@delopay/sdk 0.68.0 → 0.70.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
@@ -735,10 +735,14 @@ var Disputes = class {
735
735
  return this.request("PUT", "/disputes/evidence", { body: params });
736
736
  }
737
737
  /**
738
- * Retrieve previously submitted evidence for a dispute.
738
+ * Retrieve previously stored evidence for a dispute.
739
+ *
740
+ * Returns an ARRAY of file-evidence blocks (this was previously mistyped
741
+ * as the flat submit-request shape). Only file evidence is reported —
742
+ * text evidence is not retrievable once submitted.
739
743
  *
740
744
  * @param disputeId - The dispute ID.
741
- * @returns The submitted evidence.
745
+ * @returns The stored file-evidence blocks.
742
746
  */
743
747
  async retrieveEvidence(disputeId) {
744
748
  return this.request("GET", `/disputes/evidence/${encodeURIComponent(disputeId)}`);
@@ -776,16 +780,22 @@ var Disputes = class {
776
780
  return this.request("GET", "/disputes/profile/aggregate", { query: params });
777
781
  }
778
782
  /**
779
- * Fetch the latest dispute state from the connector (gateway).
780
- * `GET /disputes/{connectorId}/fetch`
783
+ * Fetch the latest dispute state from the connector (gateway) and persist it.
784
+ * `GET /disputes/{disputeId}?force_sync=true`
785
+ *
786
+ * The path parameter is the **Delopay dispute id** (`dp_…`). Force-sync asks the
787
+ * backend to pull the dispute from the connector (supported where the connector
788
+ * implements the dispute-sync flow, e.g. Stripe) and update the stored record
789
+ * before returning it.
781
790
  *
782
- * Note: the path parameter is the **connector dispute id** on the gateway, not the
783
- * Delopay dispute id. Method is GET (not POST) and this method signature was
784
- * previously wrongcallers depending on the old `POST /disputes/{id}/fetch_from_connector`
785
- * path were silently hitting 404s.
791
+ * Note: this method previously called `GET /disputes/{id}/fetch`, which is a
792
+ * different backend route a bulk import keyed by **merchant connector account
793
+ * id** with a required date range so every call with a dispute id failed.
786
794
  */
787
- async fetchFromConnector(connectorId) {
788
- return this.request("GET", `/disputes/${encodeURIComponent(connectorId)}/fetch`);
795
+ async fetchFromConnector(disputeId) {
796
+ return this.request("GET", `/disputes/${encodeURIComponent(disputeId)}`, {
797
+ query: { force_sync: "true" }
798
+ });
789
799
  }
790
800
  };
791
801
 
@@ -1297,6 +1307,30 @@ var Payments = class {
1297
1307
  async listAttempts(paymentId, options) {
1298
1308
  return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/attempts`, options);
1299
1309
  }
1310
+ /**
1311
+ * The status timeline of a payment: every recorded creation / status
1312
+ * transition of the intent and its attempts, refunds and disputes, oldest
1313
+ * first. `complete: false` marks timelines partially reconstructed from
1314
+ * current records (payments created before the status log existed).
1315
+ *
1316
+ * @param paymentId - The payment intent ID.
1317
+ * @returns The ordered status-history events.
1318
+ *
1319
+ * @example
1320
+ * ```typescript
1321
+ * const { events, complete } = await delopay.payments.listStatusHistory('pay_abc123');
1322
+ * for (const event of events) {
1323
+ * console.log(event.timestamp, event.entity_type, event.status);
1324
+ * }
1325
+ * ```
1326
+ */
1327
+ async listStatusHistory(paymentId, options) {
1328
+ return this.request(
1329
+ "GET",
1330
+ `/payments/${encodeURIComponent(paymentId)}/status-history`,
1331
+ options
1332
+ );
1333
+ }
1300
1334
  /**
1301
1335
  * Update an existing payment intent before it is confirmed.
1302
1336
  *