perspectapi-ts-sdk 6.5.3 → 6.5.4
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/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +1 -1
- package/src/types/index.ts +2 -0
- package/src/v2/client/collections-client.ts +4 -0
- package/src/v2/types.ts +6 -0
package/dist/index.d.mts
CHANGED
|
@@ -1041,6 +1041,7 @@ interface BundleCollection {
|
|
|
1041
1041
|
description?: string;
|
|
1042
1042
|
available_from?: string;
|
|
1043
1043
|
available_until?: string;
|
|
1044
|
+
custom?: Record<string, any> | string | null;
|
|
1044
1045
|
published: number;
|
|
1045
1046
|
created_at: string;
|
|
1046
1047
|
updated_at: string;
|
|
@@ -1050,6 +1051,7 @@ interface CreateBundleCollectionRequest {
|
|
|
1050
1051
|
description?: string;
|
|
1051
1052
|
available_from?: string;
|
|
1052
1053
|
available_until?: string;
|
|
1054
|
+
custom?: Record<string, any> | null;
|
|
1053
1055
|
published?: number;
|
|
1054
1056
|
}
|
|
1055
1057
|
interface BundleCollectionItem {
|
|
@@ -1284,6 +1286,10 @@ interface V2Product extends V2Object {
|
|
|
1284
1286
|
} | null;
|
|
1285
1287
|
tax_behavior: "inclusive" | "exclusive" | "unspecified" | null;
|
|
1286
1288
|
category_id: string | null;
|
|
1289
|
+
gateway_product_id_test: string | null;
|
|
1290
|
+
gateway_product_id_live: string | null;
|
|
1291
|
+
gateway_price_id_test: string | null;
|
|
1292
|
+
gateway_price_id_live: string | null;
|
|
1287
1293
|
media: V2Media[];
|
|
1288
1294
|
created_at: string | null;
|
|
1289
1295
|
updated_at: string | null;
|
|
@@ -1345,6 +1351,7 @@ interface V2Collection extends V2Object {
|
|
|
1345
1351
|
description: string | null;
|
|
1346
1352
|
available_from: string | null;
|
|
1347
1353
|
available_until: string | null;
|
|
1354
|
+
custom: Record<string, unknown> | null;
|
|
1348
1355
|
published: boolean;
|
|
1349
1356
|
created_at: string | null;
|
|
1350
1357
|
updated_at: string | null;
|
|
@@ -1361,6 +1368,7 @@ interface V2CollectionCreateParams {
|
|
|
1361
1368
|
description?: string | null;
|
|
1362
1369
|
available_from?: string | null;
|
|
1363
1370
|
available_until?: string | null;
|
|
1371
|
+
custom?: Record<string, unknown> | null;
|
|
1364
1372
|
published?: boolean;
|
|
1365
1373
|
}
|
|
1366
1374
|
interface V2CollectionUpdateParams extends Partial<V2CollectionCreateParams> {
|
|
@@ -1890,6 +1898,7 @@ declare class CategoriesV2Client extends BaseV2Client {
|
|
|
1890
1898
|
|
|
1891
1899
|
declare class CollectionsV2Client extends BaseV2Client {
|
|
1892
1900
|
list(siteName: string, params?: V2PaginationParams): Promise<V2List<V2Collection>>;
|
|
1901
|
+
listAutoPaginated(siteName: string, params?: Omit<V2PaginationParams, 'starting_after' | 'ending_before'>): AsyncGenerator<V2Collection, void, unknown>;
|
|
1893
1902
|
getCurrent(siteName: string): Promise<V2Collection | null>;
|
|
1894
1903
|
get(siteName: string, id: string): Promise<V2Collection>;
|
|
1895
1904
|
create(siteName: string, data: V2CollectionCreateParams): Promise<V2Collection>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1041,6 +1041,7 @@ interface BundleCollection {
|
|
|
1041
1041
|
description?: string;
|
|
1042
1042
|
available_from?: string;
|
|
1043
1043
|
available_until?: string;
|
|
1044
|
+
custom?: Record<string, any> | string | null;
|
|
1044
1045
|
published: number;
|
|
1045
1046
|
created_at: string;
|
|
1046
1047
|
updated_at: string;
|
|
@@ -1050,6 +1051,7 @@ interface CreateBundleCollectionRequest {
|
|
|
1050
1051
|
description?: string;
|
|
1051
1052
|
available_from?: string;
|
|
1052
1053
|
available_until?: string;
|
|
1054
|
+
custom?: Record<string, any> | null;
|
|
1053
1055
|
published?: number;
|
|
1054
1056
|
}
|
|
1055
1057
|
interface BundleCollectionItem {
|
|
@@ -1284,6 +1286,10 @@ interface V2Product extends V2Object {
|
|
|
1284
1286
|
} | null;
|
|
1285
1287
|
tax_behavior: "inclusive" | "exclusive" | "unspecified" | null;
|
|
1286
1288
|
category_id: string | null;
|
|
1289
|
+
gateway_product_id_test: string | null;
|
|
1290
|
+
gateway_product_id_live: string | null;
|
|
1291
|
+
gateway_price_id_test: string | null;
|
|
1292
|
+
gateway_price_id_live: string | null;
|
|
1287
1293
|
media: V2Media[];
|
|
1288
1294
|
created_at: string | null;
|
|
1289
1295
|
updated_at: string | null;
|
|
@@ -1345,6 +1351,7 @@ interface V2Collection extends V2Object {
|
|
|
1345
1351
|
description: string | null;
|
|
1346
1352
|
available_from: string | null;
|
|
1347
1353
|
available_until: string | null;
|
|
1354
|
+
custom: Record<string, unknown> | null;
|
|
1348
1355
|
published: boolean;
|
|
1349
1356
|
created_at: string | null;
|
|
1350
1357
|
updated_at: string | null;
|
|
@@ -1361,6 +1368,7 @@ interface V2CollectionCreateParams {
|
|
|
1361
1368
|
description?: string | null;
|
|
1362
1369
|
available_from?: string | null;
|
|
1363
1370
|
available_until?: string | null;
|
|
1371
|
+
custom?: Record<string, unknown> | null;
|
|
1364
1372
|
published?: boolean;
|
|
1365
1373
|
}
|
|
1366
1374
|
interface V2CollectionUpdateParams extends Partial<V2CollectionCreateParams> {
|
|
@@ -1890,6 +1898,7 @@ declare class CategoriesV2Client extends BaseV2Client {
|
|
|
1890
1898
|
|
|
1891
1899
|
declare class CollectionsV2Client extends BaseV2Client {
|
|
1892
1900
|
list(siteName: string, params?: V2PaginationParams): Promise<V2List<V2Collection>>;
|
|
1901
|
+
listAutoPaginated(siteName: string, params?: Omit<V2PaginationParams, 'starting_after' | 'ending_before'>): AsyncGenerator<V2Collection, void, unknown>;
|
|
1893
1902
|
getCurrent(siteName: string): Promise<V2Collection | null>;
|
|
1894
1903
|
get(siteName: string, id: string): Promise<V2Collection>;
|
|
1895
1904
|
create(siteName: string, data: V2CollectionCreateParams): Promise<V2Collection>;
|
package/dist/index.js
CHANGED
|
@@ -907,6 +907,9 @@ var CollectionsV2Client = class extends BaseV2Client {
|
|
|
907
907
|
tags: [`collections:${siteName}`]
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
|
+
async *listAutoPaginated(siteName, params) {
|
|
911
|
+
yield* this.listAutoPaginate(this.sitePath(siteName, "collections"), params);
|
|
912
|
+
}
|
|
910
913
|
async getCurrent(siteName) {
|
|
911
914
|
const result = await this.getOne(
|
|
912
915
|
this.sitePath(siteName, "collections", "current")
|
package/dist/index.mjs
CHANGED
|
@@ -831,6 +831,9 @@ var CollectionsV2Client = class extends BaseV2Client {
|
|
|
831
831
|
tags: [`collections:${siteName}`]
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
|
+
async *listAutoPaginated(siteName, params) {
|
|
835
|
+
yield* this.listAutoPaginate(this.sitePath(siteName, "collections"), params);
|
|
836
|
+
}
|
|
834
837
|
async getCurrent(siteName) {
|
|
835
838
|
const result = await this.getOne(
|
|
836
839
|
this.sitePath(siteName, "collections", "current")
|
package/package.json
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -1093,6 +1093,7 @@ export interface BundleCollection {
|
|
|
1093
1093
|
description?: string;
|
|
1094
1094
|
available_from?: string;
|
|
1095
1095
|
available_until?: string;
|
|
1096
|
+
custom?: Record<string, any> | string | null;
|
|
1096
1097
|
published: number;
|
|
1097
1098
|
created_at: string;
|
|
1098
1099
|
updated_at: string;
|
|
@@ -1103,6 +1104,7 @@ export interface CreateBundleCollectionRequest {
|
|
|
1103
1104
|
description?: string;
|
|
1104
1105
|
available_from?: string;
|
|
1105
1106
|
available_until?: string;
|
|
1107
|
+
custom?: Record<string, any> | null;
|
|
1106
1108
|
published?: number;
|
|
1107
1109
|
}
|
|
1108
1110
|
|
|
@@ -16,6 +16,10 @@ export class CollectionsV2Client extends BaseV2Client {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
async *listAutoPaginated(siteName: string, params?: Omit<V2PaginationParams, 'starting_after' | 'ending_before'>) {
|
|
20
|
+
yield* this.listAutoPaginate<V2Collection>(this.sitePath(siteName, 'collections'), params);
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
async getCurrent(siteName: string): Promise<V2Collection | null> {
|
|
20
24
|
const result = await this.getOne<{ object: string; data: V2Collection | null }>(
|
|
21
25
|
this.sitePath(siteName, 'collections', 'current'),
|
package/src/v2/types.ts
CHANGED
|
@@ -129,6 +129,10 @@ export interface V2Product extends V2Object {
|
|
|
129
129
|
recurring: { interval: string; interval_count?: number } | null;
|
|
130
130
|
tax_behavior: "inclusive" | "exclusive" | "unspecified" | null;
|
|
131
131
|
category_id: string | null;
|
|
132
|
+
gateway_product_id_test: string | null;
|
|
133
|
+
gateway_product_id_live: string | null;
|
|
134
|
+
gateway_price_id_test: string | null;
|
|
135
|
+
gateway_price_id_live: string | null;
|
|
132
136
|
media: V2Media[];
|
|
133
137
|
created_at: string | null;
|
|
134
138
|
updated_at: string | null;
|
|
@@ -196,6 +200,7 @@ export interface V2Collection extends V2Object {
|
|
|
196
200
|
description: string | null;
|
|
197
201
|
available_from: string | null;
|
|
198
202
|
available_until: string | null;
|
|
203
|
+
custom: Record<string, unknown> | null;
|
|
199
204
|
published: boolean;
|
|
200
205
|
created_at: string | null;
|
|
201
206
|
updated_at: string | null;
|
|
@@ -214,6 +219,7 @@ export interface V2CollectionCreateParams {
|
|
|
214
219
|
description?: string | null;
|
|
215
220
|
available_from?: string | null;
|
|
216
221
|
available_until?: string | null;
|
|
222
|
+
custom?: Record<string, unknown> | null;
|
|
217
223
|
published?: boolean;
|
|
218
224
|
}
|
|
219
225
|
|