@delopay/sdk 0.184.0 → 0.185.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/dist/{chunk-RH4CX4MU.js → chunk-LA4KAVRD.js} +158 -2
- package/dist/chunk-LA4KAVRD.js.map +1 -0
- package/dist/index.cjs +157 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +349 -4
- package/dist/index.d.ts +349 -4
- package/dist/index.js +1 -1
- package/dist/internal.cjs +160 -2
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +28 -2
- package/dist/internal.d.ts +28 -2
- package/dist/internal.js +4 -2
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-RH4CX4MU.js.map +0 -1
|
@@ -4958,6 +4958,19 @@ var Products = class {
|
|
|
4958
4958
|
...this.scoped(profileId, options)
|
|
4959
4959
|
});
|
|
4960
4960
|
}
|
|
4961
|
+
/**
|
|
4962
|
+
* Find the product a name or a connector's id belongs to. Pass exactly one
|
|
4963
|
+
* of `alias`, `connector_product_id` and `connector_price_id`; the connector
|
|
4964
|
+
* ids need `connector` as well. Archived products resolve too, so a payment
|
|
4965
|
+
* that references one is still attributed. No match answers 404.
|
|
4966
|
+
* `GET /products/resolve`
|
|
4967
|
+
*/
|
|
4968
|
+
async resolve(query, profileId, options) {
|
|
4969
|
+
return this.request("GET", "/products/resolve", {
|
|
4970
|
+
query: { ...query },
|
|
4971
|
+
...this.scoped(profileId, options)
|
|
4972
|
+
});
|
|
4973
|
+
}
|
|
4961
4974
|
/**
|
|
4962
4975
|
* Retrieve one product with its prices.
|
|
4963
4976
|
* `GET /products/{product_id}`
|
|
@@ -4968,7 +4981,8 @@ var Products = class {
|
|
|
4968
4981
|
});
|
|
4969
4982
|
}
|
|
4970
4983
|
/**
|
|
4971
|
-
* Change a product's name, description or
|
|
4984
|
+
* Change a product's name, description, image, metadata or category
|
|
4985
|
+
* (`category_id: null` makes it uncategorized).
|
|
4972
4986
|
* `POST /products/{product_id}`
|
|
4973
4987
|
*
|
|
4974
4988
|
* Its kind and its prices are not editable here — see the class note.
|
|
@@ -5092,6 +5106,148 @@ var Products = class {
|
|
|
5092
5106
|
...this.scoped(profileId, options)
|
|
5093
5107
|
});
|
|
5094
5108
|
}
|
|
5109
|
+
// --- identity: names and connector references ---------------------
|
|
5110
|
+
/**
|
|
5111
|
+
* Add a name the product goes by. A name it already goes by is returned
|
|
5112
|
+
* as it is; one another product of the shop goes by is refused.
|
|
5113
|
+
* `POST /products/{product_id}/aliases`
|
|
5114
|
+
*/
|
|
5115
|
+
async addAlias(productId, body, profileId, options) {
|
|
5116
|
+
return this.request("POST", `/products/${encodeURIComponent(productId)}/aliases`, {
|
|
5117
|
+
body,
|
|
5118
|
+
...this.scoped(profileId, options)
|
|
5119
|
+
});
|
|
5120
|
+
}
|
|
5121
|
+
/**
|
|
5122
|
+
* Remove a name the product goes by. Its current name stays.
|
|
5123
|
+
* `POST /products/{product_id}/aliases/{alias_id}/remove`
|
|
5124
|
+
*/
|
|
5125
|
+
async removeAlias(productId, aliasId, profileId, options) {
|
|
5126
|
+
return this.request(
|
|
5127
|
+
"POST",
|
|
5128
|
+
`/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,
|
|
5129
|
+
{ ...this.scoped(profileId, options) }
|
|
5130
|
+
);
|
|
5131
|
+
}
|
|
5132
|
+
/**
|
|
5133
|
+
* Tie a connected account's product, or one of its prices, to the product.
|
|
5134
|
+
* Recorded as `manual_id`: the ids are not checked against the account.
|
|
5135
|
+
* `POST /products/{product_id}/connector-references`
|
|
5136
|
+
*/
|
|
5137
|
+
async addConnectorReference(productId, body, profileId, options) {
|
|
5138
|
+
return this.request("POST", `/products/${encodeURIComponent(productId)}/connector-references`, {
|
|
5139
|
+
body,
|
|
5140
|
+
...this.scoped(profileId, options)
|
|
5141
|
+
});
|
|
5142
|
+
}
|
|
5143
|
+
/**
|
|
5144
|
+
* Remove a connected account's product or price from the product.
|
|
5145
|
+
* `POST /products/{product_id}/connector-references/{reference_id}/remove`
|
|
5146
|
+
*/
|
|
5147
|
+
async removeConnectorReference(productId, referenceId, profileId, options) {
|
|
5148
|
+
return this.request(
|
|
5149
|
+
"POST",
|
|
5150
|
+
`/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,
|
|
5151
|
+
{ ...this.scoped(profileId, options) }
|
|
5152
|
+
);
|
|
5153
|
+
}
|
|
5154
|
+
/**
|
|
5155
|
+
* One bounded page of a connected billing account's products, to pick an
|
|
5156
|
+
* existing one to tie to a product. Reads only.
|
|
5157
|
+
* `GET /products/import-suggestions`
|
|
5158
|
+
*/
|
|
5159
|
+
async importSuggestions(query, profileId, options) {
|
|
5160
|
+
return this.request("GET", "/products/import-suggestions", {
|
|
5161
|
+
query: { ...query },
|
|
5162
|
+
...this.scoped(profileId, options)
|
|
5163
|
+
});
|
|
5164
|
+
}
|
|
5165
|
+
/**
|
|
5166
|
+
* Tie one of a connected account's existing products (or a price of it) to
|
|
5167
|
+
* the product, verified against a fresh read of the page it was suggested
|
|
5168
|
+
* on — pass the same `limit` and `offset`. Recorded as `map_existing`.
|
|
5169
|
+
* `POST /products/{product_id}/connector-references/import`
|
|
5170
|
+
*/
|
|
5171
|
+
async acceptImport(productId, body, profileId, options) {
|
|
5172
|
+
return this.request(
|
|
5173
|
+
"POST",
|
|
5174
|
+
`/products/${encodeURIComponent(productId)}/connector-references/import`,
|
|
5175
|
+
{ body, ...this.scoped(profileId, options) }
|
|
5176
|
+
);
|
|
5177
|
+
}
|
|
5178
|
+
// --- categories ------------------------------------------------------
|
|
5179
|
+
/**
|
|
5180
|
+
* Add a category to the shop, at the end of its order. File products under
|
|
5181
|
+
* it with `category_id` on `create` or `update`.
|
|
5182
|
+
* `POST /products/categories`
|
|
5183
|
+
*/
|
|
5184
|
+
async createCategory(body, profileId, options) {
|
|
5185
|
+
return this.request("POST", "/products/categories", {
|
|
5186
|
+
body,
|
|
5187
|
+
...this.scoped(profileId, options)
|
|
5188
|
+
});
|
|
5189
|
+
}
|
|
5190
|
+
/**
|
|
5191
|
+
* The shop's categories in order. Archived ones only with
|
|
5192
|
+
* `include_archived`; deleted ones never.
|
|
5193
|
+
* `GET /products/categories/list`
|
|
5194
|
+
*/
|
|
5195
|
+
async listCategories(query, profileId, options) {
|
|
5196
|
+
return this.request("GET", "/products/categories/list", {
|
|
5197
|
+
query: query === void 0 ? void 0 : { ...query },
|
|
5198
|
+
...this.scoped(profileId, options)
|
|
5199
|
+
});
|
|
5200
|
+
}
|
|
5201
|
+
/**
|
|
5202
|
+
* Put the shop's categories in a new order. Name every live category,
|
|
5203
|
+
* archived ones included, exactly once. Returns the categories in their new
|
|
5204
|
+
* order.
|
|
5205
|
+
* `POST /products/categories/reorder`
|
|
5206
|
+
*/
|
|
5207
|
+
async reorderCategories(body, profileId, options) {
|
|
5208
|
+
return this.request("POST", "/products/categories/reorder", {
|
|
5209
|
+
body,
|
|
5210
|
+
...this.scoped(profileId, options)
|
|
5211
|
+
});
|
|
5212
|
+
}
|
|
5213
|
+
/**
|
|
5214
|
+
* Rename a category.
|
|
5215
|
+
* `POST /products/categories/{category_id}`
|
|
5216
|
+
*/
|
|
5217
|
+
async updateCategory(categoryId, changes, profileId, options) {
|
|
5218
|
+
return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}`, {
|
|
5219
|
+
body: changes,
|
|
5220
|
+
...this.scoped(profileId, options)
|
|
5221
|
+
});
|
|
5222
|
+
}
|
|
5223
|
+
/**
|
|
5224
|
+
* Mark a category deleted. Its products become uncategorized and no payment
|
|
5225
|
+
* changes. Returns the deleted category.
|
|
5226
|
+
* `DELETE /products/categories/{category_id}`
|
|
5227
|
+
*/
|
|
5228
|
+
async deleteCategory(categoryId, profileId, options) {
|
|
5229
|
+
return this.request("DELETE", `/products/categories/${encodeURIComponent(categoryId)}`, {
|
|
5230
|
+
...this.scoped(profileId, options)
|
|
5231
|
+
});
|
|
5232
|
+
}
|
|
5233
|
+
/**
|
|
5234
|
+
* Keep a category with its products, but file no new product under it.
|
|
5235
|
+
* `POST /products/categories/{category_id}/archive`
|
|
5236
|
+
*/
|
|
5237
|
+
async archiveCategory(categoryId, profileId, options) {
|
|
5238
|
+
return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/archive`, {
|
|
5239
|
+
...this.scoped(profileId, options)
|
|
5240
|
+
});
|
|
5241
|
+
}
|
|
5242
|
+
/**
|
|
5243
|
+
* Let an archived category take products again.
|
|
5244
|
+
* `POST /products/categories/{category_id}/restore`
|
|
5245
|
+
*/
|
|
5246
|
+
async restoreCategory(categoryId, profileId, options) {
|
|
5247
|
+
return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/restore`, {
|
|
5248
|
+
...this.scoped(profileId, options)
|
|
5249
|
+
});
|
|
5250
|
+
}
|
|
5095
5251
|
// --- provider import ---------------------------------------------
|
|
5096
5252
|
/**
|
|
5097
5253
|
* Read a connected billing account's products and say how each relates to
|
|
@@ -10576,4 +10732,4 @@ export {
|
|
|
10576
10732
|
decodeNativePanes,
|
|
10577
10733
|
encodeNativePanes
|
|
10578
10734
|
};
|
|
10579
|
-
//# sourceMappingURL=chunk-
|
|
10735
|
+
//# sourceMappingURL=chunk-LA4KAVRD.js.map
|