@segment/action-destinations 3.297.0 → 3.297.1-staging-261fe1ab0.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/facebook-custom-audiences/fbca-operations.d.ts +39 -0
- package/dist/destinations/facebook-custom-audiences/fbca-operations.js +104 -0
- package/dist/destinations/facebook-custom-audiences/fbca-operations.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/fbca-properties.d.ts +5 -0
- package/dist/destinations/facebook-custom-audiences/fbca-properties.js +45 -0
- package/dist/destinations/facebook-custom-audiences/fbca-properties.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/generated-types.d.ts +2 -2
- package/dist/destinations/facebook-custom-audiences/index.js +6 -16
- package/dist/destinations/facebook-custom-audiences/index.js.map +1 -1
- package/dist/destinations/facebook-custom-audiences/sync/generated-types.d.ts +38 -0
- package/dist/destinations/facebook-custom-audiences/sync/generated-types.js.map +1 -0
- package/dist/destinations/facebook-custom-audiences/sync/index.js +267 -0
- package/dist/destinations/facebook-custom-audiences/sync/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/destinations/facebook-custom-audiences/add/generated-types.d.ts +0 -2
- package/dist/destinations/facebook-custom-audiences/add/generated-types.js.map +0 -1
- package/dist/destinations/facebook-custom-audiences/add/index.js +0 -11
- package/dist/destinations/facebook-custom-audiences/add/index.js.map +0 -1
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.d.ts +0 -2
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.js +0 -3
- package/dist/destinations/facebook-custom-audiences/remove/generated-types.js.map +0 -1
- package/dist/destinations/facebook-custom-audiences/remove/index.d.ts +0 -5
- package/dist/destinations/facebook-custom-audiences/remove/index.js +0 -11
- package/dist/destinations/facebook-custom-audiences/remove/index.js.map +0 -1
- /package/dist/destinations/facebook-custom-audiences/{add → sync}/generated-types.js +0 -0
- /package/dist/destinations/facebook-custom-audiences/{add → sync}/index.d.ts +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DynamicFieldItem, DynamicFieldError, RequestClient } from '@segment/actions-core';
|
|
2
|
+
import { Payload } from './sync/generated-types';
|
|
3
|
+
export declare const BASE_URL: string;
|
|
4
|
+
interface AudienceCreationResponse {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
interface GetSingleAudienceResponse {
|
|
8
|
+
name: string;
|
|
9
|
+
id: string;
|
|
10
|
+
}
|
|
11
|
+
interface FacebookResponseError {
|
|
12
|
+
error: {
|
|
13
|
+
message: string;
|
|
14
|
+
type: string;
|
|
15
|
+
code: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const generateData: (payloads: Payload[]) => (string | number)[][];
|
|
19
|
+
export default class FacebookClient {
|
|
20
|
+
request: RequestClient;
|
|
21
|
+
adAccountId: string;
|
|
22
|
+
constructor(request: RequestClient, adAccountId: string);
|
|
23
|
+
createAudience: (name: string) => Promise<import("@segment/actions-core").ModifiedResponse<AudienceCreationResponse>>;
|
|
24
|
+
getSingleAudience: (audienceId: string) => Promise<{
|
|
25
|
+
data?: GetSingleAudienceResponse;
|
|
26
|
+
error?: FacebookResponseError;
|
|
27
|
+
}>;
|
|
28
|
+
getAllAudiences: () => Promise<{
|
|
29
|
+
choices: DynamicFieldItem[];
|
|
30
|
+
error: DynamicFieldError | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
syncAudience: (input: {
|
|
33
|
+
audienceId: string;
|
|
34
|
+
payloads: Payload[];
|
|
35
|
+
deleteUsers?: boolean;
|
|
36
|
+
}) => Promise<import("@segment/actions-core").ModifiedResponse<unknown> | undefined>;
|
|
37
|
+
private formatAdAccount;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateData = exports.BASE_URL = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const fbca_properties_1 = require("./fbca-properties");
|
|
7
|
+
const FACEBOOK_API_VERSION = 'v20.0';
|
|
8
|
+
exports.BASE_URL = `https://graph.facebook.com/${FACEBOOK_API_VERSION}/`;
|
|
9
|
+
const generateData = (payloads) => {
|
|
10
|
+
const data = new Array(payloads.length);
|
|
11
|
+
payloads.forEach((payload, index) => {
|
|
12
|
+
const row = new Array(fbca_properties_1.SCHEMA_PROPERTIES.length).fill('');
|
|
13
|
+
Object.entries(payload).forEach(([key, value]) => {
|
|
14
|
+
if (typeof value === 'object') {
|
|
15
|
+
Object.entries(value).forEach(([nestedKey, value]) => {
|
|
16
|
+
appendToDataRow(nestedKey, value, row);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
appendToDataRow(key, value, row);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
data[index] = row;
|
|
24
|
+
});
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
exports.generateData = generateData;
|
|
28
|
+
const appendToDataRow = (key, value, row) => {
|
|
29
|
+
const index = fbca_properties_1.segmentSchemaKeyToArrayIndex.get(key);
|
|
30
|
+
if (index === undefined) {
|
|
31
|
+
throw new actions_core_1.IntegrationError(`Invalid schema key: ${key}`, 'INVALID_SCHEMA_KEY', 500);
|
|
32
|
+
}
|
|
33
|
+
if (typeof value === 'number') {
|
|
34
|
+
row[index] = value;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
row[index] = hash(value);
|
|
38
|
+
};
|
|
39
|
+
const hash = (value) => {
|
|
40
|
+
return crypto_1.createHash('sha256').update(value).digest('hex');
|
|
41
|
+
};
|
|
42
|
+
class FacebookClient {
|
|
43
|
+
constructor(request, adAccountId) {
|
|
44
|
+
this.createAudience = async (name) => {
|
|
45
|
+
return await this.request(`${exports.BASE_URL}${this.adAccountId}/customaudiences`, {
|
|
46
|
+
method: 'post',
|
|
47
|
+
json: {
|
|
48
|
+
name,
|
|
49
|
+
subtype: 'CUSTOM',
|
|
50
|
+
customer_file_source: 'BOTH_USER_AND_PARTNER_PROVIDED'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
this.getSingleAudience = async (audienceId) => {
|
|
55
|
+
try {
|
|
56
|
+
const fields = '?fields=id,name';
|
|
57
|
+
const { data } = await this.request(`${exports.BASE_URL}${audienceId}${fields}`);
|
|
58
|
+
return { data, error: undefined };
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return { data: undefined, error: error };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
this.getAllAudiences = async () => {
|
|
65
|
+
const { data } = await this.request(`${exports.BASE_URL}${this.adAccountId}/customaudiences?fields=id,name&limit=200`);
|
|
66
|
+
const choices = data.data.map(({ id, name }) => ({
|
|
67
|
+
value: id,
|
|
68
|
+
label: name
|
|
69
|
+
}));
|
|
70
|
+
return {
|
|
71
|
+
choices,
|
|
72
|
+
error: undefined
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
this.syncAudience = async (input) => {
|
|
76
|
+
const data = exports.generateData(input.payloads);
|
|
77
|
+
const params = {
|
|
78
|
+
payload: {
|
|
79
|
+
schema: fbca_properties_1.SCHEMA_PROPERTIES,
|
|
80
|
+
data: data
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
try {
|
|
84
|
+
return await this.request(`${exports.BASE_URL}${input.audienceId}/users`, {
|
|
85
|
+
method: input.deleteUsers === true ? 'delete' : 'post',
|
|
86
|
+
json: params
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
this.request = request;
|
|
94
|
+
this.adAccountId = this.formatAdAccount(adAccountId);
|
|
95
|
+
}
|
|
96
|
+
formatAdAccount(adAccountId) {
|
|
97
|
+
if (adAccountId.startsWith('act_')) {
|
|
98
|
+
return adAccountId;
|
|
99
|
+
}
|
|
100
|
+
return `act_${adAccountId}`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.default = FacebookClient;
|
|
104
|
+
//# sourceMappingURL=fbca-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fbca-operations.js","sourceRoot":"","sources":["../../../src/destinations/facebook-custom-audiences/fbca-operations.ts"],"names":[],"mappings":";;;AAAA,wDAA4G;AAE5G,mCAAmC;AACnC,uDAAmF;AAEnF,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAEvB,QAAA,QAAQ,GAAG,8BAA8B,oBAAoB,GAAG,CAAA;AA2BtE,MAAM,YAAY,GAAG,CAAC,QAAmB,EAAyB,EAAE;IACzE,MAAM,IAAI,GAA0B,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAE9D,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QAClC,MAAM,GAAG,GAAwB,IAAI,KAAK,CAAC,mCAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAE7E,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE;oBACnD,eAAe,CAAC,SAAS,EAAE,KAAwB,EAAE,GAAG,CAAC,CAAA;gBAC3D,CAAC,CAAC,CAAA;aACH;iBAAM;gBACL,eAAe,CAAC,GAAG,EAAE,KAAwB,EAAE,GAAG,CAAC,CAAA;aACpD;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAA;IAC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C,CAAA;QA7DC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAA;IACtD,CAAC;IA6DO,eAAe,CAAC,WAAmB;QACzC,IAAI,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YAClC,OAAO,WAAW,CAAA;SACnB;QACD,OAAO,OAAO,WAAW,EAAE,CAAA;IAC7B,CAAC;CACF;AA1ED,iCA0EC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GlobalSetting } from '@segment/actions-core';
|
|
2
|
+
export declare const adAccountId: GlobalSetting;
|
|
3
|
+
export declare const SCHEMA_PROPERTIES: string[];
|
|
4
|
+
export declare const SEGMENT_SCHEMA_PROPERTIES: string[];
|
|
5
|
+
export declare const segmentSchemaKeyToArrayIndex: Map<string, number>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.segmentSchemaKeyToArrayIndex = exports.SEGMENT_SCHEMA_PROPERTIES = exports.SCHEMA_PROPERTIES = exports.adAccountId = void 0;
|
|
4
|
+
exports.adAccountId = {
|
|
5
|
+
type: 'string',
|
|
6
|
+
label: 'Advertiser Account ID',
|
|
7
|
+
description: 'Your advertiser account id. Read [more](https://www.facebook.com/business/help/1492627900875762).',
|
|
8
|
+
required: true
|
|
9
|
+
};
|
|
10
|
+
exports.SCHEMA_PROPERTIES = [
|
|
11
|
+
'EXTERN_ID',
|
|
12
|
+
'EMAIL',
|
|
13
|
+
'PHONE',
|
|
14
|
+
'GEN',
|
|
15
|
+
'DOBY',
|
|
16
|
+
'DOBM',
|
|
17
|
+
'DOBD',
|
|
18
|
+
'LN',
|
|
19
|
+
'FN',
|
|
20
|
+
'FI',
|
|
21
|
+
'CT',
|
|
22
|
+
'ST',
|
|
23
|
+
'ZIP',
|
|
24
|
+
'MADID',
|
|
25
|
+
'COUNTRY'
|
|
26
|
+
];
|
|
27
|
+
exports.SEGMENT_SCHEMA_PROPERTIES = [
|
|
28
|
+
'externalId',
|
|
29
|
+
'email',
|
|
30
|
+
'phone',
|
|
31
|
+
'gender',
|
|
32
|
+
'year',
|
|
33
|
+
'month',
|
|
34
|
+
'day',
|
|
35
|
+
'last',
|
|
36
|
+
'first',
|
|
37
|
+
'firstInitial',
|
|
38
|
+
'city',
|
|
39
|
+
'state',
|
|
40
|
+
'zip',
|
|
41
|
+
'mobileAdId',
|
|
42
|
+
'country'
|
|
43
|
+
];
|
|
44
|
+
exports.segmentSchemaKeyToArrayIndex = new Map(exports.SEGMENT_SCHEMA_PROPERTIES.map((property, index) => [property, index]));
|
|
45
|
+
//# sourceMappingURL=fbca-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fbca-properties.js","sourceRoot":"","sources":["../../../src/destinations/facebook-custom-audiences/fbca-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAkB;IACxC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,mGAAmG;IAChH,QAAQ,EAAE,IAAI;CACf,CAAA;AAIY,QAAA,iBAAiB,GAAG;IAC/B,WAAW;IACX,OAAO;IACP,OAAO;IACP,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,OAAO;IACP,SAAS;CACV,CAAA;AAIY,QAAA,yBAAyB,GAAG;IACvC,YAAY;IACZ,OAAO;IACP,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;IACN,OAAO;IACP,cAAc;IACd,MAAM;IACN,OAAO;IACP,KAAK;IACL,YAAY;IACZ,SAAS;CACV,CAAA;AAEY,QAAA,4BAA4B,GAAG,IAAI,GAAG,CACjD,iCAAyB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CACtE,CAAA"}
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FACEBOOK_API_VERSION = void 0;
|
|
7
7
|
const actions_core_1 = require("@segment/actions-core");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const fbca_properties_1 = require("./fbca-properties");
|
|
9
|
+
const sync_1 = __importDefault(require("./sync"));
|
|
10
10
|
exports.FACEBOOK_API_VERSION = 'v17.0';
|
|
11
11
|
const EXTERNAL_ID_KEY = 'id';
|
|
12
12
|
const destination = {
|
|
@@ -17,11 +17,7 @@ const destination = {
|
|
|
17
17
|
authentication: {
|
|
18
18
|
scheme: 'oauth2',
|
|
19
19
|
fields: {
|
|
20
|
-
|
|
21
|
-
label: 'Placeholder',
|
|
22
|
-
description: 'Placeholder',
|
|
23
|
-
type: 'string'
|
|
24
|
-
}
|
|
20
|
+
retlAdAccountId: fbca_properties_1.adAccountId
|
|
25
21
|
},
|
|
26
22
|
refreshAccessToken: async () => {
|
|
27
23
|
return { accessToken: 'TODO: Implement this' };
|
|
@@ -35,12 +31,7 @@ const destination = {
|
|
|
35
31
|
};
|
|
36
32
|
},
|
|
37
33
|
audienceFields: {
|
|
38
|
-
|
|
39
|
-
type: 'string',
|
|
40
|
-
label: 'Advertiser Account ID',
|
|
41
|
-
description: 'Your advertiser account id. Read [more](https://www.facebook.com/business/help/1492627900875762).',
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
34
|
+
engageAdAccountId: fbca_properties_1.adAccountId,
|
|
44
35
|
audienceDescription: {
|
|
45
36
|
type: 'string',
|
|
46
37
|
label: 'Description',
|
|
@@ -55,7 +46,7 @@ const destination = {
|
|
|
55
46
|
},
|
|
56
47
|
async createAudience(request, createAudienceInput) {
|
|
57
48
|
const audienceName = createAudienceInput.audienceName;
|
|
58
|
-
const adAccountId = createAudienceInput.audienceSettings?.
|
|
49
|
+
const adAccountId = createAudienceInput.audienceSettings?.engageAdAccountId;
|
|
59
50
|
const audienceDescription = createAudienceInput.audienceSettings?.audienceDescription;
|
|
60
51
|
if (!audienceName) {
|
|
61
52
|
throw new actions_core_1.IntegrationError('Missing audience name value', 'MISSING_REQUIRED_FIELD', 400);
|
|
@@ -101,8 +92,7 @@ const destination = {
|
|
|
101
92
|
}
|
|
102
93
|
},
|
|
103
94
|
actions: {
|
|
104
|
-
|
|
105
|
-
remove: remove_1.default
|
|
95
|
+
sync: sync_1.default
|
|
106
96
|
}
|
|
107
97
|
};
|
|
108
98
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/facebook-custom-audiences/index.ts"],"names":[],"mappings":";;;;;;AACA,wDAAwD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/facebook-custom-audiences/index.ts"],"names":[],"mappings":";;;;;;AACA,wDAAwD;AAExD,uDAA+C;AAC/C,kDAAyB;AAEZ,QAAA,oBAAoB,GAAG,OAAO,CAAA;AAC3C,MAAM,eAAe,GAAG,IAAI,CAAA;AAE5B,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,qCAAqC;IAC3C,IAAI,EAAE,mCAAmC;IACzC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,4CAA4C;IAEzD,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,eAAe,EAAE,6BAAW;SAC7B;QACD,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAA;QAChD,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,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G,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YAC/B,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;gBACvB,MAAM,IAAI,+BAAgB,CAAC,+CAA+C,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;aACrG;YAED,OAAO;gBACL,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC;aAC/B,CAAA;QACH,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,gBAAgB;YACzC,MAAM,cAAc,GAAG,8BAA8B,4BAAoB,IAAI,gBAAgB,CAAC,UAAU,EAAE,CAAA;YAE1G,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;YAEjE,MAAM,CAAC,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YAC/B,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;gBACvB,MAAM,IAAI,+BAAgB,CAAC,4CAA4C,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;aAClG;YAED,IAAI,gBAAgB,CAAC,UAAU,KAAK,CAAC,CAAC,eAAe,CAAC,EAAE;gBACtD,MAAM,IAAI,+BAAgB,CAAC,wBAAwB,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;aAC9E;YAED,OAAO;gBACL,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC;aAC/B,CAAA;QACH,CAAC;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAJ,cAAI;KACL;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
email?: string;
|
|
3
|
+
phone?: string;
|
|
4
|
+
gender?: string;
|
|
5
|
+
birth?: {
|
|
6
|
+
year?: string;
|
|
7
|
+
month?: string;
|
|
8
|
+
day?: string;
|
|
9
|
+
};
|
|
10
|
+
name?: {
|
|
11
|
+
first?: string;
|
|
12
|
+
last?: string;
|
|
13
|
+
firstInitial?: string;
|
|
14
|
+
};
|
|
15
|
+
address?: {
|
|
16
|
+
city?: string;
|
|
17
|
+
state?: string;
|
|
18
|
+
zip?: string;
|
|
19
|
+
country?: string;
|
|
20
|
+
};
|
|
21
|
+
mobileAdId?: string;
|
|
22
|
+
externalId?: string;
|
|
23
|
+
appIds?: string[];
|
|
24
|
+
pageIds?: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface HookBundle {
|
|
27
|
+
retlOnMappingSave: {
|
|
28
|
+
inputs?: {
|
|
29
|
+
operation?: string;
|
|
30
|
+
audienceName?: string;
|
|
31
|
+
existingAudienceId?: string;
|
|
32
|
+
};
|
|
33
|
+
outputs?: {
|
|
34
|
+
audienceName: string;
|
|
35
|
+
audienceId: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-custom-audiences/sync/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fbca_operations_1 = __importDefault(require("../fbca-operations"));
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Sync Audience',
|
|
9
|
+
description: 'Sync data to Facebook Custom Audiences.',
|
|
10
|
+
hooks: {
|
|
11
|
+
retlOnMappingSave: {
|
|
12
|
+
label: 'Select or create an audience in Facebook',
|
|
13
|
+
description: 'When saving this mapping, Segment will either create a new audience in Facebook or connect to an existing one. To create a new audience, enter the name of the audience. To connect to an existing audience, select the audience ID from the dropdown.',
|
|
14
|
+
inputFields: {
|
|
15
|
+
operation: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
label: 'Create a new custom audience or connect to an existing one?',
|
|
18
|
+
description: 'Choose to either create a new custom audience or use an existing one. If you opt to create a new audience, we will display the required fields for audience creation. If you opt to use an existing audience, a drop-down menu will appear, allowing you to select from all the custom audiences in your ad account.',
|
|
19
|
+
choices: [
|
|
20
|
+
{ label: 'Create New Audience', value: 'create' },
|
|
21
|
+
{ label: 'Connect to Existing Audience', value: 'existing' }
|
|
22
|
+
],
|
|
23
|
+
default: 'create'
|
|
24
|
+
},
|
|
25
|
+
audienceName: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
label: 'Audience Creation Name',
|
|
28
|
+
description: 'The name of the audience in Facebook.',
|
|
29
|
+
default: 'TODO: Model Name by default',
|
|
30
|
+
depends_on: {
|
|
31
|
+
conditions: [
|
|
32
|
+
{
|
|
33
|
+
fieldKey: 'operation',
|
|
34
|
+
operator: 'is',
|
|
35
|
+
value: 'create'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
existingAudienceId: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
label: 'Existing Audience ID',
|
|
43
|
+
description: 'The ID of the audience in Facebook.',
|
|
44
|
+
depends_on: {
|
|
45
|
+
conditions: [
|
|
46
|
+
{
|
|
47
|
+
fieldKey: 'operation',
|
|
48
|
+
operator: 'is',
|
|
49
|
+
value: 'existing'
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
dynamic: async (request, { settings }) => {
|
|
54
|
+
const fbClient = new fbca_operations_1.default(request, settings.retlAdAccountId);
|
|
55
|
+
const { choices, error } = await fbClient.getAllAudiences();
|
|
56
|
+
if (error) {
|
|
57
|
+
return { error, choices: [] };
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
choices
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
outputTypes: {
|
|
66
|
+
audienceName: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
label: 'Audience Name',
|
|
69
|
+
description: 'The name of the audience in Facebook this mapping is connected to.',
|
|
70
|
+
required: true
|
|
71
|
+
},
|
|
72
|
+
audienceId: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
label: 'Audience ID',
|
|
75
|
+
description: 'The ID of the audience in Facebook.',
|
|
76
|
+
required: true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
performHook: async (request, { settings, hookInputs }) => {
|
|
80
|
+
const fbClient = new fbca_operations_1.default(request, settings.retlAdAccountId);
|
|
81
|
+
if (hookInputs.operation === 'create' && !hookInputs.audienceName) {
|
|
82
|
+
return {
|
|
83
|
+
error: {
|
|
84
|
+
message: 'Missing audience name value',
|
|
85
|
+
code: 'MISSING_REQUIRED_FIELD'
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if (hookInputs.operation === 'existing' && !hookInputs.existingAudienceId) {
|
|
90
|
+
return {
|
|
91
|
+
error: {
|
|
92
|
+
message: 'Missing audience ID value',
|
|
93
|
+
code: 'MISSING_REQUIRED_FIELD'
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (hookInputs.operation === 'existing' && hookInputs.existingAudienceId) {
|
|
98
|
+
const { data, error } = await fbClient.getSingleAudience(hookInputs.existingAudienceId);
|
|
99
|
+
if (error) {
|
|
100
|
+
return {
|
|
101
|
+
error: {
|
|
102
|
+
message: error.error.message,
|
|
103
|
+
code: error.error.type
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
successMessage: `Connected to audience with ID: ${hookInputs.existingAudienceId}`,
|
|
109
|
+
savedData: {
|
|
110
|
+
audienceId: hookInputs.existingAudienceId,
|
|
111
|
+
audienceName: data?.name
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (hookInputs.operation === 'create' && hookInputs.audienceName) {
|
|
116
|
+
const { data } = await fbClient.createAudience(hookInputs.audienceName);
|
|
117
|
+
return {
|
|
118
|
+
successMessage: `Audience created with ID: ${data.id}`,
|
|
119
|
+
savedData: {
|
|
120
|
+
audienceId: data.id,
|
|
121
|
+
audienceName: hookInputs.audienceName
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
error: {
|
|
127
|
+
message: 'Invalid operation',
|
|
128
|
+
code: 'INVALID_OPERATION'
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
syncMode: {
|
|
135
|
+
label: 'Sync Mode',
|
|
136
|
+
description: 'The sync mode to use when syncing data to Facebook.',
|
|
137
|
+
default: 'upsert',
|
|
138
|
+
choices: [
|
|
139
|
+
{ value: 'add', label: 'Add' },
|
|
140
|
+
{ value: 'update', label: 'Update' },
|
|
141
|
+
{ value: 'upsert', label: 'Upsert' },
|
|
142
|
+
{ value: 'delete', label: 'Delete' }
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
fields: {
|
|
146
|
+
email: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
label: 'Email',
|
|
149
|
+
description: 'The email address of the user.'
|
|
150
|
+
},
|
|
151
|
+
phone: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
label: 'Phone',
|
|
154
|
+
description: 'The phone number of the user.'
|
|
155
|
+
},
|
|
156
|
+
gender: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
label: 'Gender',
|
|
159
|
+
description: 'The gender of the user.'
|
|
160
|
+
},
|
|
161
|
+
birth: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
label: 'Date of Birth',
|
|
164
|
+
description: 'The date of birth of the user.',
|
|
165
|
+
properties: {
|
|
166
|
+
year: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
label: 'Year'
|
|
169
|
+
},
|
|
170
|
+
month: {
|
|
171
|
+
type: 'string',
|
|
172
|
+
label: 'Month'
|
|
173
|
+
},
|
|
174
|
+
day: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
label: 'Day'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
name: {
|
|
181
|
+
type: 'object',
|
|
182
|
+
label: 'Name',
|
|
183
|
+
description: 'The name of the user.',
|
|
184
|
+
properties: {
|
|
185
|
+
first: {
|
|
186
|
+
type: 'string',
|
|
187
|
+
label: 'First Name'
|
|
188
|
+
},
|
|
189
|
+
last: {
|
|
190
|
+
type: 'string',
|
|
191
|
+
label: 'Last Name'
|
|
192
|
+
},
|
|
193
|
+
firstInitial: {
|
|
194
|
+
type: 'string',
|
|
195
|
+
label: 'First Initial'
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
address: {
|
|
200
|
+
type: 'object',
|
|
201
|
+
label: 'Address',
|
|
202
|
+
description: 'The address of the user.',
|
|
203
|
+
properties: {
|
|
204
|
+
city: {
|
|
205
|
+
type: 'string',
|
|
206
|
+
label: 'City'
|
|
207
|
+
},
|
|
208
|
+
state: {
|
|
209
|
+
type: 'string',
|
|
210
|
+
label: 'State'
|
|
211
|
+
},
|
|
212
|
+
zip: {
|
|
213
|
+
type: 'string',
|
|
214
|
+
label: 'Postal Code'
|
|
215
|
+
},
|
|
216
|
+
country: {
|
|
217
|
+
type: 'string',
|
|
218
|
+
label: 'Country'
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
mobileAdId: {
|
|
223
|
+
type: 'string',
|
|
224
|
+
label: 'Mobile Advertising ID',
|
|
225
|
+
description: 'The mobile advertising ID of the user.'
|
|
226
|
+
},
|
|
227
|
+
externalId: {
|
|
228
|
+
type: 'string',
|
|
229
|
+
label: 'External ID',
|
|
230
|
+
description: 'The external ID of the user.'
|
|
231
|
+
},
|
|
232
|
+
appIds: {
|
|
233
|
+
type: 'string',
|
|
234
|
+
multiple: true,
|
|
235
|
+
label: 'App IDs',
|
|
236
|
+
description: 'The app IDs of the user.'
|
|
237
|
+
},
|
|
238
|
+
pageIds: {
|
|
239
|
+
type: 'string',
|
|
240
|
+
multiple: true,
|
|
241
|
+
label: 'Page IDs',
|
|
242
|
+
description: 'The page IDs of the user.'
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
perform: async (request, { settings, payload, hookOutputs, syncMode }) => {
|
|
246
|
+
const fbClient = new fbca_operations_1.default(request, settings.retlAdAccountId);
|
|
247
|
+
if (syncMode) {
|
|
248
|
+
return await fbClient.syncAudience({
|
|
249
|
+
audienceId: hookOutputs?.retlOnMappingSave.audienceId,
|
|
250
|
+
payloads: [payload],
|
|
251
|
+
deleteUsers: syncMode === 'delete' ? true : false
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
performBatch: async (request, { settings, payload, hookOutputs, syncMode }) => {
|
|
256
|
+
const fbClient = new fbca_operations_1.default(request, settings.retlAdAccountId);
|
|
257
|
+
if (syncMode) {
|
|
258
|
+
return await fbClient.syncAudience({
|
|
259
|
+
audienceId: hookOutputs?.retlOnMappingSave.audienceId,
|
|
260
|
+
payloads: payload,
|
|
261
|
+
deleteUsers: syncMode === 'delete' ? true : false
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
exports.default = action;
|
|
267
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-custom-audiences/sync/index.ts"],"names":[],"mappings":";;;;;AAGA,yEAA+C;AAE/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE;QACL,iBAAiB,EAAE;YACjB,KAAK,EAAE,0CAA0C;YACjD,WAAW,EACT,wPAAwP;YAC1P,WAAW,EAAE;gBACX,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,KAA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AAC,CAAA;SACH;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.297.0",
|
|
4
|
+
"version": "3.297.1-staging-261fe1ab0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"__tests__/__helpers__/"
|
|
88
88
|
]
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "02950d51e681263b767f9cda78f51c065d902fe7"
|
|
91
91
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-custom-audiences/add/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const action = {
|
|
4
|
-
title: 'Add',
|
|
5
|
-
description: 'This action is in charge of adding elements to your audience.',
|
|
6
|
-
fields: {},
|
|
7
|
-
perform: (_request, _data) => {
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
exports.default = action;
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-custom-audiences/add/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,+DAA+D;IAC5E,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;IAM7B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-custom-audiences/remove/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const action = {
|
|
4
|
-
title: 'Remove',
|
|
5
|
-
description: 'This action is in charge of removing elements to your audience.',
|
|
6
|
-
fields: {},
|
|
7
|
-
perform: (_request, _data) => {
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
exports.default = action;
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-custom-audiences/remove/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,iEAAiE;IAC9E,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;IAM7B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
File without changes
|
|
File without changes
|