@walkeros/server-destination-meta 0.0.0-next-20251219153324
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/LICENSE +21 -0
- package/README.md +69 -0
- package/dist/browser-schemas.d.mts +8 -0
- package/dist/browser-schemas.d.ts +8 -0
- package/dist/browser-schemas.js +1 -0
- package/dist/browser-schemas.js.map +1 -0
- package/dist/browser-schemas.mjs +1 -0
- package/dist/browser-schemas.mjs.map +1 -0
- package/dist/dev.d.mts +404 -0
- package/dist/dev.d.ts +404 -0
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -0
- package/dist/dev.mjs +1 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/examples/index.d.mts +312 -0
- package/dist/examples/index.d.ts +312 -0
- package/dist/examples/index.js +137 -0
- package/dist/examples/index.mjs +114 -0
- package/dist/index.d.mts +318 -0
- package/dist/index.d.ts +318 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 elbWalker GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<p align="left">
|
|
2
|
+
<a href="https://www.walkeros.io">
|
|
3
|
+
<img title="elbwalker" src="https://www.walkeros.io/img/elbwalker_logo.png" width="256px"/>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# Meta (CAPI) Destination for walkerOS
|
|
8
|
+
|
|
9
|
+
[Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/meta)
|
|
10
|
+
•
|
|
11
|
+
[NPM Package](https://www.npmjs.com/package/@walkeros/server-destination-meta)
|
|
12
|
+
|
|
13
|
+
walkerOS follows a **source → collector → destination** architecture. This Meta
|
|
14
|
+
CAPI destination receives processed events from the walkerOS collector and sends
|
|
15
|
+
them server-to-server to Meta's Conversions API, providing enhanced data
|
|
16
|
+
accuracy and attribution for Meta advertising campaigns while bypassing browser
|
|
17
|
+
limitations.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install @walkeros/server-destination-meta
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
Here's a basic example of how to use the Meta CAPI destination:
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { startFlow } from '@walkeros/collector';
|
|
31
|
+
import { destinationMeta } from '@walkeros/server-destination-meta';
|
|
32
|
+
|
|
33
|
+
await startFlow({
|
|
34
|
+
destinations: {
|
|
35
|
+
meta: {
|
|
36
|
+
code: destinationMeta,
|
|
37
|
+
config: {
|
|
38
|
+
settings: {
|
|
39
|
+
accessToken: 'YOUR_ACCESS_TOKEN',
|
|
40
|
+
pixelId: 'YOUR_PIXEL_ID',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
| Name | Type | Description | Required | Example |
|
|
51
|
+
| ----------------- | --------------------- | --------------------------------------------------------- | -------- | ---------------------------------------------- |
|
|
52
|
+
| `accessToken` | `string` | Meta access token for Conversions API authentication | Yes | `'your_access_token'` |
|
|
53
|
+
| `pixelId` | `string` | Meta Pixel ID from your Facebook Business account | Yes | `'1234567890'` |
|
|
54
|
+
| `action_source` | `ActionSource` | Source of the event (website, app, phone_call, etc.) | No | `'website'` |
|
|
55
|
+
| `doNotHash` | `string[]` | Array of user_data fields that should not be hashed | No | `['client_ip_address', 'client_user_agent']` |
|
|
56
|
+
| `test_event_code` | `string` | Test event code for debugging Meta Conversions API events | No | `'TEST12345'` |
|
|
57
|
+
| `url` | `string` | Custom URL for Meta Conversions API endpoint | No | `'https://graph.facebook.com/v17.0'` |
|
|
58
|
+
| `user_data` | `WalkerOSMapping.Map` | Mapping configuration for user data fields | No | `{ email: 'user.email', phone: 'user.phone' }` |
|
|
59
|
+
|
|
60
|
+
## Contribute
|
|
61
|
+
|
|
62
|
+
Feel free to contribute by submitting an
|
|
63
|
+
[issue](https://github.com/elbwalker/walkerOS/issues), starting a
|
|
64
|
+
[discussion](https://github.com/elbwalker/walkerOS/discussions), or getting in
|
|
65
|
+
[contact](https://calendly.com/elb-alexander/30min).
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var mod,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,browser_schemas_exports={};((target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})})(browser_schemas_exports,{schemas:()=>schemas}),module.exports=(mod=browser_schemas_exports,((to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to})(__defProp({},"__esModule",{value:!0}),mod));var import_dev4=require("@walkeros/core/dev"),import_dev2=require("@walkeros/core/dev"),import_dev=require("@walkeros/core/dev"),ActionSourceSchema=import_dev.z.enum(["email","website","app","phone_call","chat","physical_store","system_generated","business_messaging","other"]),SettingsSchema=(import_dev.z.union([import_dev.z.enum(["AddPaymentInfo","AddToCart","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","InitiateCheckout","Lead","Purchase","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent"]),import_dev.z.string()]),import_dev2.z.object({accessToken:import_dev2.z.string().min(1).describe("Meta access token for Conversions API authentication (like your_access_token)"),pixelId:import_dev2.z.string().regex(/^[0-9]+$/,"Pixel ID must contain only digits").describe("Meta Pixel ID from your Facebook Business account (like 1234567890)"),action_source:ActionSourceSchema.describe("Source of the event (website, app, phone_call, etc.) (like website)").optional(),doNotHash:import_dev2.z.array(import_dev2.z.string()).describe("Array of user_data fields that should not be hashed (like ['client_ip_address', 'client_user_agent'])").optional(),test_event_code:import_dev2.z.string().describe("Test event code for debugging Meta Conversions API events (like TEST12345)").optional(),url:import_dev2.z.string().url().describe("Custom URL for Meta Conversions API endpoint (like https://graph.facebook.com/v17.0)").optional(),user_data:import_dev2.z.record(import_dev2.z.string(),import_dev2.z.string()).describe("Mapping configuration for user data fields (like { email: 'user.email', phone: 'user.phone' })").optional()})),MappingSchema=require("@walkeros/core/dev").z.object({}),schemas={settings:(0,import_dev4.zodToSchema)(SettingsSchema),mapping:(0,import_dev4.zodToSchema)(MappingSchema)};//# sourceMappingURL=browser-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/browser-schemas.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts","../src/schemas/mapping.ts"],"sourcesContent":["// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\nimport { settings, mapping } from './schemas';\n\nexport const schemas = {\n settings,\n mapping,\n};\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport * from './primitives';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\nimport { ActionSourceSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'Meta access token for Conversions API authentication (like your_access_token)',\n ),\n pixelId: z\n .string()\n .regex(/^[0-9]+$/, 'Pixel ID must contain only digits')\n .describe(\n 'Meta Pixel ID from your Facebook Business account (like 1234567890)',\n ),\n action_source: ActionSourceSchema.describe(\n 'Source of the event (website, app, phone_call, etc.) (like website)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user_data fields that should not be hashed (like ['client_ip_address', 'client_user_agent'])\",\n )\n .optional(),\n test_event_code: z\n .string()\n .describe(\n 'Test event code for debugging Meta Conversions API events (like TEST12345)',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for Meta Conversions API endpoint (like https://graph.facebook.com/v17.0)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { email: 'user.email', phone: 'user.phone' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Action Source Enum\n * Where the conversion event took place\n * https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event\n */\nexport const ActionSourceSchema = z.enum([\n 'email',\n 'website',\n 'app',\n 'phone_call',\n 'chat',\n 'physical_store',\n 'system_generated',\n 'business_messaging',\n 'other',\n]);\n\n/**\n * Event Name\n * Standard Meta event names or custom event identifiers\n */\nexport const EventNameSchema = z.union([\n z.enum([\n 'AddPaymentInfo',\n 'AddToCart',\n 'AddToWishlist',\n 'CompleteRegistration',\n 'Contact',\n 'CustomizeProduct',\n 'Donate',\n 'FindLocation',\n 'InitiateCheckout',\n 'Lead',\n 'Purchase',\n 'Schedule',\n 'Search',\n 'StartTrial',\n 'SubmitApplication',\n 'Subscribe',\n 'ViewContent',\n ]),\n z.string(), // Allow custom event names\n]);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Meta Conversions API Mapping Schema\n * Meta CAPI has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,cAA4B;;;ACA5B,IAAAC,cAAkB;;;ACAlB,iBAAkB;AAOX,IAAM,qBAAqB,aAAE,KAAK;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,kBAAkB,aAAE,MAAM;AAAA,EACrC,aAAE,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAE,OAAO;AAAA;AACX,CAAC;;;ADzCM,IAAM,iBAAiB,cAAE,OAAO;AAAA,EACrC,aAAa,cACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,SAAS,cACN,OAAO,EACP,MAAM,YAAY,mCAAmC,EACrD;AAAA,IACC;AAAA,EACF;AAAA,EACF,eAAe,mBAAmB;AAAA,IAChC;AAAA,EACF,EAAE,SAAS;AAAA,EACX,WAAW,cACR,MAAM,cAAE,OAAO,CAAC,EAChB;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,iBAAiB,cACd,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,KAAK,cACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WAAW,cACR,OAAO,cAAE,OAAO,GAAG,cAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AE5CD,IAAAC,cAAkB;AAMX,IAAM,gBAAgB,cAAE,OAAO,CAAC,CAAC;;;AHIjC,IAAM,eAAW,yBAAY,cAAc;AAC3C,IAAM,cAAU,yBAAY,aAAa;;;ADPzC,IAAM,UAAU;AAAA,EACrB;AAAA,EACA;AACF;","names":["import_dev","import_dev","import_dev"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{zodToSchema}from"@walkeros/core/dev";import{z as z2}from"@walkeros/core/dev";import{z}from"@walkeros/core/dev";var ActionSourceSchema=z.enum(["email","website","app","phone_call","chat","physical_store","system_generated","business_messaging","other"]),SettingsSchema=(z.union([z.enum(["AddPaymentInfo","AddToCart","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","InitiateCheckout","Lead","Purchase","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent"]),z.string()]),z2.object({accessToken:z2.string().min(1).describe("Meta access token for Conversions API authentication (like your_access_token)"),pixelId:z2.string().regex(/^[0-9]+$/,"Pixel ID must contain only digits").describe("Meta Pixel ID from your Facebook Business account (like 1234567890)"),action_source:ActionSourceSchema.describe("Source of the event (website, app, phone_call, etc.) (like website)").optional(),doNotHash:z2.array(z2.string()).describe("Array of user_data fields that should not be hashed (like ['client_ip_address', 'client_user_agent'])").optional(),test_event_code:z2.string().describe("Test event code for debugging Meta Conversions API events (like TEST12345)").optional(),url:z2.string().url().describe("Custom URL for Meta Conversions API endpoint (like https://graph.facebook.com/v17.0)").optional(),user_data:z2.record(z2.string(),z2.string()).describe("Mapping configuration for user data fields (like { email: 'user.email', phone: 'user.phone' })").optional()}));import{z as z3}from"@walkeros/core/dev";var MappingSchema=z3.object({}),schemas={settings:zodToSchema(SettingsSchema),mapping:zodToSchema(MappingSchema)};export{schemas};//# sourceMappingURL=browser-schemas.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts","../src/schemas/mapping.ts","../src/browser-schemas.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport * from './primitives';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\nimport { ActionSourceSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'Meta access token for Conversions API authentication (like your_access_token)',\n ),\n pixelId: z\n .string()\n .regex(/^[0-9]+$/, 'Pixel ID must contain only digits')\n .describe(\n 'Meta Pixel ID from your Facebook Business account (like 1234567890)',\n ),\n action_source: ActionSourceSchema.describe(\n 'Source of the event (website, app, phone_call, etc.) (like website)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user_data fields that should not be hashed (like ['client_ip_address', 'client_user_agent'])\",\n )\n .optional(),\n test_event_code: z\n .string()\n .describe(\n 'Test event code for debugging Meta Conversions API events (like TEST12345)',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for Meta Conversions API endpoint (like https://graph.facebook.com/v17.0)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { email: 'user.email', phone: 'user.phone' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Action Source Enum\n * Where the conversion event took place\n * https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event\n */\nexport const ActionSourceSchema = z.enum([\n 'email',\n 'website',\n 'app',\n 'phone_call',\n 'chat',\n 'physical_store',\n 'system_generated',\n 'business_messaging',\n 'other',\n]);\n\n/**\n * Event Name\n * Standard Meta event names or custom event identifiers\n */\nexport const EventNameSchema = z.union([\n z.enum([\n 'AddPaymentInfo',\n 'AddToCart',\n 'AddToWishlist',\n 'CompleteRegistration',\n 'Contact',\n 'CustomizeProduct',\n 'Donate',\n 'FindLocation',\n 'InitiateCheckout',\n 'Lead',\n 'Purchase',\n 'Schedule',\n 'Search',\n 'StartTrial',\n 'SubmitApplication',\n 'Subscribe',\n 'ViewContent',\n ]),\n z.string(), // Allow custom event names\n]);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Meta Conversions API Mapping Schema\n * Meta CAPI has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\nimport { settings, mapping } from './schemas';\n\nexport const schemas = {\n settings,\n mapping,\n};\n"],"mappings":";AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAOX,IAAM,qBAAqB,EAAE,KAAK;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAMM,IAAM,kBAAkB,EAAE,MAAM;AAAA,EACrC,EAAE,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,EAAE,OAAO;AAAA;AACX,CAAC;;;ADzCM,IAAM,iBAAiBC,GAAE,OAAO;AAAA,EACrC,aAAaA,GACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,SAASA,GACN,OAAO,EACP,MAAM,YAAY,mCAAmC,EACrD;AAAA,IACC;AAAA,EACF;AAAA,EACF,eAAe,mBAAmB;AAAA,IAChC;AAAA,EACF,EAAE,SAAS;AAAA,EACX,WAAWA,GACR,MAAMA,GAAE,OAAO,CAAC,EAChB;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,iBAAiBA,GACd,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,KAAKA,GACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WAAWA,GACR,OAAOA,GAAE,OAAO,GAAGA,GAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AE5CD,SAAS,KAAAC,UAAS;AAMX,IAAM,gBAAgBA,GAAE,OAAO,CAAC,CAAC;;;AHIjC,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;;;AIPzC,IAAM,UAAU;AAAA,EACrB;AAAA,EACA;AACF;","names":["z","z","z"]}
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { Mapping as Mapping$2 } from '@walkeros/core';
|
|
4
|
+
import { DestinationServer, sendServer } from '@walkeros/server-core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Action Source Enum
|
|
8
|
+
* Where the conversion event took place
|
|
9
|
+
* https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event
|
|
10
|
+
*/
|
|
11
|
+
declare const ActionSourceSchema: z.ZodEnum<{
|
|
12
|
+
email: "email";
|
|
13
|
+
website: "website";
|
|
14
|
+
app: "app";
|
|
15
|
+
phone_call: "phone_call";
|
|
16
|
+
chat: "chat";
|
|
17
|
+
physical_store: "physical_store";
|
|
18
|
+
system_generated: "system_generated";
|
|
19
|
+
business_messaging: "business_messaging";
|
|
20
|
+
other: "other";
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Event Name
|
|
24
|
+
* Standard Meta event names or custom event identifiers
|
|
25
|
+
*/
|
|
26
|
+
declare const EventNameSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
27
|
+
AddPaymentInfo: "AddPaymentInfo";
|
|
28
|
+
AddToCart: "AddToCart";
|
|
29
|
+
AddToWishlist: "AddToWishlist";
|
|
30
|
+
CompleteRegistration: "CompleteRegistration";
|
|
31
|
+
Contact: "Contact";
|
|
32
|
+
CustomizeProduct: "CustomizeProduct";
|
|
33
|
+
Donate: "Donate";
|
|
34
|
+
FindLocation: "FindLocation";
|
|
35
|
+
InitiateCheckout: "InitiateCheckout";
|
|
36
|
+
Lead: "Lead";
|
|
37
|
+
Purchase: "Purchase";
|
|
38
|
+
Schedule: "Schedule";
|
|
39
|
+
Search: "Search";
|
|
40
|
+
StartTrial: "StartTrial";
|
|
41
|
+
SubmitApplication: "SubmitApplication";
|
|
42
|
+
Subscribe: "Subscribe";
|
|
43
|
+
ViewContent: "ViewContent";
|
|
44
|
+
}>, z.ZodString]>;
|
|
45
|
+
|
|
46
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
47
|
+
accessToken: z.ZodString;
|
|
48
|
+
pixelId: z.ZodString;
|
|
49
|
+
action_source: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
email: "email";
|
|
51
|
+
website: "website";
|
|
52
|
+
app: "app";
|
|
53
|
+
phone_call: "phone_call";
|
|
54
|
+
chat: "chat";
|
|
55
|
+
physical_store: "physical_store";
|
|
56
|
+
system_generated: "system_generated";
|
|
57
|
+
business_messaging: "business_messaging";
|
|
58
|
+
other: "other";
|
|
59
|
+
}>>;
|
|
60
|
+
doNotHash: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
test_event_code: z.ZodOptional<z.ZodString>;
|
|
62
|
+
url: z.ZodOptional<z.ZodString>;
|
|
63
|
+
user_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
type Settings$1 = z.infer<typeof SettingsSchema>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Meta Conversions API Mapping Schema
|
|
69
|
+
* Meta CAPI has no event-level mapping configuration
|
|
70
|
+
*/
|
|
71
|
+
declare const MappingSchema: z.ZodObject<{}, z.core.$strip>;
|
|
72
|
+
/**
|
|
73
|
+
* Type inference from MappingSchema
|
|
74
|
+
*/
|
|
75
|
+
type Mapping$1 = z.infer<typeof MappingSchema>;
|
|
76
|
+
|
|
77
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
78
|
+
declare const mapping$1: _walkeros_core_dev.JSONSchema;
|
|
79
|
+
|
|
80
|
+
declare const index$1_ActionSourceSchema: typeof ActionSourceSchema;
|
|
81
|
+
declare const index$1_EventNameSchema: typeof EventNameSchema;
|
|
82
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
83
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
84
|
+
declare const index$1_settings: typeof settings;
|
|
85
|
+
declare namespace index$1 {
|
|
86
|
+
export { index$1_ActionSourceSchema as ActionSourceSchema, index$1_EventNameSchema as EventNameSchema, type Mapping$1 as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, mapping$1 as mapping, index$1_settings as settings };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface Settings {
|
|
90
|
+
accessToken: string;
|
|
91
|
+
pixelId: string;
|
|
92
|
+
action_source?: ActionSource;
|
|
93
|
+
doNotHash?: string[];
|
|
94
|
+
test_event_code?: string;
|
|
95
|
+
url?: string;
|
|
96
|
+
user_data?: Mapping$2.Map;
|
|
97
|
+
}
|
|
98
|
+
interface Mapping {
|
|
99
|
+
}
|
|
100
|
+
interface Env extends DestinationServer.Env {
|
|
101
|
+
sendServer?: typeof sendServer;
|
|
102
|
+
}
|
|
103
|
+
type Rule = Mapping$2.Rule<Mapping>;
|
|
104
|
+
interface BodyParameters {
|
|
105
|
+
data: Array<ServerEventParameters>;
|
|
106
|
+
test_event_code?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Represents the top‑level parameters for a server event sent via Meta's Conversions API.
|
|
110
|
+
* https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/server-event
|
|
111
|
+
*/
|
|
112
|
+
interface ServerEventParameters extends StandardParameters {
|
|
113
|
+
/** The event name or custom event identifier. Required for deduplication. */
|
|
114
|
+
event_name: EventName;
|
|
115
|
+
/** Unix timestamp (in seconds) when the event actually occurred. GMT timezone. */
|
|
116
|
+
event_time: number;
|
|
117
|
+
/** Map of customer information for matching (emails, phone, etc.). */
|
|
118
|
+
user_data: CustomerInformationParameters;
|
|
119
|
+
/** Additional business data about the event. */
|
|
120
|
+
custom_data?: Record<string, unknown>;
|
|
121
|
+
/** URL of the page where the event occurred. */
|
|
122
|
+
event_source_url?: string;
|
|
123
|
+
/** If true, exclude this event from ads optimization (only attribution). */
|
|
124
|
+
opt_out?: boolean;
|
|
125
|
+
/** Unique ID for deduplication across Pixel and CAPI. */
|
|
126
|
+
event_id?: string;
|
|
127
|
+
/** Source of the event (e.g., website, app). */
|
|
128
|
+
action_source: ActionSource;
|
|
129
|
+
/** Processing options (e.g., ['LDU'] for CCPA limited data use). */
|
|
130
|
+
data_processing_options?: DataProcessingOption[];
|
|
131
|
+
/** Country code for data processing option (1 = USA, 0 = auto‑geolocate). */
|
|
132
|
+
data_processing_options_country?: number;
|
|
133
|
+
/** State code for data processing option (1000 = California, 0 = auto). */
|
|
134
|
+
data_processing_options_state?: number;
|
|
135
|
+
/** App‑specific data (required if action_source is 'app'). */
|
|
136
|
+
app_data?: AppData;
|
|
137
|
+
/** HTTP referrer header of the event. */
|
|
138
|
+
referrer_url?: string;
|
|
139
|
+
/** Metadata to link delayed events to past acquisition events. */
|
|
140
|
+
original_event_data?: OriginalEventDataParameters;
|
|
141
|
+
/** User segment for more context about the customer's relationship. */
|
|
142
|
+
customer_segmentation?: CustomerSegmentation;
|
|
143
|
+
}
|
|
144
|
+
type EventName = 'AddPaymentInfo' | 'AddToCart' | 'AddToWishlist' | 'CompleteRegistration' | 'Contact' | 'CustomizeProduct' | 'Donate' | 'FindLocation' | 'InitiateCheckout' | 'Lead' | 'Purchase' | 'Schedule' | 'Search' | 'StartTrial' | 'SubmitApplication' | 'Subscribe' | 'ViewContent' | string;
|
|
145
|
+
type ActionSource = 'email' | 'website' | 'app' | 'phone_call' | 'chat' | 'physical_store' | 'system_generated' | 'business_messaging' | 'other';
|
|
146
|
+
type DataProcessingOption = 'LDU';
|
|
147
|
+
type CustomerSegmentation = 'new_customer_to_business' | 'new_customer_to_business_line' | 'new_customer_to_product_area' | 'new_customer_to_medium' | 'existing_customer_to_business' | 'existing_customer_to_business_line' | 'existing_customer_to_product_area' | 'existing_customer_to_medium' | 'customer_in_loyalty_program';
|
|
148
|
+
/** Extended device info for app events (Android version 'a2', iOS 'i2') */
|
|
149
|
+
interface AppData {
|
|
150
|
+
/**
|
|
151
|
+
* Comma-separated array of strings with fixed order:
|
|
152
|
+
* [sdk_version, os_version, device_model, device_brand,
|
|
153
|
+
* screen_width, screen_height, ...]
|
|
154
|
+
*/
|
|
155
|
+
extinfo: string[];
|
|
156
|
+
}
|
|
157
|
+
interface CustomerInformationParameters {
|
|
158
|
+
/** Email(s), SHA-256 hashed, lowercase and trimmed */
|
|
159
|
+
em?: string | string[];
|
|
160
|
+
/** Phone number(s), SHA-256 hashed, E.164 format (no leading 0s or symbols) */
|
|
161
|
+
ph?: string | string[];
|
|
162
|
+
/** First name(s), SHA-256 hashed, lowercase */
|
|
163
|
+
fn?: string | string[];
|
|
164
|
+
/** Last name(s), SHA-256 hashed, lowercase */
|
|
165
|
+
ln?: string | string[];
|
|
166
|
+
/** Date(s) of birth in YYYYMMDD, SHA-256 hashed */
|
|
167
|
+
db?: string | string[];
|
|
168
|
+
/** Gender(s) in lowercase single letter ("m", "f", etc.), SHA-256 hashed */
|
|
169
|
+
ge?: string | string[];
|
|
170
|
+
/** City name(s), SHA-256 hashed, lowercase */
|
|
171
|
+
ct?: string | string[];
|
|
172
|
+
/** State abbreviation(s), SHA-256 hashed, lowercase (e.g., "ca", "ny") */
|
|
173
|
+
st?: string | string[];
|
|
174
|
+
/** ZIP or postal code(s), SHA-256 hashed, lowercase */
|
|
175
|
+
zp?: string | string[];
|
|
176
|
+
/** Country code(s), SHA-256 hashed, lowercase (ISO 3166-1 alpha-2) */
|
|
177
|
+
country?: string | string[];
|
|
178
|
+
/** External IDs, unique per user. SHA-256 hash recommended */
|
|
179
|
+
external_id?: string | string[];
|
|
180
|
+
/** IPv4 or IPv6 address of client. Do NOT hash. */
|
|
181
|
+
client_ip_address?: string;
|
|
182
|
+
/** User agent string from browser. Do NOT hash. */
|
|
183
|
+
client_user_agent?: string;
|
|
184
|
+
/** fbclid parameter value from the URL. Do NOT hash. */
|
|
185
|
+
fbclid?: string;
|
|
186
|
+
/** Facebook click ID (_fbc cookie). Do NOT hash. */
|
|
187
|
+
fbc?: string;
|
|
188
|
+
/** Facebook browser ID (_fbp cookie). Do NOT hash. */
|
|
189
|
+
fbp?: string;
|
|
190
|
+
/** Subscription ID for the transaction. Do NOT hash. */
|
|
191
|
+
subscription_id?: string;
|
|
192
|
+
/** Facebook login ID (App-Scoped ID). Do NOT hash. */
|
|
193
|
+
fb_login_id?: number;
|
|
194
|
+
/** Meta Lead Ad lead ID. Do NOT hash. */
|
|
195
|
+
lead_id?: number;
|
|
196
|
+
/** Anonymous install ID. App events only. Do NOT hash. */
|
|
197
|
+
anon_id?: string;
|
|
198
|
+
/** Mobile advertiser ID (GAID/IDFA). Do NOT hash. */
|
|
199
|
+
madid?: string;
|
|
200
|
+
/** Facebook Page ID. Do NOT hash. */
|
|
201
|
+
page_id?: string;
|
|
202
|
+
/** Messenger Page-scoped user ID. Do NOT hash. */
|
|
203
|
+
page_scoped_user_id?: string;
|
|
204
|
+
/** Click to WhatsApp ad click ID. Do NOT hash. */
|
|
205
|
+
ctwa_clid?: string;
|
|
206
|
+
/** Instagram business account ID. Do NOT hash. */
|
|
207
|
+
ig_account_id?: string;
|
|
208
|
+
/** Instagram-scoped user ID. Do NOT hash. */
|
|
209
|
+
ig_sid?: string;
|
|
210
|
+
}
|
|
211
|
+
interface StandardParameters {
|
|
212
|
+
availability?: string;
|
|
213
|
+
body_style?: string;
|
|
214
|
+
checkin_date?: string;
|
|
215
|
+
city?: string;
|
|
216
|
+
condition_of_vehicle?: string;
|
|
217
|
+
content_ids?: string[];
|
|
218
|
+
content_type?: 'product' | 'product_group' | string;
|
|
219
|
+
contents?: Array<{
|
|
220
|
+
id: string;
|
|
221
|
+
quantity?: number;
|
|
222
|
+
item_price?: number;
|
|
223
|
+
delivery_category?: string;
|
|
224
|
+
}>;
|
|
225
|
+
country?: string;
|
|
226
|
+
currency?: string;
|
|
227
|
+
delivery_category?: 'in_store' | 'curbside' | 'home_delivery' | string;
|
|
228
|
+
departing_arrival_date?: string;
|
|
229
|
+
departing_departure_date?: string;
|
|
230
|
+
destination_airport?: string;
|
|
231
|
+
destination_ids?: string[];
|
|
232
|
+
dma_code?: string;
|
|
233
|
+
drivetrain?: string;
|
|
234
|
+
exterior_color?: string;
|
|
235
|
+
fuel_type?: string;
|
|
236
|
+
hotel_score?: number;
|
|
237
|
+
interior_color?: string;
|
|
238
|
+
lead_event_source?: string;
|
|
239
|
+
lease_end_date?: string;
|
|
240
|
+
lease_start_date?: string;
|
|
241
|
+
listing_type?: string;
|
|
242
|
+
make?: string;
|
|
243
|
+
'mileage.unit'?: string;
|
|
244
|
+
'mileage.value'?: number;
|
|
245
|
+
model?: string;
|
|
246
|
+
neighborhood?: string;
|
|
247
|
+
net_revenue?: number;
|
|
248
|
+
num_adults?: number;
|
|
249
|
+
num_children?: number;
|
|
250
|
+
num_infants?: number;
|
|
251
|
+
num_items?: number;
|
|
252
|
+
order_id?: string;
|
|
253
|
+
origin_airport?: string;
|
|
254
|
+
postal_code?: string;
|
|
255
|
+
predicted_ltv?: number;
|
|
256
|
+
preferred_baths_range?: string;
|
|
257
|
+
preferred_beds_range?: string;
|
|
258
|
+
preferred_neighborhoods?: string[];
|
|
259
|
+
preferred_num_stops?: number;
|
|
260
|
+
preferred_price_range?: string;
|
|
261
|
+
preferred_star_ratings?: [number, number];
|
|
262
|
+
price?: string;
|
|
263
|
+
product_catalog_id?: string;
|
|
264
|
+
property_type?: string;
|
|
265
|
+
region?: string;
|
|
266
|
+
returning_arrival_date?: string;
|
|
267
|
+
returning_departure_date?: string;
|
|
268
|
+
search_string?: string;
|
|
269
|
+
state_of_vehicle?: string;
|
|
270
|
+
suggested_destinations?: string[];
|
|
271
|
+
suggested_home_listings?: string[];
|
|
272
|
+
suggested_hotels?: string[];
|
|
273
|
+
suggested_jobs?: string[];
|
|
274
|
+
suggested_local_service_businesses?: string[];
|
|
275
|
+
suggested_location_based_items?: string[];
|
|
276
|
+
suggested_vehicles?: string[];
|
|
277
|
+
transmission?: string;
|
|
278
|
+
travel_class?: string;
|
|
279
|
+
travel_end?: string;
|
|
280
|
+
travel_start?: string;
|
|
281
|
+
trim?: string;
|
|
282
|
+
fb_availability?: string;
|
|
283
|
+
fb_body_style?: string;
|
|
284
|
+
fb_checkin_date?: string;
|
|
285
|
+
fb_city?: string;
|
|
286
|
+
fb_condition_of_vehicle?: string;
|
|
287
|
+
fb_content_ids?: string[];
|
|
288
|
+
fb_content_type?: string;
|
|
289
|
+
fb_contents?: Array<{
|
|
290
|
+
id: string;
|
|
291
|
+
quantity?: number;
|
|
292
|
+
item_price?: number;
|
|
293
|
+
}>;
|
|
294
|
+
fb_country?: string;
|
|
295
|
+
fb_currency?: string;
|
|
296
|
+
fb_delivery_category?: string;
|
|
297
|
+
fb_departing_arrival_date?: string;
|
|
298
|
+
fb_departing_departure_date?: string;
|
|
299
|
+
fb_destination_airport?: string;
|
|
300
|
+
fb_destination_ids?: string[];
|
|
301
|
+
fb_dma_code?: string;
|
|
302
|
+
fb_drivetrain?: string;
|
|
303
|
+
fb_exterior_color?: string;
|
|
304
|
+
fb_fuel_type?: string;
|
|
305
|
+
fb_hotel_score?: number;
|
|
306
|
+
fb_interior_color?: string;
|
|
307
|
+
fb_lease_end_date?: string;
|
|
308
|
+
fb_lease_start_date?: string;
|
|
309
|
+
fb_listing_type?: string;
|
|
310
|
+
fb_make?: string;
|
|
311
|
+
'fb_mileage.unit'?: string;
|
|
312
|
+
'fb_mileage.value'?: number;
|
|
313
|
+
fb_model?: string;
|
|
314
|
+
fb_neighborhood?: string;
|
|
315
|
+
fb_num_adults?: number;
|
|
316
|
+
fb_num_children?: number;
|
|
317
|
+
fb_num_infants?: number;
|
|
318
|
+
fb_num_items?: number;
|
|
319
|
+
fb_order_id?: string;
|
|
320
|
+
fb_origin_airport?: string;
|
|
321
|
+
fb_postal_code?: string;
|
|
322
|
+
fb_predicted_ltv?: number;
|
|
323
|
+
fb_preferred_baths_range?: string;
|
|
324
|
+
fb_preferred_beds_range?: string;
|
|
325
|
+
fb_preferred_neighborhoods?: string[];
|
|
326
|
+
fb_preferred_num_stops?: number;
|
|
327
|
+
fb_preferred_price_range?: string;
|
|
328
|
+
fb_preferred_star_ratings?: [number, number];
|
|
329
|
+
fb_price?: string;
|
|
330
|
+
fb_product_catalog_id?: string;
|
|
331
|
+
fb_property_type?: string;
|
|
332
|
+
fb_region?: string;
|
|
333
|
+
fb_returning_arrival_date?: string;
|
|
334
|
+
fb_returning_departure_date?: string;
|
|
335
|
+
fb_search_string?: string;
|
|
336
|
+
fb_state_of_vehicle?: string;
|
|
337
|
+
fb_suggested_destinations?: string[];
|
|
338
|
+
fb_suggested_home_listings?: string[];
|
|
339
|
+
fb_suggested_hotels?: string[];
|
|
340
|
+
fb_suggested_jobs?: string[];
|
|
341
|
+
fb_suggested_local_service_businesses?: string[];
|
|
342
|
+
fb_suggested_location_based_items?: string[];
|
|
343
|
+
fb_suggested_vehicles?: string[];
|
|
344
|
+
fb_transmission?: string;
|
|
345
|
+
fb_travel_class?: string;
|
|
346
|
+
fb_travel_end?: string;
|
|
347
|
+
fb_travel_start?: string;
|
|
348
|
+
user_bucket?: string;
|
|
349
|
+
value?: number;
|
|
350
|
+
vin?: string;
|
|
351
|
+
year?: number;
|
|
352
|
+
item_number?: string;
|
|
353
|
+
}
|
|
354
|
+
interface OriginalEventDataParameters {
|
|
355
|
+
event_name?: EventName;
|
|
356
|
+
event_time?: number;
|
|
357
|
+
order_id?: number;
|
|
358
|
+
event_id?: string;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Standard mock environment for push operations
|
|
363
|
+
*
|
|
364
|
+
* Use this for testing Meta Conversions API events without making
|
|
365
|
+
* actual HTTP requests to Facebook's servers.
|
|
366
|
+
*/
|
|
367
|
+
declare const push: Env;
|
|
368
|
+
declare const simulation: string[];
|
|
369
|
+
|
|
370
|
+
declare const env_push: typeof push;
|
|
371
|
+
declare const env_simulation: typeof simulation;
|
|
372
|
+
declare namespace env {
|
|
373
|
+
export { env_push as push, env_simulation as simulation };
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
declare function Purchase$1(): BodyParameters;
|
|
377
|
+
|
|
378
|
+
declare namespace events {
|
|
379
|
+
export { Purchase$1 as Purchase };
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
declare const InitUserData: Settings;
|
|
383
|
+
declare const Purchase: Rule;
|
|
384
|
+
declare const config: {
|
|
385
|
+
order: {
|
|
386
|
+
complete: Rule;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
declare const mapping_InitUserData: typeof InitUserData;
|
|
391
|
+
declare const mapping_Purchase: typeof Purchase;
|
|
392
|
+
declare const mapping_config: typeof config;
|
|
393
|
+
declare namespace mapping {
|
|
394
|
+
export { mapping_InitUserData as InitUserData, mapping_Purchase as Purchase, mapping_config as config };
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
declare const index_env: typeof env;
|
|
398
|
+
declare const index_events: typeof events;
|
|
399
|
+
declare const index_mapping: typeof mapping;
|
|
400
|
+
declare namespace index {
|
|
401
|
+
export { index_env as env, index_events as events, index_mapping as mapping };
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export { index as examples, index$1 as schemas };
|