@walkeros/server-destination-api 4.7.0-next-1790187973605 → 4.7.0-next-1790722899482

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/CHANGELOG.md CHANGED
@@ -1,22 +1,31 @@
1
1
  # @walkeros/server-destination-api
2
2
 
3
- ## 4.7.0-next-1790187973605
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [57788bc]
8
- - Updated dependencies [f5a1cfd]
9
- - Updated dependencies [ef02916]
10
- - Updated dependencies [ef02916]
11
- - Updated dependencies [2aebc53]
12
- - Updated dependencies [f5a1cfd]
13
- - Updated dependencies [f5a1cfd]
14
- - Updated dependencies [2aebc53]
15
- - Updated dependencies [8f8aea6]
16
- - Updated dependencies [2aebc53]
17
- - Updated dependencies [2aebc53]
18
- - @walkeros/core@4.7.0-next-1790187973605
19
- - @walkeros/server-core@4.7.0-next-1790187973605
3
+ ## 4.7.0-next-1790722899482
4
+
5
+ ### Patch Changes
6
+
7
+ - 74821ed: Simulate records every vendor call through one recorder, `observeEnv`
8
+ from `@walkeros/core`, and runs offline: BigQuery, Data Manager and the
9
+ Sheets, GCS and S3 stores reach the network through `env`. Client and `Env`
10
+ types of BigQuery, Firehose, PostHog, SQS and Pub/Sub are structural.
11
+ `@walkeros/cli` exports `resolveExportName` and `selectDevExamples` and drops
12
+ `findExample` and `compareOutput`.
13
+ - Updated dependencies [74821ed]
14
+ - Updated dependencies [06b498a]
15
+ - Updated dependencies [74821ed]
16
+ - Updated dependencies [74821ed]
17
+ - Updated dependencies [74821ed]
18
+ - Updated dependencies [74821ed]
19
+ - Updated dependencies [06b498a]
20
+ - Updated dependencies [74821ed]
21
+ - Updated dependencies [74821ed]
22
+ - Updated dependencies [74821ed]
23
+ - Updated dependencies [74821ed]
24
+ - Updated dependencies [74821ed]
25
+ - Updated dependencies [74821ed]
26
+ - Updated dependencies [74821ed]
27
+ - @walkeros/core@4.7.0-next-1790722899482
28
+ - @walkeros/server-core@4.7.0-next-1790722899482
20
29
 
21
30
  ## 4.6.1
22
31
 
package/dist/dev.d.mts CHANGED
@@ -33,7 +33,7 @@ interface Env extends DestinationServer.Env {
33
33
  }
34
34
 
35
35
  declare const init: Env | undefined;
