Skip to content

Commit ba37de3

Browse files
authored
Merge branch 'segmentio:main' into main
2 parents fb4e047 + 25c9d2a commit ba37de3

File tree

37 files changed

+527
-187
lines changed

37 files changed

+527
-187
lines changed

packages/browser-destinations/destinations/braze-cloud-plugins/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@segment/analytics-browser-actions-braze-cloud-plugins",
3-
"version": "1.85.0",
3+
"version": "1.86.0",
44
"license": "MIT",
55
"publishConfig": {
66
"access": "public",
@@ -15,7 +15,7 @@
1515
},
1616
"typings": "./dist/esm",
1717
"dependencies": {
18-
"@segment/analytics-browser-actions-braze": "^1.85.0",
18+
"@segment/analytics-browser-actions-braze": "^1.86.0",
1919
"@segment/browser-destination-runtime": "^1.77.0"
2020
},
2121
"peerDependencies": {

packages/browser-destinations/destinations/braze/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@segment/analytics-browser-actions-braze",
3-
"version": "1.85.0",
3+
"version": "1.86.0",
44
"license": "MIT",
55
"publishConfig": {
66
"access": "public",
@@ -33,7 +33,7 @@
3333
},
3434
"typings": "./dist/esm",
3535
"dependencies": {
36-
"@braze/web-sdk": "npm:@braze/web-sdk@^4.1.0",
36+
"@braze/web-sdk": "npm:@braze/web-sdk@^5",
3737
"@braze/web-sdk-v3": "npm:@braze/web-sdk@^3.5.1",
3838
"@segment/actions-core": "^3.148.0",
3939
"@segment/browser-destination-runtime": "^1.77.0"

packages/browser-destinations/destinations/braze/src/__tests__/__snapshots__/integration.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ NodeList [
7474
exports[`loads different versions from CDN undefined version:
7575
NodeList [
7676
<script
77-
src="https://js.appboycdn.com/web-sdk/4.6/braze.no-module.min.js"
77+
src="https://js.appboycdn.com/web-sdk/5.6/braze.no-module.min.js"
7878
status="loaded"
7979
type="text/javascript"
8080
/>,
@@ -85,7 +85,7 @@ exports[`loads different versions from CDN undefined version:
8585
1`] = `
8686
NodeList [
8787
<script
88-
src="https://js.appboycdn.com/web-sdk/4.10/braze.no-module.min.js"
88+
src="https://js.appboycdn.com/web-sdk/5.7/braze.no-module.min.js"
8989
status="loaded"
9090
type="text/javascript"
9191
/>,

packages/browser-destinations/destinations/braze/src/__tests__/integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe('loads different versions from CDN', () => {
143143
expect(scripts).toMatchSnapshot(`
144144
NodeList [
145145
<script
146-
src="https://js.appboycdn.com/web-sdk/4.6/braze.no-module.min.js"
146+
src="https://js.appboycdn.com/web-sdk/5.6/braze.no-module.min.js"
147147
status="loaded"
148148
type="text/javascript"
149149
/>,

packages/browser-destinations/destinations/braze/src/generated-types.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/browser-destinations/destinations/braze/src/index.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Settings } from './generated-types'
22
import type { BrowserDestinationDefinition } from '@segment/browser-destination-runtime/types'
33
import { browserDestination } from '@segment/browser-destination-runtime/shim'
4-
import type braze from '@braze/web-sdk'
4+
import * as braze from '@braze/web-sdk'
55
import type appboy from '@braze/web-sdk-v3'
66
import trackEvent from './trackEvent'
77
import updateUserProfile from './updateUserProfile'
@@ -18,25 +18,26 @@ declare global {
1818
}
1919
}
2020

21-
const defaultVersion = '4.10'
21+
const defaultVersion = '5.7'
2222

2323
const presets: DestinationDefinition['presets'] = [
2424
{
2525
name: 'Identify Calls',
26+
type: 'automatic',
2627
subscribe: 'type = "identify" or type = "group"',
2728
partnerAction: 'updateUserProfile',
28-
mapping: defaultValues(updateUserProfile.fields),
29-
type: 'automatic'
29+
mapping: defaultValues(updateUserProfile.fields)
3030
},
3131
{
3232
name: 'Order Completed calls',
33+
type: 'automatic',
3334
subscribe: 'type = "track" and event = "Order Completed"',
3435
partnerAction: 'trackPurchase',
35-
mapping: defaultValues(trackPurchase.fields),
36-
type: 'automatic'
36+
mapping: defaultValues(trackPurchase.fields)
3737
},
3838
{
3939
name: 'Track Calls',
40+
type: 'automatic',
4041
subscribe: 'type = "track" and event != "Order Completed"',
4142
partnerAction: 'trackEvent',
4243
mapping: {
@@ -47,8 +48,7 @@ const presets: DestinationDefinition['presets'] = [
4748
eventProperties: {
4849
'@path': '$.properties'
4950
}
50-
},
51-
type: 'automatic'
51+
}
5252
}
5353
]
5454

@@ -93,6 +93,10 @@ export const destination: BrowserDestinationDefinition<Settings, BrazeDestinatio
9393
{
9494
value: '5.4',
9595
label: '5.4'
96+
},
97+
{
98+
value: '5.7',
99+
label: '5.7'
96100
}
97101
],
98102
default: defaultVersion,
@@ -120,9 +124,11 @@ export const destination: BrowserDestinationDefinition<Settings, BrazeDestinatio
120124
{ label: 'US-07 (https://dashboard-07.braze.com)', value: 'sdk.iad-07.braze.com' },
121125
{ label: 'US-08 (https://dashboard-08.braze.com)', value: 'sdk.iad-08.braze.com' },
122126
{ label: 'US-09 (https://dashboard-09.braze.com)', value: 'sdk.iad-09.braze.com' },
127+
{ label: 'US-10 (https://dashboard-10.braze.com)', value: 'sdk.iad-10.braze.com' },
123128
{ label: 'EU-01 (https://dashboard-01.braze.eu)', value: 'sdk.fra-01.braze.eu' },
124129
{ label: 'EU-02 (https://dashboard-02.braze.eu)', value: 'sdk.fra-02.braze.eu' },
125-
{ label: 'AU-01 (https://dashboard.au-01.braze.com)', value: 'sdk.au-01.braze.com' }
130+
{ label: 'AU-01 (https://dashboard.au-01.braze.com)', value: 'sdk.au-01.braze.com' },
131+
{ label: 'ID-01 (https://dashboard.id-01.braze.com)', value: 'sdk.id-01.braze.com' }
126132
],
127133
default: 'sdk.iad-01.braze.com',
128134
required: true
@@ -137,7 +143,7 @@ export const destination: BrowserDestinationDefinition<Settings, BrazeDestinatio
137143
},
138144
allowUserSuppliedJavascript: {
139145
description:
140-
'To indicate that you trust the Braze dashboard users to write non-malicious Javascript click actions, set this property to true. If enableHtmlInAppMessages is true, this option will also be set to true. [See more details](https://js.appboycdn.com/web-sdk/latest/doc/modules/appboy.html#initializationoptions)',
146+
'To indicate that you trust the Braze dashboard users to write non-malicious Javascript click actions, set this property to true. [See more details](https://js.appboycdn.com/web-sdk/latest/doc/modules/appboy.html#initializationoptions)',
141147
label: 'Allow User Supplied Javascript',
142148
default: false,
143149
type: 'boolean',

packages/destination-actions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/action-destinations",
33
"description": "Destination Actions engine and definitions.",
4-
"version": "3.372.0",
4+
"version": "3.373.0",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/segmentio/action-destinations",

packages/destination-actions/src/destinations/dawn/__tests__/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import nock from 'nock'
22
import { createTestIntegration } from '@segment/actions-core'
33
import Definition from '../index'
4-
4+
import { DAWN_API_ENDPOINT } from '../utils'
55
const testDestination = createTestIntegration(Definition)
66

77
describe('Dawn Analytics', () => {
88
describe('testAuthentication', () => {
99
it('should validate authentication inputs', async () => {
10-
nock('https://api.dawnai.com')
11-
.post('/validate-auth')
10+
nock(`${DAWN_API_ENDPOINT}`)
11+
.post('/auth')
1212
.matchHeader('authorization', 'Bearer test-write-key')
1313
.matchHeader('user-agent', 'Segment (Actions)')
1414
.matchHeader('content-type', 'application/json')

packages/destination-actions/src/destinations/dawn/identifyUser/__tests__/index.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import nock from 'nock'
22
import { createTestIntegration } from '@segment/actions-core'
33
import Definition from '../../index'
4+
import { DAWN_API_ENDPOINT } from '../../utils'
45

56
const testDestination = createTestIntegration(Definition)
67

@@ -21,8 +22,8 @@ describe('Dawn Analytics - Identify User', () => {
2122
traits: { name: 'John Doe', email: 'john@example.com' }
2223
}
2324

24-
nock('https://api.dawnai.com')
25-
.post('/segment-identify', [
25+
nock(DAWN_API_ENDPOINT)
26+
.post('/sinks/segment/identify', [
2627
{
2728
user_id: 'test-user-id',
2829
traits: { name: 'John Doe', email: 'john@example.com' }
@@ -45,8 +46,8 @@ describe('Dawn Analytics - Identify User', () => {
4546
user_id: 'test-user-id'
4647
}
4748

48-
nock('https://api.dawnai.com')
49-
.post('/segment-identify', [
49+
nock(`${DAWN_API_ENDPOINT}`)
50+
.post('/sinks/segment/identify', [
5051
{
5152
user_id: 'test-user-id',
5253
traits: {}

packages/destination-actions/src/destinations/dawn/identifyUser/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ActionDefinition, RequestClient } from '@segment/actions-core'
22
import type { Settings } from '../generated-types'
33
import type { Payload } from './generated-types'
44
import { DawnIdentifyUser } from '../dawn-types'
5+
import { DAWN_API_ENDPOINT } from '../utils'
56

67
const getEventFromPayload = (payload: Payload): DawnIdentifyUser => {
78
const identifyUserPayload: DawnIdentifyUser = {
@@ -13,7 +14,7 @@ const getEventFromPayload = (payload: Payload): DawnIdentifyUser => {
1314

1415
const processData = async (request: RequestClient, settings: Settings, payload: Payload[]) => {
1516
const identifyUsers = payload.map((value) => getEventFromPayload(value))
16-
return request('https://api.dawnai.com/segment-identify', {
17+
return request(`${DAWN_API_ENDPOINT}/sinks/segment/identify`, {
1718
method: 'post',
1819
json: identifyUsers,
1920
headers: {

0 commit comments

Comments
 (0)