@walkeros/collector 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/index.d.mts +12 -7
  2. package/dist/index.d.ts +12 -7
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +3 -3
  8. package/dist/__tests__/auto-run.test.d.ts +0 -2
  9. package/dist/__tests__/auto-run.test.d.ts.map +0 -1
  10. package/dist/__tests__/auto-run.test.js +0 -102
  11. package/dist/__tests__/auto-run.test.js.map +0 -1
  12. package/dist/__tests__/consent.test.d.ts +0 -2
  13. package/dist/__tests__/consent.test.d.ts.map +0 -1
  14. package/dist/__tests__/consent.test.js +0 -21
  15. package/dist/__tests__/consent.test.js.map +0 -1
  16. package/dist/__tests__/create-flow.test.d.ts +0 -2
  17. package/dist/__tests__/create-flow.test.d.ts.map +0 -1
  18. package/dist/__tests__/create-flow.test.js +0 -69
  19. package/dist/__tests__/create-flow.test.js.map +0 -1
  20. package/dist/__tests__/destination-code.test.d.ts +0 -2
  21. package/dist/__tests__/destination-code.test.d.ts.map +0 -1
  22. package/dist/__tests__/destination-code.test.js +0 -396
  23. package/dist/__tests__/destination-code.test.js.map +0 -1
  24. package/dist/__tests__/destination.test.d.ts +0 -2
  25. package/dist/__tests__/destination.test.d.ts.map +0 -1
  26. package/dist/__tests__/destination.test.js +0 -471
  27. package/dist/__tests__/destination.test.js.map +0 -1
  28. package/dist/__tests__/handle.test.d.ts +0 -2
  29. package/dist/__tests__/handle.test.d.ts.map +0 -1
  30. package/dist/__tests__/handle.test.js +0 -78
  31. package/dist/__tests__/handle.test.js.map +0 -1
  32. package/dist/__tests__/mapping.test.d.ts +0 -2
  33. package/dist/__tests__/mapping.test.d.ts.map +0 -1
  34. package/dist/__tests__/mapping.test.js +0 -310
  35. package/dist/__tests__/mapping.test.js.map +0 -1
  36. package/dist/__tests__/source.test.d.ts +0 -2
  37. package/dist/__tests__/source.test.d.ts.map +0 -1
  38. package/dist/__tests__/source.test.js +0 -306
  39. package/dist/__tests__/source.test.js.map +0 -1
  40. package/dist/__tests__/start-flow.test.d.ts +0 -2
  41. package/dist/__tests__/start-flow.test.d.ts.map +0 -1
  42. package/dist/__tests__/start-flow.test.js +0 -167
  43. package/dist/__tests__/start-flow.test.js.map +0 -1
  44. package/dist/__tests__/walker-entity.test.d.ts +0 -2
  45. package/dist/__tests__/walker-entity.test.d.ts.map +0 -1
  46. package/dist/__tests__/walker-entity.test.js +0 -52
  47. package/dist/__tests__/walker-entity.test.js.map +0 -1
  48. package/dist/collector.d.ts +0 -3
  49. package/dist/collector.d.ts.map +0 -1
  50. package/dist/collector.js +0 -60
  51. package/dist/collector.js.map +0 -1
  52. package/dist/command.d.ts +0 -12
  53. package/dist/command.d.ts.map +0 -1
  54. package/dist/command.js +0 -20
  55. package/dist/command.js.map +0 -1
  56. package/dist/consent.d.ts +0 -10
  57. package/dist/consent.d.ts.map +0 -1
  58. package/dist/consent.js +0 -30
  59. package/dist/consent.js.map +0 -1
  60. package/dist/constants.d.ts +0 -13
  61. package/dist/constants.d.ts.map +0 -1
  62. package/dist/constants.js +0 -35
  63. package/dist/constants.js.map +0 -1
  64. package/dist/destination-code.d.ts +0 -4
  65. package/dist/destination-code.d.ts.map +0 -1
  66. package/dist/destination-code.js +0 -72
  67. package/dist/destination-code.js.map +0 -1
  68. package/dist/destination.d.ts +0 -61
  69. package/dist/destination.d.ts.map +0 -1
  70. package/dist/destination.js +0 -325
  71. package/dist/destination.js.map +0 -1
  72. package/dist/dev.d.ts.map +0 -1
  73. package/dist/elb.d.ts +0 -11
  74. package/dist/elb.d.ts.map +0 -1
  75. package/dist/elb.js +0 -60
  76. package/dist/elb.js.map +0 -1
  77. package/dist/flow.d.ts +0 -4
  78. package/dist/flow.d.ts.map +0 -1
  79. package/dist/flow.js +0 -44
  80. package/dist/flow.js.map +0 -1
  81. package/dist/handle.d.ts +0 -29
  82. package/dist/handle.d.ts.map +0 -1
  83. package/dist/handle.js +0 -161
  84. package/dist/handle.js.map +0 -1
  85. package/dist/index.d.ts.map +0 -1
  86. package/dist/on.d.ts +0 -19
  87. package/dist/on.d.ts.map +0 -1
  88. package/dist/on.js +0 -127
  89. package/dist/on.js.map +0 -1
  90. package/dist/push.d.ts +0 -11
  91. package/dist/push.d.ts.map +0 -1
  92. package/dist/push.js +0 -43
  93. package/dist/push.js.map +0 -1
  94. package/dist/source.d.ts +0 -10
  95. package/dist/source.d.ts.map +0 -1
  96. package/dist/source.js +0 -47
  97. package/dist/source.js.map +0 -1
  98. package/dist/types/code.d.ts +0 -23
  99. package/dist/types/code.d.ts.map +0 -1
  100. package/dist/types/code.js +0 -2
  101. package/dist/types/code.js.map +0 -1
  102. package/dist/types/collector.d.ts +0 -19
  103. package/dist/types/collector.d.ts.map +0 -1
  104. package/dist/types/collector.js +0 -2
  105. package/dist/types/collector.js.map +0 -1
  106. package/dist/types/index.d.ts +0 -3
  107. package/dist/types/index.d.ts.map +0 -1
  108. package/dist/types/index.js +0 -4
  109. package/dist/types/index.js.map +0 -1
