@trycourier/courier 7.20.0 → 7.21.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,4CASqB;AARnB,sGAAA,SAAS,OAAA;AASX,kDAKwB;AAJtB,2GAAA,WAAW,OAAA;AAKb,kCAAsF;AAA7E,4FAAA,IAAI,OAAA;AACb,4DAMmC;AALjC,0GAAA,WAAW,OAAA;AAMb,sCAoBkB;AAnBhB,gGAAA,MAAM,OAAA;AAoBR,kCAUgB;AATd,4FAAA,IAAI,OAAA;AAUN,gDAK2B;AAJzB,kGAAA,OAAO,OAAA;AAKT,wCAAkG;AAAzF,kGAAA,OAAO,OAAA;AAChB,mDA8C6B;AA7C3B,oGAAA,QAAQ,OAAA;AA8CV,0CAQuB;AAPrB,8FAAA,KAAK,OAAA;AAQP,0CAUoB;AATlB,oGAAA,QAAQ,OAAA;AAUV,kEAgCuC;AA/BrC,8GAAA,aAAa,OAAA;AAgCf,mDAS6B;AAR3B,oGAAA,QAAQ,OAAA;AASV,sDAQ+B;AAP7B,sGAAA,SAAS,OAAA;AAQX,0CAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,8DAY8B;AAX5B,uHAAA,iBAAiB,OAAA;AAYnB,kCAAgF;AAAvE,4FAAA,IAAI,OAAA;AACb,gDAiB2B;AAhBzB,kGAAA,OAAO,OAAA;AAiBT,kDAKwB;AAJtB,4GAAA,YAAY,OAAA;AAKd,0CAAsC;AAA7B,8FAAA,KAAK,OAAA;AACd,0FAeuD;AAdrD,6HAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,4CASqB;AARnB,sGAAA,SAAS,OAAA;AASX,kDAKwB;AAJtB,2GAAA,WAAW,OAAA;AAKb,kCAAsF;AAA7E,4FAAA,IAAI,OAAA;AACb,4DAMmC;AALjC,0GAAA,WAAW,OAAA;AAMb,sCAoBkB;AAnBhB,gGAAA,MAAM,OAAA;AAoBR,gDAK2B;AAJzB,kGAAA,OAAO,OAAA;AAKT,wCAAkG;AAAzF,kGAAA,OAAO,OAAA;AAChB,mDA8C6B;AA7C3B,oGAAA,QAAQ,OAAA;AA8CV,0CAQuB;AAPrB,8FAAA,KAAK,OAAA;AAQP,0CAUoB;AATlB,oGAAA,QAAQ,OAAA;AAUV,kEAgCuC;AA/BrC,8GAAA,aAAa,OAAA;AAgCf,mDAS6B;AAR3B,oGAAA,QAAQ,OAAA;AASV,sDAQ+B;AAP7B,sGAAA,SAAS,OAAA;AAQX,0CAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,8DAY8B;AAX5B,uHAAA,iBAAiB,OAAA;AAYnB,kCAAgF;AAAvE,4FAAA,IAAI,OAAA;AACb,gDAiB2B;AAhBzB,kGAAA,OAAO,OAAA;AAiBT,kDAKwB;AAJtB,4GAAA,YAAY,OAAA;AAKd,0CAAsC;AAA7B,8FAAA,KAAK,OAAA;AACd,0FAeuD;AAdrD,6HAAA,oBAAoB,OAAA"}
@@ -5,7 +5,6 @@ export { AuditEvents, } from "./audit-events.mjs";
5
5
  export { Auth } from "./auth.mjs";
6
6
  export { Automations, } from "./automations/automations.mjs";
7
7
  export { Brands, } from "./brands.mjs";
8
- export { Bulk, } from "./bulk.mjs";
9
8
  export { Digests, } from "./digests/digests.mjs";
10
9
  export { Inbound } from "./inbound.mjs";
