pocketsflow 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +17 -0
- package/dist/index.mjs +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,6 +83,11 @@ const updated = await pocketsflow.products.update('product_id', {
|
|
|
83
83
|
|
|
84
84
|
// Delete a product
|
|
85
85
|
await pocketsflow.products.delete('product_id');
|
|
86
|
+
|
|
87
|
+
// Copy a catalog item (a one-time product or a subscription offer —
|
|
88
|
+
// whichever owns the id). `{ testMode: false }` copies a test-mode offer
|
|
89
|
+
// into live mode; the copy starts unpublished in live mode.
|
|
90
|
+
const copy = await pocketsflow.products.copy('product_id', { testMode: false });
|
|
86
91
|
```
|
|
87
92
|
|
|
88
93
|
### Product Variants
|
package/dist/index.d.mts
CHANGED
|
@@ -47,6 +47,20 @@ interface ProductFile {
|
|
|
47
47
|
url: string;
|
|
48
48
|
size?: number;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Optional params for `products.copy` (POST /products/copy/{id}).
|
|
52
|
+
*
|
|
53
|
+
* The endpoint duplicates one of your catalog items — a one-time product or
|
|
54
|
+
* a subscription offer, whichever owns the id. Omit `testMode` to copy
|
|
55
|
+
* within the source's own mode; send `{ testMode: false }` to copy a
|
|
56
|
+
* test-mode offer into live mode ("Copy to live"). The copy gets a
|
|
57
|
+
* deduplicated "Name (Copy)" name and starts unpublished when copied into
|
|
58
|
+
* live mode.
|
|
59
|
+
*/
|
|
60
|
+
interface CopyCatalogItemParams {
|
|
61
|
+
/** Target mode of the copy. Omit to copy within the source's own mode. */
|
|
62
|
+
testMode?: boolean;
|
|
63
|
+
}
|
|
50
64
|
interface CreateProductParams {
|
|
51
65
|
/** Product name (required) */
|
|
52
66
|
name: string;
|
|
@@ -479,6 +493,17 @@ declare class ProductsResource {
|
|
|
479
493
|
delete(id: string): Promise<{
|
|
480
494
|
message: string;
|
|
481
495
|
}>;
|
|
496
|
+
/**
|
|
497
|
+
* Copy a catalog item (POC-917): duplicates one of your one-time products
|
|
498
|
+
* OR a subscription offer — whichever owns the id.
|
|
499
|
+
*
|
|
500
|
+
* Send `{ testMode: false }` to copy a test-mode offer into live mode
|
|
501
|
+
* ("Copy to live"); omit params to copy within the source's own mode.
|
|
502
|
+
* The copy gets a deduplicated "Name (Copy)" name and starts unpublished
|
|
503
|
+
* when copied into live mode. A copied one-time product fires the
|
|
504
|
+
* `product.created` webhook against the copy's own mode.
|
|
505
|
+
*/
|
|
506
|
+
copy(id: string, params?: CopyCatalogItemParams): Promise<Product | SubscriptionOffer>;
|
|
482
507
|
}
|
|
483
508
|
declare class VariantsResource {
|
|
484
509
|
private client;
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,20 @@ interface ProductFile {
|
|
|
47
47
|
url: string;
|
|
48
48
|
size?: number;
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Optional params for `products.copy` (POST /products/copy/{id}).
|
|
52
|
+
*
|
|
53
|
+
* The endpoint duplicates one of your catalog items — a one-time product or
|
|
54
|
+
* a subscription offer, whichever owns the id. Omit `testMode` to copy
|
|
55
|
+
* within the source's own mode; send `{ testMode: false }` to copy a
|
|
56
|
+
* test-mode offer into live mode ("Copy to live"). The copy gets a
|
|
57
|
+
* deduplicated "Name (Copy)" name and starts unpublished when copied into
|
|
58
|
+
* live mode.
|
|
59
|
+
*/
|
|
60
|
+
interface CopyCatalogItemParams {
|
|
61
|
+
/** Target mode of the copy. Omit to copy within the source's own mode. */
|
|
62
|
+
testMode?: boolean;
|
|
63
|
+
}
|
|
50
64
|
interface CreateProductParams {
|
|
51
65
|
/** Product name (required) */
|
|
52
66
|
name: string;
|
|
@@ -479,6 +493,17 @@ declare class ProductsResource {
|
|
|
479
493
|
delete(id: string): Promise<{
|
|
480
494
|
message: string;
|
|
481
495
|
}>;
|
|
496
|
+
/**
|
|
497
|
+
* Copy a catalog item (POC-917): duplicates one of your one-time products
|
|
498
|
+
* OR a subscription offer — whichever owns the id.
|
|
499
|
+
*
|
|
500
|
+
* Send `{ testMode: false }` to copy a test-mode offer into live mode
|
|
501
|
+
* ("Copy to live"); omit params to copy within the source's own mode.
|
|
502
|
+
* The copy gets a deduplicated "Name (Copy)" name and starts unpublished
|
|
503
|
+
* when copied into live mode. A copied one-time product fires the
|
|
504
|
+
* `product.created` webhook against the copy's own mode.
|
|
505
|
+
*/
|
|
506
|
+
copy(id: string, params?: CopyCatalogItemParams): Promise<Product | SubscriptionOffer>;
|
|
482
507
|
}
|
|
483
508
|
declare class VariantsResource {
|
|
484
509
|
private client;
|
package/dist/index.js
CHANGED
|
@@ -137,6 +137,23 @@ var ProductsResource = class {
|
|
|
137
137
|
async delete(id) {
|
|
138
138
|
return this.client.request("DELETE", `/products/${id}`);
|
|
139
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Copy a catalog item (POC-917): duplicates one of your one-time products
|
|
142
|
+
* OR a subscription offer — whichever owns the id.
|
|
143
|
+
*
|
|
144
|
+
* Send `{ testMode: false }` to copy a test-mode offer into live mode
|
|
145
|
+
* ("Copy to live"); omit params to copy within the source's own mode.
|
|
146
|
+
* The copy gets a deduplicated "Name (Copy)" name and starts unpublished
|
|
147
|
+
* when copied into live mode. A copied one-time product fires the
|
|
148
|
+
* `product.created` webhook against the copy's own mode.
|
|
149
|
+
*/
|
|
150
|
+
async copy(id, params = {}) {
|
|
151
|
+
return this.client.request(
|
|
152
|
+
"POST",
|
|
153
|
+
`/products/copy/${id}`,
|
|
154
|
+
{ body: params }
|
|
155
|
+
);
|
|
156
|
+
}
|
|
140
157
|
};
|
|
141
158
|
var VariantsResource = class {
|
|
142
159
|
constructor(client) {
|
package/dist/index.mjs
CHANGED
|
@@ -110,6 +110,23 @@ var ProductsResource = class {
|
|
|
110
110
|
async delete(id) {
|
|
111
111
|
return this.client.request("DELETE", `/products/${id}`);
|
|
112
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Copy a catalog item (POC-917): duplicates one of your one-time products
|
|
115
|
+
* OR a subscription offer — whichever owns the id.
|
|
116
|
+
*
|
|
117
|
+
* Send `{ testMode: false }` to copy a test-mode offer into live mode
|
|
118
|
+
* ("Copy to live"); omit params to copy within the source's own mode.
|
|
119
|
+
* The copy gets a deduplicated "Name (Copy)" name and starts unpublished
|
|
120
|
+
* when copied into live mode. A copied one-time product fires the
|
|
121
|
+
* `product.created` webhook against the copy's own mode.
|
|
122
|
+
*/
|
|
123
|
+
async copy(id, params = {}) {
|
|
124
|
+
return this.client.request(
|
|
125
|
+
"POST",
|
|
126
|
+
`/products/copy/${id}`,
|
|
127
|
+
{ body: params }
|
|
128
|
+
);
|
|
129
|
+
}
|
|
113
130
|
};
|
|
114
131
|
var VariantsResource = class {
|
|
115
132
|
constructor(client) {
|