@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.
@@ -4010,6 +4010,20 @@ var Users = class {
4010
4010
  async deleteUserRole(params) {
4011
4011
  return this.request("DELETE", "/user/employees/delete", { body: params });
4012
4012
  }
4013
+ /**
4014
+ * Move a team member between a merchant-level role and shop-level roles.
4015
+ * `POST /user/employees/change-scope`
4016
+ *
4017
+ * A merchant-level `role_id` takes no `profile_ids`; a shop-level one needs
4018
+ * at least one. Every earlier merchant- and shop-level binding of the member
4019
+ * in your merchant is replaced. When the change takes a scope away, the
4020
+ * member's sessions end (`sessions_revoked: true`). Needs a caller at
4021
+ * merchant level or above. A refusal is a `UR_23` error whose `data.reason`
4022
+ * names the rule; an unknown `role_id` is `UR_22`.
4023
+ */
4024
+ async changeMemberScope(params) {
4025
+ return this.request("POST", "/user/employees/change-scope", { body: params });
4026
+ }
4013
4027
  /** Sign in via OIDC. `POST /user/oidc` */
4014
4028
  async signInOidc(params) {
4015
4029
  return this.request("POST", "/user/oidc", { body: params });
@@ -4559,6 +4573,24 @@ var Export = class {
4559
4573
  options
4560
4574
  );
4561
4575
  }
4576
+ async transactionLines(params, options) {
4577
+ return runExport(
4578
+ this.request,
4579
+ "POST",
4580
+ "/export/transactions/lines",
4581
+ { body: params ?? {} },
4582
+ options
4583
+ );
4584
+ }
4585
+ async transactionLinesForProfile(params, options) {
4586
+ return runExport(
4587
+ this.request,
4588
+ "POST",
4589
+ "/export/profile/transactions/lines",
4590
+ { body: params ?? {} },
4591
+ options
4592
+ );
4593
+ }
4562
4594
  async refunds(params, options) {
4563
4595
  return runExport(this.request, "POST", "/refunds/list/export", { body: params ?? {} }, options);
4564
4596
  }
@@ -4958,6 +4990,19 @@ var Products = class {
4958
4990
  ...this.scoped(profileId, options)
4959
4991
  });
4960
4992
  }
