@walkeros/server-destination-datamanager 2.2.0-next-1773136823705 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.d.mts CHANGED
@@ -12,11 +12,13 @@ declare namespace schemas {
12
12
 
13
13
  declare const purchase: Flow.StepExample;
14
14
  declare const lead: Flow.StepExample;
15
+ declare const ga4PageView: Flow.StepExample;
15
16
 
17
+ declare const step_ga4PageView: typeof ga4PageView;
16
18
  declare const step_lead: typeof lead;
17
19
  declare const step_purchase: typeof purchase;
18
20
  declare namespace step {
19
- export { step_lead as lead, step_purchase as purchase };
21
+ export { step_ga4PageView as ga4PageView, step_lead as lead, step_purchase as purchase };
20
22
  }
21
23
 
22
24
  declare const index_step: typeof step;
package/dist/dev.d.ts CHANGED
@@ -12,11 +12,13 @@ declare namespace schemas {
12
12
 
13
13
  declare const purchase: Flow.StepExample;
14
14
  declare const lead: Flow.StepExample;
15
+ declare const ga4PageView: Flow.StepExample;
15
16
 
17
+ declare const step_ga4PageView: typeof ga4PageView;
16
18
  declare const step_lead: typeof lead;
17
19
  declare const step_purchase: typeof purchase;
18
20
  declare namespace step {
19
- export { step_lead as lead, step_purchase as purchase };
21
+ export { step_ga4PageView as ga4PageView, step_lead as lead, step_purchase as purchase };
20
22
  }
21
23
 
22
24
  declare const index_step: typeof step;
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var r in a)t(e,r,{get:a[r],enumerable:!0})},i={};o(i,{examples:()=>I,schemas:()=>s}),module.exports=(e=i,((e,o,i,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of r(o))n.call(e,c)||c===i||t(e,c,{get:()=>o[c],enumerable:!(s=a(o,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{mapping:()=>O,settings:()=>E});var c=require("@walkeros/core/dev"),l=c.z.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),d=c.z.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),u=c.z.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),p=c.z.object({adUserData:u.describe("Consent for data collection and use").optional(),adPersonalization:u.describe("Consent for ad personalization").optional()}),m=c.z.object({accountId:c.z.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:l.describe("Type of account")}),v=c.z.object({operatingAccount:m.describe("Operating account details"),productDestinationId:c.z.string().min(1).describe("Product-specific destination ID (conversion action or user list)")}),b=require("@walkeros/core/dev"),g=b.z.object({client_email:b.z.string().email().describe("Service account email"),private_key:b.z.string().min(1).describe("Service account private key (PEM format)")}),f=b.z.object({credentials:g.optional().describe("Service account credentials (client_email + private_key). Recommended for serverless environments."),keyFilename:b.z.string().optional().describe("Path to service account JSON file. For local development or environments with filesystem access."),scopes:b.z.array(b.z.string()).optional().describe("OAuth scopes for Data Manager API. Defaults to datamanager scope."),destinations:b.z.array(v).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:d.optional().default("WEB").describe("Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER"),batchSize:b.z.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:b.z.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:b.z.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:b.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:b.z.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:b.z.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:b.z.record(b.z.string(),b.z.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:b.z.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:b.z.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:b.z.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:b.z.union([b.z.string(),b.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:b.z.union([b.z.string(),b.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'targeting') or static boolean value").optional()}),z=require("@walkeros/core/dev").z.object({}),y=require("@walkeros/core/dev"),E=(0,y.zodToSchema)(f),O=(0,y.zodToSchema)(z),I={};o(I,{step:()=>h});var h={};o(h,{lead:()=>A,purchase:()=>P});var D=require("@walkeros/core"),P={in:(0,D.getEvent)("order complete",{timestamp:1700001200,data:{id:"ORD-600",total:149.99,currency:"EUR"},user:{id:"user-abc",email:"buyer@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{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"}}},out:{events:[{transactionId:"ORD-600",eventName:"purchase",eventSource:"WEB",conversionValue:149.99,currency:"EUR",userId:"user-abc",email:"buyer@example.com"}]}},A={in:(0,D.getEvent)("form submit",{timestamp:1700001201,data:{type:"demo-request"},user:{email:"prospect@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},out:{events:[{transactionId:"1700001201-gr0up-1",eventName:"generate_lead",eventSource:"WEB",email:"prospect@example.com"}]}};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(e,a)=>{for(var r in a)t(e,r,{get:a[r],enumerable:!0})},o={};i(o,{examples:()=>O,schemas:()=>s}),module.exports=(e=o,((e,i,o,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of r(i))n.call(e,c)||c===o||t(e,c,{get:()=>i[c],enumerable:!(s=a(i,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};i(s,{mapping:()=>I,settings:()=>E});var c=require("@walkeros/core/dev"),l=c.z.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),d=c.z.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),u=c.z.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),p=c.z.object({adUserData:u.describe("Consent for data collection and use").optional(),adPersonalization:u.describe("Consent for ad personalization").optional()}),m=c.z.object({accountId:c.z.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:l.describe("Type of account")}),v=c.z.object({operatingAccount:m.describe("Operating account details"),productDestinationId:c.z.string().min(1).describe("Product-specific destination ID (conversion action or user list)")}),b=require("@walkeros/core/dev"),g=b.z.object({client_email:b.z.string().email().describe("Service account email"),private_key:b.z.string().min(1).describe("Service account private key (PEM format)")}),f=b.z.object({credentials:g.optional().describe("Service account credentials (client_email + private_key). Recommended for serverless environments."),keyFilename:b.z.string().optional().describe("Path to service account JSON file. For local development or environments with filesystem access."),scopes:b.z.array(b.z.string()).optional().describe("OAuth scopes for Data Manager API. Defaults to datamanager scope."),destinations:b.z.array(v).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:d.optional().default("WEB").describe("Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER"),batchSize:b.z.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:b.z.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:b.z.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:b.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:b.z.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:b.z.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:b.z.record(b.z.string(),b.z.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:b.z.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:b.z.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:b.z.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:b.z.union([b.z.string(),b.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:b.z.union([b.z.string(),b.z.boolean()]).describe("Consent mapping: Field name from event.consent (like 'targeting') or static boolean value").optional()}),z=require("@walkeros/core/dev").z.object({}),y=require("@walkeros/core/dev"),E=(0,y.zodToSchema)(f),I=(0,y.zodToSchema)(z),O={};i(O,{step:()=>h});var h={};i(h,{ga4PageView:()=>A,lead:()=>D,purchase:()=>_});var P=require("@walkeros/core"),_={in:(0,P.getEvent)("order complete",{timestamp:1700001200,data:{id:"ORD-600",total:149.99,currency:"EUR"},user:{id:"user-abc",email:"buyer@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{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"}}},out:{events:[{transactionId:"ORD-600",eventName:"purchase",eventSource:"WEB",conversionValue:149.99,currency:"EUR",userId:"user-abc",email:"buyer@example.com"}]}},D={in:(0,P.getEvent)("form submit",{timestamp:1700001201,data:{type:"demo-request"},user:{email:"prospect@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},out:{events:[{transactionId:"1700001201-gr0up-1",eventName:"generate_lead",eventSource:"WEB",email:"prospect@example.com"}]}},A={in:(0,P.getEvent)("page view",{timestamp:1700001202,data:{title:"Pricing",url:"https://example.com/pricing"},user:{id:"visitor-55"},source:{type:"server",id:"",previous_id:""}}),mapping:{name:"page_view",data:{map:{eventName:{value:"page_view"},userId:"user.id"}}},out:{events:[{transactionId:"1700001202-gr0up-1",eventName:"page_view",eventSource:"WEB",userId:"visitor-55"}]}};//# 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/step.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\n/**\n * Service account credentials schema\n */\nconst CredentialsSchema = z.object({\n client_email: z.string().email().describe('Service account email'),\n private_key: z\n .string()\n .min(1)\n .describe('Service account private key (PEM format)'),\n});\n\nexport const SettingsSchema = z.object({\n credentials: CredentialsSchema.optional().describe(\n 'Service account credentials (client_email + private_key). Recommended for serverless environments.',\n ),\n keyFilename: z\n .string()\n .optional()\n .describe(\n 'Path to service account JSON file. For local development or environments with filesystem access.',\n ),\n scopes: z\n .array(z.string())\n .optional()\n .describe(\n 'OAuth scopes for Data Manager API. Defaults to datamanager scope.',\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 step from './step';\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700001200,\n data: { id: 'ORD-600', total: 149.99, currency: 'EUR' },\n user: { id: 'user-abc', email: 'buyer@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n userId: 'user.id',\n email: 'user.id',\n },\n },\n },\n out: {\n events: [\n {\n transactionId: 'ORD-600',\n eventName: 'purchase',\n eventSource: 'WEB',\n conversionValue: 149.99,\n currency: 'EUR',\n userId: 'user-abc',\n email: 'buyer@example.com',\n },\n ],\n },\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700001201,\n data: { type: 'demo-request' },\n user: { email: 'prospect@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\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 out: {\n events: [\n {\n transactionId: '1700001201-gr0up-1',\n eventName: 'generate_lead',\n eventSource: 'WEB',\n email: 'prospect@example.com',\n },\n ],\n },\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,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,IAAM,oBAAoB,aAAE,OAAO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QACH,eAAe;AAAA,QACf,iBAAiB;AAAA,QACjB,UAAU,EAAE,KAAK,iBAAiB,OAAO,MAAM;AAAA,QAC/C,WAAW,EAAE,OAAO,WAAW;AAAA,QAC/B,QAAQ;AAAA,QACR,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,QAAQ;AAAA,MACN;AAAA,QACE,eAAe;AAAA,QACf,WAAW;AAAA,QACX,aAAa;AAAA,QACb,iBAAiB;AAAA,QACjB,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,OAAyB;AAAA,EACpC,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,MAAM,eAAe;AAAA,IAC7B,MAAM,EAAE,OAAO,uBAAuB;AAAA,IACtC,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,WAAW,EAAE,OAAO,gBAAgB;AAAA,QACpC,iBAAiB,EAAE,OAAO,GAAG;AAAA,QAC7B,UAAU,EAAE,OAAO,MAAM;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,QAAQ;AAAA,MACN;AAAA,QACE,eAAe;AAAA,QACf,WAAW;AAAA,QACX,aAAa;AAAA,QACb,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;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/step.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\n/**\n * Service account credentials schema\n */\nconst CredentialsSchema = z.object({\n client_email: z.string().email().describe('Service account email'),\n private_key: z\n .string()\n .min(1)\n .describe('Service account private key (PEM format)'),\n});\n\nexport const SettingsSchema = z.object({\n credentials: CredentialsSchema.optional().describe(\n 'Service account credentials (client_email + private_key). Recommended for serverless environments.',\n ),\n keyFilename: z\n .string()\n .optional()\n .describe(\n 'Path to service account JSON file. For local development or environments with filesystem access.',\n ),\n scopes: z\n .array(z.string())\n .optional()\n .describe(\n 'OAuth scopes for Data Manager API. Defaults to datamanager scope.',\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 step from './step';\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700001200,\n data: { id: 'ORD-600', total: 149.99, currency: 'EUR' },\n user: { id: 'user-abc', email: 'buyer@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n userId: 'user.id',\n email: 'user.id',\n },\n },\n },\n out: {\n events: [\n {\n transactionId: 'ORD-600',\n eventName: 'purchase',\n eventSource: 'WEB',\n conversionValue: 149.99,\n currency: 'EUR',\n userId: 'user-abc',\n email: 'buyer@example.com',\n },\n ],\n },\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700001201,\n data: { type: 'demo-request' },\n user: { email: 'prospect@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\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 out: {\n events: [\n {\n transactionId: '1700001201-gr0up-1',\n eventName: 'generate_lead',\n eventSource: 'WEB',\n email: 'prospect@example.com',\n },\n ],\n },\n};\n\nexport const ga4PageView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700001202,\n data: { title: 'Pricing', url: 'https://example.com/pricing' },\n user: { id: 'visitor-55' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n name: 'page_view',\n data: {\n map: {\n eventName: { value: 'page_view' },\n userId: 'user.id',\n },\n },\n },\n out: {\n events: [\n {\n transactionId: '1700001202-gr0up-1',\n eventName: 'page_view',\n eventSource: 'WEB',\n userId: 'visitor-55',\n },\n ],\n },\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,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,IAAM,oBAAoB,aAAE,OAAO;AAAA,EACxC,kBAAkB,uBAAuB;AAAA,IACvC;AAAA,EACF;AAAA,EACA,sBAAsB,aACnB,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AACJ,CAAC;;;ACjDD,IAAAA,cAAkB;AAUlB,IAAM,oBAAoB,cAAE,OAAO;AAAA,EACjC,cAAc,cAAE,OAAO,EAAE,MAAM,EAAE,SAAS,uBAAuB;AAAA,EACjE,aAAa,cACV,OAAO,EACP,IAAI,CAAC,EAC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dev","import_dev","import_dev"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,a=(a,t)=>{for(var o in t)e(a,o,{get:t[o],enumerable:!0})},t={};a(t,{mapping:()=>f,settings:()=>g});import{z as o}from"@walkeros/core/dev";var n=o.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),r=o.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),i=o.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),s=o.object({adUserData:i.describe("Consent for data collection and use").optional(),adPersonalization:i.describe("Consent for ad personalization").optional()}),c=o.object({accountId:o.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:n.describe("Type of account")}),l=o.object({operatingAccount:c.describe("Operating account details"),productDestinationId:o.string().min(1).describe("Product-specific destination ID (conversion action or user list)")});import{z as d}from"@walkeros/core/dev";var u=d.object({client_email:d.string().email().describe("Service account email"),private_key:d.string().min(1).describe("Service account private key (PEM format)")}),m=d.object({credentials:u.optional().describe("Service account credentials (client_email + private_key). Recommended for serverless environments."),keyFilename:d.string().optional().describe("Path to service account JSON file. For local development or environments with filesystem access."),scopes:d.array(d.string()).optional().describe("OAuth scopes for Data Manager API. Defaults to datamanager scope."),destinations:d.array(l).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:r.optional().default("WEB").describe("Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER"),batchSize:d.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:d.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:d.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:d.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:d.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:d.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:d.record(d.string(),d.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:d.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:d.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:d.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:d.union([d.string(),d.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:d.union([d.string(),d.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 v=p.object({});import{zodToSchema as b}from"@walkeros/core/dev";var g=b(m),f=b(v),E={};a(E,{step:()=>y});var y={};a(y,{lead:()=>A,purchase:()=>D});import{getEvent as I}from"@walkeros/core";var D={in:I("order complete",{timestamp:1700001200,data:{id:"ORD-600",total:149.99,currency:"EUR"},user:{id:"user-abc",email:"buyer@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{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"}}},out:{events:[{transactionId:"ORD-600",eventName:"purchase",eventSource:"WEB",conversionValue:149.99,currency:"EUR",userId:"user-abc",email:"buyer@example.com"}]}},A={in:I("form submit",{timestamp:1700001201,data:{type:"demo-request"},user:{email:"prospect@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},out:{events:[{transactionId:"1700001201-gr0up-1",eventName:"generate_lead",eventSource:"WEB",email:"prospect@example.com"}]}};export{E as examples,t as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,a=(a,t)=>{for(var i in t)e(a,i,{get:t[i],enumerable:!0})},t={};a(t,{mapping:()=>f,settings:()=>g});import{z as i}from"@walkeros/core/dev";var r=i.enum(["GOOGLE_ADS","DISPLAY_VIDEO_ADVERTISER","DISPLAY_VIDEO_PARTNER","GOOGLE_ANALYTICS_PROPERTY"]),n=i.enum(["WEB","APP","IN_STORE","PHONE","OTHER"]),o=i.enum(["CONSENT_GRANTED","CONSENT_DENIED"]),s=i.object({adUserData:o.describe("Consent for data collection and use").optional(),adPersonalization:o.describe("Consent for ad personalization").optional()}),c=i.object({accountId:i.string().min(1).describe('Account ID (e.g., "123-456-7890" for Google Ads)'),accountType:r.describe("Type of account")}),l=i.object({operatingAccount:c.describe("Operating account details"),productDestinationId:i.string().min(1).describe("Product-specific destination ID (conversion action or user list)")});import{z as d}from"@walkeros/core/dev";var u=d.object({client_email:d.string().email().describe("Service account email"),private_key:d.string().min(1).describe("Service account private key (PEM format)")}),p=d.object({credentials:u.optional().describe("Service account credentials (client_email + private_key). Recommended for serverless environments."),keyFilename:d.string().optional().describe("Path to service account JSON file. For local development or environments with filesystem access."),scopes:d.array(d.string()).optional().describe("OAuth scopes for Data Manager API. Defaults to datamanager scope."),destinations:d.array(l).min(1).max(10).describe("Array of destination accounts and conversion actions/user lists (max 10)"),eventSource:n.optional().default("WEB").describe("Event source for all events. Defaults to WEB. Values: WEB, APP, IN_STORE, PHONE, OTHER"),batchSize:d.number().int().min(1).max(2e3).describe("Maximum number of events to batch before sending (max 2000, like 100)").optional(),batchInterval:d.number().int().min(0).describe("Time in milliseconds to wait before auto-flushing batch (like 5000)").optional(),validateOnly:d.boolean().describe("If true, validate request without ingestion (testing mode)").optional(),url:d.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:d.string().describe("Test event code for debugging (like TEST12345)").optional(),logLevel:d.enum(["debug","info","warn","error","none"]).describe("Log level for debugging (debug shows all API calls)").optional(),userData:d.record(d.string(),d.unknown()).describe("Guided helper: User data mapping for all events (like { email: 'user.id', phone: 'data.phone' })").optional(),userId:d.any().describe("Guided helper: First-party user ID for all events (like 'user.id')").optional(),clientId:d.any().describe("Guided helper: GA4 client ID for all events (like 'user.device')").optional(),sessionAttributes:d.any().describe("Guided helper: Privacy-safe attribution for all events (like 'context.sessionAttributes')").optional(),consentAdUserData:d.union([d.string(),d.boolean()]).describe("Consent mapping: Field name from event.consent (like 'marketing') or static boolean value").optional(),consentAdPersonalization:d.union([d.string(),d.boolean()]).describe("Consent mapping: Field name from event.consent (like 'targeting') or static boolean value").optional()});import{z as m}from"@walkeros/core/dev";var v=m.object({});import{zodToSchema as b}from"@walkeros/core/dev";var g=b(p),f=b(v),E={};a(E,{step:()=>I});var I={};a(I,{ga4PageView:()=>h,lead:()=>_,purchase:()=>D});import{getEvent as y}from"@walkeros/core";var D={in:y("order complete",{timestamp:1700001200,data:{id:"ORD-600",total:149.99,currency:"EUR"},user:{id:"user-abc",email:"buyer@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{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"}}},out:{events:[{transactionId:"ORD-600",eventName:"purchase",eventSource:"WEB",conversionValue:149.99,currency:"EUR",userId:"user-abc",email:"buyer@example.com"}]}},_={in:y("form submit",{timestamp:1700001201,data:{type:"demo-request"},user:{email:"prospect@example.com"},source:{type:"server",id:"",previous_id:""}}),mapping:{name:"generate_lead",data:{map:{eventName:{value:"generate_lead"},conversionValue:{value:10},currency:{value:"USD"}}}},out:{events:[{transactionId:"1700001201-gr0up-1",eventName:"generate_lead",eventSource:"WEB",email:"prospect@example.com"}]}},h={in:y("page view",{timestamp:1700001202,data:{title:"Pricing",url:"https://example.com/pricing"},user:{id:"visitor-55"},source:{type:"server",id:"",previous_id:""}}),mapping:{name:"page_view",data:{map:{eventName:{value:"page_view"},userId:"user.id"}}},out:{events:[{transactionId:"1700001202-gr0up-1",eventName:"page_view",eventSource:"WEB",userId:"visitor-55"}]}};export{E as examples,t 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/step.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\n/**\n * Service account credentials schema\n */\nconst CredentialsSchema = z.object({\n client_email: z.string().email().describe('Service account email'),\n private_key: z\n .string()\n .min(1)\n .describe('Service account private key (PEM format)'),\n});\n\nexport const SettingsSchema = z.object({\n credentials: CredentialsSchema.optional().describe(\n 'Service account credentials (client_email + private_key). Recommended for serverless environments.',\n ),\n keyFilename: z\n .string()\n .optional()\n .describe(\n 'Path to service account JSON file. For local development or environments with filesystem access.',\n ),\n scopes: z\n .array(z.string())\n .optional()\n .describe(\n 'OAuth scopes for Data Manager API. Defaults to datamanager scope.',\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 step from './step';\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700001200,\n data: { id: 'ORD-600', total: 149.99, currency: 'EUR' },\n user: { id: 'user-abc', email: 'buyer@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n userId: 'user.id',\n email: 'user.id',\n },\n },\n },\n out: {\n events: [\n {\n transactionId: 'ORD-600',\n eventName: 'purchase',\n eventSource: 'WEB',\n conversionValue: 149.99,\n currency: 'EUR',\n userId: 'user-abc',\n email: 'buyer@example.com',\n },\n ],\n },\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700001201,\n data: { type: 'demo-request' },\n user: { email: 'prospect@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\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 out: {\n events: [\n {\n transactionId: '1700001201-gr0up-1',\n eventName: 'generate_lead',\n eventSource: 'WEB',\n email: 'prospect@example.com',\n },\n ],\n },\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,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,kDAAkD;AAAA,EAC9D,aAAa,kBAAkB,SAAS,iBAAiB;AAC3D,CAAC;AAEM,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,kBAAkB,uBAAuB;AAAA,IACvC;AAAA,EACF;AAAA,EACA,sBAAsB,EACnB,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AACJ,CAAC;;;ACjDD,SAAS,KAAAA,UAAS;AAUlB,IAAM,oBAAoBC,GAAE,OAAO;AAAA,EACjC,cAAcA,GAAE,OAAO,EAAE,MAAM,EAAE,SAAS,uBAAuB;AAAA,EACjE,aAAaA,GACV,OAAO,EACP,IAAI,CAAC,EACL,SAAS,0CAA0C;AACxD,CAAC;AAEM,IAAM,iBAAiBA,GAAE,OAAO;AA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AA,QACR,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,OAAyB;AAAA,EACpC,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,MAAM,eAAe;AAAA,IAC7B,MAAM,EAAE,OAAO,uBAAuB;AAAA,IACtC,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,WAAW,EAAE,OAAO,gBAAgB;AAAA,QACpC,iBAAiB,EAAE,OAAO,GAAG;AAAA,QAC7B,UAAU,EAAE,OAAO,MAAM;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,QAAQ;AAAA,MACN;AAAA,QACE,eAAe;AAAA,QACf,WAAW;AAAA,QACX,aAAa;AAAA,QACb,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;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/step.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\n/**\n * Service account credentials schema\n */\nconst CredentialsSchema = z.object({\n client_email: z.string().email().describe('Service account email'),\n private_key: z\n .string()\n .min(1)\n .describe('Service account private key (PEM format)'),\n});\n\nexport const SettingsSchema = z.object({\n credentials: CredentialsSchema.optional().describe(\n 'Service account credentials (client_email + private_key). Recommended for serverless environments.',\n ),\n keyFilename: z\n .string()\n .optional()\n .describe(\n 'Path to service account JSON file. For local development or environments with filesystem access.',\n ),\n scopes: z\n .array(z.string())\n .optional()\n .describe(\n 'OAuth scopes for Data Manager API. Defaults to datamanager scope.',\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 step from './step';\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700001200,\n data: { id: 'ORD-600', total: 149.99, currency: 'EUR' },\n user: { id: 'user-abc', email: 'buyer@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n transactionId: 'data.id',\n conversionValue: 'data.total',\n currency: { key: 'data.currency', value: 'USD' },\n eventName: { value: 'purchase' },\n userId: 'user.id',\n email: 'user.id',\n },\n },\n },\n out: {\n events: [\n {\n transactionId: 'ORD-600',\n eventName: 'purchase',\n eventSource: 'WEB',\n conversionValue: 149.99,\n currency: 'EUR',\n userId: 'user-abc',\n email: 'buyer@example.com',\n },\n ],\n },\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700001201,\n data: { type: 'demo-request' },\n user: { email: 'prospect@example.com' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\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 out: {\n events: [\n {\n transactionId: '1700001201-gr0up-1',\n eventName: 'generate_lead',\n eventSource: 'WEB',\n email: 'prospect@example.com',\n },\n ],\n },\n};\n\nexport const ga4PageView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700001202,\n data: { title: 'Pricing', url: 'https://example.com/pricing' },\n user: { id: 'visitor-55' },\n source: { type: 'server', id: '', previous_id: '' },\n }),\n mapping: {\n name: 'page_view',\n data: {\n map: {\n eventName: { value: 'page_view' },\n userId: 'user.id',\n },\n },\n },\n out: {\n events: [\n {\n transactionId: '1700001202-gr0up-1',\n eventName: 'page_view',\n eventSource: 'WEB',\n userId: 'visitor-55',\n },\n ],\n },\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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O,gBAAgB;AAAA,QACpC,iBAAiB,EAAE,OAAO,GAAG;AAAA,QAC7B,UAAU,EAAE,OAAO,MAAM;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,QAAQ;AAAA,MACN;AAAA,QACE,eAAe;AAAA,QACf,WAAW;AAAA,QACX,aAAa;AAAA,QACb,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,cAAgC;AAAA,EAC3C,IAAI,SAAS,aAAa;AAAA,IACxB,WAAW;AAAA,IACX,MAAM,EAAE,OAAO,WAAW,KAAK,8BAA8B;AAAA,IAC7D,MAAM,EAAE,IAAI,aAAa;AAAA,IACzB,QAAQ,EAAE,MAAM,UAAU,IAAI,IAAI,aAAa,GAAG;AAAA,EACpD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,WAAW,EAAE,OAAO,YAAY;AAAA,QAChC,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,QAAQ;AAAA,MACN;AAAA,QACE,eAAe;AAAA,QACf,WAAW;AAAA,QACX,aAAa;AAAA,QACb,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACF;","names":["z","z","z"]}
@@ -2,11 +2,13 @@ import { Flow } from '@walkeros/core';
2
2
 
3
3
  declare const purchase: Flow.StepExample;
4
4
  declare const lead: Flow.StepExample;
5
+ declare const ga4PageView: Flow.StepExample;
5
6
 
7
+ declare const step_ga4PageView: typeof ga4PageView;
6
8
  declare const step_lead: typeof lead;
7
9
  declare const step_purchase: typeof purchase;
8
10
  declare namespace step {
9
- export { step_lead as lead, step_purchase as purchase };
11
+ export { step_ga4PageView as ga4PageView, step_lead as lead, step_purchase as purchase };
10
12
  }
11
13
 
12
14
  export { step };
@@ -2,11 +2,13 @@ import { Flow } from '@walkeros/core';
2
2
 
3
3
  declare const purchase: Flow.StepExample;
4
4
  declare const lead: Flow.StepExample;
5
+ declare const ga4PageView: Flow.StepExample;
5
6
 
7
+ declare const step_ga4PageView: typeof ga4PageView;
6
8
  declare const step_lead: typeof lead;
7
9
  declare const step_purchase: typeof purchase;
8
10
  declare namespace step {
9
- export { step_lead as lead, step_purchase as purchase };
11
+ export { step_ga4PageView as ga4PageView, step_lead as lead, step_purchase as purchase };
10
12
  }
11
13
 
12
14
  export { step };
@@ -27,6 +27,7 @@ module.exports = __toCommonJS(examples_exports);
27
27
  // src/examples/step.ts
28
28
  var step_exports = {};
29
29
  __export(step_exports, {
30
+ ga4PageView: () => ga4PageView,
30
31
  lead: () => lead,
31
32
  purchase: () => purchase
32
33
  });
@@ -93,6 +94,33 @@ var lead = {
93
94
  ]
94
95
  }
95
96
  };
97
+ var ga4PageView = {
98
+ in: (0, import_core.getEvent)("page view", {
99
+ timestamp: 1700001202,
100
+ data: { title: "Pricing", url: "https://example.com/pricing" },
101
+ user: { id: "visitor-55" },
102
+ source: { type: "server", id: "", previous_id: "" }
103
+ }),
104
+ mapping: {
105
+ name: "page_view",
106
+ data: {
107
+ map: {
108
+ eventName: { value: "page_view" },
109
+ userId: "user.id"
110
+ }
111
+ }
112
+ },
113
+ out: {
114
+ events: [
115
+ {
116
+ transactionId: "1700001202-gr0up-1",
117
+ eventName: "page_view",
118
+ eventSource: "WEB",
119
+ userId: "visitor-55"
120
+ }
121
+ ]
122
+ }
123
+ };
96
124
  // Annotate the CommonJS export names for ESM import in node:
97
125
  0 && (module.exports = {
98
126
  step
@@ -7,6 +7,7 @@ var __export = (target, all) => {
7
7
  // src/examples/step.ts
8
8
  var step_exports = {};
9
9
  __export(step_exports, {
10
+ ga4PageView: () => ga4PageView,
10
11
  lead: () => lead,
11
12
  purchase: () => purchase
12
13
  });
@@ -73,6 +74,33 @@ var lead = {
73
74
  ]
74
75
  }
75
76
  };
77
+ var ga4PageView = {
78
+ in: getEvent("page view", {
79
+ timestamp: 1700001202,
80
+ data: { title: "Pricing", url: "https://example.com/pricing" },
81
+ user: { id: "visitor-55" },
82
+ source: { type: "server", id: "", previous_id: "" }
83
+ }),
84
+ mapping: {
85
+ name: "page_view",
86
+ data: {
87
+ map: {
88
+ eventName: { value: "page_view" },
89
+ userId: "user.id"
90
+ }
91
+ }
92
+ },
93
+ out: {
94
+ events: [
95
+ {
96
+ transactionId: "1700001202-gr0up-1",
97
+ eventName: "page_view",
98
+ eventSource: "WEB",
99
+ userId: "visitor-55"
100
+ }
101
+ ]
102
+ }
103
+ };
76
104
  export {
77
105
  step_exports as step
78
106
  };
@@ -3,7 +3,9 @@
3
3
  "package": "@walkeros/server-destination-datamanager",
4
4
  "version": "2.1.1",
5
5
  "type": "destination",
6
- "platform": "server"
6
+ "platform": "server",
7
+ "docs": "https://www.walkeros.io/docs/destinations/server/datamanager",
8
+ "source": "https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/datamanager/src"
7
9
  },
8
10
  "schemas": {
9
11
  "mapping": {
@@ -216,6 +218,86 @@
216
218
  },
217
219
  "examples": {
218
220
  "step": {
221
+ "ga4PageView": {
222
+ "in": {
223
+ "name": "page view",
224
+ "data": {
225
+ "title": "Pricing",
226
+ "url": "https://example.com/pricing"
227
+ },
228
+ "context": {
229
+ "dev": [
230
+ "test",
231
+ 1
232
+ ]
233
+ },
234
+ "globals": {
235
+ "pagegroup": "docs"
236
+ },
237
+ "custom": {
238
+ "completely": "random"
239
+ },
240
+ "user": {
241
+ "id": "visitor-55"
242
+ },
243
+ "nested": [
244
+ {
245
+ "entity": "child",
246
+ "data": {
247
+ "is": "subordinated"
248
+ },
249
+ "nested": [],
250
+ "context": {
251
+ "element": [
252
+ "child",
253
+ 0
254
+ ]
255
+ }
256
+ }
257
+ ],
258
+ "consent": {
259
+ "functional": true
260
+ },
261
+ "id": "1700001202-gr0up-1",
262
+ "trigger": "load",
263
+ "entity": "page",
264
+ "action": "view",
265
+ "timestamp": 1700001202,
266
+ "timing": 3.14,
267
+ "group": "gr0up",
268
+ "count": 1,
269
+ "version": {
270
+ "source": "2.1.1",
271
+ "tagging": 1
272
+ },
273
+ "source": {
274
+ "type": "server",
275
+ "id": "",
276
+ "previous_id": ""
277
+ }
278
+ },
279
+ "mapping": {
280
+ "name": "page_view",
281
+ "data": {
282
+ "map": {
283
+ "eventName": {
284
+ "value": "page_view"
285
+ },
286
+ "userId": "user.id"
287
+ }
288
+ }
289
+ },
290
+ "out": {
291
+ "events": [
292
+ {
293
+ "transactionId": "1700001202-gr0up-1",
294
+ "eventName": "page_view",
295
+ "eventSource": "WEB",
296
+ "userId": "visitor-55"
297
+ }
298
+ ]
299
+ }
300
+ },
219
301
  "lead": {
220
302
  "in": {
221
303
  "name": "form submit",
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@walkeros/server-destination-datamanager",
3
3
  "description": "Google Data Manager server destination for walkerOS",
4
- "version": "2.2.0-next-1773136823705",
4
+ "version": "3.0.0",
5
5
  "license": "MIT",
6
- "sideEffects": false,
7
6
  "exports": {
8
7
  ".": {
9
8
  "types": "./dist/index.d.ts",
@@ -34,12 +33,12 @@
34
33
  "update": "npx npm-check-updates -u && npm update"
35
34
  },
36
35
  "dependencies": {
37
- "@walkeros/core": "2.2.0-next-1773136823705",
38
- "@walkeros/server-core": "2.2.0-next-1773136823705",
36
+ "@walkeros/core": "^3.0.0",
37
+ "@walkeros/server-core": "^3.0.0",
39
38
  "google-auth-library": "^10.5.0"
40
39
  },
41
40
  "devDependencies": {
42
- "@walkeros/collector": "2.2.0-next-1773136823705"
41
+ "@walkeros/collector": "^3.0.0"
43
42
  },
44
43
  "repository": {
45
44
  "url": "git+https://github.com/elbwalker/walkerOS.git",
@@ -52,7 +51,8 @@
52
51
  },
53
52
  "walkerOS": {
54
53
  "type": "destination",
55
- "platform": "server"
54
+ "platform": "server",
55
+ "docs": "https://www.walkeros.io/docs/destinations/server/datamanager"
56
56
  },
57
57
  "keywords": [
58
58
  "walkerOS",