@delopay/sdk 0.171.0 → 0.174.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.cjs CHANGED
@@ -3962,6 +3962,28 @@ var Users = class {
3962
3962
  async update(params) {
3963
3963
  return this.request("POST", "/user/update", { body: params });
3964
3964
  }
3965
+ /**
3966
+ * Read a preference owned by the logged-in user. Missing keys return value null.
3967
+ * Works in both dashboards with a login JWT; API keys and impersonation are rejected.
3968
+ * Keys contain 1–128 ASCII letters, digits, dots, underscores or hyphens.
3969
+ * Unknown widget IDs and their order are preserved; consumers choose what to render.
3970
+ */
3971
+ async getPreference(key) {
3972
+ return this.request("GET", `/user/preferences/${encodeURIComponent(key)}`);
3973
+ }
3974
+ /**
3975
+ * Atomically replace one own preference (last write wins). The JSON object is
3976
+ * limited to 16 KiB of compact UTF-8 JSON. For layouts, use one namespaced key
3977
+ * per page (e.g. merchant.analytics.payments) and ordered widget IDs per region,
3978
+ * without titles, fetched metrics or rendered state. Requires a login JWT.
3979
+ */
3980
+ async setPreference(key, params) {
3981
+ return this.request("PUT", `/user/preferences/${encodeURIComponent(key)}`, { body: params });
3982
+ }
3983
+ /** Reset an own preference to defaults. Idempotent; returns value null. Login JWT only. */
3984
+ async deletePreference(key) {
3985
+ return this.request("DELETE", `/user/preferences/${encodeURIComponent(key)}`);
3986
+ }
3965
3987
  /**
3966
3988
  * RFC 7396 merge-patch the caller's own user-scoped metadata bucket.
3967
3989
  * Returns the full user details, so callers can refresh their context
@@ -5263,6 +5285,24 @@ var ProcessorCosts = class {
5263
5285
  }
5264
5286
  };
5265
5287
 
5288
+ // src/resources/checkoutBrowserInfo.ts
5289
+ var CheckoutBrowserInfo = class {
5290
+ constructor(request) {
5291
+ this.request = request;
5292
+ }
5293
+ /** Read the merchant's own setting and effective collection policy. */
5294
+ async retrieve(merchantId) {
5295
+ return this.request("GET", "/checkout-browser-info", { query: { merchant_id: merchantId } });
5296
+ }
5297
+ /** Replace the merchant setting. An admin refusal still wins; changes are audited. */
5298
+ async update(merchantId, body) {
5299
+ return this.request("PUT", "/checkout-browser-info", {
5300
+ query: { merchant_id: merchantId },
5301
+ body
5302
+ });
5303
+ }
5304
+ };
5305
+
5266
5306
  // src/resources/checkoutMethods.ts
5267
5307
  var CheckoutMethods = class {
5268
5308
  constructor(request) {
@@ -5318,6 +5358,19 @@ var Subscriptions = class {
5318
5358
  async create(params, options) {
5319
5359
  return this.request("POST", "/subscriptions/create", { body: params, ...options });
5320
5360
  }
5361
+ /**
5362
+ * Adopt an existing Creem subscription. `POST /subscriptions/adopt`
5363
+ *
5364
+ * Requires adoption to be enabled on the deployment and `X-Profile-Id` in
5365
+ * options.headers. Adoption charges nothing and emits no invoice or webhook.
5366
+ * Repeating the processor subscription ID returns the existing DeloPay ID.
5367
+ * Retry when handoff_confirmed is false. That flag confirms persistence,
5368
+ * not the merchant's external switch-over: stop processing Creem events in
5369
+ * your own integration when handing subsequent events to DeloPay.
5370
+ */
5371
+ async adopt(params, options) {
5372
+ return this.request("POST", "/subscriptions/adopt", { body: params, ...options });
5373
+ }
5321
5374
  /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
5322
5375
  async retrieve(subscriptionId, options) {
5323
5376
  return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`, {
@@ -6352,6 +6405,7 @@ var Delopay = class {
6352
6405
  this.externalRecords = new ExternalRecords(request);
6353
6406
  this.products = new Products(request);
6354
6407
  this.processorCosts = new ProcessorCosts(request);
6408
+ this.checkoutBrowserInfo = new CheckoutBrowserInfo(request);
6355
6409
  this.checkoutMethods = new CheckoutMethods(request);
6356
6410
  this.analytics = new Analytics(request);
6357
6411
  this.analyticsDashboard = new AnalyticsDashboard(request);
@@ -9368,9 +9422,8 @@ var CheckoutSession = class {
9368
9422
  *
9369
9423
  * Deliberately unauthenticated: a `pay_` link bootstraps before any
9370
9424
  * credential exists, so no credential header is ever attached (caller
9371
- * extras are still stripped of credentials). The response is a large
9372
- * discriminated union owned by the consuming checkout, which keeps its
9373
- * own types and runtime gates — hence the loose return type.
9425
+ * extras are still stripped of credentials). Core fields and the collection
9426
+ * policy are typed; provider-specific fields remain available as unknown.
9374
9427
  *
9375
9428
  * `theme` (a named checkout variant) and `country` are the route's declared
9376
9429
  * query parameters. `country` is a manual override of the buyer country the