@delopay/sdk 0.184.0 → 0.186.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-RH4CX4MU.js";
219
+ } from "./chunk-FRMLBRHG.js";
220
220
  export {
221
221
  AIRWALLEX_AUTOFILL_TREATMENTS,
222
222
  AIRWALLEX_CARD_LAYOUTS,
package/dist/internal.cjs CHANGED
@@ -4265,6 +4265,20 @@ var Users = class {
4265
4265
  async deleteUserRole(params) {
4266
4266
  return this.request("DELETE", "/user/employees/delete", { body: params });
4267
4267
  }
4268
+ /**
4269
+ * Move a team member between a merchant-level role and shop-level roles.
4270
+ * `POST /user/employees/change-scope`
4271
+ *
4272
+ * A merchant-level `role_id` takes no `profile_ids`; a shop-level one needs
4273
+ * at least one. Every earlier merchant- and shop-level binding of the member
4274
+ * in your merchant is replaced. When the change takes a scope away, the
4275
+ * member's sessions end (`sessions_revoked: true`). Needs a caller at
4276
+ * merchant level or above. A refusal is a `UR_23` error whose `data.reason`
4277
+ * names the rule; an unknown `role_id` is `UR_22`.
4278
+ */
4279
+ async changeMemberScope(params) {
4280
+ return this.request("POST", "/user/employees/change-scope", { body: params });
4281
+ }
4268
4282
  /** Sign in via OIDC. `POST /user/oidc` */
4269
4283
  async signInOidc(params) {
4270
4284
  return this.request("POST", "/user/oidc", { body: params });
@@ -4814,6 +4828,24 @@ var Export = class {
4814
4828
  options
4815
4829
  );
4816
4830
  }
4831
+ async transactionLines(params, options) {
4832
+ return runExport(
4833
+ this.request,
4834
+ "POST",
4835
+ "/export/transactions/lines",
4836
+ { body: params ?? {} },
4837
+ options
4838
+ );
4839
+ }
4840
+ async transactionLinesForProfile(params, options) {
4841
+ return runExport(
4842
+ this.request,
4843
+ "POST",
4844
+ "/export/profile/transactions/lines",
4845
+ { body: params ?? {} },
4846
+ options
4847
+ );
4848
+ }
4817
4849
  async refunds(params, options) {
4818
4850
  return runExport(this.request, "POST", "/refunds/list/export", { body: params ?? {} }, options);
4819
4851
  }
@@ -5213,6 +5245,19 @@ var Products = class {
5213
5245
  ...this.scoped(profileId, options)
5214
5246
  });
5215
5247
  }
