Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AAMPE_API_VERSION } from './versioning-info'

export const SingaporeURL = 'https://ingestion-service-asia-southeast1-toqowp62ka-as.a.run.app/v1/'
export const GermanyURL = 'https://ingestion-service-europe-west3-toqowp62ka-ey.a.run.app/v1/'
export const FranceURL = 'https://ingestion-service-europe-west9-toqowp62ka-ey.a.run.app/v1/'
export const SingaporeURL = `https://ingestion-service-asia-southeast1-toqowp62ka-as.a.run.app/${AAMPE_API_VERSION}/`
export const GermanyURL = `https://ingestion-service-europe-west3-toqowp62ka-ey.a.run.app/${AAMPE_API_VERSION}/`
export const FranceURL = `https://ingestion-service-europe-west9-toqowp62ka-ey.a.run.app/${AAMPE_API_VERSION}/`
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** AAMPE_API_VERSION
* Endpoint: /{region}/v1/
* API reference: https://docs.aampe.com/
*/
export const AAMPE_API_VERSION = 'v1'
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { InvalidAuthenticationError } from '@segment/actions-core'
import type { Settings } from './generated-types'
import send from './send'
import { AggregationsAuthError } from './types'
import { AGGREGATIONS_IO_API_VERSION } from './versioning-info'

