@interfere/types 9.0.0 → 9.0.2
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/README.md +3 -3
- package/dist/data/frame.d.mts +16 -4
- package/dist/data/frame.d.mts.map +1 -1
- package/dist/data/frame.mjs +1 -16
- package/dist/data/frame.mjs.map +1 -1
- package/dist/data/session.d.mts +1 -1
- package/dist/data/session.d.mts.map +1 -1
- package/dist/data/session.mjs +1 -9
- package/dist/data/session.mjs.map +1 -1
- package/dist/data/source-maps.d.mts +133 -27
- package/dist/data/source-maps.d.mts.map +1 -1
- package/dist/data/source-maps.mjs +1 -21
- package/dist/data/source-maps.mjs.map +1 -1
- package/dist/events/error.d.mts +139 -35
- package/dist/events/error.d.mts.map +1 -1
- package/dist/events/error.mjs +1 -64
- package/dist/events/error.mjs.map +1 -1
- package/dist/events/pageleave.d.mts +1 -1
- package/dist/events/pageleave.mjs +1 -10
- package/dist/events/pageleave.mjs.map +1 -1
- package/dist/events/pageview.d.mts +1 -1
- package/dist/events/pageview.d.mts.map +1 -1
- package/dist/events/pageview.mjs +1 -11
- package/dist/events/pageview.mjs.map +1 -1
- package/dist/integrations/index.mjs +1 -57
- package/dist/integrations/index.mjs.map +1 -1
- package/dist/integrations/platforms/github.mjs +1 -13
- package/dist/integrations/platforms/github.mjs.map +1 -1
- package/dist/integrations/platforms/slack.d.mts +32 -0
- package/dist/integrations/platforms/slack.d.mts.map +1 -0
- package/dist/integrations/platforms/slack.mjs +1 -0
- package/dist/integrations/platforms/slack.mjs.map +1 -0
- package/dist/integrations/platforms/vercel.mjs +1 -26
- package/dist/integrations/platforms/vercel.mjs.map +1 -1
- package/dist/releases/definition.d.mts +2 -1
- package/dist/releases/definition.d.mts.map +1 -1
- package/dist/releases/definition.mjs +1 -63
- package/dist/releases/definition.mjs.map +1 -1
- package/dist/releases/slug.d.mts +22 -0
- package/dist/releases/slug.d.mts.map +1 -0
- package/dist/releases/slug.mjs +1 -0
- package/dist/releases/slug.mjs.map +1 -0
- package/dist/sdk/env.mjs +1 -17
- package/dist/sdk/env.mjs.map +1 -1
- package/dist/sdk/envelope.d.mts +161 -34
- package/dist/sdk/envelope.d.mts.map +1 -1
- package/dist/sdk/envelope.mjs +1 -114
- package/dist/sdk/envelope.mjs.map +1 -1
- package/dist/sdk/errors.d.mts +87 -30
- package/dist/sdk/errors.d.mts.map +1 -1
- package/dist/sdk/errors.mjs +2 -253
- package/dist/sdk/errors.mjs.map +1 -1
- package/dist/sdk/geo.mjs +1 -17
- package/dist/sdk/geo.mjs.map +1 -1
- package/dist/sdk/identify.d.mts +1 -1
- package/dist/sdk/identify.d.mts.map +1 -1
- package/dist/sdk/identify.mjs +1 -43
- package/dist/sdk/identify.mjs.map +1 -1
- package/dist/sdk/plugins/context/browser.d.mts +8 -0
- package/dist/sdk/plugins/context/browser.d.mts.map +1 -1
- package/dist/sdk/plugins/context/browser.mjs +1 -81
- package/dist/sdk/plugins/context/browser.mjs.map +1 -1
- package/dist/sdk/plugins/context/edge.mjs +1 -9
- package/dist/sdk/plugins/context/edge.mjs.map +1 -1
- package/dist/sdk/plugins/context/next.mjs +1 -50
- package/dist/sdk/plugins/context/next.mjs.map +1 -1
- package/dist/sdk/plugins/context/node.d.mts +12 -0
- package/dist/sdk/plugins/context/node.d.mts.map +1 -0
- package/dist/sdk/plugins/context/node.mjs +1 -0
- package/dist/sdk/plugins/context/node.mjs.map +1 -0
- package/dist/sdk/plugins/manifest.d.mts +5 -0
- package/dist/sdk/plugins/manifest.d.mts.map +1 -1
- package/dist/sdk/plugins/manifest.mjs +1 -62
- package/dist/sdk/plugins/manifest.mjs.map +1 -1
- package/dist/sdk/plugins/payload/errors.d.mts +27 -18
- package/dist/sdk/plugins/payload/errors.d.mts.map +1 -1
- package/dist/sdk/plugins/payload/errors.mjs +1 -37
- package/dist/sdk/plugins/payload/errors.mjs.map +1 -1
- package/dist/sdk/plugins/payload/page-events.d.mts +2 -2
- package/dist/sdk/plugins/payload/page-events.mjs +1 -25
- package/dist/sdk/plugins/payload/page-events.mjs.map +1 -1
- package/dist/sdk/plugins/payload/rage-click.mjs +1 -17
- package/dist/sdk/plugins/payload/rage-click.mjs.map +1 -1
- package/dist/sdk/plugins/payload/replay.mjs +1 -17
- package/dist/sdk/plugins/payload/replay.mjs.map +1 -1
- package/dist/sdk/remote-config.d.mts +31 -4
- package/dist/sdk/remote-config.d.mts.map +1 -1
- package/dist/sdk/remote-config.mjs +1 -5
- package/dist/sdk/remote-config.mjs.map +1 -1
- package/dist/sdk/runtime.mjs +1 -35
- package/dist/sdk/runtime.mjs.map +1 -1
- package/package.json +10 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.mjs","names":[],"sources":["../../src/events/error.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ingestedFrame } from \"#data/frame\";\n\nconst
|
|
1
|
+
{"version":3,"file":"error.mjs","names":[],"sources":["../../src/events/error.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ingestedFrame } from \"#data/frame\";\n\n/**\n * One stack frame after enrichment's source-map resolution stage.\n *\n * Discriminated on `resolved` — when source-map resolution succeeded\n * (`resolved: true`) the `original*` fields carry the post-resolution\n * positions; the `file` / `line` / `column` / `fn` fields keep the\n * pre-resolution (minified) positions for debugging. When resolution\n * couldn't run (`resolved: false`) the only positions available are\n * the pre-resolution ones, and the `original*` fields aren't on the\n * shape — the type system enforces it.\n *\n * `ingestedId` references back to the originating `IngestedFrame.id`\n * so consumers can pair pre/post-resolution frames without relying\n * on array index.\n */\nconst baseEnrichedFrameSchema = z.object({\n ingestedId: z.string(),\n inApp: z.boolean(),\n file: z.string().nullable(),\n line: z.number().nullable(),\n column: z.number().nullable(),\n fn: z.string().nullable(),\n});\n\nconst resolvedFrameSchema = baseEnrichedFrameSchema.extend({\n resolved: z.literal(true),\n originalFile: z.string().nullable(),\n originalLine: z.number().nullable(),\n originalColumn: z.number().nullable(),\n originalName: z.string().nullable(),\n});\n\nconst unresolvedFrameSchema = baseEnrichedFrameSchema.extend({\n resolved: z.literal(false),\n});\n\nexport const enrichedFrameSchema = z.discriminatedUnion(\"resolved\", [\n resolvedFrameSchema,\n unresolvedFrameSchema,\n]);\n\nexport type EnrichedFrame = z.infer<typeof enrichedFrameSchema>;\nexport type ResolvedFrame = z.infer<typeof resolvedFrameSchema>;\nexport type UnresolvedFrame = z.infer<typeof unresolvedFrameSchema>;\n\nexport const errorMechanismSchema = z.object({\n type: z.string(),\n handled: z.boolean(),\n synthetic: z.boolean().optional(),\n});\n\nexport type ErrorMechanism = z.infer<typeof errorMechanismSchema>;\n\nexport const errorContextSchema = z.object({\n framework: z.string().optional(),\n routerKind: z.enum([\"Pages Router\", \"App Router\"]).optional(),\n routePath: z.string().optional(),\n routeType: z\n .enum([\"render\", \"route\", \"action\", \"middleware\", \"proxy\"])\n .optional(),\n renderSource: z\n .enum([\n \"react-server-components\",\n \"react-server-components-payload\",\n \"server-rendering\",\n ])\n .optional(),\n revalidateReason: z.enum([\"on-demand\", \"stale\"]).optional(),\n renderType: z.enum([\"dynamic\", \"dynamic-resume\"]).optional(),\n requestPath: z.string().optional(),\n requestMethod: z.string().optional(),\n errorDigest: z.string().optional(),\n});\n\n/**\n * Wire-shape payload for an exception event captured by the SDK.\n * Discriminated on `capture`:\n *\n * - `\"error\"` — a real `Error` (or string coerced to one). Carries\n * parsed `frames` and the standard `name` / `message` / `stack`.\n * Production RSC sanitisation may reduce stack to just the header,\n * in which case the collector's stack parser drops the frames.\n *\n * - `\"non-error\"` — `Promise.reject({...})`, `Promise.reject(42)`,\n * etc. The frames here are from the catch site (where the rejection\n * was observed) since the rejected value carries no stack of its\n * own; the original payload rides on `serialized` so dashboards +\n * agent can render the structured value directly.\n *\n * The discriminator name (`capture`) is distinct from the\n * `ClassifierInput.event.kind` discriminator (which says \"this is a\n * triage flow for errors\"). `capture` says \"how the SDK saw it\".\n */\nconst errorPayloadCommonSchema = z.object({\n message: z.string().nullable(),\n name: z.string().nullable(),\n stack: z.string().nullable(),\n context: errorContextSchema.optional(),\n mechanism: errorMechanismSchema.optional(),\n captureSource: z.string().optional(),\n runtime: z.string().optional(),\n frames: z.array(ingestedFrame),\n});\n\nconst errorPayloadFromErrorSchema = errorPayloadCommonSchema.extend({\n capture: z.literal(\"error\"),\n});\n\nconst errorPayloadFromNonErrorSchema = errorPayloadCommonSchema.extend({\n capture: z.literal(\"non-error\"),\n /**\n * Original rejected payload preserved verbatim, depth-bounded +\n * circular-safe — see `serializeBoundedDepth` in\n * `@interfere/types/sdk/errors`. Only present on the `non-error`\n * variant; the type system prevents reading it on error-shaped\n * captures.\n *\n * Typed as `z.json()` (recursive JSON-encodable union) rather than\n * `z.unknown()` so the wire schema honestly advertises that this\n * field is always JSON-serializable — `serializeBoundedDepth` is\n * the source of that invariant. Reflects properly into JSON Schema\n * as well, where `z.unknown()` would emit `{}` (\"any value\").\n */\n serialized: z.json(),\n});\n\nexport const errorPayloadSchema = z.discriminatedUnion(\"capture\", [\n errorPayloadFromErrorSchema,\n errorPayloadFromNonErrorSchema,\n]);\n\nexport type ErrorPayload = z.infer<typeof errorPayloadSchema>;\n"],"mappings":"oEAmBA,MAAM,EAA0B,EAAE,OAAO,CACvC,WAAY,EAAE,QAAQ,CACtB,MAAO,EAAE,SAAS,CAClB,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,OAAQ,EAAE,QAAQ,CAAC,UAAU,CAC7B,GAAI,EAAE,QAAQ,CAAC,UAAU,CAC1B,CAAC,CAEI,EAAsB,EAAwB,OAAO,CACzD,SAAU,EAAE,QAAQ,GAAK,CACzB,aAAc,EAAE,QAAQ,CAAC,UAAU,CACnC,aAAc,EAAE,QAAQ,CAAC,UAAU,CACnC,eAAgB,EAAE,QAAQ,CAAC,UAAU,CACrC,aAAc,EAAE,QAAQ,CAAC,UAAU,CACpC,CAAC,CAEI,EAAwB,EAAwB,OAAO,CAC3D,SAAU,EAAE,QAAQ,GAAM,CAC3B,CAAC,CAEW,EAAsB,EAAE,mBAAmB,WAAY,CAClE,EACA,EACD,CAAC,CAMW,EAAuB,EAAE,OAAO,CAC3C,KAAM,EAAE,QAAQ,CAChB,QAAS,EAAE,SAAS,CACpB,UAAW,EAAE,SAAS,CAAC,UAAU,CAClC,CAAC,CAIW,EAAqB,EAAE,OAAO,CACzC,UAAW,EAAE,QAAQ,CAAC,UAAU,CAChC,WAAY,EAAE,KAAK,CAAC,eAAgB,aAAa,CAAC,CAAC,UAAU,CAC7D,UAAW,EAAE,QAAQ,CAAC,UAAU,CAChC,UAAW,EACR,KAAK,CAAC,SAAU,QAAS,SAAU,aAAc,QAAQ,CAAC,CAC1D,UAAU,CACb,aAAc,EACX,KAAK,CACJ,0BACA,kCACA,mBACD,CAAC,CACD,UAAU,CACb,iBAAkB,EAAE,KAAK,CAAC,YAAa,QAAQ,CAAC,CAAC,UAAU,CAC3D,WAAY,EAAE,KAAK,CAAC,UAAW,iBAAiB,CAAC,CAAC,UAAU,CAC5D,YAAa,EAAE,QAAQ,CAAC,UAAU,CAClC,cAAe,EAAE,QAAQ,CAAC,UAAU,CACpC,YAAa,EAAE,QAAQ,CAAC,UAAU,CACnC,CAAC,CAqBI,EAA2B,EAAE,OAAO,CACxC,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,MAAO,EAAE,QAAQ,CAAC,UAAU,CAC5B,QAAS,EAAmB,UAAU,CACtC,UAAW,EAAqB,UAAU,CAC1C,cAAe,EAAE,QAAQ,CAAC,UAAU,CACpC,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,OAAQ,EAAE,MAAM,EAAc,CAC/B,CAAC,CAEI,EAA8B,EAAyB,OAAO,CAClE,QAAS,EAAE,QAAQ,QAAQ,CAC5B,CAAC,CAEI,EAAiC,EAAyB,OAAO,CACrE,QAAS,EAAE,QAAQ,YAAY,CAc/B,WAAY,EAAE,MAAM,CACrB,CAAC,CAEW,EAAqB,EAAE,mBAAmB,UAAW,CAChE,EACA,EACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region src/events/pageleave.d.ts
|
|
4
4
|
declare const pageleaveFactsPayloadSchema: z.ZodObject<{
|
|
5
|
-
url: z.
|
|
5
|
+
url: z.ZodURL;
|
|
6
6
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
7
7
|
runtime: z.ZodOptional<z.ZodString>;
|
|
8
8
|
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/events/pageleave.ts
|
|
3
|
-
const pageleaveFactsPayloadSchema = z.object({
|
|
4
|
-
url: z.string(),
|
|
5
|
-
durationMs: z.number().optional(),
|
|
6
|
-
runtime: z.string().optional(),
|
|
7
|
-
releaseId: z.string().nullable().optional()
|
|
8
|
-
});
|
|
9
|
-
//#endregion
|
|
10
|
-
export { pageleaveFactsPayloadSchema };
|
|
1
|
+
import{z as e}from"zod";const t=e.object({url:e.url(),durationMs:e.number().optional(),runtime:e.string().optional(),releaseId:e.string().nullable().optional()});export{t as pageleaveFactsPayloadSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageleave.mjs","names":[],"sources":["../../src/events/pageleave.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageleaveFactsPayloadSchema = z.object({\n url: z.
|
|
1
|
+
{"version":3,"file":"pageleave.mjs","names":[],"sources":["../../src/events/pageleave.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageleaveFactsPayloadSchema = z.object({\n url: z.url(),\n durationMs: z.number().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type PageleaveFactsPayload = z.infer<typeof pageleaveFactsPayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAA8B,EAAE,OAAO,CAClD,IAAK,EAAE,KAAK,CACZ,WAAY,EAAE,QAAQ,CAAC,UAAU,CACjC,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,UAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAC5C,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region src/events/pageview.d.ts
|
|
4
4
|
declare const pageviewFactsPayloadSchema: z.ZodObject<{
|
|
5
|
-
url: z.
|
|
5
|
+
url: z.ZodURL;
|
|
6
6
|
title: z.ZodOptional<z.ZodString>;
|
|
7
7
|
referrer: z.ZodOptional<z.ZodString>;
|
|
8
8
|
runtime: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageview.d.mts","names":[],"sources":["../../src/events/pageview.ts"],"mappings":";;;cAEa,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;
|
|
1
|
+
{"version":3,"file":"pageview.d.mts","names":[],"sources":["../../src/events/pageview.ts"],"mappings":";;;cAEa,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;KAY3B,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,0BAAA"}
|
package/dist/events/pageview.mjs
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/events/pageview.ts
|
|
3
|
-
const pageviewFactsPayloadSchema = z.object({
|
|
4
|
-
url: z.string(),
|
|
5
|
-
title: z.string().optional(),
|
|
6
|
-
referrer: z.string().optional(),
|
|
7
|
-
runtime: z.string().optional(),
|
|
8
|
-
releaseId: z.string().nullable().optional()
|
|
9
|
-
});
|
|
10
|
-
//#endregion
|
|
11
|
-
export { pageviewFactsPayloadSchema };
|
|
1
|
+
import{z as e}from"zod";const t=e.object({url:e.url(),title:e.string().optional(),referrer:e.string().optional(),runtime:e.string().optional(),releaseId:e.string().nullable().optional()});export{t as pageviewFactsPayloadSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageview.mjs","names":[],"sources":["../../src/events/pageview.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageviewFactsPayloadSchema = z.object({\n url: z.
|
|
1
|
+
{"version":3,"file":"pageview.mjs","names":[],"sources":["../../src/events/pageview.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageviewFactsPayloadSchema = z.object({\n url: z.url(),\n title: z.string().optional(),\n // `referrer` is `document.referrer`, which is \"\" (empty string)\n // when navigation came from a non-referring source — RFC-ish URL\n // validation would reject those legitimate cases. Keep as plain\n // string and validate at consumption sites that need it.\n referrer: z.string().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type PageviewFactsPayload = z.infer<typeof pageviewFactsPayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAA6B,EAAE,OAAO,CACjD,IAAK,EAAE,KAAK,CACZ,MAAO,EAAE,QAAQ,CAAC,UAAU,CAK5B,SAAU,EAAE,QAAQ,CAAC,UAAU,CAC/B,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,UAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAC5C,CAAC"}
|
|
@@ -1,57 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { vercelDestinationIdEnvKeys } from "./platforms/vercel.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
//#region src/integrations/index.ts
|
|
5
|
-
const githubReleaseSourceSchema = z.object({
|
|
6
|
-
provider: z.literal("github"),
|
|
7
|
-
commitMessage: z.string(),
|
|
8
|
-
branch: z.string(),
|
|
9
|
-
commitSha: z.string().nullable()
|
|
10
|
-
}).meta({
|
|
11
|
-
id: "GithubReleaseSource",
|
|
12
|
-
title: "GithubReleaseSource",
|
|
13
|
-
description: "Release source metadata coming from GitHub."
|
|
14
|
-
});
|
|
15
|
-
const releaseSourceMetadataSchema = z.discriminatedUnion("provider", [githubReleaseSourceSchema]).meta({
|
|
16
|
-
id: "ReleaseSource",
|
|
17
|
-
title: "ReleaseSource"
|
|
18
|
-
});
|
|
19
|
-
const vercelReleaseDestinationSchema = z.object({
|
|
20
|
-
provider: z.literal("vercel"),
|
|
21
|
-
destinationReleaseId: z.string().nullable(),
|
|
22
|
-
environment: z.string().nullable(),
|
|
23
|
-
deploymentId: z.string().nullable(),
|
|
24
|
-
deploymentUrl: z.string().nullable(),
|
|
25
|
-
environmentName: z.string().nullable(),
|
|
26
|
-
environmentTarget: z.string().nullable()
|
|
27
|
-
}).meta({
|
|
28
|
-
id: "VercelReleaseDestination",
|
|
29
|
-
title: "VercelReleaseDestination",
|
|
30
|
-
description: "Release destination metadata for a Vercel deployment."
|
|
31
|
-
});
|
|
32
|
-
const releaseDestinationMetadataSchema = z.discriminatedUnion("provider", [vercelReleaseDestinationSchema]).meta({
|
|
33
|
-
id: "ReleaseDestination",
|
|
34
|
-
title: "ReleaseDestination"
|
|
35
|
-
});
|
|
36
|
-
const sourceProviderSchema = z.enum(["github"]).meta({
|
|
37
|
-
id: "SourceProvider",
|
|
38
|
-
title: "SourceProvider"
|
|
39
|
-
});
|
|
40
|
-
const destinationProviderSchema = z.enum(["vercel"]).meta({
|
|
41
|
-
id: "DestinationProvider",
|
|
42
|
-
title: "DestinationProvider"
|
|
43
|
-
});
|
|
44
|
-
const releaseSourceIdEnvKeys = z.enum([
|
|
45
|
-
"NEXT_PUBLIC_INTERFERE_BUILD_ID",
|
|
46
|
-
"INTERFERE_SOURCE_ID",
|
|
47
|
-
"NEXT_BUILD_ID",
|
|
48
|
-
...githubSourceIdEnvKeys
|
|
49
|
-
]).options;
|
|
50
|
-
const releaseDestinationIdEnvKeys = z.enum([
|
|
51
|
-
"NEXT_PUBLIC_INTERFERE_RELEASE_ID",
|
|
52
|
-
"INTERFERE_DESTINATION_ID",
|
|
53
|
-
...vercelDestinationIdEnvKeys,
|
|
54
|
-
...githubSourceIdEnvKeys
|
|
55
|
-
]).options;
|
|
56
|
-
//#endregion
|
|
57
|
-
export { destinationProviderSchema, githubReleaseSourceSchema, releaseDestinationIdEnvKeys, releaseDestinationMetadataSchema, releaseSourceIdEnvKeys, releaseSourceMetadataSchema, sourceProviderSchema, vercelReleaseDestinationSchema };
|
|
1
|
+
import{githubSourceIdEnvKeys as e}from"./platforms/github.mjs";import{vercelDestinationIdEnvKeys as t}from"./platforms/vercel.mjs";import{z as n}from"zod";const r=n.object({provider:n.literal(`github`),commitMessage:n.string(),branch:n.string(),commitSha:n.string().nullable()}).meta({id:`GithubReleaseSource`,title:`GithubReleaseSource`,description:`Release source metadata coming from GitHub.`}),i=n.discriminatedUnion(`provider`,[r]).meta({id:`ReleaseSource`,title:`ReleaseSource`}),a=n.object({provider:n.literal(`vercel`),destinationReleaseId:n.string().nullable(),environment:n.string().nullable(),deploymentId:n.string().nullable(),deploymentUrl:n.string().nullable(),environmentName:n.string().nullable(),environmentTarget:n.string().nullable()}).meta({id:`VercelReleaseDestination`,title:`VercelReleaseDestination`,description:`Release destination metadata for a Vercel deployment.`}),o=n.discriminatedUnion(`provider`,[a]).meta({id:`ReleaseDestination`,title:`ReleaseDestination`}),s=n.enum([`github`]).meta({id:`SourceProvider`,title:`SourceProvider`}),c=n.enum([`vercel`]).meta({id:`DestinationProvider`,title:`DestinationProvider`}),l=n.enum([`NEXT_PUBLIC_INTERFERE_BUILD_ID`,`INTERFERE_SOURCE_ID`,`NEXT_BUILD_ID`,...e]).options,u=n.enum([`NEXT_PUBLIC_INTERFERE_RELEASE_ID`,`INTERFERE_DESTINATION_ID`,...t,...e]).options;export{c as destinationProviderSchema,r as githubReleaseSourceSchema,u as releaseDestinationIdEnvKeys,o as releaseDestinationMetadataSchema,l as releaseSourceIdEnvKeys,i as releaseSourceMetadataSchema,s as sourceProviderSchema,a as vercelReleaseDestinationSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/integrations/index.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { githubSourceIdEnvKeys } from \"./platforms/github.js\";\nimport { vercelDestinationIdEnvKeys } from \"./platforms/vercel.js\";\n\nexport const githubReleaseSourceSchema = z\n .object({\n provider: z.literal(\"github\"),\n commitMessage: z.string(),\n branch: z.string(),\n commitSha: z.string().nullable(),\n })\n .meta({\n id: \"GithubReleaseSource\",\n title: \"GithubReleaseSource\",\n description: \"Release source metadata coming from GitHub.\",\n });\n\nexport const releaseSourceMetadataSchema = z\n .discriminatedUnion(\"provider\", [githubReleaseSourceSchema])\n .meta({ id: \"ReleaseSource\", title: \"ReleaseSource\" });\n\nexport type ReleaseSourceMetadata = z.infer<typeof releaseSourceMetadataSchema>;\n\nexport const vercelReleaseDestinationSchema = z\n .object({\n provider: z.literal(\"vercel\"),\n destinationReleaseId: z.string().nullable(),\n environment: z.string().nullable(),\n deploymentId: z.string().nullable(),\n deploymentUrl: z.string().nullable(),\n environmentName: z.string().nullable(),\n environmentTarget: z.string().nullable(),\n })\n .meta({\n id: \"VercelReleaseDestination\",\n title: \"VercelReleaseDestination\",\n description: \"Release destination metadata for a Vercel deployment.\",\n });\n\nexport const releaseDestinationMetadataSchema = z\n .discriminatedUnion(\"provider\", [vercelReleaseDestinationSchema])\n .meta({ id: \"ReleaseDestination\", title: \"ReleaseDestination\" });\n\nexport type ReleaseDestinationMetadata = z.infer<\n typeof releaseDestinationMetadataSchema\n>;\n\nexport const sourceProviderSchema = z\n .enum([\"github\"])\n .meta({ id: \"SourceProvider\", title: \"SourceProvider\" });\nexport type SourceProvider = z.infer<typeof sourceProviderSchema>;\n\nexport const destinationProviderSchema = z\n .enum([\"vercel\"])\n .meta({ id: \"DestinationProvider\", title: \"DestinationProvider\" });\nexport type DestinationProvider = z.infer<typeof destinationProviderSchema>;\n\nconst releaseSourceIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_BUILD_ID\",\n \"INTERFERE_SOURCE_ID\",\n \"NEXT_BUILD_ID\",\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseSourceIdEnvKeys = releaseSourceIdEnvKeySchema.options;\n\nconst releaseDestinationIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_RELEASE_ID\",\n \"INTERFERE_DESTINATION_ID\",\n ...vercelDestinationIdEnvKeys,\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseDestinationIdEnvKeys =\n releaseDestinationIdEnvKeySchema.options;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/integrations/index.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { githubSourceIdEnvKeys } from \"./platforms/github.js\";\nimport { vercelDestinationIdEnvKeys } from \"./platforms/vercel.js\";\n\nexport const githubReleaseSourceSchema = z\n .object({\n provider: z.literal(\"github\"),\n commitMessage: z.string(),\n branch: z.string(),\n commitSha: z.string().nullable(),\n })\n .meta({\n id: \"GithubReleaseSource\",\n title: \"GithubReleaseSource\",\n description: \"Release source metadata coming from GitHub.\",\n });\n\nexport const releaseSourceMetadataSchema = z\n .discriminatedUnion(\"provider\", [githubReleaseSourceSchema])\n .meta({ id: \"ReleaseSource\", title: \"ReleaseSource\" });\n\nexport type ReleaseSourceMetadata = z.infer<typeof releaseSourceMetadataSchema>;\n\nexport const vercelReleaseDestinationSchema = z\n .object({\n provider: z.literal(\"vercel\"),\n destinationReleaseId: z.string().nullable(),\n environment: z.string().nullable(),\n deploymentId: z.string().nullable(),\n deploymentUrl: z.string().nullable(),\n environmentName: z.string().nullable(),\n environmentTarget: z.string().nullable(),\n })\n .meta({\n id: \"VercelReleaseDestination\",\n title: \"VercelReleaseDestination\",\n description: \"Release destination metadata for a Vercel deployment.\",\n });\n\nexport const releaseDestinationMetadataSchema = z\n .discriminatedUnion(\"provider\", [vercelReleaseDestinationSchema])\n .meta({ id: \"ReleaseDestination\", title: \"ReleaseDestination\" });\n\nexport type ReleaseDestinationMetadata = z.infer<\n typeof releaseDestinationMetadataSchema\n>;\n\nexport const sourceProviderSchema = z\n .enum([\"github\"])\n .meta({ id: \"SourceProvider\", title: \"SourceProvider\" });\nexport type SourceProvider = z.infer<typeof sourceProviderSchema>;\n\nexport const destinationProviderSchema = z\n .enum([\"vercel\"])\n .meta({ id: \"DestinationProvider\", title: \"DestinationProvider\" });\nexport type DestinationProvider = z.infer<typeof destinationProviderSchema>;\n\nconst releaseSourceIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_BUILD_ID\",\n \"INTERFERE_SOURCE_ID\",\n \"NEXT_BUILD_ID\",\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseSourceIdEnvKeys = releaseSourceIdEnvKeySchema.options;\n\nconst releaseDestinationIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_RELEASE_ID\",\n \"INTERFERE_DESTINATION_ID\",\n ...vercelDestinationIdEnvKeys,\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseDestinationIdEnvKeys =\n releaseDestinationIdEnvKeySchema.options;\n"],"mappings":"2JAKA,MAAa,EAA4B,EACtC,OAAO,CACN,SAAU,EAAE,QAAQ,SAAS,CAC7B,cAAe,EAAE,QAAQ,CACzB,OAAQ,EAAE,QAAQ,CAClB,UAAW,EAAE,QAAQ,CAAC,UAAU,CACjC,CAAC,CACD,KAAK,CACJ,GAAI,sBACJ,MAAO,sBACP,YAAa,8CACd,CAAC,CAES,EAA8B,EACxC,mBAAmB,WAAY,CAAC,EAA0B,CAAC,CAC3D,KAAK,CAAE,GAAI,gBAAiB,MAAO,gBAAiB,CAAC,CAI3C,EAAiC,EAC3C,OAAO,CACN,SAAU,EAAE,QAAQ,SAAS,CAC7B,qBAAsB,EAAE,QAAQ,CAAC,UAAU,CAC3C,YAAa,EAAE,QAAQ,CAAC,UAAU,CAClC,aAAc,EAAE,QAAQ,CAAC,UAAU,CACnC,cAAe,EAAE,QAAQ,CAAC,UAAU,CACpC,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACtC,kBAAmB,EAAE,QAAQ,CAAC,UAAU,CACzC,CAAC,CACD,KAAK,CACJ,GAAI,2BACJ,MAAO,2BACP,YAAa,wDACd,CAAC,CAES,EAAmC,EAC7C,mBAAmB,WAAY,CAAC,EAA+B,CAAC,CAChE,KAAK,CAAE,GAAI,qBAAsB,MAAO,qBAAsB,CAAC,CAMrD,EAAuB,EACjC,KAAK,CAAC,SAAS,CAAC,CAChB,KAAK,CAAE,GAAI,iBAAkB,MAAO,iBAAkB,CAAC,CAG7C,EAA4B,EACtC,KAAK,CAAC,SAAS,CAAC,CAChB,KAAK,CAAE,GAAI,sBAAuB,MAAO,sBAAuB,CAAC,CASvD,EANuB,EAAE,KAAK,CACzC,iCACA,sBACA,gBACA,GAAG,EACJ,CACqC,CAA4B,QAQrD,EAN4B,EAAE,KAAK,CAC9C,mCACA,2BACA,GAAG,EACH,GAAG,EACJ,CAEC,CAAiC"}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
const githubSourceIdEnvKeys = z.enum(["VERCEL_GIT_COMMIT_SHA", "GITHUB_SHA"]).options;
|
|
3
|
-
const githubIntegration = z.object({
|
|
4
|
-
name: z.literal("github"),
|
|
5
|
-
metadata: z.object({
|
|
6
|
-
accountType: z.string(),
|
|
7
|
-
avatarUrl: z.string().nullable().default(null),
|
|
8
|
-
repositories: z.record(z.string(), z.string()),
|
|
9
|
-
installationUrl: z.string().nullable()
|
|
10
|
-
})
|
|
11
|
-
});
|
|
12
|
-
//#endregion
|
|
13
|
-
export { githubIntegration, githubSourceIdEnvKeys };
|
|
1
|
+
import{z as e}from"zod";const t=e.enum([`VERCEL_GIT_COMMIT_SHA`,`GITHUB_SHA`]).options,n=e.object({name:e.literal(`github`),metadata:e.object({accountType:e.string(),avatarUrl:e.string().nullable().default(null),repositories:e.record(e.string(),e.string()),installationUrl:e.string().nullable()})});export{n as githubIntegration,t as githubSourceIdEnvKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.mjs","names":[],"sources":["../../../src/integrations/platforms/github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst githubSourceIdEnvKeySchema = z.enum([\n \"VERCEL_GIT_COMMIT_SHA\",\n \"GITHUB_SHA\",\n]);\nexport const githubSourceIdEnvKeys = githubSourceIdEnvKeySchema.options;\n\nexport const githubIntegration = z.object({\n name: z.literal(\"github\"),\n metadata: z.object({\n accountType: z.string(),\n avatarUrl: z.string().nullable().default(null),\n repositories: z.record(z.string(), z.string()),\n installationUrl: z.string().nullable(),\n }),\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"github.mjs","names":[],"sources":["../../../src/integrations/platforms/github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst githubSourceIdEnvKeySchema = z.enum([\n \"VERCEL_GIT_COMMIT_SHA\",\n \"GITHUB_SHA\",\n]);\nexport const githubSourceIdEnvKeys = githubSourceIdEnvKeySchema.options;\n\nexport const githubIntegration = z.object({\n name: z.literal(\"github\"),\n metadata: z.object({\n accountType: z.string(),\n avatarUrl: z.string().nullable().default(null),\n repositories: z.record(z.string(), z.string()),\n installationUrl: z.string().nullable(),\n }),\n});\n"],"mappings":"wBAMA,MAAa,EAJsB,EAAE,KAAK,CACxC,wBACA,aACD,CACoC,CAA2B,QAEnD,EAAoB,EAAE,OAAO,CACxC,KAAM,EAAE,QAAQ,SAAS,CACzB,SAAU,EAAE,OAAO,CACjB,YAAa,EAAE,QAAQ,CACvB,UAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK,CAC9C,aAAc,EAAE,OAAO,EAAE,QAAQ,CAAE,EAAE,QAAQ,CAAC,CAC9C,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACvC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/integrations/platforms/slack.d.ts
|
|
4
|
+
declare const routableCategorySchema: z.ZodEnum<{
|
|
5
|
+
collaboration: "collaboration";
|
|
6
|
+
problems: "problems";
|
|
7
|
+
team: "team";
|
|
8
|
+
}>;
|
|
9
|
+
type RoutableCategory = z.infer<typeof routableCategorySchema>;
|
|
10
|
+
declare const slackChatRoutingEntrySchema: z.ZodObject<{
|
|
11
|
+
channelId: z.ZodString;
|
|
12
|
+
channelName: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
type SlackChatRoutingEntry = z.infer<typeof slackChatRoutingEntrySchema>;
|
|
15
|
+
declare const slackIntegration: z.ZodObject<{
|
|
16
|
+
name: z.ZodLiteral<"slack">;
|
|
17
|
+
metadata: z.ZodObject<{
|
|
18
|
+
teamId: z.ZodString;
|
|
19
|
+
teamName: z.ZodString;
|
|
20
|
+
installationUrl: z.ZodNullable<z.ZodString>;
|
|
21
|
+
chatRouting: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
22
|
+
collaboration: "collaboration";
|
|
23
|
+
problems: "problems";
|
|
24
|
+
team: "team";
|
|
25
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
26
|
+
channelId: z.ZodString;
|
|
27
|
+
channelName: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { RoutableCategory, SlackChatRoutingEntry, routableCategorySchema, slackChatRoutingEntrySchema, slackIntegration };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack.d.mts","names":[],"sources":["../../../src/integrations/platforms/slack.ts"],"mappings":";;;cAEa,sBAAA,EAAsB,CAAA,CAAA,OAAA;;;;;KAKvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA;AAAA,cAEjC,2BAAA,EAA2B,CAAA,CAAA,SAAA;;;;KAI5B,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,2BAAA;AAAA,cAEtC,gBAAA,EAAgB,CAAA,CAAA,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";const t=e.enum([`problems`,`team`,`collaboration`]),n=e.object({channelId:e.string(),channelName:e.string()}),r=e.object({name:e.literal(`slack`),metadata:e.object({teamId:e.string(),teamName:e.string(),installationUrl:e.string().nullable(),chatRouting:e.partialRecord(t,n).default({})})});export{t as routableCategorySchema,n as slackChatRoutingEntrySchema,r as slackIntegration};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack.mjs","names":[],"sources":["../../../src/integrations/platforms/slack.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const routableCategorySchema = z.enum([\n \"problems\",\n \"team\",\n \"collaboration\",\n]);\nexport type RoutableCategory = z.infer<typeof routableCategorySchema>;\n\nexport const slackChatRoutingEntrySchema = z.object({\n channelId: z.string(),\n channelName: z.string(),\n});\nexport type SlackChatRoutingEntry = z.infer<typeof slackChatRoutingEntrySchema>;\n\nexport const slackIntegration = z.object({\n name: z.literal(\"slack\"),\n metadata: z.object({\n teamId: z.string(),\n teamName: z.string(),\n installationUrl: z.string().nullable(),\n chatRouting: z\n .partialRecord(routableCategorySchema, slackChatRoutingEntrySchema)\n .default({}),\n }),\n});\n"],"mappings":"wBAEA,MAAa,EAAyB,EAAE,KAAK,CAC3C,WACA,OACA,gBACD,CAAC,CAGW,EAA8B,EAAE,OAAO,CAClD,UAAW,EAAE,QAAQ,CACrB,YAAa,EAAE,QAAQ,CACxB,CAAC,CAGW,EAAmB,EAAE,OAAO,CACvC,KAAM,EAAE,QAAQ,QAAQ,CACxB,SAAU,EAAE,OAAO,CACjB,OAAQ,EAAE,QAAQ,CAClB,SAAU,EAAE,QAAQ,CACpB,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACtC,YAAa,EACV,cAAc,EAAwB,EAA4B,CAClE,QAAQ,EAAE,CAAC,CACf,CAAC,CACH,CAAC"}
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
const vercelDestinationIdEnvKeys = z.enum(["VERCEL_DEPLOYMENT_ID"]).options;
|
|
3
|
-
const vercelMetadataBase = z.object({
|
|
4
|
-
avatar: z.string().nullable().default(null),
|
|
5
|
-
name: z.string().nullable().default(null),
|
|
6
|
-
installationUrl: z.string().nullable(),
|
|
7
|
-
projects: z.record(z.string(), z.string()).default({})
|
|
8
|
-
});
|
|
9
|
-
const vercelTeamMetadata = vercelMetadataBase.extend({
|
|
10
|
-
accountType: z.literal("team"),
|
|
11
|
-
id: z.string(),
|
|
12
|
-
slug: z.string()
|
|
13
|
-
});
|
|
14
|
-
const vercelUserMetadata = vercelMetadataBase.extend({
|
|
15
|
-
accountType: z.literal("user"),
|
|
16
|
-
id: z.string(),
|
|
17
|
-
username: z.string(),
|
|
18
|
-
email: z.string()
|
|
19
|
-
});
|
|
20
|
-
const vercelMetadataSchema = z.discriminatedUnion("accountType", [vercelTeamMetadata, vercelUserMetadata]);
|
|
21
|
-
const vercelIntegration = z.object({
|
|
22
|
-
name: z.literal("vercel"),
|
|
23
|
-
metadata: vercelMetadataSchema
|
|
24
|
-
});
|
|
25
|
-
//#endregion
|
|
26
|
-
export { vercelDestinationIdEnvKeys, vercelIntegration, vercelTeamMetadata, vercelUserMetadata };
|
|
1
|
+
import{z as e}from"zod";const t=e.enum([`VERCEL_DEPLOYMENT_ID`]).options,n=e.object({avatar:e.string().nullable().default(null),name:e.string().nullable().default(null),installationUrl:e.string().nullable(),projects:e.record(e.string(),e.string()).default({})}),r=n.extend({accountType:e.literal(`team`),id:e.string(),slug:e.string()}),i=n.extend({accountType:e.literal(`user`),id:e.string(),username:e.string(),email:e.string()}),a=e.discriminatedUnion(`accountType`,[r,i]),o=e.object({name:e.literal(`vercel`),metadata:a});export{t as vercelDestinationIdEnvKeys,o as vercelIntegration,r as vercelTeamMetadata,i as vercelUserMetadata};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel.mjs","names":[],"sources":["../../../src/integrations/platforms/vercel.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst vercelDestinationIdEnvKeySchema = z.enum([\"VERCEL_DEPLOYMENT_ID\"]);\nexport const vercelDestinationIdEnvKeys =\n vercelDestinationIdEnvKeySchema.options;\n\nconst vercelMetadataBase = z.object({\n avatar: z.string().nullable().default(null),\n name: z.string().nullable().default(null),\n installationUrl: z.string().nullable(),\n projects: z.record(z.string(), z.string()).default({}),\n});\n\nexport const vercelTeamMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"team\"),\n id: z.string(),\n slug: z.string(),\n});\n\nexport const vercelUserMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"user\"),\n id: z.string(),\n username: z.string(),\n email: z.string(),\n});\n\nconst vercelMetadataSchema = z.discriminatedUnion(\"accountType\", [\n vercelTeamMetadata,\n vercelUserMetadata,\n]);\n\nexport const vercelIntegration = z.object({\n name: z.literal(\"vercel\"),\n metadata: vercelMetadataSchema,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vercel.mjs","names":[],"sources":["../../../src/integrations/platforms/vercel.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst vercelDestinationIdEnvKeySchema = z.enum([\"VERCEL_DEPLOYMENT_ID\"]);\nexport const vercelDestinationIdEnvKeys =\n vercelDestinationIdEnvKeySchema.options;\n\nconst vercelMetadataBase = z.object({\n avatar: z.string().nullable().default(null),\n name: z.string().nullable().default(null),\n installationUrl: z.string().nullable(),\n projects: z.record(z.string(), z.string()).default({}),\n});\n\nexport const vercelTeamMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"team\"),\n id: z.string(),\n slug: z.string(),\n});\n\nexport const vercelUserMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"user\"),\n id: z.string(),\n username: z.string(),\n email: z.string(),\n});\n\nconst vercelMetadataSchema = z.discriminatedUnion(\"accountType\", [\n vercelTeamMetadata,\n vercelUserMetadata,\n]);\n\nexport const vercelIntegration = z.object({\n name: z.literal(\"vercel\"),\n metadata: vercelMetadataSchema,\n});\n"],"mappings":"wBAGA,MAAa,EAD2B,EAAE,KAAK,CAAC,uBAAuB,CAErE,CAAgC,QAE5B,EAAqB,EAAE,OAAO,CAClC,OAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK,CAC3C,KAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK,CACzC,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACtC,SAAU,EAAE,OAAO,EAAE,QAAQ,CAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CACvD,CAAC,CAEW,EAAqB,EAAmB,OAAO,CAC1D,YAAa,EAAE,QAAQ,OAAO,CAC9B,GAAI,EAAE,QAAQ,CACd,KAAM,EAAE,QAAQ,CACjB,CAAC,CAEW,EAAqB,EAAmB,OAAO,CAC1D,YAAa,EAAE,QAAQ,OAAO,CAC9B,GAAI,EAAE,QAAQ,CACd,SAAU,EAAE,QAAQ,CACpB,MAAO,EAAE,QAAQ,CAClB,CAAC,CAEI,EAAuB,EAAE,mBAAmB,cAAe,CAC/D,EACA,EACD,CAAC,CAEW,EAAoB,EAAE,OAAO,CACxC,KAAM,EAAE,QAAQ,SAAS,CACzB,SAAU,EACX,CAAC"}
|
|
@@ -26,6 +26,7 @@ declare const createReleaseRequest: z.ZodObject<{
|
|
|
26
26
|
environmentTarget: z.ZodNullable<z.ZodString>;
|
|
27
27
|
}, z.core.$strip>], "provider">>;
|
|
28
28
|
buildId: z.ZodString;
|
|
29
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
29
30
|
producerVersion: z.ZodOptional<z.ZodString>;
|
|
30
31
|
}, z.core.$strip>;
|
|
31
32
|
type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;
|
|
@@ -43,7 +44,7 @@ declare const createReleaseResponse: z.ZodObject<{
|
|
|
43
44
|
}, z.core.$strip>;
|
|
44
45
|
destination: z.ZodObject<{
|
|
45
46
|
id: z.ZodString;
|
|
46
|
-
slug: z.
|
|
47
|
+
slug: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
47
48
|
environment: z.ZodNullable<z.ZodString>;
|
|
48
49
|
}, z.core.$strip>;
|
|
49
50
|
build: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.mts","names":[],"sources":["../../src/releases/definition.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"definition.d.mts","names":[],"sources":["../../src/releases/definition.ts"],"mappings":";;;cAQa,mBAAA,EAAmB,CAAA,CAAA,OAAA;;;;;;;KAIpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAgB9B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;KAsBrB,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAErC,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;KA4BtB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA"}
|
|
@@ -1,63 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
//#region src/releases/definition.ts
|
|
4
|
-
const releaseStatusSchema = z.enum([
|
|
5
|
-
"pending",
|
|
6
|
-
"building",
|
|
7
|
-
"ready",
|
|
8
|
-
"errored",
|
|
9
|
-
"canceled"
|
|
10
|
-
]).meta({
|
|
11
|
-
id: "ReleaseStatus",
|
|
12
|
-
title: "ReleaseStatus"
|
|
13
|
-
});
|
|
14
|
-
const orgRefSchema = z.object({
|
|
15
|
-
id: z.string(),
|
|
16
|
-
slug: z.string()
|
|
17
|
-
}).meta({
|
|
18
|
-
id: "OrgRef",
|
|
19
|
-
title: "OrgRef"
|
|
20
|
-
});
|
|
21
|
-
const surfaceRefSchema = z.object({
|
|
22
|
-
id: z.string(),
|
|
23
|
-
slug: z.string()
|
|
24
|
-
}).meta({
|
|
25
|
-
id: "SurfaceRef",
|
|
26
|
-
title: "SurfaceRef"
|
|
27
|
-
});
|
|
28
|
-
const createReleaseRequest = z.object({
|
|
29
|
-
source: releaseSourceMetadataSchema,
|
|
30
|
-
destination: releaseDestinationMetadataSchema.nullable(),
|
|
31
|
-
buildId: z.string(),
|
|
32
|
-
producerVersion: z.string().optional()
|
|
33
|
-
}).meta({
|
|
34
|
-
id: "CreateReleaseRequest",
|
|
35
|
-
title: "CreateReleaseRequest",
|
|
36
|
-
description: "Request body for creating a release."
|
|
37
|
-
});
|
|
38
|
-
const createReleaseResponse = z.object({
|
|
39
|
-
org: orgRefSchema,
|
|
40
|
-
surface: surfaceRefSchema,
|
|
41
|
-
source: z.object({ id: z.string() }).meta({
|
|
42
|
-
id: "ReleaseSourceRef",
|
|
43
|
-
title: "ReleaseSourceRef"
|
|
44
|
-
}),
|
|
45
|
-
destination: z.object({
|
|
46
|
-
id: z.string(),
|
|
47
|
-
slug: z.string(),
|
|
48
|
-
environment: z.string().nullable()
|
|
49
|
-
}).meta({
|
|
50
|
-
id: "ReleaseDestinationRef",
|
|
51
|
-
title: "ReleaseDestinationRef"
|
|
52
|
-
}),
|
|
53
|
-
build: z.object({ hash: z.string() }).meta({
|
|
54
|
-
id: "ReleaseBuildRef",
|
|
55
|
-
title: "ReleaseBuildRef"
|
|
56
|
-
})
|
|
57
|
-
}).meta({
|
|
58
|
-
id: "CreateReleaseResponse",
|
|
59
|
-
title: "CreateReleaseResponse",
|
|
60
|
-
description: "Response body returned after creating a release."
|
|
61
|
-
});
|
|
62
|
-
//#endregion
|
|
63
|
-
export { createReleaseRequest, createReleaseResponse, releaseStatusSchema };
|
|
1
|
+
import{releaseDestinationMetadataSchema as e,releaseSourceMetadataSchema as t}from"../integrations/index.mjs";import{releaseSlugSchema as n}from"./slug.mjs";import{z as r}from"zod";const i=r.enum([`pending`,`building`,`ready`,`errored`,`canceled`]).meta({id:`ReleaseStatus`,title:`ReleaseStatus`}),a=r.object({id:r.string(),slug:r.string()}).meta({id:`OrgRef`,title:`OrgRef`}),o=r.object({id:r.string(),slug:r.string()}).meta({id:`SurfaceRef`,title:`SurfaceRef`}),s=r.object({source:t,destination:e.nullable(),buildId:r.string(),slug:r.string().optional(),producerVersion:r.string().optional()}).meta({id:`CreateReleaseRequest`,title:`CreateReleaseRequest`,description:`Request body for creating a release.`}),c=r.object({org:a,surface:o,source:r.object({id:r.string()}).meta({id:`ReleaseSourceRef`,title:`ReleaseSourceRef`}),destination:r.object({id:r.string(),slug:n,environment:r.string().nullable()}).meta({id:`ReleaseDestinationRef`,title:`ReleaseDestinationRef`}),build:r.object({hash:r.string()}).meta({id:`ReleaseBuildRef`,title:`ReleaseBuildRef`})}).meta({id:`CreateReleaseResponse`,title:`CreateReleaseResponse`,description:`Response body returned after creating a release.`});export{s as createReleaseRequest,c as createReleaseResponse,i as releaseStatusSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.mjs","names":[],"sources":["../../src/releases/definition.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport {\n releaseDestinationMetadataSchema,\n releaseSourceMetadataSchema,\n} from \"../integrations\";\n\nexport const releaseStatusSchema = z\n .enum([\"pending\", \"building\", \"ready\", \"errored\", \"canceled\"])\n .meta({ id: \"ReleaseStatus\", title: \"ReleaseStatus\" });\n\nexport type ReleaseStatus = z.infer<typeof releaseStatusSchema>;\n\nconst orgRefSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n })\n .meta({ id: \"OrgRef\", title: \"OrgRef\" });\n\nconst surfaceRefSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n })\n .meta({ id: \"SurfaceRef\", title: \"SurfaceRef\" });\n\nexport const createReleaseRequest = z\n .object({\n source: releaseSourceMetadataSchema,\n destination: releaseDestinationMetadataSchema.nullable(),\n buildId: z.string(),\n producerVersion: z.string().optional(),\n })\n .meta({\n id: \"CreateReleaseRequest\",\n title: \"CreateReleaseRequest\",\n description: \"Request body for creating a release.\",\n });\n\nexport type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;\n\nexport const createReleaseResponse = z\n .object({\n org: orgRefSchema,\n surface: surfaceRefSchema,\n source: z\n .object({\n id: z.string(),\n })\n .meta({ id: \"ReleaseSourceRef\", title: \"ReleaseSourceRef\" }),\n destination: z\n .object({\n id: z.string(),\n slug:
|
|
1
|
+
{"version":3,"file":"definition.mjs","names":[],"sources":["../../src/releases/definition.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport {\n releaseDestinationMetadataSchema,\n releaseSourceMetadataSchema,\n} from \"../integrations\";\nimport { releaseSlugSchema } from \"./slug\";\n\nexport const releaseStatusSchema = z\n .enum([\"pending\", \"building\", \"ready\", \"errored\", \"canceled\"])\n .meta({ id: \"ReleaseStatus\", title: \"ReleaseStatus\" });\n\nexport type ReleaseStatus = z.infer<typeof releaseStatusSchema>;\n\nconst orgRefSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n })\n .meta({ id: \"OrgRef\", title: \"OrgRef\" });\n\nconst surfaceRefSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n })\n .meta({ id: \"SurfaceRef\", title: \"SurfaceRef\" });\n\nexport const createReleaseRequest = z\n .object({\n source: releaseSourceMetadataSchema,\n destination: releaseDestinationMetadataSchema.nullable(),\n buildId: z.string(),\n /**\n * Client-supplied release slug. The SDK build plugin derives this from\n * the commit SHA (`rel_<first 16 hex>`) and stamps it into the bundle\n * as `__INTERFERE_RELEASE_SLUG__`, so server and client converge on the\n * same value with no shared secret. Optional only so direct API\n * callers (integration tests, scripts) can omit it; in that case the\n * server derives the same value from `buildId`.\n */\n slug: z.string().optional(),\n producerVersion: z.string().optional(),\n })\n .meta({\n id: \"CreateReleaseRequest\",\n title: \"CreateReleaseRequest\",\n description: \"Request body for creating a release.\",\n });\n\nexport type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;\n\nexport const createReleaseResponse = z\n .object({\n org: orgRefSchema,\n surface: surfaceRefSchema,\n source: z\n .object({\n id: z.string(),\n })\n .meta({ id: \"ReleaseSourceRef\", title: \"ReleaseSourceRef\" }),\n destination: z\n .object({\n id: z.string(),\n slug: releaseSlugSchema,\n environment: z.string().nullable(),\n })\n .meta({ id: \"ReleaseDestinationRef\", title: \"ReleaseDestinationRef\" }),\n build: z\n .object({\n hash: z.string(),\n })\n .meta({ id: \"ReleaseBuildRef\", title: \"ReleaseBuildRef\" }),\n })\n .meta({\n id: \"CreateReleaseResponse\",\n title: \"CreateReleaseResponse\",\n description: \"Response body returned after creating a release.\",\n });\n\nexport type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;\n"],"mappings":"qLAQA,MAAa,EAAsB,EAChC,KAAK,CAAC,UAAW,WAAY,QAAS,UAAW,WAAW,CAAC,CAC7D,KAAK,CAAE,GAAI,gBAAiB,MAAO,gBAAiB,CAAC,CAIlD,EAAe,EAClB,OAAO,CACN,GAAI,EAAE,QAAQ,CACd,KAAM,EAAE,QAAQ,CACjB,CAAC,CACD,KAAK,CAAE,GAAI,SAAU,MAAO,SAAU,CAAC,CAEpC,EAAmB,EACtB,OAAO,CACN,GAAI,EAAE,QAAQ,CACd,KAAM,EAAE,QAAQ,CACjB,CAAC,CACD,KAAK,CAAE,GAAI,aAAc,MAAO,aAAc,CAAC,CAErC,EAAuB,EACjC,OAAO,CACN,OAAQ,EACR,YAAa,EAAiC,UAAU,CACxD,QAAS,EAAE,QAAQ,CASnB,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACvC,CAAC,CACD,KAAK,CACJ,GAAI,uBACJ,MAAO,uBACP,YAAa,uCACd,CAAC,CAIS,EAAwB,EAClC,OAAO,CACN,IAAK,EACL,QAAS,EACT,OAAQ,EACL,OAAO,CACN,GAAI,EAAE,QAAQ,CACf,CAAC,CACD,KAAK,CAAE,GAAI,mBAAoB,MAAO,mBAAoB,CAAC,CAC9D,YAAa,EACV,OAAO,CACN,GAAI,EAAE,QAAQ,CACd,KAAM,EACN,YAAa,EAAE,QAAQ,CAAC,UAAU,CACnC,CAAC,CACD,KAAK,CAAE,GAAI,wBAAyB,MAAO,wBAAyB,CAAC,CACxE,MAAO,EACJ,OAAO,CACN,KAAM,EAAE,QAAQ,CACjB,CAAC,CACD,KAAK,CAAE,GAAI,kBAAmB,MAAO,kBAAmB,CAAC,CAC7D,CAAC,CACD,KAAK,CACJ,GAAI,wBACJ,MAAO,wBACP,YAAa,mDACd,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/releases/slug.d.ts
|
|
4
|
+
declare const releaseSlugSchema: z.core.$ZodBranded<z.ZodTemplateLiteral<`rel_${string}`>, "ReleaseSlug", "out">;
|
|
5
|
+
type ReleaseSlug = z.infer<typeof releaseSlugSchema>;
|
|
6
|
+
/**
|
|
7
|
+
* Derives a release slug from a commit SHA. Both ends of the wire — the
|
|
8
|
+
* build step that stamps the slug into the bundle, and any server-side
|
|
9
|
+
* upsert that reaches the same commit — compute the same `rel_<16hex>`
|
|
10
|
+
* shape with no shared secret, so no round-trip negotiation is needed.
|
|
11
|
+
*
|
|
12
|
+
* Git commit SHAs are uniformly distributed hex; the leading 16 chars give
|
|
13
|
+
* 64 bits of entropy, which is the same width the collector regex enforces.
|
|
14
|
+
* Cross-surface collisions on the same commit are intentional (eyeball-
|
|
15
|
+
* correlate slug to commit) — lookups are scoped by `(surfaceId, slug)`.
|
|
16
|
+
*
|
|
17
|
+
* Return type is `ReleaseSlug` (template-literal branded) so consumers
|
|
18
|
+
* can pass the result into branded sites without a re-validate.
|
|
19
|
+
*/
|
|
20
|
+
declare function deriveReleaseSlug(commitSha: string): ReleaseSlug;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ReleaseSlug, deriveReleaseSlug, releaseSlugSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slug.d.mts","names":[],"sources":["../../src/releases/slug.ts"],"mappings":";;;cAKa,iBAAA,EAAiB,CAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA,kBAAA;AAAA,KAIlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAJzC;;;;;;;;;;;AAIA;;;AAJA,iBAoBgB,iBAAA,CAAkB,SAAA,WAAoB,WAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";const t=`rel_`,n=e.templateLiteral([t,e.string().regex(/^[0-9a-f]{16}$/)]).brand();function r(e){return n.parse(`${t}${e.toLowerCase().slice(0,16)}`)}export{r as deriveReleaseSlug,n as releaseSlugSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slug.mjs","names":[],"sources":["../../src/releases/slug.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst SLUG_PREFIX = \"rel_\";\nconst SLUG_HEX_LEN = 16;\n\nexport const releaseSlugSchema = z\n .templateLiteral([SLUG_PREFIX, z.string().regex(/^[0-9a-f]{16}$/)])\n .brand<\"ReleaseSlug\">();\n\nexport type ReleaseSlug = z.infer<typeof releaseSlugSchema>;\n\n/**\n * Derives a release slug from a commit SHA. Both ends of the wire — the\n * build step that stamps the slug into the bundle, and any server-side\n * upsert that reaches the same commit — compute the same `rel_<16hex>`\n * shape with no shared secret, so no round-trip negotiation is needed.\n *\n * Git commit SHAs are uniformly distributed hex; the leading 16 chars give\n * 64 bits of entropy, which is the same width the collector regex enforces.\n * Cross-surface collisions on the same commit are intentional (eyeball-\n * correlate slug to commit) — lookups are scoped by `(surfaceId, slug)`.\n *\n * Return type is `ReleaseSlug` (template-literal branded) so consumers\n * can pass the result into branded sites without a re-validate.\n */\nexport function deriveReleaseSlug(commitSha: string): ReleaseSlug {\n return releaseSlugSchema.parse(\n `${SLUG_PREFIX}${commitSha.toLowerCase().slice(0, SLUG_HEX_LEN)}`\n );\n}\n"],"mappings":"wBAEA,MAAM,EAAc,OAGP,EAAoB,EAC9B,gBAAgB,CAAC,EAAa,EAAE,QAAQ,CAAC,MAAM,iBAAiB,CAAC,CAAC,CAClE,OAAsB,CAkBzB,SAAgB,EAAkB,EAAgC,CAChE,OAAO,EAAkB,MACvB,GAAG,IAAc,EAAU,aAAa,CAAC,MAAM,EAAG,GAAa,GAChE"}
|
package/dist/sdk/env.mjs
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
//#region src/sdk/env.ts
|
|
3
|
-
const interfereEnvValueSchema = z.string().trim().min(1);
|
|
4
|
-
function parseEnvValue(value) {
|
|
5
|
-
const parsed = interfereEnvValueSchema.safeParse(value);
|
|
6
|
-
if (!parsed.success) return null;
|
|
7
|
-
return parsed.data;
|
|
8
|
-
}
|
|
9
|
-
function readFirstEnvValue(env, keys) {
|
|
10
|
-
for (const key of keys) {
|
|
11
|
-
const value = parseEnvValue(env[key]);
|
|
12
|
-
if (value !== null) return value;
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { parseEnvValue, readFirstEnvValue };
|
|
1
|
+
import{z as e}from"zod";const t=e.string().trim().min(1);function n(e){let n=t.safeParse(e);return n.success?n.data:null}function r(e,t){for(let r of t){let t=n(e[r]);if(t!==null)return t}return null}export{n as parseEnvValue,r as readFirstEnvValue};
|
package/dist/sdk/env.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.mjs","names":[],"sources":["../../src/sdk/env.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst interfereEnvValueSchema = z.string().trim().min(1);\n\nexport function parseEnvValue(value: unknown) {\n const parsed = interfereEnvValueSchema.safeParse(value);\n if (!parsed.success) {\n return null;\n }\n\n return parsed.data;\n}\n\nexport function readFirstEnvValue(\n env: Record<string, string | undefined>,\n keys: readonly string[]\n) {\n for (const key of keys) {\n const value = parseEnvValue(env[key]);\n if (value !== null) {\n return value;\n }\n }\n\n return null;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.mjs","names":[],"sources":["../../src/sdk/env.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst interfereEnvValueSchema = z.string().trim().min(1);\n\nexport function parseEnvValue(value: unknown) {\n const parsed = interfereEnvValueSchema.safeParse(value);\n if (!parsed.success) {\n return null;\n }\n\n return parsed.data;\n}\n\nexport function readFirstEnvValue(\n env: Record<string, string | undefined>,\n keys: readonly string[]\n) {\n for (const key of keys) {\n const value = parseEnvValue(env[key]);\n if (value !== null) {\n return value;\n }\n }\n\n return null;\n}\n"],"mappings":"wBAEA,MAAM,EAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAExD,SAAgB,EAAc,EAAgB,CAC5C,IAAM,EAAS,EAAwB,UAAU,EAAM,CAKvD,OAJK,EAAO,QAIL,EAAO,KAHL,KAMX,SAAgB,EACd,EACA,EACA,CACA,IAAK,IAAM,KAAO,EAAM,CACtB,IAAM,EAAQ,EAAc,EAAI,GAAK,CACrC,GAAI,IAAU,KACZ,OAAO,EAIX,OAAO"}
|