doc-detective-common 1.21.1-dev.2 → 1.22.0-dev.1

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.
@@ -0,0 +1,92 @@
1
+ language: en-US
2
+ tone_instructions: ''
3
+ early_access: false
4
+ enable_free_tier: true
5
+ reviews:
6
+ profile: chill
7
+ request_changes_workflow: false
8
+ high_level_summary: true
9
+ high_level_summary_placeholder: '@coderabbitai summary'
10
+ auto_title_placeholder: '@coderabbitai'
11
+ review_status: true
12
+ commit_status: true
13
+ poem: true
14
+ collapse_walkthrough: false
15
+ sequence_diagrams: true
16
+ changed_files_summary: true
17
+ labeling_instructions: []
18
+ path_filters: []
19
+ path_instructions: []
20
+ abort_on_close: true
21
+ auto_review:
22
+ enabled: true
23
+ auto_incremental_review: true
24
+ ignore_title_keywords: []
25
+ labels: []
26
+ drafts: false
27
+ base_branches: ["rc"]
28
+ tools:
29
+ shellcheck:
30
+ enabled: true
31
+ ruff:
32
+ enabled: true
33
+ markdownlint:
34
+ enabled: true
35
+ github-checks:
36
+ enabled: true
37
+ timeout_ms: 90000
38
+ languagetool:
39
+ enabled: true
40
+ enabled_only: false
41
+ level: default
42
+ biome:
43
+ enabled: true
44
+ hadolint:
45
+ enabled: true
46
+ swiftlint:
47
+ enabled: true
48
+ phpstan:
49
+ enabled: true
50
+ level: default
51
+ golangci-lint:
52
+ enabled: true
53
+ yamllint:
54
+ enabled: true
55
+ gitleaks:
56
+ enabled: true
57
+ checkov:
58
+ enabled: true
59
+ detekt:
60
+ enabled: true
61
+ eslint:
62
+ enabled: true
63
+ rubocop:
64
+ enabled: true
65
+ buf:
66
+ enabled: true
67
+ regal:
68
+ enabled: true
69
+ actionlint:
70
+ enabled: true
71
+ pmd:
72
+ enabled: true
73
+ cppcheck:
74
+ enabled: true
75
+ semgrep:
76
+ enabled: true
77
+ circleci:
78
+ enabled: true
79
+ chat:
80
+ auto_reply: true
81
+ knowledge_base:
82
+ opt_out: false
83
+ learnings:
84
+ scope: auto
85
+ issues:
86
+ scope: auto
87
+ jira:
88
+ project_keys: []
89
+ linear:
90
+ team_keys: []
91
+ pull_requests:
92
+ scope: auto
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-detective-common",
3
- "version": "1.21.1-dev.2",
3
+ "version": "1.22.0-dev.1",
4
4
  "description": "Shared components for Doc Detective projects.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -20,17 +20,17 @@
20
20
  "homepage": "https://github.com/doc-detective/doc-detective-common#readme",
21
21
  "devDependencies": {
22
22
  "chai": "^5.1.2",
23
- "mocha": "^10.8.2",
23
+ "mocha": "^11.1.0",
24
24
  "sinon": "^19.0.2"
25
25
  },
26
26
  "dependencies": {
27
- "@apidevtools/json-schema-ref-parser": "^11.7.2",
28
- "ajv": "^8.17.1",
27
+ "@apidevtools/json-schema-ref-parser": "^11.7.3",
28
+ "ajv": "8.16.0",
29
29
  "ajv-errors": "^3.0.0",
30
30
  "ajv-formats": "^3.0.1",
31
31
  "ajv-keywords": "^5.1.0",
32
- "axios": "^1.7.7",
33
- "uuid": "^11.0.3",
34
- "yaml": "^2.6.0"
32
+ "axios": "^1.7.9",
33
+ "uuid": "^11.0.5",
34
+ "yaml": "^2.7.0"
35
35
  }
36
36
  }
@@ -27,6 +27,7 @@ async function dereferenceSchemas() {
27
27
  "moveTo_v2.schema.json",
28
28
  "openApi_v2.schema.json",
29
29
  "runShell_v2.schema.json",
30
+ "runCode_v2.schema.json",
30
31
  "saveScreenshot_v2.schema.json",
31
32
  "setVariables_v2.schema.json",
32
33
  "startRecording_v2.schema.json",
@@ -182,6 +182,14 @@
182
182
  "type": "integer",
183
183
  "description": "Height of the window in pixels."
184
184
  },
185
+ "viewport_height": {
186
+ "type": "integer",
187
+ "description": "Height of the viewport in pixels. Overrides `height`."
188
+ },
189
+ "viewport_width": {
190
+ "type": "integer",
191
+ "description": "Width of the viewport in pixels. Overrides `width`."
192
+ },
185
193
  "headless": {
186
194
  "type": "boolean",
187
195
  "description": "If `true`, runs the browser in headless mode. Not supported by Safari."
@@ -221,6 +229,18 @@
221
229
  "linux"
222
230
  ]
223
231
  },
