@walkeros/server-destination-datamanager 0.4.1 → 0.4.2

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/dev.d.mts CHANGED
@@ -1,16 +1,16 @@
1
- import { JSONSchema } from '@walkeros/core/dev';
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
2
  import { Mapping as Mapping$1, Destination as Destination$1 } from '@walkeros/core';
3
3
  import { DestinationServer } from '@walkeros/server-core';
4
4
  import { OAuth2Client } from 'google-auth-library';
5
5
 
6
- declare const schemas$1: Record<string, JSONSchema>;
6
+ declare const settings: _walkeros_core_dev.JSONSchema;
7
+ declare const mapping$2: _walkeros_core_dev.JSONSchema;
7
8
 
9
+ declare const schemas_settings: typeof settings;
8
10
  declare namespace schemas {
9
- export { schemas$1 as schemas };
11
+ export { mapping$2 as mapping, schemas_settings as settings };
10
12
  }
11
13
 
12
- type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
13
-
14
14
  interface Settings {
15
15
  /**
16
16
  * Service account credentials (client_email + private_key)
@@ -32,7 +32,7 @@ interface Settings {
32
32
  scopes?: string[];
33
33
  /** Array of destination accounts and conversion actions/user lists */
34
34
  destinations: Destination[];
35
- /** Default event source if not specified per event */
35
+ /** Event source for all events. Defaults to WEB if not specified */
36
36
  eventSource?: EventSource;
37
37
  /** Maximum number of events to batch before sending (max 2000) */
38
38
  batchSize?: number;
@@ -46,8 +46,6 @@ interface Settings {
46
46
  consent?: Consent;
47
47
  /** Test event code for debugging (optional) */
48
48
  testEventCode?: string;
49
- /** Log level for debugging (optional) */
50
- logLevel?: LogLevel;
51
49
  /** Guided helpers: User data mapping (applies to all events) */
52
50
  userData?: Mapping$1.Map;
53
51
  /** Guided helper: First-party user ID */
package/dist/dev.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { JSONSchema } from '@walkeros/core/dev';
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
2
  import { Mapping as Mapping$1, Destination as Destination$1 } from '@walkeros/core';
3
3
  import { DestinationServer } from '@walkeros/server-core';
4
4
  import { OAuth2Client } from 'google-auth-library';
5
5
 
6
- declare const schemas$1: Record<string, JSONSchema>;
6
+ declare const settings: _walkeros_core_dev.JSONSchema;
7
+ declare const mapping$2: _walkeros_core_dev.JSONSchema;
7
8
 
9
+ declare const schemas_settings: typeof settings;
8
10
  declare namespace schemas {
9
- export { schemas$1 as schemas };
11
+ export { mapping$2 as mapping, schemas_settings as settings };
10
12
  }
11
13
 
12
- type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
13
-
14
14
  interface Settings {
15
15
  /**
16
16
  * Service account credentials (client_email + private_key)
@@ -32,7 +32,7 @@ interface Settings {
32
32
  scopes?: string[];
33
33
  /** Array of destination accounts and conversion actions/user lists */
34
34
  destinations: Destination[];
35
- /** Default event source if not specified per event */
35
+ /** Event source for all events. Defaults to WEB if not specified */
36
36
  eventSource?: EventSource;
37
37
  /** Maximum number of events to batch before sending (max 2000) */
38
38
  batchSize?: number;
@@ -46,8 +46,6 @@ interface Settings {
46
46
  consent?: Consent;
47
47
  /** Test event code for debugging (optional) */
48
48
  testEventCode?: string;
49
- /** Log level for debugging (optional) */
50
- logLevel?: LogLevel;
51
49
  /** Guided helpers: User data mapping (applies to all events) */
52
50
  userData?: Mapping$1.Map;
53
51
  /** Guided helper: First-party user ID */
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(e,a)=>{for(var n in a)t(e,n,{get:a[n],enumerable:!0})},c={};i(c,{examples:()=>A,schemas:()=>s}),module.exports=(e=c,((e,i,c,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let r of n(i))o.call(e,r)||r===c||t(e,r,{get:()=>i[r],enumerable:!(s=a(i,r))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};i(s,{schemas:()=>I});var r=require("@walkeros/core/dev"),d=r.z.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),u=r.z.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),l=r.z.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),p=r.z.object({adUserData:l.describe("Consent for data collection and use").optional(),adPersonalization:l.describe("Consent for ad personalization").optional()}),m=r.z.object({accountId:r.z.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:d.describe("Type of account")}),g=r.z.object({operatingAccount:m.describe("Operating account details"),productDestinationId:r.z.string().min(1).describe("Product-specific destination ID (conversion action or user list)")}),v=require("@walkeros/core/dev"),O=v.z.object({accessToken:v.z.string().min(1).describe("OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)"),destinations:v.z.array(g).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:u.describe("Default event source if not specified per event (like WEB)").optional(),batchSize:v.z.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:v.z.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:v.z.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:v.z.string().url().describe("Override API endpoint for testing (like https://datamanager.googleapis.com/v1)").optional(),consent:p.describe("Request-level consent for all events").optional(),testEventCode:v.z.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:v.z.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:v.z.record(v.z.string(),v.z.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:v.z.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:v.z.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:v.z.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:v.z.union([v.z.string(),v.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:v.z.union([v.z.string(),v.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'targeting') or static boolean value").optional()}),E=require("@walkeros/core/dev").z.object({}),b=require("@walkeros/core/dev"),I={settings:(0,b.zodToSchema)(O),mapping:(0,b.zodToSchema)(E)},A={};i(A,{auth:()=>N,basic:()=>S,mapping:()=>k});var N={};i(N,{awsLambda:()=>D,customScopes:()=>T,dockerKubernetes:()=>y,gcpCloudFunctions:()=>G,localDevelopment:()=>_});var D={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL,private_key:process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g,"\n")},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},G={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},_={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},y={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},T={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL,private_key:process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g,"\n")},scopes:["https://www.googleapis.com/auth/datamanager"],destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},S={};i(S,{complete:()=>f,debug:()=>P,ga4:()=>h,minimal:()=>z});var z={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},f={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"},{operatingAccount:{accountId:"987654321",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}],eventSource:"WEB",batchSize:100,batchInterval:5e3,validateOnly:!1,consent:{adUserData:"CONSENT_GRANTED",adPersonalization:"CONSENT_GRANTED"},userData:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName"},userId:"user.id",clientId:"user.device",sessionAttributes:"context.sessionAttributes"},data:{map:{eventSource:{value:"WEB"}}}},h={settings:{destinations:[{operatingAccount:{accountId:"123456789",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}],eventSource:"WEB"}},P={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}],logLevel:"debug"}},k={};i(k,{Lead:()=>C,PageView:()=>w,Purchase:()=>R,mapping:()=>V,userDataMapping:()=>X});var L=require("@walkeros/core"),R={name:"purchase",data:{map:{transactionId:"data.id",conversionValue:"data.total",currency:{key:"data.currency",value:"USD"},eventName:{value:"purchase"},userId:"user.id",email:"user.id",gclid:"context.gclid",gbraid:"context.gbraid",wbraid:"context.wbraid",cartData:{map:{items:{loop:["nested",{condition:e=>(0,L.isObject)(e)&&"product"===e.entity,map:{merchantProductId:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},C={name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},w={name:"page_view",data:{map:{eventName:{value:"page_view"}}}},V={order:{complete:R},lead:{submit:C},page:{view:w}},X={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]},data:{map:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName",regionCode:"data.country",postalCode:"data.zip"}},mapping:V};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(e,a)=>{for(var n in a)t(e,n,{get:a[n],enumerable:!0})},c={};i(c,{examples:()=>N,schemas:()=>s}),module.exports=(e=c,((e,i,c,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let r of n(i))o.call(e,r)||r===c||t(e,r,{get:()=>i[r],enumerable:!(s=a(i,r))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};i(s,{mapping:()=>A,settings:()=>b});var r=require("@walkeros/core/dev"),d=r.z.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),u=r.z.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),l=r.z.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),p=r.z.object({adUserData:l.describe("Consent for data collection and use").optional(),adPersonalization:l.describe("Consent for ad personalization").optional()}),m=r.z.object({accountId:r.z.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:d.describe("Type of account")}),g=r.z.object({operatingAccount:m.describe("Operating account details"),productDestinationId:r.z.string().min(1).describe("Product-specific destination ID (conversion action or user list)")}),O=require("@walkeros/core/dev"),E=O.z.object({accessToken:O.z.string().min(1).describe("OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)"),destinations:O.z.array(g).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:u.optional().default("WEB").describe("Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER"),batchSize:O.z.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:O.z.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:O.z.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:O.z.string().url().describe("Override API endpoint for testing (like https://datamanager.googleapis.com/v1)").optional(),consent:p.describe("Request-level consent for all events").optional(),testEventCode:O.z.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:O.z.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:O.z.record(O.z.string(),O.z.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:O.z.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:O.z.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:O.z.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:O.z.union([O.z.string(),O.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:O.z.union([O.z.string(),O.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'targeting') or static boolean value").optional()}),v=require("@walkeros/core/dev").z.object({}),I=require("@walkeros/core/dev"),b=(0,I.zodToSchema)(E),A=(0,I.zodToSchema)(v),N={};i(N,{auth:()=>D,basic:()=>z,mapping:()=>k});var D={};i(D,{awsLambda:()=>_,customScopes:()=>S,dockerKubernetes:()=>y,gcpCloudFunctions:()=>G,localDevelopment:()=>T});var _={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL||"",private_key:(process.env.GOOGLE_PRIVATE_KEY||"").replace(/\\n/g,"\n")},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},G={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},T={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},y={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},S={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL||"",private_key:(process.env.GOOGLE_PRIVATE_KEY||"").replace(/\\n/g,"\n")},scopes:["https://www.googleapis.com/auth/datamanager"],destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},z={};i(z,{complete:()=>P,debug:()=>R,ga4:()=>h,minimal:()=>f});var f={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},P={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"},{operatingAccount:{accountId:"987654321",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}],batchSize:100,batchInterval:5e3,validateOnly:!1,consent:{adUserData:"CONSENT_GRANTED",adPersonalization:"CONSENT_GRANTED"},userData:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName"},userId:"user.id",clientId:"user.device",sessionAttributes:"context.sessionAttributes"}},h={settings:{destinations:[{operatingAccount:{accountId:"123456789",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}]}},R={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},k={};i(k,{Lead:()=>w,PageView:()=>V,Purchase:()=>C,mapping:()=>X,userDataMapping:()=>j});var L=require("@walkeros/core"),C={name:"purchase",data:{map:{transactionId:"data.id",conversionValue:"data.total",currency:{key:"data.currency",value:"USD"},eventName:{value:"purchase"},userId:"user.id",email:"user.id",gclid:"context.gclid",gbraid:"context.gbraid",wbraid:"context.wbraid",cartData:{map:{items:{loop:["nested",{condition:e=>(0,L.isObject)(e)&&"product"===e.entity,map:{merchantProductId:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},w={name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},V={name:"page_view",data:{map:{eventName:{value:"page_view"}}}},X={order:{complete:C},lead:{submit:w},page:{view:V}},j={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]},data:{map:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName",regionCode:"data.country",postalCode:"data.zip"}},mapping:X};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/schemas.ts","../src/schemas/primitives.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/index.ts","../src/examples/index.ts","../src/examples/auth.ts","../src/examples/basic.ts","../src/examples/mapping.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\nimport { schemas } from './schemas/index';\n\nexport { schemas };\n","import { z } from '@walkeros/core/dev';\n\nexport const AccountTypeSchema = z.enum([\n 'GOOGLE_ADS',\n 'DISPLAY_VIDEO_ADVERTISER',\n 'DISPLAY_VIDEO_PARTNER',\n 'GOOGLE_ANALYTICS_PROPERTY',\n]);\n\nexport const EventSourceSchema = z.enum([\n 'WEB',\n 'APP',\n 'IN_STORE',\n 'PHONE',\n 'OTHER',\n]);\n\nexport const ConsentStatusSchema = z.enum([\n 'CONSENT_GRANTED',\n 'CONSENT_DENIED',\n]);\n\nexport const ConsentSchema = z.object({\n adUserData: ConsentStatusSchema.describe(\n 'Consent for data collection and use',\n ).optional(),\n adPersonalization: ConsentStatusSchema.describe(\n 'Consent for ad personalization',\n ).optional(),\n});\n\nexport const OperatingAccountSchema = z.object({\n accountId: z\n .string()\n .min(1)\n .describe('Account ID (e.g., \"123-456-7890\" for Google Ads)'),\n accountType: AccountTypeSchema.describe('Type of account'),\n});\n\nexport const DestinationSchema = z.object({\n operatingAccount: OperatingAccountSchema.describe(\n 'Operating account details',\n ),\n productDestinationId: z\n .string()\n .min(1)\n .describe(\n 'Product-specific destination ID (conversion action or user list)',\n ),\n});\n","import { z } from '@walkeros/core/dev';\nimport {\n DestinationSchema,\n EventSourceSchema,\n ConsentSchema,\n} from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)',\n ),\n destinations: z\n .array(DestinationSchema)\n .min(1)\n .max(10)\n .describe(\n 'Array of destination accounts and conversion actions/user lists (max 10)',\n ),\n eventSource: EventSourceSchema.describe(\n 'Default event source if not specified per event (like WEB)',\n ).optional(),\n batchSize: z\n .number()\n .int()\n .min(1)\n .max(2000)\n .describe(\n 'Maximum number of events to batch before sending (max 2000, like 100)',\n )\n .optional(),\n batchInterval: z\n .number()\n .int()\n .min(0)\n .describe(\n 'Time in milliseconds to wait before auto-flushing batch (like 5000)',\n )\n .optional(),\n validateOnly: z\n .boolean()\n .describe('If true, validate request without ingestion (testing mode)')\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Override API endpoint for testing (like https://datamanager.googleapis.com/v1)',\n )\n .optional(),\n consent: ConsentSchema.describe(\n 'Request-level consent for all events',\n ).optional(),\n testEventCode: z\n .string()\n .describe('Test event code for debugging (like TEST12345)')\n .optional(),\n logLevel: z\n .enum(['debug', 'info', 'warn', 'error', 'none'])\n .describe('Log level for debugging (debug shows all API calls)')\n .optional(),\n userData: z\n .record(z.string(), z.unknown())\n .describe(\n \"Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })\",\n )\n .optional(),\n userId: z\n .any()\n .describe(\n \"Guided helper: First-party user ID for all events (like 'user.id')\",\n )\n .optional(),\n clientId: z\n .any()\n .describe(\n \"Guided helper: GA4 client ID for all events (like 'user.device')\",\n )\n .optional(),\n sessionAttributes: z\n .any()\n .describe(\n \"Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')\",\n )\n .optional(),\n consentAdUserData: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'marketing') or static boolean value\",\n )\n .optional(),\n consentAdPersonalization: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'targeting') or static boolean value\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n// Data Manager uses flexible mapping via walkerOS mapping system\n// No event-specific mapping schema needed (similar to Meta CAPI pattern)\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * from './primitives';\nexport * from './settings';\nexport * from './mapping';\n\nimport { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nimport type { JSONSchema } from '@walkeros/core/dev';\n\nexport const schemas: Record<string, JSONSchema> = {\n settings: zodToSchema(SettingsSchema),\n mapping: zodToSchema(MappingSchema),\n};\n","export * as auth from './auth';\nexport * as basic from './basic';\nexport * as mapping from './mapping';\n","import type { DestinationDataManager } from '..';\n\n/**\n * AWS Lambda / Serverless Configuration\n * Uses inline credentials from environment variables\n * Best for: AWS Lambda, Docker, Kubernetes, any serverless environment\n */\nexport const awsLambda: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL!,\n private_key: process.env.GOOGLE_PRIVATE_KEY!.replace(/\\\\n/g, '\\n'),\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * GCP Cloud Functions / Cloud Run Configuration\n * Uses Application Default Credentials (ADC) - no explicit auth config needed\n * Best for: Google Cloud Functions, Cloud Run, GCE, GKE\n */\nexport const gcpCloudFunctions: DestinationDataManager.Config = {\n settings: {\n // No auth config needed - ADC works automatically on GCP!\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Local Development Configuration\n * Uses service account JSON file\n * Best for: Local development, testing\n */\nexport const localDevelopment: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Docker / Kubernetes Configuration\n * Uses ADC via GOOGLE_APPLICATION_CREDENTIALS environment variable\n * Best for: Docker containers, Kubernetes pods\n *\n * Setup:\n * 1. Mount service account JSON as secret/configmap\n * 2. Set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json\n * 3. ADC will automatically use it\n */\nexport const dockerKubernetes: DestinationDataManager.Config = {\n settings: {\n // No explicit config - ADC uses GOOGLE_APPLICATION_CREDENTIALS env var\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Custom Scopes Configuration\n * For specific use cases requiring different OAuth scopes\n */\nexport const customScopes: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL!,\n private_key: process.env.GOOGLE_PRIVATE_KEY!.replace(/\\\\n/g, '\\n'),\n },\n scopes: ['https://www.googleapis.com/auth/datamanager'],\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n","import type { DestinationDataManager } from '..';\n\n/**\n * Minimal configuration for Google Data Manager with inline credentials\n */\nexport const minimal: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Complete configuration with all options\n */\nexport const complete: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n {\n operatingAccount: {\n accountId: '987654321',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n eventSource: 'WEB',\n batchSize: 100,\n batchInterval: 5000,\n validateOnly: false,\n consent: {\n adUserData: 'CONSENT_GRANTED',\n adPersonalization: 'CONSENT_GRANTED',\n },\n\n // Guided helpers (apply to all events)\n userData: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n },\n userId: 'user.id',\n clientId: 'user.device',\n sessionAttributes: 'context.sessionAttributes',\n },\n data: {\n map: {\n eventSource: { value: 'WEB' },\n },\n },\n};\n\n/**\n * GA4-specific configuration using Application Default Credentials\n */\nexport const ga4: DestinationDataManager.Config = {\n settings: {\n destinations: [\n {\n operatingAccount: {\n accountId: '123456789',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n eventSource: 'WEB',\n },\n};\n\n/**\n * Debug configuration with logging enabled using keyFilename\n */\nexport const debug: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n logLevel: 'debug', // Shows all API calls and responses\n },\n};\n","import type { DestinationDataManager } from '..';\nimport { isObject } from '@walkeros/core';\n\n/**\n * Purchase event mapping for Google Ads conversion\n */\nexport const Purchase: DestinationDataManager.Rule = {\n name: 'purchase',\n data: {\n map: {\n // Required fields\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n\n // User identification\n userId: 'user.id',\n email: 'user.id', // Will be hashed automatically\n\n // Attribution identifiers (captured by browser source from URL)\n gclid: 'context.gclid', // Google Click ID\n gbraid: 'context.gbraid', // iOS attribution\n wbraid: 'context.wbraid', // Web-to-app\n\n // Shopping cart data\n cartData: {\n map: {\n items: {\n loop: [\n 'nested',\n {\n condition: (entity) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n merchantProductId: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n};\n\n/**\n * Lead event mapping\n */\nexport const Lead: DestinationDataManager.Rule = {\n name: 'generate_lead',\n data: {\n map: {\n eventName: { value: 'generate_lead' },\n conversionValue: { value: 10 },\n currency: { value: 'USD' },\n },\n },\n};\n\n/**\n * Page view mapping for GA4\n */\nexport const PageView: DestinationDataManager.Rule = {\n name: 'page_view',\n data: {\n map: {\n eventName: { value: 'page_view' },\n },\n },\n};\n\n/**\n * Complete mapping configuration\n */\nexport const mapping = {\n order: {\n complete: Purchase,\n },\n lead: {\n submit: Lead,\n },\n page: {\n view: PageView,\n },\n} satisfies DestinationDataManager.Rules;\n\n/**\n * User data mapping configuration\n * Maps walkerOS user properties to Data Manager user identifiers\n */\nexport const userDataMapping: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n data: {\n map: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n regionCode: 'data.country',\n postalCode: 'data.zip',\n },\n },\n mapping,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,oBAAoB,aAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,oBAAoB,aAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,sBAAsB,aAAE,KAAK;AAAA,EACxC;AAAA,EACA;AACF,CAAC;AAEM,IAAM,gBAAgB,aAAE,OAAO;AAAA,EACpC,YAAY,oBAAoB;AAAA,IAC9B;AAAA,EACF,EAAE,SAAS;AAAA,EACX,mBAAmB,oBAAoB;AAAA,IACrC;AAAA,EACF,EAAE,SAAS;AACb,CAAC;AAEM,IAAM,yBAAyB,aAAE,OAAO;AAAA,EAC7C,WAAW,aACR,OAAO,EACP,IAAI,CAAC,EACL,SAAS,kDAAkD;AAAA,EAC9D,aAAa,kBAAkB,SAAS,iBAAiB;AAC3D,CAAC;AAEM,IAA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UAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA;AACF;","names":["import_dev","import_dev","import_dev"]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas.ts","../src/schemas/primitives.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/index.ts","../src/examples/index.ts","../src/examples/auth.ts","../src/examples/basic.ts","../src/examples/mapping.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\nexport { settings, mapping } from './schemas/index';\n","import { z } from '@walkeros/core/dev';\n\nexport const AccountTypeSchema = z.enum([\n 'GOOGLE_ADS',\n 'DISPLAY_VIDEO_ADVERTISER',\n 'DISPLAY_VIDEO_PARTNER',\n 'GOOGLE_ANALYTICS_PROPERTY',\n]);\n\nexport const EventSourceSchema = z.enum([\n 'WEB',\n 'APP',\n 'IN_STORE',\n 'PHONE',\n 'OTHER',\n]);\n\nexport const ConsentStatusSchema = z.enum([\n 'CONSENT_GRANTED',\n 'CONSENT_DENIED',\n]);\n\nexport const ConsentSchema = z.object({\n adUserData: ConsentStatusSchema.describe(\n 'Consent for data collection and use',\n ).optional(),\n adPersonalization: ConsentStatusSchema.describe(\n 'Consent for ad personalization',\n ).optional(),\n});\n\nexport const OperatingAccountSchema = z.object({\n accountId: z\n .string()\n .min(1)\n .describe('Account ID (e.g., \"123-456-7890\" for Google Ads)'),\n accountType: AccountTypeSchema.describe('Type of account'),\n});\n\nexport const DestinationSchema = z.object({\n operatingAccount: OperatingAccountSchema.describe(\n 'Operating account details',\n ),\n productDestinationId: z\n .string()\n .min(1)\n .describe(\n 'Product-specific destination ID (conversion action or user list)',\n ),\n});\n","import { z } from '@walkeros/core/dev';\nimport {\n DestinationSchema,\n EventSourceSchema,\n ConsentSchema,\n} from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)',\n ),\n destinations: z\n .array(DestinationSchema)\n .min(1)\n .max(10)\n .describe(\n 'Array of destination accounts and conversion actions/user lists (max 10)',\n ),\n eventSource: EventSourceSchema.optional()\n .default('WEB')\n .describe(\n 'Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER',\n ),\n batchSize: z\n .number()\n .int()\n .min(1)\n .max(2000)\n .describe(\n 'Maximum number of events to batch before sending (max 2000, like 100)',\n )\n .optional(),\n batchInterval: z\n .number()\n .int()\n .min(0)\n .describe(\n 'Time in milliseconds to wait before auto-flushing batch (like 5000)',\n )\n .optional(),\n validateOnly: z\n .boolean()\n .describe('If true, validate request without ingestion (testing mode)')\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Override API endpoint for testing (like https://datamanager.googleapis.com/v1)',\n )\n .optional(),\n consent: ConsentSchema.describe(\n 'Request-level consent for all events',\n ).optional(),\n testEventCode: z\n .string()\n .describe('Test event code for debugging (like TEST12345)')\n .optional(),\n logLevel: z\n .enum(['debug', 'info', 'warn', 'error', 'none'])\n .describe('Log level for debugging (debug shows all API calls)')\n .optional(),\n userData: z\n .record(z.string(), z.unknown())\n .describe(\n \"Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })\",\n )\n .optional(),\n userId: z\n .any()\n .describe(\n \"Guided helper: First-party user ID for all events (like 'user.id')\",\n )\n .optional(),\n clientId: z\n .any()\n .describe(\n \"Guided helper: GA4 client ID for all events (like 'user.device')\",\n )\n .optional(),\n sessionAttributes: z\n .any()\n .describe(\n \"Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')\",\n )\n .optional(),\n consentAdUserData: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'marketing') or static boolean value\",\n )\n .optional(),\n consentAdPersonalization: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'targeting') or static boolean value\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n// Data Manager uses flexible mapping via walkerOS mapping system\n// No event-specific mapping schema needed (similar to Meta CAPI pattern)\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * from './primitives';\nexport * from './settings';\nexport * from './mapping';\n\nimport { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","export * as auth from './auth';\nexport * as basic from './basic';\nexport * as mapping from './mapping';\n","import type { DestinationDataManager } from '..';\n\n/**\n * AWS Lambda / Serverless Configuration\n * Uses inline credentials from environment variables\n * Best for: AWS Lambda, Docker, Kubernetes, any serverless environment\n */\nexport const awsLambda: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL || '',\n private_key: (process.env.GOOGLE_PRIVATE_KEY || '').replace(/\\\\n/g, '\\n'),\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * GCP Cloud Functions / Cloud Run Configuration\n * Uses Application Default Credentials (ADC) - no explicit auth config needed\n * Best for: Google Cloud Functions, Cloud Run, GCE, GKE\n */\nexport const gcpCloudFunctions: DestinationDataManager.Config = {\n settings: {\n // No auth config needed - ADC works automatically on GCP!\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Local Development Configuration\n * Uses service account JSON file\n * Best for: Local development, testing\n */\nexport const localDevelopment: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Docker / Kubernetes Configuration\n * Uses ADC via GOOGLE_APPLICATION_CREDENTIALS environment variable\n * Best for: Docker containers, Kubernetes pods\n *\n * Setup:\n * 1. Mount service account JSON as secret/configmap\n * 2. Set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json\n * 3. ADC will automatically use it\n */\nexport const dockerKubernetes: DestinationDataManager.Config = {\n settings: {\n // No explicit config - ADC uses GOOGLE_APPLICATION_CREDENTIALS env var\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Custom Scopes Configuration\n * For specific use cases requiring different OAuth scopes\n */\nexport const customScopes: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL || '',\n private_key: (process.env.GOOGLE_PRIVATE_KEY || '').replace(/\\\\n/g, '\\n'),\n },\n scopes: ['https://www.googleapis.com/auth/datamanager'],\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n","import type { DestinationDataManager } from '..';\n\n/**\n * Minimal configuration for Google Data Manager with inline credentials\n */\nexport const minimal: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Complete configuration with all options\n */\nexport const complete: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n {\n operatingAccount: {\n accountId: '987654321',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n batchSize: 100,\n batchInterval: 5000,\n validateOnly: false,\n consent: {\n adUserData: 'CONSENT_GRANTED',\n adPersonalization: 'CONSENT_GRANTED',\n },\n\n // Guided helpers (apply to all events)\n userData: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n },\n userId: 'user.id',\n clientId: 'user.device',\n sessionAttributes: 'context.sessionAttributes',\n },\n};\n\n/**\n * GA4-specific configuration using Application Default Credentials\n */\nexport const ga4: DestinationDataManager.Config = {\n settings: {\n destinations: [\n {\n operatingAccount: {\n accountId: '123456789',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n },\n};\n\n/**\n * Debug configuration with logging enabled using keyFilename\n */\nexport const debug: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n","import type { DestinationDataManager } from '..';\nimport { isObject } from '@walkeros/core';\n\n/**\n * Purchase event mapping for Google Ads conversion\n */\nexport const Purchase: DestinationDataManager.Rule = {\n name: 'purchase',\n data: {\n map: {\n // Required fields\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n\n // User identification\n userId: 'user.id',\n email: 'user.id', // Will be hashed automatically\n\n // Attribution identifiers (captured by browser source from URL)\n gclid: 'context.gclid', // Google Click ID\n gbraid: 'context.gbraid', // iOS attribution\n wbraid: 'context.wbraid', // Web-to-app\n\n // Shopping cart data\n cartData: {\n map: {\n items: {\n loop: [\n 'nested',\n {\n condition: (entity) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n merchantProductId: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n};\n\n/**\n * Lead event mapping\n */\nexport const Lead: DestinationDataManager.Rule = {\n name: 'generate_lead',\n data: {\n map: {\n eventName: { value: 'generate_lead' },\n conversionValue: { value: 10 },\n currency: { value: 'USD' },\n },\n },\n};\n\n/**\n * Page view mapping for GA4\n */\nexport const PageView: DestinationDataManager.Rule = {\n name: 'page_view',\n data: {\n map: {\n eventName: { value: 'page_view' },\n },\n },\n};\n\n/**\n * Complete mapping configuration\n */\nexport const mapping = {\n order: {\n complete: Purchase,\n },\n lead: {\n submit: Lead,\n },\n page: {\n view: PageView,\n },\n} satisfies DestinationDataManager.Rules;\n\n/**\n * User data mapping configuration\n * Maps walkerOS user properties to Data Manager user identifiers\n */\nexport const userDataMapping: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n data: {\n map: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n regionCode: 'data.country',\n postalCode: 'data.zip',\n },\n },\n mapping,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,oBAAoB,aAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,oBAAoB,aAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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;AAMO,IAAM,kBAAiD;AAAA,EAC5D,UAAU;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,MACZ;AAAA,QACE,kBAAkB;AAAA,UAChB,WAAW;AAAA,UACX,aAAa;AAAA,QACf;AAAA,QACA,sBAAsB;AAAA,MACxB;AAAA,IACF;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,KAAK;AAAA,MACH,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,SAAAA;AACF;","names":["import_dev","import_dev","import_dev","mapping"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,t=(t,a)=>{for(var n in a)e(t,n,{get:a[n],enumerable:!0})},a={};t(a,{schemas:()=>v});import{z as n}from"@walkeros/core/dev";var o=n.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),i=n.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),c=n.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),s=n.object({adUserData:c.describe("Consent for data collection and use").optional(),adPersonalization:c.describe("Consent for ad personalization").optional()}),r=n.object({accountId:n.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:o.describe("Type of account")}),d=n.object({operatingAccount:r.describe("Operating account details"),productDestinationId:n.string().min(1).describe("Product-specific destination ID (conversion action or user list)")});import{z as u}from"@walkeros/core/dev";var l=u.object({accessToken:u.string().min(1).describe("OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)"),destinations:u.array(d).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:i.describe("Default event source if not specified per event (like WEB)").optional(),batchSize:u.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:u.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:u.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:u.string().url().describe("Override API endpoint for testing (like https://datamanager.googleapis.com/v1)").optional(),consent:s.describe("Request-level consent for all events").optional(),testEventCode:u.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:u.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:u.record(u.string(),u.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:u.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:u.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:u.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:u.union([u.string(),u.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:u.union([u.string(),u.boolean()]).describe("Consent mapping: Field name from event.consent (like 'targeting') or static boolean value").optional()});import{z as p}from"@walkeros/core/dev";var m=p.object({});import{zodToSchema as g}from"@walkeros/core/dev";var v={settings:g(l),mapping:g(m)},E={};t(E,{auth:()=>I,basic:()=>G,mapping:()=>f});var I={};t(I,{awsLambda:()=>O,customScopes:()=>D,dockerKubernetes:()=>N,gcpCloudFunctions:()=>A,localDevelopment:()=>b});var O={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL,private_key:process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g,"\n")},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},A={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},b={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},N={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},D={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL,private_key:process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g,"\n")},scopes:["https://www.googleapis.com/auth/datamanager"],destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},G={};t(G,{complete:()=>T,debug:()=>S,ga4:()=>y,minimal:()=>_});var _={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},T={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"},{operatingAccount:{accountId:"987654321",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}],eventSource:"WEB",batchSize:100,batchInterval:5e3,validateOnly:!1,consent:{adUserData:"CONSENT_GRANTED",adPersonalization:"CONSENT_GRANTED"},userData:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName"},userId:"user.id",clientId:"user.device",sessionAttributes:"context.sessionAttributes"},data:{map:{eventSource:{value:"WEB"}}}},y={settings:{destinations:[{operatingAccount:{accountId:"123456789",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}],eventSource:"WEB"}},S={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}],logLevel:"debug"}},f={};t(f,{Lead:()=>L,PageView:()=>R,Purchase:()=>k,mapping:()=>P,userDataMapping:()=>C});import{isObject as h}from"@walkeros/core";var k={name:"purchase",data:{map:{transactionId:"data.id",conversionValue:"data.total",currency:{key:"data.currency",value:"USD"},eventName:{value:"purchase"},userId:"user.id",email:"user.id",gclid:"context.gclid",gbraid:"context.gbraid",wbraid:"context.wbraid",cartData:{map:{items:{loop:["nested",{condition:e=>h(e)&&"product"===e.entity,map:{merchantProductId:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},L={name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},R={name:"page_view",data:{map:{eventName:{value:"page_view"}}}},P={order:{complete:k},lead:{submit:L},page:{view:R}},C={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]},data:{map:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName",regionCode:"data.country",postalCode:"data.zip"}},mapping:P};export{E as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,t=(t,a)=>{for(var n in a)e(t,n,{get:a[n],enumerable:!0})},a={};t(a,{mapping:()=>v,settings:()=>E});import{z as n}from"@walkeros/core/dev";var o=n.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),i=n.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),s=n.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),c=n.object({adUserData:s.describe("Consent for data collection and use").optional(),adPersonalization:s.describe("Consent for ad personalization").optional()}),r=n.object({accountId:n.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:o.describe("Type of account")}),d=n.object({operatingAccount:r.describe("Operating account details"),productDestinationId:n.string().min(1).describe("Product-specific destination ID (conversion action or user list)")});import{z as l}from"@walkeros/core/dev";var u=l.object({accessToken:l.string().min(1).describe("OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)"),destinations:l.array(d).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:i.optional().default("WEB").describe("Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER"),batchSize:l.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:l.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:l.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:l.string().url().describe("Override API endpoint for testing (like https://datamanager.googleapis.com/v1)").optional(),consent:c.describe("Request-level consent for all events").optional(),testEventCode:l.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:l.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:l.record(l.string(),l.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:l.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:l.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:l.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:l.union([l.string(),l.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:l.union([l.string(),l.boolean()]).describe("Consent mapping: Field name from event.consent (like 'targeting') or static boolean value").optional()});import{z as p}from"@walkeros/core/dev";var m=p.object({});import{zodToSchema as g}from"@walkeros/core/dev";var E=g(u),v=g(m),O={};t(O,{auth:()=>I,basic:()=>_,mapping:()=>R});var I={};t(I,{awsLambda:()=>A,customScopes:()=>G,dockerKubernetes:()=>D,gcpCloudFunctions:()=>b,localDevelopment:()=>N});var A={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL||"",private_key:(process.env.GOOGLE_PRIVATE_KEY||"").replace(/\\n/g,"\n")},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},b={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},N={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},D={settings:{destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},G={settings:{credentials:{client_email:process.env.GOOGLE_CLIENT_EMAIL||"",private_key:(process.env.GOOGLE_PRIVATE_KEY||"").replace(/\\n/g,"\n")},scopes:["https://www.googleapis.com/auth/datamanager"],destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},_={};t(_,{complete:()=>y,debug:()=>f,ga4:()=>S,minimal:()=>T});var T={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},y={settings:{credentials:{client_email:"service-account@project.iam.gserviceaccount.com",private_key:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"},destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"},{operatingAccount:{accountId:"987654321",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}],batchSize:100,batchInterval:5e3,validateOnly:!1,consent:{adUserData:"CONSENT_GRANTED",adPersonalization:"CONSENT_GRANTED"},userData:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName"},userId:"user.id",clientId:"user.device",sessionAttributes:"context.sessionAttributes"}},S={settings:{destinations:[{operatingAccount:{accountId:"123456789",accountType:"GOOGLE_ANALYTICS_PROPERTY"},productDestinationId:"G-XXXXXXXXXX"}]}},f={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]}},R={};t(R,{Lead:()=>k,PageView:()=>L,Purchase:()=>h,mapping:()=>C,userDataMapping:()=>V});import{isObject as P}from"@walkeros/core";var h={name:"purchase",data:{map:{transactionId:"data.id",conversionValue:"data.total",currency:{key:"data.currency",value:"USD"},eventName:{value:"purchase"},userId:"user.id",email:"user.id",gclid:"context.gclid",gbraid:"context.gbraid",wbraid:"context.wbraid",cartData:{map:{items:{loop:["nested",{condition:e=>P(e)&&"product"===e.entity,map:{merchantProductId:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},k={name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},L={name:"page_view",data:{map:{eventName:{value:"page_view"}}}},C={order:{complete:h},lead:{submit:k},page:{view:L}},V={settings:{keyFilename:"./service-account.json",destinations:[{operatingAccount:{accountId:"123-456-7890",accountType:"GOOGLE_ADS"},productDestinationId:"AW-CONVERSION-123"}]},data:{map:{email:"user.id",phone:"data.phone",firstName:"data.firstName",lastName:"data.lastName",regionCode:"data.country",postalCode:"data.zip"}},mapping:C};export{O as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas.ts","../src/schemas/primitives.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/index.ts","../src/examples/index.ts","../src/examples/auth.ts","../src/examples/basic.ts","../src/examples/mapping.ts"],"sourcesContent":["// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\nimport { schemas } from './schemas/index';\n\nexport { schemas };\n","import { z } from '@walkeros/core/dev';\n\nexport const AccountTypeSchema = z.enum([\n 'GOOGLE_ADS',\n 'DISPLAY_VIDEO_ADVERTISER',\n 'DISPLAY_VIDEO_PARTNER',\n 'GOOGLE_ANALYTICS_PROPERTY',\n]);\n\nexport const EventSourceSchema = z.enum([\n 'WEB',\n 'APP',\n 'IN_STORE',\n 'PHONE',\n 'OTHER',\n]);\n\nexport const ConsentStatusSchema = z.enum([\n 'CONSENT_GRANTED',\n 'CONSENT_DENIED',\n]);\n\nexport const ConsentSchema = z.object({\n adUserData: ConsentStatusSchema.describe(\n 'Consent for data collection and use',\n ).optional(),\n adPersonalization: ConsentStatusSchema.describe(\n 'Consent for ad personalization',\n ).optional(),\n});\n\nexport const OperatingAccountSchema = z.object({\n accountId: z\n .string()\n .min(1)\n .describe('Account ID (e.g., \"123-456-7890\" for Google Ads)'),\n accountType: AccountTypeSchema.describe('Type of account'),\n});\n\nexport const DestinationSchema = z.object({\n operatingAccount: OperatingAccountSchema.describe(\n 'Operating account details',\n ),\n productDestinationId: z\n .string()\n .min(1)\n .describe(\n 'Product-specific destination ID (conversion action or user list)',\n ),\n});\n","import { z } from '@walkeros/core/dev';\nimport {\n DestinationSchema,\n EventSourceSchema,\n ConsentSchema,\n} from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)',\n ),\n destinations: z\n .array(DestinationSchema)\n .min(1)\n .max(10)\n .describe(\n 'Array of destination accounts and conversion actions/user lists (max 10)',\n ),\n eventSource: EventSourceSchema.describe(\n 'Default event source if not specified per event (like WEB)',\n ).optional(),\n batchSize: z\n .number()\n .int()\n .min(1)\n .max(2000)\n .describe(\n 'Maximum number of events to batch before sending (max 2000, like 100)',\n )\n .optional(),\n batchInterval: z\n .number()\n .int()\n .min(0)\n .describe(\n 'Time in milliseconds to wait before auto-flushing batch (like 5000)',\n )\n .optional(),\n validateOnly: z\n .boolean()\n .describe('If true, validate request without ingestion (testing mode)')\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Override API endpoint for testing (like https://datamanager.googleapis.com/v1)',\n )\n .optional(),\n consent: ConsentSchema.describe(\n 'Request-level consent for all events',\n ).optional(),\n testEventCode: z\n .string()\n .describe('Test event code for debugging (like TEST12345)')\n .optional(),\n logLevel: z\n .enum(['debug', 'info', 'warn', 'error', 'none'])\n .describe('Log level for debugging (debug shows all API calls)')\n .optional(),\n userData: z\n .record(z.string(), z.unknown())\n .describe(\n \"Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })\",\n )\n .optional(),\n userId: z\n .any()\n .describe(\n \"Guided helper: First-party user ID for all events (like 'user.id')\",\n )\n .optional(),\n clientId: z\n .any()\n .describe(\n \"Guided helper: GA4 client ID for all events (like 'user.device')\",\n )\n .optional(),\n sessionAttributes: z\n .any()\n .describe(\n \"Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')\",\n )\n .optional(),\n consentAdUserData: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'marketing') or static boolean value\",\n )\n .optional(),\n consentAdPersonalization: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'targeting') or static boolean value\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n// Data Manager uses flexible mapping via walkerOS mapping system\n// No event-specific mapping schema needed (similar to Meta CAPI pattern)\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * from './primitives';\nexport * from './settings';\nexport * from './mapping';\n\nimport { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nimport type { JSONSchema } from '@walkeros/core/dev';\n\nexport const schemas: Record<string, JSONSchema> = {\n settings: zodToSchema(SettingsSchema),\n mapping: zodToSchema(MappingSchema),\n};\n","export * as auth from './auth';\nexport * as basic from './basic';\nexport * as mapping from './mapping';\n","import type { DestinationDataManager } from '..';\n\n/**\n * AWS Lambda / Serverless Configuration\n * Uses inline credentials from environment variables\n * Best for: AWS Lambda, Docker, Kubernetes, any serverless environment\n */\nexport const awsLambda: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL!,\n private_key: process.env.GOOGLE_PRIVATE_KEY!.replace(/\\\\n/g, '\\n'),\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * GCP Cloud Functions / Cloud Run Configuration\n * Uses Application Default Credentials (ADC) - no explicit auth config needed\n * Best for: Google Cloud Functions, Cloud Run, GCE, GKE\n */\nexport const gcpCloudFunctions: DestinationDataManager.Config = {\n settings: {\n // No auth config needed - ADC works automatically on GCP!\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Local Development Configuration\n * Uses service account JSON file\n * Best for: Local development, testing\n */\nexport const localDevelopment: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Docker / Kubernetes Configuration\n * Uses ADC via GOOGLE_APPLICATION_CREDENTIALS environment variable\n * Best for: Docker containers, Kubernetes pods\n *\n * Setup:\n * 1. Mount service account JSON as secret/configmap\n * 2. Set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json\n * 3. ADC will automatically use it\n */\nexport const dockerKubernetes: DestinationDataManager.Config = {\n settings: {\n // No explicit config - ADC uses GOOGLE_APPLICATION_CREDENTIALS env var\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Custom Scopes Configuration\n * For specific use cases requiring different OAuth scopes\n */\nexport const customScopes: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL!,\n private_key: process.env.GOOGLE_PRIVATE_KEY!.replace(/\\\\n/g, '\\n'),\n },\n scopes: ['https://www.googleapis.com/auth/datamanager'],\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n","import type { DestinationDataManager } from '..';\n\n/**\n * Minimal configuration for Google Data Manager with inline credentials\n */\nexport const minimal: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Complete configuration with all options\n */\nexport const complete: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n {\n operatingAccount: {\n accountId: '987654321',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n eventSource: 'WEB',\n batchSize: 100,\n batchInterval: 5000,\n validateOnly: false,\n consent: {\n adUserData: 'CONSENT_GRANTED',\n adPersonalization: 'CONSENT_GRANTED',\n },\n\n // Guided helpers (apply to all events)\n userData: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n },\n userId: 'user.id',\n clientId: 'user.device',\n sessionAttributes: 'context.sessionAttributes',\n },\n data: {\n map: {\n eventSource: { value: 'WEB' },\n },\n },\n};\n\n/**\n * GA4-specific configuration using Application Default Credentials\n */\nexport const ga4: DestinationDataManager.Config = {\n settings: {\n destinations: [\n {\n operatingAccount: {\n accountId: '123456789',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n eventSource: 'WEB',\n },\n};\n\n/**\n * Debug configuration with logging enabled using keyFilename\n */\nexport const debug: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n logLevel: 'debug', // Shows all API calls and responses\n },\n};\n","import type { DestinationDataManager } from '..';\nimport { isObject } from '@walkeros/core';\n\n/**\n * Purchase event mapping for Google Ads conversion\n */\nexport const Purchase: DestinationDataManager.Rule = {\n name: 'purchase',\n data: {\n map: {\n // Required fields\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n\n // User identification\n userId: 'user.id',\n email: 'user.id', // Will be hashed automatically\n\n // Attribution identifiers (captured by browser source from URL)\n gclid: 'context.gclid', // Google Click ID\n gbraid: 'context.gbraid', // iOS attribution\n wbraid: 'context.wbraid', // Web-to-app\n\n // Shopping cart data\n cartData: {\n map: {\n items: {\n loop: [\n 'nested',\n {\n condition: (entity) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n merchantProductId: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n};\n\n/**\n * Lead event mapping\n */\nexport const Lead: DestinationDataManager.Rule = {\n name: 'generate_lead',\n data: {\n map: {\n eventName: { value: 'generate_lead' },\n conversionValue: { value: 10 },\n currency: { value: 'USD' },\n },\n },\n};\n\n/**\n * Page view mapping for GA4\n */\nexport const PageView: DestinationDataManager.Rule = {\n name: 'page_view',\n data: {\n map: {\n eventName: { value: 'page_view' },\n },\n },\n};\n\n/**\n * Complete mapping configuration\n */\nexport const mapping = {\n order: {\n complete: Purchase,\n },\n lead: {\n submit: Lead,\n },\n page: {\n view: PageView,\n },\n} satisfies DestinationDataManager.Rules;\n\n/**\n * User data mapping configuration\n * Maps walkerOS user properties to Data Manager user identifiers\n */\nexport const userDataMapping: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n data: {\n map: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n regionCode: 'data.country',\n postalCode: 'data.zip',\n },\n },\n mapping,\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,SAAS;AAEX,IAAM,oBAAoB,EAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,oBAAoB,EAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,sBAAsB,EAAE,KAAK;AAAA,EACxC;AAAA,EACA;AACF,CAAC;AAEM,IAAM,gBAAgB,EAAE,OAAO;AAAA,EACpC,YAAY,oBAAoB;AAAA,IAC9B;AAAA,EACF,EAAE,SAAS;AAAA,EACX,mBAAmB,oBAAoB;AAAA,IACrC;AAAA,EACF,EAAE,SAAS;AACb,CAAC;AAEM,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,WAAW,EACR,OAAO,EACP,IAAI,CAAC,EACL,SAAS,kDAA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A,EACF;AAAA,EACA,MAAM;AAAA,IACJ,KAAK;AAAA,MACH,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA;AACF;","names":["z","z","z"]}
1
+ {"version":3,"sources":["../src/schemas.ts","../src/schemas/primitives.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/index.ts","../src/examples/index.ts","../src/examples/auth.ts","../src/examples/basic.ts","../src/examples/mapping.ts"],"sourcesContent":["// Browser-safe schema-only exports\n// This file exports ONLY schemas without any Node.js dependencies\nexport { settings, mapping } from './schemas/index';\n","import { z } from '@walkeros/core/dev';\n\nexport const AccountTypeSchema = z.enum([\n 'GOOGLE_ADS',\n 'DISPLAY_VIDEO_ADVERTISER',\n 'DISPLAY_VIDEO_PARTNER',\n 'GOOGLE_ANALYTICS_PROPERTY',\n]);\n\nexport const EventSourceSchema = z.enum([\n 'WEB',\n 'APP',\n 'IN_STORE',\n 'PHONE',\n 'OTHER',\n]);\n\nexport const ConsentStatusSchema = z.enum([\n 'CONSENT_GRANTED',\n 'CONSENT_DENIED',\n]);\n\nexport const ConsentSchema = z.object({\n adUserData: ConsentStatusSchema.describe(\n 'Consent for data collection and use',\n ).optional(),\n adPersonalization: ConsentStatusSchema.describe(\n 'Consent for ad personalization',\n ).optional(),\n});\n\nexport const OperatingAccountSchema = z.object({\n accountId: z\n .string()\n .min(1)\n .describe('Account ID (e.g., \"123-456-7890\" for Google Ads)'),\n accountType: AccountTypeSchema.describe('Type of account'),\n});\n\nexport const DestinationSchema = z.object({\n operatingAccount: OperatingAccountSchema.describe(\n 'Operating account details',\n ),\n productDestinationId: z\n .string()\n .min(1)\n .describe(\n 'Product-specific destination ID (conversion action or user list)',\n ),\n});\n","import { z } from '@walkeros/core/dev';\nimport {\n DestinationSchema,\n EventSourceSchema,\n ConsentSchema,\n} from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'OAuth 2.0 access token with datamanager scope (like ya29.c.xxx)',\n ),\n destinations: z\n .array(DestinationSchema)\n .min(1)\n .max(10)\n .describe(\n 'Array of destination accounts and conversion actions/user lists (max 10)',\n ),\n eventSource: EventSourceSchema.optional()\n .default('WEB')\n .describe(\n 'Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER',\n ),\n batchSize: z\n .number()\n .int()\n .min(1)\n .max(2000)\n .describe(\n 'Maximum number of events to batch before sending (max 2000, like 100)',\n )\n .optional(),\n batchInterval: z\n .number()\n .int()\n .min(0)\n .describe(\n 'Time in milliseconds to wait before auto-flushing batch (like 5000)',\n )\n .optional(),\n validateOnly: z\n .boolean()\n .describe('If true, validate request without ingestion (testing mode)')\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Override API endpoint for testing (like https://datamanager.googleapis.com/v1)',\n )\n .optional(),\n consent: ConsentSchema.describe(\n 'Request-level consent for all events',\n ).optional(),\n testEventCode: z\n .string()\n .describe('Test event code for debugging (like TEST12345)')\n .optional(),\n logLevel: z\n .enum(['debug', 'info', 'warn', 'error', 'none'])\n .describe('Log level for debugging (debug shows all API calls)')\n .optional(),\n userData: z\n .record(z.string(), z.unknown())\n .describe(\n \"Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })\",\n )\n .optional(),\n userId: z\n .any()\n .describe(\n \"Guided helper: First-party user ID for all events (like 'user.id')\",\n )\n .optional(),\n clientId: z\n .any()\n .describe(\n \"Guided helper: GA4 client ID for all events (like 'user.device')\",\n )\n .optional(),\n sessionAttributes: z\n .any()\n .describe(\n \"Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')\",\n )\n .optional(),\n consentAdUserData: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'marketing') or static boolean value\",\n )\n .optional(),\n consentAdPersonalization: z\n .union([z.string(), z.boolean()])\n .describe(\n \"Consent mapping: Field name from event.consent (like 'targeting') or static boolean value\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n// Data Manager uses flexible mapping via walkerOS mapping system\n// No event-specific mapping schema needed (similar to Meta CAPI pattern)\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * from './primitives';\nexport * from './settings';\nexport * from './mapping';\n\nimport { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","export * as auth from './auth';\nexport * as basic from './basic';\nexport * as mapping from './mapping';\n","import type { DestinationDataManager } from '..';\n\n/**\n * AWS Lambda / Serverless Configuration\n * Uses inline credentials from environment variables\n * Best for: AWS Lambda, Docker, Kubernetes, any serverless environment\n */\nexport const awsLambda: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL || '',\n private_key: (process.env.GOOGLE_PRIVATE_KEY || '').replace(/\\\\n/g, '\\n'),\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * GCP Cloud Functions / Cloud Run Configuration\n * Uses Application Default Credentials (ADC) - no explicit auth config needed\n * Best for: Google Cloud Functions, Cloud Run, GCE, GKE\n */\nexport const gcpCloudFunctions: DestinationDataManager.Config = {\n settings: {\n // No auth config needed - ADC works automatically on GCP!\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Local Development Configuration\n * Uses service account JSON file\n * Best for: Local development, testing\n */\nexport const localDevelopment: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Docker / Kubernetes Configuration\n * Uses ADC via GOOGLE_APPLICATION_CREDENTIALS environment variable\n * Best for: Docker containers, Kubernetes pods\n *\n * Setup:\n * 1. Mount service account JSON as secret/configmap\n * 2. Set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json\n * 3. ADC will automatically use it\n */\nexport const dockerKubernetes: DestinationDataManager.Config = {\n settings: {\n // No explicit config - ADC uses GOOGLE_APPLICATION_CREDENTIALS env var\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Custom Scopes Configuration\n * For specific use cases requiring different OAuth scopes\n */\nexport const customScopes: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: process.env.GOOGLE_CLIENT_EMAIL || '',\n private_key: (process.env.GOOGLE_PRIVATE_KEY || '').replace(/\\\\n/g, '\\n'),\n },\n scopes: ['https://www.googleapis.com/auth/datamanager'],\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n","import type { DestinationDataManager } from '..';\n\n/**\n * Minimal configuration for Google Data Manager with inline credentials\n */\nexport const minimal: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n\n/**\n * Complete configuration with all options\n */\nexport const complete: DestinationDataManager.Config = {\n settings: {\n credentials: {\n client_email: 'service-account@project.iam.gserviceaccount.com',\n private_key:\n '-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n',\n },\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n {\n operatingAccount: {\n accountId: '987654321',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n batchSize: 100,\n batchInterval: 5000,\n validateOnly: false,\n consent: {\n adUserData: 'CONSENT_GRANTED',\n adPersonalization: 'CONSENT_GRANTED',\n },\n\n // Guided helpers (apply to all events)\n userData: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n },\n userId: 'user.id',\n clientId: 'user.device',\n sessionAttributes: 'context.sessionAttributes',\n },\n};\n\n/**\n * GA4-specific configuration using Application Default Credentials\n */\nexport const ga4: DestinationDataManager.Config = {\n settings: {\n destinations: [\n {\n operatingAccount: {\n accountId: '123456789',\n accountType: 'GOOGLE_ANALYTICS_PROPERTY',\n },\n productDestinationId: 'G-XXXXXXXXXX',\n },\n ],\n },\n};\n\n/**\n * Debug configuration with logging enabled using keyFilename\n */\nexport const debug: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n};\n","import type { DestinationDataManager } from '..';\nimport { isObject } from '@walkeros/core';\n\n/**\n * Purchase event mapping for Google Ads conversion\n */\nexport const Purchase: DestinationDataManager.Rule = {\n name: 'purchase',\n data: {\n map: {\n // Required fields\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n\n // User identification\n userId: 'user.id',\n email: 'user.id', // Will be hashed automatically\n\n // Attribution identifiers (captured by browser source from URL)\n gclid: 'context.gclid', // Google Click ID\n gbraid: 'context.gbraid', // iOS attribution\n wbraid: 'context.wbraid', // Web-to-app\n\n // Shopping cart data\n cartData: {\n map: {\n items: {\n loop: [\n 'nested',\n {\n condition: (entity) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n merchantProductId: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n};\n\n/**\n * Lead event mapping\n */\nexport const Lead: DestinationDataManager.Rule = {\n name: 'generate_lead',\n data: {\n map: {\n eventName: { value: 'generate_lead' },\n conversionValue: { value: 10 },\n currency: { value: 'USD' },\n },\n },\n};\n\n/**\n * Page view mapping for GA4\n */\nexport const PageView: DestinationDataManager.Rule = {\n name: 'page_view',\n data: {\n map: {\n eventName: { value: 'page_view' },\n },\n },\n};\n\n/**\n * Complete mapping configuration\n */\nexport const mapping = {\n order: {\n complete: Purchase,\n },\n lead: {\n submit: Lead,\n },\n page: {\n view: PageView,\n },\n} satisfies DestinationDataManager.Rules;\n\n/**\n * User data mapping configuration\n * Maps walkerOS user properties to Data Manager user identifiers\n */\nexport const userDataMapping: DestinationDataManager.Config = {\n settings: {\n keyFilename: './service-account.json',\n destinations: [\n {\n operatingAccount: {\n accountId: '123-456-7890',\n accountType: 'GOOGLE_ADS',\n },\n productDestinationId: 'AW-CONVERSION-123',\n },\n ],\n },\n data: {\n map: {\n email: 'user.id',\n phone: 'data.phone',\n firstName: 'data.firstName',\n lastName: 'data.lastName',\n regionCode: 'data.country',\n postalCode: 'data.zip',\n },\n },\n mapping,\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,SAAS;AAEX,IAAM,oBAAoB,EAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,oBAAoB,EAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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AAAA,IACJ,MAAM;AAAA,EACR;AACF;AAMO,IAAM,kBAAiD;AAAA,EAC5D,UAAU;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,MACZ;AAAA,QACE,kBAAkB;AAAA,UAChB,WAAW;AAAA,UACX,aAAa;AAAA,QACf;AAAA,QACA,sBAAsB;AAAA,MACxB;AAAA,IACF;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,KAAK;AAAA,MACH,OAAO;AAAA,MACP,OAAO;AAAA,MACP,WAAW;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,SAAAA;AACF;","names":["z","z","z","mapping"]}
@@ -2,8 +2,6 @@ import { Mapping as Mapping$1, Destination as Destination$1 } from '@walkeros/co
2
2
  import { DestinationServer } from '@walkeros/server-core';
3
3
  import { OAuth2Client } from 'google-auth-library';
4
4
 
5
- type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
6
-
7
5
  interface Settings {
8
6
  /**
9
7
  * Service account credentials (client_email + private_key)
@@ -25,7 +23,7 @@ interface Settings {
25
23
  scopes?: string[];
26
24
  /** Array of destination accounts and conversion actions/user lists */
27
25
  destinations: Destination[];
28
- /** Default event source if not specified per event */
26
+ /** Event source for all events. Defaults to WEB if not specified */
29
27
  eventSource?: EventSource;
30
28
  /** Maximum number of events to batch before sending (max 2000) */
31
29
  batchSize?: number;
@@ -39,8 +37,6 @@ interface Settings {
39
37
  consent?: Consent;
40
38
  /** Test event code for debugging (optional) */
41
39
  testEventCode?: string;
42
- /** Log level for debugging (optional) */
43
- logLevel?: LogLevel;
44
40
  /** Guided helpers: User data mapping (applies to all events) */
45
41
  userData?: Mapping$1.Map;
46
42
  /** Guided helper: First-party user ID */
@@ -2,8 +2,6 @@ import { Mapping as Mapping$1, Destination as Destination$1 } from '@walkeros/co
2
2
  import { DestinationServer } from '@walkeros/server-core';
3
3
  import { OAuth2Client } from 'google-auth-library';
4
4
 
5
- type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
6
-
7
5
  interface Settings {
8
6
  /**
9
7
  * Service account credentials (client_email + private_key)
@@ -25,7 +23,7 @@ interface Settings {
25
23
  scopes?: string[];
26
24
  /** Array of destination accounts and conversion actions/user lists */
27
25
  destinations: Destination[];
28
- /** Default event source if not specified per event */
26
+ /** Event source for all events. Defaults to WEB if not specified */
29
27
  eventSource?: EventSource;
30
28
  /** Maximum number of events to batch before sending (max 2000) */
31
29
  batchSize?: number;
@@ -39,8 +37,6 @@ interface Settings {
39
37
  consent?: Consent;
40
38
  /** Test event code for debugging (optional) */
41
39
  testEventCode?: string;
42
- /** Log level for debugging (optional) */
43
- logLevel?: LogLevel;
44
40
  /** Guided helpers: User data mapping (applies to all events) */
45
41
  userData?: Mapping$1.Map;
46
42
  /** Guided helper: First-party user ID */
@@ -38,8 +38,8 @@ __export(auth_exports, {
38
38
  var awsLambda = {
39
39
  settings: {
40
40
  credentials: {
41
- client_email: process.env.GOOGLE_CLIENT_EMAIL,
42
- private_key: process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g, "\n")
41
+ client_email: process.env.GOOGLE_CLIENT_EMAIL || "",
42
+ private_key: (process.env.GOOGLE_PRIVATE_KEY || "").replace(/\\n/g, "\n")
43
43
  },
44
44
  destinations: [
45
45
  {
@@ -97,8 +97,8 @@ var dockerKubernetes = {
97
97
  var customScopes = {
98
98
  settings: {
99
99
  credentials: {
100
- client_email: process.env.GOOGLE_CLIENT_EMAIL,
101
- private_key: process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g, "\n")
100
+ client_email: process.env.GOOGLE_CLIENT_EMAIL || "",
101
+ private_key: (process.env.GOOGLE_PRIVATE_KEY || "").replace(/\\n/g, "\n")
102
102
  },
103
103
  scopes: ["https://www.googleapis.com/auth/datamanager"],
104
104
  destinations: [
@@ -160,7 +160,6 @@ var complete = {
160
160
  productDestinationId: "G-XXXXXXXXXX"
161
161
  }
162
162
  ],
163
- eventSource: "WEB",
164
163
  batchSize: 100,
165
164
  batchInterval: 5e3,
166
165
  validateOnly: false,
@@ -178,11 +177,6 @@ var complete = {
178
177
  userId: "user.id",
179
178
  clientId: "user.device",
180
179
  sessionAttributes: "context.sessionAttributes"
181
- },
182
- data: {
183
- map: {
184
- eventSource: { value: "WEB" }
185
- }
186
180
  }
187
181
  };
188
182
  var ga4 = {
@@ -195,8 +189,7 @@ var ga4 = {
195
189
  },
196
190
  productDestinationId: "G-XXXXXXXXXX"
197
191
  }
198
- ],
199
- eventSource: "WEB"
192
+ ]
200
193
  }
201
194
  };
202
195
  var debug = {
@@ -210,9 +203,7 @@ var debug = {
210
203
  },
211
204
  productDestinationId: "AW-CONVERSION-123"
212
205
  }
213
- ],
214
- logLevel: "debug"
215
- // Shows all API calls and responses
206
+ ]
216
207
  }
217
208
  };
218
209
 
@@ -16,8 +16,8 @@ __export(auth_exports, {
16
16
  var awsLambda = {
17
17
  settings: {
18
18
  credentials: {
19
- client_email: process.env.GOOGLE_CLIENT_EMAIL,
20
- private_key: process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g, "\n")
19
+ client_email: process.env.GOOGLE_CLIENT_EMAIL || "",
20
+ private_key: (process.env.GOOGLE_PRIVATE_KEY || "").replace(/\\n/g, "\n")
21
21
  },
22
22
  destinations: [
23
23
  {
@@ -75,8 +75,8 @@ var dockerKubernetes = {
75
75
  var customScopes = {
76
76
  settings: {
77
77
  credentials: {
78
- client_email: process.env.GOOGLE_CLIENT_EMAIL,
79
- private_key: process.env.GOOGLE_PRIVATE_KEY.replace(/\\n/g, "\n")
78
+ client_email: process.env.GOOGLE_CLIENT_EMAIL || "",
79
+ private_key: (process.env.GOOGLE_PRIVATE_KEY || "").replace(/\\n/g, "\n")
80
80
  },
81
81
  scopes: ["https://www.googleapis.com/auth/datamanager"],
82
82
  destinations: [
@@ -138,7 +138,6 @@ var complete = {
138
138
  productDestinationId: "G-XXXXXXXXXX"
139
139
  }
140
140
  ],
141
- eventSource: "WEB",
142
141
  batchSize: 100,
143
142
  batchInterval: 5e3,
144
143
  validateOnly: false,
@@ -156,11 +155,6 @@ var complete = {
156
155
  userId: "user.id",
157
156
  clientId: "user.device",
158
157
  sessionAttributes: "context.sessionAttributes"
159
- },
160
- data: {
161
- map: {
162
- eventSource: { value: "WEB" }
163
- }
164
158
  }
165
159
  };
166
160
  var ga4 = {
@@ -173,8 +167,7 @@ var ga4 = {
173
167
  },
174
168
  productDestinationId: "G-XXXXXXXXXX"
175
169
  }
176
- ],
177
- eventSource: "WEB"
170
+ ]
178
171
  }
179
172
  };
180
173
  var debug = {
@@ -188,9 +181,7 @@ var debug = {
188
181
  },
189
182
  productDestinationId: "AW-CONVERSION-123"
190
183
  }
191
- ],
192
- logLevel: "debug"
193
- // Shows all API calls and responses
184
+ ]
194
185
  }
195
186
  };
196
187
 
package/dist/index.d.mts CHANGED
@@ -2,8 +2,6 @@ import { Destination as Destination$1, Mapping as Mapping$1 } from '@walkeros/co
2
2
  import { DestinationServer } from '@walkeros/server-core';
3
3
  import { OAuth2Client } from 'google-auth-library';
4
4
 
5
- type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
6
-
7
5
  interface Settings {
8
6
  /**
9
7
  * Service account credentials (client_email + private_key)
@@ -25,7 +23,7 @@ interface Settings {
25
23
  scopes?: string[];
26
24
  /** Array of destination accounts and conversion actions/user lists */
27
25
  destinations: Destination[];
28
- /** Default event source if not specified per event */
26
+ /** Event source for all events. Defaults to WEB if not specified */
29
27
  eventSource?: EventSource;
30
28
  /** Maximum number of events to batch before sending (max 2000) */
31
29
  batchSize?: number;
@@ -39,8 +37,6 @@ interface Settings {
39
37
  consent?: Consent;
40
38
  /** Test event code for debugging (optional) */
41
39
  testEventCode?: string;
42
- /** Log level for debugging (optional) */
43
- logLevel?: LogLevel;
44
40
  /** Guided helpers: User data mapping (applies to all events) */
45
41
  userData?: Mapping$1.Map;
46
42
  /** Guided helper: First-party user ID */
@@ -72,6 +68,16 @@ interface DestinationInterface extends DestinationServer.Destination<Types> {
72
68
  type Config = {
73
69
  settings: Settings;
74
70
  } & DestinationServer.Config<Types>;
71
+ /**
72
+ * Config after validation - settings is guaranteed to exist with required fields
73
+ * Use this type after calling getConfig() to get proper type narrowing
74
+ * After validation, eventSource is always set (defaults to 'WEB')
75
+ */
76
+ type ValidatedConfig = Omit<Config, 'settings'> & {
77
+ settings: Settings & {
78
+ eventSource: EventSource;
79
+ };
80
+ };
75
81
  type InitFn = DestinationServer.InitFn<Types>;
76
82
  type PushFn = DestinationServer.PushFn<Types>;
77
83
  type PartialConfig = DestinationServer.PartialConfig<Types>;
@@ -371,9 +377,10 @@ type index_Types = Types;
371
377
  type index_UserData = UserData;
372
378
  type index_UserIdentifier = UserIdentifier;
373
379
  type index_UserProperties = UserProperties;
380
+ type index_ValidatedConfig = ValidatedConfig;
374
381
  type index_ValidationError = ValidationError;
375
382
  declare namespace index {
376
- export type { index_AccountType as AccountType, index_AdIdentifiers as AdIdentifiers, index_Address as Address, index_CartData as CartData, index_CartItem as CartItem, index_Config as Config, index_Consent as Consent, index_ConsentStatus as ConsentStatus, index_CustomVariable as CustomVariable, index_Destination as Destination, index_DestinationInterface as DestinationInterface, index_DeviceInfo as DeviceInfo, index_Env as Env, index_Event as Event, index_EventParameter as EventParameter, index_EventSource as EventSource, index_ExperimentalField as ExperimentalField, index_IngestEventsRequest as IngestEventsRequest, index_IngestEventsResponse as IngestEventsResponse, index_InitFn as InitFn, index_InitSettings as InitSettings, index_Mapping as Mapping, index_PartialConfig as PartialConfig, index_ProductAccount as ProductAccount, index_PushEvents as PushEvents, index_PushFn as PushFn, index_RequestError as RequestError, index_RequestState as RequestState, index_RequestStatusResponse as RequestStatusResponse, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types, index_UserData as UserData, index_UserIdentifier as UserIdentifier, index_UserProperties as UserProperties, index_ValidationError as ValidationError };
383
+ export type { index_AccountType as AccountType, index_AdIdentifiers as AdIdentifiers, index_Address as Address, index_CartData as CartData, index_CartItem as CartItem, index_Config as Config, index_Consent as Consent, index_ConsentStatus as ConsentStatus, index_CustomVariable as CustomVariable, index_Destination as Destination, index_DestinationInterface as DestinationInterface, index_DeviceInfo as DeviceInfo, index_Env as Env, index_Event as Event, index_EventParameter as EventParameter, index_EventSource as EventSource, index_ExperimentalField as ExperimentalField, index_IngestEventsRequest as IngestEventsRequest, index_IngestEventsResponse as IngestEventsResponse, index_InitFn as InitFn, index_InitSettings as InitSettings, index_Mapping as Mapping, index_PartialConfig as PartialConfig, index_ProductAccount as ProductAccount, index_PushEvents as PushEvents, index_PushFn as PushFn, index_RequestError as RequestError, index_RequestState as RequestState, index_RequestStatusResponse as RequestStatusResponse, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types, index_UserData as UserData, index_UserIdentifier as UserIdentifier, index_UserProperties as UserProperties, index_ValidatedConfig as ValidatedConfig, index_ValidationError as ValidationError };
377
384
  }
378
385
 
379
386
  declare const destinationDataManager: DestinationInterface;