@delopay/sdk 0.176.0 → 0.178.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
@@ -1060,8 +1060,8 @@ var Customers = class {
1060
1060
  return this.request("DELETE", `/customers/${encodeURIComponent(customerId)}`);
1061
1061
  }
1062
1062
  /**
1063
- * List customers, optionally filtered by email, shop (`profile_id`), or
1064
- * project (`project_id`).
1063
+ * List customers, optionally filtered by customer id/name/email prefix,
1064
+ * shop (`profile_id`), or project (`project_id`).
1065
1065
  *
1066
1066
  * @param params - Optional filter and pagination parameters.
1067
1067
  * @returns Array of customer objects.
@@ -3972,7 +3972,8 @@ var Users = class {
3972
3972
  return this.request("GET", `/user/preferences/${encodeURIComponent(key)}`);
3973
3973
  }
3974
3974
  /**
3975
- * Atomically replace one own preference (last write wins). The JSON object is
3975
+ * Save one own preference: omitted/false if_absent replaces it (last write wins);
3976
+ * true preserves an existing object and returns the winner. The JSON object is
3976
3977
  * limited to 16 KiB of compact UTF-8 JSON. For layouts, use one namespaced key
3977
3978
  * per page (e.g. merchant.analytics.payments) and ordered widget IDs per region,
3978
3979
  * without titles, fetched metrics or rendered state. Requires a login JWT.
@@ -3980,7 +3981,25 @@ var Users = class {
3980
3981
  async setPreference(key, params) {
3981
3982
  return this.request("PUT", `/user/preferences/${encodeURIComponent(key)}`, { body: params });
3982
3983
  }
3983
- /** Reset an own preference to defaults. Idempotent; returns value null. Login JWT only. */
3984
+ /**
3985
+ * Initialize only a missing preference. Existing objects, including a client
3986
+ * reset marker saved with setPreference (for example { reset: true }), win. Render/cache the returned value, which may differ from
3987
+ * the proposed value. Safe for migration retries after a lost response.
3988
+ * Explicit edits and reset markers use setPreference with no if_absent flag.
3989
+ * DELETE removes the key; it leaves no marker and permits initialization again.
3990
+ * Requires a login JWT and the same key/object limits as setPreference.
3991
+ */
3992
+ async initializePreference(key, value) {
3993
+ return this.request("PUT", `/user/preferences/${encodeURIComponent(key)}`, {
3994
+ body: { value, if_absent: true }
3995
+ });
3996
+ }
3997
+ /**
3998
+ * Remove an own preference. Idempotent; returns value null, without storing a
3999
+ * tombstone. Later initialization may import a value again. To suppress legacy
4000
+ * migration after a reset, save a client reset-marker object with setPreference.
4001
+ * Login JWT only.
4002
+ */
3984
4003
  async deletePreference(key) {
3985
4004
  return this.request("DELETE", `/user/preferences/${encodeURIComponent(key)}`);
3986
4005
  }