232
+ {
233
+ "app": {
234
+ "name": "chrome",
235
+ "options": {
236
+ "viewport_width": 800,
237
+ "viewport_height": 600
238
+ }
239
+ },
240
+ "platforms": [
241
+ "linux"
242
+ ]
243
+ },
224
244
  {
225
245
  "app": {
226
246
  "name": "firefox",
@@ -632,9 +652,28 @@
632
652
  "default": false
633
653
  },
634
654
  "click": {
635
- "type": "boolean",
636
655
  "description": "Click the element.",
637
- "default": false
656
+ "oneOf": [
657
+ {
658
+ "type": "boolean",
659
+ "default": false
660
+ },
661
+ {
662
+ "type": "object",
663
+ "additionalProperties": false,
664
+ "properties": {
665
+ "button": {
666
+ "description": "Kind of click to perform.",
667
+ "type": "string",
668
+ "enum": [
669
+ "left",
670
+ "right",
671
+ "middle"
672
+ ]
673
+ }
674
+ }
675
+ }
676
+ ]
638
677
  },
639
678
  "typeKeys": {
640
679
  "description": "Type keys after finding the element. Either a string or an object with a `keys` field as defined in [`typeKeys`](typeKeys). To type in the element, make the element active with the `click` parameter.",
@@ -723,6 +762,13 @@
723
762
  "click": true,
724
763
  "typeKeys": "shorthair cat"
725
764
  },
765
+ {
766
+ "action": "find",
767
+ "selector": "[title=Search]",
768
+ "click": {
769
+ "button": "right"
770
+ }
771
+ },
726
772
  {
727
773
  "action": "find",
728
774
  "selector": "[title=Search]",
@@ -38,6 +38,14 @@
38
38
  "type": "integer",
39
39
  "description": "Height of the window in pixels."
40
40
  },
41
+ "viewport_height": {
42
+ "type": "integer",
43
+ "description": "Height of the viewport in pixels. Overrides `height`."
44
+ },
45
+ "viewport_width": {
46
+ "type": "integer",
47
+ "description": "Width of the viewport in pixels. Overrides `width`."
48
+ },
41
49
  "headless": {
42
50
  "type": "boolean",
43
51
  "description": "If `true`, runs the browser in headless mode. Not supported by Safari."
@@ -77,6 +85,18 @@
77
85
  "linux"
78
86
  ]
79
87
  },
