@lyxa.ai/core 1.0.287 → 1.0.289
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libraries/auth/index.d.ts +1 -1
- package/dist/libraries/auth/index.js +1 -1
- package/dist/libraries/auth/index.js.map +1 -1
- package/dist/libraries/mongo/models/chat-room.model.d.ts +0 -1
- package/dist/libraries/mongo/models/chat-room.model.js +1 -6
- package/dist/libraries/mongo/models/chat-room.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/chat-participant.model.d.ts +3 -1
- package/dist/libraries/mongo/models/embedded/chat-participant.model.js +10 -4
- package/dist/libraries/mongo/models/embedded/chat-participant.model.js.map +1 -1
- package/dist/libraries/mongo/models/index.d.ts +3 -3
- package/dist/libraries/mongo/models/index.js +4 -4
- package/dist/libraries/mongo/models/index.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +1 -1
- package/dist/libraries/mongo/models/vendor-access-control.model.d.ts +2 -2
- package/dist/libraries/mongo/models/vendor-access-control.model.js +2 -2
- package/dist/libraries/mongo/models/vendor-access-control.model.js.map +1 -1
- package/dist/libraries/mongo/models/{service-parent.model.d.ts → vendor-parent.model.d.ts} +1 -1
- package/dist/libraries/mongo/models/{service-parent.model.js → vendor-parent.model.js} +19 -19
- package/dist/libraries/mongo/models/vendor-parent.model.js.map +1 -0
- package/dist/libraries/mongo/models/vendor.model.d.ts +4 -2
- package/dist/libraries/mongo/models/vendor.model.js +7 -1
- package/dist/libraries/mongo/models/vendor.model.js.map +1 -1
- package/dist/libraries/mongo/repositories/index.d.ts +0 -0
- package/dist/libraries/mongo/repositories/index.js +2 -0
- package/dist/libraries/mongo/repositories/index.js.map +1 -0
- package/dist/libraries/mongo/repositories/optimized-product.repository.d.ts +0 -0
- package/dist/libraries/mongo/repositories/optimized-product.repository.js +2 -0
- package/dist/libraries/mongo/repositories/optimized-product.repository.js.map +1 -0
- package/dist/libraries/mongo/repositories/optimized-product.service.d.ts +0 -0
- package/dist/libraries/mongo/repositories/optimized-product.service.js +2 -0
- package/dist/libraries/mongo/repositories/optimized-product.service.js.map +1 -0
- package/dist/libraries/mongo/repositories/product-benchmark.d.ts +0 -0
- package/dist/libraries/mongo/repositories/product-benchmark.js +2 -0
- package/dist/libraries/mongo/repositories/product-benchmark.js.map +1 -0
- package/dist/libraries/mongo/repositories/product-query-optimizer.d.ts +0 -0
- package/dist/libraries/mongo/repositories/product-query-optimizer.js +2 -0
- package/dist/libraries/mongo/repositories/product-query-optimizer.js.map +1 -0
- package/dist/libraries/mongo/repositories/product.repository.d.ts +0 -0
- package/dist/libraries/mongo/repositories/product.repository.js +2 -0
- package/dist/libraries/mongo/repositories/product.repository.js.map +1 -0
- package/dist/libraries/mongo/repositories/test-optimized-product.d.ts +0 -0
- package/dist/libraries/mongo/repositories/test-optimized-product.js +2 -0
- package/dist/libraries/mongo/repositories/test-optimized-product.js.map +1 -0
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/enum.d.ts +0 -4
- package/dist/types/utilities/enum.js +1 -6
- package/dist/types/utilities/enum.js.map +1 -1
- package/dist/utilities/auth-ref.mapper.js +1 -1
- package/dist/utilities/auth-ref.mapper.js.map +1 -1
- package/dist/utilities/enum.d.ts +0 -4
- package/dist/utilities/enum.js +1 -6
- package/dist/utilities/enum.js.map +1 -1
- package/package.json +1 -1
- package/dist/libraries/mongo/models/service-parent.model.js.map +0 -1
|
@@ -26,7 +26,7 @@ var AuthEntityType;
|
|
|
26
26
|
AuthEntityType["SELLER"] = "SELLER";
|
|
27
27
|
AuthEntityType["DELIVERY_BOY"] = "DELIVERY_BOY";
|
|
28
28
|
AuthEntityType["CRM"] = "CRM";
|
|
29
|
-
AuthEntityType["
|
|
29
|
+
AuthEntityType["VENDOR_PARENT"] = "VENDOR_PARENT";
|
|
30
30
|
AuthEntityType["PROFESSIONAL"] = "PROFESSIONAL";
|
|
31
31
|
})(AuthEntityType || (exports.AuthEntityType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C,MAAM,UAAU,GAAG;QAClB,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC;IAEF,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC;YACrC,EAAE,EAAE,WAAW,CAAC,QAAQ;YACxB,IAAI,EAAE,WAAW,CAAC,UAAU;YAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;SACtC,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,kBAAkB,CAAC,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';\n\nexport enum AuthEntityType {\n\tUSER = 'USER',\n\tSELLER = 'SELLER',\n\tDELIVERY_BOY = 'DELIVERY_BOY',\n\tCRM = 'CRM',\n\tVENDOR = 'VENDOR',\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;\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/**\n * Initialize the RefreshToken model (called from initGlobalConnection)\n */\nexport function initializeRefreshTokenModel(globalConnection: any) {\n\tactualRefreshTokenModel = getModelForClass(RefreshToken, { 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\tvalid: boolean;\n\tentity?: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> };\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tconst storedToken = await tokenRepository.findRefreshToken(token);\n\n\tif (!storedToken) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.expiresAt && new Date() > storedToken.expiresAt) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.isRevoked) {\n\t\treturn { valid: false };\n\t}\n\n\treturn {\n\t\tvalid: true,\n\t\tentity: {\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata,\n\t\t},\n\t};\n}\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":";;;;;;AAoCA,oDAKC;AAKD,kEAGC;AAMD,0CA2BC;AAKD,oDAuDC;AAaD,8CAwBC;AAKD,oDA2BC;AAMD,sCAoCC;AAKD,gDAGC;AAKD,wDAGC;AAKD,sCA6BC;AAOD,gDA2EC;AAjYD,gEAA4D;AAE5D,mCAAqC;AACrC,iDAA8C;AAC9C,uCAA2C;AAC3C,oDAAyE;AAEzE,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;AAKhF,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;AAKD,SAAgB,2BAA2B,CAAC,gBAAqB;IAChE,uBAAuB,GAAG,IAAA,4BAAgB,EAAC,2BAAY,EAAE,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACnG,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AACjD,CAAC;AAMM,KAAK,UAAU,eAAe,CACpC,MAAiF,EACjF,OAAqB;IAErB,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ACtB,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;IAE1C,MAAM,UAAU,GAAG;QAClB,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC;IAEF,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC;YACrC,EAAE,EAAE,WAAW,CAAC,QAAQ;YACxB,IAAI,EAAE,WAAW,CAAC,UAAU;YAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;SACtC,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,kBAAkB,CAAC,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';\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;\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/**\n * Initialize the RefreshToken model (called from initGlobalConnection)\n */\nexport function initializeRefreshTokenModel(globalConnection: any) {\n\tactualRefreshTokenModel = getModelForClass(RefreshToken, { 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\tvalid: boolean;\n\tentity?: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> };\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tconst storedToken = await tokenRepository.findRefreshToken(token);\n\n\tif (!storedToken) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.expiresAt && new Date() > storedToken.expiresAt) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.isRevoked) {\n\t\treturn { valid: false };\n\t}\n\n\treturn {\n\t\tvalid: true,\n\t\tentity: {\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata,\n\t\t},\n\t};\n}\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"]}
|
|
@@ -20,7 +20,6 @@ class LastMessage extends defaultClasses_1.TimeStamps {
|
|
|
20
20
|
content;
|
|
21
21
|
senderType;
|
|
22
22
|
sender;
|
|
23
|
-
isRead;
|
|
24
23
|
}
|
|
25
24
|
__decorate([
|
|
26
25
|
(0, typegoose_1.prop)({ type: mongoose_1.Types.ObjectId }),
|
|
@@ -38,10 +37,6 @@ __decorate([
|
|
|
38
37
|
(0, typegoose_1.prop)({ refPath: 'senderType' }),
|
|
39
38
|
__metadata("design:type", Object)
|
|
40
39
|
], LastMessage.prototype, "sender", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
43
|
-
__metadata("design:type", Boolean)
|
|
44
|
-
], LastMessage.prototype, "isRead", void 0);
|
|
45
40
|
let Chatroom = class Chatroom extends defaultClasses_1.TimeStamps {
|
|
46
41
|
type;
|
|
47
42
|
participants;
|
|
@@ -87,6 +82,6 @@ exports.Chatroom = Chatroom = __decorate([
|
|
|
87
82
|
(0, typegoose_1.index)({ ticket: 1 }),
|
|
88
83
|
(0, typegoose_1.index)({ createdAt: -1 }),
|
|
89
84
|
(0, typegoose_1.index)({ messageCount: -1 }),
|
|
90
|
-
(0, typegoose_1.index)({ 'participants.
|
|
85
|
+
(0, typegoose_1.index)({ 'participants.lastReadMessageAt': 1 })
|
|
91
86
|
], Chatroom);
|
|
92
87
|
//# sourceMappingURL=chat-room.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-room.model.js","sourceRoot":"/","sources":["libraries/mongo/models/chat-room.model.ts"],"names":[],"m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C,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,wCAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACvB;AAGjC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BACd,WAAW;6CAAC;AAG1B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;0CACpB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACL,IAAI;+CAAC;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8CACb;mBAjBV,QAAQ;IAZpB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC/B,IAAA,iBAAK,EAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAC;IACxD,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,IAAA,iBAAK,EAAC,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC;IAC3B,IAAA,iBAAK,EAAC,EAAE,gCAAgC,EAAE,CAAC,EAAE,CAAC;GAClC,QAAQ,CAkBpB","sourcesContent":["import { prop, modelOptions, index, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ChatParticipant } from './embedded/chat-participant.model';\nimport { ChatroomType, UserRef } from '../../../utilities/enum';\nimport { User } from './user.model';\nimport { Shop } from './shop.model';\nimport { Admin } from './admin.model';\nimport { Rider } from './rider.model';\nimport { Types } from 'mongoose';\n\nclass LastMessage extends TimeStamps {\n\t@prop({ type: Types.ObjectId })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ required: true, type: String })\n\tpublic content!: string;\n\n\t@prop({ required: true, type: String, enum: UserRef })\n\tpublic senderType!: UserRef;\n\n\t@prop({ refPath: 'senderType' })\n\tpublic sender!: Ref<User | Admin | Shop | Rider>;\n}\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'chatrooms',\n\t\ttimestamps: true,\n\t},\n})\n@index({ type: 1, isActive: 1 })\n@index({ 'participants.ref': 1, 'participants.type': 1 })\n@index({ ticket: 1 })\n@index({ createdAt: -1 })\n@index({ messageCount: -1 })\n@index({ 'participants.lastReadMessageAt': 1 })\nexport class Chatroom extends TimeStamps {\n\t@prop({ enum: ChatroomType, required: true })\n\ttype!: ChatroomType;\n\n\t@prop({ type: () => [ChatParticipant], required: true })\n\tparticipants!: ChatParticipant[];\n\n\t@prop({ type: LastMessage })\n\tlastMessage?: LastMessage;\n\n\t@prop({ type: Boolean, default: true })\n\tisActive?: boolean;\n\n\t@prop({ type: Date })\n\tlastMessageAt?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tmessageCount?: number;\n}\n"]}
|
|
@@ -4,12 +4,14 @@ import { Admin } from '../admin.model';
|
|
|
4
4
|
import { Shop } from '../shop.model';
|
|
5
5
|
import { Rider } from '../rider.model';
|
|
6
6
|
import { UserRef } from '../../../../utilities/enum';
|
|
7
|
+
import { Message } from '../message.model';
|
|
7
8
|
export declare class ChatParticipant {
|
|
8
9
|
ref: Ref<User | Admin | Shop | Rider>;
|
|
9
10
|
type: UserRef;
|
|
10
11
|
joinedAt?: Date;
|
|
11
12
|
lastReadAt?: Date;
|
|
12
13
|
isActive?: boolean;
|
|
13
|
-
|
|
14
|
+
lastReadMessage?: Ref<Message>;
|
|
15
|
+
lastReadMessageAt?: Date;
|
|
14
16
|
leftAt?: Date;
|
|
15
17
|
}
|
|
@@ -12,13 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ChatParticipant = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const enum_1 = require("../../../../utilities/enum");
|
|
15
|
+
const message_model_1 = require("../message.model");
|
|
15
16
|
class ChatParticipant {
|
|
16
17
|
ref;
|
|
17
18
|
type;
|
|
18
19
|
joinedAt;
|
|
19
20
|
lastReadAt;
|
|
20
21
|
isActive;
|
|
21
|
-
|
|
22
|
+
lastReadMessage;
|
|
23
|
+
lastReadMessageAt;
|
|
22
24
|
leftAt;
|
|
23
25
|
}
|
|
24
26
|
exports.ChatParticipant = ChatParticipant;
|
|
@@ -43,9 +45,13 @@ __decorate([
|
|
|
43
45
|
__metadata("design:type", Boolean)
|
|
44
46
|
], ChatParticipant.prototype, "isActive", void 0);
|
|
45
47
|
__decorate([
|
|
46
|
-
(0, typegoose_1.prop)({
|
|
47
|
-
__metadata("design:type",
|
|
48
|
-
], ChatParticipant.prototype, "
|
|
48
|
+
(0, typegoose_1.prop)({ ref: () => message_model_1.Message }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], ChatParticipant.prototype, "lastReadMessage", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typegoose_1.prop)({ type: Date }),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], ChatParticipant.prototype, "lastReadMessageAt", void 0);
|
|
49
55
|
__decorate([
|
|
50
56
|
(0, typegoose_1.prop)({ type: Date }),
|
|
51
57
|
__metadata("design:type", Date)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/chat-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAKjD,qDAAqD;
|
|
1
|
+
{"version":3,"file":"chat-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/chat-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAKjD,qDAAqD;AACrD,oDAA2C;AAE3C,MAAa,eAAe;IAE3B,GAAG,CAAoC;IAGvC,IAAI,CAAW;IAGf,QAAQ,CAAQ;IAGhB,UAAU,CAAQ;IAGlB,QAAQ,CAAW;IAGnB,eAAe,CAAgB;IAG/B,iBAAiB,CAAQ;IAGzB,MAAM,CAAQ;CACd;AAxBD,0CAwBC;AAtBA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;4CACH;AAGvC;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;6CACzB;AAGf;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACrC,IAAI;iDAAC;AAGhB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACR,IAAI;mDAAC;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,CAAC;;wDACE;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACD,IAAI;0DAAC;AAGzB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;+CAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { User } from '../user.model';\nimport { Admin } from '../admin.model';\nimport { Shop } from '../shop.model';\nimport { Rider } from '../rider.model';\nimport { UserRef } from '../../../../utilities/enum';\nimport { Message } from '../message.model';\n\nexport class ChatParticipant {\n\t@prop({ required: true, refPath: 'type' })\n\tref!: Ref<User | Admin | Shop | Rider>;\n\n\t@prop({ required: true, enum: UserRef })\n\ttype!: UserRef;\n\n\t@prop({ type: Date, default: () => new Date() })\n\tjoinedAt?: Date;\n\n\t@prop({ type: Date })\n\tlastReadAt?: Date;\n\n\t@prop({ type: Boolean, default: true })\n\tisActive?: boolean;\n\n\t@prop({ ref: () => Message })\n\tlastReadMessage?: Ref<Message>;\n\n\t@prop({ type: Date })\n\tlastReadMessageAt?: Date;\n\n\t@prop({ type: Date })\n\tleftAt?: Date;\n}\n"]}
|
|
@@ -88,7 +88,7 @@ import { Ticket } from './ticket.model';
|
|
|
88
88
|
import { Message } from './message.model';
|
|
89
89
|
import { AgentPerformance } from './agent-performance.model';
|
|
90
90
|
import { Chatroom } from './chat-room.model';
|
|
91
|
-
import {
|
|
91
|
+
import { VendorParent } from './vendor-parent.model';
|
|
92
92
|
import { Vendor } from './vendor.model';
|
|
93
93
|
import { VendorAccessControl } from './vendor-access-control.model';
|
|
94
94
|
import { ServiceCategory } from './service-category.model';
|
|
@@ -287,8 +287,8 @@ export * from './chat-room.model';
|
|
|
287
287
|
export * from './embedded/chat-participant.model';
|
|
288
288
|
export declare const ServiceModel: ReturnModelType<typeof Service>;
|
|
289
289
|
export * from './service.model';
|
|
290
|
-
export declare const
|
|
291
|
-
export * from './
|
|
290
|
+
export declare const VendorParentModel: ReturnModelType<typeof VendorParent>;
|
|
291
|
+
export * from './vendor-parent.model';
|
|
292
292
|
export declare const VendorModel: ReturnModelType<typeof Vendor>;
|
|
293
293
|
export * from './vendor.model';
|
|
294
294
|
export declare const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl>;
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.RiderPayoutModel = exports.ShopPayoutModel = exports.PayoutModel = exports.ParentModel = exports.OrderDeliveryModel = exports.ShopCourierOrderModel = exports.CourierOrderModel = exports.RegularOrderModel = exports.OrderModel = exports.NutritionModel = exports.NotificationModel = exports.MealPlanModel = exports.PunchMarketingModel = exports.LoyaltyPointMarketingModel = exports.FreeDeliveryMarketingModel = exports.FeaturedMarketingModel = exports.DiscountMarketingModel = exports.Buy1Get1MarketingModel = exports.MarketingModel = exports.LoyaltyPointSettingModel = exports.LoyaltyPointCategoryModel = exports.ListContainerModel = exports.LineItemModel = exports.GalleryModel = exports.FinanceSettlementModel = exports.FilterContainerModel = exports.FeaturedSettingModel = exports.FavouriteModel = exports.FaqModel = exports.DishModel = exports.DealSettingModel = exports.ReferralRewardCouponModel = exports.ReferralCodeCouponModel = exports.IndividualUserCouponModel = exports.IndividualStoreCouponModel = exports.GlobalCouponModel = exports.CustomCouponModel = exports.CouponModel = exports.CounterModel = exports.CategoryModel = exports.CartParticipantModel = exports.CartModel = exports.BrandModel = exports.BOBFinanceModel = exports.BannerModel = exports.AttributeModel = exports.UserAppSectionSettingModel = exports.AdminModel = exports.AdminAccessControlModel = exports.ActivityLogModel = void 0;
|
|
18
|
-
exports.ServicePromotionModel = exports.VendorSettingsModel = exports.TicketActionModel = exports.ProfessionalScheduleModel = exports.ProfessionalReviewModel = exports.ServiceOrderModel = exports.ServiceLineItemModel = exports.ServiceCartModel = exports.ProfessionalModel = exports.ServicePackageModel = exports.ServiceCategoryModel = exports.VendorAccessControlModel = exports.VendorModel = exports.
|
|
18
|
+
exports.ServicePromotionModel = exports.VendorSettingsModel = exports.TicketActionModel = exports.ProfessionalScheduleModel = exports.ProfessionalReviewModel = exports.ServiceOrderModel = exports.ServiceLineItemModel = exports.ServiceCartModel = exports.ProfessionalModel = exports.ServicePackageModel = 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.SubscriptionSettingModel = exports.ShopModel = exports.ShopReviewModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.RiderReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.PunchMarketingHistoryModel = exports.ProductModel = exports.ProductMarketingModel = void 0;
|
|
19
19
|
exports.getCardModel = getCardModel;
|
|
20
20
|
exports.getAreebaCardModel = getAreebaCardModel;
|
|
21
21
|
exports.getCoreAuthIdentityModel = getCoreAuthIdentityModel;
|
|
@@ -118,7 +118,7 @@ const message_model_1 = require("./message.model");
|
|
|
118
118
|
const agent_performance_model_1 = require("./agent-performance.model");
|
|
119
119
|
const chat_room_model_1 = require("./chat-room.model");
|
|
120
120
|
const auth_1 = require("../../auth");
|
|
121
|
-
const
|
|
121
|
+
const vendor_parent_model_1 = require("./vendor-parent.model");
|
|
122
122
|
const vendor_model_1 = require("./vendor.model");
|
|
123
123
|
const vendor_access_control_model_1 = require("./vendor-access-control.model");
|
|
124
124
|
const service_category_model_1 = require("./service-category.model");
|
|
@@ -374,8 +374,8 @@ __exportStar(require("./chat-room.model"), exports);
|
|
|
374
374
|
__exportStar(require("./embedded/chat-participant.model"), exports);
|
|
375
375
|
exports.ServiceModel = (0, typegoose_1.getModelForClass)(service_model_1.Service);
|
|
376
376
|
__exportStar(require("./service.model"), exports);
|
|
377
|
-
exports.
|
|
378
|
-
__exportStar(require("./
|
|
377
|
+
exports.VendorParentModel = (0, typegoose_1.getModelForClass)(vendor_parent_model_1.VendorParent);
|
|
378
|
+
__exportStar(require("./vendor-parent.model"), exports);
|
|
379
379
|
exports.VendorModel = (0, typegoose_1.getModelForClass)(vendor_model_1.Vendor);
|
|
380
380
|
__exportStar(require("./vendor.model"), exports);
|
|
381
381
|
exports.VendorAccessControlModel = (0, typegoose_1.getModelForClass)(vendor_access_control_model_1.VendorAccessControl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA4JA,oCAGC;AAED,gDAGC;AAED,4DAGC;AAED,sEAGC;AAED,sEAGC;AAED,wEAGC;AAED,sEAGC;AAED,4CAGC;AAED,oCAGC;AAGD,wDA8CC;AAxPD,uEAA4D;AAC5D,uEAA6D;AAC7D,qEAA2D;AAC3D,oDAAwG;AACxG,+CAAsC;AACtC,6EAAkE;AAClE,6DAAmD;AACnD,qFAAyE;AACzE,uDAA8C;AAC9C,iDAAwC;AACxC,2DAAiD;AACjD,+CAAsC;AACtC,qDAA4C;AAC5C,mDAA0C;AAC1C,iDAAwC;AACxC,6DAAmD;AACnD,6CAAoC;AACpC,2CAAkC;AAClC,uDAA8C;AAC9C,qEAA2D;AAC3D,qEAA2D;AAC3D,iEAAuD;AACvD,iFAAsE;AACtE,+EAAoE;AACpE,uDAA8C;AAC9C,uDAA6C;AAC7C,uDAA8C;AAC9C,iDAAwC;AACxC,uEAA6D;AAC7D,mDAA0C;AAC1C,mFAAwE;AACxE,iEAAuD;AACvD,qEAA2D;AAC3D,6DAAmD;AACnD,6DAAmD;AACnD,6CAAoC;AACpC,mDAA0C;AAC1C,2EAAgE;AAChE,+DAAqD;AACrD,iEAAsD;AACtD,2DAAiD;AACjD,6CAAoC;AACpC,6EAAmE;AACnE,6DAAoD;AACpD,2CAAkC;AAClC,6CAAoC;AACpC,qFAA0E;AAC1E,kDAOiC;AACjC,yEAA+D;AAC/D,mFAAyE;AACzE,mFAAyE;AACzE,6FAAkF;AAClF,yEAA+D;AAC/D,6FAAkF;AAClF,2FAAgF;AAChF,6FAAkF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GAA0C,IAAA,4BAAgB,EAAC,oCAAa,CAAC,CAAC;AACzG,yDAAuC;AAE1B,QAAA,WAAW,GAAmC,IAAA,4BAAgB,EAAC,qBAAM,CAAC,CAAC;AACpF,iDAA+B;AAElB,QAAA,wBAAwB,GAAgD,IAAA,4BAAgB,EAAC,iDAAmB,CAAC,CAAC;AAC3H,gEAA8C;AAEjC,QAAA,oBAAoB,GAA4C,IAAA,4BAAgB,EAAC,wCAAe,CAAC,CAAC;AAC/G,2DAAyC;AAE5B,QAAA,mBAAmB,GAA2C,IAAA,4BAAgB,EAAC,sCAAc,CAAC,CAAC;AAC5G,0DAAwC;AAE3B,QAAA,iBAAiB,GAAyC,IAAA,4BAAgB,EAAC,iCAAY,CAAC,CAAA;AACrG,uDAAoC;AAEvB,QAAA,gBAAgB,GAAwC,IAAA,4BAAgB,EAAC,gCAAW,CAAC,CAAC;AACnG,uDAAqC;AAExB,QAAA,oBAAoB,GAA4C,IAAA,4BAAgB,EAAC,yCAAe,CAAC,CAAC;AAC/G,4DAA0C;AAG7B,QAAA,iBAAiB,GAAyC,IAAA,4BAAgB,EAAC,kCAAY,CAAC,CAAA;AACrG,wDAAqC;AAExB,QAAA,uBAAuB,GAA+C,IAAA,4BAAgB,EAAC,8CAAkB,CAAC,CAAA;AACvH,8DAA2C;AAE9B,QAAA,yBAAyB,GAAiD,IAAA,4BAAgB,EAAC,4CAAoB,CAAC,CAAA;AAC7H,0DAAuC;AAE1B,QAAA,iBAAiB,GAAyC,IAAA,4BAAgB,EAAC,kCAAY,CAAC,CAAC;AACtG,wDAAsC;AAEzB,QAAA,mBAAmB,GAA2C,IAAA,4BAAgB,EAAC,sCAAc,CAAC,CAAA;AAC3G,0DAAuC;AAE1B,QAAA,qBAAqB,GAA6C,IAAA,4BAAgB,EAAC,0CAAgB,CAAC,CAAC;AAClH,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 { 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 { Faq } from './faq.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 { LoyaltyPointCategory } from './loyalty-point-category.model';\nimport { LoyaltyPointSetting } from './loyalty-point-setting.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 { RiderReview } from './rider-review.model';\nimport { Role } from './role.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 { ShopReview } from './shop-review.model';\nimport { Shop } from './shop.model';\nimport { SubscriptionSetting } from './subscription-setting.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\tCardType,\n\tCoreAuthIdentityType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n} from '../../../utilities/enum';\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 { LoyaltyPointMarketing } from './providers/loyalty-point-marketing.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 { Card } from './card.model';\nimport { AreebaCard } from './providers/areeba-card.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 { OrderDelivery } from './order-delivery.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 { ServiceParent } from './service-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 { ProfessionalReview } from './professional-review.model';\nimport { ProfessionalSchedule } from './professional-schedule';\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 { VendorSettings } from './vendor-settings.model';\nimport { ServicePromotion } from './service-promotion.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\n// Global models - will be set after initGlobalConnection()\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualRoleModel: ReturnModelType<typeof Role> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\nlet actualAreebaCardModel: ReturnModelType<typeof AreebaCard> | null = null;\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 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 getAreebaCardModel(): ReturnModelType<typeof AreebaCard> {\n\tif (!actualAreebaCardModel) throw new Error('AreebaCard model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualAreebaCardModel;\n}\n\nexport function getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel) throw new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel) throw new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel) throw new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel) throw new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel) throw new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel) throw new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\nexport function getRoleModel(): ReturnModelType<typeof Role> {\n\tif (!actualRoleModel) throw new Error('Role model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualRoleModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualRoleModel = getModelForClass(Role, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\n\tactualAreebaCardModel = getDiscriminatorModelForClass(\n\t\tactualCardModel,\n\t\tAreebaCard,\n\t\tCardType.AREEEBA,\n\t\t{ existingConnection: globalConnection }\n\t);\n\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 * from './card.model';\nexport * from './providers/areeba-card.model';\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';\nexport * from './role.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 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 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 './providers/custom-coupon.model';\nexport * from './providers/global-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 FaqModel: ReturnModelType<typeof Faq> = getModelForClass(Faq);\nexport * from './faq.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 GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.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 LoyaltyPointCategoryModel: ReturnModelType<typeof LoyaltyPointCategory> =\n\tgetModelForClass(LoyaltyPointCategory);\nexport * from './loyalty-point-category.model';\n\nexport const LoyaltyPointSettingModel: ReturnModelType<typeof LoyaltyPointSetting> =\n\tgetModelForClass(LoyaltyPointSetting);\nexport * from './loyalty-point-setting.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 LoyaltyPointMarketingModel: ReturnModelType<typeof LoyaltyPointMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, LoyaltyPointMarketing, MarketingType.LOYALTY_POINT);\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/loyalty-point-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 OrderDeliveryModel: ReturnModelType<typeof OrderDelivery> = getModelForClass(OrderDelivery);\nexport * from './order-delivery.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 ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.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 RiderReviewModel: ReturnModelType<typeof RiderReview> = getModelForClass(RiderReview);\nexport * from './rider-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 ShopReviewModel: ReturnModelType<typeof ShopReview> = getModelForClass(ShopReview);\nexport * from './shop-review.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.model';\n\nexport const SubscriptionSettingModel: ReturnModelType<typeof SubscriptionSetting> =\n\tgetModelForClass(SubscriptionSetting);\nexport * from './subscription-setting.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 ServiceParentModel: ReturnModelType<typeof ServiceParent> = getModelForClass(ServiceParent);\nexport * from './service-parent.model';\n\nexport const VendorModel: ReturnModelType<typeof Vendor> = getModelForClass(Vendor);\nexport * from './vendor.model';\n\nexport const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl> = getModelForClass(VendorAccessControl);\nexport * from './vendor-access-control.model';\n\nexport const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory> = getModelForClass(ServiceCategory);\nexport * from './service-category.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> = getModelForClass(ServiceLineItem);\nexport * from './service-line-item.model';\n\n\nexport const ServiceOrderModel: ReturnModelType<typeof ServiceOrder> = getModelForClass(ServiceOrder)\nexport * from './service-order.model'\n\nexport const ProfessionalReviewModel: ReturnModelType<typeof ProfessionalReview> = getModelForClass(ProfessionalReview)\nexport * from './professional-review.model'\n\nexport const ProfessionalScheduleModel: ReturnModelType<typeof ProfessionalSchedule> = getModelForClass(ProfessionalSchedule)\nexport * from './professional-schedule'\n\nexport const TicketActionModel: ReturnModelType<typeof TicketAction> = getModelForClass(TicketAction);\nexport * from './ticket-action.model';\n\nexport const VendorSettingsModel: ReturnModelType<typeof VendorSettings> = getModelForClass(VendorSettings)\nexport * from './vendor-settings.model'\n\nexport const ServicePromotionModel: ReturnModelType<typeof ServicePromotion> = getModelForClass(ServicePromotion);\nexport * from './service-promotion.model';"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA4JA,oCAGC;AAED,gDAGC;AAED,4DAGC;AAED,sEAGC;AAED,sEAGC;AAED,wEAGC;AAED,sEAGC;AAED,4CAGC;AAED,oCAGC;AAGD,wDA8CC;AAxPD,uEAA4D;AAC5D,uEAA6D;AAC7D,qEAA2D;AAC3D,oDAAwG;AACxG,+CAAsC;AACtC,6EAAkE;AAClE,6DAAmD;AACnD,qFAAyE;AACzE,uDAA8C;AAC9C,iDAAwC;AACxC,2DAAiD;AACjD,+CAAsC;AACtC,qDAA4C;AAC5C,mDAA0C;AAC1C,iDAAwC;AACxC,6DAAmD;AACnD,6CAAoC;AACpC,2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iB,GAAyC,IAAA,4BAAgB,EAAC,kCAAY,CAAC,CAAA;AACrG,wDAAqC;AAExB,QAAA,uBAAuB,GAA+C,IAAA,4BAAgB,EAAC,8CAAkB,CAAC,CAAA;AACvH,8DAA2C;AAE9B,QAAA,yBAAyB,GAAiD,IAAA,4BAAgB,EAAC,4CAAoB,CAAC,CAAA;AAC7H,0DAAuC;AAE1B,QAAA,iBAAiB,GAAyC,IAAA,4BAAgB,EAAC,kCAAY,CAAC,CAAC;AACtG,wDAAsC;AAEzB,QAAA,mBAAmB,GAA2C,IAAA,4BAAgB,EAAC,sCAAc,CAAC,CAAA;AAC3G,0DAAuC;AAE1B,QAAA,qBAAqB,GAA6C,IAAA,4BAAgB,EAAC,0CAAgB,CAAC,CAAC;AAClH,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 { 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 { Faq } from './faq.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 { LoyaltyPointCategory } from './loyalty-point-category.model';\nimport { LoyaltyPointSetting } from './loyalty-point-setting.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 { RiderReview } from './rider-review.model';\nimport { Role } from './role.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 { ShopReview } from './shop-review.model';\nimport { Shop } from './shop.model';\nimport { SubscriptionSetting } from './subscription-setting.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\tCardType,\n\tCoreAuthIdentityType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n} from '../../../utilities/enum';\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 { LoyaltyPointMarketing } from './providers/loyalty-point-marketing.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 { Card } from './card.model';\nimport { AreebaCard } from './providers/areeba-card.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 { OrderDelivery } from './order-delivery.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 { ProfessionalReview } from './professional-review.model';\nimport { ProfessionalSchedule } from './professional-schedule';\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 { VendorSettings } from './vendor-settings.model';\nimport { ServicePromotion } from './service-promotion.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\n// Global models - will be set after initGlobalConnection()\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualRoleModel: ReturnModelType<typeof Role> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\nlet actualAreebaCardModel: ReturnModelType<typeof AreebaCard> | null = null;\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 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 getAreebaCardModel(): ReturnModelType<typeof AreebaCard> {\n\tif (!actualAreebaCardModel) throw new Error('AreebaCard model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualAreebaCardModel;\n}\n\nexport function getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel) throw new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel) throw new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel) throw new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel) throw new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel) throw new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel) throw new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\nexport function getRoleModel(): ReturnModelType<typeof Role> {\n\tif (!actualRoleModel) throw new Error('Role model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualRoleModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualRoleModel = getModelForClass(Role, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\n\tactualAreebaCardModel = getDiscriminatorModelForClass(\n\t\tactualCardModel,\n\t\tAreebaCard,\n\t\tCardType.AREEEBA,\n\t\t{ existingConnection: globalConnection }\n\t);\n\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 * from './card.model';\nexport * from './providers/areeba-card.model';\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';\nexport * from './role.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 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 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 './providers/custom-coupon.model';\nexport * from './providers/global-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 FaqModel: ReturnModelType<typeof Faq> = getModelForClass(Faq);\nexport * from './faq.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 GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.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 LoyaltyPointCategoryModel: ReturnModelType<typeof LoyaltyPointCategory> =\n\tgetModelForClass(LoyaltyPointCategory);\nexport * from './loyalty-point-category.model';\n\nexport const LoyaltyPointSettingModel: ReturnModelType<typeof LoyaltyPointSetting> =\n\tgetModelForClass(LoyaltyPointSetting);\nexport * from './loyalty-point-setting.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 LoyaltyPointMarketingModel: ReturnModelType<typeof LoyaltyPointMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, LoyaltyPointMarketing, MarketingType.LOYALTY_POINT);\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/loyalty-point-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 OrderDeliveryModel: ReturnModelType<typeof OrderDelivery> = getModelForClass(OrderDelivery);\nexport * from './order-delivery.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 ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.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 RiderReviewModel: ReturnModelType<typeof RiderReview> = getModelForClass(RiderReview);\nexport * from './rider-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 ShopReviewModel: ReturnModelType<typeof ShopReview> = getModelForClass(ShopReview);\nexport * from './shop-review.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.model';\n\nexport const SubscriptionSettingModel: ReturnModelType<typeof SubscriptionSetting> =\n\tgetModelForClass(SubscriptionSetting);\nexport * from './subscription-setting.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> = getModelForClass(VendorAccessControl);\nexport * from './vendor-access-control.model';\n\nexport const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory> = getModelForClass(ServiceCategory);\nexport * from './service-category.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> = getModelForClass(ServiceLineItem);\nexport * from './service-line-item.model';\n\n\nexport const ServiceOrderModel: ReturnModelType<typeof ServiceOrder> = getModelForClass(ServiceOrder)\nexport * from './service-order.model'\n\nexport const ProfessionalReviewModel: ReturnModelType<typeof ProfessionalReview> = getModelForClass(ProfessionalReview)\nexport * from './professional-review.model'\n\nexport const ProfessionalScheduleModel: ReturnModelType<typeof ProfessionalSchedule> = getModelForClass(ProfessionalSchedule)\nexport * from './professional-schedule'\n\nexport const TicketActionModel: ReturnModelType<typeof TicketAction> = getModelForClass(TicketAction);\nexport * from './ticket-action.model';\n\nexport const VendorSettingsModel: ReturnModelType<typeof VendorSettings> = getModelForClass(VendorSettings)\nexport * from './vendor-settings.model'\n\nexport const ServicePromotionModel: ReturnModelType<typeof ServicePromotion> = getModelForClass(ServicePromotion);\nexport * from './service-promotion.model';"]}
|
|
@@ -31,7 +31,7 @@ export declare class User extends TimeStamps {
|
|
|
31
31
|
isPhoneVerified?: boolean;
|
|
32
32
|
onlineStatus?: OnlineStatus;
|
|
33
33
|
fcmTokens?: string[];
|
|
34
|
-
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject
|
|
34
|
+
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
|
|
35
35
|
_id: import("mongoose").Types.ObjectId;
|
|
36
36
|
} & {
|
|
37
37
|
__v: number;
|
|
@@ -2,12 +2,12 @@ import { Ref } from "@typegoose/typegoose";
|
|
|
2
2
|
import { TimeStamps } from "@typegoose/typegoose/lib/defaultClasses";
|
|
3
3
|
import { Vendor } from "./vendor.model";
|
|
4
4
|
import { VendorRole } from "../../../utilities/enum";
|
|
5
|
-
import {
|
|
5
|
+
import { VendorParent } from "./vendor-parent.model";
|
|
6
6
|
export declare class VendorAccessControl extends TimeStamps {
|
|
7
7
|
name: string;
|
|
8
8
|
email: string;
|
|
9
9
|
password: string;
|
|
10
|
-
parent?: Ref<
|
|
10
|
+
parent?: Ref<VendorParent>;
|
|
11
11
|
vendors?: Ref<Vendor>[];
|
|
12
12
|
role: VendorRole;
|
|
13
13
|
}
|
|
@@ -15,7 +15,7 @@ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
|
15
15
|
const vendor_model_1 = require("./vendor.model");
|
|
16
16
|
const enum_1 = require("../../../utilities/enum");
|
|
17
17
|
const password_1 = require("../../../utilities/password");
|
|
18
|
-
const
|
|
18
|
+
const vendor_parent_model_1 = require("./vendor-parent.model");
|
|
19
19
|
let VendorAccessControl = class VendorAccessControl extends defaultClasses_1.TimeStamps {
|
|
20
20
|
name;
|
|
21
21
|
email;
|
|
@@ -38,7 +38,7 @@ __decorate([
|
|
|
38
38
|
__metadata("design:type", String)
|
|
39
39
|
], VendorAccessControl.prototype, "password", void 0);
|
|
40
40
|
__decorate([
|
|
41
|
-
(0, typegoose_1.prop)({ required: true, ref: () =>
|
|
41
|
+
(0, typegoose_1.prop)({ required: true, ref: () => vendor_parent_model_1.VendorParent }),
|
|
42
42
|
__metadata("design:type", Object)
|
|
43
43
|
], VendorAccessControl.prototype, "parent", void 0);
|
|
44
44
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,iDAAwC;AACxC,kDAAqD;AACrD,0DAA2D;AAE3D
|
|
1
|
+
{"version":3,"file":"vendor-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,iDAAwC;AACxC,kDAAqD;AACrD,0DAA2D;AAE3D,+DAAqD;AAkB9C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,2BAAU;IAExC,IAAI,CAAS;IAGb,KAAK,CAAS;IAGd,QAAQ,CAAS;IAGjB,MAAM,CAAoB;IAG1B,OAAO,CAAgB;IAGvB,IAAI,CAAa;CAC3B,CAAA;AAlBY,kDAAmB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAC,CAAC;;iDACjC;AAGb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAA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AAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAC,CAAC;IAClF,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,sBAAsB,EAAC,EAAC,CAAC;GACzD,mBAAmB,CAkB/B","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from \"@typegoose/typegoose\";\nimport { TimeStamps } from \"@typegoose/typegoose/lib/defaultClasses\";\nimport { Vendor } from \"./vendor.model\";\nimport { VendorRole } from \"../../../utilities/enum\";\nimport { hashPassword } from \"../../../utilities/password\";\nimport { Query } from \"mongoose\";\nimport { VendorParent } from \"./vendor-parent.model\";\n\n@pre<VendorAccessControl>('save', async function (next) {\n if (this.isModified('password')) {\n this.password = await hashPassword(this.password)\n }\n next()\n})\n@pre<Query<any, VendorAccessControl>>('findOneAndUpdate', async function (next) {\n const update = this.getUpdate() as Record<string, any>\n if(update?.password) {\n update.password = await hashPassword(update.password)\n this.setUpdate(update)\n }\n next()\n})\n@index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null }})\n@modelOptions({ schemaOptions: { collection: 'vendorAccessControls'}})\nexport class VendorAccessControl extends TimeStamps {\n @prop({ required: true, type: String, maxlength: 50})\n public name!: string\n\n @prop({ required: true, type: String })\n public email!: string\n\n @prop({ required: true, type: String, minlength: 8 })\n public password!: string\n\n @prop({ required: true, ref: () => VendorParent })\n public parent?: Ref<VendorParent>\n\n @prop({ ref: () => Vendor, default: []})\n public vendors?: Ref<Vendor>[]\n\n @prop({ required: true, type: String, enum: VendorRole }) \n public role!: VendorRole\n}"]}
|
|
@@ -6,7 +6,7 @@ import { Charge } from './embedded/charge.model';
|
|
|
6
6
|
import { ParentDocument } from './embedded/parent-document.model';
|
|
7
7
|
import { Address } from './shared/address.model';
|
|
8
8
|
import { Duration } from './shared/duration.model';
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class VendorParent extends TimeStamps {
|
|
10
10
|
name: string;
|
|
11
11
|
email: string;
|
|
12
12
|
phoneNumber: string;
|