@postplus/cli 0.1.33 → 0.1.35
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.
- package/README.md +27 -5
- package/build/account-binding-display.js +21 -0
- package/build/auth-lifecycle.js +5 -1
- package/build/auth-login.js +23 -0
- package/build/auth-session.js +8 -0
- package/build/auth-validate.js +15 -1
- package/build/auth.js +16 -1
- package/build/client-compatibility.js +1 -1
- package/build/doctor.js +11 -4
- package/build/hosted-domain-commands.js +366 -0
- package/build/hosted-request-schemas.js +507 -0
- package/build/hosted-schema-catalog.js +307 -0
- package/build/index.js +39 -3
- package/build/local-state.js +6 -0
- package/build/skill-catalog.js +1 -3
- package/build/skill-management.js +57 -20
- package/build/status.js +6 -3
- package/package.json +6 -2
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
import { MEDIA_ENDPOINT_HINTS, PUBLIC_CONTENT_DISCOVERY_TOOL_HINTS, PUBLIC_CONTENT_SOURCE_HINTS, RESEARCH_COLLECTION_HINTS, VIDEO_ANALYSIS_MODEL_HINTS, } from './hosted-schema-catalog.js';
|
|
3
|
+
const JSON_OBJECT_SCHEMA = {
|
|
4
|
+
additionalProperties: true,
|
|
5
|
+
type: 'object',
|
|
6
|
+
};
|
|
7
|
+
const OPERATION_ID_SCHEMA = {
|
|
8
|
+
description: 'Stable idempotency key for this logical operation.',
|
|
9
|
+
minLength: 1,
|
|
10
|
+
type: 'string',
|
|
11
|
+
};
|
|
12
|
+
export function buildHostedRequestSchemaReport(input) {
|
|
13
|
+
switch (input.domain) {
|
|
14
|
+
case 'research':
|
|
15
|
+
return buildResearchSchemaReport(input.collectionKey ?? null);
|
|
16
|
+
case 'media':
|
|
17
|
+
return buildMediaSchemaReport(input.endpointKey ?? null);
|
|
18
|
+
case 'publish':
|
|
19
|
+
return buildPublishSchemaReport();
|
|
20
|
+
case 'mobile':
|
|
21
|
+
return buildMobileSchemaReport();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function buildResearchSchemaReport(collectionKey) {
|
|
25
|
+
if (collectionKey && !RESEARCH_COLLECTION_HINTS[collectionKey]) {
|
|
26
|
+
throw new Error(`Unknown research collection ${collectionKey}. Known collections: ${Object.keys(RESEARCH_COLLECTION_HINTS).join(', ')}`);
|
|
27
|
+
}
|
|
28
|
+
const collectionInput = collectionKey
|
|
29
|
+
? RESEARCH_COLLECTION_HINTS[collectionKey]
|
|
30
|
+
: {
|
|
31
|
+
maxItems: 20,
|
|
32
|
+
query: 'electric toothbrush morning routine',
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
schemaVersion: 1,
|
|
36
|
+
domain: 'research',
|
|
37
|
+
command: 'postplus research collect --skill <skill-id> --collection-key <key> --input <hosted-envelope.json> --output <result.json>; postplus research capability --request <hosted-capability-request.json> --output <result.json>',
|
|
38
|
+
description: 'Schemas for files passed to hosted research commands.',
|
|
39
|
+
collectionKeys: Object.keys(RESEARCH_COLLECTION_HINTS).sort(),
|
|
40
|
+
selectedCollectionKey: collectionKey ?? undefined,
|
|
41
|
+
sourceKeys: Object.keys(PUBLIC_CONTENT_SOURCE_HINTS).sort(),
|
|
42
|
+
toolKeys: Object.keys(PUBLIC_CONTENT_DISCOVERY_TOOL_HINTS).sort(),
|
|
43
|
+
notes: [
|
|
44
|
+
'The collection key stays in the CLI flag, not inside the JSON file.',
|
|
45
|
+
'Put the skill-specific provider input under input.',
|
|
46
|
+
'Use --run-handle for polling instead of this envelope.',
|
|
47
|
+
'Use research capability for public-content sourceKey and discovery tool requests.',
|
|
48
|
+
'The CLI derives operationId before sending capability requests to PostPlus Cloud.',
|
|
49
|
+
],
|
|
50
|
+
schemas: [
|
|
51
|
+
{
|
|
52
|
+
id: 'research.collection-envelope',
|
|
53
|
+
description: 'Hosted research collection input envelope.',
|
|
54
|
+
required: ['schemaVersion', 'input'],
|
|
55
|
+
jsonSchema: {
|
|
56
|
+
additionalProperties: false,
|
|
57
|
+
properties: {
|
|
58
|
+
hostedOperationId: OPERATION_ID_SCHEMA,
|
|
59
|
+
input: JSON_OBJECT_SCHEMA,
|
|
60
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
61
|
+
quoteConfirmationToken: {
|
|
62
|
+
minLength: 1,
|
|
63
|
+
type: 'string',
|
|
64
|
+
},
|
|
65
|
+
schemaVersion: {
|
|
66
|
+
const: 1,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
required: ['schemaVersion', 'input'],
|
|
70
|
+
type: 'object',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'public-content-collection.scrape',
|
|
75
|
+
description: 'Collect public content from a released sourceKey.',
|
|
76
|
+
required: ['capability', 'operation', 'sourceKey', 'input'],
|
|
77
|
+
jsonSchema: {
|
|
78
|
+
additionalProperties: false,
|
|
79
|
+
properties: {
|
|
80
|
+
capability: { const: 'public-content-collection' },
|
|
81
|
+
input: {
|
|
82
|
+
items: JSON_OBJECT_SCHEMA,
|
|
83
|
+
minItems: 1,
|
|
84
|
+
type: 'array',
|
|
85
|
+
},
|
|
86
|
+
operation: { const: 'scrape' },
|
|
87
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
88
|
+
quoteConfirmationToken: {
|
|
89
|
+
minLength: 1,
|
|
90
|
+
type: 'string',
|
|
91
|
+
},
|
|
92
|
+
sourceKey: {
|
|
93
|
+
enum: Object.keys(PUBLIC_CONTENT_SOURCE_HINTS).sort(),
|
|
94
|
+
type: 'string',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
required: ['capability', 'operation', 'sourceKey', 'input'],
|
|
98
|
+
type: 'object',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 'public-content-collection.status',
|
|
103
|
+
description: 'Poll a public-content collection job.',
|
|
104
|
+
required: ['capability', 'operation', 'handle'],
|
|
105
|
+
jsonSchema: {
|
|
106
|
+
additionalProperties: false,
|
|
107
|
+
properties: {
|
|
108
|
+
capability: { const: 'public-content-collection' },
|
|
109
|
+
handle: {
|
|
110
|
+
minLength: 1,
|
|
111
|
+
type: 'string',
|
|
112
|
+
},
|
|
113
|
+
operation: { const: 'status' },
|
|
114
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
115
|
+
},
|
|
116
|
+
required: ['capability', 'operation', 'handle'],
|
|
117
|
+
type: 'object',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'public-content-discovery.tool-call',
|
|
122
|
+
description: 'Run a hosted public-content discovery tool.',
|
|
123
|
+
required: ['capability', 'operation', 'toolKey', 'args'],
|
|
124
|
+
jsonSchema: {
|
|
125
|
+
additionalProperties: false,
|
|
126
|
+
properties: {
|
|
127
|
+
args: JSON_OBJECT_SCHEMA,
|
|
128
|
+
capability: { const: 'public-content-discovery' },
|
|
129
|
+
operation: { const: 'tool-call' },
|
|
130
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
131
|
+
quoteConfirmationToken: {
|
|
132
|
+
minLength: 1,
|
|
133
|
+
type: 'string',
|
|
134
|
+
},
|
|
135
|
+
toolKey: {
|
|
136
|
+
enum: Object.keys(PUBLIC_CONTENT_DISCOVERY_TOOL_HINTS).sort(),
|
|
137
|
+
type: 'string',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
required: ['capability', 'operation', 'toolKey', 'args'],
|
|
141
|
+
type: 'object',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
examples: {
|
|
146
|
+
'research.collection-envelope': {
|
|
147
|
+
schemaVersion: 1,
|
|
148
|
+
input: collectionInput,
|
|
149
|
+
},
|
|
150
|
+
'public-content-collection.scrape': {
|
|
151
|
+
capability: 'public-content-collection',
|
|
152
|
+
operation: 'scrape',
|
|
153
|
+
sourceKey: 'youtube-videos',
|
|
154
|
+
input: PUBLIC_CONTENT_SOURCE_HINTS['youtube-videos'],
|
|
155
|
+
},
|
|
156
|
+
'public-content-collection.status': {
|
|
157
|
+
capability: 'public-content-collection',
|
|
158
|
+
operation: 'status',
|
|
159
|
+
handle: '<output.data.id>',
|
|
160
|
+
},
|
|
161
|
+
'public-content-discovery.tool-call': {
|
|
162
|
+
capability: 'public-content-discovery',
|
|
163
|
+
operation: 'tool-call',
|
|
164
|
+
toolKey: 'web-search',
|
|
165
|
+
args: PUBLIC_CONTENT_DISCOVERY_TOOL_HINTS['web-search'],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function buildMediaSchemaReport(endpointKey) {
|
|
171
|
+
if (endpointKey && !MEDIA_ENDPOINT_HINTS[endpointKey]) {
|
|
172
|
+
throw new Error(`Unknown media endpoint ${endpointKey}. Known endpoints: ${Object.keys(MEDIA_ENDPOINT_HINTS).join(', ')}`);
|
|
173
|
+
}
|
|
174
|
+
const endpointInput = endpointKey
|
|
175
|
+
? MEDIA_ENDPOINT_HINTS[endpointKey]
|
|
176
|
+
: {
|
|
177
|
+
prompt: 'A realistic vertical short-form product reveal.',
|
|
178
|
+
};
|
|
179
|
+
const selectedEndpoint = endpointKey ?? '<endpoint-key>';
|
|
180
|
+
return {
|
|
181
|
+
schemaVersion: 1,
|
|
182
|
+
domain: 'media',
|
|
183
|
+
command: 'postplus media capability --request <hosted-capability-request.json> --output <result.json>',
|
|
184
|
+
description: 'Schemas for files passed to postplus media capability --request.',
|
|
185
|
+
endpointKeys: Object.keys(MEDIA_ENDPOINT_HINTS).sort(),
|
|
186
|
+
modelKeys: Object.keys(VIDEO_ANALYSIS_MODEL_HINTS).sort(),
|
|
187
|
+
selectedEndpointKey: endpointKey ?? undefined,
|
|
188
|
+
notes: [
|
|
189
|
+
'Use media-generation request for async generation, transcription, and voice jobs.',
|
|
190
|
+
'Use media-generation status with the output.data.id handle returned by a pending request.',
|
|
191
|
+
'Use media-file operations for upload/download setup when a workflow needs hosted media storage.',
|
|
192
|
+
'Use video-analysis analyze for Gemini video understanding payloads.',
|
|
193
|
+
'The CLI derives operationId and billing dimensions before sending requests to PostPlus Cloud.',
|
|
194
|
+
'Endpoint-specific input belongs under input; top-level provider or billing fields are not public contract fields.',
|
|
195
|
+
],
|
|
196
|
+
schemas: [
|
|
197
|
+
{
|
|
198
|
+
id: 'media-generation.request',
|
|
199
|
+
description: 'Submit an async media generation/transcription job.',
|
|
200
|
+
required: [
|
|
201
|
+
'capability',
|
|
202
|
+
'operation',
|
|
203
|
+
'endpointKey',
|
|
204
|
+
'input',
|
|
205
|
+
],
|
|
206
|
+
jsonSchema: {
|
|
207
|
+
additionalProperties: false,
|
|
208
|
+
properties: {
|
|
209
|
+
capability: { const: 'media-generation' },
|
|
210
|
+
endpointKey: {
|
|
211
|
+
minLength: 1,
|
|
212
|
+
type: 'string',
|
|
213
|
+
},
|
|
214
|
+
input: JSON_OBJECT_SCHEMA,
|
|
215
|
+
operation: { const: 'request' },
|
|
216
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
217
|
+
quoteConfirmationToken: {
|
|
218
|
+
minLength: 1,
|
|
219
|
+
type: 'string',
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
required: [
|
|
223
|
+
'capability',
|
|
224
|
+
'operation',
|
|
225
|
+
'endpointKey',
|
|
226
|
+
'input',
|
|
227
|
+
],
|
|
228
|
+
type: 'object',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: 'media-generation.status',
|
|
233
|
+
description: 'Poll an async media generation/transcription job.',
|
|
234
|
+
required: ['capability', 'operation', 'handle'],
|
|
235
|
+
jsonSchema: {
|
|
236
|
+
additionalProperties: false,
|
|
237
|
+
properties: {
|
|
238
|
+
capability: { const: 'media-generation' },
|
|
239
|
+
handle: {
|
|
240
|
+
minLength: 1,
|
|
241
|
+
type: 'string',
|
|
242
|
+
},
|
|
243
|
+
operation: { const: 'status' },
|
|
244
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
245
|
+
},
|
|
246
|
+
required: ['capability', 'operation', 'handle'],
|
|
247
|
+
type: 'object',
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: 'media-file.create-upload-url',
|
|
252
|
+
description: 'Create a hosted media upload target.',
|
|
253
|
+
required: ['capability', 'operation', 'file'],
|
|
254
|
+
jsonSchema: {
|
|
255
|
+
additionalProperties: false,
|
|
256
|
+
properties: {
|
|
257
|
+
capability: { const: 'media-file' },
|
|
258
|
+
file: {
|
|
259
|
+
additionalProperties: false,
|
|
260
|
+
properties: {
|
|
261
|
+
mimeType: { minLength: 1, type: 'string' },
|
|
262
|
+
name: { minLength: 1, type: 'string' },
|
|
263
|
+
sizeBytes: { minimum: 1, type: 'integer' },
|
|
264
|
+
},
|
|
265
|
+
required: ['mimeType', 'name', 'sizeBytes'],
|
|
266
|
+
type: 'object',
|
|
267
|
+
},
|
|
268
|
+
operation: { const: 'create-upload-url' },
|
|
269
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
270
|
+
quoteConfirmationToken: {
|
|
271
|
+
minLength: 1,
|
|
272
|
+
type: 'string',
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
required: ['capability', 'operation', 'file'],
|
|
276
|
+
type: 'object',
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
id: 'video-analysis.analyze',
|
|
281
|
+
description: 'Run hosted Gemini video analysis.',
|
|
282
|
+
required: ['capability', 'operation', 'modelKey', 'payload'],
|
|
283
|
+
jsonSchema: {
|
|
284
|
+
additionalProperties: false,
|
|
285
|
+
properties: {
|
|
286
|
+
capability: { const: 'video-analysis' },
|
|
287
|
+
estimatedUsage: JSON_OBJECT_SCHEMA,
|
|
288
|
+
modelKey: {
|
|
289
|
+
enum: Object.keys(VIDEO_ANALYSIS_MODEL_HINTS).sort(),
|
|
290
|
+
type: 'string',
|
|
291
|
+
},
|
|
292
|
+
operation: { const: 'analyze' },
|
|
293
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
294
|
+
payload: JSON_OBJECT_SCHEMA,
|
|
295
|
+
quoteConfirmationToken: {
|
|
296
|
+
minLength: 1,
|
|
297
|
+
type: 'string',
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
required: ['capability', 'operation', 'modelKey', 'payload'],
|
|
301
|
+
type: 'object',
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
examples: {
|
|
306
|
+
'media-generation.request': {
|
|
307
|
+
capability: 'media-generation',
|
|
308
|
+
operation: 'request',
|
|
309
|
+
endpointKey: selectedEndpoint,
|
|
310
|
+
input: endpointInput,
|
|
311
|
+
},
|
|
312
|
+
'media-generation.status': {
|
|
313
|
+
capability: 'media-generation',
|
|
314
|
+
operation: 'status',
|
|
315
|
+
handle: '<output.data.id>',
|
|
316
|
+
},
|
|
317
|
+
'media-file.create-upload-url': {
|
|
318
|
+
capability: 'media-file',
|
|
319
|
+
operation: 'create-upload-url',
|
|
320
|
+
file: {
|
|
321
|
+
mimeType: 'video/mp4',
|
|
322
|
+
name: 'input.mp4',
|
|
323
|
+
sizeBytes: 1048576,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
'video-analysis.analyze': {
|
|
327
|
+
capability: 'video-analysis',
|
|
328
|
+
operation: 'analyze',
|
|
329
|
+
modelKey: 'gemini-video-analysis',
|
|
330
|
+
payload: VIDEO_ANALYSIS_MODEL_HINTS['gemini-video-analysis'],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
export function buildMediaGenerationRequestDimensions(endpointKey, input) {
|
|
336
|
+
const dimensions = {
|
|
337
|
+
billableUnitCount: 1,
|
|
338
|
+
operationKey: endpointKey,
|
|
339
|
+
};
|
|
340
|
+
if (endpointKey.startsWith('video-')) {
|
|
341
|
+
const duration = readPositiveNumber(input.duration) ?? 5;
|
|
342
|
+
const resolution = typeof input.resolution === 'string' && input.resolution.trim()
|
|
343
|
+
? input.resolution.trim()
|
|
344
|
+
: '720p';
|
|
345
|
+
dimensions.audioMode =
|
|
346
|
+
endpointKey.startsWith('video-kling-v3-0-') && input.sound !== true
|
|
347
|
+
? 'off'
|
|
348
|
+
: 'on';
|
|
349
|
+
dimensions.duration = Math.ceil(duration);
|
|
350
|
+
dimensions.requestBytes = Buffer.byteLength(JSON.stringify(input));
|
|
351
|
+
dimensions.resolution = resolution;
|
|
352
|
+
if (endpointKey.startsWith('video-seedance-2-')) {
|
|
353
|
+
const referenceVideoCount = Array.isArray(input.reference_videos)
|
|
354
|
+
? input.reference_videos.length
|
|
355
|
+
: 0;
|
|
356
|
+
dimensions.referenceVideoCount = referenceVideoCount;
|
|
357
|
+
dimensions.referenceVideoMode =
|
|
358
|
+
referenceVideoCount > 0
|
|
359
|
+
? 'with_reference_videos'
|
|
360
|
+
: 'without_reference_videos';
|
|
361
|
+
}
|
|
362
|
+
if (endpointKey === 'video-kling-v2-6-pro-motion-control') {
|
|
363
|
+
dimensions.characterOrientation =
|
|
364
|
+
typeof input.character_orientation === 'string'
|
|
365
|
+
? input.character_orientation
|
|
366
|
+
: 'image';
|
|
367
|
+
dimensions.motionControlMode = 'reference_motion_transfer';
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return dimensions;
|
|
371
|
+
}
|
|
372
|
+
function readPositiveNumber(value) {
|
|
373
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
return value;
|
|
377
|
+
}
|
|
378
|
+
function buildPublishSchemaReport() {
|
|
379
|
+
return {
|
|
380
|
+
schemaVersion: 1,
|
|
381
|
+
domain: 'publish',
|
|
382
|
+
command: 'postplus publish capability --request <hosted-capability-request.json> --output <result.json>',
|
|
383
|
+
description: 'Schema for files passed to postplus publish capability --request.',
|
|
384
|
+
notes: [
|
|
385
|
+
'Use social-publishing operations only through PostPlus Cloud.',
|
|
386
|
+
'Put the operation-specific publishing payload under input.',
|
|
387
|
+
],
|
|
388
|
+
schemas: [
|
|
389
|
+
{
|
|
390
|
+
id: 'social-publishing.request',
|
|
391
|
+
description: 'Run a hosted social publishing operation.',
|
|
392
|
+
required: ['capability', 'operation', 'input'],
|
|
393
|
+
jsonSchema: {
|
|
394
|
+
additionalProperties: false,
|
|
395
|
+
properties: {
|
|
396
|
+
capability: { const: 'social-publishing' },
|
|
397
|
+
input: JSON_OBJECT_SCHEMA,
|
|
398
|
+
operation: {
|
|
399
|
+
enum: [
|
|
400
|
+
'analytics',
|
|
401
|
+
'channel-settings',
|
|
402
|
+
'create-post',
|
|
403
|
+
'delete-post',
|
|
404
|
+
'delete-post-group',
|
|
405
|
+
'list-channels',
|
|
406
|
+
'list-posts',
|
|
407
|
+
'missing-content',
|
|
408
|
+
'notifications',
|
|
409
|
+
'set-release-id',
|
|
410
|
+
'trigger-channel-tool',
|
|
411
|
+
'update-post-status',
|
|
412
|
+
'upload-file',
|
|
413
|
+
'upload-from-url',
|
|
414
|
+
],
|
|
415
|
+
type: 'string',
|
|
416
|
+
},
|
|
417
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
418
|
+
quoteConfirmationToken: {
|
|
419
|
+
minLength: 1,
|
|
420
|
+
type: 'string',
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
required: ['capability', 'operation', 'input'],
|
|
424
|
+
type: 'object',
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
],
|
|
428
|
+
examples: {
|
|
429
|
+
'social-publishing.list-channels': {
|
|
430
|
+
capability: 'social-publishing',
|
|
431
|
+
operation: 'list-channels',
|
|
432
|
+
input: {},
|
|
433
|
+
},
|
|
434
|
+
'social-publishing.create-post': {
|
|
435
|
+
capability: 'social-publishing',
|
|
436
|
+
operation: 'create-post',
|
|
437
|
+
input: {
|
|
438
|
+
body: {
|
|
439
|
+
posts: [],
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
function buildMobileSchemaReport() {
|
|
447
|
+
return {
|
|
448
|
+
schemaVersion: 1,
|
|
449
|
+
domain: 'mobile',
|
|
450
|
+
command: 'postplus mobile capability --request <hosted-capability-request.json> --output <result.json>',
|
|
451
|
+
description: 'Schema for files passed to postplus mobile capability --request.',
|
|
452
|
+
notes: [
|
|
453
|
+
'Use mobile-automation operations only through PostPlus Cloud.',
|
|
454
|
+
'Put the operation-specific mobile automation payload under input.',
|
|
455
|
+
],
|
|
456
|
+
schemas: [
|
|
457
|
+
{
|
|
458
|
+
id: 'mobile-automation.request',
|
|
459
|
+
description: 'Run a hosted mobile automation operation.',
|
|
460
|
+
required: ['capability', 'operation', 'input'],
|
|
461
|
+
jsonSchema: {
|
|
462
|
+
additionalProperties: false,
|
|
463
|
+
properties: {
|
|
464
|
+
capability: { const: 'mobile-automation' },
|
|
465
|
+
input: JSON_OBJECT_SCHEMA,
|
|
466
|
+
operation: {
|
|
467
|
+
enum: [
|
|
468
|
+
'cancel-tasks',
|
|
469
|
+
'create-cloud-phones',
|
|
470
|
+
'install-app',
|
|
471
|
+
'list-cloud-phones',
|
|
472
|
+
'list-installed-apps',
|
|
473
|
+
'list-installable-apps',
|
|
474
|
+
'query-phone-status',
|
|
475
|
+
'query-tasks',
|
|
476
|
+
'start-app',
|
|
477
|
+
'start-cloud-phones',
|
|
478
|
+
'stop-cloud-phones',
|
|
479
|
+
'task-detail',
|
|
480
|
+
'tiktok-login',
|
|
481
|
+
'tiktok-publish-image-set',
|
|
482
|
+
'tiktok-publish-video',
|
|
483
|
+
'tiktok-warmup',
|
|
484
|
+
'uninstall-app',
|
|
485
|
+
],
|
|
486
|
+
type: 'string',
|
|
487
|
+
},
|
|
488
|
+
operationId: OPERATION_ID_SCHEMA,
|
|
489
|
+
quoteConfirmationToken: {
|
|
490
|
+
minLength: 1,
|
|
491
|
+
type: 'string',
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
required: ['capability', 'operation', 'input'],
|
|
495
|
+
type: 'object',
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
examples: {
|
|
500
|
+
'mobile-automation.list-cloud-phones': {
|
|
501
|
+
capability: 'mobile-automation',
|
|
502
|
+
operation: 'list-cloud-phones',
|
|
503
|
+
input: {},
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
};
|
|
507
|
+
}
|