@prosopo/api-route 2.6.1 → 2.6.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # @prosopo/api-route
2
2
 
3
+ ## 2.6.9
4
+ ### Patch Changes
5
+
6
+ - eb71691: configure typecheck before bundle for vue packages
7
+ - eb71691: make typecheck script always recompile
8
+ - Updated dependencies [eb71691]
9
+ - Updated dependencies [eb71691]
10
+ - @prosopo/common@3.1.1
11
+ - @prosopo/config@3.1.2
12
+
13
+ ## 2.6.8
14
+ ### Patch Changes
15
+
16
+ - 3573f0b: fix npm scripts bundle command
17
+ - 3573f0b: build using vite, typecheck using tsc
18
+ - efd8102: Add tests for unwrap error helper
19
+ - 3573f0b: standardise all vite based npm scripts for bundling
20
+ - Updated dependencies [3573f0b]
21
+ - Updated dependencies [3573f0b]
22
+ - Updated dependencies [efd8102]
23
+ - Updated dependencies [f29fc7e]
24
+ - Updated dependencies [3573f0b]
25
+ - Updated dependencies [2d0dd8a]
26
+ - @prosopo/common@3.1.0
27
+ - @prosopo/config@3.1.1
28
+
29
+ ## 2.6.7
30
+ ### Patch Changes
31
+
32
+ - @prosopo/common@3.0.2
33
+
34
+ ## 2.6.6
35
+ ### Patch Changes
36
+
37
+ - @prosopo/common@3.0.1
38
+
39
+ ## 2.6.5
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [64b5bcd]
43
+ - @prosopo/common@3.0.0
44
+
45
+ ## 2.6.4
46
+ ### Patch Changes
47
+
48
+ - 86c22b8: structured logging
49
+ - Updated dependencies [86c22b8]
50
+ - @prosopo/common@2.7.2
51
+
52
+ ## 2.6.3
53
+ ### Patch Changes
54
+
55
+ - @prosopo/common@2.7.1
56
+
57
+ ## 2.6.2
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies [8f0644a]
61
+ - @prosopo/common@2.7.0
62
+
3
63
  ## 2.6.1
4
64
 
5
65
  ### Patch Changes
@@ -1,8 +1,9 @@
1
- var ApiEndpointResponseStatus;
2
- (function (ApiEndpointResponseStatus) {
3
- ApiEndpointResponseStatus["SUCCESS"] = "SUCCESS";
4
- ApiEndpointResponseStatus["FAIL"] = "FAIL";
5
- ApiEndpointResponseStatus["PROCESSING"] = "PROCESSING";
6
- })(ApiEndpointResponseStatus || (ApiEndpointResponseStatus = {}));
7
- export { ApiEndpointResponseStatus };
8
- //# sourceMappingURL=apiEndpointResponseStatus.js.map
1
+ var ApiEndpointResponseStatus = /* @__PURE__ */ ((ApiEndpointResponseStatus2) => {
2
+ ApiEndpointResponseStatus2["SUCCESS"] = "SUCCESS";
3
+ ApiEndpointResponseStatus2["FAIL"] = "FAIL";
4
+ ApiEndpointResponseStatus2["PROCESSING"] = "PROCESSING";
5
+ return ApiEndpointResponseStatus2;
6
+ })(ApiEndpointResponseStatus || {});
7
+ export {
8
+ ApiEndpointResponseStatus
9
+ };
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  import { ApiEndpointResponseStatus } from "./endpoint/apiEndpointResponseStatus.js";
2
- export { ApiEndpointResponseStatus, };
3
- //# sourceMappingURL=index.js.map
2
+ export {
3
+ ApiEndpointResponseStatus
4
+ };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@prosopo/api-route",
3
- "version": "2.6.1",
3
+ "version": "2.6.9",
4
4
  "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
5
6
  "type": "module",
6
7
  "engines": {
7
8
  "node": "20",
@@ -9,23 +10,25 @@
9
10
  },
10
11
  "exports": {
11
12
  ".": {
13
+ "types": "./dist/index.d.ts",
12
14
  "import": "./dist/index.js",
13
15
  "require": "./dist/cjs/index.cjs"
14
16
  }
15
17
  },
16
18
  "scripts": {
17
- "test": "echo \"No test specified\"",
18
- "clean": "tsc --build --clean",
19
- "build": "tsc --build --verbose",
20
- "build:cjs": "npx vite --config vite.cjs.config.ts build"
19
+ "clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
20
+ "build": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
21
+ "build:tsc": "tsc --build --verbose",
22
+ "build:cjs": "NODE_ENV=${NODE_ENV:-production}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
23
+ "typecheck": "tsc --build --declaration --emitDeclarationOnly --force",
24
+ "test": "echo no tests"
21
25
  },
22
26
  "dependencies": {
23
- "@prosopo/common": "2.6.1",
24
- "zod": "3.23.8"
25
- },
26
- "devDependencies": {
27
- "@prosopo/config": "2.6.0"
27
+ "@prosopo/common": "3.1.1",
28
+ "zod": "3.23.8",
29
+ "@prosopo/config": "3.1.2"
28
30
  },
31
+ "devDependencies": {},
29
32
  "author": "PROSOPO LIMITED <info@prosopo.io>",
30
33
  "license": "Apache-2.0",
