@lyxa.ai/core 1.0.166-test3 → 1.0.167
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/dist/libraries/dispatcher/index.d.ts +1 -2
- package/dist/libraries/dispatcher/index.js +1 -2
- package/dist/libraries/dispatcher/index.js.map +1 -1
- package/dist/libraries/mongo/models/notification.model.d.ts +1 -1
- package/dist/libraries/mongo/models/notification.model.js +2 -2
- package/dist/libraries/mongo/models/notification.model.js.map +1 -1
- package/dist/libraries/trpc/context.d.ts +12 -13
- package/dist/libraries/trpc/context.js +2 -4
- package/dist/libraries/trpc/context.js.map +1 -1
- package/dist/libraries/trpc/index.d.ts +153 -46
- package/dist/libraries/trpc/index.js.map +1 -1
- package/dist/libraries/trpc/middlewares/auth.d.ts +32 -9
- package/dist/libraries/trpc/middlewares/phone-verified.d.ts +32 -9
- package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +32 -9
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +3 -3
|
@@ -5,6 +5,5 @@ export declare class MicroServiceDispatcher {
|
|
|
5
5
|
constructor(secretService: SecretManagerService);
|
|
6
6
|
getMicroService<T extends AnyRouter>(serviceName: string, customURL?: string, options?: {
|
|
7
7
|
headers?: Record<string, string>;
|
|
8
|
-
|
|
9
|
-
}): Promise<import("@trpc/client").TRPCClient<T>>;
|
|
8
|
+
}): Promise<import("@trpc/client").CreateTRPCProxyClient<T>>;
|
|
10
9
|
}
|
|
@@ -25,12 +25,11 @@ let MicroServiceDispatcher = class MicroServiceDispatcher {
|
|
|
25
25
|
if (!deploymentURL) {
|
|
26
26
|
throw new Error('The requested service does not have a configured secret URL');
|
|
27
27
|
}
|
|
28
|
-
return (0, client_1.
|
|
28
|
+
return (0, client_1.createTRPCProxyClient)({
|
|
29
29
|
links: [
|
|
30
30
|
(0, client_1.httpBatchLink)({
|
|
31
31
|
url: deploymentURL,
|
|
32
32
|
headers: async () => options?.headers ?? {},
|
|
33
|
-
transformer: options?.transformer,
|
|
34
33
|
}),
|
|
35
34
|
],
|
|
36
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/dispatcher/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/dispatcher/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAiC;AACjC,yCAAoE;AAEpE,wCAAkD;AAG3C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC1B,cAAc,CAAuB;IAE7C,YAAY,aAAmC;QAC9C,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,eAAe,CAC3B,WAAmB,EACnB,SAAkB,EAClB,OAEC;QAED,MAAM,aAAa,GAClB,SAAS;YACT,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAChC,2BAA2B,GAAG,WAAW,CAAC,WAAW,EAAE,GAAG,WAAW,CACrE,CAAC,CAAC;QAEJ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAChF,CAAC;QAGD,OAAO,IAAA,8BAAqB,EAAI;YAC/B,KAAK,EAAE;gBACN,IAAA,sBAAa,EAAC;oBACb,GAAG,EAAE,aAAa;oBAClB,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE;iBAC3C,CAAC;aACF;SAED,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AArCY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,gBAAO,GAAE;qCAIkB,8BAAoB;GAHnC,sBAAsB,CAqClC","sourcesContent":["import { Service } from 'typedi';\nimport { createTRPCProxyClient, httpBatchLink } from '@trpc/client';\nimport { AnyRouter } from '@trpc/server';\nimport { SecretManagerService } from '../secrets';\n\n@Service()\nexport class MicroServiceDispatcher {\n\tprivate _secretService: SecretManagerService;\n\n\tconstructor(secretService: SecretManagerService) {\n\t\tthis._secretService = secretService;\n\t}\n\n\tpublic async getMicroService<T extends AnyRouter>(\n\t\tserviceName: string,\n\t\tcustomURL?: string,\n\t\toptions?: {\n\t\t\theaders?: Record<string, string>;\n\t\t}\n\t) {\n\t\tconst deploymentURL =\n\t\t\tcustomURL ??\n\t\t\t(await this._secretService.getKey(\n\t\t\t\t'DEPLOYMENTS_MICROSERVICE_' + serviceName.toUpperCase() + '_ENDPOINT'\n\t\t\t));\n\n\t\tconsole.log(deploymentURL, 'deploymentURL--');\n\n\t\tif (!deploymentURL) {\n\t\t\tthrow new Error('The requested service does not have a configured secret URL');\n\t\t}\n\n\t\t// @ts-ignore\n\t\treturn createTRPCProxyClient<T>({\n\t\t\tlinks: [\n\t\t\t\thttpBatchLink({\n\t\t\t\t\turl: deploymentURL,\n\t\t\t\t\theaders: async () => options?.headers ?? {},\n\t\t\t\t}),\n\t\t\t],\n\t\t\t//special http request header that has a token\n\t\t});\n\t}\n}\n"]}
|
|
@@ -32,7 +32,7 @@ export declare class Notification extends TimeStamps {
|
|
|
32
32
|
clickableProduct?: Ref<Product>;
|
|
33
33
|
clickableListContainer?: Ref<ListContainer>;
|
|
34
34
|
clickablePayout?: Ref<Payout>;
|
|
35
|
-
|
|
35
|
+
clickableBobFinance?: Ref<BOBFinance>;
|
|
36
36
|
clickableRequestArea?: Ref<RequestArea>;
|
|
37
37
|
isSendByAdmin?: boolean;
|
|
38
38
|
createdBy?: Ref<Admin>;
|
|
@@ -44,7 +44,7 @@ let Notification = class Notification extends defaultClasses_1.TimeStamps {
|
|
|
44
44
|
clickableProduct;
|
|
45
45
|
clickableListContainer;
|
|
46
46
|
clickablePayout;
|
|
47
|
-
|
|
47
|
+
clickableBobFinance;
|
|
48
48
|
clickableRequestArea;
|
|
49
49
|
isSendByAdmin;
|
|
50
50
|
createdBy;
|
|
@@ -130,7 +130,7 @@ __decorate([
|
|
|
130
130
|
__decorate([
|
|
131
131
|
(0, typegoose_1.prop)({ ref: () => bob_finance_model_1.BOBFinance }),
|
|
132
132
|
__metadata("design:type", Object)
|
|
133
|
-
], Notification.prototype, "
|
|
133
|
+
], Notification.prototype, "clickableBobFinance", void 0);
|
|
134
134
|
__decorate([
|
|
135
135
|
(0, typegoose_1.prop)({ ref: () => request_area_model_1.RequestArea }),
|
|
136
136
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.model.js","sourceRoot":"/","sources":["libraries/mongo/models/notification.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,kDAA6E;AAC7E,+CAAsC;AACtC,2DAAiD;AACjD,iEAAuD;AACvD,+CAAsC;AACtC,iDAAwC;AACxC,iDAAwC;AACxC,mDAA0C;AAC1C,6DAAmD;AACnD,+CAAsC;AACtC,6CAAoC;AACpC,6CAAoC;AAuB7B,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAU;IAEpC,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,WAAW,CAA2B;IAGtC,QAAQ,CAAW;IAGnB,KAAK,CAAe;IAGpB,OAAO,CAAiB;IAGxB,KAAK,CAAe;IAGpB,MAAM,CAAgB;IAGtB,MAAM,CAAgB;IAGtB,WAAW,CAAW;IAGtB,SAAS,CAAa;IAGtB,YAAY,CAAU;IAGtB,cAAc,CAAc;IAG5B,aAAa,CAAa;IAG1B,gBAAgB,CAAgB;IAGhC,sBAAsB,CAAsB;IAG5C,eAAe,CAAe;IAG9B,mBAAmB,CAAmB;IAGtC,oBAAoB,CAAoB;IAGxC,aAAa,CAAW;IAGxB,SAAS,CAAc;IAGvB,MAAM,CAA6B;CAC1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AS,EAAE,IAAI,EAAE,EAAE,CAC7F;GACY,YAAY,CAwExB","sourcesContent":["import { index, modelOptions, mongoose, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ClickType, NotificationAccountType } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { BOBFinance } from './bob-finance.model';\nimport { ListContainer } from './list-container.model';\nimport { Order } from './order.model';\nimport { Parent } from './parent.model';\nimport { Payout } from './payout.model';\nimport { Product } from './product.model';\nimport { RequestArea } from './request-area.model';\nimport { Rider } from './rider.model';\nimport { Shop } from './shop.model';\nimport { User } from './user.model';\n\n@modelOptions({ schemaOptions: { collection: 'notifications' } })\n@index(\n\t{ isGlobal: 1, users: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.USER, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, shops: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.SHOP, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, riders: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.RIDER, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, admins: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.ADMIN, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, parents: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.PARENT, deletedAt: null } }\n)\nexport class Notification extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String, maxlength: 250 })\n\tpublic body!: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String })\n\tpublic sound?: string;\n\n\t@prop({ required: true, type: String, enum: NotificationAccountType })\n\tpublic accountType!: NotificationAccountType;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isGlobal!: boolean;\n\n\t@prop({ ref: () => User, default: [] })\n\tpublic users?: Ref<User>[];\n\n\t@prop({ ref: () => Parent, default: [] })\n\tpublic parents?: Ref<Parent>[];\n\n\t@prop({ ref: () => Shop, default: [] })\n\tpublic shops?: Ref<Shop>[];\n\n\t@prop({ ref: () => Rider, default: [] })\n\tpublic riders?: Ref<Rider>[];\n\n\t@prop({ ref: () => Admin, default: [] })\n\tpublic admins?: Ref<Admin>[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isClickable?: boolean;\n\n\t@prop({ type: String, enum: ClickType })\n\tpublic clickType?: ClickType;\n\n\t@prop({ type: String, trim: true })\n\tpublic clickableUrl?: string;\n\n\t@prop({ ref: () => Order })\n\tpublic clickableOrder?: Ref<Order>;\n\n\t@prop({ ref: () => Shop })\n\tpublic clickableShop?: Ref<Shop>;\n\n\t@prop({ ref: () => Product })\n\tpublic clickableProduct?: Ref<Product>;\n\n\t@prop({ ref: () => ListContainer })\n\tpublic clickableListContainer?: Ref<ListContainer>;\n\n\t@prop({ ref: () => Payout })\n\tpublic clickablePayout?: Ref<Payout>;\n\n\t@prop({ ref: () => BOBFinance })\n\tpublic
|
|
1
|
+
{"version":3,"file":"notification.model.js","sourceRoot":"/","sources":["libraries/mongo/models/notification.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,kDAA6E;AAC7E,+CAAsC;AACtC,2DAAiD;AACjD,iEAAuD;AACvD,+CAAsC;AACtC,iDAAwC;AACxC,iDAAwC;AACxC,mDAA0C;AAC1C,6DAAmD;AACnD,+CAAsC;AACtC,6CAAoC;AACpC,6CAAoC;AAuB7B,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAU;IAEpC,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,WAAW,CAA2B;IAGtC,QAAQ,CAAW;IAGnB,KAAK,CAAe;IAGpB,OAAO,CAAiB;IAGxB,KAAK,CAAe;IAGpB,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,CAAC,EAAE,EACzC,EAAE,uBAAuB,EAAE,EAAE,WAAW,EAAE,8BAAuB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAC5F;IACA,IAAA,iBAAK,EACL,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAC1C,EAAE,uBAAuB,EAAE,EAAE,WAAW,EAAE,8BAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAC7F;GACY,YAAY,CAwExB","sourcesContent":["import { index, modelOptions, mongoose, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ClickType, NotificationAccountType } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { BOBFinance } from './bob-finance.model';\nimport { ListContainer } from './list-container.model';\nimport { Order } from './order.model';\nimport { Parent } from './parent.model';\nimport { Payout } from './payout.model';\nimport { Product } from './product.model';\nimport { RequestArea } from './request-area.model';\nimport { Rider } from './rider.model';\nimport { Shop } from './shop.model';\nimport { User } from './user.model';\n\n@modelOptions({ schemaOptions: { collection: 'notifications' } })\n@index(\n\t{ isGlobal: 1, users: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.USER, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, shops: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.SHOP, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, riders: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.RIDER, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, admins: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.ADMIN, deletedAt: null } }\n)\n@index(\n\t{ isGlobal: 1, parents: 1, createdAt: -1 },\n\t{ partialFilterExpression: { accountType: NotificationAccountType.PARENT, deletedAt: null } }\n)\nexport class Notification extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String, maxlength: 250 })\n\tpublic body!: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String })\n\tpublic sound?: string;\n\n\t@prop({ required: true, type: String, enum: NotificationAccountType })\n\tpublic accountType!: NotificationAccountType;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isGlobal!: boolean;\n\n\t@prop({ ref: () => User, default: [] })\n\tpublic users?: Ref<User>[];\n\n\t@prop({ ref: () => Parent, default: [] })\n\tpublic parents?: Ref<Parent>[];\n\n\t@prop({ ref: () => Shop, default: [] })\n\tpublic shops?: Ref<Shop>[];\n\n\t@prop({ ref: () => Rider, default: [] })\n\tpublic riders?: Ref<Rider>[];\n\n\t@prop({ ref: () => Admin, default: [] })\n\tpublic admins?: Ref<Admin>[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isClickable?: boolean;\n\n\t@prop({ type: String, enum: ClickType })\n\tpublic clickType?: ClickType;\n\n\t@prop({ type: String, trim: true })\n\tpublic clickableUrl?: string;\n\n\t@prop({ ref: () => Order })\n\tpublic clickableOrder?: Ref<Order>;\n\n\t@prop({ ref: () => Shop })\n\tpublic clickableShop?: Ref<Shop>;\n\n\t@prop({ ref: () => Product })\n\tpublic clickableProduct?: Ref<Product>;\n\n\t@prop({ ref: () => ListContainer })\n\tpublic clickableListContainer?: Ref<ListContainer>;\n\n\t@prop({ ref: () => Payout })\n\tpublic clickablePayout?: Ref<Payout>;\n\n\t@prop({ ref: () => BOBFinance })\n\tpublic clickableBobFinance?: Ref<BOBFinance>;\n\n\t@prop({ ref: () => RequestArea })\n\tpublic clickableRequestArea?: Ref<RequestArea>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSendByAdmin?: boolean;\n\n\t@prop({ ref: () => Admin })\n\tpublic createdBy?: Ref<Admin>;\n\n\t@prop({ type: () => [mongoose.Types.ObjectId], default: [] })\n\tpublic seenBy?: mongoose.Types.ObjectId[];\n}\n"]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { CreateHTTPContextOptions } from '@trpc/server/adapters/standalone';
|
|
2
|
-
import type { NodeHTTPCreateContextFnOptions } from '@trpc/server/adapters/node-http';
|
|
1
|
+
import { CreateHTTPContextOptions } from '@trpc/server/dist/adapters/standalone';
|
|
3
2
|
import type { CreateWSSContextFnOptions } from '@trpc/server/adapters/ws';
|
|
4
3
|
import { AuthEntityType } from '../auth';
|
|
5
4
|
import jwt from 'jsonwebtoken';
|
|
6
5
|
import { TokenType } from '../auth';
|
|
7
|
-
import type { IncomingMessage, ServerResponse } from 'http';
|
|
8
6
|
export interface EntityContext extends jwt.JwtPayload {
|
|
9
7
|
id: string;
|
|
10
8
|
type: AuthEntityType;
|
|
@@ -17,14 +15,15 @@ export interface LyxaContextParams {
|
|
|
17
15
|
usedRefreshToken?: boolean;
|
|
18
16
|
tokenRenewed?: boolean;
|
|
19
17
|
}
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
}>;
|
|
30
28
|
export type LyxaContext = Awaited<ReturnType<typeof createLyxaContext>>;
|
|
29
|
+
export type LyxaWSContext = Awaited<ReturnType<typeof createLyxaWsContext>>;
|
|
@@ -3,25 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createLyxaWsContext = exports.createLyxaContext = void 0;
|
|
4
4
|
const createLyxaContext = async (opts) => {
|
|
5
5
|
return {
|
|
6
|
+
...opts,
|
|
6
7
|
entity: undefined,
|
|
7
8
|
requestId: undefined,
|
|
8
9
|
tokenType: undefined,
|
|
9
10
|
usedRefreshToken: false,
|
|
10
11
|
tokenRenewed: false,
|
|
11
|
-
req: opts.req,
|
|
12
|
-
res: opts.res,
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
14
|
exports.createLyxaContext = createLyxaContext;
|
|
16
15
|
const createLyxaWsContext = async (opts) => {
|
|
17
16
|
return {
|
|
17
|
+
...opts,
|
|
18
18
|
entity: undefined,
|
|
19
19
|
requestId: undefined,
|
|
20
20
|
tokenType: undefined,
|
|
21
21
|
usedRefreshToken: false,
|
|
22
22
|
tokenRenewed: false,
|
|
23
|
-
req: opts.req,
|
|
24
|
-
res: opts.res,
|
|
25
23
|
};
|
|
26
24
|
};
|
|
27
25
|
exports.createLyxaWsContext = createLyxaWsContext;
|
|
@@ -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>>;\nexport type LyxaWSContext = Awaited<ReturnType<typeof createLyxaWsContext>>;\n"]}
|
|
@@ -1,71 +1,178 @@
|
|
|
1
|
-
export declare const t:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
export declare const t: {
|
|
2
|
+
_config: import("@trpc/server").RootConfig<{
|
|
3
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
4
|
+
meta: object;
|
|
5
|
+
errorShape: {
|
|
6
|
+
message: string;
|
|
7
|
+
data: {
|
|
8
|
+
stack: undefined;
|
|
9
|
+
path: undefined;
|
|
10
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
11
|
+
httpStatus: number;
|
|
12
|
+
};
|
|
12
13
|
stack: undefined;
|
|
13
|
-
|
|
14
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
15
|
-
httpStatus: number;
|
|
14
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
17
|
+
}>;
|
|
18
|
+
procedure: import("@trpc/server").ProcedureBuilder<{
|
|
19
|
+
_config: import("@trpc/server").RootConfig<{
|
|
20
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
21
|
+
meta: object;
|
|
22
|
+
errorShape: {
|
|
23
|
+
message: string;
|
|
24
|
+
data: {
|
|
25
|
+
stack: undefined;
|
|
26
|
+
path: undefined;
|
|
27
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
28
|
+
httpStatus: number;
|
|
29
|
+
};
|
|
30
|
+
stack: undefined;
|
|
31
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
32
|
+
};
|
|
33
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
34
|
+
}>;
|
|
35
|
+
_ctx_out: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
36
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
37
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
38
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
39
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
40
|
+
_meta: object;
|
|
41
|
+
}>;
|
|
42
|
+
middleware: <TNewParams extends import("@trpc/server").ProcedureParams<import("@trpc/server").AnyRootConfig, unknown, unknown, unknown, unknown, unknown, unknown>>(fn: import("@trpc/server").MiddlewareFunction<{
|
|
43
|
+
_config: import("@trpc/server").RootConfig<{
|
|
44
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
45
|
+
meta: object;
|
|
46
|
+
errorShape: {
|
|
47
|
+
message: string;
|
|
48
|
+
data: {
|
|
49
|
+
stack: undefined;
|
|
50
|
+
path: undefined;
|
|
51
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
52
|
+
httpStatus: number;
|
|
53
|
+
};
|
|
54
|
+
stack: undefined;
|
|
55
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
56
|
+
};
|
|
57
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
58
|
+
}>;
|
|
59
|
+
_ctx_out: {};
|
|
60
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
61
|
+
_input_in: unknown;
|
|
62
|
+
_output_in: unknown;
|
|
63
|
+
_output_out: unknown;
|
|
64
|
+
_meta: object;
|
|
65
|
+
}, TNewParams>) => import("@trpc/server").MiddlewareBuilder<{
|
|
66
|
+
_config: import("@trpc/server").RootConfig<{
|
|
67
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
68
|
+
meta: object;
|
|
69
|
+
errorShape: {
|
|
70
|
+
message: string;
|
|
71
|
+
data: {
|
|
72
|
+
stack: undefined;
|
|
73
|
+
path: undefined;
|
|
74
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
75
|
+
httpStatus: number;
|
|
76
|
+
};
|
|
77
|
+
stack: undefined;
|
|
78
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
79
|
+
};
|
|
80
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
81
|
+
}>;
|
|
82
|
+
_ctx_out: {};
|
|
83
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
84
|
+
_input_in: unknown;
|
|
85
|
+
_output_in: unknown;
|
|
86
|
+
_output_out: unknown;
|
|
87
|
+
_meta: object;
|
|
88
|
+
}, TNewParams>;
|
|
89
|
+
router: <TProcRouterRecord extends import("@trpc/server").ProcedureRouterRecord>(procedures: TProcRouterRecord) => import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
|
|
90
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
91
|
+
meta: object;
|
|
92
|
+
errorShape: {
|
|
93
|
+
message: string;
|
|
94
|
+
data: {
|
|
95
|
+
stack: undefined;
|
|
96
|
+
path: undefined;
|
|
97
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
98
|
+
httpStatus: number;
|
|
99
|
+
};
|
|
26
100
|
stack: undefined;
|
|
27
|
-
|
|
28
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
29
|
-
httpStatus: number;
|
|
101
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
30
102
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
103
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
104
|
+
}>, TProcRouterRecord>;
|
|
105
|
+
mergeRouters: typeof import("@trpc/server").mergeRouters;
|
|
106
|
+
createCallerFactory: <TRouter extends import("@trpc/server").Router<import("@trpc/server").AnyRouterDef<import("@trpc/server").RootConfig<{
|
|
107
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
108
|
+
meta: object;
|
|
109
|
+
errorShape: {
|
|
110
|
+
message: string;
|
|
111
|
+
data: {
|
|
112
|
+
stack: undefined;
|
|
113
|
+
path: undefined;
|
|
114
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
115
|
+
httpStatus: number;
|
|
116
|
+
};
|
|
117
|
+
stack: undefined;
|
|
118
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
119
|
+
};
|
|
120
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
121
|
+
}>, any>>>(router: TRouter) => import("@trpc/server").RouterCaller<TRouter["_def"]>;
|
|
122
|
+
};
|
|
123
|
+
export declare const publicProcedure: import("@trpc/server").ProcedureBuilder<{
|
|
124
|
+
_config: import("@trpc/server").RootConfig<{
|
|
125
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
126
|
+
meta: object;
|
|
127
|
+
errorShape: {
|
|
128
|
+
message: string;
|
|
129
|
+
data: {
|
|
130
|
+
stack: undefined;
|
|
131
|
+
path: undefined;
|
|
132
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
133
|
+
httpStatus: number;
|
|
134
|
+
};
|
|
135
|
+
stack: undefined;
|
|
136
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
137
|
+
};
|
|
138
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
139
|
+
}>;
|
|
140
|
+
_ctx_out: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
141
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
142
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
143
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
144
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
145
|
+
_meta: object;
|
|
35
146
|
}>;
|
|
36
|
-
export declare const
|
|
37
|
-
|
|
38
|
-
ctx: import("./context").LyxaHTTPContext;
|
|
147
|
+
export declare const createTRPCRouter: <TProcRouterRecord extends import("@trpc/server").ProcedureRouterRecord>(procedures: TProcRouterRecord) => import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
|
|
148
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
39
149
|
meta: object;
|
|
40
150
|
errorShape: {
|
|
41
151
|
message: string;
|
|
42
152
|
data: {
|
|
43
153
|
stack: undefined;
|
|
44
154
|
path: undefined;
|
|
45
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
155
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
46
156
|
httpStatus: number;
|
|
47
157
|
};
|
|
48
158
|
stack: undefined;
|
|
49
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
159
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
50
160
|
};
|
|
51
|
-
transformer:
|
|
52
|
-
}>;
|
|
53
|
-
export declare const createCallerFactory: import("@trpc/server").
|
|
54
|
-
ctx: import("./context").
|
|
161
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
162
|
+
}>, TProcRouterRecord>;
|
|
163
|
+
export declare const createCallerFactory: <TRouter extends import("@trpc/server").Router<import("@trpc/server").AnyRouterDef<import("@trpc/server").RootConfig<{
|
|
164
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("./context").LyxaContextParams;
|
|
55
165
|
meta: object;
|
|
56
166
|
errorShape: {
|
|
57
167
|
message: string;
|
|
58
168
|
data: {
|
|
59
169
|
stack: undefined;
|
|
60
170
|
path: undefined;
|
|
61
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
171
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
62
172
|
httpStatus: number;
|
|
63
173
|
};
|
|
64
174
|
stack: undefined;
|
|
65
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
175
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
66
176
|
};
|
|
67
|
-
transformer:
|
|
68
|
-
}>;
|
|
69
|
-
export type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
|
|
70
|
-
export type { AnyTRPCRouter } from '@trpc/server';
|
|
71
|
-
export type LyxaRouter = ReturnType<typeof createTRPCRouter>;
|
|
177
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
178
|
+
}>, any>>>(router: TRouter) => import("@trpc/server").RouterCaller<TRouter["_def"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/trpc/index.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC,6BAA+B;AAGlB,QAAA,CAAC,GAAG,iBAAQ,CAAC,OAAO,EAAe,CAAC,MAAM,CAAC;IACvD,cAAc,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;QAC9B,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,IAAI,KAAK,CAAC,KAAK,YAAY,cAAQ,EAAE,CAAC;YACrE,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACxC,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC;QACnC,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QAE5D,OAAO;YACN,GAAG,KAAK;YACR,OAAO,EACN,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ;gBACzC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO;gBACnD,CAAC,CAAC,KAAK,CAAC,OAAO;YACjB,IAAI,EAAE;gBACL,GAAG,KAAK,CAAC,IAAI;gBAEb,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,SAAS;aACf;YAED,KAAK,EAAE,SAAS;SAChB,CAAC;IACH,CAAC;CACD,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,SAAC,CAAC,SAAS,CAAC;AAC9B,QAAA,gBAAgB,GAAG,SAAC,CAAC,MAAM,CAAC;AAC5B,QAAA,mBAAmB,GAAG,SAAC,CAAC,mBAAmB,CAAC","sourcesContent":["import { initTRPC } from '@trpc/server';\nimport { ZodError } from 'zod';\nimport { LyxaContext } from './context';\n\nexport const t = initTRPC.context<LyxaContext>().create({\n\terrorFormatter({ shape, error }) {\n\t\tlet zodErrors = null;\n\n\t\tif (error.code === 'BAD_REQUEST' && error.cause instanceof ZodError) {\n\t\t\tconst flattened = error.cause.flatten();\n\t\t\tzodErrors = flattened.fieldErrors;\n\t\t}\n\n\t\tconsole.log('Error:', error, shape, 'error log', zodErrors);\n\n\t\treturn {\n\t\t\t...shape,\n\t\t\tmessage:\n\t\t\t\tzodErrors && typeof zodErrors === 'object'\n\t\t\t\t\t? Object.values(zodErrors)[0]?.[0] || shape.message\n\t\t\t\t\t: shape.message,\n\t\t\tdata: {\n\t\t\t\t...shape.data,\n\n\t\t\t\tstack: undefined,\n\t\t\t\tpath: undefined,\n\t\t\t},\n\t\t\t// Prevent stack trace from being returned in the response\n\t\t\tstack: undefined,\n\t\t};\n\t},\n});\n\nexport const publicProcedure = t.procedure;\nexport const createTRPCRouter = t.router;\nexport const createCallerFactory = t.createCallerFactory;\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/trpc/index.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC,6BAA+B;AAGlB,QAAA,CAAC,GAAG,iBAAQ,CAAC,OAAO,EAAe,CAAC,MAAM,CAAC;IACvD,cAAc,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;QAC9B,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,IAAI,KAAK,CAAC,KAAK,YAAY,cAAQ,EAAE,CAAC;YACrE,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACxC,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC;QACnC,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QAE5D,OAAO;YACN,GAAG,KAAK;YACR,OAAO,EACN,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ;gBACzC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO;gBACnD,CAAC,CAAC,KAAK,CAAC,OAAO;YACjB,IAAI,EAAE;gBACL,GAAG,KAAK,CAAC,IAAI;gBAEb,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,SAAS;aACf;YAED,KAAK,EAAE,SAAS;SAChB,CAAC;IACH,CAAC;CACD,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,SAAC,CAAC,SAAS,CAAC;AAC9B,QAAA,gBAAgB,GAAG,SAAC,CAAC,MAAM,CAAC;AAC5B,QAAA,mBAAmB,GAAG,SAAC,CAAC,mBAAmB,CAAC","sourcesContent":["import { initTRPC } from '@trpc/server';\nimport { ZodError } from 'zod';\nimport { LyxaContext } from './context';\n\nexport const t = initTRPC.context<LyxaContext>().create({\n\terrorFormatter({ shape, error }) {\n\t\tlet zodErrors = null;\n\n\t\tif (error.code === 'BAD_REQUEST' && error.cause instanceof ZodError) {\n\t\t\tconst flattened = error.cause.flatten();\n\t\t\tzodErrors = flattened.fieldErrors;\n\t\t}\n\n\t\tconsole.log('Error:', error, shape, 'error log', zodErrors);\n\n\t\treturn {\n\t\t\t...shape,\n\t\t\tmessage:\n\t\t\t\tzodErrors && typeof zodErrors === 'object'\n\t\t\t\t\t? Object.values(zodErrors)[0]?.[0] || shape.message\n\t\t\t\t\t: shape.message,\n\t\t\tdata: {\n\t\t\t\t...shape.data,\n\n\t\t\t\tstack: undefined,\n\t\t\t\tpath: undefined,\n\t\t\t},\n\t\t\t// Prevent stack trace from being returned in the response\n\t\t\tstack: undefined,\n\t\t};\n\t},\n});\n\nexport const publicProcedure = t.procedure;\nexport const createTRPCRouter = t.router;\nexport const createCallerFactory = t.createCallerFactory;\n"]}
|
|
@@ -4,13 +4,36 @@ interface AuthOptions {
|
|
|
4
4
|
allowRefreshToken?: boolean;
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").ProcedureBuilder<{
|
|
8
|
+
_config: import("@trpc/server").RootConfig<{
|
|
9
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("../context").LyxaContextParams;
|
|
10
|
+
meta: object;
|
|
11
|
+
errorShape: {
|
|
12
|
+
message: string;
|
|
13
|
+
data: {
|
|
14
|
+
stack: undefined;
|
|
15
|
+
path: undefined;
|
|
16
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
17
|
+
httpStatus: number;
|
|
18
|
+
};
|
|
19
|
+
stack: undefined;
|
|
20
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
21
|
+
};
|
|
22
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
23
|
+
}>;
|
|
24
|
+
_meta: object;
|
|
25
|
+
_ctx_out: {
|
|
26
|
+
requestId: string | undefined;
|
|
27
|
+
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
28
|
+
tokenType: TokenType | undefined;
|
|
29
|
+
entity: import("../context").EntityContext | undefined;
|
|
30
|
+
req: import("http").IncomingMessage;
|
|
31
|
+
usedRefreshToken: boolean | undefined;
|
|
32
|
+
tokenRenewed: boolean | undefined;
|
|
33
|
+
};
|
|
34
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
35
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
36
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
37
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
38
|
+
}>;
|
|
16
39
|
export {};
|
|
@@ -2,13 +2,36 @@ import { AuthEntityType } from '../../auth';
|
|
|
2
2
|
interface PhoneVerifiedOptions {
|
|
3
3
|
entityTypes: AuthEntityType[];
|
|
4
4
|
}
|
|
5
|
-
export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").ProcedureBuilder<{
|
|
6
|
+
_config: import("@trpc/server").RootConfig<{
|
|
7
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("../context").LyxaContextParams;
|
|
8
|
+
meta: object;
|
|
9
|
+
errorShape: {
|
|
10
|
+
message: string;
|
|
11
|
+
data: {
|
|
12
|
+
stack: undefined;
|
|
13
|
+
path: undefined;
|
|
14
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
15
|
+
httpStatus: number;
|
|
16
|
+
};
|
|
17
|
+
stack: undefined;
|
|
18
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
19
|
+
};
|
|
20
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
21
|
+
}>;
|
|
22
|
+
_meta: object;
|
|
23
|
+
_ctx_out: {
|
|
24
|
+
requestId: string | undefined;
|
|
25
|
+
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
26
|
+
tokenType: import("../../auth").TokenType | undefined;
|
|
27
|
+
entity: import("../context").EntityContext | undefined;
|
|
28
|
+
req: import("http").IncomingMessage;
|
|
29
|
+
usedRefreshToken: boolean | undefined;
|
|
30
|
+
tokenRenewed: boolean | undefined;
|
|
31
|
+
};
|
|
32
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
33
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
34
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
35
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
36
|
+
}>;
|
|
14
37
|
export {};
|
|
@@ -4,13 +4,36 @@ interface AuthOptions {
|
|
|
4
4
|
allowRefreshToken?: boolean;
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").ProcedureBuilder<{
|
|
8
|
+
_config: import("@trpc/server").RootConfig<{
|
|
9
|
+
ctx: import("@trpc/server/dist/adapters/standalone").CreateHTTPContextOptions & import("../context").LyxaContextParams;
|
|
10
|
+
meta: object;
|
|
11
|
+
errorShape: {
|
|
12
|
+
message: string;
|
|
13
|
+
data: {
|
|
14
|
+
stack: undefined;
|
|
15
|
+
path: undefined;
|
|
16
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
17
|
+
httpStatus: number;
|
|
18
|
+
};
|
|
19
|
+
stack: undefined;
|
|
20
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
21
|
+
};
|
|
22
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
23
|
+
}>;
|
|
24
|
+
_meta: object;
|
|
25
|
+
_ctx_out: {
|
|
26
|
+
requestId: string | undefined;
|
|
27
|
+
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
28
|
+
tokenType: TokenType | undefined;
|
|
29
|
+
entity: import("../context").EntityContext | undefined;
|
|
30
|
+
req: import("http").IncomingMessage;
|
|
31
|
+
usedRefreshToken: boolean | undefined;
|
|
32
|
+
tokenRenewed: boolean | undefined;
|
|
33
|
+
};
|
|
34
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
35
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
36
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
37
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
38
|
+
}>;
|
|
16
39
|
export {};
|
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.
|
|
3
|
+
"version": "1.0.167",
|
|
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",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.167",
|
|
4
4
|
"description": "The Core system of the Lyxa services.",
|
|
5
5
|
"author": "elie <42282499+Internalizable@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@google-cloud/secret-manager": "^5.6.0",
|
|
22
22
|
"@mapbox/polyline": "^1.2.1",
|
|
23
|
-
"@trpc/client": "^
|
|
24
|
-
"@trpc/server": "^
|
|
23
|
+
"@trpc/client": "^10.45.2",
|
|
24
|
+
"@trpc/server": "^10.45.2",
|
|
25
25
|
"@typegoose/typegoose": "^12.10.1",
|
|
26
26
|
"@types/amqplib": "^0.10.7",
|
|
27
27
|
"@types/node": "^22.10.2",
|