@delopay/sdk 0.81.0 → 0.83.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/{chunk-PHKXFVHZ.js → chunk-G44EQT6Q.js} +49 -5
- package/dist/chunk-G44EQT6Q.js.map +1 -0
- package/dist/index.cjs +48 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -2
- package/dist/index.d.ts +104 -2
- package/dist/index.js +1 -1
- package/dist/internal.cjs +48 -4
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-PHKXFVHZ.js.map +0 -1
|
@@ -507,6 +507,36 @@ var Connectors = class {
|
|
|
507
507
|
`/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}`
|
|
508
508
|
);
|
|
509
509
|
}
|
|
510
|
+
/**
|
|
511
|
+
* Bring an already-registered webhook's event subscription up to date with
|
|
512
|
+
* the events Delopay handles.
|
|
513
|
+
* `POST /account/{merchantId}/connectors/webhooks/{connectorId}/sync-events`
|
|
514
|
+
*
|
|
515
|
+
* A PSP freezes an endpoint's event list at registration time, so an endpoint
|
|
516
|
+
* created before an event type was added never receives it — silently, with
|
|
517
|
+
* no error anywhere. {@link getWebhook} reports the gap as `missing_events`;
|
|
518
|
+
* this repairs it.
|
|
519
|
+
*
|
|
520
|
+
* Unlike re-registering, the endpoints are updated in place: the endpoint id
|
|
521
|
+
* and its signing secret are preserved, so signature verification keeps
|
|
522
|
+
* working across the change. Stripe connectors only; idempotent, so it is
|
|
523
|
+
* safe to call on a schedule or after every deploy.
|
|
524
|
+
*
|
|
525
|
+
* @example
|
|
526
|
+
* ```typescript
|
|
527
|
+
* const sync = await delopay.connectors.syncWebhookEvents('mer_abc', 'mca_xyz');
|
|
528
|
+
* for (const endpoint of sync.endpoints) {
|
|
529
|
+
* if (endpoint.error_message) console.warn(endpoint.connector_webhook_id, endpoint.error_message);
|
|
530
|
+
* else if (endpoint.updated) console.log('subscribed', endpoint.added_events);
|
|
531
|
+
* }
|
|
532
|
+
* ```
|
|
533
|
+
*/
|
|
534
|
+
async syncWebhookEvents(merchantId, connectorId) {
|
|
535
|
+
return this.request(
|
|
536
|
+
"POST",
|
|
537
|
+
`/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/sync-events`
|
|
538
|
+
);
|
|
539
|
+
}
|
|
510
540
|
/** List available payment methods. `GET /account/payment-methods` */
|
|
511
541
|
async listPaymentMethods() {
|
|
512
542
|
return this.request("GET", "/account/payment-methods");
|
|
@@ -514,6 +544,15 @@ var Connectors = class {
|
|
|
514
544
|
};
|
|
515
545
|
|
|
516
546
|
// src/resources/customers.ts
|
|
547
|
+
function toQuery(params) {
|
|
548
|
+
if (!params) return void 0;
|
|
549
|
+
const { profile_ids, ...rest } = params;
|
|
550
|
+
const query = rest;
|
|
551
|
+
if (profile_ids && profile_ids.length > 0) {
|
|
552
|
+
query.profile_ids = profile_ids.join(",");
|
|
553
|
+
}
|
|
554
|
+
return query;
|
|
555
|
+
}
|
|
517
556
|
var Customers = class {
|
|
518
557
|
constructor(request) {
|
|
519
558
|
this.request = request;
|
|
@@ -579,11 +618,16 @@ var Customers = class {
|
|
|
579
618
|
* ```typescript
|
|
580
619
|
* // Customers who have transacted in a specific shop.
|
|
581
620
|
* const customers = await delopay.customers.list({ profile_id: 'pro_abc123' });
|
|
621
|
+
*
|
|
622
|
+
* // Several shops at once (unions with profile_id / project_id).
|
|
623
|
+
* const many = await delopay.customers.list({
|
|
624
|
+
* profile_ids: ['pro_abc123', 'pro_def456'],
|
|
625
|
+
* });
|
|
582
626
|
* ```
|
|
583
627
|
*/
|
|
584
628
|
async list(params) {
|
|
585
629
|
return this.request("GET", "/customers/list", {
|
|
586
|
-
query: params
|
|
630
|
+
query: toQuery(params)
|
|
587
631
|
});
|
|
588
632
|
}
|
|
589
633
|
// --- OLAP extensions (Task 4.6) ---
|
|
@@ -593,7 +637,7 @@ var Customers = class {
|
|
|
593
637
|
*/
|
|
594
638
|
async listWithCount(params) {
|
|
595
639
|
return this.request("GET", "/customers/list-with-count", {
|
|
596
|
-
query: params
|
|
640
|
+
query: toQuery(params)
|
|
597
641
|
});
|
|
598
642
|
}
|
|
599
643
|
/**
|
|
@@ -607,7 +651,7 @@ var Customers = class {
|
|
|
607
651
|
*/
|
|
608
652
|
async listByProfile(params) {
|
|
609
653
|
return this.request("GET", "/customers/profile/list", {
|
|
610
|
-
query: params
|
|
654
|
+
query: toQuery(params)
|
|
611
655
|
});
|
|
612
656
|
}
|
|
613
657
|
/**
|
|
@@ -616,7 +660,7 @@ var Customers = class {
|
|
|
616
660
|
*/
|
|
617
661
|
async listByProfileWithCount(params) {
|
|
618
662
|
return this.request("GET", "/customers/profile/list-with-count", {
|
|
619
|
-
query: params
|
|
663
|
+
query: toQuery(params)
|
|
620
664
|
});
|
|
621
665
|
}
|
|
622
666
|
/** List mandates for a customer. `GET /customers/{customerId}/mandates` */
|
|
@@ -5052,4 +5096,4 @@ export {
|
|
|
5052
5096
|
focusedCheckoutUrl,
|
|
5053
5097
|
CHECKOUT_EVENT_KINDS
|
|
5054
5098
|
};
|
|
5055
|
-
//# sourceMappingURL=chunk-
|
|
5099
|
+
//# sourceMappingURL=chunk-G44EQT6Q.js.map
|