@walkeros/web-source-browser 0.2.1 → 0.3.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/index.d.mts CHANGED
@@ -1,6 +1,90 @@
1
1
  import * as _walkeros_core from '@walkeros/core';
2
- import { Elb, WalkerOS, Collector, Source } from '@walkeros/core';
2
+ import { z, Elb, WalkerOS, Collector, Source } from '@walkeros/core';
3
3
  import { DestinationWeb, SessionConfig, SessionCallback, Walker } from '@walkeros/web-core';
4
+ import * as zod_to_json_schema from 'zod-to-json-schema';
5
+
6
+ /**
7
+ * Data attribute prefix
8
+ * Used for DOM event tracking
9
+ */
10
+ declare const DataAttributePrefix: z.ZodString;
11
+ /**
12
+ * JavaScript variable name
13
+ * Used for global function names
14
+ */
15
+ declare const JavaScriptVarName: z.ZodString;
16
+ /**
17
+ * DOM scope selector
18
+ * Note: Runtime type is Element | Document (non-serializable)
19
+ */
20
+ declare const ScopeSelector: z.ZodOptional<z.ZodString>;
21
+
22
+ /**
23
+ * Browser source settings schema
24
+ */
25
+ declare const SettingsSchema: z.ZodObject<{
26
+ prefix: z.ZodDefault<z.ZodString>;
27
+ scope: z.ZodOptional<z.ZodString>;
28
+ pageview: z.ZodDefault<z.ZodBoolean>;
29
+ session: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodAny]>>;
30
+ elb: z.ZodDefault<z.ZodString>;
31
+ name: z.ZodOptional<z.ZodString>;
32
+ elbLayer: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodAny]>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ elb: string;
35
+ prefix: string;
36
+ pageview: boolean;
37
+ session?: any;
38
+ scope?: string | undefined;
39
+ name?: string | undefined;
40
+ elbLayer?: any;
41
+ }, {
42
+ session?: any;
43
+ elb?: string | undefined;
44
+ prefix?: string | undefined;
45
+ scope?: string | undefined;
46
+ pageview?: boolean | undefined;
47
+ name?: string | undefined;
48
+ elbLayer?: any;
49
+ }>;
50
+ type Settings$1 = z.infer<typeof SettingsSchema>;
51
+
52
+ /**
53
+ * Tagger configuration schema
54
+ * Used for automatic data attribute generation
55
+ */
56
+ declare const TaggerSchema: z.ZodObject<{
57
+ prefix: z.ZodDefault<z.ZodString>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ prefix: string;
60
+ }, {
61
+ prefix?: string | undefined;
62
+ }>;
63
+ type TaggerConfig$1 = z.infer<typeof TaggerSchema>;
64
+
65
+ declare const settings: zod_to_json_schema.JsonSchema7Type & {
66
+ $schema?: string | undefined;
67
+ definitions?: {
68
+ [key: string]: zod_to_json_schema.JsonSchema7Type;
69
+ } | undefined;
70
+ };
71
+ declare const tagger: zod_to_json_schema.JsonSchema7Type & {
72
+ $schema?: string | undefined;
73
+ definitions?: {
74
+ [key: string]: zod_to_json_schema.JsonSchema7Type;
75
+ } | undefined;
76
+ };
77
+
78
+ declare const index$2_DataAttributePrefix: typeof DataAttributePrefix;
79
+ declare const index$2_JavaScriptVarName: typeof JavaScriptVarName;
80
+ declare const index$2_ScopeSelector: typeof ScopeSelector;
81
+ declare const index$2_SettingsSchema: typeof SettingsSchema;
82
+ declare const index$2_TaggerSchema: typeof TaggerSchema;
83
+ declare const index$2_settings: typeof settings;
84
+ declare const index$2_tagger: typeof tagger;
85
+ declare namespace index$2 {
86
+ export { index$2_DataAttributePrefix as DataAttributePrefix, index$2_JavaScriptVarName as JavaScriptVarName, index$2_ScopeSelector as ScopeSelector, type Settings$1 as Settings, index$2_SettingsSchema as SettingsSchema, type TaggerConfig$1 as TaggerConfig, index$2_TaggerSchema as TaggerSchema, index$2_settings as settings, index$2_tagger as tagger };
87
+ }
4
88
 
