@interfere/types 9.0.3-canary.0 → 9.0.3-canary.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.
Files changed (105) hide show
  1. package/README.md +1 -1
  2. package/dist/data/frame.d.cts +1 -2
  3. package/dist/data/frame.d.mts +1 -2
  4. package/dist/data/frame.mjs +1 -2
  5. package/dist/data/session.d.cts +1 -2
  6. package/dist/data/session.d.mts +1 -2
  7. package/dist/data/session.mjs +1 -2
  8. package/dist/data/source-maps.d.cts +1 -2
  9. package/dist/data/source-maps.d.mts +1 -2
  10. package/dist/data/source-maps.mjs +1 -2
  11. package/dist/events/error.d.cts +1 -2
  12. package/dist/events/error.d.mts +1 -2
  13. package/dist/events/error.mjs +1 -2
  14. package/dist/events/pageleave.d.cts +1 -2
  15. package/dist/events/pageleave.d.mts +1 -2
  16. package/dist/events/pageleave.mjs +1 -2
  17. package/dist/events/pageview.d.cts +1 -2
  18. package/dist/events/pageview.d.mts +1 -2
  19. package/dist/events/pageview.mjs +1 -2
  20. package/dist/integrations/index.cjs +1 -1
  21. package/dist/integrations/index.d.cts +85 -3
  22. package/dist/integrations/index.d.mts +85 -3
  23. package/dist/integrations/index.mjs +1 -2
  24. package/dist/integrations/platforms/cli.d.cts +1 -2
  25. package/dist/integrations/platforms/cli.d.mts +1 -2
  26. package/dist/integrations/platforms/cli.mjs +1 -2
  27. package/dist/integrations/platforms/cloudflare.cjs +1 -0
  28. package/dist/integrations/platforms/cloudflare.d.cts +29 -0
  29. package/dist/integrations/platforms/cloudflare.d.mts +29 -0
  30. package/dist/integrations/platforms/cloudflare.mjs +1 -0
  31. package/dist/integrations/platforms/github.cjs +1 -1
  32. package/dist/integrations/platforms/github.d.cts +62 -2
  33. package/dist/integrations/platforms/github.d.mts +62 -2
  34. package/dist/integrations/platforms/github.mjs +1 -2
  35. package/dist/integrations/platforms/slack.d.cts +1 -2
  36. package/dist/integrations/platforms/slack.d.mts +1 -2
  37. package/dist/integrations/platforms/slack.mjs +1 -2
  38. package/dist/integrations/platforms/vercel.d.cts +1 -2
  39. package/dist/integrations/platforms/vercel.d.mts +1 -2
  40. package/dist/integrations/platforms/vercel.mjs +1 -2
  41. package/dist/releases/definition.d.cts +30 -2
  42. package/dist/releases/definition.d.mts +30 -2
  43. package/dist/releases/definition.mjs +1 -2
  44. package/dist/releases/slug.d.cts +1 -2
  45. package/dist/releases/slug.d.mts +1 -2
  46. package/dist/releases/slug.mjs +1 -2
  47. package/dist/sdk/cli-destination.cjs +1 -0
  48. package/dist/sdk/cli-destination.d.cts +7 -0
  49. package/dist/sdk/cli-destination.d.mts +7 -0
  50. package/dist/sdk/cli-destination.mjs +1 -0
  51. package/dist/sdk/deploy-environment.cjs +2 -0
  52. package/dist/sdk/deploy-environment.d.cts +5 -0
  53. package/dist/sdk/deploy-environment.d.mts +5 -0
  54. package/dist/sdk/deploy-environment.mjs +2 -0
  55. package/dist/sdk/env.d.cts +1 -2
  56. package/dist/sdk/env.d.mts +1 -2
  57. package/dist/sdk/env.mjs +1 -2
  58. package/dist/sdk/envelope.d.cts +13 -62
  59. package/dist/sdk/envelope.d.mts +13 -62
  60. package/dist/sdk/envelope.mjs +1 -2
  61. package/dist/sdk/errors.cjs +1 -1
  62. package/dist/sdk/errors.d.cts +9 -2
  63. package/dist/sdk/errors.d.mts +9 -2
  64. package/dist/sdk/errors.mjs +2 -3
  65. package/dist/sdk/geo.d.cts +1 -2
  66. package/dist/sdk/geo.d.mts +1 -2
  67. package/dist/sdk/geo.mjs +1 -2
  68. package/dist/sdk/identify.d.cts +1 -2
  69. package/dist/sdk/identify.d.mts +1 -2
  70. package/dist/sdk/identify.mjs +1 -2
  71. package/dist/sdk/plugins/context/browser.d.cts +1 -2
  72. package/dist/sdk/plugins/context/browser.d.mts +1 -2
  73. package/dist/sdk/plugins/context/browser.mjs +1 -2
  74. package/dist/sdk/plugins/context/edge.d.cts +1 -2
  75. package/dist/sdk/plugins/context/edge.d.mts +1 -2
  76. package/dist/sdk/plugins/context/edge.mjs +1 -2
  77. package/dist/sdk/plugins/context/next.d.cts +1 -2
  78. package/dist/sdk/plugins/context/next.d.mts +1 -2
  79. package/dist/sdk/plugins/context/next.mjs +1 -2
  80. package/dist/sdk/plugins/context/node.d.cts +1 -2
  81. package/dist/sdk/plugins/context/node.d.mts +1 -2
  82. package/dist/sdk/plugins/context/node.mjs +1 -2
  83. package/dist/sdk/plugins/manifest.d.cts +1 -2
  84. package/dist/sdk/plugins/manifest.d.mts +1 -2
  85. package/dist/sdk/plugins/manifest.mjs +1 -2
  86. package/dist/sdk/plugins/payload/errors.d.cts +1 -2
  87. package/dist/sdk/plugins/payload/errors.d.mts +1 -2
  88. package/dist/sdk/plugins/payload/errors.mjs +1 -2
  89. package/dist/sdk/plugins/payload/page-events.d.cts +1 -2
  90. package/dist/sdk/plugins/payload/page-events.d.mts +1 -2
  91. package/dist/sdk/plugins/payload/page-events.mjs +1 -2
  92. package/dist/sdk/plugins/payload/rage-click.d.cts +1 -2
  93. package/dist/sdk/plugins/payload/rage-click.d.mts +1 -2
  94. package/dist/sdk/plugins/payload/rage-click.mjs +1 -2
  95. package/dist/sdk/plugins/payload/replay.d.cts +1 -2
  96. package/dist/sdk/plugins/payload/replay.d.mts +1 -2
  97. package/dist/sdk/plugins/payload/replay.mjs +1 -2
  98. package/dist/sdk/remote-config.d.cts +1 -2
  99. package/dist/sdk/remote-config.d.mts +1 -2
  100. package/dist/sdk/remote-config.mjs +1 -2
  101. package/dist/sdk/runtime.cjs +1 -1
  102. package/dist/sdk/runtime.d.cts +26 -8
  103. package/dist/sdk/runtime.d.mts +26 -8
  104. package/dist/sdk/runtime.mjs +1 -2
  105. package/package.json +8 -30
