@lyxa.ai/core 1.3.254 → 1.3.257

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.
Files changed (31) hide show
  1. package/dist/libraries/auth/index.d.ts +2 -8
  2. package/dist/libraries/auth/index.js +3 -10
  3. package/dist/libraries/auth/index.js.map +1 -1
  4. package/dist/libraries/mongo/models/app-instance.model.d.ts +9 -0
  5. package/dist/libraries/mongo/models/app-instance.model.js +49 -0
  6. package/dist/libraries/mongo/models/app-instance.model.js.map +1 -0
  7. package/dist/libraries/mongo/models/index.d.ts +3 -0
  8. package/dist/libraries/mongo/models/index.js +4 -0
  9. package/dist/libraries/mongo/models/index.js.map +1 -1
  10. package/dist/libraries/socket/events/chatlist-message-send.socket.event.d.ts +12 -0
  11. package/dist/libraries/socket/events/chatlist-message-send.socket.event.js +1 -0
  12. package/dist/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -1
  13. package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +13 -0
  14. package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +3 -0
  15. package/dist/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -1
  16. package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
  17. package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
  18. package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
  19. package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
  20. package/dist/types/README.md +1 -1
  21. package/dist/types/package.json +1 -1
  22. package/dist/types/utilities/enum.d.ts +8 -0
  23. package/dist/types/utilities/enum.js +12 -3
  24. package/dist/types/utilities/enum.js.map +1 -1
  25. package/dist/utilities/app-instance.d.ts +4 -0
  26. package/dist/utilities/app-instance.js +22 -0
  27. package/dist/utilities/app-instance.js.map +1 -0
  28. package/dist/utilities/enum.d.ts +8 -0
  29. package/dist/utilities/enum.js +12 -3
  30. package/dist/utilities/enum.js.map +1 -1
  31. package/package.json +1 -1
@@ -3,14 +3,8 @@ import { EntityContext } from '../trpc/context';
3
3
  import { RefreshToken } from './refreshtoken';
4
4
  import { ReturnModelType } from '@typegoose/typegoose';
5
5
  import { Rider } from '../mongo/models';
