@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.
@@ -5716,6 +5716,60 @@ var BuyerConversations = class {
5716
5716
  }
5717
5717
  };
5718
5718
 
5719
+ // src/resources/buyerEvidenceReviews.ts
5720
+ var BuyerEvidenceReviews = class {
5721
+ constructor(request) {
5722
+ this.request = request;
5723
+ }
5724
+ /**
5725
+ * The shop's cases with buyer evidence, the nearest target first.
5726
+ * `merchant_id` and `reviewer` are ignored here. `GET /buyer-evidence`
5727
+ */
5728
+ async list(params) {
5729
+ return this.request("GET", "/buyer-evidence", {
5730
+ query: params
5731
+ });
5732
+ }
5733
+ /** One case's evidence with its history and files. `GET /buyer-evidence/{id}` */
5734
+ async retrieve(evidenceId) {
5735
+ return this.request("GET", `/buyer-evidence/${encodeURIComponent(evidenceId)}`);
5736
+ }
5737
+ /** Download a file of a case's evidence. */
5738
+ async downloadFile(evidenceId, fileId) {
5739
+ return this.request(
5740
+ "GET",
5741
+ `/buyer-evidence/${encodeURIComponent(evidenceId)}/files/${encodeURIComponent(fileId)}`,
5742
+ { responseType: "blob" }
5743
+ );
5744
+ }
5745
+ /** Ask the buyer for more, by a cut-off. Refused once a result closed the review. */
5746
+ async requestInformation(evidenceId, params) {
5747
+ return this.request(
5748
+ "POST",
5749
+ `/buyer-evidence/${encodeURIComponent(evidenceId)}/information-requests`,
5750
+ { body: params }
5751
+ );
5752
+ }
5753
+ /** An answer the buyer sees. */
5754
+ async reply(evidenceId, params) {
5755
+ return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/replies`, {
5756
+ body: params
5757
+ });
5758
+ }
5759
+ /** Record the result, which closes the review. */
5760
+ async review(evidenceId, params) {
5761
+ return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/reviews`, {
5762
+ body: params
5763
+ });
5764
+ }
5765
+ /** A note the shop's team and DeloPay read, never the buyer. */
5766
+ async note(evidenceId, params) {
5767
+ return this.request("POST", `/buyer-evidence/${encodeURIComponent(evidenceId)}/notes`, {
5768
+ body: params
5769
+ });
5770
+ }
5771
+ };
5772
+
5719
5773
  // src/resources/checkoutRecovery.ts