@@ -1,12 +1,31 @@
1
1
  import { z } from "zod";
2
2
 
3
3
  //#region src/sdk/runtime.d.ts
4
- declare const envSchema: z.ZodNullable<z.ZodEnum<{
5
- development: "development";
6
- preview: "preview";
7
- production: "production";
8
- }>>;
4
+ declare const envSchema: z.ZodNullable<z.ZodString>;
9
5
  type Env = z.infer<typeof envSchema>;
6
+ /**
7
+ * Fallback environment when nothing is configured. `development` (not
8
+ * `production`, which is what Sentry defaults to) because the collector has
9
+ * an always-on per-surface environment filter — an unconfigured run is far
10
+ * more likely a developer's laptop than a real deploy, so a filtered-by-default
11
+ * label keeps local noise out of product data. A real deploy sets one of the
12
+ * higher-precedence signals below.
13
+ */
14
+ declare const DEFAULT_ENVIRONMENT = "development";
15
+ /**
16
+ * Resolve the deployment environment using a precedence chain modelled on
17
+ * Sentry's: an explicit value (init option) wins, then a dedicated
18
+ * `INTERFERE_ENVIRONMENT`, then platform signals (`VERCEL_ENV`), then
19
+ * `NODE_ENV` as a last-resort fallback, then {@link DEFAULT_ENVIRONMENT}.
20
+ *
21
+ * `NODE_ENV` is deliberately last: it's a build-mode flag (staging, preview,
22
+ * and prod all ship `NODE_ENV=production`), not a deploy-environment
23
+ * identifier. The dedicated var is the real abstraction.
24
+ */
25
+ declare function resolveEnvironment(opts?: {
26
+ readonly explicit?: string | null | undefined;
27
+ readonly env?: Record<string, string | undefined>;
28
+ }): string;
10
29
  declare const runtimeSchema: z.ZodNullable<z.ZodEnum<{
11
30
  browser: "browser";
12
31
  edge: "edge";
@@ -16,7 +35,6 @@ type Runtime = z.infer<typeof runtimeSchema>;
16
35
  declare function inferRuntime(options?: {
17
36
  readonly nextRuntime?: unknown;
18
37
  }): Runtime;
19
- declare function normalizeEnv(value: unknown): Env;
38
+ declare function normalizeEnv(value: unknown): string | null;
20
39
  //#endregion
21
- export { Env, Runtime, envSchema, inferRuntime, normalizeEnv, runtimeSchema };
22
- //# sourceMappingURL=runtime.d.cts.map
40
+ export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
@@ -1,12 +1,31 @@
1
1
  import { z } from "zod";
2
2
 
3
3
  //#region src/sdk/runtime.d.ts
4
- declare const envSchema: z.ZodNullable<z.ZodEnum<{
5
- development: "development";
6
- preview: "preview";
7
- production: "production";
8
- }>>;
4
+ declare const envSchema: z.ZodNullable<z.ZodString>;
9
5
  type Env = z.infer<typeof envSchema>;
6
+ /**
7
+ * Fallback environment when nothing is configured. `development` (not
8
+ * `production`, which is what Sentry defaults to) because the collector has
9
+ * an always-on per-surface environment filter — an unconfigured run is far
10
+ * more likely a developer's laptop than a real deploy, so a filtered-by-default
11
+ * label keeps local noise out of product data. A real deploy sets one of the
12
+ * higher-precedence signals below.
13
+ */
14
+ declare const DEFAULT_ENVIRONMENT = "development";
15
+ /**
16
+ * Resolve the deployment environment using a precedence chain modelled on
17
+ * Sentry's: an explicit value (init option) wins, then a dedicated
18
+ * `INTERFERE_ENVIRONMENT`, then platform signals (`VERCEL_ENV`), then
19
+ * `NODE_ENV` as a last-resort fallback, then {@link DEFAULT_ENVIRONMENT}.
20
+ *
21
+ * `NODE_ENV` is deliberately last: it's a build-mode flag (staging, preview,
22
+ * and prod all ship `NODE_ENV=production`), not a deploy-environment
23
+ * identifier. The dedicated var is the real abstraction.
24
+ */
25
+ declare function resolveEnvironment(opts?: {
26
+ readonly explicit?: string | null | undefined;
27
+ readonly env?: Record<string, string | undefined>;
28
+ }): string;
10
29
  declare const runtimeSchema: z.ZodNullable<z.ZodEnum<{
11
30
  browser: "browser";
12
31
  edge: "edge";
@@ -16,7 +35,6 @@ type Runtime = z.infer<typeof runtimeSchema>;
16
35
  declare function inferRuntime(options?: {
17
36
  readonly nextRuntime?: unknown;
18
37
  }): Runtime;
19
- declare function normalizeEnv(value: unknown): Env;
38
+ declare function normalizeEnv(value: unknown): string | null;
20
39
  //#endregion
21
- export { Env, Runtime, envSchema, inferRuntime, normalizeEnv, runtimeSchema };
22
- //# sourceMappingURL=runtime.d.mts.map
40
+ export { DEFAULT_ENVIRONMENT, Env, Runtime, envSchema, inferRuntime, normalizeEnv, resolveEnvironment, runtimeSchema };
@@ -1,2 +1 @@
1
- import{z}from"zod";const envSchema=z.enum([`development`,`preview`,`production`]).nullable().meta({id:`Environment`,title:`Environment`,description:`Deployment environment the SDK is running in.`}),runtimeSchema=z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`});function inferRuntime(options){return typeof window<`u`&&typeof document<`u`&&typeof navigator<`u`?`browser`:typeof globalThis.EdgeRuntime==`string`||options?.nextRuntime===`edge`?`edge`:typeof process<`u`&&typeof process.versions?.node==`string`?`node`:null}function normalizeEnv(value){if(typeof value!=`string`)return null;let env=value.toLowerCase();return envSchema.safeParse(env).success?env:null}export{envSchema,inferRuntime,normalizeEnv,runtimeSchema};
2
- //# sourceMappingURL=runtime.mjs.map
1
+ import{z}from"zod";const envSchema=z.string().min(1).nullable().meta({id:`Environment`,title:`Environment`,description:"Deployment environment the SDK is running in. Free-form label (e.g. `production`, `preview`, `staging`, `development`)."}),DEFAULT_ENVIRONMENT=`development`,ENVIRONMENT_ENV_VARS=[`INTERFERE_ENVIRONMENT`,`VERCEL_ENV`,`NODE_ENV`];function resolveEnvironment(opts){let env=opts?.env??{},explicit=normalizeEnv(opts?.explicit);if(explicit)return explicit;for(let key of ENVIRONMENT_ENV_VARS){let value=normalizeEnv(env[key]);if(value)return value}return DEFAULT_ENVIRONMENT}const runtimeSchema=z.enum([`browser`,`node`,`edge`]).nullable().meta({id:`Runtime`,title:`Runtime`,description:`JavaScript runtime the SDK is running in.`});function inferRuntime(options){return typeof window<`u`&&typeof document<`u`&&typeof navigator<`u`?`browser`:typeof globalThis.EdgeRuntime==`string`||options?.nextRuntime===`edge`?`edge`:typeof process<`u`&&typeof process.versions?.node==`string`?`node`:null}function normalizeEnv(value){if(typeof value!=`string`)return null;let env=value.trim().toLowerCase();return env.length>0?env:null}export{DEFAULT_ENVIRONMENT,envSchema,inferRuntime,normalizeEnv,resolveEnvironment,runtimeSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interfere/types",
3
- "version": "9.0.3-canary.0",
3
+ "version": "9.0.3-canary.2",
4
4
  "license": "MIT",
5
5
  "description": "TypeScript & Zod types for Interfere",
6
6
  "keywords": [
@@ -15,7 +15,7 @@
15
15
  "author": "Interfere <support@interfere.com> (https://interfere.com)",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/interfere-inc/interfere.git",
18
+ "url": "git+https://interfere.ghe.com/interfere/interfere.git",
19
19
  "directory": "src/packages/public/types"
20
20
  },
21
21
  "files": [
@@ -38,17 +38,6 @@
38
38
  "default": "./dist/data/*.cjs"
39
39
  }
40
40
  },
41
- "#auth/*": {
42
- "monorepo": "./src/auth/*.ts",
43
- "import": {
44
- "types": "./dist/auth/*.d.mts",
45
- "default": "./dist/auth/*.mjs"
46
- },
47
- "require": {
48
- "types": "./dist/auth/*.d.cts",
49
- "default": "./dist/auth/*.cjs"
50
- }
51
- },
52
41
  "#sdk/*": {
53
42
  "monorepo": "./src/sdk/*.ts",
54
43
  "import": {
@@ -84,17 +73,6 @@
84
73
  "default": "./dist/data/*.cjs"
85
74
  }
86
75
  },
87
- "./auth/*": {
88
- "monorepo": "./src/auth/*.ts",
89
- "import": {
90
- "types": "./dist/auth/*.d.mts",
91
- "default": "./dist/auth/*.mjs"
92
- },
93
- "require": {
94
- "types": "./dist/auth/*.d.cts",
95
- "default": "./dist/auth/*.cjs"
96
- }
97
- },
98
76
  "./sdk/plugins/*": {
99
77
  "monorepo": "./src/sdk/plugins/*.ts",
100
78
  "import": {
@@ -168,7 +146,7 @@
168
146
  "scripts": {
169
147
  "build": "tsdown",
170
148
  "test": "vitest run",
171
- "typecheck": "tsgo --noEmit --incremental"
149
+ "typecheck": "tsgo --noEmit"
172
150
  },
173
151
  "dependencies": {
174
152
  "zod": "^4.4.3"
@@ -176,10 +154,10 @@
176
154
  "devDependencies": {
177
155
  "@interfere/test-utils": "^9.0.0",
178
156
  "@interfere/typescript-config": "^9.0.0",
179
- "@types/node": "^24.12.0",
180
- "@typescript/native-preview": "7.0.0-dev.20260522.1",
181
- "@vitest/coverage-v8": "^4.1.6",
182
- "tsdown": "^0.22.0",
183
- "vitest": "^4.1.6"
157
+ "@types/node": "^25.9.3",
158
+ "@typescript/native-preview": "7.0.0-dev.20260617.2",
159
+ "@vitest/coverage-v8": "4.1.9",
160
+ "tsdown": "^0.22.2",
161
+ "vitest": "4.1.9"
184
162
  }
185
163
  }