@segment/action-destinations 3.480.0 → 3.481.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.
Files changed (72) hide show
  1. package/dist/destinations/facebook-conversions-api/addToCart/generated-types.d.ts +0 -1
  2. package/dist/destinations/facebook-conversions-api/addToCart/index.js +87 -4
  3. package/dist/destinations/facebook-conversions-api/addToCart/index.js.map +1 -1
  4. package/dist/destinations/facebook-conversions-api/addToCart2/generated-types.d.ts +0 -1
  5. package/dist/destinations/facebook-conversions-api/addToCart2/index.js +86 -4
  6. package/dist/destinations/facebook-conversions-api/addToCart2/index.js.map +1 -1
  7. package/dist/destinations/facebook-conversions-api/constants.d.ts +0 -11
  8. package/dist/destinations/facebook-conversions-api/constants.js +1 -12
  9. package/dist/destinations/facebook-conversions-api/constants.js.map +1 -1
  10. package/dist/destinations/facebook-conversions-api/custom/generated-types.d.ts +0 -9
  11. package/dist/destinations/facebook-conversions-api/custom/index.js +53 -5
  12. package/dist/destinations/facebook-conversions-api/custom/index.js.map +1 -1
  13. package/dist/destinations/facebook-conversions-api/custom2/generated-types.d.ts +0 -9
  14. package/dist/destinations/facebook-conversions-api/custom2/index.js +52 -5
  15. package/dist/destinations/facebook-conversions-api/custom2/index.js.map +1 -1
  16. package/dist/destinations/facebook-conversions-api/fb-capi-app-data.d.ts +11 -0
  17. package/dist/destinations/facebook-conversions-api/fb-capi-app-data.js +188 -0
  18. package/dist/destinations/facebook-conversions-api/fb-capi-app-data.js.map +1 -0
  19. package/dist/destinations/facebook-conversions-api/{fields.d.ts → fb-capi-properties.d.ts} +10 -14
  20. package/dist/destinations/facebook-conversions-api/fb-capi-properties.js +185 -0
  21. package/dist/destinations/facebook-conversions-api/fb-capi-properties.js.map +1 -0
  22. package/dist/destinations/facebook-conversions-api/fb-capi-user-data.d.ts +7 -0
  23. package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js +272 -0
  24. package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js.map +1 -0
  25. package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.d.ts +0 -1
  26. package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js +90 -4
  27. package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js.map +1 -1
  28. package/dist/destinations/facebook-conversions-api/initiateCheckout2/generated-types.d.ts +0 -1
  29. package/dist/destinations/facebook-conversions-api/initiateCheckout2/index.js +89 -4
  30. package/dist/destinations/facebook-conversions-api/initiateCheckout2/index.js.map +1 -1
  31. package/dist/destinations/facebook-conversions-api/pageView/generated-types.d.ts +0 -1
  32. package/dist/destinations/facebook-conversions-api/pageView/index.js +46 -5
  33. package/dist/destinations/facebook-conversions-api/pageView/index.js.map +1 -1
  34. package/dist/destinations/facebook-conversions-api/pageView2/generated-types.d.ts +0 -1
  35. package/dist/destinations/facebook-conversions-api/pageView2/index.js +45 -5
  36. package/dist/destinations/facebook-conversions-api/pageView2/index.js.map +1 -1
  37. package/dist/destinations/facebook-conversions-api/purchase/generated-types.d.ts +0 -11
  38. package/dist/destinations/facebook-conversions-api/purchase/index.js +95 -4
  39. package/dist/destinations/facebook-conversions-api/purchase/index.js.map +1 -1
  40. package/dist/destinations/facebook-conversions-api/purchase2/fields.d.ts +2 -0
  41. package/dist/destinations/facebook-conversions-api/purchase2/fields.js +50 -0
  42. package/dist/destinations/facebook-conversions-api/purchase2/fields.js.map +1 -0
  43. package/dist/destinations/facebook-conversions-api/purchase2/functions.d.ts +4 -0
  44. package/dist/destinations/facebook-conversions-api/purchase2/functions.js +59 -0
  45. package/dist/destinations/facebook-conversions-api/purchase2/functions.js.map +1 -0
  46. package/dist/destinations/facebook-conversions-api/purchase2/generated-types.d.ts +0 -11
  47. package/dist/destinations/facebook-conversions-api/purchase2/index.js +4 -5
  48. package/dist/destinations/facebook-conversions-api/purchase2/index.js.map +1 -1
  49. package/dist/destinations/facebook-conversions-api/search/generated-types.d.ts +0 -1
  50. package/dist/destinations/facebook-conversions-api/search/index.js +94 -4
  51. package/dist/destinations/facebook-conversions-api/search/index.js.map +1 -1
  52. package/dist/destinations/facebook-conversions-api/search2/generated-types.d.ts +0 -1
  53. package/dist/destinations/facebook-conversions-api/search2/index.js +93 -4
  54. package/dist/destinations/facebook-conversions-api/search2/index.js.map +1 -1
  55. package/dist/destinations/facebook-conversions-api/utils.d.ts +3 -0
  56. package/dist/destinations/facebook-conversions-api/utils.js +19 -0
  57. package/dist/destinations/facebook-conversions-api/utils.js.map +1 -0
  58. package/dist/destinations/facebook-conversions-api/viewContent/generated-types.d.ts +0 -1
  59. package/dist/destinations/facebook-conversions-api/viewContent/index.js +89 -4
  60. package/dist/destinations/facebook-conversions-api/viewContent/index.js.map +1 -1
  61. package/dist/destinations/facebook-conversions-api/viewContent2/generated-types.d.ts +0 -1
  62. package/dist/destinations/facebook-conversions-api/viewContent2/index.js +88 -4
  63. package/dist/destinations/facebook-conversions-api/viewContent2/index.js.map +1 -1
  64. package/package.json +2 -2
  65. package/dist/destinations/facebook-conversions-api/fields.js +0 -842
  66. package/dist/destinations/facebook-conversions-api/fields.js.map +0 -1
  67. package/dist/destinations/facebook-conversions-api/functions.d.ts +0 -37
  68. package/dist/destinations/facebook-conversions-api/functions.js +0 -425
  69. package/dist/destinations/facebook-conversions-api/functions.js.map +0 -1
  70. package/dist/destinations/facebook-conversions-api/types.d.ts +0 -182
  71. package/dist/destinations/facebook-conversions-api/types.js +0 -3
  72. package/dist/destinations/facebook-conversions-api/types.js.map +0 -1