5
89
  type Scope$1 = Element | Document;
6
90
  type Trigger = string;
@@ -26,20 +110,15 @@ type CommandRun<R = Promise<Elb.PushResult>> = (event: 'walker run', state?: Par
26
110
  type PushResult = Elb.PushResult;
27
111
  type Layer = Elb.Layer | IArguments;
28
112
 
29
- interface InitSettings extends Record<string, unknown> {
30
- prefix?: string;
113
+ type BaseSettings = z.infer<typeof SettingsSchema>;
114
+ interface InitSettings extends Partial<Omit<BaseSettings, 'scope' | 'session' | 'elbLayer'>> {
31
115
  scope?: Element | Document;
32
- pageview?: boolean;
33
116
  session?: boolean | SessionConfig;
34
- elb?: string;
35
117
  elbLayer?: boolean | string | Elb.Layer;
36
118
  }
37
- interface Settings extends Record<string, unknown> {
38
- prefix: string;
119
+ interface Settings extends Omit<BaseSettings, 'scope' | 'session' | 'elbLayer'> {
39
120
  scope?: Element | Document;
40
- pageview: boolean;
41
121
  session: boolean | SessionConfig;
42
- elb: string;
43
122
  elbLayer: boolean | string | Elb.Layer;
44
123
  }
45
124
  interface Mapping {
@@ -143,4 +222,4 @@ declare function createTagger(config?: TaggerConfig): (entity?: string) => Tagge
143
222
  */
144
223
  declare const sourceBrowser: Source.Init<Types>;
145
224
 
146
- export { index$1 as SourceBrowser, type TaggerConfig, type TaggerInstance, createTagger, sourceBrowser as default, index as examples, getAllEvents, getElbAttributeName, getElbValues, getEvents, getGlobals, sourceBrowser };
225
+ export { index$1 as SourceBrowser, type TaggerConfig, type TaggerInstance, createTagger, sourceBrowser as default, index as examples, getAllEvents, getElbAttributeName, getElbValues, getEvents, getGlobals, index$2 as schemas, sourceBrowser };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,90 @@
1
1
  import * as _walkeros_core from '@walkeros/core';
2
- import { Elb, WalkerOS, Collector, Source } from '@walkeros/core';
2
+ import { z, Elb, WalkerOS, Collector, Source } from '@walkeros/core';
3
3
  import { DestinationWeb, SessionConfig, SessionCallback, Walker } from '@walkeros/web-core';
4
+ import * as zod_to_json_schema from 'zod-to-json-schema';
5
+
6
+ /**
7
+ * Data attribute prefix
8
+ * Used for DOM event tracking
9
+ */
10
+ declare const DataAttributePrefix: z.ZodString;
11
+ /**
12
+ * JavaScript variable name
13
+ * Used for global function names
14
+ */
15
+ declare const JavaScriptVarName: z.ZodString;
16
+ /**
17
+ * DOM scope selector
18
+ * Note: Runtime type is Element | Document (non-serializable)
19
+ */
20
+ declare const ScopeSelector: z.ZodOptional<z.ZodString>;
21
+
22
+ /**
23
+ * Browser source settings schema
24
+ */
25
+ declare const SettingsSchema: z.ZodObject<{
26
+ prefix: z.ZodDefault<z.ZodString>;
27
+ scope: z.ZodOptional<z.ZodString>;
28
+ pageview: z.ZodDefault<z.ZodBoolean>;
29
+ session: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodAny]>>;
30
+ elb: z.ZodDefault<z.ZodString>;
31
+ name: z.ZodOptional<z.ZodString>;
32
+ elbLayer: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodAny]>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ elb: string;
35
+ prefix: string;
36
+ pageview: boolean;
37
+ session?: any;
38
+ scope?: string | undefined;
39
+ name?: string | undefined;
40
+ elbLayer?: any;
41
+ }, {
42
+ session?: any;
43
+ elb?: string | undefined;
44
+ prefix?: string | undefined;
45
+ scope?: string | undefined;
46
+ pageview?: boolean | undefined;
47
+ name?: string | undefined;
48
+ elbLayer?: any;
49
+ }>;
50
+ type Settings$1 = z.infer<typeof SettingsSchema>;
51
+
52
+ /**
53
+ * Tagger configuration schema
54
+ * Used for automatic data attribute generation
55
+ */
56
+ declare const TaggerSchema: z.ZodObject<{
57
+ prefix: z.ZodDefault<z.ZodString>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ prefix: string;
60
+ }, {
61
+ prefix?: string | undefined;
62
+ }>;
63
+ type TaggerConfig$1 = z.infer<typeof TaggerSchema>;
64
+
65
+ declare const settings: zod_to_json_schema.JsonSchema7Type & {
66
+ $schema?: string | undefined;
67
+ definitions?: {
68
+ [key: string]: zod_to_json_schema.JsonSchema7Type;
69
+ } | undefined;
70
+ };
71
+ declare const tagger: zod_to_json_schema.JsonSchema7Type & {
72
+ $schema?: string | undefined;
73
+ definitions?: {
74
+ [key: string]: zod_to_json_schema.JsonSchema7Type;
75
+ } | undefined;
76
+ };
77
+
78
+ declare const index$2_DataAttributePrefix: typeof DataAttributePrefix;
79
+ declare const index$2_JavaScriptVarName: typeof JavaScriptVarName;
80
+ declare const index$2_ScopeSelector: typeof ScopeSelector;
81
+ declare const index$2_SettingsSchema: typeof SettingsSchema;
82
+ declare const index$2_TaggerSchema: typeof TaggerSchema;
83
+ declare const index$2_settings: typeof settings;
84
+ declare const index$2_tagger: typeof tagger;
85
+ declare namespace index$2 {
86
+ export { index$2_DataAttributePrefix as DataAttributePrefix, index$2_JavaScriptVarName as JavaScriptVarName, index$2_ScopeSelector as ScopeSelector, type Settings$1 as Settings, index$2_SettingsSchema as SettingsSchema, type TaggerConfig$1 as TaggerConfig, index$2_TaggerSchema as TaggerSchema, index$2_settings as settings, index$2_tagger as tagger };
87
+ }
4
88
 
5
89
  type Scope$1 = Element | Document;
6
90
  type Trigger = string;
@@ -26,20 +110,15 @@ type CommandRun<R = Promise<Elb.PushResult>> = (event: 'walker run', state?: Par
26
110
  type PushResult = Elb.PushResult;
27
111
  type Layer = Elb.Layer | IArguments;
28
112
 
29
- interface InitSettings extends Record<string, unknown> {
30
- prefix?: string;
113
+ type BaseSettings = z.infer<typeof SettingsSchema>;
114
+ interface InitSettings extends Partial<Omit<BaseSettings, 'scope' | 'session' | 'elbLayer'>> {
31
115
  scope?: Element | Document;
32
- pageview?: boolean;
33
116
  session?: boolean | SessionConfig;
34
- elb?: string;
35
117
  elbLayer?: boolean | string | Elb.Layer;
36
118
  }
37
- interface Settings extends Record<string, unknown> {
38
- prefix: string;
119
+ interface Settings extends Omit<BaseSettings, 'scope' | 'session' | 'elbLayer'> {
39
120
  scope?: Element | Document;
40
- pageview: boolean;
41
121
  session: boolean | SessionConfig;
42
- elb: string;
43
122
  elbLayer: boolean | string | Elb.Layer;
44
123
  }
45
124
  interface Mapping {
@@ -143,4 +222,4 @@ declare function createTagger(config?: TaggerConfig): (entity?: string) => Tagge
143
222
  */
144
223
  declare const sourceBrowser: Source.Init<Types>;
145
224
 
146
- export { index$1 as SourceBrowser, type TaggerConfig, type TaggerInstance, createTagger, sourceBrowser as default, index as examples, getAllEvents, getElbAttributeName, getElbValues, getEvents, getGlobals, sourceBrowser };
225
+ export { index$1 as SourceBrowser, type TaggerConfig, type TaggerInstance, createTagger, sourceBrowser as default, index as examples, getAllEvents, getElbAttributeName, getElbValues, getEvents, getGlobals, index$2 as schemas, sourceBrowser };