36
- declare const standard: Env;
36
+ declare const push: Env;
37
37
  /**
38
38
  * Simulation tracking paths
39
39
  * Specifies which function calls to track during simulation
@@ -41,10 +41,10 @@ declare const standard: Env;
41
41
  declare const simulation: string[];
42
42
 
43
43
  declare const env_init: typeof init;
44
+ declare const env_push: typeof push;
44
45
  declare const env_simulation: typeof simulation;
45
- declare const env_standard: typeof standard;
46
46
  declare namespace env {
47
- export { env_init as init, env_simulation as simulation, env_standard as standard };
47
+ export { env_init as init, env_push as push, env_simulation as simulation };
48
48
  }
49
49
 
50
50
  declare const fullEvent: Flow.StepExample;
package/dist/dev.d.ts CHANGED
@@ -33,7 +33,7 @@ interface Env extends DestinationServer.Env {
33
33
  }
34
34
 
35
35
  declare const init: Env | undefined;
36
- declare const standard: Env;
36
+ declare const push: Env;
37
37
  /**
38
38
  * Simulation tracking paths
39
39
  * Specifies which function calls to track during simulation
@@ -41,10 +41,10 @@ declare const standard: Env;
41
41
  declare const simulation: string[];
42
42
 
43
43
  declare const env_init: typeof init;
44
+ declare const env_push: typeof push;
44
45
  declare const env_simulation: typeof simulation;
45
- declare const env_standard: typeof standard;
46
46
  declare namespace env {
47
- export { env_init as init, env_simulation as simulation, env_standard as standard };
47
+ export { env_init as init, env_push as push, env_simulation as simulation };
48
48
  }
49
49
 
50
50
  declare const fullEvent: Flow.StepExample;
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})},s={};i(s,{examples:()=>v,schemas:()=>d}),module.exports=(e=s,((e,i,s,d)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let n of o(i))a.call(e,n)||n===s||t(e,n,{get:()=>i[n],enumerable:!(d=r(i,n))||d.enumerable});return e})(t({},"__esModule",{value:!0}),e));var d={};i(d,{MappingSchema:()=>p,SettingsSchema:()=>c,mapping:()=>l,settings:()=>u});var n=require("@walkeros/core/dev"),m=require("@walkeros/core/dev"),c=m.z.object({url:m.z.string().url().describe("The API endpoint URL to send events to"),headers:m.z.record(m.z.string(),m.z.string()).describe("Custom HTTP headers to include with requests").optional(),method:m.z.string().describe("HTTP method to use (default: POST)").optional(),transform:m.z.any().describe("Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))").optional(),timeout:m.z.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()}),p=require("@walkeros/core/dev").z.object({}),u=(0,n.zodToSchema)(c),l=(0,n.zodToSchema)(p),v={};i(v,{env:()=>h,step:()=>b});var h={};i(h,{init:()=>g,simulation:()=>f,standard:()=>y});var g={sendServer:void 0},y={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},f=["sendServer"],b={};i(b,{customHeaders:()=>w,customTransform:()=>z,fullEvent:()=>P});var S=require("@walkeros/core"),O="https://api.example.com/events",P={title:"Forward event data",description:"A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.",in:(0,S.getEvent)("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",O,JSON.stringify({title:"Docs",url:"https://example.com/docs"}),{headers:void 0,method:void 0,timeout:void 0}]]},w={title:"Custom headers",description:"A form submission is sent to the API with custom request headers such as an API key for authentication.",in:(0,S.getEvent)("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",O,JSON.stringify({type:"contact",email:"user@example.com"}),{headers:{"X-API-Key":"YOUR_API_KEY"},method:void 0,timeout:void 0}]]},z={title:"Custom payload",description:"An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.",in:(0,S.getEvent)("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"express",platform:"server"}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:[["sendServer",O,JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"}),{headers:void 0,method:void 0,timeout:void 0}]]};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})},s={};i(s,{examples:()=>v,schemas:()=>d}),module.exports=(e=s,((e,i,s,d)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let n of o(i))a.call(e,n)||n===s||t(e,n,{get:()=>i[n],enumerable:!(d=r(i,n))||d.enumerable});return e})(t({},"__esModule",{value:!0}),e));var d={};i(d,{MappingSchema:()=>c,SettingsSchema:()=>p,mapping:()=>l,settings:()=>u});var n=require("@walkeros/core/dev"),m=require("@walkeros/core/dev"),p=m.z.object({url:m.z.string().url().describe("The API endpoint URL to send events to"),headers:m.z.record(m.z.string(),m.z.string()).describe("Custom HTTP headers to include with requests").optional(),method:m.z.string().describe("HTTP method to use (default: POST)").optional(),transform:m.z.any().describe("Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))").optional(),timeout:m.z.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()}),c=require("@walkeros/core/dev").z.object({}),u=(0,n.zodToSchema)(p),l=(0,n.zodToSchema)(c),v={};i(v,{env:()=>h,step:()=>b});var h={};i(h,{init:()=>y,push:()=>f,simulation:()=>g});var y={sendServer:void 0},f={sendServer:()=>Promise.resolve({ok:!0})},g=["sendServer"],b={};i(b,{customHeaders:()=>w,customTransform:()=>z,fullEvent:()=>P});var S=require("@walkeros/core"),O="https://api.example.com/events",P={title:"Forward event data",description:"A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.",in:(0,S.getEvent)("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",O,JSON.stringify({title:"Docs",url:"https://example.com/docs"}),{headers:void 0,method:void 0,timeout:void 0}]]},w={title:"Custom headers",description:"A form submission is sent to the API with custom request headers such as an API key for authentication.",in:(0,S.getEvent)("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",O,JSON.stringify({type:"contact",email:"user@example.com"}),{headers:{"X-API-Key":"YOUR_API_KEY"},method:void 0,timeout:void 0}]]},z={title:"Custom payload",description:"An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.",in:(0,S.getEvent)("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"express",platform:"server"}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:[["sendServer",O,JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"}),{headers:void 0,method:void 0,timeout:void 0}]]};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n transform: z\n .any()\n .describe(\n 'Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))',\n )\n .optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * API server destination step examples.\n *\n * At push time, the destination calls `env.sendServer(url, body, options)`\n * where `url` is the configured endpoint, `body` is the JSON-stringified\n * event data (or mapped data), and `options` carries headers/method/timeout.\n *\n * Each `out` tuple is `['sendServer', url, body, options]` mirroring the real\n * call signature. The test fixture injects the configured settings per example.\n */\nconst URL = 'https://api.example.com/events';\n\nexport const fullEvent: Flow.StepExample = {\n title: 'Forward event data',\n description:\n 'A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.',\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n\nexport const customHeaders: Flow.StepExample = {\n title: 'Custom headers',\n description:\n 'A form submission is sent to the API with custom request headers such as an API key for authentication.',\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n {\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n method: undefined,\n timeout: undefined,\n },\n ],\n ],\n};\n\nexport const customTransform: Flow.StepExample = {\n title: 'Custom payload',\n description:\n 'An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.',\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,KAAK,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS,wCAAwC;AAAA,EACvE,SAAS,aACN,OAAO,aAAE,OAAO,GAAG,aAAE,OAAO,CAAC,EAC7B,SAAS,8C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as/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n transform: z\n .any()\n .describe(\n 'Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))',\n )\n .optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst sendServer: NonNullable<Env['sendServer']> = () =>\n Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const push: Env = {\n sendServer,\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * API server destination step examples.\n *\n * At push time, the destination calls `env.sendServer(url, body, options)`\n * where `url` is the configured endpoint, `body` is the JSON-stringified\n * event data (or mapped data), and `options` carries headers/method/timeout.\n *\n * Each `out` tuple is `['sendServer', url, body, options]` mirroring the real\n * call signature. The test fixture injects the configured settings per example.\n */\nconst URL = 'https://api.example.com/events';\n\nexport const fullEvent: Flow.StepExample = {\n title: 'Forward event data',\n description:\n 'A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.',\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n\nexport const customHeaders: Flow.StepExample = {\n title: 'Custom headers',\n description:\n 'A form submission is sent to the API with custom request headers such as an API key for authentication.',\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n {\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n method: undefined,\n timeout: undefined,\n },\n ],\n ],\n};\n\nexport const customTransform: Flow.StepExample = {\n title: 'Custom payload',\n description:\n 'An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.',\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n"],"mappings":";;;;;;;;;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,MACA,KAAK,UAAU;AAAA,QACb,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,aAAa;AAAA,QACb,YAAY;AAAA,MACd,CAAC;AAAA,MACD,EAAE,SAAS,QAAW,QAAQ,QAAW,SAAS,OAAU;AAAA,IAC9D;AAAA,EACF;AACF;","names":["import_dev","import_dev"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,t=(t,r)=>{for(var o in r)e(t,o,{get:r[o],enumerable:!0})},r={};t(r,{MappingSchema:()=>d,SettingsSchema:()=>i,mapping:()=>m,settings:()=>n});import{zodToSchema as o}from"@walkeros/core/dev";import{z as a}from"@walkeros/core/dev";var i=a.object({url:a.string().url().describe("The API endpoint URL to send events to"),headers:a.record(a.string(),a.string()).describe("Custom HTTP headers to include with requests").optional(),method:a.string().describe("HTTP method to use (default: POST)").optional(),transform:a.any().describe("Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))").optional(),timeout:a.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()});import{z as s}from"@walkeros/core/dev";var d=s.object({}),n=o(i),m=o(d),p={};t(p,{env:()=>c,step:()=>h});var c={};t(c,{init:()=>u,simulation:()=>v,standard:()=>l});var u={sendServer:void 0},l={sendServer:Object.assign(()=>Promise.resolve({ok:!0}),{})},v=["sendServer"],h={};t(h,{customHeaders:()=>S,customTransform:()=>b,fullEvent:()=>y});import{getEvent as f}from"@walkeros/core";var g="https://api.example.com/events",y={title:"Forward event data",description:"A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.",in:f("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",g,JSON.stringify({title:"Docs",url:"https://example.com/docs"}),{headers:void 0,method:void 0,timeout:void 0}]]},S={title:"Custom headers",description:"A form submission is sent to the API with custom request headers such as an API key for authentication.",in:f("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",g,JSON.stringify({type:"contact",email:"user@example.com"}),{headers:{"X-API-Key":"YOUR_API_KEY"},method:void 0,timeout:void 0}]]},b={title:"Custom payload",description:"An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.",in:f("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"express",platform:"server"}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:[["sendServer",g,JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"}),{headers:void 0,method:void 0,timeout:void 0}]]};export{p as examples,r as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,t=(t,r)=>{for(var o in r)e(t,o,{get:r[o],enumerable:!0})},r={};t(r,{MappingSchema:()=>d,SettingsSchema:()=>i,mapping:()=>m,settings:()=>n});import{zodToSchema as o}from"@walkeros/core/dev";import{z as a}from"@walkeros/core/dev";var i=a.object({url:a.string().url().describe("The API endpoint URL to send events to"),headers:a.record(a.string(),a.string()).describe("Custom HTTP headers to include with requests").optional(),method:a.string().describe("HTTP method to use (default: POST)").optional(),transform:a.any().describe("Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))").optional(),timeout:a.number().positive().describe("Request timeout in milliseconds (default: 5000)").optional()});import{z as s}from"@walkeros/core/dev";var d=s.object({}),n=o(i),m=o(d),p={};t(p,{env:()=>c,step:()=>h});var c={};t(c,{init:()=>u,push:()=>l,simulation:()=>v});var u={sendServer:void 0},l={sendServer:()=>Promise.resolve({ok:!0})},v=["sendServer"],h={};t(h,{customHeaders:()=>S,customTransform:()=>b,fullEvent:()=>g});import{getEvent as f}from"@walkeros/core";var y="https://api.example.com/events",g={title:"Forward event data",description:"A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.",in:f("page view",{timestamp:1700000800,data:{title:"Docs",url:"https://example.com/docs"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",y,JSON.stringify({title:"Docs",url:"https://example.com/docs"}),{headers:void 0,method:void 0,timeout:void 0}]]},S={title:"Custom headers",description:"A form submission is sent to the API with custom request headers such as an API key for authentication.",in:f("form submit",{timestamp:1700000801,data:{type:"contact",email:"user@example.com"},source:{type:"express",platform:"server"}}),mapping:{data:"data"},out:[["sendServer",y,JSON.stringify({type:"contact",email:"user@example.com"}),{headers:{"X-API-Key":"YOUR_API_KEY"},method:void 0,timeout:void 0}]]},b={title:"Custom payload",description:"An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.",in:f("order complete",{timestamp:1700000802,data:{id:"ORD-500",total:199.99,currency:"USD"},user:{id:"buyer-42"},source:{type:"express",platform:"server"}}),mapping:{data:{map:{order_id:"data.id",amount:"data.total",currency:"data.currency",customer_id:"user.id",event_type:"name"}}},out:[["sendServer",y,JSON.stringify({order_id:"ORD-500",amount:199.99,currency:"USD",customer_id:"buyer-42",event_type:"order complete"}),{headers:void 0,method:void 0,timeout:void 0}]]};export{p as examples,r as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n transform: z\n .any()\n .describe(\n 'Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))',\n )\n .optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst noop = () => Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const standard: Env = {\n sendServer: Object.assign(noop, {\n // Add any specific properties if needed for sendServer\n }) as unknown as Env['sendServer'],\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * API server destination step examples.\n *\n * At push time, the destination calls `env.sendServer(url, body, options)`\n * where `url` is the configured endpoint, `body` is the JSON-stringified\n * event data (or mapped data), and `options` carries headers/method/timeout.\n *\n * Each `out` tuple is `['sendServer', url, body, options]` mirroring the real\n * call signature. The test fixture injects the configured settings per example.\n */\nconst URL = 'https://api.example.com/events';\n\nexport const fullEvent: Flow.StepExample = {\n title: 'Forward event data',\n description:\n 'A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.',\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n\nexport const customHeaders: Flow.StepExample = {\n title: 'Custom headers',\n description:\n 'A form submission is sent to the API with custom request headers such as an API key for authentication.',\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n {\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n method: undefined,\n timeout: undefined,\n },\n ],\n ],\n};\n\nexport const customTransform: Flow.StepExample = {\n title: 'Custom payload',\n description:\n 'An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.',\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,wCAAwC;AAAA,EACvE,SAAS,EACN,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAC7B,SAAS,8CAA8C,EACvD,SAAS;AAAA,EACZ,QAAQ,EAAE,OAAO,EAAE,SAAS,oCAAoC,EAAE,SAAS;AAAA,EAC3E,WAAW,EACR,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,EACN,OAAO,EACP,SAAS,EACT,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AAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,MAAM;AAAA,QACN,OAAO;AAAA,MACT,CAAC;AAAA,MACD;AAAA,QACE,SAAS,EAAE,aAAa,eAAe;AAAA,QACvC,QAAQ;AAAA,QACR,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,kBAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI,SAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,OAAO,QAAQ,UAAU,MAAM;AAAA,IACtD,MAAM,EAAE,IAAI,WAAW;AAAA,IACvB,QAAQ,EAAE,MAAM,WAAW,UAAU,SAAS;AAAA,EAChD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,aAAa;AAAA,QACb,YAAY;AAAA,MACd,CAAC;AAAA,MACD,EAAE,SAAS,QAAW,QAAQ,QAAW,SAAS,OAAU;AAAA,IAC9D;AAAA,EACF;AACF;","names":["z"]}
1
+ {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n url: z.string().url().describe('The API endpoint URL to send events to'),\n headers: z\n .record(z.string(), z.string())\n .describe('Custom HTTP headers to include with requests')\n .optional(),\n method: z.string().describe('HTTP method to use (default: POST)').optional(),\n transform: z\n .any()\n .describe(\n 'Function to transform event data before sending (like (data, config, mapping) => JSON.stringify(data))',\n )\n .optional(),\n timeout: z\n .number()\n .positive()\n .describe('Request timeout in milliseconds (default: 5000)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring external dependencies.\n */\n\nconst sendServer: NonNullable<Env['sendServer']> = () =>\n Promise.resolve({ ok: true });\n\nexport const init: Env | undefined = {\n sendServer: undefined,\n};\n\nexport const push: Env = {\n sendServer,\n};\n\n/**\n * Simulation tracking paths\n * Specifies which function calls to track during simulation\n */\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * API server destination step examples.\n *\n * At push time, the destination calls `env.sendServer(url, body, options)`\n * where `url` is the configured endpoint, `body` is the JSON-stringified\n * event data (or mapped data), and `options` carries headers/method/timeout.\n *\n * Each `out` tuple is `['sendServer', url, body, options]` mirroring the real\n * call signature. The test fixture injects the configured settings per example.\n */\nconst URL = 'https://api.example.com/events';\n\nexport const fullEvent: Flow.StepExample = {\n title: 'Forward event data',\n description:\n 'A page view is POSTed to the configured endpoint with the event data serialized as the JSON body.',\n in: getEvent('page view', {\n timestamp: 1700000800,\n data: { title: 'Docs', url: 'https://example.com/docs' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n title: 'Docs',\n url: 'https://example.com/docs',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n\nexport const customHeaders: Flow.StepExample = {\n title: 'Custom headers',\n description:\n 'A form submission is sent to the API with custom request headers such as an API key for authentication.',\n in: getEvent('form submit', {\n timestamp: 1700000801,\n data: { type: 'contact', email: 'user@example.com' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: 'data',\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n type: 'contact',\n email: 'user@example.com',\n }),\n {\n headers: { 'X-API-Key': 'YOUR_API_KEY' },\n method: undefined,\n timeout: undefined,\n },\n ],\n ],\n};\n\nexport const customTransform: Flow.StepExample = {\n title: 'Custom payload',\n description:\n 'An order event is reshaped via a data mapping into a custom JSON payload with renamed fields for the API.',\n in: getEvent('order complete', {\n timestamp: 1700000802,\n data: { id: 'ORD-500', total: 199.99, currency: 'USD' },\n user: { id: 'buyer-42' },\n source: { type: 'express', platform: 'server' },\n }),\n mapping: {\n data: {\n map: {\n order_id: 'data.id',\n amount: 'data.total',\n currency: 'data.currency',\n customer_id: 'user.id',\n event_type: 'name',\n },\n },\n },\n out: [\n [\n 'sendServer',\n URL,\n JSON.stringify({\n order_id: 'ORD-500',\n amount: 199.99,\n currency: 'USD',\n customer_id: 'buyer-42',\n event_type: 'order complete',\n }),\n { headers: undefined, method: undefined, timeout: undefined },\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,wCAAwC;AAAA,EACvE,SAAS,EACN,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,E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AAAA,EACF,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,MAAM,WAAW,OAAO,mBAAmB;AAAA,IACnD,QAAQ,EAAE,MAAM,WAAW,UAAU,SAAS;AAAA,EAChD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,MAAM;AAAA,QACN,OAAO;AAAA,MACT,CAAC;AAAA,MACD;AAAA,QACE,SAAS,EAAE,aAAa,eAAe;AAAA,QACvC,QAAQ;AAAA,QACR,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,kBAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI,SAAS,kBAAkB;AAAA,IAC7B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,OAAO,QAAQ,UAAU,MAAM;AAAA,IACtD,MAAM,EAAE,IAAI,WAAW;AAAA,IACvB,QAAQ,EAAE,MAAM,WAAW,UAAU,SAAS;AAAA,EAChD,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,aAAa;AAAA,QACb,YAAY;AAAA,MACd,CAAC;AAAA,MACD,EAAE,SAAS,QAAW,QAAQ,QAAW,SAAS,OAAU;AAAA,IAC9D;AAAA,EACF;AACF;","names":["z"]}
@@ -6,7 +6,7 @@ interface Env extends DestinationServer.Env {
6
6
  }
7
7
 
8
8
  declare const init: Env | undefined;
9
- declare const standard: Env;
9
+ declare const push: Env;
10
10
  /**
11
11
  * Simulation tracking paths
12
12
  * Specifies which function calls to track during simulation
@@ -14,10 +14,10 @@ declare const standard: Env;
14
14
  declare const simulation: string[];
15
15
 
16
16
  declare const env_init: typeof init;
17
+ declare const env_push: typeof push;
17
18
  declare const env_simulation: typeof simulation;
18
- declare const env_standard: typeof standard;
19
19
  declare namespace env {
20
- export { env_init as init, env_simulation as simulation, env_standard as standard };
20
+ export { env_init as init, env_push as push, env_simulation as simulation };
21
21
  }
22
22
 
23
23
  declare const fullEvent: Flow.StepExample;
@@ -6,7 +6,7 @@ interface Env extends DestinationServer.Env {
6
6
  }
7
7
 
8
8
  declare const init: Env | undefined;
9
- declare const standard: Env;
9
+ declare const push: Env;
10
10
  /**
11
11
  * Simulation tracking paths
12
12
  * Specifies which function calls to track during simulation
@@ -14,10 +14,10 @@ declare const standard: Env;
14
14
  declare const simulation: string[];
15
15
 
16
16
  declare const env_init: typeof init;
17
+ declare const env_push: typeof push;
17
18
  declare const env_simulation: typeof simulation;
18
- declare const env_standard: typeof standard;
19
19
  declare namespace env {
20
- export { env_init as init, env_simulation as simulation, env_standard as standard };
20
+ export { env_init as init, env_push as push, env_simulation as simulation };
21
21
  }
22
22
 
23
23
  declare const fullEvent: Flow.StepExample;
@@ -29,17 +29,15 @@ module.exports = __toCommonJS(examples_exports);
29
29
  var env_exports = {};
30
30
  __export(env_exports, {
31
31
  init: () => init,
32
- simulation: () => simulation,
33
- standard: () => standard
32
+ push: () => push,
33
+ simulation: () => simulation
34
34
  });
35
- var noop = () => Promise.resolve({ ok: true });
35
+ var sendServer = () => Promise.resolve({ ok: true });
36
36
  var init = {
37
37
  sendServer: void 0
38
38
  };
39
- var standard = {
40
- sendServer: Object.assign(noop, {
41
- // Add any specific properties if needed for sendServer
42
- })
39
+ var push = {
40
+ sendServer
43
41
  };
44
42
  var simulation = ["sendServer"];
45
43
 
@@ -8,17 +8,15 @@ var __export = (target, all) => {
8
8
  var env_exports = {};
9
9
  __export(env_exports, {
10
10
  init: () => init,
11
- simulation: () => simulation,
12
- standard: () => standard
11
+ push: () => push,
12
+ simulation: () => simulation
13
13
  });
14
- var noop = () => Promise.resolve({ ok: true });
14
+ var sendServer = () => Promise.resolve({ ok: true });
15
15
  var init = {
16
16
  sendServer: void 0
17
17
  };
18
- var standard = {
19
- sendServer: Object.assign(noop, {
20
- // Add any specific properties if needed for sendServer
21
- })
18
+ var push = {
19
+ sendServer
22
20
  };
23
21
  var simulation = ["sendServer"];
24
22
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-destination-api",
4
- "version": "4.7.0-next-1790187973605",
4
+ "version": "4.7.0-next-1790722899482",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "server"
@@ -57,14 +57,14 @@
57
57
  "examples": {
58
58
  "env": {
59
59
  "init": {},
60
- "simulation": [
61
- "sendServer"
62
- ],
63
- "standard": {
60
+ "push": {
64
61
  "sendServer": {
65
62
  "$code": "()=>Promise.resolve({ok:!0})"
66
63
  }
67
- }
64
+ },
65
+ "simulation": [
66
+ "sendServer"
67
+ ]
68
68
  },
69
69
  "step": {
70
70
  "customHeaders": {
@@ -104,7 +104,7 @@
104
104
  "consent": {
105
105
  "functional": true
106
106
  },
107
- "id": "e0edf55c9444eee8",
107
+ "id": "013d907bd1f4135c",
108
108
  "trigger": "test",
109
109
  "entity": "form",
110
110
  "action": "submit",
@@ -209,7 +209,7 @@
209
209
  "consent": {
210
210
  "functional": true
211
211
  },
212
- "id": "93366d0de1c3909f",
212
+ "id": "fd4eb58a6ff9313f",
213
213
  "trigger": "load",
214
214
  "entity": "order",
215
215
  "action": "complete",
@@ -279,7 +279,7 @@
279
279
  "consent": {
280
280
  "functional": true
281
281
  },
282
- "id": "05934080b1c5bed9",
282
+ "id": "1990cbebfd9111df",
283
283
  "trigger": "load",
284
284
  "entity": "page",
285
285
  "action": "view",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/server-destination-api",
3
3
  "description": "API server destination for walkerOS",
4
- "version": "4.7.0-next-1790187973605",
4
+ "version": "4.7.0-next-1790722899482",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -38,8 +38,8 @@
38
38
  "update": "npx npm-check-updates -u && npm update"
39
39
  },
40
40
  "dependencies": {
41
- "@walkeros/core": "4.7.0-next-1790187973605",
42
- "@walkeros/server-core": "4.7.0-next-1790187973605"
41
+ "@walkeros/core": "4.7.0-next-1790722899482",
42
+ "@walkeros/server-core": "4.7.0-next-1790722899482"
43
43
  },
44
44
  "devDependencies": {},
45
45
  "repository": {