@testin-official/xagent 0.3.12 → 0.3.14

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 (69) hide show
  1. package/README.md +98 -2
  2. package/dist/assets/contracts/app-upload.schema.json +3 -2
  3. package/dist/assets/contracts/build-create.schema.json +17 -0
  4. package/dist/assets/contracts/build-list.schema.json +18 -0
  5. package/dist/assets/contracts/build.schema.json +76 -0
  6. package/dist/assets/contracts/execution-target.schema.json +12 -4
  7. package/dist/assets/contracts/fixtures/execution-target.concurrency-twenty-one.invalid.json +4 -0
  8. package/dist/assets/contracts/fixtures/execution-target.concurrency-two.invalid.json +1 -1
  9. package/dist/assets/contracts/fixtures/execution-target.concurrency-two.valid.json +4 -0
  10. package/dist/assets/contracts/fixtures/execution-target.count-eleven.invalid.json +6 -0
  11. package/dist/assets/contracts/fixtures/execution-target.count-two.invalid.json +1 -1
  12. package/dist/assets/contracts/fixtures/execution-target.count-two.valid.json +6 -0
  13. package/dist/assets/contracts/fixtures/execution-target.multiple-devices.invalid.json +23 -1
  14. package/dist/assets/contracts/fixtures/execution-target.multiple-devices.valid.json +4 -0
  15. package/dist/assets/contracts/fixtures/execution-target.multiple-filters.invalid.json +66 -2
  16. package/dist/assets/contracts/fixtures/execution-target.multiple-filters.valid.json +7 -0
  17. package/dist/assets/contracts/fixtures/target-hash-cases.json +52 -1
  18. package/dist/assets/contracts/fixtures/target-preview.success.json +4 -1
  19. package/dist/assets/contracts/fixtures/target-preview.unavailable.json +4 -1
  20. package/dist/assets/contracts/run-create-result.schema.json +18 -0
  21. package/dist/assets/contracts/run-create-v2.schema.json +85 -19
  22. package/dist/assets/contracts/run.schema.json +179 -34
  23. package/dist/assets/contracts/target-preview.schema.json +89 -19
  24. package/dist/cli.d.ts.map +1 -1
  25. package/dist/cli.js +324 -19
  26. package/dist/cli.js.map +1 -1
  27. package/dist/core/version.d.ts +1 -1
  28. package/dist/core/version.js +1 -1
  29. package/dist/project/target-matrix.d.ts +4 -0
  30. package/dist/project/target-matrix.d.ts.map +1 -0
  31. package/dist/project/target-matrix.js +26 -0
  32. package/dist/project/target-matrix.js.map +1 -0
  33. package/dist/run/batch.d.ts +44 -0
  34. package/dist/run/batch.d.ts.map +1 -0
  35. package/dist/run/batch.js +261 -0
  36. package/dist/run/batch.js.map +1 -0
  37. package/dist/run/builds.d.ts +20 -0
  38. package/dist/run/builds.d.ts.map +1 -0
  39. package/dist/run/builds.js +70 -0
  40. package/dist/run/builds.js.map +1 -0
  41. package/dist/run/create-result.d.ts +6 -0
  42. package/dist/run/create-result.d.ts.map +1 -0
  43. package/dist/run/create-result.js +18 -0
  44. package/dist/run/create-result.js.map +1 -0
  45. package/dist/run/exit-codes.d.ts +8 -0
  46. package/dist/run/exit-codes.d.ts.map +1 -0
  47. package/dist/run/exit-codes.js +47 -0
  48. package/dist/run/exit-codes.js.map +1 -0
  49. package/dist/run/idempotency.d.ts +2 -0
  50. package/dist/run/idempotency.d.ts.map +1 -0
  51. package/dist/run/idempotency.js +13 -0
  52. package/dist/run/idempotency.js.map +1 -0
  53. package/dist/run/junit-suite.d.ts +17 -0
  54. package/dist/run/junit-suite.d.ts.map +1 -0
  55. package/dist/run/junit-suite.js +98 -0
  56. package/dist/run/junit-suite.js.map +1 -0
  57. package/dist/run/junit.d.ts +19 -0
  58. package/dist/run/junit.d.ts.map +1 -0
  59. package/dist/run/junit.js +218 -0
  60. package/dist/run/junit.js.map +1 -0
  61. package/dist/run/scripts.d.ts +9 -0
  62. package/dist/run/scripts.d.ts.map +1 -0
  63. package/dist/run/scripts.js +156 -0
  64. package/dist/run/scripts.js.map +1 -0
  65. package/dist/sdk/client.d.ts +7 -0
  66. package/dist/sdk/client.d.ts.map +1 -1
  67. package/dist/sdk/client.js +46 -0
  68. package/dist/sdk/client.js.map +1 -1
  69. package/package.json +2 -2
