@lyxa.ai/core 1.3.266 → 1.3.268
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/mongo/models/service-promotion.model.d.ts +1 -2
- package/dist/libraries/mongo/models/service-promotion.model.js +6 -11
- package/dist/libraries/mongo/models/service-promotion.model.js.map +1 -1
- package/dist/libraries/socket/events/order-actions.socket.event.d.ts +2 -1
- package/dist/libraries/socket/events/order-actions.socket.event.js +1 -0
- package/dist/libraries/socket/events/order-actions.socket.event.js.map +1 -1
- package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -18,11 +18,10 @@ export declare class ServicePromotion {
|
|
|
18
18
|
maxDiscountPerOrder?: number;
|
|
19
19
|
isSpendLimitEnabled?: boolean;
|
|
20
20
|
spendLimit?: number;
|
|
21
|
-
spendAmount?: number;
|
|
22
21
|
valueType?: ValueType;
|
|
23
22
|
value?: number;
|
|
24
23
|
status: MarketingStatus;
|
|
25
|
-
deactivationReason?: string;
|
|
26
24
|
pausedAt?: Date | null;
|
|
27
25
|
createdBy?: Ref<Admin>;
|
|
26
|
+
amountSpent?: number;
|
|
28
27
|
}
|
|
@@ -30,13 +30,12 @@ let ServicePromotion = class ServicePromotion {
|
|
|
30
30
|
maxDiscountPerOrder;
|
|
31
31
|
isSpendLimitEnabled;
|
|
32
32
|
spendLimit;
|
|
33
|
-
spendAmount;
|
|
34
33
|
valueType;
|
|
35
34
|
value;
|
|
36
35
|
status;
|
|
37
|
-
deactivationReason;
|
|
38
36
|
pausedAt;
|
|
39
37
|
createdBy;
|
|
38
|
+
amountSpent;
|
|
40
39
|
};
|
|
41
40
|
exports.ServicePromotion = ServicePromotion;
|
|
42
41
|
__decorate([
|
|
@@ -88,11 +87,7 @@ __decorate([
|
|
|
88
87
|
__metadata("design:type", Number)
|
|
89
88
|
], ServicePromotion.prototype, "spendLimit", void 0);
|
|
90
89
|
__decorate([
|
|
91
|
-
(0, typegoose_1.prop)({ type:
|
|
92
|
-
__metadata("design:type", Number)
|
|
93
|
-
], ServicePromotion.prototype, "spendAmount", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType }),
|
|
90
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType, default: enum_1.ValueType.PERCENTAGE }),
|
|
96
91
|
__metadata("design:type", String)
|
|
97
92
|
], ServicePromotion.prototype, "valueType", void 0);
|
|
98
93
|
__decorate([
|
|
@@ -107,10 +102,6 @@ __decorate([
|
|
|
107
102
|
}),
|
|
108
103
|
__metadata("design:type", String)
|
|
109
104
|
], ServicePromotion.prototype, "status", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
(0, typegoose_1.prop)({ type: String }),
|
|
112
|
-
__metadata("design:type", String)
|
|
113
|
-
], ServicePromotion.prototype, "deactivationReason", void 0);
|
|
114
105
|
__decorate([
|
|
115
106
|
(0, typegoose_1.prop)({ type: Date, default: null }),
|
|
116
107
|
__metadata("design:type", Object)
|
|
@@ -119,6 +110,10 @@ __decorate([
|
|
|
119
110
|
(0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
|
|
120
111
|
__metadata("design:type", Object)
|
|
121
112
|
], ServicePromotion.prototype, "createdBy", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], ServicePromotion.prototype, "amountSpent", void 0);
|
|
122
117
|
exports.ServicePromotion = ServicePromotion = __decorate([
|
|
123
118
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'servicePromotions' } })
|
|
124
119
|
], ServicePromotion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,mEAAyD;AACzD,+CAAsC;AACtC,4DAA8D;AAC9D,+DAAqD;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAG9B,QAAQ,CAAY;IAGpB,kBAAkB,CAAW;IAG7B,eAAe,CAAyB;IAGxC,MAAM,CAAuB;IAG7B,YAAY,CAAW;IAGvB,UAAU,CAAe;IAGzB,4BAA4B,CAAW;IAGvC,mBAAmB,CAAU;IAG7B,mBAAmB,CAAW;IAG9B,UAAU,CAAU;IAGpB,
|
|
1
|
+
{"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,mEAAyD;AACzD,+CAAsC;AACtC,4DAA8D;AAC9D,+DAAqD;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAG9B,QAAQ,CAAY;IAGpB,kBAAkB,CAAW;IAG7B,eAAe,CAAyB;IAGxC,MAAM,CAAuB;IAG7B,YAAY,CAAW;IAGvB,UAAU,CAAe;IAGzB,4BAA4B,CAAW;IAGvC,mBAAmB,CAAU;IAG7B,mBAAmB,CAAW;IAG9B,UAAU,CAAU;IAGpB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAOf,MAAM,CAAkB;IAGxB,QAAQ,CAAe;IAGvB,SAAS,CAAc;IAGvB,WAAW,CAAU;CAC5B,CAAA;AA1DY,4CAAgB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,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E,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,OAAO,EAAE,gBAAS,CAAC,UAAU,EAAE,CAAC;;mDAC1C;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACD;AAOf;IALN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sBAAe;QACrB,OAAO,EAAE,sBAAe,CAAC,MAAM;KAC/B,CAAC;;gDAC6B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;mDACG;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACK;2BAzDhB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;GACxD,gBAAgB,CA0D5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';\nimport { ServicePackage } from './service-package.model';\nimport { Admin } from './admin.model';\nimport { Duration, SlotRange } from './shared/duration.model';\nimport { ServiceAddon } from './service-addon.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePromotions' } })\nexport class ServicePromotion {\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, type: String, enum: PromotionType })\n\tpublic promotionType!: PromotionType;\n\n\t@prop({ required: true, type: Duration })\n\tpublic duration!: Duration;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isAppliedByCompany!: boolean;\n\n\t@prop({ ref: () => ServicePackage, default: [] })\n\tpublic servicePackages?: Ref<ServicePackage>[];\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: Boolean })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({ type: SlotRange, default: [] })\n\tpublic slotRanges?: SlotRange[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMaxDiscountPerOrderEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSpendLimitEnabled?: boolean;\n\n\t@prop({ type: Number, min: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: String, enum: ValueType, default: ValueType.PERCENTAGE })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: MarketingStatus,\n\t\tdefault: MarketingStatus.ACTIVE,\n\t})\n\tpublic status: MarketingStatus;\n\n\t@prop({ type: Date, default: null })\n\tpublic pausedAt?: Date | null;\n\n\t@prop({ ref: () => Admin })\n\tpublic createdBy?: Ref<Admin>;\n\n\t@prop({ type: Number })\n\tpublic amountSpent?: number;\n}\n"]}
|
|
@@ -5,7 +5,8 @@ import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
|
5
5
|
export declare enum OrderAction {
|
|
6
6
|
PLACED = "placed",
|
|
7
7
|
ADJUSTMENT = "adjustment",
|
|
8
|
-
REPLACEMENT = "replacement"
|
|
8
|
+
REPLACEMENT = "replacement",
|
|
9
|
+
CANCELLED = "cancelled"
|
|
9
10
|
}
|
|
10
11
|
export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
11
12
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
|
|
@@ -11,6 +11,7 @@ var OrderAction;
|
|
|
11
11
|
OrderAction["PLACED"] = "placed";
|
|
12
12
|
OrderAction["ADJUSTMENT"] = "adjustment";
|
|
13
13
|
OrderAction["REPLACEMENT"] = "replacement";
|
|
14
|
+
OrderAction["CANCELLED"] = "cancelled";
|
|
14
15
|
})(OrderAction || (exports.OrderAction = OrderAction = {}));
|
|
15
16
|
const OrderUserSchema = zod_1.z.object({
|
|
16
17
|
_id: validation_1.ZodValidation.objectId('User ID'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAGpE,IAAY,
|
|
1
|
+
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAGpE,IAAY,WAKX;AALD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;AACxB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,IAAI,EAAE,0BAAa,CAAC,MAAM,CAAC,WAAW,CAAC;CACvC,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,UAAU,CAAC;IACvC,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC;IACxC,OAAO,EAAE,0BAAa,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAClD,IAAI,EAAE,eAAe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AC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,SAAS,EAAE,CAAC;AAKrD,MAAa,uBAAwB,SAAQ,iCAG5C;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,+BAAuB;QAC9B,MAAM,EAAE,gCAAwB;KAChC,CAAC;IAGM,MAAM,CAAC,mBAAmB,CAAC,WAAwB;QAC1D,QAAQ,WAAW,EAAE,CAAC;YACrB,KAAK,WAAW,CAAC,MAAM;gBACtB,OAAO,YAAY,CAAC;YACrB,KAAK,WAAW,CAAC,UAAU;gBAC1B,OAAO,yBAAyB,CAAC;YAClC,KAAK,WAAW,CAAC,WAAW;gBAC3B,OAAO,yBAAyB,CAAC;YAClC;gBACC,OAAO,cAAc,CAAC;QACxB,CAAC;IACF,CAAC;IAED,YAAY,OAAmC;QAC9C,MAAM,OAAO,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACjF,MAAM,uBAAuB,GAAG,IAAI,iDAAuB,CAAC;YAC3D,OAAO;YACP,gBAAgB,EAAE,sBAAe,CAAC,aAAa;YAC/C,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,eAAe,EAAE,OAAO,CAAC,WAAW;SACpC,CAAC,CAAC;QAEH,KAAK,CACJ,sBAAe,CAAC,aAAa,EAC7B,uBAAuB,CAAC,OAAO,EAC/B,OAAO,EACP,SAAS,EACT,uBAAuB,CACvB,CAAC;IACH,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AA3CF,0DA4CC","sourcesContent":["import { z } from 'zod';\nimport { DTO, ZodValidation } from '../../../utilities/validation/';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { SocketNotificationEvent } from './socketNotificationEvent';\nimport { EventFactory } from '../core';\n\nexport enum OrderAction {\n\tPLACED = 'placed',\n\tADJUSTMENT = 'adjustment',\n\tREPLACEMENT = 'replacement',\n\tCANCELLED = 'cancelled',\n}\n\nconst OrderUserSchema = z.object({\n\t_id: ZodValidation.objectId('User ID'),\n\tname: ZodValidation.string('User Name'),\n});\n\nexport const OrderActionsOutputSchema = z.object({\n\t_id: ZodValidation.objectId('Order ID'),\n\tshopId: ZodValidation.objectId('shopId'),\n\torderId: ZodValidation.string('Readable Order ID'),\n\tuser: OrderUserSchema,\n\torderStatus: ZodValidation.enumType(RegularOrderStatus, 'status'),\n\torderAction: ZodValidation.enumType(OrderAction, 'orderAction'),\n\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\tpreparationTimeMinutes: ZodValidation.number('Preparation Time (minutes)', {\n\t\tisNonnegative: true,\n\t}),\n\tadjustedFinance: z.object({\n\t\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\t\tshopProfit: ZodValidation.number('shopProfit'),\n\t\tpricing: z.object({\n\t\t\ttotal: ZodValidation.number('total'),\n\t\t\tsecondaryTotal: ZodValidation.number('secondaryTotal'),\n\t\t\tpaidAmount: ZodValidation.number('paidAmount'),\n\t\t\tsecondaryPaidAmount: ZodValidation.number('secondaryPaidAmount'),\n\t\t\tdeliveryFee: ZodValidation.number('deliveryFee'),\n\t\t\tsecondaryDeliveryFee: ZodValidation.number('secondaryDeliveryFee'),\n\t\t\triderTips: ZodValidation.number('riderTip'),\n\t\t\tsecondaryRiderTips: ZodValidation.number('secondaryRiderTips'),\n\t\t}),\n\t}),\n\tcreatedAt: ZodValidation.coerce.date('Order Creation Date'),\n\ttriggerAt: ZodValidation.coerce.date('Order Trigger Date'),\n\torderActionType: ZodValidation.enumType(OrderAction, 'order action type'),\n});\n\nexport const OrderActionsInputSchema = z.undefined();\n\nexport type OrderActionSocketInputDTO = DTO<typeof OrderActionsInputSchema>;\nexport type OrderActionSocketOutputDTO = DTO<typeof OrderActionsOutputSchema>;\n\nexport class OrderActionsSocketEvent extends BaseSocketEvent<\n\ttypeof OrderActionsInputSchema,\n\ttypeof OrderActionsOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: OrderActionsInputSchema,\n\t\toutput: OrderActionsOutputSchema,\n\t};\n\n\t// Map each OrderAction to its message\n\tprivate static getMessageForAction(orderAction: OrderAction): string {\n\t\tswitch (orderAction) {\n\t\t\tcase OrderAction.PLACED:\n\t\t\t\treturn 'New Order!';\n\t\t\tcase OrderAction.ADJUSTMENT:\n\t\t\t\treturn 'Order has been adjusted';\n\t\t\tcase OrderAction.REPLACEMENT:\n\t\t\t\treturn 'Order has been replaced';\n\t\t\tdefault:\n\t\t\t\treturn 'Order update';\n\t\t}\n\t}\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tconst message = OrderActionsSocketEvent.getMessageForAction(payload.orderAction);\n\t\tconst socketNotificationEvent = new SocketNotificationEvent({\n\t\t\tmessage,\n\t\t\tnotificationType: SocketEventType.ORDER_ACTIONS,\n\t\t\t_id: payload._id,\n\t\t\torderActionType: payload.orderAction,\n\t\t});\n\n\t\tsuper(\n\t\t\tSocketEventType.ORDER_ACTIONS,\n\t\t\tOrderActionsSocketEvent.schemas,\n\t\t\tpayload,\n\t\t\tundefined,\n\t\t\tsocketNotificationEvent\n\t\t);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
|
|
@@ -5,10 +5,10 @@ interface AuthOptions {
|
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
8
|
-
req: import("http").IncomingMessage;
|
|
9
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
10
9
|
tokenType: TokenType | undefined;
|
|
11
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
+
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: boolean | undefined;
|
|
@@ -4,10 +4,10 @@ interface RoleProtectedOptions {
|
|
|
4
4
|
allowedRoles: string[];
|
|
5
5
|
}
|
|
6
6
|
export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
7
|
-
req: import("http").IncomingMessage;
|
|
8
7
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
9
8
|
tokenType: import("../../auth").TokenType | undefined;
|
|
10
9
|
entity: import("../context").EntityContext | undefined;
|
|
10
|
+
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
usedRefreshToken: boolean | undefined;
|
|
13
13
|
tokenRenewed: boolean | undefined;
|
|
@@ -3,10 +3,10 @@ interface PhoneVerifiedOptions {
|
|
|
3
3
|
entityTypes: AuthEntityType[];
|
|
4
4
|
}
|
|
5
5
|
export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
6
|
-
req: import("http").IncomingMessage;
|
|
7
6
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
8
7
|
tokenType: import("../../auth").TokenType | undefined;
|
|
9
8
|
entity: import("../context").EntityContext | undefined;
|
|
9
|
+
req: import("http").IncomingMessage;
|
|
10
10
|
requestId: string | undefined;
|
|
11
11
|
usedRefreshToken: boolean | undefined;
|
|
12
12
|
tokenRenewed: boolean | undefined;
|
|
@@ -5,10 +5,10 @@ interface AuthOptions {
|
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
8
|
-
req: import("http").IncomingMessage;
|
|
9
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
10
9
|
tokenType: TokenType | undefined;
|
|
11
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
+
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: boolean | undefined;
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED