@antelopejs/interface-dms 0.17.6-next.1170.g0f31f2d → 0.17.6-next.1183.ga9db169
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/CHANGELOG.md +0 -17
- package/dist/internal/registration-owner.d.ts +21 -0
- package/dist/internal/registration-owner.js +49 -0
- package/dist/internal/registration-owner.js.map +1 -0
- package/dist/invite-resolution.js +2 -8
- package/dist/invite-resolution.js.map +1 -1
- package/dist/page/categories.d.ts +11 -3
- package/dist/page/categories.js +15 -3
- package/dist/page/categories.js.map +1 -1
- package/dist/page/internal/registry.d.ts +7 -0
- package/dist/page/internal/registry.js +10 -0
- package/dist/page/internal/registry.js.map +1 -1
- package/dist/period-request.d.ts +4 -5
- package/dist/period-request.js +14 -27
- package/dist/period-request.js.map +1 -1
- package/dist/tenant-access.js +2 -0
- package/dist/tenant-access.js.map +1 -1
- package/docs/1.core/12.frontend-modules-and-request-helpers.md +1 -1
- package/docs/2.auth/3.tokens-and-sessions.md +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## v0.17.5
|
|
4
|
-
|
|
5
|
-
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.17.4...interface-v0.17.5)
|
|
6
|
-
|
|
7
|
-
### 🩹 Fixes
|
|
8
|
-
|
|
9
|
-
- **deps:** Land the non-major dependency updates of #1353 ([#1360](https://github.com/AntelopeJS/dms/pull/1360))
|
|
10
|
-
|
|
11
|
-
### 🏡 Chore
|
|
12
|
-
|
|
13
|
-
- **deps:** Update node.js types ([#1352](https://github.com/AntelopeJS/dms/pull/1352))
|
|
14
|
-
- **deps:** Update dependency release-it to v21 ([#1381](https://github.com/AntelopeJS/dms/pull/1381))
|
|
15
|
-
|
|
16
|
-
### ❤️ Contributors
|
|
17
|
-
|
|
18
|
-
- Antony Rizzitelli
|
|
19
|
-
|
|
20
3
|
## v0.17.4
|
|
21
4
|
|
|
22
5
|
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.17.3...interface-v0.17.4)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stamps registrations of one family with the module that filed them and reads
|
|
3
|
+
* the stamp back. It names no registration type, so it imports none.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class RegistrationOwners<T extends object> {
|
|
8
|
+
/**
|
|
9
|
+
* Records the module whose work is running as the owner of `registration`.
|
|
10
|
+
* Leaves it unstamped when no module is running, so a registration made
|
|
11
|
+
* outside one reads as owned by none.
|
|
12
|
+
*/
|
|
13
|
+
stamp(registration: T): void;
|
|
14
|
+
/**
|
|
15
|
+
* The id of the module that filed `registration`, as the runtime knows the
|
|
16
|
+
* module; undefined when it was filed outside any module.
|
|
17
|
+
*/
|
|
18
|
+
ownerOf(registration: T): string | undefined;
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const registrationOwners: RegistrationOwners<object>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registrationOwners = exports.RegistrationOwners = void 0;
|
|
4
|
+
const interface_core_1 = require("@antelopejs/interface-core");
|
|
5
|
+
/**
|
|
6
|
+
* The property a registration carries to name the module that filed it. A
|
|
7
|
+
* callback attached to a `RegisteringProxy` runs in the context it was
|
|
8
|
+
* attached in, and the proxy keeps its registrations private, so the runtime
|
|
9
|
+
* cannot ask who registered what: the interface stamps it before the
|
|
10
|
+
* registration crosses. A symbol property survives the per-context view the
|
|
11
|
+
* runtime receives, as the page registration token does.
|
|
12
|
+
*/
|
|
13
|
+
const REGISTRATION_OWNER = Symbol.for("@antelopejs/interface-dms:registrationOwner");
|
|
14
|
+
/**
|
|
15
|
+
* Stamps registrations of one family with the module that filed them and reads
|
|
16
|
+
* the stamp back. It names no registration type, so it imports none.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
class RegistrationOwners {
|
|
21
|
+
/**
|
|
22
|
+
* Records the module whose work is running as the owner of `registration`.
|
|
23
|
+
* Leaves it unstamped when no module is running, so a registration made
|
|
24
|
+
* outside one reads as owned by none.
|
|
25
|
+
*/
|
|
26
|
+
stamp(registration) {
|
|
27
|
+
const owner = (0, interface_core_1.GetResponsibleModule)();
|
|
28
|
+
if (owner === undefined)
|
|
29
|
+
return;
|
|
30
|
+
Object.defineProperty(registration, REGISTRATION_OWNER, {
|
|
31
|
+
value: owner,
|
|
32
|
+
configurable: true,
|
|
33
|
+
enumerable: false,
|
|
34
|
+
writable: false,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The id of the module that filed `registration`, as the runtime knows the
|
|
39
|
+
* module; undefined when it was filed outside any module.
|
|
40
|
+
*/
|
|
41
|
+
ownerOf(registration) {
|
|
42
|
+
const stamped = registration;
|
|
43
|
+
return stamped[REGISTRATION_OWNER];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.RegistrationOwners = RegistrationOwners;
|
|
47
|
+
/** @internal */
|
|
48
|
+
exports.registrationOwners = new RegistrationOwners();
|
|
49
|
+
//# sourceMappingURL=registration-owner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration-owner.js","sourceRoot":"","sources":["../../src/internal/registration-owner.ts"],"names":[],"mappings":";;;AAAA,+DAAkE;AAElE;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CACnC,6CAA6C,CAC9C,CAAC;AAIF;;;;;GAKG;AACH;IACE;;;;OAIG;IACI,KAAK,CAAC,YAAe;QAC1B,MAAM,KAAK,GAAG,IAAA,qCAAoB,GAAE,CAAC;QACrC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO;QAChC,MAAM,CAAC,cAAc,CAAC,YAAY,EAAE,kBAAkB,EAAE;YACtD,KAAK,EAAE,KAAK;YACZ,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,YAAe;QAC5B,MAAM,OAAO,GAAe,YAAY,CAAC;QACzC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;CACF;;AAED,gBAAgB;AACH,QAAA,kBAAkB,GAAG,IAAI,kBAAkB,EAAU,CAAC"}
|
|
@@ -44,14 +44,8 @@ async function assertOnlyInviteOfEmail(tenantId, invite) {
|
|
|
44
44
|
? stored.find((row) => row._id !== invite._id)
|
|
45
45
|
: undefined;
|
|
46
46
|
throw new interface_api_1.HTTPResult(HTTP_CONFLICT, other
|
|
47
|
-
? {
|
|
48
|
-
|
|
49
|
-
params: {
|
|
50
|
-
inviteId: other._id,
|
|
51
|
-
createdAt: other.createdAt.toISOString(),
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
: "$dms.refusals.invite.email_invited_concurrently");
|
|
47
|
+
? `Invitation for this email was created concurrently: cancel invitation ${other._id}, created ${other.createdAt.toISOString()}, first`
|
|
48
|
+
: "Invitation for this email was created concurrently");
|
|
55
49
|
}
|
|
56
50
|
/**
|
|
57
51
|
* Chooses one permanent outcome; all competing lifecycle paths must use this before effects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invite-resolution.js","sourceRoot":"","sources":["../src/invite-resolution.ts"],"names":[],"mappings":";;;;;;AAAA,6DAAuD;AACvD,uEAAwD;AACxD,6FAAqE;AAErE,mFAA+E;AAE/E,uEAAiE;AAEjE,oEAA6E;AAC7E,qDAAuD;AACvD,oEAAgF;AAChF,oEAAwE;AACxE,8DAAgE;AAEhE,MAAM,aAAa,GAAG,GAAG,CAAC;AAG1B,wFAAwF;AACjF,KAAK,8BACV,QAAgB,EAChB,QAAg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AAM,IAAA,oCAAmB,EAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC1D,OAAO,EAAE,MAAM,IAAA,4CAAwB,EAAC,UAAU,CAAC;QACnD,KAAK,EAAE,GAAG,EAAE,CAAC,IAAA,oDAAgC,EAAC,UAAU,CAAC;KAC1D,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -18,6 +18,14 @@ declare class IdentifiedRegisteringProxy<T extends object> extends RegisteringPr
|
|
|
18
18
|
register(value: T): void;
|
|
19
19
|
unregister(value: T): void;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* An identified proxy whose registrations carry the module that filed them,
|
|
23
|
+
* stamped before they cross into the DMS: the runtime's callback runs in its
|
|
24
|
+
* own context, so it could not tell otherwise.
|
|
25
|
+
*/
|
|
26
|
+
declare class OwnedRegisteringProxy<T extends CategoryInfo | ModuleInfo | PageInfo> extends IdentifiedRegisteringProxy<T> {
|
|
27
|
+
register(value: T): void;
|
|
28
|
+
}
|
|
21
29
|
/**
|
|
22
30
|
* Captures the registering module's context before the extension reaches the
|
|
23
31
|
* DMS, which applies it -- now and on every later sync -- from its own.
|
|
@@ -30,9 +38,9 @@ declare class PageExtensionRegisteringProxy extends IdentifiedRegisteringProxy<P
|
|
|
30
38
|
* @internal
|
|
31
39
|
*/
|
|
32
40
|
export declare namespace internal {
|
|
33
|
-
const RegisterCategory:
|
|
34
|
-
const RegisterPage:
|
|
35
|
-
const RegisterModule:
|
|
41
|
+
const RegisterCategory: OwnedRegisteringProxy<CategoryInfo>;
|
|
42
|
+
const RegisterPage: OwnedRegisteringProxy<PageInfo>;
|
|
43
|
+
const RegisterModule: OwnedRegisteringProxy<ModuleInfo>;
|
|
36
44
|
const RegisterDynamicMenuProvider: IdentifiedRegisteringProxy<DynamicMenuProviderInfo>;
|
|
37
45
|
const RegisterPageExtension: PageExtensionRegisteringProxy;
|
|
38
46
|
}
|
package/dist/page/categories.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.internal = void 0;
|
|
|
4
4
|
exports.isOwnerOnly = isOwnerOnly;
|
|
5
5
|
exports.isInsideModule = isInsideModule;
|
|
6
6
|
const interface_core_1 = require("@antelopejs/interface-core");
|
|
7
|
+
const registration_owner_1 = require("../internal/registration-owner");
|
|
7
8
|
const registry_1 = require("./internal/registry");
|
|
8
9
|
const category_resolution_1 = require("./internal/category-resolution");
|
|
9
10
|
/**
|
|
@@ -32,6 +33,17 @@ class IdentifiedRegisteringProxy extends interface_core_1.RegisteringProxy {
|
|
|
32
33
|
super.unregister(registered);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* An identified proxy whose registrations carry the module that filed them,
|
|
38
|
+
* stamped before they cross into the DMS: the runtime's callback runs in its
|
|
39
|
+
* own context, so it could not tell otherwise.
|
|
40
|
+
*/
|
|
41
|
+
class OwnedRegisteringProxy extends IdentifiedRegisteringProxy {
|
|
42
|
+
register(value) {
|
|
43
|
+
registration_owner_1.registrationOwners.stamp(value);
|
|
44
|
+
super.register(value);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
35
47
|
/**
|
|
36
48
|
* Captures the registering module's context before the extension reaches the
|
|
37
49
|
* DMS, which applies it -- now and on every later sync -- from its own.
|
|
@@ -50,9 +62,9 @@ class PageExtensionRegisteringProxy extends IdentifiedRegisteringProxy {
|
|
|
50
62
|
*/
|
|
51
63
|
var internal;
|
|
52
64
|
(function (internal) {
|
|
53
|
-
internal.RegisterCategory = new
|
|
54
|
-
internal.RegisterPage = new
|
|
55
|
-
internal.RegisterModule = new
|
|
65
|
+
internal.RegisterCategory = new OwnedRegisteringProxy(registry_1.categoryIdentity);
|
|
66
|
+
internal.RegisterPage = new OwnedRegisteringProxy(registry_1.pageIdentity);
|
|
67
|
+
internal.RegisterModule = new OwnedRegisteringProxy(registry_1.moduleIdentity);
|
|
56
68
|
internal.RegisterDynamicMenuProvider = new IdentifiedRegisteringProxy(registry_1.dynamicMenuProviderIdentity);
|
|
57
69
|
internal.RegisterPageExtension = new PageExtensionRegisteringProxy();
|
|
58
70
|
})(internal || (exports.internal = internal = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/page/categories.ts"],"names":[],"mappings":";;;;;AACA,+DAA8D;AAC9D,kDAQ6B;AAQ7B,wEAAqE;AAErE;;;;;;;;;GASG;AACH,MAAM,0BAA6C,SAAQ,iCAE1D;IAC8B,QAAQ;IAArC,YAA6B,QAAiC;QAC5D,KAAK,EAAE,CAAC;wBADmB,QAAQ;IAErC,CAAC;IAEQ,QAAQ,CAAC,KAAQ;QACxB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAEQ,UAAU,CAAC,KAAQ;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACjC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,6BAA8B,SAAQ,0BAA6C;IACvF;QACE,KAAK,CAAC,gCAAqB,CAAC,CAAC;IAC/B,CAAC;IAEQ,QAAQ,CAAC,KAAwB;QACxC,IAAA,sCAA2B,EAAC,KAAK,CAAC,CAAC;QACnC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;CACF;AAED;;GAEG;AACH,IAAiB,QAAQ,
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../src/page/categories.ts"],"names":[],"mappings":";;;;;AACA,+DAA8D;AAC9D,uEAAoE;AACpE,kDAQ6B;AAQ7B,wEAAqE;AAErE;;;;;;;;;GASG;AACH,MAAM,0BAA6C,SAA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,GAAG,IAAI,6BAA6B,EAAE,CAAC;AAC3E,CAAC,EAdgB,QAAQ,aAAR,QAAQ,GAAR,QAAQ,QAcxB;AASD;;;GAGG;AACH,qBAA4B,KAAkB;IAC5C,OAAO,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,wBAA+B,KAAkB;IAC/C,IAAI,KAAK,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,OAAO,GAA+C,KAAK,CAAC,QAAQ,CAAC;IACzE,OAAO,OAAO,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,IAAA,yCAAmB,EAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5B,IAAI,QAAQ,CAAC,YAAY;YAAE,OAAO,IAAI,CAAC;QACvC,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAC9B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -73,6 +73,13 @@ export declare const pageExtensionIdentity: RegistrationIdentity<PageExtensionIn
|
|
|
73
73
|
* @internal
|
|
74
74
|
*/
|
|
75
75
|
export declare function capturePageExtensionContext(info: PageExtensionInfo): void;
|
|
76
|
+
/**
|
|
77
|
+
* The id of the module that registered `info`, as the runtime knows it;
|
|
78
|
+
* undefined when it was registered outside any module.
|
|
79
|
+
*
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export declare function pageExtensionOwnerOf(info: PageExtensionInfo): string | undefined;
|
|
76
83
|
/**
|
|
77
84
|
* Run `callback` as the module that registered `info`, so everything it
|
|
78
85
|
* registers is owned by, and released with, that module. Runs in the current
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.moduleDefaultCategories = exports.moduleRootCategories = exports.pageExtensions = exports.pageExtensionIdentity = exports.dynamicMenuProviderIdentity = exports.moduleIdentity = exports.categoryIdentity = exports.pageIdentity = exports.RegistrationIdentity = exports.pageMetadataByFullId = exports.pageLayoutHandlers = exports.permissionMap = void 0;
|
|
4
4
|
exports.capturePageExtensionContext = capturePageExtensionContext;
|
|
5
|
+
exports.pageExtensionOwnerOf = pageExtensionOwnerOf;
|
|
5
6
|
exports.runAsPageExtensionOwner = runAsPageExtensionOwner;
|
|
6
7
|
exports.stampPageRegistration = stampPageRegistration;
|
|
7
8
|
exports.isSamePageRegistration = isSamePageRegistration;
|
|
@@ -151,6 +152,15 @@ function capturePageExtensionContext(info) {
|
|
|
151
152
|
if (module)
|
|
152
153
|
pageExtensionContexts.set(info, { module });
|
|
153
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* The id of the module that registered `info`, as the runtime knows it;
|
|
157
|
+
* undefined when it was registered outside any module.
|
|
158
|
+
*
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
function pageExtensionOwnerOf(info) {
|
|
162
|
+
return pageExtensionContexts.get(exports.pageExtensionIdentity.resolve(info))?.module;
|
|
163
|
+
}
|
|
154
164
|
/**
|
|
155
165
|
* Run `callback` as the module that registered `info`, so everything it
|
|
156
166
|
* registers is owned by, and released with, that module. Runs in the current
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/page/internal/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/page/internal/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+DAAkE;AAClE,gEAI4C;AAY5C,gBAAgB;AACH,QAAA,aAAa,GAAG,IAAI,GAAG,EAAuC,CAAC;AAE5E,gBAAgB;AACH,QAAA,kBAAkB,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEvE,gBAAgB;AACH,QAAA,oBAAoB,GAAG,IAAI,GAAG,EA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,QAAA,qBAAqB,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;;;;;;GAMG;AACH,+BAAsC,YAAoB;IACxD,OAAO,QAAA,oBAAoB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,iBAAiB,EAAE,IAAI,KAAK,CAAC;AAC9E,CAAC;AAYD;;;;;;GAMG;AACH;IACE,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,QAAA,cAAc,EAAE,CAAC;QACnD,IAAI,QAAA,oBAAoB,CAAC,GAAG,CAAC,YAAY,CAAC;YAAE,SAAS;QACrD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,8BAAqC,YAAoB;IACvD,MAAM,QAAQ,GAAG,QAAA,oBAAoB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACxD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO,QAAQ,CAAC,cAAc,EAAE,CAAC;AACnC,CAAC;AAED,gBAAgB;AACH,QAAA,oBAAoB,GAAG,IAAI,GAAG,EAAwB,CAAC;AACpE,gBAAgB;AACH,QAAA,uBAAuB,GAAG,IAAI,GAAG,EAAwB,CAAC"}
|
package/dist/period-request.d.ts
CHANGED
|
@@ -47,11 +47,10 @@ export interface PeriodRequest {
|
|
|
47
47
|
*
|
|
48
48
|
* @param context The request context (`@Context()` in a controller)
|
|
49
49
|
* @returns The period, its windows as `Date`s
|
|
50
|
-
* @throws HTTPResult 400,
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* them, `none` with a window)
|
|
50
|
+
* @throws HTTPResult 400, with a sentence naming the fault, when a bound is
|
|
51
|
+
* not an ISO instant, a window lacks a bound or ends before it starts, a
|
|
52
|
+
* preset or a comparison is unknown, or the parameters contradict each
|
|
53
|
+
* other (`all` with bounds, a preset without them, `none` with a window)
|
|
55
54
|
*/
|
|
56
55
|
export declare function readPeriodRequest(context: Pick<RequestContext, "url" | "rawRequest">): PeriodRequest;
|
|
57
56
|
/**
|
package/dist/period-request.js
CHANGED
|
@@ -12,11 +12,8 @@ const COOKIE_SEPARATOR = ";";
|
|
|
12
12
|
const COOKIE_ASSIGNMENT = "=";
|
|
13
13
|
/** An instant as `Date.toISOString` writes it, or with an explicit offset. */
|
|
14
14
|
const ISO_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
15
|
-
function refuse(
|
|
16
|
-
throw new interface_api_1.HTTPResult(HTTP_BAD_REQUEST,
|
|
17
|
-
message: `$dms.refusals.period.${key}`,
|
|
18
|
-
params,
|
|
19
|
-
});
|
|
15
|
+
function refuse(sentence) {
|
|
16
|
+
throw new interface_api_1.HTTPResult(HTTP_BAD_REQUEST, sentence);
|
|
20
17
|
}
|
|
21
18
|
function isOneOf(values, value) {
|
|
22
19
|
return values.some((entry) => entry === value);
|
|
@@ -27,7 +24,7 @@ function readInstant(query, key) {
|
|
|
27
24
|
return undefined;
|
|
28
25
|
const time = ISO_INSTANT.test(text) ? Date.parse(text) : Number.NaN;
|
|
29
26
|
if (Number.isNaN(time)) {
|
|
30
|
-
refuse("
|
|
27
|
+
refuse(`The period's "${key}" must be an ISO instant such as 2026-10-01T00:00:00.000Z, not "${text}".`);
|
|
31
28
|
}
|
|
32
29
|
return new Date(time);
|
|
33
30
|
}
|
|
@@ -37,13 +34,10 @@ function readWindow(query, fromKey, toKey) {
|
|
|
37
34
|
if (!from && !to)
|
|
38
35
|
return undefined;
|
|
39
36
|
if (!from || !to) {
|
|
40
|
-
refuse("
|
|
41
|
-
sent: from ? fromKey : toKey,
|
|
42
|
-
missing: from ? toKey : fromKey,
|
|
43
|
-
});
|
|
37
|
+
refuse(`The period sends "${from ? fromKey : toKey}" without "${from ? toKey : fromKey}": a window needs both.`);
|
|
44
38
|
}
|
|
45
39
|
if (from.getTime() > to.getTime()) {
|
|
46
|
-
refuse("
|
|
40
|
+
refuse(`The period's "${fromKey}" falls after its "${toKey}".`);
|
|
47
41
|
}
|
|
48
42
|
return { from, to };
|
|
49
43
|
}
|
|
@@ -52,34 +46,28 @@ function readPreset(query) {
|
|
|
52
46
|
if (text === null)
|
|
53
47
|
return undefined;
|
|
54
48
|
if (!isOneOf(period_selector_1.PERIOD_PRESETS, text)) {
|
|
55
|
-
refuse("
|
|
56
|
-
preset: text,
|
|
57
|
-
presets: period_selector_1.PERIOD_PRESETS.join(", "),
|
|
58
|
-
});
|
|
49
|
+
refuse(`The period names the preset "${text}", which is none of ${period_selector_1.PERIOD_PRESETS.join(", ")}.`);
|
|
59
50
|
}
|
|
60
51
|
return text;
|
|
61
52
|
}
|
|
62
53
|
function readComparison(query, compare) {
|
|
63
54
|
const text = query.get("comparison");
|
|
64
55
|
if (text !== null && !isOneOf(period_selector_1.PERIOD_COMPARISONS, text)) {
|
|
65
|
-
refuse("
|
|
66
|
-
comparison: text,
|
|
67
|
-
comparisons: period_selector_1.PERIOD_COMPARISONS.join(", "),
|
|
68
|
-
});
|
|
56
|
+
refuse(`The period names the comparison "${text}", which is none of ${period_selector_1.PERIOD_COMPARISONS.join(", ")}.`);
|
|
69
57
|
}
|
|
70
58
|
if (!compare)
|
|
71
59
|
return "none";
|
|
72
60
|
if (text === "none") {
|
|
73
|
-
refuse("
|
|
61
|
+
refuse(`The period compares with nothing but sends "compareFrom" and "compareTo".`);
|
|
74
62
|
}
|
|
75
63
|
return text ?? "custom";
|
|
76
64
|
}
|
|
77
65
|
function checkPresetBounds(preset, range) {
|
|
78
66
|
if (preset === "all" && range) {
|
|
79
|
-
refuse("
|
|
67
|
+
refuse(`The period "all" has no bounds, but it sends "from" and "to".`);
|
|
80
68
|
}
|
|
81
69
|
if (preset && preset !== "all" && !range) {
|
|
82
|
-
refuse("
|
|
70
|
+
refuse(`The period "${preset}" sends no "from" and "to": the selector sends the window it resolved.`);
|
|
83
71
|
}
|
|
84
72
|
}
|
|
85
73
|
function isKnownTimeZone(timeZone) {
|
|
@@ -124,11 +112,10 @@ function readTimeZone(cookie) {
|
|
|
124
112
|
*
|
|
125
113
|
* @param context The request context (`@Context()` in a controller)
|
|
126
114
|
* @returns The period, its windows as `Date`s
|
|
127
|
-
* @throws HTTPResult 400,
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* them, `none` with a window)
|
|
115
|
+
* @throws HTTPResult 400, with a sentence naming the fault, when a bound is
|
|
116
|
+
* not an ISO instant, a window lacks a bound or ends before it starts, a
|
|
117
|
+
* preset or a comparison is unknown, or the parameters contradict each
|
|
118
|
+
* other (`all` with bounds, a preset without them, `none` with a window)
|
|
132
119
|
*/
|
|
133
120
|
function readPeriodRequest(context) {
|
|
134
121
|
const query = context.url.searchParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"period-request.js","sourceRoot":"","sources":["../src/period-request.ts"],"names":[],"mappings":";;;;AAAA,6DAImC;AACnC,sEAA0F;AAC1F,4DAKgC;AAChC,4DAAuD;AA2CvD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,8EAA8E;AAC9E,MAAM,WAAW,GACf,+EAA+E,CAAC;
|
|
1
|
+
{"version":3,"file":"period-request.js","sourceRoot":"","sources":["../src/period-request.ts"],"names":[],"mappings":";;;;AAAA,6DAImC;AACn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AQ,EAAE,CAAC;KAC9B,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACU,QAAA,MAAM,GAAG,IAAA,8CAAiC,EACrD,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;IACrB,IAAA,oCAAoB,EAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAC9D,CAAC,CACF,CAAC"}
|
package/dist/tenant-access.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.RegisterTenantAccessGate = RegisterTenantAccessGate;
|
|
|
5
5
|
exports.AssertTenantAccess = AssertTenantAccess;
|
|
6
6
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
7
7
|
const interface_core_1 = require("@antelopejs/interface-core");
|
|
8
|
+
const registration_owner_1 = require("./internal/registration-owner");
|
|
8
9
|
const HTTP_FORBIDDEN_STATUS = 403;
|
|
9
10
|
/**
|
|
10
11
|
* @internal
|
|
@@ -40,6 +41,7 @@ var internal;
|
|
|
40
41
|
* table-view data routes.
|
|
41
42
|
*/
|
|
42
43
|
function RegisterTenantAccessGate(info) {
|
|
44
|
+
registration_owner_1.registrationOwners.stamp(info);
|
|
43
45
|
internal.RegisterTenantAccessGate.register(info);
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-access.js","sourceRoot":"","sources":["../src/tenant-access.ts"],"names":[],"mappings":";;;;;AAAA,6DAAuD;AACvD,+DAGoC;
|
|
1
|
+
{"version":3,"file":"tenant-access.js","sourceRoot":"","sources":["../src/tenant-access.ts"],"names":[],"mappings":";;;;;AAAA,6DAAuD;AACvD,+DAGoC;AACpC,sEAAmE;AAEnE,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAiBlC;;GAEG;AACH,IAAiB,QAAQ,CAIxB;AAJD,WAAiB,QAAQ;IACV,iCAAwB,GAAG,IAAI,iCAAgB,EAEzD,CAAC;AACN,CAAC,EAJgB,QAAQ,aAAR,QAAQ,GAAR,QAAQ,QAIxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,kCAAyC,IAA0B;IACjE,uCAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,QAAQ,CAAC,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACU,QAAA,iBAAiB,GAC5B,IAAA,kCAAiB,GAKd,CAAC;AAQN;;;;;;;;GAQG;AACU,QAAA,oBAAoB,GAC/B,IAAA,kCAAiB,GAKd,CAAC;AAEN;;;GAGG;AACI,KAAK,6BACV,MAA0B,EAC1B,QAAgB;IAEhB,MAAM,MAAM,GAAG,MAAM,IAAA,QAAA,iBAAiB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,0BAAU,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
|
@@ -154,7 +154,7 @@ export class DashboardController extends Controller("/api/dashboard") {
|
|
|
154
154
|
|
|
155
155
|
`PeriodRequest` has `preset?: PeriodPreset`, `range?: PeriodWindow` (absent for `all`), `compare?: PeriodWindow` (absent with no comparison, and for `all`), `comparison: PeriodComparison` (`none` exactly when `compare` is absent) and `timeZone?: string`, the browser's zone from the `dms-time-zone` cookie. A `PeriodWindow` is `{ from: Date; to: Date }`, both included. The windows are the instants the selector resolved in the browser's time zone, so the route needs no preset logic of its own.
|
|
156
156
|
|
|
157
|
-
A malformed period throws `HTTPResult` 400
|
|
157
|
+
A malformed period throws `HTTPResult` 400 with a sentence naming the fault: a bound that is not an ISO instant, a window missing a bound or ending before it starts, an unknown preset or comparison, `all` with bounds, another preset without them, or `none` with a comparison window. A request with no period parameters reads as `all` with no comparison.
|
|
158
158
|
|
|
159
159
|
## `SaveComponentFiles`
|
|
160
160
|
|
|
@@ -206,7 +206,7 @@ generateTenantAssignmentToken(
|
|
|
206
206
|
validateTenantAssignmentToken(token: string): Promise<{ id: string; user: User }>
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
A tenant-assignment token lives fifteen minutes. `validateTenantAssignmentToken` rejects a token that was not issued for the tenant-assignment purpose, and returns the user id together with the loaded `User`. Like the two-factor check, every refusal is the same `HTTPResult(401, "
|
|
209
|
+
A tenant-assignment token lives fifteen minutes. `validateTenantAssignmentToken` rejects a token that was not issued for the tenant-assignment purpose, and returns the user id together with the loaded `User`. Like the two-factor check, every refusal is the same `HTTPResult(401, "Invalid tenant assignment token")`.
|
|
210
210
|
|
|
211
211
|
```typescript
|
|
212
212
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/interface-dms",
|
|
3
|
-
"version": "0.17.6-next.
|
|
3
|
+
"version": "0.17.6-next.1183.ga9db169",
|
|
4
4
|
"description": "Public AntelopeJS interfaces of the DMS: pages, components, permissions, tenancy, auth, notifications and HTML rendering.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"provenance": true,
|
|
132
132
|
"registry": "https://registry.npmjs.org/"
|
|
133
133
|
},
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "a9db16941e6ac2201ed865c05dca1591b6661344",
|
|
135
135
|
"scripts": {
|
|
136
136
|
"build": "rimraf dist && antelopejs-tsc",
|
|
137
137
|
"typecheck": "antelopejs-tsc --noEmit",
|