@@ -0,0 +1,188 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.app_data_field = exports.generate_app_data = void 0;
4
+ const generate_app_data = (app_data) => {
5
+ if (!app_data || !app_data.use_app_data) {
6
+ return undefined;
7
+ }
8
+ return {
9
+ advertiser_tracking_enabled: app_data?.advertiser_tracking_enabled ? 1 : 0,
10
+ application_tracking_enabled: app_data?.application_tracking_enabled ? 1 : 0,
11
+ madid: app_data?.madId,
12
+ extinfo: [
13
+ app_data?.version ?? '',
14
+ app_data?.packageName ?? '',
15
+ app_data?.shortVersion ?? '',
16
+ app_data?.longVersion ?? '',
17
+ app_data?.osVersion ?? '',
18
+ app_data?.deviceName ?? '',
19
+ app_data?.locale ?? '',
20
+ app_data?.timezone ?? '',
21
+ app_data?.carrier ?? '',
22
+ app_data?.width ?? '',
23
+ app_data?.height ?? '',
24
+ app_data?.density ?? '',
25
+ app_data?.cpuCores ?? '',
26
+ app_data?.storageSize ?? '',
27
+ app_data?.freeStorage ?? '',
28
+ app_data?.deviceTimezone ?? ''
29
+ ]
30
+ };
31
+ };
32
+ exports.generate_app_data = generate_app_data;
33
+ exports.app_data_field = {
34
+ label: 'App Events Fields',
35
+ description: `These fields support sending app events to Facebook through the Conversions API. For more information about app events support in the Conversions API, see the Facebook docs [here](https://developers.facebook.com/docs/marketing-api/conversions-api/app-events).
36
+ App events sent through the Conversions API must be associated with a dataset.
37
+ Instructions for creating a dataset can be found [here](https://www.facebook.com/business/help/750785952855662?id=490360542427371). Once a dataset is created, the dataset ID
38
+ can be substituted for the pixel ID in the destination settings.`,
39
+ type: 'object',
40
+ properties: {
41
+ use_app_data: {
42
+ label: 'Send App Events?',
43
+ description: 'Segment will not send app events to Facebook by default. Enable this once you have created a dataset in Facebook and are ready to begin sending app events.',
44
+ type: 'boolean',
45
+ default: false
46
+ },
47
+ advertiser_tracking_enabled: {
48
+ label: 'Advertiser Tracking Enabled',
49
+ description: `*Required for app events*
50
+ Use this field to specify ATT permission on an iOS 14.5+ device. Set to 0 for disabled or 1 for enabled.`,
51
+ type: 'boolean'
52
+ },
53
+ application_tracking_enabled: {
54
+ label: 'Application Tracking Enabled',
55
+ type: 'boolean',
56
+ description: `*Required for app events*
57
+ A person can choose to enable ad tracking on an app level. Your SDK should allow an app developer to put an opt-out setting into their app. Use this field to specify the person's choice. Use 0 for disabled, 1 for enabled.`
58
+ },
59
+ version: {
60
+ label: 'ExtInfo Version',
61
+ description: `*Required for app events* Example: 'i2'.`,
62
+ type: 'string',
63
+ choices: [
64
+ { label: 'iOS', value: 'i2' },
65
+ { label: 'Android', value: 'a2' }
66
+ ]
67
+ },
68
+ packageName: {
69
+ label: 'Package Name',
70
+ description: `Example: 'com.facebook.sdk.samples.hellofacebook'.`,
71
+ type: 'string'
72
+ },
73
+ shortVersion: {
74
+ label: 'Short Version',
75
+ description: `Example: '1.0'.`,
76
+ type: 'string'
77
+ },
78
+ longVersion: {
79
+ label: 'Long Version',
80
+ description: `Example: '1.0 long'.`,
81
+ type: 'string'
82
+ },
83
+ osVersion: {
84
+ label: '*Required for app events* OS Version',
85
+ description: `Example: '13.4.1'.`,
86
+ type: 'string'
87
+ },
88
+ deviceName: {
89
+ label: 'Device Model Name',
90
+ description: `Example: 'iPhone5,1'.`,
91
+ type: 'string'
92
+ },
93
+ madId: {
94
+ label: 'Advertiser ID (madid)',
95
+ description: 'Your mobile advertiser ID, the advertising ID from an Android device or the Advertising Identifier (IDFA) from an Apple device.',
96
+ type: 'string'
97
+ },
98
+ locale: {
99
+ label: 'Locale',
100
+ description: `Example: 'En_US'.`,
101
+ type: 'string'
102
+ },
103
+ timezone: {
104
+ label: 'Timezone Abbreviation',
105
+ description: `Example: 'PST'.`,
106
+ type: 'string'
107
+ },
108
+ carrier: {
109
+ label: 'Carrier Name',
110
+ description: `Example: 'AT&T'.`,
111
+ type: 'string'
112
+ },
113
+ width: {
114
+ label: 'Screen Width',
115
+ description: `Example: '1080'.`,
116
+ type: 'string'
117
+ },
118
+ height: {
119
+ label: 'Screen Height',
120
+ description: `Example: '1920'.`,
121
+ type: 'string'
122
+ },
123
+ density: {
124
+ label: 'Screen Density',
125
+ description: `Example: '2.0'.`,
126
+ type: 'string'
127
+ },
128
+ cpuCores: {
129
+ label: 'CPU Cores',
130
+ description: `Example: '8'.`,
131
+ type: 'string'
132
+ },
133
+ storageSize: {
134
+ label: 'Storage Size in GBs',
135
+ description: `Example: '64'.`,
136
+ type: 'string'
137
+ },
138
+ freeStorage: {
139
+ label: 'Free Storage in GBs',
140
+ description: `Example: '32'.`,
141
+ type: 'string'
142
+ },
143
+ deviceTimezone: {
144
+ label: 'Device Timezone',
145
+ description: `Example: 'USA/New York'.`,
146
+ type: 'string'
147
+ }
148
+ },
149
+ default: {
150
+ application_tracking_enabled: {
151
+ '@path': '$.context.device.adTrackingEnabled'
152
+ },
153
+ packageName: {
154
+ '@path': '$.context.app.namespace'
155
+ },
156
+ longVersion: {
157
+ '@path': '$.context.app.version'
158
+ },
159
+ osVersion: {
160
+ '@path': '$.context.os.version'
161
+ },
162
+ deviceName: {
163
+ '@path': '$.context.device.model'
164
+ },
165
+ locale: {
166
+ '@path': '$.context.locale'
167
+ },
168
+ carrier: {
169
+ '@path': '$.context.network.carrier'
170
+ },
171
+ width: {
172
+ '@path': '$.context.screen.width'
173
+ },
174
+ height: {
175
+ '@path': '$.context.screen.height'
176
+ },
177
+ density: {
178
+ '@path': '$.context.screen.density'
179
+ },
180
+ deviceTimezone: {
181
+ '@path': '$.context.timezone'
182
+ },
183
+ madId: {
184
+ '@path': '$.context.madId'
185
+ }
186
+ }
187
+ };
188
+ //# sourceMappingURL=fb-capi-app-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fb-capi-app-data.js","sourceRoot":"","sources":["../../../src/destinations/facebook-conversions-api/fb-capi-app-data.ts"],"names":[],"mappings":";;;AAYO,MAAM,iBAAiB,GAAG,CAAC,QAAiB,EAAgC,EAAE;IACnF,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;QACxC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO;QACL,2BAA2B,EAAE,QAAQ,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,4BAA4B,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,KAAK,EAAE,QAAQ,EAAE,KAAK;QACtB,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AO,EAAE;YACP,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,QAAQ;SACf;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,eAAe;YAC5B,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,QAAQ;SACf;QACD,cAAc,EAAE;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;SACf;KACF;IACD,OAAO,EAAE;QACP,4BAA4B,EAAE;YAC5B,OAAO,EAAE,oCAAoC;SAC9C;QACD,WAAW,EAAE;YACX,OAAO,EAAE,yBAAyB;SACnC;QACD,WAAW,EAAE;YACX,OAAO,EAAE,uBAAuB;SACjC;QACD,SAAS,EAAE;YACT,OAAO,EAAE,sBAAsB;SAChC;QACD,UAAU,EAAE;YACV,OAAO,EAAE,wBAAwB;SAClC;QACD,MAAM,EAAE;YACN,OAAO,EAAE,kBAAkB;SAC5B;QACD,OAAO,EAAE;YACP,OAAO,EAAE,2BAA2B;SACrC;QACD,KAAK,EAAE;YACL,OAAO,EAAE,wBAAwB;SAClC;QACD,MAAM,EAAE;YACN,OAAO,EAAE,yBAAyB;SACnC;QACD,OAAO,EAAE;YACP,OAAO,EAAE,0BAA0B;SACpC;QACD,cAAc,EAAE;YACd,OAAO,EAAE,oBAAoB;SAC9B;QACD,KAAK,EAAE;YACL,OAAO,EAAE,iBAAiB;SAC3B;KACF;CACF,CAAA"}
@@ -1,13 +1,13 @@
1
- import { InputField } from '@segment/actions-core';
2
- export declare const user_data_field: InputField;
3
- export declare const app_data_field: InputField;
4
- export declare const is_append_event: InputField;
5
- export declare const append_event_details: InputField;
1
+ import { InputField } from '@segment/actions-core/destination-kit/types';
2
+ import { PayloadValidationError } from '@segment/actions-core';
3
+ type Content = {
4
+ id?: string;
5
+ delivery_category?: string;
6
+ };
6
7
  export declare const custom_data: InputField;
