cantian-rest 0.0.3 → 0.0.6

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.
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ import cors from 'cors';
2
3
  import fs from 'node:fs';
3
4
  import { app } from '../app.js';
4
5
  import { createControllerRouter } from '../handlers.js';
5
6
  const { JWTS, SCOPE, PORT = 3001 } = process.env;
7
+ app.use(cors());
6
8
  if (fs.existsSync('dist/controllers')) {
7
9
  const controllerDir = process.cwd() + '/dist/controllers/';
8
10
  const router = await createControllerRouter({
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/bin/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAEjD,IAAI,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;IACtC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,oBAAoB,CAAC;IAC3D,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC;QAC1C,aAAa;QACb,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,IAAI,CAAC,2BAA2B,IAAI,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/bin/server.ts"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAEjD,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AAEhB,IAAI,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;IACtC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,oBAAoB,CAAC;IAC3D,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC;QAC1C,aAAa;QACb,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACpB,OAAO,CAAC,IAAI,CAAC,2BAA2B,IAAI,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as express from 'express';
2
- import { app } from './app.js';
3
- import { BaseController } from './BaseController.js';
4
- import { RestError } from './RestError.js';
5
- export { app, BaseController, express, RestError };
2
+ export * from './app.js';
3
+ export * from './BaseController.js';
4
+ export * from './RestError.js';
5
+ export * from './schemas.js';
6
+ export { express };
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as express from 'express';
2
- import { app } from './app.js';
3
- import { BaseController } from './BaseController.js';
4
- import { RestError } from './RestError.js';
5
- export { app, BaseController, express, RestError };
2
+ export * from './app.js';
3
+ export * from './BaseController.js';
4
+ export * from './RestError.js';
5
+ export * from './schemas.js';
6
+ export { express };
6
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { FromSchema } from 'json-schema-to-ts';
2
+ export declare const resultTrueSchema: {
3
+ readonly type: "object";
4
+ readonly properties: {
5
+ readonly result: {
6
+ readonly type: "boolean";
7
+ };
8
+ };
9
+ readonly additionalProperties: false;
10
+ readonly required: readonly ["result"];
11
+ };
12
+ export type ResultTrue = FromSchema<typeof resultTrueSchema>;
@@ -0,0 +1,9 @@
1
+ export const resultTrueSchema = {
2
+ type: 'object',
3
+ properties: {
4
+ result: { type: 'boolean' },
5
+ },
6
+ additionalProperties: false,
7
+ required: ['result'],
8
+ };
9
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC5B;IACD,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,QAAQ,CAAC;CACS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cantian-rest",
3
- "version": "0.0.3",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "ajv": "^8.17.1",
23
+ "cors": "^2.8.5",
23
24
  "express": "^5.1.0",
24
25
  "jose": "^6.0.11"
25
26
  }