@interfere/constants 9.0.0 → 9.0.2-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,15 +2,15 @@
2
2
  <a href="https://interfere.com">
3
3
  <picture>
4
4
  <source media="(prefers-color-scheme: dark)" srcset="https://qyzkf4cgb8ydxtq1.public.blob.vercel-storage.com/v2/header/logo-dark.png">
5
- <img src="https://qyzkf4cgb8ydxtq1.public.blob.vercel-storage.com/v2/header/logo-light.png" height="64">
5
+ <img src="https://qyzkf4cgb8ydxtq1.public.blob.vercel-storage.com/v2/header/logo-light.png" height="64" alt="Interfere">
6
6
  </picture>
7
7
  </a>
8
8
  <h1 align="center">@interfere/constants</h1>
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="https://www.npmjs.com/package/@interfere/constants"><img src="https://img.shields.io/npm/v/@interfere/constants.svg" /></a>
13
- <a href="https://github.com/interfere-inc/interfere/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@interfere/constants.svg" /></a>
12
+ <a href="https://www.npmjs.com/package/@interfere/constants"><img src="https://img.shields.io/npm/v/@interfere/constants.svg" alt="npm version" /></a>
13
+ <a href="https://github.com/interfere-inc/interfere/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@interfere/constants.svg" alt="License" /></a>
14
14
  </p>
15
15
 
16
16
  <p align="center">
package/dist/api.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const API_PATHS={CONFIG:`/v2/config`,SESSION:`/v2/session`,SINK:`/v2/sink`};exports.API_PATHS=API_PATHS,exports.API_URL=`https://in.interfere.com`;
package/dist/api.d.cts ADDED
@@ -0,0 +1,10 @@
1
+ //#region src/api.d.ts
2
+ declare const API_URL = "https://in.interfere.com";
3
+ declare const API_PATHS: {
4
+ readonly CONFIG: "/v2/config";
5
+ readonly SESSION: "/v2/session";
6
+ readonly SINK: "/v2/sink";
7
+ };
8
+ //#endregion
9
+ export { API_PATHS, API_URL };
10
+ //# sourceMappingURL=api.d.cts.map
package/dist/api.d.mts CHANGED
@@ -1,9 +1,10 @@
1
1
  //#region src/api.d.ts
2
2
  declare const API_URL = "https://in.interfere.com";
3
3
  declare const API_PATHS: {
4
- readonly CONFIG: "/v1/config";
5
- readonly INGEST: "/v1/ingest";
6
- readonly SESSION: "/v1/session";
4
+ readonly CONFIG: "/v2/config";
5
+ readonly SESSION: "/v2/session";
6
+ readonly SINK: "/v2/sink";
7
7
  };
8
8
  //#endregion
