File tree Expand file tree Collapse file tree 9 files changed +35
-8
lines changed
packages/destination-actions/src/destinations Expand file tree Collapse file tree 9 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import { InvalidAuthenticationError } from '@segment/actions-core'
33import type { Settings } from './generated-types'
44import send from './send'
55import { 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
710const 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 : {
Original file line number Diff line number Diff line change 11import type { DestinationDefinition } from '@segment/actions-core'
22import type { Settings } from './generated-types'
3+ import { AMBEE_API_VERSION } from '../versioning-info'
34
45import subscribeUserToCampaign from './subscribeUserToCampaign'
56
7+ const AMBEE_BASE_URL = `https://segment-api.ambeedata.com/${ AMBEE_API_VERSION } `
8+
69const 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 } )
Original file line number Diff line number Diff line change 11import { ActionDefinition , PayloadValidationError } from '@segment/actions-core'
22import type { Settings } from '../generated-types'
33import 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
58const 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 ,
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ const destination: DestinationDefinition<Settings> = {
5959 }
6060 } ,
6161 testAuthentication : ( request ) => {
62- return request ( 'https://api-dev.prodeology.com/api/v1/ event-collection/validate-api-key' , { method : 'GET' } )
62+ return request ( ` ${ PRODEOLOGY_BASE_URL } / event-collection/validate-api-key` , { method : 'GET' } )
6363 }
6464 } ,
6565 presets,
Original file line number Diff line number Diff line change 11import type { ActionDefinition } from '@segment/actions-core'
22import type { Settings } from '../generated-types'
33import type { Payload } from './generated-types'
4+ import { USERMOTION_BASE_URL } from '../../versioning-info'
45
56const action : ActionDefinition < Settings , Payload > = {
67 title : 'Identify Company' ,
@@ -36,7 +37,7 @@ const action: ActionDefinition<Settings, Payload> = {
3637 }
3738 } ,
3839 perform : ( request , { payload } ) => {
39- return request ( 'https://api.usermotion.com/v1/ group' , {
40+ return request ( ` ${ USERMOTION_BASE_URL } / group` , {
4041 method : 'post' ,
4142 json : {
4243 id : payload . groupId ,
Original file line number Diff line number Diff line change 11import type { ActionDefinition } from '@segment/actions-core'
22import type { Settings } from '../generated-types'
33import type { Payload } from './generated-types'
4+ import { USERMOTION_BASE_URL } from '../../versioning-info'
45
56const action : ActionDefinition < Settings , Payload > = {
67 title : 'Identify' ,
@@ -42,7 +43,7 @@ const action: ActionDefinition<Settings, Payload> = {
4243 }
4344 } ,
4445 perform : ( request , { payload } ) => {
45- return request ( 'https://api.usermotion.com/v1/ identify' , {
46+ return request ( ` ${ USERMOTION_BASE_URL } / identify` , {
4647 method : 'post' ,
4748 json : {
4849 id : payload . userId ,
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ const destination: DestinationDefinition<Settings> = {
5757 }
5858 } ,
5959 testAuthentication : ( request ) => {
60- return request ( 'https://api.usermotion.com/v1/ verify' , { method : 'POST' } )
60+ return request ( ` ${ USERMOTION_BASE_URL } / verify` , { method : 'POST' } )
6161 }
6262 } ,
6363 presets,
Original file line number Diff line number Diff line change 11import type { ActionDefinition } from '@segment/actions-core'
22import type { Settings } from '../generated-types'
33import type { Payload } from './generated-types'
4+ import { USERMOTION_BASE_URL } from '../../versioning-info'
45
56const action : ActionDefinition < Settings , Payload > = {
67 title : 'Track Analytics Event' ,
@@ -50,7 +51,7 @@ const action: ActionDefinition<Settings, Payload> = {
5051 }
5152 } ,
5253 perform : ( request , { payload } ) => {
53- return request ( 'https://api.usermotion.com/v1/ track' , {
54+ return request ( ` ${ USERMOTION_BASE_URL } / track` , {
5455 method : 'post' ,
5556 json : {
5657 event : payload . eventName ,
Original file line number Diff line number Diff line change @@ -248,3 +248,18 @@ export const YOTPO_API_VERSION = 'v2'
248248export const TWILIO_MESSAGING_API_VERSION = '2010-04-01'
249249export const TWILIO_MESSAGING_SERVICES_API_VERSION = 'v1'
250250export const TWILIO_CONTENT_API_VERSION = 'v1'
251+
252+ /**
253+ * Aggregations.io API Version
254+ */
255+ export const AGGREGATIONS_IO_API_VERSION = 'v1'
256+
257+ /**
258+ * Canvas API Version
259+ */
260+ export const CANVAS_API_VERSION = 'v1'
261+
262+ /**
263+ * Pipedrive API Version
264+ */
265+ export const PIPEDRIVE_API_VERSION = 'v1'
You can’t perform that action at this time.
0 commit comments