@managesome/knotr-toolkit 0.8.26 → 0.8.28
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/backend/config.d.ts.map +1 -1
- package/dist/backend/config.js +9 -1
- package/dist/backend/config.js.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/pagination.d.ts +50 -0
- package/dist/helpers/pagination.d.ts.map +1 -0
- package/dist/helpers/pagination.js +56 -0
- package/dist/helpers/pagination.js.map +1 -0
- package/dist/schemas/account.schema.d.ts +82 -12
- package/dist/schemas/account.schema.d.ts.map +1 -1
- package/dist/schemas/account.schema.js +1 -0
- package/dist/schemas/account.schema.js.map +1 -1
- package/dist/schemas/audit-log.schema.d.ts +4170 -0
- package/dist/schemas/audit-log.schema.d.ts.map +1 -0
- package/dist/schemas/audit-log.schema.js +39 -0
- package/dist/schemas/audit-log.schema.js.map +1 -0
- package/dist/schemas/company.schema.d.ts +142 -12
- package/dist/schemas/company.schema.d.ts.map +1 -1
- package/dist/schemas/company.schema.js +3 -0
- package/dist/schemas/company.schema.js.map +1 -1
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/policy.schema.d.ts +5520 -0
- package/dist/schemas/policy.schema.d.ts.map +1 -0
- package/dist/schemas/policy.schema.js +32 -0
- package/dist/schemas/policy.schema.js.map +1 -0
- package/dist/schemas/promo-code.schema.d.ts +52 -52
- package/dist/schemas/tenant.schema.d.ts +4980 -0
- package/dist/schemas/tenant.schema.d.ts.map +1 -0
- package/dist/schemas/tenant.schema.js +132 -0
- package/dist/schemas/tenant.schema.js.map +1 -0
- package/dist/schemas/verification.schema.d.ts +64 -64
- package/dist/types/account.d.ts +1 -0
- package/dist/types/account.d.ts.map +1 -1
- package/dist/types/company.d.ts +2 -0
- package/dist/types/company.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/tenant.d.ts +128 -0
- package/dist/types/tenant.d.ts.map +1 -0
- package/dist/types/tenant.js +37 -0
- package/dist/types/tenant.js.map +1 -0
- package/dist/validation/schemas.d.ts +14 -14
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/backend/config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAE5B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IAGrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;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gB,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAM5G"}
|
package/dist/backend/config.js
CHANGED
|
@@ -25,7 +25,7 @@ export async function initConfig(serviceName) {
|
|
|
25
25
|
firebaseDatabaseUrl: process.env.FIREBASE_DATABASE_URL,
|
|
26
26
|
firebaseStorageBucket: process.env.FIREBASE_STORAGE_BUCKET,
|
|
27
27
|
// JWT
|
|
28
|
-
jwtSecret: process.env.JWT_SECRET || '
|
|
28
|
+
jwtSecret: process.env.JWT_SECRET || '',
|
|
29
29
|
jwtExpiresIn: process.env.JWT_EXPIRES_IN || '7d',
|
|
30
30
|
// API URLs
|
|
31
31
|
mainServiceUrl: process.env.MAIN_SERVICE_URL,
|
|
@@ -51,6 +51,14 @@ export async function initConfig(serviceName) {
|
|
|
51
51
|
config[configKey] = process.env[key];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
if (config) {
|
|
55
|
+
if (!config.jwtSecret) {
|
|
56
|
+
if (config.nodeEnv === 'production') {
|
|
57
|
+
throw new Error('JWT_SECRET is required in production');
|
|
58
|
+
}
|
|
59
|
+
config.jwtSecret = 'development-secret-change-in-production';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
/**
|
|
56
64
|
* Get the current configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/backend/config.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,2BAA2B;AAC3B,qDAAqD;AACrD,+CAA+C;AA6C/C,yBAAyB;AACzB,IAAI,MAAM,GAAyB,IAAI,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,WAAmB;IAClD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;IAEtD,MAA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ED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,0BAA0B;AAC1B,+CAA+C;AAE/C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,0BAA0B;AAC1B,+CAA+C;AAE/C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { IPaginatedResponse, IPagination } from '../types/common.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pagination query params (from URL query string)
|
|
4
|
+
*/
|
|
5
|
+
export interface PaginationParams {
|
|
6
|
+
page?: number | string;
|
|
7
|
+
limit?: number | string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Default pagination values
|
|
11
|
+
*/
|
|
12
|
+
export declare const PAGINATION_DEFAULTS: {
|
|
13
|
+
readonly page: 1;
|
|
14
|
+
readonly limit: 20;
|
|
15
|
+
readonly maxLimit: 100;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Parse and validate pagination params from query
|
|
19
|
+
*/
|
|
20
|
+
export declare function parsePagination(params: PaginationParams): {
|
|
21
|
+
page: number;
|
|
22
|
+
limit: number;
|
|
23
|
+
skip: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Build pagination metadata from query results
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildPaginationMeta(total: number, page: number, limit: number): IPagination;
|
|
29
|
+
/**
|
|
30
|
+
* Build a standardized paginated response
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildPaginatedResponse<T>(data: T[], total: number, page: number, limit: number): IPaginatedResponse<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Full paginated API response with success flag
|
|
35
|
+
*/
|
|
36
|
+
export interface PaginatedApiResponse<T> {
|
|
37
|
+
success: true;
|
|
38
|
+
data: T[];
|
|
39
|
+
total: number;
|
|
40
|
+
page: number;
|
|
41
|
+
limit: number;
|
|
42
|
+
totalPages: number;
|
|
43
|
+
hasNext: boolean;
|
|
44
|
+
hasPrev: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Build a paginated API response ready to send
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildPaginatedApiResponse<T>(data: T[], total: number, page: number, limit: number): PaginatedApiResponse<T>;
|
|
50
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/helpers/pagination.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAOvG;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAW3F;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,IAAI,EAAE,CAAC,EAAE,EACT,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,kBAAkB,CAAC,CAAC,CAAC,CAOvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,IAAI,EAAE,CAAC,EAAE,EACT,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAAC,CAAC,CAAC,CAKzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// Pagination Helpers
|
|
3
|
+
// Standardized pagination utilities
|
|
4
|
+
// ============================================
|
|
5
|
+
/**
|
|
6
|
+
* Default pagination values
|
|
7
|
+
*/
|
|
8
|
+
export const PAGINATION_DEFAULTS = {
|
|
9
|
+
page: 1,
|
|
10
|
+
limit: 20,
|
|
11
|
+
maxLimit: 100,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Parse and validate pagination params from query
|
|
15
|
+
*/
|
|
16
|
+
export function parsePagination(params) {
|
|
17
|
+
const page = Math.max(1, Number(params.page) || PAGINATION_DEFAULTS.page);
|
|
18
|
+
const rawLimit = Number(params.limit) || PAGINATION_DEFAULTS.limit;
|
|
19
|
+
const limit = Math.min(Math.max(1, rawLimit), PAGINATION_DEFAULTS.maxLimit);
|
|
20
|
+
const skip = (page - 1) * limit;
|
|
21
|
+
return { page, limit, skip };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build pagination metadata from query results
|
|
25
|
+
*/
|
|
26
|
+
export function buildPaginationMeta(total, page, limit) {
|
|
27
|
+
const totalPages = Math.ceil(total / limit);
|
|
28
|
+
return {
|
|
29
|
+
total,
|
|
30
|
+
page,
|
|
31
|
+
limit,
|
|
32
|
+
totalPages,
|
|
33
|
+
hasNext: page < totalPages,
|
|
34
|
+
hasPrev: page > 1,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build a standardized paginated response
|
|
39
|
+
*/
|
|
40
|
+
export function buildPaginatedResponse(data, total, page, limit) {
|
|
41
|
+
const meta = buildPaginationMeta(total, page, limit);
|
|
42
|
+
return {
|
|
43
|
+
data,
|
|
44
|
+
...meta,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build a paginated API response ready to send
|
|
49
|
+
*/
|
|
50
|
+
export function buildPaginatedApiResponse(data, total, page, limit) {
|
|
51
|
+
return {
|
|
52
|
+
success: true,
|
|
53
|
+
...buildPaginatedResponse(data, total, page, limit),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAI,GAAG,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAErD,OAAO;QACL,IAAI;QACJ,GAAG,IAAI;KACR,CAAC;AACJ,CAAC;AAgBD;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,IAAS,EACT,KAAa,EACb,IAAY,EACZ,KAAa;IAEb,OAAO;QACL,OAAO,EAAE,IAAI;QACb,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;KACpD,CAAC;AACJ,CAAC"}
|
|
@@ -100,6 +100,11 @@ export declare const AccountSchemaDefinition: {
|
|
|
100
100
|
readonly ref: "Subscription";
|
|
101
101
|
readonly sparse: true;
|
|
102
102
|
};
|
|
103
|
+
readonly stripeCustomerId: {
|
|
104
|
+
readonly type: StringConstructor;
|
|
105
|
+
readonly index: true;
|
|
106
|
+
readonly sparse: true;
|
|
107
|
+
};
|
|
103
108
|
readonly trialEndsAt: {
|
|
104
109
|
readonly type: DateConstructor;
|
|
105
110
|
};
|
|
@@ -1217,7 +1222,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1217
1222
|
id: string;
|
|
1218
1223
|
}> | undefined;
|
|
1219
1224
|
get?: import("mongoose").SchemaDefinitionProperty<{
|
|
1220
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, type?: any, options?: any): (Omit<IAccount, "id"> & {
|
|
1225
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, type?: any, options?: any): (Omit<IAccount, "id"> & {
|
|
1221
1226
|
_id: string;
|
|
1222
1227
|
})[T];
|
|
1223
1228
|
(path: string, type?: any, options?: any): any;
|
|
@@ -1376,7 +1381,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1376
1381
|
id: string;
|
|
1377
1382
|
}> | undefined;
|
|
1378
1383
|
invalidate?: import("mongoose").SchemaDefinitionProperty<{
|
|
1379
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null;
|
|
1384
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null;
|
|
1380
1385
|
(path: string, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null;
|
|
1381
1386
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
1382
1387
|
_id: string;
|
|
@@ -1410,7 +1415,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1410
1415
|
id: string;
|
|
1411
1416
|
}> | undefined;
|
|
1412
1417
|
isDirectModified?: import("mongoose").SchemaDefinitionProperty<{
|
|
1413
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T | T[]): boolean;
|
|
1418
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T | T[]): boolean;
|
|
1414
1419
|
(path: string | Array<string>): boolean;
|
|
1415
1420
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
1416
1421
|
_id: string;
|
|
@@ -1444,7 +1449,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1444
1449
|
id: string;
|
|
1445
1450
|
}> | undefined;
|
|
1446
1451
|
isDirectSelected?: import("mongoose").SchemaDefinitionProperty<{
|
|
1447
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): boolean;
|
|
1452
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): boolean;
|
|
1448
1453
|
(path: string): boolean;
|
|
1449
1454
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
1450
1455
|
_id: string;
|
|
@@ -1478,7 +1483,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1478
1483
|
id: string;
|
|
1479
1484
|
}> | undefined;
|
|
1480
1485
|
isInit?: import("mongoose").SchemaDefinitionProperty<{
|
|
1481
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): boolean;
|
|
1486
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): boolean;
|
|
1482
1487
|
(path: string): boolean;
|
|
1483
1488
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
1484
1489
|
_id: string;
|
|
@@ -1512,7 +1517,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1512
1517
|
id: string;
|
|
1513
1518
|
}> | undefined;
|
|
1514
1519
|
isModified?: import("mongoose").SchemaDefinitionProperty<{
|
|
1515
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path?: T | T[] | undefined, options?: {
|
|
1520
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path?: T | T[] | undefined, options?: {
|
|
1516
1521
|
ignoreAtomics?: boolean;
|
|
1517
1522
|
} | null): boolean;
|
|
1518
1523
|
(path?: string | Array<string>, options?: {
|
|
@@ -1581,7 +1586,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1581
1586
|
id: string;
|
|
1582
1587
|
}> | undefined;
|
|
1583
1588
|
isSelected?: import("mongoose").SchemaDefinitionProperty<{
|
|
1584
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): boolean;
|
|
1589
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): boolean;
|
|
1585
1590
|
(path: string): boolean;
|
|
1586
1591
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
1587
1592
|
_id: string;
|
|
@@ -1615,7 +1620,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
1615
1620
|
id: string;
|
|
1616
1621
|
}> | undefined;
|
|
1617
1622
|
markModified?: import("mongoose").SchemaDefinitionProperty<{
|
|
1618
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, scope?: any): void;
|
|
1623
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, scope?: any): void;
|
|
1619
1624
|
(path: string, scope?: any): void;
|
|
1620
1625
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
1621
1626
|
_id: string;
|
|
@@ -2054,7 +2059,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2054
2059
|
id: string;
|
|
2055
2060
|
}> | undefined;
|
|
2056
2061
|
set?: import("mongoose").SchemaDefinitionProperty<{
|
|
2057
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, val: (Omit<IAccount, "id"> & {
|
|
2062
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T, val: (Omit<IAccount, "id"> & {
|
|
2058
2063
|
_id: string;
|
|
2059
2064
|
})[T], type: any, options?: import("mongoose").DocumentSetOptions): import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
2060
2065
|
_id: string;
|
|
@@ -2167,6 +2172,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2167
2172
|
role?: string | undefined;
|
|
2168
2173
|
tenantId?: string | undefined;
|
|
2169
2174
|
subscriptionId?: string | undefined;
|
|
2175
|
+
stripeCustomerId?: string | undefined;
|
|
2170
2176
|
createdAt: Date;
|
|
2171
2177
|
firebaseUid: string;
|
|
2172
2178
|
emailVerified: boolean;
|
|
@@ -2222,6 +2228,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2222
2228
|
role?: string | undefined;
|
|
2223
2229
|
tenantId?: string | undefined;
|
|
2224
2230
|
subscriptionId?: string | undefined;
|
|
2231
|
+
stripeCustomerId?: string | undefined;
|
|
2225
2232
|
createdAt: Date;
|
|
2226
2233
|
firebaseUid: string;
|
|
2227
2234
|
emailVerified: boolean;
|
|
@@ -2297,6 +2304,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2297
2304
|
role?: string | undefined;
|
|
2298
2305
|
tenantId?: string | undefined;
|
|
2299
2306
|
subscriptionId?: string | undefined;
|
|
2307
|
+
stripeCustomerId?: string | undefined;
|
|
2300
2308
|
createdAt: Date;
|
|
2301
2309
|
firebaseUid: string;
|
|
2302
2310
|
emailVerified: boolean;
|
|
@@ -2352,6 +2360,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2352
2360
|
role?: string | undefined;
|
|
2353
2361
|
tenantId?: string | undefined;
|
|
2354
2362
|
subscriptionId?: string | undefined;
|
|
2363
|
+
stripeCustomerId?: string | undefined;
|
|
2355
2364
|
createdAt: Date;
|
|
2356
2365
|
firebaseUid: string;
|
|
2357
2366
|
emailVerified: boolean;
|
|
@@ -2427,6 +2436,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2427
2436
|
role?: string | undefined;
|
|
2428
2437
|
tenantId?: string | undefined;
|
|
2429
2438
|
subscriptionId?: string | undefined;
|
|
2439
|
+
stripeCustomerId?: string | undefined;
|
|
2430
2440
|
createdAt: Date;
|
|
2431
2441
|
firebaseUid: string;
|
|
2432
2442
|
emailVerified: boolean;
|
|
@@ -2482,6 +2492,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2482
2492
|
role?: string | undefined;
|
|
2483
2493
|
tenantId?: string | undefined;
|
|
2484
2494
|
subscriptionId?: string | undefined;
|
|
2495
|
+
stripeCustomerId?: string | undefined;
|
|
2485
2496
|
createdAt: Date;
|
|
2486
2497
|
firebaseUid: string;
|
|
2487
2498
|
emailVerified: boolean;
|
|
@@ -2557,6 +2568,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2557
2568
|
role?: string | undefined;
|
|
2558
2569
|
tenantId?: string | undefined;
|
|
2559
2570
|
subscriptionId?: string | undefined;
|
|
2571
|
+
stripeCustomerId?: string | undefined;
|
|
2560
2572
|
createdAt: Date;
|
|
2561
2573
|
firebaseUid: string;
|
|
2562
2574
|
emailVerified: boolean;
|
|
@@ -2612,6 +2624,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2612
2624
|
role?: string | undefined;
|
|
2613
2625
|
tenantId?: string | undefined;
|
|
2614
2626
|
subscriptionId?: string | undefined;
|
|
2627
|
+
stripeCustomerId?: string | undefined;
|
|
2615
2628
|
createdAt: Date;
|
|
2616
2629
|
firebaseUid: string;
|
|
2617
2630
|
emailVerified: boolean;
|
|
@@ -2686,6 +2699,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2686
2699
|
role?: string | undefined;
|
|
2687
2700
|
tenantId?: string | undefined;
|
|
2688
2701
|
subscriptionId?: string | undefined;
|
|
2702
|
+
stripeCustomerId?: string | undefined;
|
|
2689
2703
|
createdAt: Date;
|
|
2690
2704
|
firebaseUid: string;
|
|
2691
2705
|
emailVerified: boolean;
|
|
@@ -2740,6 +2754,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2740
2754
|
role?: string | undefined;
|
|
2741
2755
|
tenantId?: string | undefined;
|
|
2742
2756
|
subscriptionId?: string | undefined;
|
|
2757
|
+
stripeCustomerId?: string | undefined;
|
|
2743
2758
|
createdAt: Date;
|
|
2744
2759
|
firebaseUid: string;
|
|
2745
2760
|
emailVerified: boolean;
|
|
@@ -2794,6 +2809,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2794
2809
|
role?: string | undefined;
|
|
2795
2810
|
tenantId?: string | undefined;
|
|
2796
2811
|
subscriptionId?: string | undefined;
|
|
2812
|
+
stripeCustomerId?: string | undefined;
|
|
2797
2813
|
createdAt: Date;
|
|
2798
2814
|
firebaseUid: string;
|
|
2799
2815
|
emailVerified: boolean;
|
|
@@ -2847,6 +2863,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2847
2863
|
role?: string | undefined;
|
|
2848
2864
|
tenantId?: string | undefined;
|
|
2849
2865
|
subscriptionId?: string | undefined;
|
|
2866
|
+
stripeCustomerId?: string | undefined;
|
|
2850
2867
|
createdAt: Date;
|
|
2851
2868
|
firebaseUid: string;
|
|
2852
2869
|
emailVerified: boolean;
|
|
@@ -2918,6 +2935,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2918
2935
|
role?: string | undefined;
|
|
2919
2936
|
tenantId?: string | undefined;
|
|
2920
2937
|
subscriptionId?: string | undefined;
|
|
2938
|
+
stripeCustomerId?: string | undefined;
|
|
2921
2939
|
createdAt: Date;
|
|
2922
2940
|
firebaseUid: string;
|
|
2923
2941
|
emailVerified: boolean;
|
|
@@ -2974,6 +2992,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
2974
2992
|
role?: string | undefined;
|
|
2975
2993
|
tenantId?: string | undefined;
|
|
2976
2994
|
subscriptionId?: string | undefined;
|
|
2995
|
+
stripeCustomerId?: string | undefined;
|
|
2977
2996
|
createdAt: Date;
|
|
2978
2997
|
firebaseUid: string;
|
|
2979
2998
|
emailVerified: boolean;
|
|
@@ -3038,6 +3057,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3038
3057
|
role?: string | undefined;
|
|
3039
3058
|
tenantId?: string | undefined;
|
|
3040
3059
|
subscriptionId?: string | undefined;
|
|
3060
|
+
stripeCustomerId?: string | undefined;
|
|
3041
3061
|
createdAt: Date;
|
|
3042
3062
|
firebaseUid: string;
|
|
3043
3063
|
emailVerified: boolean;
|
|
@@ -3101,6 +3121,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3101
3121
|
role?: string | undefined;
|
|
3102
3122
|
tenantId?: string | undefined;
|
|
3103
3123
|
subscriptionId?: string | undefined;
|
|
3124
|
+
stripeCustomerId?: string | undefined;
|
|
3104
3125
|
createdAt: Date;
|
|
3105
3126
|
firebaseUid: string;
|
|
3106
3127
|
emailVerified: boolean;
|
|
@@ -3155,6 +3176,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3155
3176
|
role?: string | undefined;
|
|
3156
3177
|
tenantId?: string | undefined;
|
|
3157
3178
|
subscriptionId?: string | undefined;
|
|
3179
|
+
stripeCustomerId?: string | undefined;
|
|
3158
3180
|
createdAt: Date;
|
|
3159
3181
|
firebaseUid: string;
|
|
3160
3182
|
emailVerified: boolean;
|
|
@@ -3275,6 +3297,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3275
3297
|
role?: string | undefined;
|
|
3276
3298
|
tenantId?: string | undefined;
|
|
3277
3299
|
subscriptionId?: string | undefined;
|
|
3300
|
+
stripeCustomerId?: string | undefined;
|
|
3278
3301
|
createdAt: Date;
|
|
3279
3302
|
firebaseUid: string;
|
|
3280
3303
|
emailVerified: boolean;
|
|
@@ -3330,6 +3353,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3330
3353
|
role?: string | undefined;
|
|
3331
3354
|
tenantId?: string | undefined;
|
|
3332
3355
|
subscriptionId?: string | undefined;
|
|
3356
|
+
stripeCustomerId?: string | undefined;
|
|
3333
3357
|
createdAt: Date;
|
|
3334
3358
|
firebaseUid: string;
|
|
3335
3359
|
emailVerified: boolean;
|
|
@@ -3405,6 +3429,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3405
3429
|
role?: string | undefined;
|
|
3406
3430
|
tenantId?: string | undefined;
|
|
3407
3431
|
subscriptionId?: string | undefined;
|
|
3432
|
+
stripeCustomerId?: string | undefined;
|
|
3408
3433
|
createdAt: Date;
|
|
3409
3434
|
firebaseUid: string;
|
|
3410
3435
|
emailVerified: boolean;
|
|
@@ -3460,6 +3485,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3460
3485
|
role?: string | undefined;
|
|
3461
3486
|
tenantId?: string | undefined;
|
|
3462
3487
|
subscriptionId?: string | undefined;
|
|
3488
|
+
stripeCustomerId?: string | undefined;
|
|
3463
3489
|
createdAt: Date;
|
|
3464
3490
|
firebaseUid: string;
|
|
3465
3491
|
emailVerified: boolean;
|
|
@@ -3535,6 +3561,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3535
3561
|
role?: string | undefined;
|
|
3536
3562
|
tenantId?: string | undefined;
|
|
3537
3563
|
subscriptionId?: string | undefined;
|
|
3564
|
+
stripeCustomerId?: string | undefined;
|
|
3538
3565
|
createdAt: Date;
|
|
3539
3566
|
firebaseUid: string;
|
|
3540
3567
|
emailVerified: boolean;
|
|
@@ -3590,6 +3617,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3590
3617
|
role?: string | undefined;
|
|
3591
3618
|
tenantId?: string | undefined;
|
|
3592
3619
|
subscriptionId?: string | undefined;
|
|
3620
|
+
stripeCustomerId?: string | undefined;
|
|
3593
3621
|
createdAt: Date;
|
|
3594
3622
|
firebaseUid: string;
|
|
3595
3623
|
emailVerified: boolean;
|
|
@@ -3665,6 +3693,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3665
3693
|
role?: string | undefined;
|
|
3666
3694
|
tenantId?: string | undefined;
|
|
3667
3695
|
subscriptionId?: string | undefined;
|
|
3696
|
+
stripeCustomerId?: string | undefined;
|
|
3668
3697
|
createdAt: Date;
|
|
3669
3698
|
firebaseUid: string;
|
|
3670
3699
|
emailVerified: boolean;
|
|
@@ -3720,6 +3749,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3720
3749
|
role?: string | undefined;
|
|
3721
3750
|
tenantId?: string | undefined;
|
|
3722
3751
|
subscriptionId?: string | undefined;
|
|
3752
|
+
stripeCustomerId?: string | undefined;
|
|
3723
3753
|
createdAt: Date;
|
|
3724
3754
|
firebaseUid: string;
|
|
3725
3755
|
emailVerified: boolean;
|
|
@@ -3794,6 +3824,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3794
3824
|
role?: string | undefined;
|
|
3795
3825
|
tenantId?: string | undefined;
|
|
3796
3826
|
subscriptionId?: string | undefined;
|
|
3827
|
+
stripeCustomerId?: string | undefined;
|
|
3797
3828
|
createdAt: Date;
|
|
3798
3829
|
firebaseUid: string;
|
|
3799
3830
|
emailVerified: boolean;
|
|
@@ -3848,6 +3879,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3848
3879
|
role?: string | undefined;
|
|
3849
3880
|
tenantId?: string | undefined;
|
|
3850
3881
|
subscriptionId?: string | undefined;
|
|
3882
|
+
stripeCustomerId?: string | undefined;
|
|
3851
3883
|
createdAt: Date;
|
|
3852
3884
|
firebaseUid: string;
|
|
3853
3885
|
emailVerified: boolean;
|
|
@@ -3902,6 +3934,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3902
3934
|
role?: string | undefined;
|
|
3903
3935
|
tenantId?: string | undefined;
|
|
3904
3936
|
subscriptionId?: string | undefined;
|
|
3937
|
+
stripeCustomerId?: string | undefined;
|
|
3905
3938
|
createdAt: Date;
|
|
3906
3939
|
firebaseUid: string;
|
|
3907
3940
|
emailVerified: boolean;
|
|
@@ -3955,6 +3988,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
3955
3988
|
role?: string | undefined;
|
|
3956
3989
|
tenantId?: string | undefined;
|
|
3957
3990
|
subscriptionId?: string | undefined;
|
|
3991
|
+
stripeCustomerId?: string | undefined;
|
|
3958
3992
|
createdAt: Date;
|
|
3959
3993
|
firebaseUid: string;
|
|
3960
3994
|
emailVerified: boolean;
|
|
@@ -4026,6 +4060,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4026
4060
|
role?: string | undefined;
|
|
4027
4061
|
tenantId?: string | undefined;
|
|
4028
4062
|
subscriptionId?: string | undefined;
|
|
4063
|
+
stripeCustomerId?: string | undefined;
|
|
4029
4064
|
createdAt: Date;
|
|
4030
4065
|
firebaseUid: string;
|
|
4031
4066
|
emailVerified: boolean;
|
|
@@ -4082,6 +4117,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4082
4117
|
role?: string | undefined;
|
|
4083
4118
|
tenantId?: string | undefined;
|
|
4084
4119
|
subscriptionId?: string | undefined;
|
|
4120
|
+
stripeCustomerId?: string | undefined;
|
|
4085
4121
|
createdAt: Date;
|
|
4086
4122
|
firebaseUid: string;
|
|
4087
4123
|
emailVerified: boolean;
|
|
@@ -4146,6 +4182,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4146
4182
|
role?: string | undefined;
|
|
4147
4183
|
tenantId?: string | undefined;
|
|
4148
4184
|
subscriptionId?: string | undefined;
|
|
4185
|
+
stripeCustomerId?: string | undefined;
|
|
4149
4186
|
createdAt: Date;
|
|
4150
4187
|
firebaseUid: string;
|
|
4151
4188
|
emailVerified: boolean;
|
|
@@ -4209,6 +4246,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4209
4246
|
role?: string | undefined;
|
|
4210
4247
|
tenantId?: string | undefined;
|
|
4211
4248
|
subscriptionId?: string | undefined;
|
|
4249
|
+
stripeCustomerId?: string | undefined;
|
|
4212
4250
|
createdAt: Date;
|
|
4213
4251
|
firebaseUid: string;
|
|
4214
4252
|
emailVerified: boolean;
|
|
@@ -4263,6 +4301,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4263
4301
|
role?: string | undefined;
|
|
4264
4302
|
tenantId?: string | undefined;
|
|
4265
4303
|
subscriptionId?: string | undefined;
|
|
4304
|
+
stripeCustomerId?: string | undefined;
|
|
4266
4305
|
createdAt: Date;
|
|
4267
4306
|
firebaseUid: string;
|
|
4268
4307
|
emailVerified: boolean;
|
|
@@ -4348,7 +4387,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4348
4387
|
id: string;
|
|
4349
4388
|
}> | undefined;
|
|
4350
4389
|
unmarkModified?: import("mongoose").SchemaDefinitionProperty<{
|
|
4351
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): void;
|
|
4390
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(path: T): void;
|
|
4352
4391
|
(path: string): void;
|
|
4353
4392
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
4354
4393
|
_id: string;
|
|
@@ -4433,7 +4472,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4433
4472
|
id: string;
|
|
4434
4473
|
}> | undefined;
|
|
4435
4474
|
validate?: import("mongoose").SchemaDefinitionProperty<{
|
|
4436
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(pathsToValidate?: T | T[] | undefined, options?: import("mongoose").AnyObject): Promise<void>;
|
|
4475
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(pathsToValidate?: T | T[] | undefined, options?: import("mongoose").AnyObject): Promise<void>;
|
|
4437
4476
|
(pathsToValidate?: import("mongoose").pathsToValidate, options?: import("mongoose").AnyObject): Promise<void>;
|
|
4438
4477
|
(options: {
|
|
4439
4478
|
pathsToSkip?: import("mongoose").pathsToSkip;
|
|
@@ -4474,7 +4513,7 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4474
4513
|
pathsToSkip?: import("mongoose").pathsToSkip;
|
|
4475
4514
|
[k: string]: any;
|
|
4476
4515
|
}): import("mongoose").Error.ValidationError | null;
|
|
4477
|
-
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(pathsToValidate?: T | T[] | undefined, options?: import("mongoose").AnyObject): import("mongoose").Error.ValidationError | null;
|
|
4516
|
+
<T extends "email" | "phone" | "status" | "settings" | "type" | "role" | "tenantId" | "subscriptionId" | "stripeCustomerId" | "createdAt" | "firebaseUid" | "emailVerified" | "phoneVerified" | "holderName" | "holderRelation" | "maxFreeProfiles" | "additionalProfilesPurchased" | "companyId" | "trialEndsAt" | "flagCount" | "preferredLanguage" | "notificationsEnabled" | "agreedToTermsAt" | "privacyConsentAt" | "dataStorageConsentAt" | "lastActiveAt" | "deviceTokens" | "updatedAt" | "_id">(pathsToValidate?: T | T[] | undefined, options?: import("mongoose").AnyObject): import("mongoose").Error.ValidationError | null;
|
|
4478
4517
|
(pathsToValidate?: import("mongoose").pathsToValidate, options?: import("mongoose").AnyObject): import("mongoose").Error.ValidationError | null;
|
|
4479
4518
|
}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
4480
4519
|
_id: string;
|
|
@@ -4755,6 +4794,37 @@ export declare const AccountSchema: Schema<import("mongoose").Document<unknown,
|
|
|
4755
4794
|
} & {
|
|
4756
4795
|
id: string;
|
|
4757
4796
|
}> | undefined;
|
|
4797
|
+
stripeCustomerId?: import("mongoose").SchemaDefinitionProperty<string | undefined, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
4798
|
+
_id: string;
|
|
4799
|
+
}, {}, import("mongoose").DefaultSchemaOptions> & Omit<IAccount, "id"> & {
|
|
4800
|
+
_id: string;
|
|
4801
|
+
} & Required<{
|
|
4802
|
+
_id: string;
|
|
4803
|
+
}> & {
|
|
4804
|
+
__v: number;
|
|
4805
|
+
} & {
|
|
4806
|
+
id: string;
|
|
4807
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
4808
|
+
_id: string;
|
|
4809
|
+
}, {}, import("mongoose").DefaultSchemaOptions> & Omit<IAccount, "id"> & {
|
|
4810
|
+
_id: string;
|
|
4811
|
+
} & Required<{
|
|
4812
|
+
_id: string;
|
|
4813
|
+
}> & {
|
|
4814
|
+
__v: number;
|
|
4815
|
+
} & {
|
|
4816
|
+
id: string;
|
|
4817
|
+
}, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
4818
|
+
_id: string;
|
|
4819
|
+
}, {}, import("mongoose").DefaultSchemaOptions> & Omit<IAccount, "id"> & {
|
|
4820
|
+
_id: string;
|
|
4821
|
+
} & Required<{
|
|
4822
|
+
_id: string;
|
|
4823
|
+
}> & {
|
|
4824
|
+
__v: number;
|
|
4825
|
+
} & {
|
|
4826
|
+
id: string;
|
|
4827
|
+
}> | undefined;
|
|
4758
4828
|
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, import("mongoose").Document<unknown, {}, Omit<IAccount, "id"> & {
|
|
4759
4829
|
_id: string;
|
|
4760
4830
|
}, {}, import("mongoose").DefaultSchemaOptions> & Omit<IAccount, "id"> & {
|