doc-detective-common 1.16.2-dev.0 → 1.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/.devcontainer/devcontainer.json +37 -37
  2. package/.github/FUNDING.yml +14 -14
  3. package/.github/workflows/npm-publish.yml +83 -83
  4. package/.github/workflows/npm-test.yml +43 -43
  5. package/LICENSE +21 -21
  6. package/README.md +81 -81
  7. package/dev/dev.js +2 -2
  8. package/package.json +32 -32
  9. package/src/index.js +4 -4
  10. package/src/schemas/dereferenceSchemas.js +114 -114
  11. package/src/schemas/index.js +5 -5
  12. package/src/schemas/output_schemas/analytics_v1.schema.json +584 -584
  13. package/src/schemas/output_schemas/checkLink_v1.schema.json +41 -41
  14. package/src/schemas/output_schemas/click_v1.schema.json +59 -59
  15. package/src/schemas/output_schemas/config_v2.schema.json +2109 -2110
  16. package/src/schemas/output_schemas/find_v1.schema.json +170 -170
  17. package/src/schemas/output_schemas/goTo_v1.schema.json +29 -29
  18. package/src/schemas/output_schemas/httpRequest_v1.schema.json +114 -114
  19. package/src/schemas/output_schemas/httpRequest_v2.schema.json +189 -190
  20. package/src/schemas/output_schemas/matchText_v1.schema.json +31 -31
  21. package/src/schemas/output_schemas/moveMouse_v1.schema.json +59 -59
  22. package/src/schemas/output_schemas/runShell_v1.schema.json +34 -34
  23. package/src/schemas/output_schemas/screenshot_v1.schema.json +47 -47
  24. package/src/schemas/output_schemas/scroll_v1.schema.json +49 -49
  25. package/src/schemas/output_schemas/spec_v2.schema.json +1435 -1436
  26. package/src/schemas/output_schemas/startRecording_v1.schema.json +54 -54
  27. package/src/schemas/output_schemas/stopRecording_v1.schema.json +19 -19
  28. package/src/schemas/output_schemas/test_v2.schema.json +1177 -1178
  29. package/src/schemas/output_schemas/type_v1.schema.json +61 -61
  30. package/src/schemas/output_schemas/wait_v1.schema.json +41 -41
  31. package/src/schemas/schemas.json +5840 -5844
  32. package/src/schemas/src_schemas/analytics_v1.schema.json +584 -584
  33. package/src/schemas/src_schemas/checkLink_v1.schema.json +41 -41
  34. package/src/schemas/src_schemas/checkLink_v2.schema.json +65 -65
  35. package/src/schemas/src_schemas/click_v1.schema.json +59 -59
  36. package/src/schemas/src_schemas/config_v2.schema.json +891 -891
  37. package/src/schemas/src_schemas/context_v2.schema.json +90 -90
  38. package/src/schemas/src_schemas/find_v1.schema.json +136 -136
  39. package/src/schemas/src_schemas/find_v2.schema.json +99 -99
  40. package/src/schemas/src_schemas/goTo_v1.schema.json +29 -29
  41. package/src/schemas/src_schemas/goTo_v2.schema.json +57 -57
  42. package/src/schemas/src_schemas/httpRequest_v1.schema.json +114 -114
  43. package/src/schemas/src_schemas/httpRequest_v2.schema.json +166 -167
  44. package/src/schemas/src_schemas/matchText_v1.schema.json +31 -31
  45. package/src/schemas/src_schemas/moveMouse_v1.schema.json +59 -59
  46. package/src/schemas/src_schemas/moveTo_v2.schema.json +89 -89
  47. package/src/schemas/src_schemas/runShell_v1.schema.json +34 -34
  48. package/src/schemas/src_schemas/runShell_v2.schema.json +119 -119
  49. package/src/schemas/src_schemas/saveScreenshot_v2.schema.json +72 -72
  50. package/src/schemas/src_schemas/screenshot_v1.schema.json +47 -47
  51. package/src/schemas/src_schemas/scroll_v1.schema.json +49 -49
  52. package/src/schemas/src_schemas/setVariables_v2.schema.json +37 -37
  53. package/src/schemas/src_schemas/spec_v2.schema.json +130 -130
  54. package/src/schemas/src_schemas/startRecording_v1.schema.json +54 -54
  55. package/src/schemas/src_schemas/startRecording_v2.schema.json +54 -54
  56. package/src/schemas/src_schemas/stopRecording_v1.schema.json +19 -19
  57. package/src/schemas/src_schemas/stopRecording_v2.schema.json +31 -31
  58. package/src/schemas/src_schemas/test_v2.schema.json +159 -159
  59. package/src/schemas/src_schemas/typeKeys_v2.schema.json +63 -63
  60. package/src/schemas/src_schemas/type_v1.schema.json +61 -61
  61. package/src/schemas/src_schemas/wait_v1.schema.json +41 -41
  62. package/src/schemas/src_schemas/wait_v2.schema.json +40 -40
  63. package/src/validate.js +43 -43
  64. package/test/schema.test.js +21 -21
