@segment/action-destinations 3.435.0 → 3.436.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/amazon-amc/index.js +14 -0
- package/dist/destinations/amazon-amc/index.js.map +1 -1
- package/dist/destinations/amplitude/groupIdentifyUser/index.js +23 -21
- package/dist/destinations/amplitude/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/aws-s3/index.js +14 -0
- package/dist/destinations/aws-s3/index.js.map +1 -1
- package/dist/destinations/delivrai-activate/index.js +14 -0
- package/dist/destinations/delivrai-activate/index.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +14 -0
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/index.js +14 -0
- package/dist/destinations/dynamic-yield-audiences/index.js.map +1 -1
- package/dist/destinations/facebook-custom-audiences/index.js +14 -0
- package/dist/destinations/facebook-custom-audiences/index.js.map +1 -1
- package/dist/destinations/first-party-dv360/index.js +14 -0
- package/dist/destinations/first-party-dv360/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/index.js +14 -0
- package/dist/destinations/google-enhanced-conversions/index.js.map +1 -1
- package/dist/destinations/hubspot/errors.d.ts +1 -0
- package/dist/destinations/hubspot/errors.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/client.d.ts +5 -1
- package/dist/destinations/hubspot/upsertObject/client.js +27 -0
- package/dist/destinations/hubspot/upsertObject/client.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/common-fields.js +133 -2
- package/dist/destinations/hubspot/upsertObject/common-fields.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/constants.d.ts +1 -0
- package/dist/destinations/hubspot/upsertObject/constants.js +2 -1
- package/dist/destinations/hubspot/upsertObject/constants.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/cache-functions.d.ts +5 -2
- package/dist/destinations/hubspot/upsertObject/functions/cache-functions.js +30 -5
- package/dist/destinations/hubspot/upsertObject/functions/cache-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/dynamic-field-functions.d.ts +29 -0
- package/dist/destinations/hubspot/upsertObject/functions/dynamic-field-functions.js +103 -1
- package/dist/destinations/hubspot/upsertObject/functions/dynamic-field-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-association-functions.d.ts +4 -3
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-association-functions.js +11 -5
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-association-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-list-functions.d.ts +9 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-list-functions.js +152 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-list-functions.js.map +1 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-record-functions.js +5 -0
- package/dist/destinations/hubspot/upsertObject/functions/hubspot-record-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/validation-functions.d.ts +1 -1
- package/dist/destinations/hubspot/upsertObject/functions/validation-functions.js +22 -1
- package/dist/destinations/hubspot/upsertObject/functions/validation-functions.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/generated-types.d.ts +18 -0
- package/dist/destinations/hubspot/upsertObject/index.js +46 -36
- package/dist/destinations/hubspot/upsertObject/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertObject/types.d.ts +53 -11
- package/dist/destinations/hubspot/upsertObject/types.js.map +1 -1
- package/dist/destinations/iterable-lists/index.js +14 -0
- package/dist/destinations/iterable-lists/index.js.map +1 -1
- package/dist/destinations/klaviyo/index.js +14 -0
- package/dist/destinations/klaviyo/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/index.js +14 -0
- package/dist/destinations/marketo-static-lists/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/index.js +2 -2
- package/dist/destinations/ms-bing-capi/index.js.map +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/fields.js +1 -1
- package/dist/destinations/ms-bing-capi/sendEvent/fields.js.map +1 -1
- package/dist/destinations/ortto/common-fields.js +0 -21
- package/dist/destinations/ortto/common-fields.js.map +1 -1
- package/dist/destinations/ortto/trackActivity/generated-types.d.ts +2 -2
- package/dist/destinations/ortto/trackActivity/index.js +21 -2
- package/dist/destinations/ortto/trackActivity/index.js.map +1 -1
- package/dist/destinations/ortto/upsertContactProfile/generated-types.d.ts +2 -2
- package/dist/destinations/ortto/upsertContactProfile/index.js +23 -2
- package/dist/destinations/ortto/upsertContactProfile/index.js.map +1 -1
- package/dist/destinations/ortto-audiences/syncAudience/index.js +2 -0
- package/dist/destinations/ortto-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/reddit-audiences/index.js +14 -0
- package/dist/destinations/reddit-audiences/index.js.map +1 -1
- package/dist/destinations/sendgrid-audiences/index.js +14 -0
- package/dist/destinations/sendgrid-audiences/index.js.map +1 -1
- package/dist/destinations/snap-audiences/index.js +14 -0
- package/dist/destinations/snap-audiences/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/common-fields.d.ts +2 -0
- package/dist/destinations/stackadapt-audiences/common-fields.js +215 -0
- package/dist/destinations/stackadapt-audiences/common-fields.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/common-functions.d.ts +8 -0
- package/dist/destinations/stackadapt-audiences/common-functions.js +212 -0
- package/dist/destinations/stackadapt-audiences/common-functions.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/constants.d.ts +15 -0
- package/dist/destinations/stackadapt-audiences/constants.js +133 -0
- package/dist/destinations/stackadapt-audiences/constants.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.d.ts +2 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js +63 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/generated-types.d.ts +24 -5
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/index.js +19 -83
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/forwardProfile/generated-types.d.ts +15 -9
- package/dist/destinations/stackadapt-audiences/forwardProfile/index.js +78 -124
- package/dist/destinations/stackadapt-audiences/forwardProfile/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/generated-types.d.ts +1 -0
- package/dist/destinations/stackadapt-audiences/index.js +20 -8
- package/dist/destinations/stackadapt-audiences/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/types.d.ts +37 -0
- package/dist/destinations/taboola-actions/index.js +14 -0
- package/dist/destinations/taboola-actions/index.js.map +1 -1
- package/dist/destinations/tiktok-audiences/index.js +14 -0
- package/dist/destinations/tiktok-audiences/index.js.map +1 -1
- package/dist/destinations/webhook-audiences/index.js +14 -0
- package/dist/destinations/webhook-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/index.js +14 -0
- package/dist/destinations/yahoo-audiences/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.d.ts +0 -3
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js +0 -83
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/forwardProfile/functions.d.ts +0 -3
- package/dist/destinations/stackadapt-audiences/forwardProfile/functions.js +0 -131
- package/dist/destinations/stackadapt-audiences/forwardProfile/functions.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/functions.d.ts +0 -7
- package/dist/destinations/stackadapt-audiences/functions.js +0 -62
- package/dist/destinations/stackadapt-audiences/functions.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.audience_only_fields = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
exports.audience_only_fields = {
|
|
6
|
+
marketing_status: {
|
|
7
|
+
label: 'Marketing Status',
|
|
8
|
+
description: 'In certain jurisdictions, explicit consent may be required to send email marketing communications to imported profiles. Consult independent counsel for further guidance.',
|
|
9
|
+
type: 'string',
|
|
10
|
+
required: true,
|
|
11
|
+
disabledInputMethods: ['literal', 'variable', 'function', 'freeform', 'enrichment'],
|
|
12
|
+
choices: [
|
|
13
|
+
{ label: 'Opted-in (Profiles can receive email marketing)', value: constants_1.MarketingStatus.OPT_IN },
|
|
14
|
+
{ label: 'Indeterminate (Profiles that have not opted-out, but are excluded from email marketing)', value: constants_1.MarketingStatus.Indeterminate }
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
traits_or_props: {
|
|
18
|
+
label: 'Event Properties',
|
|
19
|
+
type: 'object',
|
|
20
|
+
description: 'The properties of the user or event.',
|
|
21
|
+
unsafe_hidden: true,
|
|
22
|
+
required: true,
|
|
23
|
+
default: {
|
|
24
|
+
'@if': {
|
|
25
|
+
exists: { '@path': '$.properties' },
|
|
26
|
+
then: { '@path': '$.properties' },
|
|
27
|
+
else: { '@path': '$.traits' }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
segment_computation_class: {
|
|
32
|
+
label: 'Segment Computation Class',
|
|
33
|
+
required: true,
|
|
34
|
+
description: "Segment computation class used to determine if input event is from an Engage Audience'.",
|
|
35
|
+
type: 'string',
|
|
36
|
+
unsafe_hidden: true,
|
|
37
|
+
default: {
|
|
38
|
+
'@path': '$.context.personas.computation_class'
|
|
39
|
+
},
|
|
40
|
+
choices: [{ label: 'audience', value: 'audience' }, { label: 'journey_step', value: 'journey_step' }]
|
|
41
|
+
},
|
|
42
|
+
segment_computation_id: {
|
|
43
|
+
label: 'Segment Computation ID',
|
|
44
|
+
description: 'For audience enter/exit events, this will be the audience ID.',
|
|
45
|
+
type: 'string',
|
|
46
|
+
required: true,
|
|
47
|
+
unsafe_hidden: true,
|
|
48
|
+
default: {
|
|
49
|
+
'@path': '$.context.personas.computation_id'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
segment_computation_key: {
|
|
53
|
+
label: 'Segment Computation Key',
|
|
54
|
+
description: 'For audience enter/exit events, this will be the audience key.',
|
|
55
|
+
type: 'string',
|
|
56
|
+
unsafe_hidden: true,
|
|
57
|
+
required: true,
|
|
58
|
+
default: {
|
|
59
|
+
'@path': '$.context.personas.computation_key'
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/destinations/stackadapt-audiences/forwardAudienceEvent/fields.ts"],"names":[],"mappings":";;;AACA,4CAA8C;AAEjC,QAAA,oBAAoB,GAA+B;IAC5D,gBAAgB,EAAE;QAChB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,2KAA2K;QACxL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC;QACnF,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,iDAAiD,EAAE,KAAK,EAAE,2BAAe,CAAC,MAAM,EAAE;YAC3F,EAAE,KAAK,EAAE,yFAAyF,EAAE,KAAK,EAAE,2BAAe,CAAC,aAAa,EAAE;SAC3I;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,sCAAsC;QACnD,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;gBACnC,IAAI,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;gBACjC,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;aAC9B;SACF;KACF;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,2BAA2B;QAClC,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,yFAAyF;QACtG,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,IAAI;QACnB,OAAO,EAAE;YACP,OAAO,EAAE,sCAAsC;SAChD;QACD,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EAAC,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;KACrG;IACD,sBAAsB,EAAE;QACtB,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,+DAA+D;QAC5E,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,IAAI;QACnB,OAAO,EAAE;YACP,OAAO,EAAE,mCAAmC;SAC7C;KACF;IACD,uBAAuB,EAAE;QACvB,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,gEAAgE;QAC7E,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,OAAO,EAAE,oCAAoC;SAC9C;KACF;CACJ,CAAA"}
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
export interface Payload {
|
|
2
|
-
|
|
2
|
+
standard_traits?: {
|
|
3
|
+
first_name?: string;
|
|
4
|
+
last_name?: string;
|
|
5
|
+
phone?: string;
|
|
6
|
+
address?: string;
|
|
7
|
+
city?: string;
|
|
8
|
+
country?: string;
|
|
9
|
+
state?: string;
|
|
10
|
+
timezone?: string;
|
|
11
|
+
postal_code?: string;
|
|
12
|
+
birth_day?: number;
|
|
13
|
+
birth_month?: number;
|
|
14
|
+
birth_year?: number;
|
|
15
|
+
birth_date?: string;
|
|
16
|
+
};
|
|
17
|
+
custom_traits?: {
|
|
3
18
|
[k: string]: unknown;
|
|
4
19
|
};
|
|
5
20
|
user_id?: string;
|
|
6
|
-
event_type
|
|
21
|
+
event_type: string;
|
|
7
22
|
enable_batching: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
23
|
+
marketing_status: string;
|
|
24
|
+
traits_or_props: {
|
|
25
|
+
[k: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
segment_computation_class: string;
|
|
28
|
+
segment_computation_id: string;
|
|
10
29
|
segment_computation_key: string;
|
|
11
|
-
|
|
30
|
+
email: string;
|
|
12
31
|
}
|
|
@@ -1,99 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const common_functions_1 = require("../common-functions");
|
|
4
|
+
const common_fields_1 = require("../common-fields");
|
|
5
|
+
const fields_1 = require("./fields");
|
|
5
6
|
const action = {
|
|
6
|
-
title: '
|
|
7
|
-
description: '
|
|
7
|
+
title: 'Sync Audience',
|
|
8
|
+
description: 'Sync Segment Engage audience and user profile details to StackAdapt',
|
|
8
9
|
defaultSubscription: 'type = "identify" or type = "track"',
|
|
9
10
|
fields: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
required: true,
|
|
16
|
-
default: {
|
|
17
|
-
'@if': {
|
|
18
|
-
exists: { '@path': '$.properties.audience_key' },
|
|
19
|
-
then: { '@path': '$.properties' },
|
|
20
|
-
else: { '@path': '$.traits' }
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
user_id: {
|
|
25
|
-
label: 'Segment User ID',
|
|
26
|
-
description: 'The ID of the user in Segment',
|
|
11
|
+
...common_fields_1.common_fields,
|
|
12
|
+
...fields_1.audience_only_fields,
|
|
13
|
+
email: {
|
|
14
|
+
label: 'Email',
|
|
15
|
+
description: 'The email address of the user.',
|
|
27
16
|
type: 'string',
|
|
17
|
+
format: 'email',
|
|
18
|
+
required: true,
|
|
28
19
|
default: {
|
|
29
20
|
'@if': {
|
|
30
|
-
exists: { '@path': '$.
|
|
31
|
-
then: { '@path': '$.
|
|
32
|
-
else: { '@path': '$.
|
|
21
|
+
exists: { '@path': '$.traits.email' },
|
|
22
|
+
then: { '@path': '$.traits.email' },
|
|
23
|
+
else: { '@path': '$.properties.email' }
|
|
33
24
|
}
|
|
34
25
|
}
|
|
35
|
-
},
|
|
36
|
-
event_type: {
|
|
37
|
-
label: 'Event Type',
|
|
38
|
-
description: 'The Segment event type (identify, alias, etc.)',
|
|
39
|
-
type: 'string',
|
|
40
|
-
default: {
|
|
41
|
-
'@path': '$.type'
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
enable_batching: {
|
|
45
|
-
type: 'boolean',
|
|
46
|
-
label: 'Batch Profiles',
|
|
47
|
-
unsafe_hidden: true,
|
|
48
|
-
description: 'When enabled, Segment will batch profiles together and send them to StackAdapt in a single request.',
|
|
49
|
-
required: true,
|
|
50
|
-
default: true
|
|
51
|
-
},
|
|
52
|
-
segment_computation_class: {
|
|
53
|
-
label: 'Segment Computation Class',
|
|
54
|
-
description: "Segment computation class used to determine if input event is from an Engage Audience'.",
|
|
55
|
-
type: 'string',
|
|
56
|
-
unsafe_hidden: true,
|
|
57
|
-
default: {
|
|
58
|
-
'@path': '$.context.personas.computation_class'
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
segment_computation_id: {
|
|
62
|
-
label: 'Segment Computation ID',
|
|
63
|
-
description: 'For audience enter/exit events, this will be the audience ID.',
|
|
64
|
-
type: 'string',
|
|
65
|
-
unsafe_hidden: true,
|
|
66
|
-
default: {
|
|
67
|
-
'@path': '$.context.personas.computation_id'
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
segment_computation_key: {
|
|
71
|
-
label: 'Segment Computation Key',
|
|
72
|
-
description: 'For audience enter/exit events, this will be the audience key.',
|
|
73
|
-
type: 'string',
|
|
74
|
-
unsafe_hidden: true,
|
|
75
|
-
required: true,
|
|
76
|
-
default: {
|
|
77
|
-
'@path': '$.context.personas.computation_key'
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
advertiser_id: {
|
|
81
|
-
label: 'Advertiser',
|
|
82
|
-
description: 'The StackAdapt advertiser to add the profile to.',
|
|
83
|
-
type: 'string',
|
|
84
|
-
disabledInputMethods: ['literal', 'variable', 'function', 'freeform', 'enrichment'],
|
|
85
|
-
required: true,
|
|
86
|
-
dynamic: true
|
|
87
26
|
}
|
|
88
27
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
perform: async (request, { payload }) => {
|
|
93
|
-
return await (0, functions_1.performForwardAudienceEvents)(request, [payload]);
|
|
28
|
+
perform: async (request, { payload, settings }) => {
|
|
29
|
+
return await (0, common_functions_1.send)(request, [payload], settings, true);
|
|
94
30
|
},
|
|
95
|
-
performBatch: async (request, { payload }) => {
|
|
96
|
-
return await (0,
|
|
31
|
+
performBatch: async (request, { payload, settings }) => {
|
|
32
|
+
return await (0, common_functions_1.send)(request, payload, settings, true);
|
|
97
33
|
}
|
|
98
34
|
};
|
|
99
35
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/stackadapt-audiences/forwardAudienceEvent/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/stackadapt-audiences/forwardAudienceEvent/index.ts"],"names":[],"mappings":";;AAGA,0DAA0C;AAC1C,oDAAgD;AAChD,qCAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,qEAAqE;IAClF,mBAAmB,EAAE,qCAAqC;IAC1D,MAAM,EAAE;QACN,GAAG,6BAAa;QAChB,GAAG,6BAAoB;QACvB,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACrC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACnC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;iBACxC;aACF;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChD,OAAO,MAAM,IAAA,uBAAI,EAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IACvD,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QACrD,OAAO,MAAM,IAAA,uBAAI,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IACrD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
export interface Payload {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
lastName?: string;
|
|
2
|
+
standard_traits?: {
|
|
3
|
+
first_name?: string;
|
|
4
|
+
last_name?: string;
|
|
6
5
|
phone?: string;
|
|
6
|
+
address?: string;
|
|
7
7
|
city?: string;
|
|
8
8
|
country?: string;
|
|
9
9
|
state?: string;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
timezone?: string;
|
|
11
|
+
postal_code?: string;
|
|
12
|
+
birth_day?: number;
|
|
13
|
+
birth_month?: number;
|
|
14
|
+
birth_year?: number;
|
|
15
|
+
birth_date?: string;
|
|
16
|
+
};
|
|
17
|
+
custom_traits?: {
|
|
12
18
|
[k: string]: unknown;
|
|
13
19
|
};
|
|
14
20
|
user_id?: string;
|
|
15
|
-
|
|
16
|
-
event_type?: string;
|
|
21
|
+
event_type: string;
|
|
17
22
|
enable_batching: boolean;
|
|
18
|
-
|
|
23
|
+
previous_id?: string;
|
|
24
|
+
email?: string;
|
|
19
25
|
}
|
|
@@ -1,82 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const common_functions_1 = require("../common-functions");
|
|
4
|
+
const common_fields_1 = require("../common-fields");
|
|
5
5
|
const action = {
|
|
6
6
|
title: 'Forward Profile',
|
|
7
|
-
description: 'Forward new or updated user
|
|
7
|
+
description: 'Forward new or updated user profiles to StackAdapt',
|
|
8
8
|
defaultSubscription: 'type = "identify" or type = "alias" or type = "track"',
|
|
9
9
|
fields: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
description: "The user's first name."
|
|
27
|
-
},
|
|
28
|
-
lastName: {
|
|
29
|
-
label: 'Last Name',
|
|
30
|
-
type: 'string',
|
|
31
|
-
description: "The user's last name."
|
|
32
|
-
},
|
|
33
|
-
phone: {
|
|
34
|
-
label: 'Phone',
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'The phone number of the user.'
|
|
37
|
-
},
|
|
38
|
-
city: {
|
|
39
|
-
label: 'City',
|
|
40
|
-
type: 'string',
|
|
41
|
-
description: 'The city of the user.'
|
|
42
|
-
},
|
|
43
|
-
country: {
|
|
44
|
-
label: 'Country',
|
|
45
|
-
type: 'string',
|
|
46
|
-
description: 'The country of the user.'
|
|
47
|
-
},
|
|
48
|
-
state: {
|
|
49
|
-
label: 'State',
|
|
50
|
-
type: 'string',
|
|
51
|
-
description: 'The state of the user.'
|
|
52
|
-
},
|
|
53
|
-
postalCode: {
|
|
54
|
-
label: 'Postal Code',
|
|
55
|
-
type: 'string',
|
|
56
|
-
description: 'The postal code of the user.'
|
|
57
|
-
},
|
|
58
|
-
birthday: {
|
|
59
|
-
label: 'Birthday',
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: 'The birthday of the user.'
|
|
62
|
-
}
|
|
10
|
+
...common_fields_1.common_fields,
|
|
11
|
+
previous_id: {
|
|
12
|
+
label: 'Previous ID',
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: "The user's previous ID, for alias events",
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.previousId'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
email: {
|
|
20
|
+
label: 'Email',
|
|
21
|
+
description: 'The email address of the user.',
|
|
22
|
+
type: 'string',
|
|
23
|
+
format: 'email',
|
|
24
|
+
required: {
|
|
25
|
+
conditions: [{ fieldKey: 'previous_id', operator: 'is', value: undefined }]
|
|
63
26
|
},
|
|
64
27
|
default: {
|
|
65
|
-
|
|
66
|
-
'@
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
28
|
+
'@if': {
|
|
29
|
+
exists: { '@path': '$.traits.email' },
|
|
30
|
+
then: { '@path': '$.traits.email' },
|
|
31
|
+
else: { '@path': '$.context.traits.email' }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
standard_traits: {
|
|
36
|
+
...common_fields_1.common_fields.standard_traits,
|
|
37
|
+
default: {
|
|
38
|
+
first_name: {
|
|
73
39
|
'@if': {
|
|
74
40
|
exists: { '@path': '$.traits.first_name' },
|
|
75
41
|
then: { '@path': '$.traits.first_name' },
|
|
76
42
|
else: { '@path': '$.context.traits.first_name' }
|
|
77
43
|
}
|
|
78
44
|
},
|
|
79
|
-
|
|
45
|
+
last_name: {
|
|
80
46
|
'@if': {
|
|
81
47
|
exists: { '@path': '$.traits.last_name' },
|
|
82
48
|
then: { '@path': '$.traits.last_name' },
|
|
@@ -90,6 +56,13 @@ const action = {
|
|
|
90
56
|
else: { '@path': '$.context.traits.phone' }
|
|
91
57
|
}
|
|
92
58
|
},
|
|
59
|
+
address: {
|
|
60
|
+
'@if': {
|
|
61
|
+
exists: { '@path': '$.traits.address.street' },
|
|
62
|
+
then: { '@path': '$.traits.address.street' },
|
|
63
|
+
else: { '@path': '$.context.traits.address.street' }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
93
66
|
city: {
|
|
94
67
|
'@if': {
|
|
95
68
|
exists: { '@path': '$.traits.address.city' },
|
|
@@ -111,75 +84,56 @@ const action = {
|
|
|
111
84
|
else: { '@path': '$.context.traits.address.state' }
|
|
112
85
|
}
|
|
113
86
|
},
|
|
114
|
-
|
|
87
|
+
postal_code: {
|
|
115
88
|
'@if': {
|
|
116
|
-
exists: { '@path': '$.traits.address.
|
|
117
|
-
then: { '@path': '$.traits.address.
|
|
118
|
-
else: { '@path': '$.context.traits.address.
|
|
89
|
+
exists: { '@path': '$.traits.address.postal_code' },
|
|
90
|
+
then: { '@path': '$.traits.address.postal_code' },
|
|
91
|
+
else: { '@path': '$.context.traits.address.postal_code' }
|
|
119
92
|
}
|
|
120
93
|
},
|
|
121
|
-
|
|
94
|
+
timezone: {
|
|
122
95
|
'@if': {
|
|
123
|
-
exists: { '@path': '$.traits.
|
|
124
|
-
then: { '@path': '$.traits.
|
|
125
|
-
else: { '@path': '$.context.traits.
|
|
96
|
+
exists: { '@path': '$.traits.timezone' },
|
|
97
|
+
then: { '@path': '$.traits.timezone' },
|
|
98
|
+
else: { '@path': '$.context.traits.timezone' }
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
birth_day: {
|
|
102
|
+
'@if': {
|
|
103
|
+
exists: { '@path': '$.traits.birth_day' },
|
|
104
|
+
then: { '@path': '$.traits.birth_day' },
|
|
105
|
+
else: { '@path': '$.context.traits.birth_day' }
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
birth_month: {
|
|
109
|
+
'@if': {
|
|
110
|
+
exists: { '@path': '$.traits.birth_month' },
|
|
111
|
+
then: { '@path': '$.traits.birth_month' },
|
|
112
|
+
else: { '@path': '$.context.traits.birth_month' }
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
birth_year: {
|
|
116
|
+
'@if': {
|
|
117
|
+
exists: { '@path': '$.traits.birth_year' },
|
|
118
|
+
then: { '@path': '$.traits.birth_year' },
|
|
119
|
+
else: { '@path': '$.context.traits.birth_year' }
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
birth_date: {
|
|
123
|
+
'@if': {
|
|
124
|
+
exists: { '@path': '$.traits.birth_date' },
|
|
125
|
+
then: { '@path': '$.traits.birth_date' },
|
|
126
|
+
else: { '@path': '$.context.traits.birth_date' }
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
|
-
},
|
|
130
|
-
user_id: {
|
|
131
|
-
label: 'Segment User ID',
|
|
132
|
-
description: 'The ID of the user in Segment',
|
|
133
|
-
type: 'string',
|
|
134
|
-
default: {
|
|
135
|
-
'@if': {
|
|
136
|
-
exists: { '@path': '$.userId' },
|
|
137
|
-
then: { '@path': '$.userId' },
|
|
138
|
-
else: { '@path': '$.anonymousId' }
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
previous_id: {
|
|
143
|
-
label: 'Previous ID',
|
|
144
|
-
type: 'string',
|
|
145
|
-
description: "The user's previous ID, for alias events",
|
|
146
|
-
default: {
|
|
147
|
-
'@path': '$.previousId'
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
event_type: {
|
|
151
|
-
label: 'Event Type',
|
|
152
|
-
description: 'The Segment event type (identify, alias, etc.)',
|
|
153
|
-
type: 'string',
|
|
154
|
-
default: {
|
|
155
|
-
'@path': '$.type'
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
enable_batching: {
|
|
159
|
-
type: 'boolean',
|
|
160
|
-
label: 'Batch Profiles',
|
|
161
|
-
unsafe_hidden: true,
|
|
162
|
-
description: 'When enabled, Segment will batch profiles together and send them to StackAdapt in a single request.',
|
|
163
|
-
required: true,
|
|
164
|
-
default: true
|
|
165
|
-
},
|
|
166
|
-
advertiser_id: {
|
|
167
|
-
label: 'Advertiser',
|
|
168
|
-
description: 'The StackAdapt advertiser to add the profile to.',
|
|
169
|
-
type: 'string',
|
|
170
|
-
disabledInputMethods: ['literal', 'variable', 'function', 'freeform', 'enrichment'],
|
|
171
|
-
required: true,
|
|
172
|
-
dynamic: true
|
|
173
130
|
}
|
|
174
131
|
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
perform: async (request, { payload }) => {
|
|
179
|
-
return await (0, functions_1.performForwardProfiles)(request, [payload]);
|
|
132
|
+
perform: async (request, { settings, payload }) => {
|
|
133
|
+
return await (0, common_functions_1.send)(request, [payload], settings, false);
|
|
180
134
|
},
|
|
181
|
-
performBatch: async (request, { payload }) => {
|
|
182
|
-
return await (0,
|
|
135
|
+
performBatch: async (request, { settings, payload }) => {
|
|
136
|
+
return await (0, common_functions_1.send)(request, payload, settings, false);
|
|
183
137
|
}
|
|
184
138
|
};
|
|
185
139
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/stackadapt-audiences/forwardProfile/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/stackadapt-audiences/forwardProfile/index.ts"],"names":[],"mappings":";;AAGA,0DAA0C;AAC1C,oDAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,oDAAoD;IACjE,mBAAmB,EAAE,uDAAuD;IAC5E,MAAM,EAAE;QACN,GAAG,6BAAa;QAChB,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YAC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AAA"}
|
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
7
|
const forwardProfile_1 = __importDefault(require("./forwardProfile"));
|
|
8
8
|
const forwardAudienceEvent_1 = __importDefault(require("./forwardAudienceEvent"));
|
|
9
|
-
const
|
|
9
|
+
const common_functions_1 = require("./common-functions");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
10
11
|
const destination = {
|
|
11
12
|
name: 'StackAdapt Audiences',
|
|
12
13
|
slug: 'actions-stackadapt-audiences',
|
|
14
|
+
description: 'Send Segment Audience and user profile details to StackAdapt',
|
|
13
15
|
mode: 'cloud',
|
|
14
16
|
authentication: {
|
|
15
17
|
scheme: 'custom',
|
|
@@ -19,6 +21,12 @@ const destination = {
|
|
|
19
21
|
description: 'Your StackAdapt GQL API Token',
|
|
20
22
|
type: 'string',
|
|
21
23
|
required: true
|
|
24
|
+
},
|
|
25
|
+
advertiser_id: {
|
|
26
|
+
label: "Advertiser ID",
|
|
27
|
+
description: "The StackAdapt advertiser ID to add the profile to.",
|
|
28
|
+
type: 'string',
|
|
29
|
+
required: true
|
|
22
30
|
}
|
|
23
31
|
},
|
|
24
32
|
testAuthentication: async (request) => {
|
|
@@ -34,7 +42,7 @@ const destination = {
|
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
}`;
|
|
37
|
-
const res = await request(
|
|
45
|
+
const res = await request(constants_1.GQL_ENDPOINT, {
|
|
38
46
|
body: JSON.stringify({ query: scopeQuery }),
|
|
39
47
|
throwHttpErrors: false
|
|
40
48
|
});
|
|
@@ -56,15 +64,19 @@ const destination = {
|
|
|
56
64
|
}
|
|
57
65
|
};
|
|
58
66
|
},
|
|
59
|
-
onDelete: async (request, { payload }) => {
|
|
67
|
+
onDelete: async (request, { payload, settings }) => {
|
|
60
68
|
const userId = payload.userId;
|
|
61
69
|
const formattedExternalIds = `["${userId}"]`;
|
|
62
|
-
const syncId = (0,
|
|
70
|
+
const syncId = (0, common_functions_1.sha256hash)(String(userId));
|
|
71
|
+
const advertiserId = settings.advertiser_id;
|
|
63
72
|
const mutation = `mutation {
|
|
64
73
|
deleteProfilesWithExternalIds(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
input: {
|
|
75
|
+
externalIds: ${formattedExternalIds},
|
|
76
|
+
externalProvider: "${constants_1.EXTERNAL_PROVIDER}",
|
|
77
|
+
syncId: "${syncId}",
|
|
78
|
+
advertiserIds: [${parseInt(advertiserId, 10)}]
|
|
79
|
+
}
|
|
68
80
|
) {
|
|
69
81
|
userErrors {
|
|
70
82
|
message
|
|
@@ -72,7 +84,7 @@ const destination = {
|
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
86
|
}`;
|
|
75
|
-
const response = await request(
|
|
87
|
+
const response = await request(constants_1.GQL_ENDPOINT, {
|
|
76
88
|
method: 'POST',
|
|
77
89
|
headers: { 'Content-Type': 'application/json' },
|
|
78
90
|
body: JSON.stringify({ query: mutation })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/stackadapt-audiences/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAwD;AACxD,sEAA6C;AAC7C,kFAAyD;AAEzD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/stackadapt-audiences/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAAwD;AACxD,sEAA6C;AAC7C,kFAAyD;AAEzD,yDAA+C;AAC/C,2CAA6D;AAE7D,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,8DAA8D;IAC3E,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,+BAA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