@lyxa.ai/core 1.0.166-test2 → 1.0.166-test4
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/adapters/standalone';
|
|
2
|
+
import type { NodeHTTPCreateContextFnOptions } from '@trpc/server/adapters/node-http';
|
|
2
3
|
import type { CreateWSSContextFnOptions } from '@trpc/server/adapters/ws';
|
|
3
4
|
import { AuthEntityType } from '../auth';
|
|
4
5
|
import jwt from 'jsonwebtoken';
|
|
@@ -24,6 +25,6 @@ export interface LyxaWSContext extends LyxaContextParams {
|
|
|
24
25
|
req: any;
|
|
25
26
|
res: any;
|
|
26
27
|
}
|
|
27
|
-
export declare const createLyxaContext: (opts: CreateHTTPContextOptions) => Promise<LyxaHTTPContext>;
|
|
28
|
+
export declare const createLyxaContext: (opts: CreateHTTPContextOptions | NodeHTTPCreateContextFnOptions<IncomingMessage, ServerResponse>) => Promise<LyxaHTTPContext>;
|
|
28
29
|
export declare const createLyxaWsContext: (opts: CreateWSSContextFnOptions) => Promise<LyxaWSContext>;
|
|
29
30
|
export type LyxaContext = Awaited<ReturnType<typeof createLyxaContext>>;
|
|
@@ -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":";;;AAgCO,MAAM,iBAAiB,GAAG,KAAK,EACrC,IAAgG,EACrE,EAAE;IAC7B,OAAO;QACN,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,gBAAgB,EAAE,KAAK;QACvB,YAAY,EAAE,KAAK;QACnB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,CAAC,GAAG;KACb,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,iBAAiB,qBAY5B;AAEK,MAAM,mBAAmB,GAAG,KAAK,EACvC,IAA+B,EACN,EAAE;IAC3B,OAAO;QACN,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,gBAAgB,EAAE,KAAK;QACvB,YAAY,EAAE,KAAK;QACnB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,CAAC,GAAG;KACb,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,mBAAmB,uBAY9B","sourcesContent":["import { CreateHTTPContextOptions } from '@trpc/server/adapters/standalone';\nimport type { NodeHTTPCreateContextFnOptions } from '@trpc/server/adapters/node-http';\nimport type { CreateWSSContextFnOptions } from '@trpc/server/adapters/ws';\nimport { AuthEntityType } from '../auth';\nimport jwt from 'jsonwebtoken';\nimport { TokenType } from '../auth';\nimport type { IncomingMessage, ServerResponse } 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 interface LyxaHTTPContext extends LyxaContextParams {\n\treq: IncomingMessage;\n\tres: ServerResponse;\n}\n\nexport interface LyxaWSContext extends LyxaContextParams {\n\treq: any;\n\tres: any;\n}\n\nexport const createLyxaContext = async (\n\topts: CreateHTTPContextOptions | NodeHTTPCreateContextFnOptions<IncomingMessage, ServerResponse>\n): Promise<LyxaHTTPContext> => {\n\treturn {\n\t\tentity: undefined,\n\t\trequestId: undefined,\n\t\ttokenType: undefined,\n\t\tusedRefreshToken: false,\n\t\ttokenRenewed: false,\n\t\treq: opts.req,\n\t\tres: opts.res,\n\t};\n};\n\nexport const createLyxaWsContext = async (\n\topts: CreateWSSContextFnOptions\n): Promise<LyxaWSContext> => {\n\treturn {\n\t\tentity: undefined,\n\t\trequestId: undefined,\n\t\ttokenType: undefined,\n\t\tusedRefreshToken: false,\n\t\ttokenRenewed: false,\n\t\treq: opts.req,\n\t\tres: opts.res,\n\t};\n};\nexport type LyxaContext = Awaited<ReturnType<typeof createLyxaContext>>;"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/types",
|
|
3
|
-
"version": "1.0.166-
|
|
3
|
+
"version": "1.0.166-test4",
|
|
4
4
|
"description": "Lyxa type definitions and validation schemas for both frontend and backend",
|
|
5
5
|
"author": "elie <42282499+Internalizable@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|