6
- export declare enum AuthEntityType {
7
- USER = "USER",
8
- SELLER = "SELLER",
9
- DELIVERY_BOY = "DELIVERY_BOY",
10
- CRM = "CRM",
11
- VENDOR_PARENT = "VENDOR_PARENT",
12
- PROFESSIONAL = "PROFESSIONAL"
13
- }
6
+ import { AuthEntityType } from '../../utilities/enum';
7
+ export { AuthEntityType };
14
8
  export declare enum TokenType {
15
9
  ACCESS = "ACCESS",
16
10
  REFRESH = "REFRESH"
@@ -22,15 +22,8 @@ const refreshtoken_1 = require("./refreshtoken");
22
22
  const index_1 = require("../../index");
23
23
  const typegoose_1 = require("@typegoose/typegoose");
24
24
  const models_1 = require("../mongo/models");
25
- var AuthEntityType;
26
- (function (AuthEntityType) {
27
- AuthEntityType["USER"] = "USER";
28
- AuthEntityType["SELLER"] = "SELLER";
29
- AuthEntityType["DELIVERY_BOY"] = "DELIVERY_BOY";
30
- AuthEntityType["CRM"] = "CRM";
31
- AuthEntityType["VENDOR_PARENT"] = "VENDOR_PARENT";
32
- AuthEntityType["PROFESSIONAL"] = "PROFESSIONAL";
33
- })(AuthEntityType || (exports.AuthEntityType = AuthEntityType = {}));
25
+ const enum_1 = require("../../utilities/enum");
26
+ Object.defineProperty(exports, "AuthEntityType", { enumerable: true, get: function () { return enum_1.AuthEntityType; } });
34
27
  var TokenType;
35
28
  (function (TokenType) {
36
29
  TokenType["ACCESS"] = "ACCESS";
@@ -146,7 +139,7 @@ async function verifyAccessToken(entityTypes, token) {
146
139
  async function validateRefreshToken(token) {
147
140
  const tokenRepository = (0, index_1.getLibraries)().getAuthTokenRepository();
148
141
  const storedToken = await tokenRepository.findRefreshToken(token);
149
- if (storedToken && storedToken?.entityType === AuthEntityType.DELIVERY_BOY) {
142
+ if (storedToken && storedToken?.entityType === enum_1.AuthEntityType.DELIVERY_BOY) {
150
143
  const rider = await getRiderModel().findOne({ _id: storedToken.entityId }).lean();
151
144
  if (rider && storedToken.metadata && rider.lastLoginDeviceId !== storedToken.metadata.deviceId) {
152
145
  return { valid: false };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/auth/index.ts"],"names":[],"mappings":";;;;;;AAsCA,oDAKC;AAGD,sCAKC;AAKD,kEAIC;AAMD,0CA2BC;AAKD,oDAuDC;AAaD,8CAwBC;AAKD,oDAiCE;AAMF,sCAoCC;AAKD,gDAGC;AAKD,wDAGC;AAKD,sCA6BC;AAOD,gDA2EC;AAlZD,gEAA4D;AAE5D,mCAAqC;AACrC,iDAA8C;AAC9C,uCAA2C;AAC3C,oDAAyE;AACzE,4CAAwC;AAExC,IAAY,cAOX;AAPD,WAAY,cAAc;IACzB,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,+CAA6B,CAAA;IAC7B,6BAAW,CAAA;IACX,iDAA+B,CAAA;IAC/B,+CAA6B,CAAA;AAC9B,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACpB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACpB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAYD,IAAI,uBAAuB,GAAgD,IAAI,CAAC;AAChF,IAAI,UAAU,GAAyC,IAAI,CAAC;AAK5D,SAAgB,oBAAoB;IACnC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAC/F,CAAC;IACD,OAAO,uBAAuB,CAAC;AAChC,CAAC;AAGD,SAAgB,aAAa;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAC/F,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAKD,SAAg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,YAAY,CAAC,CAAC;QAEvD,OAAO;YACN,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,UAAU;YAClB,WAAW,EAAE,SAAS;YACtB,SAAS,EAAE;gBACV,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,YAAY,EAAE,SAAS,CAAC,YAAY;aACpC;SACD,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC;QAC5C,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC,CAAC;IAEH,OAAO;QACN,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE;YACV,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,IAAI;SAClB;KACD,CAAC;AACH,CAAC","sourcesContent":["import jwt, { SignOptions, JwtPayload } from 'jsonwebtoken';\nimport { EntityContext } from '../trpc/context';\nimport { randomBytes } from 'crypto';\nimport { RefreshToken } from './refreshtoken';\nimport { getLibraries } from '../../index';\nimport { getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { Rider } from '../mongo/models';\n\nexport enum AuthEntityType {\n\tUSER = 'USER',\n\tSELLER = 'SELLER',\n\tDELIVERY_BOY = 'DELIVERY_BOY',\n\tCRM = 'CRM',\n\tVENDOR_PARENT = 'VENDOR_PARENT',\n\tPROFESSIONAL = 'PROFESSIONAL'\n}\n\nexport enum TokenType {\n\tACCESS = 'ACCESS',\n\tREFRESH = 'REFRESH',\n}\n\nexport interface RefreshTokenRecord {\n\ttoken: string;\n\tentityId: string;\n\tentityType: AuthEntityType;\n\texpiresAt: Date;\n\tisRevoked: boolean;\n\tmetadata?: Record<string, unknown>;\n}\n\n// Global model for RefreshToken - will be set after initGlobalConnection()\nlet actualRefreshTokenModel: ReturnModelType<typeof RefreshToken> | null = null;\nlet riderModel: ReturnModelType<typeof Rider> | null = null;\n\n/**\n * Get the RefreshToken model (throws if not initialized)\n */\nexport function getRefreshTokenModel(): ReturnModelType<typeof RefreshToken> {\n\tif (!actualRefreshTokenModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn actualRefreshTokenModel;\n}\n\n\nexport function getRiderModel(): ReturnModelType<typeof Rider> {\n\tif (!riderModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn riderModel;\n}\n\n/**\n * Initialize the RefreshToken model (called from initGlobalConnection)\n */\nexport function initializeRefreshTokenModel(globalConnection: any) {\n\tactualRefreshTokenModel = getModelForClass(RefreshToken, { existingConnection: globalConnection });\n\triderModel = getModelForClass(Rider, { existingConnection: globalConnection })\n\tconsole.log('✅ RefreshToken model initialized');\n}\n\n/**\n * Sign a JWT access token for the given entity (id + type).\n * It will fetch the secret for that entity type and create a token.\n */\nexport async function signAccessToken(\n\tentity: { id: string; type: AuthEntityType; parameters: Record<string, unknown> },\n\toptions?: SignOptions\n): Promise<string> {\n\tif (!entity?.type) {\n\t\tthrow new Error('Entity type is required to sign token');\n\t}\n\n\tconst secret = await getLibraries().getSecretsService().getKey(`${entity.type.toUpperCase()}_JWT_TOKEN`);\n\n\tif (!secret) {\n\t\tthrow new Error(`No secret found for entity type ${entity.type}`);\n\t}\n\n\tconst payload = {\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t\ttokenType: TokenType.ACCESS,\n\t};\n\n\tconst tokenOptions: SignOptions = {\n\t\t...options,\n\t\texpiresIn: options?.expiresIn || '1d',\n\t};\n\n\treturn jwt.sign(payload, secret, tokenOptions);\n}\n\n/**\n * Generate a refresh token for the given entity\n */\nexport async function generateRefreshToken(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { expiresIn?: string | number }\n): Promise<string> {\n\tconst tokenValue = randomBytes(40).toString('hex');\n\n\tconst expiresIn = options?.expiresIn || '7d';\n\tconst expiresAt = new Date();\n\n\tif (typeof expiresIn === 'string') {\n\t\t// Parse duration strings like '7d', '30d', etc.\n\t\tconst match = expiresIn.match(/^(\\d+)([smhdwy])$/);\n\t\tif (match) {\n\t\t\tconst value = parseInt(match[1]);\n\t\t\tconst unit = match[2];\n\n\t\t\tswitch (unit) {\n\t\t\t\tcase 's':\n\t\t\t\t\texpiresAt.setSeconds(expiresAt.getSeconds() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm':\n\t\t\t\t\texpiresAt.setMinutes(expiresAt.getMinutes() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'h':\n\t\t\t\t\texpiresAt.setHours(expiresAt.getHours() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value * 7);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\texpiresAt.setFullYear(expiresAt.getFullYear() + value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t// Default to 7 days if format is invalid\n\t\t\texpiresAt.setDate(expiresAt.getDate() + 7);\n\t\t}\n\t} else if (typeof expiresIn === 'number') {\n\t\t// Interpret number as seconds\n\t\texpiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);\n\t}\n\n\tawait storeRefreshToken({\n\t\ttoken: tokenValue,\n\t\tentityId: entity.id,\n\t\tentityType: entity.type,\n\t\texpiresAt,\n\t\tisRevoked: false,\n\t\tmetadata: entity.parameters,\n\t});\n\n\treturn tokenValue;\n}\n\n/**\n * Store a refresh token in the database\n */\nasync function storeRefreshToken(tokenRecord: RefreshTokenRecord): Promise<void> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tawait tokenRepository.saveRefreshToken(tokenRecord);\n}\n\n/**\n * Verify an access token for the given entity types\n */\nexport async function verifyAccessToken(\n\tentityTypes: AuthEntityType[],\n\ttoken: string\n): Promise<EntityContext | undefined> {\n\tfor (const entityType of entityTypes) {\n\t\tconst secret = await getLibraries()\n\t\t\t.getSecretsService()\n\t\t\t.getKey(entityType.toUpperCase() + '_JWT_TOKEN');\n\n\t\ttry {\n\t\t\tconst decoded = jwt.verify(token, secret!) as EntityContext & { tokenType?: TokenType };\n\n\t\t\t// Verify this is an access token\n\t\t\tif (decoded.tokenType !== TokenType.ACCESS) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn decoded;\n\t\t} catch (err) {\n\t\t\t// Continue to the next entity type\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validate a refresh token and return the associated entity\n */\nexport async function validateRefreshToken(token: string): Promise<{\n\t\tvalid: boolean;\n\t\tentity?: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> };\n\t}> {\n\t\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\t\tconst storedToken = await tokenRepository.findRefreshToken(token);\t\t\n\t\tif (storedToken && storedToken?.entityType === AuthEntityType.DELIVERY_BOY) {\n\t\t\tconst rider = await getRiderModel().findOne({ _id: storedToken.entityId }).lean();\t\t\t\n\t\t\tif (rider && storedToken.metadata && rider.lastLoginDeviceId !== storedToken.metadata.deviceId) {\t\t\t\t\n\t\t\t\treturn { valid: false };\n\t\t\t}\n\t\t}\n\n\t\tif (!storedToken) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\tif (storedToken.expiresAt && new Date() > storedToken.expiresAt) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\tif (storedToken.isRevoked) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\tentity: {\n\t\t\t\tid: storedToken.entityId,\n\t\t\t\ttype: storedToken.entityType,\n\t\t\t\tparameters: storedToken.metadata,\n\t\t\t},\n\t\t};\n\t}\n\n/**\n * Refresh authentication tokens\n * Returns new access and refresh tokens\n */\nexport async function refreshTokens(refreshToken: string): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n\tentity: { id: string; type: AuthEntityType };\n} | null> {\n\t// Validate the refresh token\n\tconst validation = await validateRefreshToken(refreshToken);\n\n\tif (!validation.valid || !validation.entity) {\n\t\treturn null;\n\t}\n\n\tawait revokeRefreshToken(refreshToken);\n\n\t// Create new tokens\n\tconst entity = validation.entity;\n\tconst newAccessToken = await signAccessToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters || {},\n\t});\n\n\tconst newRefreshToken = await generateRefreshToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t});\n\n\treturn {\n\t\taccessToken: newAccessToken,\n\t\trefreshToken: newRefreshToken,\n\t\tentity: {\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t},\n\t};\n}\n\n/**\n * Revoke a refresh token\n */\nexport async function revokeRefreshToken(token: string): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeRefreshToken(token);\n}\n\n/**\n * Revoke all refresh tokens for a specific entity\n */\nexport async function revokeAllRefreshTokens(entityId: string, entityType: AuthEntityType): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeAllRefreshTokensForEntity(entityId, entityType);\n}\n\n/**\n * Sign both access and refresh tokens - utility for initial login/authentication\n */\nexport async function signTokenPair(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { accessTokenOptions?: SignOptions; refreshTokenExpiresIn?: string | number }\n): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n}> {\n\tconst accessToken = await signAccessToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters || {},\n\t\t},\n\t\toptions?.accessTokenOptions\n\t);\n\n\tconst refreshToken = await generateRefreshToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters,\n\t\t},\n\t\t{ expiresIn: options?.refreshTokenExpiresIn }\n\t);\n\n\treturn {\n\t\taccessToken,\n\t\trefreshToken,\n\t};\n}\n\n/**\n * Handle the refresh token validation and renewal logic\n * @param refreshToken The refresh token to validate or renew\n * @returns Result object with token status and renewal information\n */\nexport async function handleTokenRenewal(refreshToken: string): Promise<{\n\tsuccess: boolean;\n\tentity?: {\n\t\tid: string;\n\t\ttype: AuthEntityType;\n\t\tparameters: Record<string, unknown>;\n\t};\n\ttokenStatus: 'valid' | 'expired' | 'revoked' | 'invalid';\n\tnewTokens?: {\n\t\taccessToken: string;\n\t\trefreshToken?: string | null;\n\t};\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\n\tconst storedToken = await tokenRepository.findRefreshToken(refreshToken);\n\n\tif (!storedToken) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'invalid',\n\t\t};\n\t}\n\n\tconst isRevoked = storedToken.isRevoked;\n\tif (isRevoked) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'revoked',\n\t\t};\n\t}\n\n\tconst isExpired = storedToken.isExpired();\n\n\tconst entityData = {\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t};\n\n\tif (isExpired) {\n\t\tconst newTokens = await signTokenPair({\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata || {},\n\t\t});\n\n\t\tawait tokenRepository.revokeRefreshToken(refreshToken);\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tentity: entityData,\n\t\t\ttokenStatus: 'expired',\n\t\t\tnewTokens: {\n\t\t\t\taccessToken: newTokens.accessToken,\n\t\t\t\trefreshToken: newTokens.refreshToken,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst newAccessToken = await signAccessToken({\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t});\n\n\treturn {\n\t\tsuccess: true,\n\t\tentity: entityData,\n\t\ttokenStatus: 'valid',\n\t\tnewTokens: {\n\t\t\taccessToken: newAccessToken,\n\t\t\trefreshToken: null,\n\t\t},\n\t};\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/auth/index.ts"],"names":[],"mappings":";;;;;;AAgCA,oDAKC;AAGD,sCAKC;AAKD,kEAIC;AAMD,0CA2BC;AAKD,oDAuDC;AAaD,8CAwBC;AAKD,oDAiCE;AAMF,sCAoCC;AAKD,gDAGC;AAKD,wDAGC;AAKD,sCA6BC;AAOD,gDA2EC;AA5YD,gEAA4D;AAE5D,mCAAqC;AACrC,iDAA8C;AAC9C,uCAA2C;AAC3C,oDAAyE;AACzE,4CAAwC;AACxC,+CAAsD;AAE9C,+FAFC,qBAAc,OAED;AAEtB,IAAY,SAGX;AAHD,WAAY,SAAS;IACpB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACpB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAYD,IAAI,uBAAuB,GAAgD,IAAI,CAAC;AAChF,IAAI,UAAU,GAAyC,IAAI,CAAC;AAK5D,SAAgB,oBAAoB;IACnC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAC/F,CAAC;IACD,OAAO,uBAAuB,CAAC;AAChC,CAAC;AAGD,SAAgB,aAAa;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAC/F,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAKD,SAAgB,2BAA2B,CAAC,gBAAqB;IAChE,uBAAuB,GAAG,IAAA,4BAAgB,EAAC,2BAAY,EAAE,EA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ClB,WAAW,EAAE,SAAS;YACtB,SAAS,EAAE;gBACV,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,YAAY,EAAE,SAAS,CAAC,YAAY;aACpC;SACD,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC;QAC5C,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC,CAAC;IAEH,OAAO;QACN,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE;YACV,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,IAAI;SAClB;KACD,CAAC;AACH,CAAC","sourcesContent":["import jwt, { SignOptions, JwtPayload } from 'jsonwebtoken';\nimport { EntityContext } from '../trpc/context';\nimport { randomBytes } from 'crypto';\nimport { RefreshToken } from './refreshtoken';\nimport { getLibraries } from '../../index';\nimport { getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { Rider } from '../mongo/models';\nimport { AuthEntityType } from '../../utilities/enum';\n\nexport {AuthEntityType}\n\nexport enum TokenType {\n\tACCESS = 'ACCESS',\n\tREFRESH = 'REFRESH',\n}\n\nexport interface RefreshTokenRecord {\n\ttoken: string;\n\tentityId: string;\n\tentityType: AuthEntityType;\n\texpiresAt: Date;\n\tisRevoked: boolean;\n\tmetadata?: Record<string, unknown>;\n}\n\n// Global model for RefreshToken - will be set after initGlobalConnection()\nlet actualRefreshTokenModel: ReturnModelType<typeof RefreshToken> | null = null;\nlet riderModel: ReturnModelType<typeof Rider> | null = null;\n\n/**\n * Get the RefreshToken model (throws if not initialized)\n */\nexport function getRefreshTokenModel(): ReturnModelType<typeof RefreshToken> {\n\tif (!actualRefreshTokenModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn actualRefreshTokenModel;\n}\n\n\nexport function getRiderModel(): ReturnModelType<typeof Rider> {\n\tif (!riderModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn riderModel;\n}\n\n/**\n * Initialize the RefreshToken model (called from initGlobalConnection)\n */\nexport function initializeRefreshTokenModel(globalConnection: any) {\n\tactualRefreshTokenModel = getModelForClass(RefreshToken, { existingConnection: globalConnection });\n\triderModel = getModelForClass(Rider, { existingConnection: globalConnection })\n\tconsole.log('✅ RefreshToken model initialized');\n}\n\n/**\n * Sign a JWT access token for the given entity (id + type).\n * It will fetch the secret for that entity type and create a token.\n */\nexport async function signAccessToken(\n\tentity: { id: string; type: AuthEntityType; parameters: Record<string, unknown> },\n\toptions?: SignOptions\n): Promise<string> {\n\tif (!entity?.type) {\n\t\tthrow new Error('Entity type is required to sign token');\n\t}\n\n\tconst secret = await getLibraries().getSecretsService().getKey(`${entity.type.toUpperCase()}_JWT_TOKEN`);\n\n\tif (!secret) {\n\t\tthrow new Error(`No secret found for entity type ${entity.type}`);\n\t}\n\n\tconst payload = {\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t\ttokenType: TokenType.ACCESS,\n\t};\n\n\tconst tokenOptions: SignOptions = {\n\t\t...options,\n\t\texpiresIn: options?.expiresIn || '1d',\n\t};\n\n\treturn jwt.sign(payload, secret, tokenOptions);\n}\n\n/**\n * Generate a refresh token for the given entity\n */\nexport async function generateRefreshToken(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { expiresIn?: string | number }\n): Promise<string> {\n\tconst tokenValue = randomBytes(40).toString('hex');\n\n\tconst expiresIn = options?.expiresIn || '7d';\n\tconst expiresAt = new Date();\n\n\tif (typeof expiresIn === 'string') {\n\t\t// Parse duration strings like '7d', '30d', etc.\n\t\tconst match = expiresIn.match(/^(\\d+)([smhdwy])$/);\n\t\tif (match) {\n\t\t\tconst value = parseInt(match[1]);\n\t\t\tconst unit = match[2];\n\n\t\t\tswitch (unit) {\n\t\t\t\tcase 's':\n\t\t\t\t\texpiresAt.setSeconds(expiresAt.getSeconds() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm':\n\t\t\t\t\texpiresAt.setMinutes(expiresAt.getMinutes() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'h':\n\t\t\t\t\texpiresAt.setHours(expiresAt.getHours() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value * 7);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\texpiresAt.setFullYear(expiresAt.getFullYear() + value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t// Default to 7 days if format is invalid\n\t\t\texpiresAt.setDate(expiresAt.getDate() + 7);\n\t\t}\n\t} else if (typeof expiresIn === 'number') {\n\t\t// Interpret number as seconds\n\t\texpiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);\n\t}\n\n\tawait storeRefreshToken({\n\t\ttoken: tokenValue,\n\t\tentityId: entity.id,\n\t\tentityType: entity.type,\n\t\texpiresAt,\n\t\tisRevoked: false,\n\t\tmetadata: entity.parameters,\n\t});\n\n\treturn tokenValue;\n}\n\n/**\n * Store a refresh token in the database\n */\nasync function storeRefreshToken(tokenRecord: RefreshTokenRecord): Promise<void> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tawait tokenRepository.saveRefreshToken(tokenRecord);\n}\n\n/**\n * Verify an access token for the given entity types\n */\nexport async function verifyAccessToken(\n\tentityTypes: AuthEntityType[],\n\ttoken: string\n): Promise<EntityContext | undefined> {\n\tfor (const entityType of entityTypes) {\n\t\tconst secret = await getLibraries()\n\t\t\t.getSecretsService()\n\t\t\t.getKey(entityType.toUpperCase() + '_JWT_TOKEN');\n\n\t\ttry {\n\t\t\tconst decoded = jwt.verify(token, secret!) as EntityContext & { tokenType?: TokenType };\n\n\t\t\t// Verify this is an access token\n\t\t\tif (decoded.tokenType !== TokenType.ACCESS) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn decoded;\n\t\t} catch (err) {\n\t\t\t// Continue to the next entity type\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validate a refresh token and return the associated entity\n */\nexport async function validateRefreshToken(token: string): Promise<{\n\t\tvalid: boolean;\n\t\tentity?: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> };\n\t}> {\n\t\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\t\tconst storedToken = await tokenRepository.findRefreshToken(token);\t\t\n\t\tif (storedToken && storedToken?.entityType === AuthEntityType.DELIVERY_BOY) {\n\t\t\tconst rider = await getRiderModel().findOne({ _id: storedToken.entityId }).lean();\t\t\t\n\t\t\tif (rider && storedToken.metadata && rider.lastLoginDeviceId !== storedToken.metadata.deviceId) {\t\t\t\t\n\t\t\t\treturn { valid: false };\n\t\t\t}\n\t\t}\n\n\t\tif (!storedToken) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\tif (storedToken.expiresAt && new Date() > storedToken.expiresAt) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\tif (storedToken.isRevoked) {\n\t\t\treturn { valid: false };\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\tentity: {\n\t\t\t\tid: storedToken.entityId,\n\t\t\t\ttype: storedToken.entityType,\n\t\t\t\tparameters: storedToken.metadata,\n\t\t\t},\n\t\t};\n\t}\n\n/**\n * Refresh authentication tokens\n * Returns new access and refresh tokens\n */\nexport async function refreshTokens(refreshToken: string): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n\tentity: { id: string; type: AuthEntityType };\n} | null> {\n\t// Validate the refresh token\n\tconst validation = await validateRefreshToken(refreshToken);\n\n\tif (!validation.valid || !validation.entity) {\n\t\treturn null;\n\t}\n\n\tawait revokeRefreshToken(refreshToken);\n\n\t// Create new tokens\n\tconst entity = validation.entity;\n\tconst newAccessToken = await signAccessToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters || {},\n\t});\n\n\tconst newRefreshToken = await generateRefreshToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t});\n\n\treturn {\n\t\taccessToken: newAccessToken,\n\t\trefreshToken: newRefreshToken,\n\t\tentity: {\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t},\n\t};\n}\n\n/**\n * Revoke a refresh token\n */\nexport async function revokeRefreshToken(token: string): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeRefreshToken(token);\n}\n\n/**\n * Revoke all refresh tokens for a specific entity\n */\nexport async function revokeAllRefreshTokens(entityId: string, entityType: AuthEntityType): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeAllRefreshTokensForEntity(entityId, entityType);\n}\n\n/**\n * Sign both access and refresh tokens - utility for initial login/authentication\n */\nexport async function signTokenPair(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { accessTokenOptions?: SignOptions; refreshTokenExpiresIn?: string | number }\n): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n}> {\n\tconst accessToken = await signAccessToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters || {},\n\t\t},\n\t\toptions?.accessTokenOptions\n\t);\n\n\tconst refreshToken = await generateRefreshToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters,\n\t\t},\n\t\t{ expiresIn: options?.refreshTokenExpiresIn }\n\t);\n\n\treturn {\n\t\taccessToken,\n\t\trefreshToken,\n\t};\n}\n\n/**\n * Handle the refresh token validation and renewal logic\n * @param refreshToken The refresh token to validate or renew\n * @returns Result object with token status and renewal information\n */\nexport async function handleTokenRenewal(refreshToken: string): Promise<{\n\tsuccess: boolean;\n\tentity?: {\n\t\tid: string;\n\t\ttype: AuthEntityType;\n\t\tparameters: Record<string, unknown>;\n\t};\n\ttokenStatus: 'valid' | 'expired' | 'revoked' | 'invalid';\n\tnewTokens?: {\n\t\taccessToken: string;\n\t\trefreshToken?: string | null;\n\t};\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\n\tconst storedToken = await tokenRepository.findRefreshToken(refreshToken);\n\n\tif (!storedToken) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'invalid',\n\t\t};\n\t}\n\n\tconst isRevoked = storedToken.isRevoked;\n\tif (isRevoked) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'revoked',\n\t\t};\n\t}\n\n\tconst isExpired = storedToken.isExpired();\n\n\tconst entityData = {\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t};\n\n\tif (isExpired) {\n\t\tconst newTokens = await signTokenPair({\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata || {},\n\t\t});\n\n\t\tawait tokenRepository.revokeRefreshToken(refreshToken);\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tentity: entityData,\n\t\t\ttokenStatus: 'expired',\n\t\t\tnewTokens: {\n\t\t\t\taccessToken: newTokens.accessToken,\n\t\t\t\trefreshToken: newTokens.refreshToken,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst newAccessToken = await signAccessToken({\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t});\n\n\treturn {\n\t\tsuccess: true,\n\t\tentity: entityData,\n\t\ttokenStatus: 'valid',\n\t\tnewTokens: {\n\t\t\taccessToken: newAccessToken,\n\t\t\trefreshToken: null,\n\t\t},\n\t};\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
2
+ import { AppPlatform, AuthEntityType } from '../../../utilities/enum';
3
+ export declare class AppInstance extends TimeStamps {
4
+ entityId: string;
5
+ entityType: AuthEntityType;
6
+ platform?: AppPlatform;
7
+ appVersion?: string;
8
+ fcmToken?: string;
9
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AppInstance = void 0;
13
+ const typegoose_1 = require("@typegoose/typegoose");
14
+ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
+ const enum_1 = require("../../../utilities/enum");
16
+ let AppInstance = class AppInstance extends defaultClasses_1.TimeStamps {
17
+ entityId;
18
+ entityType;
19
+ platform;
20
+ appVersion;
21
+ fcmToken;
22
+ };
23
+ exports.AppInstance = AppInstance;
24
+ __decorate([
25
+ (0, typegoose_1.prop)({ required: true, type: String }),
26
+ __metadata("design:type", String)
27
+ ], AppInstance.prototype, "entityId", void 0);
28
+ __decorate([
29
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.AuthEntityType }),
30
+ __metadata("design:type", String)
31
+ ], AppInstance.prototype, "entityType", void 0);
32
+ __decorate([
33
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.AppPlatform }),
34
+ __metadata("design:type", String)
35
+ ], AppInstance.prototype, "platform", void 0);
36
+ __decorate([
37
+ (0, typegoose_1.prop)({ type: String }),
38
+ __metadata("design:type", String)
39
+ ], AppInstance.prototype, "appVersion", void 0);
40
+ __decorate([
41
+ (0, typegoose_1.prop)({ type: String }),
42
+ __metadata("design:type", String)
43
+ ], AppInstance.prototype, "fcmToken", void 0);
44
+ exports.AppInstance = AppInstance = __decorate([
45
+ (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'appInstances' } }),
46
+ (0, typegoose_1.index)({ entityType: 1, entityId: 1 }),
47
+ (0, typegoose_1.index)({ fcmToken: 1 })
48
+ ], AppInstance);
49
+ //# sourceMappingURL=app-instance.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-instance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/app-instance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiE;AACjE,4EAAqE;AACrE,kDAAsE;AAK/D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,QAAQ,CAAU;IAGlB,UAAU,CAAkB;IAG5B,QAAQ,CAAe;IAGvB,UAAU,CAAU;IAGpB,QAAQ,CAAU;CACzB,CAAA;AAfY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;+CAC1B;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;6CACZ;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACI;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACE;sBAdb,WAAW;IAHvB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC;IAC/D,IAAA,iBAAK,EAAC,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACrC,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;GACV,WAAW,CAevB","sourcesContent":["import { index, modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { AppPlatform, AuthEntityType } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'appInstances' } })\n@index({ entityType: 1, entityId: 1 })\n@index({ fcmToken: 1 })\nexport class AppInstance extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic entityId!: string;\n\n\t@prop({ required: true, type: String, enum: AuthEntityType })\n\tpublic entityType!: AuthEntityType;\n\n\t@prop({ type: String, enum: AppPlatform })\n\tpublic platform?: AppPlatform;\n\n\t@prop({ type: String })\n\tpublic appVersion?: string;\n\n\t@prop({ type: String })\n\tpublic fcmToken?: string;\n}\n"]}
@@ -107,6 +107,7 @@ import { Log } from './log.model';
107
107
  import { Card } from './card.model';
108
108
  import { ProductStockTracker } from './product-stock-tracker.model';
109
109
  import { PaymentIntent } from './payment-intent.model';
110
+ import { AppInstance } from './app-instance.model';
110
111
  export declare const ActivityLogModel: ReturnModelType<typeof ActivityLog>;
111
112
  export * from './activity-log.model';
112
113
  export declare const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl>;
@@ -326,3 +327,5 @@ export * from './log.model';
326
327
  export declare const ZoneExtraTimeModel: ReturnModelType<typeof ZoneExtraTime>;
327
328
  export * from './zone-extra-time';
328
329
  export * from './google-maps-usage.model';
330
+ export declare const AppInstanceModel: ReturnModelType<typeof AppInstance>;
331
+ export * from './app-instance.model';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.ShopPayoutModel = exports.PayoutModel = exports.ParentModel = exports.ShopCourierOrderModel = exports.CourierOrderModel = exports.RegularOrderModel = exports.OrderModel = exports.NutritionModel = exports.NotificationModel = exports.MealPlanModel = exports.PunchMarketingModel = exports.FreeDeliveryMarketingModel = exports.FeaturedMarketingModel = exports.DiscountMarketingModel = exports.Buy1Get1MarketingModel = exports.MarketingModel = exports.ListContainerModel = exports.LineItemModel = exports.GalleryUploadModel = exports.GalleryModel = exports.FlagModel = exports.FinanceSettlementModel = exports.FilterContainerModel = exports.FeaturedSettingModel = exports.FavouriteModel = exports.DishModel = exports.DealSettingModel = exports.ReferralRewardCouponModel = exports.ReferralCodeCouponModel = exports.IndividualUserCouponModel = exports.IndividualStoreCouponModel = exports.ShopsCategoriesCouponModel = exports.GlobalCouponModel = exports.CustomCouponModel = exports.BaseCouponModel = exports.CouponModel = exports.CounterModel = exports.CategoryModel = exports.CartParticipantModel = exports.CartModel = exports.ServiceControlModel = exports.AppAppearanceModel = exports.BrandModel = exports.BOBFinanceModel = exports.BannerModel = exports.AttributeModel = exports.UserAppSectionSettingModel = exports.AdminModel = exports.AdminAccessControlModel = exports.ActivityLogModel = void 0;
18
18
  exports.ZoneExtraTimeModel = exports.LoggerModel = exports.ServicePromotionModel = exports.TicketActionModel = exports.ProfessionalBlockedTimeModel = exports.ServiceOrderModel = exports.ServiceLineItemModel = exports.ServiceCartModel = exports.ProfessionalModel = exports.ServicePackageModel = exports.ServiceAddonModel = exports.ServiceCategoryModel = exports.VendorAccessControlModel = exports.VendorModel = exports.VendorParentModel = exports.ServiceModel = exports.ChatroomModel = exports.AgentPerformanceModel = exports.MessageModel = exports.TicketModel = exports.RewardModel = exports.CancellationReasonModel = exports.SupportReasonModel = exports.TermsAndConditionsModel = exports.DefaultChatModel = exports.ZoneModel = exports.UserModel = exports.TagModel = exports.SubscriptionModel = exports.ShopModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.ServiceOrderReviewModel = exports.RiderReviewModel = exports.ShopReviewModel = exports.ReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.PunchMarketingHistoryModel = exports.ProductUploadModel = exports.ProductModel = exports.ProductStockTrackerModel = exports.ProductMarketingModel = exports.RiderPayoutModel = void 0;
19
+ exports.AppInstanceModel = void 0;
19
20
  exports.getCoreAuthIdentityModel = getCoreAuthIdentityModel;
20
21
  exports.getCoreEmailAuthIdentityModel = getCoreEmailAuthIdentityModel;
21
22
  exports.getCorePhoneAuthIdentityModel = getCorePhoneAuthIdentityModel;
@@ -137,6 +138,7 @@ const log_model_1 = require("./log.model");
137
138
  const card_model_1 = require("./card.model");
138
139
  const product_stock_tracker_model_1 = require("./product-stock-tracker.model");
139
140
  const payment_intent_model_1 = require("./payment-intent.model");
141
+ const app_instance_model_1 = require("./app-instance.model");
140
142
  exports.ActivityLogModel = (0, typegoose_1.getModelForClass)(activity_log_model_1.ActivityLog);
141
143
  __exportStar(require("./activity-log.model"), exports);
142
144
  exports.AdminAccessControlModel = (0, typegoose_1.getModelForClass)(admin_access_control_model_1.AdminAccessControl);
@@ -411,4 +413,6 @@ __exportStar(require("./log.model"), exports);
411
413
  exports.ZoneExtraTimeModel = (0, typegoose_1.getModelForClass)(zone_extra_time_1.ZoneExtraTime);
412
414
  __exportStar(require("./zone-extra-time"), exports);
413
415
  __exportStar(require("./google-maps-usage.model"), exports);
416
+ exports.AppInstanceModel = (0, typegoose_1.getModelForClass)(app_instance_model_1.AppInstance);
417
+ __exportStar(require("./app-instance.model"), exports);
414
418
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["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,WAAW,GAAgC,IAAA,4BAAgB,EAAC,eAAG,CAAC,CAAC;AAC9E,8CAA4B;AAEf,QAAA,kBAAkB,GAA0C,IAAA,4BAAgB,EAAC,+BAAa,CAAC,CAAC;AACzG,oDAAkC;AAElC,4DAA0C","sourcesContent":["import { ServiceLineItem } from './service-line-item.model';\nimport { RiderPayout } from './providers/rider-payout.model';\nimport { ShopPayout } from './providers/shop-payout.model';\nimport { getDiscriminatorModelForClass, getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { Admin } from './admin.model';\nimport { AdminAccessControl } from './admin-access-control.model';\nimport { ActivityLog } from './activity-log.model';\nimport { UserAppSectionSetting } from './user-app-section-setting.model';\nimport { Attribute } from './attribute.model';\nimport { Banner } from './banner.model';\nimport { BaseCoupon } from './base/base-coupon.model';\nimport { BOBFinance } from './bob-finance.model';\nimport { Brand } from './brand.model';\nimport { Category } from './category.model';\nimport { Counter } from './counter.model';\nimport { Coupon } from './coupon.model';\nimport { DealSetting } from './deal-setting.model';\nimport { Dish } from './dish.model';\nimport { Favourite } from './favourite.model';\nimport { FeaturedSetting } from './featured-setting.model';\nimport { FilterContainer } from './filter-container.model';\nimport { ListContainer } from './list-container.model';\nimport { Marketing } from './marketing.model';\nimport { MealPlan } from './meal-plan.model';\nimport { Nutrition } from './nutrition.model';\nimport { Parent } from './parent.model';\nimport { ProductMarketing } from './product-marketing.model';\nimport { Product } from './product.model';\nimport { PunchMarketingHistory } from './punch-marketing-history.model';\nimport { RatingSetting } from './rating-setting.model';\nimport { ReferralSetting } from './referral-setting.model';\nimport { RequestArea } from './request-area.model';\nimport { Setting } from './setting.model';\nimport { ShopAccessControl } from './shop-access-control.model';\nimport { ShopCategory } from './shop-category.model';\nimport { ShopMealPlan } from './shop-meal-plan.model';\nimport { Shop } from './shop.model';\nimport { Subscription } from './subscription.model';\nimport { Tag } from './tag.model';\nimport { Zone } from './zone.model';\nimport { Buy1Get1Marketing } from './providers/buy1-get1-marketing.model';\nimport {\n\tCoreAuthIdentityType,\n\tCounterType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n\tReviewType,\n} from '../../../utilities/enum';\nimport { ServiceAddon } from './service-addon.model';\nimport { CustomCoupon } from './providers/custom-coupon.model';\nimport { DiscountMarketing } from './providers/discount-marketing.model';\nimport { FeaturedMarketing } from './providers/featured-marketing.model';\nimport { FreeDeliveryMarketing } from './providers/free-delivery-marketing.model';\nimport { GlobalCoupon } from './providers/global-coupon.model';\nimport { IndividualStoreCoupon } from './providers/individual-store-coupon.model';\nimport { IndividualUserCoupon } from './providers/individual-user-coupon.model';\nimport { PunchMarketing } from './providers/punch-marketing.model';\nimport { ReferralCodeCoupon } from './providers/referral-code-coupon.model';\nimport { ReferralRewardCoupon } from './providers/referral-reward-coupon.model';\nimport { Notification } from './notification.model';\nimport { CoreAuthIdentity } from './core-auth-identity.model';\nimport { CoreEmailAuthIdentity } from './providers/core-email-auth-identity.model';\nimport { CorePhoneAuthIdentity } from './providers/core-phone-auth-identity.model';\nimport { CoreGoogleAuthIdentity } from './providers/core-google-auth-identity.model';\nimport { CoreAppleAuthIdentity } from './providers/core-apple-auth-identity.model';\nimport { CoreUser } from './core-user.model';\nimport { RiderTracking } from './rider-tracking.model';\nimport { Rider } from './rider.model';\nimport { RiderTimeout } from './rider-timeout.model';\nimport { User } from './user.model';\nimport { Cart } from './cart.model';\nimport { LineItem } from './line-item.model';\nimport { CartParticipant } from './cart-participant.model';\nimport { Gallery } from './gallery.model';\nimport { Order } from './order.model';\nimport { RegularOrder } from './providers/regular-order.model';\nimport { CourierOrder } from './providers/courier-order.model';\nimport { FinanceSettlement } from './finance-settlement.model';\nimport { DefaultChat } from './default-chat.model';\nimport { TermsAndConditions } from './terms-and-conditions.model';\nimport { SupportReason } from './support-reason.model';\nimport { CancellationReason } from './cancellation-reason.model';\nimport { Payout } from './payout.model';\nimport { Reward } from './reward.model';\nimport { Ticket } from './ticket.model';\nimport { Message } from './message.model';\nimport { AgentPerformance } from './agent-performance.model';\nimport { Chatroom } from './chat-room.model';\nimport { initializeRefreshTokenModel } from '../../auth';\nimport { VendorParent } from './vendor-parent.model';\nimport { Vendor } from './vendor.model';\nimport { VendorAccessControl } from './vendor-access-control.model';\nimport { ServiceCategory } from './service-category.model';\nimport { ServicePackage } from './service-package.model';\nimport { Professional } from './professional.model';\nimport { ServiceOrder } from './service-order.model';\nimport { Service } from './service.model';\nimport { TicketAction } from './ticket-action.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ShopCourierOrder } from './providers/shop-courier.model';\nimport { ServicePromotion } from './service-promotion.model';\nimport { Flag } from './flag.model';\nimport { Review } from './review.model';\nimport { ShopReview } from './providers/shop-review.model';\nimport { RiderReview } from './providers/rider-review.model';\nimport { ServiceOrderReview } from './providers/service-order-review.model';\nimport { assignIdsToDocuments } from '../../../utilities/id-generator';\nimport { GalleryUpload } from './gallery-upload.model';\nimport { ProductUpload } from './product-upload.model';\nimport { ShopsCategoriesCoupon } from './providers/shops-categories-coupon.model';\nimport { ProfessionalBlockedTime } from './professional-blocked-time.model';\nimport { ZoneExtraTime } from './zone-extra-time';\nimport { AppAppearance } from './app-appearance.model';\nimport { ServiceControl } from './service-control.model';\nimport { Log } from './log.model';\nimport { Card } from './card.model';\nimport { ProductStockTracker } from './product-stock-tracker.model';\nimport { PaymentIntent } from './payment-intent.model';\n\n// Regular models (using standard getModelForClass)\nexport const ActivityLogModel: ReturnModelType<typeof ActivityLog> = getModelForClass(ActivityLog);\nexport * from './activity-log.model';\n\nexport const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl> =\n\tgetModelForClass(AdminAccessControl);\nexport * from './admin-access-control.model';\n\nexport const AdminModel: ReturnModelType<typeof Admin> = getModelForClass(Admin);\nexport * from './admin.model';\n\nexport const UserAppSectionSettingModel: ReturnModelType<typeof UserAppSectionSetting> =\n\tgetModelForClass(UserAppSectionSetting);\nexport * from './user-app-section-setting.model';\n\nexport const AttributeModel: ReturnModelType<typeof Attribute> = getModelForClass(Attribute);\nexport * from './attribute.model';\n\nexport const BannerModel: ReturnModelType<typeof Banner> = getModelForClass(Banner);\nexport * from './banner.model';\n\nexport const BOBFinanceModel: ReturnModelType<typeof BOBFinance> = getModelForClass(BOBFinance);\nexport * from './bob-finance.model';\n\nexport const BrandModel: ReturnModelType<typeof Brand> = getModelForClass(Brand);\nexport * from './brand.model';\n\nexport const AppAppearanceModel: ReturnModelType<typeof AppAppearance> = getModelForClass(AppAppearance);\nexport * from './app-appearance.model';\n\nexport const ServiceControlModel: ReturnModelType<typeof ServiceControl> = getModelForClass(ServiceControl);\nexport * from './service-control.model';\n\n// Global models - will be set after initGlobalConnection()\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualPaymentIntentModel: ReturnModelType<typeof PaymentIntent> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\nlet actualCoreEmailAuthIdentityModel: ReturnModelType<typeof CoreEmailAuthIdentity> | null = null;\nlet actualCorePhoneAuthIdentityModel: ReturnModelType<typeof CorePhoneAuthIdentity> | null = null;\nlet actualCoreGoogleAuthIdentityModel: ReturnModelType<typeof CoreGoogleAuthIdentity> | null = null;\nlet actualCoreAppleAuthIdentityModel: ReturnModelType<typeof CoreAppleAuthIdentity> | null = null;\n\n// Export getter functions for global models\nexport function getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel)\n\t\tthrow new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel)\n\t\tthrow new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel)\n\t\tthrow new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel)\n\t\tthrow new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel)\n\t\tthrow new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel)\n\t\tthrow new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\nexport function getCardModel(): ReturnModelType<typeof Card> {\n\tif (!actualCardModel) throw new Error('Card model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCardModel;\n}\n\nexport function getPaymentIntentModel(): ReturnModelType<typeof PaymentIntent> {\n\tif (!actualPaymentIntentModel)\n\t\tthrow new Error('Payment Intent model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualPaymentIntentModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualPaymentIntentModel = getModelForClass(PaymentIntent, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\n\tactualCoreEmailAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreEmailAuthIdentity,\n\t\tCoreAuthIdentityType.EMAIL,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCorePhoneAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCorePhoneAuthIdentity,\n\t\tCoreAuthIdentityType.PHONE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreGoogleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreGoogleAuthIdentity,\n\t\tCoreAuthIdentityType.GOOGLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreAppleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreAppleAuthIdentity,\n\t\tCoreAuthIdentityType.APPLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tinitializeRefreshTokenModel(globalConnection);\n\n\tconsole.log('✅ All global models initialized');\n}\n\nexport const CartModel: ReturnModelType<typeof Cart> = getModelForClass(Cart);\nexport * from './cart.model';\n\nexport const CartParticipantModel: ReturnModelType<typeof CartParticipant> =\n\tgetModelForClass(CartParticipant);\nexport * from './cart-participant.model';\n\nexport const CategoryModel: ReturnModelType<typeof Category> = getModelForClass(Category);\nexport * from './category.model';\n\nexport * from './core-auth-identity.model';\nexport * from './providers/core-apple-auth-identity.model';\nexport * from './providers/core-email-auth-identity.model';\nexport * from './providers/core-google-auth-identity.model';\nexport * from './providers/core-phone-auth-identity.model';\nexport * from './core-user.model';\n\nexport const CounterModel: ReturnModelType<typeof Counter> = getModelForClass(Counter);\nexport * from './counter.model';\n\nexport const CouponModel: ReturnModelType<typeof Coupon> = getModelForClass(Coupon);\nexport const BaseCouponModel: ReturnModelType<typeof BaseCoupon> = getModelForClass(BaseCoupon);\nexport const CustomCouponModel: ReturnModelType<typeof CustomCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tCustomCoupon,\n\tCouponType.CUSTOM_COUPON\n);\nexport const GlobalCouponModel: ReturnModelType<typeof GlobalCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tGlobalCoupon,\n\tCouponType.GLOBAL\n);\nexport const ShopsCategoriesCouponModel: ReturnModelType<typeof ShopsCategoriesCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ShopsCategoriesCoupon, CouponType.SHOPS_CATEGORIES);\nexport const IndividualStoreCouponModel: ReturnModelType<typeof IndividualStoreCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualStoreCoupon, CouponType.INDIVIDUAL_STORE);\nexport const IndividualUserCouponModel: ReturnModelType<typeof IndividualUserCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualUserCoupon, CouponType.INDIVIDUAL_USER);\nexport const ReferralCodeCouponModel: ReturnModelType<typeof ReferralCodeCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralCodeCoupon, CouponType.REFERRAL_CODE);\nexport const ReferralRewardCouponModel: ReturnModelType<typeof ReferralRewardCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralRewardCoupon, CouponType.REFERRAL_REWARD);\nexport * from './coupon.model';\nexport * from './base/base-coupon.model';\nexport * from './providers/custom-coupon.model';\nexport * from './providers/global-coupon.model';\nexport * from './providers/shops-categories-coupon.model';\nexport * from './providers/individual-store-coupon.model';\nexport * from './providers/individual-user-coupon.model';\nexport * from './providers/referral-code-coupon.model';\nexport * from './providers/referral-reward-coupon.model';\n\nexport const DealSettingModel: ReturnModelType<typeof DealSetting> = getModelForClass(DealSetting);\nexport * from './deal-setting.model';\n\nexport const DishModel: ReturnModelType<typeof Dish> = getModelForClass(Dish);\nexport * from './dish.model';\n\nexport const FavouriteModel: ReturnModelType<typeof Favourite> = getModelForClass(Favourite);\nexport * from './favourite.model';\n\nexport const FeaturedSettingModel: ReturnModelType<typeof FeaturedSetting> =\n\tgetModelForClass(FeaturedSetting);\nexport * from './featured-setting.model';\n\nexport const FilterContainerModel: ReturnModelType<typeof FilterContainer> =\n\tgetModelForClass(FilterContainer);\nexport * from './filter-container.model';\n\nexport const FinanceSettlementModel: ReturnModelType<typeof FinanceSettlement> =\n\tgetModelForClass(FinanceSettlement);\nexport * from './finance-settlement.model';\n\nexport const FlagModel: ReturnModelType<typeof Flag> = getModelForClass(Flag);\nexport * from './flag.model';\n\nexport const GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.model';\n\nexport const GalleryUploadModel: ReturnModelType<typeof GalleryUpload> = getModelForClass(GalleryUpload);\nexport * from './gallery-upload.model';\n\nexport const LineItemModel: ReturnModelType<typeof LineItem> = getModelForClass(LineItem);\nexport * from './line-item.model';\n\nexport const ListContainerModel: ReturnModelType<typeof ListContainer> = getModelForClass(ListContainer);\nexport * from './list-container.model';\n\nexport const MarketingModel: ReturnModelType<typeof Marketing> = getModelForClass(Marketing);\nexport const Buy1Get1MarketingModel: ReturnModelType<typeof Buy1Get1Marketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, Buy1Get1Marketing, MarketingType.BUY1GET1);\nexport const DiscountMarketingModel: ReturnModelType<typeof DiscountMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, DiscountMarketing, MarketingType.DISCOUNT);\nexport const FeaturedMarketingModel: ReturnModelType<typeof FeaturedMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FeaturedMarketing, MarketingType.FEATURED);\nexport const FreeDeliveryMarketingModel: ReturnModelType<typeof FreeDeliveryMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FreeDeliveryMarketing, MarketingType.FREE_DELIVERY);\nexport const PunchMarketingModel: ReturnModelType<typeof PunchMarketing> = getDiscriminatorModelForClass(\n\tMarketingModel,\n\tPunchMarketing,\n\tMarketingType.PUNCH_MARKETING\n);\nexport * from './marketing.model';\nexport * from './providers/buy1-get1-marketing.model';\nexport * from './providers/discount-marketing.model';\nexport * from './providers/featured-marketing.model';\nexport * from './providers/free-delivery-marketing.model';\nexport * from './providers/punch-marketing.model';\n\nexport const MealPlanModel: ReturnModelType<typeof MealPlan> = getModelForClass(MealPlan);\nexport * from './meal-plan.model';\n\nexport const NotificationModel: ReturnModelType<typeof Notification> = getModelForClass(Notification);\nexport * from './notification.model';\n\nexport const NutritionModel: ReturnModelType<typeof Nutrition> = getModelForClass(Nutrition);\nexport * from './nutrition.model';\n\nexport const OrderModel: ReturnModelType<typeof Order> = getModelForClass(Order);\nexport const RegularOrderModel: ReturnModelType<typeof RegularOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tRegularOrder,\n\tOrderType.REGULAR\n);\nexport const CourierOrderModel: ReturnModelType<typeof CourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tCourierOrder,\n\tOrderType.COURIER\n);\n\nexport const ShopCourierOrderModel: ReturnModelType<typeof ShopCourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tShopCourierOrder,\n\tOrderType.SHOP_COURIER\n);\n\nexport * from './order.model';\nexport * from './providers/regular-order.model';\nexport * from './providers/courier-order.model';\nexport * from './providers/shop-courier.model';\n\nexport const ParentModel: ReturnModelType<typeof Parent> = getModelForClass(Parent);\nexport * from './parent.model';\n\nexport const PayoutModel: ReturnModelType<typeof Payout> = getModelForClass(Payout);\nexport const ShopPayoutModel: ReturnModelType<typeof ShopPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tShopPayout,\n\tPayoutType.SHOP\n);\nexport const RiderPayoutModel: ReturnModelType<typeof RiderPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tRiderPayout,\n\tPayoutType.RIDER\n);\nexport * from './payout.model';\nexport * from './providers/shop-payout.model';\nexport * from './providers/rider-payout.model';\n\nexport const ProductMarketingModel: ReturnModelType<typeof ProductMarketing> =\n\tgetModelForClass(ProductMarketing);\nexport * from './product-marketing.model';\n\nexport const ProductStockTrackerModel: ReturnModelType<typeof ProductStockTracker> =\n\tgetModelForClass(ProductStockTracker);\nexport * from './product-stock-tracker.model';\n\nexport const ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.model';\nProductModel.schema.pre('insertMany', async function (next, docs: Product[]) {\n\t// Generate all IDs at once (ATOMIC)\n\tawait assignIdsToDocuments(CounterModel, CounterType.ITEM, docs, 'productId');\n\tnext();\n});\n\nexport const ProductUploadModel: ReturnModelType<typeof ProductUpload> = getModelForClass(ProductUpload);\nexport * from './product-upload.model';\n\nexport const PunchMarketingHistoryModel: ReturnModelType<typeof PunchMarketingHistory> =\n\tgetModelForClass(PunchMarketingHistory);\nexport * from './punch-marketing-history.model';\n\nexport const RatingSettingModel: ReturnModelType<typeof RatingSetting> = getModelForClass(RatingSetting);\nexport * from './rating-setting.model';\n\nexport const ReferralSettingModel: ReturnModelType<typeof ReferralSetting> =\n\tgetModelForClass(ReferralSetting);\nexport * from './referral-setting.model';\n\nexport const RequestAreaModel: ReturnModelType<typeof RequestArea> = getModelForClass(RequestArea);\nexport * from './request-area.model';\n\nexport const ReviewModel: ReturnModelType<typeof Review> = getModelForClass(Review);\nexport const ShopReviewModel: ReturnModelType<typeof ShopReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tShopReview,\n\tReviewType.SHOP\n);\nexport const RiderReviewModel: ReturnModelType<typeof RiderReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tRiderReview,\n\tReviewType.RIDER\n);\nexport const ServiceOrderReviewModel: ReturnModelType<typeof ServiceOrderReview> =\n\tgetDiscriminatorModelForClass(ReviewModel, ServiceOrderReview, ReviewType.SERVICE_ORDER);\nexport * from './review.model';\nexport * from './providers/shop-review.model';\nexport * from './providers/rider-review.model';\nexport * from './providers/service-order-review.model';\n\nexport const RiderTimeoutModel: ReturnModelType<typeof RiderTimeout> = getModelForClass(RiderTimeout);\nexport * from './rider-timeout.model';\n\nexport const RiderTrackingModel: ReturnModelType<typeof RiderTracking> = getModelForClass(RiderTracking);\nexport * from './rider-tracking.model';\n\nexport const RiderModel: ReturnModelType<typeof Rider> = getModelForClass(Rider);\nexport * from './rider.model';\n\nexport const SettingModel: ReturnModelType<typeof Setting> = getModelForClass(Setting);\nexport * from './setting.model';\n\nexport const ShopAccessControlModel: ReturnModelType<typeof ShopAccessControl> =\n\tgetModelForClass(ShopAccessControl);\nexport * from './shop-access-control.model';\n\nexport const ShopCategoryModel: ReturnModelType<typeof ShopCategory> = getModelForClass(ShopCategory);\nexport * from './shop-category.model';\n\nexport const ShopMealPlanModel: ReturnModelType<typeof ShopMealPlan> = getModelForClass(ShopMealPlan);\nexport * from './shop-meal-plan.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.model';\n\nexport const SubscriptionModel: ReturnModelType<typeof Subscription> = getModelForClass(Subscription);\nexport * from './subscription.model';\n\nexport const TagModel: ReturnModelType<typeof Tag> = getModelForClass(Tag);\nexport * from './tag.model';\n\nexport const UserModel: ReturnModelType<typeof User> = getModelForClass(User);\nexport * from './user.model';\n\nexport const ZoneModel: ReturnModelType<typeof Zone> = getModelForClass(Zone);\nexport * from './zone.model';\n\nexport const DefaultChatModel: ReturnModelType<typeof DefaultChat> = getModelForClass(DefaultChat);\nexport * from './default-chat.model';\n\nexport const TermsAndConditionsModel: ReturnModelType<typeof TermsAndConditions> =\n\tgetModelForClass(TermsAndConditions);\nexport * from './terms-and-conditions.model';\n\nexport const SupportReasonModel: ReturnModelType<typeof SupportReason> = getModelForClass(SupportReason);\nexport * from './support-reason.model';\n\nexport const CancellationReasonModel: ReturnModelType<typeof CancellationReason> =\n\tgetModelForClass(CancellationReason);\nexport * from './cancellation-reason.model';\n\nexport * from './embedded/trip-leg.mode';\nexport * from './embedded/rider-assignment-model';\n\nexport const RewardModel: ReturnModelType<typeof Reward> = getModelForClass(Reward);\nexport * from './reward.model';\n\nexport const TicketModel: ReturnModelType<typeof Ticket> = getModelForClass(Ticket);\nexport * from './ticket.model';\n\nexport const MessageModel: ReturnModelType<typeof Message> = getModelForClass(Message);\nexport * from './message.model';\n\nexport const AgentPerformanceModel: ReturnModelType<typeof AgentPerformance> =\n\tgetModelForClass(AgentPerformance);\nexport * from './agent-performance.model';\n\nexport const ChatroomModel: ReturnModelType<typeof Chatroom> = getModelForClass(Chatroom);\nexport * from './chat-room.model';\n\nexport * from './embedded/chat-participant.model';\n\nexport const ServiceModel: ReturnModelType<typeof Service> = getModelForClass(Service);\nexport * from './service.model';\n\nexport const VendorParentModel: ReturnModelType<typeof VendorParent> = getModelForClass(VendorParent);\nexport * from './vendor-parent.model';\n\nexport const VendorModel: ReturnModelType<typeof Vendor> = getModelForClass(Vendor);\nexport * from './vendor.model';\n\nexport const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl> =\n\tgetModelForClass(VendorAccessControl);\nexport * from './vendor-access-control.model';\n\nexport const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory> =\n\tgetModelForClass(ServiceCategory);\nexport * from './service-category.model';\n\nexport const ServiceAddonModel: ReturnModelType<typeof ServiceAddon> = getModelForClass(ServiceAddon);\nexport * from './service-addon.model';\n\nexport const ServicePackageModel: ReturnModelType<typeof ServicePackage> = getModelForClass(ServicePackage);\nexport * from './service-package.model';\n\nexport const ProfessionalModel: ReturnModelType<typeof Professional> = getModelForClass(Professional);\nexport * from './professional.model';\n\nexport const ServiceCartModel: ReturnModelType<typeof ServiceCart> = getModelForClass(ServiceCart);\nexport * from './service-cart.model';\n\nexport const ServiceLineItemModel: ReturnModelType<typeof ServiceLineItem> =\n\tgetModelForClass(ServiceLineItem);\nexport * from './service-line-item.model';\n\nexport const ServiceOrderModel: ReturnModelType<typeof ServiceOrder> = getModelForClass(ServiceOrder);\nexport * from './service-order.model';\n\nexport const ProfessionalBlockedTimeModel: ReturnModelType<typeof ProfessionalBlockedTime> =\n\tgetModelForClass(ProfessionalBlockedTime);\nexport * from './professional-blocked-time.model';\n\nexport const TicketActionModel: ReturnModelType<typeof TicketAction> = getModelForClass(TicketAction);\nexport * from './ticket-action.model';\n\nexport const ServicePromotionModel: ReturnModelType<typeof ServicePromotion> =\n\tgetModelForClass(ServicePromotion);\nexport * from './service-promotion.model';\n\nexport const LoggerModel: ReturnModelType<typeof Log> = getModelForClass(Log);\nexport * from './log.model';\n\nexport const ZoneExtraTimeModel: ReturnModelType<typeof ZoneExtraTime> = getModelForClass(ZoneExtraTime);\nexport * from './zone-extra-time';\n\nexport * from './google-maps-usage.model';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAwKA,4DAIC;AAED,sEAIC;AAED,sEAIC;AAED,wEAIC;AAED,sEAIC;AAED,4CAIC;AAED,oCAGC;AAED,sDAIC;AAGD,wDAuCC;AA/PD,uEAA4D;AAC5D,uEAA6D;AAC7D,qEAA2D;AAC3D,oDAAwG;AACxG,+CAAsC;AACtC,6EAAkE;AAClE,6DAAmD;AACnD,qFAAyE;AACzE,uDAA8C;AAC9C,iDAAwC;AACxC,gEAAsD;AACtD,2DAAiD;AACjD,+CAAsC;AACtC,qDAA4C;AAC5C,mDAA0C;AAC1C,iDAAwC;AACxC,6DAAmD;AACnD,6CAAoC;AACpC,uDAA8C;AAC9C,qEAA2D;AAC3D,qEAA2D;AAC3D,iEAAuD;AACvD,uDAA8C;AAC9C,uDAA6C;AAC7C,uDAA8C;AAC9C,iDAAwC;AACxC,uEAA6D;AAC7D,mDAA0C;AAC1C,mFAAwE;AACxE,iEAAuD;AACvD,qEAA2D;AAC3D,6DAAmD;AACnD,mDAA0C;AAC1C,2EAAgE;AAChE,+DAAqD;AACrD,iEAAsD;AACtD,6CAAoC;AACpC,6DAAoD;AACpD,2CAAkC;AAClC,6CAAoC;AACpC,qFAA0E;AAC1E,kDAQiC;AACjC,+DAAqD;AACrD,yEAA+D;AAC/D,mFAAyE;AACzE,mFAAyE;AACzE,6FAAkF;AAClF,yEAA+D;A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AAC;AACnC,4DAA0C;AAE7B,QAAA,iBAAiB,GAAyC,IAAA,4BAAgB,EAAC,kCAAY,CAAC,CAAC;AACtG,wDAAsC;AAEzB,QAAA,4BAA4B,GACxC,IAAA,4BAAgB,EAAC,yDAAuB,CAAC,CAAC;AAC3C,oEAAkD;AAErC,QAAA,iBAAiB,GAAyC,IAAA,4BAAgB,EAAC,kCAAY,CAAC,CAAC;AACtG,wDAAsC;AAEzB,QAAA,qBAAqB,GACjC,IAAA,4BAAgB,EAAC,0CAAgB,CAAC,CAAC;AACpC,4DAA0C;AAE7B,QAAA,WAAW,GAAgC,IAAA,4BAAgB,EAAC,eAAG,CAAC,CAAC;AAC9E,8CAA4B;AAEf,QAAA,kBAAkB,GAA0C,IAAA,4BAAgB,EAAC,+BAAa,CAAC,CAAC;AACzG,oDAAkC;AAElC,4DAA0C;AAE7B,QAAA,gBAAgB,GAAwC,IAAA,4BAAgB,EAAC,gCAAW,CAAC,CAAC;AACnG,uDAAqC","sourcesContent":["import { ServiceLineItem } from './service-line-item.model';\nimport { RiderPayout } from './providers/rider-payout.model';\nimport { ShopPayout } from './providers/shop-payout.model';\nimport { getDiscriminatorModelForClass, getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { Admin } from './admin.model';\nimport { AdminAccessControl } from './admin-access-control.model';\nimport { ActivityLog } from './activity-log.model';\nimport { UserAppSectionSetting } from './user-app-section-setting.model';\nimport { Attribute } from './attribute.model';\nimport { Banner } from './banner.model';\nimport { BaseCoupon } from './base/base-coupon.model';\nimport { BOBFinance } from './bob-finance.model';\nimport { Brand } from './brand.model';\nimport { Category } from './category.model';\nimport { Counter } from './counter.model';\nimport { Coupon } from './coupon.model';\nimport { DealSetting } from './deal-setting.model';\nimport { Dish } from './dish.model';\nimport { Favourite } from './favourite.model';\nimport { FeaturedSetting } from './featured-setting.model';\nimport { FilterContainer } from './filter-container.model';\nimport { ListContainer } from './list-container.model';\nimport { Marketing } from './marketing.model';\nimport { MealPlan } from './meal-plan.model';\nimport { Nutrition } from './nutrition.model';\nimport { Parent } from './parent.model';\nimport { ProductMarketing } from './product-marketing.model';\nimport { Product } from './product.model';\nimport { PunchMarketingHistory } from './punch-marketing-history.model';\nimport { RatingSetting } from './rating-setting.model';\nimport { ReferralSetting } from './referral-setting.model';\nimport { RequestArea } from './request-area.model';\nimport { Setting } from './setting.model';\nimport { ShopAccessControl } from './shop-access-control.model';\nimport { ShopCategory } from './shop-category.model';\nimport { ShopMealPlan } from './shop-meal-plan.model';\nimport { Shop } from './shop.model';\nimport { Subscription } from './subscription.model';\nimport { Tag } from './tag.model';\nimport { Zone } from './zone.model';\nimport { Buy1Get1Marketing } from './providers/buy1-get1-marketing.model';\nimport {\n\tCoreAuthIdentityType,\n\tCounterType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n\tReviewType,\n} from '../../../utilities/enum';\nimport { ServiceAddon } from './service-addon.model';\nimport { CustomCoupon } from './providers/custom-coupon.model';\nimport { DiscountMarketing } from './providers/discount-marketing.model';\nimport { FeaturedMarketing } from './providers/featured-marketing.model';\nimport { FreeDeliveryMarketing } from './providers/free-delivery-marketing.model';\nimport { GlobalCoupon } from './providers/global-coupon.model';\nimport { IndividualStoreCoupon } from './providers/individual-store-coupon.model';\nimport { IndividualUserCoupon } from './providers/individual-user-coupon.model';\nimport { PunchMarketing } from './providers/punch-marketing.model';\nimport { ReferralCodeCoupon } from './providers/referral-code-coupon.model';\nimport { ReferralRewardCoupon } from './providers/referral-reward-coupon.model';\nimport { Notification } from './notification.model';\nimport { CoreAuthIdentity } from './core-auth-identity.model';\nimport { CoreEmailAuthIdentity } from './providers/core-email-auth-identity.model';\nimport { CorePhoneAuthIdentity } from './providers/core-phone-auth-identity.model';\nimport { CoreGoogleAuthIdentity } from './providers/core-google-auth-identity.model';\nimport { CoreAppleAuthIdentity } from './providers/core-apple-auth-identity.model';\nimport { CoreUser } from './core-user.model';\nimport { RiderTracking } from './rider-tracking.model';\nimport { Rider } from './rider.model';\nimport { RiderTimeout } from './rider-timeout.model';\nimport { User } from './user.model';\nimport { Cart } from './cart.model';\nimport { LineItem } from './line-item.model';\nimport { CartParticipant } from './cart-participant.model';\nimport { Gallery } from './gallery.model';\nimport { Order } from './order.model';\nimport { RegularOrder } from './providers/regular-order.model';\nimport { CourierOrder } from './providers/courier-order.model';\nimport { FinanceSettlement } from './finance-settlement.model';\nimport { DefaultChat } from './default-chat.model';\nimport { TermsAndConditions } from './terms-and-conditions.model';\nimport { SupportReason } from './support-reason.model';\nimport { CancellationReason } from './cancellation-reason.model';\nimport { Payout } from './payout.model';\nimport { Reward } from './reward.model';\nimport { Ticket } from './ticket.model';\nimport { Message } from './message.model';\nimport { AgentPerformance } from './agent-performance.model';\nimport { Chatroom } from './chat-room.model';\nimport { initializeRefreshTokenModel } from '../../auth';\nimport { VendorParent } from './vendor-parent.model';\nimport { Vendor } from './vendor.model';\nimport { VendorAccessControl } from './vendor-access-control.model';\nimport { ServiceCategory } from './service-category.model';\nimport { ServicePackage } from './service-package.model';\nimport { Professional } from './professional.model';\nimport { ServiceOrder } from './service-order.model';\nimport { Service } from './service.model';\nimport { TicketAction } from './ticket-action.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ShopCourierOrder } from './providers/shop-courier.model';\nimport { ServicePromotion } from './service-promotion.model';\nimport { Flag } from './flag.model';\nimport { Review } from './review.model';\nimport { ShopReview } from './providers/shop-review.model';\nimport { RiderReview } from './providers/rider-review.model';\nimport { ServiceOrderReview } from './providers/service-order-review.model';\nimport { assignIdsToDocuments } from '../../../utilities/id-generator';\nimport { GalleryUpload } from './gallery-upload.model';\nimport { ProductUpload } from './product-upload.model';\nimport { ShopsCategoriesCoupon } from './providers/shops-categories-coupon.model';\nimport { ProfessionalBlockedTime } from './professional-blocked-time.model';\nimport { ZoneExtraTime } from './zone-extra-time';\nimport { AppAppearance } from './app-appearance.model';\nimport { ServiceControl } from './service-control.model';\nimport { Log } from './log.model';\nimport { Card } from './card.model';\nimport { ProductStockTracker } from './product-stock-tracker.model';\nimport { PaymentIntent } from './payment-intent.model';\nimport { AppInstance } from './app-instance.model';\n\n// Regular models (using standard getModelForClass)\nexport const ActivityLogModel: ReturnModelType<typeof ActivityLog> = getModelForClass(ActivityLog);\nexport * from './activity-log.model';\n\nexport const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl> =\n\tgetModelForClass(AdminAccessControl);\nexport * from './admin-access-control.model';\n\nexport const AdminModel: ReturnModelType<typeof Admin> = getModelForClass(Admin);\nexport * from './admin.model';\n\nexport const UserAppSectionSettingModel: ReturnModelType<typeof UserAppSectionSetting> =\n\tgetModelForClass(UserAppSectionSetting);\nexport * from './user-app-section-setting.model';\n\nexport const AttributeModel: ReturnModelType<typeof Attribute> = getModelForClass(Attribute);\nexport * from './attribute.model';\n\nexport const BannerModel: ReturnModelType<typeof Banner> = getModelForClass(Banner);\nexport * from './banner.model';\n\nexport const BOBFinanceModel: ReturnModelType<typeof BOBFinance> = getModelForClass(BOBFinance);\nexport * from './bob-finance.model';\n\nexport const BrandModel: ReturnModelType<typeof Brand> = getModelForClass(Brand);\nexport * from './brand.model';\n\nexport const AppAppearanceModel: ReturnModelType<typeof AppAppearance> = getModelForClass(AppAppearance);\nexport * from './app-appearance.model';\n\nexport const ServiceControlModel: ReturnModelType<typeof ServiceControl> = getModelForClass(ServiceControl);\nexport * from './service-control.model';\n\n// Global models - will be set after initGlobalConnection()\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualPaymentIntentModel: ReturnModelType<typeof PaymentIntent> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\nlet actualCoreEmailAuthIdentityModel: ReturnModelType<typeof CoreEmailAuthIdentity> | null = null;\nlet actualCorePhoneAuthIdentityModel: ReturnModelType<typeof CorePhoneAuthIdentity> | null = null;\nlet actualCoreGoogleAuthIdentityModel: ReturnModelType<typeof CoreGoogleAuthIdentity> | null = null;\nlet actualCoreAppleAuthIdentityModel: ReturnModelType<typeof CoreAppleAuthIdentity> | null = null;\n\n// Export getter functions for global models\nexport function getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel)\n\t\tthrow new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel)\n\t\tthrow new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel)\n\t\tthrow new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel)\n\t\tthrow new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel)\n\t\tthrow new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel)\n\t\tthrow new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\nexport function getCardModel(): ReturnModelType<typeof Card> {\n\tif (!actualCardModel) throw new Error('Card model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCardModel;\n}\n\nexport function getPaymentIntentModel(): ReturnModelType<typeof PaymentIntent> {\n\tif (!actualPaymentIntentModel)\n\t\tthrow new Error('Payment Intent model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualPaymentIntentModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualPaymentIntentModel = getModelForClass(PaymentIntent, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\n\tactualCoreEmailAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreEmailAuthIdentity,\n\t\tCoreAuthIdentityType.EMAIL,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCorePhoneAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCorePhoneAuthIdentity,\n\t\tCoreAuthIdentityType.PHONE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreGoogleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreGoogleAuthIdentity,\n\t\tCoreAuthIdentityType.GOOGLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreAppleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreAppleAuthIdentity,\n\t\tCoreAuthIdentityType.APPLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tinitializeRefreshTokenModel(globalConnection);\n\n\tconsole.log('✅ All global models initialized');\n}\n\nexport const CartModel: ReturnModelType<typeof Cart> = getModelForClass(Cart);\nexport * from './cart.model';\n\nexport const CartParticipantModel: ReturnModelType<typeof CartParticipant> =\n\tgetModelForClass(CartParticipant);\nexport * from './cart-participant.model';\n\nexport const CategoryModel: ReturnModelType<typeof Category> = getModelForClass(Category);\nexport * from './category.model';\n\nexport * from './core-auth-identity.model';\nexport * from './providers/core-apple-auth-identity.model';\nexport * from './providers/core-email-auth-identity.model';\nexport * from './providers/core-google-auth-identity.model';\nexport * from './providers/core-phone-auth-identity.model';\nexport * from './core-user.model';\n\nexport const CounterModel: ReturnModelType<typeof Counter> = getModelForClass(Counter);\nexport * from './counter.model';\n\nexport const CouponModel: ReturnModelType<typeof Coupon> = getModelForClass(Coupon);\nexport const BaseCouponModel: ReturnModelType<typeof BaseCoupon> = getModelForClass(BaseCoupon);\nexport const CustomCouponModel: ReturnModelType<typeof CustomCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tCustomCoupon,\n\tCouponType.CUSTOM_COUPON\n);\nexport const GlobalCouponModel: ReturnModelType<typeof GlobalCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tGlobalCoupon,\n\tCouponType.GLOBAL\n);\nexport const ShopsCategoriesCouponModel: ReturnModelType<typeof ShopsCategoriesCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ShopsCategoriesCoupon, CouponType.SHOPS_CATEGORIES);\nexport const IndividualStoreCouponModel: ReturnModelType<typeof IndividualStoreCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualStoreCoupon, CouponType.INDIVIDUAL_STORE);\nexport const IndividualUserCouponModel: ReturnModelType<typeof IndividualUserCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualUserCoupon, CouponType.INDIVIDUAL_USER);\nexport const ReferralCodeCouponModel: ReturnModelType<typeof ReferralCodeCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralCodeCoupon, CouponType.REFERRAL_CODE);\nexport const ReferralRewardCouponModel: ReturnModelType<typeof ReferralRewardCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralRewardCoupon, CouponType.REFERRAL_REWARD);\nexport * from './coupon.model';\nexport * from './base/base-coupon.model';\nexport * from './providers/custom-coupon.model';\nexport * from './providers/global-coupon.model';\nexport * from './providers/shops-categories-coupon.model';\nexport * from './providers/individual-store-coupon.model';\nexport * from './providers/individual-user-coupon.model';\nexport * from './providers/referral-code-coupon.model';\nexport * from './providers/referral-reward-coupon.model';\n\nexport const DealSettingModel: ReturnModelType<typeof DealSetting> = getModelForClass(DealSetting);\nexport * from './deal-setting.model';\n\nexport const DishModel: ReturnModelType<typeof Dish> = getModelForClass(Dish);\nexport * from './dish.model';\n\nexport const FavouriteModel: ReturnModelType<typeof Favourite> = getModelForClass(Favourite);\nexport * from './favourite.model';\n\nexport const FeaturedSettingModel: ReturnModelType<typeof FeaturedSetting> =\n\tgetModelForClass(FeaturedSetting);\nexport * from './featured-setting.model';\n\nexport const FilterContainerModel: ReturnModelType<typeof FilterContainer> =\n\tgetModelForClass(FilterContainer);\nexport * from './filter-container.model';\n\nexport const FinanceSettlementModel: ReturnModelType<typeof FinanceSettlement> =\n\tgetModelForClass(FinanceSettlement);\nexport * from './finance-settlement.model';\n\nexport const FlagModel: ReturnModelType<typeof Flag> = getModelForClass(Flag);\nexport * from './flag.model';\n\nexport const GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.model';\n\nexport const GalleryUploadModel: ReturnModelType<typeof GalleryUpload> = getModelForClass(GalleryUpload);\nexport * from './gallery-upload.model';\n\nexport const LineItemModel: ReturnModelType<typeof LineItem> = getModelForClass(LineItem);\nexport * from './line-item.model';\n\nexport const ListContainerModel: ReturnModelType<typeof ListContainer> = getModelForClass(ListContainer);\nexport * from './list-container.model';\n\nexport const MarketingModel: ReturnModelType<typeof Marketing> = getModelForClass(Marketing);\nexport const Buy1Get1MarketingModel: ReturnModelType<typeof Buy1Get1Marketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, Buy1Get1Marketing, MarketingType.BUY1GET1);\nexport const DiscountMarketingModel: ReturnModelType<typeof DiscountMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, DiscountMarketing, MarketingType.DISCOUNT);\nexport const FeaturedMarketingModel: ReturnModelType<typeof FeaturedMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FeaturedMarketing, MarketingType.FEATURED);\nexport const FreeDeliveryMarketingModel: ReturnModelType<typeof FreeDeliveryMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FreeDeliveryMarketing, MarketingType.FREE_DELIVERY);\nexport const PunchMarketingModel: ReturnModelType<typeof PunchMarketing> = getDiscriminatorModelForClass(\n\tMarketingModel,\n\tPunchMarketing,\n\tMarketingType.PUNCH_MARKETING\n);\nexport * from './marketing.model';\nexport * from './providers/buy1-get1-marketing.model';\nexport * from './providers/discount-marketing.model';\nexport * from './providers/featured-marketing.model';\nexport * from './providers/free-delivery-marketing.model';\nexport * from './providers/punch-marketing.model';\n\nexport const MealPlanModel: ReturnModelType<typeof MealPlan> = getModelForClass(MealPlan);\nexport * from './meal-plan.model';\n\nexport const NotificationModel: ReturnModelType<typeof Notification> = getModelForClass(Notification);\nexport * from './notification.model';\n\nexport const NutritionModel: ReturnModelType<typeof Nutrition> = getModelForClass(Nutrition);\nexport * from './nutrition.model';\n\nexport const OrderModel: ReturnModelType<typeof Order> = getModelForClass(Order);\nexport const RegularOrderModel: ReturnModelType<typeof RegularOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tRegularOrder,\n\tOrderType.REGULAR\n);\nexport const CourierOrderModel: ReturnModelType<typeof CourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tCourierOrder,\n\tOrderType.COURIER\n);\n\nexport const ShopCourierOrderModel: ReturnModelType<typeof ShopCourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tShopCourierOrder,\n\tOrderType.SHOP_COURIER\n);\n\nexport * from './order.model';\nexport * from './providers/regular-order.model';\nexport * from './providers/courier-order.model';\nexport * from './providers/shop-courier.model';\n\nexport const ParentModel: ReturnModelType<typeof Parent> = getModelForClass(Parent);\nexport * from './parent.model';\n\nexport const PayoutModel: ReturnModelType<typeof Payout> = getModelForClass(Payout);\nexport const ShopPayoutModel: ReturnModelType<typeof ShopPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tShopPayout,\n\tPayoutType.SHOP\n);\nexport const RiderPayoutModel: ReturnModelType<typeof RiderPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tRiderPayout,\n\tPayoutType.RIDER\n);\nexport * from './payout.model';\nexport * from './providers/shop-payout.model';\nexport * from './providers/rider-payout.model';\n\nexport const ProductMarketingModel: ReturnModelType<typeof ProductMarketing> =\n\tgetModelForClass(ProductMarketing);\nexport * from './product-marketing.model';\n\nexport const ProductStockTrackerModel: ReturnModelType<typeof ProductStockTracker> =\n\tgetModelForClass(ProductStockTracker);\nexport * from './product-stock-tracker.model';\n\nexport const ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.model';\nProductModel.schema.pre('insertMany', async function (next, docs: Product[]) {\n\t// Generate all IDs at once (ATOMIC)\n\tawait assignIdsToDocuments(CounterModel, CounterType.ITEM, docs, 'productId');\n\tnext();\n});\n\nexport const ProductUploadModel: ReturnModelType<typeof ProductUpload> = getModelForClass(ProductUpload);\nexport * from './product-upload.model';\n\nexport const PunchMarketingHistoryModel: ReturnModelType<typeof PunchMarketingHistory> =\n\tgetModelForClass(PunchMarketingHistory);\nexport * from './punch-marketing-history.model';\n\nexport const RatingSettingModel: ReturnModelType<typeof RatingSetting> = getModelForClass(RatingSetting);\nexport * from './rating-setting.model';\n\nexport const ReferralSettingModel: ReturnModelType<typeof ReferralSetting> =\n\tgetModelForClass(ReferralSetting);\nexport * from './referral-setting.model';\n\nexport const RequestAreaModel: ReturnModelType<typeof RequestArea> = getModelForClass(RequestArea);\nexport * from './request-area.model';\n\nexport const ReviewModel: ReturnModelType<typeof Review> = getModelForClass(Review);\nexport const ShopReviewModel: ReturnModelType<typeof ShopReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tShopReview,\n\tReviewType.SHOP\n);\nexport const RiderReviewModel: ReturnModelType<typeof RiderReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tRiderReview,\n\tReviewType.RIDER\n);\nexport const ServiceOrderReviewModel: ReturnModelType<typeof ServiceOrderReview> =\n\tgetDiscriminatorModelForClass(ReviewModel, ServiceOrderReview, ReviewType.SERVICE_ORDER);\nexport * from './review.model';\nexport * from './providers/shop-review.model';\nexport * from './providers/rider-review.model';\nexport * from './providers/service-order-review.model';\n\nexport const RiderTimeoutModel: ReturnModelType<typeof RiderTimeout> = getModelForClass(RiderTimeout);\nexport * from './rider-timeout.model';\n\nexport const RiderTrackingModel: ReturnModelType<typeof RiderTracking> = getModelForClass(RiderTracking);\nexport * from './rider-tracking.model';\n\nexport const RiderModel: ReturnModelType<typeof Rider> = getModelForClass(Rider);\nexport * from './rider.model';\n\nexport const SettingModel: ReturnModelType<typeof Setting> = getModelForClass(Setting);\nexport * from './setting.model';\n\nexport const ShopAccessControlModel: ReturnModelType<typeof ShopAccessControl> =\n\tgetModelForClass(ShopAccessControl);\nexport * from './shop-access-control.model';\n\nexport const ShopCategoryModel: ReturnModelType<typeof ShopCategory> = getModelForClass(ShopCategory);\nexport * from './shop-category.model';\n\nexport const ShopMealPlanModel: ReturnModelType<typeof ShopMealPlan> = getModelForClass(ShopMealPlan);\nexport * from './shop-meal-plan.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.model';\n\nexport const SubscriptionModel: ReturnModelType<typeof Subscription> = getModelForClass(Subscription);\nexport * from './subscription.model';\n\nexport const TagModel: ReturnModelType<typeof Tag> = getModelForClass(Tag);\nexport * from './tag.model';\n\nexport const UserModel: ReturnModelType<typeof User> = getModelForClass(User);\nexport * from './user.model';\n\nexport const ZoneModel: ReturnModelType<typeof Zone> = getModelForClass(Zone);\nexport * from './zone.model';\n\nexport const DefaultChatModel: ReturnModelType<typeof DefaultChat> = getModelForClass(DefaultChat);\nexport * from './default-chat.model';\n\nexport const TermsAndConditionsModel: ReturnModelType<typeof TermsAndConditions> =\n\tgetModelForClass(TermsAndConditions);\nexport * from './terms-and-conditions.model';\n\nexport const SupportReasonModel: ReturnModelType<typeof SupportReason> = getModelForClass(SupportReason);\nexport * from './support-reason.model';\n\nexport const CancellationReasonModel: ReturnModelType<typeof CancellationReason> =\n\tgetModelForClass(CancellationReason);\nexport * from './cancellation-reason.model';\n\nexport * from './embedded/trip-leg.mode';\nexport * from './embedded/rider-assignment-model';\n\nexport const RewardModel: ReturnModelType<typeof Reward> = getModelForClass(Reward);\nexport * from './reward.model';\n\nexport const TicketModel: ReturnModelType<typeof Ticket> = getModelForClass(Ticket);\nexport * from './ticket.model';\n\nexport const MessageModel: ReturnModelType<typeof Message> = getModelForClass(Message);\nexport * from './message.model';\n\nexport const AgentPerformanceModel: ReturnModelType<typeof AgentPerformance> =\n\tgetModelForClass(AgentPerformance);\nexport * from './agent-performance.model';\n\nexport const ChatroomModel: ReturnModelType<typeof Chatroom> = getModelForClass(Chatroom);\nexport * from './chat-room.model';\n\nexport * from './embedded/chat-participant.model';\n\nexport const ServiceModel: ReturnModelType<typeof Service> = getModelForClass(Service);\nexport * from './service.model';\n\nexport const VendorParentModel: ReturnModelType<typeof VendorParent> = getModelForClass(VendorParent);\nexport * from './vendor-parent.model';\n\nexport const VendorModel: ReturnModelType<typeof Vendor> = getModelForClass(Vendor);\nexport * from './vendor.model';\n\nexport const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl> =\n\tgetModelForClass(VendorAccessControl);\nexport * from './vendor-access-control.model';\n\nexport const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory> =\n\tgetModelForClass(ServiceCategory);\nexport * from './service-category.model';\n\nexport const ServiceAddonModel: ReturnModelType<typeof ServiceAddon> = getModelForClass(ServiceAddon);\nexport * from './service-addon.model';\n\nexport const ServicePackageModel: ReturnModelType<typeof ServicePackage> = getModelForClass(ServicePackage);\nexport * from './service-package.model';\n\nexport const ProfessionalModel: ReturnModelType<typeof Professional> = getModelForClass(Professional);\nexport * from './professional.model';\n\nexport const ServiceCartModel: ReturnModelType<typeof ServiceCart> = getModelForClass(ServiceCart);\nexport * from './service-cart.model';\n\nexport const ServiceLineItemModel: ReturnModelType<typeof ServiceLineItem> =\n\tgetModelForClass(ServiceLineItem);\nexport * from './service-line-item.model';\n\nexport const ServiceOrderModel: ReturnModelType<typeof ServiceOrder> = getModelForClass(ServiceOrder);\nexport * from './service-order.model';\n\nexport const ProfessionalBlockedTimeModel: ReturnModelType<typeof ProfessionalBlockedTime> =\n\tgetModelForClass(ProfessionalBlockedTime);\nexport * from './professional-blocked-time.model';\n\nexport const TicketActionModel: ReturnModelType<typeof TicketAction> = getModelForClass(TicketAction);\nexport * from './ticket-action.model';\n\nexport const ServicePromotionModel: ReturnModelType<typeof ServicePromotion> =\n\tgetModelForClass(ServicePromotion);\nexport * from './service-promotion.model';\n\nexport const LoggerModel: ReturnModelType<typeof Log> = getModelForClass(Log);\nexport * from './log.model';\n\nexport const ZoneExtraTimeModel: ReturnModelType<typeof ZoneExtraTime> = getModelForClass(ZoneExtraTime);\nexport * from './zone-extra-time';\n\nexport * from './google-maps-usage.model';\n\nexport const AppInstanceModel: ReturnModelType<typeof AppInstance> = getModelForClass(AppInstance);\nexport * from './app-instance.model';\n"]}
@@ -5,6 +5,7 @@ import { NotificationSettings } from '../PushNotificationEvent';
5
5
  export declare const ChatlistMessageSendSocketInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
6
6
  export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
7
7
  chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
8
+ orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
8
9
  lastMessage: z.ZodOptional<z.ZodObject<{
9
10
  content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
10
11
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
@@ -23,6 +24,7 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
23
24
  content: string;
24
25
  createdAt: Date;
25
26
  } | undefined;
27
+ orderId?: import("mongoose").Types.ObjectId | undefined;
26
28
  }, {
27
29
  unreadCount: number;
28
30
  chatroomId: import("mongoose").Types.ObjectId;
@@ -30,9 +32,11 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
30
32
  content: string;
31
33
  createdAt: Date;
32
34
  } | undefined;
35
+ orderId?: import("mongoose").Types.ObjectId | undefined;
33
36
  }>;
34
37
  export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
35
38
  chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
39
+ orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
36
40
  lastMessage: z.ZodOptional<z.ZodObject<{
37
41
  content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
38
42
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
@@ -51,6 +55,7 @@ export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
51
55
  content: string;
52
56
  createdAt: Date;
53
57
  } | undefined;
58
+ orderId?: import("mongoose").Types.ObjectId | undefined;
54
59
  }, {
55
60
  unreadCount: number;
56
61
  chatroomId: import("mongoose").Types.ObjectId;
@@ -58,6 +63,7 @@ export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
58
63
  content: string;
59
64
  createdAt: Date;
60
65
  } | undefined;
66
+ orderId?: import("mongoose").Types.ObjectId | undefined;
61
67
  }>;
62
68
  export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatlistMessageSendPushOutputSchema>;
63
69
  export type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;
@@ -67,6 +73,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
67
73
  input: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
68
74
  output: z.ZodObject<{
69
75
  chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
76
+ orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
70
77
  lastMessage: z.ZodOptional<z.ZodObject<{
71
78
  content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
72
79
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
@@ -85,6 +92,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
85
92
  content: string;
86
93
  createdAt: Date;
87
94
  } | undefined;
95
+ orderId?: import("mongoose").Types.ObjectId | undefined;
88
96
  }, {
89
97
  unreadCount: number;
90
98
  chatroomId: import("mongoose").Types.ObjectId;
@@ -92,9 +100,11 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
92
100
  content: string;
93
101
  createdAt: Date;
94
102
  } | undefined;
103
+ orderId?: import("mongoose").Types.ObjectId | undefined;
95
104
  }>;
