@nextage/era-lib 1.0.210 → 1.0.211
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/build/constants.d.ts +3 -3
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +3 -3
- package/build/constants.js.map +1 -1
- package/build/events/access-revoked-publisher.d.ts +1 -1
- package/build/events/access-revoked-publisher.js +1 -1
- package/build/events/base/base-event.controller.d.ts +35 -5
- package/build/events/base/base-event.controller.d.ts.map +1 -1
- package/build/events/base/base-event.controller.js +43 -6
- package/build/events/base/base-event.controller.js.map +1 -1
- package/build/events/base/base-msg-listener.js +1 -1
- package/build/events/base/base-msg-listener.js.map +1 -1
- package/build/events/base/base-nats-listener.d.ts +2 -2
- package/build/events/base/base-nats-listener.js +3 -3
- package/build/events/base/base-nats-listener.js.map +1 -1
- package/build/events/dlq-manager.js +3 -3
- package/build/events/event-relay.js +2 -2
- package/build/events/field-map.js +1 -1
- package/build/events/interfaces.d.ts +1 -1
- package/build/events/organization/interfaces.d.ts +3 -3
- package/build/events/organization/restored-event.d.ts +1 -1
- package/build/events/publisher-registry.js +1 -1
- package/build/events/revocation-denylist.js +2 -2
- package/build/events/revocation-listener.js +1 -1
- package/build/events/transport/base-client-wrapper.d.ts +1 -1
- package/build/events/transport/base-client-wrapper.js +1 -1
- package/build/events/transport/nats-client-manager.d.ts +1 -1
- package/build/events/transport/nats-client-manager.js +1 -1
- package/build/events/types/dlq.constants.js +1 -1
- package/build/events/types/dlq.constants.js.map +1 -1
- package/build/events/types/dlq.interfaces.js +1 -1
- package/build/events/types/dlq.interfaces.js.map +1 -1
- package/build/events/types/enums.d.ts +1 -1
- package/build/events/types/enums.js +3 -3
- package/build/events/types/enums.js.map +1 -1
- package/build/events/types/relay.constants.js +1 -1
- package/build/events/types/relay.constants.js.map +1 -1
- package/build/events/types/relay.interfaces.js +1 -1
- package/build/events/types/relay.interfaces.js.map +1 -1
- package/build/events/types/revocation.constants.js +1 -1
- package/build/events/types/revocation.constants.js.map +1 -1
- package/build/events/types/revocation.interfaces.js +1 -1
- package/build/events/types/revocation.interfaces.js.map +1 -1
- package/build/interfaces.d.ts +1 -1
- package/build/services/tenant-archive.d.ts +2 -2
- package/build/services/tenant-archive.js +2 -2
- package/build/types/app-config.d.ts +3 -3
- package/build/types/nx-context.d.ts +1 -1
- package/build/types/nx-context.js +1 -1
- package/build/utils/domain.d.ts +1 -1
- package/build/utils/domain.js +1 -1
- package/build/utils/env.constants.js +1 -1
- package/build/utils/env.constants.js.map +1 -1
- package/build/utils/express.d.ts +1 -1
- package/build/utils/express.js +2 -2
- package/build/utils/express.js.map +1 -1
- package/build/utils/functs.d.ts +2 -2
- package/build/utils/functs.js +6 -6
- package/build/utils/functs.js.map +1 -1
- package/build/utils/jwt.constants.d.ts +2 -2
- package/build/utils/jwt.constants.js +2 -2
- package/build/utils/jwt.js +3 -3
- package/build/utils/jwt.js.map +1 -1
- package/build/utils/tenancy.d.ts +4 -4
- package/build/utils/tenancy.js +5 -5
- package/build/utils/tenant.d.ts +6 -6
- package/build/utils/tenant.js +7 -7
- package/build/utils/tenant.js.map +1 -1
- package/package.json +1 -1
package/build/utils/tenant.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { ExistenceCheckModel, ScopedReadModel } from './tenant.interfaces';
|
|
|
16
16
|
* The selection NEVER comes from the payload: it travels out of band (`X-Org-Id`
|
|
17
17
|
* header, or `orgId` in the WebSocket connection params) and lands on
|
|
18
18
|
* `NxContext.orgId`. Reading it from the body would let a client name any tenant
|
|
19
|
-
* simply by adding a field to a mutation input
|
|
19
|
+
* simply by adding a field to a mutation input.
|
|
20
20
|
*
|
|
21
21
|
* Resolution order (ADR-0005 section 5.1) - the first match wins:
|
|
22
22
|
*
|
|
@@ -54,7 +54,7 @@ export declare function resolveTenant(user?: BaseUser, orgId?: string): string;
|
|
|
54
54
|
* defect D2 of ADR-0005 section 5.1, a fail-open by default.
|
|
55
55
|
*
|
|
56
56
|
* IMPORTANT: **What it is FOR, since 2026-08-13.** Scoping is no longer its job: `BaseModel`
|
|
57
|
-
* applies the tenant on its own (opt-out
|
|
57
|
+
* applies the tenant on its own (opt-out), so this is not what keeps a query
|
|
58
58
|
* inside its organization anymore. The four remaining callers use it for a different
|
|
59
59
|
* reason - they need the resolved tenant as a VALUE, to then load
|
|
60
60
|
* `organization.get(params.tenantId)` or to pick the right items while composing a
|
|
@@ -84,11 +84,11 @@ export declare function getTenant(user?: BaseUser): string;
|
|
|
84
84
|
* tenant scoping is **opt-out**: `BaseModel.beforeRemove` refuses an out-of-scope `_id`
|
|
85
85
|
* on its own, so the nine `beforeRemove` overrides that called this helper are gone
|
|
86
86
|
* (OPS-10) and it has **no production caller left**. Do NOT reach for it in new code -
|
|
87
|
-
* a second copy of the rule is exactly what
|
|
87
|
+
* a second copy of the rule is exactly what the opt-out design removed. It stays exported,
|
|
88
88
|
* and covered by its test, because the framework keeps its old behaviour whenever no
|
|
89
89
|
* tenancy provider is registered: a consumer in that state still needs this.
|
|
90
90
|
*
|
|
91
|
-
* Fills
|
|
91
|
+
* Fills a gap in the framework: `BaseModel.remove(id)` calls `beforeRemove` and then
|
|
92
92
|
* `findByIdAndDelete(id)`, applying neither `updateFilters` nor any `tenantId`
|
|
93
93
|
* constraint - and `bulkRemove(ids)` is nothing but `ids.map(remove)`. Without this
|
|
94
94
|
* check any user deletes documents belonging to OTHER organizations, knowing only
|
|
@@ -103,7 +103,7 @@ export declare function getTenant(user?: BaseUser): string;
|
|
|
103
103
|
* **Fail-closed**: a missing or out-of-scope `id` raises an error, without telling
|
|
104
104
|
* the two cases apart (the existence of someone else's document is never confirmed).
|
|
105
105
|
* That muteness was lost when the guard moved into the framework, which at first
|
|
106
|
-
* refused only EXISTING documents - an enumeration oracle,
|
|
106
|
+
* refused only EXISTING documents - an enumeration oracle, since
|
|
107
107
|
* repaired in nx-frame-be 1.0.47.
|
|
108
108
|
*
|
|
109
109
|
* @param model the model the removal happens on (`this` inside the hook)
|
|
@@ -114,7 +114,7 @@ export declare function getTenant(user?: BaseUser): string;
|
|
|
114
114
|
*/
|
|
115
115
|
export declare function assertTenantScope(model: ScopedReadModel, id: string, context?: NxContext): Promise<string>;
|
|
116
116
|
/**
|
|
117
|
-
* Answers whether the organization NAMED by a request actually exists
|
|
117
|
+
* Answers whether the organization NAMED by a request actually exists.
|
|
118
118
|
*
|
|
119
119
|
* {@link resolveTenant} answers one question - "may this user REACH the
|
|
120
120
|
* selection" - and for a cross-tenant role the answer is "any of them", so it
|
package/build/utils/tenant.js
CHANGED
|
@@ -25,7 +25,7 @@ const scope_1 = require("./scope");
|
|
|
25
25
|
* The selection NEVER comes from the payload: it travels out of band (`X-Org-Id`
|
|
26
26
|
* header, or `orgId` in the WebSocket connection params) and lands on
|
|
27
27
|
* `NxContext.orgId`. Reading it from the body would let a client name any tenant
|
|
28
|
-
* simply by adding a field to a mutation input
|
|
28
|
+
* simply by adding a field to a mutation input.
|
|
29
29
|
*
|
|
30
30
|
* Resolution order (ADR-0005 section 5.1) - the first match wins:
|
|
31
31
|
*
|
|
@@ -62,7 +62,7 @@ function resolveTenant(user, orgId) {
|
|
|
62
62
|
return orgId;
|
|
63
63
|
// `messages.forbidden` was defined by NO dictionary, so the client - which
|
|
64
64
|
// falls back to the message when `extensions.i18n` is absent - showed the raw
|
|
65
|
-
// key to the user
|
|
65
|
+
// key to the user. This refusal is an access denial, and reads as one.
|
|
66
66
|
if (!reachable.includes(orgId))
|
|
67
67
|
throw new nx_frame_be_1.AppError('messages.authorization.accessDenied');
|
|
68
68
|
return orgId;
|
|
@@ -76,7 +76,7 @@ function resolveTenant(user, orgId) {
|
|
|
76
76
|
* defect D2 of ADR-0005 section 5.1, a fail-open by default.
|
|
77
77
|
*
|
|
78
78
|
* IMPORTANT: **What it is FOR, since 2026-08-13.** Scoping is no longer its job: `BaseModel`
|
|
79
|
-
* applies the tenant on its own (opt-out
|
|
79
|
+
* applies the tenant on its own (opt-out), so this is not what keeps a query
|
|
80
80
|
* inside its organization anymore. The four remaining callers use it for a different
|
|
81
81
|
* reason - they need the resolved tenant as a VALUE, to then load
|
|
82
82
|
* `organization.get(params.tenantId)` or to pick the right items while composing a
|
|
@@ -112,11 +112,11 @@ function getTenant(user) {
|
|
|
112
112
|
* tenant scoping is **opt-out**: `BaseModel.beforeRemove` refuses an out-of-scope `_id`
|
|
113
113
|
* on its own, so the nine `beforeRemove` overrides that called this helper are gone
|
|
114
114
|
* (OPS-10) and it has **no production caller left**. Do NOT reach for it in new code -
|
|
115
|
-
* a second copy of the rule is exactly what
|
|
115
|
+
* a second copy of the rule is exactly what the opt-out design removed. It stays exported,
|
|
116
116
|
* and covered by its test, because the framework keeps its old behaviour whenever no
|
|
117
117
|
* tenancy provider is registered: a consumer in that state still needs this.
|
|
118
118
|
*
|
|
119
|
-
* Fills
|
|
119
|
+
* Fills a gap in the framework: `BaseModel.remove(id)` calls `beforeRemove` and then
|
|
120
120
|
* `findByIdAndDelete(id)`, applying neither `updateFilters` nor any `tenantId`
|
|
121
121
|
* constraint - and `bulkRemove(ids)` is nothing but `ids.map(remove)`. Without this
|
|
122
122
|
* check any user deletes documents belonging to OTHER organizations, knowing only
|
|
@@ -131,7 +131,7 @@ function getTenant(user) {
|
|
|
131
131
|
* **Fail-closed**: a missing or out-of-scope `id` raises an error, without telling
|
|
132
132
|
* the two cases apart (the existence of someone else's document is never confirmed).
|
|
133
133
|
* That muteness was lost when the guard moved into the framework, which at first
|
|
134
|
-
* refused only EXISTING documents - an enumeration oracle,
|
|
134
|
+
* refused only EXISTING documents - an enumeration oracle, since
|
|
135
135
|
* repaired in nx-frame-be 1.0.47.
|
|
136
136
|
*
|
|
137
137
|
* @param model the model the removal happens on (`this` inside the hook)
|
|
@@ -146,7 +146,7 @@ async function assertTenantScope(model, id, context = {}) {
|
|
|
146
146
|
return id;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Answers whether the organization NAMED by a request actually exists
|
|
149
|
+
* Answers whether the organization NAMED by a request actually exists.
|
|
150
150
|
*
|
|
151
151
|
* {@link resolveTenant} answers one question - "may this user REACH the
|
|
152
152
|
* selection" - and for a cross-tenant role the answer is "any of them", so it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.js","sourceRoot":"","sources":["../../src/utils/tenant.ts"],"names":[],"mappings":";AAAA;;;;;;;;;+FAS+F;;AA0C/F,sCAkBC;AAqBD,8BAGC;AAaD,8BAMC;AAqCD,8CAMC;AAqDD,8CASC;AAkBD,0DAIC;AApOD,sDAA+E;AAC/E,oFAA6G;AAE7G,mCAAkE;AAGlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,aAAa,CAAC,IAAe,EAAE,KAAc;IAE3D,IAAI,CAAC,KAAK;QACR,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAEzB,MAAM,SAAS,GAAG,IAAA,uBAAe,EAAC,IAAI,CAAC,CAAC;IAExC,sEAAsE;IACtE,IAAI,CAAC,SAAS;QACZ,OAAO,KAAK,CAAC;IAEf,2EAA2E;IAC3E,8EAA8E;IAC9E,
|
|
1
|
+
{"version":3,"file":"tenant.js","sourceRoot":"","sources":["../../src/utils/tenant.ts"],"names":[],"mappings":";AAAA;;;;;;;;;+FAS+F;;AA0C/F,sCAkBC;AAqBD,8BAGC;AAaD,8BAMC;AAqCD,8CAMC;AAqDD,8CASC;AAkBD,0DAIC;AApOD,sDAA+E;AAC/E,oFAA6G;AAE7G,mCAAkE;AAGlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,aAAa,CAAC,IAAe,EAAE,KAAc;IAE3D,IAAI,CAAC,KAAK;QACR,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAEzB,MAAM,SAAS,GAAG,IAAA,uBAAe,EAAC,IAAI,CAAC,CAAC;IAExC,sEAAsE;IACtE,IAAI,CAAC,SAAS;QACZ,OAAO,KAAK,CAAC;IAEf,2EA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