package/dist/handle.js DELETED
@@ -1,161 +0,0 @@
1
- import { Const } from './constants';
2
- import { addDestination, pushToDestinations } from './destination';
3
- import { assign, getId, isFunction, isString } from '@walkeros/core';
4
- import { isObject } from '@walkeros/core';
5
- import { setConsent } from './consent';
6
- import { on, onApply } from './on';
7
- /**
8
- * Handles common commands.
9
- *
10
- * @param collector The walkerOS collector instance.
11
- * @param action The action to handle.
12
- * @param data The data to handle.
13
- * @param options The options to handle.
14
- * @returns A promise that resolves with the push result or undefined.
15
- */
16
- export async function commonHandleCommand(collector, action, data, options) {
17
- let result;
18
- switch (action) {
19
- case Const.Commands.Config:
20
- if (isObject(data)) {
21
- assign(collector.config, data, {
22
- shallow: false,
23
- });
24
- }
25
- break;
26
- case Const.Commands.Consent:
27
- if (isObject(data)) {
28
- result = await setConsent(collector, data);
29
- }
30
- break;
31
- case Const.Commands.Custom:
32
- if (isObject(data)) {
33
- collector.custom = assign(collector.custom, data);
34
- }
35
- break;
36
- case Const.Commands.Destination:
37
- if (isObject(data) && isFunction(data.push)) {
38
- result = await addDestination(collector, { code: data }, options);
39
- }
40
- break;
41
- case Const.Commands.Globals:
42
- if (isObject(data)) {
43
- collector.globals = assign(collector.globals, data);
44
- }
45
- break;
46
- case Const.Commands.On:
47
- if (isString(data)) {
48
- on(collector, data, options);
49
- }
50
- break;
51
- case Const.Commands.Ready:
52
- onApply(collector, 'ready');
53
- break;
54
- case Const.Commands.Run:
55
- result = await runCollector(collector, data);
56
- break;
57
- case Const.Commands.Session:
58
- onApply(collector, 'session');
59
- break;
60
- case Const.Commands.User:
61
- if (isObject(data)) {
62
- assign(collector.user, data, { shallow: false });
63
- }
64
- break;
65
- }
66
- return (result || {
67
- ok: true,
68
- successful: [],
69
- queued: [],
70
- failed: [],
71
- });
72
- }
73
- /**
74
- * Creates a full event from a partial event.
75
- *
76
- * @param collector The walkerOS collector instance.
77
- * @param partialEvent The partial event to transform.
78
- * @returns The full event.
79
- */
80
- export function createEvent(collector, partialEvent) {
81
- if (!partialEvent.name)
82
- throw new Error('Event name is required');
83
- const [entityValue, actionValue] = partialEvent.name.split(' ');
84
- if (!entityValue || !actionValue)
85
- throw new Error('Event name is invalid');
86
- ++collector.count;
87
- const { timestamp = Date.now(), group = collector.group, count = collector.count, } = partialEvent;
88
- const { name = `${entityValue} ${actionValue}`, data = {}, context = {}, globals = collector.globals, custom = {}, user = collector.user, nested = [], consent = collector.consent, id = `${timestamp}-${group}-${count}`, trigger = '', entity = entityValue, action = actionValue, timing = 0, version = {
89
- source: collector.version,
90
- tagging: collector.config.tagging || 0,
91
- }, source = { type: 'collector', id: '', previous_id: '' }, } = partialEvent;
92
- return {
93
- name,
94
- data,
95
- context,
96
- globals,
97
- custom,
98
- user,
99
- nested,
100
- consent,
101
- id,
102
- trigger,
103
- entity,
104
- action,
105
- timestamp,
106
- timing,
107
- group,
108
- count,
109
- version,
110
- source,
111
- };
112
- }
113
- /**
114
- * Runs the collector by setting it to allowed state and processing queued events.
115
- *
116
- * @param collector The walkerOS collector instance.
117
- * @param state Optional state to merge with the collector (user, globals, consent, custom).
118
- * @returns A promise that resolves with the push result.
119
- */
120
- export async function runCollector(collector, state) {
121
- // Set the collector to allowed state
122
- collector.allowed = true;
123
- // Reset count and generate new group ID
124
- collector.count = 0;
125
- collector.group = getId();
126
- // Update timing for this run
127
- collector.timing = Date.now();
128
- // Update collector state if provided
129
- if (state) {
130
- // Update consent if provided
131
- if (state.consent) {
132
- collector.consent = assign(collector.consent, state.consent);
133
- }
134
- // Update user if provided
135
- if (state.user) {
136
- collector.user = assign(collector.user, state.user);
137
- }
138
- // Update globals if provided
139
- if (state.globals) {
140
- collector.globals = assign(collector.config.globalsStatic || {}, state.globals);
141
- }
142
- // Update custom if provided
143
- if (state.custom) {
144
- collector.custom = assign(collector.custom, state.custom);
145
- }
146
- }
147
- // Reset destination queues
148
- Object.values(collector.destinations).forEach((destination) => {
149
- destination.queue = [];
150
- });
151
- // Reset collector queue for this run
152
- collector.queue = [];
153
- // Increase round counter
154
- collector.round++;
155
- // Process any queued events now that the collector is allowed
156
- const result = await pushToDestinations(collector);
157
- // Call the predefined run events
158
- onApply(collector, 'run');
159
- return result;
160
- }
161
- //# sourceMappingURL=handle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA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;IACzB,SAAS,CAAC,KAAK,EAAE,CAAC;IAElB,8DAA8D;IAC9D,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAEnD,iCAAiC;IACjC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAE1B,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AAExB,cAAc,aAAa,CAAC;AAE5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC"}
package/dist/on.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import type { Collector, On, WalkerOS } from '@walkeros/core';
2
- /**
3
- * Registers a callback for a specific event type.
4
- *
5
- * @param collector The walkerOS collector instance.
6
- * @param type The type of the event to listen for.
7
- * @param option The callback function or an array of callback functions.
8
- */
9
- export declare function on(collector: Collector.Instance, type: On.Types, option: WalkerOS.SingleOrArray<On.Options>): void;
10
- /**
11
- * Applies all registered callbacks for a specific event type.
12
- *
13
- * @param collector The walkerOS collector instance.
14
- * @param type The type of the event to apply the callbacks for.
15
- * @param options The options for the callbacks.
16
- * @param config The consent configuration.
17
- */
18
- export declare function onApply(collector: Collector.Instance, type: On.Types, options?: Array<On.Options>, config?: WalkerOS.Consent): void;
19
- //# sourceMappingURL=on.d.ts.map
package/dist/on.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"on.d.ts","sourceRoot":"","sources":["../src/on.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAM3E;;;;;;GAMG;AACH,wBAAgB,EAAE,CAChB,SAAS,EAAE,SAAS,CAAC,QAAQ,EAC7B,IAAI,EAAE,EAAE,CAAC,KAAK,EACd,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,QAe3C;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,SAAS,EAAE,SAAS,CAAC,QAAQ,EAC7B,IAAI,EAAE,EAAE,CAAC,KAAK,EACd,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,EAC3B,MAAM,CAAC,EAAE,QAAQ,CAAC,OAAO,QAuE1B"}
package/dist/on.js DELETED
@@ -1,127 +0,0 @@
1
- import { isArray } from '@walkeros/core';
2
- import { Const } from './constants';
3
- import { tryCatch } from '@walkeros/core';
4
- import { mergeEnvironments } from './destination';
5
- /**
6
- * Registers a callback for a specific event type.
7
- *
8
- * @param collector The walkerOS collector instance.
9
- * @param type The type of the event to listen for.
10
- * @param option The callback function or an array of callback functions.
11
- */
12
- export function on(collector, type, option) {
13
- const on = collector.on;
14
- const onType = on[type] || [];
15
- const options = isArray(option) ? option : [option];
16
- options.forEach((option) => {
17
- onType.push(option);
18
- });
19
- // Update collector on state
20
- on[type] = onType;
21
- // Execute the on function directly
22
- onApply(collector, type, options);
23
- }
24
- /**
25
- * Applies all registered callbacks for a specific event type.
26
- *
27
- * @param collector The walkerOS collector instance.
28
- * @param type The type of the event to apply the callbacks for.
29
- * @param options The options for the callbacks.
30
- * @param config The consent configuration.
31
- */
32
- export function onApply(collector, type, options, config) {
33
- // Use the optionally provided options
34
- let onConfig = options || [];
35
- if (!options) {
36
- // Get the collector on events
37
- onConfig = collector.on[type] || [];
38
- }
39
- // Calculate context data once for all sources and destinations
40
- let contextData;
41
- switch (type) {
42
- case Const.Commands.Consent:
43
- contextData = config || collector.consent;
44
- break;
45
- case Const.Commands.Session:
46
- contextData = collector.session;
47
- break;
48
- case Const.Commands.Ready:
49
- case Const.Commands.Run:
50
- default:
51
- contextData = undefined;
52
- break;
53
- }
54
- Object.values(collector.sources).forEach((source) => {
55
- if (source.on) {
56
- tryCatch(source.on)(type, contextData);
57
- }
58
- });
59
- Object.values(collector.destinations).forEach((destination) => {
60
- if (destination.on) {
61
- const destType = destination.type || 'unknown';
62
- const destLogger = collector.logger
63
- .scope(destType)
64
- .scope('on')
65
- .scope(type);
66
- const context = {
67
- collector,
68
- config: destination.config,
69
- data: contextData,
70
- env: mergeEnvironments(destination.env, destination.config.env),
71
- logger: destLogger,
72
- };
73
- tryCatch(destination.on)(type, context);
74
- }
75
- });
76
- if (!onConfig.length)
77
- return; // No on-events registered, nothing to do
78
- switch (type) {
79
- case Const.Commands.Consent:
80
- onConsent(collector, onConfig, config);
81
- break;
82
- case Const.Commands.Ready:
83
- onReady(collector, onConfig);
84
- break;
85
- case Const.Commands.Run:
86
- onRun(collector, onConfig);
87
- break;
88
- case Const.Commands.Session:
89
- onSession(collector, onConfig);
90
- break;
91
- default:
92
- break;
93
- }
94
- }
95
- function onConsent(collector, onConfig, currentConsent) {
96
- const consentState = currentConsent || collector.consent;
97
- onConfig.forEach((consentConfig) => {
98
- // Collect functions whose consent keys match the rule keys directly
99
- // Directly execute functions whose consent keys match the rule keys
100
- Object.keys(consentState) // consent keys
101
- .filter((consent) => consent in consentConfig) // check for matching rule keys
102
- .forEach((consent) => {
103
- // Execute the function
104
- tryCatch(consentConfig[consent])(collector, consentState);
105
- });
106
- });
107
- }
108
- function onReady(collector, onConfig) {
109
- if (collector.allowed)
110
- onConfig.forEach((func) => {
111
- tryCatch(func)(collector);
112
- });
113
- }
114
- function onRun(collector, onConfig) {
115
- if (collector.allowed)
116
- onConfig.forEach((func) => {
117
- tryCatch(func)(collector);
118
- });
119
- }
120
- function onSession(collector, onConfig) {
121
- if (!collector.session)
122
- return;
123
- onConfig.forEach((func) => {
124
- tryCatch(func)(collector, collector.session);
125
- });
126
- }
127
- //# sourceMappingURL=on.js.map
package/dist/on.js.map DELETED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E/B,IAAI,SAAS,CAAC,OAAO;QACnB,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,KAAK,CACZ,SAA6B,EAC7B,QAA6B;IAE7B,IAAI,SAAS,CAAC,OAAO;QACnB,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,SAAS,CAChB,SAA6B,EAC7B,QAAiC;IAEjC,IAAI,CAAC,SAAS,CAAC,OAAO;QAAE,OAAO;IAE/B,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/push.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import type { Collector, WalkerOS } from '@walkeros/core';
2
- /**
3
- * Creates the push function for the collector.
4
- * Handles source mapping, event creation, and routing to destinations.
5
- *
6
- * @param collector - The walkerOS collector instance
7
- * @param prepareEvent - Function to enrich partial events
8
- * @returns The push function
9
- */
10
- export declare function createPush<T extends Collector.Instance>(collector: T, prepareEvent: (event: WalkerOS.DeepPartialEvent) => WalkerOS.PartialEvent): Collector.PushFn;
11
- //# sourceMappingURL=push.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAO,MAAM,gBAAgB,CAAC;AAU/D;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,CAAC,QAAQ,EACrD,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,KAAK,QAAQ,CAAC,YAAY,GACxE,SAAS,CAAC,MAAM,CAwDlB"}
package/dist/push.js DELETED
@@ -1,43 +0,0 @@
1
- import { getGrantedConsent, processEventMapping, tryCatchAsync, useHooks, } from '@walkeros/core';
2
- import { createEvent } from './handle';
3
- import { pushToDestinations, createPushResult } from './destination';
4
- /**
5
- * Creates the push function for the collector.
6
- * Handles source mapping, event creation, and routing to destinations.
7
- *
8
- * @param collector - The walkerOS collector instance
9
- * @param prepareEvent - Function to enrich partial events
10
- * @returns The push function
11
- */
12
- export function createPush(collector, prepareEvent) {
13
- return useHooks(async (event, context = {}) => {
14
- return await tryCatchAsync(async () => {
15
- let partialEvent = event;
16
- // Apply source mapping if provided in context
17
- if (context.mapping) {
18
- const processed = await processEventMapping(partialEvent, context.mapping, collector);
19
- // Check ignore flag
20
- if (processed.ignore) {
21
- return createPushResult({ ok: true });
22
- }
23
- // Check consent requirements
24
- if (context.mapping.consent) {
25
- const grantedConsent = getGrantedConsent(context.mapping.consent, collector.consent, processed.event.consent);
26
- if (!grantedConsent) {
27
- return createPushResult({ ok: true });
28
- }
29
- }
30
- partialEvent = processed.event;
31
- }
32
- // Prepare event (add timing, source info)
33
- const enrichedEvent = prepareEvent(partialEvent);
34
- // Create full event
35
- const fullEvent = createEvent(collector, enrichedEvent);
36
- // Push to destinations
37
- return await pushToDestinations(collector, fullEvent);
38
- }, () => {
39
- return createPushResult({ ok: false });
40
- })();
41
- }, 'Push', collector.hooks);
42
- }
43
- //# sourceMappingURL=push.js.map
package/dist/push.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"push.js","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MA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AC;QACxD,CAAC,EACD,GAAG,EAAE;YACH,OAAO,gBAAgB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACzC,CAAC,CACF,EAAE,CAAC;IACN,CAAC,EACD,MAAM,EACN,SAAS,CAAC,KAAK,CACI,CAAC;AACxB,CAAC"}
package/dist/source.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { Collector, Source } from '@walkeros/core';
2
- /**
3
- * Initialize sources using the code/config/env pattern
4
- *
5
- * @param collector - The WalkerOS collector instance
6
- * @param sources - Map of source definitions with code/config/env
7
- * @returns Initialized sources
8
- */
9
- export declare function initSources(collector: Collector.Instance, sources?: Source.InitSources): Promise<Collector.Sources>;
10
- //# sourceMappingURL=source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAY,MAAM,gBAAgB,CAAC;AAGlE;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,SAAS,EAAE,SAAS,CAAC,QAAQ,EAC7B,OAAO,GAAE,MAAM,CAAC,WAAgB,GAC/B,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAiD5B"}
package/dist/source.js DELETED
@@ -1,47 +0,0 @@
1
- import { tryCatchAsync } from '@walkeros/core';
2
- /**
3
- * Initialize sources using the code/config/env pattern
4
- *
5
- * @param collector - The WalkerOS collector instance
6
- * @param sources - Map of source definitions with code/config/env
7
- * @returns Initialized sources
8
- */
9
- export async function initSources(collector, sources = {}) {
10
- const result = {};
11
- for (const [sourceId, sourceDefinition] of Object.entries(sources)) {
12
- const { code, config = {}, env = {}, primary } = sourceDefinition;
13
- // Create wrapped push that auto-applies source mapping config
14
- const wrappedPush = (event, context = {}) => {
15
- // Pass source config as mapping in context
16
- return collector.push(event, {
17
- ...context,
18
- mapping: config,
19
- });
20
- };
21
- // Create initial logger scoped to sourceId (type will be added after init)
22
- const initialLogger = collector.logger.scope('source').scope(sourceId);
23
- const cleanEnv = {
24
- push: wrappedPush,
25
- command: collector.command,
26
- sources: collector.sources, // Provide access to all sources for chaining
27
- elb: collector.sources.elb.push, // ELB source is always available
28
- logger: initialLogger,
29
- ...env,
30
- };
31
- // Call source function with config and environment separately
32
- const sourceInstance = await tryCatchAsync(code)(config, cleanEnv);
33
- if (!sourceInstance)
34
- continue; // Skip failed source initialization
35
- // Update logger with actual source type: [type:sourceId] or [unknown:sourceId]
36
- const sourceType = sourceInstance.type || 'unknown';
37
- const sourceLogger = collector.logger.scope(sourceType).scope(sourceId);
38
- cleanEnv.logger = sourceLogger;
39
- // Store the primary flag in the source config for later access
40
- if (primary) {
41
- sourceInstance.config = { ...sourceInstance.config, primary };
42
- }
43
- result[sourceId] = sourceInstance;
44
- }
45
- return result;
46
- }
47
- //# sourceMappingURL=source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,SAA6B,EAC7B,UAA8B,EAAE;IAEhC,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC;QAElE,8DAA8D;QAC9D,MAAM,WAAW,GAAqB,CACpC,KAAgC,EAChC,UAAiC,EAAE,EACnC,EAAE;YACF,2CAA2C;YAC3C,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE;gBAC3B,GAAG,OAAO;gBACV,OAAO,EAAE,MAAM;aAChB,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,2EAA2E;QAC3E,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEvE,MAAM,QAAQ,GAAe;YAC3B,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,6CAA6C;YACzE,GAAG,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,iCAAiC;YAClE,MAAM,EAAE,aAAa;YACrB,GAAG,GAAG;SACP,CAAC;QAEF,8DAA8D;QAC9D,MAAM,cAAc,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEnE,IAAI,CAAC,cAAc;YAAE,SAAS,CAAC,oCAAoC;QAEnE,+EAA+E;QAC/E,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,IAAI,SAAS,CAAC;QACpD,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxE,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC;QAE/B,+DAA+D;QAC/D,IAAI,OAAO,EAAE,CAAC;YACZ,cAAc,CAAC,MAAM,GAAG,EAAE,GAAG,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;QAChE,CAAC;QAED,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC;IACpC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,23 +0,0 @@
1
- import type { Destination, Mapping, On, WalkerOS } from '@walkeros/core';
2
- export interface Settings {
3
- scripts?: string[];
4
- init?: string;
5
- on?: string;
6
- push?: string;
7
- pushBatch?: string;
8
- }
9
- export interface CodeMapping extends Mapping.Rule<CodeMapping> {
10
- push?: string;
11
- pushBatch?: string;
12
- }
13
- export type Types = Destination.Types<Settings, CodeMapping>;
14
- export type Config = Destination.Config<Types>;
15
- export type Context = Destination.Context<Types>;
16
- export type InitContext = Destination.InitContext<Types>;
17
- export type PushContext = Destination.PushContext<Types>;
18
- export type PushBatchContext = Destination.PushBatchContext<Types>;
19
- export type InitFn = (context: InitContext) => void;
20
- export type OnFn = (type: On.Types, context: Context) => void;
21
- export type PushFn = (event: WalkerOS.Event, context: PushContext) => void;
22
- export type PushBatchFn = (batch: Destination.Batch<CodeMapping>, context: PushBatchContext) => void;
23
- //# sourceMappingURL=code.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/types/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEzE,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC7D,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/C,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACzD,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAEnE,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;AACpD,MAAM,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAC9D,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;AAC3E,MAAM,MAAM,WAAW,GAAG,CACxB,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,EACrC,OAAO,EAAE,gBAAgB,KACtB,IAAI,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code.js","sourceRoot":"","sources":["../../src/types/code.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- import type { Collector, WalkerOS, Elb } from '@walkeros/core';
2
- export interface RunState {
3
- consent?: WalkerOS.Consent;
4
- user?: WalkerOS.User;
5
- globals?: WalkerOS.Properties;
6
- custom?: WalkerOS.Properties;
7
- }
8
- export type HandleCommandFn<T extends Collector.Instance> = (collector: T, action: string, data?: unknown, options?: unknown) => Promise<Elb.PushResult>;
9
- export type CommandTypes = 'Action' | 'Actions' | 'Config' | 'Consent' | 'Context' | 'Custom' | 'Destination' | 'Elb' | 'Globals' | 'Hook' | 'Init' | 'Link' | 'On' | 'Prefix' | 'Ready' | 'Run' | 'Session' | 'User' | 'Walker';
10
- export type StorageType = 'cookie' | 'local' | 'session';
11
- export interface CreateCollector {
12
- collector: Collector.Instance;
13
- elb: WalkerOS.Elb;
14
- }
15
- export interface StartFlow<ElbPush extends WalkerOS.Elb = WalkerOS.Elb> {
16
- collector: Collector.Instance;
17
- elb: ElbPush;
18
- }
19
- //# sourceMappingURL=collector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/types/collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAG/D,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;IAC9B,MAAM,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;CAC9B;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,SAAS,CAAC,QAAQ,IAAI,CAC1D,SAAS,EAAE,CAAC,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,OAAO,KACd,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAE7B,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,aAAa,GACb,KAAK,GACL,SAAS,GACT,MAAM,GACN,MAAM,GACN,MAAM,GACN,IAAI,GACJ,QAAQ,GACR,OAAO,GACP,KAAK,GACL,SAAS,GACT,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC;IAC9B,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC;CACnB;AAED,MAAM,WAAW,SAAS,CAAC,OAAO,SAAS,QAAQ,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG;IACpE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC;IAC9B,GAAG,EAAE,OAAO,CAAC;CACd"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=collector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/types/collector.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export * from './collector';
2
- export * as Code from './code';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './collector';
2
- import * as Code_1 from './code';
3
- export { Code_1 as Code };
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;wBACN,QAAQ;mBAAlB,IAAI"}