@trycourier/courier 7.8.0 → 7.9.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/CHANGELOG.md +24 -0
- package/client.d.mts +16 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +35 -0
- package/resources/notifications/checks.d.mts.map +1 -1
- package/resources/notifications/checks.d.ts +35 -0
- package/resources/notifications/checks.d.ts.map +1 -1
- package/resources/notifications/checks.js +35 -0
- package/resources/notifications/checks.js.map +1 -1
- package/resources/notifications/checks.mjs +35 -0
- package/resources/notifications/checks.mjs.map +1 -1
- package/resources/notifications/draft.d.mts +7 -0
- package/resources/notifications/draft.d.mts.map +1 -1
- package/resources/notifications/draft.d.ts +7 -0
- package/resources/notifications/draft.d.ts.map +1 -1
- package/resources/notifications/draft.js +7 -0
- package/resources/notifications/draft.js.map +1 -1
- package/resources/notifications/draft.mjs +7 -0
- package/resources/notifications/draft.mjs.map +1 -1
- package/resources/notifications/index.d.mts +1 -1
- package/resources/notifications/index.d.mts.map +1 -1
- package/resources/notifications/index.d.ts +1 -1
- package/resources/notifications/index.d.ts.map +1 -1
- package/resources/notifications/index.js.map +1 -1
- package/resources/notifications/index.mjs.map +1 -1
- package/resources/notifications/notifications.d.mts +369 -6
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +369 -6
- package/resources/notifications/notifications.d.ts.map +1 -1
- package/resources/notifications/notifications.js +122 -0
- package/resources/notifications/notifications.js.map +1 -1
- package/resources/notifications/notifications.mjs +122 -0
- package/resources/notifications/notifications.mjs.map +1 -1
- package/resources/providers/catalog.d.mts +40 -0
- package/resources/providers/catalog.d.mts.map +1 -0
- package/resources/providers/catalog.d.ts +40 -0
- package/resources/providers/catalog.d.ts.map +1 -0
- package/resources/providers/catalog.js +18 -0
- package/resources/providers/catalog.js.map +1 -0
- package/resources/providers/catalog.mjs +14 -0
- package/resources/providers/catalog.mjs.map +1 -0
- package/resources/providers/index.d.mts +3 -0
- package/resources/providers/index.d.mts.map +1 -0
- package/resources/providers/index.d.ts +3 -0
- package/resources/providers/index.d.ts.map +1 -0
- package/resources/providers/index.js +9 -0
- package/resources/providers/index.js.map +1 -0
- package/resources/providers/index.mjs +4 -0
- package/resources/providers/index.mjs.map +1 -0
- package/resources/providers/providers.d.mts +182 -0
- package/resources/providers/providers.d.mts.map +1 -0
- package/resources/providers/providers.d.ts +182 -0
- package/resources/providers/providers.d.ts.map +1 -0
- package/resources/providers/providers.js +57 -0
- package/resources/providers/providers.js.map +1 -0
- package/resources/providers/providers.mjs +52 -0
- package/resources/providers/providers.mjs.map +1 -0
- package/resources/providers.d.mts +2 -0
- package/resources/providers.d.mts.map +1 -0
- package/resources/providers.d.ts +2 -0
- package/resources/providers.d.ts.map +1 -0
- package/resources/providers.js +6 -0
- package/resources/providers.js.map +1 -0
- package/resources/providers.mjs +3 -0
- package/resources/providers.mjs.map +1 -0
- package/resources/routing-strategies.d.mts +304 -0
- package/resources/routing-strategies.d.mts.map +1 -0
- package/resources/routing-strategies.d.ts +304 -0
- package/resources/routing-strategies.d.ts.map +1 -0
- package/resources/routing-strategies.js +94 -0
- package/resources/routing-strategies.js.map +1 -0
- package/resources/routing-strategies.mjs +90 -0
- package/resources/routing-strategies.mjs.map +1 -0
- package/resources/send.d.mts +2 -60
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +2 -60
- package/resources/send.d.ts.map +1 -1
- package/resources/shared.d.mts +60 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +60 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/tenants/tenants.d.mts +2 -62
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +2 -62
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs.map +1 -1
- package/src/client.ts +84 -0
- package/src/resources/index.ts +35 -0
- package/src/resources/notifications/checks.ts +35 -0
- package/src/resources/notifications/draft.ts +7 -0
- package/src/resources/notifications/index.ts +14 -0
- package/src/resources/notifications/notifications.ts +474 -5
- package/src/resources/providers/catalog.ts +53 -0
- package/src/resources/providers/index.ts +12 -0
- package/src/resources/providers/providers.ts +240 -0
- package/src/resources/providers.ts +3 -0
- package/src/resources/routing-strategies.ts +394 -0
- package/src/resources/send.ts +2 -67
- package/src/resources/shared.ts +71 -1
- package/src/resources/tenants/tenants.ts +2 -69
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -4,6 +4,7 @@ import * as ChecksAPI from "./checks.mjs";
|
|
|
4
4
|
import { Checks, } from "./checks.mjs";
|
|
5
5
|
import * as DraftAPI from "./draft.mjs";
|
|
6
6
|
import { Draft } from "./draft.mjs";
|
|
7
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
7
8
|
import { path } from "../../internal/utils/path.mjs";
|
|
8
9
|
export class Notifications extends APIResource {
|
|
9
10
|
constructor() {
|
|
@@ -11,9 +12,130 @@ export class Notifications extends APIResource {
|
|
|
11
12
|
this.draft = new DraftAPI.Draft(this._client);
|
|
12
13
|
this.checks = new ChecksAPI.Checks(this._client);
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Create a notification template. Requires all fields in the notification object.
|
|
17
|
+
* Templates are created in draft state by default.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const notificationTemplateMutationResponse =
|
|
22
|
+
* await client.notifications.create({
|
|
23
|
+
* notification: {
|
|
24
|
+
* name: 'Welcome Email',
|
|
25
|
+
* tags: ['onboarding', 'welcome'],
|
|
26
|
+
* brand: { id: 'brand_abc' },
|
|
27
|
+
* subscription: { topic_id: 'marketing' },
|
|
28
|
+
* routing: { strategy_id: 'rs_123' },
|
|
29
|
+
* content: {
|
|
30
|
+
* version: '2022-01-01',
|
|
31
|
+
* elements: [{ type: 'channel' }],
|
|
32
|
+
* },
|
|
33
|
+
* },
|
|
34
|
+
* state: 'DRAFT',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
create(body, options) {
|
|
39
|
+
return this._client.post('/notifications', { body, ...options });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Retrieve a notification template by ID. Returns the published version by
|
|
43
|
+
* default. Pass version=draft to retrieve an unpublished template.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const notificationTemplateGetResponse =
|
|
48
|
+
* await client.notifications.retrieve('id');
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
retrieve(id, query = {}, options) {
|
|
52
|
+
return this._client.get(path `/notifications/${id}`, { query, ...options });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* List notification templates in your workspace.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const notifications = await client.notifications.list();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
14
62
|
list(query = {}, options) {
|
|
15
63
|
return this._client.get('/notifications', { query, ...options });
|
|
16
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Archive a notification template.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* await client.notifications.archive('id');
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
archive(id, options) {
|
|
74
|
+
return this._client.delete(path `/notifications/${id}`, {
|
|
75
|
+
...options,
|
|
76
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* List versions of a notification template.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const notificationTemplateVersionListResponse =
|
|
85
|
+
* await client.notifications.listVersions('id');
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
listVersions(id, query = {}, options) {
|
|
89
|
+
return this._client.get(path `/notifications/${id}/versions`, { query, ...options });
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Publish a notification template. Publishes the current draft by default. Pass a
|
|
93
|
+
* version in the request body to publish a specific historical version.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* await client.notifications.publish('id');
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
publish(id, body = {}, options) {
|
|
101
|
+
return this._client.post(path `/notifications/${id}/publish`, {
|
|
102
|
+
body,
|
|
103
|
+
...options,
|
|
104
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Replace a notification template. All fields are required.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const notificationTemplateMutationResponse =
|
|
113
|
+
* await client.notifications.replace('id', {
|
|
114
|
+
* notification: {
|
|
115
|
+
* name: 'Updated Name',
|
|
116
|
+
* tags: ['updated'],
|
|
117
|
+
* brand: null,
|
|
118
|
+
* subscription: null,
|
|
119
|
+
* routing: null,
|
|
120
|
+
* content: {
|
|
121
|
+
* version: '2022-01-01',
|
|
122
|
+
* elements: [{ type: 'channel' }],
|
|
123
|
+
* },
|
|
124
|
+
* },
|
|
125
|
+
* state: 'PUBLISHED',
|
|
126
|
+
* });
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
replace(id, body, options) {
|
|
130
|
+
return this._client.put(path `/notifications/${id}`, { body, ...options });
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* const notificationGetContent =
|
|
136
|
+
* await client.notifications.retrieveContent('id');
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
17
139
|
retrieveContent(id, options) {
|
|
18
140
|
return this._client.get(path `/notifications/${id}/content`, options);
|
|
19
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.mjs","sourceRoot":"","sources":["../../src/resources/notifications/notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"notifications.mjs","sourceRoot":"","sources":["../../src/resources/notifications/notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,SAAS;OACd,EAML,MAAM,GACP;OACM,KAAK,QAAQ;OACb,EAAE,KAAK,EAAE;OAET,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8JhE,CAAC;IA5JC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CACN,EAAU,EACV,QAAuD,E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,EAAU,EACV,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CAAC,EAAU,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACF;AAybD,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as Shared from "../shared.mjs";
|
|
3
|
+
import * as ProvidersAPI from "./providers.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
6
|
+
export declare class Catalog extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the catalog of available provider types with their display names,
|
|
9
|
+
* descriptions, and configuration schema fields (snake_case, with `type` and
|
|
10
|
+
* `required`). Providers with no configurable schema return only `provider`,
|
|
11
|
+
* `name`, and `description`.
|
|
12
|
+
*/
|
|
13
|
+
list(query?: CatalogListParams | null | undefined, options?: RequestOptions): APIPromise<CatalogListResponse>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Paginated list of available provider types with their configuration schemas.
|
|
17
|
+
*/
|
|
18
|
+
export interface CatalogListResponse {
|
|
19
|
+
paging: Shared.Paging;
|
|
20
|
+
results: Array<ProvidersAPI.ProvidersCatalogEntry>;
|
|
21
|
+
}
|
|
22
|
+
export interface CatalogListParams {
|
|
23
|
+
/**
|
|
24
|
+
* Exact match (case-insensitive) against the provider channel taxonomy (e.g.
|
|
25
|
+
* `email`, `sms`, `push`).
|
|
26
|
+
*/
|
|
27
|
+
channel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Comma-separated provider keys to filter by (e.g. `sendgrid,twilio`).
|
|
30
|
+
*/
|
|
31
|
+
keys?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Case-insensitive substring match against the provider display name.
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare namespace Catalog {
|
|
38
|
+
export { type CatalogListResponse as CatalogListResponse, type CatalogListParams as CatalogListParams };
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=catalog.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.mts","sourceRoot":"","sources":["../../src/resources/providers/catalog.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,KAAK,YAAY;OACjB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;OAKG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;CAGnC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAEtB,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACzG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as Shared from "../shared.js";
|
|
3
|
+
import * as ProvidersAPI from "./providers.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
+
export declare class Catalog extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the catalog of available provider types with their display names,
|
|
9
|
+
* descriptions, and configuration schema fields (snake_case, with `type` and
|
|
10
|
+
* `required`). Providers with no configurable schema return only `provider`,
|
|
11
|
+
* `name`, and `description`.
|
|
12
|
+
*/
|
|
13
|
+
list(query?: CatalogListParams | null | undefined, options?: RequestOptions): APIPromise<CatalogListResponse>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Paginated list of available provider types with their configuration schemas.
|
|
17
|
+
*/
|
|
18
|
+
export interface CatalogListResponse {
|
|
19
|
+
paging: Shared.Paging;
|
|
20
|
+
results: Array<ProvidersAPI.ProvidersCatalogEntry>;
|
|
21
|
+
}
|
|
22
|
+
export interface CatalogListParams {
|
|
23
|
+
/**
|
|
24
|
+
* Exact match (case-insensitive) against the provider channel taxonomy (e.g.
|
|
25
|
+
* `email`, `sms`, `push`).
|
|
26
|
+
*/
|
|
27
|
+
channel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Comma-separated provider keys to filter by (e.g. `sendgrid,twilio`).
|
|
30
|
+
*/
|
|
31
|
+
keys?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Case-insensitive substring match against the provider display name.
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare namespace Catalog {
|
|
38
|
+
export { type CatalogListResponse as CatalogListResponse, type CatalogListParams as CatalogListParams };
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/resources/providers/catalog.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,KAAK,YAAY;OACjB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;OAKG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;CAGnC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAEtB,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACzG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Catalog = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
class Catalog extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the catalog of available provider types with their display names,
|
|
9
|
+
* descriptions, and configuration schema fields (snake_case, with `type` and
|
|
10
|
+
* `required`). Providers with no configurable schema return only `provider`,
|
|
11
|
+
* `name`, and `description`.
|
|
12
|
+
*/
|
|
13
|
+
list(query = {}, options) {
|
|
14
|
+
return this._client.get('/providers/catalog', { query, ...options });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.Catalog = Catalog;
|
|
18
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/resources/providers/catalog.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;OAKG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAbD,0BAaC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
export class Catalog extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Returns the catalog of available provider types with their display names,
|
|
6
|
+
* descriptions, and configuration schema fields (snake_case, with `type` and
|
|
7
|
+
* `required`). Providers with no configurable schema return only `provider`,
|
|
8
|
+
* `name`, and `description`.
|
|
9
|
+
*/
|
|
10
|
+
list(query = {}, options) {
|
|
11
|
+
return this._client.get('/providers/catalog', { query, ...options });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=catalog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.mjs","sourceRoot":"","sources":["../../src/resources/providers/catalog.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAMtB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;OAKG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Catalog, type CatalogListResponse, type CatalogListParams } from "./catalog.mjs";
|
|
2
|
+
export { Providers, type Provider, type ProvidersCatalogEntry, type ProviderListResponse, type ProviderCreateParams, type ProviderUpdateParams, type ProviderListParams, } from "./providers.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/providers/index.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE;OAC7D,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Catalog, type CatalogListResponse, type CatalogListParams } from "./catalog.js";
|
|
2
|
+
export { Providers, type Provider, type ProvidersCatalogEntry, type ProviderListResponse, type ProviderCreateParams, type ProviderUpdateParams, type ProviderListParams, } from "./providers.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/providers/index.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE;OAC7D,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Providers = exports.Catalog = void 0;
|
|
5
|
+
var catalog_1 = require("./catalog.js");
|
|
6
|
+
Object.defineProperty(exports, "Catalog", { enumerable: true, get: function () { return catalog_1.Catalog; } });
|
|
7
|
+
var providers_1 = require("./providers.js");
|
|
8
|
+
Object.defineProperty(exports, "Providers", { enumerable: true, get: function () { return providers_1.Providers; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/providers/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAAsF;AAA7E,kGAAA,OAAO,OAAA;AAChB,4CAQqB;AAPnB,sGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/providers/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,OAAO,EAAoD;OAC7D,EACL,SAAS,GAOV"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as Shared from "../shared.mjs";
|
|
3
|
+
import * as CatalogAPI from "./catalog.mjs";
|
|
4
|
+
import { Catalog, CatalogListParams, CatalogListResponse } from "./catalog.mjs";
|
|
5
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
|
+
export declare class Providers extends APIResource {
|
|
8
|
+
catalog: CatalogAPI.Catalog;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new provider configuration. The `provider` field must be a known
|
|
11
|
+
* Courier provider key (see catalog).
|
|
12
|
+
*/
|
|
13
|
+
create(body: ProviderCreateParams, options?: RequestOptions): APIPromise<Provider>;
|
|
14
|
+
/**
|
|
15
|
+
* Fetch a single provider configuration by ID.
|
|
16
|
+
*/
|
|
17
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Provider>;
|
|
18
|
+
/**
|
|
19
|
+
* Update an existing provider configuration. The `provider` key is required. All
|
|
20
|
+
* other fields are optional — omitted fields are cleared from the stored
|
|
21
|
+
* configuration (this is a full replacement, not a partial merge).
|
|
22
|
+
*/
|
|
23
|
+
update(id: string, body: ProviderUpdateParams, options?: RequestOptions): APIPromise<Provider>;
|
|
24
|
+
/**
|
|
25
|
+
* List configured provider integrations for the current workspace. Supports
|
|
26
|
+
* cursor-based pagination.
|
|
27
|
+
*/
|
|
28
|
+
list(query?: ProviderListParams | null | undefined, options?: RequestOptions): APIPromise<ProviderListResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Delete a provider configuration. Returns 409 if the provider is still referenced
|
|
31
|
+
* by routing or notifications.
|
|
32
|
+
*/
|
|
33
|
+
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A configured provider in the workspace.
|
|
37
|
+
*/
|
|
38
|
+
export interface Provider {
|
|
39
|
+
/**
|
|
40
|
+
* A unique identifier for the provider configuration.
|
|
41
|
+
*/
|
|
42
|
+
id: string;
|
|
43
|
+
/**
|
|
44
|
+
* Unix timestamp (ms) of when the provider was created.
|
|
45
|
+
*/
|
|
46
|
+
created: number;
|
|
47
|
+
/**
|
|
48
|
+
* The provider key (e.g. "sendgrid", "twilio", "slack").
|
|
49
|
+
*/
|
|
50
|
+
provider: string;
|
|
51
|
+
/**
|
|
52
|
+
* Provider-specific settings (snake_case keys on the wire).
|
|
53
|
+
*/
|
|
54
|
+
settings: {
|
|
55
|
+
[key: string]: unknown;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Display title. Defaults to "Default Configuration" when not explicitly set.
|
|
59
|
+
*/
|
|
60
|
+
title: string;
|
|
61
|
+
/**
|
|
62
|
+
* Optional alias for this configuration.
|
|
63
|
+
*/
|
|
64
|
+
alias?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Unix timestamp (ms) of when the provider was last updated.
|
|
67
|
+
*/
|
|
68
|
+
updated?: number | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A provider type from the catalog. Contains the key, display name, description,
|
|
72
|
+
* and a `settings` object describing configuration schema fields.
|
|
73
|
+
*/
|
|
74
|
+
export interface ProvidersCatalogEntry {
|
|
75
|
+
/**
|
|
76
|
+
* Courier taxonomy channel (e.g. email, push, sms, direct_message, inbox,
|
|
77
|
+
* webhook).
|
|
78
|
+
*/
|
|
79
|
+
channel: string;
|
|
80
|
+
/**
|
|
81
|
+
* Short description of the provider.
|
|
82
|
+
*/
|
|
83
|
+
description: string;
|
|
84
|
+
/**
|
|
85
|
+
* Human-readable display name.
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
/**
|
|
89
|
+
* The provider key (e.g. "sendgrid", "twilio").
|
|
90
|
+
*/
|
|
91
|
+
provider: string;
|
|
92
|
+
/**
|
|
93
|
+
* Map of setting field names (snake_case) to their schema descriptors. Each
|
|
94
|
+
* descriptor has `type` and `required`. Empty when the provider has no
|
|
95
|
+
* configurable schema.
|
|
96
|
+
*/
|
|
97
|
+
settings: {
|
|
98
|
+
[key: string]: ProvidersCatalogEntry.Settings;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export declare namespace ProvidersCatalogEntry {
|
|
102
|
+
/**
|
|
103
|
+
* Describes a single configuration field in the provider catalog.
|
|
104
|
+
*/
|
|
105
|
+
interface Settings {
|
|
106
|
+
/**
|
|
107
|
+
* Whether this field is required when configuring the provider.
|
|
108
|
+
*/
|
|
109
|
+
required: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The field's data type (e.g. "string", "boolean", "enum").
|
|
112
|
+
*/
|
|
113
|
+
type: string;
|
|
114
|
+
/**
|
|
115
|
+
* Allowed values when `type` is "enum".
|
|
116
|
+
*/
|
|
117
|
+
values?: Array<string>;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Paginated list of provider configurations.
|
|
122
|
+
*/
|
|
123
|
+
export interface ProviderListResponse {
|
|
124
|
+
paging: Shared.Paging;
|
|
125
|
+
results: Array<Provider>;
|
|
126
|
+
}
|
|
127
|
+
export interface ProviderCreateParams {
|
|
128
|
+
/**
|
|
129
|
+
* The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a
|
|
130
|
+
* known Courier provider — see the catalog endpoint for valid keys.
|
|
131
|
+
*/
|
|
132
|
+
provider: string;
|
|
133
|
+
/**
|
|
134
|
+
* Optional alias for this configuration.
|
|
135
|
+
*/
|
|
136
|
+
alias?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Provider-specific settings (snake_case keys). Defaults to an empty object when
|
|
139
|
+
* omitted. Use the catalog endpoint to discover required fields for a given
|
|
140
|
+
* provider — omitting a required field returns a 400 validation error.
|
|
141
|
+
*/
|
|
142
|
+
settings?: {
|
|
143
|
+
[key: string]: unknown;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Optional display title. Omit to use "Default Configuration".
|
|
147
|
+
*/
|
|
148
|
+
title?: string;
|
|
149
|
+
}
|
|
150
|
+
export interface ProviderUpdateParams {
|
|
151
|
+
/**
|
|
152
|
+
* The provider key identifying the type.
|
|
153
|
+
*/
|
|
154
|
+
provider: string;
|
|
155
|
+
/**
|
|
156
|
+
* Updated alias. Omit to clear.
|
|
157
|
+
*/
|
|
158
|
+
alias?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Provider-specific settings (snake_case keys). Replaces the full settings object
|
|
161
|
+
* — omitted settings fields are removed. Use the catalog endpoint to check
|
|
162
|
+
* required fields.
|
|
163
|
+
*/
|
|
164
|
+
settings?: {
|
|
165
|
+
[key: string]: unknown;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Updated display title.
|
|
169
|
+
*/
|
|
170
|
+
title?: string;
|
|
171
|
+
}
|
|
172
|
+
export interface ProviderListParams {
|
|
173
|
+
/**
|
|
174
|
+
* Opaque cursor for fetching the next page.
|
|
175
|
+
*/
|
|
176
|
+
cursor?: string;
|
|
177
|
+
}
|
|
178
|
+
export declare namespace Providers {
|
|
179
|
+
export { type Provider as Provider, type ProvidersCatalogEntry as ProvidersCatalogEntry, type ProviderListResponse as ProviderListResponse, type ProviderCreateParams as ProviderCreateParams, type ProviderUpdateParams as ProviderUpdateParams, type ProviderListParams as ProviderListParams, };
|
|
180
|
+
export { Catalog as Catalog, type CatalogListResponse as CatalogListResponse, type CatalogListParams as CatalogListParams, };
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=providers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.mts","sourceRoot":"","sources":["../../src/resources/providers/providers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,KAAK,UAAU;OACf,EAAE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE;OACnD,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;IAEnE;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIlF;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIpE;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAI9F;;;OAGG;IACH,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