GithubHelp home page GithubHelp logo

extas-jsonrpc's Introduction

tests codecov.io PHPStan Enabled Extas Installer v3 Latest Stable Version Total Downloads Dependents

Description

Extas-compatible JSON RPC server.

install operations

install jsonrpc plugin and default operation

# vendor/bin/extas i

usage out of the box

start server

# php -S 0.0.0.0:8080 -t src/public

make request

# curl -X POST localhost:8080/api/jsonrpc -d '{"id": "request id", "method":"operation.index"}'

spec generation

This package allows generating specs upon to InstallSection-plugins, extended from extas\components\plugins\intsall\InstallSection.

This package allows generating specs upon to InitSection-plugins, extended from extas\components\plugins\init\InitSection.

* - you can reset this prefix (see below).

There is extas-command for spec generation. Command is ready-to-extending, so you can add your own options, using extas-commands-options-notation. See extas.json of the current package for examples.

install command

  • # vendor/bin/extas i
  • # vendor/bin/extas list - command jsonrpc should be listed.

generate specs

# vendor/bin/extas jsonrpc --export-path generated.extas.json

This will generate extas-compatible configuration in ready-to-install format.

So you can install specs by

# vendor/bin/extas i

--export-path

Define path to store generated specs.

  • Default: CWD/specs.extas.json
  • You can pass relative and absolute path.

CWD - Current Working Directory.

--prefix-jsonrpc-install

Allow setting prefix for plugins searching by install section crawler.

  • Default: Install

--path-jsonrpc-install

Allow setting path for searching plugins by install section crawler.

  • Default: current working directory.

--prefix-jsonrpc-doc-comment

Allow setting prefix for classes searching by doc-comment crawler.

  • Default: Install

--path-jsonrpc-doc-comment

Allow setting path for searching classes by doc comment crawler.

  • Default: current working directory.

-f --filter

Allow filtering operations names.

  • Default:
  • Example: # vendor/bin/extas jsonrpc -f workflow will generate specs only for operations with workflow in a name.

-e --only-edge

Sometimes you want to make entity name shorter and use only last word of plugin name.

You can do this with the option -e:

For example, we have plugin name workflow schema.

  • Default: 0 - generate entity name workflow.schema.
  • With edging: # vendor/bin/extas jsonrpc -e 1 will produce entity name schema.

specs examples

You can find them here:

  • resources/create.spec.json
  • resources/index.spec.json
  • resources/update.spec.json
  • resources/delete.spec.json

injection into json-rpc process

Current package provide next stages to allow you to inject into the json-rpc process:

  • before.run.jsonrpc - before every json-rpc processing.
  • before.run.jsonrpc.<method.name>
  • after.run.jsonrpc.<method.name>
  • after.run.jsonrpc - after every json-rpc processing.

Generators

Package use extas-generators package for getting generators.

You should turn generators on if you want to use one.

You can find ready-to-config default generators configuration in resources/generators.json. Just copy-paste them into your extas.json.

Crawlers

Package use extas-crawlers package for getting crawlers.

You should turn crawlers on if you want to use one.

You can find ready-to-config default crawlers configuration in resources/crawlers.json. Just copy-paste them into your extas.json.

extas-jsonrpc's People

Contributors

jeyroik avatar sett avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.