9
- export { API_PATHS, API_URL };
9
+ export { API_PATHS, API_URL };
10
+ //# sourceMappingURL=api.d.mts.map
package/dist/api.mjs CHANGED
@@ -1,9 +1,2 @@
1
- //#region src/api.ts
2
- const API_URL = "https://in.interfere.com";
3
- const API_PATHS = {
4
- CONFIG: "/v1/config",
5
- INGEST: "/v1/ingest",
6
- SESSION: "/v1/session"
7
- };
8
- //#endregion
9
- export { API_PATHS, API_URL };
1
+ const API_URL=`https://in.interfere.com`,API_PATHS={CONFIG:`/v2/config`,SESSION:`/v2/session`,SINK:`/v2/sink`};export{API_PATHS,API_URL};
2
+ //# sourceMappingURL=api.mjs.map
package/dist/http.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let better_status_codes=require("better-status-codes");Object.defineProperty(exports,"Status",{enumerable:!0,get:function(){return better_status_codes.Status}}),Object.defineProperty(exports,"StatusText",{enumerable:!0,get:function(){return better_status_codes.StatusText}});
@@ -0,0 +1,2 @@
1
+ import { Status, StatusText } from "better-status-codes";
2
+ export { Status, StatusText };
package/dist/http.mjs CHANGED
@@ -1,2 +1 @@
1
- import { Status, StatusText } from "better-status-codes";
2
- export { Status, StatusText };
1
+ import{Status,StatusText}from"better-status-codes";export{Status,StatusText};
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const DEFAULT_ROUTE_PREFIX=`/api/interfere`;function resolveRoutePrefix(){let fromGlobal=globalThis.__INTERFERE_ROUTE_PREFIX__;if(typeof fromGlobal==`string`&&fromGlobal.length>0)return normalizeRoutePrefix(fromGlobal);if(typeof process<`u`){let fromEnv=process.env.NEXT_PUBLIC_INTERFERE_ROUTE_PREFIX;if(typeof fromEnv==`string`&&fromEnv.length>0)return normalizeRoutePrefix(fromEnv)}return DEFAULT_ROUTE_PREFIX}function normalizeRoutePrefix(prefix){let trimmed=prefix.trim();if(trimmed===``||trimmed===`/`)return DEFAULT_ROUTE_PREFIX;let withLeading=trimmed.startsWith(`/`)?trimmed:`/${trimmed}`;return withLeading.endsWith(`/`)?withLeading.slice(0,-1):withLeading}exports.DEFAULT_ROUTE_PREFIX=DEFAULT_ROUTE_PREFIX,exports.normalizeRoutePrefix=normalizeRoutePrefix,exports.resolveRoutePrefix=resolveRoutePrefix;
@@ -0,0 +1,16 @@
1
+ //#region src/route-prefix.d.ts
2
+ declare const DEFAULT_ROUTE_PREFIX = "/api/interfere";
3
+ /**
4
+ * Resolves the route prefix used by the Interfere proxy route handler and the
5
+ * client-side SDK. Consumers can override `/api/interfere` by setting
6
+ * `NEXT_PUBLIC_INTERFERE_ROUTE_PREFIX` in their environment, or by injecting
7
+ * `globalThis.__INTERFERE_ROUTE_PREFIX__` (used by bundler plugins).
8
+ *
9
+ * The returned prefix is normalized: it always starts with `/` and never has a
10
+ * trailing slash (except when the prefix is exactly `/`).
11
+ */
12
+ declare function resolveRoutePrefix(): string;
13
+ declare function normalizeRoutePrefix(prefix: string): string;
14
+ //#endregion
15
+ export { DEFAULT_ROUTE_PREFIX, normalizeRoutePrefix, resolveRoutePrefix };
16
+ //# sourceMappingURL=route-prefix.d.cts.map
@@ -0,0 +1,16 @@
1
+ //#region src/route-prefix.d.ts
2
+ declare const DEFAULT_ROUTE_PREFIX = "/api/interfere";
3
+ /**
4
+ * Resolves the route prefix used by the Interfere proxy route handler and the
5
+ * client-side SDK. Consumers can override `/api/interfere` by setting
6
+ * `NEXT_PUBLIC_INTERFERE_ROUTE_PREFIX` in their environment, or by injecting
7
+ * `globalThis.__INTERFERE_ROUTE_PREFIX__` (used by bundler plugins).
8
+ *
9
+ * The returned prefix is normalized: it always starts with `/` and never has a
10
+ * trailing slash (except when the prefix is exactly `/`).
11
+ */
12
+ declare function resolveRoutePrefix(): string;
13
+ declare function normalizeRoutePrefix(prefix: string): string;
14
+ //#endregion
15
+ export { DEFAULT_ROUTE_PREFIX, normalizeRoutePrefix, resolveRoutePrefix };
16
+ //# sourceMappingURL=route-prefix.d.mts.map
@@ -0,0 +1,2 @@
1
+ const DEFAULT_ROUTE_PREFIX=`/api/interfere`;function resolveRoutePrefix(){let fromGlobal=globalThis.__INTERFERE_ROUTE_PREFIX__;if(typeof fromGlobal==`string`&&fromGlobal.length>0)return normalizeRoutePrefix(fromGlobal);if(typeof process<`u`){let fromEnv=process.env.NEXT_PUBLIC_INTERFERE_ROUTE_PREFIX;if(typeof fromEnv==`string`&&fromEnv.length>0)return normalizeRoutePrefix(fromEnv)}return DEFAULT_ROUTE_PREFIX}function normalizeRoutePrefix(prefix){let trimmed=prefix.trim();if(trimmed===``||trimmed===`/`)return DEFAULT_ROUTE_PREFIX;let withLeading=trimmed.startsWith(`/`)?trimmed:`/${trimmed}`;return withLeading.endsWith(`/`)?withLeading.slice(0,-1):withLeading}export{DEFAULT_ROUTE_PREFIX,normalizeRoutePrefix,resolveRoutePrefix};
2
+ //# sourceMappingURL=route-prefix.mjs.map
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@interfere/constants",
3
- "version": "9.0.0",
3
+ "version": "9.0.2-canary.0",
4
4
  "license": "MIT",
