@interfere/types 10.1.2 → 10.2.1
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 +10 -9
- package/dist/sdk/plugins/manifest.d.mts +10 -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 +13 -13
|
@@ -1,84 +1,83 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/releases/definition.d.ts
|
|
3
|
-
declare const releaseStatusSchema: z.ZodEnum<{
|
|
3
|
+
export declare const releaseStatusSchema: z.ZodEnum<{
|
|
4
4
|
building: "building";
|
|
5
5
|
canceled: "canceled";
|
|
6
6
|
errored: "errored";
|
|
7
7
|
pending: "pending";
|
|
8
8
|
ready: "ready";
|
|
9
9
|
}>;
|
|
10
|
-
type ReleaseStatus = z.infer<typeof releaseStatusSchema>;
|
|
11
|
-
declare const createReleaseRequest: z.ZodObject<{
|
|
12
|
-
|
|
13
|
-
provider: z.ZodLiteral<"github">;
|
|
14
|
-
commitMessage: z.ZodString;
|
|
15
|
-
branch: z.ZodString;
|
|
16
|
-
commitSha: z.ZodNullable<z.ZodString>;
|
|
17
|
-
runnerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
-
runId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
-
runUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
-
provider: z.ZodLiteral<"cli">;
|
|
22
|
-
commitSha: z.ZodNullable<z.ZodString>;
|
|
23
|
-
commitRef: z.ZodNullable<z.ZodString>;
|
|
24
|
-
commitMessage: z.ZodNullable<z.ZodString>;
|
|
25
|
-
commitUrl: z.ZodNullable<z.ZodString>;
|
|
26
|
-
runnerName: z.ZodNullable<z.ZodString>;
|
|
27
|
-
runId: z.ZodNullable<z.ZodString>;
|
|
28
|
-
runUrl: z.ZodNullable<z.ZodString>;
|
|
29
|
-
environment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
-
deploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
-
}, z.core.$strip>], "provider">;
|
|
10
|
+
export type ReleaseStatus = z.infer<typeof releaseStatusSchema>;
|
|
11
|
+
export declare const createReleaseRequest: z.ZodObject<{
|
|
12
|
+
buildId: z.ZodString;
|
|
32
13
|
destination: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
-
provider: z.ZodLiteral<"vercel">;
|
|
34
|
-
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
35
|
-
environment: z.ZodNullable<z.ZodString>;
|
|
36
14
|
deploymentId: z.ZodNullable<z.ZodString>;
|
|
37
15
|
deploymentUrl: z.ZodNullable<z.ZodString>;
|
|
16
|
+
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
17
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
38
18
|
environmentName: z.ZodNullable<z.ZodString>;
|
|
39
19
|
environmentTarget: z.ZodNullable<z.ZodString>;
|
|
20
|
+
provider: z.ZodLiteral<"vercel">;
|
|
40
21
|
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
-
provider: z.ZodLiteral<"cloudflare">;
|
|
42
|
-
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
43
|
-
environment: z.ZodNullable<z.ZodString>;
|
|
44
|
-
versionId: z.ZodNullable<z.ZodString>;
|
|
45
|
-
scriptName: z.ZodNullable<z.ZodString>;
|
|
46
22
|
accountId: z.ZodNullable<z.ZodString>;
|
|
47
23
|
deploymentUrl: z.ZodNullable<z.ZodString>;
|
|
24
|
+
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
25
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
48
26
|
environmentName: z.ZodNullable<z.ZodString>;
|
|
49
27
|
environmentTarget: z.ZodNullable<z.ZodString>;
|
|
28
|
+
provider: z.ZodLiteral<"cloudflare">;
|
|
29
|
+
scriptName: z.ZodNullable<z.ZodString>;
|
|
30
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
50
31
|
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
-
|
|
32
|
+
deploymentUrl: z.ZodNullable<z.ZodString>;
|
|
52
33
|
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
53
34
|
environment: z.ZodNullable<z.ZodString>;
|
|
54
|
-
|
|
35
|
+
provider: z.ZodLiteral<"cli">;
|
|
55
36
|
}, z.core.$strip>], "provider">>;
|
|
56
|
-
buildId: z.ZodString;
|
|
57
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
58
37
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
38
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
39
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
|
+
branch: z.ZodString;
|
|
41
|
+
commitMessage: z.ZodString;
|
|
42
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
43
|
+
provider: z.ZodLiteral<"github">;
|
|
44
|
+
runId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
runUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
runnerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
commitMessage: z.ZodNullable<z.ZodString>;
|
|
49
|
+
commitRef: z.ZodNullable<z.ZodString>;
|
|
50
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
51
|
+
commitUrl: z.ZodNullable<z.ZodString>;
|
|
52
|
+
deploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
environment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
provider: z.ZodLiteral<"cli">;
|
|
55
|
+
runId: z.ZodNullable<z.ZodString>;
|
|
56
|
+
runUrl: z.ZodNullable<z.ZodString>;
|
|
57
|
+
runnerName: z.ZodNullable<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>], "provider">;
|
|
59
59
|
}, z.core.$strip>;
|
|
60
|
-
type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;
|
|
61
|
-
declare const createReleaseResponse: z.ZodObject<{
|
|
62
|
-
|
|
60
|
+
export type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;
|
|
61
|
+
export declare const createReleaseResponse: z.ZodObject<{
|
|
62
|
+
build: z.ZodObject<{
|
|
63
|
+
hash: z.ZodString;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
destination: z.ZodObject<{
|
|
63
66
|
id: z.ZodString;
|
|
64
|
-
slug: z.
|
|
67
|
+
slug: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
68
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
65
69
|
}, z.core.$strip>;
|
|
66
|
-
|
|
70
|
+
org: z.ZodObject<{
|
|
67
71
|
id: z.ZodString;
|
|
68
72
|
slug: z.ZodString;
|
|
69
73
|
}, z.core.$strip>;
|
|
70
74
|
source: z.ZodObject<{
|
|
71
75
|
id: z.ZodString;
|
|
72
76
|
}, z.core.$strip>;
|
|
73
|
-
|
|
77
|
+
surface: z.ZodObject<{
|
|
74
78
|
id: z.ZodString;
|
|
75
|
-
slug: z.
|
|
76
|
-
environment: z.ZodNullable<z.ZodString>;
|
|
77
|
-
}, z.core.$strip>;
|
|
78
|
-
build: z.ZodObject<{
|
|
79
|
-
hash: z.ZodString;
|
|
79
|
+
slug: z.ZodString;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
|
-
type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { CreateReleaseRequest, CreateReleaseResponse, ReleaseStatus, createReleaseRequest, createReleaseResponse, releaseStatusSchema };
|
|
82
|
+
export type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;
|
|
83
|
+
//#endregion
|
|
@@ -1,84 +1,83 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/releases/definition.d.ts
|
|
3
|
-
declare const releaseStatusSchema: z.ZodEnum<{
|
|
3
|
+
export declare const releaseStatusSchema: z.ZodEnum<{
|
|
4
4
|
building: "building";
|
|
5
5
|
canceled: "canceled";
|
|
6
6
|
errored: "errored";
|
|
7
7
|
pending: "pending";
|
|
8
8
|
ready: "ready";
|
|
9
9
|
}>;
|
|
10
|
-
type ReleaseStatus = z.infer<typeof releaseStatusSchema>;
|
|
11
|
-
declare const createReleaseRequest: z.ZodObject<{
|
|
12
|
-
|
|
13
|
-
provider: z.ZodLiteral<"github">;
|
|
14
|
-
commitMessage: z.ZodString;
|
|
15
|
-
branch: z.ZodString;
|
|
16
|
-
commitSha: z.ZodNullable<z.ZodString>;
|
|
17
|
-
runnerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
-
runId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
-
runUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
-
provider: z.ZodLiteral<"cli">;
|
|
22
|
-
commitSha: z.ZodNullable<z.ZodString>;
|
|
23
|
-
commitRef: z.ZodNullable<z.ZodString>;
|
|
24
|
-
commitMessage: z.ZodNullable<z.ZodString>;
|
|
25
|
-
commitUrl: z.ZodNullable<z.ZodString>;
|
|
26
|
-
runnerName: z.ZodNullable<z.ZodString>;
|
|
27
|
-
runId: z.ZodNullable<z.ZodString>;
|
|
28
|
-
runUrl: z.ZodNullable<z.ZodString>;
|
|
29
|
-
environment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
-
deploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
-
}, z.core.$strip>], "provider">;
|
|
10
|
+
export type ReleaseStatus = z.infer<typeof releaseStatusSchema>;
|
|
11
|
+
export declare const createReleaseRequest: z.ZodObject<{
|
|
12
|
+
buildId: z.ZodString;
|
|
32
13
|
destination: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
-
provider: z.ZodLiteral<"vercel">;
|
|
34
|
-
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
35
|
-
environment: z.ZodNullable<z.ZodString>;
|
|
36
14
|
deploymentId: z.ZodNullable<z.ZodString>;
|
|
37
15
|
deploymentUrl: z.ZodNullable<z.ZodString>;
|
|
16
|
+
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
17
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
38
18
|
environmentName: z.ZodNullable<z.ZodString>;
|
|
39
19
|
environmentTarget: z.ZodNullable<z.ZodString>;
|
|
20
|
+
provider: z.ZodLiteral<"vercel">;
|
|
40
21
|
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
-
provider: z.ZodLiteral<"cloudflare">;
|
|
42
|
-
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
43
|
-
environment: z.ZodNullable<z.ZodString>;
|
|
44
|
-
versionId: z.ZodNullable<z.ZodString>;
|
|
45
|
-
scriptName: z.ZodNullable<z.ZodString>;
|
|
46
22
|
accountId: z.ZodNullable<z.ZodString>;
|
|
47
23
|
deploymentUrl: z.ZodNullable<z.ZodString>;
|
|
24
|
+
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
25
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
48
26
|
environmentName: z.ZodNullable<z.ZodString>;
|
|
49
27
|
environmentTarget: z.ZodNullable<z.ZodString>;
|
|
28
|
+
provider: z.ZodLiteral<"cloudflare">;
|
|
29
|
+
scriptName: z.ZodNullable<z.ZodString>;
|
|
30
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
50
31
|
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
-
|
|
32
|
+
deploymentUrl: z.ZodNullable<z.ZodString>;
|
|
52
33
|
destinationReleaseId: z.ZodNullable<z.ZodString>;
|
|
53
34
|
environment: z.ZodNullable<z.ZodString>;
|
|
54
|
-
|
|
35
|
+
provider: z.ZodLiteral<"cli">;
|
|
55
36
|
}, z.core.$strip>], "provider">>;
|
|
56
|
-
buildId: z.ZodString;
|
|
57
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
58
37
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
38
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
39
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
|
+
branch: z.ZodString;
|
|
41
|
+
commitMessage: z.ZodString;
|
|
42
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
43
|
+
provider: z.ZodLiteral<"github">;
|
|
44
|
+
runId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
runUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
runnerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
commitMessage: z.ZodNullable<z.ZodString>;
|
|
49
|
+
commitRef: z.ZodNullable<z.ZodString>;
|
|
50
|
+
commitSha: z.ZodNullable<z.ZodString>;
|
|
51
|
+
commitUrl: z.ZodNullable<z.ZodString>;
|
|
52
|
+
deploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
environment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
provider: z.ZodLiteral<"cli">;
|
|
55
|
+
runId: z.ZodNullable<z.ZodString>;
|
|
56
|
+
runUrl: z.ZodNullable<z.ZodString>;
|
|
57
|
+
runnerName: z.ZodNullable<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>], "provider">;
|
|
59
59
|
}, z.core.$strip>;
|
|
60
|
-
type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;
|
|
61
|
-
declare const createReleaseResponse: z.ZodObject<{
|
|
62
|
-
|
|
60
|
+
export type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;
|
|
61
|
+
export declare const createReleaseResponse: z.ZodObject<{
|
|
62
|
+
build: z.ZodObject<{
|
|
63
|
+
hash: z.ZodString;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
destination: z.ZodObject<{
|
|
63
66
|
id: z.ZodString;
|
|
64
|
-
slug: z.
|
|
67
|
+
slug: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
68
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
65
69
|
}, z.core.$strip>;
|
|
66
|
-
|
|
70
|
+
org: z.ZodObject<{
|
|
67
71
|
id: z.ZodString;
|
|
68
72
|
slug: z.ZodString;
|
|
69
73
|
}, z.core.$strip>;
|
|
70
74
|
source: z.ZodObject<{
|
|
71
75
|
id: z.ZodString;
|
|
72
76
|
}, z.core.$strip>;
|
|
73
|
-
|
|
77
|
+
surface: z.ZodObject<{
|
|
74
78
|
id: z.ZodString;
|
|
75
|
-
slug: z.
|
|
76
|
-
environment: z.ZodNullable<z.ZodString>;
|
|
77
|
-
}, z.core.$strip>;
|
|
78
|
-
build: z.ZodObject<{
|
|
79
|
-
hash: z.ZodString;
|
|
79
|
+
slug: z.ZodString;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
|
-
type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { CreateReleaseRequest, CreateReleaseResponse, ReleaseStatus, createReleaseRequest, createReleaseResponse, releaseStatusSchema };
|
|
82
|
+
export type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;
|
|
83
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{releaseSlugSchema}from"./slug.mjs";import{releaseDestinationMetadataSchema,releaseSourceMetadataSchema}from"../integrations/index.mjs";import{z}from"zod";const releaseStatusSchema=z.enum([`pending`,`building`,`ready`,`errored`,`canceled`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),orgRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`OrgRef`,title:`OrgRef`}),surfaceRefSchema=z.object({id:z.string(),slug:z.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),createReleaseRequest=z.object({buildId:z.string(),destination:releaseDestinationMetadataSchema.nullable(),producerVersion:z.string().optional(),slug:z.string().optional(),source:releaseSourceMetadataSchema}).meta({description:`Request body for creating a release.`,id:`CreateReleaseRequest`,title:`CreateReleaseRequest`}),createReleaseResponse=z.object({build:z.object({hash:z.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`}),destination:z.object({id:z.string(),slug:releaseSlugSchema,environment:z.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),org:orgRefSchema,source:z.object({id:z.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),surface:surfaceRefSchema}).meta({description:`Response body returned after creating a release.`,id:`CreateReleaseResponse`,title:`CreateReleaseResponse`});export{createReleaseRequest,createReleaseResponse,releaseStatusSchema};
|
package/dist/releases/slug.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/releases/slug.d.ts
|
|
3
|
-
declare const releaseSlugSchema: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
4
|
-
type ReleaseSlug = z.infer<typeof releaseSlugSchema>;
|
|
5
|
-
declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
3
|
+
export declare const releaseSlugSchema: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
4
|
+
export type ReleaseSlug = z.infer<typeof releaseSlugSchema>;
|
|
5
|
+
export declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
6
6
|
/**
|
|
7
7
|
* Derives a release slug from a commit SHA. Both ends of the wire — the
|
|
8
8
|
* build step that stamps the slug into the bundle, and any server-side
|
|
@@ -17,6 +17,5 @@ declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
|
17
17
|
* Return type is `ReleaseSlug` (template-literal branded) so consumers
|
|
18
18
|
* can pass the result into branded sites without a re-validate.
|
|
19
19
|
*/
|
|
20
|
-
declare function deriveReleaseSlug(commitSha: string): ReleaseSlug
|
|
21
|
-
//#endregion
|
|
22
|
-
export { LOCAL_DEV_RELEASE_SLUG, ReleaseSlug, deriveReleaseSlug, releaseSlugSchema };
|
|
20
|
+
export declare function deriveReleaseSlug(commitSha: string): `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
21
|
+
//#endregion
|
package/dist/releases/slug.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/releases/slug.d.ts
|
|
3
|
-
declare const releaseSlugSchema: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
4
|
-
type ReleaseSlug = z.infer<typeof releaseSlugSchema>;
|
|
5
|
-
declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
3
|
+
export declare const releaseSlugSchema: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
4
|
+
export type ReleaseSlug = z.infer<typeof releaseSlugSchema>;
|
|
5
|
+
export declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
6
6
|
/**
|
|
7
7
|
* Derives a release slug from a commit SHA. Both ends of the wire — the
|
|
8
8
|
* build step that stamps the slug into the bundle, and any server-side
|
|
@@ -17,6 +17,5 @@ declare const LOCAL_DEV_RELEASE_SLUG: `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
|
17
17
|
* Return type is `ReleaseSlug` (template-literal branded) so consumers
|
|
18
18
|
* can pass the result into branded sites without a re-validate.
|
|
19
19
|
*/
|
|
20
|
-
declare function deriveReleaseSlug(commitSha: string): ReleaseSlug
|
|
21
|
-
//#endregion
|
|
22
|
-
export { LOCAL_DEV_RELEASE_SLUG, ReleaseSlug, deriveReleaseSlug, releaseSlugSchema };
|
|
20
|
+
export declare function deriveReleaseSlug(commitSha: string): `rel_${string}` & z.$brand<"ReleaseSlug">;
|
|
21
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_remote_config=require("./remote-config.cjs");let zod=require("zod");const remoteConfigFields=require_sdk_remote_config.remoteConfigSchema.shape,buildConfigSchema=(0,zod.catch)(zod.z.object({ingestUrl:(0,zod.catch)(remoteConfigFields.ingestUrl,void 0),logSourcing:(0,zod.catch)(remoteConfigFields.logSourcing,void 0),plugins:(0,zod.catch)(remoteConfigFields.plugins.partial().optional(),void 0),serverTracing:(0,zod.catch)(remoteConfigFields.serverTracing,void 0)}),{});exports.buildConfigSchema=buildConfigSchema;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/sdk/build-config.d.ts
|
|
3
|
+
export declare const buildConfigSchema: z.ZodCatch<z.ZodObject<{
|
|
4
|
+
ingestUrl: z.ZodCatch<z.ZodOptional<z.ZodURL>>;
|
|
5
|
+
logSourcing: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
drain: "drain";
|
|
7
|
+
sdk: "sdk";
|
|
8
|
+
}>>>;
|
|
9
|
+
plugins: z.ZodCatch<z.ZodOptional<z.ZodObject<{
|
|
10
|
+
device: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
errors: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
logs: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
pageEvents: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
rageClick: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
replay: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, z.core.$strip>>>;
|
|
17
|
+
serverTracing: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
drain: "drain";
|
|
19
|
+
full: "full";
|
|
20
|
+
}>>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
//#endregion
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/sdk/build-config.d.ts
|
|
3
|
+
export declare const buildConfigSchema: z.ZodCatch<z.ZodObject<{
|
|
4
|
+
ingestUrl: z.ZodCatch<z.ZodOptional<z.ZodURL>>;
|
|
5
|
+
logSourcing: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
drain: "drain";
|
|
7
|
+
sdk: "sdk";
|
|
8
|
+
}>>>;
|
|
9
|
+
plugins: z.ZodCatch<z.ZodOptional<z.ZodObject<{
|
|
10
|
+
device: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
errors: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
logs: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
pageEvents: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
rageClick: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
replay: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, z.core.$strip>>>;
|
|
17
|
+
serverTracing: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
drain: "drain";
|
|
19
|
+
full: "full";
|
|
20
|
+
}>>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{remoteConfigSchema}from"./remote-config.mjs";import{catch as catch$1,z}from"zod";const remoteConfigFields=remoteConfigSchema.shape,buildConfigSchema=catch$1(z.object({ingestUrl:catch$1(remoteConfigFields.ingestUrl,void 0),logSourcing:catch$1(remoteConfigFields.logSourcing,void 0),plugins:catch$1(remoteConfigFields.plugins.partial().optional(),void 0),serverTracing:catch$1(remoteConfigFields.serverTracing,void 0)}),{});export{buildConfigSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `);function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}const CATALOG={
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `);function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}const CATALOG={API_KEY_NETWORK_DENIED:()=>({code:`API_KEY_NETWORK_DENIED`,severity:`fatal`,title:`Build machine blocked by network policy`,details:[`INTERFERE_API_KEY was recognized, but the workspace network policy blocks this build machine.`,`Allow your CI egress IPs or ASN under Network access at https://interfere.com/settings/security.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,title:`Secret key rejected by server`,details:[`INTERFERE_API_KEY was sent but the server did not recognize it.`,`Verify it matches an active key at ${DASHBOARD_KEYS_URL}.`,`If you recently rotated keys, restart your build with the new value.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,title:`Secret key missing release scope`,details:[`INTERFERE_API_KEY was recognized but cannot publish release metadata.`,`Create or update the key with \`release:write\` scope at ${DASHBOARD_KEYS_URL}.`,`If you recently changed key scopes, restart your build with the new value.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,title:`Secret key could not be read`,details:[`INTERFERE_API_KEY was sent but the server could not read it.`,`Expected a key starting with ${API_KEY_PREFIX_HINT}.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_WRONG_PREFIX:(ctx,input)=>({code:`API_KEY_WRONG_PREFIX`,severity:`fatal`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with ${API_KEY_PREFIX_HINT} but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),RELEASE_PIPELINE_FAILED:(_ctx,input)=>({code:`RELEASE_PIPELINE_FAILED`,severity:`warn`,title:`Skipping release pipeline`,details:[`Interfere failed to process this release.`,`Events from this release will be ingested, but ignored as finding when generating insights.`,`Please check https://status.interfere.com for any outages, or contact support@interfere.com if the problem persists.`,`Error: ${input.errorMessage??`<unknown>`}`]})};function diagnoseRelease(code,ctx,input={}){return CATALOG[code](ctx,input)}const API_CODE_TO_DIAGNOSTIC=new Map(Object.entries({AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,AUTH_MISSING:`API_KEY_UNREADABLE`,NETWORK_ACCESS_DENIED:`API_KEY_NETWORK_DENIED`}));function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let body=`body`in error?error.body:void 0;if(typeof body!=`object`||!body)return`RELEASE_PIPELINE_FAILED`;let code=`code`in body?body.code:void 0;return typeof code==`string`?API_CODE_TO_DIAGNOSTIC.get(code)??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}exports.API_KEY_PREFIXES=API_KEY_PREFIXES,exports.classifyReleasePipelineError=classifyReleasePipelineError,exports.diagnoseRelease=diagnoseRelease,exports.formatApiKeyPreview=formatApiKeyPreview,exports.isInterfereApiKey=isInterfereApiKey;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
//#region src/sdk/build-diagnostics.d.ts
|
|
2
|
-
declare const API_KEY_PREFIXES: readonly ["interfere_secret_us_", "interfere_secret_eu_", "interfere_ak_"];
|
|
3
|
-
type ReleaseDiagnosticSeverity = "fatal" | "warn";
|
|
4
|
-
type ReleaseDiagnosticCode = "API_KEY_WRONG_PREFIX" | "API_KEY_UNREADABLE" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
|
|
5
|
-
interface ReleaseDiagnostic {
|
|
2
|
+
export declare const API_KEY_PREFIXES: readonly ["interfere_secret_us_", "interfere_secret_eu_", "interfere_ak_"];
|
|
3
|
+
export type ReleaseDiagnosticSeverity = "fatal" | "warn";
|
|
4
|
+
export type ReleaseDiagnosticCode = "API_KEY_WRONG_PREFIX" | "API_KEY_UNREADABLE" | "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
|
|
5
|
+
export interface ReleaseDiagnostic {
|
|
6
6
|
readonly code: ReleaseDiagnosticCode;
|
|
7
7
|
readonly details: readonly string[];
|
|
8
8
|
readonly severity: ReleaseDiagnosticSeverity;
|
|
9
9
|
readonly title: string;
|
|
10
10
|
}
|
|
11
|
-
interface ReleaseDiagnosticContext {
|
|
11
|
+
export interface ReleaseDiagnosticContext {
|
|
12
12
|
readonly publicKeyEnvVar: string;
|
|
13
13
|
}
|
|
14
|
-
interface ReleaseDiagnosticInput {
|
|
14
|
+
export interface ReleaseDiagnosticInput {
|
|
15
15
|
readonly apiKey?: string;
|
|
16
16
|
readonly errorMessage?: string;
|
|
17
17
|
}
|
|
18
|
-
declare function formatApiKeyPreview(apiKey: string): string;
|
|
19
|
-
declare function isInterfereApiKey(apiKey: string): boolean;
|
|
20
|
-
declare function diagnoseRelease(code: ReleaseDiagnosticCode, ctx: ReleaseDiagnosticContext, input?: ReleaseDiagnosticInput): ReleaseDiagnostic;
|
|
21
|
-
declare function classifyReleasePipelineError(error: unknown):
|
|
22
|
-
//#endregion
|
|
23
|
-
export { API_KEY_PREFIXES, ReleaseDiagnostic, ReleaseDiagnosticCode, ReleaseDiagnosticContext, ReleaseDiagnosticInput, ReleaseDiagnosticSeverity, classifyReleasePipelineError, diagnoseRelease, formatApiKeyPreview, isInterfereApiKey };
|
|
18
|
+
export declare function formatApiKeyPreview(apiKey: string): string;
|
|
19
|
+
export declare function isInterfereApiKey(apiKey: string): boolean;
|
|
20
|
+
export declare function diagnoseRelease(code: ReleaseDiagnosticCode, ctx: ReleaseDiagnosticContext, input?: ReleaseDiagnosticInput): ReleaseDiagnostic;
|
|
21
|
+
export declare function classifyReleasePipelineError(error: unknown): "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_UNREADABLE" | "RELEASE_PIPELINE_FAILED";
|
|
22
|
+
//#endregion
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
//#region src/sdk/build-diagnostics.d.ts
|
|
2
|
-
declare const API_KEY_PREFIXES: readonly ["interfere_secret_us_", "interfere_secret_eu_", "interfere_ak_"];
|
|
3
|
-
type ReleaseDiagnosticSeverity = "fatal" | "warn";
|
|
4
|
-
type ReleaseDiagnosticCode = "API_KEY_WRONG_PREFIX" | "API_KEY_UNREADABLE" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
|
|
5
|
-
interface ReleaseDiagnostic {
|
|
2
|
+
export declare const API_KEY_PREFIXES: readonly ["interfere_secret_us_", "interfere_secret_eu_", "interfere_ak_"];
|
|
3
|
+
export type ReleaseDiagnosticSeverity = "fatal" | "warn";
|
|
4
|
+
export type ReleaseDiagnosticCode = "API_KEY_WRONG_PREFIX" | "API_KEY_UNREADABLE" | "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "RELEASE_PIPELINE_FAILED";
|
|
5
|
+
export interface ReleaseDiagnostic {
|
|
6
6
|
readonly code: ReleaseDiagnosticCode;
|
|
7
7
|
readonly details: readonly string[];
|
|
8
8
|
readonly severity: ReleaseDiagnosticSeverity;
|
|
9
9
|
readonly title: string;
|
|
10
10
|
}
|
|
11
|
-
interface ReleaseDiagnosticContext {
|
|
11
|
+
export interface ReleaseDiagnosticContext {
|
|
12
12
|
readonly publicKeyEnvVar: string;
|
|
13
13
|
}
|
|
14
|
-
interface ReleaseDiagnosticInput {
|
|
14
|
+
export interface ReleaseDiagnosticInput {
|
|
15
15
|
readonly apiKey?: string;
|
|
16
16
|
readonly errorMessage?: string;
|
|
17
17
|
}
|
|
18
|
-
declare function formatApiKeyPreview(apiKey: string): string;
|
|
19
|
-
declare function isInterfereApiKey(apiKey: string): boolean;
|
|
20
|
-
declare function diagnoseRelease(code: ReleaseDiagnosticCode, ctx: ReleaseDiagnosticContext, input?: ReleaseDiagnosticInput): ReleaseDiagnostic;
|
|
21
|
-
declare function classifyReleasePipelineError(error: unknown):
|
|
22
|
-
//#endregion
|
|
23
|
-
export { API_KEY_PREFIXES, ReleaseDiagnostic, ReleaseDiagnosticCode, ReleaseDiagnosticContext, ReleaseDiagnosticInput, ReleaseDiagnosticSeverity, classifyReleasePipelineError, diagnoseRelease, formatApiKeyPreview, isInterfereApiKey };
|
|
18
|
+
export declare function formatApiKeyPreview(apiKey: string): string;
|
|
19
|
+
export declare function isInterfereApiKey(apiKey: string): boolean;
|
|
20
|
+
export declare function diagnoseRelease(code: ReleaseDiagnosticCode, ctx: ReleaseDiagnosticContext, input?: ReleaseDiagnosticInput): ReleaseDiagnostic;
|
|
21
|
+
export declare function classifyReleasePipelineError(error: unknown): "API_KEY_NETWORK_DENIED" | "API_KEY_REJECTED" | "API_KEY_SCOPE_MISMATCH" | "API_KEY_UNREADABLE" | "RELEASE_PIPELINE_FAILED";
|
|
22
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `);function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}const CATALOG={
|
|
1
|
+
const API_KEY_PREFIXES=[`interfere_secret_us_`,`interfere_secret_eu_`,`interfere_ak_`],DASHBOARD_KEYS_URL=`https://interfere.com/settings/api-keys`,API_KEY_PREFIX_HINT=API_KEY_PREFIXES.map(prefix=>`\`${prefix}\``).join(` or `);function formatApiKeyPreview(apiKey){let preview=apiKey.slice(0,12);return apiKey.length>12?`${preview}...`:preview}function isInterfereApiKey(apiKey){return API_KEY_PREFIXES.some(prefix=>apiKey.startsWith(prefix))}const CATALOG={API_KEY_NETWORK_DENIED:()=>({code:`API_KEY_NETWORK_DENIED`,severity:`fatal`,title:`Build machine blocked by network policy`,details:[`INTERFERE_API_KEY was recognized, but the workspace network policy blocks this build machine.`,`Allow your CI egress IPs or ASN under Network access at https://interfere.com/settings/security.`]}),API_KEY_REJECTED:()=>({code:`API_KEY_REJECTED`,severity:`fatal`,title:`Secret key rejected by server`,details:[`INTERFERE_API_KEY was sent but the server did not recognize it.`,`Verify it matches an active key at ${DASHBOARD_KEYS_URL}.`,`If you recently rotated keys, restart your build with the new value.`]}),API_KEY_SCOPE_MISMATCH:()=>({code:`API_KEY_SCOPE_MISMATCH`,severity:`fatal`,title:`Secret key missing release scope`,details:[`INTERFERE_API_KEY was recognized but cannot publish release metadata.`,`Create or update the key with \`release:write\` scope at ${DASHBOARD_KEYS_URL}.`,`If you recently changed key scopes, restart your build with the new value.`]}),API_KEY_UNREADABLE:ctx=>({code:`API_KEY_UNREADABLE`,severity:`fatal`,title:`Secret key could not be read`,details:[`INTERFERE_API_KEY was sent but the server could not read it.`,`Expected a key starting with ${API_KEY_PREFIX_HINT}.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),API_KEY_WRONG_PREFIX:(ctx,input)=>({code:`API_KEY_WRONG_PREFIX`,severity:`fatal`,title:`INTERFERE_API_KEY has wrong prefix`,details:[`Expected a key starting with ${API_KEY_PREFIX_HINT} but got \`${formatApiKeyPreview(input.apiKey??``)}\`.`,`If you set a public key (\`interfere_public_us_*\`, \`interfere_public_eu_*\`, or legacy \`interfere_pub_*\`/\`interfere_pk_*\`), put it in \`${ctx.publicKeyEnvVar}\` instead.`,`Generate a new secret key at ${DASHBOARD_KEYS_URL}.`]}),RELEASE_PIPELINE_FAILED:(_ctx,input)=>({code:`RELEASE_PIPELINE_FAILED`,severity:`warn`,title:`Skipping release pipeline`,details:[`Interfere failed to process this release.`,`Events from this release will be ingested, but ignored as finding when generating insights.`,`Please check https://status.interfere.com for any outages, or contact support@interfere.com if the problem persists.`,`Error: ${input.errorMessage??`<unknown>`}`]})};function diagnoseRelease(code,ctx,input={}){return CATALOG[code](ctx,input)}const API_CODE_TO_DIAGNOSTIC=new Map(Object.entries({AUTH_AK_INVALID:`API_KEY_REJECTED`,AUTH_AK_SCOPE_MISMATCH:`API_KEY_SCOPE_MISMATCH`,AUTH_MISSING:`API_KEY_UNREADABLE`,NETWORK_ACCESS_DENIED:`API_KEY_NETWORK_DENIED`}));function classifyReleasePipelineError(error){if(typeof error!=`object`||!error)return`RELEASE_PIPELINE_FAILED`;let body=`body`in error?error.body:void 0;if(typeof body!=`object`||!body)return`RELEASE_PIPELINE_FAILED`;let code=`code`in body?body.code:void 0;return typeof code==`string`?API_CODE_TO_DIAGNOSTIC.get(code)??`RELEASE_PIPELINE_FAILED`:`RELEASE_PIPELINE_FAILED`}export{API_KEY_PREFIXES,classifyReleasePipelineError,diagnoseRelease,formatApiKeyPreview,isInterfereApiKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_env=require("./env.cjs");function resolveCliReleaseDestination(env,releaseSlug){return{
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_env=require("./env.cjs");function resolveCliReleaseDestination(env,releaseSlug){return{deploymentUrl:require_sdk_env.parseEnvValue(env.INTERFERE_DEPLOYMENT_URL),destinationReleaseId:releaseSlug,environment:require_sdk_env.parseEnvValue(env.INTERFERE_ENVIRONMENT),provider:`cli`}}exports.resolveCliReleaseDestination=resolveCliReleaseDestination;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ReleaseDestinationMetadata } from "../integrations/index.cjs";
|
|
2
1
|
import { ReleaseSlug } from "../releases/slug.cjs";
|
|
3
2
|
//#region src/sdk/cli-destination.d.ts
|
|
4
|
-
declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug):
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug): {
|
|
4
|
+
deploymentUrl: string | null;
|
|
5
|
+
destinationReleaseId: `rel_${string}` & import("zod").$brand<"ReleaseSlug">;
|
|
6
|
+
environment: string | null;
|
|
7
|
+
provider: "cli";
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ReleaseDestinationMetadata } from "../integrations/index.mjs";
|
|
2
1
|
import { ReleaseSlug } from "../releases/slug.mjs";
|
|
3
2
|
//#region src/sdk/cli-destination.d.ts
|
|
4
|
-
declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug):
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare function resolveCliReleaseDestination(env: Record<string, string | undefined>, releaseSlug: ReleaseSlug): {
|
|
4
|
+
deploymentUrl: string | null;
|
|
5
|
+
destinationReleaseId: `rel_${string}` & import("zod").$brand<"ReleaseSlug">;
|
|
6
|
+
environment: string | null;
|
|
7
|
+
provider: "cli";
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseEnvValue}from"./env.mjs";function resolveCliReleaseDestination(env,releaseSlug){return{
|
|
1
|
+
import{parseEnvValue}from"./env.mjs";function resolveCliReleaseDestination(env,releaseSlug){return{deploymentUrl:parseEnvValue(env.INTERFERE_DEPLOYMENT_URL),destinationReleaseId:releaseSlug,environment:parseEnvValue(env.INTERFERE_ENVIRONMENT),provider:`cli`}}export{resolveCliReleaseDestination};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");function fromEnv(...names){return
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const require_sdk_runtime=require("./runtime.cjs");function fromEnv(...names){return(env=>{for(let name of names){let value=require_sdk_runtime.normalizeEnv(env[name]);if(value)return value}return null})}const PROVIDER_RESOLVERS={cloudflare:[fromEnv(`CLOUDFLARE_ENV`)],vercel:[fromEnv(`VERCEL_TARGET_ENV`,`VERCEL_ENV`)]},UNRESOLVED_ENVIRONMENT_MESSAGE=[`Could not determine the deploy environment for this build.`,`Set INTERFERE_ENVIRONMENT (e.g. production or preview), or deploy on a platform that sets VERCEL_ENV / CLOUDFLARE_ENV.`].join(`
|
|
2
2
|
`);var DeployEnvironmentError=class extends Error{name=`DeployEnvironmentError`};function resolveEnvironmentValue(env){let explicit=require_sdk_runtime.normalizeEnv(env.INTERFERE_ENVIRONMENT);if(explicit)return explicit;for(let resolvers of Object.values(PROVIDER_RESOLVERS))for(let resolve of resolvers){let value=resolve(env);if(value)return value}return null}function resolveDeployEnvironment(env){let environment=resolveEnvironmentValue(env);if(!environment)throw new DeployEnvironmentError(UNRESOLVED_ENVIRONMENT_MESSAGE);if(environment.length>32)throw new DeployEnvironmentError(`Deploy environment "${environment}" is ${environment.length} characters; the maximum is 32. Set a shorter INTERFERE_ENVIRONMENT.`);return environment}function applyDeployEnvironment(destination,environment){return environment?destination.provider===`cli`?{...destination,environment}:{...destination,environment,environmentName:environment,environmentTarget:environment}:destination}exports.DEPLOY_ENVIRONMENT_MAX_LENGTH=32,exports.DeployEnvironmentError=DeployEnvironmentError,exports.applyDeployEnvironment=applyDeployEnvironment,exports.resolveDeployEnvironment=resolveDeployEnvironment;
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { ReleaseDestinationMetadata } from "../integrations/index.cjs";
|
|
2
2
|
//#region src/sdk/deploy-environment.d.ts
|
|
3
|
-
declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
|
|
4
|
-
declare class DeployEnvironmentError extends Error {
|
|
3
|
+
export declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
|
|
4
|
+
export declare class DeployEnvironmentError extends Error {
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
|
|
8
|
-
declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null):
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
|
|
8
|
+
export declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null): {
|
|
9
|
+
deploymentId: string | null;
|
|
10
|
+
deploymentUrl: string | null;
|
|
11
|
+
destinationReleaseId: string | null;
|
|
12
|
+
environment: string | null;
|
|
13
|
+
environmentName: string | null;
|
|
14
|
+
environmentTarget: string | null;
|
|
15
|
+
provider: "vercel";
|
|
16
|
+
} | {
|
|
17
|
+
accountId: string | null;
|
|
18
|
+
deploymentUrl: string | null;
|
|
19
|
+
destinationReleaseId: string | null;
|
|
20
|
+
environment: string | null;
|
|
21
|
+
environmentName: string | null;
|
|
22
|
+
environmentTarget: string | null;
|
|
23
|
+
provider: "cloudflare";
|
|
24
|
+
scriptName: string | null;
|
|
25
|
+
versionId: string | null;
|
|
26
|
+
} | {
|
|
27
|
+
deploymentUrl: string | null;
|
|
28
|
+
destinationReleaseId: string | null;
|
|
29
|
+
environment: string | null;
|
|
30
|
+
provider: "cli";
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { ReleaseDestinationMetadata } from "../integrations/index.mjs";
|
|
2
2
|
//#region src/sdk/deploy-environment.d.ts
|
|
3
|
-
declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
|
|
4
|
-
declare class DeployEnvironmentError extends Error {
|
|
3
|
+
export declare const DEPLOY_ENVIRONMENT_MAX_LENGTH = 32;
|
|
4
|
+
export declare class DeployEnvironmentError extends Error {
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
|
|
8
|
-
declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null):
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export declare function resolveDeployEnvironment(env: Record<string, string | undefined>): string;
|
|
8
|
+
export declare function applyDeployEnvironment(destination: ReleaseDestinationMetadata, environment: string | null): {
|
|
9
|
+
deploymentId: string | null;
|
|
10
|
+
deploymentUrl: string | null;
|
|
11
|
+
destinationReleaseId: string | null;
|
|
12
|
+
environment: string | null;
|
|
13
|
+
environmentName: string | null;
|
|
14
|
+
environmentTarget: string | null;
|
|
15
|
+
provider: "vercel";
|
|
16
|
+
} | {
|
|
17
|
+
accountId: string | null;
|
|
18
|
+
deploymentUrl: string | null;
|
|
19
|
+
destinationReleaseId: string | null;
|
|
20
|
+
environment: string | null;
|
|
21
|
+
environmentName: string | null;
|
|
22
|
+
environmentTarget: string | null;
|
|
23
|
+
provider: "cloudflare";
|
|
24
|
+
scriptName: string | null;
|
|
25
|
+
versionId: string | null;
|
|
26
|
+
} | {
|
|
27
|
+
deploymentUrl: string | null;
|
|
28
|
+
destinationReleaseId: string | null;
|
|
29
|
+
environment: string | null;
|
|
30
|
+
provider: "cli";
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{normalizeEnv}from"./runtime.mjs";function fromEnv(...names){return
|
|
1
|
+
import{normalizeEnv}from"./runtime.mjs";function fromEnv(...names){return(env=>{for(let name of names){let value=normalizeEnv(env[name]);if(value)return value}return null})}const PROVIDER_RESOLVERS={cloudflare:[fromEnv(`CLOUDFLARE_ENV`)],vercel:[fromEnv(`VERCEL_TARGET_ENV`,`VERCEL_ENV`)]},UNRESOLVED_ENVIRONMENT_MESSAGE=[`Could not determine the deploy environment for this build.`,`Set INTERFERE_ENVIRONMENT (e.g. production or preview), or deploy on a platform that sets VERCEL_ENV / CLOUDFLARE_ENV.`].join(`
|
|
2
2
|
`),DEPLOY_ENVIRONMENT_MAX_LENGTH=32;var DeployEnvironmentError=class extends Error{name=`DeployEnvironmentError`};function resolveEnvironmentValue(env){let explicit=normalizeEnv(env.INTERFERE_ENVIRONMENT);if(explicit)return explicit;for(let resolvers of Object.values(PROVIDER_RESOLVERS))for(let resolve of resolvers){let value=resolve(env);if(value)return value}return null}function resolveDeployEnvironment(env){let environment=resolveEnvironmentValue(env);if(!environment)throw new DeployEnvironmentError(UNRESOLVED_ENVIRONMENT_MESSAGE);if(environment.length>32)throw new DeployEnvironmentError(`Deploy environment "${environment}" is ${environment.length} characters; the maximum is 32. Set a shorter INTERFERE_ENVIRONMENT.`);return environment}function applyDeployEnvironment(destination,environment){return environment?destination.provider===`cli`?{...destination,environment}:{...destination,environment,environmentName:environment,environmentTarget:environment}:destination}export{DEPLOY_ENVIRONMENT_MAX_LENGTH,DeployEnvironmentError,applyDeployEnvironment,resolveDeployEnvironment};
|