5248
+ /**
5249
+ * Find the product a name or a connector's id belongs to. Pass exactly one
5250
+ * of `alias`, `connector_product_id` and `connector_price_id`; the connector
5251
+ * ids need `connector` as well. Archived products resolve too, so a payment
5252
+ * that references one is still attributed. No match answers 404.
5253
+ * `GET /products/resolve`
5254
+ */
5255
+ async resolve(query, profileId, options) {
5256
+ return this.request("GET", "/products/resolve", {
5257
+ query: { ...query },
5258
+ ...this.scoped(profileId, options)
5259
+ });
5260
+ }
5216
5261
  /**
5217
5262
  * Retrieve one product with its prices.
5218
5263
  * `GET /products/{product_id}`
@@ -5223,7 +5268,22 @@ var Products = class {
5223
5268
  });
5224
5269
  }
5225
5270
  /**
5226
- * Change a product's name, description or metadata.
5271
+ * What a product sold in a window, per currency, net of the refunds credited
5272
+ * to its lines. Refunds that named no product line are not included.
5273
+ * `GET /products/{product_id}/sales`
5274
+ *
5275
+ * Needs payment read; refused (403) to a caller limited to some connector
5276
+ * accounts.
5277
+ */
5278
+ async sales(productId, query, profileId, options) {
5279
+ return this.request("GET", `/products/${encodeURIComponent(productId)}/sales`, {
5280
+ ...this.scoped(profileId, options),
5281
+ query: { ...query }
5282
+ });
5283
+ }
5284
+ /**
5285
+ * Change a product's name, description, image, metadata or category
5286
+ * (`category_id: null` makes it uncategorized).
5227
5287
  * `POST /products/{product_id}`
5228
5288
  *
5229
5289
  * Its kind and its prices are not editable here — see the class note.
@@ -5347,6 +5407,148 @@ var Products = class {
5347
5407
  ...this.scoped(profileId, options)
5348
5408
  });
5349
5409
  }
5410
+ // --- identity: names and connector references ---------------------
5411
+ /**
5412
+ * Add a name the product goes by. A name it already goes by is returned
5413
+ * as it is; one another product of the shop goes by is refused.
5414
+ * `POST /products/{product_id}/aliases`
5415
+ */
5416
+ async addAlias(productId, body, profileId, options) {
5417
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/aliases`, {
5418
+ body,
5419
+ ...this.scoped(profileId, options)
5420
+ });
5421
+ }
5422
+ /**
5423
+ * Remove a name the product goes by. Its current name stays.
5424
+ * `POST /products/{product_id}/aliases/{alias_id}/remove`
5425
+ */
5426
+ async removeAlias(productId, aliasId, profileId, options) {
5427
+ return this.request(
5428
+ "POST",
5429
+ `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,
5430
+ { ...this.scoped(profileId, options) }
5431
+ );
5432
+ }
5433
+ /**
5434
+ * Tie a connected account's product, or one of its prices, to the product.
5435
+ * Recorded as `manual_id`: the ids are not checked against the account.
5436
+ * `POST /products/{product_id}/connector-references`
5437
+ */
5438
+ async addConnectorReference(productId, body, profileId, options) {
5439
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/connector-references`, {
5440
+ body,
5441
+ ...this.scoped(profileId, options)
5442
+ });
5443
+ }
5444
+ /**
5445
+ * Remove a connected account's product or price from the product.
5446
+ * `POST /products/{product_id}/connector-references/{reference_id}/remove`
5447
+ */
5448
+ async removeConnectorReference(productId, referenceId, profileId, options) {
5449
+ return this.request(
5450
+ "POST",
5451
+ `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,
5452
+ { ...this.scoped(profileId, options) }
5453
+ );
5454
+ }
5455
+ /**
5456
+ * One bounded page of a connected billing account's products, to pick an
5457
+ * existing one to tie to a product. Reads only.
5458
+ * `GET /products/import-suggestions`
5459
+ */
5460
+ async importSuggestions(query, profileId, options) {
5461
+ return this.request("GET", "/products/import-suggestions", {
5462
+ query: { ...query },
5463
+ ...this.scoped(profileId, options)
5464
+ });
5465
+ }
5466
+ /**
5467
+ * Tie one of a connected account's existing products (or a price of it) to
5468
+ * the product, verified against a fresh read of the page it was suggested
5469
+ * on — pass the same `limit` and `offset`. Recorded as `map_existing`.
5470
+ * `POST /products/{product_id}/connector-references/import`
5471
+ */
5472
+ async acceptImport(productId, body, profileId, options) {
5473
+ return this.request(
5474
+ "POST",
5475
+ `/products/${encodeURIComponent(productId)}/connector-references/import`,
5476
+ { body, ...this.scoped(profileId, options) }
5477
+ );
5478
+ }
5479
+ // --- categories ------------------------------------------------------
5480
+ /**
5481
+ * Add a category to the shop, at the end of its order. File products under
5482
+ * it with `category_id` on `create` or `update`.
5483
+ * `POST /products/categories`
5484
+ */
5485
+ async createCategory(body, profileId, options) {
5486
+ return this.request("POST", "/products/categories", {
5487
+ body,
5488
+ ...this.scoped(profileId, options)
5489
+ });
5490
+ }
5491
+ /**
5492
+ * The shop's categories in order. Archived ones only with
5493
+ * `include_archived`; deleted ones never.
5494
+ * `GET /products/categories/list`
5495
+ */
5496
+ async listCategories(query, profileId, options) {
5497
+ return this.request("GET", "/products/categories/list", {
5498
+ query: query === void 0 ? void 0 : { ...query },
5499
+ ...this.scoped(profileId, options)
5500
+ });
5501
+ }
5502
+ /**
5503
+ * Put the shop's categories in a new order. Name every live category,
5504
+ * archived ones included, exactly once. Returns the categories in their new
5505
+ * order.
5506
+ * `POST /products/categories/reorder`
5507
+ */
5508
+ async reorderCategories(body, profileId, options) {
5509
+ return this.request("POST", "/products/categories/reorder", {
5510
+ body,
5511
+ ...this.scoped(profileId, options)
5512
+ });
5513
+ }
5514
+ /**
5515
+ * Rename a category.
5516
+ * `POST /products/categories/{category_id}`
5517
+ */
5518
+ async updateCategory(categoryId, changes, profileId, options) {
5519
+ return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}`, {
5520
+ body: changes,
5521
+ ...this.scoped(profileId, options)
5522
+ });
5523
+ }
5524
+ /**
5525
+ * Mark a category deleted. Its products become uncategorized and no payment
5526
+ * changes. Returns the deleted category.
5527
+ * `DELETE /products/categories/{category_id}`
5528
+ */
5529
+ async deleteCategory(categoryId, profileId, options) {
5530
+ return this.request("DELETE", `/products/categories/${encodeURIComponent(categoryId)}`, {
5531
+ ...this.scoped(profileId, options)
5532
+ });
5533
+ }
5534
+ /**
5535
+ * Keep a category with its products, but file no new product under it.
5536
+ * `POST /products/categories/{category_id}/archive`
5537
+ */
5538
+ async archiveCategory(categoryId, profileId, options) {
5539
+ return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/archive`, {
5540
+ ...this.scoped(profileId, options)
5541
+ });
5542
+ }
5543
+ /**
5544
+ * Let an archived category take products again.
5545
+ * `POST /products/categories/{category_id}/restore`
5546
+ */
5547
+ async restoreCategory(categoryId, profileId, options) {
5548
+ return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/restore`, {
5549
+ ...this.scoped(profileId, options)
5550
+ });
5551
+ }
5350
5552
  // --- provider import ---------------------------------------------
5351
5553
  /**
5352
5554
  * Read a connected billing account's products and say how each relates to
@@ -5382,6 +5584,44 @@ var Products = class {
5382
5584
  ...this.scoped(profileId, options)
5383
5585
  });
5384
5586
  }
5587
+ // --- provider sync -----------------------------------------------
5588
+ /**
5589
+ * Compare the product with its copy at every connected account it is tied
5590
+ * to. Reads the providers now; an unreadable provider answers `unknown`,
5591
+ * never `in_sync`.
5592
+ * `GET /products/{product_id}/provider-sync`
5593
+ */
5594
+ async providerSync(productId, profileId, options) {
5595
+ return this.request("GET", `/products/${encodeURIComponent(productId)}/provider-sync`, {
5596
+ ...this.scoped(profileId, options)
5597
+ });
5598
+ }
5599
+ /**
5600
+ * {@link providerSync} for 1 to 50 products at once, such as one page of the
5601
+ * product list. Unknown ids are left out of the answer.
5602
+ * `POST /products/provider-sync`
5603
+ */
5604
+ async providerSyncBatch(request, profileId, options) {
5605
+ return this.request("POST", "/products/provider-sync", {
5606
+ body: request,
5607
+ ...this.scoped(profileId, options)
5608
+ });
5609
+ }
5610
+ /**
5611
+ * Write the catalog's state onto one connected account's copy of the
5612
+ * product, for the differences a push changes and nothing else. When it
5613
+ * would change a difference not named in `confirmed`, nothing is written and
5614
+ * the answer carries `confirmation_outdated: true` with the current
5615
+ * differences in `result`; `nothing_to_push` answers without a provider
5616
+ * write when nothing pushable differs.
5617
+ * `POST /products/{product_id}/provider-sync/push`
5618
+ */
5619
+ async providerPush(productId, request, profileId, options) {
5620
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/provider-sync/push`, {
5621
+ body: request,
5622
+ ...this.scoped(profileId, options)
5623
+ });
5624
+ }
5385
5625
  };
