From 291803c31f829fe0d32bb3207bc11def95a7408c Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Tue, 1 Mar 2022 20:05:50 +0100 Subject: Urađena test aplikacija. Povezan front i back. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../json-schema-traverse/.eslintrc.yml | 27 ++++ .../json-schema-traverse/.github/FUNDING.yml | 2 + .../.github/workflows/build.yml | 28 ++++ .../.github/workflows/publish.yml | 27 ++++ .../node_modules/json-schema-traverse/LICENSE | 21 +++ .../node_modules/json-schema-traverse/README.md | 95 ++++++++++++ .../node_modules/json-schema-traverse/index.d.ts | 40 +++++ .../node_modules/json-schema-traverse/index.js | 93 +++++++++++ .../node_modules/json-schema-traverse/package.json | 43 ++++++ .../json-schema-traverse/spec/.eslintrc.yml | 6 + .../json-schema-traverse/spec/fixtures/schema.js | 125 +++++++++++++++ .../json-schema-traverse/spec/index.spec.js | 171 +++++++++++++++++++++ 12 files changed, 678 insertions(+) create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.eslintrc.yml create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/FUNDING.yml create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/build.yml create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/publish.yml create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/LICENSE create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/README.md create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.d.ts create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.js create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/package.json create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/spec/.eslintrc.yml create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/spec/fixtures/schema.js create mode 100644 sandbox/testAppNevena/Front/node_modules/json-schema-traverse/spec/index.spec.js (limited to 'sandbox/testAppNevena/Front/node_modules/json-schema-traverse') diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.eslintrc.yml b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.eslintrc.yml new file mode 100644 index 00000000..618559ab --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.eslintrc.yml @@ -0,0 +1,27 @@ +extends: eslint:recommended +env: + node: true + browser: true +rules: + block-scoped-var: 2 + complexity: [2, 15] + curly: [2, multi-or-nest, consistent] + dot-location: [2, property] + dot-notation: 2 + indent: [2, 2, SwitchCase: 1] + linebreak-style: [2, unix] + new-cap: 2 + no-console: [2, allow: [warn, error]] + no-else-return: 2 + no-eq-null: 2 + no-fallthrough: 2 + no-invalid-this: 2 + no-return-assign: 2 + no-shadow: 1 + no-trailing-spaces: 2 + no-use-before-define: [2, nofunc] + quotes: [2, single, avoid-escape] + semi: [2, always] + strict: [2, global] + valid-jsdoc: [2, requireReturn: false] + no-control-regex: 0 diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/FUNDING.yml b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/FUNDING.yml new file mode 100644 index 00000000..44f80f41 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: epoberezkin +tidelift: "npm/json-schema-traverse" diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/build.yml b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/build.yml new file mode 100644 index 00000000..f8ef5ba8 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: build + +on: + push: + branches: [master] + pull_request: + branches: ["*"] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/publish.yml b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/publish.yml new file mode 100644 index 00000000..924825b1 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +name: publish + +on: + release: + types: [published] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + - run: npm install + - run: npm test + - name: Publish beta version to npm + if: "github.event.release.prerelease" + run: npm publish --tag beta + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish to npm + if: "!github.event.release.prerelease" + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/LICENSE b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/LICENSE new file mode 100644 index 00000000..7f154356 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/README.md b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/README.md new file mode 100644 index 00000000..f3e60073 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/README.md @@ -0,0 +1,95 @@ +# json-schema-traverse +Traverse JSON Schema passing each schema object to callback + +[![build](https://github.com/epoberezkin/json-schema-traverse/workflows/build/badge.svg)](https://github.com/epoberezkin/json-schema-traverse/actions?query=workflow%3Abuild) +[![npm](https://img.shields.io/npm/v/json-schema-traverse)](https://www.npmjs.com/package/json-schema-traverse) +[![coverage](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) + + +## Install + +``` +npm install json-schema-traverse +``` + + +## Usage + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + properties: { + foo: {type: 'string'}, + bar: {type: 'integer'} + } +}; + +traverse(schema, {cb}); +// cb is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} + +// Or: + +traverse(schema, {cb: {pre, post}}); +// pre is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} +// +// post is called 3 times with: +// 1. {type: 'string'} +// 2. {type: 'integer'} +// 3. root schema + +``` + +Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. + +Callback is passed these parameters: + +- _schema_: the current schema object +- _JSON pointer_: from the root schema to the current schema object +- _root schema_: the schema passed to `traverse` object +- _parent JSON pointer_: from the root schema to the parent schema object (see below) +- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) +- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema +- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` + + +## Traverse objects in all unknown keywords + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + mySchema: { + minimum: 1, + maximum: 2 + } +}; + +traverse(schema, {allKeys: true, cb}); +// cb is called 2 times with: +// 1. root schema +// 2. mySchema +``` + +Without option `allKeys: true` callback will be called only with root schema. + + +## Enterprise support + +json-schema-traverse package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-json-schema-traverse?utm_source=npm-json-schema-traverse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + + +## License + +[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.d.ts b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.d.ts new file mode 100644 index 00000000..0772daed --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.d.ts @@ -0,0 +1,40 @@ +declare function traverse( + schema: traverse.SchemaObject, + opts: traverse.Options, + cb?: traverse.Callback +): void; + +declare function traverse( + schema: traverse.SchemaObject, + cb: traverse.Callback +): void; + +declare namespace traverse { + interface SchemaObject { + $id?: string; + $schema?: string; + [x: string]: any; + } + + type Callback = ( + schema: SchemaObject, + jsonPtr: string, + rootSchema: SchemaObject, + parentJsonPtr?: string, + parentKeyword?: string, + parentSchema?: SchemaObject, + keyIndex?: string | number + ) => void; + + interface Options { + allKeys?: boolean; + cb?: + | Callback + | { + pre?: Callback; + post?: Callback; + }; + } +} + +export = traverse; diff --git a/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.js b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.js new file mode 100644 index 00000000..e521bfa8 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/json-schema-traverse/index.js @@ -0,0 +1,93 @@ +'use strict'; + +var traverse = module.exports = function (schema, opts, cb) { + // Legacy support for v0.3.1 and earlier. + if (typeof opts == 'function') { + cb = opts; + opts = {}; + } + + cb = opts.cb || cb; + var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; + var post = cb.post || function() {}; + + _traverse(opts, pre, post, schema, '', schema); +}; + + +traverse.keywords = { + additionalItems: true, + items: true, + contains: true, + additionalProperties: true, + propertyNames: true, + not: true, + if: true, + then: true, + else: true +}; + +traverse.arrayKeywords = { + items: true, + allOf: true, + anyOf: true, + oneOf: true +}; + +traverse.propsKeywords = { + $defs: true, + definitions: true, + properties: true, + patternProperties: true, + dependencies: true +}; + +traverse.skipKeywords = { + default: true, + enum: true, + const: true, + required: true, + maximum: true, + minimum: true, + exclusiveMaximum: true, + exclusiveMinimum: true, + multipleOf: true, + maxLength: true, + minLength: true, + pattern: true, + format: true, + maxItems: true, + minItems: true, + uniqueItems: true, + maxProperties: true, + minProperties: true +}; + + +function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (schema && typeof schema == 'object' && !Array.isArray(schema)) { + pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + for (var key in schema) { + var sch = schema[key]; + if (Array.isArray(sch)) { + if (key in traverse.arrayKeywords) { + for (var i=0; i