@lyxa.ai/core 1.0.146 → 1.0.147
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,4 +1,5 @@
|
|
|
1
1
|
import { CreateHTTPContextOptions } from '@trpc/server/dist/adapters/standalone';
|
|
2
|
+
import type { CreateWSSContextFnOptions } from '@trpc/server/adapters/ws';
|
|
2
3
|
import { AuthEntityType } from '../auth';
|
|
3
4
|
import jwt from 'jsonwebtoken';
|
|
4
5
|
import { TokenType } from '../auth';
|
|
@@ -15,4 +16,13 @@ export interface LyxaContextParams {
|
|
|
15
16
|
tokenRenewed?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export declare const createLyxaContext: (opts: CreateHTTPContextOptions) => Promise<CreateHTTPContextOptions & LyxaContextParams>;
|
|
19
|
+
export declare const createLyxaWsContext: (opts: CreateWSSContextFnOptions) => Promise<{
|
|
20
|
+
entity: undefined;
|
|
21
|
+
requestId: undefined;
|
|
22
|
+
tokenType: undefined;
|
|
23
|
+
usedRefreshToken: boolean;
|
|
24
|
+
tokenRenewed: boolean;
|
|
25
|
+
req: import("http").IncomingMessage;
|
|
26
|
+
res: import("ws").WebSocket;
|
|
27
|
+
}>;
|
|
18
28
|
export type LyxaContext = Awaited<ReturnType<typeof createLyxaContext>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLyxaContext = void 0;
|
|
3
|
+
exports.createLyxaWsContext = exports.createLyxaContext = void 0;
|
|
4
4
|
const createLyxaContext = async (opts) => {
|
|
5
5
|
return {
|
|
6
6
|
...opts,
|
|
@@ -12,4 +12,15 @@ const createLyxaContext = async (opts) => {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
exports.createLyxaContext = createLyxaContext;
|
|
15
|
+
const createLyxaWsContext = async (opts) => {
|
|
16
|
+
return {
|
|
17
|
+
...opts,
|
|
18
|
+
entity: undefined,
|
|
19
|
+
requestId: undefined,
|
|
20
|
+
tokenType: undefined,
|
|
21
|
+
usedRefreshToken: false,
|
|
22
|
+
tokenRenewed: false,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.createLyxaWsContext = createLyxaWsContext;
|
|
15
26
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"/","sources":["libraries/trpc/context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"/","sources":["libraries/trpc/context.ts"],"names":[],"mappings":";;;AAqBO,MAAM,iBAAiB,GAAG,KAAK,EACrC,IAA8B,EAC0B,EAAE;IAC1D,OAAO;QACN,GAAG,IAAI;QACP,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,gBAAgB,EAAE,KAAK;QACvB,YAAY,EAAE,KAAK;KACnB,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,iBAAiB,qBAW5B;AAEK,MAAM,mBAAmB,GAAG,KAAK,EAAE,IAA+B,EAAE,EAAE;IAC5E,OAAO;QACN,GAAG,IAAI;QACP,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,gBAAgB,EAAE,KAAK;QACvB,YAAY,EAAE,KAAK;KACnB,CAAC;AACH,CAAC,CAAC;AATW,QAAA,mBAAmB,uBAS9B","sourcesContent":["import { CreateHTTPContextOptions } from '@trpc/server/dist/adapters/standalone';\nimport type { CreateWSSContextFnOptions } from '@trpc/server/adapters/ws';\nimport { AuthEntityType } from '../auth';\nimport jwt from 'jsonwebtoken';\nimport { TokenType } from '../auth';\nimport { request } from 'http';\n\nexport interface EntityContext extends jwt.JwtPayload {\n\tid: string;\n\ttype: AuthEntityType;\n\tparameters: Record<string, unknown>;\n}\n\nexport interface LyxaContextParams {\n\tentity?: EntityContext;\n\trequestId?: string;\n\ttokenType?: TokenType;\n\tusedRefreshToken?: boolean;\n\ttokenRenewed?: boolean;\n}\n\nexport const createLyxaContext = async (\n\topts: CreateHTTPContextOptions\n): Promise<CreateHTTPContextOptions & LyxaContextParams> => {\n\treturn {\n\t\t...opts,\n\t\tentity: undefined,\n\t\trequestId: undefined,\n\t\ttokenType: undefined,\n\t\tusedRefreshToken: false,\n\t\ttokenRenewed: false,\n\t};\n};\n\nexport const createLyxaWsContext = async (opts: CreateWSSContextFnOptions) => {\n\treturn {\n\t\t...opts,\n\t\tentity: undefined,\n\t\trequestId: undefined,\n\t\ttokenType: undefined,\n\t\tusedRefreshToken: false,\n\t\ttokenRenewed: false,\n\t};\n};\n\nexport type LyxaContext = Awaited<ReturnType<typeof createLyxaContext>>;\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.147",
|
|
4
4
|
"description": "The Core system of the Lyxa services.",
|
|
5
5
|
"author": "elie <42282499+Internalizable@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "node build.js",
|
|
14
14
|
"clean": "rimraf dist",
|
|
15
|
-
"prepare": "npm run build",
|
|
16
15
|
"start": "npx ts-node src/index.ts",
|
|
17
16
|
"publish:types": "cd dist/types && npm publish",
|
|
18
17
|
"publish:core": "npm publish --ignore-scripts",
|
|
@@ -48,11 +47,13 @@
|
|
|
48
47
|
"twilio": "^5.4.0",
|
|
49
48
|
"typedi": "^0.10.0",
|
|
50
49
|
"typescript": "^5.7.2",
|
|
50
|
+
"ws": "^8.18.3",
|
|
51
51
|
"zod": "^3.24.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/mapbox__polyline": "^1.0.5",
|
|
55
55
|
"@types/mime-types": "^2.1.4",
|
|
56
|
+
"@types/ws": "^8.18.1",
|
|
56
57
|
"prettier": "3.5.3"
|
|
57
58
|
}
|
|
58
59
|
}
|