├── OpenAPI-Specification ├── .gitignore ├── CONTRIBUTORS.md ├── DEVELOPMENT.md ├── GOVERNANCE.md ├── IMPLEMENTATIONS.md ├── LICENSE ├── MAINTAINERS.md ├── README.md ├── TOB.md ├── examples │ ├── v2.0 │ │ ├── json │ │ │ ├── api-with-examples.json │ │ │ ├── petstore-expanded.json │ │ │ ├── petstore-minimal.json │ │ │ ├── petstore-separate │ │ │ │ ├── common │ │ │ │ │ └── Error.json │ │ │ │ └── spec │ │ │ │ │ ├── NewPet.json │ │ │ │ │ ├── Pet.json │ │ │ │ │ ├── parameters.json │ │ │ │ │ └── swagger.json │ │ │ ├── petstore-simple.json │ │ │ ├── petstore-with-external-docs.json │ │ │ ├── petstore.json │ │ │ └── uber.json │ │ └── yaml │ │ │ ├── api-with-examples.yaml │ │ │ ├── petstore-expanded.yaml │ │ │ ├── petstore-minimal.yaml │ │ │ ├── petstore-separate │ │ │ ├── common │ │ │ │ └── Error.yaml │ │ │ └── spec │ │ │ │ ├── NewPet.yaml │ │ │ │ ├── Pet.yaml │ │ │ │ ├── parameters.yaml │ │ │ │ └── swagger.yaml │ │ │ ├── petstore-simple.yaml │ │ │ ├── petstore-with-external-docs.yaml │ │ │ ├── petstore.yaml │ │ │ └── uber.yaml │ ├── v3.0 │ │ ├── api-with-examples.json │ │ ├── api-with-examples.yaml │ │ ├── callback-example.json │ │ ├── callback-example.yaml │ │ ├── link-example.json │ │ ├── link-example.yaml │ │ ├── petstore-expanded.json │ │ ├── petstore-expanded.yaml │ │ ├── petstore.json │ │ ├── petstore.yaml │ │ ├── uspto.json │ │ └── uspto.yaml │ └── v3.1 │ │ └── webhook-example.yaml ├── guidelines │ ├── EXTENSIONS.md │ └── v2.0 │ │ ├── EXTENSIONS.md │ │ ├── README.md │ │ └── REUSE.md ├── package.json ├── proposals │ ├── 000_OAS-proposal-template.md │ ├── 001_Alternative Schema Proposal.md │ ├── 002_Webhooks.md │ ├── 003_Clarify-Nullable.md │ ├── 004_Overlays.md │ └── Alternative Schema │ │ ├── CONTRIBUTORS.md │ │ ├── DEVELOPMENT.md │ │ ├── alternative_schema_examples.md │ │ ├── alternative_schema_object.adoc │ │ ├── implementations.md │ │ └── schema_object.md ├── schemas │ ├── v1.2 │ │ ├── README.md │ │ ├── apiDeclaration.json │ │ ├── authorizationObject.json │ │ ├── dataType.json │ │ ├── dataTypeBase.json │ │ ├── infoObject.json │ │ ├── modelsObject.json │ │ ├── oauth2GrantType.json │ │ ├── operationObject.json │ │ ├── parameterObject.json │ │ ├── resourceListing.json │ │ └── resourceObject.json │ ├── v2.0 │ │ ├── README.md │ │ └── schema.json │ └── v3.0 │ │ ├── README.md │ │ ├── schema.json │ │ └── schema.yaml ├── scripts │ └── yaml2json │ │ └── yaml2json.js └── versions │ ├── 1.2.md │ ├── 2.0.md │ ├── 3.0.0.md │ ├── 3.0.1.md │ ├── 3.0.2.md │ ├── 3.0.3.md │ └── 3.1.0.md ├── README.md ├── app.js ├── arc-method ├── 5bdfd79e1ffdc48c@265.js ├── README.md ├── files │ ├── 31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052 │ ├── ethereum-rpc-methods │ └── methods.json ├── index.html ├── index.js ├── inspector.css ├── node_modules │ ├── @observablehq │ │ ├── inspector │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dist │ │ │ │ ├── inspector.css │ │ │ │ └── inspector.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ ├── array.js │ │ │ │ ├── collapsed.js │ │ │ │ ├── dispatch.js │ │ │ │ ├── expanded.js │ │ │ │ ├── formatDate.js │ │ │ │ ├── formatError.js │ │ │ │ ├── formatRegExp.js │ │ │ │ ├── formatString.js │ │ │ │ ├── formatSymbol.js │ │ │ │ ├── immutable.js │ │ │ │ ├── index.js │ │ │ │ ├── inspect.js │ │ │ │ ├── inspectFunction.js │ │ │ │ ├── inspectName.js │ │ │ │ ├── object.js │ │ │ │ └── style.css │ │ ├── runtime │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dist │ │ │ │ ├── runtime.js │ │ │ │ └── runtime.umd.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ ├── array.js │ │ │ │ ├── constant.js │ │ │ │ ├── errors.js │ │ │ │ ├── generatorish.js │ │ │ │ ├── identity.js │ │ │ │ ├── index.js │ │ │ │ ├── load.js │ │ │ │ ├── module.js │ │ │ │ ├── noop.js │ │ │ │ ├── rethrow.js │ │ │ │ ├── runtime.js │ │ │ │ └── variable.js │ │ └── stdlib │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dist │ │ │ └── stdlib.js │ │ │ ├── package.json │ │ │ └── src │ │ │ ├── constant.js │ │ │ ├── dom │ │ │ ├── canvas.js │ │ │ ├── context2d.js │ │ │ ├── download.js │ │ │ ├── element.js │ │ │ ├── index.js │ │ │ ├── input.js │ │ │ ├── range.js │ │ │ ├── select.js │ │ │ ├── svg.js │ │ │ ├── text.js │ │ │ └── uid.js │ │ │ ├── fileAttachment.js │ │ │ ├── files │ │ │ ├── buffer.js │ │ │ ├── index.js │ │ │ ├── text.js │ │ │ └── url.js │ │ │ ├── generators │ │ │ ├── disposable.js │ │ │ ├── filter.js │ │ │ ├── index.js │ │ │ ├── input.js │ │ │ ├── map.js │ │ │ ├── observe.js │ │ │ ├── queue.js │ │ │ ├── range.js │ │ │ ├── valueAt.js │ │ │ └── worker.js │ │ │ ├── html.js │ │ │ ├── index.js │ │ │ ├── library.js │ │ │ ├── md.js │ │ │ ├── mutable.js │ │ │ ├── now.js │ │ │ ├── promises │ │ │ ├── delay.js │ │ │ ├── index.js │ │ │ ├── tick.js │ │ │ └── when.js │ │ │ ├── require.js │ │ │ ├── resolve.js │ │ │ ├── svg.js │ │ │ ├── template.js │ │ │ ├── tex.js │ │ │ ├── that.js │ │ │ └── width.js │ ├── d3-require │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dist │ │ │ ├── d3-require.js │ │ │ └── d3-require.min.js │ │ ├── package.json │ │ └── src │ │ │ └── index.js │ └── esm │ │ ├── LICENSE │ │ ├── README.md │ │ ├── esm.js │ │ ├── esm │ │ └── loader.js │ │ ├── index.js │ │ └── package.json ├── package-lock.json ├── package.json └── runtime.js ├── etc.json ├── graph-method ├── BUU-index.html ├── README.md ├── a6c00de7c09bdfa1@139.js ├── files │ └── 31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052 ├── imgs │ └── method-network.png ├── index.html ├── index.js ├── inspector.css ├── node_modules │ ├── @d3 │ │ └── force-directed-graph │ │ │ ├── README.md │ │ │ ├── a6c00de7c09bdfa1@139.js │ │ │ ├── files │ │ │ └── 31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052 │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ ├── inspector.css │ │ │ ├── package.json │ │ │ └── runtime.js │ ├── @observablehq │ │ ├── inspector │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dist │ │ │ │ ├── inspector.css │ │ │ │ └── inspector.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ ├── array.js │ │ │ │ ├── collapsed.js │ │ │ │ ├── dispatch.js │ │ │ │ ├── expanded.js │ │ │ │ ├── formatDate.js │ │ │ │ ├── formatError.js │ │ │ │ ├── formatRegExp.js │ │ │ │ ├── formatString.js │ │ │ │ ├── formatSymbol.js │ │ │ │ ├── immutable.js │ │ │ │ ├── index.js │ │ │ │ ├── inspect.js │ │ │ │ ├── inspectFunction.js │ │ │ │ ├── inspectName.js │ │ │ │ ├── object.js │ │ │ │ └── style.css │ │ ├── runtime │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dist │ │ │ │ ├── runtime.js │ │ │ │ └── runtime.umd.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ ├── array.js │ │ │ │ ├── constant.js │ │ │ │ ├── errors.js │ │ │ │ ├── generatorish.js │ │ │ │ ├── identity.js │ │ │ │ ├── index.js │ │ │ │ ├── load.js │ │ │ │ ├── module.js │ │ │ │ ├── noop.js │ │ │ │ ├── rethrow.js │ │ │ │ ├── runtime.js │ │ │ │ └── variable.js │ │ └── stdlib │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dist │ │ │ └── stdlib.js │ │ │ ├── package.json │ │ │ └── src │ │ │ ├── constant.js │ │ │ ├── dom │ │ │ ├── canvas.js │ │ │ ├── context2d.js │ │ │ ├── download.js │ │ │ ├── element.js │ │ │ ├── index.js │ │ │ ├── input.js │ │ │ ├── range.js │ │ │ ├── select.js │ │ │ ├── svg.js │ │ │ ├── text.js │ │ │ └── uid.js │ │ │ ├── fileAttachment.js │ │ │ ├── files │ │ │ ├── buffer.js │ │ │ ├── index.js │ │ │ ├── text.js │ │ │ └── url.js │ │ │ ├── generators │ │ │ ├── disposable.js │ │ │ ├── filter.js │ │ │ ├── index.js │ │ │ ├── input.js │ │ │ ├── map.js │ │ │ ├── observe.js │ │ │ ├── queue.js │ │ │ ├── range.js │ │ │ ├── valueAt.js │ │ │ └── worker.js │ │ │ ├── html.js │ │ │ ├── index.js │ │ │ ├── library.js │ │ │ ├── md.js │ │ │ ├── mutable.js │ │ │ ├── now.js │ │ │ ├── promises │ │ │ ├── delay.js │ │ │ ├── index.js │ │ │ ├── tick.js │ │ │ └── when.js │ │ │ ├── require.js │ │ │ ├── resolve.js │ │ │ ├── svg.js │ │ │ ├── template.js │ │ │ ├── tex.js │ │ │ ├── that.js │ │ │ └── width.js │ ├── d3-require │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dist │ │ │ ├── d3-require.js │ │ │ └── d3-require.min.js │ │ ├── package.json │ │ └── src │ │ │ └── index.js │ └── esm │ │ ├── LICENSE │ │ ├── README.md │ │ ├── esm.js │ │ ├── esm │ │ └── loader.js │ │ ├── index.js │ │ └── package.json ├── package-lock.json ├── package.json └── runtime.js ├── img ├── arc.jpg ├── graph.jpg └── openapi.jpg ├── praxis-openapi-editor ├── .agignore ├── .babelrc ├── .dockerignore ├── .editorconfig ├── .eslintrc ├── .gitignore ├── .npmignore ├── .npmrc ├── .prettierrc.yaml ├── Dockerfile ├── LICENSE ├── README.md ├── SECURITY.md ├── build-tools │ ├── deploy-docker-hub-tag.sh │ └── loadersByExtension.js ├── cypress.json ├── dev-helpers │ └── index.html ├── dist │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── swagger-editor-bundle.js │ ├── swagger-editor-bundle.js.map │ ├── swagger-editor-standalone-preset.js │ ├── swagger-editor-standalone-preset.js.map │ ├── swagger-editor.css │ ├── swagger-editor.css.map │ ├── swagger-editor.js │ └── swagger-editor.js.map ├── docker-run.sh ├── docs │ ├── drag-and-drop.gif │ ├── helpers.md │ └── import.md ├── index.html ├── nginx.conf ├── package-lock.json ├── package.json ├── praxis-api.json ├── release │ ├── .release-it.json │ ├── check-for-breaking-changes.sh │ └── get-changelog.sh ├── src │ ├── .eslintrc │ ├── index.js │ ├── layout.jsx │ ├── plugins │ │ ├── ast │ │ │ ├── ast.js │ │ │ └── index.js │ │ ├── editor-autosuggest-keywords │ │ │ ├── get-completions.js │ │ │ ├── get-keywords-for-path.js │ │ │ ├── index.js │ │ │ ├── keyword-map.js │ │ │ └── wrap-actions.js │ │ ├── editor-autosuggest-oas3-keywords │ │ │ ├── get-completions.js │ │ │ ├── get-keywords-for-path.js │ │ │ ├── index.js │ │ │ ├── keyword-map.js │ │ │ ├── oas3-objects.js │ │ │ └── wrap-actions.js │ │ ├── editor-autosuggest-refs │ │ │ ├── get-completions.js │ │ │ ├── get-refs-for-path.js │ │ │ ├── index.js │ │ │ └── wrap-actions.js │ │ ├── editor-autosuggest-snippets │ │ │ ├── get-completions.js │ │ │ ├── get-snippets-for-path.js │ │ │ ├── index.js │ │ │ ├── snippets.js │ │ │ └── wrap-actions.js │ │ ├── editor-autosuggest │ │ │ ├── actions.js │ │ │ ├── fn.js │ │ │ ├── helpers.js │ │ │ ├── index.js │ │ │ └── spec-selectors.js │ │ ├── editor-metadata │ │ │ └── index.js │ │ ├── editor │ │ │ ├── actions.js │ │ │ ├── components │ │ │ │ ├── brace-snippets-yaml.js │ │ │ │ ├── editor-container.jsx │ │ │ │ └── editor.jsx │ │ │ ├── editor-helpers │ │ │ │ └── marker-placer.js │ │ │ ├── editor-plugins │ │ │ │ ├── gutter-click.js │ │ │ │ ├── hook.js │ │ │ │ ├── json-to-yaml.js │ │ │ │ └── tab-handler.js │ │ │ ├── index.js │ │ │ ├── reducers.js │ │ │ ├── selectors.js │ │ │ └── spec.js │ │ ├── json-schema-validator │ │ │ ├── SCHEMA_CONSTRUCTS.md │ │ │ ├── index.js │ │ │ ├── oas3-schema.yaml │ │ │ ├── swagger2-schema.yaml │ │ │ ├── validator.worker.js │ │ │ └── validator │ │ │ │ ├── condense-errors.js │ │ │ │ ├── index.js │ │ │ │ ├── jsonSchema.js │ │ │ │ ├── path-translator.js │ │ │ │ └── shared.js │ │ ├── jump-to-path │ │ │ ├── components.jsx │ │ │ ├── index.js │ │ │ ├── jump-icon.svg │ │ │ └── spec.js │ │ ├── local-storage │ │ │ ├── index.js │ │ │ └── petstore.js │ │ ├── performance │ │ │ └── index.js │ │ ├── refs-util.js │ │ ├── split-pane-mode │ │ │ ├── components │ │ │ │ └── split-pane-mode.jsx │ │ │ └── index.js │ │ ├── validate-base │ │ │ └── index.js │ │ └── validate-semantic │ │ │ ├── README.md │ │ │ ├── actions.js │ │ │ ├── helpers.js │ │ │ ├── index.js │ │ │ ├── selectors.js │ │ │ └── validators │ │ │ ├── 2and3 │ │ │ ├── operations.js │ │ │ ├── parameters.js │ │ │ ├── paths.js │ │ │ ├── refs.js │ │ │ ├── schemas.js │ │ │ ├── security.js │ │ │ └── tags.js │ │ │ ├── form-data.js │ │ │ ├── helpers.js │ │ │ ├── oas3 │ │ │ ├── components.js │ │ │ ├── operations.js │ │ │ ├── parameters.js │ │ │ └── refs.js │ │ │ ├── parameters.js │ │ │ ├── paths.js │ │ │ ├── schema.js │ │ │ └── security.js │ ├── polyfills.js │ ├── standalone │ │ ├── README.md │ │ ├── index.js │ │ ├── standalone-layout.js │ │ ├── styles │ │ │ ├── main.less │ │ │ ├── topbar-insert-forms.less │ │ │ ├── topbar-modal.less │ │ │ └── topbar.less │ │ ├── topbar-insert │ │ │ ├── dropdown │ │ │ │ ├── Dropdown.jsx │ │ │ │ └── DropdownItem.jsx │ │ │ ├── forms │ │ │ │ ├── components │ │ │ │ │ ├── AddForm.jsx │ │ │ │ │ ├── FormChild.jsx │ │ │ │ │ ├── FormDropdown.jsx │ │ │ │ │ ├── FormInput.jsx │ │ │ │ │ ├── FormInputWrapper.jsx │ │ │ │ │ ├── FormMap.jsx │ │ │ │ │ ├── InsertForm.jsx │ │ │ │ │ ├── InsertFormInput.jsx │ │ │ │ │ └── InsertFormList.jsx │ │ │ │ ├── form-data-readme.md │ │ │ │ ├── form-objects │ │ │ │ │ ├── add-operation-tags.js │ │ │ │ │ ├── contact-object.js │ │ │ │ │ ├── example-value-object.js │ │ │ │ │ ├── external-documentation-object.js │ │ │ │ │ ├── info-object.js │ │ │ │ │ ├── license-object.js │ │ │ │ │ ├── operation-object.js │ │ │ │ │ ├── path-object.js │ │ │ │ │ ├── select-operation.js │ │ │ │ │ ├── select-response.js │ │ │ │ │ ├── server-variable-object.js │ │ │ │ │ ├── servers-object.js │ │ │ │ │ ├── tag-object.js │ │ │ │ │ └── tags-object.js │ │ │ │ └── helpers │ │ │ │ │ ├── form-data-helpers.js │ │ │ │ │ └── validation-helpers.js │ │ │ ├── index.js │ │ │ ├── modal │ │ │ │ └── Modal.jsx │ │ │ └── topbar-insert.jsx │ │ ├── topbar-menu-edit-convert │ │ │ ├── components │ │ │ │ ├── convert-definition-menu-item.jsx │ │ │ │ └── convert-modal.jsx │ │ │ └── index.js │ │ ├── topbar-menu-file-import_file │ │ │ ├── components │ │ │ │ └── ImportFileMenuItem.jsx │ │ │ └── index.js │ │ └── topbar │ │ │ ├── DropdownMenu.js │ │ │ ├── index.js │ │ │ ├── logo_small.svg │ │ │ └── topbar.jsx │ ├── style.css │ ├── styles │ │ ├── _editor.less │ │ ├── _read-only-watermark.less │ │ └── main.less │ └── window.js ├── swagger-editor-dist-package │ ├── .npmignore │ ├── .npmrc │ ├── README.md │ ├── deploy.sh │ └── package.json ├── test │ ├── .eslintrc │ ├── e2e │ │ ├── .eslintrc │ │ ├── fixtures │ │ │ └── example.json │ │ ├── plugins │ │ │ └── index.js │ │ ├── static │ │ │ ├── documents │ │ │ │ ├── petstore.openapi.yaml │ │ │ │ └── petstore.swagger.yaml │ │ │ └── index.html │ │ ├── support │ │ │ ├── commands.js │ │ │ └── index.js │ │ └── tests │ │ │ └── bugs │ │ │ └── 1862.js │ └── unit │ │ ├── layout.js │ │ ├── mocks │ │ └── ace.js │ │ ├── path-translator.js │ │ ├── plugins │ │ ├── ast │ │ │ └── ast-manager.js │ │ ├── editor-autosuggest │ │ │ └── fn.js │ │ ├── editor-metadata │ │ │ └── index.js │ │ ├── editor │ │ │ ├── editor.js │ │ │ └── spec.js │ │ ├── json-schema-validator │ │ │ ├── index.js │ │ │ └── test-documents │ │ │ │ ├── 1394.yaml │ │ │ │ ├── 1480.yaml │ │ │ │ ├── 1489.yaml │ │ │ │ ├── 1511.yaml │ │ │ │ ├── 1519.yaml │ │ │ │ ├── 1672.yaml │ │ │ │ ├── 1709.yaml │ │ │ │ ├── 1711.yaml │ │ │ │ ├── 1797.yaml │ │ │ │ ├── 1808.yaml │ │ │ │ ├── 1832.yaml │ │ │ │ ├── 1853.yaml │ │ │ │ ├── 2.0-schema-additional-properties.yaml │ │ │ │ ├── 3.0.0-schema-additional-properties.yaml │ │ │ │ ├── parameter-exclusive-schema-content.yaml │ │ │ │ ├── response-schema-restrictions.yaml │ │ │ │ ├── security-scheme-http-bearerFormat.yaml │ │ │ │ └── tag-object-uniqueness.yaml │ │ ├── selectors.js │ │ └── validate-semantic │ │ │ ├── 2and3 │ │ │ ├── operations.js │ │ │ ├── parameters.js │ │ │ ├── paths.js │ │ │ ├── refs.js │ │ │ ├── schemas.js │ │ │ ├── security.js │ │ │ └── tags.js │ │ │ ├── bugs │ │ │ └── 1817.js │ │ │ ├── form-data.js │ │ │ ├── oas3 │ │ │ ├── components.js │ │ │ ├── operations.js │ │ │ ├── parameters.js │ │ │ └── refs.js │ │ │ ├── parameters.js │ │ │ ├── paths.js │ │ │ ├── refs.js │ │ │ ├── schema.js │ │ │ ├── security.js │ │ │ └── validate-helper.js │ │ ├── setup.js │ │ └── standalone │ │ └── topbar-insert │ │ ├── form-data-helpers.js │ │ ├── form-objects.js │ │ ├── form-validation.js │ │ └── index.js └── webpack │ ├── _RemoveSourcemapsLackingMatchingAssetsPlugin.babel.js │ ├── _config-builder.js │ ├── _helpers.js │ ├── bundle.babel.js │ ├── core.babel.js │ ├── dev.babel.js │ ├── standalone.babel.js │ ├── stylesheets.babel.js │ └── test_deps_size.babel.js └── web3.js ├── .editorconfig ├── .gitignore ├── .jshintignore ├── .jshintrc ├── .npmignore ├── CHANGELOG.md ├── CONTRIBUTIONS.md ├── LICENSE ├── README.md ├── RELEASE.md ├── REVIEW.md ├── TESTING.md ├── assets └── logo │ ├── web3js.ai │ ├── web3js.jpg │ └── web3js.svg ├── docs ├── Makefile ├── callbacks-promises-events.rst ├── conf.py ├── getting-started.rst ├── glossary.rst ├── include_package-core.rst ├── include_package-net.rst ├── index.rst ├── make.bat ├── web3-bzz.rst ├── web3-eth-abi.rst ├── web3-eth-accounts.rst ├── web3-eth-contract.rst ├── web3-eth-ens.rst ├── web3-eth-iban.rst ├── web3-eth-net.rst ├── web3-eth-personal.rst ├── web3-eth-subscribe.rst ├── web3-eth.rst ├── web3-net.rst ├── web3-shh.rst ├── web3-utils.rst └── web3.rst ├── gulpfile.js ├── karma.conf.js ├── lerna.json ├── package-lock.json ├── package.json ├── packages ├── web3-bzz │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── bzz-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-core-helpers │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── errors.js │ │ ├── formatters.js │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ ├── errors-test.ts │ │ └── formatters-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-core-method │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-core-promievent │ ├── README.md │ ├── package-lock.json │ ├── package.json │ └── src │ │ └── index.js ├── web3-core-requestmanager │ ├── README.md │ ├── package-lock.json │ ├── package.json │ └── src │ │ ├── batch.js │ │ ├── givenProvider.js │ │ ├── index.js │ │ └── jsonrpc.js ├── web3-core-subscriptions │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.js │ │ └── subscription.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── subscriptions.tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-core │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── extend.js │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-eth-abi │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── abi-coder-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-eth-accounts │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── accounts-tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-eth-contract │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── contract-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-eth-ens │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── ENS.js │ │ ├── config.js │ │ ├── index.js │ │ ├── lib │ │ │ ├── ResolverMethodHandler.js │ │ │ └── contentHash.js │ │ └── resources │ │ │ └── ABI │ │ │ ├── Registry.js │ │ │ └── Resolver.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── ens-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-eth-iban │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── iban-tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-eth-personal │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── personal-tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-eth │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── getNetworkType.js │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── eth.tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-net │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── network-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-providers-http │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── web3-provider-http-tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-providers-ipc │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── web3-provider-ipc-tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-providers-ws │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── helpers.js │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── web3-provider-ws-tests.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-shh │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ └── index.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ └── shh-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json ├── web3-utils │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── index.js │ │ ├── soliditySha3.js │ │ └── utils.js │ └── types │ │ ├── index.d.ts │ │ ├── tests │ │ ├── ascii-to-hex-test.ts │ │ ├── bytes-to-hex-test.ts │ │ ├── check-address-checksum-test.ts │ │ ├── from-ascii-test.ts │ │ ├── from-decimal-test.ts │ │ ├── from-utf8-test.ts │ │ ├── from-wei-test.ts │ │ ├── get-signature-params-test.ts │ │ ├── get-unit-value-test.ts │ │ ├── hex-to-ascii-test.ts │ │ ├── hex-to-bytes-test.ts │ │ ├── hex-to-number-string-test.ts │ │ ├── hex-to-number-test.ts │ │ ├── hex-to-string-test.ts │ │ ├── hex-to-utf8-test.ts │ │ ├── is-address-test.ts │ │ ├── is-big-number-test.ts │ │ ├── is-bloom-test.ts │ │ ├── is-bn-test.ts │ │ ├── is-contract-address-in-bloom.ts │ │ ├── is-hex-strict-test.ts │ │ ├── is-hex-test.ts │ │ ├── is-in-bloom.ts │ │ ├── is-topic-in-bloom.ts │ │ ├── is-topic-test.ts │ │ ├── is-topic.ts │ │ ├── is-user-ethereum-address-in-bloom.ts │ │ ├── json-interface-method-to-string-test.ts │ │ ├── keccak256-test.ts │ │ ├── left-pad-test.ts │ │ ├── number-to-hex-test.ts │ │ ├── pad-left-test.ts │ │ ├── pad-right-test.ts │ │ ├── random-hex-test.ts │ │ ├── right-pad-test.ts │ │ ├── sha3-raw-test.ts │ │ ├── sha3-test.ts │ │ ├── solidity-sha3-raw-test.ts │ │ ├── solidity-sha3-test.ts │ │ ├── string-to-hex-test.ts │ │ ├── strip-hex-prefix-test.ts │ │ ├── test-address-test.ts │ │ ├── test-topic-test.ts │ │ ├── to-ascii-test.ts │ │ ├── to-bn-test.ts │ │ ├── to-check-sum-address-test.ts │ │ ├── to-decimal-test.ts │ │ ├── to-hex-test.ts │ │ ├── to-twos-compement-test.ts │ │ ├── to-utf8-test.ts │ │ ├── to-wei-test.ts │ │ ├── unit-map-test.ts │ │ └── utf8-to-hex-test.ts │ │ ├── tsconfig.json │ │ └── tslint.json └── web3 │ ├── README.md │ ├── angular-patch.js │ ├── package-lock.json │ ├── package.json │ ├── src │ └── index.js │ └── types │ ├── index.d.ts │ ├── tests │ └── web3-test.ts │ ├── tsconfig.json │ └── tslint.json ├── scripts ├── ci.sh ├── e2e.cdn.sh ├── e2e.chrome.sh ├── e2e.firefox.sh ├── e2e.ganache.core.sh ├── e2e.ganache.sh ├── e2e.geth.automine.sh ├── e2e.geth.instamine.sh ├── e2e.gnosis.dex.sh ├── e2e.min.sh ├── e2e.mosaic.sh ├── e2e.npm.publish.sh ├── e2e.windows.sh ├── html │ └── index.html ├── install.sh └── js │ ├── basic_usage.js │ ├── ens.js │ └── resolutions.js ├── test ├── 1_givenProvider-ethereumProvider.js ├── 2_givenProvider-currentProvider.js ├── 3_givenProvider-ganache.js ├── abi.decodeParam-ethjs.js_ ├── abi.decodeParameter.js ├── abi.encodeParam-ethjs.js_ ├── abi.encodeParameter.js ├── async.js ├── batch.js ├── contract.encodeABI.js ├── contract.errors.js ├── contract.js ├── e2e.contract.deploy.js ├── e2e.contract.events.js ├── e2e.ens.js ├── e2e.method.call.js ├── e2e.method.send.js ├── e2e.method.signing.js ├── e2e.minified.js ├── errors.js ├── eth.Iban.js ├── eth.abi.decodeLog.js ├── eth.abi.decodeParameter.js ├── eth.abi.decodeParameters.js ├── eth.abi.encodeEventSignature.js ├── eth.abi.encodeFunctionCall.js ├── eth.abi.encodeFunctionSignature.js ├── eth.abi.encodeParameter.js ├── eth.abi.encodeParameters.js ├── eth.accounts.create.js ├── eth.accounts.encrypt-decrypt.js ├── eth.accounts.sign.js ├── eth.accounts.signTransaction.js ├── eth.accounts.wallet.js ├── eth.call.js ├── eth.defaultAccount.js ├── eth.defaultBlock.js ├── eth.ens.js ├── eth.estimateGas.js ├── eth.gasPrice.js ├── eth.getAccounts.js ├── eth.getBalance.js ├── eth.getBlock.js ├── eth.getBlockNumber.js ├── eth.getBlockTransactionCount.js ├── eth.getBlockUncleCount.js ├── eth.getChainId.js ├── eth.getCode.js ├── eth.getCoinbase.js ├── eth.getHashRate.js ├── eth.getNodeVersion.js ├── eth.getPendingTransactions.js ├── eth.getProof.js ├── eth.getStorageAt.js ├── eth.getTransaction.js ├── eth.getTransactionFromBlock.js ├── eth.getTransactionReceipt.js ├── eth.getUncle.js ├── eth.getWork.js ├── eth.handleRevert.js ├── eth.isMining.js ├── eth.maxListenersWarningThreshold.js ├── eth.net.getNetworkType.js ├── eth.net.getPeerCount.js ├── eth.net.isListening.js ├── eth.net_methods.js ├── eth.protocolVersion.js ├── eth.requestAccounts.js ├── eth.sendTransaction.js ├── eth.sendTransaction.revert.js ├── eth.sign.js ├── eth.submitWork.js ├── eth.subscribe.ganache.js ├── eth.subscribe.js ├── eth.transactionBlockTimeout.js ├── eth.transactionConfirmationBlocks.js ├── eth.transactionPollingTimeout.js ├── eth_methods.js ├── event.decode.js ├── event.encode.js ├── extend.js ├── formatters.inputAddressFormatter.js ├── formatters.inputDefaultBlockFormatter.js ├── formatters.inputLogFormatter.js ├── formatters.inputPostFormatter.js ├── formatters.inputTransactionFormatter.js ├── formatters.outputBlockFormatter.js ├── formatters.outputLogFormatter.js ├── formatters.outputPostFormatter.js ├── formatters.outputTransactionFormatter.js ├── formatters.outputTransactionReceiptFormatter.js ├── helpers │ ├── FakeHttpProvider.js │ ├── FakeIpcProvider.js │ ├── FakeIpcProvider2.js │ ├── FakeIpcRequest.js │ ├── FakeXHR2.js │ ├── test.method.js │ ├── test.subscription.js │ └── test.utils.js ├── httpprovider.js ├── iban.createIndirect.js ├── iban.fromAddress.js ├── iban.isValid.js ├── iban.toAddress.js ├── iban.toIban.js ├── ipcprovider.js ├── jsonrpc.id.js ├── jsonrpc.isValidResponse.js ├── jsonrpc.toBatchPayload.js ├── jsonrpc.toPayload.js ├── method.buildCall.js ├── method.extractCallback.js ├── method.formatInput.js ├── method.formatOutput.js ├── method.getCall.js ├── method.validateArgs.js ├── mocha.opts ├── personal.getAccounts.js ├── personal.lockAccount.js ├── personal.newAccount.js ├── personal.sendTransaction.js ├── personal.unlockAccount.js ├── personal_methods.js ├── provider.js ├── requestmanager.js ├── setProvider.js ├── shh.post.js ├── shh.subscribe.js ├── shh_methods.js ├── sources │ ├── Basic.json │ ├── Basic.sol │ ├── Child.json │ ├── Misc.json │ ├── Misc.sol │ ├── Parent.json │ ├── ParentAndChild.sol │ ├── Reverts.json │ └── Reverts.sol ├── utils.fromAscii.js ├── utils.fromNumber.js ├── utils.fromWei.js ├── utils.isAddress.js ├── utils.isBN.js ├── utils.isChecksumAddress.js ├── utils.randomHex.js ├── utils.sha3.js ├── utils.sha3Raw.js ├── utils.soliditySha3.js ├── utils.soliditySha3Raw.js ├── utils.toAscii.js ├── utils.toBigNumber.js ├── utils.toHex.js ├── utils.toNumber.js ├── utils.toNumberString.js ├── utils.toTwosComplement.js ├── utils.toUtf8.js ├── utils.toWei.js ├── utils.utf8ToHex.js ├── utils_methods.js ├── web3_methods.js └── websocket.ganache.js └── verdaccio.yml /OpenAPI-Specification/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | *.ipr 4 | *.iws 5 | target 6 | atlassian-ide-plugin.xml 7 | node_modules/ 8 | package-lock.json 9 | Gemfile.lock 10 | -------------------------------------------------------------------------------- /OpenAPI-Specification/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | * Darrel Miller [@darrelmiller](https://github.com/darrelmiller) 2 | * Jason Harmon [@jharmn](https://github.com/jharmn) 3 | * Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) 4 | * Kris Hahn [@KrisHahn](https://github.com/krishahn) 5 | * Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) 6 | * Mike Ralphson [@MikeRalphson](https://github.com/mikeralphson) 7 | * Rob Dolin [@RobDolinMS](https://github.com/robdolinms) 8 | * Ron Ratovsky [@webron](https://github.com/webron) 9 | * Tony Tam [@fehguy](https://github.com/fehguy) 10 | -------------------------------------------------------------------------------- /OpenAPI-Specification/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | ## Active 2 | * Darrel Miller [@darrelmiller](https://github.com/darrelmiller) 3 | * Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc) 4 | * Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh) 5 | * Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson) 6 | * Ron Ratovsky [@webron](https://github.com/webron) 7 | * Uri Sarid [@usarid](https://github.com/usarid) 8 | 9 | ## Emeritus 10 | * Jason Harmon [@jharmn](https://github.com/jharmn) 11 | * Tony Tam [@fehguy](https://github.com/fehguy) 12 | -------------------------------------------------------------------------------- /OpenAPI-Specification/TOB.md: -------------------------------------------------------------------------------- 1 | # Technical Oversight Board ("TOB") 2 | 3 | ## Description: 4 | > The TOB is responsible for managing conflicts, violations of procedures or guidelines or other issues that cannot be resolved in the TSC for the OAS. For further details please consult the OpenAPI Project Charter. 5 | 6 | ## TSC Elected - terms through May 2021 7 | Isabelle Mauny @isamauny 8 | 9 | Uri Sarid @usarid 10 | 11 | Marsh Gardiner @earth2marsh 12 | 13 | Ron Ratovsky @webron 14 | 15 | ## BGB Elected - terms through May 2020 16 | 17 | Darrel Miller @darrelmiller 18 | 19 | Jerome Louvel @jlouvel 20 | 21 | Jeremy Whitlock @whitlockjc 22 | -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/json/petstore-separate/common/Error.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "required": [ 4 | "code", 5 | "message" 6 | ], 7 | "properties": { 8 | "code": { 9 | "type": "integer", 10 | "format": "int32" 11 | }, 12 | "message": { 13 | "type": "string" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/json/petstore-separate/spec/NewPet.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "allOf": [ 4 | { 5 | "$ref": "Pet.json" 6 | }, 7 | { 8 | "required": [ 9 | "name" 10 | ], 11 | "properties": { 12 | "description": { 13 | "type": "integer", 14 | "format": "int64" 15 | } 16 | } 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/json/petstore-separate/spec/Pet.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "required": [ 4 | "id", 5 | "name" 6 | ], 7 | "properties": { 8 | "id": { 9 | "type": "integer", 10 | "format": "int64" 11 | }, 12 | "name": { 13 | "type": "string" 14 | }, 15 | "tag": { 16 | "type": "string" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/json/petstore-separate/spec/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "tagsParam": { 3 | "name": "tags", 4 | "in": "query", 5 | "description": "tags to filter by", 6 | "required": false, 7 | "type": "array", 8 | "collectionFormat": "csv", 9 | "items": { 10 | "type": "string" 11 | } 12 | }, 13 | "limitsParam": { 14 | "name": "limit", 15 | "in": "query", 16 | "description": "maximum number of results to return", 17 | "required": false, 18 | "type": "integer", 19 | "format": "int32" 20 | } 21 | } -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/yaml/petstore-separate/common/Error.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - code 4 | - message 5 | properties: 6 | code: 7 | type: integer 8 | format: int32 9 | message: 10 | type: string 11 | -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/yaml/petstore-separate/spec/NewPet.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | allOf: 3 | - $ref: 'Pet.yaml' 4 | - required: 5 | - name 6 | properties: 7 | description: 8 | type: integer 9 | format: int64 10 | -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/yaml/petstore-separate/spec/Pet.yaml: -------------------------------------------------------------------------------- 1 | type: object 2 | required: 3 | - id 4 | - name 5 | properties: 6 | id: 7 | type: integer 8 | format: int64 9 | name: 10 | type: string 11 | tag: 12 | type: string 13 | -------------------------------------------------------------------------------- /OpenAPI-Specification/examples/v2.0/yaml/petstore-separate/spec/parameters.yaml: -------------------------------------------------------------------------------- 1 | tagsParam: 2 | name: tags 3 | in: query 4 | description: tags to filter by 5 | required: false 6 | type: array 7 | collectionFormat: csv 8 | items: 9 | type: string 10 | limitsParam: 11 | name: limit 12 | in: query 13 | description: maximum number of results to return 14 | required: false 15 | type: integer 16 | format: int32 17 | -------------------------------------------------------------------------------- /OpenAPI-Specification/guidelines/EXTENSIONS.md: -------------------------------------------------------------------------------- 1 | For OpenAPI Specification version 2.0, please see [v2.0/EXTENSIONS.md](v2.0/EXTENSIONS.md) 2 | -------------------------------------------------------------------------------- /OpenAPI-Specification/guidelines/v2.0/README.md: -------------------------------------------------------------------------------- 1 | ## Guidelines for OpenAPI Definitions 2 | 3 | * [Reuse](REUSE.md) of OpenAPI definitions 4 | * [Extending](EXTENSIONS.md) OpenAPI definitions with custom metadata 5 | -------------------------------------------------------------------------------- /OpenAPI-Specification/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oas-schemas", 3 | "version": "2.0.0", 4 | "description": "OpenAPI Specification JSON schemas", 5 | "author": { 6 | "name": "OpenAPI Initiative TSC", 7 | "email": "tsc@openapis.org", 8 | "url": "https://openapis.org/" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/OAI/OpenAPI-Specification.git" 13 | }, 14 | "license": "Apache-2.0", 15 | "readmeFilename": "README.md", 16 | "files": [ 17 | "README.md", 18 | "schemas/*" 19 | ], 20 | "dependencies": {}, 21 | "devDependencies": { 22 | "mdv": "^1.0.7", 23 | "yaml": "^1.8.3" 24 | }, 25 | "keywords": [ 26 | "OpenAPI", 27 | "OAS", 28 | "Swagger", 29 | "schema", 30 | "API" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /OpenAPI-Specification/proposals/Alternative Schema/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | * Chuck Heazel [@cmheazel](https://github.com/cmheazel) 2 | * Darrel Miller [@darrelmiller](https://github.com/darrelmiller) -------------------------------------------------------------------------------- /OpenAPI-Specification/proposals/Alternative Schema/DEVELOPMENT.md: -------------------------------------------------------------------------------- 1 | ## Development Guidelines 2 | 3 | TBD 4 | 5 | ## Specification Driving factors 6 | 7 | TBD 8 | 9 | ## Specification Change Criteria 10 | 11 | TBD 12 | 13 | ## Specification Change Process 14 | 15 | TBD 16 | 17 | ## Tracking Process 18 | 19 | * GitHub is the medium of record for all spec designs, use cases, and so on. 20 | 21 | 22 | ## Release Process 23 | 24 | TBD 25 | 26 | ## Draft Features 27 | 28 | 29 | ## Transparency 30 | 31 | 32 | 33 | ## Participation 34 | 35 | 36 | 37 | ## Community Roles 38 | 39 | -------------------------------------------------------------------------------- /OpenAPI-Specification/schemas/v1.2/README.md: -------------------------------------------------------------------------------- 1 | # Swagger Specification JSON Schemas 2 | 3 | The work on the JSON Schema for the Swagger Specification was donated to the community by [Francis Galiegue](https://github.com/fge)! 4 | 5 | Keep in mind that due to some JSON Schema limitations, not all constraints can be described. The missing constraints will be listed here in the future. 6 | -------------------------------------------------------------------------------- /OpenAPI-Specification/schemas/v1.2/infoObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/infoObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "description": "info object (section 5.1.3)", 5 | "type": "object", 6 | "required": [ "title", "description" ], 7 | "properties": { 8 | "title": { "type": "string" }, 9 | "description": { "type": "string" }, 10 | "termsOfServiceUrl": { "type": "string", "format": "uri" }, 11 | "contact": { "type": "string", "format": "email" }, 12 | "license": { "type": "string" }, 13 | "licenseUrl": { "type": "string", "format": "uri" } 14 | }, 15 | "additionalProperties": false 16 | } -------------------------------------------------------------------------------- /OpenAPI-Specification/schemas/v1.2/resourceListing.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/resourceListing.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "required": [ "swaggerVersion", "apis" ], 6 | "properties": { 7 | "swaggerVersion": { "enum": [ "1.2" ] }, 8 | "apis": { 9 | "type": "array", 10 | "items": { "$ref": "resourceObject.json#" } 11 | }, 12 | "apiVersion": { "type": "string" }, 13 | "info": { "$ref": "infoObject.json#" }, 14 | "authorizations": { "$ref": "authorizationObject.json#" } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /OpenAPI-Specification/schemas/v1.2/resourceObject.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/resourceObject.json#", 3 | "$schema": "http://json-schema.org/draft-04/schema#", 4 | "type": "object", 5 | "required": [ "path" ], 6 | "properties": { 7 | "path": { "type": "string", "format": "uri" }, 8 | "description": { "type": "string" } 9 | }, 10 | "additionalProperties": false 11 | } -------------------------------------------------------------------------------- /OpenAPI-Specification/schemas/v2.0/README.md: -------------------------------------------------------------------------------- 1 | # OpenAPI Specification v2.0 JSON Schema 2 | 3 | This is the JSON Schema file for the OpenAPI Specification version 2.0. Download and install it via NPM. 4 | 5 | ## Install via NPM 6 | 7 | ```shell 8 | npm install --save swagger-schema-official 9 | ``` 10 | 11 | ## License 12 | 13 | Apache-2.0 14 | -------------------------------------------------------------------------------- /OpenAPI-Specification/schemas/v3.0/README.md: -------------------------------------------------------------------------------- 1 | OpenAPI 3.0.X JSON Schema 2 | --- 3 | 4 | Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.X. 5 | 6 | As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins. Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance. 7 | 8 | The iteration version of the JSON Schema can be found in the `id` field. For example, the value of `id: https://spec.openapis.org/oas/3.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019. 9 | 10 | To submit improvements to the schema, modify the schema.yaml file only. 11 | 12 | The TSC will then: 13 | - Run tests on the updated schema 14 | - Update the iteration version 15 | - Convert the schema.yaml to schema.json 16 | - Publish the new version 17 | -------------------------------------------------------------------------------- /OpenAPI-Specification/scripts/yaml2json/yaml2json.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | const fs = require('fs'); 6 | const yaml = require('yaml'); 7 | 8 | function convert(filename) { 9 | console.log(filename); 10 | const s = fs.readFileSync(filename,'utf8'); 11 | let obj; 12 | try { 13 | obj = yaml.parse(s, {prettyErrors: true}); 14 | fs.writeFileSync(filename.replace('.yaml','.json'),JSON.stringify(obj,null,2),'utf8'); 15 | } 16 | catch (ex) { 17 | console.warn(' ',ex.message); 18 | process.exitCode = 1; 19 | } 20 | } 21 | 22 | if (process.argv.length<3) { 23 | console.warn('Usage: yaml2json {infiles}'); 24 | } 25 | else { 26 | for (let i=2;i console.log(value)); 33 | ~~~ 34 | -------------------------------------------------------------------------------- /arc-method/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | API Method Arc Diagram 4 | 5 | 6 | 17 | -------------------------------------------------------------------------------- /arc-method/index.js: -------------------------------------------------------------------------------- 1 | export {default} from "./5bdfd79e1ffdc48c@265.js"; 2 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/src/array.js: -------------------------------------------------------------------------------- 1 | // TODO https://twitter.com/mbostock/status/702737065121742848 2 | export function isarray(value) { 3 | return Array.isArray(value) 4 | || value instanceof Int8Array 5 | || value instanceof Int16Array 6 | || value instanceof Int32Array 7 | || value instanceof Uint8Array 8 | || value instanceof Uint8ClampedArray 9 | || value instanceof Uint16Array 10 | || value instanceof Uint32Array 11 | || value instanceof Float32Array 12 | || value instanceof Float64Array; 13 | } 14 | 15 | // Non-integer keys in arrays, e.g. [1, 2, 0.5: "value"]. 16 | export function isindex(key) { 17 | return key === (key | 0) + ""; 18 | } 19 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/src/dispatch.js: -------------------------------------------------------------------------------- 1 | export default function dispatch(node, type, detail) { 2 | detail = detail || {}; 3 | var document = node.ownerDocument, event = document.defaultView.CustomEvent; 4 | if (typeof event === "function") { 5 | event = new event(type, {detail: detail}); 6 | } else { 7 | event = document.createEvent("Event"); 8 | event.initEvent(type, false, false); 9 | event.detail = detail; 10 | } 11 | node.dispatchEvent(event); 12 | } 13 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/src/formatError.js: -------------------------------------------------------------------------------- 1 | var errorToString = Error.prototype.toString; 2 | 3 | export default function formatError(value) { 4 | return value.stack || errorToString.call(value); 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/src/formatRegExp.js: -------------------------------------------------------------------------------- 1 | var regExpToString = RegExp.prototype.toString; 2 | 3 | export default function formatRegExp(value) { 4 | return regExpToString.call(value); 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/src/formatSymbol.js: -------------------------------------------------------------------------------- 1 | const symbolToString = Symbol.prototype.toString; 2 | 3 | // Symbols do not coerce to strings; they must be explicitly converted. 4 | export default function formatSymbol(symbol) { 5 | return symbolToString.call(symbol); 6 | } 7 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/src/inspectName.js: -------------------------------------------------------------------------------- 1 | export default function inspectName(name) { 2 | const n = document.createElement("span"); 3 | n.className = "observablehq--cellname"; 4 | n.textContent = `${name} = `; 5 | return n; 6 | } 7 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/inspector/src/object.js: -------------------------------------------------------------------------------- 1 | const {getOwnPropertySymbols, prototype: {hasOwnProperty}} = Object; 2 | const {toStringTag} = Symbol; 3 | 4 | export const FORBIDDEN = {}; 5 | 6 | export const symbolsof = getOwnPropertySymbols; 7 | 8 | export function isown(object, key) { 9 | return hasOwnProperty.call(object, key); 10 | } 11 | 12 | export function tagof(object) { 13 | return object[toStringTag] 14 | || (object.constructor && object.constructor.name) 15 | || "Object"; 16 | } 17 | 18 | export function valueof(object, key) { 19 | try { 20 | const value = object[key]; 21 | if (value) value.constructor; // Test for SecurityError. 22 | return value; 23 | } catch (ignore) { 24 | return FORBIDDEN; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/array.js: -------------------------------------------------------------------------------- 1 | var prototype = Array.prototype; 2 | export var map = prototype.map; 3 | export var forEach = prototype.forEach; 4 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/constant.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return function() { 3 | return x; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/errors.js: -------------------------------------------------------------------------------- 1 | export function RuntimeError(message, input) { 2 | this.message = message + ""; 3 | this.input = input; 4 | } 5 | 6 | RuntimeError.prototype = Object.create(Error.prototype); 7 | RuntimeError.prototype.name = "RuntimeError"; 8 | RuntimeError.prototype.constructor = RuntimeError; 9 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/generatorish.js: -------------------------------------------------------------------------------- 1 | export default function generatorish(value) { 2 | return value 3 | && typeof value.next === "function" 4 | && typeof value.return === "function"; 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/identity.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return x; 3 | } 4 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/index.js: -------------------------------------------------------------------------------- 1 | import {Inspector} from "@observablehq/inspector"; 2 | import {Library} from "@observablehq/stdlib"; 3 | import {RuntimeError} from "./errors"; 4 | import Runtime from "./runtime"; 5 | 6 | export {Inspector, Library, Runtime, RuntimeError}; 7 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/noop.js: -------------------------------------------------------------------------------- 1 | export default function() {} 2 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/runtime/src/rethrow.js: -------------------------------------------------------------------------------- 1 | export default function(e) { 2 | return function() { 3 | throw e; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/constant.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return function() { 3 | return x; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/canvas.js: -------------------------------------------------------------------------------- 1 | export default function(width, height) { 2 | var canvas = document.createElement("canvas"); 3 | canvas.width = width; 4 | canvas.height = height; 5 | return canvas; 6 | } 7 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/context2d.js: -------------------------------------------------------------------------------- 1 | export default function(width, height, dpi) { 2 | if (dpi == null) dpi = devicePixelRatio; 3 | var canvas = document.createElement("canvas"); 4 | canvas.width = width * dpi; 5 | canvas.height = height * dpi; 6 | canvas.style.width = width + "px"; 7 | var context = canvas.getContext("2d"); 8 | context.scale(dpi, dpi); 9 | return context; 10 | } 11 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/index.js: -------------------------------------------------------------------------------- 1 | import canvas from "./canvas.js"; 2 | import context2d from "./context2d.js"; 3 | import download from "./download.js"; 4 | import element from "./element.js"; 5 | import input from "./input.js"; 6 | import range from "./range.js"; 7 | import select from "./select.js"; 8 | import svg from "./svg.js"; 9 | import text from "./text.js"; 10 | import uid from "./uid.js"; 11 | 12 | export default { 13 | canvas: canvas, 14 | context2d: context2d, 15 | download: download, 16 | element: element, 17 | input: input, 18 | range: range, 19 | select: select, 20 | svg: svg, 21 | text: text, 22 | uid: uid 23 | }; 24 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/input.js: -------------------------------------------------------------------------------- 1 | export default function(type) { 2 | var input = document.createElement("input"); 3 | if (type != null) input.type = type; 4 | return input; 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/range.js: -------------------------------------------------------------------------------- 1 | export default function(min, max, step) { 2 | if (arguments.length === 1) max = min, min = null; 3 | var input = document.createElement("input"); 4 | input.min = min = min == null ? 0 : +min; 5 | input.max = max = max == null ? 1 : +max; 6 | input.step = step == null ? "any" : step = +step; 7 | input.type = "range"; 8 | return input; 9 | } 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/select.js: -------------------------------------------------------------------------------- 1 | export default function(values) { 2 | var select = document.createElement("select"); 3 | Array.prototype.forEach.call(values, function(value) { 4 | var option = document.createElement("option"); 5 | option.value = option.textContent = value; 6 | select.appendChild(option); 7 | }); 8 | return select; 9 | } 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/svg.js: -------------------------------------------------------------------------------- 1 | export default function(width, height) { 2 | var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 3 | svg.setAttribute("viewBox", [0, 0, width, height]); 4 | svg.setAttribute("width", width); 5 | svg.setAttribute("height", height); 6 | return svg; 7 | } 8 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/text.js: -------------------------------------------------------------------------------- 1 | export default function(value) { 2 | return document.createTextNode(value); 3 | } 4 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/dom/uid.js: -------------------------------------------------------------------------------- 1 | var count = 0; 2 | 3 | export default function(name) { 4 | return new Id("O-" + (name == null ? "" : name + "-") + ++count); 5 | } 6 | 7 | function Id(id) { 8 | this.id = id; 9 | this.href = new URL(`#${id}`, location) + ""; 10 | } 11 | 12 | Id.prototype.toString = function() { 13 | return "url(" + this.href + ")"; 14 | }; 15 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/files/buffer.js: -------------------------------------------------------------------------------- 1 | export default function(file) { 2 | return new Promise(function(resolve, reject) { 3 | var reader = new FileReader; 4 | reader.onload = function() { resolve(reader.result); }; 5 | reader.onerror = reject; 6 | reader.readAsArrayBuffer(file); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/files/index.js: -------------------------------------------------------------------------------- 1 | import buffer from "./buffer.js"; 2 | import text from "./text.js"; 3 | import url from "./url.js"; 4 | 5 | export default { 6 | buffer: buffer, 7 | text: text, 8 | url: url 9 | }; 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/files/text.js: -------------------------------------------------------------------------------- 1 | export default function(file) { 2 | return new Promise(function(resolve, reject) { 3 | var reader = new FileReader; 4 | reader.onload = function() { resolve(reader.result); }; 5 | reader.onerror = reject; 6 | reader.readAsText(file); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/files/url.js: -------------------------------------------------------------------------------- 1 | export default function(file) { 2 | return new Promise(function(resolve, reject) { 3 | var reader = new FileReader; 4 | reader.onload = function() { resolve(reader.result); }; 5 | reader.onerror = reject; 6 | reader.readAsDataURL(file); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/disposable.js: -------------------------------------------------------------------------------- 1 | import that from "../that.js"; 2 | 3 | export default function disposable(value, dispose) { 4 | let done = false; 5 | if (typeof dispose !== "function") { 6 | throw new Error("dispose is not a function"); 7 | } 8 | return { 9 | [Symbol.iterator]: that, 10 | next: () => done ? {done: true} : (done = true, {done: false, value}), 11 | return: () => (done = true, dispose(value), {done: true}), 12 | throw: () => ({done: done = true}) 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/filter.js: -------------------------------------------------------------------------------- 1 | export default function*(iterator, test) { 2 | var result, index = -1; 3 | while (!(result = iterator.next()).done) { 4 | if (test(result.value, ++index)) { 5 | yield result.value; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/index.js: -------------------------------------------------------------------------------- 1 | import disposable from "./disposable.js"; 2 | import filter from "./filter.js"; 3 | import input from "./input.js"; 4 | import map from "./map.js"; 5 | import observe from "./observe.js"; 6 | import queue from "./queue.js"; 7 | import range from "./range.js"; 8 | import valueAt from "./valueAt.js"; 9 | import worker from "./worker.js"; 10 | 11 | export default { 12 | disposable: disposable, 13 | filter: filter, 14 | input: input, 15 | map: map, 16 | observe: observe, 17 | queue: queue, 18 | range: range, 19 | valueAt: valueAt, 20 | worker: worker 21 | }; 22 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/map.js: -------------------------------------------------------------------------------- 1 | export default function*(iterator, transform) { 2 | var result, index = -1; 3 | while (!(result = iterator.next()).done) { 4 | yield transform(result.value, ++index); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/queue.js: -------------------------------------------------------------------------------- 1 | import that from "../that.js"; 2 | 3 | export default function(initialize) { 4 | let resolve; 5 | const queue = []; 6 | const dispose = initialize(push); 7 | 8 | if (dispose != null && typeof dispose !== "function") { 9 | throw new Error(typeof dispose.then === "function" 10 | ? "async initializers are not supported" 11 | : "initializer returned something, but not a dispose function"); 12 | } 13 | 14 | function push(x) { 15 | queue.push(x); 16 | if (resolve) resolve(queue.shift()), resolve = null; 17 | return x; 18 | } 19 | 20 | function next() { 21 | return {done: false, value: queue.length 22 | ? Promise.resolve(queue.shift()) 23 | : new Promise(_ => (resolve = _))}; 24 | } 25 | 26 | return { 27 | [Symbol.iterator]: that, 28 | throw: () => ({done: true}), 29 | return: () => (dispose != null && dispose(), {done: true}), 30 | next 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/range.js: -------------------------------------------------------------------------------- 1 | export default function*(start, stop, step) { 2 | start = +start; 3 | stop = +stop; 4 | step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; 5 | var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0; 6 | while (++i < n) { 7 | yield start + i * step; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/valueAt.js: -------------------------------------------------------------------------------- 1 | export default function(iterator, i) { 2 | if (!isFinite(i = +i) || i < 0 || i !== i | 0) return; 3 | var result, index = -1; 4 | while (!(result = iterator.next()).done) { 5 | if (++index === i) { 6 | return result.value; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/generators/worker.js: -------------------------------------------------------------------------------- 1 | import disposable from "./disposable.js"; 2 | 3 | export default function worker(source) { 4 | const url = URL.createObjectURL(new Blob([source], {type: "text/javascript"})); 5 | const worker = new Worker(url); 6 | return disposable(worker, () => { 7 | worker.terminate(); 8 | URL.revokeObjectURL(url); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/html.js: -------------------------------------------------------------------------------- 1 | import template from "./template.js"; 2 | 3 | export default template(function(string) { 4 | var template = document.createElement("template"); 5 | template.innerHTML = string.trim(); 6 | return document.importNode(template.content, true); 7 | }, function() { 8 | return document.createElement("span"); 9 | }); 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/index.js: -------------------------------------------------------------------------------- 1 | export {default as FileAttachments} from "./fileAttachment.js"; 2 | export {default as Library} from "./library.js"; 3 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/mutable.js: -------------------------------------------------------------------------------- 1 | import observe from "./generators/observe.js"; 2 | 3 | export default function Mutable(value) { 4 | let change; 5 | Object.defineProperties(this, { 6 | generator: {value: observe(_ => void (change = _))}, 7 | value: {get: () => value, set: x => change(value = x)} 8 | }); 9 | if (value !== undefined) change(value); 10 | } 11 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/now.js: -------------------------------------------------------------------------------- 1 | export default function*() { 2 | while (true) { 3 | yield Date.now(); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/promises/delay.js: -------------------------------------------------------------------------------- 1 | export default function(duration, value) { 2 | return new Promise(function(resolve) { 3 | setTimeout(function() { 4 | resolve(value); 5 | }, duration); 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/promises/index.js: -------------------------------------------------------------------------------- 1 | import delay from "./delay.js"; 2 | import tick from "./tick.js"; 3 | import when from "./when.js"; 4 | 5 | export default { 6 | delay: delay, 7 | tick: tick, 8 | when: when 9 | }; 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/promises/tick.js: -------------------------------------------------------------------------------- 1 | import when from "./when.js"; 2 | 3 | export default function(duration, value) { 4 | return when(Math.ceil((Date.now() + 1) / duration) * duration, value); 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/promises/when.js: -------------------------------------------------------------------------------- 1 | import constant from "../constant.js"; 2 | 3 | var timeouts = new Map; 4 | 5 | function timeout(now, time) { 6 | var t = new Promise(function(resolve) { 7 | timeouts.delete(time); 8 | var delay = time - now; 9 | if (!(delay > 0)) throw new Error("invalid time"); 10 | if (delay > 0x7fffffff) throw new Error("too long to wait"); 11 | setTimeout(resolve, delay); 12 | }); 13 | timeouts.set(time, t); 14 | return t; 15 | } 16 | 17 | export default function when(time, value) { 18 | var now; 19 | return (now = timeouts.get(time = +time)) ? now.then(constant(value)) 20 | : (now = Date.now()) >= time ? Promise.resolve(value) 21 | : timeout(now, time).then(constant(value)); 22 | } 23 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/require.js: -------------------------------------------------------------------------------- 1 | import {require as requireDefault, requireFrom} from "d3-require"; 2 | 3 | export default function(resolve) { 4 | return resolve == null ? requireDefault : requireFrom(resolve); 5 | } 6 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/resolve.js: -------------------------------------------------------------------------------- 1 | export default function resolve(name, base) { 2 | if (/^(\w+:)|\/\//i.test(name)) return name; 3 | if (/^[.]{0,2}\//i.test(name)) return new URL(name, base == null ? location : base).href; 4 | if (!name.length || /^[\s._]/.test(name) || /\s$/.test(name)) throw new Error("illegal name"); 5 | return "https://unpkg.com/" + name; 6 | } 7 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/svg.js: -------------------------------------------------------------------------------- 1 | import template from "./template.js"; 2 | 3 | export default template(function(string) { 4 | var root = document.createElementNS("http://www.w3.org/2000/svg", "g"); 5 | root.innerHTML = string.trim(); 6 | return root; 7 | }, function() { 8 | return document.createElementNS("http://www.w3.org/2000/svg", "g"); 9 | }); 10 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/that.js: -------------------------------------------------------------------------------- 1 | export default function that() { 2 | return this; 3 | } 4 | -------------------------------------------------------------------------------- /arc-method/node_modules/@observablehq/stdlib/src/width.js: -------------------------------------------------------------------------------- 1 | import observe from "./generators/observe.js"; 2 | 3 | export default function() { 4 | return observe(function(change) { 5 | var width = change(document.body.clientWidth); 6 | function resized() { 7 | var w = document.body.clientWidth; 8 | if (w !== width) change(width = w); 9 | } 10 | window.addEventListener("resize", resized); 11 | return function() { 12 | window.removeEventListener("resize", resized); 13 | }; 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /arc-method/node_modules/d3-require/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017-2019 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /arc-method/node_modules/esm/index.js: -------------------------------------------------------------------------------- 1 | "use strict";module.exports=require("./esm.js"); -------------------------------------------------------------------------------- /arc-method/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "praxis-arc", 3 | "main": "5bdfd79e1ffdc48c@265.js", 4 | "version": "265.0.0", 5 | "homepage": "https://observablehq.com/d/7c4fb1c6f7b0cdaf", 6 | "author": { "Chris Spannos", 7 | "name": "D3", 8 | "url": "https://observablehq.com/@d3" 9 | }, 10 | "type": "module", 11 | "peerDependencies": { 12 | "@observablehq/runtime": "4" 13 | }, 14 | "dependencies": { 15 | "@observablehq/runtime": "^4.7.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /graph-method/README.md: -------------------------------------------------------------------------------- 1 | # Force-Directed Graph 2 | 3 | https://observablehq.com/@d3/force-directed-graph@139 4 | 5 | View this notebook in your browser by running a web server in this folder. For 6 | example: 7 | 8 | ~~~sh 9 | python -m SimpleHTTPServer 10 | ~~~ 11 | 12 | Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to 13 | import this module directly into your application. To npm install: 14 | 15 | ~~~sh 16 | npm install @observablehq/runtime@4 17 | npm install https://api.observablehq.com/@d3/force-directed-graph.tgz?v=3 18 | ~~~ 19 | 20 | Then, import your notebook and the runtime as: 21 | 22 | ~~~js 23 | import {Runtime, Inspector} from "@observablehq/runtime"; 24 | import define from "@d3/force-directed-graph"; 25 | ~~~ 26 | 27 | To log the value of the cell named “foo”: 28 | 29 | ~~~js 30 | const runtime = new Runtime(); 31 | const main = runtime.module(define); 32 | main.value("foo").then(value => console.log(value)); 33 | ~~~ 34 | -------------------------------------------------------------------------------- /graph-method/imgs/method-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/graph-method/imgs/method-network.png -------------------------------------------------------------------------------- /graph-method/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | PRAXIS P2P Method Analyzer 4 | 5 | 6 | 20 | -------------------------------------------------------------------------------- /graph-method/index.js: -------------------------------------------------------------------------------- 1 | export {default} from "./a6c00de7c09bdfa1@139.js"; 2 | -------------------------------------------------------------------------------- /graph-method/node_modules/@d3/force-directed-graph/README.md: -------------------------------------------------------------------------------- 1 | # Force-Directed Graph 2 | 3 | https://observablehq.com/@d3/force-directed-graph@139 4 | 5 | View this notebook in your browser by running a web server in this folder. For 6 | example: 7 | 8 | ~~~sh 9 | python -m SimpleHTTPServer 10 | ~~~ 11 | 12 | Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to 13 | import this module directly into your application. To npm install: 14 | 15 | ~~~sh 16 | npm install @observablehq/runtime@4 17 | npm install https://api.observablehq.com/@d3/force-directed-graph.tgz?v=3 18 | ~~~ 19 | 20 | Then, import your notebook and the runtime as: 21 | 22 | ~~~js 23 | import {Runtime, Inspector} from "@observablehq/runtime"; 24 | import define from "@d3/force-directed-graph"; 25 | ~~~ 26 | 27 | To log the value of the cell named “foo”: 28 | 29 | ~~~js 30 | const runtime = new Runtime(); 31 | const main = runtime.module(define); 32 | main.value("foo").then(value => console.log(value)); 33 | ~~~ 34 | -------------------------------------------------------------------------------- /graph-method/node_modules/@d3/force-directed-graph/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Force-Directed Graph 4 | 5 | 6 | 15 | -------------------------------------------------------------------------------- /graph-method/node_modules/@d3/force-directed-graph/index.js: -------------------------------------------------------------------------------- 1 | export {default} from "./a6c00de7c09bdfa1@139.js"; 2 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/src/array.js: -------------------------------------------------------------------------------- 1 | // TODO https://twitter.com/mbostock/status/702737065121742848 2 | export function isarray(value) { 3 | return Array.isArray(value) 4 | || value instanceof Int8Array 5 | || value instanceof Int16Array 6 | || value instanceof Int32Array 7 | || value instanceof Uint8Array 8 | || value instanceof Uint8ClampedArray 9 | || value instanceof Uint16Array 10 | || value instanceof Uint32Array 11 | || value instanceof Float32Array 12 | || value instanceof Float64Array; 13 | } 14 | 15 | // Non-integer keys in arrays, e.g. [1, 2, 0.5: "value"]. 16 | export function isindex(key) { 17 | return key === (key | 0) + ""; 18 | } 19 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/src/dispatch.js: -------------------------------------------------------------------------------- 1 | export default function dispatch(node, type, detail) { 2 | detail = detail || {}; 3 | var document = node.ownerDocument, event = document.defaultView.CustomEvent; 4 | if (typeof event === "function") { 5 | event = new event(type, {detail: detail}); 6 | } else { 7 | event = document.createEvent("Event"); 8 | event.initEvent(type, false, false); 9 | event.detail = detail; 10 | } 11 | node.dispatchEvent(event); 12 | } 13 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/src/formatError.js: -------------------------------------------------------------------------------- 1 | var errorToString = Error.prototype.toString; 2 | 3 | export default function formatError(value) { 4 | return value.stack || errorToString.call(value); 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/src/formatRegExp.js: -------------------------------------------------------------------------------- 1 | var regExpToString = RegExp.prototype.toString; 2 | 3 | export default function formatRegExp(value) { 4 | return regExpToString.call(value); 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/src/formatSymbol.js: -------------------------------------------------------------------------------- 1 | const symbolToString = Symbol.prototype.toString; 2 | 3 | // Symbols do not coerce to strings; they must be explicitly converted. 4 | export default function formatSymbol(symbol) { 5 | return symbolToString.call(symbol); 6 | } 7 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/src/inspectName.js: -------------------------------------------------------------------------------- 1 | export default function inspectName(name) { 2 | const n = document.createElement("span"); 3 | n.className = "observablehq--cellname"; 4 | n.textContent = `${name} = `; 5 | return n; 6 | } 7 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/inspector/src/object.js: -------------------------------------------------------------------------------- 1 | const {getOwnPropertySymbols, prototype: {hasOwnProperty}} = Object; 2 | const {toStringTag} = Symbol; 3 | 4 | export const FORBIDDEN = {}; 5 | 6 | export const symbolsof = getOwnPropertySymbols; 7 | 8 | export function isown(object, key) { 9 | return hasOwnProperty.call(object, key); 10 | } 11 | 12 | export function tagof(object) { 13 | return object[toStringTag] 14 | || (object.constructor && object.constructor.name) 15 | || "Object"; 16 | } 17 | 18 | export function valueof(object, key) { 19 | try { 20 | const value = object[key]; 21 | if (value) value.constructor; // Test for SecurityError. 22 | return value; 23 | } catch (ignore) { 24 | return FORBIDDEN; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/array.js: -------------------------------------------------------------------------------- 1 | var prototype = Array.prototype; 2 | export var map = prototype.map; 3 | export var forEach = prototype.forEach; 4 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/constant.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return function() { 3 | return x; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/errors.js: -------------------------------------------------------------------------------- 1 | export function RuntimeError(message, input) { 2 | this.message = message + ""; 3 | this.input = input; 4 | } 5 | 6 | RuntimeError.prototype = Object.create(Error.prototype); 7 | RuntimeError.prototype.name = "RuntimeError"; 8 | RuntimeError.prototype.constructor = RuntimeError; 9 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/generatorish.js: -------------------------------------------------------------------------------- 1 | export default function generatorish(value) { 2 | return value 3 | && typeof value.next === "function" 4 | && typeof value.return === "function"; 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/identity.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return x; 3 | } 4 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/index.js: -------------------------------------------------------------------------------- 1 | import {Inspector} from "@observablehq/inspector"; 2 | import {Library} from "@observablehq/stdlib"; 3 | import {RuntimeError} from "./errors"; 4 | import Runtime from "./runtime"; 5 | 6 | export {Inspector, Library, Runtime, RuntimeError}; 7 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/noop.js: -------------------------------------------------------------------------------- 1 | export default function() {} 2 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/runtime/src/rethrow.js: -------------------------------------------------------------------------------- 1 | export default function(e) { 2 | return function() { 3 | throw e; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/constant.js: -------------------------------------------------------------------------------- 1 | export default function(x) { 2 | return function() { 3 | return x; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/canvas.js: -------------------------------------------------------------------------------- 1 | export default function(width, height) { 2 | var canvas = document.createElement("canvas"); 3 | canvas.width = width; 4 | canvas.height = height; 5 | return canvas; 6 | } 7 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/context2d.js: -------------------------------------------------------------------------------- 1 | export default function(width, height, dpi) { 2 | if (dpi == null) dpi = devicePixelRatio; 3 | var canvas = document.createElement("canvas"); 4 | canvas.width = width * dpi; 5 | canvas.height = height * dpi; 6 | canvas.style.width = width + "px"; 7 | var context = canvas.getContext("2d"); 8 | context.scale(dpi, dpi); 9 | return context; 10 | } 11 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/index.js: -------------------------------------------------------------------------------- 1 | import canvas from "./canvas.js"; 2 | import context2d from "./context2d.js"; 3 | import download from "./download.js"; 4 | import element from "./element.js"; 5 | import input from "./input.js"; 6 | import range from "./range.js"; 7 | import select from "./select.js"; 8 | import svg from "./svg.js"; 9 | import text from "./text.js"; 10 | import uid from "./uid.js"; 11 | 12 | export default { 13 | canvas: canvas, 14 | context2d: context2d, 15 | download: download, 16 | element: element, 17 | input: input, 18 | range: range, 19 | select: select, 20 | svg: svg, 21 | text: text, 22 | uid: uid 23 | }; 24 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/input.js: -------------------------------------------------------------------------------- 1 | export default function(type) { 2 | var input = document.createElement("input"); 3 | if (type != null) input.type = type; 4 | return input; 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/range.js: -------------------------------------------------------------------------------- 1 | export default function(min, max, step) { 2 | if (arguments.length === 1) max = min, min = null; 3 | var input = document.createElement("input"); 4 | input.min = min = min == null ? 0 : +min; 5 | input.max = max = max == null ? 1 : +max; 6 | input.step = step == null ? "any" : step = +step; 7 | input.type = "range"; 8 | return input; 9 | } 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/select.js: -------------------------------------------------------------------------------- 1 | export default function(values) { 2 | var select = document.createElement("select"); 3 | Array.prototype.forEach.call(values, function(value) { 4 | var option = document.createElement("option"); 5 | option.value = option.textContent = value; 6 | select.appendChild(option); 7 | }); 8 | return select; 9 | } 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/svg.js: -------------------------------------------------------------------------------- 1 | export default function(width, height) { 2 | var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 3 | svg.setAttribute("viewBox", [0, 0, width, height]); 4 | svg.setAttribute("width", width); 5 | svg.setAttribute("height", height); 6 | return svg; 7 | } 8 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/text.js: -------------------------------------------------------------------------------- 1 | export default function(value) { 2 | return document.createTextNode(value); 3 | } 4 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/dom/uid.js: -------------------------------------------------------------------------------- 1 | var count = 0; 2 | 3 | export default function(name) { 4 | return new Id("O-" + (name == null ? "" : name + "-") + ++count); 5 | } 6 | 7 | function Id(id) { 8 | this.id = id; 9 | this.href = new URL(`#${id}`, location) + ""; 10 | } 11 | 12 | Id.prototype.toString = function() { 13 | return "url(" + this.href + ")"; 14 | }; 15 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/files/buffer.js: -------------------------------------------------------------------------------- 1 | export default function(file) { 2 | return new Promise(function(resolve, reject) { 3 | var reader = new FileReader; 4 | reader.onload = function() { resolve(reader.result); }; 5 | reader.onerror = reject; 6 | reader.readAsArrayBuffer(file); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/files/index.js: -------------------------------------------------------------------------------- 1 | import buffer from "./buffer.js"; 2 | import text from "./text.js"; 3 | import url from "./url.js"; 4 | 5 | export default { 6 | buffer: buffer, 7 | text: text, 8 | url: url 9 | }; 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/files/text.js: -------------------------------------------------------------------------------- 1 | export default function(file) { 2 | return new Promise(function(resolve, reject) { 3 | var reader = new FileReader; 4 | reader.onload = function() { resolve(reader.result); }; 5 | reader.onerror = reject; 6 | reader.readAsText(file); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/files/url.js: -------------------------------------------------------------------------------- 1 | export default function(file) { 2 | return new Promise(function(resolve, reject) { 3 | var reader = new FileReader; 4 | reader.onload = function() { resolve(reader.result); }; 5 | reader.onerror = reject; 6 | reader.readAsDataURL(file); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/disposable.js: -------------------------------------------------------------------------------- 1 | import that from "../that.js"; 2 | 3 | export default function disposable(value, dispose) { 4 | let done = false; 5 | if (typeof dispose !== "function") { 6 | throw new Error("dispose is not a function"); 7 | } 8 | return { 9 | [Symbol.iterator]: that, 10 | next: () => done ? {done: true} : (done = true, {done: false, value}), 11 | return: () => (done = true, dispose(value), {done: true}), 12 | throw: () => ({done: done = true}) 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/filter.js: -------------------------------------------------------------------------------- 1 | export default function*(iterator, test) { 2 | var result, index = -1; 3 | while (!(result = iterator.next()).done) { 4 | if (test(result.value, ++index)) { 5 | yield result.value; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/index.js: -------------------------------------------------------------------------------- 1 | import disposable from "./disposable.js"; 2 | import filter from "./filter.js"; 3 | import input from "./input.js"; 4 | import map from "./map.js"; 5 | import observe from "./observe.js"; 6 | import queue from "./queue.js"; 7 | import range from "./range.js"; 8 | import valueAt from "./valueAt.js"; 9 | import worker from "./worker.js"; 10 | 11 | export default { 12 | disposable: disposable, 13 | filter: filter, 14 | input: input, 15 | map: map, 16 | observe: observe, 17 | queue: queue, 18 | range: range, 19 | valueAt: valueAt, 20 | worker: worker 21 | }; 22 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/map.js: -------------------------------------------------------------------------------- 1 | export default function*(iterator, transform) { 2 | var result, index = -1; 3 | while (!(result = iterator.next()).done) { 4 | yield transform(result.value, ++index); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/queue.js: -------------------------------------------------------------------------------- 1 | import that from "../that.js"; 2 | 3 | export default function(initialize) { 4 | let resolve; 5 | const queue = []; 6 | const dispose = initialize(push); 7 | 8 | if (dispose != null && typeof dispose !== "function") { 9 | throw new Error(typeof dispose.then === "function" 10 | ? "async initializers are not supported" 11 | : "initializer returned something, but not a dispose function"); 12 | } 13 | 14 | function push(x) { 15 | queue.push(x); 16 | if (resolve) resolve(queue.shift()), resolve = null; 17 | return x; 18 | } 19 | 20 | function next() { 21 | return {done: false, value: queue.length 22 | ? Promise.resolve(queue.shift()) 23 | : new Promise(_ => (resolve = _))}; 24 | } 25 | 26 | return { 27 | [Symbol.iterator]: that, 28 | throw: () => ({done: true}), 29 | return: () => (dispose != null && dispose(), {done: true}), 30 | next 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/range.js: -------------------------------------------------------------------------------- 1 | export default function*(start, stop, step) { 2 | start = +start; 3 | stop = +stop; 4 | step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; 5 | var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0; 6 | while (++i < n) { 7 | yield start + i * step; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/valueAt.js: -------------------------------------------------------------------------------- 1 | export default function(iterator, i) { 2 | if (!isFinite(i = +i) || i < 0 || i !== i | 0) return; 3 | var result, index = -1; 4 | while (!(result = iterator.next()).done) { 5 | if (++index === i) { 6 | return result.value; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/generators/worker.js: -------------------------------------------------------------------------------- 1 | import disposable from "./disposable.js"; 2 | 3 | export default function worker(source) { 4 | const url = URL.createObjectURL(new Blob([source], {type: "text/javascript"})); 5 | const worker = new Worker(url); 6 | return disposable(worker, () => { 7 | worker.terminate(); 8 | URL.revokeObjectURL(url); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/html.js: -------------------------------------------------------------------------------- 1 | import template from "./template.js"; 2 | 3 | export default template(function(string) { 4 | var template = document.createElement("template"); 5 | template.innerHTML = string.trim(); 6 | return document.importNode(template.content, true); 7 | }, function() { 8 | return document.createElement("span"); 9 | }); 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/index.js: -------------------------------------------------------------------------------- 1 | export {default as FileAttachments} from "./fileAttachment.js"; 2 | export {default as Library} from "./library.js"; 3 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/mutable.js: -------------------------------------------------------------------------------- 1 | import observe from "./generators/observe.js"; 2 | 3 | export default function Mutable(value) { 4 | let change; 5 | Object.defineProperties(this, { 6 | generator: {value: observe(_ => void (change = _))}, 7 | value: {get: () => value, set: x => change(value = x)} 8 | }); 9 | if (value !== undefined) change(value); 10 | } 11 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/now.js: -------------------------------------------------------------------------------- 1 | export default function*() { 2 | while (true) { 3 | yield Date.now(); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/promises/delay.js: -------------------------------------------------------------------------------- 1 | export default function(duration, value) { 2 | return new Promise(function(resolve) { 3 | setTimeout(function() { 4 | resolve(value); 5 | }, duration); 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/promises/index.js: -------------------------------------------------------------------------------- 1 | import delay from "./delay.js"; 2 | import tick from "./tick.js"; 3 | import when from "./when.js"; 4 | 5 | export default { 6 | delay: delay, 7 | tick: tick, 8 | when: when 9 | }; 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/promises/tick.js: -------------------------------------------------------------------------------- 1 | import when from "./when.js"; 2 | 3 | export default function(duration, value) { 4 | return when(Math.ceil((Date.now() + 1) / duration) * duration, value); 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/promises/when.js: -------------------------------------------------------------------------------- 1 | import constant from "../constant.js"; 2 | 3 | var timeouts = new Map; 4 | 5 | function timeout(now, time) { 6 | var t = new Promise(function(resolve) { 7 | timeouts.delete(time); 8 | var delay = time - now; 9 | if (!(delay > 0)) throw new Error("invalid time"); 10 | if (delay > 0x7fffffff) throw new Error("too long to wait"); 11 | setTimeout(resolve, delay); 12 | }); 13 | timeouts.set(time, t); 14 | return t; 15 | } 16 | 17 | export default function when(time, value) { 18 | var now; 19 | return (now = timeouts.get(time = +time)) ? now.then(constant(value)) 20 | : (now = Date.now()) >= time ? Promise.resolve(value) 21 | : timeout(now, time).then(constant(value)); 22 | } 23 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/require.js: -------------------------------------------------------------------------------- 1 | import {require as requireDefault, requireFrom} from "d3-require"; 2 | 3 | export default function(resolve) { 4 | return resolve == null ? requireDefault : requireFrom(resolve); 5 | } 6 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/resolve.js: -------------------------------------------------------------------------------- 1 | export default function resolve(name, base) { 2 | if (/^(\w+:)|\/\//i.test(name)) return name; 3 | if (/^[.]{0,2}\//i.test(name)) return new URL(name, base == null ? location : base).href; 4 | if (!name.length || /^[\s._]/.test(name) || /\s$/.test(name)) throw new Error("illegal name"); 5 | return "https://unpkg.com/" + name; 6 | } 7 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/svg.js: -------------------------------------------------------------------------------- 1 | import template from "./template.js"; 2 | 3 | export default template(function(string) { 4 | var root = document.createElementNS("http://www.w3.org/2000/svg", "g"); 5 | root.innerHTML = string.trim(); 6 | return root; 7 | }, function() { 8 | return document.createElementNS("http://www.w3.org/2000/svg", "g"); 9 | }); 10 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/that.js: -------------------------------------------------------------------------------- 1 | export default function that() { 2 | return this; 3 | } 4 | -------------------------------------------------------------------------------- /graph-method/node_modules/@observablehq/stdlib/src/width.js: -------------------------------------------------------------------------------- 1 | import observe from "./generators/observe.js"; 2 | 3 | export default function() { 4 | return observe(function(change) { 5 | var width = change(document.body.clientWidth); 6 | function resized() { 7 | var w = document.body.clientWidth; 8 | if (w !== width) change(width = w); 9 | } 10 | window.addEventListener("resize", resized); 11 | return function() { 12 | window.removeEventListener("resize", resized); 13 | }; 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /graph-method/node_modules/d3-require/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017-2019 Observable, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /graph-method/node_modules/esm/index.js: -------------------------------------------------------------------------------- 1 | "use strict";module.exports=require("./esm.js"); -------------------------------------------------------------------------------- /graph-method/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "praxis-graph", 3 | "main": "a6c00de7c09bdfa1@139.js", 4 | "version": "139.0.0", 5 | "homepage": "https://observablehq.com/@cspannos/praxis-p2p-network-method-analyzer", 6 | "author": { "Chris Spannos", 7 | "name": "D3", 8 | "url": "https://observablehq.com/@d3" 9 | }, 10 | "type": "module", 11 | "peerDependencies": { 12 | "@observablehq/runtime": "4" 13 | }, 14 | "dependencies": { 15 | "@d3/force-directed-graph": "https://api.observablehq.com/@d3/force-directed-graph.tgz?v=3", 16 | "@observablehq/runtime": "^4.7.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /img/arc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/img/arc.jpg -------------------------------------------------------------------------------- /img/graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/img/graph.jpg -------------------------------------------------------------------------------- /img/openapi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/img/openapi.jpg -------------------------------------------------------------------------------- /praxis-openapi-editor/.agignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | -------------------------------------------------------------------------------- /praxis-openapi-editor/.dockerignore: -------------------------------------------------------------------------------- 1 | /.git 2 | /.github 3 | /dev-helpers 4 | /docs 5 | /src 6 | /swagger-editor-dist-package 7 | /test 8 | /node_modules -------------------------------------------------------------------------------- /praxis-openapi-editor/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_style = space 6 | indent_size = 2 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | [*.md] 10 | trim_trailing_whitespace = false 11 | -------------------------------------------------------------------------------- /praxis-openapi-editor/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | .deps_check 4 | .DS_Store 5 | npm-debug.log* 6 | .eslintcache 7 | 8 | # Cypress 9 | test/e2e/screenshots 10 | test/e2e/videos -------------------------------------------------------------------------------- /praxis-openapi-editor/.npmignore: -------------------------------------------------------------------------------- 1 | * 2 | */ 3 | !README.md 4 | !package.json 5 | !dist/swagger-editor.js 6 | !dist/swagger-editor.js.map 7 | !dist/swagger-editor.css 8 | !dist/swagger-editor.css.map 9 | !dist/validation.worker.js 10 | !dist/validation.worker.js.map 11 | -------------------------------------------------------------------------------- /praxis-openapi-editor/.npmrc: -------------------------------------------------------------------------------- 1 | save-prefix="=" 2 | -------------------------------------------------------------------------------- /praxis-openapi-editor/.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | semi: false 2 | trailingComma: es5 3 | endOfLine: lf 4 | requirePragma: true 5 | insertPragma: true 6 | -------------------------------------------------------------------------------- /praxis-openapi-editor/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.17-alpine 2 | 3 | MAINTAINER fehguy 4 | 5 | RUN mkdir -p /run/nginx 6 | 7 | COPY nginx.conf /etc/nginx/ 8 | 9 | # copy swagger files to the `/js` folder 10 | COPY ./index.html /usr/share/nginx/html/ 11 | ADD ./dist/*.js /usr/share/nginx/html/dist/ 12 | ADD ./dist/*.map /usr/share/nginx/html/dist/ 13 | ADD ./dist/*.css /usr/share/nginx/html/dist/ 14 | ADD ./dist/*.png /usr/share/nginx/html/dist/ 15 | ADD ./docker-run.sh /usr/share/nginx/ 16 | 17 | EXPOSE 8080 18 | 19 | CMD ["sh", "/usr/share/nginx/docker-run.sh"] 20 | -------------------------------------------------------------------------------- /praxis-openapi-editor/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | If you believe you've found an exploitable security issue in Swagger Editor, 4 | **please don't create a public issue**. 5 | 6 | 7 | ## Supported versions 8 | 9 | This is the list of versions of `swagger-editor` which are 10 | currently being supported with security updates. 11 | 12 | | Version | Supported | Notes | 13 | | -------- | ------------------ | ---------------------- | 14 | | 3.x | :white_check_mark: | | 15 | | 2.x | :x: | End-of-life as of 2017 | 16 | 17 | ## Reporting a vulnerability 18 | 19 | To report a vulnerability please send an email with the details to [security@swagger.io](mailto:security@swagger.io). 20 | 21 | We'll acknowledge receipt of your report ASAP, and set expectations on how we plan to handle it. 22 | -------------------------------------------------------------------------------- /praxis-openapi-editor/build-tools/deploy-docker-hub-tag.sh: -------------------------------------------------------------------------------- 1 | if [ $DOCKER_HUB_USERNAME ]; then 2 | docker login --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD; 3 | 4 | if [ ! -z "$TRAVIS_TAG" ]; then 5 | DOCKER_IMAGE_TAG=${TRAVIS_TAG#?}; 6 | docker build -t $DOCKER_IMAGE_NAME .; 7 | docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG; 8 | docker push $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG; 9 | docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:latest; 10 | docker push $DOCKER_IMAGE_NAME:latest; 11 | fi; 12 | fi; 13 | -------------------------------------------------------------------------------- /praxis-openapi-editor/build-tools/loadersByExtension.js: -------------------------------------------------------------------------------- 1 | function extsToRegExp(exts) { 2 | return new RegExp("\\.(" + exts.map(function(ext) { 3 | return ext.replace(/\./g, "\\."); 4 | }).join("|") + ")(\\?.*)?$"); 5 | } 6 | 7 | module.exports = function loadersByExtension(obj) { 8 | var loaders = []; 9 | Object.keys(obj).forEach(function(key) { 10 | var exts = key.split("|"); 11 | var value = obj[key]; 12 | var entry = { 13 | extensions: exts, 14 | test: extsToRegExp(exts) 15 | }; 16 | if(Array.isArray(value)) { 17 | entry.loaders = value; 18 | } else if(typeof value === "string") { 19 | entry.loader = value; 20 | } else { 21 | Object.keys(value).forEach(function(valueKey) { 22 | entry[valueKey] = value[valueKey]; 23 | }); 24 | } 25 | loaders.push(entry); 26 | }); 27 | return loaders; 28 | }; 29 | -------------------------------------------------------------------------------- /praxis-openapi-editor/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileServerFolder": "test/e2e/static", 3 | "fixturesFolder": "test/e2e/fixtures", 4 | "integrationFolder": "test/e2e/tests", 5 | "pluginsFile": "test/e2e/plugins/index.js", 6 | "screenshotsFolder": "test/e2e/screenshots", 7 | "supportFile": "test/e2e/support/index.js", 8 | "videosFolder": "test/e2e/videos", 9 | "baseUrl": "http://localhost:3260/" 10 | } 11 | -------------------------------------------------------------------------------- /praxis-openapi-editor/dist/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/praxis-openapi-editor/dist/favicon-16x16.png -------------------------------------------------------------------------------- /praxis-openapi-editor/dist/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/praxis-openapi-editor/dist/favicon-32x32.png -------------------------------------------------------------------------------- /praxis-openapi-editor/docker-run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | NGINX_ROOT=/usr/share/nginx/html 6 | INDEX_FILE=$NGINX_ROOT/index.html 7 | 8 | # TODO: this is empty but we'll be adding configuration values here 9 | 10 | ## Adding env var support for swagger file (json or yaml) 11 | if [[ -f "$SWAGGER_FILE" ]]; then 12 | cp -s "$SWAGGER_FILE" "$NGINX_ROOT" 13 | REL_PATH="/$(basename $SWAGGER_FILE)" 14 | sed -i "s|https://petstore.swagger.io/v2/swagger.json|$REL_PATH|g" $INDEX_FILE 15 | fi 16 | 17 | # Gzip after replacements 18 | find /usr/share/nginx/html/ -type f -regex ".*\.\(html\|js\|css\)" -exec sh -c "gzip < {} > {}.gz" \; 19 | 20 | exec nginx -g 'daemon off;' 21 | -------------------------------------------------------------------------------- /praxis-openapi-editor/docs/drag-and-drop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/praxis-openapi-editor/docs/drag-and-drop.gif -------------------------------------------------------------------------------- /praxis-openapi-editor/docs/helpers.md: -------------------------------------------------------------------------------- 1 | ### `getEditorMetadata` 2 | 3 | `getEditorMetadata` is a method that allows you to get information about the Editor's state without reaching directly into the plugin system. 4 | 5 | Example: 6 | 7 | ```js 8 | const editor = SwaggerEditor({ /* your configuration here */ }) 9 | 10 | SwaggerEditor.getEditorMetadata() 11 | ``` 12 | 13 | Result: 14 | 15 | ```js 16 | { 17 | contentString: String, 18 | contentObject: Object, 19 | isValid: Boolean, 20 | errors: Array, 21 | } 22 | ``` -------------------------------------------------------------------------------- /praxis-openapi-editor/docs/import.md: -------------------------------------------------------------------------------- 1 | # Importing OpenAPI documents 2 | 3 | Swagger Editor can import your OpenAPI document, which can be formatted as JSON or YAML. 4 | 5 | ### File → Import File 6 | 7 | Click **Choose File** and select import. The file you are importing has to be a valid JSON or YAML OpenAPI document. Swagger Editor will prompt you about validation errors, if any exist. 8 | 9 | ### File → Import URL 10 | 11 | Paste the URL to your OpenAPI document. 12 | 13 | ### Drag and Drop 14 | 15 | Simply drag and drop your OpenAPI JSON or YAML document into the Swagger Editor browser window. 16 | 17 | ![Swagger Editor drag and drop demo](./drag-and-drop.gif) 18 | -------------------------------------------------------------------------------- /praxis-openapi-editor/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes 1; 2 | 3 | events { 4 | worker_connections 1024; 5 | } 6 | 7 | http { 8 | include mime.types; 9 | default_type application/octet-stream; 10 | 11 | sendfile on; 12 | 13 | keepalive_timeout 65; 14 | 15 | gzip on; 16 | gzip_static on; 17 | gzip_disable "msie6"; 18 | 19 | gzip_vary on; 20 | gzip_types text/plain text/css application/javascript; 21 | 22 | add_header X-Frame-Options deny; 23 | 24 | server { 25 | listen 8080; 26 | server_name localhost; 27 | 28 | location / { 29 | root /usr/share/nginx/html; 30 | index index.html index.htm; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /praxis-openapi-editor/release/.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "hooks": { 3 | "before:bump": [ 4 | "./release/check-for-breaking-changes.sh ${latestVersion} ${version}", 5 | "npm update swagger-client", 6 | "npm update swagger-ui", 7 | "npm test" 8 | ], 9 | "after:bump": ["npm run build"], 10 | "after:release": "export GIT_TAG=v${version} && echo GIT_TAG=v${version} > release/.version" 11 | }, 12 | "git": { 13 | "requireUpstream": false, 14 | "changelog": "./release/get-changelog.sh", 15 | "commitMessage": "release: v${version}", 16 | "tagName": "v${version}", 17 | "push": false 18 | }, 19 | "github": { 20 | "release": true, 21 | "releaseName": "Swagger Editor %s Released!", 22 | "draft": true 23 | }, 24 | "plugins": { 25 | "@release-it/conventional-changelog": { 26 | "preset": "angular" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /praxis-openapi-editor/release/check-for-breaking-changes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CURRENT_VERSION=$1 3 | NEXT_VERSION=$2 4 | CURRENT_MAJOR=${CURRENT_VERSION:0:1} 5 | NEXT_MAJOR=${NEXT_VERSION:0:1} 6 | 7 | if [ "$CURRENT_MAJOR" -ne "$NEXT_MAJOR" ] ; 8 | then if [ "$BREAKING_OKAY" = "true" ]; 9 | then echo "breaking change detected but BREAKING_OKAY is set; continuing." && exit 0; 10 | else echo "breaking change detected and BREAKING_OKAY is not set; aborting." && exit 1; 11 | fi; 12 | fi; 13 | 14 | echo "next version is not a breaking change; continuing."; -------------------------------------------------------------------------------- /praxis-openapi-editor/release/get-changelog.sh: -------------------------------------------------------------------------------- 1 | echo "_No release summary included._\n\n#### Changelog\n" 2 | 3 | PREV_RELEASE_REF=$(git log --pretty=oneline | grep ' release: ' | head -n 2 | tail -n 1 | cut -f 1 -d " ") 4 | 5 | git log --pretty=oneline $PREV_RELEASE_REF..HEAD | awk '{ $1=""; print}' | sed -e 's/^[ \t]*//' | sed 's/^feat/0,feat/' | sed 's/^improve/1,improve/' | sed 's/^fix/2,fix/'| sort | sed 's/^[0-2],//' | sed 's/^/* /' 6 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "import/no-extraneous-dependencies": [ 4 | 2, 5 | { 6 | "devDependencies": false 7 | } 8 | ] 9 | } 10 | } -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/ast/index.js: -------------------------------------------------------------------------------- 1 | import * as AST from "./ast" 2 | 3 | export default function() { 4 | return { 5 | fn: { AST } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-keywords/get-completions.js: -------------------------------------------------------------------------------- 1 | import keywordMap from "./keyword-map" 2 | import getKeywordsForPath from "./get-keywords-for-path" 3 | 4 | export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) { 5 | 6 | const { fn: { getPathForPosition }, specSelectors } = system 7 | 8 | const { isOAS3 } = specSelectors 9 | 10 | if(isOAS3 && isOAS3()) { 11 | // isOAS3 selector exists, and returns true 12 | return cb(null, null) 13 | } 14 | 15 | const { AST } = ctx 16 | var editorValue = editor.getValue() 17 | const path = getPathForPosition({ pos, prefix, editorValue, AST}) 18 | 19 | const suggestions = getKeywordsForPath({ system, path, keywordMap }) 20 | cb(null, suggestions) 21 | } 22 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-keywords/index.js: -------------------------------------------------------------------------------- 1 | import * as wrapActions from "./wrap-actions" 2 | 3 | export default function EditorAutosuggestKeywordsPlugin() { 4 | return { 5 | statePlugins: { 6 | editor: { 7 | wrapActions, 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-keywords/wrap-actions.js: -------------------------------------------------------------------------------- 1 | import getCompletions from "./get-completions" 2 | 3 | // Add an autosuggest completer 4 | export const addAutosuggestionCompleters = (ori, system) => (context) => { 5 | return ori(context).concat([{ 6 | getCompletions(...args) { 7 | // Add `context`, then `system` as the last args 8 | return getCompletions(...args, context, system) 9 | } 10 | }]) 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-oas3-keywords/get-completions.js: -------------------------------------------------------------------------------- 1 | import keywordMap from "./keyword-map" 2 | import getKeywordsForPath from "./get-keywords-for-path" 3 | 4 | export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) { 5 | 6 | const { fn: { getPathForPosition }, specSelectors } = system 7 | 8 | const { isOAS3 } = specSelectors 9 | 10 | if(isOAS3 && !isOAS3()) { 11 | // isOAS3 selector exists, and returns false 12 | return cb(null, null) 13 | } 14 | 15 | const { AST } = ctx 16 | var editorValue = editor.getValue() 17 | const path = getPathForPosition({ pos, prefix, editorValue, AST}) 18 | 19 | const suggestions = getKeywordsForPath({ system, path, keywordMap }) 20 | cb(null, suggestions) 21 | } 22 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-oas3-keywords/index.js: -------------------------------------------------------------------------------- 1 | import * as wrapActions from "./wrap-actions" 2 | 3 | export default function EditorAutosuggestOAS3KeywordsPlugin() { 4 | return { 5 | statePlugins: { 6 | editor: { 7 | wrapActions, 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-oas3-keywords/keyword-map.js: -------------------------------------------------------------------------------- 1 | import { 2 | ExternalDocumentation, 3 | Info, 4 | SecurityRequirement, 5 | Server, 6 | Tag, 7 | Components, 8 | Paths 9 | } from "./oas3-objects.js" 10 | 11 | export default { 12 | openapi: String, 13 | info: Info, 14 | servers: [Server], 15 | paths: Paths, 16 | components: Components, 17 | security: [SecurityRequirement], 18 | tags: [Tag], 19 | externalDocs: ExternalDocumentation 20 | } 21 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-oas3-keywords/wrap-actions.js: -------------------------------------------------------------------------------- 1 | import getCompletions from "./get-completions" 2 | 3 | // Add an autosuggest completer 4 | export const addAutosuggestionCompleters = (ori, system) => (context) => { 5 | return ori(context).concat([{ 6 | getCompletions(...args) { 7 | // Add `context`, then `system` as the last args 8 | return getCompletions(...args, context, system) 9 | } 10 | }]) 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-refs/get-completions.js: -------------------------------------------------------------------------------- 1 | import getRefsForPath from "./get-refs-for-path" 2 | 3 | export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) { 4 | 5 | const { fn: { getPathForPosition } } = system 6 | const { AST } = ctx 7 | var editorValue = editor.getValue() 8 | const path = getPathForPosition({ pos, prefix, editorValue, AST}) 9 | 10 | const suggestions = getRefsForPath({ system, path}) 11 | cb(null, suggestions) 12 | } 13 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-refs/index.js: -------------------------------------------------------------------------------- 1 | import * as wrapActions from "./wrap-actions" 2 | 3 | export default function EditorAutosuggestRefsPlugin() { 4 | return { 5 | statePlugins: { 6 | editor: { 7 | wrapActions, 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-refs/wrap-actions.js: -------------------------------------------------------------------------------- 1 | import getCompletions from "./get-completions" 2 | 3 | // Add an autosuggest completer 4 | export const addAutosuggestionCompleters = (ori, system) => (context) => { 5 | return ori(context).concat([{ 6 | getCompletions(...args) { 7 | // Add `context`, then `system` as the last args 8 | return getCompletions(...args, context, system) 9 | } 10 | }]) 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-snippets/get-completions.js: -------------------------------------------------------------------------------- 1 | import snippets from "./snippets" 2 | import getSnippetsForPath from "./get-snippets-for-path" 3 | 4 | export default function getCompletions(editor, session, pos, prefix, cb, ctx, system) { 5 | 6 | const { fn: { getPathForPosition }, specSelectors } = system 7 | const { isOAS3 } = specSelectors 8 | 9 | if(isOAS3 && isOAS3()) { 10 | // isOAS3 selector exists, and returns true 11 | return cb(null, null) 12 | } 13 | 14 | const { AST } = ctx 15 | const editorValue = editor.getValue() 16 | const path = getPathForPosition({ pos, prefix, editorValue, AST}) 17 | 18 | const suggestions = getSnippetsForPath({ path, snippets}) 19 | 20 | return cb(null, suggestions) 21 | } 22 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-snippets/index.js: -------------------------------------------------------------------------------- 1 | import * as wrapActions from "./wrap-actions" 2 | 3 | export default function EditorAutosuggestSnippetsPlugin() { 4 | return { 5 | statePlugins: { 6 | editor: { 7 | wrapActions, 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest-snippets/wrap-actions.js: -------------------------------------------------------------------------------- 1 | import getCompletions from "./get-completions" 2 | 3 | // Add an autosuggest completer 4 | export const addAutosuggestionCompleters = (ori, system) => (context) => { 5 | return ori(context).concat([{ 6 | getCompletions(...args) { 7 | // Add `context`, then `system` as the last args 8 | return getCompletions(...args, context, system) 9 | } 10 | }]) 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-autosuggest/actions.js: -------------------------------------------------------------------------------- 1 | // Enable Ace editor autocompletions 2 | export const enableAutocompletions = ({editor}) => () => { 3 | editor.setOptions({ 4 | enableBasicAutocompletion: true, 5 | enableSnippets: true, 6 | enableLiveAutocompletion: true 7 | }) 8 | } 9 | 10 | // Add completers. Just override this method. And concat on your completer(s) 11 | // see: https://github.com/ajaxorg/ace/blob/master/lib/ace/autocomplete.js 12 | // eg: return ori(...args).concat({ getCompletions() {...}}) 13 | export const addAutosuggestionCompleters = () => () => { 14 | return [] 15 | } 16 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor-metadata/index.js: -------------------------------------------------------------------------------- 1 | export default function(system) { 2 | return { 3 | rootInjects: { 4 | getEditorMetadata() { 5 | const allErrors = system.errSelectors.allErrors() 6 | return { 7 | contentString: system.specSelectors.specStr(), 8 | contentObject: system.specSelectors.specJson().toJS(), 9 | isValid: allErrors.size === 0, 10 | errors: allErrors.toJS() 11 | } 12 | } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/actions.js: -------------------------------------------------------------------------------- 1 | export const JUMP_TO_LINE = "jump_to_line" 2 | 3 | export function jumpToLine(line) { 4 | return { 5 | type: JUMP_TO_LINE, 6 | payload: line 7 | } 8 | 9 | } 10 | 11 | // This is a hook. Will have editor instance 12 | // It needs to be an async-function, to avoid dispatching an object to the reducer 13 | export const onLoad = () => () => {} 14 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/components/brace-snippets-yaml.js: -------------------------------------------------------------------------------- 1 | /* global ace */ 2 | ace.define("ace/snippets/yaml", 3 | ["require","exports","module"], function(e,t,n){ // eslint-disable-line no-unused-vars 4 | t.snippetText=undefined 5 | t.scope="yaml" 6 | }) 7 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/editor-plugins/gutter-click.js: -------------------------------------------------------------------------------- 1 | import isFunction from "lodash/isFunction" 2 | 3 | export default function(editor, { onGutterClick }) { 4 | editor.on("guttermousedown", (e) => { 5 | let editor = e.editor 6 | let line = e.getDocumentPosition().row 7 | let region = editor.renderer.$gutterLayer.getRegion(e) 8 | 9 | e.stop() 10 | 11 | if(isFunction(onGutterClick)) { 12 | onGutterClick({ region, line }) 13 | } 14 | 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/editor-plugins/hook.js: -------------------------------------------------------------------------------- 1 | // TODO: Turn these into actions, that we can override 2 | import GutterClick from "./gutter-click" 3 | import JsonToYaml from "./json-to-yaml" 4 | import TabHandler from "./tab-handler" 5 | 6 | const plugins = [ 7 | {fn: GutterClick, name: "gutterClick"}, 8 | {fn: JsonToYaml, name: "jsonToYaml"}, 9 | {fn: TabHandler, name: "tabHandler"}, 10 | ] 11 | 12 | export default function (editor, props = {}, editorPluginsToRun = [], helpers = {}) { 13 | plugins 14 | .filter(plugin => ~editorPluginsToRun.indexOf(plugin.name)) 15 | .forEach( plugin => { 16 | try { 17 | plugin.fn(editor, props, helpers) 18 | } catch(e) { 19 | console.error(`${plugin.name || ""} plugin error:`, e) 20 | } 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/editor-plugins/tab-handler.js: -------------------------------------------------------------------------------- 1 | export default function(editor) { 2 | // NOTE: react-ace has an onPaste prop.. we could refactor to that. 3 | editor.on("paste", e => { 4 | // replace all U+0009 tabs in pasted string with two spaces 5 | e.text = e.text.replace(/\t/g, " ") 6 | }) 7 | } 8 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/index.js: -------------------------------------------------------------------------------- 1 | import makeEditor from "./components/editor" 2 | import EditorContainer from "./components/editor-container" 3 | import * as actions from "./actions" 4 | import reducers from "./reducers" 5 | import * as selectors from "./selectors" 6 | import EditorSpecPlugin from "./spec" 7 | 8 | let Editor = makeEditor({ 9 | editorPluginsToRun: ["gutterClick", "jsonToYaml", "pasteHandler"] 10 | }) 11 | 12 | export default function () { 13 | return [EditorSpecPlugin, { 14 | components: { Editor, EditorContainer }, 15 | statePlugins: { 16 | editor: { 17 | reducers, 18 | actions, 19 | selectors 20 | } 21 | } 22 | }] 23 | } 24 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/reducers.js: -------------------------------------------------------------------------------- 1 | import { 2 | JUMP_TO_LINE 3 | } from "./actions" 4 | 5 | export default { 6 | [JUMP_TO_LINE]: (state, { payload } ) =>{ 7 | return state.set("gotoLine", { line: payload }) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/editor/selectors.js: -------------------------------------------------------------------------------- 1 | import { createSelector } from "reselect" 2 | import Im from "immutable" 3 | 4 | const state = state => { 5 | return state || Im.Map() 6 | } 7 | 8 | export const gotoLine = createSelector( 9 | state, 10 | state => { 11 | return state.get("gotoLine") || null 12 | } 13 | ) 14 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/json-schema-validator/validator.worker.js: -------------------------------------------------------------------------------- 1 | import "src/polyfills" 2 | import registerPromiseWorker from "promise-worker/register" 3 | import Validator from "./validator" 4 | 5 | const validator = new Validator() 6 | 7 | registerPromiseWorker(({ type, payload }) => { 8 | if (type == "add-schema") { 9 | const { schema, schemaPath } = payload 10 | validator.addSchema(schema, schemaPath) 11 | return 12 | } 13 | 14 | if (type == "validate") { 15 | const { jsSpec, specStr, schemaPath, source } = payload 16 | let validationResults = validator.validate({ 17 | jsSpec, 18 | specStr, 19 | schemaPath, 20 | source 21 | }) 22 | 23 | return { results: validationResults } 24 | } 25 | }) 26 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/json-schema-validator/validator/shared.js: -------------------------------------------------------------------------------- 1 | // export * from './ast.js' 2 | // These import/exports are shared code between worker and main bundle. 3 | // Putting them here keeps the distiction clear 4 | export { getLineNumberForPath } from "../../ast/ast.js" 5 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/jump-to-path/index.js: -------------------------------------------------------------------------------- 1 | import spec from "./spec" 2 | import * as components from "./components" 3 | 4 | export default function JumpToPathPlugin() { 5 | return [ 6 | spec, 7 | { 8 | components, 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/jump-to-path/jump-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/refs-util.js: -------------------------------------------------------------------------------- 1 | import qs from "querystring-browser" 2 | 3 | /** 4 | * Unescapes a JSON pointer. 5 | * @api public 6 | */ 7 | export function unescapeJsonPointerToken(token) { 8 | if (typeof token !== "string") { 9 | return token 10 | } 11 | return qs.unescape(token.replace(/~1/g, "/").replace(/~0/g, "~")) 12 | } 13 | 14 | /** 15 | * Escapes a JSON pointer. 16 | * @api public 17 | */ 18 | export function escapeJsonPointerToken(token) { 19 | return qs.escape(token.replace(/~/g, "~0").replace(/\//g, "~1")) 20 | } 21 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/split-pane-mode/index.js: -------------------------------------------------------------------------------- 1 | import SplitPaneMode from "./components/split-pane-mode" 2 | export default function SplitPaneModePlugin() { 3 | return { 4 | // statePlugins: { 5 | // layout: { 6 | // actions, 7 | // selectors, 8 | // } 9 | // }, 10 | 11 | components: { 12 | SplitPaneMode 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/validate-semantic/helpers.js: -------------------------------------------------------------------------------- 1 | const HARD_CYCLE_LIMIT = 200 2 | 3 | export function getRootNode(node) { 4 | var i = 0 5 | while(node.notRoot && i < HARD_CYCLE_LIMIT) { 6 | node = node.parent 7 | i++ 8 | } 9 | return node || {} 10 | } 11 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/validate-semantic/validators/2and3/operations.js: -------------------------------------------------------------------------------- 1 | export const validate2And3OperationHasUniqueId = () => sys => { 2 | return sys.validateSelectors 3 | .allOperations() 4 | .then(nodes => { 5 | const seen = [] 6 | return nodes.reduce((acc, node) => { 7 | const value = node.node 8 | 9 | const id = value.operationId 10 | 11 | if (id) { 12 | if (seen.indexOf(id) > -1) { 13 | acc.push({ 14 | level: "error", 15 | message: "Operations must have unique operationIds.", 16 | path: [...node.path, "operationId"] 17 | }) 18 | } 19 | seen.push(id) 20 | } 21 | return acc 22 | }, []) 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/validate-semantic/validators/2and3/tags.js: -------------------------------------------------------------------------------- 1 | export const validate2And3TagObjectsHaveUniqueNames = () => (system) => { 2 | return system.validateSelectors 3 | .allTags() 4 | .then(nodes => { 5 | const seenNames = [] 6 | return nodes.reduce((acc, node) => { 7 | const tagObj = node.node 8 | const { name } = tagObj || {} 9 | if(!name || seenNames.indexOf(name) > -1) { 10 | acc.push({ 11 | message: "Tag Objects must have unique `name` field values.", 12 | path: node.path, 13 | level: "error", 14 | }) 15 | } else { 16 | seenNames.push(name) 17 | } 18 | return acc 19 | }, []) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/validate-semantic/validators/oas3/components.js: -------------------------------------------------------------------------------- 1 | export const COMPONENT_NAME_REGEX = /^[A-Za-z0-9\-\._]+$/ 2 | 3 | export const validateOAS3ComponentNames = () => (system) => { 4 | return system.validateSelectors 5 | .allOAS3Components() 6 | .then(nodes => { 7 | return nodes.reduce((acc, node) => { 8 | if(!COMPONENT_NAME_REGEX.test(node.key)) { 9 | acc.push({ 10 | level: "error", 11 | message: "Component names can only contain the characters A-Z a-z 0-9 - . _", 12 | path: node.path 13 | }) 14 | } 15 | return acc 16 | }, []) 17 | }) 18 | } -------------------------------------------------------------------------------- /praxis-openapi-editor/src/plugins/validate-semantic/validators/oas3/operations.js: -------------------------------------------------------------------------------- 1 | export const validateOAS3GetAndDeleteOpsHaveNoRequestBody = () => sys => { 2 | return sys.validateSelectors 3 | .allOperations() 4 | .then(nodes => { 5 | return nodes.reduce((acc, node) => { 6 | const key = (node.key || "").toLowerCase() 7 | const value = node.node 8 | 9 | if((key === "get" || key === "delete") && value.requestBody !== undefined) { 10 | acc.push({ 11 | level: "error", 12 | message: `${key.toUpperCase()} operations cannot have a requestBody.`, 13 | path: [...node.path, "requestBody"] 14 | }) 15 | } 16 | return acc 17 | }, []) 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/polyfills.js: -------------------------------------------------------------------------------- 1 | require("core-js/fn/object/values") 2 | require("core-js/fn/object/assign") 3 | require("core-js/es6/string") 4 | require("core-js/es6/array") 5 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/README.md: -------------------------------------------------------------------------------- 1 | This is the Editor's Standalone preset - it adds some features used by [editor.swagger.io](http://editor.swagger.io): 2 | 3 | - Topbar with Swagger branding 4 | - URL/File import 5 | - YAML conversion trigger 6 | - JSON/YAML export 7 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/index.js: -------------------------------------------------------------------------------- 1 | import TopbarPlugin from "./topbar" 2 | import TopbarInsertPlugin from "./topbar-insert" 3 | import TopbarMenuFileImportFile from "./topbar-menu-file-import_file" 4 | import TopbarMenuEditConvert from "./topbar-menu-edit-convert" 5 | import StandaloneLayout from "./standalone-layout" 6 | 7 | let StandaloneLayoutPlugin = function() { 8 | return { 9 | components: { 10 | StandaloneLayout 11 | } 12 | } 13 | } 14 | 15 | export default function () { 16 | return [ 17 | TopbarPlugin, 18 | TopbarInsertPlugin, 19 | TopbarMenuFileImportFile, 20 | TopbarMenuEditConvert, 21 | StandaloneLayoutPlugin 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/standalone-layout.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import PropTypes from "prop-types" 3 | 4 | export default class StandaloneLayout extends React.Component { 5 | 6 | static propTypes = { 7 | specActions: PropTypes.object.isRequired, 8 | getComponent: PropTypes.func.isRequired, 9 | } 10 | 11 | render() { 12 | const { getComponent } = this.props 13 | const EditorLayout = getComponent("EditorLayout", true) 14 | const Topbar = getComponent("Topbar", true) 15 | 16 | return ( 17 |
18 | 19 | 20 |
21 | ) 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/styles/main.less: -------------------------------------------------------------------------------- 1 | @import "topbar-insert-forms.less"; 2 | @import "topbar-modal.less"; 3 | @import "topbar.less"; -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/topbar-insert/dropdown/DropdownItem.jsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import PropTypes from "prop-types" 3 | 4 | const DropdownItem = (props) => ( 5 |
6 |
  • 7 | 8 |
  • 9 | {props.endsSection &&
    } 10 |
    11 | ) 12 | 13 | DropdownItem.propTypes = { 14 | onClick: PropTypes.func, 15 | name: PropTypes.string, 16 | endsSection: PropTypes.bool 17 | } 18 | 19 | export default DropdownItem 20 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/topbar-insert/forms/components/FormInputWrapper.jsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import PropTypes from "prop-types" 3 | 4 | const FormInputWrapper = props => ( 5 |
    6 | 14 | {props.children} 15 |
    16 | ) 17 | 18 | FormInputWrapper.propTypes = { 19 | name: PropTypes.string, 20 | description: PropTypes.string, 21 | isRequired: PropTypes.bool, 22 | children: PropTypes.oneOfType([ 23 | PropTypes.array, 24 | PropTypes.element 25 | ]) 26 | } 27 | 28 | export default FormInputWrapper 29 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/topbar-menu-edit-convert/components/convert-definition-menu-item.jsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react" 2 | import PropTypes from "prop-types" 3 | 4 | export default class ConvertDefinitionMenuItem extends Component { 5 | render() { 6 | const { isSwagger2, } = this.props 7 | 8 | if(!isSwagger2) { 9 | return null 10 | } 11 | 12 | return
  • 13 | 14 |
  • 15 | } 16 | } 17 | 18 | ConvertDefinitionMenuItem.propTypes = { 19 | isSwagger2: PropTypes.bool.isRequired, 20 | onClick: PropTypes.func.isRequired, 21 | } -------------------------------------------------------------------------------- /praxis-openapi-editor/src/standalone/topbar-menu-file-import_file/index.js: -------------------------------------------------------------------------------- 1 | import ImportFileMenuItem from "./components/ImportFileMenuItem" 2 | 3 | export default { 4 | components: { 5 | ImportFileMenuItem 6 | } 7 | } -------------------------------------------------------------------------------- /praxis-openapi-editor/src/style.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/praxis-openapi-editor/src/style.css -------------------------------------------------------------------------------- /praxis-openapi-editor/src/styles/_read-only-watermark.less: -------------------------------------------------------------------------------- 1 | .editor-readonly-watermark { 2 | position: absolute; 3 | top: 0; 4 | height: 40px; 5 | left: 0; 6 | right: 0; 7 | padding-right: 20px; 8 | padding-top: 10px; 9 | margin: 0; 10 | 11 | z-index: 2; 12 | color: #fff; 13 | font-weight: bold; 14 | text-align: right; 15 | user-select: none; 16 | pointer-events: none; 17 | 18 | &:before { 19 | z-index: 1; 20 | pointer-events: none; 21 | position: absolute; 22 | content: ' '; 23 | top: 0; 24 | left: 0; 25 | right: 0; 26 | bottom: 0; 27 | 28 | background: linear-gradient( 29 | to right, 30 | rgba(255,255,255,0) 60%, 31 | rgba(145, 145, 145, 0.31) 74%, 32 | rgba(255, 255, 255, 0.17) 100%); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/styles/main.less: -------------------------------------------------------------------------------- 1 | 2 | .swagger-editor { 3 | // Partials 4 | @import './_editor.less'; 5 | @import './_read-only-watermark.less'; 6 | 7 | @import (less) "../../node_modules/swagger-ui/dist/swagger-ui.css"; 8 | } 9 | 10 | .swagger-editor-standalone { 11 | // Standalone preset 12 | @import "../standalone/styles/main.less"; 13 | @import (less) "../../node_modules/react-dd-menu/dist/react-dd-menu.css"; 14 | } 15 | -------------------------------------------------------------------------------- /praxis-openapi-editor/src/window.js: -------------------------------------------------------------------------------- 1 | let win = { 2 | navigator: { 3 | userAgent: "fake!" 4 | }, 5 | document: { 6 | getElementById() {}, 7 | addEventListener() {}, 8 | removeEventListener() {}, 9 | documentElement: { 10 | setAttribute() {}, 11 | } 12 | }, 13 | } 14 | 15 | if(typeof window !== "undefined") { 16 | win = window 17 | } 18 | 19 | export default win 20 | -------------------------------------------------------------------------------- /praxis-openapi-editor/swagger-editor-dist-package/.npmignore: -------------------------------------------------------------------------------- 1 | README.md 2 | deploy.sh 3 | -------------------------------------------------------------------------------- /praxis-openapi-editor/swagger-editor-dist-package/.npmrc: -------------------------------------------------------------------------------- 1 | //registry.npmjs.org/:_authToken=${NPM_TOKEN} 2 | -------------------------------------------------------------------------------- /praxis-openapi-editor/swagger-editor-dist-package/README.md: -------------------------------------------------------------------------------- 1 | This module, `swagger-editor-dist`, exposes Swagger-Editor's entire dist folder as a dependency-free npm module. 2 | 3 | Use `swagger-editor` instead, if you'd like to have npm install dependencies for you. 4 | -------------------------------------------------------------------------------- /praxis-openapi-editor/swagger-editor-dist-package/deploy.sh: -------------------------------------------------------------------------------- 1 | # Deploy `swagger-editor-dist` to npm. 2 | 3 | # Parameter Expansion: http://stackoverflow.com/questions/6393551/what-is-the-meaning-of-0-in-a-bash-script 4 | cd "${0%/*}" 5 | 6 | # Get Editor version 7 | EDITOR_VERSION=$(node -p "require('../package.json').version") 8 | 9 | # Replace our version placeholder with Editor's version 10 | sed -i.bak "s/\$\$VERSION/$EDITOR_VERSION/g" package.json 11 | rm package.json.bak 12 | 13 | # Copy Editor's dist files to our directory 14 | cp ../dist/* . 15 | 16 | # Copy index.html 17 | cp ../index.html . 18 | 19 | # Rewire `./dist` references to `.` in index.html 20 | sed -i.bak "s/\.\/dist/\./g" index.html 21 | rm index.html.bak 22 | 23 | if [ "$PUBLISH_DIST" = "true" ] || [ "$TRAVIS" = "true" ] ; then 24 | npm publish . 25 | else 26 | npm pack . 27 | fi 28 | 29 | find . -not -name .npmignore -not -name .npmrc -not -name deploy.sh -not -name package.json -not -name README.md -not -name *.tgz -delete 30 | -------------------------------------------------------------------------------- /praxis-openapi-editor/swagger-editor-dist-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "swagger-editor-dist", 3 | "version": "$$VERSION", 4 | "main": "swagger-editor.js", 5 | "repository": "git@github.com:swagger-api/swagger-editor.git", 6 | "contributors": [ 7 | "(in alphabetical order)", 8 | "Anna Bodnia ", 9 | "Buu Nguyen ", 10 | "Josh Ponelat ", 11 | "Kyle Shockey ", 12 | "Robert Barnwell ", 13 | "Sahar Jafari " 14 | ], 15 | "license": "Apache-2.0", 16 | "dependencies": {}, 17 | "devDependencies": {} 18 | } 19 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/.eslintrc: -------------------------------------------------------------------------------- 1 | env: 2 | mocha: true 3 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/e2e/.eslintrc: -------------------------------------------------------------------------------- 1 | globals: 2 | cy: false 3 | Cypress: false 4 | expect: false 5 | assert: false 6 | 7 | rules: 8 | "no-console": 0 9 | "no-unused-vars": 0 -------------------------------------------------------------------------------- /praxis-openapi-editor/test/e2e/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } -------------------------------------------------------------------------------- /praxis-openapi-editor/test/e2e/plugins/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example plugins/index.js can be used to load plugins 3 | // 4 | // You can change the location of this file or turn off loading 5 | // the plugins file with the 'pluginsFile' configuration option. 6 | // 7 | // You can read more here: 8 | // https://on.cypress.io/plugins-guide 9 | // *********************************************************** 10 | 11 | // This function is called when a project is opened or re-opened (e.g. due to 12 | // the project's config changing) 13 | 14 | module.exports = (on, config) => { 15 | // `on` is used to hook into various events Cypress emits 16 | // `config` is the resolved Cypress config 17 | } 18 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/e2e/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This is will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/e2e/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import "./commands" 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1480.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1480 - illegal `tokenUrl` in implicit OAuth Flow Object" 3 | input: 4 | openapi: "3.0.0" 5 | info: 6 | version: 1.0.0 7 | title: Swagger Petstore 8 | license: 9 | name: MIT 10 | paths: {} 11 | components: 12 | securitySchemes: 13 | apiOAuth: 14 | type: oauth2 15 | flows: 16 | implicit: 17 | authorizationUrl: 'https://myapi.com/oauth/authorize' 18 | tokenUrl: 'https://myapi.com/oauth/token' 19 | refreshUrl: 'https://myapi.com/oauth/token/refresh' 20 | scopes: 21 | -'write:pets': "modify pets in your account" 22 | output: 23 | length: 1 24 | match: 25 | - level: error 26 | message: |- 27 | should NOT have additional properties 28 | additionalProperty: tokenUrl 29 | path: [components, securitySchemes, apiOAuth, flows, implicit] 30 | source: structural -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1489.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1489 - illegal presence of both `example` and `examples` in Media Type Object" 3 | input: 4 | openapi: 3.0.0 5 | info: 6 | version: "validation" 7 | title: Spec with both example and examples 8 | paths: 9 | /: 10 | get: 11 | responses: 12 | '200': 13 | description: OK 14 | content: 15 | text/plain: 16 | example: sample response 17 | examples: 18 | foo: 19 | value: anonther response 20 | output: 21 | length: 1 22 | match: 23 | - level: error 24 | message: should not have both `example` and `examples`, as they are mutually exclusive 25 | path: [paths, /, get, responses, "200", content, text/plain] 26 | source: structural -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1511.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1511 - illegal `example` in Path Parameter Object" 3 | input: 4 | swagger: '2.0' 5 | info: 6 | version: '1' 7 | title: oneOf validation fail 8 | description: ok 9 | 10 | paths: 11 | /: 12 | get: 13 | summary: Extra `example` field in parameter 14 | description: ok 15 | parameters: 16 | - in: path 17 | name: name 18 | type: string 19 | required: true 20 | example: ok 21 | responses: 22 | "200": 23 | description: Ok 24 | output: 25 | length: 1 26 | match: 27 | - level: error 28 | message: |- 29 | should NOT have additional properties 30 | additionalProperty: example 31 | path: [paths, /, get, parameters, "0"] 32 | source: structural 33 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1672.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1672 - Header Security Scheme Object lacking a `name`" 3 | input: 4 | openapi: 3.0.0 5 | info: 6 | title: "#1672" 7 | version: 1.0.0 8 | paths: {} 9 | components: 10 | schemas: {} 11 | securitySchemes: 12 | headerFoo: 13 | type: apiKey 14 | in: header 15 | links: {} 16 | callbacks: {} 17 | output: 18 | length: 1 19 | match: 20 | - level: error 21 | message: |- 22 | should have required property 'name' 23 | missingProperty: name 24 | path: [components, securitySchemes, headerFoo] 25 | source: structural -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1709.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1709 - relative (badly-formed) OIDC URIs" 3 | input: 4 | openapi: 3.0.0 5 | info: 6 | title: "#1709" 7 | version: "1.0" 8 | servers: 9 | - url: https://api.example.com/v2 10 | paths: {} 11 | components: 12 | securitySchemes: 13 | openId: 14 | type: openIdConnect 15 | openIdConnectUrl: /.well-known/openid-configuration 16 | output: 17 | equal: null # no errors -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1797.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1797 - Missing `required: true` within a 3.0 Path Parameter Object" 3 | input: 4 | openapi: 3.0.0 5 | info: 6 | title: Foo OpenApi Spec 7 | version: 1.0.0 8 | paths: 9 | /: 10 | get: 11 | parameters: 12 | - name: id 13 | in: path 14 | allowEmptyValue: true 15 | schema: 16 | type: integer 17 | format: int32 18 | responses: 19 | '200': 20 | description: ok 21 | output: 22 | length: 1 23 | match: 24 | - level: error 25 | message: |- 26 | should have required property 'required' 27 | missingProperty: required 28 | path: [paths, /, get, parameters, "0"] 29 | source: structural -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1808.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1808 - Misleading errors for a Responses Object within Operation Object" 3 | cases: 4 | - name: in OpenAPI 2.0 5 | input: 6 | swagger: "2.0" 7 | info: 8 | version: 0.0.0 9 | title: test 10 | paths: 11 | /: 12 | get: 13 | responses: {} 14 | output: 15 | length: 1 16 | match: 17 | - level: error 18 | message: should define at least one response 19 | path: [paths, /, get, responses] 20 | source: structural 21 | - name: in OpenAPI 3.0 22 | input: 23 | openapi: "3.0.0" 24 | info: 25 | version: 0.0.0 26 | title: test 27 | paths: 28 | /: 29 | get: 30 | responses: {} 31 | output: 32 | length: 1 33 | match: 34 | - level: error 35 | message: should define at least one response 36 | path: [paths, /, get, responses] 37 | source: structural -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1832.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1832 - Schema Object with a non-valid type" 3 | input: 4 | swagger: '2.0' 5 | info: 6 | title: test 7 | version: 0.0.0 8 | paths: {} 9 | definitions: 10 | Model1: 11 | type: int 12 | output: 13 | length: 1 14 | match: 15 | - level: error 16 | message: |- 17 | should be equal to one of the allowed values 18 | allowedValues: array, boolean, integer, number, object, string 19 | path: [definitions, Model1, type] 20 | source: structural -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/1853.yaml: -------------------------------------------------------------------------------- 1 | meta: 2 | title: "#1853 - OpenAPI 3.0 path parameter missing both `schema` and `content`" 3 | input: 4 | openapi: 3.0.0 5 | info: 6 | title: Contact List API 7 | description: CRUD a simple Contact item. 8 | version: '0.1' 9 | paths: 10 | /: 11 | get: 12 | summary: Get a single contact by Id 13 | operationId: getContactById 14 | responses: 15 | "200": 16 | description: ok 17 | parameters: 18 | - name: contactId 19 | in: path 20 | description: ID of contact to return 21 | required: true 22 | output: 23 | length: 1 24 | match: 25 | - level: error 26 | message: should have either a `schema` or `content` property 27 | path: [paths, /, get, parameters, "0"] 28 | source: structural 29 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/plugins/json-schema-validator/test-documents/tag-object-uniqueness.yaml: -------------------------------------------------------------------------------- 1 | # The Editor's semantic validation handles this better than JSON Schema can, 2 | # so we want it to be disabled in the schema validator. 3 | 4 | meta: 5 | title: "Tag Objects should not be validated for uniqueness" 6 | cases: 7 | - name: in Swagger 2.0 8 | input: 9 | swagger: '2.0' 10 | info: 11 | version: 0.0.0 12 | title: test 13 | tags: 14 | - name: pet 15 | - name: pet 16 | - name: pet 17 | description: Everything about your Pets 18 | paths: {} 19 | output: 20 | equal: null 21 | - name: in OpenAPI 3.0 22 | input: 23 | openapi: 3.0.2 24 | info: 25 | version: 0.0.0 26 | title: test 27 | tags: 28 | - name: pet 29 | - name: pet 30 | - name: pet 31 | description: Everything about your Pets 32 | paths: {} 33 | output: 34 | equal: null 35 | -------------------------------------------------------------------------------- /praxis-openapi-editor/test/unit/setup.js: -------------------------------------------------------------------------------- 1 | if (typeof process === "object") { 2 | require("jsdom-global")() 3 | } 4 | -------------------------------------------------------------------------------- /praxis-openapi-editor/webpack/_helpers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @prettier 3 | */ 4 | 5 | import { gitDescribeSync } from "git-describe" 6 | 7 | export function getRepoInfo() { 8 | try { 9 | return gitDescribeSync(__dirname) 10 | } catch (e) { 11 | console.error(e) 12 | return { 13 | hash: "noGit", 14 | dirty: false, 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /praxis-openapi-editor/webpack/bundle.babel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @prettier 3 | */ 4 | 5 | import configBuilder from "./_config-builder" 6 | 7 | const result = configBuilder( 8 | { 9 | minimize: true, 10 | mangle: true, 11 | sourcemaps: true, 12 | includeDependencies: true, 13 | includeStyles: true, 14 | emitWorkerAssets: true, 15 | }, 16 | { 17 | entry: { 18 | "swagger-editor-bundle": [ 19 | "./src/styles/main.less", 20 | "./src/polyfills.js", 21 | "./src/index.js", 22 | ], 23 | }, 24 | 25 | output: { 26 | library: "SwaggerEditorBundle", 27 | }, 28 | 29 | performance: { 30 | hints: "error", 31 | maxEntrypointSize: 1024000 * 3.25, // MB 32 | maxAssetSize: 1024000 * 3.25, // MB 33 | }, 34 | } 35 | ) 36 | 37 | export default result 38 | -------------------------------------------------------------------------------- /praxis-openapi-editor/webpack/core.babel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @prettier 3 | */ 4 | 5 | import configBuilder from "./_config-builder" 6 | 7 | const result = configBuilder( 8 | { 9 | minimize: true, 10 | mangle: true, 11 | sourcemaps: true, 12 | includeDependencies: false, 13 | includeStyles: false, 14 | emitWorkerAssets: false, 15 | }, 16 | { 17 | entry: { 18 | "swagger-editor": ["./src/polyfills.js", "./src/index.js"], 19 | }, 20 | 21 | output: { 22 | library: "SwaggerEditorBundle", 23 | }, 24 | 25 | performance: { 26 | hints: "error", 27 | maxEntrypointSize: 1024000, // 1MB 28 | maxAssetSize: 1024000, // 1MB 29 | }, 30 | } 31 | ) 32 | 33 | export default result 34 | -------------------------------------------------------------------------------- /praxis-openapi-editor/webpack/standalone.babel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @prettier 3 | */ 4 | 5 | import configBuilder from "./_config-builder" 6 | 7 | const result = configBuilder( 8 | { 9 | minimize: true, 10 | mangle: true, 11 | sourcemaps: true, 12 | includeDependencies: true, 13 | includeStyles: false, 14 | emitWorkerAssets: false, 15 | }, 16 | { 17 | entry: { 18 | "swagger-editor-standalone-preset": [ 19 | "./src/polyfills.js", 20 | "./src/standalone/index.js", 21 | ], 22 | }, 23 | 24 | output: { 25 | library: "SwaggerEditorStandalonePreset", 26 | }, 27 | } 28 | ) 29 | 30 | export default result 31 | -------------------------------------------------------------------------------- /praxis-openapi-editor/webpack/test_deps_size.babel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @prettier 3 | */ 4 | 5 | import configBuilder from "./_config-builder" 6 | 7 | const result = configBuilder( 8 | { 9 | minimize: false, 10 | mangle: false, 11 | sourcemaps: false, 12 | includeDependencies: true, 13 | includeStyles: true, 14 | emitWorkerAssets: false, 15 | }, 16 | { 17 | entry: { 18 | "swagger-editor-bundle": [ 19 | "./src/styles/main.less", 20 | "./src/polyfills.js", 21 | "./src/index.js", 22 | ], 23 | }, 24 | 25 | output: { 26 | library: "SwaggerEditorBundle", 27 | path: path.join( 28 | __dirname, 29 | require("../package.json").config.deps_check_dir 30 | ), 31 | }, 32 | 33 | performance: { 34 | hints: false, 35 | }, 36 | } 37 | ) 38 | 39 | export default result 40 | -------------------------------------------------------------------------------- /web3.js/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /web3.js/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | */**/*un~ 4 | *un~ 5 | */**/.DS_Store 6 | npm-debug.log 7 | .npm/ 8 | /coverage 9 | /tmp 10 | node_modules 11 | .idea/ 12 | .npm/ 13 | .vscode/ 14 | dist/ 15 | packages/web3/dist/ 16 | lerna-debug.log 17 | !./dist/web3.min.js 18 | .nyc_output/ 19 | build/ 20 | contracts/ 21 | migrations/ 22 | truffle-config.js 23 | test/config/ensAddresses.json 24 | -------------------------------------------------------------------------------- /web3.js/.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | packages/**/node_modules/ 3 | karma.conf.js 4 | -------------------------------------------------------------------------------- /web3.js/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "browserify": true, 3 | "bitwise": true, 4 | "camelcase": true, 5 | "eqeqeq": true, 6 | "freeze": true, 7 | "funcscope": false, 8 | "maxcomplexity": 15, 9 | "maxdepth": 4, 10 | "maxerr": 50, 11 | /*"maxlen": 80*/ /*this should be our goal*/ 12 | /*"maxparams": 3,*/ 13 | "nonew": true, 14 | "unused": true, 15 | "undef": true, 16 | "predef": [ 17 | "console" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /web3.js/.npmignore: -------------------------------------------------------------------------------- 1 | *.idea 2 | test 3 | dist 4 | docs 5 | coverage 6 | scripts 7 | .gitignore 8 | .editorconfig 9 | .npmignore 10 | .DS_Store 11 | -------------------------------------------------------------------------------- /web3.js/LICENSE: -------------------------------------------------------------------------------- 1 | This file is part of web3.js. 2 | 3 | web3.js is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU Lesser General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | web3.js is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU Lesser General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public License 14 | along with web3.js. If not, see . 15 | -------------------------------------------------------------------------------- /web3.js/assets/logo/web3js.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/web3.js/assets/logo/web3js.ai -------------------------------------------------------------------------------- /web3.js/assets/logo/web3js.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cspannos/PRAXIS-Blockchain-API-Maximizer/8ee70fc7c85d5bde8da762dbfbefe748d6c89492/web3.js/assets/logo/web3js.jpg -------------------------------------------------------------------------------- /web3.js/docs/web3-net.rst: -------------------------------------------------------------------------------- 1 | .. _net: 2 | 3 | ======== 4 | web3.*.net 5 | ======== 6 | 7 | 8 | The ``web3-net`` package allows you to interact with an Ethereum node's network properties. 9 | 10 | 11 | .. code-block:: javascript 12 | 13 | var Net = require('web3-net'); 14 | 15 | // "Personal.providers.givenProvider" will be set if in an Ethereum supported browser. 16 | var net = new Net(Net.givenProvider || 'ws://some.local-or-remote.node:8546'); 17 | 18 | 19 | // or using the web3 umbrella package 20 | 21 | var Web3 = require('web3'); 22 | var web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546'); 23 | 24 | // -> web3.eth.net 25 | // -> web3.bzz.net 26 | // -> web3.shh.net 27 | 28 | 29 | 30 | ------------------------------------------------------------------------------ 31 | 32 | 33 | .. include:: include_package-net.rst 34 | 35 | 36 | ------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /web3.js/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.2.9", 3 | "lerna": "2.0.0", 4 | "command": { 5 | "init": { 6 | "exact": true 7 | }, 8 | "publish": { 9 | "exact": true, 10 | "skipGit": true 11 | } 12 | }, 13 | "packages": [ 14 | "packages/*" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /web3.js/packages/web3-bzz/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-bzz", 3 | "version": "1.2.9", 4 | "description": "Web3 module to interact with the Swarm network.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-bzz", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "@types/node": "^10.12.18", 17 | "got": "9.6.0", 18 | "swarm-js": "^0.1.40", 19 | "underscore": "1.9.1" 20 | }, 21 | "devDependencies": { 22 | "dtslint": "^3.4.1", 23 | "typescript": "latest" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web3.js/packages/web3-bzz/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-bzz": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-bzz/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "unified-signatures": false, 10 | "no-redundant-jsdoc": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-helpers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core-helpers", 3 | "version": "1.2.9", 4 | "description": "Web3 core tools helper for sub packages. This is an internal package.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core-helpers", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "underscore": "1.9.1", 17 | "web3-eth-iban": "1.2.9", 18 | "web3-utils": "1.2.9" 19 | }, 20 | "devDependencies": { 21 | "@types/node": "^12.12.5", 22 | "dtslint": "^3.4.1", 23 | "typescript": "latest" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-helpers/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-core-helpers": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-helpers/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-method/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core-method", 3 | "version": "1.2.9", 4 | "description": "Creates the methods on the web3 modules. This is an internal package.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core-method", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "@ethersproject/transactions": "^5.0.0-beta.135", 17 | "underscore": "1.9.1", 18 | "web3-core-helpers": "1.2.9", 19 | "web3-core-promievent": "1.2.9", 20 | "web3-core-subscriptions": "1.2.9", 21 | "web3-utils": "1.2.9" 22 | }, 23 | "devDependencies": { 24 | "dtslint": "^3.4.1", 25 | "typescript": "latest" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-method/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-core-method": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-method/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-promievent/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core-promievent", 3 | "version": "1.2.9", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "eventemitter3": { 8 | "version": "3.1.2", 9 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", 10 | "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-promievent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core-promievent", 3 | "version": "1.2.9", 4 | "description": "This package extends the EventEmitter with the Promise class to allow chaining as well as multiple final states of a function.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core-promievent", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "main": "src/index.js", 11 | "dependencies": { 12 | "eventemitter3": "3.1.2" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-requestmanager/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core-requestmanager", 3 | "version": "1.2.9", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "underscore": { 8 | "version": "1.9.1", 9 | "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", 10 | "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-requestmanager/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core-requestmanager", 3 | "version": "1.2.9", 4 | "description": "Web3 module to handle requests to external providers.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core-requestmanager", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "main": "src/index.js", 11 | "dependencies": { 12 | "underscore": "1.9.1", 13 | "web3-core-helpers": "1.2.9", 14 | "web3-providers-http": "1.2.9", 15 | "web3-providers-ipc": "1.2.9", 16 | "web3-providers-ws": "1.2.9" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-subscriptions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core-subscriptions", 3 | "version": "1.2.9", 4 | "description": "Manages web3 subscriptions. This is an internal package.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core-subscriptions", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "eventemitter3": "3.1.2", 17 | "underscore": "1.9.1", 18 | "web3-core-helpers": "1.2.9" 19 | }, 20 | "devDependencies": { 21 | "dtslint": "^3.4.1", 22 | "typescript": "latest" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-subscriptions/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-core-subscriptions": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core-subscriptions/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "unified-signatures": false, 10 | "no-redundant-jsdoc": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-core", 3 | "version": "1.2.9", 4 | "description": "Web3 core tools for sub-packages. This is an internal package.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "@types/bn.js": "^4.11.4", 17 | "@types/node": "^12.6.1", 18 | "bignumber.js": "^9.0.0", 19 | "web3-core-helpers": "1.2.9", 20 | "web3-core-method": "1.2.9", 21 | "web3-core-requestmanager": "1.2.9", 22 | "web3-utils": "1.2.9" 23 | }, 24 | "devDependencies": { 25 | "dtslint": "^3.4.1", 26 | "typescript": "latest" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-core": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-core/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "unified-signatures": false, 10 | "no-redundant-jsdoc": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-abi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-eth-abi", 3 | "version": "1.2.9", 4 | "description": "Web3 module encode and decode EVM in/output.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-eth-abi", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "@ethersproject/abi": "5.0.0-beta.153", 17 | "underscore": "1.9.1", 18 | "web3-utils": "1.2.9" 19 | }, 20 | "devDependencies": { 21 | "dtslint": "^3.4.1", 22 | "typescript": "latest" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-abi/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-eth-abi": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-abi/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "typedef-whitespace": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-accounts/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-eth-accounts": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-accounts/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-contract/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-eth-contract": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-contract/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "no-empty-interface": false, 10 | "unified-signatures": false, 11 | "no-redundant-jsdoc": false 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-ens/src/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of web3.js. 3 | web3.js is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU Lesser General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | web3.js is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License 12 | along with web3.js. If not, see . 13 | */ 14 | /** 15 | * @file index.js 16 | * 17 | * @author Samuel Furter 18 | * @date 2018 19 | */ 20 | 21 | "use strict"; 22 | 23 | var ENS = require('./ENS'); 24 | 25 | module.exports = ENS; 26 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-ens/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-eth-ens": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-ens/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "no-empty-interface": false, 10 | "unified-signatures": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-iban/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-eth-iban", 3 | "version": "1.2.9", 4 | "description": "This package converts Ethereum addresses to IBAN addresses a vice versa.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-eth-iban", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "bn.js": "4.11.8", 17 | "web3-utils": "1.2.9" 18 | }, 19 | "devDependencies": { 20 | "dtslint": "^3.4.1", 21 | "typescript": "latest" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-iban/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-eth-iban": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-iban/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-personal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-eth-personal", 3 | "version": "1.2.9", 4 | "description": "Web3 module to interact with the Ethereum blockchain accounts stored in the node.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-eth-personal", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "@types/node": "^12.6.1", 17 | "web3-core": "1.2.9", 18 | "web3-core-helpers": "1.2.9", 19 | "web3-core-method": "1.2.9", 20 | "web3-net": "1.2.9", 21 | "web3-utils": "1.2.9" 22 | }, 23 | "devDependencies": { 24 | "dtslint": "^3.4.1", 25 | "typescript": "latest" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-personal/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-eth-personal": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth-personal/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "unified-signatures": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-eth": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-eth/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "unified-signatures": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /web3.js/packages/web3-net/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-net", 3 | "version": "1.2.9", 4 | "description": "Web3 module to interact with the Ethereum nodes networking properties.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-net", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "web3-core": "1.2.9", 17 | "web3-core-method": "1.2.9", 18 | "web3-utils": "1.2.9" 19 | }, 20 | "devDependencies": { 21 | "dtslint": "^3.4.1", 22 | "typescript": "latest" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /web3.js/packages/web3-net/types/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of web3.js. 3 | web3.js is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU Lesser General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | web3.js is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License 12 | along with web3.js. If not, see . 13 | */ 14 | /** 15 | * @file index.d.ts 16 | * @author Josh Stevens 17 | * @date 2018 18 | */ 19 | 20 | import { NetworkBase } from 'web3-core'; 21 | 22 | export class Network extends NetworkBase {} 23 | -------------------------------------------------------------------------------- /web3.js/packages/web3-net/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-net": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-net/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-http/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-providers-http", 3 | "version": "1.2.9", 4 | "description": "Module to handle web3 RPC connections over HTTP.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "scripts": { 11 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 12 | }, 13 | "types": "types/index.d.ts", 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "web3-core-helpers": "1.2.9", 17 | "xhr2-cookies": "1.1.0" 18 | }, 19 | "devDependencies": { 20 | "dtslint": "^3.4.1", 21 | "typescript": "latest" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-http/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-providers": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-http/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-ipc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-providers-ipc", 3 | "version": "1.2.9", 4 | "description": "Module to handle web3 RPC connections over IPC sockets.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ipc", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "scripts": { 11 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 12 | }, 13 | "types": "types/index.d.ts", 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "oboe": "2.1.4", 17 | "underscore": "1.9.1", 18 | "web3-core-helpers": "1.2.9" 19 | }, 20 | "devDependencies": { 21 | "@types/node": "^12.12.5", 22 | "dtslint": "^3.4.1", 23 | "typescript": "latest" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-ipc/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-providers": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-ipc/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-ws/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-providers-ws", 3 | "version": "1.2.9", 4 | "description": "Module to handle web3 RPC connections over WebSockets.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "scripts": { 11 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 12 | }, 13 | "types": "types/index.d.ts", 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "eventemitter3": "^4.0.0", 17 | "underscore": "1.9.1", 18 | "web3-core-helpers": "1.2.9", 19 | "websocket": "^1.0.31" 20 | }, 21 | "devDependencies": { 22 | "dtslint": "^3.4.1", 23 | "typescript": "latest" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-ws/src/helpers.js: -------------------------------------------------------------------------------- 1 | var isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; 2 | 3 | var _btoa = null; 4 | var helpers = null; 5 | if (isNode) { 6 | _btoa = function(str) { 7 | return Buffer.from(str).toString('base64'); 8 | }; 9 | var url = require('url'); 10 | if (url.URL) { 11 | // Use the new Node 6+ API for parsing URLs that supports username/password 12 | var newURL = url.URL; 13 | helpers = function(url) { 14 | return new newURL(url); 15 | }; 16 | } else { 17 | // Web3 supports Node.js 5, so fall back to the legacy URL API if necessary 18 | helpers = require('url').parse; 19 | } 20 | } else { 21 | _btoa = btoa.bind(window); 22 | helpers = function(url) { 23 | return new URL(url); 24 | }; 25 | } 26 | 27 | module.exports = { 28 | parseURL: helpers, 29 | btoa: _btoa 30 | }; 31 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-ws/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-providers": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-providers-ws/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /web3.js/packages/web3-shh/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-shh", 3 | "version": "1.2.9", 4 | "description": "Web3 module to interact with the Whisper messaging protocol.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-shh", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "web3-core": "1.2.9", 17 | "web3-core-method": "1.2.9", 18 | "web3-core-subscriptions": "1.2.9", 19 | "web3-net": "1.2.9" 20 | }, 21 | "devDependencies": { 22 | "@types/node": "^12.12.5", 23 | "dtslint": "^3.4.1", 24 | "typescript": "latest" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /web3.js/packages/web3-shh/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-shh": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-shh/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "unified-signatures": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /web3.js/packages/web3-utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web3-utils", 3 | "version": "1.2.9", 4 | "description": "Collection of utility functions used in web3.js.", 5 | "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-utils", 6 | "license": "LGPL-3.0", 7 | "engines": { 8 | "node": ">=8.0.0" 9 | }, 10 | "types": "types/index.d.ts", 11 | "scripts": { 12 | "dtslint": "dtslint --localTs node_modules/typescript/lib types" 13 | }, 14 | "main": "src/index.js", 15 | "dependencies": { 16 | "bn.js": "4.11.8", 17 | "eth-lib": "0.2.7", 18 | "ethereum-bloom-filters": "^1.0.6", 19 | "ethjs-unit": "0.1.6", 20 | "number-to-bn": "1.7.0", 21 | "randombytes": "^2.1.0", 22 | "underscore": "1.9.1", 23 | "utf8": "3.0.0" 24 | }, 25 | "devDependencies": { 26 | "dtslint": "^3.4.1", 27 | "typescript": "latest" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /web3.js/packages/web3-utils/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3-utils": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3-utils/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-redundant-jsdoc": false, 9 | "max-line-length": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /web3.js/packages/web3/angular-patch.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var f = '../../node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; 3 | 4 | // This is because we have to replace the `node:false` in the `/angular-cli-files/models/webpack-configs/browser.js` 5 | // with `node: {crypto: true, stream: true}` to allow web3 to work with angular (as they enforce node: false.) 6 | // as explained here - https://github.com/ethereum/web3.js/issues/2260#issuecomment-458519127 7 | if (fs.existsSync(f)) { 8 | fs.readFile(f, 'utf8', function(err, data) { 9 | if (err) { 10 | return console.log(err); 11 | } 12 | var result = data.replace(/node: false/g, 'node: {crypto: true, stream: true}'); 13 | fs.writeFile(f, result, 'utf8', function(err) { 14 | if (err) return console.log(err); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["es6"], 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "noImplicitThis": true, 8 | "strictNullChecks": true, 9 | "strictFunctionTypes": true, 10 | "noEmit": true, 11 | "allowSyntheticDefaultImports": false, 12 | "baseUrl": ".", 13 | "paths": { 14 | "web3": ["."] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web3.js/packages/web3/types/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "dtslint/dtslint.json", 3 | "rules": { 4 | "semicolon": false, 5 | "no-import-default-of-export-equals": false, 6 | "file-name-casing": [true, "kebab-case"], 7 | "whitespace": false, 8 | "no-unnecessary-class": false, 9 | "unified-signatures": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /web3.js/scripts/e2e.chrome.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ------------------------------------------------------------------------------------- 4 | # Runs mocha tests tagged 'e2e' vs chrome headless + insta-mining ganache client 5 | # ------------------------------------------------------------------------------------- 6 | 7 | # Exit immediately on error 8 | set -o errexit 9 | 10 | # Run cleanup on exit 11 | trap cleanup EXIT 12 | 13 | cleanup() { 14 | if [ -n "$client" ]; then 15 | kill -9 $client 16 | fi 17 | } 18 | 19 | echo " " 20 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 21 | echo "E2E: chrome headless browser " 22 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 23 | echo " " 24 | 25 | # Launch ganache, track its PID and wait until port is open 26 | npx ganache-cli --noVMErrorsOnRPCResponse > /dev/null & 27 | client=$! 28 | npx wait-port 8545 29 | 30 | # Test 31 | karma start \ 32 | --single-run \ 33 | --browsers ChromeHeadless 34 | -------------------------------------------------------------------------------- /web3.js/scripts/e2e.firefox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ------------------------------------------------------------------------------------- 4 | # Runs mocha tests tagged 'e2e' vs firefox headless + insta-mining ganache client 5 | # ------------------------------------------------------------------------------------- 6 | 7 | # Exit immediately on error 8 | set -o errexit 9 | 10 | # Run cleanup on exit 11 | trap cleanup EXIT 12 | 13 | cleanup() { 14 | if [ -n "$client" ]; then 15 | kill -9 $client 16 | fi 17 | } 18 | 19 | echo " " 20 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 21 | echo "E2E: firefox headless browser " 22 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 23 | echo " " 24 | 25 | # Launch ganache, track its PID and wait until port is open 26 | npx ganache-cli --noVMErrorsOnRPCResponse > /dev/null & 27 | client=$! 28 | npx wait-port 8545 29 | 30 | # Test 31 | karma start \ 32 | --single-run \ 33 | --browsers FirefoxHeadless 34 | -------------------------------------------------------------------------------- /web3.js/scripts/e2e.ganache.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # -------------------------------------------------------------------- 4 | # Runs mocha tests tagged 'e2e' using an insta-mining ganache client 5 | # -------------------------------------------------------------------- 6 | 7 | # Exit immediately on error 8 | set -o errexit 9 | 10 | # Run cleanup on exit 11 | trap cleanup EXIT 12 | 13 | cleanup() { 14 | if [ -n "$client" ]; then 15 | kill -9 $client 16 | fi 17 | } 18 | 19 | echo " " 20 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 21 | echo "E2E: ganache insta-mining " 22 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 23 | echo " " 24 | 25 | # Launch ganache, track its PID and wait until port is open 26 | npx ganache-cli --noVMErrorsOnRPCResponse > /dev/null & 27 | client=$! 28 | npx wait-port 8545 29 | 30 | # Test 31 | GANACHE=true nyc --no-clean --silent _mocha -- \ 32 | --reporter spec \ 33 | --grep 'E2E' \ 34 | --timeout 5000 \ 35 | --exit 36 | -------------------------------------------------------------------------------- /web3.js/scripts/e2e.min.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ------------------------------------------------------------------------------------- 4 | # Runs basic min bundle loading check on chrome headless 5 | # ------------------------------------------------------------------------------------- 6 | 7 | # Exit immediately on error 8 | set -o errexit 9 | 10 | echo " " 11 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 12 | echo "E2E: web3/dist/web3.min.js (Chrome). " 13 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 14 | echo " " 15 | 16 | BROWSER_BUNDLE_TEST="publishedDist" karma start \ 17 | --single-run \ 18 | --browsers ChromeHeadless 19 | 20 | echo " " 21 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 22 | echo "E2E: web3/dist/web3.min.js (Chrome). " 23 | echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" 24 | echo " " 25 | 26 | BROWSER_BUNDLE_TEST="gitRepoDist" karma start \ 27 | --single-run \ 28 | --browsers ChromeHeadless 29 | -------------------------------------------------------------------------------- /web3.js/scripts/e2e.windows.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script installs Web3 from virtual registry in a 4 | # Windows env and runs some simple Web3 calls. 5 | 6 | # Exit immediately on error 7 | set -o errexit 8 | 9 | # Setup mock project to install web3 from virtual registry 10 | mkdir windows_test 11 | cp scripts/js/basic_usage.js windows_test/basic_usage.js 12 | cd windows_test 13 | 14 | # Install web3 as dep 15 | npm init --yes 16 | npm install web3@e2e --save --registry http://localhost:4873 17 | ./basic_usage.js 18 | 19 | # Shutdown verdaccio server 20 | cd .. 21 | source verdaccio_pid 22 | kill -9 $VERDACCIO_PID 23 | 24 | # Terminate stray node process 25 | if [ ! -z "$CI" ]; then 26 | kill -9 $(grep node <(ps -ef) | sed 's/.*\travis *\([0-9]*\).*/\1/') 27 | fi 28 | -------------------------------------------------------------------------------- /web3.js/scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script contains conditional installation logic for CI 4 | 5 | # CI jobs we'd like to skip default installation for: 6 | # Helpful for E2E tests where the dev deps might cause problems 7 | skip=( 8 | "e2e_ganache" 9 | "e2e_mosaic" 10 | "e2e_windows" 11 | ) 12 | 13 | if [[ ! " ${skip[@]} " =~ " ${TEST} " ]]; then 14 | npm install 15 | fi 16 | -------------------------------------------------------------------------------- /web3.js/test/e2e.minified.js: -------------------------------------------------------------------------------- 1 | // Simple check to make sure window.web3 is defined for the karma min loading tests 2 | describe('window.Web3 is defined', function () { 3 | 4 | // Referencing `process` throws w/out browserify. 5 | // We want to be skipped during the browserified units tests here. 6 | it("loads", function(){ 7 | try { if (process) return } catch (e) {} 8 | 9 | if (!window.Web3) throw new Error('"window.Web3" was not defined'); 10 | }); 11 | }) 12 | -------------------------------------------------------------------------------- /web3.js/test/errors.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | 4 | var errors = require('../packages/web3-core-helpers/src/errors.js'); 5 | 6 | describe('lib/web3/method', function () { 7 | describe('getCall', function () { 8 | 9 | for(var key in errors) { 10 | it('should return and error', function () { 11 | 12 | assert.instanceOf(errors[key](), Error); 13 | }); 14 | } 15 | 16 | }); 17 | }); 18 | 19 | -------------------------------------------------------------------------------- /web3.js/test/eth.abi.decodeParameter.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var Abi = require('../packages/web3-eth-abi'); 4 | 5 | var tests = [{ 6 | params: ['uint256', '0x0000000000000000000000000000000000000000000000000000000000000010'], 7 | result: "16" 8 | },{ 9 | params: ['string', '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000848656c6c6f212521000000000000000000000000000000000000000000000000'], 10 | result: "Hello!%!" 11 | }]; 12 | 13 | describe('decodeParameter', function () { 14 | tests.forEach(function (test) { 15 | it('should convert correctly', function () { 16 | assert.equal(Abi.decodeParameter.apply(Abi, test.params), test.result); 17 | }); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /web3.js/test/eth.estimateGas.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'estimateGas'; 4 | 5 | var tests = [{ 6 | args: [{ 7 | to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', 8 | data: '0x23455654', 9 | gas: 11, 10 | gasPrice: 11 11 | }], 12 | formattedArgs: [{ 13 | to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', 14 | data: '0x23455654', 15 | gas: '0xb', 16 | gasPrice: '0xb' 17 | }], 18 | result: '0x31981', 19 | formattedResult: 203137, 20 | call: 'eth_'+ method 21 | }]; 22 | 23 | testMethod.runTests('eth', method, tests); 24 | 25 | -------------------------------------------------------------------------------- /web3.js/test/eth.gasPrice.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getGasPrice'; 4 | var methodCall = 'eth_gasPrice'; 5 | 6 | var tests = [{ 7 | result: '0x15f90', 8 | formattedResult: '90000', 9 | call: methodCall 10 | }]; 11 | 12 | 13 | testMethod.runTests('eth', method, tests); 14 | 15 | -------------------------------------------------------------------------------- /web3.js/test/eth.getAccounts.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getAccounts'; 4 | var call = 'eth_accounts'; 5 | 6 | var tests = [{ 7 | result: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', '0x11f4d0a3c12e86b4b5f39b213f7e19d048276dae'], 8 | formattedResult: ['0x47D33b27Bb249a2DBab4C0612BF9CaF4C1950855', '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe'], 9 | call: call 10 | }, 11 | { 12 | result: ['0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe'], 13 | formattedResult: ['0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe'], 14 | call: call 15 | }]; 16 | 17 | 18 | testMethod.runTests('eth', method, tests); 19 | 20 | -------------------------------------------------------------------------------- /web3.js/test/eth.getBlockNumber.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getBlockNumber'; 4 | 5 | var tests = [{ 6 | result: '0xb', 7 | formattedResult: 11, 8 | call: 'eth_blockNumber' 9 | }]; 10 | 11 | 12 | testMethod.runTests('eth', method, tests); 13 | -------------------------------------------------------------------------------- /web3.js/test/eth.getBlockUncleCount.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getBlockUncleCount'; 4 | 5 | var tests = [{ 6 | args: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'], 7 | formattedArgs: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'], 8 | result: '0xb', 9 | formattedResult: 11, 10 | call: 'eth_getUncleCountByBlockHash' 11 | },{ 12 | args: [436], 13 | formattedArgs: ['0x1b4'], 14 | result: '0xb', 15 | formattedResult: 11, 16 | call: 'eth_getUncleCountByBlockNumber' 17 | },{ 18 | args: ['pending'], 19 | formattedArgs: ['pending'], 20 | result: '0xb', 21 | formattedResult: 11, 22 | call: 'eth_getUncleCountByBlockNumber' 23 | }]; 24 | 25 | testMethod.runTests('eth', method, tests); 26 | -------------------------------------------------------------------------------- /web3.js/test/eth.getChainId.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getChainId'; 4 | var methodCall = 'eth_chainId'; 5 | 6 | var tests = [{ 7 | result: '0x01', 8 | formattedResult: 1, 9 | call: methodCall 10 | }]; 11 | 12 | 13 | testMethod.runTests('eth', method, tests); 14 | 15 | -------------------------------------------------------------------------------- /web3.js/test/eth.getCoinbase.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getCoinbase'; 4 | 5 | 6 | var tests = [{ 7 | result: '0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', 8 | formattedResult: '0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', 9 | call: 'eth_coinbase' 10 | }]; 11 | 12 | 13 | testMethod.runTests('eth', method, tests); 14 | -------------------------------------------------------------------------------- /web3.js/test/eth.getHashRate.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getHashrate'; 4 | 5 | 6 | var tests = [{ 7 | result: '0x788a8', 8 | formattedResult: 493736, 9 | call: 'eth_hashrate' 10 | }]; 11 | 12 | 13 | testMethod.runTests('eth', method, tests); 14 | 15 | -------------------------------------------------------------------------------- /web3.js/test/eth.getNodeVersion.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getNodeInfo'; 4 | var call = 'web3_clientVersion'; 5 | 6 | var tests = [{ 7 | result: 'Geth/v1.6.7-stable-ab5646c5/darwin-amd64/go1.8.3', 8 | formattedResult: 'Geth/v1.6.7-stable-ab5646c5/darwin-amd64/go1.8.3', 9 | call: call 10 | }]; 11 | 12 | 13 | testMethod.runTests('eth', method, tests); 14 | -------------------------------------------------------------------------------- /web3.js/test/eth.getWork.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getWork'; 4 | 5 | var tests = [{ 6 | args: [], 7 | formattedArgs: [], 8 | result: true, 9 | formattedResult: true, 10 | call: 'eth_'+ method 11 | }]; 12 | 13 | testMethod.runTests('eth', method, tests); 14 | 15 | -------------------------------------------------------------------------------- /web3.js/test/eth.handleRevert.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var Eth = require('../packages/web3-eth'); 4 | 5 | var eth = new Eth(); 6 | 7 | var setValue = true; 8 | 9 | describe('web3.eth', function () { 10 | describe('handleRevert', function () { 11 | it('should check if handleRevert is set to proper value', function () { 12 | assert.equal(eth.handleRevert, false); 13 | assert.equal(eth.Contract.handleRevert, false); 14 | assert.equal(eth.getCode.method.handleRevert, false); 15 | }); 16 | 17 | it('should set handleRevert for all sub packages', function () { 18 | eth.handleRevert = setValue; 19 | 20 | assert.equal(eth.handleRevert, setValue); 21 | assert.equal(eth.Contract.handleRevert, setValue); 22 | assert.equal(eth.getCode.method.handleRevert, setValue); 23 | }); 24 | }); 25 | }); 26 | 27 | -------------------------------------------------------------------------------- /web3.js/test/eth.isMining.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'isMining'; 4 | var call = 'eth_mining'; 5 | 6 | var tests = [{ 7 | result: true, 8 | formattedResult: true, 9 | call: call 10 | }]; 11 | 12 | 13 | testMethod.runTests('eth', method, tests); 14 | -------------------------------------------------------------------------------- /web3.js/test/eth.net.getPeerCount.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getPeerCount'; 4 | 5 | 6 | var tests = [{ 7 | result: '0xf', 8 | formattedResult: 15, 9 | call: 'net_peerCount' 10 | }]; 11 | 12 | testMethod.runTests(['eth','net'], method, tests); 13 | -------------------------------------------------------------------------------- /web3.js/test/eth.net.isListening.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'isListening'; 4 | 5 | 6 | var tests = [{ 7 | result: true, 8 | formattedResult: true, 9 | call: 'net_listening' 10 | }]; 11 | 12 | testMethod.runTests(['eth','net'], method, tests); 13 | -------------------------------------------------------------------------------- /web3.js/test/eth.net_methods.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var u = require('./helpers/test.utils.js'); 4 | var Eth = require('../packages/web3-eth'); 5 | var eth = new Eth(); 6 | 7 | describe('web3.net', function() { 8 | describe('methods', function() { 9 | u.methodExists(eth.net, 'getId'); 10 | u.methodExists(eth.net, 'getNetworkType'); 11 | u.methodExists(eth.net, 'isListening'); 12 | u.methodExists(eth.net, 'getPeerCount'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /web3.js/test/eth.protocolVersion.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getProtocolVersion'; 4 | var call = 'eth_protocolVersion'; 5 | 6 | var tests = [{ 7 | result: '12345', 8 | formattedResult: '12345', 9 | call: call 10 | }]; 11 | 12 | 13 | testMethod.runTests('eth', method, tests); 14 | -------------------------------------------------------------------------------- /web3.js/test/eth.requestAccounts.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'requestAccounts'; 4 | var call = 'eth_requestAccounts'; 5 | 6 | var tests = [{ 7 | result: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', '0x11f4d0a3c12e86b4b5f39b213f7e19d048276dae'], 8 | formattedResult: ['0x47D33b27Bb249a2DBab4C0612BF9CaF4C1950855', '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe'], 9 | call: call 10 | }, 11 | { 12 | result: ['0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe'], 13 | formattedResult: ['0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe'], 14 | call: call 15 | }]; 16 | 17 | 18 | testMethod.runTests('eth', method, tests); 19 | 20 | -------------------------------------------------------------------------------- /web3.js/test/eth.submitWork.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'submitWork'; 4 | 5 | var tests = [ 6 | { 7 | args: ['0x567890abcdef5555', '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', '0xcdef1234567890abcdef1234567890abcdef0x1234567890abcf1234567890ab'], 8 | formattedArgs: ['0x567890abcdef5555', '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', '0xcdef1234567890abcdef1234567890abcdef0x1234567890abcf1234567890ab'], 9 | result: true, 10 | formattedResult: true, 11 | call: 'eth_'+ method 12 | }]; 13 | 14 | testMethod.runTests('eth', method, tests); 15 | 16 | -------------------------------------------------------------------------------- /web3.js/test/formatters.inputDefaultBlockFormatter.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var formatters = require('../packages/web3-core-helpers/src/formatters.js'); 4 | 5 | var tests = [ 6 | { value: 'genesis', expected: '0x0' }, 7 | { value: 'latest', expected: 'latest' }, 8 | { value: 'pending', expected: 'pending' }, 9 | { value: 'earliest', expected: 'earliest' }, 10 | { value: 1, expected: '0x1' }, 11 | { value: '0x1', expected: '0x1' } 12 | ]; 13 | 14 | describe('lib/web3/formatters', function () { 15 | describe('inputDefaultBlockNumberFormatter', function () { 16 | tests.forEach(function (test) { 17 | it('should turn ' + test.value + ' to ' + test.expected, function () { 18 | assert.strictEqual(formatters.inputDefaultBlockNumberFormatter(test.value), test.expected); 19 | }); 20 | }); 21 | }); 22 | }); 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /web3.js/test/iban.createIndirect.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var Iban = require('../packages/web3-eth-iban'); 4 | 5 | var tests = [ 6 | { institution: 'XREG', identifier: 'GAVOFYORK', expected: 'XE81ETHXREGGAVOFYORK'} 7 | ]; 8 | 9 | describe('lib/web3/iban', function () { 10 | describe('createIndirect', function () { 11 | tests.forEach(function (test) { 12 | it('shoud create indirect iban: ' + test.expected, function () { 13 | assert.deepEqual(Iban.createIndirect({ 14 | institution: test.institution, 15 | identifier: test.identifier 16 | }), new Iban(test.expected)); 17 | }); 18 | }); 19 | }); 20 | }); 21 | 22 | -------------------------------------------------------------------------------- /web3.js/test/jsonrpc.id.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var Jsonrpc = require('../packages/web3-core-requestmanager/src/jsonrpc'); 4 | 5 | describe('lib/web3/jsonrpc', function () { 6 | describe('id', function () { 7 | it('should increment the id', function () { 8 | 9 | // given 10 | var method = 'm'; 11 | 12 | // when 13 | var p1 = Jsonrpc.toPayload(method); 14 | var p2 = Jsonrpc.toPayload(method); 15 | 16 | // then 17 | assert.equal(p2.id, p1.id + 1); 18 | }); 19 | }); 20 | }); 21 | 22 | -------------------------------------------------------------------------------- /web3.js/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --reporter dot 2 | -------------------------------------------------------------------------------- /web3.js/test/personal.getAccounts.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'getAccounts'; 4 | 5 | 6 | var tests = [{ 7 | result: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'], 8 | formattedResult: ['0x47D33b27Bb249a2DBab4C0612BF9CaF4C1950855'], // checksum address 9 | call: 'personal_listAccounts' 10 | }]; 11 | 12 | testMethod.runTests(['eth','personal'], method, tests); 13 | -------------------------------------------------------------------------------- /web3.js/test/personal.lockAccount.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'lockAccount'; 4 | 5 | 6 | var tests = [{ 7 | args: ['0x47D33b27Bb249a2DBab4C0612BF9CaF4C1950855'], // checksum address 8 | formattedArgs: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'], 9 | result: true, 10 | formattedResult: true, 11 | call: 'personal_'+ method 12 | },{ 13 | args: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'], 14 | formattedArgs: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'], 15 | result: true, 16 | formattedResult: true, 17 | call: 'personal_'+ method 18 | }]; 19 | 20 | testMethod.runTests(['eth','personal'], method, tests); 21 | -------------------------------------------------------------------------------- /web3.js/test/personal.newAccount.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'newAccount'; 4 | 5 | 6 | var tests = [{ 7 | args: ['P@ssw0rd!'], 8 | formattedArgs: ['P@ssw0rd!'], 9 | result: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855'], 10 | formattedResult: ['0x47D33b27Bb249a2DBab4C0612BF9CaF4C1950855'], // checksum address 11 | call: 'personal_newAccount' 12 | }]; 13 | 14 | testMethod.runTests(['eth','personal'], method, tests); 15 | 16 | -------------------------------------------------------------------------------- /web3.js/test/personal.unlockAccount.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | 3 | var method = 'unlockAccount'; 4 | 5 | 6 | var tests = [{ 7 | args: ['0x47D33b27Bb249a2DBab4C0612BF9CaF4C1950855', 'P@ssw0rd!'], // checksum address 8 | formattedArgs: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', 'P@ssw0rd!', null], 9 | result: true, 10 | formattedResult: true, 11 | call: 'personal_'+ method 12 | },{ 13 | args: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', 'P@ssw0rd!', 10], 14 | formattedArgs: ['0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', 'P@ssw0rd!', 10], 15 | result: true, 16 | formattedResult: true, 17 | call: 'personal_'+ method 18 | }]; 19 | 20 | testMethod.runTests(['eth','personal'], method, tests); 21 | -------------------------------------------------------------------------------- /web3.js/test/personal_methods.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var u = require('./helpers/test.utils.js'); 4 | var Personal = require('../packages/web3-eth-personal'); 5 | var personal = new Personal(); 6 | 7 | describe('web3.net', function() { 8 | describe('methods', function() { 9 | u.methodExists(personal, 'getAccounts'); 10 | u.methodExists(personal, 'newAccount'); 11 | u.methodExists(personal, 'unlockAccount'); 12 | u.methodExists(personal, 'lockAccount'); 13 | u.methodExists(personal, 'sendTransaction'); 14 | 15 | u.propertyExists(personal, 'net'); 16 | u.methodExists(personal.net, 'getId'); 17 | u.methodExists(personal.net, 'isListening'); 18 | u.methodExists(personal.net, 'getPeerCount'); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /web3.js/test/shh.post.js: -------------------------------------------------------------------------------- 1 | var testMethod = require('./helpers/test.method.js'); 2 | var utils = require('../packages/web3-utils'); 3 | 4 | var method = 'post'; 5 | 6 | var tests = [{ 7 | args: [{ 8 | symKeyID: '123123123ff', 9 | sig: '44ffdd55', 10 | topic: '0xffdd11', 11 | payload: utils.numberToHex('12345'), 12 | ttl: 100, 13 | minPow: 0.5, 14 | powTarget: 3, 15 | padding: '0xffdd4455' 16 | }], 17 | formattedArgs: [{ 18 | symKeyID: '123123123ff', 19 | sig: '44ffdd55', 20 | topic: '0xffdd11', 21 | payload: utils.numberToHex('12345'), 22 | ttl: 100, 23 | minPow: 0.5, 24 | powTarget: 3, 25 | padding: '0xffdd4455' 26 | }], 27 | result: true, 28 | formattedResult: true, 29 | call: 'shh_'+ method 30 | }]; 31 | 32 | testMethod.runTests('shh', method, tests); 33 | 34 | -------------------------------------------------------------------------------- /web3.js/test/sources/Misc.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "Misc", 3 | "abi": [ 4 | { 5 | "inputs": [], 6 | "payable": false, 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | } 10 | ], 11 | "bytecode": "0x6080604052348015600f57600080fd5b50603580601d6000396000f3fe6080604052600080fdfea165627a7a723058205b81906cade92d8eeda5d0627076490bd44b563a504fe790edbcd6afadbe359d0029", 12 | "deployedBytecode": "0x6080604052600080fdfea165627a7a723058205b81906cade92d8eeda5d0627076490bd44b563a504fe790edbcd6afadbe359d0029", 13 | "linkReferences": {}, 14 | "deployedLinkReferences": {} 15 | } 16 | -------------------------------------------------------------------------------- /web3.js/test/sources/Misc.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.1; 2 | 3 | contract Misc { 4 | 5 | string misc; 6 | 7 | constructor() public { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /web3.js/test/sources/Reverts.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "Reverts", 3 | "abi": [ 4 | { 5 | "inputs": [], 6 | "payable": false, 7 | "stateMutability": "nonpayable", 8 | "type": "constructor" 9 | } 10 | ], 11 | "bytecode": "0x6080604052348015600f57600080fd5b506000601a57600080fd5b603e8060276000396000f3fe6080604052600080fdfea265627a7a72315820fd31c994ac2f614e770a2ea9e63f6bc8f05f3e5aa1feb77ad79c3a778d594f4064736f6c634300050b0032", 12 | "deployedBytecode": "0x6080604052600080fdfea265627a7a72315820fd31c994ac2f614e770a2ea9e63f6bc8f05f3e5aa1feb77ad79c3a778d594f4064736f6c634300050b0032", 13 | "linkReferences": {}, 14 | "deployedLinkReferences": {} 15 | } 16 | -------------------------------------------------------------------------------- /web3.js/test/sources/Reverts.sol: -------------------------------------------------------------------------------- 1 | /** 2 | * Source contract for Reverts.json 3 | */ 4 | pragma solidity ^0.5.1; 5 | 6 | contract Reverts { 7 | 8 | constructor() public { 9 | require(false); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /web3.js/test/utils.isBN.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var utils = require('../packages/web3-utils'); 3 | 4 | var BigNumber = require('bn.js'); 5 | 6 | var assert = chai.assert; 7 | 8 | var tests = [ 9 | { value: function () {}, is: false}, 10 | { value: new Function(), is: false}, 11 | { value: 'function', is: false}, 12 | { value: {}, is: false}, 13 | { value: new String('hello'), is: false}, 14 | { value: new BigNumber(0), is: true}, 15 | { value: 132, is: false}, 16 | { value: '0x12', is: false}, 17 | 18 | ]; 19 | 20 | describe('lib/utils/utils', function () { 21 | describe('isBigNumber', function () { 22 | tests.forEach(function (test) { 23 | it('shoud test if value ' + test.func + ' is BigNumber: ' + test.is, function () { 24 | assert.equal(utils.isBN(test.value), test.is); 25 | }); 26 | }); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /web3.js/test/utils.sha3Raw.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var cjsSha3 = require('crypto-js/sha3'); 4 | var sha3Raw = require('../packages/web3-utils').sha3Raw; 5 | 6 | describe('web3.sha3Raw', function () { 7 | it('should return the sha3 hash with hex prefix', function() { 8 | assert.deepEqual(sha3Raw(''), '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'); 9 | }); 10 | 11 | it('should return sha3 with hex prefix', function() { 12 | assert.deepEqual( 13 | sha3Raw('test123'), 14 | '0x' + cjsSha3('test123', {outputLength: 256}).toString() 15 | ); 16 | 17 | assert.deepEqual( 18 | sha3Raw('test(int)'), 19 | '0x' + cjsSha3('test(int)', {outputLength: 256}).toString() 20 | ); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /web3.js/test/utils.soliditySha3Raw.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | var assert = chai.assert; 3 | var soliditySha3Raw = require('../packages/web3-utils').soliditySha3Raw; 4 | 5 | describe('web3.soliditySha3Raw', function () { 6 | it('should return the sha3 hash of a empty string with hex prefix', function () { 7 | assert.deepEqual( 8 | soliditySha3Raw( 9 | {t: 'string', v: ''} 10 | ), 11 | '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' 12 | ); 13 | }); 14 | 15 | it('should return the expected sha3 hash with hex prefix', function () { 16 | assert.deepEqual(soliditySha3Raw( 17 | 'Hello!%', 18 | 2345676856, 19 | '2342342342342342342345676856', 20 | 'Hello!%', 21 | false 22 | ), '0x7eb45eb9a0e1f6904514bc34c8b43e71c2e1f96f21b45ea284a0418cb351ec69'); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /web3.js/test/utils.toNumber.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var utils = require('../packages/web3-utils'); 3 | 4 | describe('lib/utils/utils', function () { 5 | describe('hexToNumber', function () { 6 | it('should return the correct value', function () { 7 | 8 | assert.equal(utils.hexToNumber("0x3e8"), 1000); 9 | assert.equal(utils.hexToNumber('0x1f0fe294a36'), 2134567897654); 10 | // allow compatiblity 11 | assert.equal(utils.hexToNumber(100000), 100000); 12 | }); 13 | 14 | it('should validate hex strings', function() { 15 | try { 16 | utils.hexToNumber('100000'); 17 | assert.fail(); 18 | } catch (error){ 19 | assert(error.message.includes('is not a valid hex string')) 20 | } 21 | }) 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /web3.js/test/utils.toNumberString.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var utils = require('../packages/web3-utils'); 3 | 4 | describe('lib/utils/utils', function () { 5 | describe('hexToNumberString', function () { 6 | it('should return the correct value', function () { 7 | 8 | assert.equal(utils.hexToNumberString("0x3e8"), '1000'); 9 | assert.equal(utils.hexToNumberString('0x1f0fe294a36'), '2134567897654'); 10 | // allow compatiblity 11 | assert.equal(utils.hexToNumberString(100000), '100000'); 12 | }); 13 | 14 | it('should validate hex strings', function() { 15 | try { 16 | utils.hexToNumberString('100000'); 17 | assert.fail(); 18 | } catch (error){ 19 | assert(error.message.includes('is not a valid hex string')) 20 | } 21 | }) 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /web3.js/test/utils_methods.js: -------------------------------------------------------------------------------- 1 | var u = require('./helpers/test.utils.js'); 2 | var utils = require('../packages/web3-utils'); 3 | 4 | describe('utils', function() { 5 | describe('methods', function () { 6 | u.methodExists(utils, 'sha3'); 7 | u.methodExists(utils, 'hexToAscii'); 8 | u.methodExists(utils, 'asciiToHex'); 9 | u.methodExists(utils, 'hexToNumberString'); 10 | u.methodExists(utils, 'numberToHex'); 11 | u.methodExists(utils, 'fromWei'); 12 | u.methodExists(utils, 'toWei'); 13 | u.methodExists(utils, 'toBN'); 14 | u.methodExists(utils, 'isAddress'); 15 | }); 16 | }); 17 | 18 | -------------------------------------------------------------------------------- /web3.js/test/web3_methods.js: -------------------------------------------------------------------------------- 1 | var u = require('./helpers/test.utils.js'); 2 | var Web3 = require('../packages/web3'); 3 | var web3 = new Web3(); 4 | 5 | describe('web3', function() { 6 | describe('methods', function () { 7 | u.methodExists(web3, 'setProvider'); 8 | 9 | u.propertyExists(web3, 'givenProvider'); 10 | 11 | u.propertyExists(web3, 'eth'); 12 | u.propertyExists(web3, 'bzz'); 13 | u.propertyExists(web3, 'shh'); 14 | 15 | u.propertyExists(web3, 'utils'); 16 | }); 17 | }); 18 | 19 | -------------------------------------------------------------------------------- /web3.js/verdaccio.yml: -------------------------------------------------------------------------------- 1 | storage: ./storage 2 | auth: 3 | htpasswd: 4 | file: ./htpasswd 5 | uplinks: 6 | npmjs: 7 | url: https://registry.npmjs.org/ 8 | timeout: 10m 9 | fail_timeout: 10m 10 | max_fails: 20 11 | agent_options: { keepAlive: true, keepAliveMsecs: 1000000, timeout: 100000 } 12 | yarn: 13 | url: https://registry.yarnpkg.com/ 14 | timeout: 10m 15 | fail_timeout: 10m 16 | max_fails: 20 17 | agent_options: { keepAlive: true, keepAliveMsecs: 1000000, timeout: 100000 } 18 | packages: 19 | '@*/*': 20 | # scoped packages 21 | access: $all 22 | publish: $all 23 | proxy: npmjs yarn 24 | '**': 25 | access: $all 26 | publish: $all 27 | proxy: npmjs yarn 28 | logs: 29 | - {type: stdout, format: pretty, level: warn} 30 | server: 31 | keepAliveTimeout: 600 # specified in seconds --------------------------------------------------------------------------------