@@ -12,32 +12,74 @@
12
12
  "target"
13
13
  ],
14
14
  "properties": {
15
- "schema_version": {"const": "xagent-run-create/v2"},
16
- "script": {"$ref": "public-script.schema.json"},
17
- "package_id": {"type": "integer", "minimum": 1},
15
+ "schema_version": {
16
+ "const": "xagent-run-create/v2"
17
+ },
18
+ "script": {
19
+ "$ref": "public-script.schema.json"
20
+ },
21
+ "package_id": {
22
+ "type": "integer",
23
+ "minimum": 1
24
+ },
18
25
  "app_upload_id": {
19
26
  "type": "string",
20
27
  "pattern": "^appup_[a-f0-9]{32}$"
21
28
  },
22
- "variables": {"type": "object", "additionalProperties": true},
23
- "timeout_ms": {"type": "integer", "minimum": 1000, "maximum": 28800000},
24
- "source_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
29
+ "variables": {
30
+ "type": "object",
31
+ "additionalProperties": true
32
+ },
33
+ "timeout_ms": {
34
+ "type": "integer",
35
+ "minimum": 1000,
36
+ "maximum": 28800000
37
+ },
38
+ "device_wait_timeout_ms": {
39
+ "type": "integer",
40
+ "minimum": 0,
41
+ "maximum": 3600000
42
+ },
43
+ "source_hash": {
44
+ "type": "string",
45
+ "pattern": "^[a-f0-9]{64}$"
46
+ },
25
47
  "target_name": {
26
48
  "type": "string",
27
49
  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
28
50
  },
29
- "target_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
30
- "target": {"$ref": "execution-target.schema.json"}
51
+ "target_hash": {
52
+ "type": "string",
53
+ "pattern": "^[a-f0-9]{64}$"
54
+ },
55
+ "target": {
56
+ "$ref": "execution-target.schema.json"
57
+ },
58
+ "build_id": {
59
+ "type": "string",
60
+ "pattern": "^bld_[a-f0-9]{32}$"
61
+ }
31
62
  },
32
63
  "allOf": [
33
64
  {
34
65
  "not": {
35
66
  "anyOf": [
36
- {"required": ["package_id", "app_upload_id"]},
37
67
  {
38
- "required": ["app_upload_id"],
68
+ "required": [
69
+ "package_id",
70
+ "app_upload_id"
71
+ ]
72
+ },
73
+ {
74
+ "required": [
75
+ "app_upload_id"
76
+ ],
39
77
  "properties": {
40
- "script": {"required": ["package_id"]}
78
+ "script": {
79
+ "required": [
80
+ "package_id"
81
+ ]
82
+ }
41
83
  }
42
84
  }
43
85
  ]
@@ -51,25 +93,49 @@
51
93
  "steps": {
52
94
  "contains": {
53
95
  "type": "object",
54
- "properties": {"action": {"const": "install"}},
55
- "required": ["action"]
96
+ "properties": {
97
+ "action": {
98
+ "const": "install"
99
+ }
100
+ },
101
+ "required": [
102
+ "action"
103
+ ]
56
104
  }
57
105
  }
58
106
  },
59
- "required": ["steps"]
107
+ "required": [
108
+ "steps"
109
+ ]
60
110
  }
61
111
  },
62
- "required": ["script"]
112
+ "required": [
113
+ "script"
114
+ ]
63
115
  },
64
116
  "then": {
65
117
  "anyOf": [
66
- {"required": ["package_id"]},
67
- {"required": ["app_upload_id"]},
118
+ {
119
+ "required": [
120
+ "package_id"
121
+ ]
122
+ },
123
+ {
124
+ "required": [
125
+ "app_upload_id"
126
+ ]
127
+ },
68
128
  {
69
129
  "properties": {
70
- "script": {"required": ["package_id"]}
130
+ "script": {
131
+ "required": [
132
+ "package_id"
133
+ ]
134
+ }
71
135
  },
72
- "required": ["script"]
136
+ "required": [
137
+ "script"
138
+ ]
73
139
  }
74
140
  ]
75
141
  }