11
10
  export { Journeys, } from "./journeys/journeys.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,6BAAyB;AACzB,OAAO,EACL,SAAS,GAQV,wBAAoB;AACrB,OAAO,EACL,WAAW,GAIZ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ACpB,OAAO,EACL,aAAa,GA+Bd,0CAAsC;AACvC,OAAO,EACL,QAAQ,GAQT,gCAA4B;AAC7B,OAAO,EACL,SAAS,GAOV,kCAA8B;AAC/B,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,OAAO,EACL,iBAAiB,GAWlB,iCAA6B;AAC9B,OAAO,EAAE,IAAI,EAAoD,mBAAe;AAChF,OAAO,EACL,OAAO,GAgBR,8BAA0B;AAC3B,OAAO,EACL,YAAY,GAIb,2BAAuB;AACxB,OAAO,EAAE,KAAK,EAAE,0BAAsB;AACtC,OAAO,EACL,oBAAoB,GAcrB,0DAAsD"}
package/src/client.ts CHANGED
@@ -55,17 +55,6 @@ import {
55
55
  Logo,
56
56
  WidgetBackground,
57
57
  } from './resources/brands';
58
- import {
59
- Bulk,
60
- BulkAddUsersParams,
61
- BulkCreateJobParams,
62
- BulkCreateJobResponse,
63
- BulkListUsersParams,
64
- BulkListUsersResponse,
65
- BulkRetrieveJobResponse,
66
- InboundBulkMessage,
67
- InboundBulkMessageUser,
68
- } from './resources/bulk';
69
58
  import { Inbound, InboundTrackEventParams, InboundTrackEventResponse } from './resources/inbound';
