Skip to content

Commit 03ab659

Browse files
committed
batch 1
1 parent 53b87bf commit 03ab659

File tree

12 files changed

+58
-25
lines changed

12 files changed

+58
-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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** AAMPE_API_VERSION
2+
* Endpoint: /{region}/v1/
3+
* API reference: https://docs.aampe.com/
4+
*/
5+
export const AAMPE_API_VERSION = 'v1'

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ 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'
67

78
const destination: DestinationDefinition<Settings> = {
89
name: 'Aggregations.io (Actions)',
@@ -29,7 +30,7 @@ const destination: DestinationDefinition<Settings> = {
2930
testAuthentication: async (request, { settings }) => {
3031
try {
3132
return await request(
32-
`https://app.aggregations.io/api/v1/organization/ping-w?ingest_id=${settings.ingest_id}&schema=ARRAY_OF_EVENTS`,
33+
`https://app.aggregations.io/api/${AGGREGATIONS_IO_API_VERSION}/organization/ping-w?ingest_id=${settings.ingest_id}&schema=ARRAY_OF_EVENTS`,
3334
{
3435
method: 'get',
3536
headers: {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** AGGREGATIONS_IO_API_VERSION
2+
* Endpoint: /api/v1
3+
* API reference: https://aggregations.io/docs/
4+
*/
5+
export const AGGREGATIONS_IO_API_VERSION = 'v1'

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
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

@@ -51,7 +52,7 @@ const destination: DestinationDefinition<Settings> = {
5152
}
5253
},
5354
testAuthentication: (request, { settings }) => {
54-
return request('https://segment-api.ambeedata.com/v1/company-info', {
55+
return request(`https://segment-api.ambeedata.com/${AMBEE_API_VERSION}/company-info`, {
5556
method: 'post',
5657
json: settings
5758
})

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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'
45

56
const action: ActionDefinition<Settings, Payload> = {
67
title: 'Subscribe to Campaign',
@@ -87,7 +88,7 @@ const action: ActionDefinition<Settings, Payload> = {
8788
)
8889

8990
if (payload.segmentLibrary)
90-
return request('https://segment-api.ambeedata.com/v1/campaign-info', {
91+
return request(`https://segment-api.ambeedata.com/${AMBEE_API_VERSION}/campaign-info`, {
9192
method: 'post',
9293
json: {
9394
...payload,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** AMBEE_API_VERSION
2+
* Endpoint: /v1/*
3+
* API reference: https://docs.ambeedata.com/apis/overview
4+
*/
5+
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** ANGLER_AI_API_VERSION
2+
* Endpoint: /v1/*
3+
* API reference: https://docs.getangler.ai/reference
4+
*/
5+
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)