@@ -1,37 +1,37 @@
1
- // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
- // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3
- {
4
- "name": "Ubuntu",
5
- // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
- "image": "mcr.microsoft.com/devcontainers/base:jammy",
7
- "features": {
8
- "ghcr.io/devcontainers/features/node:1": {}
9
- },
10
-
11
- // Features to add to the dev container. More info: https://containers.dev/features.
12
- // "features": {},
13
-
14
- // Use 'forwardPorts' to make a list of ports inside the container available locally.
15
- // "forwardPorts": [],
16
-
17
- // Use 'postCreateCommand' to run commands after the container is created.
18
- "postCreateCommand": "npm i",
19
-
20
- // Configure tool-specific properties.
21
- "customizations": {
22
- // Configure properties specific to VS Code.
23
- "vscode": {
24
- // Add the IDs of extensions you want installed when the container is created.
25
- "extensions": [
26
- "github.copilot",
27
- "aaron-bond.better-comments",
28
- "esbenp.prettier-vscode",
29
- "GitHub.vscode-pull-request-github",
30
- "streetsidesoftware.code-spell-checker"
31
- ]
32
- }
33
- }
34
-
35
- // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
36
- // "remoteUser": "root"
37
- }
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3
+ {
4
+ "name": "Ubuntu",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/base:jammy",
7
+ "features": {
8
+ "ghcr.io/devcontainers/features/node:1": {}
9
+ },
10
+
11
+ // Features to add to the dev container. More info: https://containers.dev/features.
12
+ // "features": {},
13
+
14
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
15
+ // "forwardPorts": [],
16
+
17
+ // Use 'postCreateCommand' to run commands after the container is created.
18
+ "postCreateCommand": "npm i",
19
+
20
+ // Configure tool-specific properties.
21
+ "customizations": {
22
+ // Configure properties specific to VS Code.
23
+ "vscode": {
24
+ // Add the IDs of extensions you want installed when the container is created.
25
+ "extensions": [
26
+ "github.copilot",
27
+ "aaron-bond.better-comments",
28
+ "esbenp.prettier-vscode",
29
+ "GitHub.vscode-pull-request-github",
30
+ "streetsidesoftware.code-spell-checker"
31
+ ]
32
+ }
33
+ }
34
+
35
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
36
+ // "remoteUser": "root"
37
+ }
@@ -1,14 +1,14 @@
1
- # These are supported funding model platforms
2
-
3
- github: [doc-detective] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
- patreon: # Replace with a single Patreon username
5
- open_collective: doc-detective # Replace with a single Open Collective username
6
- ko_fi: # Replace with a single Ko-fi username
7
- tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
- community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
- liberapay: # Replace with a single Liberapay username
10
- issuehunt: # Replace with a single IssueHunt username
11
- otechie: # Replace with a single Otechie username
12
- lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13
- polar: # Replace with a single Polar username
14
- custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1
+ # These are supported funding model platforms
2
+
3
+ github: [doc-detective] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: doc-detective # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13
+ polar: # Replace with a single Polar username
14
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -1,83 +1,83 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Publish NPM package
5
-
6
- on:
7
- release:
8
- types: [created]
9
- workflow_dispatch:
10
-
11
- jobs:
12
- test:
13
- runs-on: ${{ matrix.os }}
14
- strategy:
15
- matrix:
16
- os:
17
- - ubuntu-latest
18
- - windows-latest
19
- - macos-latest
20
- node:
21
- - 18
22
- - 20
23
-
24
- steps:
25
- - uses: actions/checkout@v3
26
-
27
- - uses: actions/setup-node@v3
28
- with:
29
- node-version: ${{ matrix.node }}
30
-
31
- - name: Cache node_modules
32
- uses: actions/cache@v3
33
- with:
34
- # Cache key uses the contents of `package-lock.json` to identify unique cache
35
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36
- restore-keys: |
37
- ${{ runner.OS }}-node-
38
- path: |
39
- node_modules
40
-
41
- - run: npm ci
42
-
43
- - run: npm test
44
-
45
- publish-npm:
46
- name: Publish to NPM
47
- needs: test
48
- runs-on: ubuntu-latest
49
- steps:
50
- - uses: actions/checkout@v3
51
- - uses: actions/setup-node@v3
52
- with:
53
- registry-url: https://registry.npmjs.org/
54
- - name: Cache node_modules
55
- uses: actions/cache@v3
56
- with:
57
- # Cache key uses the contents of `package-lock.json` to identify unique cache
58
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
59
- restore-keys: |
60
- ${{ runner.OS }}-node-
61
- path: |
62
- node_modules
63
- - run: npm ci
64
- - run: npm publish
65
- env:
66
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
67
-
68
- update-docs:
69
- name: Update documentation
70
- needs: publish-npm
71
- runs-on: ubuntu-latest
72
- steps:
73
- - uses: actions/checkout@v3
74
-
75
- - name: Get package version
76
- run: echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
77
-
78
- - name: Trigger GitHub Action in doc-detective.github.io
79
- run: |
80
- curl -XPOST -H "Authorization: token ${{ secrets.DOCS_PERSONAL_ACCESS_TOKEN }}" \
81
- -H "Accept: application/vnd.github.everest-preview+json" \
82
- "https://api.github.com/repos/doc-detective/doc-detective.github.io/dispatches" \
83
- -d '{"event_type": "update-common-package-event", "client_payload": {"version": "${{ env.VERSION }}"} }'
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Publish NPM package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ matrix:
16
+ os:
17
+ - ubuntu-latest
18
+ - windows-latest
19
+ - macos-latest
20
+ node:
21
+ - 18
22
+ - 20
23
+
24
+ steps:
25
+ - uses: actions/checkout@v3
26
+
27
+ - uses: actions/setup-node@v3
28
+ with:
29
+ node-version: ${{ matrix.node }}
30
+
31
+ - name: Cache node_modules
32
+ uses: actions/cache@v3
33
+ with:
34
+ # Cache key uses the contents of `package-lock.json` to identify unique cache
35
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36
+ restore-keys: |
37
+ ${{ runner.OS }}-node-
38
+ path: |
39
+ node_modules
40
+
41
+ - run: npm ci
42
+
43
+ - run: npm test
44
+
45
+ publish-npm:
46
+ name: Publish to NPM
47
+ needs: test
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v3
51
+ - uses: actions/setup-node@v3
52
+ with:
53
+ registry-url: https://registry.npmjs.org/
54
+ - name: Cache node_modules
55
+ uses: actions/cache@v3
56
+ with:
57
+ # Cache key uses the contents of `package-lock.json` to identify unique cache
58
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
59
+ restore-keys: |
60
+ ${{ runner.OS }}-node-
61
+ path: |
62
+ node_modules
63
+ - run: npm ci
64
+ - run: npm publish
65
+ env:
66
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
67
+
68
+ update-docs:
69
+ name: Update documentation
70
+ needs: publish-npm
71
+ runs-on: ubuntu-latest
72
+ steps:
73
+ - uses: actions/checkout@v3
74
+
75
+ - name: Get package version
76
+ run: echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
77
+
78
+ - name: Trigger GitHub Action in doc-detective.github.io
79
+ run: |
80
+ curl -XPOST -H "Authorization: token ${{ secrets.DOCS_PERSONAL_ACCESS_TOKEN }}" \
81
+ -H "Accept: application/vnd.github.everest-preview+json" \
82
+ "https://api.github.com/repos/doc-detective/doc-detective.github.io/dispatches" \
83
+ -d '{"event_type": "update-common-package-event", "client_payload": {"version": "${{ env.VERSION }}"} }'
@@ -1,43 +1,43 @@
1
- name: Run tests
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- types: [opened, reopened, synchronize]
9
- workflow_dispatch:
10
-
11
- jobs:
12
- test:
13
- runs-on: ${{ matrix.os }}
14
- strategy:
15
- matrix:
16
- os:
17
- - ubuntu-latest
18
- - windows-latest
19
- - macos-latest
20
- node:
21
- - 18
22
- - 20
23
-
24
- steps:
25
- - uses: actions/checkout@v3
26
-
27
- - uses: actions/setup-node@v3
28
- with:
29
- node-version: ${{ matrix.node }}
30
-
31
- - name: Cache node_modules
32
- uses: actions/cache@v3
33
- with:
34
- # Cache key uses the contents of `package-lock.json` to identify unique cache
35
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36
- restore-keys: |
37
- ${{ runner.OS }}-node-
38
- path: |
39
- node_modules
40
-
41
- - run: npm ci
42
-
43
- - run: npm test
1
+ name: Run tests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ types: [opened, reopened, synchronize]
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ matrix:
16
+ os:
17
+ - ubuntu-latest
18
+ - windows-latest
19
+ - macos-latest
20
+ node:
21
+ - 18
22
+ - 20
23
+
24
+ steps:
25
+ - uses: actions/checkout@v3
26
+
27
+ - uses: actions/setup-node@v3
28
+ with:
29
+ node-version: ${{ matrix.node }}
30
+
31
+ - name: Cache node_modules
32
+ uses: actions/cache@v3
33
+ with:
34
+ # Cache key uses the contents of `package-lock.json` to identify unique cache
35
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36
+ restore-keys: |
37
+ ${{ runner.OS }}-node-
38
+ path: |
39
+ node_modules
40
+
41
+ - run: npm ci
42
+
43
+ - run: npm test
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 doc-detective
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2023 doc-detective
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,81 +1,81 @@
1
- # Doc Detective Common
2
-
3
- ![Current version](https://img.shields.io/github/package-json/v/doc-detective/doc-detective-common?color=orange)
4
- [![NPM Shield](https://img.shields.io/npm/v/doc-detective-common)](https://www.npmjs.com/package/doc-detective-common)
5
- [![Discord Shield](https://img.shields.io/badge/chat-on%20discord-purple)](https://discord.gg/mSCCRAhH)
6
-
7
- Shared resources for Doc Detective projects.
8
-
9
- ## Install
10
-
11
- ```bash
12
- npm i doc-detective-common
13
- ```
14
-
15
- ## Init
16
-
17
- ```javascript
18
- const common = require("doc-detective-common");
19
- ```
20
-
21
- ## Methods
22
-
23
- ### `.validate(schemaKey: string, object: object)`
24
-
25
- Validate that `object` matches the specified [schema](#.schemas) definition.
26
-
27
- Returns an object with the following schema:
28
-
29
- ```json
30
- {
31
- "valid": boolean,
32
- "errors": [
33
- {
34
- "instancePath": string,
35
- "schemaPath": string,
36
- "keyword": string,
37
- "params": [{Object}],
38
- "message": string
39
- }
40
- ]
41
- }
42
- ```
43
-
44
- #### Usage
45
-
46
- ```js
47
- const schemaKey = "runShell_v1";
48
- const object = {
49
- action: "runShell",
50
- command: "echo $username",
51
- };
52
- console.log(common.validate(schemaKey, object));
53
- ```
54
-
55
- ## Objects
56
-
57
- ### `.schemas`
58
-
59
- JSON schema definitions for various objects used throughout Doc Detective.
60
-
61
- Schema objects are located in the [`/schemas`](https://github.com/doc-detective/doc-detective-common/tree/schema/schemas) directory and made available through the `.schemas` object.
62
-
63
- ```json
64
- {
65
- "analytics_v1": {Object},
66
- "checkLink_v1": {Object},
67
- "click_v1": {Object},
68
- "find_v1": {Object},
69
- "goTo_v1": {Object},
70
- "httpRequest_v1": {Object},
71
- "matchText_v1": {Object},
72
- "moveMouse_v1": {Object},
73
- "runShell_v1": {Object},
74
- "screenshot_v1": {Object},
75
- "scroll_v1": {Object},
76
- "startRecording_v1": {Object},
77
- "stopRecording_v1": {Object},
78
- "type_v1": {Object},
79
- "wait_v1": {Object}
80
- }
81
- ```
1
+ # Doc Detective Common
2
+
3
+ ![Current version](https://img.shields.io/github/package-json/v/doc-detective/doc-detective-common?color=orange)
4
+ [![NPM Shield](https://img.shields.io/npm/v/doc-detective-common)](https://www.npmjs.com/package/doc-detective-common)
5
+ [![Discord Shield](https://img.shields.io/badge/chat-on%20discord-purple)](https://discord.gg/mSCCRAhH)
6
+
7
+ Shared resources for Doc Detective projects.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm i doc-detective-common
13
+ ```
14
+
15
+ ## Init
16
+
17
+ ```javascript
18
+ const common = require("doc-detective-common");
19
+ ```
20
+
21
+ ## Methods
22
+
23
+ ### `.validate(schemaKey: string, object: object)`
24
+
25
+ Validate that `object` matches the specified [schema](#.schemas) definition.
26
+
27
+ Returns an object with the following schema:
28
+
29
+ ```json
30
+ {
31
+ "valid": boolean,
32
+ "errors": [
33
+ {
34
+ "instancePath": string,
35
+ "schemaPath": string,
36
+ "keyword": string,
37
+ "params": [{Object}],
38
+ "message": string
39
+ }
40
+ ]
41
+ }
42
+ ```
43
+
44
+ #### Usage
45
+
46
+ ```js
47
+ const schemaKey = "runShell_v1";
48
+ const object = {
49
+ action: "runShell",
50
+ command: "echo $username",
51
+ };
52
+ console.log(common.validate(schemaKey, object));
53
+ ```
54
+
55
+ ## Objects
56
+
57
+ ### `.schemas`
58
+
59
+ JSON schema definitions for various objects used throughout Doc Detective.
60
+
61
+ Schema objects are located in the [`/schemas`](https://github.com/doc-detective/doc-detective-common/tree/schema/schemas) directory and made available through the `.schemas` object.
62
+
63
+ ```json
64
+ {
65
+ "analytics_v1": {Object},
66
+ "checkLink_v1": {Object},
67
+ "click_v1": {Object},
68
+ "find_v1": {Object},
69
+ "goTo_v1": {Object},
70
+ "httpRequest_v1": {Object},
71
+ "matchText_v1": {Object},
72
+ "moveMouse_v1": {Object},
73
+ "runShell_v1": {Object},
74
+ "screenshot_v1": {Object},
75
+ "scroll_v1": {Object},
76
+ "startRecording_v1": {Object},
77
+ "stopRecording_v1": {Object},
78
+ "type_v1": {Object},
79
+ "wait_v1": {Object}
80
+ }
81
+ ```
package/dev/dev.js CHANGED
@@ -1,3 +1,3 @@
1
- const { validate, schemas } = require("../src/index");
2
-
1
+ const { validate, schemas } = require("../src/index");
2
+
3
3
  console.log(validate("find_v2",schemas.find_v2.examples[0]))
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
- {
2
- "name": "doc-detective-common",
3
- "version": "1.16.2-dev.0",
4
- "description": "Shared components for Doc Detective projects.",
5
- "main": "src/index.js",
6
- "scripts": {
7
- "dereferenceSchemas": "node ./src/schemas/dereferenceSchemas.js",
8
- "test:full": "npm run dereferenceSchemas && npm run test",
9
- "test": "jest"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/doc-detective/doc-detective-common.git"
14
- },
15
- "author": "Manny Silva",
16
- "license": "MIT",
17
- "bugs": {
18
- "url": "https://github.com/doc-detective/doc-detective-common/issues"
19
- },
20
- "homepage": "https://github.com/doc-detective/doc-detective-common#readme",
21
- "devDependencies": {
22
- "jest": "^29.7.0"
23
- },
24
- "dependencies": {
25
- "@apidevtools/json-schema-ref-parser": "^11.6.4",
26
- "ajv": "8.16.0",
27
- "ajv-errors": "^3.0.0",
28
- "ajv-formats": "^3.0.1",
29
- "ajv-keywords": "^5.1.0",
30
- "uuid": "^9.0.1"
31
- }
32
- }
1
+ {
2
+ "name": "doc-detective-common",
3
+ "version": "1.16.2",
4
+ "description": "Shared components for Doc Detective projects.",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "dereferenceSchemas": "node ./src/schemas/dereferenceSchemas.js",
8
+ "test:full": "npm run dereferenceSchemas && npm run test",
9
+ "test": "jest"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/doc-detective/doc-detective-common.git"
14
+ },
15
+ "author": "Manny Silva",
16
+ "license": "MIT",
17
+ "bugs": {
18
+ "url": "https://github.com/doc-detective/doc-detective-common/issues"
19
+ },
20
+ "homepage": "https://github.com/doc-detective/doc-detective-common#readme",
21
+ "devDependencies": {
22
+ "jest": "^29.7.0"
23
+ },
24
+ "dependencies": {
25
+ "@apidevtools/json-schema-ref-parser": "^11.6.4",
26
+ "ajv": "8.16.0",
27
+ "ajv-errors": "^3.0.0",
28
+ "ajv-formats": "^3.0.1",
29
+ "ajv-keywords": "^5.1.0",
30
+ "uuid": "^10.0.0"
31
+ }
32
+ }
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
- const { schemas } = require("./schemas");
2
- const { validate } = require("./validate");
3
-
4
- exports.schemas = schemas;
1
+ const { schemas } = require("./schemas");
2
+ const { validate } = require("./validate");
3
+
4
+ exports.schemas = schemas;
5
5
  exports.validate = validate;