silon-sdk 0.2.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/LICENSE +21 -0
- package/README.md +560 -0
- package/dist/client.d.ts +141 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +249 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +117 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +199 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/utils.d.ts +24 -0
- package/dist/internal/utils.d.ts.map +1 -0
- package/dist/internal/utils.js +58 -0
- package/dist/internal/utils.js.map +1 -0
- package/dist/pagination.d.ts +52 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +80 -0
- package/dist/pagination.js.map +1 -0
- package/dist/resources/auth.d.ts +20 -0
- package/dist/resources/auth.d.ts.map +1 -0
- package/dist/resources/auth.js +41 -0
- package/dist/resources/auth.js.map +1 -0
- package/dist/resources/broadcasts.d.ts +63 -0
- package/dist/resources/broadcasts.d.ts.map +1 -0
- package/dist/resources/broadcasts.js +103 -0
- package/dist/resources/broadcasts.js.map +1 -0
- package/dist/resources/bulk.d.ts +60 -0
- package/dist/resources/bulk.d.ts.map +1 -0
- package/dist/resources/bulk.js +137 -0
- package/dist/resources/bulk.js.map +1 -0
- package/dist/resources/client-groups.d.ts +50 -0
- package/dist/resources/client-groups.d.ts.map +1 -0
- package/dist/resources/client-groups.js +97 -0
- package/dist/resources/client-groups.js.map +1 -0
- package/dist/resources/clients.d.ts +51 -0
- package/dist/resources/clients.d.ts.map +1 -0
- package/dist/resources/clients.js +99 -0
- package/dist/resources/clients.js.map +1 -0
- package/dist/resources/events.d.ts +22 -0
- package/dist/resources/events.d.ts.map +1 -0
- package/dist/resources/events.js +38 -0
- package/dist/resources/events.js.map +1 -0
- package/dist/resources/messages.d.ts +99 -0
- package/dist/resources/messages.d.ts.map +1 -0
- package/dist/resources/messages.js +167 -0
- package/dist/resources/messages.js.map +1 -0
- package/dist/resources/otp.d.ts +26 -0
- package/dist/resources/otp.d.ts.map +1 -0
- package/dist/resources/otp.js +40 -0
- package/dist/resources/otp.js.map +1 -0
- package/dist/resources/profile.d.ts +18 -0
- package/dist/resources/profile.d.ts.map +1 -0
- package/dist/resources/profile.js +40 -0
- package/dist/resources/profile.js.map +1 -0
- package/dist/resources/push.d.ts +45 -0
- package/dist/resources/push.d.ts.map +1 -0
- package/dist/resources/push.js +103 -0
- package/dist/resources/push.js.map +1 -0
- package/dist/resources/reports.d.ts +44 -0
- package/dist/resources/reports.d.ts.map +1 -0
- package/dist/resources/reports.js +127 -0
- package/dist/resources/reports.js.map +1 -0
- package/dist/resources/suppressions.d.ts +54 -0
- package/dist/resources/suppressions.d.ts.map +1 -0
- package/dist/resources/suppressions.js +79 -0
- package/dist/resources/suppressions.js.map +1 -0
- package/dist/resources/templates.d.ts +58 -0
- package/dist/resources/templates.d.ts.map +1 -0
- package/dist/resources/templates.js +96 -0
- package/dist/resources/templates.js.map +1 -0
- package/dist/resources/webhook-endpoints.d.ts +54 -0
- package/dist/resources/webhook-endpoints.d.ts.map +1 -0
- package/dist/resources/webhook-endpoints.js +96 -0
- package/dist/resources/webhook-endpoints.js.map +1 -0
- package/dist/resources/whatsapp-templates.d.ts +20 -0
- package/dist/resources/whatsapp-templates.d.ts.map +1 -0
- package/dist/resources/whatsapp-templates.js +33 -0
- package/dist/resources/whatsapp-templates.js.map +1 -0
- package/dist/types/auth.d.ts +34 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +8 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/broadcasts.d.ts +174 -0
- package/dist/types/broadcasts.d.ts.map +1 -0
- package/dist/types/broadcasts.js +8 -0
- package/dist/types/broadcasts.js.map +1 -0
- package/dist/types/bulk.d.ts +161 -0
- package/dist/types/bulk.d.ts.map +1 -0
- package/dist/types/bulk.js +8 -0
- package/dist/types/bulk.js.map +1 -0
- package/dist/types/client-groups.d.ts +52 -0
- package/dist/types/client-groups.d.ts.map +1 -0
- package/dist/types/client-groups.js +8 -0
- package/dist/types/client-groups.js.map +1 -0
- package/dist/types/clients.d.ts +64 -0
- package/dist/types/clients.d.ts.map +1 -0
- package/dist/types/clients.js +8 -0
- package/dist/types/clients.js.map +1 -0
- package/dist/types/events.d.ts +64 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +9 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/messages.d.ts +334 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/messages.js +8 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/otp.d.ts +61 -0
- package/dist/types/otp.d.ts.map +1 -0
- package/dist/types/otp.js +8 -0
- package/dist/types/otp.js.map +1 -0
- package/dist/types/profile.d.ts +37 -0
- package/dist/types/profile.d.ts.map +1 -0
- package/dist/types/profile.js +8 -0
- package/dist/types/profile.js.map +1 -0
- package/dist/types/push.d.ts +90 -0
- package/dist/types/push.d.ts.map +1 -0
- package/dist/types/push.js +8 -0
- package/dist/types/push.js.map +1 -0
- package/dist/types/reports.d.ts +109 -0
- package/dist/types/reports.d.ts.map +1 -0
- package/dist/types/reports.js +8 -0
- package/dist/types/reports.js.map +1 -0
- package/dist/types/suppressions.d.ts +72 -0
- package/dist/types/suppressions.d.ts.map +1 -0
- package/dist/types/suppressions.js +8 -0
- package/dist/types/suppressions.js.map +1 -0
- package/dist/types/templates.d.ts +96 -0
- package/dist/types/templates.d.ts.map +1 -0
- package/dist/types/templates.js +9 -0
- package/dist/types/templates.js.map +1 -0
- package/dist/types/webhook-endpoints.d.ts +123 -0
- package/dist/types/webhook-endpoints.d.ts.map +1 -0
- package/dist/types/webhook-endpoints.js +8 -0
- package/dist/types/webhook-endpoints.js.map +1 -0
- package/dist/types/whatsapp-templates.d.ts +59 -0
- package/dist/types/whatsapp-templates.d.ts.map +1 -0
- package/dist/types/whatsapp-templates.js +8 -0
- package/dist/types/whatsapp-templates.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/dist/webhooks.d.ts +48 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +97 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.js","sourceRoot":"","sources":["../../src/types/otp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Profile resource.
|
|
3
|
+
*
|
|
4
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
5
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
6
|
+
*/
|
|
7
|
+
/** Body of `GET /api/v1/profile/` — the authenticated user's own profile. */
|
|
8
|
+
export interface UserProfile {
|
|
9
|
+
email: string;
|
|
10
|
+
first_name: string;
|
|
11
|
+
last_name: string;
|
|
12
|
+
phone_number: string;
|
|
13
|
+
civil_id?: string | null;
|
|
14
|
+
/** Preferred language, e.g. `"en"`, `"ar"`. */
|
|
15
|
+
default_language: string;
|
|
16
|
+
/** The linked contact profile's client_id (read-only). */
|
|
17
|
+
client_id: string;
|
|
18
|
+
}
|
|
19
|
+
/** Parameters for {@link Profile.update} (`PATCH /api/v1/profile/`). */
|
|
20
|
+
export interface ProfileUpdateParams {
|
|
21
|
+
email?: string | null;
|
|
22
|
+
first_name?: string | null;
|
|
23
|
+
last_name?: string | null;
|
|
24
|
+
phone_number?: string | null;
|
|
25
|
+
civil_id?: string | null;
|
|
26
|
+
default_language?: string | null;
|
|
27
|
+
}
|
|
28
|
+
/** Parameters for {@link Profile.replace} (`PUT /api/v1/profile/`). */
|
|
29
|
+
export interface ProfileReplaceParams {
|
|
30
|
+
email: string;
|
|
31
|
+
first_name: string;
|
|
32
|
+
last_name: string;
|
|
33
|
+
phone_number: string;
|
|
34
|
+
civil_id?: string | null;
|
|
35
|
+
default_language?: string | null;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/types/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,+CAA+C;IAC/C,gBAAgB,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wEAAwE;AACxE,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/types/profile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Push resource.
|
|
3
|
+
*
|
|
4
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
5
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
6
|
+
*/
|
|
7
|
+
/** Native platform selector for {@link Push.listNotifications}. */
|
|
8
|
+
export type PushPlatform = "android" | "ios";
|
|
9
|
+
/** Parameters for {@link Push.subscribeAndroid} (`POST /api/v1/subscribe/android/`). */
|
|
10
|
+
export interface PushSubscribeAndroidParams {
|
|
11
|
+
/** Mobile application slug. */
|
|
12
|
+
slug: string;
|
|
13
|
+
/** FCM device token. */
|
|
14
|
+
token?: string | null;
|
|
15
|
+
}
|
|
16
|
+
/** Parameters for {@link Push.subscribeIos} (`POST /api/v1/subscribe/ios/`). */
|
|
17
|
+
export interface PushSubscribeIosParams {
|
|
18
|
+
/** Mobile application slug. */
|
|
19
|
+
slug: string;
|
|
20
|
+
/** APNs device token. */
|
|
21
|
+
token?: string | null;
|
|
22
|
+
/** APNs environment: `"dev"` or `"prod"`. */
|
|
23
|
+
environment?: string | null;
|
|
24
|
+
}
|
|
25
|
+
/** Parameters for {@link Push.upsertDevices} (`POST /api/v1/push/client/`). */
|
|
26
|
+
export interface PushUpsertDevicesParams {
|
|
27
|
+
/** The CRM contact the device belongs to. */
|
|
28
|
+
client_id: string;
|
|
29
|
+
/** Mobile application slug. */
|
|
30
|
+
slug: string;
|
|
31
|
+
/** `"android"`, `"ios"` or `"web"`. */
|
|
32
|
+
device_type: string;
|
|
33
|
+
/** Device token / registration id. */
|
|
34
|
+
device_id?: string | null;
|
|
35
|
+
/** `false` prunes the client's other registered devices. */
|
|
36
|
+
keep_devices?: boolean | null;
|
|
37
|
+
}
|
|
38
|
+
/** Parameters for {@link Push.markRead} (`POST /api/v1/push/read/`). */
|
|
39
|
+
export interface PushMarkReadParams {
|
|
40
|
+
/** Mobile application slug. */
|
|
41
|
+
slug: string;
|
|
42
|
+
}
|
|
43
|
+
/** Options for the deprecated {@link Push.listNotifications}. */
|
|
44
|
+
export interface PushListNotificationsOptions {
|
|
45
|
+
/**
|
|
46
|
+
* `"android"` or `"ios"` for the per-platform feed; omit (or `null`) for
|
|
47
|
+
* the combined list. Anything else throws a {@link SilonError}
|
|
48
|
+
* client-side.
|
|
49
|
+
*/
|
|
50
|
+
platform?: PushPlatform | null;
|
|
51
|
+
}
|
|
52
|
+
/** Parameters for the deprecated {@link Push.subscribeWeb} (`POST /api/v1/webpush/client/`). */
|
|
53
|
+
export interface PushSubscribeWebParams {
|
|
54
|
+
/** The CRM contact the subscription belongs to. */
|
|
55
|
+
client_id: string;
|
|
56
|
+
/** Web application (widget) slug. */
|
|
57
|
+
slug: string;
|
|
58
|
+
/** Serialized browser PushSubscription JSON. */
|
|
59
|
+
subscription_info?: string | null;
|
|
60
|
+
}
|
|
61
|
+
/** Body of `POST /api/v1/subscribe/android|ios/`. */
|
|
62
|
+
export interface SubscribeResult {
|
|
63
|
+
success: number;
|
|
64
|
+
}
|
|
65
|
+
/** Body of `POST /api/v1/push/read/`. */
|
|
66
|
+
export interface MarkReadResult {
|
|
67
|
+
affected_rows: number;
|
|
68
|
+
}
|
|
69
|
+
/** One native push notification row (legacy list endpoints). */
|
|
70
|
+
export interface PushNotification {
|
|
71
|
+
message: string;
|
|
72
|
+
subject: string;
|
|
73
|
+
/** ISO-8601 date string. */
|
|
74
|
+
date: string;
|
|
75
|
+
}
|
|
76
|
+
/** Echo body of `POST /api/v1/push/client/`. */
|
|
77
|
+
export interface PushClientDevices {
|
|
78
|
+
client_id: string;
|
|
79
|
+
slug: string;
|
|
80
|
+
device_id?: string;
|
|
81
|
+
device_type?: string;
|
|
82
|
+
keep_devices?: boolean | null;
|
|
83
|
+
}
|
|
84
|
+
/** Echo body of the legacy `POST /api/v1/webpush/client/`. */
|
|
85
|
+
export interface WebPushSubscription {
|
|
86
|
+
client_id: string;
|
|
87
|
+
slug: string;
|
|
88
|
+
subscription_info?: string;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=push.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/types/push.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,CAAC;AAE7C,wFAAwF;AACxF,MAAM,WAAW,0BAA0B;IACzC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,gFAAgF;AAChF,MAAM,WAAW,sBAAsB;IACrC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,+EAA+E;AAC/E,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAElB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IAEpB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B;AAED,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iEAAiE;AACjE,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CAChC;AAED,gGAAgG;AAChG,MAAM,WAAW,sBAAsB;IACrC,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAElB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IAEb,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/types/push.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Reports resource.
|
|
3
|
+
*
|
|
4
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
5
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Common envelope of every `POST /api/v1/reports/*` endpoint.
|
|
9
|
+
*
|
|
10
|
+
* Row columns in `report_data` vary per report (and per `report_type`), so
|
|
11
|
+
* rows stay plain objects.
|
|
12
|
+
*/
|
|
13
|
+
export interface Report {
|
|
14
|
+
report_data: Array<Record<string, unknown>>;
|
|
15
|
+
total_items: number;
|
|
16
|
+
total_pages: number;
|
|
17
|
+
page: number;
|
|
18
|
+
/** Echoed by the `report_type`-driven reports; absent/`null` elsewhere. */
|
|
19
|
+
report_type?: string | null;
|
|
20
|
+
}
|
|
21
|
+
/** Body of `GET /api/v1/reports/balance/{slug}/`. */
|
|
22
|
+
export interface ProviderBalance {
|
|
23
|
+
/**
|
|
24
|
+
* Upstream provider balance (provider-specific format; may be a number).
|
|
25
|
+
* Empty string when the account has no balance lookup.
|
|
26
|
+
*/
|
|
27
|
+
balance: string;
|
|
28
|
+
}
|
|
29
|
+
/** The date-range + search filter shared by the `users` / `bulks` reports. */
|
|
30
|
+
export interface ReportDateRangeParams {
|
|
31
|
+
/** ISO-8601 date, e.g. `"2026-06-01"`. */
|
|
32
|
+
date_from?: string | null;
|
|
33
|
+
/** ISO-8601 date, e.g. `"2026-06-30"`. */
|
|
34
|
+
date_to?: string | null;
|
|
35
|
+
/** Free-text search over the report rows. */
|
|
36
|
+
search?: string | null;
|
|
37
|
+
}
|
|
38
|
+
/** Parameters for {@link Reports.messages} (`POST /api/v1/reports/messages/`). */
|
|
39
|
+
export interface ReportMessagesParams extends ReportDateRangeParams {
|
|
40
|
+
/**
|
|
41
|
+
* `"phone"` (SMS/TTS/WhatsApp), `"email"`, `"mobile"` (push) or `"web"`
|
|
42
|
+
* (web push). Required.
|
|
43
|
+
*/
|
|
44
|
+
report_type: string;
|
|
45
|
+
/** Device filters. */
|
|
46
|
+
device?: string[] | null;
|
|
47
|
+
/** Delivery-status filters, e.g. `["sent", "read"]`. */
|
|
48
|
+
status?: string[] | null;
|
|
49
|
+
/** Template ids. */
|
|
50
|
+
template?: number[] | null;
|
|
51
|
+
/** Source filters. */
|
|
52
|
+
source?: string[] | null;
|
|
53
|
+
}
|
|
54
|
+
/** Parameters for {@link Reports.channels} (`POST /api/v1/reports/channels/`). */
|
|
55
|
+
export interface ReportChannelsParams {
|
|
56
|
+
/** ISO-8601 date, e.g. `"2026-06-01"`. */
|
|
57
|
+
date_from?: string | null;
|
|
58
|
+
/** ISO-8601 date, e.g. `"2026-06-30"`. */
|
|
59
|
+
date_to?: string | null;
|
|
60
|
+
/** Channel names to include, e.g. `["whatsapp"]`. */
|
|
61
|
+
channel_name?: string[] | null;
|
|
62
|
+
}
|
|
63
|
+
/** Parameters for {@link Reports.clients} (`POST /api/v1/reports/clients/`). */
|
|
64
|
+
export interface ReportClientsParams extends ReportDateRangeParams {
|
|
65
|
+
/** Contact language filters, e.g. `["en", "ar"]`. */
|
|
66
|
+
language?: string[] | null;
|
|
67
|
+
/** Device filters. */
|
|
68
|
+
device?: string[] | null;
|
|
69
|
+
/** Web-push subscription filter. */
|
|
70
|
+
web_subscription?: string | null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Parameters for {@link Reports.specificBulks}
|
|
74
|
+
* (`POST /api/v1/reports/specific-bulks/`).
|
|
75
|
+
*/
|
|
76
|
+
export interface ReportSpecificBulksParams extends ReportDateRangeParams {
|
|
77
|
+
/** The bulk batch id to report on. Required. */
|
|
78
|
+
bulks_file: number;
|
|
79
|
+
/** Mobile application filters. */
|
|
80
|
+
mobile_app?: string[] | null;
|
|
81
|
+
/** Web application filters. */
|
|
82
|
+
web_app?: string[] | null;
|
|
83
|
+
/** Delivery-status filters. */
|
|
84
|
+
status?: string[] | null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Parameters for {@link Reports.subscriptions}
|
|
88
|
+
* (`POST /api/v1/reports/subscriptions/`).
|
|
89
|
+
*/
|
|
90
|
+
export interface ReportSubscriptionsParams extends ReportDateRangeParams {
|
|
91
|
+
/** `"mobile"` or `"web"`. Required. */
|
|
92
|
+
report_type: string;
|
|
93
|
+
/** Mobile application filters. */
|
|
94
|
+
mobile_app?: string[] | null;
|
|
95
|
+
/** Web application filters. */
|
|
96
|
+
web_app?: string[] | null;
|
|
97
|
+
/** Device-type filters, e.g. `["android"]`. */
|
|
98
|
+
device_type?: string[] | null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Parameters for {@link Reports.awsUsage}
|
|
102
|
+
* (`POST /api/v1/reports/aws-usage-statistics/` — page is a query param;
|
|
103
|
+
* the request has no body).
|
|
104
|
+
*/
|
|
105
|
+
export interface ReportAwsUsageParams {
|
|
106
|
+
/** 1-based page number (query parameter). */
|
|
107
|
+
page?: number | null;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=reports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../../src/types/reports.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,kFAAkF;AAClF,MAAM,WAA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BAAqB;IACtE,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IAEpB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE7B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE1B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/types/reports.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Suppressions resource — the workspace do-not-contact list.
|
|
3
|
+
*
|
|
4
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
5
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
6
|
+
*/
|
|
7
|
+
/** Query parameters for {@link Suppressions.list}. */
|
|
8
|
+
export interface SuppressionListParams {
|
|
9
|
+
/**
|
|
10
|
+
* Filter to one address. Normalized before matching, so any formatting of
|
|
11
|
+
* the same phone number / email finds its stored compact row.
|
|
12
|
+
*/
|
|
13
|
+
address?: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Filter to suppressions scoped to one channel (e.g. `"sms"`). All-channel
|
|
16
|
+
* rows (`channel: null`) are NOT matched by this filter.
|
|
17
|
+
*/
|
|
18
|
+
channel?: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Filter by reason: `"manual"`, `"unsubscribe"`, `"hard_bounce"` or
|
|
21
|
+
* `"stop"`.
|
|
22
|
+
*/
|
|
23
|
+
reason?: string | null;
|
|
24
|
+
/** Opaque pagination cursor from a previous page. */
|
|
25
|
+
cursor?: string | null;
|
|
26
|
+
/** Page size (default 50, max 100). */
|
|
27
|
+
limit?: number | null;
|
|
28
|
+
}
|
|
29
|
+
/** Parameters for {@link Suppressions.create} (`POST /api/v1/suppressions/`). */
|
|
30
|
+
export interface SuppressionCreateParams {
|
|
31
|
+
/**
|
|
32
|
+
* The address to stop contacting: an E.164 phone number or an email.
|
|
33
|
+
* Stored normalized (compact E.164 / lowercase), so any formatting of the
|
|
34
|
+
* same address matches at enforcement time. Required.
|
|
35
|
+
*/
|
|
36
|
+
address: string;
|
|
37
|
+
/**
|
|
38
|
+
* Restrict the suppression to one channel (e.g. `"sms"`). Omit (or pass
|
|
39
|
+
* `null`) to suppress the address across ALL channels.
|
|
40
|
+
*/
|
|
41
|
+
channel?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Why the address is suppressed: `"manual"` (default), `"unsubscribe"`,
|
|
44
|
+
* `"hard_bounce"` or `"stop"`.
|
|
45
|
+
*/
|
|
46
|
+
reason?: string | null;
|
|
47
|
+
}
|
|
48
|
+
/** One do-not-contact row, as returned by the Suppressions API. */
|
|
49
|
+
export interface Suppression {
|
|
50
|
+
/** Opaque suppression id, `sup_` prefixed. */
|
|
51
|
+
id: string;
|
|
52
|
+
/** Always `"suppression"`. */
|
|
53
|
+
object: string;
|
|
54
|
+
/** The suppressed address, normalized (compact E.164 / lowercase email). */
|
|
55
|
+
address: string;
|
|
56
|
+
/**
|
|
57
|
+
* The channel the suppression is scoped to, or `null` when it applies to
|
|
58
|
+
* every channel.
|
|
59
|
+
*/
|
|
60
|
+
channel: string | null;
|
|
61
|
+
/** `"manual"`, `"unsubscribe"`, `"hard_bounce"` or `"stop"`. */
|
|
62
|
+
reason: string;
|
|
63
|
+
/**
|
|
64
|
+
* `false` when the row lives in test mode (created and enforced by
|
|
65
|
+
* `sk_test_` keys only); `true` for live rows. Suppressions are
|
|
66
|
+
* mode-scoped end to end.
|
|
67
|
+
*/
|
|
68
|
+
livemode?: boolean;
|
|
69
|
+
/** ISO-8601 date-time string. */
|
|
70
|
+
created?: string | null;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=suppressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppressions.d.ts","sourceRoot":"","sources":["../../src/types/suppressions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,iFAAiF;AACjF,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Suppressions resource — the workspace do-not-contact list.
|
|
3
|
+
*
|
|
4
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
5
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=suppressions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppressions.js","sourceRoot":"","sources":["../../src/types/suppressions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Templates resource — slug-keyed message templates with an
|
|
3
|
+
* immutable version spine.
|
|
4
|
+
*
|
|
5
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
6
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A template list row (`GET /api/v1/templates/`).
|
|
10
|
+
*
|
|
11
|
+
* The content fields (`body`, `body_md`) and the full `versions` list appear
|
|
12
|
+
* only on the detail shape ({@link TemplateDetail}).
|
|
13
|
+
*/
|
|
14
|
+
export interface TemplateRow {
|
|
15
|
+
/** Unique slug — the value sends reference via `template: {slug}`. */
|
|
16
|
+
slug: string;
|
|
17
|
+
/** Always `"template"`. */
|
|
18
|
+
object: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional channel hint (metadata only — never restricts rendering), or
|
|
21
|
+
* `null` when unset.
|
|
22
|
+
*/
|
|
23
|
+
channel: string | null;
|
|
24
|
+
/** Optional subject line. */
|
|
25
|
+
subject?: string;
|
|
26
|
+
/** Latest version number (immutable ints starting at 1). */
|
|
27
|
+
version: number;
|
|
28
|
+
/** ISO-8601 date-time string. */
|
|
29
|
+
created?: string | null;
|
|
30
|
+
/** ISO-8601 date-time string. */
|
|
31
|
+
updated?: string | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A template detail (`GET/POST/PATCH /api/v1/templates/{slug}/`) — a
|
|
35
|
+
* {@link TemplateRow} plus the content fields and the full version history.
|
|
36
|
+
*/
|
|
37
|
+
export interface TemplateDetail extends TemplateRow {
|
|
38
|
+
/** Rendered HTML body. */
|
|
39
|
+
body?: string;
|
|
40
|
+
/** Markdown source body. */
|
|
41
|
+
body_md?: string;
|
|
42
|
+
/**
|
|
43
|
+
* All available version numbers, ascending. Pin one on a send via
|
|
44
|
+
* `template: {slug, version: N}`.
|
|
45
|
+
*/
|
|
46
|
+
versions: number[];
|
|
47
|
+
}
|
|
48
|
+
/** Query filters for {@link Templates.list}. */
|
|
49
|
+
export interface TemplateListParams {
|
|
50
|
+
/** Filter by the channel hint, e.g. `"email"`. */
|
|
51
|
+
channel?: string | null;
|
|
52
|
+
/** Slug-prefix search. */
|
|
53
|
+
q?: string | null;
|
|
54
|
+
/** Opaque pagination cursor from a previous page. */
|
|
55
|
+
cursor?: string | null;
|
|
56
|
+
/** Page size. */
|
|
57
|
+
limit?: number | null;
|
|
58
|
+
}
|
|
59
|
+
/** Parameters for {@link Templates.create} (`POST /api/v1/templates/`). */
|
|
60
|
+
export interface TemplateCreateParams {
|
|
61
|
+
/**
|
|
62
|
+
* Unique slug — lowercase letters, digits, hyphens and underscores.
|
|
63
|
+
* Required. A duplicate (including an archived) slug rejects
|
|
64
|
+
* `409 template-exists`.
|
|
65
|
+
*/
|
|
66
|
+
slug: string;
|
|
67
|
+
/**
|
|
68
|
+
* Optional channel hint (metadata only — never restricts rendering); omit
|
|
69
|
+
* or pass `null` to leave it unset.
|
|
70
|
+
*/
|
|
71
|
+
channel?: string | null;
|
|
72
|
+
/** Optional subject line. */
|
|
73
|
+
subject?: string | null;
|
|
74
|
+
/** Rendered HTML body. */
|
|
75
|
+
body?: string | null;
|
|
76
|
+
/** Markdown source body. */
|
|
77
|
+
body_md?: string | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Parameters for {@link Templates.update} (`PATCH /api/v1/templates/{slug}/`).
|
|
81
|
+
*
|
|
82
|
+
* Pass at least one field. Changing any CONTENT field (`subject`, `body`,
|
|
83
|
+
* `body_md`) mints a new immutable version; `channel` is metadata and never
|
|
84
|
+
* bumps the version; a no-op content PATCH mints nothing.
|
|
85
|
+
*/
|
|
86
|
+
export interface TemplateUpdateParams {
|
|
87
|
+
/** New channel hint (metadata only — does not bump the version). */
|
|
88
|
+
channel?: string | null;
|
|
89
|
+
/** New subject line (content — bumps the version when it changes). */
|
|
90
|
+
subject?: string | null;
|
|
91
|
+
/** New HTML body (content — bumps the version when it changes). */
|
|
92
|
+
body?: string | null;
|
|
93
|
+
/** New markdown body (content — bumps the version when it changes). */
|
|
94
|
+
body_md?: string | null;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/types/templates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0BAA0B;IAC1B,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Templates resource — slug-keyed message templates with an
|
|
3
|
+
* immutable version spine.
|
|
4
|
+
*
|
|
5
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
6
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/types/templates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the WebhookEndpoints resource.
|
|
3
|
+
*
|
|
4
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
5
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* A webhook endpoint as returned by the API.
|
|
9
|
+
*
|
|
10
|
+
* The signing `secret` is never present here — it is revealed once, in the
|
|
11
|
+
* create response ({@link WebhookEndpointWithSecret}).
|
|
12
|
+
*/
|
|
13
|
+
export interface WebhookEndpoint {
|
|
14
|
+
/** Opaque endpoint id, `we_` prefixed. */
|
|
15
|
+
id: string;
|
|
16
|
+
object?: string;
|
|
17
|
+
url: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Event types delivered to this endpoint, or `["*"]` for all. */
|
|
20
|
+
enabled_events?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* `true`: receives events from live sends; `false`: receives events from
|
|
23
|
+
* test-mode (`sk_test_`) sends. Fixed at create time.
|
|
24
|
+
*/
|
|
25
|
+
livemode?: boolean;
|
|
26
|
+
/** `"enabled"` or `"disabled"`. */
|
|
27
|
+
status?: string;
|
|
28
|
+
/** ISO-8601 date-time string. */
|
|
29
|
+
created_at?: string | null;
|
|
30
|
+
}
|
|
31
|
+
/** Create response — includes the one-time signing `secret`. */
|
|
32
|
+
export interface WebhookEndpointWithSecret extends WebhookEndpoint {
|
|
33
|
+
/**
|
|
34
|
+
* Signing secret (`whsec_` prefix). Shown **once**, only here. Use it to
|
|
35
|
+
* verify the `Silon-Signature` header on every delivery.
|
|
36
|
+
*/
|
|
37
|
+
secret: string;
|
|
38
|
+
}
|
|
39
|
+
/** Parameters for {@link WebhookEndpoints.create}. */
|
|
40
|
+
export interface WebhookEndpointCreateParams {
|
|
41
|
+
/** HTTPS URL event payloads are POSTed to. Required. */
|
|
42
|
+
url: string;
|
|
43
|
+
/** Free-form label for the endpoint. */
|
|
44
|
+
description?: string | null;
|
|
45
|
+
/** Event types to deliver; defaults server-side to `["*"]` (everything). */
|
|
46
|
+
enabled_events?: string[] | null;
|
|
47
|
+
/**
|
|
48
|
+
* Mode routing, fixed at create time. `true` (the server-side default)
|
|
49
|
+
* receives events from live sends only; `false` receives events from
|
|
50
|
+
* test-mode (`sk_test_`) sends only. Register one endpoint per mode to
|
|
51
|
+
* consume both streams.
|
|
52
|
+
*/
|
|
53
|
+
livemode?: boolean | null;
|
|
54
|
+
}
|
|
55
|
+
/** Parameters for {@link WebhookEndpoints.update} (PATCH — partial). */
|
|
56
|
+
export interface WebhookEndpointUpdateParams {
|
|
57
|
+
url?: string | null;
|
|
58
|
+
description?: string | null;
|
|
59
|
+
enabled_events?: string[] | null;
|
|
60
|
+
/** Set to `"disabled"` to pause deliveries, `"enabled"` to resume. */
|
|
61
|
+
status?: string | null;
|
|
62
|
+
}
|
|
63
|
+
/** Query parameters for {@link WebhookEndpoints.list}. */
|
|
64
|
+
export interface WebhookEndpointListParams {
|
|
65
|
+
/** Opaque pagination cursor from a previous page. */
|
|
66
|
+
cursor?: string | null;
|
|
67
|
+
/** Page size. */
|
|
68
|
+
limit?: number | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Result of {@link WebhookEndpoints.test} — the outcome of a single
|
|
72
|
+
* synchronous `ping` delivery.
|
|
73
|
+
*
|
|
74
|
+
* A failing sink is NOT an HTTP error: `delivered` is `false` with the reason
|
|
75
|
+
* in `error`, the call still resolves `200`.
|
|
76
|
+
*/
|
|
77
|
+
export interface WebhookEndpointTestResult {
|
|
78
|
+
/** `true` when the endpoint answered 2xx. */
|
|
79
|
+
delivered: boolean;
|
|
80
|
+
/** The endpoint's HTTP status, or `null` when the request never completed. */
|
|
81
|
+
response_status: number | null;
|
|
82
|
+
/** Round-trip time in milliseconds. */
|
|
83
|
+
latency_ms: number;
|
|
84
|
+
/** Failure reason when `delivered` is `false`, else `null`. */
|
|
85
|
+
error: string | null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* One recorded delivery attempt for an endpoint
|
|
89
|
+
* (`GET /api/v1/webhook_endpoints/{id}/attempts`). Test pings are never
|
|
90
|
+
* persisted and never appear here.
|
|
91
|
+
*/
|
|
92
|
+
export interface WebhookAttempt {
|
|
93
|
+
/** Opaque attempt id, `wha_` prefixed. */
|
|
94
|
+
id: string;
|
|
95
|
+
/** Always `"webhook_attempt"`. */
|
|
96
|
+
object: string;
|
|
97
|
+
/** The delivered event's id. */
|
|
98
|
+
event_id: string;
|
|
99
|
+
/** The delivered event's type, e.g. `"message.failed"`. */
|
|
100
|
+
event_type: string;
|
|
101
|
+
/** How many times delivery has been attempted so far. */
|
|
102
|
+
attempts: number;
|
|
103
|
+
/** The endpoint's last HTTP status, or `null` when it never responded. */
|
|
104
|
+
response_status: number | null;
|
|
105
|
+
/** `true` once a delivery attempt succeeded (2xx). */
|
|
106
|
+
ok: boolean;
|
|
107
|
+
/** The last failure reason, or `null`. */
|
|
108
|
+
error: string | null;
|
|
109
|
+
/** ISO-8601 date-time of the most recent attempt, or `null`. */
|
|
110
|
+
last_attempt_at?: string | null;
|
|
111
|
+
/** ISO-8601 date-time of the next scheduled retry, or `null` when done. */
|
|
112
|
+
next_attempt_at?: string | null;
|
|
113
|
+
/** ISO-8601 date-time string. */
|
|
114
|
+
created?: string | null;
|
|
115
|
+
}
|
|
116
|
+
/** Query parameters for {@link WebhookEndpoints.listAttempts}. */
|
|
117
|
+
export interface WebhookEndpointAttemptsParams {
|
|
118
|
+
/** Opaque pagination cursor from a previous page. */
|
|
119
|
+
cursor?: string | null;
|
|
120
|
+
/** Page size. */
|
|
121
|
+
limit?: number | null;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=webhook-endpoints.d.ts.map
|
|
@@ -0,0 +1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Types for the WebhookEndpoints resource.
|
|
3
|
+
*
|
|
4
|
+
* Field names mirror the wire format exactly (snake_case) and date-times are
|
|
5
|
+
* ISO-8601 strings — this SDK performs no casing or date transformation.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=webhook-endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-endpoints.js","sourceRoot":"","sources":["../../src/types/webhook-endpoints.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|