70
59
  import {
71
60
  MessageContentResponse,
@@ -980,7 +969,6 @@ export class Courier {
980
969
  automations: API.Automations = new API.Automations(this);
981
970
  journeys: API.Journeys = new API.Journeys(this);
982
971
  brands: API.Brands = new API.Brands(this);
983
- bulk: API.Bulk = new API.Bulk(this);
984
972
  digests: API.Digests = new API.Digests(this);
985
973
  inbound: API.Inbound = new API.Inbound(this);
986
974
  lists: API.Lists = new API.Lists(this);
@@ -1003,7 +991,6 @@ Courier.Auth = Auth;
1003
991
  Courier.Automations = Automations;
1004
992
  Courier.Journeys = Journeys;
1005
993
  Courier.Brands = Brands;
1006
- Courier.Bulk = Bulk;
1007
994
  Courier.Digests = Digests;
1008
995
  Courier.Inbound = Inbound;
1009
996
  Courier.Lists = Lists;
@@ -1138,18 +1125,6 @@ export declare namespace Courier {
1138
1125
  type BrandListParams as BrandListParams,
1139
1126
  };
1140
1127
 
1141
- export {
1142
- Bulk as Bulk,
1143
- type InboundBulkMessage as InboundBulkMessage,
1144
- type InboundBulkMessageUser as InboundBulkMessageUser,
1145
- type BulkCreateJobResponse as BulkCreateJobResponse,
1146
- type BulkListUsersResponse as BulkListUsersResponse,
1147
- type BulkRetrieveJobResponse as BulkRetrieveJobResponse,
1148
- type BulkAddUsersParams as BulkAddUsersParams,
1149
- type BulkCreateJobParams as BulkCreateJobParams,
1150
- type BulkListUsersParams as BulkListUsersParams,
1151
- };
1152
-
1153
1128
  export {
1154
1129
  Digests as Digests,
1155
1130
  type DigestCategory as DigestCategory,
@@ -46,17 +46,6 @@ export {
46
46
  type BrandUpdateParams,
47
47
  type BrandListParams,
48
48
  } from './brands';
49
- export {
50
- Bulk,
51
- type InboundBulkMessage,
52
- type InboundBulkMessageUser,
53
- type BulkCreateJobResponse,
54
- type BulkListUsersResponse,
55
- type BulkRetrieveJobResponse,
56
- type BulkAddUsersParams,
57
- type BulkCreateJobParams,
58
- type BulkListUsersParams,
59
- } from './bulk';
60
49
  export {
61
50
  Digests,
62
51
  type DigestCategory,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.20.0'; // x-release-please-version
1
+ export const VERSION = '7.21.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.20.0";
1
+ export declare const VERSION = "7.21.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.20.0";
1
+ export declare const VERSION = "7.21.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '7.20.0'; // x-release-please-version
4
+ exports.VERSION = '7.21.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '7.20.0'; // x-release-please-version
1
+ export const VERSION = '7.21.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,155 +0,0 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import * as BulkAPI from "./bulk.mjs";
3
- import * as Shared from "./shared.mjs";
4
- import { APIPromise } from "../core/api-promise.mjs";
5
- import { RequestOptions } from "../internal/request-options.mjs";
6
- export declare class Bulk extends APIResource {
7
- /**
8
- * Ingest user data into a Bulk Job.
9
- *
10
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
11
- * for provider routing to work correctly. The `to.email` field is not sufficient
12
- * for email provider routing.
13
- */
14
- addUsers(jobID: string, body: BulkAddUsersParams, options?: RequestOptions): APIPromise<void>;
15
- /**
16
- * Creates a new bulk job for sending messages to multiple recipients.
17
- *
18
- * **Required**: `message.event` (event ID or notification ID)
19
- *
20
- * **Optional (V2 format)**: `message.template` (notification ID) or
21
- * `message.content` (Elemental content) can be provided to override the
22
- * notification associated with the event.
23
- */
24
- createJob(body: BulkCreateJobParams, options?: RequestOptions): APIPromise<BulkCreateJobResponse>;
25
- /**
26
- * Get Bulk Job Users
27
- */
28
- listUsers(jobID: string, query?: BulkListUsersParams | null | undefined, options?: RequestOptions): APIPromise<BulkListUsersResponse>;
29
- /**
30
- * Get a bulk job
31
- */
32
- retrieveJob(jobID: string, options?: RequestOptions): APIPromise<BulkRetrieveJobResponse>;
33
- /**
34
- * Run a bulk job
35
- */
36
- runJob(jobID: string, options?: RequestOptions): APIPromise<void>;
37
- }
38
- /**
39
- * Bulk message definition. Supports two formats:
40
- *
41
- * - V1 format: Requires `event` field (event ID or notification ID)
42
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
43
- * content) in addition to `event`
44
- */
45
- export interface InboundBulkMessage {
46
- /**
47
- * Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
48
- * "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
49
- * mapped to a notification.
50
- */
51
- event: string;
52
- brand?: string | null;
53
- /**
54
- * Elemental content (optional, for V2 format). When provided, this will be used
55
- * instead of the notification associated with the `event` field.
56
- */
57
- content?: Shared.ElementalContentSugar | Shared.ElementalContent | null;
58
- data?: {
59
- [key: string]: unknown;
60
- } | null;
61
- locale?: {
62
- [key: string]: {
63
- [key: string]: unknown;
64
- };
65
- } | null;
66
- override?: {
67
- [key: string]: unknown;
68
- } | null;
69
- /**
70
- * Notification ID or template ID (optional, for V2 format). When provided, this
71
- * will be used instead of the notification associated with the `event` field.
72
- */
73
- template?: string | null;
74
- }
75
- export interface InboundBulkMessageUser {
76
- /**
77
- * User-specific data that will be merged with message.data
78
- */
79
- data?: unknown;
80
- preferences?: Shared.RecipientPreferences | null;
81
- /**
82
- * User profile information. For email-based bulk jobs, `profile.email` is required
83
- * for provider routing to determine if the message can be delivered. The email
84
- * address should be provided here rather than in `to.email`.
85
- */
86
- profile?: {
87
- [key: string]: unknown;
88
- } | null;
89
- /**
90
- * User ID (legacy field, use profile or to.user_id instead)
91
- */
92
- recipient?: string | null;
93
- /**
94
- * Optional recipient information. Note: For email provider routing, use
95
- * `profile.email` instead of `to.email`. The `to` field is primarily used for
96
- * recipient identification and data merging.
97
- */
98
- to?: Shared.UserRecipient | null;
99
- }
100
- export interface BulkCreateJobResponse {
101
- jobId: string;
102
- }
103
- export interface BulkListUsersResponse {
104
- items: Array<BulkListUsersResponse.Item>;
105
- paging: Shared.Paging;
106
- }
107
- export declare namespace BulkListUsersResponse {
108
- interface Item extends BulkAPI.InboundBulkMessageUser {
109
- status: 'PENDING' | 'ENQUEUED' | 'ERROR';
110
- messageId?: string | null;
111
- }
112
- }
113
- export interface BulkRetrieveJobResponse {
114
- job: BulkRetrieveJobResponse.Job;
115
- }
116
- export declare namespace BulkRetrieveJobResponse {
117
- interface Job {
118
- /**
119
- * Bulk message definition. Supports two formats:
120
- *
121
- * - V1 format: Requires `event` field (event ID or notification ID)
122
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
123
- * content) in addition to `event`
124
- */
125
- definition: BulkAPI.InboundBulkMessage;
126
- enqueued: number;
127
- failures: number;
128
- received: number;
129
- status: 'CREATED' | 'PROCESSING' | 'COMPLETED' | 'ERROR';
130
- }
131
- }
132
- export interface BulkAddUsersParams {
133
- users: Array<InboundBulkMessageUser>;
134
- }
135
- export interface BulkCreateJobParams {
136
- /**
137
- * Bulk message definition. Supports two formats:
138
- *
139
- * - V1 format: Requires `event` field (event ID or notification ID)
140
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
141
- * content) in addition to `event`
142
- */
143
- message: InboundBulkMessage;
144
- }
145
- export interface BulkListUsersParams {
146
- /**
147
- * A unique identifier that allows for fetching the next set of users added to the
148
- * bulk job
149
- */
150
- cursor?: string | null;
151
- }
152
- export declare namespace Bulk {
153
- export { type InboundBulkMessage as InboundBulkMessage, type InboundBulkMessageUser as InboundBulkMessageUser, type BulkCreateJobResponse as BulkCreateJobResponse, type BulkListUsersResponse as BulkListUsersResponse, type BulkRetrieveJobResponse as BulkRetrieveJobResponse, type BulkAddUsersParams as BulkAddUsersParams, type BulkCreateJobParams as BulkCreateJobParams, type BulkListUsersParams as BulkListUsersParams, };
154
- }
155
- //# sourceMappingURL=bulk.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.d.mts","sourceRoot":"","sources":["../src/resources/bulk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,OAAO,mBAAe;AAClC,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE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IAClC;;;;;;OAMG;IACH,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -1,155 +0,0 @@
1
- import { APIResource } from "../core/resource.js";
2
- import * as BulkAPI from "./bulk.js";
3
- import * as Shared from "./shared.js";
4
- import { APIPromise } from "../core/api-promise.js";
5
- import { RequestOptions } from "../internal/request-options.js";
6
- export declare class Bulk extends APIResource {
7
- /**
8
- * Ingest user data into a Bulk Job.
9
- *
10
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
11
- * for provider routing to work correctly. The `to.email` field is not sufficient
12
- * for email provider routing.
13
- */
14
- addUsers(jobID: string, body: BulkAddUsersParams, options?: RequestOptions): APIPromise<void>;
15
- /**
16
- * Creates a new bulk job for sending messages to multiple recipients.
17
- *
18
- * **Required**: `message.event` (event ID or notification ID)
19
- *
20
- * **Optional (V2 format)**: `message.template` (notification ID) or
21
- * `message.content` (Elemental content) can be provided to override the
22
- * notification associated with the event.
23
- */
24
- createJob(body: BulkCreateJobParams, options?: RequestOptions): APIPromise<BulkCreateJobResponse>;
25
- /**
26
- * Get Bulk Job Users
27
- */
28
- listUsers(jobID: string, query?: BulkListUsersParams | null | undefined, options?: RequestOptions): APIPromise<BulkListUsersResponse>;
29
- /**
30
- * Get a bulk job
31
- */
32
- retrieveJob(jobID: string, options?: RequestOptions): APIPromise<BulkRetrieveJobResponse>;
33
- /**
34
- * Run a bulk job
35
- */
36
- runJob(jobID: string, options?: RequestOptions): APIPromise<void>;
37
- }
38
- /**
39
- * Bulk message definition. Supports two formats:
40
- *
41
- * - V1 format: Requires `event` field (event ID or notification ID)
42
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
43
- * content) in addition to `event`
44
- */
45
- export interface InboundBulkMessage {
46
- /**
47
- * Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
48
- * "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
49
- * mapped to a notification.
50
- */
51
- event: string;
52
- brand?: string | null;
53
- /**
54
- * Elemental content (optional, for V2 format). When provided, this will be used
55
- * instead of the notification associated with the `event` field.
56
- */
57
- content?: Shared.ElementalContentSugar | Shared.ElementalContent | null;
58
- data?: {
59
- [key: string]: unknown;
60
- } | null;
61
- locale?: {
62
- [key: string]: {
63
- [key: string]: unknown;
64
- };
65
- } | null;
66
- override?: {
67
- [key: string]: unknown;
68
- } | null;
69
- /**
70
- * Notification ID or template ID (optional, for V2 format). When provided, this
71
- * will be used instead of the notification associated with the `event` field.
72
- */
73
- template?: string | null;
74
- }
75
- export interface InboundBulkMessageUser {
76
- /**
77
- * User-specific data that will be merged with message.data
78
- */
79
- data?: unknown;
80
- preferences?: Shared.RecipientPreferences | null;
81
- /**
82
- * User profile information. For email-based bulk jobs, `profile.email` is required
83
- * for provider routing to determine if the message can be delivered. The email
84
- * address should be provided here rather than in `to.email`.
85
- */
86
- profile?: {
87
- [key: string]: unknown;
88
- } | null;
89
- /**
90
- * User ID (legacy field, use profile or to.user_id instead)
91
- */
92
- recipient?: string | null;
93
- /**
94
- * Optional recipient information. Note: For email provider routing, use
95
- * `profile.email` instead of `to.email`. The `to` field is primarily used for
96
- * recipient identification and data merging.
97
- */
98
- to?: Shared.UserRecipient | null;
99
- }
100
- export interface BulkCreateJobResponse {
101
- jobId: string;
102
- }
103
- export interface BulkListUsersResponse {
104
- items: Array<BulkListUsersResponse.Item>;
105
- paging: Shared.Paging;
106
- }
107
- export declare namespace BulkListUsersResponse {
108
- interface Item extends BulkAPI.InboundBulkMessageUser {
109
- status: 'PENDING' | 'ENQUEUED' | 'ERROR';
110
- messageId?: string | null;
111
- }
112
- }
113
- export interface BulkRetrieveJobResponse {
114
- job: BulkRetrieveJobResponse.Job;
115
- }
116
- export declare namespace BulkRetrieveJobResponse {
117
- interface Job {
118
- /**
119
- * Bulk message definition. Supports two formats:
120
- *
121
- * - V1 format: Requires `event` field (event ID or notification ID)
122
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
123
- * content) in addition to `event`
124
- */
125
- definition: BulkAPI.InboundBulkMessage;
126
- enqueued: number;
127
- failures: number;
128
- received: number;
129
- status: 'CREATED' | 'PROCESSING' | 'COMPLETED' | 'ERROR';
130
- }
131
- }
132
- export interface BulkAddUsersParams {
133
- users: Array<InboundBulkMessageUser>;
134
- }
135
- export interface BulkCreateJobParams {
136
- /**
137
- * Bulk message definition. Supports two formats:
138
- *
139
- * - V1 format: Requires `event` field (event ID or notification ID)
140
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
141
- * content) in addition to `event`
142
- */
143
- message: InboundBulkMessage;
144
- }
145
- export interface BulkListUsersParams {
146
- /**
147
- * A unique identifier that allows for fetching the next set of users added to the
148
- * bulk job
149
- */
150
- cursor?: string | null;
151
- }
152
- export declare namespace Bulk {
153
- export { type InboundBulkMessage as InboundBulkMessage, type InboundBulkMessageUser as InboundBulkMessageUser, type BulkCreateJobResponse as BulkCreateJobResponse, type BulkListUsersResponse as BulkListUsersResponse, type BulkRetrieveJobResponse as BulkRetrieveJobResponse, type BulkAddUsersParams as BulkAddUsersParams, type BulkCreateJobParams as BulkCreateJobParams, type BulkListUsersParams as BulkListUsersParams, };
154
- }
155
- //# sourceMappingURL=bulk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk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B,GAAG;QAClB;;;;;;WAMG;QACH,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC;QAEvC,QAAQ,EAAE,MAAM,CAAC;QAEjB,QAAQ,EAAE,MAAM,CAAC;QAEjB,QAAQ,EAAE,MAAM,CAAC;QAEjB,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;KAC1D;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
package/resources/bulk.js DELETED
@@ -1,58 +0,0 @@
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.Bulk = void 0;
5
- const resource_1 = require("../core/resource.js");
6
- const headers_1 = require("../internal/headers.js");
7
- const path_1 = require("../internal/utils/path.js");
8
- class Bulk extends resource_1.APIResource {
9
- /**
10
- * Ingest user data into a Bulk Job.
11
- *
12
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
13
- * for provider routing to work correctly. The `to.email` field is not sufficient
14
- * for email provider routing.
15
- */
16
- addUsers(jobID, body, options) {
17
- return this._client.post((0, path_1.path) `/bulk/${jobID}`, {
18
- body,
19
- ...options,
20
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
21
- });
22
- }
23
- /**
24
- * Creates a new bulk job for sending messages to multiple recipients.
25
- *
26
- * **Required**: `message.event` (event ID or notification ID)
27
- *
28
- * **Optional (V2 format)**: `message.template` (notification ID) or
29
- * `message.content` (Elemental content) can be provided to override the
30
- * notification associated with the event.
31
- */
32
- createJob(body, options) {
33
- return this._client.post('/bulk', { body, ...options });
34
- }
35
- /**
36
- * Get Bulk Job Users
37
- */
38
- listUsers(jobID, query = {}, options) {
39
- return this._client.get((0, path_1.path) `/bulk/${jobID}/users`, { query, ...options });
40
- }
41
- /**
42
- * Get a bulk job
43
- */
44
- retrieveJob(jobID, options) {
45
- return this._client.get((0, path_1.path) `/bulk/${jobID}`, options);
46
- }
47
- /**
48
- * Run a bulk job
49
- */
50
- runJob(jobID, options) {
51
- return this._client.post((0, path_1.path) `/bulk/${jobID}/run`, {
52
- ...options,
53
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
54
- });
55
- }
56
- }
57
- exports.Bulk = Bulk;
58
- //# sourceMappingURL=bulk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.js","sourceRoot":"","sources":["../src/resources/bulk.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAa,EAAE,IAAwB,EAAE,OAAwB;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,SAAS,KAAK,EAAE,EAAE;YAC7C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,IAAyB,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,SAAS,CACP,KAAa,EACb,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,SAAS,KAAK,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,KAAa,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,SAAS,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,SAAS,KAAK,MAAM,EAAE;YACjD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAxDD,oBAwDC"}
@@ -1,54 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../core/resource.mjs";
3
- import { buildHeaders } from "../internal/headers.mjs";
4
- import { path } from "../internal/utils/path.mjs";
5
- export class Bulk extends APIResource {
6
- /**
7
- * Ingest user data into a Bulk Job.
8
- *
9
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
10
- * for provider routing to work correctly. The `to.email` field is not sufficient
11
- * for email provider routing.
12
- */
13
- addUsers(jobID, body, options) {
14
- return this._client.post(path `/bulk/${jobID}`, {
15
- body,
16
- ...options,
17
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
18
- });
19
- }
20
- /**
21
- * Creates a new bulk job for sending messages to multiple recipients.
22
- *
23
- * **Required**: `message.event` (event ID or notification ID)
24
- *
25
- * **Optional (V2 format)**: `message.template` (notification ID) or
26
- * `message.content` (Elemental content) can be provided to override the
27
- * notification associated with the event.
28
- */
29
- createJob(body, options) {
30
- return this._client.post('/bulk', { body, ...options });
31
- }
32
- /**
33
- * Get Bulk Job Users
34
- */
35
- listUsers(jobID, query = {}, options) {
36
- return this._client.get(path `/bulk/${jobID}/users`, { query, ...options });
37
- }
38
- /**
39
- * Get a bulk job
40
- */
41
- retrieveJob(jobID, options) {
42
- return this._client.get(path `/bulk/${jobID}`, options);
43
- }
44
- /**
45
- * Run a bulk job
46
- */
47
- runJob(jobID, options) {
48
- return this._client.post(path `/bulk/${jobID}/run`, {
49
- ...options,
50
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
51
- });
52
- }
53
- }
54
- //# sourceMappingURL=bulk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.mjs","sourceRoot":"","sources":["../src/resources/bulk.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAa,EAAE,IAAwB,EAAE,OAAwB;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,SAAS,KAAK,EAAE,EAAE;YAC7C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK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