5
5
  "description": "Build apps that never break.",
6
6
  "keywords": [
7
7
  "observability",
8
- "typescript",
8
+ "@typescript/native-preview",
9
9
  "react",
10
10
  "logging",
11
11
  "error-tracking",
@@ -22,19 +22,46 @@
22
22
  "directory": "src/packages/public/constants"
23
23
  },
24
24
  "files": [
25
- "dist"
25
+ "dist/**/*.cjs",
26
+ "dist/**/*.mjs",
27
+ "dist/**/*.d.cts",
28
+ "dist/**/*.d.mts",
29
+ "README.md"
26
30
  ],
27
31
  "type": "module",
28
32
  "exports": {
29
33
  "./api": {
30
- "@source": "./src/api.ts",
31
- "types": "./dist/api.d.mts",
32
- "default": "./dist/api.mjs"
34
+ "monorepo": "./src/api.ts",
35
+ "import": {
36
+ "types": "./dist/api.d.mts",
37
+ "default": "./dist/api.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./dist/api.d.cts",
41
+ "default": "./dist/api.cjs"
42
+ }
33
43
  },
34
44
  "./http": {
35
- "@source": "./src/http.ts",
36
- "types": "./dist/http.d.mts",
37
- "default": "./dist/http.mjs"
45
+ "monorepo": "./src/http.ts",
46
+ "import": {
47
+ "types": "./dist/http.d.mts",
48
+ "default": "./dist/http.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/http.d.cts",
52
+ "default": "./dist/http.cjs"
53
+ }
54
+ },
55
+ "./route-prefix": {
56
+ "monorepo": "./src/route-prefix.ts",
57
+ "import": {
58
+ "types": "./dist/route-prefix.d.mts",
59
+ "default": "./dist/route-prefix.mjs"
60
+ },
61
+ "require": {
62
+ "types": "./dist/route-prefix.d.cts",
63
+ "default": "./dist/route-prefix.cjs"
64
+ }
38
65
  },
39
66
  "./package.json": "./package.json"
40
67
  },
@@ -43,15 +70,18 @@
43
70
  },
44
71
  "scripts": {
45
72
  "build": "tsdown",
46
- "typecheck": "tsc --noEmit --incremental"
73
+ "test": "vitest run --passWithNoTests",
74
+ "typecheck": "tsgo --noEmit --incremental"
47
75
  },
48
76
  "dependencies": {
49
77
  "better-status-codes": "^2.2.0"
50
78
  },
51
79
  "devDependencies": {
80
+ "@interfere/test-utils": "^9.0.0",
52
81
  "@interfere/typescript-config": "^9.0.0",
53
82
  "@types/node": "^24.12.0",
54
- "tsdown": "^0.21.10",
55
- "typescript": "6.0.3"
83
+ "@typescript/native-preview": "7.0.0-dev.20260522.1",
84
+ "tsdown": "^0.22.0",
85
+ "vitest": "^4.1.6"
56
86
  }
57
87
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.mts","names":[],"sources":["../src/api.ts"],"mappings":";cAAa,OAAA;AAAA,cAEA,SAAA;EAAA"}
package/dist/api.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.mjs","names":[],"sources":["../src/api.ts"],"sourcesContent":["export const API_URL = \"https://in.interfere.com\";\n\nexport const API_PATHS = {\n CONFIG: \"/v1/config\",\n INGEST: \"/v1/ingest\",\n SESSION: \"/v1/session\",\n} as const;\n"],"mappings":";AAAA,MAAa,UAAU;AAEvB,MAAa,YAAY;CACvB,QAAQ;CACR,QAAQ;CACR,SAAS;CACV"}