@cuencor/shared-constants 0.0.1
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/README.md +19 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/platform.d.ts +62 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +81 -0
- package/dist/platform.js.map +1 -0
- package/package.json +34 -0
- package/src/index.ts +2 -0
- package/src/platform.ts +95 -0
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @cuencor/shared-constants
|
|
2
|
+
|
|
3
|
+
NATS subjects, permissions and module IDs for Cuencor Platform
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @cuencor/shared-constants
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { ... } from '@cuencor/shared-constants';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## License
|
|
18
|
+
|
|
19
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// @cuencor/shared-constants � Platform constants
|
|
18
|
+
__exportStar(require("./platform"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAAiD;AACjD,6CAA2B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const PLATFORM_MODULE_IDS: {
|
|
2
|
+
readonly CORE: "com.finaxis.core";
|
|
3
|
+
};
|
|
4
|
+
export declare const PLATFORM_NATS_SUBJECTS: {
|
|
5
|
+
readonly PLATFORM: {
|
|
6
|
+
readonly MODULE_INSTALLED: "erp.platform.module.installed";
|
|
7
|
+
readonly MODULE_UNINSTALLED: "erp.platform.module.uninstalled";
|
|
8
|
+
};
|
|
9
|
+
readonly CORE: {
|
|
10
|
+
readonly USER_CREATED: "erp.core.users.created";
|
|
11
|
+
readonly USER_UPDATED: "erp.core.users.updated";
|
|
12
|
+
readonly USER_DEACTIVATED: "erp.core.users.deactivated";
|
|
13
|
+
readonly TENANT_CREATED: "erp.core.tenants.created";
|
|
14
|
+
readonly TENANT_SUSPENDED: "erp.core.tenants.suspended";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const PLATFORM_PERMISSIONS: {
|
|
18
|
+
readonly USERS_READ: "core:users:read";
|
|
19
|
+
readonly USERS_WRITE: "core:users:write";
|
|
20
|
+
readonly USERS_DELETE: "core:users:delete";
|
|
21
|
+
readonly TENANTS_MANAGE: "core:tenants:manage";
|
|
22
|
+
readonly MODULES_INSTALL: "core:modules:install";
|
|
23
|
+
readonly MODULES_UNINSTALL: "core:modules:uninstall";
|
|
24
|
+
readonly ROLES_READ: "core:roles:read";
|
|
25
|
+
readonly ROLES_MANAGE: "core:roles:manage";
|
|
26
|
+
readonly DEVICES_READ: "core:devices:read";
|
|
27
|
+
readonly DEVICES_REVOKE: "core:devices:revoke";
|
|
28
|
+
readonly BRANCHES_READ: "core:branches:read";
|
|
29
|
+
readonly BRANCHES_WRITE: "core:branches:write";
|
|
30
|
+
readonly BRANCHES_DELETE: "core:branches:delete";
|
|
31
|
+
};
|
|
32
|
+
export declare const DB_SCHEMA: {
|
|
33
|
+
readonly PUBLIC: "public";
|
|
34
|
+
readonly tenantSchema: (tenantSlug: string) => string;
|
|
35
|
+
};
|
|
36
|
+
export declare const HTTP_HEADERS: {
|
|
37
|
+
readonly TENANT_ID: "x-tenant-id";
|
|
38
|
+
readonly USER_ID: "x-user-id";
|
|
39
|
+
readonly USER_ROLES: "x-user-roles";
|
|
40
|
+
};
|
|
41
|
+
export declare const QUEUE_NAMES: {
|
|
42
|
+
readonly EMAIL: "email-queue";
|
|
43
|
+
readonly SMS: "sms-queue";
|
|
44
|
+
};
|
|
45
|
+
export declare const NOTIFICATION_PERMISSIONS: {
|
|
46
|
+
readonly EMAIL_SETTINGS_READ: "core:email-settings:read";
|
|
47
|
+
readonly EMAIL_SETTINGS_WRITE: "core:email-settings:write";
|
|
48
|
+
};
|
|
49
|
+
export declare const REDIS_KEYS: {
|
|
50
|
+
readonly refreshToken: (userId: string) => string;
|
|
51
|
+
readonly moduleManifest: (tenantId: string) => string;
|
|
52
|
+
readonly emailSettings: (tenantId: string) => string;
|
|
53
|
+
};
|
|
54
|
+
export declare const JWT_CONFIG: {
|
|
55
|
+
readonly ACCESS_TTL_SECONDS: 900;
|
|
56
|
+
readonly REFRESH_TTL_SECONDS: 604800;
|
|
57
|
+
};
|
|
58
|
+
export declare const RATE_LIMITS: {
|
|
59
|
+
readonly GLOBAL_PER_TENANT: 1000;
|
|
60
|
+
readonly AUTH_PER_IP: 10;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;CAEtB,CAAC;AAIX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;CAYzB,CAAC;AAIX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;CAoBvB,CAAC;AAIX,eAAO,MAAM,SAAS;;wCAEO,MAAM,KAAG,MAAM;CAClC,CAAC;AAIX,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAIX,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC;AAIX,eAAO,MAAM,UAAU;oCACE,MAAM,KAAG,MAAM;wCACX,MAAM,KAAG,MAAM;uCAChB,MAAM,KAAG,MAAM;CACjC,CAAC;AAIX,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,eAAO,MAAM,WAAW;;;CAGd,CAAC"}
|
package/dist/platform.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @cuencor/shared-constants — Platform constants (reusable across all products)
|
|
3
|
+
// These constants belong to the platform core: auth, users, tenants, RBAC, messaging.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.RATE_LIMITS = exports.JWT_CONFIG = exports.REDIS_KEYS = exports.NOTIFICATION_PERMISSIONS = exports.QUEUE_NAMES = exports.HTTP_HEADERS = exports.DB_SCHEMA = exports.PLATFORM_PERMISSIONS = exports.PLATFORM_NATS_SUBJECTS = exports.PLATFORM_MODULE_IDS = void 0;
|
|
6
|
+
// ─── Module IDs (platform-level) ─────────────────────────────────────────────
|
|
7
|
+
exports.PLATFORM_MODULE_IDS = {
|
|
8
|
+
CORE: 'com.finaxis.core',
|
|
9
|
+
};
|
|
10
|
+
// ─── NATS Subjects — Platform & Core ──────────────────────────────────────────
|
|
11
|
+
exports.PLATFORM_NATS_SUBJECTS = {
|
|
12
|
+
PLATFORM: {
|
|
13
|
+
MODULE_INSTALLED: 'erp.platform.module.installed',
|
|
14
|
+
MODULE_UNINSTALLED: 'erp.platform.module.uninstalled',
|
|
15
|
+
},
|
|
16
|
+
CORE: {
|
|
17
|
+
USER_CREATED: 'erp.core.users.created',
|
|
18
|
+
USER_UPDATED: 'erp.core.users.updated',
|
|
19
|
+
USER_DEACTIVATED: 'erp.core.users.deactivated',
|
|
20
|
+
TENANT_CREATED: 'erp.core.tenants.created',
|
|
21
|
+
TENANT_SUSPENDED: 'erp.core.tenants.suspended',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
// ─── Permissions — Platform ───────────────────────────────────────────────────
|
|
25
|
+
exports.PLATFORM_PERMISSIONS = {
|
|
26
|
+
// Users
|
|
27
|
+
USERS_READ: 'core:users:read',
|
|
28
|
+
USERS_WRITE: 'core:users:write',
|
|
29
|
+
USERS_DELETE: 'core:users:delete',
|
|
30
|
+
// Tenants
|
|
31
|
+
TENANTS_MANAGE: 'core:tenants:manage',
|
|
32
|
+
// Modules
|
|
33
|
+
MODULES_INSTALL: 'core:modules:install',
|
|
34
|
+
MODULES_UNINSTALL: 'core:modules:uninstall',
|
|
35
|
+
// RBAC
|
|
36
|
+
ROLES_READ: 'core:roles:read',
|
|
37
|
+
ROLES_MANAGE: 'core:roles:manage',
|
|
38
|
+
// Devices (ISO 27001 A.9.4.2)
|
|
39
|
+
DEVICES_READ: 'core:devices:read',
|
|
40
|
+
DEVICES_REVOKE: 'core:devices:revoke',
|
|
41
|
+
// Branches
|
|
42
|
+
BRANCHES_READ: 'core:branches:read',
|
|
43
|
+
BRANCHES_WRITE: 'core:branches:write',
|
|
44
|
+
BRANCHES_DELETE: 'core:branches:delete',
|
|
45
|
+
};
|
|
46
|
+
// ─── Database ─────────────────────────────────────────────────────────────────
|
|
47
|
+
exports.DB_SCHEMA = {
|
|
48
|
+
PUBLIC: 'public',
|
|
49
|
+
tenantSchema: (tenantSlug) => `tenant_${tenantSlug}`,
|
|
50
|
+
};
|
|
51
|
+
// ─── HTTP Headers ─────────────────────────────────────────────────────────────
|
|
52
|
+
exports.HTTP_HEADERS = {
|
|
53
|
+
TENANT_ID: 'x-tenant-id',
|
|
54
|
+
USER_ID: 'x-user-id',
|
|
55
|
+
USER_ROLES: 'x-user-roles',
|
|
56
|
+
};
|
|
57
|
+
// ─── Messaging ────────────────────────────────────────────────────────────────
|
|
58
|
+
exports.QUEUE_NAMES = {
|
|
59
|
+
EMAIL: 'email-queue',
|
|
60
|
+
SMS: 'sms-queue',
|
|
61
|
+
};
|
|
62
|
+
exports.NOTIFICATION_PERMISSIONS = {
|
|
63
|
+
EMAIL_SETTINGS_READ: 'core:email-settings:read',
|
|
64
|
+
EMAIL_SETTINGS_WRITE: 'core:email-settings:write',
|
|
65
|
+
};
|
|
66
|
+
// ─── Redis Keys ───────────────────────────────────────────────────────────────
|
|
67
|
+
exports.REDIS_KEYS = {
|
|
68
|
+
refreshToken: (userId) => `refresh_token:${userId}`,
|
|
69
|
+
moduleManifest: (tenantId) => `module_manifest:${tenantId}`,
|
|
70
|
+
emailSettings: (tenantId) => `email_settings:${tenantId}`,
|
|
71
|
+
};
|
|
72
|
+
// ─── Config ───────────────────────────────────────────────────────────────────
|
|
73
|
+
exports.JWT_CONFIG = {
|
|
74
|
+
ACCESS_TTL_SECONDS: 900, // 15 minutes
|
|
75
|
+
REFRESH_TTL_SECONDS: 604800, // 7 days
|
|
76
|
+
};
|
|
77
|
+
exports.RATE_LIMITS = {
|
|
78
|
+
GLOBAL_PER_TENANT: 1000, // req/min per tenant
|
|
79
|
+
AUTH_PER_IP: 10, // req/min for login endpoint
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,sFAAsF;;;AAEtF,gFAAgF;AAEnE,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,kBAAkB;CAChB,CAAC;AAEX,iFAAiF;AAEpE,QAAA,sBAAsB,GAAG;IACpC,QAAQ,EAAE;QACR,gBAAgB,EAAE,+BAA+B;QACjD,kBAAkB,EAAE,iCAAiC;KACtD;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,wBAAwB;QACtC,YAAY,EAAE,wBAAwB;QACtC,gBAAgB,EAAE,4BAA4B;QAC9C,cAAc,EAAE,0BAA0B;QAC1C,gBAAgB,EAAE,4BAA4B;KAC/C;CACO,CAAC;AAEX,iFAAiF;AAEpE,QAAA,oBAAoB,GAAG;IAClC,QAAQ;IACR,UAAU,EAAE,iBAAiB;IAC7B,WAAW,EAAE,kBAAkB;IAC/B,YAAY,EAAE,mBAAmB;IACjC,UAAU;IACV,cAAc,EAAE,qBAAqB;IACrC,UAAU;IACV,eAAe,EAAE,sBAAsB;IACvC,iBAAiB,EAAE,wBAAwB;IAC3C,OAAO;IACP,UAAU,EAAE,iBAAiB;IAC7B,YAAY,EAAE,mBAAmB;IACjC,8BAA8B;IAC9B,YAAY,EAAE,mBAAmB;IACjC,cAAc,EAAE,qBAAqB;IACrC,WAAW;IACX,aAAa,EAAE,oBAAoB;IACnC,cAAc,EAAE,qBAAqB;IACrC,eAAe,EAAE,sBAAsB;CAC/B,CAAC;AAEX,iFAAiF;AAEpE,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,CAAC,UAAkB,EAAU,EAAE,CAAC,UAAU,UAAU,EAAE;CAC5D,CAAC;AAEX,iFAAiF;AAEpE,QAAA,YAAY,GAAG;IAC1B,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,WAAW;IACpB,UAAU,EAAE,cAAc;CAClB,CAAC;AAEX,iFAAiF;AAEpE,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE,aAAa;IACpB,GAAG,EAAE,WAAW;CACR,CAAC;AAEE,QAAA,wBAAwB,GAAG;IACtC,mBAAmB,EAAE,0BAA0B;IAC/C,oBAAoB,EAAE,2BAA2B;CACzC,CAAC;AAEX,iFAAiF;AAEpE,QAAA,UAAU,GAAG;IACxB,YAAY,EAAE,CAAC,MAAc,EAAU,EAAE,CAAC,iBAAiB,MAAM,EAAE;IACnE,cAAc,EAAE,CAAC,QAAgB,EAAU,EAAE,CAAC,mBAAmB,QAAQ,EAAE;IAC3E,aAAa,EAAE,CAAC,QAAgB,EAAU,EAAE,CAAC,kBAAkB,QAAQ,EAAE;CACjE,CAAC;AAEX,iFAAiF;AAEpE,QAAA,UAAU,GAAG;IACxB,kBAAkB,EAAE,GAAG,EAAE,aAAa;IACtC,mBAAmB,EAAE,MAAM,EAAE,SAAS;CAC9B,CAAC;AAEE,QAAA,WAAW,GAAG;IACzB,iBAAiB,EAAE,IAAI,EAAE,qBAAqB;IAC9C,WAAW,EAAE,EAAE,EAAE,6BAA6B;CACtC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cuencor/shared-constants",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "NATS subjects, permissions, module IDs for Cuencor Platform",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"src"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.build.json",
|
|
20
|
+
"build:watch": "tsc -p tsconfig.build.json --watch",
|
|
21
|
+
"typecheck": "tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/cuencor/shared-constants"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"typescript": "~5.7.2"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/index.ts
ADDED
package/src/platform.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// @cuencor/shared-constants — Platform constants (reusable across all products)
|
|
2
|
+
// These constants belong to the platform core: auth, users, tenants, RBAC, messaging.
|
|
3
|
+
|
|
4
|
+
// ─── Module IDs (platform-level) ─────────────────────────────────────────────
|
|
5
|
+
|
|
6
|
+
export const PLATFORM_MODULE_IDS = {
|
|
7
|
+
CORE: 'com.finaxis.core',
|
|
8
|
+
} as const;
|
|
9
|
+
|
|
10
|
+
// ─── NATS Subjects — Platform & Core ──────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
export const PLATFORM_NATS_SUBJECTS = {
|
|
13
|
+
PLATFORM: {
|
|
14
|
+
MODULE_INSTALLED: 'erp.platform.module.installed',
|
|
15
|
+
MODULE_UNINSTALLED: 'erp.platform.module.uninstalled',
|
|
16
|
+
},
|
|
17
|
+
CORE: {
|
|
18
|
+
USER_CREATED: 'erp.core.users.created',
|
|
19
|
+
USER_UPDATED: 'erp.core.users.updated',
|
|
20
|
+
USER_DEACTIVATED: 'erp.core.users.deactivated',
|
|
21
|
+
TENANT_CREATED: 'erp.core.tenants.created',
|
|
22
|
+
TENANT_SUSPENDED: 'erp.core.tenants.suspended',
|
|
23
|
+
},
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
// ─── Permissions — Platform ───────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
export const PLATFORM_PERMISSIONS = {
|
|
29
|
+
// Users
|
|
30
|
+
USERS_READ: 'core:users:read',
|
|
31
|
+
USERS_WRITE: 'core:users:write',
|
|
32
|
+
USERS_DELETE: 'core:users:delete',
|
|
33
|
+
// Tenants
|
|
34
|
+
TENANTS_MANAGE: 'core:tenants:manage',
|
|
35
|
+
// Modules
|
|
36
|
+
MODULES_INSTALL: 'core:modules:install',
|
|
37
|
+
MODULES_UNINSTALL: 'core:modules:uninstall',
|
|
38
|
+
// RBAC
|
|
39
|
+
ROLES_READ: 'core:roles:read',
|
|
40
|
+
ROLES_MANAGE: 'core:roles:manage',
|
|
41
|
+
// Devices (ISO 27001 A.9.4.2)
|
|
42
|
+
DEVICES_READ: 'core:devices:read',
|
|
43
|
+
DEVICES_REVOKE: 'core:devices:revoke',
|
|
44
|
+
// Branches
|
|
45
|
+
BRANCHES_READ: 'core:branches:read',
|
|
46
|
+
BRANCHES_WRITE: 'core:branches:write',
|
|
47
|
+
BRANCHES_DELETE: 'core:branches:delete',
|
|
48
|
+
} as const;
|
|
49
|
+
|
|
50
|
+
// ─── Database ─────────────────────────────────────────────────────────────────
|
|
51
|
+
|
|
52
|
+
export const DB_SCHEMA = {
|
|
53
|
+
PUBLIC: 'public',
|
|
54
|
+
tenantSchema: (tenantSlug: string): string => `tenant_${tenantSlug}`,
|
|
55
|
+
} as const;
|
|
56
|
+
|
|
57
|
+
// ─── HTTP Headers ─────────────────────────────────────────────────────────────
|
|
58
|
+
|
|
59
|
+
export const HTTP_HEADERS = {
|
|
60
|
+
TENANT_ID: 'x-tenant-id',
|
|
61
|
+
USER_ID: 'x-user-id',
|
|
62
|
+
USER_ROLES: 'x-user-roles',
|
|
63
|
+
} as const;
|
|
64
|
+
|
|
65
|
+
// ─── Messaging ────────────────────────────────────────────────────────────────
|
|
66
|
+
|
|
67
|
+
export const QUEUE_NAMES = {
|
|
68
|
+
EMAIL: 'email-queue',
|
|
69
|
+
SMS: 'sms-queue',
|
|
70
|
+
} as const;
|
|
71
|
+
|
|
72
|
+
export const NOTIFICATION_PERMISSIONS = {
|
|
73
|
+
EMAIL_SETTINGS_READ: 'core:email-settings:read',
|
|
74
|
+
EMAIL_SETTINGS_WRITE: 'core:email-settings:write',
|
|
75
|
+
} as const;
|
|
76
|
+
|
|
77
|
+
// ─── Redis Keys ───────────────────────────────────────────────────────────────
|
|
78
|
+
|
|
79
|
+
export const REDIS_KEYS = {
|
|
80
|
+
refreshToken: (userId: string): string => `refresh_token:${userId}`,
|
|
81
|
+
moduleManifest: (tenantId: string): string => `module_manifest:${tenantId}`,
|
|
82
|
+
emailSettings: (tenantId: string): string => `email_settings:${tenantId}`,
|
|
83
|
+
} as const;
|
|
84
|
+
|
|
85
|
+
// ─── Config ───────────────────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
export const JWT_CONFIG = {
|
|
88
|
+
ACCESS_TTL_SECONDS: 900, // 15 minutes
|
|
89
|
+
REFRESH_TTL_SECONDS: 604800, // 7 days
|
|
90
|
+
} as const;
|
|
91
|
+
|
|
92
|
+
export const RATE_LIMITS = {
|
|
93
|
+
GLOBAL_PER_TENANT: 1000, // req/min per tenant
|
|
94
|
+
AUTH_PER_IP: 10, // req/min for login endpoint
|
|
95
|
+
} as const;
|