88
+ {
89
+ "app": {
90
+ "name": "chrome",
91
+ "options": {
92
+ "viewport_width": 800,
93
+ "viewport_height": 600
94
+ }
95
+ },
96
+ "platforms": [
97
+ "linux"
98
+ ]
99
+ },
80
100
  {
81
101
  "app": {
82
102
  "name": "firefox",
@@ -39,9 +39,28 @@
39
39
  "default": false
40
40
  },
41
41
  "click": {
42
- "type": "boolean",
43
42
  "description": "Click the element.",
44
- "default": false
43
+ "oneOf": [
44
+ {
45
+ "type": "boolean",
46
+ "default": false
47
+ },
48
+ {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "properties": {
52
+ "button": {
53
+ "description": "Kind of click to perform.",
54
+ "type": "string",
55
+ "enum": [
56
+ "left",
57
+ "right",
58
+ "middle"
59
+ ]
60
+ }
61
+ }
62
+ }
63
+ ]
45
64
  },
46
65
  "typeKeys": {
47
66
  "description": "Type keys after finding the element. Either a string or an object with a `keys` field as defined in [`typeKeys`](typeKeys). To type in the element, make the element active with the `click` parameter.",
@@ -130,6 +149,13 @@
130
149
  "click": true,
131
150
  "typeKeys": "shorthair cat"
132
151
  },
152
+ {
153
+ "action": "find",
154
+ "selector": "[title=Search]",
155
+ "click": {
156
+ "button": "right"
157
+ }
158
+ },
133
159
  {
134
160
  "action": "find",
135
161
  "selector": "[title=Search]",
@@ -0,0 +1,205 @@
1
+ {
2
+ "title": "runCode",
3
+ "type": "object",
4
+ "description": "Assemble and run code.",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "description": "ID of the step."
9
+ },
10
+ "description": {
11
+ "type": "string",
12
+ "description": "Description of the step."
13
+ },
14
+ "action": {
15
+ "type": "string",
16
+ "const": "runCode",
17
+ "description": "The action to perform."
18
+ },
19
+ "language": {
20
+ "type": "string",
21
+ "description": "Language of the code to run. If not specified, the code is run in the shell.",
22
+ "enum": [
23
+ "shell",
24
+ "python",
25
+ "py",
26
+ "node",
27
+ "bash",
28
+ "sh",
29
+ "javascript",
30
+ "js"
31
+ ]
32
+ },
33
+ "code": {
34
+ "type": "string",
35
+ "description": "Code to run."
36
+ },
37
+ "args": {
38
+ "type": "array",
39
+ "description": "Arguments for the command.",
40
+ "items": {
41
+ "oneOf": [
42
+ {
43
+ "type": "string"
44
+ }
45
+ ]
46
+ },
47
+ "default": []
48
+ },
49
+ "workingDirectory": {
50
+ "type": "string",
51
+ "description": "Working directory for the command.",
52
+ "default": "."
53
+ },
54
+ "exitCodes": {
55
+ "type": "array",
56
+ "description": "Expected exit codes of the command. If the command's actual exit code isn't in this list, the step fails.",
57
+ "items": {
58
+ "oneOf": [
59
+ {
60
+ "type": "integer"
61
+ }
62
+ ]
63
+ },
64
+ "default": [
65
+ 0
66
+ ]
67
+ },
68
+ "output": {
69
+ "type": "string",
70
+ "description": "Content expected in the command's output. If the expected content can't be found in the command's output (either stdout or stderr), the step fails. Supports strings and regular expressions. To use a regular expression, the string must start and end with a forward slash, like in `/^hello-world.*/`."
71
+ },
72
+ "savePath": {
73
+ "type": "string",
74
+ "description": "File path to save the command's output, relative to `saveDirectory`."
75
+ },
76
+ "saveDirectory": {
77
+ "type": "string",
78
+ "description": "Directory to save the command's output. If the directory doesn't exist, creates the directory. If not specified, the directory is your media directory."
79
+ },
80
+ "maxVariation": {
81
+ "type": "integer",
82
+ "description": "Allowed variation in percentage of text different between the current output and previously saved output. If the difference between the current output and the previous output is greater than `maxVariation`, the step fails. If output doesn't exist at `savePath`, this value is ignored.",
83
+ "default": 0,
84
+ "minimum": 0,
85
+ "maximum": 100
86
+ },
87
+ "overwrite": {
88
+ "type": "string",
89
+ "description": "If `true`, overwrites the existing output at `savePath` if it exists.\nIf `byVariation`, overwrites the existing output at `savePath` if the difference between the new output and the existing output is greater than `maxVariation`.",
90
+ "enum": [
91
+ "true",
92
+ "false",
93
+ "byVariation"
94
+ ],
95
+ "default": "false"
96
+ },
97
+ "timeout": {
98
+ "type": "integer",
99
+ "description": "Max time in milliseconds the command is allowed to run. If the command runs longer than this, the step fails.",
100
+ "default": 60000
101
+ },
102
+ "setVariables": {
103
+ "type": "array",
104
+ "description": "Extract environment variables from the command's output.",
105
+ "items": {
106
+ "oneOf": [
107
+ {
108
+ "description": "",
109
+ "type": "object",
110
+ "properties": {
111
+ "name": {
112
+ "description": "Name of the environment variable to set.",
113
+ "type": "string"
114
+ },
115
+ "regex": {
116
+ "description": "Regex to extract the environment variable from the command's output.",
117
+ "type": "string"
118
+ }
119
+ },
120
+ "required": [
121
+ "name",
122
+ "regex"
123
+ ]
124
+ }
125
+ ]
126
+ },
127
+ "default": []
128
+ },
129
+ "outputs": {
130
+ "type": "object",
131
+ "description": "Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence.",
132
+ "patternProperties": {
133
+ "^[A-Za-z0-9_]+$": {
134
+ "type": "string",
135
+ "description": "Runtime expression for a user-defined output value."
136
+ }
137
+ },
138
+ "properties": {
139
+ "stdout": {
140
+ "type": "string",
141
+ "description": "Standard output of the command.",
142
+ "readOnly": true
143
+ },
144
+ "stderr": {
145
+ "type": "string",
146
+ "description": "Standard error of the command.",
147
+ "readOnly": true
148
+ },
149
+ "exitCode": {
150
+ "type": "integer",
151
+ "description": "Exit code of the command.",
152
+ "readOnly": true
153
+ }
154
+ }
155
+ }
156
+ },
157
+ "dynamicDefaults": {
158
+ "id": "uuid"
159
+ },
160
+ "additionalProperties": false,
161
+ "required": [
162
+ "action",
163
+ "code",
164
+ "language"
165
+ ],
166
+ "examples": [
167
+ {
168
+ "action": "runCode",
169
+ "language": "javascript",
170
+ "code": "console.log('Hello, ${process.env.USER}!');"
171
+ },
172
+ {
173
+ "action": "runCode",
174
+ "language": "bash",
175
+ "code": "docker run hello-world",
176
+ "timeout": 20000,
177
+ "exitCodes": [
178
+ 0
179
+ ],
180
+ "output": "Hello from Docker!"
181
+ },
182
+ {
183
+ "action": "runCode",
184
+ "language": "javascript",
185
+ "code": "return false",
186
+ "exitCodes": [
187
+ 1
188
+ ]
189
+ },
190
+ {
191
+ "action": "runCode",
192
+ "language": "python",
193
+ "code": "print('Hello from Python')",
194
+ "workingDirectory": ".",
195
+ "exitCodes": [
196
+ 0
197
+ ],
198
+ "output": "Hello from Python!",
199
+ "savePath": "python-output.txt",
200
+ "saveDirectory": "output",
201
+ "maxVariation": 10,
202
+ "overwrite": "byVariation"
203
+ }
204
+ ]
205
+ }