@delopay/sdk 0.183.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/index.js CHANGED
@@ -216,7 +216,7 @@ import {
216
216
  validatePanes,
217
217
  verticalGapValue,
218
218
  visibleCustomFields
219
- } from "./chunk-HITQ3SXH.js";
219
+ } from "./chunk-LA4KAVRD.js";
220
220
  export {
221
221
  AIRWALLEX_AUTOFILL_TREATMENTS,
222
222
  AIRWALLEX_CARD_LAYOUTS,
package/dist/internal.cjs CHANGED
@@ -4239,6 +4239,14 @@ var Users = class {
4239
4239
  async listUserRoles(params) {
4240
4240
  return this.request("POST", "/user/employees", { body: params });
4241
4241
  }
4242
+ /**
4243
+ * The current role's explicit payment-data policy, or `null` when the role
4244
+ * retains its pre-control access. A dashboard hint: every API response
4245
+ * enforces the same policy on its own. `GET /user/role/payment-visibility`
4246
+ */
4247
+ async getRolePaymentVisibility() {
4248
+ return this.request("GET", "/user/role/payment-visibility");
4249
+ }
4242
4250
  /**
4243
4251
  * Change a team member's role. `POST /user/employees/update-role`
4244
4252
  *
@@ -5205,6 +5213,19 @@ var Products = class {
5205
5213
  ...this.scoped(profileId, options)
5206
5214
  });
5207
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
+ }
5208
5229
  /**
5209
5230
  * Retrieve one product with its prices.
5210
5231
  * `GET /products/{product_id}`
@@ -5215,7 +5236,8 @@ var Products = class {
5215
5236
  });
5216
5237
  }
5217
5238
  /**
5218
- * Change a product's name, description or metadata.
5239
+ * Change a product's name, description, image, metadata or category
5240
+ * (`category_id: null` makes it uncategorized).
5219
5241
  * `POST /products/{product_id}`
5220
5242
  *
5221
5243
  * Its kind and its prices are not editable here — see the class note.
@@ -5291,6 +5313,231 @@ var Products = class {
5291
5313
  { ...this.scoped(profileId, options) }
5292
5314
  );
5293
5315
  }
5316
+ // --- add-on selection groups ---------------------------------------
5317
+ /**
5318
+ * Add a group of optional extras to a one-time product, with how many of
5319
+ * them a buyer must and may choose. Each add-on is an active product of kind
5320
+ * `addon` in the same shop. Returns the whole product.
5321
+ * `POST /products/{product_id}/addon-groups`
5322
+ */
5323
+ async createAddonGroup(productId, group, profileId, options) {
5324
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/addon-groups`, {
5325
+ body: group,
5326
+ ...this.scoped(profileId, options)
5327
+ });
5328
+ }
5329
+ /**
5330
+ * Change a group's name, bounds, or the add-ons it offers; a new list
5331
+ * replaces the old one whole.
5332
+ * `POST /products/{product_id}/addon-groups/{group_id}`
5333
+ */
5334
+ async updateAddonGroup(productId, groupId, changes, profileId, options) {
5335
+ return this.request(
5336
+ "POST",
5337
+ `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,
5338
+ { body: changes, ...this.scoped(profileId, options) }
5339
+ );
5340
+ }
5341
+ /**
5342
+ * Remove a group and what it offered. The add-on products themselves stay.
5343
+ * `DELETE /products/{product_id}/addon-groups/{group_id}`
5344
+ */
5345
+ async deleteAddonGroup(productId, groupId, profileId, options) {
5346
+ return this.request(
5347
+ "DELETE",
5348
+ `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,
5349
+ { ...this.scoped(profileId, options) }
5350
+ );
5351
+ }
5352
+ // --- bundles ---------------------------------------------------------
5353
+ /**
5354
+ * Replace what a bundle contains. Its pricing mode is fixed at creation;
5355
+ * past purchases keep their own frozen lines.
5356
+ * `POST /products/{product_id}/bundle`
5357
+ */
5358
+ async replaceBundle(productId, bundle, profileId, options) {
5359
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/bundle`, {
5360
+ body: bundle,
5361
+ ...this.scoped(profileId, options)
5362
+ });
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
+ }
5506
+ // --- provider import ---------------------------------------------
5507
+ /**
5508
+ * Read a connected billing account's products and say how each relates to
5509
+ * the catalog. Reads only: nothing is written to the provider or the catalog.
5510
+ * `POST /products/import/preview`
5511
+ */
5512
+ async importPreview(request, profileId, options) {
5513
+ return this.request("POST", "/products/import/preview", {
5514
+ body: request,
5515
+ ...this.scoped(profileId, options)
5516
+ });
5517
+ }
5518
+ /**
5519
+ * Create a product for every new item and add the new prices of every
5520
+ * changed one, tied to the provider's ids. Nothing is edited or removed, and
5521
+ * nothing is written to the provider. A failed item is reported with its
5522
+ * reason and can be retried by naming it in `connector_product_ids`.
5523
+ * `POST /products/import/apply`
5524
+ */
5525
+ async importApply(request, profileId, options) {
5526
+ return this.request("POST", "/products/import/apply", {
5527
+ body: request,
5528
+ ...this.scoped(profileId, options)
5529
+ });
5530
+ }
5531
+ /**
5532
+ * The shop's past imports from one connected account, newest first.
5533
+ * `GET /products/import/runs`
5534
+ */
5535
+ async listImportRuns(merchantConnectorId, profileId, options) {
5536
+ return this.request("GET", "/products/import/runs", {
5537
+ query: { merchant_connector_id: merchantConnectorId },
5538
+ ...this.scoped(profileId, options)
5539
+ });
5540
+ }
5294
5541
  };
5295
5542
 
5296
5543
  // src/resources/processorCosts.ts
@@ -5425,6 +5672,16 @@ var CheckoutMethods = class {
5425
5672
  query: { merchant_id: merchantId }
5426
5673
  });
5427
5674
  }
5675
+ /**
5676
+ * The same document as {@link retrieve}, on the route that stays open to a
5677
+ * reader of the checkout's appearance while the role's payment-data
5678
+ * visibility is restricted. `GET /checkout-methods/{profile_id}/preview`
5679
+ */
5680
+ async preview(merchantId, profileId) {
5681
+ return this.request("GET", `/checkout-methods/${encodeURIComponent(profileId)}/preview`, {
5682
+ query: { merchant_id: merchantId }
5683
+ });
5684
+ }
5428
5685
  /**
5429
5686
  * Replace the shop's layout. The router refuses an express item that does
5430
5687
  * not draw its own button, more than two rows of two in the express strip,
@@ -11359,6 +11616,7 @@ function transactionListQuery(params) {
11359
11616
  merchant_connector_ids,
11360
11617
  connector_settlement_statuses,
11361
11618
  routing_approaches,
11619
+ product_ids,
11362
11620
  ...query
11363
11621
  } = params;
11364
11622
  return {
@@ -11370,7 +11628,8 @@ function transactionListQuery(params) {
11370
11628
  ...currencies?.length ? { currencies: currencies.join(",") } : {},
11371
11629
  ...merchant_connector_ids?.length ? { merchant_connector_ids: merchant_connector_ids.join(",") } : {},
11372
11630
  ...connector_settlement_statuses?.length ? { connector_settlement_statuses: connector_settlement_statuses.join(",") } : {},
11373
- ...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(",") } : {}
11374
11633
  };
11375
11634
  }
11376
11635