@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
package/dist/internal.cjs
CHANGED
|
@@ -5213,6 +5213,19 @@ var Products = class {
|
|
|
5213
5213
|
...this.scoped(profileId, options)
|
|
5214
5214
|
});
|
|
5215
5215
|
}
|
|
5216
|
+
/**
|
|
5217
|
+
* Find the product a name or a connector's id belongs to. Pass exactly one
|
|
5218
|
+
* of `alias`, `connector_product_id` and `connector_price_id`; the connector
|
|
5219
|
+
* ids need `connector` as well. Archived products resolve too, so a payment
|
|
5220
|
+
* that references one is still attributed. No match answers 404.
|
|
5221
|
+
* `GET /products/resolve`
|
|
5222
|
+
*/
|
|
5223
|
+
async resolve(query, profileId, options) {
|
|
5224
|
+
return this.request("GET", "/products/resolve", {
|
|
5225
|
+
query: { ...query },
|
|
5226
|
+
...this.scoped(profileId, options)
|
|
5227
|
+
});
|
|
5228
|
+
}
|
|
5216
5229
|
/**
|
|
5217
5230
|
* Retrieve one product with its prices.
|
|
5218
5231
|
* `GET /products/{product_id}`
|
|
@@ -5223,7 +5236,8 @@ var Products = class {
|
|
|
5223
5236
|
});
|
|
5224
5237
|
}
|
|
5225
5238
|
/**
|
|
5226
|
-
* Change a product's name, description or
|
|
5239
|
+
* Change a product's name, description, image, metadata or category
|
|
5240
|
+
* (`category_id: null` makes it uncategorized).
|
|
5227
5241
|
* `POST /products/{product_id}`
|
|
5228
5242
|
*
|
|
5229
5243
|
* Its kind and its prices are not editable here — see the class note.
|
|
@@ -5347,6 +5361,148 @@ var Products = class {
|
|
|
5347
5361
|
...this.scoped(profileId, options)
|
|
5348
5362
|
});
|
|
5349
5363
|
}
|
|
5364
|
+
// --- identity: names and connector references ---------------------
|
|
5365
|
+
/**
|
|
5366
|
+
* Add a name the product goes by. A name it already goes by is returned
|
|
5367
|
+
* as it is; one another product of the shop goes by is refused.
|
|
5368
|
+
* `POST /products/{product_id}/aliases`
|
|
5369
|
+
*/
|
|
5370
|
+
async addAlias(productId, body, profileId, options) {
|
|
5371
|
+
return this.request("POST", `/products/${encodeURIComponent(productId)}/aliases`, {
|
|
5372
|
+
body,
|
|
5373
|
+
...this.scoped(profileId, options)
|
|
5374
|
+
});
|
|
5375
|
+
}
|
|
5376
|
+
/**
|
|
5377
|
+
* Remove a name the product goes by. Its current name stays.
|
|
5378
|
+
* `POST /products/{product_id}/aliases/{alias_id}/remove`
|
|
5379
|
+
*/
|
|
5380
|
+
async removeAlias(productId, aliasId, profileId, options) {
|
|
5381
|
+
return this.request(
|
|
5382
|
+
"POST",
|
|
5383
|
+
`/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,
|
|
5384
|
+
{ ...this.scoped(profileId, options) }
|
|
5385
|
+
);
|
|
5386
|
+
}
|
|
5387
|
+
/**
|
|
5388
|
+
* Tie a connected account's product, or one of its prices, to the product.
|
|
5389
|
+
* Recorded as `manual_id`: the ids are not checked against the account.
|
|
5390
|
+
* `POST /products/{product_id}/connector-references`
|
|
5391
|
+
*/
|
|
5392
|
+
async addConnectorReference(productId, body, profileId, options) {
|
|
5393
|
+
return this.request("POST", `/products/${encodeURIComponent(productId)}/connector-references`, {
|
|
5394
|
+
body,
|
|
5395
|
+
...this.scoped(profileId, options)
|
|
5396
|
+
});
|
|
5397
|
+
}
|
|
5398
|
+
/**
|
|
5399
|
+
* Remove a connected account's product or price from the product.
|
|
5400
|
+
* `POST /products/{product_id}/connector-references/{reference_id}/remove`
|
|
5401
|
+
*/
|
|
5402
|
+
async removeConnectorReference(productId, referenceId, profileId, options) {
|
|
5403
|
+
return this.request(
|
|
5404
|
+
"POST",
|
|
5405
|
+
`/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,
|
|
5406
|
+
{ ...this.scoped(profileId, options) }
|
|
5407
|
+
);
|
|
5408
|
+
}
|
|
5409
|
+
/**
|
|
5410
|
+
* One bounded page of a connected billing account's products, to pick an
|
|
5411
|
+
* existing one to tie to a product. Reads only.
|
|
5412
|
+
* `GET /products/import-suggestions`
|
|
5413
|
+
*/
|
|
5414
|
+
async importSuggestions(query, profileId, options) {
|
|
5415
|
+
return this.request("GET", "/products/import-suggestions", {
|
|
5416
|
+
query: { ...query },
|
|
5417
|
+
...this.scoped(profileId, options)
|
|
5418
|
+
});
|
|
5419
|
+
}
|
|
5420
|
+
/**
|
|
5421
|
+
* Tie one of a connected account's existing products (or a price of it) to
|
|
5422
|
+
* the product, verified against a fresh read of the page it was suggested
|
|
5423
|
+
* on — pass the same `limit` and `offset`. Recorded as `map_existing`.
|
|
5424
|
+
* `POST /products/{product_id}/connector-references/import`
|
|
5425
|
+
*/
|
|
5426
|
+
async acceptImport(productId, body, profileId, options) {
|
|
5427
|
+
return this.request(
|
|
5428
|
+
"POST",
|
|
5429
|
+
`/products/${encodeURIComponent(productId)}/connector-references/import`,
|
|
5430
|
+
{ body, ...this.scoped(profileId, options) }
|
|
5431
|
+
);
|
|
5432
|
+
}
|
|
5433
|
+
// --- categories ------------------------------------------------------
|
|
5434
|
+
/**
|
|
5435
|
+
* Add a category to the shop, at the end of its order. File products under
|
|
5436
|
+
* it with `category_id` on `create` or `update`.
|
|
5437
|
+
* `POST /products/categories`
|
|
5438
|
+
*/
|
|
5439
|
+
async createCategory(body, profileId, options) {
|
|
5440
|
+
return this.request("POST", "/products/categories", {
|
|
5441
|
+
body,
|
|
5442
|
+
...this.scoped(profileId, options)
|
|
5443
|
+
});
|
|
5444
|
+
}
|
|
5445
|
+
/**
|
|
5446
|
+
* The shop's categories in order. Archived ones only with
|
|
5447
|
+
* `include_archived`; deleted ones never.
|
|
5448
|
+
* `GET /products/categories/list`
|
|
5449
|
+
*/
|
|
5450
|
+
async listCategories(query, profileId, options) {
|
|
5451
|
+
return this.request("GET", "/products/categories/list", {
|
|
5452
|
+
query: query === void 0 ? void 0 : { ...query },
|
|
5453
|
+
...this.scoped(profileId, options)
|
|
5454
|
+
});
|
|
5455
|
+
}
|
|
5456
|
+
/**
|
|
5457
|
+
* Put the shop's categories in a new order. Name every live category,
|
|
5458
|
+
* archived ones included, exactly once. Returns the categories in their new
|
|
5459
|
+
* order.
|
|
5460
|
+
* `POST /products/categories/reorder`
|
|
5461
|
+
*/
|
|
5462
|
+
async reorderCategories(body, profileId, options) {
|
|
5463
|
+
return this.request("POST", "/products/categories/reorder", {
|
|
5464
|
+
body,
|
|
5465
|
+
...this.scoped(profileId, options)
|
|
5466
|
+
});
|
|
5467
|
+
}
|
|
5468
|
+
/**
|
|
5469
|
+
* Rename a category.
|
|
5470
|
+
* `POST /products/categories/{category_id}`
|
|
5471
|
+
*/
|
|
5472
|
+
async updateCategory(categoryId, changes, profileId, options) {
|
|
5473
|
+
return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}`, {
|
|
5474
|
+
body: changes,
|
|
5475
|
+
...this.scoped(profileId, options)
|
|
5476
|
+
});
|
|
5477
|
+
}
|
|
5478
|
+
/**
|
|
5479
|
+
* Mark a category deleted. Its products become uncategorized and no payment
|
|
5480
|
+
* changes. Returns the deleted category.
|
|
5481
|
+
* `DELETE /products/categories/{category_id}`
|
|
5482
|
+
*/
|
|
5483
|
+
async deleteCategory(categoryId, profileId, options) {
|
|
5484
|
+
return this.request("DELETE", `/products/categories/${encodeURIComponent(categoryId)}`, {
|
|
5485
|
+
...this.scoped(profileId, options)
|
|
5486
|
+
});
|
|
5487
|
+
}
|
|
5488
|
+
/**
|
|
5489
|
+
* Keep a category with its products, but file no new product under it.
|
|
5490
|
+
* `POST /products/categories/{category_id}/archive`
|
|
5491
|
+
*/
|
|
5492
|
+
async archiveCategory(categoryId, profileId, options) {
|
|
5493
|
+
return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/archive`, {
|
|
5494
|
+
...this.scoped(profileId, options)
|
|
5495
|
+
});
|
|
5496
|
+
}
|
|
5497
|
+
/**
|
|
5498
|
+
* Let an archived category take products again.
|
|
5499
|
+
* `POST /products/categories/{category_id}/restore`
|
|
5500
|
+
*/
|
|
5501
|
+
async restoreCategory(categoryId, profileId, options) {
|
|
5502
|
+
return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/restore`, {
|
|
5503
|
+
...this.scoped(profileId, options)
|
|
5504
|
+
});
|
|
5505
|
+
}
|
|
5350
5506
|
// --- provider import ---------------------------------------------
|
|
5351
5507
|
/**
|
|
5352
5508
|
* Read a connected billing account's products and say how each relates to
|
|
@@ -11460,6 +11616,7 @@ function transactionListQuery(params) {
|
|
|
11460
11616
|
merchant_connector_ids,
|
|
11461
11617
|
connector_settlement_statuses,
|
|
11462
11618
|
routing_approaches,
|
|
11619
|
+
product_ids,
|
|
11463
11620
|
...query
|
|
11464
11621
|
} = params;
|
|
11465
11622
|
return {
|
|
@@ -11471,7 +11628,8 @@ function transactionListQuery(params) {
|
|
|
11471
11628
|
...currencies?.length ? { currencies: currencies.join(",") } : {},
|
|
11472
11629
|
...merchant_connector_ids?.length ? { merchant_connector_ids: merchant_connector_ids.join(",") } : {},
|
|
11473
11630
|
...connector_settlement_statuses?.length ? { connector_settlement_statuses: connector_settlement_statuses.join(",") } : {},
|
|
11474
|
-
...routing_approaches?.length ? { routing_approaches: routing_approaches.join(",") } : {}
|
|
11631
|
+
...routing_approaches?.length ? { routing_approaches: routing_approaches.join(",") } : {},
|
|
11632
|
+
...product_ids?.length ? { product_ids: product_ids.join(",") } : {}
|
|
11475
11633
|
};
|
|
11476
11634
|
}
|
|
11477
11635
|
|