@getmanza/sdk 1.1.0 → 2.1.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.
@@ -0,0 +1,17 @@
1
+ export declare const WebhookEvents: {
2
+ readonly PAYMENT_LINK_REFUNDED: "payment_link.refunded";
3
+ readonly PAYMENT_LINK_CHARGED_BACK: "payment_link.charged_back";
4
+ readonly PAYMENT_LINK_DISPUTE_OPENED: "payment_link.dispute_opened";
5
+ readonly CHECKOUT_SESSION_REFUNDED: "checkout_session.refunded";
6
+ readonly CHECKOUT_SESSION_CHARGED_BACK: "checkout_session.charged_back";
7
+ readonly CHECKOUT_SESSION_DISPUTE_OPENED: "checkout_session.dispute_opened";
8
+ };
9
+ export declare const Reversal: {
10
+ readonly KIND_REFUND: "refund";
11
+ readonly KIND_CHARGEBACK: "chargeback";
12
+ readonly STATUS_PENDING: "pending";
13
+ readonly STATUS_COMPLETED: "completed";
14
+ readonly STATUS_CANCELLED: "cancelled";
15
+ readonly RESOLUTION_WON: "won";
16
+ };
17
+ //# sourceMappingURL=webhook_events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook_events.d.ts","sourceRoot":"","sources":["../src/webhook_events.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;;;;;;;CAchB,CAAC;AASX,eAAO,MAAM,QAAQ;;;;;;;CAUX,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { Manza } from "./client.js";
2
+ export declare class ListenerEvent {
3
+ readonly type: "webhook";
4
+ readonly id: string;
5
+ readonly eventType: string;
6
+ readonly eventId: string;
7
+ readonly body: string;
8
+ readonly streamId: string | null;
9
+ constructor(fields: {
10
+ id: string;
11
+ eventType: string;
12
+ eventId: string;
13
+ body: string;
14
+ streamId: string | null;
15
+ });
16
+ }
17
+ export declare class ListenerClosed {
18
+ readonly type: "listener_closed";
19
+ readonly id: string | null;
20
+ readonly reason: string | null;
21
+ constructor(fields: {
22
+ id: string | null;
23
+ reason: string | null;
24
+ });
25
+ }
26
+ export type ListenerItem = ListenerEvent | ListenerClosed;
27
+ export interface WebhookListenerStreamOptions {
28
+ lastEventId?: string | null | undefined;
29
+ signal?: AbortSignal | undefined;
30
+ }
31
+ export declare class WebhookListenerStream implements AsyncIterable<ListenerItem> {
32
+ #private;
33
+ constructor(client: Manza, streamUrl: string, options?: WebhookListenerStreamOptions);
34
+ [Symbol.asyncIterator](): AsyncGenerator<ListenerItem, void, undefined>;
35
+ /** @internal The reconnect wait; tests override it. Not public API. */
36
+ protected sleep(ms: number): Promise<void>;
37
+ }
38
+ //# sourceMappingURL=webhook_listener_stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook_listener_stream.d.ts","sourceRoot":"","sources":["../src/webhook_listener_stream.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAazC,qBAAa,aAAa;IACxB,QAAQ,CAAC,IAAI,EAAG,SAAS,CAAU;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;gBAErB,MAAM,EAAE;QAClB,EAAE,EAAE,MAAM,CAAC;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;KACzB;CAOF;AAID,qBAAa,cAAc;IACzB,QAAQ,CAAC,IAAI,EAAG,iBAAiB,CAAU;IAC3C,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEnB,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;CAIjE;AAED,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,cAAc,CAAC;AAE1D,MAAM,WAAW,4BAA4B;IAE3C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAGxC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC;AA8GD,qBAAa,qBAAsB,YAAW,aAAa,CAAC,YAAY,CAAC;;gBAM3D,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,4BAAiC;IAOjF,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC;IA0C9E,uEAAuE;IACvE,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAsG3C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmanza/sdk",
3
- "version": "1.1.0",
3
+ "version": "2.1.0",
4
4
  "description": "TypeScript SDK for the Manza API. Runtime-agnostic (Node, Bun, Deno, browsers, Cloudflare Workers).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",