@walkeros/web-destination-api 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/examples/index.js +195 -65
- package/dist/examples/index.mjs +195 -65
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +71 -26
- package/dist/index.d.ts +71 -26
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { Destination as Destination$1, SendHeaders, Mapping as Mapping$
|
|
1
|
+
import { Destination as Destination$1, SendHeaders, Mapping as Mapping$2, SendDataValue, z } from '@walkeros/core';
|
|
2
2
|
import { DestinationWeb, SendWebTransport, sendWeb } from '@walkeros/web-core';
|
|
3
|
+
import * as zod_to_json_schema from 'zod-to-json-schema';
|
|
3
4
|
|
|
4
|
-
interface Settings {
|
|
5
|
+
interface Settings$1 {
|
|
5
6
|
url: string;
|
|
6
7
|
headers?: SendHeaders;
|
|
7
8
|
method?: string;
|
|
8
9
|
transform?: Transform;
|
|
9
10
|
transport?: SendWebTransport;
|
|
10
11
|
}
|
|
11
|
-
interface Mapping {
|
|
12
|
+
interface Mapping$1 {
|
|
12
13
|
}
|
|
13
14
|
interface Env extends DestinationWeb.Env {
|
|
14
15
|
sendWeb?: typeof sendWeb;
|
|
15
16
|
}
|
|
16
|
-
type Types = Destination$1.Types<Settings, Mapping, Env>;
|
|
17
|
+
type Types = Destination$1.Types<Settings$1, Mapping$1, Env>;
|
|
17
18
|
type Destination = DestinationWeb.Destination<Types>;
|
|
18
19
|
type Config = DestinationWeb.Config<Types>;
|
|
19
|
-
type Rule = Mapping$
|
|
20
|
-
type Rules = Mapping$
|
|
21
|
-
type Transform = (data?: unknown, config?: Config, mapping?: Mapping$
|
|
20
|
+
type Rule = Mapping$2.Rule<Mapping$1>;
|
|
21
|
+
type Rules = Mapping$2.Rules<Rule>;
|
|
22
|
+
type Transform = (data?: unknown, config?: Config, mapping?: Mapping$2.Rule<Mapping$1>) => SendDataValue;
|
|
22
23
|
|
|
23
|
-
type index$
|
|
24
|
-
type index$
|
|
25
|
-
type index$
|
|
26
|
-
type index$
|
|
27
|
-
type index$
|
|
28
|
-
type index$
|
|
29
|
-
type index$
|
|
30
|
-
|
|
31
|
-
type index$
|
|
32
|
-
declare namespace index$1 {
|
|
33
|
-
export type { index$1_Config as Config, index$1_Destination as Destination, index$1_Env as Env, index$1_Mapping as Mapping, index$1_Rule as Rule, index$1_Rules as Rules, index$1_Settings as Settings, index$1_Transform as Transform, index$1_Types as Types };
|
|
24
|
+
type index$2_Config = Config;
|
|
25
|
+
type index$2_Destination = Destination;
|
|
26
|
+
type index$2_Env = Env;
|
|
27
|
+
type index$2_Rule = Rule;
|
|
28
|
+
type index$2_Rules = Rules;
|
|
29
|
+
type index$2_Transform = Transform;
|
|
30
|
+
type index$2_Types = Types;
|
|
31
|
+
declare namespace index$2 {
|
|
32
|
+
export type { index$2_Config as Config, index$2_Destination as Destination, index$2_Env as Env, Mapping$1 as Mapping, index$2_Rule as Rule, index$2_Rules as Rules, Settings$1 as Settings, index$2_Transform as Transform, index$2_Types as Types };
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
declare const init: Env | undefined;
|
|
@@ -55,19 +54,65 @@ declare const config: {
|
|
|
55
54
|
};
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
declare const
|
|
59
|
-
declare const
|
|
60
|
-
declare namespace mapping {
|
|
61
|
-
export {
|
|
57
|
+
declare const mapping$1_config: typeof config;
|
|
58
|
+
declare const mapping$1_entity_action: typeof entity_action;
|
|
59
|
+
declare namespace mapping$1 {
|
|
60
|
+
export { mapping$1_config as config, mapping$1_entity_action as entity_action };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare const index$1_env: typeof env;
|
|
64
|
+
declare const index$1_events: typeof events;
|
|
65
|
+
declare namespace index$1 {
|
|
66
|
+
export { index$1_env as env, index$1_events as events, mapping$1 as mapping };
|
|
62
67
|
}
|
|
63
68
|
|
|
64
|
-
declare const
|
|
65
|
-
|
|
69
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
70
|
+
url: z.ZodString;
|
|
71
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
72
|
+
method: z.ZodDefault<z.ZodString>;
|
|
73
|
+
transform: z.ZodOptional<z.ZodAny>;
|
|
74
|
+
transport: z.ZodDefault<z.ZodEnum<["fetch", "xhr", "beacon"]>>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
url: string;
|
|
77
|
+
method: string;
|
|
78
|
+
transport: "fetch" | "beacon" | "xhr";
|
|
79
|
+
headers?: Record<string, string> | undefined;
|
|
80
|
+
transform?: any;
|
|
81
|
+
}, {
|
|
82
|
+
url: string;
|
|
83
|
+
headers?: Record<string, string> | undefined;
|
|
84
|
+
method?: string | undefined;
|
|
85
|
+
transform?: any;
|
|
86
|
+
transport?: "fetch" | "beacon" | "xhr" | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
89
|
+
|
|
90
|
+
declare const MappingSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
91
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
92
|
+
|
|
93
|
+
declare const settings: zod_to_json_schema.JsonSchema7Type & {
|
|
94
|
+
$schema?: string | undefined;
|
|
95
|
+
definitions?: {
|
|
96
|
+
[key: string]: zod_to_json_schema.JsonSchema7Type;
|
|
97
|
+
} | undefined;
|
|
98
|
+
};
|
|
99
|
+
declare const mapping: zod_to_json_schema.JsonSchema7Type & {
|
|
100
|
+
$schema?: string | undefined;
|
|
101
|
+
definitions?: {
|
|
102
|
+
[key: string]: zod_to_json_schema.JsonSchema7Type;
|
|
103
|
+
} | undefined;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type index_Mapping = Mapping;
|
|
107
|
+
declare const index_MappingSchema: typeof MappingSchema;
|
|
108
|
+
type index_Settings = Settings;
|
|
109
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
66
110
|
declare const index_mapping: typeof mapping;
|
|
111
|
+
declare const index_settings: typeof settings;
|
|
67
112
|
declare namespace index {
|
|
68
|
-
export {
|
|
113
|
+
export { type index_Mapping as Mapping, index_MappingSchema as MappingSchema, type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_mapping as mapping, index_settings as settings };
|
|
69
114
|
}
|
|
70
115
|
|
|
71
116
|
declare const destinationAPI: Destination;
|
|
72
117
|
|
|
73
|
-
export { index$
|
|
118
|
+
export { index$2 as DestinationAPI, destinationAPI as default, destinationAPI, index$1 as examples, index as schemas };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { Destination as Destination$1, SendHeaders, Mapping as Mapping$
|
|
1
|
+
import { Destination as Destination$1, SendHeaders, Mapping as Mapping$2, SendDataValue, z } from '@walkeros/core';
|
|
2
2
|
import { DestinationWeb, SendWebTransport, sendWeb } from '@walkeros/web-core';
|
|
3
|
+
import * as zod_to_json_schema from 'zod-to-json-schema';
|
|
3
4
|
|
|
4
|
-
interface Settings {
|
|
5
|
+
interface Settings$1 {
|
|
5
6
|
url: string;
|
|
6
7
|
headers?: SendHeaders;
|
|
7
8
|
method?: string;
|
|
8
9
|
transform?: Transform;
|
|
9
10
|
transport?: SendWebTransport;
|
|
10
11
|
}
|
|
11
|
-
interface Mapping {
|
|
12
|
+
interface Mapping$1 {
|
|
12
13
|
}
|
|
13
14
|
interface Env extends DestinationWeb.Env {
|
|
14
15
|
sendWeb?: typeof sendWeb;
|
|
15
16
|
}
|
|
16
|
-
type Types = Destination$1.Types<Settings, Mapping, Env>;
|
|
17
|
+
type Types = Destination$1.Types<Settings$1, Mapping$1, Env>;
|
|
17
18
|
type Destination = DestinationWeb.Destination<Types>;
|
|
18
19
|
type Config = DestinationWeb.Config<Types>;
|
|
19
|
-
type Rule = Mapping$
|
|
20
|
-
type Rules = Mapping$
|
|
21
|
-
type Transform = (data?: unknown, config?: Config, mapping?: Mapping$
|
|
20
|
+
type Rule = Mapping$2.Rule<Mapping$1>;
|
|
21
|
+
type Rules = Mapping$2.Rules<Rule>;
|
|
22
|
+
type Transform = (data?: unknown, config?: Config, mapping?: Mapping$2.Rule<Mapping$1>) => SendDataValue;
|
|
22
23
|
|
|
23
|
-
type index$
|
|
24
|
-
type index$
|
|
25
|
-
type index$
|
|
26
|
-
type index$
|
|
27
|
-
type index$
|
|
28
|
-
type index$
|
|
29
|
-
type index$
|
|
30
|
-
|
|
31
|
-
type index$
|
|
32
|
-
declare namespace index$1 {
|
|
33
|
-
export type { index$1_Config as Config, index$1_Destination as Destination, index$1_Env as Env, index$1_Mapping as Mapping, index$1_Rule as Rule, index$1_Rules as Rules, index$1_Settings as Settings, index$1_Transform as Transform, index$1_Types as Types };
|
|
24
|
+
type index$2_Config = Config;
|
|
25
|
+
type index$2_Destination = Destination;
|
|
26
|
+
type index$2_Env = Env;
|
|
27
|
+
type index$2_Rule = Rule;
|
|
28
|
+
type index$2_Rules = Rules;
|
|
29
|
+
type index$2_Transform = Transform;
|
|
30
|
+
type index$2_Types = Types;
|
|
31
|
+
declare namespace index$2 {
|
|
32
|
+
export type { index$2_Config as Config, index$2_Destination as Destination, index$2_Env as Env, Mapping$1 as Mapping, index$2_Rule as Rule, index$2_Rules as Rules, Settings$1 as Settings, index$2_Transform as Transform, index$2_Types as Types };
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
declare const init: Env | undefined;
|
|
@@ -55,19 +54,65 @@ declare const config: {
|
|
|
55
54
|
};
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
declare const
|
|
59
|
-
declare const
|
|
60
|
-
declare namespace mapping {
|
|
61
|
-
export {
|
|
57
|
+
declare const mapping$1_config: typeof config;
|
|
58
|
+
declare const mapping$1_entity_action: typeof entity_action;
|
|
59
|
+
declare namespace mapping$1 {
|
|
60
|
+
export { mapping$1_config as config, mapping$1_entity_action as entity_action };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare const index$1_env: typeof env;
|
|
64
|
+
declare const index$1_events: typeof events;
|
|
65
|
+
declare namespace index$1 {
|
|
66
|
+
export { index$1_env as env, index$1_events as events, mapping$1 as mapping };
|
|
62
67
|
}
|
|
63
68
|
|
|
64
|
-
declare const
|
|
65
|
-
|
|
69
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
70
|
+
url: z.ZodString;
|
|
71
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
72
|
+
method: z.ZodDefault<z.ZodString>;
|
|
73
|
+
transform: z.ZodOptional<z.ZodAny>;
|
|
74
|
+
transport: z.ZodDefault<z.ZodEnum<["fetch", "xhr", "beacon"]>>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
url: string;
|
|
77
|
+
method: string;
|
|
78
|
+
transport: "fetch" | "beacon" | "xhr";
|
|
79
|
+
headers?: Record<string, string> | undefined;
|
|
80
|
+
transform?: any;
|
|
81
|
+
}, {
|
|
82
|
+
url: string;
|
|
83
|
+
headers?: Record<string, string> | undefined;
|
|
84
|
+
method?: string | undefined;
|
|
85
|
+
transform?: any;
|
|
86
|
+
transport?: "fetch" | "beacon" | "xhr" | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
89
|
+
|
|
90
|
+
declare const MappingSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
91
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
92
|
+
|
|
93
|
+
declare const settings: zod_to_json_schema.JsonSchema7Type & {
|
|
94
|
+
$schema?: string | undefined;
|
|
95
|
+
definitions?: {
|
|
96
|
+
[key: string]: zod_to_json_schema.JsonSchema7Type;
|
|
97
|
+
} | undefined;
|
|
98
|
+
};
|
|
99
|
+
declare const mapping: zod_to_json_schema.JsonSchema7Type & {
|
|
100
|
+
$schema?: string | undefined;
|
|
101
|
+
definitions?: {
|
|
102
|
+
[key: string]: zod_to_json_schema.JsonSchema7Type;
|
|
103
|
+
} | undefined;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type index_Mapping = Mapping;
|
|
107
|
+
declare const index_MappingSchema: typeof MappingSchema;
|
|
108
|
+
type index_Settings = Settings;
|
|
109
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
66
110
|
declare const index_mapping: typeof mapping;
|
|
111
|
+
declare const index_settings: typeof settings;
|
|
67
112
|
declare namespace index {
|
|
68
|
-
export {
|
|
113
|
+
export { type index_Mapping as Mapping, index_MappingSchema as MappingSchema, type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_mapping as mapping, index_settings as settings };
|
|
69
114
|
}
|
|
70
115
|
|
|
71
116
|
declare const destinationAPI: Destination;
|
|
72
117
|
|
|
73
|
-
export { index$
|
|
118
|
+
export { index$2 as DestinationAPI, destinationAPI as default, destinationAPI, index$1 as examples, index as schemas };
|