4993
+ /**
4994
+ * Find the product a name or a connector's id belongs to. Pass exactly one
4995
+ * of `alias`, `connector_product_id` and `connector_price_id`; the connector
4996
+ * ids need `connector` as well. Archived products resolve too, so a payment
4997
+ * that references one is still attributed. No match answers 404.
4998
+ * `GET /products/resolve`
4999
+ */
5000
+ async resolve(query, profileId, options) {
5001
+ return this.request("GET", "/products/resolve", {
5002
+ query: { ...query },
5003
+ ...this.scoped(profileId, options)
5004
+ });
5005
+ }
4961
5006
  /**
4962
5007
  * Retrieve one product with its prices.
4963
5008
  * `GET /products/{product_id}`
@@ -4968,7 +5013,22 @@ var Products = class {
4968
5013
  });
4969
5014
  }
4970
5015
  /**
4971
- * Change a product's name, description or metadata.
5016
+ * What a product sold in a window, per currency, net of the refunds credited
5017
+ * to its lines. Refunds that named no product line are not included.
5018
+ * `GET /products/{product_id}/sales`
5019
+ *
5020
+ * Needs payment read; refused (403) to a caller limited to some connector
5021
+ * accounts.
5022
+ */
5023
+ async sales(productId, query, profileId, options) {
5024
+ return this.request("GET", `/products/${encodeURIComponent(productId)}/sales`, {
5025
+ ...this.scoped(profileId, options),
5026
+ query: { ...query }
5027
+ });
5028
+ }
5029
+ /**
5030
+ * Change a product's name, description, image, metadata or category
5031
+ * (`category_id: null` makes it uncategorized).
4972
5032
  * `POST /products/{product_id}`
4973
5033
  *
4974
5034
  * Its kind and its prices are not editable here — see the class note.
@@ -5092,6 +5152,148 @@ var Products = class {
5092
5152
  ...this.scoped(profileId, options)
5093
5153
  });
5094
5154
  }
5155
+ // --- identity: names and connector references ---------------------
5156
+ /**
5157
+ * Add a name the product goes by. A name it already goes by is returned
5158
+ * as it is; one another product of the shop goes by is refused.
5159
+ * `POST /products/{product_id}/aliases`
5160
+ */
5161
+ async addAlias(productId, body, profileId, options) {
5162
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/aliases`, {
5163
+ body,
5164
+ ...this.scoped(profileId, options)
5165
+ });
5166
+ }
5167
+ /**
5168
+ * Remove a name the product goes by. Its current name stays.
5169
+ * `POST /products/{product_id}/aliases/{alias_id}/remove`
5170
+ */
5171
+ async removeAlias(productId, aliasId, profileId, options) {
5172
+ return this.request(
5173
+ "POST",
5174
+ `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,
5175
+ { ...this.scoped(profileId, options) }
5176
+ );
5177
+ }
5178
+ /**
5179
+ * Tie a connected account's product, or one of its prices, to the product.
5180
+ * Recorded as `manual_id`: the ids are not checked against the account.
5181
+ * `POST /products/{product_id}/connector-references`
5182
+ */
5183
+ async addConnectorReference(productId, body, profileId, options) {
5184
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/connector-references`, {
5185
+ body,
5186
+ ...this.scoped(profileId, options)
5187
+ });
5188
+ }
5189
+ /**
5190
+ * Remove a connected account's product or price from the product.
5191
+ * `POST /products/{product_id}/connector-references/{reference_id}/remove`
5192
+ */
5193
+ async removeConnectorReference(productId, referenceId, profileId, options) {
5194
+ return this.request(
5195
+ "POST",
5196
+ `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,
5197
+ { ...this.scoped(profileId, options) }
5198
+ );
5199
+ }
5200
+ /**
5201
+ * One bounded page of a connected billing account's products, to pick an
5202
+ * existing one to tie to a product. Reads only.
5203
+ * `GET /products/import-suggestions`
5204
+ */
5205
+ async importSuggestions(query, profileId, options) {
5206
+ return this.request("GET", "/products/import-suggestions", {
5207
+ query: { ...query },
5208
+ ...this.scoped(profileId, options)
5209
+ });
5210
+ }
5211
+ /**
5212
+ * Tie one of a connected account's existing products (or a price of it) to
5213
+ * the product, verified against a fresh read of the page it was suggested
5214
+ * on — pass the same `limit` and `offset`. Recorded as `map_existing`.
5215
+ * `POST /products/{product_id}/connector-references/import`
5216
+ */
5217
+ async acceptImport(productId, body, profileId, options) {
5218
+ return this.request(
5219
+ "POST",
5220
+ `/products/${encodeURIComponent(productId)}/connector-references/import`,
5221
+ { body, ...this.scoped(profileId, options) }
5222
+ );
5223
+ }
5224
+ // --- categories ------------------------------------------------------
5225
+ /**
5226
+ * Add a category to the shop, at the end of its order. File products under
5227
+ * it with `category_id` on `create` or `update`.
5228
+ * `POST /products/categories`
5229
+ */
5230
+ async createCategory(body, profileId, options) {
5231
+ return this.request("POST", "/products/categories", {
5232
+ body,
5233
+ ...this.scoped(profileId, options)
5234
+ });
5235
+ }
5236
+ /**
5237
+ * The shop's categories in order. Archived ones only with
5238
+ * `include_archived`; deleted ones never.
5239
+ * `GET /products/categories/list`
5240
+ */
5241
+ async listCategories(query, profileId, options) {
5242
+ return this.request("GET", "/products/categories/list", {
5243
+ query: query === void 0 ? void 0 : { ...query },
5244
+ ...this.scoped(profileId, options)
5245
+ });
5246
+ }
5247
+ /**
5248
+ * Put the shop's categories in a new order. Name every live category,
5249
+ * archived ones included, exactly once. Returns the categories in their new
5250
+ * order.
5251
+ * `POST /products/categories/reorder`
5252
+ */
5253
+ async reorderCategories(body, profileId, options) {
5254
+ return this.request("POST", "/products/categories/reorder", {
5255
+ body,
5256
+ ...this.scoped(profileId, options)
5257
+ });
5258
+ }
5259
+ /**
5260
+ * Rename a category.
5261
+ * `POST /products/categories/{category_id}`
5262
+ */
5263
+ async updateCategory(categoryId, changes, profileId, options) {
5264
+ return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}`, {
5265
+ body: changes,
5266
+ ...this.scoped(profileId, options)
5267
+ });
5268
+ }
5269
+ /**
5270
+ * Mark a category deleted. Its products become uncategorized and no payment
5271
+ * changes. Returns the deleted category.
5272
+ * `DELETE /products/categories/{category_id}`
5273
+ */
5274
+ async deleteCategory(categoryId, profileId, options) {
5275
+ return this.request("DELETE", `/products/categories/${encodeURIComponent(categoryId)}`, {
5276
+ ...this.scoped(profileId, options)
5277
+ });
5278
+ }
5279
+ /**
5280
+ * Keep a category with its products, but file no new product under it.
5281
+ * `POST /products/categories/{category_id}/archive`
5282
+ */
5283
+ async archiveCategory(categoryId, profileId, options) {
5284
+ return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/archive`, {
5285
+ ...this.scoped(profileId, options)
5286
+ });
5287
+ }
5288
+ /**
5289
+ * Let an archived category take products again.
5290
+ * `POST /products/categories/{category_id}/restore`
5291
+ */
5292
+ async restoreCategory(categoryId, profileId, options) {
5293
+ return this.request("POST", `/products/categories/${encodeURIComponent(categoryId)}/restore`, {
5294
+ ...this.scoped(profileId, options)
5295
+ });
5296
+ }
5095
5297
  // --- provider import ---------------------------------------------