@@ -4,10 +4,21 @@
4
4
  "title": "XAgent Run v1",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["schema_version", "id", "status", "script_snapshot", "device_executions"],
7
+ "required": [
8
+ "schema_version",
9
+ "id",
10
+ "status",
11
+ "script_snapshot",
12
+ "device_executions"
13
+ ],
8
14
  "properties": {
9
- "schema_version": {"const": "xagent-run/v1"},
10
- "id": {"type": "string", "minLength": 1},
15
+ "schema_version": {
16
+ "const": "xagent-run/v1"
17
+ },
18
+ "id": {
19
+ "type": "string",
20
+ "minLength": 1
21
+ },
11
22
  "status": {
12
23
  "enum": [
13
24
  "validating",
@@ -25,25 +36,50 @@
25
36
  "script_snapshot": {
26
37
  "type": "object",
27
38
  "additionalProperties": false,
28
- "required": ["source_hash", "canonical_hash", "schema_version", "compiler_version"],
39
+ "required": [
40
+ "source_hash",
41
+ "canonical_hash",
42
+ "schema_version",
43
+ "compiler_version"
44
+ ],
29
45
  "properties": {
30
- "source_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
31
- "canonical_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
32
- "schema_version": {"const": "xagent-script/v1"},
33
- "compiler_version": {"const": "xagent-compiler/1"}
46
+ "source_hash": {
47
+ "type": "string",
48
+ "pattern": "^[a-f0-9]{64}$"
49
+ },
50
+ "canonical_hash": {
51
+ "type": "string",
52
+ "pattern": "^[a-f0-9]{64}$"
53
+ },
54
+ "schema_version": {
55
+ "const": "xagent-script/v1"
56
+ },
57
+ "compiler_version": {
58
+ "const": "xagent-compiler/1"
59
+ }
34
60
  }
35
61
  },
36
62
  "target_snapshot": {
37
63
  "type": "object",
38
64
  "additionalProperties": false,
39
- "required": ["target_name", "target_hash", "target", "devices"],
65
+ "required": [
66
+ "target_name",
67
+ "target_hash",
68
+ "target",
69
+ "devices"
70
+ ],
40
71
  "properties": {
41
72
  "target_name": {
42
73
  "type": "string",
43
74
  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
44
75
  },
45
- "target_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
46
- "target": {"$ref": "execution-target.schema.json"},
76
+ "target_hash": {
77
+ "type": "string",
78
+ "pattern": "^[a-f0-9]{64}$"
79
+ },
80
+ "target": {
81
+ "$ref": "execution-target.schema.json"
82
+ },
47
83
  "devices": {
48
84
  "type": "array",
49
85
  "minItems": 1,
@@ -61,13 +97,39 @@
61
97
  "available"
62
98
  ],
63
99
  "properties": {
64
- "device_id": {"type": "string", "minLength": 1, "maxLength": 128},
65
- "platform": {"type": "string", "minLength": 1, "maxLength": 64},
66
- "brand": {"type": "string", "minLength": 1, "maxLength": 128},
67
- "model": {"type": "string", "minLength": 1, "maxLength": 128},
68
- "os_version": {"type": "string", "minLength": 1, "maxLength": 64},
69
- "resolution": {"type": "string", "minLength": 1, "maxLength": 64},
70
- "available": {"type": "boolean"}
100
+ "device_id": {
101
+ "type": "string",
102
+ "minLength": 1,
103
+ "maxLength": 128
104
+ },
105
+ "platform": {
106
+ "type": "string",
107
+ "minLength": 1,
108
+ "maxLength": 64
109
+ },
110
+ "brand": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "maxLength": 128
114
+ },
115
+ "model": {
116
+ "type": "string",
117
+ "minLength": 1,
118
+ "maxLength": 128
119
+ },
120
+ "os_version": {
121
+ "type": "string",
122
+ "minLength": 1,
123
+ "maxLength": 64
124
+ },
125
+ "resolution": {
126
+ "type": "string",
127
+ "minLength": 1,
128
+ "maxLength": 64
129
+ },
130
+ "available": {
131
+ "type": "boolean"
132
+ }
71
133
  }
72
134
  }
73
135
  }
@@ -80,13 +142,38 @@
80
142
  "billing": {
81
143
  "type": "object",
82
144
  "additionalProperties": false,
83
- "required": ["status", "estimated_minutes", "billable_minutes", "cost", "discount_rate"],
145
+ "required": [
146
+ "status",
147
+ "estimated_minutes",
148
+ "billable_minutes",
149
+ "cost",
150
+ "discount_rate"
151
+ ],
84
152
  "properties": {
85
- "status": {"enum": ["pending", "succeeded", "failed", "unknown"]},
86
- "estimated_minutes": {"type": "integer", "minimum": 0},
87
- "billable_minutes": {"type": "integer", "minimum": 0},
88
- "cost": {"type": "integer", "minimum": 0},
89
- "discount_rate": {"type": "number", "minimum": 0}
153
+ "status": {
154
+ "enum": [
155
+ "pending",
156
+ "succeeded",
157
+ "failed",
158
+ "unknown"
159
+ ]
160
+ },
161
+ "estimated_minutes": {
162
+ "type": "integer",
163
+ "minimum": 0
164
+ },
165
+ "billable_minutes": {
166
+ "type": "integer",
167
+ "minimum": 0
168
+ },
169
+ "cost": {
170
+ "type": "integer",
171
+ "minimum": 0
172
+ },
173
+ "discount_rate": {
174
+ "type": "number",
175
+ "minimum": 0
176
+ }
90
177
  }
91
178
  },
92
179
  "device_executions": {
@@ -96,11 +183,24 @@
96
183
  "items": {
97
184
  "type": "object",
98
185
  "additionalProperties": false,
99
- "required": ["id", "device_id", "status"],
186
+ "required": [
187
+ "id",
188
+ "device_id",
189
+ "status"
190
+ ],
100
191
  "properties": {
101
- "id": {"type": "string", "minLength": 1},
102
- "device_id": {"type": "string", "minLength": 1},
103
- "device_name": {"type": "string", "minLength": 1},
192
+ "id": {
193
+ "type": "string",
194
+ "minLength": 1
195
+ },
196
+ "device_id": {
197
+ "type": "string",
198
+ "minLength": 1
199
+ },
200
+ "device_name": {
201
+ "type": "string",
202
+ "minLength": 1
203
+ },
104
204
  "status": {
105
205
  "enum": [
106
206
  "created",
@@ -120,18 +220,63 @@
120
220
  "items": {
121
221
  "type": "object",
122
222
  "additionalProperties": false,
123
- "required": ["sequence", "action", "status"],
223
+ "required": [
224
+ "sequence",
225
+ "action",
226
+ "status"
227
+ ],
124
228
  "properties": {
125
- "sequence": {"type": "integer", "minimum": 1},
126
- "action": {"type": "string", "minLength": 1},
127
- "status": {"enum": ["passed", "failed"]},
128
- "message": {"type": "string"},
129
- "screenshot_url": {"type": "string", "format": "uri"}
229
+ "sequence": {
230
+ "type": "integer",
231
+ "minimum": 1
232
+ },
233
+ "action": {
234
+ "type": "string",
235
+ "minLength": 1
236
+ },
237
+ "status": {
238
+ "enum": [
239
+ "passed",
240
+ "failed"
241
+ ]
242
+ },
243
+ "message": {
244
+ "type": "string"
245
+ },
246
+ "screenshot_url": {
247
+ "type": "string",
248
+ "format": "uri"
249
+ },
250
+ "duration_ms": {
251
+ "type": "integer",
252
+ "minimum": 0
253
+ }
130
254
  }
131
255
  }
132
256
  }
133
257
  }
134
258
  }
259
+ },
260
+ "build_id": {
261
+ "type": "string",
262
+ "pattern": "^bld_[a-f0-9]{32}$"
263
+ },
264
+ "created_at": {
265
+ "type": "string",
266
+ "format": "date-time"
267
+ },
268
+ "started_at": {
269
+ "type": "string",
270
+ "format": "date-time"
271
+ },
272
+ "finished_at": {
273
+ "type": "string",
274
+ "format": "date-time"
275
+ },
276
+ "reason": {
277
+ "type": "string",
278
+ "minLength": 1,
279
+ "maxLength": 64
135
280
  }
136
281
  }
137
282
  }
@@ -3,22 +3,38 @@
3
3
  "$id": "https://xagent.testin.cn/schemas/developer/v1/target-preview.schema.json",
4
4
  "title": "XAgent Target Preview v1",
5
5
  "oneOf": [
6
- {"$ref": "#/$defs/request"},
7
- {"$ref": "#/$defs/response"}
6
+ {
7
+ "$ref": "#/$defs/request"
8
+ },
9
+ {
10
+ "$ref": "#/$defs/response"
11
+ }
8
12
  ],
9
13
  "$defs": {
10
14
  "request": {
11
15
  "type": "object",
12
16
  "additionalProperties": false,
13
- "required": ["schema_version", "target_name", "target_hash", "target"],
17
+ "required": [
18
+ "schema_version",
19
+ "target_name",
20
+ "target_hash",
21
+ "target"
22
+ ],
14
23
  "properties": {
15
- "schema_version": {"const": "xagent-target-preview/v1"},
24
+ "schema_version": {
25
+ "const": "xagent-target-preview/v1"
26
+ },
16
27
  "target_name": {
17
28
  "type": "string",
18
29
  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
19
30
  },
20
- "target_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
21
- "target": {"$ref": "execution-target.schema.json"}
31
+ "target_hash": {
32
+ "type": "string",
33
+ "pattern": "^[a-f0-9]{64}$"
34
+ },
35
+ "target": {
36
+ "$ref": "execution-target.schema.json"
37
+ }
22
38
  }
23
39
  },
24
40
  "response": {
@@ -29,24 +45,52 @@
29
45
  "target_name",
30
46
  "target_hash",
31
47
  "devices",
48
+ "requested_count",
49
+ "matched_count",
50
+ "available_count",
32
51
  "previewed_at",
33
52
  "reserved"
34
53
  ],
35
54
  "properties": {
36
- "schema_version": {"const": "xagent-target-preview/v1"},
55
+ "schema_version": {
56
+ "const": "xagent-target-preview/v1"
57
+ },
37
58
  "target_name": {
38
59
  "type": "string",
39
60
  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
40
61
  },
41
- "target_hash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
62
+ "target_hash": {
63
+ "type": "string",
64
+ "pattern": "^[a-f0-9]{64}$"
65
+ },
42
66
  "devices": {
43
67
  "type": "array",
44
68
  "minItems": 1,
45
- "maxItems": 1,
46
- "items": {"$ref": "#/$defs/device_summary"}
69
+ "maxItems": 100,
70
+ "items": {
71
+ "$ref": "#/$defs/device_summary"
72
+ }
73
+ },
74
+ "previewed_at": {
75
+ "type": "string",
76
+ "format": "date-time"
47
77
  },
48
- "previewed_at": {"type": "string", "format": "date-time"},
49
- "reserved": {"const": false}
78
+ "reserved": {
79
+ "const": false
80
+ },
81
+ "requested_count": {
82
+ "type": "integer",
83
+ "minimum": 1,
84
+ "maximum": 100
85
+ },
86
+ "matched_count": {
87
+ "type": "integer",
88
+ "minimum": 0
89
+ },
90
+ "available_count": {
91
+ "type": "integer",
92
+ "minimum": 0
93
+ }
50
94
  }
51
95
  },
52
96
  "device_summary": {
@@ -62,13 +106,39 @@
62
106
  "available"
63
107
  ],
64
108
  "properties": {
65
- "device_id": {"type": "string", "minLength": 1, "maxLength": 128},
66
- "platform": {"type": "string", "minLength": 1, "maxLength": 64},
67
- "brand": {"type": "string", "minLength": 1, "maxLength": 128},
68
- "model": {"type": "string", "minLength": 1, "maxLength": 128},
69
- "os_version": {"type": "string", "minLength": 1, "maxLength": 64},
70
- "resolution": {"type": "string", "minLength": 1, "maxLength": 64},
71
- "available": {"type": "boolean"}
109
+ "device_id": {
110
+ "type": "string",
111
+ "minLength": 1,
112
+ "maxLength": 128
113
+ },
114
+ "platform": {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "maxLength": 64
118
+ },
119
+ "brand": {
120
+ "type": "string",
121
+ "minLength": 1,
122
+ "maxLength": 128
123
+ },
124
+ "model": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "maxLength": 128
128
+ },
129
+ "os_version": {
130
+ "type": "string",
131
+ "minLength": 1,
132
+ "maxLength": 64
133
+ },
134
+ "resolution": {
135
+ "type": "string",
136
+ "minLength": 1,
137
+ "maxLength": 64
138
+ },
139
+ "available": {
140
+ "type": "boolean"
141
+ }
72
142
  }
73
143
  }
74
144
  }
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA4dA,wBAAsB,MAAM,CAAC,IAAI,WAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB/D"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAwtBA,wBAAsB,MAAM,CAAC,IAAI,WAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB/D"}