const destination: DestinationDefinition<Settings> = {
name: 'Aggregations.io (Actions)',
Expand All @@ -29,7 +30,7 @@ const destination: DestinationDefinition<Settings> = {
testAuthentication: async (request, { settings }) => {
try {
return await request(
`https://app.aggregations.io/api/v1/organization/ping-w?ingest_id=${settings.ingest_id}&schema=ARRAY_OF_EVENTS`,
`https://app.aggregations.io/api/${AGGREGATIONS_IO_API_VERSION}/organization/ping-w?ingest_id=${settings.ingest_id}&schema=ARRAY_OF_EVENTS`,
{
method: 'get',
headers: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** AGGREGATIONS_IO_API_VERSION
* Endpoint: /api/v1
* API reference: https://aggregations.io/docs/
*/
export const AGGREGATIONS_IO_API_VERSION = 'v1'
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { DestinationDefinition } from '@segment/actions-core'
import type { Settings } from './generated-types'
import { AMBEE_API_VERSION } from './versioning-info'

import subscribeUserToCampaign from './subscribeUserToCampaign'

Expand Down Expand Up @@ -51,7 +52,7 @@ const destination: DestinationDefinition<Settings> = {
}
},
testAuthentication: (request, { settings }) => {
return request('https://segment-api.ambeedata.com/v1/company-info', {
return request(`https://segment-api.ambeedata.com/${AMBEE_API_VERSION}/company-info`, {
method: 'post',
json: settings
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActionDefinition, PayloadValidationError } from '@segment/actions-core'
import type { Settings } from '../generated-types'
import type { Payload } from './generated-types'
import { AMBEE_API_VERSION } from '../versioning-info'

const action: ActionDefinition<Settings, Payload> = {
title: 'Subscribe to Campaign',
Expand Down Expand Up @@ -87,7 +88,7 @@ const action: ActionDefinition<Settings, Payload> = {
)

if (payload.segmentLibrary)
return request('https://segment-api.ambeedata.com/v1/campaign-info', {
return request(`https://segment-api.ambeedata.com/${AMBEE_API_VERSION}/campaign-info`, {
method: 'post',
json: {
...payload,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** AMBEE_API_VERSION
* Endpoint: /v1/*
* API reference: https://docs.ambeedata.com/apis/overview
*/
export const AMBEE_API_VERSION = 'v1'
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import { ANGLER_AI_API_VERSION } from './versioning-info'

export const baseURL = 'https://data.getangler.ai'

export const testEndpoint = () => {
return `/v1/me`
return `/${ANGLER_AI_API_VERSION}/me`
}

export const eventsEndpoint = (workspaceId: string) => {
return `/v1/workspaces/${workspaceId}/events`
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/events`
}

export const ordersEndpoint = (workspaceId: string) => {
return `/v1/workspaces/${workspaceId}/data/orders`
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/orders`
}

export const customersEndpoint = (workspaceId: string) => {
return `/v1/workspaces/${workspaceId}/data/customers`
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/customers`
}

export const lineItemsEndpoint = (workspaceId: string) => {
return `/v1/workspaces/${workspaceId}/data/line_items`
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/line_items`
}

export const productsEndpoint = (workspaceId: string) => {
return `/v1/workspaces/${workspaceId}/data/products`
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/data/products`
}

export const privacyEndpoint = (workspaceId: string) => {
return `/v1/workspaces/${workspaceId}/privacy/redact`
return `/${ANGLER_AI_API_VERSION}/workspaces/${workspaceId}/privacy/redact`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** ANGLER_AI_API_VERSION
* Endpoint: /v1/*
* API reference: https://docs.getangler.ai/reference
*/
export const ANGLER_AI_API_VERSION = 'v1'
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ActionDefinition } from '@segment/actions-core'
import type { Settings } from '../generated-types'
import type { Payload } from './generated-types'
import { ANTAVO_API_VERSION } from '../versioning-info'

const action: ActionDefinition<Settings, Payload> = {
title: 'Loyalty events',
Expand Down Expand Up @@ -36,7 +37,7 @@ const action: ActionDefinition<Settings, Payload> = {
}
},
perform: (request, data) => {
const url = `https://api.${data.settings.stack}.antavo.com/v1/webhook/segment`
const url = `https://api.${data.settings.stack}.antavo.com/${ANTAVO_API_VERSION}/webhook/segment`
const payload = {
...data.payload,
api_key: data.settings.api_key
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ActionDefinition } from '@segment/actions-core'
import type { Settings } from '../generated-types'
import type { Payload } from './generated-types'
import { ANTAVO_API_VERSION } from '../versioning-info'

const action: ActionDefinition<Settings, Payload> = {
title: 'Profile updates',
Expand Down Expand Up @@ -33,44 +34,44 @@ const action: ActionDefinition<Settings, Payload> = {
properties: {
first_name: {
label: 'First name',
description: 'Customer\'s first name',
description: "Customer's first name",
type: 'string'
},
last_name: {
label: 'Last name',
description: 'Customer\'s last name',
description: "Customer's last name",
type: 'string'
},
email: {
label: 'Email',
description: 'Customer\'s email address',
description: "Customer's email address",
type: 'string'
},
birth_date: {
label: 'Birthdate',
description: 'Customer\'s birth date',
description: "Customer's birth date",
type: 'string'
},
gender: {
label: 'Gender',
description: 'Customer\'s gender',
description: "Customer's gender",
type: 'string'
},
language: {
label: 'Language',
description: 'Customer\'s language',
description: "Customer's language",
type: 'string'
},
phone: {
label: 'Phone',
description: 'Customer\'s phone number',
description: "Customer's phone number",
type: 'string'
},
mobile_phone: {
label: 'Mobile phone',
description: 'Customer\'s mobile phone number',
description: "Customer's mobile phone number",
type: 'string'
},
}
},
default: {
first_name: {
Expand Down Expand Up @@ -98,10 +99,10 @@ const action: ActionDefinition<Settings, Payload> = {
'@path': '$.traits.mobile_phone'
}
}
},
}
},
perform: (request, data) => {
const url = `https://api.${data.settings.stack}.antavo.com/v1/webhook/segment`
const url = `https://api.${data.settings.stack}.antavo.com/${ANTAVO_API_VERSION}/webhook/segment`
const payload = {
...data.payload,
action: 'profile',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** ANTAVO_API_VERSION
* Endpoint: /v1/*
* API reference: https://developers.antavo.com/docs/antavo-apis
*/
export const ANTAVO_API_VERSION = 'v1'
Loading