5386
5626
 
5387
5627
  // src/resources/processorCosts.ts
@@ -10679,6 +10919,15 @@ var AdminPortal = class {
10679
10919
  options
10680
10920
  );
10681
10921
  }
10922
+ async exportTransactionLines(params, options) {
10923
+ return runExport(
10924
+ this.request,
10925
+ "GET",
10926
+ "/admin-portal/transactions/export/lines",
10927
+ { query: transactionListQuery(params) },
10928
+ options
10929
+ );
10930
+ }
10682
10931
  /**
10683
10932
  * Full detail for a single transaction of ANY merchant — the same
10684
10933
  * `PaymentResponse` the merchant `payments.retrieve` returns. Admin-scoped:
@@ -11460,6 +11709,7 @@ function transactionListQuery(params) {
11460
11709
  merchant_connector_ids,
11461
11710
  connector_settlement_statuses,
11462
11711
  routing_approaches,
11712
+ product_ids,
11463
11713
  ...query
11464
11714
  } = params;
11465
11715
  return {
@@ -11471,7 +11721,8 @@ function transactionListQuery(params) {
11471
11721
  ...currencies?.length ? { currencies: currencies.join(",") } : {},
11472
11722
  ...merchant_connector_ids?.length ? { merchant_connector_ids: merchant_connector_ids.join(",") } : {},
11473
11723
  ...connector_settlement_statuses?.length ? { connector_settlement_statuses: connector_settlement_statuses.join(",") } : {},
11474
- ...routing_approaches?.length ? { routing_approaches: routing_approaches.join(",") } : {}
11724
+ ...routing_approaches?.length ? { routing_approaches: routing_approaches.join(",") } : {},
11725
+ ...product_ids?.length ? { product_ids: product_ids.join(",") } : {}
11475
11726
  };
11476
11727
  }
11477
11728