5720
5774
  var CheckoutRecovery = class {
5721
5775
  constructor(request) {
@@ -7333,6 +7387,17 @@ var BuyerAccount = class {
7333
7387
  async getSession(options) {
7334
7388
  return this.request("GET", "/buyer-account/session", { ...options });
7335
7389
  }
7390
+ /**
7391
+ * What the buyer is mailed about: a reply from a shop's team they have not
7392
+ * read, and news in their refund requests and disputes.
7393
+ */
7394
+ async noticeSettings(options) {
7395
+ return this.request("GET", "/buyer-account/notice-settings", { ...options });
7396
+ }
7397
+ /** Turn either mail on or off for the buyer, at every shop. */
7398
+ async setNoticeSettings(params, options) {
7399
+ return this.request("PUT", "/buyer-account/notice-settings", { body: params, ...options });
7400
+ }
7336
7401
  /** End the current session. */
7337
7402
  async signOut(options) {
7338
7403
  return this.request("DELETE", "/buyer-account/session", { ...options });
@@ -7467,6 +7532,78 @@ var BuyerAccount = class {
7467
7532
  ...options
7468
7533
  });
7469
7534
  }
7535
+ /**
7536
+ * A case's evidence: what may be handed in and by when, the files saved
7537
+ * and handed in, and what the reviewer said. Opened on the first read
7538
+ * while the case still waits.
7539
+ * The case is one of a confirmed record's, named by the `record` its
7540
+ * purchases carry and the case id the case list shows.
7541
+ */
7542
+ async caseEvidence(record, caseId, options) {
7543
+ return this.request(
7544
+ "GET",
7545
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence`,
7546
+ { ...options }
7547
+ );
7548
+ }
7549
+ /**
7550
+ * Upload a file for a case. It is saved, not handed in, until a
7551
+ * submission takes it. Uploading again with the same `clientUploadId`
7552
+ * returns the file the first upload stored, also after the cut-off.
7553
+ */
7554
+ async uploadEvidenceFile(record, caseId, file, clientUploadId, options) {
7555
+ const { fileName, ...extras } = options ?? {};
7556
+ const form = new FormData();
7557
+ form.append("client_upload_id", clientUploadId);
7558
+ if (fileName === void 0) form.append("file", file);
7559
+ else form.append("file", file, fileName);
7560
+ return this.request(
7561
+ "POST",
7562
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files`,
7563
+ { body: form, ...extras }
7564
+ );
7565
+ }
7566
+ /** Download a file of the case's evidence. */
7567
+ async downloadEvidenceFile(record, caseId, fileId, options) {
7568
+ return this.request(
7569
+ "GET",
7570
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7571
+ {
7572
+ responseType: "blob",
7573
+ ...options
7574
+ }
7575
+ );
7576
+ }
7577
+ /** Remove a saved file. A file a submission took stays. */
7578
+ async removeEvidenceFile(record, caseId, fileId, options) {
7579
+ return this.request(
7580
+ "DELETE",
7581
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7582
+ {
7583
+ ...options
7584
+ }
7585
+ );
7586
+ }
7587
+ /**
7588
+ * Hand in an explanation, saved files or both, while the buyer's window
7589
+ * is open. Sending again with the same `client_submission_id` returns the
7590
+ * submission the first send stored.
7591
+ */
7592
+ async submitEvidence(record, caseId, params, options) {
7593
+ return this.request(
7594
+ "POST",
7595
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/submissions`,
7596
+ { body: params, ...options }
7597
+ );
7598
+ }
7599
+ /** Ask for more time, once until the cut-off is next set. */
7600
+ async requestEvidenceExtension(record, caseId, params, options) {
7601
+ return this.request(
7602
+ "POST",
7603
+ `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,
7604
+ { body: params, ...options }
7605
+ );
7606
+ }
7470
7607
  };
7471
7608
 
7472
7609
  // src/resources/buyerPortal.ts
@@ -7485,6 +7622,74 @@ var BuyerPortal = class {
7485
7622
  async listCases(options) {
7486
7623
  return this.request("GET", "/buyer-portal/cases", { ...options });
7487
7624
  }
7625
+ /**
7626
+ * A case's evidence: what may be handed in and by when, the files saved
7627
+ * and handed in, and what the reviewer said. Opened on the first read
7628
+ * while the case still waits.
7629
+ */
7630
+ async caseEvidence(caseId, options) {
7631
+ return this.request("GET", `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence`, {
7632
+ ...options
7633
+ });
7634
+ }
7635
+ /**
7636
+ * Upload a file for a case. It is saved, not handed in, until a
7637
+ * submission takes it. Uploading again with the same `clientUploadId`
7638
+ * returns the file the first upload stored, also after the cut-off.
7639
+ */
7640
+ async uploadEvidenceFile(caseId, file, clientUploadId, options) {
7641
+ const { fileName, ...extras } = options ?? {};
7642
+ const form = new FormData();
7643
+ form.append("client_upload_id", clientUploadId);
7644
+ if (fileName === void 0) form.append("file", file);
7645
+ else form.append("file", file, fileName);
7646
+ return this.request(
7647
+ "POST",
7648
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files`,
7649
+ { body: form, ...extras }
7650
+ );
7651
+ }
7652
+ /** Download a file of the case's evidence. */
7653
+ async downloadEvidenceFile(caseId, fileId, options) {
7654
+ return this.request(
7655
+ "GET",
7656
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7657
+ {
7658
+ responseType: "blob",
7659
+ ...options
7660
+ }
7661
+ );
7662
+ }
7663
+ /** Remove a saved file. A file a submission took stays. */
7664
+ async removeEvidenceFile(caseId, fileId, options) {
7665
+ return this.request(
7666
+ "DELETE",
7667
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,
7668
+ {
7669
+ ...options
7670
+ }
7671
+ );
7672
+ }
7673
+ /**
7674
+ * Hand in an explanation, saved files or both, while the buyer's window
7675
+ * is open. Sending again with the same `client_submission_id` returns the
7676
+ * submission the first send stored.
7677
+ */
7678
+ async submitEvidence(caseId, params, options) {
7679
+ return this.request(
7680
+ "POST",
7681
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/submissions`,
7682
+ { body: params, ...options }
7683
+ );
7684
+ }
7685
+ /** Ask for more time, once until the cut-off is next set. */
7686
+ async requestEvidenceExtension(caseId, params, options) {
7687
+ return this.request(
7688
+ "POST",
7689
+ `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,
7690
+ { body: params, ...options }
7691
+ );
7692
+ }
7488
7693
  /**
7489
7694
  * The buyer's conversations with the shop, the latest message first. A
7490
7695
  * portal link for the whole merchant lists one per shop and mode.
@@ -8647,6 +8852,7 @@ var Delopay = class {
8647
8852
  this.sellToRestrictions = new SellToRestrictions(request);
8648
8853
  this.buyerBlocklist = new BuyerBlocklist(request);
8649
8854
  this.buyerConversations = new BuyerConversations(request);
8855
+ this.buyerEvidence = new BuyerEvidenceReviews(request);
8650
8856
  this.checkoutRecovery = new CheckoutRecovery(request);
8651
8857
  this.costRules = new CostRules(request);
8652
8858
  this.externalRecords = new ExternalRecords(request);
@@ -13464,6 +13670,7 @@ export {
13464
13670
  SellToRestrictions,
13465
13671
  BuyerBlocklist,
13466
13672
  BuyerConversations,
13673
+ BuyerEvidenceReviews,
13467
13674
  CheckoutRecovery,
13468
13675
  CostRules,
13469
13676
  ExternalRecords,
@@ -13696,4 +13903,4 @@ export {
13696
13903
  decodeNativePanes,
13697
13904
  encodeNativePanes
13698
13905
  };
13699
- //# sourceMappingURL=chunk-T7DDPU7M.js.map
13906
+ //# sourceMappingURL=chunk-C7D3FUJ2.js.map