@delopay/sdk 0.172.0 → 0.175.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
@@ -5336,6 +5358,19 @@ var Subscriptions = class {
5336
5358
  async create(params, options) {
5337
5359
  return this.request("POST", "/subscriptions/create", { body: params, ...options });
5338
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
+ }
5339
5374
  /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
5340
5375
  async retrieve(subscriptionId, options) {
5341
5376
  return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`, {