@interfere/types 10.1.2 → 10.2.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/data/frame.cjs +1 -1
- package/dist/data/frame.d.cts +6 -7
- package/dist/data/frame.d.mts +6 -7
- package/dist/data/frame.mjs +1 -1
- package/dist/data/session.cjs +1 -1
- package/dist/data/session.d.cts +3 -4
- package/dist/data/session.d.mts +3 -4
- package/dist/data/session.mjs +1 -1
- package/dist/data/source-map-batch.cjs +1 -0
- package/dist/data/source-map-batch.d.cts +4 -0
- package/dist/data/source-map-batch.d.mts +4 -0
- package/dist/data/source-map-batch.mjs +1 -0
- package/dist/data/source-map-diagnostics.cjs +1 -0
- package/dist/data/source-map-diagnostics.d.cts +49 -0
- package/dist/data/source-map-diagnostics.d.mts +49 -0
- package/dist/data/source-map-diagnostics.mjs +1 -0
- package/dist/data/source-map-status.cjs +1 -0
- package/dist/data/source-map-status.d.cts +65 -0
- package/dist/data/source-map-status.d.mts +65 -0
- package/dist/data/source-map-status.mjs +1 -0
- package/dist/data/source-map-upload-batch.cjs +1 -0
- package/dist/data/source-map-upload-batch.d.cts +22 -0
- package/dist/data/source-map-upload-batch.d.mts +22 -0
- package/dist/data/source-map-upload-batch.mjs +1 -0
- package/dist/data/source-maps.cjs +1 -1
- package/dist/data/source-maps.d.cts +73 -63
- package/dist/data/source-maps.d.mts +73 -63
- package/dist/data/source-maps.mjs +1 -1
- package/dist/events/error.cjs +1 -1
- package/dist/events/error.d.cts +118 -111
- package/dist/events/error.d.mts +118 -111
- package/dist/events/error.mjs +1 -1
- package/dist/events/pageleave.cjs +1 -1
- package/dist/events/pageleave.d.cts +5 -6
- package/dist/events/pageleave.d.mts +5 -6
- package/dist/events/pageleave.mjs +1 -1
- package/dist/events/pageview.cjs +1 -1
- package/dist/events/pageview.d.cts +6 -7
- package/dist/events/pageview.d.mts +6 -7
- package/dist/events/pageview.mjs +1 -1
- package/dist/integrations/index.cjs +1 -1
- package/dist/integrations/index.d.cts +62 -63
- package/dist/integrations/index.d.mts +62 -63
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/platforms/cli.cjs +1 -1
- package/dist/integrations/platforms/cli.d.cts +3 -4
- package/dist/integrations/platforms/cli.d.mts +3 -4
- package/dist/integrations/platforms/cli.mjs +1 -1
- package/dist/integrations/platforms/cloudflare.cjs +1 -1
- package/dist/integrations/platforms/cloudflare.d.cts +12 -13
- package/dist/integrations/platforms/cloudflare.d.mts +12 -13
- package/dist/integrations/platforms/cloudflare.mjs +1 -1
- package/dist/integrations/platforms/github.cjs +1 -1
- package/dist/integrations/platforms/github.d.cts +30 -31
- package/dist/integrations/platforms/github.d.mts +30 -31
- package/dist/integrations/platforms/github.mjs +1 -1
- package/dist/integrations/platforms/slack.cjs +1 -1
- package/dist/integrations/platforms/slack.d.cts +7 -8
- package/dist/integrations/platforms/slack.d.mts +7 -8
- package/dist/integrations/platforms/slack.mjs +1 -1
- package/dist/integrations/platforms/vercel.cjs +1 -1
- package/dist/integrations/platforms/vercel.d.cts +12 -13
- package/dist/integrations/platforms/vercel.d.mts +12 -13
- package/dist/integrations/platforms/vercel.mjs +1 -1
- package/dist/releases/build-telemetry.d.cts +8 -9
- package/dist/releases/build-telemetry.d.mts +8 -9
- package/dist/releases/definition.cjs +1 -1
- package/dist/releases/definition.d.cts +48 -49
- package/dist/releases/definition.d.mts +48 -49
- package/dist/releases/definition.mjs +1 -1
- package/dist/releases/slug.d.cts +5 -6
- package/dist/releases/slug.d.mts +5 -6
- package/dist/sdk/build-config.cjs +1 -0
- package/dist/sdk/build-config.d.cts +22 -0
- package/dist/sdk/build-config.d.mts +22 -0
- package/dist/sdk/build-config.mjs +1 -0
- package/dist/sdk/build-diagnostics.cjs +1 -1
- package/dist/sdk/build-diagnostics.d.cts +11 -12
- package/dist/sdk/build-diagnostics.d.mts +11 -12
- package/dist/sdk/build-diagnostics.mjs +1 -1
- package/dist/sdk/cli-destination.cjs +1 -1
- package/dist/sdk/cli-destination.d.cts +7 -4
- package/dist/sdk/cli-destination.d.mts +7 -4
- package/dist/sdk/cli-destination.mjs +1 -1
- package/dist/sdk/deploy-environment.cjs +1 -1
- package/dist/sdk/deploy-environment.d.cts +28 -6
- package/dist/sdk/deploy-environment.d.mts +28 -6
- package/dist/sdk/deploy-environment.mjs +1 -1
- package/dist/sdk/env.d.cts +3 -4
- package/dist/sdk/env.d.mts +3 -4
- package/dist/sdk/envelope.cjs +1 -1
- package/dist/sdk/envelope.d.cts +129 -130
- package/dist/sdk/envelope.d.mts +129 -130
- package/dist/sdk/envelope.mjs +1 -1
- package/dist/sdk/errors.cjs +2 -2
- package/dist/sdk/errors.d.cts +70 -28
- package/dist/sdk/errors.d.mts +70 -28
- package/dist/sdk/errors.mjs +2 -2
- package/dist/sdk/geo.cjs +1 -1
- package/dist/sdk/geo.d.cts +4 -5
- package/dist/sdk/geo.d.mts +4 -5
- package/dist/sdk/geo.mjs +1 -1
- package/dist/sdk/github-source.cjs +1 -1
- package/dist/sdk/github-source.d.cts +9 -9
- package/dist/sdk/github-source.d.mts +9 -9
- package/dist/sdk/github-source.mjs +1 -1
- package/dist/sdk/identify.cjs +1 -1
- package/dist/sdk/identify.d.cts +13 -14
- package/dist/sdk/identify.d.mts +13 -14
- package/dist/sdk/identify.mjs +1 -1
- package/dist/sdk/injected-globals.d.cts +9 -10
- package/dist/sdk/injected-globals.d.mts +9 -10
- package/dist/sdk/log-sourcing.cjs +1 -1
- package/dist/sdk/log-sourcing.d.cts +9 -10
- package/dist/sdk/log-sourcing.d.mts +9 -10
- package/dist/sdk/log-sourcing.mjs +1 -1
- package/dist/sdk/plugins/context/browser.cjs +1 -1
- package/dist/sdk/plugins/context/browser.d.cts +17 -18
- package/dist/sdk/plugins/context/browser.d.mts +17 -18
- package/dist/sdk/plugins/context/browser.mjs +1 -1
- package/dist/sdk/plugins/context/edge.cjs +1 -1
- package/dist/sdk/plugins/context/edge.d.cts +3 -4
- package/dist/sdk/plugins/context/edge.d.mts +3 -4
- package/dist/sdk/plugins/context/edge.mjs +1 -1
- package/dist/sdk/plugins/context/next.cjs +1 -1
- package/dist/sdk/plugins/context/next.d.cts +8 -9
- package/dist/sdk/plugins/context/next.d.mts +8 -9
- package/dist/sdk/plugins/context/next.mjs +1 -1
- package/dist/sdk/plugins/context/node.cjs +1 -1
- package/dist/sdk/plugins/context/node.d.cts +3 -4
- package/dist/sdk/plugins/context/node.d.mts +3 -4
- package/dist/sdk/plugins/context/node.mjs +1 -1
- package/dist/sdk/plugins/manifest.d.cts +8 -9
- package/dist/sdk/plugins/manifest.d.mts +8 -9
- package/dist/sdk/plugins/payload/errors.cjs +1 -1
- package/dist/sdk/plugins/payload/errors.d.cts +23 -24
- package/dist/sdk/plugins/payload/errors.d.mts +23 -24
- package/dist/sdk/plugins/payload/errors.mjs +1 -1
- package/dist/sdk/plugins/payload/page-events.cjs +1 -1
- package/dist/sdk/plugins/payload/page-events.d.cts +9 -10
- package/dist/sdk/plugins/payload/page-events.d.mts +9 -10
- package/dist/sdk/plugins/payload/page-events.mjs +1 -1
- package/dist/sdk/plugins/payload/rage-click.cjs +1 -1
- package/dist/sdk/plugins/payload/rage-click.d.cts +5 -6
- package/dist/sdk/plugins/payload/rage-click.d.mts +5 -6
- package/dist/sdk/plugins/payload/rage-click.mjs +1 -1
- package/dist/sdk/plugins/payload/replay.cjs +1 -1
- package/dist/sdk/plugins/payload/replay.d.cts +4 -5
- package/dist/sdk/plugins/payload/replay.d.mts +4 -5
- package/dist/sdk/plugins/payload/replay.mjs +1 -1
- package/dist/sdk/remote-config.cjs +1 -1
- package/dist/sdk/remote-config.d.cts +43 -20
- package/dist/sdk/remote-config.d.mts +43 -20
- package/dist/sdk/remote-config.mjs +1 -1
- package/dist/sdk/runtime.cjs +1 -1
- package/dist/sdk/runtime.d.cts +11 -12
- package/dist/sdk/runtime.d.mts +11 -12
- package/dist/sdk/runtime.mjs +1 -1
- package/dist/sdk/server-tracing.cjs +1 -1
- package/dist/sdk/server-tracing.d.cts +9 -10
- package/dist/sdk/server-tracing.d.mts +9 -10
- package/dist/sdk/server-tracing.mjs +1 -1
- package/dist/sdk/source-map-richness.cjs +1 -0
- package/dist/sdk/source-map-richness.d.cts +9 -0
- package/dist/sdk/source-map-richness.d.mts +9 -0
- package/dist/sdk/source-map-richness.mjs +1 -0
- package/dist/sdk/trace-freshness.cjs +1 -0
- package/dist/sdk/trace-freshness.d.cts +6 -0
- package/dist/sdk/trace-freshness.d.mts +6 -0
- package/dist/sdk/trace-freshness.mjs +1 -0
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/sdk/plugins/manifest.d.ts
|
|
2
|
-
declare const CONSENT_CATEGORIES: readonly ["necessary", "analytics", "replay"];
|
|
2
|
+
export declare const CONSENT_CATEGORIES: readonly ["necessary", "analytics", "replay"];
|
|
3
3
|
type AtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<T>; }[keyof T];
|
|
4
|
-
declare const PLUGIN_MANIFEST: readonly [{
|
|
4
|
+
export declare const PLUGIN_MANIFEST: readonly [{
|
|
5
5
|
readonly consentCategory: "necessary";
|
|
6
6
|
readonly defaultEnabled: true;
|
|
7
7
|
readonly events: readonly [{
|
|
@@ -50,10 +50,9 @@ declare const PLUGIN_MANIFEST: readonly [{
|
|
|
50
50
|
readonly events: readonly [];
|
|
51
51
|
readonly name: "logs";
|
|
52
52
|
}];
|
|
53
|
-
type PluginManifest = typeof PLUGIN_MANIFEST;
|
|
54
|
-
type ConsentCategory = (typeof CONSENT_CATEGORIES)[number];
|
|
55
|
-
type PluginKey = PluginManifest[number]["name"];
|
|
56
|
-
type GateableCategory = Exclude<ConsentCategory, "necessary">;
|
|
57
|
-
type ConsentState = AtLeastOne<Record<GateableCategory, boolean>>;
|
|
58
|
-
//#endregion
|
|
59
|
-
export { CONSENT_CATEGORIES, ConsentCategory, ConsentState, GateableCategory, PLUGIN_MANIFEST, PluginKey, PluginManifest };
|
|
53
|
+
export type PluginManifest = typeof PLUGIN_MANIFEST;
|
|
54
|
+
export type ConsentCategory = (typeof CONSENT_CATEGORIES)[number];
|
|
55
|
+
export type PluginKey = PluginManifest[number]["name"];
|
|
56
|
+
export type GateableCategory = Exclude<ConsentCategory, "necessary">;
|
|
57
|
+
export type ConsentState = AtLeastOne<Record<GateableCategory, boolean>>;
|
|
58
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const errorSourceSchema=zod.z.enum([`client`,`server`,`edge`]).meta({id:`ErrorSource`,title:`ErrorSource`}),errorMechanismSchema=zod.z.object({
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const errorSourceSchema=zod.z.enum([`client`,`server`,`edge`]).meta({id:`ErrorSource`,title:`ErrorSource`}),errorMechanismSchema=zod.z.object({handled:zod.z.boolean(),synthetic:zod.z.boolean().optional(),type:zod.z.string()}).meta({description:`How the exception was captured by the SDK.`,id:`ErrorMechanism`,title:`ErrorMechanism`}),errorExceptionSchema=zod.z.object({kind:zod.z.literal(`error`),mechanism:errorMechanismSchema.optional(),stack:zod.z.string(),type:zod.z.string(),value:zod.z.string()}),nonErrorExceptionSchema=zod.z.object({kind:zod.z.literal(`non-error`),mechanism:errorMechanismSchema.optional(),serialized:zod.z.unknown(),type:zod.z.string(),value:zod.z.string()}),exceptionValueSchema=zod.z.union([errorExceptionSchema,nonErrorExceptionSchema]).meta({description:"A single exception. Error-shaped exceptions carry the raw `error.stack` string; non-Error rejections (e.g. `Promise.reject({ code: 401 })`) carry the structured payload as `serialized` instead.",id:`Exception`,title:`Exception`}),errorEnvelopePayloadSchema=zod.z.object({errorDigest:zod.z.string().optional(),exceptions:zod.z.array(exceptionValueSchema).min(1)}).meta({description:`Payload for an error envelope.`,id:`ErrorPayload`,title:`ErrorPayload`});exports.errorEnvelopePayloadSchema=errorEnvelopePayloadSchema,exports.errorMechanismSchema=errorMechanismSchema,exports.errorSourceSchema=errorSourceSchema,exports.exceptionValueSchema=exceptionValueSchema;
|
|
@@ -1,63 +1,62 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/errors.d.ts
|
|
3
|
-
declare const errorSourceSchema: z.ZodEnum<{
|
|
3
|
+
export declare const errorSourceSchema: z.ZodEnum<{
|
|
4
4
|
client: "client";
|
|
5
5
|
edge: "edge";
|
|
6
6
|
server: "server";
|
|
7
7
|
}>;
|
|
8
|
-
type ErrorSource = z.infer<typeof errorSourceSchema>;
|
|
9
|
-
declare const errorMechanismSchema: z.ZodObject<{
|
|
10
|
-
type: z.ZodString;
|
|
8
|
+
export type ErrorSource = z.infer<typeof errorSourceSchema>;
|
|
9
|
+
export declare const errorMechanismSchema: z.ZodObject<{
|
|
11
10
|
handled: z.ZodBoolean;
|
|
12
11
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
type: z.ZodString;
|
|
13
13
|
}, z.core.$strip>;
|
|
14
|
-
type ErrorMechanism = z.infer<typeof errorMechanismSchema>;
|
|
15
|
-
declare const exceptionValueSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
14
|
+
export type ErrorMechanism = z.infer<typeof errorMechanismSchema>;
|
|
15
|
+
export declare const exceptionValueSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
16
16
|
kind: z.ZodLiteral<"error">;
|
|
17
|
-
type: z.ZodString;
|
|
18
|
-
value: z.ZodString;
|
|
19
17
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
20
|
-
type: z.ZodString;
|
|
21
18
|
handled: z.ZodBoolean;
|
|
22
19
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
type: z.ZodString;
|
|
23
21
|
}, z.core.$strip>>;
|
|
24
22
|
stack: z.ZodString;
|
|
25
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
-
kind: z.ZodLiteral<"non-error">;
|
|
27
23
|
type: z.ZodString;
|
|
28
24
|
value: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
kind: z.ZodLiteral<"non-error">;
|
|
29
27
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
30
|
-
type: z.ZodString;
|
|
31
28
|
handled: z.ZodBoolean;
|
|
32
29
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
type: z.ZodString;
|
|
33
31
|
}, z.core.$strip>>;
|
|
34
32
|
serialized: z.ZodUnknown;
|
|
33
|
+
type: z.ZodString;
|
|
34
|
+
value: z.ZodString;
|
|
35
35
|
}, z.core.$strip>]>;
|
|
36
|
-
type ExceptionValue = z.infer<typeof exceptionValueSchema>;
|
|
37
|
-
declare const errorEnvelopePayloadSchema: z.ZodObject<{
|
|
36
|
+
export type ExceptionValue = z.infer<typeof exceptionValueSchema>;
|
|
37
|
+
export declare const errorEnvelopePayloadSchema: z.ZodObject<{
|
|
38
|
+
errorDigest: z.ZodOptional<z.ZodString>;
|
|
38
39
|
exceptions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
39
40
|
kind: z.ZodLiteral<"error">;
|
|
40
|
-
type: z.ZodString;
|
|
41
|
-
value: z.ZodString;
|
|
42
41
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
43
|
-
type: z.ZodString;
|
|
44
42
|
handled: z.ZodBoolean;
|
|
45
43
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
type: z.ZodString;
|
|
46
45
|
}, z.core.$strip>>;
|
|
47
46
|
stack: z.ZodString;
|
|
48
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
-
kind: z.ZodLiteral<"non-error">;
|
|
50
47
|
type: z.ZodString;
|
|
51
48
|
value: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"non-error">;
|
|
52
51
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
53
|
-
type: z.ZodString;
|
|
54
52
|
handled: z.ZodBoolean;
|
|
55
53
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
type: z.ZodString;
|
|
56
55
|
}, z.core.$strip>>;
|
|
57
56
|
serialized: z.ZodUnknown;
|
|
57
|
+
type: z.ZodString;
|
|
58
|
+
value: z.ZodString;
|
|
58
59
|
}, z.core.$strip>]>>;
|
|
59
|
-
errorDigest: z.ZodOptional<z.ZodString>;
|
|
60
60
|
}, z.core.$strip>;
|
|
61
|
-
type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { ErrorEnvelopePayload, ErrorMechanism, ErrorSource, ExceptionValue, errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
|
|
61
|
+
export type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;
|
|
62
|
+
//#endregion
|
|
@@ -1,63 +1,62 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/errors.d.ts
|
|
3
|
-
declare const errorSourceSchema: z.ZodEnum<{
|
|
3
|
+
export declare const errorSourceSchema: z.ZodEnum<{
|
|
4
4
|
client: "client";
|
|
5
5
|
edge: "edge";
|
|
6
6
|
server: "server";
|
|
7
7
|
}>;
|
|
8
|
-
type ErrorSource = z.infer<typeof errorSourceSchema>;
|
|
9
|
-
declare const errorMechanismSchema: z.ZodObject<{
|
|
10
|
-
type: z.ZodString;
|
|
8
|
+
export type ErrorSource = z.infer<typeof errorSourceSchema>;
|
|
9
|
+
export declare const errorMechanismSchema: z.ZodObject<{
|
|
11
10
|
handled: z.ZodBoolean;
|
|
12
11
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
type: z.ZodString;
|
|
13
13
|
}, z.core.$strip>;
|
|
14
|
-
type ErrorMechanism = z.infer<typeof errorMechanismSchema>;
|
|
15
|
-
declare const exceptionValueSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
14
|
+
export type ErrorMechanism = z.infer<typeof errorMechanismSchema>;
|
|
15
|
+
export declare const exceptionValueSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
16
16
|
kind: z.ZodLiteral<"error">;
|
|
17
|
-
type: z.ZodString;
|
|
18
|
-
value: z.ZodString;
|
|
19
17
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
20
|
-
type: z.ZodString;
|
|
21
18
|
handled: z.ZodBoolean;
|
|
22
19
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
type: z.ZodString;
|
|
23
21
|
}, z.core.$strip>>;
|
|
24
22
|
stack: z.ZodString;
|
|
25
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
-
kind: z.ZodLiteral<"non-error">;
|
|
27
23
|
type: z.ZodString;
|
|
28
24
|
value: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
kind: z.ZodLiteral<"non-error">;
|
|
29
27
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
30
|
-
type: z.ZodString;
|
|
31
28
|
handled: z.ZodBoolean;
|
|
32
29
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
type: z.ZodString;
|
|
33
31
|
}, z.core.$strip>>;
|
|
34
32
|
serialized: z.ZodUnknown;
|
|
33
|
+
type: z.ZodString;
|
|
34
|
+
value: z.ZodString;
|
|
35
35
|
}, z.core.$strip>]>;
|
|
36
|
-
type ExceptionValue = z.infer<typeof exceptionValueSchema>;
|
|
37
|
-
declare const errorEnvelopePayloadSchema: z.ZodObject<{
|
|
36
|
+
export type ExceptionValue = z.infer<typeof exceptionValueSchema>;
|
|
37
|
+
export declare const errorEnvelopePayloadSchema: z.ZodObject<{
|
|
38
|
+
errorDigest: z.ZodOptional<z.ZodString>;
|
|
38
39
|
exceptions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
39
40
|
kind: z.ZodLiteral<"error">;
|
|
40
|
-
type: z.ZodString;
|
|
41
|
-
value: z.ZodString;
|
|
42
41
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
43
|
-
type: z.ZodString;
|
|
44
42
|
handled: z.ZodBoolean;
|
|
45
43
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
type: z.ZodString;
|
|
46
45
|
}, z.core.$strip>>;
|
|
47
46
|
stack: z.ZodString;
|
|
48
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
-
kind: z.ZodLiteral<"non-error">;
|
|
50
47
|
type: z.ZodString;
|
|
51
48
|
value: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"non-error">;
|
|
52
51
|
mechanism: z.ZodOptional<z.ZodObject<{
|
|
53
|
-
type: z.ZodString;
|
|
54
52
|
handled: z.ZodBoolean;
|
|
55
53
|
synthetic: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
type: z.ZodString;
|
|
56
55
|
}, z.core.$strip>>;
|
|
57
56
|
serialized: z.ZodUnknown;
|
|
57
|
+
type: z.ZodString;
|
|
58
|
+
value: z.ZodString;
|
|
58
59
|
}, z.core.$strip>]>>;
|
|
59
|
-
errorDigest: z.ZodOptional<z.ZodString>;
|
|
60
60
|
}, z.core.$strip>;
|
|
61
|
-
type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { ErrorEnvelopePayload, ErrorMechanism, ErrorSource, ExceptionValue, errorEnvelopePayloadSchema, errorMechanismSchema, errorSourceSchema, exceptionValueSchema };
|
|
61
|
+
export type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;
|
|
62
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const errorSourceSchema=z.enum([`client`,`server`,`edge`]).meta({id:`ErrorSource`,title:`ErrorSource`}),errorMechanismSchema=z.object({
|
|
1
|
+
import{z}from"zod";const errorSourceSchema=z.enum([`client`,`server`,`edge`]).meta({id:`ErrorSource`,title:`ErrorSource`}),errorMechanismSchema=z.object({handled:z.boolean(),synthetic:z.boolean().optional(),type:z.string()}).meta({description:`How the exception was captured by the SDK.`,id:`ErrorMechanism`,title:`ErrorMechanism`}),errorExceptionSchema=z.object({kind:z.literal(`error`),mechanism:errorMechanismSchema.optional(),stack:z.string(),type:z.string(),value:z.string()}),nonErrorExceptionSchema=z.object({kind:z.literal(`non-error`),mechanism:errorMechanismSchema.optional(),serialized:z.unknown(),type:z.string(),value:z.string()}),exceptionValueSchema=z.union([errorExceptionSchema,nonErrorExceptionSchema]).meta({description:"A single exception. Error-shaped exceptions carry the raw `error.stack` string; non-Error rejections (e.g. `Promise.reject({ code: 401 })`) carry the structured payload as `serialized` instead.",id:`Exception`,title:`Exception`}),errorEnvelopePayloadSchema=z.object({errorDigest:z.string().optional(),exceptions:z.array(exceptionValueSchema).min(1)}).meta({description:`Payload for an error envelope.`,id:`ErrorPayload`,title:`ErrorPayload`});export{errorEnvelopePayloadSchema,errorMechanismSchema,errorSourceSchema,exceptionValueSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const uiEventPayloadSchema=zod.z.object({event:zod.z.record(zod.z.string(),zod.z.unknown())}).meta({
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const uiEventPayloadSchema=zod.z.object({event:zod.z.record(zod.z.string(),zod.z.unknown())}).meta({description:`Payload for a UI event envelope.`,id:`UiEventPayload`,title:`UiEventPayload`}),pageviewPayloadSchema=zod.z.object({title:zod.z.string().optional(),url:zod.z.url()}).meta({description:`Payload for a pageview envelope.`,id:`PageviewPayload`,title:`PageviewPayload`}),pageleavePayloadSchema=zod.z.object({durationMs:zod.z.number().optional(),url:zod.z.url()}).meta({description:`Payload for a pageleave envelope.`,id:`PageleavePayload`,title:`PageleavePayload`});exports.pageleavePayloadSchema=pageleavePayloadSchema,exports.pageviewPayloadSchema=pageviewPayloadSchema,exports.uiEventPayloadSchema=uiEventPayloadSchema;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/page-events.d.ts
|
|
3
|
-
declare const uiEventPayloadSchema: z.ZodObject<{
|
|
3
|
+
export declare const uiEventPayloadSchema: z.ZodObject<{
|
|
4
4
|
event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;
|
|
7
|
-
declare const pageviewPayloadSchema: z.ZodObject<{
|
|
8
|
-
url: z.ZodURL;
|
|
6
|
+
export type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;
|
|
7
|
+
export declare const pageviewPayloadSchema: z.ZodObject<{
|
|
9
8
|
title: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;
|
|
12
|
-
declare const pageleavePayloadSchema: z.ZodObject<{
|
|
13
9
|
url: z.ZodURL;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;
|
|
12
|
+
export declare const pageleavePayloadSchema: z.ZodObject<{
|
|
14
13
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
url: z.ZodURL;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
|
-
type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { PageleavePayload, PageviewPayload, UiEventPayload, pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
|
|
16
|
+
export type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;
|
|
17
|
+
//#endregion
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/page-events.d.ts
|
|
3
|
-
declare const uiEventPayloadSchema: z.ZodObject<{
|
|
3
|
+
export declare const uiEventPayloadSchema: z.ZodObject<{
|
|
4
4
|
event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;
|
|
7
|
-
declare const pageviewPayloadSchema: z.ZodObject<{
|
|
8
|
-
url: z.ZodURL;
|
|
6
|
+
export type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;
|
|
7
|
+
export declare const pageviewPayloadSchema: z.ZodObject<{
|
|
9
8
|
title: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;
|
|
12
|
-
declare const pageleavePayloadSchema: z.ZodObject<{
|
|
13
9
|
url: z.ZodURL;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;
|
|
12
|
+
export declare const pageleavePayloadSchema: z.ZodObject<{
|
|
14
13
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
url: z.ZodURL;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
|
-
type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { PageleavePayload, PageviewPayload, UiEventPayload, pageleavePayloadSchema, pageviewPayloadSchema, uiEventPayloadSchema };
|
|
16
|
+
export type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;
|
|
17
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const uiEventPayloadSchema=z.object({event:z.record(z.string(),z.unknown())}).meta({
|
|
1
|
+
import{z}from"zod";const uiEventPayloadSchema=z.object({event:z.record(z.string(),z.unknown())}).meta({description:`Payload for a UI event envelope.`,id:`UiEventPayload`,title:`UiEventPayload`}),pageviewPayloadSchema=z.object({title:z.string().optional(),url:z.url()}).meta({description:`Payload for a pageview envelope.`,id:`PageviewPayload`,title:`PageviewPayload`}),pageleavePayloadSchema=z.object({durationMs:z.number().optional(),url:z.url()}).meta({description:`Payload for a pageleave envelope.`,id:`PageleavePayload`,title:`PageleavePayload`});export{pageleavePayloadSchema,pageviewPayloadSchema,uiEventPayloadSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const rageClickPayloadSchema=zod.z.object({count:zod.z.number(),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const rageClickPayloadSchema=zod.z.object({count:zod.z.number(),selector:zod.z.string(),text:zod.z.string(),timeWindow:zod.z.number(),timestamp:zod.z.number(),x:zod.z.number(),y:zod.z.number()}).meta({description:`Payload for a rage-click envelope.`,id:`RageClickPayload`,title:`RageClickPayload`});exports.rageClickPayloadSchema=rageClickPayloadSchema;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/rage-click.d.ts
|
|
3
|
-
declare const rageClickPayloadSchema: z.ZodObject<{
|
|
3
|
+
export declare const rageClickPayloadSchema: z.ZodObject<{
|
|
4
4
|
count: z.ZodNumber;
|
|
5
|
-
timeWindow: z.ZodNumber;
|
|
6
5
|
selector: z.ZodString;
|
|
7
6
|
text: z.ZodString;
|
|
7
|
+
timeWindow: z.ZodNumber;
|
|
8
|
+
timestamp: z.ZodNumber;
|
|
8
9
|
x: z.ZodNumber;
|
|
9
10
|
y: z.ZodNumber;
|
|
10
|
-
timestamp: z.ZodNumber;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
|
-
type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { RageClickPayload, rageClickPayloadSchema };
|
|
12
|
+
export type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;
|
|
13
|
+
//#endregion
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/rage-click.d.ts
|
|
3
|
-
declare const rageClickPayloadSchema: z.ZodObject<{
|
|
3
|
+
export declare const rageClickPayloadSchema: z.ZodObject<{
|
|
4
4
|
count: z.ZodNumber;
|
|
5
|
-
timeWindow: z.ZodNumber;
|
|
6
5
|
selector: z.ZodString;
|
|
7
6
|
text: z.ZodString;
|
|
7
|
+
timeWindow: z.ZodNumber;
|
|
8
|
+
timestamp: z.ZodNumber;
|
|
8
9
|
x: z.ZodNumber;
|
|
9
10
|
y: z.ZodNumber;
|
|
10
|
-
timestamp: z.ZodNumber;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
|
-
type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { RageClickPayload, rageClickPayloadSchema };
|
|
12
|
+
export type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;
|
|
13
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const rageClickPayloadSchema=z.object({count:z.number(),
|
|
1
|
+
import{z}from"zod";const rageClickPayloadSchema=z.object({count:z.number(),selector:z.string(),text:z.string(),timeWindow:z.number(),timestamp:z.number(),x:z.number(),y:z.number()}).meta({description:`Payload for a rage-click envelope.`,id:`RageClickPayload`,title:`RageClickPayload`});export{rageClickPayloadSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const replayChunkPayloadSchema=zod.z.object({
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const replayChunkPayloadSchema=zod.z.object({count:zod.z.number(),events:zod.z.array(zod.z.string()),first_event_ts:zod.z.number().optional(),last_event_ts:zod.z.number().optional(),ts:zod.z.number()}).meta({description:`Payload for a replay-chunk envelope.`,id:`ReplayChunkPayload`,title:`ReplayChunkPayload`});exports.replayChunkPayloadSchema=replayChunkPayloadSchema;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/replay.d.ts
|
|
3
|
-
declare const replayChunkPayloadSchema: z.ZodObject<{
|
|
4
|
-
ts: z.ZodNumber;
|
|
3
|
+
export declare const replayChunkPayloadSchema: z.ZodObject<{
|
|
5
4
|
count: z.ZodNumber;
|
|
6
5
|
events: z.ZodArray<z.ZodString>;
|
|
7
6
|
first_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
8
7
|
last_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
ts: z.ZodNumber;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
|
-
type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { ReplayChunkPayload, replayChunkPayloadSchema };
|
|
10
|
+
export type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;
|
|
11
|
+
//#endregion
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/sdk/plugins/payload/replay.d.ts
|
|
3
|
-
declare const replayChunkPayloadSchema: z.ZodObject<{
|
|
4
|
-
ts: z.ZodNumber;
|
|
3
|
+
export declare const replayChunkPayloadSchema: z.ZodObject<{
|
|
5
4
|
count: z.ZodNumber;
|
|
6
5
|
events: z.ZodArray<z.ZodString>;
|
|
7
6
|
first_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
8
7
|
last_event_ts: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
ts: z.ZodNumber;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
|
-
type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { ReplayChunkPayload, replayChunkPayloadSchema };
|
|
10
|
+
export type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;
|
|
11
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"zod";const replayChunkPayloadSchema=z.object({
|
|
1
|
+
import{z}from"zod";const replayChunkPayloadSchema=z.object({count:z.number(),events:z.array(z.string()),first_event_ts:z.number().optional(),last_event_ts:z.number().optional(),ts:z.number()}).meta({description:`Payload for a replay-chunk envelope.`,id:`ReplayChunkPayload`,title:`ReplayChunkPayload`});export{replayChunkPayloadSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_log_sourcing=require("./log-sourcing.cjs"),require_sdk_plugins_manifest=require("./plugins/manifest.cjs"),require_sdk_server_tracing=require("./server-tracing.cjs");let zod=require("zod");const remotePluginConfigSchema=zod.z.object(Object.fromEntries(require_sdk_plugins_manifest.PLUGIN_MANIFEST.map(p=>[p.name,zod.z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=zod.z.object({
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_log_sourcing=require("./log-sourcing.cjs"),require_sdk_plugins_manifest=require("./plugins/manifest.cjs"),require_sdk_server_tracing=require("./server-tracing.cjs");let zod=require("zod");const remotePluginConfigSchema=zod.z.object(Object.fromEntries(require_sdk_plugins_manifest.PLUGIN_MANIFEST.map(p=>[p.name,zod.z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=zod.z.object({ingestUrl:zod.z.url().optional(),logSourcing:require_sdk_log_sourcing.logSourcingModeSchema.optional(),plugins:remotePluginConfigSchema,serverTracing:require_sdk_server_tracing.serverTracingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),partialRemotePluginConfigSchema=remotePluginConfigSchema.partial(),remoteConfigInputSchema=remoteConfigSchema.extend({plugins:partialRemotePluginConfigSchema.optional()}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let scope=globalThis,injected=`__INTERFERE_PLUGINS__`in scope?scope[PLUGINS_GLOBAL]:void 0;if(injected==null)return null;let parsed=remotePluginConfigSchema.safeParse(injected);return parsed.success?parsed.data:null}const EVENT_TYPE_TO_PLUGIN=Object.fromEntries(require_sdk_plugins_manifest.PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));exports.EVENT_TYPE_TO_PLUGIN=EVENT_TYPE_TO_PLUGIN,exports.PLUGINS_GLOBAL=PLUGINS_GLOBAL,exports.readBakedPlugins=readBakedPlugins,exports.remoteConfigInputSchema=remoteConfigInputSchema,exports.remoteConfigSchema=remoteConfigSchema,exports.remotePluginConfigSchema=remotePluginConfigSchema;
|
|
@@ -2,18 +2,8 @@ import { EventType } from "./envelope.cjs";
|
|
|
2
2
|
import { PluginKey } from "./plugins/manifest.cjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/sdk/remote-config.d.ts
|
|
5
|
-
type RemotePluginConfig =
|
|
6
|
-
|
|
7
|
-
* Closed-shape schema for the SDK's per-plugin enabled state. Derived
|
|
8
|
-
* from `PLUGIN_MANIFEST` so adding a plugin to the manifest extends
|
|
9
|
-
* this schema automatically — no separate place to keep in sync.
|
|
10
|
-
*
|
|
11
|
-
* The closed shape (vs `Record<string, boolean>`) is what makes Speakeasy
|
|
12
|
-
* generate a typed `{ errors?: boolean, replay?: boolean, ... }` instead
|
|
13
|
-
* of a generic dictionary, and lets the SDK reject typo'd plugin names
|
|
14
|
-
* before they silently drop on the wire.
|
|
15
|
-
*/
|
|
16
|
-
declare const remotePluginConfigSchema: z.ZodObject<{
|
|
5
|
+
export type RemotePluginConfig = z.infer<typeof partialRemotePluginConfigSchema>;
|
|
6
|
+
export declare const remotePluginConfigSchema: z.ZodObject<{
|
|
17
7
|
device: z.ZodBoolean;
|
|
18
8
|
errors: z.ZodBoolean;
|
|
19
9
|
logs: z.ZodBoolean;
|
|
@@ -21,7 +11,12 @@ declare const remotePluginConfigSchema: z.ZodObject<{
|
|
|
21
11
|
rageClick: z.ZodBoolean;
|
|
22
12
|
replay: z.ZodBoolean;
|
|
23
13
|
}, z.core.$strip>;
|
|
24
|
-
declare const remoteConfigSchema: z.ZodObject<{
|
|
14
|
+
export declare const remoteConfigSchema: z.ZodObject<{
|
|
15
|
+
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
16
|
+
logSourcing: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
drain: "drain";
|
|
18
|
+
sdk: "sdk";
|
|
19
|
+
}>>;
|
|
25
20
|
plugins: z.ZodObject<{
|
|
26
21
|
device: z.ZodBoolean;
|
|
27
22
|
errors: z.ZodBoolean;
|
|
@@ -30,24 +25,52 @@ declare const remoteConfigSchema: z.ZodObject<{
|
|
|
30
25
|
rageClick: z.ZodBoolean;
|
|
31
26
|
replay: z.ZodBoolean;
|
|
32
27
|
}, z.core.$strip>;
|
|
33
|
-
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
34
28
|
serverTracing: z.ZodOptional<z.ZodEnum<{
|
|
35
29
|
drain: "drain";
|
|
36
30
|
full: "full";
|
|
37
31
|
}>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type RemoteConfig = z.infer<typeof remoteConfigSchema>;
|
|
34
|
+
declare const partialRemotePluginConfigSchema: z.ZodObject<{
|
|
35
|
+
device: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
errors: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
logs: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
pageEvents: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
rageClick: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
replay: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export declare const remoteConfigInputSchema: z.ZodObject<{
|
|
43
|
+
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
38
44
|
logSourcing: z.ZodOptional<z.ZodEnum<{
|
|
39
45
|
drain: "drain";
|
|
40
46
|
sdk: "sdk";
|
|
41
47
|
}>>;
|
|
48
|
+
serverTracing: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
drain: "drain";
|
|
50
|
+
full: "full";
|
|
51
|
+
}>>;
|
|
52
|
+
plugins: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
device: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
errors: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
logs: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
pageEvents: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
rageClick: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
replay: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
42
60
|
}, z.core.$strip>;
|
|
43
|
-
type RemoteConfig = z.infer<typeof remoteConfigSchema>;
|
|
44
61
|
/**
|
|
45
62
|
* Global stamped into the bundle at build time (Next `withInterfere`) with the
|
|
46
63
|
* surface's resolved plugin config. Its presence signals the build-time
|
|
47
64
|
* `/v2/config` fetch succeeded, so the runtime config fetch can be skipped.
|
|
48
65
|
*/
|
|
49
|
-
declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
|
|
50
|
-
declare function readBakedPlugins():
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
export declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
|
|
67
|
+
export declare function readBakedPlugins(): {
|
|
68
|
+
device: boolean;
|
|
69
|
+
errors: boolean;
|
|
70
|
+
logs: boolean;
|
|
71
|
+
pageEvents: boolean;
|
|
72
|
+
rageClick: boolean;
|
|
73
|
+
replay: boolean;
|
|
74
|
+
} | null;
|
|
75
|
+
export declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
|
|
76
|
+
//#endregion
|
|
@@ -2,18 +2,8 @@ import { EventType } from "./envelope.mjs";
|
|
|
2
2
|
import { PluginKey } from "./plugins/manifest.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/sdk/remote-config.d.ts
|
|
5
|
-
type RemotePluginConfig =
|
|
6
|
-
|
|
7
|
-
* Closed-shape schema for the SDK's per-plugin enabled state. Derived
|
|
8
|
-
* from `PLUGIN_MANIFEST` so adding a plugin to the manifest extends
|
|
9
|
-
* this schema automatically — no separate place to keep in sync.
|
|
10
|
-
*
|
|
11
|
-
* The closed shape (vs `Record<string, boolean>`) is what makes Speakeasy
|
|
12
|
-
* generate a typed `{ errors?: boolean, replay?: boolean, ... }` instead
|
|
13
|
-
* of a generic dictionary, and lets the SDK reject typo'd plugin names
|
|
14
|
-
* before they silently drop on the wire.
|
|
15
|
-
*/
|
|
16
|
-
declare const remotePluginConfigSchema: z.ZodObject<{
|
|
5
|
+
export type RemotePluginConfig = z.infer<typeof partialRemotePluginConfigSchema>;
|
|
6
|
+
export declare const remotePluginConfigSchema: z.ZodObject<{
|
|
17
7
|
device: z.ZodBoolean;
|
|
18
8
|
errors: z.ZodBoolean;
|
|
19
9
|
logs: z.ZodBoolean;
|
|
@@ -21,7 +11,12 @@ declare const remotePluginConfigSchema: z.ZodObject<{
|
|
|
21
11
|
rageClick: z.ZodBoolean;
|
|
22
12
|
replay: z.ZodBoolean;
|
|
23
13
|
}, z.core.$strip>;
|
|
24
|
-
declare const remoteConfigSchema: z.ZodObject<{
|
|
14
|
+
export declare const remoteConfigSchema: z.ZodObject<{
|
|
15
|
+
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
16
|
+
logSourcing: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
drain: "drain";
|
|
18
|
+
sdk: "sdk";
|
|
19
|
+
}>>;
|
|
25
20
|
plugins: z.ZodObject<{
|
|
26
21
|
device: z.ZodBoolean;
|
|
27
22
|
errors: z.ZodBoolean;
|
|
@@ -30,24 +25,52 @@ declare const remoteConfigSchema: z.ZodObject<{
|
|
|
30
25
|
rageClick: z.ZodBoolean;
|
|
31
26
|
replay: z.ZodBoolean;
|
|
32
27
|
}, z.core.$strip>;
|
|
33
|
-
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
34
28
|
serverTracing: z.ZodOptional<z.ZodEnum<{
|
|
35
29
|
drain: "drain";
|
|
36
30
|
full: "full";
|
|
37
31
|
}>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type RemoteConfig = z.infer<typeof remoteConfigSchema>;
|
|
34
|
+
declare const partialRemotePluginConfigSchema: z.ZodObject<{
|
|
35
|
+
device: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
errors: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
logs: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
pageEvents: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
rageClick: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
replay: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export declare const remoteConfigInputSchema: z.ZodObject<{
|
|
43
|
+
ingestUrl: z.ZodOptional<z.ZodURL>;
|
|
38
44
|
logSourcing: z.ZodOptional<z.ZodEnum<{
|
|
39
45
|
drain: "drain";
|
|
40
46
|
sdk: "sdk";
|
|
41
47
|
}>>;
|
|
48
|
+
serverTracing: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
drain: "drain";
|
|
50
|
+
full: "full";
|
|
51
|
+
}>>;
|
|
52
|
+
plugins: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
device: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
errors: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
logs: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
pageEvents: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
rageClick: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
replay: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
42
60
|
}, z.core.$strip>;
|
|
43
|
-
type RemoteConfig = z.infer<typeof remoteConfigSchema>;
|
|
44
61
|
/**
|
|
45
62
|
* Global stamped into the bundle at build time (Next `withInterfere`) with the
|
|
46
63
|
* surface's resolved plugin config. Its presence signals the build-time
|
|
47
64
|
* `/v2/config` fetch succeeded, so the runtime config fetch can be skipped.
|
|
48
65
|
*/
|
|
49
|
-
declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
|
|
50
|
-
declare function readBakedPlugins():
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
export declare const PLUGINS_GLOBAL = "__INTERFERE_PLUGINS__";
|
|
67
|
+
export declare function readBakedPlugins(): {
|
|
68
|
+
device: boolean;
|
|
69
|
+
errors: boolean;
|
|
70
|
+
logs: boolean;
|
|
71
|
+
pageEvents: boolean;
|
|
72
|
+
rageClick: boolean;
|
|
73
|
+
replay: boolean;
|
|
74
|
+
} | null;
|
|
75
|
+
export declare const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey>;
|
|
76
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{logSourcingModeSchema}from"./log-sourcing.mjs";import{PLUGIN_MANIFEST}from"./plugins/manifest.mjs";import{serverTracingModeSchema}from"./server-tracing.mjs";import{z}from"zod";const remotePluginConfigSchema=z.object(Object.fromEntries(PLUGIN_MANIFEST.map(p=>[p.name,z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=z.object({
|
|
1
|
+
import{logSourcingModeSchema}from"./log-sourcing.mjs";import{PLUGIN_MANIFEST}from"./plugins/manifest.mjs";import{serverTracingModeSchema}from"./server-tracing.mjs";import{z}from"zod";const remotePluginConfigSchema=z.object(Object.fromEntries(PLUGIN_MANIFEST.map(p=>[p.name,z.boolean()]))).meta({id:`RemotePluginConfig`,title:`RemotePluginConfig`}),remoteConfigSchema=z.object({ingestUrl:z.url().optional(),logSourcing:logSourcingModeSchema.optional(),plugins:remotePluginConfigSchema,serverTracing:serverTracingModeSchema.optional()}).meta({id:`RemoteConfig`,title:`RemoteConfig`}),partialRemotePluginConfigSchema=remotePluginConfigSchema.partial(),remoteConfigInputSchema=remoteConfigSchema.extend({plugins:partialRemotePluginConfigSchema.optional()}),PLUGINS_GLOBAL=`__INTERFERE_PLUGINS__`;function readBakedPlugins(){let scope=globalThis,injected=`__INTERFERE_PLUGINS__`in scope?scope[PLUGINS_GLOBAL]:void 0;if(injected==null)return null;let parsed=remotePluginConfigSchema.safeParse(injected);return parsed.success?parsed.data:null}const EVENT_TYPE_TO_PLUGIN=Object.fromEntries(PLUGIN_MANIFEST.flatMap(plugin=>plugin.events.map(event=>[event.name,plugin.name])));export{EVENT_TYPE_TO_PLUGIN,PLUGINS_GLOBAL,readBakedPlugins,remoteConfigInputSchema,remoteConfigSchema,remotePluginConfigSchema};
|
package/dist/sdk/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const envSchema=zod.z.string().min(1).nullable().meta({
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let zod=require("zod");const envSchema=zod.z.string().min(1).nullable().meta({description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`).",id:`Environment`,title:`Environment`}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=zod.z.enum([`browser`,`node`,`edge`]).nullable().meta({description:`JavaScript runtime the SDK is running in.`,id:`Runtime`,title:`Runtime`}),globalScope=globalThis;function readProcessEnv(){return globalScope.process?.env}function inferRuntime(options){return globalScope.window!==void 0&&globalScope.document!==void 0&&globalScope.navigator!==void 0?`browser`:typeof globalScope.EdgeRuntime==`string`||options?.nextRuntime===`edge`?`edge`:typeof globalScope.process?.versions?.node==`string`?`node`:null}function normalizeEnv(value){if(typeof value!=`string`)return null;let env=value.trim().toLowerCase();return env.length>0?env:null}exports.DEFAULT_ENVIRONMENT=DEFAULT_ENVIRONMENT,exports.envSchema=envSchema,exports.inferRuntime=inferRuntime,exports.normalizeEnv=normalizeEnv,exports.readProcessEnv=readProcessEnv,exports.resolveEnvironment=resolveEnvironment,exports.runtimeSchema=runtimeSchema;
|