7
8
  export declare const currency: InputField;
8
9
  export declare const value: InputField;
9
10
  export declare const net_revenue: InputField;
10
- export declare const predicted_ltv: InputField;
11
11
  export declare const content_category: InputField;
12
12
  export declare const content_ids: InputField;
13
13
  export declare const content_name: InputField;
@@ -16,17 +16,13 @@ export declare const contents: InputField;
16
16
  export declare const data_processing_options: InputField;
17
17
  export declare const data_processing_options_country: InputField;
18
18
  export declare const data_processing_options_state: InputField;
19
+ export declare const validateContents: (contents: Content[]) => PayloadValidationError | false;
20
+ type DPOption = string[] | number;
21
+ export declare const dataProcessingOptions: (data_processing_options: boolean | undefined, countryOption: number | undefined, stateOption: number | undefined) => DPOption[];
19
22
  export declare const num_items: InputField;
20
23
  export declare const event_time: InputField;
21
24
  export declare const action_source: InputField;
22
25
  export declare const event_source_url: InputField;
23
26
  export declare const event_id: InputField;
24
- export declare const order_id: InputField;
25
27
  export declare const test_event_code: InputField;
26
- export declare const purchaseFields: Record<string, InputField>;
27
- export declare const pageFields: Record<string, InputField>;
28
- export declare const initiateCheckoutFields: Record<string, InputField>;
29
- export declare const viewContentFields: Record<string, InputField>;
30
- export declare const searchFields: Record<string, InputField>;
31
- export declare const customFields: Record<string, InputField>;
32
- export declare const addToCartFields: Record<string, InputField>;
28
+ export {};
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.test_event_code = exports.event_id = exports.event_source_url = exports.action_source = exports.event_time = exports.num_items = exports.dataProcessingOptions = exports.validateContents = exports.data_processing_options_state = exports.data_processing_options_country = exports.data_processing_options = exports.contents = exports.content_type = exports.content_name = exports.content_ids = exports.content_category = exports.net_revenue = exports.value = exports.currency = exports.custom_data = void 0;
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ exports.custom_data = {
6
+ label: 'Custom Data',
7
+ description: 'The custom data object can be used to pass custom properties. See [Facebook documentation](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/custom-data#custom-properties) for more information.',
8
+ type: 'object',
9
+ defaultObjectUI: 'keyvalue'
10
+ };
11
+ exports.currency = {
12
+ label: 'Currency',
13
+ description: 'The currency for the value specified. Currency must be a valid ISO 4217 three-digit currency code.',
14
+ type: 'string',
15
+ default: {
16
+ '@path': '$.properties.currency'
17
+ }
18
+ };
19
+ exports.value = {
20
+ label: 'Value',
21
+ description: 'A numeric value associated with this event. This could be a monetary value or a value in some other metric.',
22
+ type: 'number'
23
+ };
24
+ exports.net_revenue = {
25
+ label: 'Net Revenue',
26
+ description: 'The numeric net revenue value associated with the purchase event.',
27
+ type: 'number'
28
+ };
29
+ exports.content_category = {
30
+ label: 'Content Category',
31
+ description: 'The category of the content associated with the event.',
32
+ type: 'string'
33
+ };
34
+ exports.content_ids = {
35
+ label: 'Content IDs',
36
+ description: 'The content IDs associated with the event, such as product SKUs.',
37
+ type: 'string',
38
+ multiple: true
39
+ };
40
+ exports.content_name = {
41
+ label: 'Content Name',
42
+ description: 'The name of the page or product associated with the event.',
43
+ type: 'string'
44
+ };
45
+ exports.content_type = {
46
+ label: 'Content Type',
47
+ description: 'The content type should be set to product or product_group. See [Facebook documentation](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/custom-data) for more information.',
48
+ type: 'string'
49
+ };
50
+ exports.contents = {
51
+ label: 'Contents',
52
+ description: 'A list of JSON objects that contain the product IDs associated with the event plus information about the products. ID and quantity are required fields.',
53
+ type: 'object',
54
+ multiple: true,
55
+ properties: {
56
+ id: {
57
+ label: 'ID',
58
+ description: 'The product ID of the purchased item.',
59
+ type: 'string'
60
+ },
61
+ quantity: {
62
+ label: 'Quantity',
63
+ description: 'The number of items purchased.',
64
+ type: 'integer'
65
+ },
66
+ item_price: {
67
+ label: 'Item Price',
68
+ description: 'The price of the item.',
69
+ type: 'number'
70
+ },
71
+ delivery_category: {
72
+ label: 'Delivery Category',
73
+ description: 'The type of delivery for a purchase event. Supported values are "in_store", "curbside", and "home_delivery".',
74
+ type: 'string'
75
+ }
76
+ }
77
+ };
78
+ exports.data_processing_options = {
79
+ label: 'Data Processing Options',
80
+ description: `The Data Processing Options to send to Facebook. If set to true, Segment will send an array to Facebook indicating events should be processed with Limited Data Use (LDU) restrictions. More information can be found in [Facebook’s documentation](https://developers.facebook.com/docs/marketing-apis/data-processing-options).`,
81
+ type: 'boolean'
82
+ };
83
+ exports.data_processing_options_country = {
84
+ label: 'Data Processing Country',
85
+ description: 'A country that you want to associate to the Data Processing Options. Accepted values are 1, for the United States of America, or 0, to request that Facebook geolocates the event using IP address. This is required if Data Processing Options is set to true. If nothing is provided, Segment will send 0.',
86
+ type: 'number',
87
+ choices: [
88
+ { label: 'Use Facebook’s Geolocation Logic', value: 0 },
89
+ { label: 'United States of America', value: 1 }
90
+ ]
91
+ };
92
+ exports.data_processing_options_state = {
93
+ label: 'Data Processing State',
94
+ description: 'A state that you want to associate to the Data Processing Options. Accepted values are 1000, for California, or 0, to request that Facebook geolocates the event using IP address. This is required if Data Processing Options is set to true. If nothing is provided, Segment will send 0.',
95
+ type: 'number',
96
+ choices: [
97
+ { label: 'Use Facebook’s Geolocation Logic', value: 0 },
98
+ { label: 'California', value: 1000 },
99
+ { label: 'Colorado', value: 1001 },
100
+ { label: 'Connecticut', value: 1002 },
101
+ { label: 'Florida', value: 1003 },
102
+ { label: 'Oregon', value: 1004 },
103
+ { label: 'Texas', value: 1005 },
104
+ { label: 'Montana', value: 1006 },
105
+ { label: 'Delaware', value: 1007 },
106
+ { label: 'Nebraska', value: 1008 },
107
+ { label: 'New Hampshire', value: 1009 },
108
+ { label: 'New Jersey', value: 1010 }
109
+ ]
110
+ };
111
+ const validateContents = (contents) => {
112
+ const valid_delivery_categories = ['in_store', 'curbside', 'home_delivery'];
113
+ for (let i = 0; i < contents.length; i++) {
114
+ const item = contents[i];
115
+ if (!item.id) {
116
+ return new actions_core_1.PayloadValidationError(`contents[${i}] must include an 'id' parameter.`);
117
+ }
118
+ if (item.delivery_category && !valid_delivery_categories.includes(item.delivery_category)) {
119
+ return new actions_core_1.PayloadValidationError(`contents[${i}].delivery_category must be one of {in_store, home_delivery, curbside}.`);
120
+ }
121
+ }
122
+ return false;
123
+ };
124
+ exports.validateContents = validateContents;
125
+ const dataProcessingOptions = (data_processing_options, countryOption, stateOption) => {
126
+ if (data_processing_options) {
127
+ const data_options = ['LDU'];
128
+ const country_code = countryOption ? countryOption : 0;
129
+ const state_code = stateOption ? stateOption : 0;
130
+ return [data_options, country_code, state_code];
131
+ }
132
+ return [];
133
+ };
134
+ exports.dataProcessingOptions = dataProcessingOptions;
135
+ exports.num_items = {
136
+ label: 'Number of Items',
137
+ description: 'The number of items when checkout was initiated.',
138
+ type: 'integer'
139
+ };
140
+ exports.event_time = {
141
+ label: 'Event Time',
142
+ description: 'A Unix timestamp in seconds indicating when the actual event occurred. Facebook will automatically convert ISO 8601 timestamps to Unix.',
143
+ type: 'string',
144
+ default: {
145
+ '@path': '$.timestamp'
146
+ }
147
+ };
148
+ exports.action_source = {
149
+ label: 'Action Source',
150
+ description: 'This field allows you to specify where your conversions occurred. See [Facebook documentation](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event) for supported values.',
151
+ type: 'string',
152
+ choices: [
153
+ { label: 'EMAIL', value: 'email' },
154
+ { label: 'WEBSITE', value: 'website' },
155
+ { label: 'APP', value: 'app' },
156
+ { label: 'PHONE CALL', value: 'phone_call' },
157
+ { label: 'CHAT', value: 'chat' },
158
+ { label: 'PHYSICAL STORE', value: 'physical_store' },
159
+ { label: 'SYSTEM GENERATED', value: 'system_generated' },
160
+ { label: 'OTHER', value: 'other' }
161
+ ]
162
+ };
163
+ exports.event_source_url = {
164
+ label: 'Event Source URL',
165
+ description: 'The browser URL where the event happened. The URL must begin with http:// or https:// and should match the verified domain. This is required if the action source is "website."',
166
+ type: 'string',
167
+ default: {
168
+ '@path': '$.context.page.url'
169
+ }
170
+ };
171
+ exports.event_id = {
172
+ label: 'Event ID',
173
+ description: 'This ID can be any unique string. Event ID is used to deduplicate events sent by both Facebook Pixel and Conversions API.',
174
+ type: 'string',
175
+ default: {
176
+ '@path': '$.messageId'
177
+ }
178
+ };
179
+ exports.test_event_code = {
180
+ label: 'Test Event Code',
181
+ type: 'string',
182
+ description: 'Use this field to specify that events should be test events rather than actual traffic. You can find your Test Event Code in your Facebook Events Manager under the "Test events" tab. This property overrides the test event code defined in Settings. You\'ll want to remove your Test Event Code when sending real traffic through this integration.',
183
+ required: false
184
+ };
185
+ //# sourceMappingURL=fb-capi-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fb-capi-properties.js","sourceRoot":"","sources":["../../../src/destinations/facebook-conversions-api/fb-capi-properties.ts"],"names":[],"mappings":";;;AACA,wDAA8D;AAWjD,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,+NAA+N;IACjO,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;CAC5B,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oGAAoG;IACjH,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAA;AAEY,QAAA,KAAK,GAAe;IAC/B,KAAK,EAAE,OAAO;IACd,WAAW,EACT,6GAA6G;IAC/G,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,mEAAmE;IAChF,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,gBAAgB,GAAe;IAC1C,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,wDAAwD;IACrE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,WAAW,GAAe;IACrC,KA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,EAAE,OAAO,EAAE;QAClC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;QACtC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;QAC9B,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;QAC5C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;QAChC,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;QACpD,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;QACxD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;KACnC;CACF,CAAA;AAEY,QAAA,gBAAgB,GAAe;IAC1C,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,iLAAiL;IACnL,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,oBAAoB;KAC9B;CACF,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EACT,2HAA2H;IAC7H,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,yVAAyV;IAC3V,QAAQ,EAAE,KAAK;CAChB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { InputField } from '@segment/actions-core/destination-kit/types';
2
+ import { Payload } from './addToCart/generated-types';
3
+ export declare const user_data_field: InputField;
4
+ type UserData = Pick<Payload, 'user_data'>;
5
+ export declare const normalize_user_data: (payload: UserData) => void;
6
+ export declare const hash_user_data: (payload: UserData) => Object;
7
+ export {};