@superdurable/connector-braze 0.1.0 → 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.
@@ -0,0 +1,400 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var ConfigSchema = z.object({
5
+ "baseUrl": z.string(),
6
+ "timeoutMs": z.number().int().optional(),
7
+ "maxResponseBytes": z.number().int().optional()
8
+ });
9
+ var CredentialMaterialError = class extends TypeError {
10
+ constructor(message) {
11
+ super(message);
12
+ this.name = "CredentialMaterialError";
13
+ }
14
+ };
15
+ var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
16
+ "project credential decoding failed",
17
+ "shared project credential decoding failed",
18
+ "project credential decoding failed: this connector version does not support shared credentials"
19
+ ]);
20
+ function isCredentialMaterialError(error) {
21
+ return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
22
+ }
23
+ function decodeCredentials(value) {
24
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
25
+ const fields = value;
26
+ const allowed = /* @__PURE__ */ new Set(["rest_api_key"]);
27
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
28
+ if (fields["rest_api_key"] != null && !(typeof fields["rest_api_key"] === "string")) throw new CredentialMaterialError("credential rest_api_key has an invalid type");
29
+ const credentials = {};
30
+ if (!fields["rest_api_key"]) throw new CredentialMaterialError("credential rest_api_key is required");
31
+ credentials.restApiKey = new SecretString(fields["rest_api_key"] ?? "");
32
+ return credentials;
33
+ }
34
+ var TriggerCampaignSendInputSchema = z.strictObject({
35
+ "campaignId": z.string(),
36
+ "externalId": z.string()
37
+ });
38
+ var TargetedSendResultSchema = z.strictObject({
39
+ "dispatchId": z.string()
40
+ });
41
+ var TriggerCanvasSendInputSchema = z.strictObject({
42
+ "canvasId": z.string(),
43
+ "externalId": z.string()
44
+ });
45
+ var UpdateUserProfileInputSchema = z.strictObject({
46
+ "externalId": z.string(),
47
+ "firstName": z.string().optional(),
48
+ "lastName": z.string().optional(),
49
+ "email": z.string().optional()
50
+ });
51
+ var UserWriteResultSchema = z.strictObject({
52
+ "externalId": z.string()
53
+ });
54
+ var DeleteUserProfileInputSchema = z.strictObject({
55
+ "externalId": z.string()
56
+ });
57
+ var UserDeleteResultSchema = z.strictObject({
58
+ "externalId": z.string(),
59
+ "deleted": z.number().int()
60
+ });
61
+ var ListCampaignsInputSchema = z.strictObject({
62
+ "page": z.number().int()
63
+ });
64
+ var CampaignIdentitySchema = z.strictObject({
65
+ "id": z.string(),
66
+ "name": z.string()
67
+ });
68
+ var CampaignsListSchema = z.strictObject({
69
+ "campaigns": z.array(CampaignIdentitySchema).nullable()
70
+ });
71
+ var ListCanvasesInputSchema = z.strictObject({
72
+ "page": z.number().int()
73
+ });
74
+ var CanvasIdentitySchema = z.strictObject({
75
+ "id": z.string(),
76
+ "name": z.string()
77
+ });
78
+ var CanvasesListSchema = z.strictObject({
79
+ "canvases": z.array(CanvasIdentitySchema).nullable()
80
+ });
81
+ var ListSegmentsInputSchema = z.strictObject({
82
+ "page": z.number().int()
83
+ });
84
+ var SegmentIdentitySchema = z.strictObject({
85
+ "id": z.string(),
86
+ "name": z.string(),
87
+ "analyticsTrackingEnabled": z.boolean()
88
+ });
89
+ var SegmentsListSchema = z.strictObject({
90
+ "segments": z.array(SegmentIdentitySchema).nullable()
91
+ });
92
+ var GetUserProfileInputSchema = z.strictObject({
93
+ "externalId": z.string()
94
+ });
95
+ var UserProfileSchema = z.strictObject({
96
+ "externalId": z.string(),
97
+ "brazeId": z.string().optional(),
98
+ "firstName": z.string().optional(),
99
+ "lastName": z.string().optional(),
100
+ "email": z.string().optional()
101
+ });
102
+
103
+ // src/generated/definitions.ts
104
+ var ConnectorID = "braze";
105
+ var ProviderID = "braze";
106
+ var TriggerCampaignSendBranch = {
107
+ Sent: "sent",
108
+ ProviderRejected: "providerRejected",
109
+ Defect: "defect",
110
+ Uncertain: "uncertain"
111
+ };
112
+ var TriggerCampaignSendBranchSent = TriggerCampaignSendBranch.Sent;
113
+ var TriggerCampaignSendBranchProviderRejected = TriggerCampaignSendBranch.ProviderRejected;
114
+ var TriggerCampaignSendBranchDefect = TriggerCampaignSendBranch.Defect;
115
+ var TriggerCampaignSendBranchUncertain = TriggerCampaignSendBranch.Uncertain;
116
+ var TriggerCampaignSendDefinition = {
117
+ operation: { connectorId: ConnectorID, operationId: "triggerCampaignSend" },
118
+ branches: [
119
+ { id: "sent", description: "Braze accepted the targeted campaign dispatch." },
120
+ { id: "providerRejected", description: "Braze conclusively rejected the dispatch.", optional: true },
121
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true },
122
+ { id: "uncertain", description: "The campaign may have been dispatched after the send cap.", optional: true }
123
+ ],
124
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
125
+ repeatOnUnknown: "limited",
126
+ maxSends: 3
127
+ };
128
+ var TriggerCampaignSendMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
129
+ var TriggerCanvasSendBranch = {
130
+ Sent: "sent",
131
+ ProviderRejected: "providerRejected",
132
+ Defect: "defect",
133
+ Uncertain: "uncertain"
134
+ };
135
+ var TriggerCanvasSendBranchSent = TriggerCanvasSendBranch.Sent;
136
+ var TriggerCanvasSendBranchProviderRejected = TriggerCanvasSendBranch.ProviderRejected;
137
+ var TriggerCanvasSendBranchDefect = TriggerCanvasSendBranch.Defect;
138
+ var TriggerCanvasSendBranchUncertain = TriggerCanvasSendBranch.Uncertain;
139
+ var TriggerCanvasSendDefinition = {
140
+ operation: { connectorId: ConnectorID, operationId: "triggerCanvasSend" },
141
+ branches: [
142
+ { id: "sent", description: "Braze accepted the targeted Canvas dispatch." },
143
+ { id: "providerRejected", description: "Braze conclusively rejected the dispatch.", optional: true },
144
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true },
145
+ { id: "uncertain", description: "The Canvas may have been dispatched after the send cap.", optional: true }
146
+ ],
147
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync" },
148
+ repeatOnUnknown: "limited",
149
+ maxSends: 3
150
+ };
151
+ var TriggerCanvasSendMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
152
+ var UpdateUserProfileBranch = {
153
+ Accepted: "accepted",
154
+ ProviderRejected: "providerRejected",
155
+ InvalidResponse: "invalidResponse",
156
+ Defect: "defect"
157
+ };
158
+ var UpdateUserProfileBranchAccepted = UpdateUserProfileBranch.Accepted;
159
+ var UpdateUserProfileBranchProviderRejected = UpdateUserProfileBranch.ProviderRejected;
160
+ var UpdateUserProfileBranchInvalidResponse = UpdateUserProfileBranch.InvalidResponse;
161
+ var UpdateUserProfileBranchDefect = UpdateUserProfileBranch.Defect;
162
+ var UpdateUserProfileDefinition = {
163
+ operation: { connectorId: ConnectorID, operationId: "updateUserProfile" },
164
+ branches: [
165
+ { id: "accepted", description: "Braze queued the profile update." },
166
+ { id: "providerRejected", description: "Braze conclusively rejected the update.", optional: true },
167
+ { id: "invalidResponse", description: "Braze returned malformed or oversized JSON.", optional: true },
168
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
169
+ ],
170
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
171
+ repeatOnUnknown: "safe"
172
+ };
173
+ var UpdateUserProfileMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
174
+ var DeleteUserProfileBranch = {
175
+ Deleted: "deleted",
176
+ ProviderRejected: "providerRejected",
177
+ InvalidResponse: "invalidResponse",
178
+ Defect: "defect"
179
+ };
180
+ var DeleteUserProfileBranchDeleted = DeleteUserProfileBranch.Deleted;
181
+ var DeleteUserProfileBranchProviderRejected = DeleteUserProfileBranch.ProviderRejected;
182
+ var DeleteUserProfileBranchInvalidResponse = DeleteUserProfileBranch.InvalidResponse;
183
+ var DeleteUserProfileBranchDefect = DeleteUserProfileBranch.Defect;
184
+ var DeleteUserProfileDefinition = {
185
+ operation: { connectorId: ConnectorID, operationId: "deleteUserProfile" },
186
+ branches: [
187
+ { id: "deleted", description: "Braze queued the user deletion." },
188
+ { id: "providerRejected", description: "Braze conclusively rejected the deletion.", optional: true },
189
+ { id: "invalidResponse", description: "Braze returned malformed or oversized JSON.", optional: true },
190
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
191
+ ],
192
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
193
+ repeatOnUnknown: "safe"
194
+ };
195
+ var DeleteUserProfileMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
196
+ var ListCampaignsBranch = {
197
+ Listed: "listed",
198
+ ProviderRejected: "providerRejected",
199
+ InvalidResponse: "invalidResponse",
200
+ Defect: "defect"
201
+ };
202
+ var ListCampaignsBranchListed = ListCampaignsBranch.Listed;
203
+ var ListCampaignsBranchProviderRejected = ListCampaignsBranch.ProviderRejected;
204
+ var ListCampaignsBranchInvalidResponse = ListCampaignsBranch.InvalidResponse;
205
+ var ListCampaignsBranchDefect = ListCampaignsBranch.Defect;
206
+ var ListCampaignsDefinition = {
207
+ operation: { connectorId: ConnectorID, operationId: "listCampaigns" },
208
+ branches: [
209
+ { id: "listed", description: "Braze returned campaign identities." },
210
+ { id: "providerRejected", description: "Braze conclusively rejected the request.", optional: true },
211
+ { id: "invalidResponse", description: "Braze returned malformed or oversized JSON.", optional: true },
212
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
213
+ ],
214
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
215
+ };
216
+ var ListCampaignsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
217
+ var ListCanvasesBranch = {
218
+ Listed: "listed",
219
+ ProviderRejected: "providerRejected",
220
+ InvalidResponse: "invalidResponse",
221
+ Defect: "defect"
222
+ };
223
+ var ListCanvasesBranchListed = ListCanvasesBranch.Listed;
224
+ var ListCanvasesBranchProviderRejected = ListCanvasesBranch.ProviderRejected;
225
+ var ListCanvasesBranchInvalidResponse = ListCanvasesBranch.InvalidResponse;
226
+ var ListCanvasesBranchDefect = ListCanvasesBranch.Defect;
227
+ var ListCanvasesDefinition = {
228
+ operation: { connectorId: ConnectorID, operationId: "listCanvases" },
229
+ branches: [
230
+ { id: "listed", description: "Braze returned Canvas identities." },
231
+ { id: "providerRejected", description: "Braze conclusively rejected the request.", optional: true },
232
+ { id: "invalidResponse", description: "Braze returned malformed or oversized JSON.", optional: true },
233
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
234
+ ],
235
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
236
+ };
237
+ var ListCanvasesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
238
+ var ListSegmentsBranch = {
239
+ Listed: "listed",
240
+ ProviderRejected: "providerRejected",
241
+ InvalidResponse: "invalidResponse",
242
+ Defect: "defect"
243
+ };
244
+ var ListSegmentsBranchListed = ListSegmentsBranch.Listed;
245
+ var ListSegmentsBranchProviderRejected = ListSegmentsBranch.ProviderRejected;
246
+ var ListSegmentsBranchInvalidResponse = ListSegmentsBranch.InvalidResponse;
247
+ var ListSegmentsBranchDefect = ListSegmentsBranch.Defect;
248
+ var ListSegmentsDefinition = {
249
+ operation: { connectorId: ConnectorID, operationId: "listSegments" },
250
+ branches: [
251
+ { id: "listed", description: "Braze returned segment identities." },
252
+ { id: "providerRejected", description: "Braze conclusively rejected the request.", optional: true },
253
+ { id: "invalidResponse", description: "Braze returned malformed or oversized JSON.", optional: true },
254
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
255
+ ],
256
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
257
+ };
258
+ var ListSegmentsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
259
+ var GetUserProfileBranch = {
260
+ Found: "found",
261
+ NotFound: "notFound",
262
+ ProviderRejected: "providerRejected",
263
+ InvalidResponse: "invalidResponse",
264
+ Defect: "defect"
265
+ };
266
+ var GetUserProfileBranchFound = GetUserProfileBranch.Found;
267
+ var GetUserProfileBranchNotFound = GetUserProfileBranch.NotFound;
268
+ var GetUserProfileBranchProviderRejected = GetUserProfileBranch.ProviderRejected;
269
+ var GetUserProfileBranchInvalidResponse = GetUserProfileBranch.InvalidResponse;
270
+ var GetUserProfileBranchDefect = GetUserProfileBranch.Defect;
271
+ var GetUserProfileDefinition = {
272
+ operation: { connectorId: ConnectorID, operationId: "getUserProfile" },
273
+ branches: [
274
+ { id: "found", description: "Braze returned the user profile." },
275
+ { id: "notFound", description: "Braze returned no user for the external ID.", optional: true },
276
+ { id: "providerRejected", description: "Braze conclusively rejected the request.", optional: true },
277
+ { id: "invalidResponse", description: "Braze returned malformed or oversized JSON.", optional: true },
278
+ { id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
279
+ ],
280
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
281
+ };
282
+ var GetUserProfileMetadata = { kind: "query", idempotency: "none", authorization: "required" };
283
+
284
+ // src/generated/connection.ts
285
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
286
+ var Connection = class {
287
+ /** Stable provider and connection name. */
288
+ reference;
289
+ /** Bound provider operations. */
290
+ operations;
291
+ /** Validate a reference and bind operations. */
292
+ constructor(reference, operations) {
293
+ this.reference = ConnectionRefSchema.parse(reference);
294
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
295
+ if (!operations) throw new TypeError("connector operations are required");
296
+ this.operations = operations;
297
+ }
298
+ };
299
+ function newConnection(client, reference) {
300
+ if (!client) throw new TypeError("connector client is required");
301
+ return new Connection(reference, client);
302
+ }
303
+ function newConnectionWithOperations(operations, reference) {
304
+ return new Connection(reference, operations);
305
+ }
306
+ function newProjectConnection(project, connectionName, createClient) {
307
+ if (!project) throw new TypeError("loaded project is required");
308
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
309
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
310
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
311
+ return newConnection(createClient(project, connectionName), reference);
312
+ }
313
+
314
+ export {
315
+ ConfigSchema,
316
+ CredentialMaterialError,
317
+ isCredentialMaterialError,
318
+ decodeCredentials,
319
+ TriggerCampaignSendInputSchema,
320
+ TargetedSendResultSchema,
321
+ TriggerCanvasSendInputSchema,
322
+ UpdateUserProfileInputSchema,
323
+ UserWriteResultSchema,
324
+ DeleteUserProfileInputSchema,
325
+ UserDeleteResultSchema,
326
+ ListCampaignsInputSchema,
327
+ CampaignIdentitySchema,
328
+ CampaignsListSchema,
329
+ ListCanvasesInputSchema,
330
+ CanvasIdentitySchema,
331
+ CanvasesListSchema,
332
+ ListSegmentsInputSchema,
333
+ SegmentIdentitySchema,
334
+ SegmentsListSchema,
335
+ GetUserProfileInputSchema,
336
+ UserProfileSchema,
337
+ ConnectorID,
338
+ ProviderID,
339
+ TriggerCampaignSendBranch,
340
+ TriggerCampaignSendBranchSent,
341
+ TriggerCampaignSendBranchProviderRejected,
342
+ TriggerCampaignSendBranchDefect,
343
+ TriggerCampaignSendBranchUncertain,
344
+ TriggerCampaignSendDefinition,
345
+ TriggerCampaignSendMetadata,
346
+ TriggerCanvasSendBranch,
347
+ TriggerCanvasSendBranchSent,
348
+ TriggerCanvasSendBranchProviderRejected,
349
+ TriggerCanvasSendBranchDefect,
350
+ TriggerCanvasSendBranchUncertain,
351
+ TriggerCanvasSendDefinition,
352
+ TriggerCanvasSendMetadata,
353
+ UpdateUserProfileBranch,
354
+ UpdateUserProfileBranchAccepted,
355
+ UpdateUserProfileBranchProviderRejected,
356
+ UpdateUserProfileBranchInvalidResponse,
357
+ UpdateUserProfileBranchDefect,
358
+ UpdateUserProfileDefinition,
359
+ UpdateUserProfileMetadata,
360
+ DeleteUserProfileBranch,
361
+ DeleteUserProfileBranchDeleted,
362
+ DeleteUserProfileBranchProviderRejected,
363
+ DeleteUserProfileBranchInvalidResponse,
364
+ DeleteUserProfileBranchDefect,
365
+ DeleteUserProfileDefinition,
366
+ DeleteUserProfileMetadata,
367
+ ListCampaignsBranch,
368
+ ListCampaignsBranchListed,
369
+ ListCampaignsBranchProviderRejected,
370
+ ListCampaignsBranchInvalidResponse,
371
+ ListCampaignsBranchDefect,
372
+ ListCampaignsDefinition,
373
+ ListCampaignsMetadata,
374
+ ListCanvasesBranch,
375
+ ListCanvasesBranchListed,
376
+ ListCanvasesBranchProviderRejected,
377
+ ListCanvasesBranchInvalidResponse,
378
+ ListCanvasesBranchDefect,
379
+ ListCanvasesDefinition,
380
+ ListCanvasesMetadata,
381
+ ListSegmentsBranch,
382
+ ListSegmentsBranchListed,
383
+ ListSegmentsBranchProviderRejected,
384
+ ListSegmentsBranchInvalidResponse,
385
+ ListSegmentsBranchDefect,
386
+ ListSegmentsDefinition,
387
+ ListSegmentsMetadata,
388
+ GetUserProfileBranch,
389
+ GetUserProfileBranchFound,
390
+ GetUserProfileBranchNotFound,
391
+ GetUserProfileBranchProviderRejected,
392
+ GetUserProfileBranchInvalidResponse,
393
+ GetUserProfileBranchDefect,
394
+ GetUserProfileDefinition,
395
+ GetUserProfileMetadata,
396
+ Connection,
397
+ newConnection,
398
+ newConnectionWithOperations,
399
+ newProjectConnection
400
+ };
@@ -0,0 +1,282 @@
1
+ import { SecretString, CredentialProvider, Mutation, Query, ConnectionRef } from '@superdurable/connectors-sdk';
2
+ import { z } from 'zod';
3
+
4
+ /** Connector configuration; omitted fields use manifest defaults. */
5
+ interface Config {
6
+ /** Your account's HTTPS REST endpoint from Braze Dashboard > Settings > APIs and Identifiers > API Keys > REST Endpoint, such as https://rest.iad-01.braze.com. This non-secret endpoint is required; blank prevents calls. */
7
+ baseUrl: string;
8
+ /** Maximum duration of one API request as a positive Go duration such as 15s. Blank uses the displayed default; increase for slow profile exports. Runtime value in milliseconds. */
9
+ timeoutMs?: number;
10
+ /** Maximum complete response in bytes as a positive integer. Blank uses the displayed default; increase for known larger selected profiles. */
11
+ maxResponseBytes?: number;
12
+ }
13
+ /** Runtime schema for manifest configuration. */
14
+ declare const ConfigSchema: z.ZodObject<{
15
+ baseUrl: z.ZodString;
16
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
17
+ maxResponseBytes: z.ZodOptional<z.ZodNumber>;
18
+ }, z.core.$strip>;
19
+ /** Private connector credentials resolved by the host. */
20
+ interface Credentials {
21
+ /** Secret REST API key from Braze Dashboard > Settings > APIs and Identifiers > API Keys. Select permissions for the operations you use; targeted sends also require campaigns.trigger.send or canvas.trigger.send. Blank prevents calls. Dex sends it only as a Bearer token. */
22
+ restApiKey: SecretString;
23
+ }
24
+ /** Stored credential material that fails the connector credential checks, so no retry can succeed. */
25
+ declare class CredentialMaterialError extends TypeError {
26
+ constructor(message: string);
27
+ }
28
+ /** Report malformed stored credential material, also behind the SDK provider's decoding TypeError. */
29
+ declare function isCredentialMaterialError(error: unknown): boolean;
30
+ /** Decode private credential fields for the connector. */
31
+ declare function decodeCredentials(value: unknown): Credentials;
32
+ /** Host-owned source of private connector credentials. */
33
+ type CredentialSource = CredentialProvider<Credentials>;
34
+ /** TriggerCampaignSendInput targets one existing user in an API-triggered campaign. */
35
+ interface TriggerCampaignSendInput {
36
+ /** CampaignID comes from a campaign configured for API-triggered delivery. */
37
+ "campaignId": string;
38
+ /** ExternalID is the existing user's external ID. */
39
+ "externalId": string;
40
+ }
41
+ /** TargetedSendResult contains the Braze dispatch identifier. */
42
+ interface TargetedSendResult {
43
+ /** DispatchID identifies Braze's accepted transmission. */
44
+ "dispatchId": string;
45
+ }
46
+ /** TriggerCanvasSendInput targets one existing user in an API-triggered Canvas. */
47
+ interface TriggerCanvasSendInput {
48
+ /** CanvasID comes from a Canvas configured for API-triggered delivery. */
49
+ "canvasId": string;
50
+ /** ExternalID is the existing user's external ID. */
51
+ "externalId": string;
52
+ }
53
+ /** UpdateUserProfileInput sets only supplied absolute attributes on one external user. */
54
+ interface UpdateUserProfileInput {
55
+ /** ExternalID identifies the profile and may create it when absent. */
56
+ "externalId": string;
57
+ /** FirstName replaces the given name when supplied. */
58
+ "firstName"?: string | undefined;
59
+ /** LastName replaces the family name when supplied. */
60
+ "lastName"?: string | undefined;
61
+ /** Email replaces the contact email when supplied. */
62
+ "email"?: string | undefined;
63
+ }
64
+ /** UserWriteResult identifies the profile whose update Braze accepted for processing. */
65
+ interface UserWriteResult {
66
+ /** ExternalID is the submitted application user ID. */
67
+ "externalId": string;
68
+ }
69
+ /** DeleteUserProfileInput selects one user profile for permanent deletion. */
70
+ interface DeleteUserProfileInput {
71
+ /** ExternalID is the application's user ID. */
72
+ "externalId": string;
73
+ }
74
+ /** UserDeleteResult reports how many user profiles Braze queued for deletion. */
75
+ interface UserDeleteResult {
76
+ /** ExternalID is the submitted application user ID. */
77
+ "externalId": string;
78
+ /** Deleted is the number of matched profiles. */
79
+ "deleted": number;
80
+ }
81
+ /** ListCampaignsInput selects one page of up to 100 campaigns, beginning at zero. */
82
+ interface ListCampaignsInput {
83
+ /** Page is a non-negative zero-based page number. */
84
+ "page": number;
85
+ }
86
+ /** CampaignIdentity contains the public identity of a campaign. */
87
+ interface CampaignIdentity {
88
+ /** ID is the campaign API identifier. */
89
+ "id": string;
90
+ /** Name is the campaign display name. */
91
+ "name": string;
92
+ }
93
+ /** CampaignsList contains one campaign page. */
94
+ interface CampaignsList {
95
+ /** Campaigns is the page of campaign identities. */
96
+ "campaigns": Array<CampaignIdentity> | null;
97
+ }
98
+ /** ListCanvasesInput selects one page of up to 100 Canvases, beginning at zero. */
99
+ interface ListCanvasesInput {
100
+ /** Page is a non-negative zero-based page number. */
101
+ "page": number;
102
+ }
103
+ /** CanvasIdentity contains the public identity of a Canvas. */
104
+ interface CanvasIdentity {
105
+ /** ID is the Canvas API identifier. */
106
+ "id": string;
107
+ /** Name is the Canvas display name. */
108
+ "name": string;
109
+ }
110
+ /** CanvasesList contains one Canvas page. */
111
+ interface CanvasesList {
112
+ /** Canvases is the page of Canvas identities. */
113
+ "canvases": Array<CanvasIdentity> | null;
114
+ }
115
+ /** ListSegmentsInput selects one page of up to 100 segments, beginning at zero. */
116
+ interface ListSegmentsInput {
117
+ /** Page is a non-negative zero-based page number. */
118
+ "page": number;
119
+ }
120
+ /** SegmentIdentity contains the public identity and tracking setting of a segment. */
121
+ interface SegmentIdentity {
122
+ /** ID is the segment API identifier. */
123
+ "id": string;
124
+ /** Name is the segment display name. */
125
+ "name": string;
126
+ /** AnalyticsTrackingEnabled reports whether Braze tracks segment analytics. */
127
+ "analyticsTrackingEnabled": boolean;
128
+ }
129
+ /** SegmentsList contains one segment page. */
130
+ interface SegmentsList {
131
+ /** Segments is the page of segment identities. */
132
+ "segments": Array<SegmentIdentity> | null;
133
+ }
134
+ /** GetUserProfileInput selects a Braze user by the application's external ID. */
135
+ interface GetUserProfileInput {
136
+ /** ExternalID is a non-secret stable application user ID. */
137
+ "externalId": string;
138
+ }
139
+ /** UserProfile contains only the selected profile fields, excluding custom attributes. */
140
+ interface UserProfile {
141
+ /** ExternalID is the application-supplied user ID. */
142
+ "externalId": string;
143
+ /** BrazeID is Braze's internal user ID. */
144
+ "brazeId"?: string | undefined;
145
+ /** FirstName is the optional given name. */
146
+ "firstName"?: string | undefined;
147
+ /** LastName is the optional family name. */
148
+ "lastName"?: string | undefined;
149
+ /** Email is the optional email address. */
150
+ "email"?: string | undefined;
151
+ }
152
+ /** Runtime validator for TriggerCampaignSendInput. */
153
+ declare const TriggerCampaignSendInputSchema: z.ZodObject<{
154
+ campaignId: z.ZodString;
155
+ externalId: z.ZodString;
156
+ }, z.core.$strict>;
157
+ /** Runtime validator for TargetedSendResult. */
158
+ declare const TargetedSendResultSchema: z.ZodObject<{
159
+ dispatchId: z.ZodString;
160
+ }, z.core.$strict>;
161
+ /** Runtime validator for TriggerCanvasSendInput. */
162
+ declare const TriggerCanvasSendInputSchema: z.ZodObject<{
163
+ canvasId: z.ZodString;
164
+ externalId: z.ZodString;
165
+ }, z.core.$strict>;
166
+ /** Runtime validator for UpdateUserProfileInput. */
167
+ declare const UpdateUserProfileInputSchema: z.ZodObject<{
168
+ externalId: z.ZodString;
169
+ firstName: z.ZodOptional<z.ZodString>;
170
+ lastName: z.ZodOptional<z.ZodString>;
171
+ email: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strict>;
173
+ /** Runtime validator for UserWriteResult. */
174
+ declare const UserWriteResultSchema: z.ZodObject<{
175
+ externalId: z.ZodString;
176
+ }, z.core.$strict>;
177
+ /** Runtime validator for DeleteUserProfileInput. */
178
+ declare const DeleteUserProfileInputSchema: z.ZodObject<{
179
+ externalId: z.ZodString;
180
+ }, z.core.$strict>;
181
+ /** Runtime validator for UserDeleteResult. */
182
+ declare const UserDeleteResultSchema: z.ZodObject<{
183
+ externalId: z.ZodString;
184
+ deleted: z.ZodNumber;
185
+ }, z.core.$strict>;
186
+ /** Runtime validator for ListCampaignsInput. */
187
+ declare const ListCampaignsInputSchema: z.ZodObject<{
188
+ page: z.ZodNumber;
189
+ }, z.core.$strict>;
190
+ /** Runtime validator for CampaignIdentity. */
191
+ declare const CampaignIdentitySchema: z.ZodObject<{
192
+ id: z.ZodString;
193
+ name: z.ZodString;
194
+ }, z.core.$strict>;
195
+ /** Runtime validator for CampaignsList. */
196
+ declare const CampaignsListSchema: z.ZodObject<{
197
+ campaigns: z.ZodNullable<z.ZodArray<z.ZodObject<{
198
+ id: z.ZodString;
199
+ name: z.ZodString;
200
+ }, z.core.$strict>>>;
201
+ }, z.core.$strict>;
202
+ /** Runtime validator for ListCanvasesInput. */
203
+ declare const ListCanvasesInputSchema: z.ZodObject<{
204
+ page: z.ZodNumber;
205
+ }, z.core.$strict>;
206
+ /** Runtime validator for CanvasIdentity. */
207
+ declare const CanvasIdentitySchema: z.ZodObject<{
208
+ id: z.ZodString;
209
+ name: z.ZodString;
210
+ }, z.core.$strict>;
211
+ /** Runtime validator for CanvasesList. */
212
+ declare const CanvasesListSchema: z.ZodObject<{
213
+ canvases: z.ZodNullable<z.ZodArray<z.ZodObject<{
214
+ id: z.ZodString;
215
+ name: z.ZodString;
216
+ }, z.core.$strict>>>;
217
+ }, z.core.$strict>;
218
+ /** Runtime validator for ListSegmentsInput. */
219
+ declare const ListSegmentsInputSchema: z.ZodObject<{
220
+ page: z.ZodNumber;
221
+ }, z.core.$strict>;
222
+ /** Runtime validator for SegmentIdentity. */
223
+ declare const SegmentIdentitySchema: z.ZodObject<{
224
+ id: z.ZodString;
225
+ name: z.ZodString;
226
+ analyticsTrackingEnabled: z.ZodBoolean;
227
+ }, z.core.$strict>;
228
+ /** Runtime validator for SegmentsList. */
229
+ declare const SegmentsListSchema: z.ZodObject<{
230
+ segments: z.ZodNullable<z.ZodArray<z.ZodObject<{
231
+ id: z.ZodString;
232
+ name: z.ZodString;
233
+ analyticsTrackingEnabled: z.ZodBoolean;
234
+ }, z.core.$strict>>>;
235
+ }, z.core.$strict>;
236
+ /** Runtime validator for GetUserProfileInput. */
237
+ declare const GetUserProfileInputSchema: z.ZodObject<{
238
+ externalId: z.ZodString;
239
+ }, z.core.$strict>;
240
+ /** Runtime validator for UserProfile. */
241
+ declare const UserProfileSchema: z.ZodObject<{
242
+ externalId: z.ZodString;
243
+ brazeId: z.ZodOptional<z.ZodString>;
244
+ firstName: z.ZodOptional<z.ZodString>;
245
+ lastName: z.ZodOptional<z.ZodString>;
246
+ email: z.ZodOptional<z.ZodString>;
247
+ }, z.core.$strict>;
248
+
249
+ /** Typed operations supplied by a client or mock. */
250
+ interface Operations {
251
+ /** Invoke triggerCampaignSend through this connection. */
252
+ triggerCampaignSend(): Mutation<TriggerCampaignSendInput, TargetedSendResult>;
253
+ /** Invoke triggerCanvasSend through this connection. */
254
+ triggerCanvasSend(): Mutation<TriggerCanvasSendInput, TargetedSendResult>;
255
+ /** Invoke updateUserProfile through this connection. */
256
+ updateUserProfile(): Mutation<UpdateUserProfileInput, UserWriteResult>;
257
+ /** Invoke deleteUserProfile through this connection. */
258
+ deleteUserProfile(): Mutation<DeleteUserProfileInput, UserDeleteResult>;
259
+ /** Invoke listCampaigns through this connection. */
260
+ listCampaigns(): Query<ListCampaignsInput, CampaignsList>;
261
+ /** Invoke listCanvases through this connection. */
262
+ listCanvases(): Query<ListCanvasesInput, CanvasesList>;
263
+ /** Invoke listSegments through this connection. */
264
+ listSegments(): Query<ListSegmentsInput, SegmentsList>;
265
+ /** Invoke getUserProfile through this connection. */
266
+ getUserProfile(): Query<GetUserProfileInput, UserProfile>;
267
+ }
268
+ /** Named connector connection kept outside Flow state. */
269
+ declare class Connection<BoundOperations = Operations> {
270
+ /** Stable provider and connection name. */
271
+ readonly reference: ConnectionRef;
272
+ /** Bound provider operations. */
273
+ readonly operations: BoundOperations;
274
+ /** Validate a reference and bind operations. */
275
+ constructor(reference: ConnectionRef, operations: BoundOperations);
276
+ }
277
+ /** Bind a client to a named connection. */
278
+ declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
279
+ /** Bind scripted operations to a named connection. */
280
+ declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
281
+
282
+ export { SegmentIdentitySchema as A, SegmentsListSchema as B, Connection as C, type DeleteUserProfileInput as D, TargetedSendResultSchema as E, TriggerCampaignSendInputSchema as F, type GetUserProfileInput as G, TriggerCanvasSendInputSchema as H, UpdateUserProfileInputSchema as I, UserDeleteResultSchema as J, UserProfileSchema as K, type ListCampaignsInput as L, UserWriteResultSchema as M, decodeCredentials as N, type Operations as O, isCredentialMaterialError as P, newConnection as Q, newConnectionWithOperations as R, type SegmentsList as S, type TriggerCampaignSendInput as T, type UserDeleteResult as U, type UserProfile as a, type CampaignsList as b, type ListCanvasesInput as c, type CanvasesList as d, type ListSegmentsInput as e, type TargetedSendResult as f, type TriggerCanvasSendInput as g, type UpdateUserProfileInput as h, type UserWriteResult as i, type Config as j, type Credentials as k, type CampaignIdentity as l, CampaignIdentitySchema as m, CampaignsListSchema as n, type CanvasIdentity as o, CanvasIdentitySchema as p, CanvasesListSchema as q, ConfigSchema as r, CredentialMaterialError as s, type CredentialSource as t, DeleteUserProfileInputSchema as u, GetUserProfileInputSchema as v, ListCampaignsInputSchema as w, ListCanvasesInputSchema as x, ListSegmentsInputSchema as y, type SegmentIdentity as z };