5096
5298
  /**
5097
5299
  * Read a connected billing account's products and say how each relates to
@@ -5127,6 +5329,44 @@ var Products = class {
5127
5329
  ...this.scoped(profileId, options)
5128
5330
  });
5129
5331
  }
5332
+ // --- provider sync -----------------------------------------------
5333
+ /**
5334
+ * Compare the product with its copy at every connected account it is tied
5335
+ * to. Reads the providers now; an unreadable provider answers `unknown`,
5336
+ * never `in_sync`.
5337
+ * `GET /products/{product_id}/provider-sync`
5338
+ */
5339
+ async providerSync(productId, profileId, options) {
5340
+ return this.request("GET", `/products/${encodeURIComponent(productId)}/provider-sync`, {
5341
+ ...this.scoped(profileId, options)
5342
+ });
5343
+ }
5344
+ /**
5345
+ * {@link providerSync} for 1 to 50 products at once, such as one page of the
5346
+ * product list. Unknown ids are left out of the answer.
5347
+ * `POST /products/provider-sync`
5348
+ */
5349
+ async providerSyncBatch(request, profileId, options) {
5350
+ return this.request("POST", "/products/provider-sync", {
5351
+ body: request,
5352
+ ...this.scoped(profileId, options)
5353
+ });
5354
+ }
5355
+ /**
5356
+ * Write the catalog's state onto one connected account's copy of the
5357
+ * product, for the differences a push changes and nothing else. When it
5358
+ * would change a difference not named in `confirmed`, nothing is written and
5359
+ * the answer carries `confirmation_outdated: true` with the current
5360
+ * differences in `result`; `nothing_to_push` answers without a provider
5361
+ * write when nothing pushable differs.
5362
+ * `POST /products/{product_id}/provider-sync/push`
5363
+ */
5364
+ async providerPush(productId, request, profileId, options) {
5365
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/provider-sync/push`, {
5366
+ body: request,
5367
+ ...this.scoped(profileId, options)
5368
+ });
5369
+ }
5130
5370
  };
5131
5371
 
5132
5372
  // src/resources/processorCosts.ts
@@ -10576,4 +10816,4 @@ export {
10576
10816
  decodeNativePanes,
10577
10817
  encodeNativePanes
10578
10818
  };
10579
- //# sourceMappingURL=chunk-RH4CX4MU.js.map
10819
+ //# sourceMappingURL=chunk-FRMLBRHG.js.map