Skip to content

Commit 8180640

Browse files
committed
batch 1
1 parent 53b87bf commit 8180640

File tree

12 files changed

+59
-25
lines changed

12 files changed

+59
-25
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
import { AAMPE_API_VERSION } from './versioning-info'
12

2-
export const SingaporeURL = 'https://ingestion-service-asia-southeast1-toqowp62ka-as.a.run.app/v1/'
3-
export const GermanyURL = 'https://ingestion-service-europe-west3-toqowp62ka-ey.a.run.app/v1/'
4-
export const FranceURL = 'https://ingestion-service-europe-west9-toqowp62ka-ey.a.run.app/v1/'
3+
export const SingaporeURL = `https://ingestion-service-asia-southeast1-toqowp62ka-as.a.run.app/${AAMPE_API_VERSION}/`
4+
export const GermanyURL = `https://ingestion-service-europe-west3-toqowp62ka-ey.a.run.app/${AAMPE_API_VERSION}/`
5+
export const FranceURL = `https://ingestion-service-europe-west9-toqowp62ka-ey.a.run.app/${AAMPE_API_VERSION}/`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** AAMPE_API_VERSION
2+
* Endpoint: /{region}/v1/
3+
*/
4+
export const AAMPE_API_VERSION = 'v1'

packages/destination-actions/src/destinations/aggregations-io/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { InvalidAuthenticationError } from '@segment/actions-core'
33
import type { Settings } from './generated-types'
44
import send from './send'
55
import { AggregationsAuthError } from './types'
6+
import { AGGREGATIONS_IO_API_VERSION } from './versioning-info'
7+
8+
const AGGREGATIONS_BASE_URL = `https://app.aggregations.io/api/${AGGREGATIONS_IO_API_VERSION}`
69

710
const destination: DestinationDefinition<Settings> = {
811
name: 'Aggregations.io (Actions)',
@@ -29,7 +32,7 @@ const destination: DestinationDefinition<Settings> = {
2932
testAuthentication: async (request, { settings }) => {
3033
try {
3134
return await request(
32-
`https://app.aggregations.io/api/v1/organization/ping-w?ingest_id=${settings.ingest_id}&schema=ARRAY_OF_EVENTS`,
35+
`${AGGREGATIONS_BASE_URL}/organization/ping-w?ingest_id=${settings.ingest_id}&schema=ARRAY_OF_EVENTS`,
3336
{
3437
method: 'get',
3538
headers: {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** AGGREGATIONS_IO_API_VERSION
2+
* Endpoint: /api/v1
3+
*/
4+
export const AGGREGATIONS_IO_API_VERSION = 'v1'

packages/destination-actions/src/destinations/ambee/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import type { DestinationDefinition } from '@segment/actions-core'
22
import type { Settings } from './generated-types'
3+
import { AMBEE_API_VERSION } from './versioning-info'
34

45
import subscribeUserToCampaign from './subscribeUserToCampaign'
56

7+
const AMBEE_BASE_URL = `https://segment-api.ambeedata.com/${AMBEE_API_VERSION}`
8+
69
const destination: DestinationDefinition<Settings> = {
710
name: 'Ambee (Actions)',
811
slug: 'actions-ambee',
@@ -51,7 +54,7 @@ const destination: DestinationDefinition<Settings> = {
5154
}
5255
},
5356
testAuthentication: (request, { settings }) => {
54-
return request('https://segment-api.ambeedata.com/v1/company-info', {
57+
return request(`${AMBEE_BASE_URL}/company-info`, {
5558
method: 'post',
5659
json: settings
5760
})

packages/destination-actions/src/destinations/ambee/subscribeUserToCampaign/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ActionDefinition, PayloadValidationError } from '@segment/actions-core'
22
import type { Settings } from '../generated-types'
33
import type { Payload } from './generated-types'
4+
import { AMBEE_API_VERSION } from '../versioning-info'
5+
6+
const AMBEE_BASE_URL = `https://segment-api.ambeedata.com/${AMBEE_API_VERSION}`
47

58
const action: ActionDefinition<Settings, Payload> = {
69
title: 'Subscribe to Campaign',
@@ -87,7 +90,7 @@ const action: ActionDefinition<Settings, Payload> = {
8790
)
8891

8992
if (payload.segmentLibrary)
90-
return request('https://segment-api.ambeedata.com/v1/campaign-info', {
93+
return request(`${AMBEE_BASE_URL}/campaign-info`, {
9194
method: 'post',
9295
json: {
9396
...payload,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** AMBEE_API_VERSION
2+
* Endpoint: /v1/*
3+
*/
4+
export const AMBEE_API_VERSION = 'v1'
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1+
import { ANGLER_AI_API_VERSION } from './versioning-info'
2+
13
export const baseURL = 'https://data.getangler.ai'
24

35
export const testEndpoint = () => {
4-
return `/v1/me`
6+
return `/${ANGLER_AI_API_VERSION}/me`
57
}
68

79
export const eventsEndpoint = (workspaceId: string) => {
8-
return `/v1/workspaces/${workspaceId}/events`
10+
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/events`
911
}
1012

1113
export const ordersEndpoint = (workspaceId: string) => {
12-
return `/v1/workspaces/${workspaceId}/data/orders`
14+
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/orders`
1315
}
1416

1517
export const customersEndpoint = (workspaceId: string) => {
16-
return `/v1/workspaces/${workspaceId}/data/customers`
18+
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/customers`
1719
}
1820

1921
export const lineItemsEndpoint = (workspaceId: string) => {
20-
return `/v1/workspaces/${workspaceId}/data/line_items`
22+
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/line_items`
2123
}
2224

2325
export const productsEndpoint = (workspaceId: string) => {
24-
return `/v1/workspaces/${workspaceId}/data/products`
26+
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/products`
2527
}
2628

2729
export const privacyEndpoint = (workspaceId: string) => {
28-
return `/v1/workspaces/${workspaceId}/privacy/redact`
30+
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/privacy/redact`
2931
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** ANGLER_AI_API_VERSION
2+
* Endpoint: /v1/*
3+
*/
4+
export const ANGLER_AI_API_VERSION = 'v1'

packages/destination-actions/src/destinations/antavo/event/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ActionDefinition } from '@segment/actions-core'
22
import type { Settings } from '../generated-types'
33
import type { Payload } from './generated-types'
4+
import { ANTAVO_API_VERSION } from '../versioning-info'
45

56
const action: ActionDefinition<Settings, Payload> = {
67
title: 'Loyalty events',
@@ -36,7 +37,7 @@ const action: ActionDefinition<Settings, Payload> = {
3637
}
3738
},
3839
perform: (request, data) => {
39-
const url = `https://api.${data.settings.stack}.antavo.com/v1/webhook/segment`
40+
const url = `https://api.${data.settings.stack}.antavo.com/${ANTAVO_API_VERSION}/webhook/segment`
4041
const payload = {
4142
...data.payload,
4243
api_key: data.settings.api_key

0 commit comments

Comments
 (0)