@delopay/sdk 0.266.0 → 0.267.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
@@ -44,6 +44,7 @@ __export(index_exports, {
44
44
  BUILTIN_PAYMENT_ICON_KEYS: () => BUILTIN_PAYMENT_ICON_KEYS,
45
45
  BuyerBlocklist: () => BuyerBlocklist,
46
46
  BuyerConversations: () => BuyerConversations,
47
+ BuyerEvidenceReviews: () => BuyerEvidenceReviews,
47
48
  CARD_FIELD_CHROMES: () => CARD_FIELD_CHROMES,
48
49
  CARD_FIELD_FONT_SIZES: () => CARD_FIELD_FONT_SIZES,
49
50
  CARD_FIELD_WEIGHTS: () => CARD_FIELD_WEIGHTS,
@@ -5992,6 +5993,60 @@ var BuyerConversations = class {
5992
5993
  }
5993
5994
  };
5994
5995
 
5996
+ // src/resources/buyerEvidenceReviews.ts
5997
+ var BuyerEvidenceReviews = class {
5998
+ constructor(request) {
5999
+ this.request = request;
6000
+ }
6001
+ /**
6002
+ * The shop's cases with buyer evidence, the nearest target first.
6003
+ * `merchant_id` and `reviewer` are ignored here. `GET /buyer-evidence`
6004
+ */
6005
+ async list(params) {
6006
+ return this.request("GET", "/buyer-evidence", {
6007
+ query: params
6008
+ });
6009
+ }
6010
+ /** One case's evidence with its history and files. `GET /buyer-evidence/{id}` */
6011
+ async retrieve(evidenceId) {
6012
+ return this.request("GET", `/buyer-evidence/${encodeURIComponent(evidenceId)}`);
6013
+ }
6014
+ /** Download a file of a case's evidence. */
6015
+ async downloadFile(evidenceId, fileId) {
6016
+ return this.request(
6017
+ "GET",
6018
+ `/buyer-evidence/${encodeURIComponent(evidenceId)}/files/${encodeURIComponent(fileId)}`,
6019
+ { responseType: "blob" }
6020
+ );
6021
+ }
6022
+ /** Ask the buyer for more, by a cut-off. Refused once a result closed the review. */
6023
+ async requestInformation(evidenceId, params) {
6024
+ return this.request(
6025
+ "POST",
6026
+ `/buyer-evidence/${encodeURIComponent(evidenceId)}/information-requests`,
6027
+ { body: params }
6028
+ );
6029
+ }
6030
+ /** An answer the buyer sees. */
6031
+ async reply(evidenceId, params) {
6032
+ return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/replies`, {
6033
+ body: params
6034
+ });
6035
+ }
6036
+ /** Record the result, which closes the review. */
6037
+ async review(evidenceId, params) {
6038
+ return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/reviews`, {
6039
+ body: params
6040
+ });
6041
+ }
6042
+ /** A note the shop's team and DeloPay read, never the buyer. */
6043
+ async note(evidenceId, params) {
6044
+ return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/notes`, {
6045
+ body: params
6046
+ });
6047
+ }
6048
+ };
6049
+
5995
6050
  // src/resources/checkoutRecovery.ts
5996
6051
  var CheckoutRecovery = class {
5997
6052
  constructor(request) {
@@ -7609,6 +7664,17 @@ var BuyerAccount = class {
7609
7664
  async getSession(options) {
7610
7665
  return this.request("GET", "/buyer-account/session", { ...options });
7611
7666
  }
7667
+ /**
7668
+ * What the buyer is mailed about: a reply from a shop's team they have not
7669
+ * read, and news in their refund requests and disputes.
7670
+ */
7671
+ async noticeSettings(options) {
7672
+ return this.request("GET", "/buyer-account/notice-settings", { ...options });
7673
+ }
7674
+ /** Turn either mail on or off for the buyer, at every shop. */
7675
+ async setNoticeSettings(params, options) {
7676
+ return this.request("PUT", "/buyer-account/notice-settings", { body: params, ...options });
7677
+ }
7612
7678
  /** End the current session. */
7613
7679
  async signOut(options) {
7614
7680
  return this.request("DELETE", "/buyer-account/session", { ...options });
@@ -7743,6 +7809,78 @@ var BuyerAccount = class {
7743
7809
  ...options
7744
7810
  });
7745
7811
  }
7812
+ /**
7813
+ * A case's evidence: what may be handed in and by when, the files saved
7814
+ * and handed in, and what the reviewer said. Opened on the first read
7815
+ * while the case still waits.
7816
+ * The case is one of a confirmed record's, named by the `record` its
7817
+ * purchases carry and the case id the case list shows.
7818
+ */
7819
+ async caseEvidence(record, caseId, options) {
7820
+ return this.request(
7821
+ "GET",
7822
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence`,
7823
+ { ...options }
7824
+ );
7825
+ }
7826
+ /**
7827
+ * Upload a file for a case. It is saved, not handed in, until a
7828
+ * submission takes it. Uploading again with the same `clientUploadId`
7829
+ * returns the file the first upload stored, also after the cut-off.
7830
+ */
7831
+ async uploadEvidenceFile(record, caseId, file, clientUploadId, options) {
7832
+ const { fileName, ...extras } = options ?? {};
7833
+ const form = new FormData();
7834
+ form.append("client_upload_id", clientUploadId);
7835
+ if (fileName === void 0) form.append("file", file);
7836
+ else form.append("file", file, fileName);
7837
+ return this.request(
7838
+ "POST",
7839
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files`,
7840
+ { body: form, ...extras }
7841
+ );
7842
+ }
7843
+ /** Download a file of the case's evidence. */
7844
+ async downloadEvidenceFile(record, caseId, fileId, options) {
7845
+ return this.request(
7846
+ "GET",
7847
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7848
+ {
7849
+ responseType: "blob",
7850
+ ...options
7851
+ }
7852
+ );
7853
+ }
7854
+ /** Remove a saved file. A file a submission took stays. */
7855
+ async removeEvidenceFile(record, caseId, fileId, options) {
7856
+ return this.request(
7857
+ "DELETE",
7858
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7859
+ {
7860
+ ...options
7861
+ }
7862
+ );
7863
+ }
7864
+ /**
7865
+ * Hand in an explanation, saved files or both, while the buyer's window
7866
+ * is open. Sending again with the same `client_submission_id` returns the
7867
+ * submission the first send stored.
7868
+ */
7869
+ async submitEvidence(record, caseId, params, options) {
7870
+ return this.request(
7871
+ "POST",
7872
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/submissions`,
7873
+ { body: params, ...options }
7874
+ );
7875
+ }
7876
+ /** Ask for more time, once until the cut-off is next set. */
7877
+ async requestEvidenceExtension(record, caseId, params, options) {
7878
+ return this.request(
7879
+ "POST",
7880
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,
7881
+ { body: params, ...options }
7882
+ );
7883
+ }
7746
7884
  };
