@mocart-io/api 1.0.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.
- package/LICENSE +15 -0
- package/README.md +84 -0
- package/dist/generated/client/client.gen.d.ts +3 -0
- package/dist/generated/client/client.gen.d.ts.map +1 -0
- package/dist/generated/client/client.gen.js +217 -0
- package/dist/generated/client/client.gen.js.map +1 -0
- package/dist/generated/client/index.d.ts +11 -0
- package/dist/generated/client/index.d.ts.map +1 -0
- package/dist/generated/client/index.js +7 -0
- package/dist/generated/client/index.js.map +1 -0
- package/dist/generated/client/types.gen.d.ts +121 -0
- package/dist/generated/client/types.gen.d.ts.map +1 -0
- package/dist/generated/client/types.gen.js +3 -0
- package/dist/generated/client/types.gen.js.map +1 -0
- package/dist/generated/client/utils.gen.d.ts +38 -0
- package/dist/generated/client/utils.gen.d.ts.map +1 -0
- package/dist/generated/client/utils.gen.js +229 -0
- package/dist/generated/client/utils.gen.js.map +1 -0
- package/dist/generated/client.gen.d.ts +13 -0
- package/dist/generated/client.gen.d.ts.map +1 -0
- package/dist/generated/client.gen.js +4 -0
- package/dist/generated/client.gen.js.map +1 -0
- package/dist/generated/core/auth.gen.d.ts +26 -0
- package/dist/generated/core/auth.gen.d.ts.map +1 -0
- package/dist/generated/core/auth.gen.js +15 -0
- package/dist/generated/core/auth.gen.js.map +1 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +26 -0
- package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/bodySerializer.gen.js +58 -0
- package/dist/generated/core/bodySerializer.gen.js.map +1 -0
- package/dist/generated/core/params.gen.d.ts +44 -0
- package/dist/generated/core/params.gen.d.ts.map +1 -0
- package/dist/generated/core/params.gen.js +110 -0
- package/dist/generated/core/params.gen.js.map +1 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
- package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/pathSerializer.gen.js +107 -0
- package/dist/generated/core/pathSerializer.gen.js.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.js +93 -0
- package/dist/generated/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.js +133 -0
- package/dist/generated/core/serverSentEvents.gen.js.map +1 -0
- package/dist/generated/core/types.gen.d.ts +84 -0
- package/dist/generated/core/types.gen.d.ts.map +1 -0
- package/dist/generated/core/types.gen.js +3 -0
- package/dist/generated/core/types.gen.js.map +1 -0
- package/dist/generated/core/utils.gen.d.ts +20 -0
- package/dist/generated/core/utils.gen.d.ts.map +1 -0
- package/dist/generated/core/utils.gen.js +88 -0
- package/dist/generated/core/utils.gen.js.map +1 -0
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +3 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/sdk.gen.d.ts +118 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -0
- package/dist/generated/sdk.gen.js +181 -0
- package/dist/generated/sdk.gen.js.map +1 -0
- package/dist/generated/types.gen.d.ts +1367 -0
- package/dist/generated/types.gen.d.ts.map +1 -0
- package/dist/generated/types.gen.js +3 -0
- package/dist/generated/types.gen.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1367 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: `${string}://${string}/api/public/v1` | (string & {});
|
|
3
|
+
};
|
|
4
|
+
export type Webhooks = RunCompletedWebhookWebhookRequest;
|
|
5
|
+
export type Product = {
|
|
6
|
+
/**
|
|
7
|
+
* Resource discriminator — always `"product"`.
|
|
8
|
+
*/
|
|
9
|
+
object: 'product';
|
|
10
|
+
/**
|
|
11
|
+
* Stable product identifier (the internal document id).
|
|
12
|
+
*/
|
|
13
|
+
productId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Merchant SKU (`core.mpn`); `null` when the product has none.
|
|
16
|
+
*/
|
|
17
|
+
sku: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Product title; `null` when absent.
|
|
20
|
+
*/
|
|
21
|
+
title: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Owning brand id; `null` when the product is not brand-scoped.
|
|
24
|
+
*/
|
|
25
|
+
brandId: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Canonical merchant product URL; `null` when absent.
|
|
28
|
+
*/
|
|
29
|
+
productUrl: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Best display thumbnail URL; `null` when the product has no image.
|
|
32
|
+
*/
|
|
33
|
+
image: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Product creation time as an ISO-8601 string; `null` only for a legacy doc lacking one.
|
|
36
|
+
*/
|
|
37
|
+
createdAt: string | null;
|
|
38
|
+
};
|
|
39
|
+
export type Pagination = {
|
|
40
|
+
/**
|
|
41
|
+
* Opaque keyset cursor; `null` ONLY on the last page. Pass back verbatim as `?cursor=`.
|
|
42
|
+
*/
|
|
43
|
+
nextCursor: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Convenience mirror of `nextCursor !== null`. NEVER stop iterating on empty `data`.
|
|
46
|
+
*/
|
|
47
|
+
hasMore: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The page size applied to this response.
|
|
50
|
+
*/
|
|
51
|
+
pageSize: number;
|
|
52
|
+
};
|
|
53
|
+
export type ProductList = {
|
|
54
|
+
/**
|
|
55
|
+
* Resource discriminator — always `"list"`.
|
|
56
|
+
*/
|
|
57
|
+
object: 'list';
|
|
58
|
+
data: Array<Product>;
|
|
59
|
+
pagination: Pagination;
|
|
60
|
+
};
|
|
61
|
+
export type AccountSpendBudget = {
|
|
62
|
+
/**
|
|
63
|
+
* The account's daily API credit cap.
|
|
64
|
+
*/
|
|
65
|
+
capCredits: number;
|
|
66
|
+
/**
|
|
67
|
+
* Credits already committed today (UTC).
|
|
68
|
+
*/
|
|
69
|
+
spentCredits: number;
|
|
70
|
+
/**
|
|
71
|
+
* What is left of the cap today; never negative.
|
|
72
|
+
*/
|
|
73
|
+
remainingCredits: number;
|
|
74
|
+
/**
|
|
75
|
+
* RFC 3339 UTC instant the budget resets at (the next midnight UTC). ABSOLUTE — render it locally.
|
|
76
|
+
*/
|
|
77
|
+
resetsAt: string;
|
|
78
|
+
};
|
|
79
|
+
export type ProblemDetails = {
|
|
80
|
+
/**
|
|
81
|
+
* Stable URI reference identifying the problem type, e.g. `/errors/PRODUCT_NOT_FOUND`.
|
|
82
|
+
*/
|
|
83
|
+
type: string;
|
|
84
|
+
/**
|
|
85
|
+
* Stable human-readable summary of the problem type (the HTTP status phrase).
|
|
86
|
+
*/
|
|
87
|
+
title: string;
|
|
88
|
+
/**
|
|
89
|
+
* HTTP status code, duplicated in the body per RFC 9457.
|
|
90
|
+
*/
|
|
91
|
+
status: number;
|
|
92
|
+
/**
|
|
93
|
+
* Stable machine-readable error code, e.g. `PRODUCT_NOT_FOUND`.
|
|
94
|
+
*/
|
|
95
|
+
code: string;
|
|
96
|
+
/**
|
|
97
|
+
* Human-readable, non-leaky explanation of this occurrence.
|
|
98
|
+
*/
|
|
99
|
+
detail?: string;
|
|
100
|
+
/**
|
|
101
|
+
* URI reference for this occurrence (the request path).
|
|
102
|
+
*/
|
|
103
|
+
instance?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Per-request correlation id for support triage.
|
|
106
|
+
*/
|
|
107
|
+
requestId: string;
|
|
108
|
+
/**
|
|
109
|
+
* Per-field validation failures (present on a 422).
|
|
110
|
+
*/
|
|
111
|
+
errors?: Array<{
|
|
112
|
+
/**
|
|
113
|
+
* Dotted path of the offending field (absent for a whole-body error).
|
|
114
|
+
*/
|
|
115
|
+
field?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Human-readable reason the field failed.
|
|
118
|
+
*/
|
|
119
|
+
message: string;
|
|
120
|
+
}>;
|
|
121
|
+
budget?: AccountSpendBudget;
|
|
122
|
+
};
|
|
123
|
+
export type Creative = {
|
|
124
|
+
/**
|
|
125
|
+
* Resource discriminator — always `"creative"`.
|
|
126
|
+
*/
|
|
127
|
+
object: 'creative';
|
|
128
|
+
/**
|
|
129
|
+
* Stable creative identifier (the internal document id).
|
|
130
|
+
*/
|
|
131
|
+
creativeId: string;
|
|
132
|
+
/**
|
|
133
|
+
* Id of the product this creative belongs to.
|
|
134
|
+
*/
|
|
135
|
+
productId: string;
|
|
136
|
+
/**
|
|
137
|
+
* Id of the campaign this creative was generated under.
|
|
138
|
+
*/
|
|
139
|
+
campaignId: string;
|
|
140
|
+
/**
|
|
141
|
+
* Owning brand id, denormalized from the linked product at creation; `null` when the product is not brand-scoped or the creative predates the denormalization backfill.
|
|
142
|
+
*/
|
|
143
|
+
brandId: string | null;
|
|
144
|
+
/**
|
|
145
|
+
* Merchant SKU (the linked product's `core.mpn`), denormalized onto the creative; `null` when the product carries no SKU or the creative predates the denormalization backfill.
|
|
146
|
+
*/
|
|
147
|
+
sku: string | null;
|
|
148
|
+
/**
|
|
149
|
+
* Creative media type: `image` (STATIC) or `video` (VIDEO). 3D/PLAYABLE are never exposed.
|
|
150
|
+
*/
|
|
151
|
+
mediaType: 'image' | 'video';
|
|
152
|
+
/**
|
|
153
|
+
* Durable URL of the creative asset.
|
|
154
|
+
*/
|
|
155
|
+
url: string;
|
|
156
|
+
/**
|
|
157
|
+
* Poster/thumbnail URL; `null` when the creative has none.
|
|
158
|
+
*/
|
|
159
|
+
thumbnailUrl: string | null;
|
|
160
|
+
/**
|
|
161
|
+
* Creative aspect ratio (e.g. `1:1`, `9:16`); `null` when it cannot be resolved.
|
|
162
|
+
*/
|
|
163
|
+
aspectRatio: string | null;
|
|
164
|
+
/**
|
|
165
|
+
* Review/approval time as an ISO-8601 string; `null` when the creative was not reviewed.
|
|
166
|
+
*/
|
|
167
|
+
approvedAt: string | null;
|
|
168
|
+
/**
|
|
169
|
+
* Hosted player URL when the creative links a published video; `null` otherwise.
|
|
170
|
+
*/
|
|
171
|
+
playerUrl: string | null;
|
|
172
|
+
/**
|
|
173
|
+
* Iframe embed snippet when the creative links a published video; `null` otherwise.
|
|
174
|
+
*/
|
|
175
|
+
embedCode: string | null;
|
|
176
|
+
/**
|
|
177
|
+
* The linked product, present ONLY when the read requested `?expand=product`: the full `ProductResponse`, or `null` when the linked product is missing/hard-deleted. ABSENT when expansion is not requested.
|
|
178
|
+
*/
|
|
179
|
+
product?: Product | null;
|
|
180
|
+
};
|
|
181
|
+
export type CreativeList = {
|
|
182
|
+
/**
|
|
183
|
+
* Resource discriminator — always `"list"`.
|
|
184
|
+
*/
|
|
185
|
+
object: 'list';
|
|
186
|
+
data: Array<Creative>;
|
|
187
|
+
pagination: Pagination;
|
|
188
|
+
};
|
|
189
|
+
export type Asset = {
|
|
190
|
+
/**
|
|
191
|
+
* Resource discriminator — always `"asset"`.
|
|
192
|
+
*/
|
|
193
|
+
object: 'asset';
|
|
194
|
+
/**
|
|
195
|
+
* Stable asset identifier (the internal document id).
|
|
196
|
+
*/
|
|
197
|
+
assetId: string;
|
|
198
|
+
/**
|
|
199
|
+
* Id of the product this asset belongs to.
|
|
200
|
+
*/
|
|
201
|
+
productId: string;
|
|
202
|
+
/**
|
|
203
|
+
* Asset media type: `VIDEO`, `STATIC` (image), or `3D` (model).
|
|
204
|
+
*/
|
|
205
|
+
type: 'VIDEO' | 'STATIC' | '3D';
|
|
206
|
+
/**
|
|
207
|
+
* Durable public URL of the asset (the type-matched video / image / model URL).
|
|
208
|
+
*/
|
|
209
|
+
url: string;
|
|
210
|
+
/**
|
|
211
|
+
* Poster/thumbnail URL; `null` when the asset has none.
|
|
212
|
+
*/
|
|
213
|
+
thumbnailUrl: string | null;
|
|
214
|
+
/**
|
|
215
|
+
* User shortlist (favorite) flag; `false` when the asset was never shortlisted.
|
|
216
|
+
*/
|
|
217
|
+
favorited: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Stored asset lifecycle status (e.g. `active`, `completed`).
|
|
220
|
+
*/
|
|
221
|
+
status: string;
|
|
222
|
+
/**
|
|
223
|
+
* Human-readable asset name (falls back to the 3D `title`); `null` when the asset has neither.
|
|
224
|
+
*/
|
|
225
|
+
name: string | null;
|
|
226
|
+
/**
|
|
227
|
+
* Intrinsic media width in pixels; `null` when unknown.
|
|
228
|
+
*/
|
|
229
|
+
width: number | null;
|
|
230
|
+
/**
|
|
231
|
+
* Intrinsic media height in pixels; `null` when unknown.
|
|
232
|
+
*/
|
|
233
|
+
height: number | null;
|
|
234
|
+
/**
|
|
235
|
+
* Video duration in seconds; `null` for non-video or when unknown.
|
|
236
|
+
*/
|
|
237
|
+
durationSec: number | null;
|
|
238
|
+
/**
|
|
239
|
+
* Hosted player URL when the asset links a published video; `null` otherwise.
|
|
240
|
+
*/
|
|
241
|
+
playerUrl: string | null;
|
|
242
|
+
/**
|
|
243
|
+
* Iframe embed snippet when the asset links a published video; `null` otherwise.
|
|
244
|
+
*/
|
|
245
|
+
embedCode: string | null;
|
|
246
|
+
/**
|
|
247
|
+
* Asset creation time as an ISO-8601 string; `null` only for a legacy doc lacking a coercible one.
|
|
248
|
+
*/
|
|
249
|
+
createdAt: string | null;
|
|
250
|
+
};
|
|
251
|
+
export type AssetList = {
|
|
252
|
+
/**
|
|
253
|
+
* Resource discriminator — always `"list"`.
|
|
254
|
+
*/
|
|
255
|
+
object: 'list';
|
|
256
|
+
data: Array<Asset>;
|
|
257
|
+
pagination: Pagination;
|
|
258
|
+
};
|
|
259
|
+
export type Campaign = {
|
|
260
|
+
/**
|
|
261
|
+
* Resource discriminator — always `"campaign"`.
|
|
262
|
+
*/
|
|
263
|
+
object: 'campaign';
|
|
264
|
+
/**
|
|
265
|
+
* Stable campaign identifier (the internal document id).
|
|
266
|
+
*/
|
|
267
|
+
campaignId: string;
|
|
268
|
+
/**
|
|
269
|
+
* Human-readable campaign name.
|
|
270
|
+
*/
|
|
271
|
+
name: string;
|
|
272
|
+
/**
|
|
273
|
+
* The campaign's generation-progress status; allowed values are enumerated by this schema's enum.
|
|
274
|
+
*/
|
|
275
|
+
status: 'IN_PROGRESS' | 'READY' | 'BLOCKED' | 'COMPLETED';
|
|
276
|
+
/**
|
|
277
|
+
* Id of the brand this campaign belongs to.
|
|
278
|
+
*/
|
|
279
|
+
brandId: string;
|
|
280
|
+
/**
|
|
281
|
+
* APPROXIMATE, denormalized best-effort count of the campaign's creatives. It is a fire-and-forget lazy recompute that can drift slightly from the live creative set — treat it as indicative, not exact.
|
|
282
|
+
*/
|
|
283
|
+
creativeCount: number;
|
|
284
|
+
/**
|
|
285
|
+
* Campaign creation time as an ISO-8601 string; `null` only for a legacy doc lacking a coercible one.
|
|
286
|
+
*/
|
|
287
|
+
createdAt: string | null;
|
|
288
|
+
};
|
|
289
|
+
export type CampaignList = {
|
|
290
|
+
/**
|
|
291
|
+
* Resource discriminator — always `"list"`.
|
|
292
|
+
*/
|
|
293
|
+
object: 'list';
|
|
294
|
+
data: Array<Campaign>;
|
|
295
|
+
pagination: Pagination;
|
|
296
|
+
};
|
|
297
|
+
export type DeliveryItem = {
|
|
298
|
+
/**
|
|
299
|
+
* Resource discriminator — always `"delivery_item"`.
|
|
300
|
+
*/
|
|
301
|
+
object: 'delivery_item';
|
|
302
|
+
/**
|
|
303
|
+
* Id of the asset that was delivered by this item.
|
|
304
|
+
*/
|
|
305
|
+
assetId: string;
|
|
306
|
+
/**
|
|
307
|
+
* Id of the product this delivered asset belongs to.
|
|
308
|
+
*/
|
|
309
|
+
productId: string;
|
|
310
|
+
/**
|
|
311
|
+
* The item's per-asset delivery status; allowed values are enumerated by this schema's enum.
|
|
312
|
+
*/
|
|
313
|
+
status: 'QUEUED' | 'PROCESSING' | 'SUCCEEDED' | 'FAILED';
|
|
314
|
+
/**
|
|
315
|
+
* Public URL of the LIVE delivered post/media (e.g. the instagram.com/p/… permalink); `null` until it succeeds.
|
|
316
|
+
*/
|
|
317
|
+
permalinkUrl: string | null;
|
|
318
|
+
/**
|
|
319
|
+
* Provider-side published id (post / media / ad id); `null` until the item succeeds.
|
|
320
|
+
*/
|
|
321
|
+
externalId: string | null;
|
|
322
|
+
/**
|
|
323
|
+
* Item success time as an ISO-8601 string; `null` when the item has not succeeded.
|
|
324
|
+
*/
|
|
325
|
+
succeededAt: string | null;
|
|
326
|
+
};
|
|
327
|
+
export type Delivery = {
|
|
328
|
+
/**
|
|
329
|
+
* Resource discriminator — always `"delivery"`.
|
|
330
|
+
*/
|
|
331
|
+
object: 'delivery';
|
|
332
|
+
/**
|
|
333
|
+
* Stable delivery-run identifier (the internal run document id).
|
|
334
|
+
*/
|
|
335
|
+
deliveryId: string;
|
|
336
|
+
/**
|
|
337
|
+
* The run's target delivery platform; allowed values are enumerated by this schema's enum.
|
|
338
|
+
*/
|
|
339
|
+
platform: 'instagram' | 'facebook' | 'x' | 'tiktok' | 'shopify' | 'woocommerce' | 'bigcommerce' | 'magento' | 'wix' | 'meta-ads' | 'tiktok-ads' | 'google-display' | 'taboola';
|
|
340
|
+
/**
|
|
341
|
+
* The run's aggregate delivery status; allowed values are enumerated by this schema's enum.
|
|
342
|
+
*/
|
|
343
|
+
status: 'IN_PROGRESS' | 'COMPLETED' | 'COMPLETED_WITH_ISSUES' | 'FAILED';
|
|
344
|
+
/**
|
|
345
|
+
* Aggregate per-status item counters for the run.
|
|
346
|
+
*/
|
|
347
|
+
itemCounts: {
|
|
348
|
+
/**
|
|
349
|
+
* Total items in the run.
|
|
350
|
+
*/
|
|
351
|
+
total: number;
|
|
352
|
+
/**
|
|
353
|
+
* Items still queued (not yet started).
|
|
354
|
+
*/
|
|
355
|
+
queued: number;
|
|
356
|
+
/**
|
|
357
|
+
* Items currently in flight.
|
|
358
|
+
*/
|
|
359
|
+
processing: number;
|
|
360
|
+
/**
|
|
361
|
+
* Items that succeeded.
|
|
362
|
+
*/
|
|
363
|
+
succeeded: number;
|
|
364
|
+
/**
|
|
365
|
+
* Items that failed.
|
|
366
|
+
*/
|
|
367
|
+
failed: number;
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* Run start time as an ISO-8601 string; `null` only for a legacy doc lacking a coercible one.
|
|
371
|
+
*/
|
|
372
|
+
startedAt: string | null;
|
|
373
|
+
/**
|
|
374
|
+
* Run completion time as an ISO-8601 string; `null` while the run is still in flight.
|
|
375
|
+
*/
|
|
376
|
+
completedAt: string | null;
|
|
377
|
+
/**
|
|
378
|
+
* The run-level failure `{ type, message }`; `null` when the run has no recorded error.
|
|
379
|
+
*/
|
|
380
|
+
error: {
|
|
381
|
+
/**
|
|
382
|
+
* Canonical failure code (the run `errorType`).
|
|
383
|
+
*/
|
|
384
|
+
type: string;
|
|
385
|
+
/**
|
|
386
|
+
* User-safe one-liner; `null` when none was recorded.
|
|
387
|
+
*/
|
|
388
|
+
message: string | null;
|
|
389
|
+
} | null;
|
|
390
|
+
/**
|
|
391
|
+
* The run's per-asset delivery items, present ONLY when the read requested `?expand=items`. ABSENT when expansion is not requested.
|
|
392
|
+
*/
|
|
393
|
+
items?: Array<DeliveryItem>;
|
|
394
|
+
};
|
|
395
|
+
export type DeliveryList = {
|
|
396
|
+
/**
|
|
397
|
+
* Resource discriminator — always `"list"`.
|
|
398
|
+
*/
|
|
399
|
+
object: 'list';
|
|
400
|
+
data: Array<Delivery>;
|
|
401
|
+
pagination: Pagination;
|
|
402
|
+
};
|
|
403
|
+
export type CreateRunRequest = {
|
|
404
|
+
brandId: string;
|
|
405
|
+
presetId?: string;
|
|
406
|
+
accountPresetId?: string;
|
|
407
|
+
productIds: Array<string>;
|
|
408
|
+
modality: 'image' | 'video';
|
|
409
|
+
creativesPerProduct?: number;
|
|
410
|
+
selections?: {
|
|
411
|
+
[key: string]: string;
|
|
412
|
+
};
|
|
413
|
+
occasionId?: string;
|
|
414
|
+
brandToneId?: string;
|
|
415
|
+
aspectRatio: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9';
|
|
416
|
+
video?: {
|
|
417
|
+
/**
|
|
418
|
+
* Length in seconds.
|
|
419
|
+
*/
|
|
420
|
+
duration: 4 | 6 | 8;
|
|
421
|
+
/**
|
|
422
|
+
* Output resolution.
|
|
423
|
+
*/
|
|
424
|
+
resolution?: '720p';
|
|
425
|
+
/**
|
|
426
|
+
* What the video starts from: `product` animates the product photo; `styled` first generates a frame from the style and direction, at no extra charge.
|
|
427
|
+
*/
|
|
428
|
+
firstFrame?: 'product' | 'styled';
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* Your direction for the creative. With a preset it steers the preset; without one it is the whole brief. At most 8000 characters for images and 4000 for video.
|
|
432
|
+
*/
|
|
433
|
+
prompt?: string;
|
|
434
|
+
includeProductName?: boolean;
|
|
435
|
+
applyBrandKit?: boolean;
|
|
436
|
+
metadata?: {
|
|
437
|
+
[key: string]: string;
|
|
438
|
+
};
|
|
439
|
+
maxCredits?: number;
|
|
440
|
+
expectedTotalCredits?: number;
|
|
441
|
+
dryRun?: boolean;
|
|
442
|
+
};
|
|
443
|
+
export type RunCompletionEstimate = {
|
|
444
|
+
/**
|
|
445
|
+
* `createdAt + durationSeconds`, as an ISO 8601 UTC instant.
|
|
446
|
+
*/
|
|
447
|
+
completesAt: string;
|
|
448
|
+
/**
|
|
449
|
+
* Whole seconds of expected wall-clock for the whole run.
|
|
450
|
+
*/
|
|
451
|
+
durationSeconds: number;
|
|
452
|
+
/**
|
|
453
|
+
* How many of this run's items are expected to be in flight at once.
|
|
454
|
+
*/
|
|
455
|
+
concurrency: number;
|
|
456
|
+
/**
|
|
457
|
+
* The measured per-item wall-clock the duration was derived from.
|
|
458
|
+
*/
|
|
459
|
+
perItemSeconds: number;
|
|
460
|
+
};
|
|
461
|
+
export type RunQuote = {
|
|
462
|
+
/**
|
|
463
|
+
* What one creative costs under this rate card.
|
|
464
|
+
*/
|
|
465
|
+
perItemCredits: number;
|
|
466
|
+
/**
|
|
467
|
+
* `perItemCredits` × the number of creatives in the run.
|
|
468
|
+
*/
|
|
469
|
+
totalCredits: number;
|
|
470
|
+
/**
|
|
471
|
+
* The price list this quote was computed from; pinned at create.
|
|
472
|
+
*/
|
|
473
|
+
rateCardVersion: string;
|
|
474
|
+
};
|
|
475
|
+
export type RunEstimate = {
|
|
476
|
+
object: 'run_estimate';
|
|
477
|
+
estimate: RunQuote;
|
|
478
|
+
budget?: AccountSpendBudget;
|
|
479
|
+
};
|
|
480
|
+
export type RunCredits = {
|
|
481
|
+
/**
|
|
482
|
+
* The quoted total the caller agreed to — a ceiling, not a charge.
|
|
483
|
+
*/
|
|
484
|
+
estimated: number | null;
|
|
485
|
+
rateCardVersion: string | null;
|
|
486
|
+
};
|
|
487
|
+
export type RunCounts = {
|
|
488
|
+
succeeded: number;
|
|
489
|
+
failed: number;
|
|
490
|
+
refused: number;
|
|
491
|
+
stopped: number;
|
|
492
|
+
/**
|
|
493
|
+
* Items with no terminal answer yet; on a final run, those that never reported.
|
|
494
|
+
*/
|
|
495
|
+
pending: number;
|
|
496
|
+
};
|
|
497
|
+
export type Run = {
|
|
498
|
+
runId: string;
|
|
499
|
+
object: 'run';
|
|
500
|
+
/**
|
|
501
|
+
* The run lifecycle status.
|
|
502
|
+
*/
|
|
503
|
+
status: 'QUEUED' | 'RUNNING' | 'STOPPING' | 'SUCCEEDED' | 'PARTIAL' | 'FAILED' | 'REFUSED' | 'STOPPED' | 'EXPIRED';
|
|
504
|
+
/**
|
|
505
|
+
* Planned creatives: products × creativesPerProduct.
|
|
506
|
+
*/
|
|
507
|
+
total: number;
|
|
508
|
+
credits: RunCredits;
|
|
509
|
+
createdAt: string;
|
|
510
|
+
/**
|
|
511
|
+
* `null` until the run is final.
|
|
512
|
+
*/
|
|
513
|
+
finalizedAt: string | null;
|
|
514
|
+
counts?: RunCounts;
|
|
515
|
+
/**
|
|
516
|
+
* Omitted when an input to the arithmetic is unavailable; poll conservatively then.
|
|
517
|
+
*/
|
|
518
|
+
estimatedCompletion?: RunCompletionEstimate;
|
|
519
|
+
};
|
|
520
|
+
export type RunList = {
|
|
521
|
+
object: 'list';
|
|
522
|
+
data: Array<Run>;
|
|
523
|
+
pagination: Pagination;
|
|
524
|
+
};
|
|
525
|
+
export type RunItem = {
|
|
526
|
+
object: 'run_item';
|
|
527
|
+
productId: string;
|
|
528
|
+
/**
|
|
529
|
+
* Position in the run, in request order.
|
|
530
|
+
*/
|
|
531
|
+
itemIndex: number;
|
|
532
|
+
jobId: string;
|
|
533
|
+
outcome: 'succeeded' | 'failed' | 'refused' | 'stopped' | 'pending';
|
|
534
|
+
/**
|
|
535
|
+
* Set on a `failed` or `refused` item; `null` otherwise.
|
|
536
|
+
*/
|
|
537
|
+
errorCode: 'INSUFFICIENT_CREDITS' | 'SPEND_CEILING_REACHED' | 'SAFETY_REFUSED' | 'SAFETY_UNAVAILABLE' | 'PROVIDER_FAILED' | 'STOPPED' | 'NO_PRIMARY_IMAGE' | 'TRY_AGAIN' | null;
|
|
538
|
+
/**
|
|
539
|
+
* Which ceiling stopped the item: raise `maxCredits` for `run`; `account` is not per-request.
|
|
540
|
+
*/
|
|
541
|
+
ceiling?: 'run' | 'account';
|
|
542
|
+
/**
|
|
543
|
+
* Set only when `outcome` is `succeeded`.
|
|
544
|
+
*/
|
|
545
|
+
assetId: string | null;
|
|
546
|
+
/**
|
|
547
|
+
* The creative's public URL, set only when `outcome` is `succeeded`. Permanent today; keep `assetId` with it, since how assets are served may change.
|
|
548
|
+
*/
|
|
549
|
+
assetUrl: string | null;
|
|
550
|
+
};
|
|
551
|
+
export type RunItemList = {
|
|
552
|
+
object: 'list';
|
|
553
|
+
data: Array<RunItem>;
|
|
554
|
+
pagination: Pagination;
|
|
555
|
+
};
|
|
556
|
+
export type RunPreset = {
|
|
557
|
+
/**
|
|
558
|
+
* Pass as `presetId` on `POST /runs` or `POST /runs/estimate`.
|
|
559
|
+
*/
|
|
560
|
+
presetId: string;
|
|
561
|
+
object: 'preset';
|
|
562
|
+
/**
|
|
563
|
+
* The `selections` keys this preset understands.
|
|
564
|
+
*/
|
|
565
|
+
readonly controlIds: Array<string>;
|
|
566
|
+
};
|
|
567
|
+
export type RunPresetList = {
|
|
568
|
+
object: 'list';
|
|
569
|
+
data: Array<RunPreset>;
|
|
570
|
+
pagination: Pagination;
|
|
571
|
+
};
|
|
572
|
+
export type RunCompletedEvent = {
|
|
573
|
+
/**
|
|
574
|
+
* Fires when a run reaches a terminal status.
|
|
575
|
+
*/
|
|
576
|
+
type: 'run.completed';
|
|
577
|
+
timestamp: string;
|
|
578
|
+
data: Run;
|
|
579
|
+
};
|
|
580
|
+
export type RunPresetWritable = {
|
|
581
|
+
/**
|
|
582
|
+
* Pass as `presetId` on `POST /runs` or `POST /runs/estimate`.
|
|
583
|
+
*/
|
|
584
|
+
presetId: string;
|
|
585
|
+
object: 'preset';
|
|
586
|
+
};
|
|
587
|
+
export type RunPresetListWritable = {
|
|
588
|
+
object: 'list';
|
|
589
|
+
data: Array<RunPresetWritable>;
|
|
590
|
+
pagination: Pagination;
|
|
591
|
+
};
|
|
592
|
+
export type ListProductsData = {
|
|
593
|
+
body?: never;
|
|
594
|
+
path?: never;
|
|
595
|
+
query?: {
|
|
596
|
+
/**
|
|
597
|
+
* Opaque base64url keyset cursor from a prior page's `pagination.nextCursor`. Omit for the first page; pass it back verbatim to continue.
|
|
598
|
+
*/
|
|
599
|
+
cursor?: string;
|
|
600
|
+
/**
|
|
601
|
+
* Optional filter by owning brand id. MUTUALLY EXCLUSIVE with `sku` — supplying both is a 400 (`INVALID_FILTER_COMBINATION`).
|
|
602
|
+
*/
|
|
603
|
+
brandId?: string;
|
|
604
|
+
/**
|
|
605
|
+
* Optional filter by merchant SKU (raw `core.mpn`, case-sensitive). MUTUALLY EXCLUSIVE with `brandId` — supplying both is a 400 (`INVALID_FILTER_COMBINATION`).
|
|
606
|
+
*/
|
|
607
|
+
sku?: string;
|
|
608
|
+
};
|
|
609
|
+
url: '/products';
|
|
610
|
+
};
|
|
611
|
+
export type ListProductsErrors = {
|
|
612
|
+
/**
|
|
613
|
+
* Bad Request. The `cursor` query parameter is not a valid opaque keyset cursor (`INVALID_CURSOR`), OR `brandId` and `sku` were supplied together (`INVALID_FILTER_COMBINATION`).
|
|
614
|
+
*/
|
|
615
|
+
400: ProblemDetails;
|
|
616
|
+
/**
|
|
617
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
618
|
+
*/
|
|
619
|
+
401: ProblemDetails;
|
|
620
|
+
/**
|
|
621
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
622
|
+
*/
|
|
623
|
+
403: ProblemDetails;
|
|
624
|
+
/**
|
|
625
|
+
* Unprocessable Content. A query parameter failed field validation (e.g. a non-string shape); the offending fields are enumerated in `errors[]`.
|
|
626
|
+
*/
|
|
627
|
+
422: ProblemDetails;
|
|
628
|
+
/**
|
|
629
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
630
|
+
*/
|
|
631
|
+
429: string;
|
|
632
|
+
};
|
|
633
|
+
export type ListProductsError = ListProductsErrors[keyof ListProductsErrors];
|
|
634
|
+
export type ListProductsResponses = {
|
|
635
|
+
/**
|
|
636
|
+
* OK. One keyset-paginated page of products.
|
|
637
|
+
*/
|
|
638
|
+
200: ProductList;
|
|
639
|
+
};
|
|
640
|
+
export type ListProductsResponse = ListProductsResponses[keyof ListProductsResponses];
|
|
641
|
+
export type GetProductByIdData = {
|
|
642
|
+
body?: never;
|
|
643
|
+
path: {
|
|
644
|
+
/**
|
|
645
|
+
* Stable Mocart product document id.
|
|
646
|
+
*/
|
|
647
|
+
id: string;
|
|
648
|
+
};
|
|
649
|
+
query?: never;
|
|
650
|
+
url: '/products/{id}';
|
|
651
|
+
};
|
|
652
|
+
export type GetProductByIdErrors = {
|
|
653
|
+
/**
|
|
654
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
655
|
+
*/
|
|
656
|
+
401: ProblemDetails;
|
|
657
|
+
/**
|
|
658
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
659
|
+
*/
|
|
660
|
+
403: ProblemDetails;
|
|
661
|
+
/**
|
|
662
|
+
* Not Found. No product matched the identifier (`PRODUCT_NOT_FOUND`). A cross-tenant id returns this SAME uniform 404 (no-leak).
|
|
663
|
+
*/
|
|
664
|
+
404: ProblemDetails;
|
|
665
|
+
/**
|
|
666
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
667
|
+
*/
|
|
668
|
+
429: string;
|
|
669
|
+
};
|
|
670
|
+
export type GetProductByIdError = GetProductByIdErrors[keyof GetProductByIdErrors];
|
|
671
|
+
export type GetProductByIdResponses = {
|
|
672
|
+
/**
|
|
673
|
+
* OK. The single product.
|
|
674
|
+
*/
|
|
675
|
+
200: Product;
|
|
676
|
+
};
|
|
677
|
+
export type GetProductByIdResponse = GetProductByIdResponses[keyof GetProductByIdResponses];
|
|
678
|
+
export type ListCreativesData = {
|
|
679
|
+
body?: never;
|
|
680
|
+
path?: never;
|
|
681
|
+
query?: {
|
|
682
|
+
/**
|
|
683
|
+
* Opaque base64url keyset cursor from a prior page's `pagination.nextCursor`. Omit for the first page; pass it back verbatim to continue.
|
|
684
|
+
*/
|
|
685
|
+
cursor?: string;
|
|
686
|
+
/**
|
|
687
|
+
* Filter by creative status. Defaults to `APPROVED` when omitted.
|
|
688
|
+
*/
|
|
689
|
+
status?: 'NOT_GENERATED' | 'QUEUED' | 'GENERATING' | 'PENDING' | 'APPROVED' | 'REJECTED' | 'FAILED';
|
|
690
|
+
/**
|
|
691
|
+
* Optional filter by owning campaign id. MUTUALLY EXCLUSIVE with the other filters (campaignId/productId/brandId/sku) — supplying more than one is a 400 (`INVALID_FILTER_COMBINATION`).
|
|
692
|
+
*/
|
|
693
|
+
campaignId?: string;
|
|
694
|
+
/**
|
|
695
|
+
* Optional filter by linked product id. MUTUALLY EXCLUSIVE with the other filters (campaignId/productId/brandId/sku) — supplying more than one is a 400 (`INVALID_FILTER_COMBINATION`).
|
|
696
|
+
*/
|
|
697
|
+
productId?: string;
|
|
698
|
+
/**
|
|
699
|
+
* Optional filter by owning brand id (denormalized from the linked product). MUTUALLY EXCLUSIVE with the other filters (campaignId/productId/brandId/sku) — supplying more than one is a 400 (`INVALID_FILTER_COMBINATION`).
|
|
700
|
+
*/
|
|
701
|
+
brandId?: string;
|
|
702
|
+
/**
|
|
703
|
+
* Optional filter by merchant SKU (the linked product's `core.mpn`, denormalized onto the creative). MUTUALLY EXCLUSIVE with the other filters (campaignId/productId/brandId/sku) — supplying more than one is a 400 (`INVALID_FILTER_COMBINATION`).
|
|
704
|
+
*/
|
|
705
|
+
sku?: string;
|
|
706
|
+
/**
|
|
707
|
+
* Optional relation expansion. `product` joins each creative's linked `Product` into a `product` field (the full `ProductResponse`, or `null` when the linked product is missing/hard-deleted). Absent by default; an unknown expand token is IGNORED (not a 422).
|
|
708
|
+
*/
|
|
709
|
+
expand?: 'product';
|
|
710
|
+
};
|
|
711
|
+
url: '/creatives';
|
|
712
|
+
};
|
|
713
|
+
export type ListCreativesErrors = {
|
|
714
|
+
/**
|
|
715
|
+
* Bad Request. The `cursor` query parameter is not a valid opaque keyset cursor (`INVALID_CURSOR`), OR more than one of the mutually-exclusive scope filters `campaignId` / `productId` / `brandId` / `sku` was supplied together (`INVALID_FILTER_COMBINATION`).
|
|
716
|
+
*/
|
|
717
|
+
400: ProblemDetails;
|
|
718
|
+
/**
|
|
719
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
720
|
+
*/
|
|
721
|
+
401: ProblemDetails;
|
|
722
|
+
/**
|
|
723
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
724
|
+
*/
|
|
725
|
+
403: ProblemDetails;
|
|
726
|
+
/**
|
|
727
|
+
* Unprocessable Content. A query parameter failed field validation (e.g. a non-string shape); the offending fields are enumerated in `errors[]`.
|
|
728
|
+
*/
|
|
729
|
+
422: ProblemDetails;
|
|
730
|
+
/**
|
|
731
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
732
|
+
*/
|
|
733
|
+
429: string;
|
|
734
|
+
};
|
|
735
|
+
export type ListCreativesError = ListCreativesErrors[keyof ListCreativesErrors];
|
|
736
|
+
export type ListCreativesResponses = {
|
|
737
|
+
/**
|
|
738
|
+
* OK. One keyset-paginated page of creatives.
|
|
739
|
+
*/
|
|
740
|
+
200: CreativeList;
|
|
741
|
+
};
|
|
742
|
+
export type ListCreativesResponse = ListCreativesResponses[keyof ListCreativesResponses];
|
|
743
|
+
export type GetCreativeByIdData = {
|
|
744
|
+
body?: never;
|
|
745
|
+
path: {
|
|
746
|
+
/**
|
|
747
|
+
* Stable Mocart creative document id.
|
|
748
|
+
*/
|
|
749
|
+
id: string;
|
|
750
|
+
};
|
|
751
|
+
query?: {
|
|
752
|
+
/**
|
|
753
|
+
* Optional relation expansion. `product` joins the creative's linked `Product` into a `product` field (the full `ProductResponse`, or `null` when the linked product is missing/hard-deleted). Absent by default; an unknown expand token is IGNORED (not a 422).
|
|
754
|
+
*/
|
|
755
|
+
expand?: 'product';
|
|
756
|
+
};
|
|
757
|
+
url: '/creatives/{id}';
|
|
758
|
+
};
|
|
759
|
+
export type GetCreativeByIdErrors = {
|
|
760
|
+
/**
|
|
761
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
762
|
+
*/
|
|
763
|
+
401: ProblemDetails;
|
|
764
|
+
/**
|
|
765
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
766
|
+
*/
|
|
767
|
+
403: ProblemDetails;
|
|
768
|
+
/**
|
|
769
|
+
* Not Found. No creative matched the identifier (`CREATIVE_NOT_FOUND`). A cross-tenant, soft-deleted, or non-usable (3D/PLAYABLE) creative id returns this SAME uniform 404 (no-leak).
|
|
770
|
+
*/
|
|
771
|
+
404: ProblemDetails;
|
|
772
|
+
/**
|
|
773
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
774
|
+
*/
|
|
775
|
+
429: string;
|
|
776
|
+
};
|
|
777
|
+
export type GetCreativeByIdError = GetCreativeByIdErrors[keyof GetCreativeByIdErrors];
|
|
778
|
+
export type GetCreativeByIdResponses = {
|
|
779
|
+
/**
|
|
780
|
+
* OK. The single creative.
|
|
781
|
+
*/
|
|
782
|
+
200: Creative;
|
|
783
|
+
};
|
|
784
|
+
export type GetCreativeByIdResponse = GetCreativeByIdResponses[keyof GetCreativeByIdResponses];
|
|
785
|
+
export type ListAssetsData = {
|
|
786
|
+
body?: never;
|
|
787
|
+
path?: never;
|
|
788
|
+
query?: {
|
|
789
|
+
/**
|
|
790
|
+
* Opaque base64url keyset cursor from a prior page's `pagination.nextCursor`. Omit for the first page; pass it back verbatim to continue.
|
|
791
|
+
*/
|
|
792
|
+
cursor?: string;
|
|
793
|
+
/**
|
|
794
|
+
* Optional filter by asset media type. Combinable with `status`.
|
|
795
|
+
*/
|
|
796
|
+
type?: 'VIDEO' | 'STATIC' | '3D';
|
|
797
|
+
/**
|
|
798
|
+
* Optional filter by stored asset status. When omitted, defaults to the ready set (`active` + `completed`). Combinable with `type`.
|
|
799
|
+
*/
|
|
800
|
+
status?: 'active' | 'completed' | 'pending' | 'processing' | 'failed' | 'approved' | 'archived' | 'deprecated' | 'beta';
|
|
801
|
+
/**
|
|
802
|
+
* Optional TRUE-ONLY shortlist filter: pass `true` to return only shortlisted (favorited) assets; omit for all. Any non-`true` value is ignored (no filter). Combinable with `type` and `status`.
|
|
803
|
+
*/
|
|
804
|
+
favorited?: boolean;
|
|
805
|
+
};
|
|
806
|
+
url: '/assets';
|
|
807
|
+
};
|
|
808
|
+
export type ListAssetsErrors = {
|
|
809
|
+
/**
|
|
810
|
+
* Bad Request. The `cursor` query parameter is not a valid opaque keyset cursor (`INVALID_CURSOR`).
|
|
811
|
+
*/
|
|
812
|
+
400: ProblemDetails;
|
|
813
|
+
/**
|
|
814
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
815
|
+
*/
|
|
816
|
+
401: ProblemDetails;
|
|
817
|
+
/**
|
|
818
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
819
|
+
*/
|
|
820
|
+
403: ProblemDetails;
|
|
821
|
+
/**
|
|
822
|
+
* Unprocessable Content. A query parameter failed field validation (e.g. a non-string shape); the offending fields are enumerated in `errors[]`.
|
|
823
|
+
*/
|
|
824
|
+
422: ProblemDetails;
|
|
825
|
+
/**
|
|
826
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
827
|
+
*/
|
|
828
|
+
429: string;
|
|
829
|
+
};
|
|
830
|
+
export type ListAssetsError = ListAssetsErrors[keyof ListAssetsErrors];
|
|
831
|
+
export type ListAssetsResponses = {
|
|
832
|
+
/**
|
|
833
|
+
* OK. One keyset-paginated page of assets.
|
|
834
|
+
*/
|
|
835
|
+
200: AssetList;
|
|
836
|
+
};
|
|
837
|
+
export type ListAssetsResponse = ListAssetsResponses[keyof ListAssetsResponses];
|
|
838
|
+
export type GetAssetByIdData = {
|
|
839
|
+
body?: never;
|
|
840
|
+
path: {
|
|
841
|
+
/**
|
|
842
|
+
* Stable Mocart asset document id.
|
|
843
|
+
*/
|
|
844
|
+
id: string;
|
|
845
|
+
};
|
|
846
|
+
query?: never;
|
|
847
|
+
url: '/assets/{id}';
|
|
848
|
+
};
|
|
849
|
+
export type GetAssetByIdErrors = {
|
|
850
|
+
/**
|
|
851
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
852
|
+
*/
|
|
853
|
+
401: ProblemDetails;
|
|
854
|
+
/**
|
|
855
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
856
|
+
*/
|
|
857
|
+
403: ProblemDetails;
|
|
858
|
+
/**
|
|
859
|
+
* Not Found. No asset matched the identifier (`ASSET_NOT_FOUND`). A cross-tenant, soft-deleted, or non-usable (no stored url) asset id returns this SAME uniform 404 (no-leak).
|
|
860
|
+
*/
|
|
861
|
+
404: ProblemDetails;
|
|
862
|
+
/**
|
|
863
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
864
|
+
*/
|
|
865
|
+
429: string;
|
|
866
|
+
};
|
|
867
|
+
export type GetAssetByIdError = GetAssetByIdErrors[keyof GetAssetByIdErrors];
|
|
868
|
+
export type GetAssetByIdResponses = {
|
|
869
|
+
/**
|
|
870
|
+
* OK. The single asset.
|
|
871
|
+
*/
|
|
872
|
+
200: Asset;
|
|
873
|
+
};
|
|
874
|
+
export type GetAssetByIdResponse = GetAssetByIdResponses[keyof GetAssetByIdResponses];
|
|
875
|
+
export type ListCampaignsData = {
|
|
876
|
+
body?: never;
|
|
877
|
+
path?: never;
|
|
878
|
+
query?: {
|
|
879
|
+
/**
|
|
880
|
+
* Opaque base64url keyset cursor from a prior page's `pagination.nextCursor`. Omit for the first page; pass it back verbatim to continue.
|
|
881
|
+
*/
|
|
882
|
+
cursor?: string;
|
|
883
|
+
/**
|
|
884
|
+
* Optional filter by campaign lifecycle status. When omitted, ALL non-deleted campaigns are returned (there is NO default status).
|
|
885
|
+
*/
|
|
886
|
+
status?: 'IN_PROGRESS' | 'READY' | 'BLOCKED' | 'COMPLETED';
|
|
887
|
+
};
|
|
888
|
+
url: '/campaigns';
|
|
889
|
+
};
|
|
890
|
+
export type ListCampaignsErrors = {
|
|
891
|
+
/**
|
|
892
|
+
* Bad Request. The `cursor` query parameter is not a valid opaque keyset cursor (`INVALID_CURSOR`).
|
|
893
|
+
*/
|
|
894
|
+
400: ProblemDetails;
|
|
895
|
+
/**
|
|
896
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
897
|
+
*/
|
|
898
|
+
401: ProblemDetails;
|
|
899
|
+
/**
|
|
900
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
901
|
+
*/
|
|
902
|
+
403: ProblemDetails;
|
|
903
|
+
/**
|
|
904
|
+
* Unprocessable Content. A query parameter failed field validation (e.g. a non-string shape); the offending fields are enumerated in `errors[]`.
|
|
905
|
+
*/
|
|
906
|
+
422: ProblemDetails;
|
|
907
|
+
/**
|
|
908
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
909
|
+
*/
|
|
910
|
+
429: string;
|
|
911
|
+
};
|
|
912
|
+
export type ListCampaignsError = ListCampaignsErrors[keyof ListCampaignsErrors];
|
|
913
|
+
export type ListCampaignsResponses = {
|
|
914
|
+
/**
|
|
915
|
+
* OK. One keyset-paginated page of campaigns.
|
|
916
|
+
*/
|
|
917
|
+
200: CampaignList;
|
|
918
|
+
};
|
|
919
|
+
export type ListCampaignsResponse = ListCampaignsResponses[keyof ListCampaignsResponses];
|
|
920
|
+
export type GetCampaignByIdData = {
|
|
921
|
+
body?: never;
|
|
922
|
+
path: {
|
|
923
|
+
/**
|
|
924
|
+
* Stable Mocart campaign document id.
|
|
925
|
+
*/
|
|
926
|
+
id: string;
|
|
927
|
+
};
|
|
928
|
+
query?: never;
|
|
929
|
+
url: '/campaigns/{id}';
|
|
930
|
+
};
|
|
931
|
+
export type GetCampaignByIdErrors = {
|
|
932
|
+
/**
|
|
933
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
934
|
+
*/
|
|
935
|
+
401: ProblemDetails;
|
|
936
|
+
/**
|
|
937
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
938
|
+
*/
|
|
939
|
+
403: ProblemDetails;
|
|
940
|
+
/**
|
|
941
|
+
* Not Found. No campaign matched the identifier (`CAMPAIGN_NOT_FOUND`). A cross-tenant or soft-deleted campaign id returns this SAME uniform 404 (no-leak).
|
|
942
|
+
*/
|
|
943
|
+
404: ProblemDetails;
|
|
944
|
+
/**
|
|
945
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
946
|
+
*/
|
|
947
|
+
429: string;
|
|
948
|
+
};
|
|
949
|
+
export type GetCampaignByIdError = GetCampaignByIdErrors[keyof GetCampaignByIdErrors];
|
|
950
|
+
export type GetCampaignByIdResponses = {
|
|
951
|
+
/**
|
|
952
|
+
* OK. The single campaign.
|
|
953
|
+
*/
|
|
954
|
+
200: Campaign;
|
|
955
|
+
};
|
|
956
|
+
export type GetCampaignByIdResponse = GetCampaignByIdResponses[keyof GetCampaignByIdResponses];
|
|
957
|
+
export type ListDeliveriesData = {
|
|
958
|
+
body?: never;
|
|
959
|
+
path?: never;
|
|
960
|
+
query?: {
|
|
961
|
+
/**
|
|
962
|
+
* Opaque base64url keyset cursor from a prior page's `pagination.nextCursor`. Omit for the first page; pass it back verbatim to continue.
|
|
963
|
+
*/
|
|
964
|
+
cursor?: string;
|
|
965
|
+
/**
|
|
966
|
+
* Optional filter by delivery-run status. When omitted, ALL non-deleted runs are returned (there is NO default status). Combinable with `platform`.
|
|
967
|
+
*/
|
|
968
|
+
status?: 'IN_PROGRESS' | 'COMPLETED' | 'COMPLETED_WITH_ISSUES' | 'FAILED';
|
|
969
|
+
/**
|
|
970
|
+
* Optional filter by target delivery platform. When omitted, runs for ALL platforms are returned. Combinable with `status`.
|
|
971
|
+
*/
|
|
972
|
+
platform?: 'instagram' | 'facebook' | 'x' | 'tiktok' | 'shopify' | 'woocommerce' | 'bigcommerce' | 'magento' | 'wix' | 'meta-ads' | 'tiktok-ads' | 'google-display' | 'taboola';
|
|
973
|
+
/**
|
|
974
|
+
* Optional relation expansion. `items` joins each delivery's per-asset items into an `items` array (each a `DeliveryItem` with its live `permalinkUrl`). Absent by default; an unknown expand token is IGNORED (not a 422).
|
|
975
|
+
*/
|
|
976
|
+
expand?: 'items';
|
|
977
|
+
};
|
|
978
|
+
url: '/deliveries';
|
|
979
|
+
};
|
|
980
|
+
export type ListDeliveriesErrors = {
|
|
981
|
+
/**
|
|
982
|
+
* Bad Request. The `cursor` query parameter is not a valid opaque keyset cursor (`INVALID_CURSOR`).
|
|
983
|
+
*/
|
|
984
|
+
400: ProblemDetails;
|
|
985
|
+
/**
|
|
986
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
987
|
+
*/
|
|
988
|
+
401: ProblemDetails;
|
|
989
|
+
/**
|
|
990
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
991
|
+
*/
|
|
992
|
+
403: ProblemDetails;
|
|
993
|
+
/**
|
|
994
|
+
* Unprocessable Content. A query parameter failed field validation (e.g. a non-string shape); the offending fields are enumerated in `errors[]`.
|
|
995
|
+
*/
|
|
996
|
+
422: ProblemDetails;
|
|
997
|
+
/**
|
|
998
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
999
|
+
*/
|
|
1000
|
+
429: string;
|
|
1001
|
+
};
|
|
1002
|
+
export type ListDeliveriesError = ListDeliveriesErrors[keyof ListDeliveriesErrors];
|
|
1003
|
+
export type ListDeliveriesResponses = {
|
|
1004
|
+
/**
|
|
1005
|
+
* OK. One keyset-paginated page of deliveries.
|
|
1006
|
+
*/
|
|
1007
|
+
200: DeliveryList;
|
|
1008
|
+
};
|
|
1009
|
+
export type ListDeliveriesResponse = ListDeliveriesResponses[keyof ListDeliveriesResponses];
|
|
1010
|
+
export type GetDeliveryByIdData = {
|
|
1011
|
+
body?: never;
|
|
1012
|
+
path: {
|
|
1013
|
+
/**
|
|
1014
|
+
* Stable Mocart delivery-run document id.
|
|
1015
|
+
*/
|
|
1016
|
+
id: string;
|
|
1017
|
+
};
|
|
1018
|
+
query?: {
|
|
1019
|
+
/**
|
|
1020
|
+
* Optional relation expansion. `items` joins the run's per-asset items into an `items` array (each a `DeliveryItem` with its live `permalinkUrl`). Absent by default; an unknown expand token is IGNORED (not a 422).
|
|
1021
|
+
*/
|
|
1022
|
+
expand?: 'items';
|
|
1023
|
+
};
|
|
1024
|
+
url: '/deliveries/{id}';
|
|
1025
|
+
};
|
|
1026
|
+
export type GetDeliveryByIdErrors = {
|
|
1027
|
+
/**
|
|
1028
|
+
* Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (`ENTITLEMENT_LOST`). A uniform problem body is returned with a distinct `code`; no owner/condition detail (no-leak).
|
|
1029
|
+
*/
|
|
1030
|
+
401: ProblemDetails;
|
|
1031
|
+
/**
|
|
1032
|
+
* Forbidden. The token does not carry the required scope (`API_TOKEN_SCOPE_DENIED`).
|
|
1033
|
+
*/
|
|
1034
|
+
403: ProblemDetails;
|
|
1035
|
+
/**
|
|
1036
|
+
* Not Found. No delivery matched the identifier (`DELIVERY_RUN_NOT_FOUND`). A cross-tenant or soft-deleted delivery id returns this SAME uniform 404 (no-leak).
|
|
1037
|
+
*/
|
|
1038
|
+
404: ProblemDetails;
|
|
1039
|
+
/**
|
|
1040
|
+
* Too Many Requests. The per-token sliding window of 200 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
|
|
1041
|
+
*/
|
|
1042
|
+
429: string;
|
|
1043
|
+
};
|
|
1044
|
+
export type GetDeliveryByIdError = GetDeliveryByIdErrors[keyof GetDeliveryByIdErrors];
|
|
1045
|
+
export type GetDeliveryByIdResponses = {
|
|
1046
|
+
/**
|
|
1047
|
+
* OK. The single delivery.
|
|
1048
|
+
*/
|
|
1049
|
+
200: Delivery;
|
|
1050
|
+
};
|
|
1051
|
+
export type GetDeliveryByIdResponse = GetDeliveryByIdResponses[keyof GetDeliveryByIdResponses];
|
|
1052
|
+
export type ListRunsData = {
|
|
1053
|
+
body?: never;
|
|
1054
|
+
path?: never;
|
|
1055
|
+
query?: {
|
|
1056
|
+
/**
|
|
1057
|
+
* Page size (default 50).
|
|
1058
|
+
*/
|
|
1059
|
+
limit?: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* Opaque cursor from a prior page's `pagination.nextCursor`; pass it back verbatim.
|
|
1062
|
+
*/
|
|
1063
|
+
cursor?: string;
|
|
1064
|
+
};
|
|
1065
|
+
url: '/runs';
|
|
1066
|
+
};
|
|
1067
|
+
export type ListRunsErrors = {
|
|
1068
|
+
/**
|
|
1069
|
+
* Unauthorized. Missing, malformed, unknown, revoked or expired bearer token — or the key owner no longer holds the Create API entitlement (`CREATE_API_ENTITLEMENT_LOST`).
|
|
1070
|
+
*/
|
|
1071
|
+
401: ProblemDetails;
|
|
1072
|
+
/**
|
|
1073
|
+
* Forbidden. The key lacks the required scope (`API_TOKEN_SCOPE_DENIED`): reads need `runs:read`, creating and stopping need `runs:write`.
|
|
1074
|
+
*/
|
|
1075
|
+
403: ProblemDetails;
|
|
1076
|
+
/**
|
|
1077
|
+
* Unprocessable Content (`VALIDATION_ERROR`). A field has the wrong type or range, or is unknown; every offending field is listed in `errors[]`.
|
|
1078
|
+
*/
|
|
1079
|
+
422: ProblemDetails;
|
|
1080
|
+
/**
|
|
1081
|
+
* Too Many Requests (`RATE_LIMITED`). More than 120 requests per minute on this key.
|
|
1082
|
+
*/
|
|
1083
|
+
429: ProblemDetails;
|
|
1084
|
+
};
|
|
1085
|
+
export type ListRunsError = ListRunsErrors[keyof ListRunsErrors];
|
|
1086
|
+
export type ListRunsResponses = {
|
|
1087
|
+
/**
|
|
1088
|
+
* A page of runs.
|
|
1089
|
+
*/
|
|
1090
|
+
200: RunList;
|
|
1091
|
+
};
|
|
1092
|
+
export type ListRunsResponse = ListRunsResponses[keyof ListRunsResponses];
|
|
1093
|
+
export type CreateRunData = {
|
|
1094
|
+
/**
|
|
1095
|
+
* The recipe: which products, which style, and how many creatives of which kind.
|
|
1096
|
+
*/
|
|
1097
|
+
body: CreateRunRequest;
|
|
1098
|
+
headers: {
|
|
1099
|
+
/**
|
|
1100
|
+
* One unique value (16–255 characters) per logical request. A retry with the same key and body returns the same run and is never charged twice.
|
|
1101
|
+
*/
|
|
1102
|
+
'Idempotency-Key': string;
|
|
1103
|
+
};
|
|
1104
|
+
path?: never;
|
|
1105
|
+
query?: never;
|
|
1106
|
+
url: '/runs';
|
|
1107
|
+
};
|
|
1108
|
+
export type CreateRunErrors = {
|
|
1109
|
+
/**
|
|
1110
|
+
* Bad Request. A cross-field rule failed (`VALIDATION_ERROR`, naming the fix), the run has more items than the plan allows (`TOO_MANY_ITEMS`), or a product has no primary image (`NO_PRIMARY_IMAGE`).
|
|
1111
|
+
*/
|
|
1112
|
+
400: ProblemDetails;
|
|
1113
|
+
/**
|
|
1114
|
+
* Unauthorized. Missing, malformed, unknown, revoked or expired bearer token — or the key owner no longer holds the Create API entitlement (`CREATE_API_ENTITLEMENT_LOST`).
|
|
1115
|
+
*/
|
|
1116
|
+
401: ProblemDetails;
|
|
1117
|
+
/**
|
|
1118
|
+
* Forbidden. The key lacks the required scope (`API_TOKEN_SCOPE_DENIED`): reads need `runs:read`, creating and stopping need `runs:write`.
|
|
1119
|
+
*/
|
|
1120
|
+
403: ProblemDetails;
|
|
1121
|
+
/**
|
|
1122
|
+
* Not Found (`PRODUCTS_NOT_IN_CATALOG`). Every product id not in the account's catalog is named.
|
|
1123
|
+
*/
|
|
1124
|
+
404: ProblemDetails;
|
|
1125
|
+
/**
|
|
1126
|
+
* Conflict. The quote exceeds `maxCredits` (`PRICE_EXCEEDS_MAX`) or differs from `expectedTotalCredits` (`PRICE_CHANGED`); the run does not fit what is left of the account's daily API credit budget (`ACCOUNT_SPEND_CAP_EXCEEDED`, with the numbers and the reset instant in `budget`); a create with this key is still in progress (`IDEMPOTENCY_IN_PROGRESS`, retry shortly); or the key was used for a different request (`IDEMPOTENCY_KEY_REUSED`). A budget refusal burns no key.
|
|
1127
|
+
*/
|
|
1128
|
+
409: ProblemDetails;
|
|
1129
|
+
/**
|
|
1130
|
+
* Unprocessable Content (`VALIDATION_ERROR`). A field has the wrong type or range, or is unknown; every offending field is listed in `errors[]`.
|
|
1131
|
+
*/
|
|
1132
|
+
422: ProblemDetails;
|
|
1133
|
+
/**
|
|
1134
|
+
* Too Many Requests (`RATE_LIMITED`). More than 20 requests per minute on this key.
|
|
1135
|
+
*/
|
|
1136
|
+
429: ProblemDetails;
|
|
1137
|
+
/**
|
|
1138
|
+
* Service Unavailable (`CREATE_API_DISABLED`). New runs are paused; existing runs can still be read. Or (`ACCOUNT_SPEND_UNAVAILABLE`) the account's daily API credit budget could not be checked, so nothing was created. Retry after the `Retry-After` interval.
|
|
1139
|
+
*/
|
|
1140
|
+
503: ProblemDetails;
|
|
1141
|
+
};
|
|
1142
|
+
export type CreateRunError = CreateRunErrors[keyof CreateRunErrors];
|
|
1143
|
+
export type CreateRunResponses = {
|
|
1144
|
+
/**
|
|
1145
|
+
* Accepted — or the replay of an earlier create with this key.
|
|
1146
|
+
*/
|
|
1147
|
+
202: Run;
|
|
1148
|
+
};
|
|
1149
|
+
export type CreateRunResponse = CreateRunResponses[keyof CreateRunResponses];
|
|
1150
|
+
export type EstimateRunData = {
|
|
1151
|
+
/**
|
|
1152
|
+
* The recipe: which products, which style, and how many creatives of which kind.
|
|
1153
|
+
*/
|
|
1154
|
+
body: CreateRunRequest;
|
|
1155
|
+
path?: never;
|
|
1156
|
+
query?: never;
|
|
1157
|
+
url: '/runs/estimate';
|
|
1158
|
+
};
|
|
1159
|
+
export type EstimateRunErrors = {
|
|
1160
|
+
/**
|
|
1161
|
+
* Bad Request. A cross-field rule failed (`VALIDATION_ERROR`, naming the fix), the run has more items than the plan allows (`TOO_MANY_ITEMS`), or a product has no primary image (`NO_PRIMARY_IMAGE`).
|
|
1162
|
+
*/
|
|
1163
|
+
400: ProblemDetails;
|
|
1164
|
+
/**
|
|
1165
|
+
* Unauthorized. Missing, malformed, unknown, revoked or expired bearer token — or the key owner no longer holds the Create API entitlement (`CREATE_API_ENTITLEMENT_LOST`).
|
|
1166
|
+
*/
|
|
1167
|
+
401: ProblemDetails;
|
|
1168
|
+
/**
|
|
1169
|
+
* Forbidden. The key lacks the required scope (`API_TOKEN_SCOPE_DENIED`): reads need `runs:read`, creating and stopping need `runs:write`.
|
|
1170
|
+
*/
|
|
1171
|
+
403: ProblemDetails;
|
|
1172
|
+
/**
|
|
1173
|
+
* Not Found (`PRODUCTS_NOT_IN_CATALOG`). Every product id not in the account's catalog is named.
|
|
1174
|
+
*/
|
|
1175
|
+
404: ProblemDetails;
|
|
1176
|
+
/**
|
|
1177
|
+
* Conflict. The quote exceeds `maxCredits` (`PRICE_EXCEEDS_MAX`) or differs from `expectedTotalCredits` (`PRICE_CHANGED`). Nothing was written or charged.
|
|
1178
|
+
*/
|
|
1179
|
+
409: ProblemDetails;
|
|
1180
|
+
/**
|
|
1181
|
+
* Unprocessable Content (`VALIDATION_ERROR`). A field has the wrong type or range, or is unknown; every offending field is listed in `errors[]`.
|
|
1182
|
+
*/
|
|
1183
|
+
422: ProblemDetails;
|
|
1184
|
+
/**
|
|
1185
|
+
* Too Many Requests (`RATE_LIMITED`). More than 120 requests per minute on this key.
|
|
1186
|
+
*/
|
|
1187
|
+
429: ProblemDetails;
|
|
1188
|
+
};
|
|
1189
|
+
export type EstimateRunError = EstimateRunErrors[keyof EstimateRunErrors];
|
|
1190
|
+
export type EstimateRunResponses = {
|
|
1191
|
+
/**
|
|
1192
|
+
* The quote this recipe would be created at.
|
|
1193
|
+
*/
|
|
1194
|
+
200: RunEstimate;
|
|
1195
|
+
};
|
|
1196
|
+
export type EstimateRunResponse = EstimateRunResponses[keyof EstimateRunResponses];
|
|
1197
|
+
export type ListPresetsData = {
|
|
1198
|
+
body?: never;
|
|
1199
|
+
path?: never;
|
|
1200
|
+
query?: never;
|
|
1201
|
+
url: '/presets';
|
|
1202
|
+
};
|
|
1203
|
+
export type ListPresetsErrors = {
|
|
1204
|
+
/**
|
|
1205
|
+
* Unauthorized. Missing, malformed, unknown, revoked or expired bearer token — or the key owner no longer holds the Create API entitlement (`CREATE_API_ENTITLEMENT_LOST`).
|
|
1206
|
+
*/
|
|
1207
|
+
401: ProblemDetails;
|
|
1208
|
+
/**
|
|
1209
|
+
* Forbidden. The key lacks the required scope (`API_TOKEN_SCOPE_DENIED`): reads need `runs:read`, creating and stopping need `runs:write`.
|
|
1210
|
+
*/
|
|
1211
|
+
403: ProblemDetails;
|
|
1212
|
+
/**
|
|
1213
|
+
* Unprocessable Content (`VALIDATION_ERROR`). A field has the wrong type or range, or is unknown; every offending field is listed in `errors[]`.
|
|
1214
|
+
*/
|
|
1215
|
+
422: ProblemDetails;
|
|
1216
|
+
/**
|
|
1217
|
+
* Too Many Requests (`RATE_LIMITED`). More than 120 requests per minute on this key.
|
|
1218
|
+
*/
|
|
1219
|
+
429: ProblemDetails;
|
|
1220
|
+
};
|
|
1221
|
+
export type ListPresetsError = ListPresetsErrors[keyof ListPresetsErrors];
|
|
1222
|
+
export type ListPresetsResponses = {
|
|
1223
|
+
/**
|
|
1224
|
+
* Every available preset.
|
|
1225
|
+
*/
|
|
1226
|
+
200: RunPresetList;
|
|
1227
|
+
};
|
|
1228
|
+
export type ListPresetsResponse = ListPresetsResponses[keyof ListPresetsResponses];
|
|
1229
|
+
export type GetRunData = {
|
|
1230
|
+
body?: never;
|
|
1231
|
+
path: {
|
|
1232
|
+
/**
|
|
1233
|
+
* The `runId` returned by `POST /runs`.
|
|
1234
|
+
*/
|
|
1235
|
+
runId: string;
|
|
1236
|
+
};
|
|
1237
|
+
query?: never;
|
|
1238
|
+
url: '/runs/{runId}';
|
|
1239
|
+
};
|
|
1240
|
+
export type GetRunErrors = {
|
|
1241
|
+
/**
|
|
1242
|
+
* Unauthorized. Missing, malformed, unknown, revoked or expired bearer token — or the key owner no longer holds the Create API entitlement (`CREATE_API_ENTITLEMENT_LOST`).
|
|
1243
|
+
*/
|
|
1244
|
+
401: ProblemDetails;
|
|
1245
|
+
/**
|
|
1246
|
+
* Forbidden. The key lacks the required scope (`API_TOKEN_SCOPE_DENIED`): reads need `runs:read`, creating and stopping need `runs:write`.
|
|
1247
|
+
*/
|
|
1248
|
+
403: ProblemDetails;
|
|
1249
|
+
/**
|
|
1250
|
+
* Not Found (`RUN_NOT_FOUND`). No run with this id belongs to the key's account.
|
|
1251
|
+
*/
|
|
1252
|
+
404: ProblemDetails;
|
|
1253
|
+
/**
|
|
1254
|
+
* Too Many Requests (`RATE_LIMITED`). More than 120 requests per minute on this key.
|
|
1255
|
+
*/
|
|
1256
|
+
429: ProblemDetails;
|
|
1257
|
+
};
|
|
1258
|
+
export type GetRunError = GetRunErrors[keyof GetRunErrors];
|
|
1259
|
+
export type GetRunResponses = {
|
|
1260
|
+
/**
|
|
1261
|
+
* The run.
|
|
1262
|
+
*/
|
|
1263
|
+
200: Run;
|
|
1264
|
+
};
|
|
1265
|
+
export type GetRunResponse = GetRunResponses[keyof GetRunResponses];
|
|
1266
|
+
export type ListRunItemsData = {
|
|
1267
|
+
body?: never;
|
|
1268
|
+
path: {
|
|
1269
|
+
/**
|
|
1270
|
+
* The `runId` returned by `POST /runs`.
|
|
1271
|
+
*/
|
|
1272
|
+
runId: string;
|
|
1273
|
+
};
|
|
1274
|
+
query?: {
|
|
1275
|
+
/**
|
|
1276
|
+
* Page size (default 50).
|
|
1277
|
+
*/
|
|
1278
|
+
limit?: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* Opaque cursor from a prior page's `pagination.nextCursor`; pass it back verbatim.
|
|
1281
|
+
*/
|
|
1282
|
+
cursor?: string;
|
|
1283
|
+
};
|
|
1284
|
+
url: '/runs/{runId}/items';
|
|
1285
|
+
};
|
|
1286
|
+
export type ListRunItemsErrors = {
|
|
1287
|
+
/**
|
|
1288
|
+
* Unauthorized. Missing, malformed, unknown, revoked or expired bearer token — or the key owner no longer holds the Create API entitlement (`CREATE_API_ENTITLEMENT_LOST`).
|
|
1289
|
+
*/
|
|
1290
|
+
401: ProblemDetails;
|
|
1291
|
+
/**
|
|
1292
|
+
* Forbidden. The key lacks the required scope (`API_TOKEN_SCOPE_DENIED`): reads need `runs:read`, creating and stopping need `runs:write`.
|
|
1293
|
+
*/
|
|
1294
|
+
403: ProblemDetails;
|
|
1295
|
+
/**
|
|
1296
|
+
* Not Found (`RUN_NOT_FOUND`). No run with this id belongs to the key's account.
|
|
1297
|
+
*/
|
|
1298
|
+
404: ProblemDetails;
|
|
1299
|
+
/**
|
|
1300
|
+
* Unprocessable Content (`VALIDATION_ERROR`). A field has the wrong type or range, or is unknown; every offending field is listed in `errors[]`.
|
|
1301
|
+
*/
|
|
1302
|
+
422: ProblemDetails;
|
|
1303
|
+
/**
|
|
1304
|
+
* Too Many Requests (`RATE_LIMITED`). More than 120 requests per minute on this key.
|
|
1305
|
+
*/
|
|
1306
|
+
429: ProblemDetails;
|
|
1307
|
+
};
|
|
1308
|
+
export type ListRunItemsError = ListRunItemsErrors[keyof ListRunItemsErrors];
|
|
1309
|
+
export type ListRunItemsResponses = {
|
|
1310
|
+
/**
|
|
1311
|
+
* A page of items.
|
|
1312
|
+
*/
|
|
1313
|
+
200: RunItemList;
|
|
1314
|
+
};
|
|
1315
|
+
export type ListRunItemsResponse = ListRunItemsResponses[keyof ListRunItemsResponses];
|
|
1316
|
+
export type StopRunData = {
|
|
1317
|
+
body?: never;
|
|
1318
|
+
path: {
|
|
1319
|
+
/**
|
|
1320
|
+
* The `runId` returned by `POST /runs`.
|
|
1321
|
+
*/
|
|
1322
|
+
runId: string;
|
|
1323
|
+
};
|
|
1324
|
+
query?: never;
|
|
1325
|
+
url: '/runs/{runId}/stop';
|
|
1326
|
+
};
|
|
1327
|
+
export type StopRunErrors = {
|
|
1328
|
+
/**
|
|
1329
|
+
* Unauthorized. Missing, malformed, unknown, revoked or expired bearer token — or the key owner no longer holds the Create API entitlement (`CREATE_API_ENTITLEMENT_LOST`).
|
|
1330
|
+
*/
|
|
1331
|
+
401: ProblemDetails;
|
|
1332
|
+
/**
|
|
1333
|
+
* Forbidden. The key lacks the required scope (`API_TOKEN_SCOPE_DENIED`): reads need `runs:read`, creating and stopping need `runs:write`.
|
|
1334
|
+
*/
|
|
1335
|
+
403: ProblemDetails;
|
|
1336
|
+
/**
|
|
1337
|
+
* Not Found (`RUN_NOT_FOUND`). No run with this id belongs to the key's account.
|
|
1338
|
+
*/
|
|
1339
|
+
404: ProblemDetails;
|
|
1340
|
+
/**
|
|
1341
|
+
* Conflict (`RUN_ALREADY_FINAL`). The run has already finished.
|
|
1342
|
+
*/
|
|
1343
|
+
409: ProblemDetails;
|
|
1344
|
+
/**
|
|
1345
|
+
* Too Many Requests (`RATE_LIMITED`). More than 20 requests per minute on this key.
|
|
1346
|
+
*/
|
|
1347
|
+
429: ProblemDetails;
|
|
1348
|
+
};
|
|
1349
|
+
export type StopRunError = StopRunErrors[keyof StopRunErrors];
|
|
1350
|
+
export type StopRunResponses = {
|
|
1351
|
+
/**
|
|
1352
|
+
* Stop accepted.
|
|
1353
|
+
*/
|
|
1354
|
+
202: Run;
|
|
1355
|
+
};
|
|
1356
|
+
export type StopRunResponse = StopRunResponses[keyof StopRunResponses];
|
|
1357
|
+
/**
|
|
1358
|
+
* The RunCompletedEvent envelope delivered by Svix (Standard Webhooks).
|
|
1359
|
+
*/
|
|
1360
|
+
export type RunCompletedWebhookWebhookPayload = RunCompletedEvent;
|
|
1361
|
+
export type RunCompletedWebhookWebhookRequest = {
|
|
1362
|
+
body: RunCompletedWebhookWebhookPayload;
|
|
1363
|
+
key: 'run.completed';
|
|
1364
|
+
path?: never;
|
|
1365
|
+
query?: never;
|
|
1366
|
+
};
|
|
1367
|
+
//# sourceMappingURL=types.gen.d.ts.map
|