@delopay/sdk 0.306.0 → 0.309.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
@@ -840,6 +840,44 @@ var Connectors = class {
840
840
  constructor(request) {
841
841
  this.request = request;
842
842
  }
843
+ /**
844
+ * Read the connected provider account's optional buyer-email preference.
845
+ * Currently supported for Whop. Use `setJwtToken` with a merchant JWT that
846
+ * has Connector Edit authority; a shop token or API key cannot substitute.
847
+ * Select Sandbox or Live explicitly through `test_mode`.
848
+ *
849
+ * The preference affects every shop sharing the provider account. It does
850
+ * not disable mandatory provider messages or DeloPay invoice delivery.
851
+ * A null or absent value establishes no on/off preference.
852
+ */
853
+ async retrieveBuyerEmailPreference(merchantId, connectorId, params) {
854
+ return this.request(
855
+ "GET",
856
+ `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/buyer-email-preference`,
857
+ { query: { test_mode: params.test_mode } }
858
+ );
859
+ }
860
+ /**
861
+ * Change the optional buyer-email preference for the whole provider account.
862
+ * Currently supported for Whop. Requires a merchant JWT with Connector Edit
863
+ * authority and explicit confirmation for every shop sharing the account.
864
+ * Send the exact account, credential mode and value read before confirmation;
865
+ * a changed account or preference is refused before mutation.
866
+ *
867
+ * Inspect `outcome`: only `verified` confirms the requested value through a
868
+ * fresh exact-account read. HTTP 200 may instead report a conflict, refusal
869
+ * or unknown outcome. An uncertain change may have happened; read the
870
+ * preference again before retrying, including after a transport error.
871
+ * This method adds no automatic readback or retry. Mandatory provider
872
+ * messages and DeloPay invoice delivery are unaffected.
873
+ */
874
+ async updateBuyerEmailPreference(merchantId, connectorId, params) {
875
+ return this.request(
876
+ "PUT",
877
+ `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/buyer-email-preference`,
878
+ { body: params }
879
+ );
880
+ }
843
881
  async create(accountId, params) {
844
882
  return this.request("POST", `/account/${encodeURIComponent(accountId)}/connectors`, {
845
883
  body: params
@@ -4927,6 +4965,31 @@ var Users = class {
4927
4965
  async deletePreference(key) {
4928
4966
  return this.request("DELETE", `/user/preferences/${encodeURIComponent(key)}`);
4929
4967
  }
4968
+ /**
4969
+ * The caller's guided dashboard tour in the session's scope: their progress,
4970
+ * whether to offer the tour now, and their current and acknowledged access.
4971
+ * Progress is kept per merchant, or per shop for a user whose role is limited
4972
+ * to shops; the scope comes from the session. Login JWT only.
4973
+ *
4974
+ * `GET /user/dashboard-tour`
4975
+ */
4976
+ async getDashboardTour() {
4977
+ return this.request("GET", "/user/dashboard-tour");
4978
+ }
4979
+ /**
4980
+ * Save the caller's tour progress in the session's scope and return the same
4981
+ * body as {@link Users.getDashboardTour}. `completed` and `skipped` are added
4982
+ * to the stored ones unless `restart` is set; `active`, `baseline` and
4983
+ * `offer_handled_at` replace them. `acknowledge_access: true` stores the
4984
+ * access the server computes as acknowledged. Unknown fields, malformed step
4985
+ * ids or baselines, and more than 300 steps per list are refused; so is any
4986
+ * save while acting as another user (`read_only`). Login JWT only.
4987
+ *
4988
+ * `PUT /user/dashboard-tour`
4989
+ */
4990
+ async updateDashboardTour(params) {
4991
+ return this.request("PUT", "/user/dashboard-tour", { body: params });
4992
+ }
4930
4993
  /**
4931
4994
  * RFC 7396 merge-patch the caller's own user-scoped metadata bucket.
4932
4995
  * Returns the full user details, so callers can refresh their context