7747
7885
 
7748
7886
  // src/resources/buyerPortal.ts
@@ -7761,6 +7899,74 @@ var BuyerPortal = class {
7761
7899
  async listCases(options) {
7762
7900
  return this.request("GET", "/buyer-portal/cases", { ...options });
7763
7901
  }
7902
+ /**
7903
+ * A case's evidence: what may be handed in and by when, the files saved
7904
+ * and handed in, and what the reviewer said. Opened on the first read
7905
+ * while the case still waits.
7906
+ */
7907
+ async caseEvidence(caseId, options) {
7908
+ return this.request("GET", `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence`, {
7909
+ ...options
7910
+ });
7911
+ }
7912
+ /**
7913
+ * Upload a file for a case. It is saved, not handed in, until a
7914
+ * submission takes it. Uploading again with the same `clientUploadId`
7915
+ * returns the file the first upload stored, also after the cut-off.
7916
+ */
7917
+ async uploadEvidenceFile(caseId, file, clientUploadId, options) {
7918
+ const { fileName, ...extras } = options ?? {};
7919
+ const form = new FormData();
7920
+ form.append("client_upload_id", clientUploadId);
7921
+ if (fileName === void 0) form.append("file", file);
7922
+ else form.append("file", file, fileName);
7923
+ return this.request(
7924
+ "POST",
7925
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files`,
7926
+ { body: form, ...extras }
7927
+ );
7928
+ }
7929
+ /** Download a file of the case's evidence. */
7930
+ async downloadEvidenceFile(caseId, fileId, options) {
7931
+ return this.request(
7932
+ "GET",
7933
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7934
+ {
7935
+ responseType: "blob",
7936
+ ...options
7937
+ }
7938
+ );
7939
+ }
7940
+ /** Remove a saved file. A file a submission took stays. */
7941
+ async removeEvidenceFile(caseId, fileId, options) {
7942
+ return this.request(
7943
+ "DELETE",
7944
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7945
+ {
7946
+ ...options
7947
+ }
7948
+ );
7949
+ }
7950
+ /**
7951
+ * Hand in an explanation, saved files or both, while the buyer's window
7952
+ * is open. Sending again with the same `client_submission_id` returns the
7953
+ * submission the first send stored.
7954
+ */
7955
+ async submitEvidence(caseId, params, options) {
7956
+ return this.request(
7957
+ "POST",
7958
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/submissions`,
7959
+ { body: params, ...options }
7960
+ );
7961
+ }
7962
+ /** Ask for more time, once until the cut-off is next set. */
7963
+ async requestEvidenceExtension(caseId, params, options) {
7964
+ return this.request(
7965
+ "POST",
7966
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,
7967
+ { body: params, ...options }
7968
+ );
7969
+ }
7764
7970
  /**
7765
7971
  * The buyer's conversations with the shop, the latest message first. A
7766
7972
  * portal link for the whole merchant lists one per shop and mode.
@@ -8923,6 +9129,7 @@ var Delopay = class {
8923
9129
  this.sellToRestrictions = new SellToRestrictions(request);
8924
9130
  this.buyerBlocklist = new BuyerBlocklist(request);
8925
9131
  this.buyerConversations = new BuyerConversations(request);
9132
+ this.buyerEvidence = new BuyerEvidenceReviews(request);
8926
9133
  this.checkoutRecovery = new CheckoutRecovery(request);
8927
9134
  this.costRules = new CostRules(request);
8928
9135
  this.externalRecords = new ExternalRecords(request);
@@ -13743,6 +13950,7 @@ var encodeNativePanes = encodePanes;
13743
13950
  BUILTIN_PAYMENT_ICON_KEYS,
13744
13951
  BuyerBlocklist,
13745
13952
  BuyerConversations,
13953
+ BuyerEvidenceReviews,
13746
13954
  CARD_FIELD_CHROMES,
13747
13955
  CARD_FIELD_FONT_SIZES,
13748
13956
  CARD_FIELD_WEIGHTS,