96
105
  pushNotificationOutput: z.ZodObject<{
97
106
  chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
107
+ orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
98
108
  lastMessage: z.ZodOptional<z.ZodObject<{
99
109
  content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
100
110
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
@@ -113,6 +123,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
113
123
  content: string;
114
124
  createdAt: Date;
115
125
  } | undefined;
126
+ orderId?: import("mongoose").Types.ObjectId | undefined;
116
127
  }, {
117
128
  unreadCount: number;
118
129
  chatroomId: import("mongoose").Types.ObjectId;
@@ -120,6 +131,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
120
131
  content: string;
121
132
  createdAt: Date;
122
133
  } | undefined;
134
+ orderId?: import("mongoose").Types.ObjectId | undefined;
123
135
  }>;
124
136
  };
125
137
  get notificationSettings(): NotificationSettings | undefined;
@@ -11,6 +11,7 @@ const BaseSocketEvent_1 = require("../BaseSocketEvent");
11
11
  exports.ChatlistMessageSendSocketInputSchema = zod_1.default.object({});
12
12
  exports.ChatlistMessageSendSocketOutputSchema = zod_1.default.object({
13
13
  chatroomId: validation_1.ZodValidation.coerce.objectId(),
14
+ orderId: validation_1.ZodValidation.coerce.objectId().optional(),
14
15
  lastMessage: zod_1.default
15
16
  .object({
16
17
  content: validation_1.ZodValidation.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAqE;AACrE,8DAAmE;AACnE,wDAAqD;AAIxC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,aAAC;SACZ,MAAM,CAAC;QACP,OAAO,EAAE,0BAAa,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;KACtC,CAAC;SACD,QAAQ,EAAE;IACZ,WAAW,EAAE,0BAAa,CAAC,MAAM,EAAE;CACnC,CAAC,CAAC;AAEU,QAAA,mCAAmC,GAAG,6CAAqC,CAAC;AAMzF,MAAa,8BAA+B,SAAQ,iCAInD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,6CAAqC;QAC7C,sBAAsB,EAAE,2CAAmC;KAC3D,CAAC;IAEF,IAAW,oBAAoB;QAC9B,OAAO;YACN,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,gBAAS,CAAC,iBAAiB;SACtC,CAAC;IACH,CAAC;IAED,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,yBAAyB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5G,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAzBF,wEA0BC","sourcesContent":["import z from 'zod';\nimport { ClickType, SocketEventType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nimport { NotificationSettings } from '../PushNotificationEvent';\n\nexport const ChatlistMessageSendSocketInputSchema = z.object({});\nexport const ChatlistMessageSendSocketOutputSchema = z.object({\n\tchatroomId: ZodValidation.coerce.objectId(),\n\tlastMessage: z\n\t\t.object({\n\t\t\tcontent: ZodValidation.string(),\n\t\t\tcreatedAt: ZodValidation.coerce.date(),\n\t\t})\n\t\t.optional(),\n\tunreadCount: ZodValidation.number(),\n});\n\nexport const ChatlistMessageSendPushOutputSchema = ChatlistMessageSendSocketOutputSchema;\n\nexport type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatlistMessageSendPushOutputSchema>;\nexport type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;\nexport type ChatlistMessageSendSocketInputDTO = DTO<typeof ChatlistMessageSendSocketInputSchema>;\n\nexport class ChatlistMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatlistMessageSendSocketInputSchema,\n\ttypeof ChatlistMessageSendSocketOutputSchema,\n\ttypeof ChatlistMessageSendPushOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatlistMessageSendSocketInputSchema,\n\t\toutput: ChatlistMessageSendSocketOutputSchema,\n\t\tpushNotificationOutput: ChatlistMessageSendPushOutputSchema,\n\t};\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn {\n\t\t\tisPushNotification: true,\n\t\t\tisClickable: true,\n\t\t\tclickType: ClickType.CLICKABLE_MESSAGE,\n\t\t};\n\t}\n\n\tconstructor(payload: ChatlistMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload, payload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
1
+ {"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAqE;AACrE,8DAAmE;AACnE,wDAAqD;AAIxC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACnD,WAAW,EAAE,aAAC;SACZ,MAAM,CAAC;QACP,OAAO,EAAE,0BAAa,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;KACtC,CAAC;SACD,QAAQ,EAAE;IACZ,WAAW,EAAE,0BAAa,CAAC,MAAM,EAAE;CACnC,CAAC,CAAC;AAEU,QAAA,mCAAmC,GAAG,6CAAqC,CAAC;AAMzF,MAAa,8BAA+B,SAAQ,iCAInD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,6CAAqC;QAC7C,sBAAsB,EAAE,2CAAmC;KAC3D,CAAC;IAEF,IAAW,oBAAoB;QAC9B,OAAO;YACN,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,gBAAS,CAAC,iBAAiB;SACtC,CAAC;IACH,CAAC;IAED,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,yBAAyB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5G,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAzBF,wEA0BC","sourcesContent":["import z from 'zod';\nimport { ClickType, SocketEventType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nimport { NotificationSettings } from '../PushNotificationEvent';\n\nexport const ChatlistMessageSendSocketInputSchema = z.object({});\nexport const ChatlistMessageSendSocketOutputSchema = z.object({\n\tchatroomId: ZodValidation.coerce.objectId(),\n\torderId: ZodValidation.coerce.objectId().optional(),\n\tlastMessage: z\n\t\t.object({\n\t\t\tcontent: ZodValidation.string(),\n\t\t\tcreatedAt: ZodValidation.coerce.date(),\n\t\t})\n\t\t.optional(),\n\tunreadCount: ZodValidation.number(),\n});\n\nexport const ChatlistMessageSendPushOutputSchema = ChatlistMessageSendSocketOutputSchema;\n\nexport type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatlistMessageSendPushOutputSchema>;\nexport type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;\nexport type ChatlistMessageSendSocketInputDTO = DTO<typeof ChatlistMessageSendSocketInputSchema>;\n\nexport class ChatlistMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatlistMessageSendSocketInputSchema,\n\ttypeof ChatlistMessageSendSocketOutputSchema,\n\ttypeof ChatlistMessageSendPushOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatlistMessageSendSocketInputSchema,\n\t\toutput: ChatlistMessageSendSocketOutputSchema,\n\t\tpushNotificationOutput: ChatlistMessageSendPushOutputSchema,\n\t};\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn {\n\t\t\tisPushNotification: true,\n\t\t\tisClickable: true,\n\t\t\tclickType: ClickType.CLICKABLE_MESSAGE,\n\t\t};\n\t}\n\n\tconstructor(payload: ChatlistMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload, payload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}