@wix/export-async-job 1.0.16 → 1.0.17

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.
@@ -1,1557 +0,0 @@
1
- type HostModule<T, H extends Host> = {
2
- __type: 'host';
3
- create(host: H): T;
4
- };
5
- type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
- type Host<Environment = unknown> = {
7
- channel: {
8
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
- disconnect: () => void;
10
- } | Promise<{
11
- disconnect: () => void;
12
- }>;
13
- };
14
- environment?: Environment;
15
- /**
16
- * Optional name of the environment, use for logging
17
- */
18
- name?: string;
19
- /**
20
- * Optional bast url to use for API requests, for example `www.wixapis.com`
21
- */
22
- apiBaseUrl?: string;
23
- /**
24
- * Possible data to be provided by every host, for cross cutting concerns
25
- * like internationalization, billing, etc.
26
- */
27
- essentials?: {
28
- /**
29
- * The language of the currently viewed session
30
- */
31
- language?: string;
32
- /**
33
- * The locale of the currently viewed session
34
- */
35
- locale?: string;
36
- /**
37
- * Any headers that should be passed through to the API requests
38
- */
39
- passThroughHeaders?: Record<string, string>;
40
- };
41
- };
42
-
43
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
- interface HttpClient {
45
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
46
- fetchWithAuth: typeof fetch;
47
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
48
- getActiveToken?: () => string | undefined;
49
- }
50
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
- type HttpResponse<T = any> = {
52
- data: T;
53
- status: number;
54
- statusText: string;
55
- headers: any;
56
- request?: any;
57
- };
58
- type RequestOptions<_TResponse = any, Data = any> = {
59
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
60
- url: string;
61
- data?: Data;
62
- params?: URLSearchParams;
63
- } & APIMetadata;
64
- type APIMetadata = {
65
- methodFqn?: string;
66
- entityFqdn?: string;
67
- packageName?: string;
68
- };
69
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
- type EventDefinition<Payload = unknown, Type extends string = string> = {
71
- __type: 'event-definition';
72
- type: Type;
73
- isDomainEvent?: boolean;
74
- transformations?: (envelope: unknown) => Payload;
75
- __payload: Payload;
76
- };
77
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
80
-
81
- type ServicePluginMethodInput = {
82
- request: any;
83
- metadata: any;
84
- };
85
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
- type ServicePluginMethodMetadata = {
87
- name: string;
88
- primaryHttpMappingPath: string;
89
- transformations: {
90
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
91
- toREST: (...args: unknown[]) => unknown;
92
- };
93
- };
94
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
95
- __type: 'service-plugin-definition';
96
- componentType: string;
97
- methods: ServicePluginMethodMetadata[];
98
- __contract: Contract;
99
- };
100
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
103
-
104
- type RequestContext = {
105
- isSSR: boolean;
106
- host: string;
107
- protocol?: string;
108
- };
109
- type ResponseTransformer = (data: any, headers?: any) => any;
110
- /**
111
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
112
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
113
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
114
- */
115
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
- type AmbassadorRequestOptions<T = any> = {
117
- _?: T;
118
- url?: string;
119
- method?: Method;
120
- params?: any;
121
- data?: any;
122
- transformResponse?: ResponseTransformer | ResponseTransformer[];
123
- };
124
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
125
- __isAmbassador: boolean;
126
- };
127
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
129
-
130
- declare global {
131
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
132
- interface SymbolConstructor {
133
- readonly observable: symbol;
134
- }
135
- }
136
-
137
- declare const emptyObjectSymbol: unique symbol;
138
-
139
- /**
140
- Represents a strictly empty plain object, the `{}` value.
141
-
142
- When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
143
-
144
- @example
145
- ```
146
- import type {EmptyObject} from 'type-fest';
147
-
148
- // The following illustrates the problem with `{}`.
149
- const foo1: {} = {}; // Pass
150
- const foo2: {} = []; // Pass
151
- const foo3: {} = 42; // Pass
152
- const foo4: {} = {a: 1}; // Pass
153
-
154
- // With `EmptyObject` only the first case is valid.
155
- const bar1: EmptyObject = {}; // Pass
156
- const bar2: EmptyObject = 42; // Fail
157
- const bar3: EmptyObject = []; // Fail
158
- const bar4: EmptyObject = {a: 1}; // Fail
159
- ```
160
-
161
- Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
162
-
163
- @category Object
164
- */
165
- type EmptyObject = {[emptyObjectSymbol]?: never};
166
-
167
- /**
168
- Returns a boolean for whether the two given types are equal.
169
-
170
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
171
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
172
-
173
- Use-cases:
174
- - If you want to make a conditional branch based on the result of a comparison of two types.
175
-
176
- @example
177
- ```
178
- import type {IsEqual} from 'type-fest';
179
-
180
- // This type returns a boolean for whether the given array includes the given item.
181
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
182
- type Includes<Value extends readonly any[], Item> =
183
- Value extends readonly [Value[0], ...infer rest]
184
- ? IsEqual<Value[0], Item> extends true
185
- ? true
186
- : Includes<rest, Item>
187
- : false;
188
- ```
189
-
190
- @category Type Guard
191
- @category Utilities
192
- */
193
- type IsEqual<A, B> =
194
- (<G>() => G extends A ? 1 : 2) extends
195
- (<G>() => G extends B ? 1 : 2)
196
- ? true
197
- : false;
198
-
199
- /**
200
- Filter out keys from an object.
201
-
202
- Returns `never` if `Exclude` is strictly equal to `Key`.
203
- Returns `never` if `Key` extends `Exclude`.
204
- Returns `Key` otherwise.
205
-
206
- @example
207
- ```
208
- type Filtered = Filter<'foo', 'foo'>;
209
- //=> never
210
- ```
211
-
212
- @example
213
- ```
214
- type Filtered = Filter<'bar', string>;
215
- //=> never
216
- ```
217
-
218
- @example
219
- ```
220
- type Filtered = Filter<'bar', 'foo'>;
221
- //=> 'bar'
222
- ```
223
-
224
- @see {Except}
225
- */
226
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
227
-
228
- type ExceptOptions = {
229
- /**
230
- Disallow assigning non-specified properties.
231
-
232
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
233
-
234
- @default false
235
- */
236
- requireExactProps?: boolean;
237
- };
238
-
239
- /**
240
- Create a type from an object type without certain keys.
241
-
242
- We recommend setting the `requireExactProps` option to `true`.
243
-
244
- This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
245
-
246
- This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
247
-
248
- @example
249
- ```
250
- import type {Except} from 'type-fest';
251
-
252
- type Foo = {
253
- a: number;
254
- b: string;
255
- };
256
-
257
- type FooWithoutA = Except<Foo, 'a'>;
258
- //=> {b: string}
259
-
260
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
261
- //=> errors: 'a' does not exist in type '{ b: string; }'
262
-
263
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
264
- //=> {a: number} & Partial<Record<"b", never>>
265
-
266
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
267
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
268
- ```
269
-
270
- @category Object
271
- */
272
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
274
- } & (Options['requireExactProps'] extends true
275
- ? Partial<Record<KeysType, never>>
276
- : {});
277
-
278
- /**
279
- Returns a boolean for whether the given type is `never`.
280
-
281
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
- @link https://stackoverflow.com/a/53984913/10292952
283
- @link https://www.zhenghao.io/posts/ts-never
284
-
285
- Useful in type utilities, such as checking if something does not occur.
286
-
287
- @example
288
- ```
289
- import type {IsNever, And} from 'type-fest';
290
-
291
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
- type AreStringsEqual<A extends string, B extends string> =
293
- And<
294
- IsNever<Exclude<A, B>> extends true ? true : false,
295
- IsNever<Exclude<B, A>> extends true ? true : false
296
- >;
297
-
298
- type EndIfEqual<I extends string, O extends string> =
299
- AreStringsEqual<I, O> extends true
300
- ? never
301
- : void;
302
-
303
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
- if (input === output) {
305
- process.exit(0);
306
- }
307
- }
308
-
309
- endIfEqual('abc', 'abc');
310
- //=> never
311
-
312
- endIfEqual('abc', '123');
313
- //=> void
314
- ```
315
-
316
- @category Type Guard
317
- @category Utilities
318
- */
319
- type IsNever<T> = [T] extends [never] ? true : false;
320
-
321
- /**
322
- An if-else-like type that resolves depending on whether the given type is `never`.
323
-
324
- @see {@link IsNever}
325
-
326
- @example
327
- ```
328
- import type {IfNever} from 'type-fest';
329
-
330
- type ShouldBeTrue = IfNever<never>;
331
- //=> true
332
-
333
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
- //=> 'bar'
335
- ```
336
-
337
- @category Type Guard
338
- @category Utilities
339
- */
340
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
- IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
- );
343
-
344
- /**
345
- Extract the keys from a type where the value type of the key extends the given `Condition`.
346
-
347
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
348
-
349
- @example
350
- ```
351
- import type {ConditionalKeys} from 'type-fest';
352
-
353
- interface Example {
354
- a: string;
355
- b: string | number;
356
- c?: string;
357
- d: {};
358
- }
359
-
360
- type StringKeysOnly = ConditionalKeys<Example, string>;
361
- //=> 'a'
362
- ```
363
-
364
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
365
-
366
- @example
367
- ```
368
- import type {ConditionalKeys} from 'type-fest';
369
-
370
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
371
- //=> 'a' | 'c'
372
- ```
373
-
374
- @category Object
375
- */
376
- type ConditionalKeys<Base, Condition> =
377
- {
378
- // Map through all the keys of the given base type.
379
- [Key in keyof Base]-?:
380
- // Pick only keys with types extending the given `Condition` type.
381
- Base[Key] extends Condition
382
- // Retain this key
383
- // If the value for the key extends never, only include it if `Condition` also extends never
384
- ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
385
- // Discard this key since the condition fails.
386
- : never;
387
- // Convert the produced object into a union type of the keys which passed the conditional test.
388
- }[keyof Base];
389
-
390
- /**
391
- Exclude keys from a shape that matches the given `Condition`.
392
-
393
- This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
394
-
395
- @example
396
- ```
397
- import type {Primitive, ConditionalExcept} from 'type-fest';
398
-
399
- class Awesome {
400
- name: string;
401
- successes: number;
402
- failures: bigint;
403
-
404
- run() {}
405
- }
406
-
407
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
408
- //=> {run: () => void}
409
- ```
410
-
411
- @example
412
- ```
413
- import type {ConditionalExcept} from 'type-fest';
414
-
415
- interface Example {
416
- a: string;
417
- b: string | number;
418
- c: () => void;
419
- d: {};
420
- }
421
-
422
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
423
- //=> {b: string | number; c: () => void; d: {}}
424
- ```
425
-
426
- @category Object
427
- */
428
- type ConditionalExcept<Base, Condition> = Except<
429
- Base,
430
- ConditionalKeys<Base, Condition>
431
- >;
432
-
433
- /**
434
- * Descriptors are objects that describe the API of a module, and the module
435
- * can either be a REST module or a host module.
436
- * This type is recursive, so it can describe nested modules.
437
- */
438
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
- [key: string]: Descriptors | PublicMetadata | any;
440
- };
441
- /**
442
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
443
- * and returns an object with the same structure, but with all descriptors replaced with their API.
444
- * Any non-descriptor properties are removed from the returned object, including descriptors that
445
- * do not match the given host (as they will not work with the given host).
446
- */
447
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
448
- done: T;
449
- recurse: T extends {
450
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
451
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
452
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
453
- -1,
454
- 0,
455
- 1,
456
- 2,
457
- 3,
458
- 4,
459
- 5
460
- ][Depth]> : never;
461
- }, EmptyObject>;
462
- }[Depth extends -1 ? 'done' : 'recurse'];
463
- type PublicMetadata = {
464
- PACKAGE_NAME?: string;
465
- };
466
-
467
- declare global {
468
- interface ContextualClient {
469
- }
470
- }
471
- /**
472
- * A type used to create concerete types from SDK descriptors in
473
- * case a contextual client is available.
474
- */
475
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
- host: Host;
477
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
478
-
479
- interface ExportAsyncJob {
480
- /** @readonly */
481
- _id?: string;
482
- data?: ExportAsyncJobData;
483
- status?: Status;
484
- /** @readonly */
485
- createDate?: Date | null;
486
- /** @readonly */
487
- updateDate?: Date | null;
488
- }
489
- interface ExportAsyncJobData {
490
- /** original request data for the export */
491
- query?: ExportQueryV2;
492
- /** translated CSV headers */
493
- fields?: FieldDescriptor[];
494
- arrayFieldDelimiter?: ArrayFieldDelimiter;
495
- /** The target method to query data from */
496
- methodMetadata?: MethodMetadata;
497
- /** Custom spec for the target method's request/response */
498
- methodSpec?: MethodSpec;
499
- userId?: string;
500
- subDir?: string | null;
501
- format?: string;
502
- uploadId?: string;
503
- saveAs?: string | null;
504
- /** the progress of fetching all data update during the process multiple times */
505
- pagingMetadata?: PagingMetadataV2;
506
- iterationsCount?: number;
507
- processedItemsCount?: number;
508
- completionStep?: string | null;
509
- /** how many times the export was reset */
510
- resetCount?: number;
511
- /** at final step update the signed_url to download the result from */
512
- signedUrl?: string;
513
- /** when failed during the process update the error details */
514
- error?: Details;
515
- testParams?: Record<string, any> | null;
516
- }
517
- interface ExportQueryV2 extends ExportQueryV2PagingMethodOneOf {
518
- /** Paging options to limit and skip the number of items. */
519
- paging?: Paging;
520
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
521
- cursorPaging?: ExportCursorPaging;
522
- /**
523
- * Filter object in the following format:
524
- * `"filter" : {
525
- * "fieldName1": "value1",
526
- * "fieldName2":{"$operator":"value2"}
527
- * }`
528
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
529
- */
530
- filter?: Record<string, any> | null;
531
- /**
532
- * Sort object in the following format:
533
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
534
- */
535
- sort?: Sorting[];
536
- /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
537
- fields?: string[];
538
- /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
539
- fieldsets?: string[];
540
- }
541
- /** @oneof */
542
- interface ExportQueryV2PagingMethodOneOf {
543
- /** Paging options to limit and skip the number of items. */
544
- paging?: Paging;
545
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
546
- cursorPaging?: ExportCursorPaging;
547
- }
548
- interface Sorting {
549
- /** Name of the field to sort by. */
550
- fieldName?: string;
551
- /** Sort order. */
552
- order?: SortOrder;
553
- }
554
- declare enum SortOrder {
555
- ASC = "ASC",
556
- DESC = "DESC"
557
- }
558
- interface Paging {
559
- /** Number of items to load. */
560
- limit?: number | null;
561
- /** Number of items to skip in the current sort order. */
562
- offset?: number | null;
563
- }
564
- interface ExportCursorPaging {
565
- limit?: number | null;
566
- cursor?: string | null;
567
- }
568
- interface FieldDescriptor {
569
- /** the path to the field out of the query response items */
570
- _id?: string;
571
- /** how to present the filed in the CSV headers (translated) */
572
- header?: string;
573
- }
574
- declare enum ArrayFieldDelimiter {
575
- SEMICOLON = "SEMICOLON",
576
- SEMICOLON_AND_SPACE = "SEMICOLON_AND_SPACE"
577
- }
578
- interface MethodMetadata {
579
- artifact?: string;
580
- service?: string;
581
- method?: string;
582
- }
583
- interface MethodSpec {
584
- requestQueryFieldNumber?: QueryFieldNumber;
585
- responseRepeatedFieldName?: string | null;
586
- responsePagingMetadataFieldName?: string | null;
587
- }
588
- declare enum QueryFieldNumber {
589
- /** message QuerySomethingRequest { .wix.common.QueryV2 query = 1; } */
590
- DEFAULT = "DEFAULT",
591
- FIELD_2 = "FIELD_2",
592
- FIELD_3 = "FIELD_3",
593
- FIELD_4 = "FIELD_4",
594
- FIELD_5 = "FIELD_5",
595
- FIELD_6 = "FIELD_6",
596
- FIELD_7 = "FIELD_7",
597
- /** message QuerySomethingRequest { .wix.common.QueryV2 query = 8; } */
598
- FIELD_8 = "FIELD_8",
599
- FIELD_9 = "FIELD_9"
600
- }
601
- interface PagingMetadataV2 {
602
- /** Number of items returned in the response. */
603
- count?: number | null;
604
- /** Offset that was requested. */
605
- offset?: number | null;
606
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
607
- total?: number | null;
608
- /** Flag that indicates the server failed to calculate the `total` field. */
609
- tooManyToCount?: boolean | null;
610
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
611
- cursors?: Cursors;
612
- }
613
- interface Cursors {
614
- /** Cursor string pointing to the next page in the list of results. */
615
- next?: string | null;
616
- /** Cursor pointing to the previous page in the list of results. */
617
- prev?: string | null;
618
- }
619
- interface Details extends DetailsKindOneOf {
620
- applicationError?: ApplicationError;
621
- validationError?: ValidationError;
622
- systemError?: SystemError;
623
- /**
624
- * deprecated in API's - to enable migration from rendering arbitrary tracing to rest response
625
- * @deprecated
626
- */
627
- tracing?: Record<string, string>;
628
- }
629
- /** @oneof */
630
- interface DetailsKindOneOf {
631
- applicationError?: ApplicationError;
632
- validationError?: ValidationError;
633
- systemError?: SystemError;
634
- }
635
- interface ApplicationError {
636
- /** Error code. */
637
- code?: string;
638
- /** Description of the error. */
639
- description?: string;
640
- /** Data related to the error. */
641
- data?: Record<string, any> | null;
642
- }
643
- /**
644
- * example result:
645
- * {
646
- * "fieldViolations": [
647
- * {
648
- * "field": "fieldA",
649
- * "description": "invalid music note. supported notes: [do,re,mi,fa,sol,la,ti]",
650
- * "violatedRule": "OTHER",
651
- * "ruleName": "INVALID_NOTE",
652
- * "data": {
653
- * "value": "FI"
654
- * }
655
- * },
656
- * {
657
- * "field": "fieldB",
658
- * "description": "field value out of range. supported range: [0-20]",
659
- * "violatedRule": "MAX",
660
- * "data": {
661
- * "threshold": 20
662
- * }
663
- * },
664
- * {
665
- * "field": "fieldC",
666
- * "description": "invalid phone number. provide a valid phone number of size: [7-12], supported characters: [0-9, +, -, (, )]",
667
- * "violatedRule": "FORMAT",
668
- * "data": {
669
- * "type": "PHONE"
670
- * }
671
- * }
672
- * ]
673
- * }
674
- */
675
- interface ValidationError {
676
- fieldViolations?: FieldViolation[];
677
- }
678
- declare enum RuleType {
679
- VALIDATION = "VALIDATION",
680
- OTHER = "OTHER",
681
- MAX = "MAX",
682
- MIN = "MIN",
683
- MAX_LENGTH = "MAX_LENGTH",
684
- MIN_LENGTH = "MIN_LENGTH",
685
- MAX_SIZE = "MAX_SIZE",
686
- MIN_SIZE = "MIN_SIZE",
687
- FORMAT = "FORMAT",
688
- DECIMAL_LTE = "DECIMAL_LTE",
689
- DECIMAL_GTE = "DECIMAL_GTE",
690
- DECIMAL_LT = "DECIMAL_LT",
691
- DECIMAL_GT = "DECIMAL_GT",
692
- DECIMAL_MAX_SCALE = "DECIMAL_MAX_SCALE",
693
- INVALID_ENUM_VALUE = "INVALID_ENUM_VALUE",
694
- REQUIRED_FIELD = "REQUIRED_FIELD",
695
- FIELD_NOT_ALLOWED = "FIELD_NOT_ALLOWED",
696
- ONE_OF_ALIGNMENT = "ONE_OF_ALIGNMENT",
697
- EXACT_LENGTH = "EXACT_LENGTH",
698
- EXACT_SIZE = "EXACT_SIZE"
699
- }
700
- interface FieldViolation {
701
- field?: string;
702
- description?: string;
703
- violatedRule?: RuleType;
704
- /** applicable when violated_rule=OTHER */
705
- ruleName?: string | null;
706
- data?: Record<string, any> | null;
707
- }
708
- interface SystemError {
709
- /** Error code. */
710
- errorCode?: string | null;
711
- }
712
- declare enum Status {
713
- UNKNOWN = "UNKNOWN",
714
- /** Job is created, but hasn't started yet. */
715
- INITIALIZED = "INITIALIZED",
716
- /** Job has started and is in progress. */
717
- PROCESSING = "PROCESSING",
718
- /** Job is finished. */
719
- FINISHED = "FINISHED",
720
- /** Job has failed. */
721
- FAILED = "FAILED"
722
- }
723
- interface CreateExportAsyncJobRequest {
724
- /** WQL expression */
725
- query: ExportQueryV2;
726
- /** translated CSV headers */
727
- fields: FieldDescriptor[];
728
- arrayFieldDelimiter?: ArrayFieldDelimiter;
729
- /** The target method to query data from */
730
- methodMetadata: MethodMetadata;
731
- /** The target method to query data from */
732
- methodSpec?: MethodSpec;
733
- saveAs?: string | null;
734
- /** Test params */
735
- testParams?: Record<string, any> | null;
736
- }
737
- interface CreateExportAsyncJobResponse {
738
- /** The retrieved Exports */
739
- job?: ExportAsyncJob;
740
- }
741
- interface GetExportAsyncJobRequest {
742
- /** Id of the Export to retrieve */
743
- jobId: string;
744
- }
745
- interface GetExportAsyncJobResponse {
746
- /** The retrieved ExportAsyncJob */
747
- job?: ExportAsyncJob;
748
- }
749
- interface CancelExportAsyncJobRequest {
750
- /** Id of the Export to retrieve */
751
- jobId?: string;
752
- }
753
- interface CancelExportAsyncJobResponse {
754
- /** The retrieved ExportAsyncJob */
755
- job?: ExportAsyncJob;
756
- }
757
- interface GenerateExportAsyncJobDownloadUrlRequest {
758
- /** Id of the Export to retrieve */
759
- jobId?: string;
760
- }
761
- interface GenerateExportAsyncJobDownloadUrlResponse {
762
- /** The retrieved ExportAsyncJob */
763
- job?: ExportAsyncJob;
764
- }
765
- interface QueryRequestLoose {
766
- /** WQL expression */
767
- query?: ExportQueryV2;
768
- }
769
- interface QueryVariantsExportSpiResponse {
770
- items?: ProductOrVariant[];
771
- pagingMetadata?: PagingMetadataV2;
772
- }
773
- interface ProductOrVariant {
774
- kind?: string;
775
- product?: Product;
776
- variant?: StoreVariant;
777
- }
778
- interface Product {
779
- /**
780
- * Product ID (generated automatically by the catalog).
781
- * @readonly
782
- */
783
- _id?: string;
784
- /**
785
- * Product name.
786
- *
787
- * Min: 1 character
788
- * Max: 80 characters
789
- */
790
- name?: string | null;
791
- /** A friendly URL name (generated automatically by the catalog when a product is created), can be updated. */
792
- slug?: string;
793
- /** Whether the product is visible to site visitors. */
794
- visible?: boolean | null;
795
- /** Currently, only creating physical products ( `"productType": "physical"` ) is supported via the API. */
796
- productType?: ProductType;
797
- /** Product description. Accepts [rich text](https://dev.wix.com/api/rest/wix-stores/rich-text). */
798
- description?: string | null;
799
- /** Stock keeping unit. If [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is enabled, SKUs will be set per variant, and this field will be empty. */
800
- sku?: string | null;
801
- /** Product weight. If [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is enabled, weight will be set per variant, and this field will be empty. */
802
- weight?: number | null;
803
- /**
804
- * Product weight range. The minimum and maximum weights of all the variants.
805
- * @readonly
806
- */
807
- weightRange?: NumericPropertyRange;
808
- /**
809
- * Product inventory status (in future this will be writable via Inventory API).
810
- * @readonly
811
- */
812
- stock?: Stock;
813
- /**
814
- * Deprecated (use `priceData` instead).
815
- * @readonly
816
- * @deprecated
817
- */
818
- price?: PriceData;
819
- /** Price data. */
820
- priceData?: PriceData;
821
- /**
822
- * Price data, converted to the currency specified in request header.
823
- * @readonly
824
- */
825
- convertedPriceData?: PriceData;
826
- /**
827
- * Product price range. The minimum and maximum prices of all the variants.
828
- * @readonly
829
- */
830
- priceRange?: NumericPropertyRange;
831
- /** Cost and profit data. */
832
- costAndProfitData?: CostAndProfitData;
833
- /**
834
- * Product cost range. The minimum and maximum costs of all the variants.
835
- * @readonly
836
- */
837
- costRange?: NumericPropertyRange;
838
- /** Price per unit data. */
839
- pricePerUnitData?: PricePerUnitData;
840
- /** Additional text that the store owner can assign to the product (e.g. shipping details, refund policy, etc.). */
841
- additionalInfoSections?: AdditionalInfoSection[];
842
- /**
843
- * Deprecated (use `ribbon` instead).
844
- * @readonly
845
- * @deprecated
846
- */
847
- ribbons?: Ribbon[];
848
- /**
849
- * Media items (images, videos etc) associated with this product (writable via [Add Product Media](https://dev.wix.com/api/rest/wix-stores/catalog/products/add-product-media) endpoint).
850
- * @readonly
851
- */
852
- media?: Media;
853
- /**
854
- * Text box for the customer to add a message to their order (e.g., customization request). Currently writable only from the UI.
855
- * @readonly
856
- */
857
- customTextFields?: CustomTextField[];
858
- /** Whether variants are being managed for this product - enables unique SKU, price and weight per variant. Also affects inventory data. */
859
- manageVariants?: boolean | null;
860
- /** Options for this product. */
861
- productOptions?: ProductOption[];
862
- /**
863
- * Product page URL for this product (generated automatically by the server).
864
- * @readonly
865
- */
866
- productPageUrl?: PageUrl;
867
- /**
868
- * Product’s unique numeric ID (assigned in ascending order).
869
- * Primarily used for sorting and filtering when crawling all products.
870
- * @readonly
871
- */
872
- numericId?: string;
873
- /**
874
- * Inventory item ID - ID referencing the inventory system.
875
- * @readonly
876
- */
877
- inventoryItemId?: string;
878
- /** Discount deducted from the product's original price. */
879
- discount?: Discount;
880
- /**
881
- * A list of all collection IDs that this product is included in (writable via the Catalog > Collection APIs).
882
- * @readonly
883
- */
884
- collectionIds?: string[];
885
- /**
886
- * Product variants, will be provided if the the request was sent with the `includeVariants: true`.
887
- *
888
- * Max: 1,000 variants
889
- * @readonly
890
- */
891
- variants?: Variant[];
892
- /**
893
- * Date and time the product was last updated.
894
- * @readonly
895
- */
896
- lastUpdated?: Date | null;
897
- /**
898
- * Date and time the product was created.
899
- * @readonly
900
- */
901
- _createdDate?: Date | null;
902
- /** Custom SEO data for the product. */
903
- seoData?: SeoSchema;
904
- /** Product ribbon. Used to highlight relevant information about a product. For example, "Sale", "New Arrival", "Sold Out". */
905
- ribbon?: string | null;
906
- /** Product brand. Including a brand name can help improve site and product [visibility on search engines](https://support.wix.com/en/article/adding-brand-names-to-boost-product-page-seo-in-wix-stores). */
907
- brand?: string | null;
908
- }
909
- declare enum ProductType {
910
- unspecified_product_type = "unspecified_product_type",
911
- physical = "physical",
912
- digital = "digital"
913
- }
914
- interface NumericPropertyRange {
915
- /** Minimum value. */
916
- minValue?: number;
917
- /** Maximum value. */
918
- maxValue?: number;
919
- }
920
- interface Stock {
921
- /** Whether inventory is being tracked */
922
- trackInventory?: boolean;
923
- /** Quantity currently left in inventory */
924
- quantity?: number | null;
925
- /**
926
- * Whether the product is currently in stock (relevant only when tracking manually)
927
- * Deprecated (use `inventoryStatus` instead)
928
- * @deprecated
929
- */
930
- inStock?: boolean;
931
- /**
932
- * The current status of the inventory
933
- * + `IN_STOCK` - In stock
934
- * + `OUT_OF_STOCK` - Not in stock
935
- * + `PARTIALLY_OUT_OF_STOCK` - Some of the variants are not in stock
936
- */
937
- inventoryStatus?: InventoryStatus;
938
- }
939
- declare enum InventoryStatus {
940
- /** In stock */
941
- IN_STOCK = "IN_STOCK",
942
- /** Not in stock */
943
- OUT_OF_STOCK = "OUT_OF_STOCK",
944
- /** Some of the variants are not in stock */
945
- PARTIALLY_OUT_OF_STOCK = "PARTIALLY_OUT_OF_STOCK"
946
- }
947
- interface PriceData {
948
- /**
949
- * Product price currency
950
- * @readonly
951
- */
952
- currency?: string;
953
- /** Product price */
954
- price?: number | null;
955
- /**
956
- * Discounted product price (if no discounted price is set, the product price is returned)
957
- * @readonly
958
- */
959
- discountedPrice?: number;
960
- /**
961
- * The product price and discounted price, formatted with the currency
962
- * @readonly
963
- */
964
- formatted?: FormattedPrice;
965
- /**
966
- * Price per unit
967
- * @readonly
968
- */
969
- pricePerUnit?: number | null;
970
- }
971
- interface FormattedPrice {
972
- /** Product price formatted with the currency */
973
- price?: string;
974
- /** Discounted product price formatted with the currency (if no discounted price is set, the product formatted price is returned) */
975
- discountedPrice?: string;
976
- /**
977
- * Price per unit
978
- * @readonly
979
- */
980
- pricePerUnit?: string | null;
981
- }
982
- interface CostAndProfitData {
983
- /** Item cost. */
984
- itemCost?: number | null;
985
- /**
986
- * Item cost formatted with currency symbol.
987
- * @readonly
988
- */
989
- formattedItemCost?: string;
990
- /**
991
- * Profit. Calculated by reducing `cost` from `discounted_price`.
992
- * @readonly
993
- */
994
- profit?: number;
995
- /**
996
- * Profit formatted with currency symbol.
997
- * @readonly
998
- */
999
- formattedProfit?: string;
1000
- /**
1001
- * Profit Margin. Calculated by dividing `profit` by `discounted_price`.
1002
- * The result is rounded to 4 decimal places.
1003
- * @readonly
1004
- */
1005
- profitMargin?: number;
1006
- }
1007
- interface PricePerUnitData {
1008
- /** Total quantity */
1009
- totalQuantity?: number;
1010
- /** Total measurement unit */
1011
- totalMeasurementUnit?: MeasurementUnit;
1012
- /** Base quantity */
1013
- baseQuantity?: number;
1014
- /** Base measurement unit */
1015
- baseMeasurementUnit?: MeasurementUnit;
1016
- }
1017
- declare enum MeasurementUnit {
1018
- UNSPECIFIED = "UNSPECIFIED",
1019
- ML = "ML",
1020
- CL = "CL",
1021
- L = "L",
1022
- CBM = "CBM",
1023
- MG = "MG",
1024
- G = "G",
1025
- KG = "KG",
1026
- MM = "MM",
1027
- CM = "CM",
1028
- M = "M",
1029
- SQM = "SQM",
1030
- OZ = "OZ",
1031
- LB = "LB",
1032
- FLOZ = "FLOZ",
1033
- PT = "PT",
1034
- QT = "QT",
1035
- GAL = "GAL",
1036
- IN = "IN",
1037
- FT = "FT",
1038
- YD = "YD",
1039
- SQFT = "SQFT"
1040
- }
1041
- interface AdditionalInfoSection {
1042
- /** Product info section title */
1043
- title?: string;
1044
- /** Product info section description */
1045
- description?: string;
1046
- }
1047
- interface Ribbon {
1048
- /** Ribbon text */
1049
- text?: string;
1050
- }
1051
- interface Media {
1052
- /** Primary media (image, video etc) associated with this product. */
1053
- mainMedia?: MediaItem;
1054
- /** Media (images, videos etc) associated with this product. */
1055
- items?: MediaItem[];
1056
- }
1057
- interface MediaItem extends MediaItemItemOneOf {
1058
- /** Image data (URL, size). */
1059
- image?: MediaItemUrlAndSize;
1060
- /** Video data (URL, size). */
1061
- video?: MediaItemVideo;
1062
- /** Media item thumbnail details. */
1063
- thumbnail?: MediaItemUrlAndSize;
1064
- /** Media item type (image, video, etc.). */
1065
- mediaType?: MediaItemType;
1066
- /** Media item title. */
1067
- title?: string;
1068
- /** Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`). */
1069
- _id?: string;
1070
- }
1071
- /** @oneof */
1072
- interface MediaItemItemOneOf {
1073
- /** Image data (URL, size). */
1074
- image?: MediaItemUrlAndSize;
1075
- /** Video data (URL, size). */
1076
- video?: MediaItemVideo;
1077
- }
1078
- interface MediaItemUrlAndSize {
1079
- /** Media item URL. */
1080
- url?: string;
1081
- /** Media item width. */
1082
- width?: number;
1083
- /** Media item height. */
1084
- height?: number;
1085
- /** Media format (mp4, png, etc.). */
1086
- format?: string | null;
1087
- /** Alt text. This text will be shown in case the image is not available. */
1088
- altText?: string | null;
1089
- }
1090
- declare enum MediaItemType {
1091
- unspecified_media_item_type = "unspecified_media_item_type",
1092
- /** Image media type. */
1093
- image = "image",
1094
- /** Video media type. */
1095
- video = "video",
1096
- /** Audio media type. */
1097
- audio = "audio",
1098
- /** Document media type. */
1099
- document = "document",
1100
- /** Zip media type. */
1101
- zip = "zip"
1102
- }
1103
- interface MediaItemVideo {
1104
- /** Data (URL, size) about each resolution for which this video is available. */
1105
- files?: MediaItemUrlAndSize[];
1106
- /** ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`. */
1107
- stillFrameMediaId?: string;
1108
- }
1109
- interface CustomTextField {
1110
- /** Text box title */
1111
- title?: string;
1112
- /** Text box input max length */
1113
- maxLength?: number;
1114
- /** Whether this text box is mandatory */
1115
- mandatory?: boolean;
1116
- }
1117
- interface ProductOption {
1118
- /**
1119
- * Option type.
1120
- * @readonly
1121
- */
1122
- optionType?: OptionType;
1123
- /** Option name. */
1124
- name?: string;
1125
- /** Choices available for this option. */
1126
- choices?: Choice[];
1127
- }
1128
- declare enum OptionType {
1129
- /** Unspecified option type. */
1130
- unspecified_option_type = "unspecified_option_type",
1131
- /** Drop down. */
1132
- drop_down = "drop_down",
1133
- /** Color. */
1134
- color = "color"
1135
- }
1136
- interface Choice {
1137
- /** Choice value. */
1138
- value?: string;
1139
- /** Choice description. */
1140
- description?: string;
1141
- /**
1142
- * Media items (images, videos) associated with this choice
1143
- * @readonly
1144
- */
1145
- media?: Media;
1146
- /**
1147
- * Based on the customer’s choices, which (if any) variants that include the selected choices are in stock
1148
- * @readonly
1149
- */
1150
- inStock?: boolean;
1151
- /**
1152
- * Based on the customer’s choices, which (if any) variants that include the selected choices are visible
1153
- * @readonly
1154
- */
1155
- visible?: boolean;
1156
- }
1157
- interface PageUrl {
1158
- /** Base URL. For premium sites, this is the domain. For free sites, this is the site URL (e.g mysite.wixsite.com/mysite). */
1159
- base?: string;
1160
- /** Path to the product page - e.g /product-page/a-product. */
1161
- path?: string;
1162
- }
1163
- interface Discount {
1164
- /**
1165
- * Discount type:
1166
- * + `"AMOUNT"`
1167
- * + `"PERCENT"`
1168
- */
1169
- type?: DiscountType;
1170
- /** Discount value */
1171
- value?: number;
1172
- }
1173
- declare enum DiscountType {
1174
- UNDEFINED = "UNDEFINED",
1175
- /** No discount */
1176
- NONE = "NONE",
1177
- /** Discount by a fixed amount */
1178
- AMOUNT = "AMOUNT",
1179
- /** Discount by a percentage */
1180
- PERCENT = "PERCENT"
1181
- }
1182
- interface Variant {
1183
- /** Requested Variant ID */
1184
- _id?: string;
1185
- /** Specific choices within a selection, as option-choice key-value pairs */
1186
- choices?: Record<string, string>;
1187
- variant?: VariantDataWithNoStock;
1188
- /**
1189
- * Variant inventory status.
1190
- * @readonly
1191
- */
1192
- stock?: VariantStock;
1193
- }
1194
- interface VariantDataWithNoStock {
1195
- /** Variant price. */
1196
- priceData?: PriceData;
1197
- /**
1198
- * Variant price data, converted to currency requested in header.
1199
- * @readonly
1200
- */
1201
- convertedPriceData?: PriceData;
1202
- /** Cost and profit data. */
1203
- costAndProfitData?: CostAndProfitData;
1204
- /** Variant weight. */
1205
- weight?: number;
1206
- /** Variant SKU (stock keeping unit). */
1207
- sku?: string;
1208
- /** Whether the variant is visible to customers. */
1209
- visible?: boolean;
1210
- }
1211
- interface VariantStock {
1212
- /** Whether inventory is being tracked. */
1213
- trackQuantity?: boolean;
1214
- /** Quantity currently left in inventory. */
1215
- quantity?: number | null;
1216
- /** Whether the product is currently in stock (relevant only when tracking manually). */
1217
- inStock?: boolean;
1218
- }
1219
- /**
1220
- * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.
1221
- * The search engines use this information for ranking purposes, or to display snippets in the search results.
1222
- * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.
1223
- */
1224
- interface SeoSchema {
1225
- /** SEO tag information. */
1226
- tags?: Tag[];
1227
- /** SEO general settings. */
1228
- settings?: Settings;
1229
- }
1230
- interface Keyword {
1231
- /** Keyword value. */
1232
- term?: string;
1233
- /** Whether the keyword is the main focus keyword. */
1234
- isMain?: boolean;
1235
- /** The source that added the keyword terms to the SEO settings. */
1236
- origin?: string | null;
1237
- }
1238
- interface Tag {
1239
- /**
1240
- * SEO tag type.
1241
- *
1242
- *
1243
- * Supported values: `title`, `meta`, `script`, `link`.
1244
- */
1245
- type?: string;
1246
- /**
1247
- * A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value.
1248
- * For example: `{"name": "description", "content": "the description itself"}`.
1249
- */
1250
- props?: Record<string, any> | null;
1251
- /** SEO tag meta data. For example, `{"height": 300, "width": 240}`. */
1252
- meta?: Record<string, any> | null;
1253
- /** SEO tag inner content. For example, `<title> inner content </title>`. */
1254
- children?: string;
1255
- /** Whether the tag is a custom tag. */
1256
- custom?: boolean;
1257
- /** Whether the tag is disabled. */
1258
- disabled?: boolean;
1259
- }
1260
- interface Settings {
1261
- /**
1262
- * Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.
1263
- *
1264
- *
1265
- * Default: `false` (Auto Redirect is enabled.)
1266
- */
1267
- preventAutoRedirect?: boolean;
1268
- /** User-selected keyword terms for a specific page. */
1269
- keywords?: Keyword[];
1270
- }
1271
- interface SecuredMedia {
1272
- /** Media ID in Wix Media Manager. */
1273
- _id?: string;
1274
- /** Original filename. */
1275
- fileName?: string;
1276
- /** File type. */
1277
- fileType?: FileType;
1278
- }
1279
- declare enum FileType {
1280
- UNSPECIFIED = "UNSPECIFIED",
1281
- SECURE_PICTURE = "SECURE_PICTURE",
1282
- SECURE_VIDEO = "SECURE_VIDEO",
1283
- SECURE_DOCUMENT = "SECURE_DOCUMENT",
1284
- SECURE_MUSIC = "SECURE_MUSIC",
1285
- SECURE_ARCHIVE = "SECURE_ARCHIVE"
1286
- }
1287
- interface StoreVariant {
1288
- /** Store variant ID. Comprised of the `productId` and the `variantId`, separated by a hyphen: {productId}.{variantId}. */
1289
- _id?: string;
1290
- /** Variant ID. */
1291
- variantId?: string;
1292
- /** Product ID. */
1293
- productId?: string;
1294
- /** Variant name. */
1295
- variantName?: string;
1296
- /** Product name. */
1297
- productName?: string;
1298
- /** Whether the variant is managed or represents a product. */
1299
- managedVariant?: boolean;
1300
- /** Variant SKU (stock keeping unit). */
1301
- sku?: string;
1302
- /** Variant inventory status. */
1303
- stock?: VariantStock;
1304
- /** The selected options of this variant. For example, `{"Color": "Blue", "Size": "Large"}`. */
1305
- choices?: Record<string, string>;
1306
- /** Collections that include this variant. */
1307
- collectionIds?: string[];
1308
- /**
1309
- * Media items (images, videos) associated with this variant.
1310
- * @readonly
1311
- */
1312
- media?: PlatformMedia;
1313
- /** Preorder information. */
1314
- preorderInfo?: PreorderInfo;
1315
- }
1316
- interface PlatformMedia extends PlatformMediaMediaOneOf {
1317
- image?: string;
1318
- video?: string;
1319
- }
1320
- /** @oneof */
1321
- interface PlatformMediaMediaOneOf {
1322
- image?: string;
1323
- video?: string;
1324
- }
1325
- interface FocalPoint {
1326
- /** X-coordinate of the focal point. */
1327
- x?: number;
1328
- /** Y-coordinate of the focal point. */
1329
- y?: number;
1330
- /** crop by height */
1331
- height?: number | null;
1332
- /** crop by width */
1333
- width?: number | null;
1334
- }
1335
- interface VideoResolution {
1336
- /** Video URL. */
1337
- url?: string;
1338
- /** Video height. */
1339
- height?: number;
1340
- /** Video width. */
1341
- width?: number;
1342
- /** Video format for example, mp4, hls. */
1343
- format?: string;
1344
- }
1345
- interface PreorderInfo {
1346
- /** Whether the item is available for preorder. */
1347
- enabled?: boolean;
1348
- /** A message the buyer will see when the item is out of stock and preorder is enabled. */
1349
- message?: string | null;
1350
- /** Number of products that can be preordered after stock reaches zero. */
1351
- limit?: number | null;
1352
- }
1353
- interface QueryProductsExportSpiResponse {
1354
- items?: ProductOrVariantV2[];
1355
- pagingMetadata?: PagingMetadataV2;
1356
- }
1357
- interface ProductOrVariantV2 {
1358
- kind?: string;
1359
- product?: Product;
1360
- variant?: Variant;
1361
- }
1362
- interface SortingNonNullableFields {
1363
- fieldName: string;
1364
- order: SortOrder;
1365
- }
1366
- interface ExportQueryV2NonNullableFields {
1367
- sort: SortingNonNullableFields[];
1368
- fields: string[];
1369
- fieldsets: string[];
1370
- }
1371
- interface FieldDescriptorNonNullableFields {
1372
- _id: string;
1373
- header: string;
1374
- }
1375
- interface MethodMetadataNonNullableFields {
1376
- artifact: string;
1377
- service: string;
1378
- method: string;
1379
- }
1380
- interface MethodSpecNonNullableFields {
1381
- requestQueryFieldNumber: QueryFieldNumber;
1382
- }
1383
- interface ApplicationErrorNonNullableFields {
1384
- code: string;
1385
- description: string;
1386
- }
1387
- interface FieldViolationNonNullableFields {
1388
- field: string;
1389
- description: string;
1390
- violatedRule: RuleType;
1391
- }
1392
- interface ValidationErrorNonNullableFields {
1393
- fieldViolations: FieldViolationNonNullableFields[];
1394
- }
1395
- interface DetailsNonNullableFields {
1396
- applicationError?: ApplicationErrorNonNullableFields;
1397
- validationError?: ValidationErrorNonNullableFields;
1398
- }
1399
- interface ExportAsyncJobDataNonNullableFields {
1400
- query?: ExportQueryV2NonNullableFields;
1401
- fields: FieldDescriptorNonNullableFields[];
1402
- arrayFieldDelimiter: ArrayFieldDelimiter;
1403
- methodMetadata?: MethodMetadataNonNullableFields;
1404
- methodSpec?: MethodSpecNonNullableFields;
1405
- userId: string;
1406
- format: string;
1407
- uploadId: string;
1408
- iterationsCount: number;
1409
- processedItemsCount: number;
1410
- resetCount: number;
1411
- signedUrl: string;
1412
- error?: DetailsNonNullableFields;
1413
- }
1414
- interface ExportAsyncJobNonNullableFields {
1415
- _id: string;
1416
- data?: ExportAsyncJobDataNonNullableFields;
1417
- status: Status;
1418
- }
1419
- interface CreateExportAsyncJobResponseNonNullableFields {
1420
- job?: ExportAsyncJobNonNullableFields;
1421
- }
1422
- interface GetExportAsyncJobResponseNonNullableFields {
1423
- job?: ExportAsyncJobNonNullableFields;
1424
- }
1425
- interface CreateExportAsyncJobOptions {
1426
- /** translated CSV headers */
1427
- fields: FieldDescriptor[];
1428
- arrayFieldDelimiter?: ArrayFieldDelimiter;
1429
- /** The target method to query data from */
1430
- methodMetadata: MethodMetadata;
1431
- /** The target method to query data from */
1432
- methodSpec?: MethodSpec;
1433
- saveAs?: string | null;
1434
- /** Test params */
1435
- testParams?: Record<string, any> | null;
1436
- }
1437
-
1438
- declare function createExportAsyncJob$1(httpClient: HttpClient): CreateExportAsyncJobSignature;
1439
- interface CreateExportAsyncJobSignature {
1440
- /**
1441
- * Creates a new Export
1442
- * @param - WQL expression
1443
- */
1444
- (query: ExportQueryV2, options?: CreateExportAsyncJobOptions | undefined): Promise<CreateExportAsyncJobResponse & CreateExportAsyncJobResponseNonNullableFields>;
1445
- }
1446
- declare function getExportAsyncJob$1(httpClient: HttpClient): GetExportAsyncJobSignature;
1447
- interface GetExportAsyncJobSignature {
1448
- /**
1449
- * Get a Export by id
1450
- * @param - Id of the Export to retrieve
1451
- * @returns The retrieved ExportAsyncJob
1452
- */
1453
- (jobId: string): Promise<ExportAsyncJob & ExportAsyncJobNonNullableFields>;
1454
- }
1455
-
1456
- declare const createExportAsyncJob: MaybeContext<BuildRESTFunction<typeof createExportAsyncJob$1> & typeof createExportAsyncJob$1>;
1457
- declare const getExportAsyncJob: MaybeContext<BuildRESTFunction<typeof getExportAsyncJob$1> & typeof getExportAsyncJob$1>;
1458
-
1459
- type context_AdditionalInfoSection = AdditionalInfoSection;
1460
- type context_ApplicationError = ApplicationError;
1461
- type context_ArrayFieldDelimiter = ArrayFieldDelimiter;
1462
- declare const context_ArrayFieldDelimiter: typeof ArrayFieldDelimiter;
1463
- type context_CancelExportAsyncJobRequest = CancelExportAsyncJobRequest;
1464
- type context_CancelExportAsyncJobResponse = CancelExportAsyncJobResponse;
1465
- type context_Choice = Choice;
1466
- type context_CostAndProfitData = CostAndProfitData;
1467
- type context_CreateExportAsyncJobOptions = CreateExportAsyncJobOptions;
1468
- type context_CreateExportAsyncJobRequest = CreateExportAsyncJobRequest;
1469
- type context_CreateExportAsyncJobResponse = CreateExportAsyncJobResponse;
1470
- type context_CreateExportAsyncJobResponseNonNullableFields = CreateExportAsyncJobResponseNonNullableFields;
1471
- type context_Cursors = Cursors;
1472
- type context_CustomTextField = CustomTextField;
1473
- type context_Details = Details;
1474
- type context_DetailsKindOneOf = DetailsKindOneOf;
1475
- type context_Discount = Discount;
1476
- type context_DiscountType = DiscountType;
1477
- declare const context_DiscountType: typeof DiscountType;
1478
- type context_ExportAsyncJob = ExportAsyncJob;
1479
- type context_ExportAsyncJobData = ExportAsyncJobData;
1480
- type context_ExportAsyncJobNonNullableFields = ExportAsyncJobNonNullableFields;
1481
- type context_ExportCursorPaging = ExportCursorPaging;
1482
- type context_ExportQueryV2 = ExportQueryV2;
1483
- type context_ExportQueryV2PagingMethodOneOf = ExportQueryV2PagingMethodOneOf;
1484
- type context_FieldDescriptor = FieldDescriptor;
1485
- type context_FieldViolation = FieldViolation;
1486
- type context_FileType = FileType;
1487
- declare const context_FileType: typeof FileType;
1488
- type context_FocalPoint = FocalPoint;
1489
- type context_FormattedPrice = FormattedPrice;
1490
- type context_GenerateExportAsyncJobDownloadUrlRequest = GenerateExportAsyncJobDownloadUrlRequest;
1491
- type context_GenerateExportAsyncJobDownloadUrlResponse = GenerateExportAsyncJobDownloadUrlResponse;
1492
- type context_GetExportAsyncJobRequest = GetExportAsyncJobRequest;
1493
- type context_GetExportAsyncJobResponse = GetExportAsyncJobResponse;
1494
- type context_GetExportAsyncJobResponseNonNullableFields = GetExportAsyncJobResponseNonNullableFields;
1495
- type context_InventoryStatus = InventoryStatus;
1496
- declare const context_InventoryStatus: typeof InventoryStatus;
1497
- type context_Keyword = Keyword;
1498
- type context_MeasurementUnit = MeasurementUnit;
1499
- declare const context_MeasurementUnit: typeof MeasurementUnit;
1500
- type context_Media = Media;
1501
- type context_MediaItem = MediaItem;
1502
- type context_MediaItemItemOneOf = MediaItemItemOneOf;
1503
- type context_MediaItemType = MediaItemType;
1504
- declare const context_MediaItemType: typeof MediaItemType;
1505
- type context_MediaItemUrlAndSize = MediaItemUrlAndSize;
1506
- type context_MediaItemVideo = MediaItemVideo;
1507
- type context_MethodMetadata = MethodMetadata;
1508
- type context_MethodSpec = MethodSpec;
1509
- type context_NumericPropertyRange = NumericPropertyRange;
1510
- type context_OptionType = OptionType;
1511
- declare const context_OptionType: typeof OptionType;
1512
- type context_PageUrl = PageUrl;
1513
- type context_Paging = Paging;
1514
- type context_PagingMetadataV2 = PagingMetadataV2;
1515
- type context_PlatformMedia = PlatformMedia;
1516
- type context_PlatformMediaMediaOneOf = PlatformMediaMediaOneOf;
1517
- type context_PreorderInfo = PreorderInfo;
1518
- type context_PriceData = PriceData;
1519
- type context_PricePerUnitData = PricePerUnitData;
1520
- type context_Product = Product;
1521
- type context_ProductOption = ProductOption;
1522
- type context_ProductOrVariant = ProductOrVariant;
1523
- type context_ProductOrVariantV2 = ProductOrVariantV2;
1524
- type context_ProductType = ProductType;
1525
- declare const context_ProductType: typeof ProductType;
1526
- type context_QueryFieldNumber = QueryFieldNumber;
1527
- declare const context_QueryFieldNumber: typeof QueryFieldNumber;
1528
- type context_QueryProductsExportSpiResponse = QueryProductsExportSpiResponse;
1529
- type context_QueryRequestLoose = QueryRequestLoose;
1530
- type context_QueryVariantsExportSpiResponse = QueryVariantsExportSpiResponse;
1531
- type context_Ribbon = Ribbon;
1532
- type context_RuleType = RuleType;
1533
- declare const context_RuleType: typeof RuleType;
1534
- type context_SecuredMedia = SecuredMedia;
1535
- type context_SeoSchema = SeoSchema;
1536
- type context_Settings = Settings;
1537
- type context_SortOrder = SortOrder;
1538
- declare const context_SortOrder: typeof SortOrder;
1539
- type context_Sorting = Sorting;
1540
- type context_Status = Status;
1541
- declare const context_Status: typeof Status;
1542
- type context_Stock = Stock;
1543
- type context_StoreVariant = StoreVariant;
1544
- type context_SystemError = SystemError;
1545
- type context_Tag = Tag;
1546
- type context_ValidationError = ValidationError;
1547
- type context_Variant = Variant;
1548
- type context_VariantDataWithNoStock = VariantDataWithNoStock;
1549
- type context_VariantStock = VariantStock;
1550
- type context_VideoResolution = VideoResolution;
1551
- declare const context_createExportAsyncJob: typeof createExportAsyncJob;
1552
- declare const context_getExportAsyncJob: typeof getExportAsyncJob;
1553
- declare namespace context {
1554
- export { type context_AdditionalInfoSection as AdditionalInfoSection, type context_ApplicationError as ApplicationError, context_ArrayFieldDelimiter as ArrayFieldDelimiter, type context_CancelExportAsyncJobRequest as CancelExportAsyncJobRequest, type context_CancelExportAsyncJobResponse as CancelExportAsyncJobResponse, type context_Choice as Choice, type context_CostAndProfitData as CostAndProfitData, type context_CreateExportAsyncJobOptions as CreateExportAsyncJobOptions, type context_CreateExportAsyncJobRequest as CreateExportAsyncJobRequest, type context_CreateExportAsyncJobResponse as CreateExportAsyncJobResponse, type context_CreateExportAsyncJobResponseNonNullableFields as CreateExportAsyncJobResponseNonNullableFields, type context_Cursors as Cursors, type context_CustomTextField as CustomTextField, type context_Details as Details, type context_DetailsKindOneOf as DetailsKindOneOf, type context_Discount as Discount, context_DiscountType as DiscountType, type context_ExportAsyncJob as ExportAsyncJob, type context_ExportAsyncJobData as ExportAsyncJobData, type context_ExportAsyncJobNonNullableFields as ExportAsyncJobNonNullableFields, type context_ExportCursorPaging as ExportCursorPaging, type context_ExportQueryV2 as ExportQueryV2, type context_ExportQueryV2PagingMethodOneOf as ExportQueryV2PagingMethodOneOf, type context_FieldDescriptor as FieldDescriptor, type context_FieldViolation as FieldViolation, context_FileType as FileType, type context_FocalPoint as FocalPoint, type context_FormattedPrice as FormattedPrice, type context_GenerateExportAsyncJobDownloadUrlRequest as GenerateExportAsyncJobDownloadUrlRequest, type context_GenerateExportAsyncJobDownloadUrlResponse as GenerateExportAsyncJobDownloadUrlResponse, type context_GetExportAsyncJobRequest as GetExportAsyncJobRequest, type context_GetExportAsyncJobResponse as GetExportAsyncJobResponse, type context_GetExportAsyncJobResponseNonNullableFields as GetExportAsyncJobResponseNonNullableFields, context_InventoryStatus as InventoryStatus, type context_Keyword as Keyword, context_MeasurementUnit as MeasurementUnit, type context_Media as Media, type context_MediaItem as MediaItem, type context_MediaItemItemOneOf as MediaItemItemOneOf, context_MediaItemType as MediaItemType, type context_MediaItemUrlAndSize as MediaItemUrlAndSize, type context_MediaItemVideo as MediaItemVideo, type context_MethodMetadata as MethodMetadata, type context_MethodSpec as MethodSpec, type context_NumericPropertyRange as NumericPropertyRange, context_OptionType as OptionType, type context_PageUrl as PageUrl, type context_Paging as Paging, type context_PagingMetadataV2 as PagingMetadataV2, type context_PlatformMedia as PlatformMedia, type context_PlatformMediaMediaOneOf as PlatformMediaMediaOneOf, type context_PreorderInfo as PreorderInfo, type context_PriceData as PriceData, type context_PricePerUnitData as PricePerUnitData, type context_Product as Product, type context_ProductOption as ProductOption, type context_ProductOrVariant as ProductOrVariant, type context_ProductOrVariantV2 as ProductOrVariantV2, context_ProductType as ProductType, context_QueryFieldNumber as QueryFieldNumber, type context_QueryProductsExportSpiResponse as QueryProductsExportSpiResponse, type context_QueryRequestLoose as QueryRequestLoose, type context_QueryVariantsExportSpiResponse as QueryVariantsExportSpiResponse, type context_Ribbon as Ribbon, context_RuleType as RuleType, type context_SecuredMedia as SecuredMedia, type context_SeoSchema as SeoSchema, type context_Settings as Settings, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_Status as Status, type context_Stock as Stock, type context_StoreVariant as StoreVariant, type context_SystemError as SystemError, type context_Tag as Tag, type context_ValidationError as ValidationError, type context_Variant as Variant, type context_VariantDataWithNoStock as VariantDataWithNoStock, type context_VariantStock as VariantStock, type context_VideoResolution as VideoResolution, context_createExportAsyncJob as createExportAsyncJob, context_getExportAsyncJob as getExportAsyncJob };
1555
- }
1556
-
1557
- export { context as exportAsyncJob };