@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,88 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam, } from './pathSerializer.gen.js';
|
|
3
|
+
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
4
|
+
export const defaultPathSerializer = ({ path, url: _url }) => {
|
|
5
|
+
let url = _url;
|
|
6
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
7
|
+
if (matches) {
|
|
8
|
+
for (const match of matches) {
|
|
9
|
+
let explode = false;
|
|
10
|
+
let name = match.substring(1, match.length - 1);
|
|
11
|
+
let style = 'simple';
|
|
12
|
+
if (name.endsWith('*')) {
|
|
13
|
+
explode = true;
|
|
14
|
+
name = name.substring(0, name.length - 1);
|
|
15
|
+
}
|
|
16
|
+
if (name.startsWith('.')) {
|
|
17
|
+
name = name.substring(1);
|
|
18
|
+
style = 'label';
|
|
19
|
+
}
|
|
20
|
+
else if (name.startsWith(';')) {
|
|
21
|
+
name = name.substring(1);
|
|
22
|
+
style = 'matrix';
|
|
23
|
+
}
|
|
24
|
+
const value = path[name];
|
|
25
|
+
if (value === undefined || value === null) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(value)) {
|
|
29
|
+
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (typeof value === 'object') {
|
|
33
|
+
url = url.replace(match, serializeObjectParam({
|
|
34
|
+
explode,
|
|
35
|
+
name,
|
|
36
|
+
style,
|
|
37
|
+
value: value,
|
|
38
|
+
valueOnly: true,
|
|
39
|
+
}));
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (style === 'matrix') {
|
|
43
|
+
url = url.replace(match, `;${serializePrimitiveParam({
|
|
44
|
+
name,
|
|
45
|
+
value: value,
|
|
46
|
+
})}`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const replaceValue = encodeURIComponent(style === 'label' ? `.${value}` : value);
|
|
50
|
+
url = url.replace(match, replaceValue);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return url;
|
|
54
|
+
};
|
|
55
|
+
export const getUrl = ({ baseUrl, path, query, querySerializer, url: _url, }) => {
|
|
56
|
+
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
57
|
+
let url = (baseUrl ?? '') + pathUrl;
|
|
58
|
+
if (path) {
|
|
59
|
+
url = defaultPathSerializer({ path, url });
|
|
60
|
+
}
|
|
61
|
+
let search = query ? querySerializer(query) : '';
|
|
62
|
+
if (search.startsWith('?')) {
|
|
63
|
+
search = search.substring(1);
|
|
64
|
+
}
|
|
65
|
+
if (search) {
|
|
66
|
+
url += `?${search}`;
|
|
67
|
+
}
|
|
68
|
+
return url;
|
|
69
|
+
};
|
|
70
|
+
export function getValidRequestBody(options) {
|
|
71
|
+
const hasBody = options.body !== undefined;
|
|
72
|
+
const isSerializedBody = hasBody && options.bodySerializer;
|
|
73
|
+
if (isSerializedBody) {
|
|
74
|
+
if ('serializedBody' in options) {
|
|
75
|
+
const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== '';
|
|
76
|
+
return hasSerializedBody ? options.serializedBody : null;
|
|
77
|
+
}
|
|
78
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
79
|
+
return options.body !== '' ? options.body : null;
|
|
80
|
+
}
|
|
81
|
+
// plain/text body
|
|
82
|
+
if (hasBody) {
|
|
83
|
+
return options.body;
|
|
84
|
+
}
|
|
85
|
+
// no body was provided
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=utils.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.gen.js","sourceRoot":"","sources":["../../../src/generated/core/utils.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAGrD,OAAO,EAEL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAOjC,MAAM,CAAC,MAAM,aAAa,GAAW,aAAa,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAkB,EAAU,EAAE;IACnF,IAAI,GAAG,GAAG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AC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,IAAI,IAAI,MAAM,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,OAInC;IACC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;IAC3C,MAAM,gBAAgB,GAAG,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC;IAE3D,IAAI,gBAAgB,EAAE,CAAC;QACrB,IAAI,gBAAgB,IAAI,OAAO,EAAE,CAAC;YAChC,MAAM,iBAAiB,GACrB,OAAO,CAAC,cAAc,KAAK,SAAS,IAAI,OAAO,CAAC,cAAc,KAAK,EAAE,CAAC;YAExE,OAAO,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,CAAC;QAED,2EAA2E;QAC3E,OAAO,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,CAAC;IAED,kBAAkB;IAClB,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,uBAAuB;IACvB,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createRun, estimateRun, getAssetById, getCampaignById, getCreativeById, getDeliveryById, getProductById, getRun, listAssets, listCampaigns, listCreatives, listDeliveries, listPresets, listProducts, listRunItems, listRuns, type Options, stopRun } from './sdk.gen.js';
|
|
2
|
+
export type { AccountSpendBudget, Asset, AssetList, Campaign, CampaignList, ClientOptions, CreateRunData, CreateRunError, CreateRunErrors, CreateRunRequest, CreateRunResponse, CreateRunResponses, Creative, CreativeList, Delivery, DeliveryItem, DeliveryList, EstimateRunData, EstimateRunError, EstimateRunErrors, EstimateRunResponse, EstimateRunResponses, GetAssetByIdData, GetAssetByIdError, GetAssetByIdErrors, GetAssetByIdResponse, GetAssetByIdResponses, GetCampaignByIdData, GetCampaignByIdError, GetCampaignByIdErrors, GetCampaignByIdResponse, GetCampaignByIdResponses, GetCreativeByIdData, GetCreativeByIdError, GetCreativeByIdErrors, GetCreativeByIdResponse, GetCreativeByIdResponses, GetDeliveryByIdData, GetDeliveryByIdError, GetDeliveryByIdErrors, GetDeliveryByIdResponse, GetDeliveryByIdResponses, GetProductByIdData, GetProductByIdError, GetProductByIdErrors, GetProductByIdResponse, GetProductByIdResponses, GetRunData, GetRunError, GetRunErrors, GetRunResponse, GetRunResponses, ListAssetsData, ListAssetsError, ListAssetsErrors, ListAssetsResponse, ListAssetsResponses, ListCampaignsData, ListCampaignsError, ListCampaignsErrors, ListCampaignsResponse, ListCampaignsResponses, ListCreativesData, ListCreativesError, ListCreativesErrors, ListCreativesResponse, ListCreativesResponses, ListDeliveriesData, ListDeliveriesError, ListDeliveriesErrors, ListDeliveriesResponse, ListDeliveriesResponses, ListPresetsData, ListPresetsError, ListPresetsErrors, ListPresetsResponse, ListPresetsResponses, ListProductsData, ListProductsError, ListProductsErrors, ListProductsResponse, ListProductsResponses, ListRunItemsData, ListRunItemsError, ListRunItemsErrors, ListRunItemsResponse, ListRunItemsResponses, ListRunsData, ListRunsError, ListRunsErrors, ListRunsResponse, ListRunsResponses, Pagination, ProblemDetails, Product, ProductList, Run, RunCompletedEvent, RunCompletedWebhookWebhookPayload, RunCompletedWebhookWebhookRequest, RunCompletionEstimate, RunCounts, RunCredits, RunEstimate, RunItem, RunItemList, RunList, RunPreset, RunPresetList, RunPresetListWritable, RunPresetWritable, RunQuote, StopRunData, StopRunError, StopRunErrors, StopRunResponse, StopRunResponses, Webhooks } from './types.gen.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnR,YAAY,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,iBAAiB,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,qBAAqB,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
export { createRun, estimateRun, getAssetById, getCampaignById, getCreativeById, getDeliveryById, getProductById, getRun, listAssets, listCampaigns, listCreatives, listDeliveries, listPresets, listProducts, listRunItems, listRuns, stopRun } from './sdk.gen.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAgB,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
|
|
2
|
+
import type { CreateRunData, CreateRunErrors, CreateRunResponses, EstimateRunData, EstimateRunErrors, EstimateRunResponses, GetAssetByIdData, GetAssetByIdErrors, GetAssetByIdResponses, GetCampaignByIdData, GetCampaignByIdErrors, GetCampaignByIdResponses, GetCreativeByIdData, GetCreativeByIdErrors, GetCreativeByIdResponses, GetDeliveryByIdData, GetDeliveryByIdErrors, GetDeliveryByIdResponses, GetProductByIdData, GetProductByIdErrors, GetProductByIdResponses, GetRunData, GetRunErrors, GetRunResponses, ListAssetsData, ListAssetsErrors, ListAssetsResponses, ListCampaignsData, ListCampaignsErrors, ListCampaignsResponses, ListCreativesData, ListCreativesErrors, ListCreativesResponses, ListDeliveriesData, ListDeliveriesErrors, ListDeliveriesResponses, ListPresetsData, ListPresetsErrors, ListPresetsResponses, ListProductsData, ListProductsErrors, ListProductsResponses, ListRunItemsData, ListRunItemsErrors, ListRunItemsResponses, ListRunsData, ListRunsErrors, ListRunsResponses, StopRunData, StopRunErrors, StopRunResponses } from './types.gen.js';
|
|
3
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
|
+
/**
|
|
5
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
6
|
+
* individual options. This might be also useful if you want to implement a
|
|
7
|
+
* custom client.
|
|
8
|
+
*/
|
|
9
|
+
client?: Client;
|
|
10
|
+
/**
|
|
11
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
12
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
13
|
+
*/
|
|
14
|
+
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* List products (keyset-paginated)
|
|
18
|
+
*
|
|
19
|
+
* Returns one page of products in the uniform list envelope `{ data, pagination }`. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const listProducts: <ThrowOnError extends boolean = false>(options?: Options<ListProductsData, ThrowOnError>) => RequestResult<ListProductsResponses, ListProductsErrors, ThrowOnError>;
|
|
22
|
+
/**
|
|
23
|
+
* Get a single product by id
|
|
24
|
+
*
|
|
25
|
+
* Returns the single product with the given stable Mocart product document id.
|
|
26
|
+
*/
|
|
27
|
+
export declare const getProductById: <ThrowOnError extends boolean = false>(options: Options<GetProductByIdData, ThrowOnError>) => RequestResult<GetProductByIdResponses, GetProductByIdErrors, ThrowOnError>;
|
|
28
|
+
/**
|
|
29
|
+
* List creatives (keyset-paginated)
|
|
30
|
+
*
|
|
31
|
+
* Returns one page of usable (image/video) creatives in the uniform list envelope `{ data, pagination }`. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Add `?expand=product` to join each creative's linked product.
|
|
32
|
+
*/
|
|
33
|
+
export declare const listCreatives: <ThrowOnError extends boolean = false>(options?: Options<ListCreativesData, ThrowOnError>) => RequestResult<ListCreativesResponses, ListCreativesErrors, ThrowOnError>;
|
|
34
|
+
/**
|
|
35
|
+
* Get a single creative by id
|
|
36
|
+
*
|
|
37
|
+
* Returns the single usable creative with the given stable Mocart creative document id. Add `?expand=product` to join the linked product.
|
|
38
|
+
*/
|
|
39
|
+
export declare const getCreativeById: <ThrowOnError extends boolean = false>(options: Options<GetCreativeByIdData, ThrowOnError>) => RequestResult<GetCreativeByIdResponses, GetCreativeByIdErrors, ThrowOnError>;
|
|
40
|
+
/**
|
|
41
|
+
* List assets (keyset-paginated)
|
|
42
|
+
*
|
|
43
|
+
* Returns one page of usable assets (each with a durable stored url) in the uniform list envelope `{ data, pagination }`. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Filter by `?type=`, `?status=` and/or `?favorited=true` (combinable); an omitted `?status=` returns the ready set (`active` + `completed`), and `?favorited=true` returns only shortlisted assets.
|
|
44
|
+
*/
|
|
45
|
+
export declare const listAssets: <ThrowOnError extends boolean = false>(options?: Options<ListAssetsData, ThrowOnError>) => RequestResult<ListAssetsResponses, ListAssetsErrors, ThrowOnError>;
|
|
46
|
+
/**
|
|
47
|
+
* Get a single asset by id
|
|
48
|
+
*
|
|
49
|
+
* Returns the single usable asset with the given stable Mocart asset document id.
|
|
50
|
+
*/
|
|
51
|
+
export declare const getAssetById: <ThrowOnError extends boolean = false>(options: Options<GetAssetByIdData, ThrowOnError>) => RequestResult<GetAssetByIdResponses, GetAssetByIdErrors, ThrowOnError>;
|
|
52
|
+
/**
|
|
53
|
+
* List campaigns (keyset-paginated)
|
|
54
|
+
*
|
|
55
|
+
* Returns one page of the owner's non-deleted campaigns in the uniform list envelope `{ data, pagination }`, newest first. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Filter by `?status=` for an exact status match; omit it for all campaigns.
|
|
56
|
+
*/
|
|
57
|
+
export declare const listCampaigns: <ThrowOnError extends boolean = false>(options?: Options<ListCampaignsData, ThrowOnError>) => RequestResult<ListCampaignsResponses, ListCampaignsErrors, ThrowOnError>;
|
|
58
|
+
/**
|
|
59
|
+
* Get a single campaign by id
|
|
60
|
+
*
|
|
61
|
+
* Returns the single non-deleted campaign with the given stable Mocart campaign document id.
|
|
62
|
+
*/
|
|
63
|
+
export declare const getCampaignById: <ThrowOnError extends boolean = false>(options: Options<GetCampaignByIdData, ThrowOnError>) => RequestResult<GetCampaignByIdResponses, GetCampaignByIdErrors, ThrowOnError>;
|
|
64
|
+
/**
|
|
65
|
+
* List deliveries (keyset-paginated)
|
|
66
|
+
*
|
|
67
|
+
* Returns one page of the owner's non-deleted delivery runs in the uniform list envelope `{ data, pagination }`, newest first. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Filter by `?status=` and/or `?platform=` (combinable); add `?expand=items` to join each run's per-asset items.
|
|
68
|
+
*/
|
|
69
|
+
export declare const listDeliveries: <ThrowOnError extends boolean = false>(options?: Options<ListDeliveriesData, ThrowOnError>) => RequestResult<ListDeliveriesResponses, ListDeliveriesErrors, ThrowOnError>;
|
|
70
|
+
/**
|
|
71
|
+
* Get a single delivery by id
|
|
72
|
+
*
|
|
73
|
+
* Returns the single non-deleted delivery run with the given stable Mocart delivery-run document id. Add `?expand=items` to join its per-asset items.
|
|
74
|
+
*/
|
|
75
|
+
export declare const getDeliveryById: <ThrowOnError extends boolean = false>(options: Options<GetDeliveryByIdData, ThrowOnError>) => RequestResult<GetDeliveryByIdResponses, GetDeliveryByIdErrors, ThrowOnError>;
|
|
76
|
+
/**
|
|
77
|
+
* List runs
|
|
78
|
+
*
|
|
79
|
+
* The key's account's runs, newest first.
|
|
80
|
+
*/
|
|
81
|
+
export declare const listRuns: <ThrowOnError extends boolean = false>(options?: Options<ListRunsData, ThrowOnError>) => RequestResult<ListRunsResponses, ListRunsErrors, ThrowOnError>;
|
|
82
|
+
/**
|
|
83
|
+
* Create a run
|
|
84
|
+
*
|
|
85
|
+
* Starts generating `creativesPerProduct` creatives for each product. Answers 202 at once; poll `GET /runs/{runId}` and collect results from `GET /runs/{runId}/items`. Credits are held per item as it starts and charged only for creatives that are produced.
|
|
86
|
+
*/
|
|
87
|
+
export declare const createRun: <ThrowOnError extends boolean = false>(options: Options<CreateRunData, ThrowOnError>) => RequestResult<CreateRunResponses, CreateRunErrors, ThrowOnError>;
|
|
88
|
+
/**
|
|
89
|
+
* Price a run without creating it
|
|
90
|
+
*
|
|
91
|
+
* Validates the same body as `POST /runs` and returns the quote. Writes nothing and charges nothing; needs only `runs:read`. When the account has a daily API credit budget, `budget` reports it — even when it is already too small for this run, so the price can be checked before anyone agrees to it.
|
|
92
|
+
*/
|
|
93
|
+
export declare const estimateRun: <ThrowOnError extends boolean = false>(options: Options<EstimateRunData, ThrowOnError>) => RequestResult<EstimateRunResponses, EstimateRunErrors, ThrowOnError>;
|
|
94
|
+
/**
|
|
95
|
+
* List styles (presets)
|
|
96
|
+
*
|
|
97
|
+
* The styles a run can use as `presetId`, with the `selections` keys each understands.
|
|
98
|
+
*/
|
|
99
|
+
export declare const listPresets: <ThrowOnError extends boolean = false>(options?: Options<ListPresetsData, ThrowOnError>) => RequestResult<ListPresetsResponses, ListPresetsErrors, ThrowOnError>;
|
|
100
|
+
/**
|
|
101
|
+
* Get a run
|
|
102
|
+
*
|
|
103
|
+
* Status and counts. Poll this until `finalizedAt` is set.
|
|
104
|
+
*/
|
|
105
|
+
export declare const getRun: <ThrowOnError extends boolean = false>(options: Options<GetRunData, ThrowOnError>) => RequestResult<GetRunResponses, GetRunErrors, ThrowOnError>;
|
|
106
|
+
/**
|
|
107
|
+
* List a run's items
|
|
108
|
+
*
|
|
109
|
+
* One row per planned creative, in request order, with its outcome and — once produced — its asset.
|
|
110
|
+
*/
|
|
111
|
+
export declare const listRunItems: <ThrowOnError extends boolean = false>(options: Options<ListRunItemsData, ThrowOnError>) => RequestResult<ListRunItemsResponses, ListRunItemsErrors, ThrowOnError>;
|
|
112
|
+
/**
|
|
113
|
+
* Stop a run
|
|
114
|
+
*
|
|
115
|
+
* No new items start. Items already in progress finish, and are charged only if they produce a creative. Answers 202 with the run, which reads `STOPPING` until it settles.
|
|
116
|
+
*/
|
|
117
|
+
export declare const stopRun: <ThrowOnError extends boolean = false>(options: Options<StopRunData, ThrowOnError>) => RequestResult<StopRunResponses, StopRunErrors, ThrowOnError>;
|
|
118
|
+
//# sourceMappingURL=sdk.gen.d.ts.map
|
|
@@ -0,0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AK,EAAE,SAAS,OAAO,CAAC,eAAe,EAAE,YAAY,CAAC,KAAG,aAAa,CAAC,oBAAoB,EAAE,iBAAiB,EAAE,YAAY,CAQrL,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,UAAU,OAAO,CAAC,eAAe,EAAE,YAAY,CAAC,KAAG,aAAa,CAAC,oBAAoB,EAAE,iBAAiB,EAAE,YAAY,CAItL,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,KAAG,aAAa,CAAC,eAAe,EAAE,YAAY,EAAE,YAAY,CAIjK,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,KAAG,aAAa,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,YAAY,CAIzL,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,SAAS,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,KAAG,aAAa,CAAC,gBAAgB,EAAE,aAAa,EAAE,YAAY,CAIrK,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { client } from './client.gen.js';
|
|
3
|
+
/**
|
|
4
|
+
* List products (keyset-paginated)
|
|
5
|
+
*
|
|
6
|
+
* Returns one page of products in the uniform list envelope `{ data, pagination }`. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`.
|
|
7
|
+
*/
|
|
8
|
+
export const listProducts = (options) => (options?.client ?? client).get({
|
|
9
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
10
|
+
url: '/products',
|
|
11
|
+
...options
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Get a single product by id
|
|
15
|
+
*
|
|
16
|
+
* Returns the single product with the given stable Mocart product document id.
|
|
17
|
+
*/
|
|
18
|
+
export const getProductById = (options) => (options.client ?? client).get({
|
|
19
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
20
|
+
url: '/products/{id}',
|
|
21
|
+
...options
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* List creatives (keyset-paginated)
|
|
25
|
+
*
|
|
26
|
+
* Returns one page of usable (image/video) creatives in the uniform list envelope `{ data, pagination }`. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Add `?expand=product` to join each creative's linked product.
|
|
27
|
+
*/
|
|
28
|
+
export const listCreatives = (options) => (options?.client ?? client).get({
|
|
29
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
30
|
+
url: '/creatives',
|
|
31
|
+
...options
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Get a single creative by id
|
|
35
|
+
*
|
|
36
|
+
* Returns the single usable creative with the given stable Mocart creative document id. Add `?expand=product` to join the linked product.
|
|
37
|
+
*/
|
|
38
|
+
export const getCreativeById = (options) => (options.client ?? client).get({
|
|
39
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
40
|
+
url: '/creatives/{id}',
|
|
41
|
+
...options
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* List assets (keyset-paginated)
|
|
45
|
+
*
|
|
46
|
+
* Returns one page of usable assets (each with a durable stored url) in the uniform list envelope `{ data, pagination }`. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Filter by `?type=`, `?status=` and/or `?favorited=true` (combinable); an omitted `?status=` returns the ready set (`active` + `completed`), and `?favorited=true` returns only shortlisted assets.
|
|
47
|
+
*/
|
|
48
|
+
export const listAssets = (options) => (options?.client ?? client).get({
|
|
49
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
50
|
+
url: '/assets',
|
|
51
|
+
...options
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Get a single asset by id
|
|
55
|
+
*
|
|
56
|
+
* Returns the single usable asset with the given stable Mocart asset document id.
|
|
57
|
+
*/
|
|
58
|
+
export const getAssetById = (options) => (options.client ?? client).get({
|
|
59
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
60
|
+
url: '/assets/{id}',
|
|
61
|
+
...options
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* List campaigns (keyset-paginated)
|
|
65
|
+
*
|
|
66
|
+
* Returns one page of the owner's non-deleted campaigns in the uniform list envelope `{ data, pagination }`, newest first. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Filter by `?status=` for an exact status match; omit it for all campaigns.
|
|
67
|
+
*/
|
|
68
|
+
export const listCampaigns = (options) => (options?.client ?? client).get({
|
|
69
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
70
|
+
url: '/campaigns',
|
|
71
|
+
...options
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Get a single campaign by id
|
|
75
|
+
*
|
|
76
|
+
* Returns the single non-deleted campaign with the given stable Mocart campaign document id.
|
|
77
|
+
*/
|
|
78
|
+
export const getCampaignById = (options) => (options.client ?? client).get({
|
|
79
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
80
|
+
url: '/campaigns/{id}',
|
|
81
|
+
...options
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* List deliveries (keyset-paginated)
|
|
85
|
+
*
|
|
86
|
+
* Returns one page of the owner's non-deleted delivery runs in the uniform list envelope `{ data, pagination }`, newest first. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Filter by `?status=` and/or `?platform=` (combinable); add `?expand=items` to join each run's per-asset items.
|
|
87
|
+
*/
|
|
88
|
+
export const listDeliveries = (options) => (options?.client ?? client).get({
|
|
89
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
90
|
+
url: '/deliveries',
|
|
91
|
+
...options
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Get a single delivery by id
|
|
95
|
+
*
|
|
96
|
+
* Returns the single non-deleted delivery run with the given stable Mocart delivery-run document id. Add `?expand=items` to join its per-asset items.
|
|
97
|
+
*/
|
|
98
|
+
export const getDeliveryById = (options) => (options.client ?? client).get({
|
|
99
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
100
|
+
url: '/deliveries/{id}',
|
|
101
|
+
...options
|
|
102
|
+
});
|
|
103
|
+
/**
|
|
104
|
+
* List runs
|
|
105
|
+
*
|
|
106
|
+
* The key's account's runs, newest first.
|
|
107
|
+
*/
|
|
108
|
+
export const listRuns = (options) => (options?.client ?? client).get({
|
|
109
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
110
|
+
url: '/runs',
|
|
111
|
+
...options
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Create a run
|
|
115
|
+
*
|
|
116
|
+
* Starts generating `creativesPerProduct` creatives for each product. Answers 202 at once; poll `GET /runs/{runId}` and collect results from `GET /runs/{runId}/items`. Credits are held per item as it starts and charged only for creatives that are produced.
|
|
117
|
+
*/
|
|
118
|
+
export const createRun = (options) => (options.client ?? client).post({
|
|
119
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
120
|
+
url: '/runs',
|
|
121
|
+
...options,
|
|
122
|
+
headers: {
|
|
123
|
+
'Content-Type': 'application/json',
|
|
124
|
+
...options.headers
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* Price a run without creating it
|
|
129
|
+
*
|
|
130
|
+
* Validates the same body as `POST /runs` and returns the quote. Writes nothing and charges nothing; needs only `runs:read`. When the account has a daily API credit budget, `budget` reports it — even when it is already too small for this run, so the price can be checked before anyone agrees to it.
|
|
131
|
+
*/
|
|
132
|
+
export const estimateRun = (options) => (options.client ?? client).post({
|
|
133
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
134
|
+
url: '/runs/estimate',
|
|
135
|
+
...options,
|
|
136
|
+
headers: {
|
|
137
|
+
'Content-Type': 'application/json',
|
|
138
|
+
...options.headers
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
/**
|
|
142
|
+
* List styles (presets)
|
|
143
|
+
*
|
|
144
|
+
* The styles a run can use as `presetId`, with the `selections` keys each understands.
|
|
145
|
+
*/
|
|
146
|
+
export const listPresets = (options) => (options?.client ?? client).get({
|
|
147
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
148
|
+
url: '/presets',
|
|
149
|
+
...options
|
|
150
|
+
});
|
|
151
|
+
/**
|
|
152
|
+
* Get a run
|
|
153
|
+
*
|
|
154
|
+
* Status and counts. Poll this until `finalizedAt` is set.
|
|
155
|
+
*/
|
|
156
|
+
export const getRun = (options) => (options.client ?? client).get({
|
|
157
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
158
|
+
url: '/runs/{runId}',
|
|
159
|
+
...options
|
|
160
|
+
});
|
|
161
|
+
/**
|
|
162
|
+
* List a run's items
|
|
163
|
+
*
|
|
164
|
+
* One row per planned creative, in request order, with its outcome and — once produced — its asset.
|
|
165
|
+
*/
|
|
166
|
+
export const listRunItems = (options) => (options.client ?? client).get({
|
|
167
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
168
|
+
url: '/runs/{runId}/items',
|
|
169
|
+
...options
|
|
170
|
+
});
|
|
171
|
+
/**
|
|
172
|
+
* Stop a run
|
|
173
|
+
*
|
|
174
|
+
* No new items start. Items already in progress finish, and are charged only if they produce a creative. Answers 202 with the run, which reads `STOPPING` until it settles.
|
|
175
|
+
*/
|
|
176
|
+
export const stopRun = (options) => (options.client ?? client).post({
|
|
177
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
178
|
+
url: '/runs/{run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