@segment/action-destinations 3.437.1-staging-ea6c83c19.0 → 3.437.1-staging-40f1a8151.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/linkedin-audiences/api.d.ts +4 -5
- package/dist/destinations/linkedin-audiences/api.js +10 -11
- package/dist/destinations/linkedin-audiences/api.js.map +1 -1
- package/dist/destinations/linkedin-audiences/common-functions.d.ts +9 -0
- package/dist/destinations/linkedin-audiences/common-functions.js +87 -0
- package/dist/destinations/linkedin-audiences/common-functions.js.map +1 -0
- package/dist/destinations/linkedin-audiences/constants.d.ts +8 -0
- package/dist/destinations/linkedin-audiences/constants.js +9 -1
- package/dist/destinations/linkedin-audiences/constants.js.map +1 -1
- package/dist/destinations/linkedin-audiences/index.js +5 -3
- package/dist/destinations/linkedin-audiences/index.js.map +1 -1
- package/dist/destinations/linkedin-audiences/types.d.ts +53 -8
- package/dist/destinations/linkedin-audiences/types.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateAudience/fields.js +36 -21
- package/dist/destinations/linkedin-audiences/updateAudience/fields.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateAudience/functions.d.ts +9 -4
- package/dist/destinations/linkedin-audiences/updateAudience/functions.js +83 -95
- package/dist/destinations/linkedin-audiences/updateAudience/functions.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateAudience/generated-types.d.ts +2 -1
- package/dist/destinations/linkedin-audiences/updateAudience/index.js +6 -4
- package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/fields.d.ts +2 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/fields.js +109 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/fields.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/functions.d.ts +9 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/functions.js +50 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/functions.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/generated-types.d.ts +15 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/generated-types.js +3 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/generated-types.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/index.d.ts +5 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/index.js +20 -0
- package/dist/destinations/linkedin-audiences/updateCompanyAudience/index.js.map +1 -0
- package/dist/destinations/linkedin-conversions/api/index.js +4 -2
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/generated-types.d.ts +1 -0
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +7 -0
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/index.js +1 -1
- package/dist/destinations/ms-bing-ads-audiences/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/fields.js +13 -17
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/fields.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { RequestClient, ModifiedResponse } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from './generated-types';
|
|
3
|
-
import type {
|
|
4
|
-
import type { ProfileAPIResponse, AdAccountUserResponse, LinkedInAudiencePayload } from './types';
|
|
3
|
+
import type { ProfileAPIResponse, AdAccountUserResponse, AudienceJSON, LinkedInBatchUpdateResponse, CreateDMPSegmentResponse, GetDMPSegmentResponse, SegmentType } from './types';
|
|
5
4
|
export declare class LinkedInAudiences {
|
|
6
5
|
request: RequestClient;
|
|
7
6
|
constructor(request: RequestClient);
|
|
8
7
|
getProfile(): Promise<ModifiedResponse<ProfileAPIResponse>>;
|
|
9
8
|
getAdAccountUserProfile(settings: Settings, userId: string): Promise<ModifiedResponse<AdAccountUserResponse>>;
|
|
10
|
-
getDmpSegment(settings: Settings,
|
|
11
|
-
createDmpSegment(settings: Settings,
|
|
12
|
-
batchUpdate(dmpSegmentId: string,
|
|
9
|
+
getDmpSegment(settings: Settings, sourceSegmentId?: string): Promise<ModifiedResponse<GetDMPSegmentResponse>>;
|
|
10
|
+
createDmpSegment(settings: Settings, sourceSegmentId: string, segmentName: string, segmentType: SegmentType): Promise<ModifiedResponse<CreateDMPSegmentResponse>>;
|
|
11
|
+
batchUpdate<E>(dmpSegmentId: string, json: AudienceJSON<E>, segmentType: SegmentType): Promise<ModifiedResponse<LinkedInBatchUpdateResponse>>;
|
|
13
12
|
}
|
|
@@ -16,26 +16,26 @@ class LinkedInAudiences {
|
|
|
16
16
|
method: 'GET'
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
async getDmpSegment(settings,
|
|
19
|
+
async getDmpSegment(settings, sourceSegmentId = '') {
|
|
20
20
|
return this.request(`${constants_1.BASE_URL}/dmpSegments`, {
|
|
21
21
|
method: 'GET',
|
|
22
22
|
searchParams: {
|
|
23
23
|
q: 'account',
|
|
24
24
|
account: `urn:li:sponsoredAccount:${settings.ad_account_id}`,
|
|
25
|
-
sourceSegmentId
|
|
25
|
+
sourceSegmentId,
|
|
26
26
|
sourcePlatform: constants_1.LINKEDIN_SOURCE_PLATFORM
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
async createDmpSegment(settings,
|
|
30
|
+
async createDmpSegment(settings, sourceSegmentId, segmentName, segmentType) {
|
|
31
31
|
return this.request(`${constants_1.BASE_URL}/dmpSegments`, {
|
|
32
32
|
method: 'POST',
|
|
33
33
|
json: {
|
|
34
|
-
name:
|
|
34
|
+
name: segmentName,
|
|
35
35
|
sourcePlatform: constants_1.LINKEDIN_SOURCE_PLATFORM,
|
|
36
|
-
sourceSegmentId
|
|
36
|
+
sourceSegmentId,
|
|
37
37
|
account: `urn:li:sponsoredAccount:${settings.ad_account_id}`,
|
|
38
|
-
type:
|
|
38
|
+
type: segmentType,
|
|
39
39
|
destinations: [
|
|
40
40
|
{
|
|
41
41
|
destination: 'LINKEDIN'
|
|
@@ -44,15 +44,14 @@ class LinkedInAudiences {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
async batchUpdate(dmpSegmentId,
|
|
48
|
-
|
|
47
|
+
async batchUpdate(dmpSegmentId, json, segmentType) {
|
|
48
|
+
const url = `${constants_1.BASE_URL}/dmpSegments/${dmpSegmentId}/${segmentType === constants_1.SEGMENT_TYPES.COMPANY ? 'companies' : 'users'}`;
|
|
49
|
+
return this.request(url, {
|
|
49
50
|
method: 'POST',
|
|
50
51
|
headers: {
|
|
51
52
|
'X-RestLi-Method': 'BATCH_CREATE'
|
|
52
53
|
},
|
|
53
|
-
json
|
|
54
|
-
elements
|
|
55
|
-
},
|
|
54
|
+
json,
|
|
56
55
|
throwHttpErrors: false
|
|
57
56
|
});
|
|
58
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/api.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/api.ts"],"names":[],"mappings":";;;AAEA,2CAA+E;AAW/E,MAAa,iBAAiB;IAG5B,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,oBAAQ,KAAK,EAAE;YACpC,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,QAAkB,EAAE,MAAc;QAC9D,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,oBAAQ,mDAAmD,QAAQ,CAAC,aAAa,uBAAuB,MAAM,EAAE,EACnH;YACE,MAAM,EAAE,KAAK;SACd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StatsContext, MultiStatusResponse, RequestClient } from '@segment/actions-core';
|
|
2
|
+
import type { Settings } from './generated-types';
|
|
3
|
+
import { SegmentType, AudienceJSON } from './types';
|
|
4
|
+
export declare function send<P, E>(request: RequestClient, getSegmentSourceIdAndName: (payload: P) => {
|
|
5
|
+
sourceSegmentId: string;
|
|
6
|
+
segmentName: string;
|
|
7
|
+
}, buildJSON: (payloads: P[], settings: Settings) => AudienceJSON<E>, validate: (payloads: P[], msResponse: MultiStatusResponse, isBatch: boolean, settings: Settings) => (P & {
|
|
8
|
+
index: number;
|
|
9
|
+
})[], settings: Settings, payloads: P[], segmentType: SegmentType, isBatch: boolean, statsContext: StatsContext | undefined): Promise<MultiStatusResponse | import("@segment/actions-core/src").ModifiedResponse<import("./types").LinkedInBatchUpdateResponse>>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.send = send;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const api_1 = require("./api");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
async function send(request, getSegmentSourceIdAndName, buildJSON, validate, settings, payloads, segmentType, isBatch, statsContext) {
|
|
8
|
+
const msResponse = new actions_core_1.MultiStatusResponse();
|
|
9
|
+
const validPayloads = validate(payloads, msResponse, isBatch, settings);
|
|
10
|
+
if (validPayloads.length === 0) {
|
|
11
|
+
if (isBatch) {
|
|
12
|
+
return msResponse;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
throw new actions_core_1.PayloadValidationError('No valid payloads to process after validation.');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const { sourceSegmentId, segmentName } = getSegmentSourceIdAndName(payloads[0]);
|
|
19
|
+
const linkedinApiClient = new api_1.LinkedInAudiences(request);
|
|
20
|
+
const { id, type } = await getDmpSegmentIdAndType(linkedinApiClient, settings, sourceSegmentId, segmentName, segmentType, statsContext);
|
|
21
|
+
if (type != segmentType) {
|
|
22
|
+
if (isBatch) {
|
|
23
|
+
payloads.forEach((_, index) => {
|
|
24
|
+
msResponse.setErrorResponseAtIndex(index, {
|
|
25
|
+
status: 400,
|
|
26
|
+
errortype: 'PAYLOAD_VALIDATION_FAILED',
|
|
27
|
+
errormessage: `The existing DMP Segment with Source Segment Id ${sourceSegmentId} is of type ${type} and cannot be used to update a segment of type ${segmentType}.`
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return msResponse;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw new actions_core_1.PayloadValidationError(`The existing DMP Segment with Source Segment Id ${sourceSegmentId} is of type ${type} and cannot be used to update a segment of type ${segmentType}.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const json = buildJSON(validPayloads, settings);
|
|
37
|
+
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [
|
|
38
|
+
...statsContext?.tags,
|
|
39
|
+
`endpoint:add-or-remove-users-from-${segmentType === constants_1.SEGMENT_TYPES.COMPANY ? 'abm-' : ''}dmpSegment`
|
|
40
|
+
]);
|
|
41
|
+
const response = await linkedinApiClient.batchUpdate(id, json, segmentType);
|
|
42
|
+
if (response.status !== 200) {
|
|
43
|
+
throw new actions_core_1.RetryableError('Error while attempting to update LinkedIn DMP Segment. This batch will be retried.');
|
|
44
|
+
}
|
|
45
|
+
if (isBatch) {
|
|
46
|
+
const sentElements = json.elements;
|
|
47
|
+
validPayloads.forEach((payload, index) => {
|
|
48
|
+
const e = response.data.elements[index];
|
|
49
|
+
if (e.status >= 200 && e.status < 300) {
|
|
50
|
+
msResponse.setSuccessResponseAtIndex(payload.index, {
|
|
51
|
+
status: e.status,
|
|
52
|
+
sent: payload,
|
|
53
|
+
body: { elements: [sentElements[index]] }
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
msResponse.setErrorResponseAtIndex(payload.index, {
|
|
58
|
+
status: e.status,
|
|
59
|
+
errortype: 'BAD_REQUEST',
|
|
60
|
+
errormessage: e.message || 'Failed to update LinkedIn Audience',
|
|
61
|
+
sent: payload,
|
|
62
|
+
body: { elements: [sentElements[index]] }
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return msResponse;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return response;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function getDmpSegmentIdAndType(linkedinApiClient, settings, sourceSegmentId, segmentName, segmentType, statsContext) {
|
|
73
|
+
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [...statsContext?.tags, `endpoint:get-${segmentType === constants_1.SEGMENT_TYPES.COMPANY ? 'abm-' : ''}dmpSegment`]);
|
|
74
|
+
const response = await linkedinApiClient.getDmpSegment(settings, sourceSegmentId);
|
|
75
|
+
const { id, type } = response.data?.elements?.[0] || {};
|
|
76
|
+
if (id && type) {
|
|
77
|
+
return { id, type };
|
|
78
|
+
}
|
|
79
|
+
return createDmpSegment(linkedinApiClient, settings, sourceSegmentId, segmentName, segmentType, statsContext);
|
|
80
|
+
}
|
|
81
|
+
async function createDmpSegment(linkedinApiClient, settings, sourceSegmentId, segmentName, segmentType, statsContext) {
|
|
82
|
+
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [...statsContext?.tags, `endpoint:create-${segmentType === constants_1.SEGMENT_TYPES.COMPANY ? 'abm-' : ''}dmpSegment`]);
|
|
83
|
+
const res = await linkedinApiClient.createDmpSegment(settings, sourceSegmentId, segmentName, segmentType);
|
|
84
|
+
const { id, type } = res.data;
|
|
85
|
+
return { id, type };
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=common-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-functions.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/common-functions.ts"],"names":[],"mappings":";;AAMA,oBAyFC;AA/FD,wDAAgJ;AAEhJ,+BAAyC;AA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B,YAAsC;IAEtC,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,IAAI,EAAE,mBAAmB,WAAW,KAAK,yBAAa,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAA;IACrK,MAAM,GAAG,GAAG,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;IACzG,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;IAC7B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AACrB,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export declare const LINKEDIN_API_VERSION = "202505";
|
|
2
2
|
export declare const BASE_URL = "https://api.linkedin.com/rest";
|
|
3
3
|
export declare const LINKEDIN_SOURCE_PLATFORM = "SEGMENT";
|
|
4
|
+
export declare const SEGMENT_TYPES: {
|
|
5
|
+
readonly USER: "USER";
|
|
6
|
+
readonly COMPANY: "COMPANY";
|
|
7
|
+
};
|
|
8
|
+
export declare const AUDIENCE_ACTION: {
|
|
9
|
+
readonly ADD: "ADD";
|
|
10
|
+
readonly REMOVE: "REMOVE";
|
|
11
|
+
};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LINKEDIN_SOURCE_PLATFORM = exports.BASE_URL = exports.LINKEDIN_API_VERSION = void 0;
|
|
3
|
+
exports.AUDIENCE_ACTION = exports.SEGMENT_TYPES = exports.LINKEDIN_SOURCE_PLATFORM = exports.BASE_URL = exports.LINKEDIN_API_VERSION = void 0;
|
|
4
4
|
exports.LINKEDIN_API_VERSION = '202505';
|
|
5
5
|
exports.BASE_URL = 'https://api.linkedin.com/rest';
|
|
6
6
|
exports.LINKEDIN_SOURCE_PLATFORM = 'SEGMENT';
|
|
7
|
+
exports.SEGMENT_TYPES = {
|
|
8
|
+
USER: 'USER',
|
|
9
|
+
COMPANY: 'COMPANY'
|
|
10
|
+
};
|
|
11
|
+
exports.AUDIENCE_ACTION = {
|
|
12
|
+
ADD: 'ADD',
|
|
13
|
+
REMOVE: 'REMOVE'
|
|
14
|
+
};
|
|
7
15
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,QAAQ,CAAA;AAC/B,QAAA,QAAQ,GAAG,+BAA+B,CAAA;AAC1C,QAAA,wBAAwB,GAAG,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,QAAQ,CAAA;AAC/B,QAAA,QAAQ,GAAG,+BAA+B,CAAA;AAC1C,QAAA,wBAAwB,GAAG,SAAS,CAAA;AACpC,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAA;AAEG,QAAA,eAAe,GAAG;IAC7B,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;CACR,CAAA"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const https_1 = __importDefault(require("https"));
|
|
7
7
|
const actions_core_1 = require("@segment/actions-core");
|
|
8
8
|
const updateAudience_1 = __importDefault(require("./updateAudience"));
|
|
9
|
+
const updateCompanyAudience_1 = __importDefault(require("./updateCompanyAudience"));
|
|
9
10
|
const constants_1 = require("./constants");
|
|
10
11
|
const api_1 = require("./api");
|
|
11
12
|
const destination = {
|
|
@@ -23,14 +24,14 @@ const destination = {
|
|
|
23
24
|
},
|
|
24
25
|
send_email: {
|
|
25
26
|
label: 'Send Email',
|
|
26
|
-
description: 'Whether to send `email` to LinkedIn
|
|
27
|
+
description: 'Whether to send `email` to LinkedIn when using a User LinkedIn Segment.',
|
|
27
28
|
type: 'boolean',
|
|
28
29
|
default: true,
|
|
29
30
|
required: true
|
|
30
31
|
},
|
|
31
32
|
send_google_advertising_id: {
|
|
32
33
|
label: 'Send Google Advertising ID',
|
|
33
|
-
description: 'Whether to send Google Advertising ID to LinkedIn
|
|
34
|
+
description: 'Whether to send Google Advertising ID to LinkedIn when using a User LinkedIn Segment.',
|
|
34
35
|
type: 'boolean',
|
|
35
36
|
default: true,
|
|
36
37
|
required: true
|
|
@@ -107,7 +108,8 @@ const destination = {
|
|
|
107
108
|
};
|
|
108
109
|
},
|
|
109
110
|
actions: {
|
|
110
|
-
updateAudience: updateAudience_1.default
|
|
111
|
+
updateAudience: updateAudience_1.default,
|
|
112
|
+
updateCompanyAudience: updateCompanyAudience_1.default
|
|
111
113
|
}
|
|
112
114
|
};
|
|
113
115
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,wDAAgG;AAEhG,sEAA6C;AAC7C,oFAA2D;AAC3D,2CAAkD;AAClD,+BAAyC;AASzC,MAAM,WAAW,GAAoC;IAEnD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,aAAa,EAAE;gBACb,KAAK,EAAE,wBAAwB;gBAC/B,WAAW,EACT,wLAAwL;gBAC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,EAAE,IAAI,EAAE,KAAK,EAAE,EAC5E,yBAAU,CAAC,oBAAoB,EAC/B,GAAG,CACJ,CAAA;YACH,CAAC;YAED,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA;QACjD,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QAGpB,MAAM,KAAK,GAAG,IAAI,eAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAElD,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;gBAC5C,kBAAkB,EAAE,gCAAoB;aACzC;YACD,KAAK;SACN,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,cAAc,EAAd,wBAAc;QACd,qBAAqB,EAArB,+BAAqB;KACtB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
import { HTTPError } from '@segment/actions-core';
|
|
2
|
+
import { SEGMENT_TYPES, AUDIENCE_ACTION } from './constants';
|
|
3
|
+
import { Payload as UserPayload } from './updateAudience/generated-types';
|
|
4
|
+
import { Payload as CompanyPayload } from './updateCompanyAudience/generated-types';
|
|
5
|
+
export type SegmentType = typeof SEGMENT_TYPES[keyof typeof SEGMENT_TYPES];
|
|
6
|
+
export type AudienceAction = typeof AUDIENCE_ACTION[keyof typeof AUDIENCE_ACTION];
|
|
7
|
+
export type ValidUserPayload = (UserPayload & {
|
|
8
|
+
index: number;
|
|
9
|
+
});
|
|
10
|
+
export type ValidCompanyPayload = (CompanyPayload & {
|
|
11
|
+
index: number;
|
|
12
|
+
});
|
|
13
|
+
export interface AudienceJSON<E> {
|
|
14
|
+
elements: E[];
|
|
15
|
+
}
|
|
16
|
+
export interface LinkedInCompanyAudienceElement {
|
|
17
|
+
action: 'ADD' | 'REMOVE';
|
|
18
|
+
companyIds: ({
|
|
19
|
+
idType: 'DOMAIN';
|
|
20
|
+
idValue: string;
|
|
21
|
+
} | {
|
|
22
|
+
idType: 'LINKEDIN_COMPANY_ID';
|
|
23
|
+
idValue: string;
|
|
24
|
+
})[];
|
|
25
|
+
}
|
|
26
|
+
export interface LinkedInUserAudienceElement {
|
|
27
|
+
action: 'ADD' | 'REMOVE';
|
|
28
|
+
userIds: LinkedInUserId[];
|
|
29
|
+
firstName?: string;
|
|
30
|
+
lastName?: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
company?: string;
|
|
33
|
+
country?: string;
|
|
34
|
+
}
|
|
35
|
+
export type LinkedInUserId = {
|
|
36
|
+
idType: 'SHA256_EMAIL';
|
|
37
|
+
idValue: string;
|
|
38
|
+
} | {
|
|
39
|
+
idType: 'GOOGLE_AID';
|
|
40
|
+
idValue: string;
|
|
41
|
+
};
|
|
2
42
|
export interface RefreshTokenResponse {
|
|
3
43
|
access_token: string;
|
|
4
44
|
scope: string;
|
|
@@ -11,14 +51,19 @@ export interface ProfileAPIResponse {
|
|
|
11
51
|
export interface AdAccountUserResponse {
|
|
12
52
|
role: string;
|
|
13
53
|
}
|
|
14
|
-
export interface
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
54
|
+
export interface GetDMPSegmentResponse {
|
|
55
|
+
elements: Array<CreateDMPSegmentResponse>;
|
|
56
|
+
}
|
|
57
|
+
export interface CreateDMPSegmentResponse {
|
|
58
|
+
id: string;
|
|
59
|
+
type: 'USER' | 'COMPANY';
|
|
60
|
+
}
|
|
61
|
+
export interface LinkedInBatchUpdateResponse {
|
|
62
|
+
elements: Array<{
|
|
63
|
+
status: number;
|
|
64
|
+
id?: string;
|
|
65
|
+
message?: string;
|
|
66
|
+
}>;
|
|
22
67
|
}
|
|
23
68
|
export declare class LinkedInRefreshTokenError extends HTTPError {
|
|
24
69
|
response: Response & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/linkedin-audiences/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;AAqEjD,MAAa,yBAA0B,SAAQ,wBAAS;CAOvD;AAPD,8DAOC;AAED,MAAa,+BAAgC,SAAQ,wBAAS;CAM7D;AAND,0EAMC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fields = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
4
5
|
exports.fields = {
|
|
5
6
|
dmp_segment_name: {
|
|
6
|
-
label: '
|
|
7
|
-
description: 'The
|
|
7
|
+
label: 'Segment Creation Name',
|
|
8
|
+
description: 'The name of the segment to create. This field is no longer used after the Segment is created in LinkedIn.',
|
|
8
9
|
type: 'string',
|
|
9
10
|
default: {
|
|
10
11
|
'@if': {
|
|
@@ -15,8 +16,8 @@ exports.fields = {
|
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
enable_batching: {
|
|
18
|
-
label: 'Enable Batching',
|
|
19
|
-
description: 'Enable batching of requests to the LinkedIn DMP Segment.',
|
|
19
|
+
label: '[Hidden] Enable Batching',
|
|
20
|
+
description: '[Hidden] Enable batching of requests to the LinkedIn DMP Segment.',
|
|
20
21
|
type: 'boolean',
|
|
21
22
|
default: true,
|
|
22
23
|
unsafe_hidden: true
|
|
@@ -29,7 +30,7 @@ exports.fields = {
|
|
|
29
30
|
'@if': {
|
|
30
31
|
exists: { '@path': '$.context.traits.email' },
|
|
31
32
|
then: { '@path': '$.context.traits.email' },
|
|
32
|
-
else: { '@path': '$.
|
|
33
|
+
else: { '@path': '$.properties.email' }
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
36
|
category: 'hashedPII'
|
|
@@ -39,7 +40,7 @@ exports.fields = {
|
|
|
39
40
|
description: "The user's first name to send to LinkedIn.",
|
|
40
41
|
type: 'string',
|
|
41
42
|
default: {
|
|
42
|
-
'@path': '$.
|
|
43
|
+
'@path': '$.properties.first_name'
|
|
43
44
|
}
|
|
44
45
|
},
|
|
45
46
|
last_name: {
|
|
@@ -47,7 +48,7 @@ exports.fields = {
|
|
|
47
48
|
description: "The user's last name to send to LinkedIn.",
|
|
48
49
|
type: 'string',
|
|
49
50
|
default: {
|
|
50
|
-
'@path': '$.
|
|
51
|
+
'@path': '$.properties.last_name'
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
54
|
title: {
|
|
@@ -55,7 +56,7 @@ exports.fields = {
|
|
|
55
56
|
description: "The user's title to send to LinkedIn.",
|
|
56
57
|
type: 'string',
|
|
57
58
|
default: {
|
|
58
|
-
'@path': '$.
|
|
59
|
+
'@path': '$.properties.title'
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
company: {
|
|
@@ -63,7 +64,7 @@ exports.fields = {
|
|
|
63
64
|
description: "The user's company to send to LinkedIn.",
|
|
64
65
|
type: 'string',
|
|
65
66
|
default: {
|
|
66
|
-
'@path': '$.
|
|
67
|
+
'@path': '$.properties.company'
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
70
|
country: {
|
|
@@ -71,21 +72,25 @@ exports.fields = {
|
|
|
71
72
|
description: "The user's country to send to LinkedIn. This field accepts an ISO standardized two letter country code e.g. US.",
|
|
72
73
|
type: 'string',
|
|
73
74
|
default: {
|
|
74
|
-
'@path': '$.
|
|
75
|
+
'@path': '$.properties.country'
|
|
75
76
|
}
|
|
76
77
|
},
|
|
77
78
|
google_advertising_id: {
|
|
78
79
|
label: 'User Google Advertising ID',
|
|
79
80
|
description: "The user's Google Advertising ID to send to LinkedIn.",
|
|
80
81
|
type: 'string',
|
|
81
|
-
unsafe_hidden:
|
|
82
|
+
unsafe_hidden: false,
|
|
82
83
|
default: {
|
|
83
|
-
'@
|
|
84
|
+
'@if': {
|
|
85
|
+
exists: { '@path': '$.properties.android_idfa' },
|
|
86
|
+
then: { '@path': '$.properties.android_idfa' },
|
|
87
|
+
else: { '@path': '$.context.device.advertisingId' }
|
|
88
|
+
}
|
|
84
89
|
}
|
|
85
90
|
},
|
|
86
91
|
source_segment_id: {
|
|
87
|
-
label: 'LinkedIn Source Segment ID',
|
|
88
|
-
description: "A Segment-specific key associated with the LinkedIn DMP Segment. This is the lookup key Segment uses to fetch the DMP Segment from LinkedIn's API.",
|
|
92
|
+
label: '[Hidden] LinkedIn Source Segment ID',
|
|
93
|
+
description: "[Hidden] A Segment-specific key associated with the LinkedIn DMP Segment. This is the lookup key Segment uses to fetch the DMP Segment from LinkedIn's API.",
|
|
89
94
|
type: 'string',
|
|
90
95
|
unsafe_hidden: true,
|
|
91
96
|
default: {
|
|
@@ -97,10 +102,11 @@ exports.fields = {
|
|
|
97
102
|
}
|
|
98
103
|
},
|
|
99
104
|
personas_audience_key: {
|
|
100
|
-
label: 'Segment Engage Audience Key',
|
|
101
|
-
description: 'The `audience_key` of the Engage audience you want to sync to LinkedIn. This value must be a hard-coded string variable, e.g. `personas_test_audience`, in order for batching to work properly.',
|
|
105
|
+
label: '[Hidden] Segment Engage Audience Key',
|
|
106
|
+
description: '[Hidden] The `audience_key` of the Engage audience you want to sync to LinkedIn. This value must be a hard-coded string variable, e.g. `personas_test_audience`, in order for batching to work properly.',
|
|
102
107
|
type: 'string',
|
|
103
|
-
required:
|
|
108
|
+
required: false,
|
|
109
|
+
unsafe_hidden: true
|
|
104
110
|
},
|
|
105
111
|
event_name: {
|
|
106
112
|
label: 'Event Name',
|
|
@@ -112,15 +118,24 @@ exports.fields = {
|
|
|
112
118
|
}
|
|
113
119
|
},
|
|
114
120
|
dmp_user_action: {
|
|
115
|
-
label: '
|
|
116
|
-
description: '
|
|
121
|
+
label: 'User Segment Action',
|
|
122
|
+
description: 'Specifies if the user should be added or removed from the LinkedIn DMP User Segment.',
|
|
117
123
|
type: 'string',
|
|
118
124
|
choices: [
|
|
119
125
|
{ label: `Auto Detect`, value: 'AUTO' },
|
|
120
|
-
{ label: `Add`, value:
|
|
121
|
-
{ label: 'Remove', value:
|
|
126
|
+
{ label: `Add`, value: constants_1.AUDIENCE_ACTION.ADD },
|
|
127
|
+
{ label: 'Remove', value: constants_1.AUDIENCE_ACTION.REMOVE }
|
|
122
128
|
],
|
|
123
129
|
default: 'AUTO'
|
|
130
|
+
},
|
|
131
|
+
batch_keys: {
|
|
132
|
+
label: '[Hidden] Batch Keys',
|
|
133
|
+
description: '[Hidden] Batch key used to ensure a batch contains payloads from a single Audience only.',
|
|
134
|
+
type: 'string',
|
|
135
|
+
unsafe_hidden: true,
|
|
136
|
+
required: false,
|
|
137
|
+
multiple: true,
|
|
138
|
+
default: ['source_segment_id', 'personas_audience_key']
|
|
124
139
|
}
|
|
125
140
|
};
|
|
126
141
|
//# sourceMappingURL=fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/destinations/linkedin-audiences/updateAudience/fields.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/destinations/linkedin-audiences/updateAudience/fields.ts"],"names":[],"mappings":";;;AAEA,4CAA8C;AAEjC,QAAA,MAAM,GAA8B;IAC7C,gBAAgB,EAAE;QAChB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,2GAA2G;QACxH,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE;gBAChD,IAAI,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE;gBAC9C,IAAI,EAAE,EAAE,OAAO,EAAE,oCAAoC,EAAE;aACxD;SACF;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,0BAA0B;QACjC,WAAW,EAAE,mEAAmE;QAChF,IAAI,EAAE,SAAS;QACf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qB;QAC5B,WAAW,EAAE,0FAA0F;QACvG,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;KACxD;CACF,CAAA"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { RequestClient } from '@segment/actions-core';
|
|
3
|
-
import type { Settings } from '../generated-types';
|
|
1
|
+
import { MultiStatusResponse } from '@segment/actions-core';
|
|
4
2
|
import type { Payload } from './generated-types';
|
|
5
|
-
|
|
3
|
+
import { AudienceJSON, LinkedInUserAudienceElement, ValidUserPayload } from '../types';
|
|
4
|
+
import type { Settings } from '../generated-types';
|
|
5
|
+
export declare function validate(payloads: Payload[], msResponse: MultiStatusResponse, isBatch: boolean, settings: Settings): ValidUserPayload[];
|
|
6
|
+
export declare function buildJSON(payloads: Payload[], settings: Settings): AudienceJSON<LinkedInUserAudienceElement>;
|
|
7
|
+
export declare function getSegmentSourceIdAndName(payload: Payload): {
|
|
8
|
+
sourceSegmentId: string;
|
|
9
|
+
segmentName: string;
|
|
10
|
+
};
|