31
34
  "bugs": {
@@ -1,3 +1,4 @@
1
+ import path from "node:path";
1
2
  // Copyright 2021-2025 Prosopo (UK) Ltd.
2
3
  //
3
4
  // Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,10 +12,11 @@
11
12
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
13
  // See the License for the specific language governing permissions and
13
14
  // limitations under the License.
14
-
15
- import path from "node:path";
16
15
  import { ViteCommonJSConfig } from "@prosopo/config";
17
16
 
18
17
  export default function () {
19
- return ViteCommonJSConfig("api-route", path.resolve("./tsconfig.cjs.json"));
18
+ return ViteCommonJSConfig(
19
+ path.basename("."),
20
+ path.resolve("./tsconfig.json"),
21
+ );
20
22
  }
@@ -0,0 +1,20 @@
1
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import path from "node:path";
16
+ import { ViteEsmConfig } from "@prosopo/config";
17
+
18
+ export default function () {
19
+ return ViteEsmConfig(path.basename("."), path.resolve("./tsconfig.json"));
20
+ }
@@ -1,8 +0,0 @@
1
- import type { ZodType } from "zod";
2
- import type { ApiEndpoint } from "./endpoint/apiEndpoint.js";
3
- interface ApiRoute {
4
- path: string;
5
- endpoint: ApiEndpoint<ZodType | undefined>;
6
- }
7
- export type { ApiRoute };
8
- //# sourceMappingURL=apiRoute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiRoute.d.ts","sourceRoot":"","sources":["../src/apiRoute.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,UAAU,QAAQ;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CAC3C;AAED,YAAY,EAAE,QAAQ,EAAE,CAAC"}
package/dist/apiRoute.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=apiRoute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiRoute.js","sourceRoot":"","sources":["../src/apiRoute.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import type { ApiRoute } from "./apiRoute.js";
2
- interface ApiRoutesProvider {
3
- getRoutes(): ApiRoute[];
4
- }
5
- export type { ApiRoutesProvider };
6
- //# sourceMappingURL=apiRoutesProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiRoutesProvider.d.ts","sourceRoot":"","sources":["../src/apiRoutesProvider.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,UAAU,iBAAiB;IAC1B,SAAS,IAAI,QAAQ,EAAE,CAAC;CACxB;AAED,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=apiRoutesProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiRoutesProvider.js","sourceRoot":"","sources":["../src/apiRoutesProvider.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import type { Logger } from "@prosopo/common";
2
- import type { ZodType, z } from "zod";
3
- import type { ApiEndpointResponse } from "./apiEndpointResponse.js";
4
- interface ApiEndpoint<T extends ZodType | undefined> {
5
- processRequest: T extends ZodType ? (args: z.infer<T>, logger?: Logger) => Promise<ApiEndpointResponse> : (logger?: Logger) => Promise<ApiEndpointResponse>;
6
- getRequestArgsSchema(): T;
7
- }
8
- export type { ApiEndpoint };
9
- //# sourceMappingURL=apiEndpoint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiEndpoint.d.ts","sourceRoot":"","sources":["../../src/endpoint/apiEndpoint.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,UAAU,WAAW,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS;IAClD,cAAc,EAAE,CAAC,SAAS,OAAO,GAC9B,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,GACnE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAErD,oBAAoB,IAAI,CAAC,CAAC;CAC1B;AAED,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=apiEndpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiEndpoint.js","sourceRoot":"","sources":["../../src/endpoint/apiEndpoint.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import type { ApiEndpointResponseStatus } from "./apiEndpointResponseStatus.js";
2
- interface ApiEndpointResponse {
3
- status: ApiEndpointResponseStatus;
4
- data?: object;
5
- error?: string;
6
- }
7
- export type { ApiEndpointResponse };
8
- //# sourceMappingURL=apiEndpointResponse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiEndpointResponse.d.ts","sourceRoot":"","sources":["../../src/endpoint/apiEndpointResponse.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,UAAU,mBAAmB;IAC5B,MAAM,EAAE,yBAAyB,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=apiEndpointResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiEndpointResponse.js","sourceRoot":"","sources":["../../src/endpoint/apiEndpointResponse.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- declare enum ApiEndpointResponseStatus {
2
- SUCCESS = "SUCCESS",
3
- FAIL = "FAIL",
4
- PROCESSING = "PROCESSING"
5
- }
6
- export { ApiEndpointResponseStatus };
7
- //# sourceMappingURL=apiEndpointResponseStatus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiEndpointResponseStatus.d.ts","sourceRoot":"","sources":["../../src/endpoint/apiEndpointResponseStatus.ts"],"names":[],"mappings":"AAcA,aAAK,yBAAyB;IAC7B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,UAAU,eAAe;CACzB;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiEndpointResponseStatus.js","sourceRoot":"","sources":["../../src/endpoint/apiEndpointResponseStatus.ts"],"names":[],"mappings":"AAcA,IAAK,yBAIJ;AAJD,WAAK,yBAAyB;IAC7B,gDAAmB,CAAA;IACnB,0CAAa,CAAA;IACb,sDAAyB,CAAA;AAC1B,CAAC,EAJI,yBAAyB,KAAzB,yBAAyB,QAI7B;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { ApiRoute } from "./apiRoute.js";
2
- import type { ApiRoutesProvider } from "./apiRoutesProvider.js";
3
- import type { ApiEndpoint } from "./endpoint/apiEndpoint.js";
4
- import type { ApiEndpointResponse } from "./endpoint/apiEndpointResponse.js";
5
- import { ApiEndpointResponseStatus } from "./endpoint/apiEndpointResponseStatus.js";
6
- export { ApiEndpointResponseStatus, type ApiEndpointResponse, type ApiEndpoint, type ApiRoute, type ApiRoutesProvider, };
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,OAAO,EACN,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,iBAAiB,GACtB,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,OAAO,EACN,yBAAyB,GAKzB,CAAC"}