Comparing version 1.1.0 to 1.2.0
import * as campaigns from './campaigns'; | ||
import * as messages from './messages'; | ||
import * as transactional from './transactional'; | ||
export declare class Braze { | ||
@@ -20,3 +21,4 @@ /** | ||
send: (body: campaigns.trigger.CampaignsTriggerSendObject) => Promise<{ | ||
[x: string]: any; | ||
dispatch_id: string; | ||
message: string; | ||
}>; | ||
@@ -27,6 +29,34 @@ }; | ||
send: (body: messages.MessagesSendObject) => Promise<{ | ||
[x: string]: any; | ||
dispatch_id: string; | ||
message: string; | ||
}>; | ||
}; | ||
transactional: { | ||
v1: { | ||
campaigns: { | ||
send: (campaignId: string, body: transactional.v1.campaigns.TransactionalV1CampaignsSendObject) => Promise<{ | ||
dispatch_id: string; | ||
/** | ||
* @param apiUrl - Braze REST endpoint. | ||
* @param apiKey - Braze API key. | ||
*/ | ||
status: "aborted" | "sent" | "processed" | "delivered" | "bounced"; | ||
metadata: { | ||
external_send_id: string; | ||
campaign_api_id: string; | ||
received_at?: string | undefined; | ||
enqueued_at?: string | undefined; | ||
executed_at?: string | undefined; | ||
sent_at?: string | undefined; | ||
processed_at?: string | undefined; | ||
delivered_at?: string | undefined; | ||
bounced_at?: string | undefined; | ||
aborted_at?: string | undefined; | ||
reason?: string | undefined; | ||
}; | ||
}>; | ||
}; | ||
}; | ||
}; | ||
} | ||
//# sourceMappingURL=Braze.d.ts.map |
@@ -6,2 +6,3 @@ "use strict"; | ||
const messages = require("./messages"); | ||
const transactional = require("./transactional"); | ||
class Braze { | ||
@@ -21,2 +22,9 @@ /** | ||
}; | ||
this.transactional = { | ||
v1: { | ||
campaigns: { | ||
send: (campaignId, body) => transactional.v1.campaigns.send(this.apiUrl, this.apiKey, campaignId, body), | ||
}, | ||
}, | ||
}; | ||
if (!apiUrl || typeof apiUrl !== 'string') { | ||
@@ -23,0 +31,0 @@ throw new Error(`Invalid Braze API URL: ${apiUrl}`); |
@@ -15,4 +15,5 @@ import type { CampaignsTriggerSendObject } from './types'; | ||
export declare function send(apiUrl: string, apiKey: string, body: CampaignsTriggerSendObject): Promise<{ | ||
[x: string]: any; | ||
dispatch_id: string; | ||
message: string; | ||
}>; | ||
//# sourceMappingURL=send.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { ConnectedAudienceObject } from '../../common/types'; | ||
import type { Attributes, ConnectedAudienceObject, TriggerProperties, UserAlias } from '../../common/types'; | ||
/** | ||
@@ -15,18 +15,14 @@ * Request body for sending campaign messages via API-triggered delivery. | ||
} | ||
declare type TriggerProperties = object; | ||
interface Recipient { | ||
trigger_properties?: TriggerProperties; | ||
send_to_existing_only?: boolean; | ||
attributes?: object; | ||
attributes?: Attributes; | ||
} | ||
interface RecipientWithExternalUserId extends Recipient { | ||
export interface RecipientWithExternalUserId extends Recipient { | ||
external_user_id: string; | ||
} | ||
interface RecipientWithUserAlias extends Recipient { | ||
user_alias: { | ||
alias_name: string; | ||
alias_label: string; | ||
}; | ||
export interface RecipientWithUserAlias extends Recipient { | ||
user_alias: UserAlias; | ||
} | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -30,3 +30,9 @@ /** | ||
declare type Comparison = 'after' | 'before' | 'does_not_equal' | 'does_not_exist' | 'does_not_include_value' | 'does_not_match_regex' | 'equals' | 'exists' | 'greater_than' | 'greater_than_or_equal_to' | 'greater_than_x_days_ago' | 'greater_than_x_days_in_the_future' | 'includes_value' | 'less_than' | 'less_than_or_equal_to' | 'less_than_x_days_ago' | 'less_than_x_days_in_the_future' | 'matches_regex' | 'not_equal'; | ||
export declare type TriggerProperties = object; | ||
export declare type Attributes = object; | ||
export interface UserAlias { | ||
alias_name: string; | ||
alias_label: string; | ||
} | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -5,2 +5,3 @@ export * from './Braze'; | ||
export * from './messages/types'; | ||
export * from './transactional/v1/campaigns/types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -21,2 +21,3 @@ "use strict"; | ||
__exportStar(require("./messages/types"), exports); | ||
__exportStar(require("./transactional/v1/campaigns/types"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -15,4 +15,5 @@ import type { MessagesSendObject } from './types'; | ||
export declare function send(apiUrl: string, apiKey: string, body: MessagesSendObject): Promise<{ | ||
[x: string]: any; | ||
dispatch_id: string; | ||
message: string; | ||
}>; | ||
//# sourceMappingURL=send.d.ts.map |
{ | ||
"name": "braze-api", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Track users, send messages, export data, and more with Braze API.", | ||
@@ -5,0 +5,0 @@ "author": "Mark <mark@remarkablemark.org>", |
@@ -113,3 +113,3 @@ # braze-api | ||
- [ ] /sends/id/create | ||
- [ ] /transactional/v1/campaigns/{{CAMPAIGN_ID}}/send | ||
- [x] /transactional/v1/campaigns/{{CAMPAIGN_ID}}/send | ||
@@ -116,0 +116,0 @@ ### Schedule messages |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44165
75
597