@astram/guard 0.17.0 → 0.19.0
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/audit/audit-chain-sealer.d.ts +90 -0
- package/dist/audit/audit-chain-sealer.d.ts.map +1 -0
- package/dist/audit/audit-chain-sealer.js +520 -0
- package/dist/audit/audit-seal-config.d.ts +22 -0
- package/dist/audit/audit-seal-config.d.ts.map +1 -0
- package/dist/audit/audit-seal-config.js +35 -0
- package/dist/audit/audit-sealer.service.d.ts +62 -0
- package/dist/audit/audit-sealer.service.d.ts.map +1 -0
- package/dist/audit/audit-sealer.service.js +197 -0
- package/dist/audit/node-sha256-hash.d.ts +6 -0
- package/dist/audit/node-sha256-hash.d.ts.map +1 -0
- package/dist/audit/node-sha256-hash.js +16 -0
- package/dist/auth/account.controller.d.ts +3 -1
- package/dist/auth/account.controller.d.ts.map +1 -1
- package/dist/auth/account.controller.js +10 -6
- package/dist/auth/auth.controller.d.ts +3 -1
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +13 -11
- package/dist/auth/auth.module.d.ts +14 -2
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js +54 -7
- package/dist/auth/confirm-email.controller.d.ts +3 -1
- package/dist/auth/confirm-email.controller.d.ts.map +1 -1
- package/dist/auth/confirm-email.controller.js +9 -5
- package/dist/auth/email-change-messages.d.ts +2 -0
- package/dist/auth/email-change-messages.d.ts.map +1 -1
- package/dist/auth/email-change-messages.js +2 -0
- package/dist/auth/password-reset-message.d.ts +7 -0
- package/dist/auth/password-reset-message.d.ts.map +1 -0
- package/dist/auth/password-reset-message.js +17 -0
- package/dist/auth/persistence.module.d.ts +2 -2
- package/dist/auth/persistence.module.d.ts.map +1 -1
- package/dist/auth/persistence.module.js +19 -3
- package/dist/auth/ports/email-sender.d.ts +7 -7
- package/dist/auth/ports/email-sender.d.ts.map +1 -1
- package/dist/auth/tokens.d.ts +14 -0
- package/dist/auth/tokens.d.ts.map +1 -1
- package/dist/auth/tokens.js +15 -1
- package/dist/authentication/credential-provisioner.d.ts +5 -0
- package/dist/authentication/credential-provisioner.d.ts.map +1 -1
- package/dist/authentication/mariadb-credential-provisioner.d.ts +1 -0
- package/dist/authentication/mariadb-credential-provisioner.d.ts.map +1 -1
- package/dist/authentication/mariadb-credential-provisioner.js +24 -1
- package/dist/config/message-config.d.ts +70 -0
- package/dist/config/message-config.d.ts.map +1 -0
- package/dist/config/message-config.js +249 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -3
- package/dist/internal.d.ts +10 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +13 -1
- package/dist/messaging/deliver-email.d.ts +10 -0
- package/dist/messaging/deliver-email.d.ts.map +1 -0
- package/dist/messaging/deliver-email.js +19 -0
- package/dist/messaging/email-delivery.d.ts +42 -0
- package/dist/messaging/email-delivery.d.ts.map +1 -0
- package/dist/messaging/email-delivery.js +117 -0
- package/dist/messaging/message-dispatcher.d.ts +66 -0
- package/dist/messaging/message-dispatcher.d.ts.map +1 -0
- package/dist/messaging/message-dispatcher.js +133 -0
- package/dist/messaging/recipient-mask.d.ts +7 -0
- package/dist/messaging/recipient-mask.d.ts.map +1 -0
- package/dist/messaging/recipient-mask.js +15 -0
- package/dist/module/shield.module.d.ts +5 -3
- package/dist/module/shield.module.d.ts.map +1 -1
- package/package.json +15 -5
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one exit for framework messages (G-010, docs/features/message-delivery/SPEC.md R6, R9, R10;
|
|
3
|
+
* spec P-1). Every framework email — password reset, invite, email-change confirmation, security
|
|
4
|
+
* notices — goes through {@link MessageDispatcher.sendEmail}, which:
|
|
5
|
+
* - bounds the send (the provider gets an abort signal at `timeoutMs`; the call itself settles by
|
|
6
|
+
* `timeoutMs + graceMs` even if the provider ignores the signal);
|
|
7
|
+
* - records `message.sent` / `message.failed` with channel, provider, purpose, masked recipient
|
|
8
|
+
* and the provider's message id or the failure class — never the link, subject or body;
|
|
9
|
+
* - never throws, so a delivery failure never changes a public response.
|
|
10
|
+
*
|
|
11
|
+
* It wraps whatever is bound: an `@astram/messaging` adapter (`emailSender: 'env'`), an app's own
|
|
12
|
+
* `EmailSender` (provider `custom`) or the dev log sender (`log`). `'disabled'` binds no provider
|
|
13
|
+
* and audits nothing.
|
|
14
|
+
*/
|
|
15
|
+
import { type AuditEvent, type DeliveryFailureClass, type EmailMessage, type EmailProvider, type MessagePurpose } from '@astram/core';
|
|
16
|
+
import type { EmailSender } from '../auth/ports/email-sender.js';
|
|
17
|
+
/** Who the message is about, for the audit row (from the session or the resolved credential). */
|
|
18
|
+
export interface MessageAuditContext {
|
|
19
|
+
readonly actorId: string;
|
|
20
|
+
readonly tenantId: string;
|
|
21
|
+
}
|
|
22
|
+
export type EmailDeliveryOutcome = {
|
|
23
|
+
readonly status: 'sent';
|
|
24
|
+
readonly provider: string;
|
|
25
|
+
readonly messageId?: string;
|
|
26
|
+
} | {
|
|
27
|
+
readonly status: 'failed';
|
|
28
|
+
readonly provider: string;
|
|
29
|
+
readonly failureClass: DeliveryFailureClass;
|
|
30
|
+
} | {
|
|
31
|
+
readonly status: 'disabled';
|
|
32
|
+
};
|
|
33
|
+
export interface MessageDispatcher {
|
|
34
|
+
/** `false` when mail is `'disabled'`: nothing can be delivered. */
|
|
35
|
+
readonly emailEnabled: boolean;
|
|
36
|
+
sendEmail(purpose: MessagePurpose, message: EmailMessage, context: MessageAuditContext): Promise<EmailDeliveryOutcome>;
|
|
37
|
+
}
|
|
38
|
+
/** Appends one audit event. Best-effort here: a failure is swallowed. */
|
|
39
|
+
export interface MessageAuditWriter {
|
|
40
|
+
record(event: AuditEvent): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
export interface MessageDispatcherOptions {
|
|
43
|
+
/** The per-send bound (`MESSAGE_SEND_TIMEOUT_MS`). */
|
|
44
|
+
readonly timeoutMs: number;
|
|
45
|
+
/** Extra time after the bound for a provider to honour the abort before the call settles. */
|
|
46
|
+
readonly graceMs?: number;
|
|
47
|
+
readonly now?: () => number;
|
|
48
|
+
}
|
|
49
|
+
export declare class GuardMessageDispatcher implements MessageDispatcher {
|
|
50
|
+
private readonly provider;
|
|
51
|
+
private readonly audit;
|
|
52
|
+
private readonly options;
|
|
53
|
+
readonly emailEnabled: boolean;
|
|
54
|
+
private readonly graceMs;
|
|
55
|
+
private readonly now;
|
|
56
|
+
constructor(provider: EmailProvider | null, audit: MessageAuditWriter | null, options: MessageDispatcherOptions);
|
|
57
|
+
sendEmail(purpose: MessagePurpose, message: EmailMessage, context: MessageAuditContext): Promise<EmailDeliveryOutcome>;
|
|
58
|
+
private bounded;
|
|
59
|
+
private record;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Adapt an app's `EmailSender` (or the dev log sender) to the provider port. The message passes
|
|
63
|
+
* through verbatim; the sender cannot be aborted, so the dispatcher's race settles the call.
|
|
64
|
+
*/
|
|
65
|
+
export declare function providerFromSender(sender: EmailSender, name: string): EmailProvider;
|
|
66
|
+
//# sourceMappingURL=message-dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-dispatcher.d.ts","sourceRoot":"","sources":["../../src/messaging/message-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,iGAAiG;AACjG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,oBAAoB,GAC5B;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KAAK,EAAE,kBAAkB,GAAG,IAAI,EAChC,OAAO,EAAE,wBAAwB;IAO9C,SAAS,CACb,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IA4BhC,OAAO,CAAC,OAAO;YAwBD,MAAM;CAiCrB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAQnF"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuardMessageDispatcher = void 0;
|
|
4
|
+
exports.providerFromSender = providerFromSender;
|
|
5
|
+
/**
|
|
6
|
+
* The one exit for framework messages (G-010, docs/features/message-delivery/SPEC.md R6, R9, R10;
|
|
7
|
+
* spec P-1). Every framework email — password reset, invite, email-change confirmation, security
|
|
8
|
+
* notices — goes through {@link MessageDispatcher.sendEmail}, which:
|
|
9
|
+
* - bounds the send (the provider gets an abort signal at `timeoutMs`; the call itself settles by
|
|
10
|
+
* `timeoutMs + graceMs` even if the provider ignores the signal);
|
|
11
|
+
* - records `message.sent` / `message.failed` with channel, provider, purpose, masked recipient
|
|
12
|
+
* and the provider's message id or the failure class — never the link, subject or body;
|
|
13
|
+
* - never throws, so a delivery failure never changes a public response.
|
|
14
|
+
*
|
|
15
|
+
* It wraps whatever is bound: an `@astram/messaging` adapter (`emailSender: 'env'`), an app's own
|
|
16
|
+
* `EmailSender` (provider `custom`) or the dev log sender (`log`). `'disabled'` binds no provider
|
|
17
|
+
* and audits nothing.
|
|
18
|
+
*/
|
|
19
|
+
const core_1 = require("@astram/core");
|
|
20
|
+
const email_address_js_1 = require("../auth/email-address.js");
|
|
21
|
+
const DEFAULT_GRACE_MS = 1_000;
|
|
22
|
+
class BoundExpired extends Error {
|
|
23
|
+
}
|
|
24
|
+
class GuardMessageDispatcher {
|
|
25
|
+
provider;
|
|
26
|
+
audit;
|
|
27
|
+
options;
|
|
28
|
+
emailEnabled;
|
|
29
|
+
graceMs;
|
|
30
|
+
now;
|
|
31
|
+
constructor(provider, audit, options) {
|
|
32
|
+
this.provider = provider;
|
|
33
|
+
this.audit = audit;
|
|
34
|
+
this.options = options;
|
|
35
|
+
this.emailEnabled = provider !== null;
|
|
36
|
+
this.graceMs = options.graceMs ?? DEFAULT_GRACE_MS;
|
|
37
|
+
this.now = options.now ?? Date.now;
|
|
38
|
+
}
|
|
39
|
+
async sendEmail(purpose, message, context) {
|
|
40
|
+
const provider = this.provider;
|
|
41
|
+
if (provider === null)
|
|
42
|
+
return { status: 'disabled' };
|
|
43
|
+
let outcome;
|
|
44
|
+
let status;
|
|
45
|
+
try {
|
|
46
|
+
const receipt = await this.bounded(provider, message);
|
|
47
|
+
outcome = {
|
|
48
|
+
status: 'sent',
|
|
49
|
+
provider: receipt.provider || provider.name,
|
|
50
|
+
...(receipt.messageId ? { messageId: receipt.messageId } : {}),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
const failureClass = e instanceof BoundExpired
|
|
55
|
+
? 'timeout'
|
|
56
|
+
: e instanceof core_1.MessageDeliveryError
|
|
57
|
+
? e.failureClass
|
|
58
|
+
: 'transient';
|
|
59
|
+
if (e instanceof core_1.MessageDeliveryError)
|
|
60
|
+
status = e.status;
|
|
61
|
+
outcome = { status: 'failed', provider: provider.name, failureClass };
|
|
62
|
+
}
|
|
63
|
+
await this.record(purpose, message.to, context, outcome, status);
|
|
64
|
+
return outcome;
|
|
65
|
+
}
|
|
66
|
+
bounded(provider, message) {
|
|
67
|
+
const signal = AbortSignal.timeout(this.options.timeoutMs);
|
|
68
|
+
let timer;
|
|
69
|
+
const expiry = new Promise((_, reject) => {
|
|
70
|
+
timer = setTimeout(() => reject(new BoundExpired()), this.options.timeoutMs + this.graceMs);
|
|
71
|
+
timer.unref?.();
|
|
72
|
+
});
|
|
73
|
+
// Started inside a promise so a provider that throws synchronously still settles the race
|
|
74
|
+
// (never an orphaned expiry rejection, and the timer below is always cleared).
|
|
75
|
+
const send = Promise.resolve()
|
|
76
|
+
.then(() => provider.send(message, { signal }))
|
|
77
|
+
.catch((e) => {
|
|
78
|
+
// A provider that stopped on our abort reports it however it likes: it is the bound.
|
|
79
|
+
if (signal.aborted &&
|
|
80
|
+
!(e instanceof core_1.MessageDeliveryError && e.failureClass !== 'timeout')) {
|
|
81
|
+
throw new BoundExpired();
|
|
82
|
+
}
|
|
83
|
+
throw e;
|
|
84
|
+
});
|
|
85
|
+
return Promise.race([send, expiry]).finally(() => clearTimeout(timer));
|
|
86
|
+
}
|
|
87
|
+
async record(purpose, to, context, outcome, status) {
|
|
88
|
+
if (this.audit === null || outcome.status === 'disabled')
|
|
89
|
+
return;
|
|
90
|
+
const attributes = {
|
|
91
|
+
channel: 'email',
|
|
92
|
+
provider: outcome.provider,
|
|
93
|
+
purpose,
|
|
94
|
+
recipient: (0, email_address_js_1.maskEmail)(to),
|
|
95
|
+
};
|
|
96
|
+
if (outcome.status === 'sent') {
|
|
97
|
+
if (outcome.messageId)
|
|
98
|
+
attributes.messageId = outcome.messageId;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
attributes.failureClass = outcome.failureClass;
|
|
102
|
+
if (status !== undefined)
|
|
103
|
+
attributes.status = status;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
await this.audit.record({
|
|
107
|
+
type: purpose === 'invite' ? 'admin_action' : 'authentication',
|
|
108
|
+
occurredAtMs: this.now(),
|
|
109
|
+
actorId: context.actorId,
|
|
110
|
+
tenantId: context.tenantId,
|
|
111
|
+
action: { key: outcome.status === 'sent' ? 'message.sent' : 'message.failed' },
|
|
112
|
+
attributes,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// Best-effort: an audit outage never fails a delivery the user already got (or did not).
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.GuardMessageDispatcher = GuardMessageDispatcher;
|
|
121
|
+
/**
|
|
122
|
+
* Adapt an app's `EmailSender` (or the dev log sender) to the provider port. The message passes
|
|
123
|
+
* through verbatim; the sender cannot be aborted, so the dispatcher's race settles the call.
|
|
124
|
+
*/
|
|
125
|
+
function providerFromSender(sender, name) {
|
|
126
|
+
return {
|
|
127
|
+
name,
|
|
128
|
+
send: async (message) => {
|
|
129
|
+
await sender.send(message);
|
|
130
|
+
return { provider: name };
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The masked form of a phone number for audit rows (G-010 R9): `+`, the first two digits, one `*`
|
|
3
|
+
* per hidden digit, the last two digits (`+919876543210` → `+91********10`). A value that is not
|
|
4
|
+
* E.164 is never echoed (`***`). Emails use `maskEmail`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function maskPhone(value: string): string;
|
|
7
|
+
//# sourceMappingURL=recipient-mask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipient-mask.d.ts","sourceRoot":"","sources":["../../src/messaging/recipient-mask.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI/C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maskPhone = maskPhone;
|
|
4
|
+
const core_1 = require("@astram/core");
|
|
5
|
+
/**
|
|
6
|
+
* The masked form of a phone number for audit rows (G-010 R9): `+`, the first two digits, one `*`
|
|
7
|
+
* per hidden digit, the last two digits (`+919876543210` → `+91********10`). A value that is not
|
|
8
|
+
* E.164 is never echoed (`***`). Emails use `maskEmail`.
|
|
9
|
+
*/
|
|
10
|
+
function maskPhone(value) {
|
|
11
|
+
if (!(0, core_1.isE164PhoneNumber)(value))
|
|
12
|
+
return '***';
|
|
13
|
+
const digits = value.slice(1);
|
|
14
|
+
return `+${digits.slice(0, 2)}${'*'.repeat(digits.length - 4)}${digits.slice(-2)}`;
|
|
15
|
+
}
|
|
@@ -115,8 +115,10 @@ export interface ShieldModuleOptions {
|
|
|
115
115
|
* sender, or `'disabled'` (no-op, forgot-password still 204). REQUIRED under
|
|
116
116
|
* `auth: true` unless the raw `NODE_ENV` is `development`/`test` (where the dev
|
|
117
117
|
* `LogEmailSender` is the default); otherwise boot fails (security hardening #6).
|
|
118
|
+
* `'env'` (G-010) reads the provider from `EMAIL_PROVIDER` and the `EMAIL_*` / provider
|
|
119
|
+
* variables (needs the `@astram/messaging` package; runbook §6).
|
|
118
120
|
*/
|
|
119
|
-
readonly emailSender?: EmailSender | 'disabled';
|
|
121
|
+
readonly emailSender?: EmailSender | 'disabled' | 'env';
|
|
120
122
|
readonly recoveryCodeStore?: RecoveryCodeStore;
|
|
121
123
|
readonly profileWriter?: ProfileWriter;
|
|
122
124
|
readonly sessionSweeper?: SessionSweeper;
|
|
@@ -248,8 +250,8 @@ export interface ShieldModuleAsyncOptions {
|
|
|
248
250
|
*/
|
|
249
251
|
readonly credentialWriter?: CredentialWriter;
|
|
250
252
|
readonly resetTokenStore?: ResetTokenStore;
|
|
251
|
-
/** See {@link ShieldModuleOptions.emailSender} (a sender, or `'
|
|
252
|
-
readonly emailSender?: EmailSender | 'disabled';
|
|
253
|
+
/** See {@link ShieldModuleOptions.emailSender} (a sender, `'disabled'` or `'env'`). */
|
|
254
|
+
readonly emailSender?: EmailSender | 'disabled' | 'env';
|
|
253
255
|
readonly recoveryCodeStore?: RecoveryCodeStore;
|
|
254
256
|
readonly profileWriter?: ProfileWriter;
|
|
255
257
|
readonly sessionSweeper?: SessionSweeper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shield.module.d.ts","sourceRoot":"","sources":["../../src/module/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AAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IACvD;;;;OAIG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IACrD;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAC/C,+FAA+F;IAC/F,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CACxC;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAEa,YAAY;IACvB,6DAA6D;IAC7D,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;IAiHhE;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,aAAa;CA6HtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astram/guard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Astram framework — the enforcement guard + real-world adapters (the 'hands'). One global deny-by-default gate every request passes through (ADR-0002), classification decorators, boot-pool assertion (ADR-0018), the forRoot() registration seam, and the DB/Redis/crypto adapters that connect the sealed core to a real backend. Depends on @astram/core (ADR-0003, ADR-0023).",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -36,17 +36,21 @@
|
|
|
36
36
|
"argon2": "^0.41.1",
|
|
37
37
|
"ioredis": "^5.4.1",
|
|
38
38
|
"mariadb": "^3.5.4",
|
|
39
|
-
"@astram/
|
|
40
|
-
"@astram/
|
|
39
|
+
"@astram/core": "1.10.0",
|
|
40
|
+
"@astram/engine": "0.10.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@nestjs/common": "^11",
|
|
44
44
|
"@nestjs/core": "^11",
|
|
45
45
|
"@nestjs/platform-express": "^11",
|
|
46
46
|
"reflect-metadata": "^0.2",
|
|
47
|
-
"rxjs": "^7"
|
|
47
|
+
"rxjs": "^7",
|
|
48
|
+
"@astram/messaging": "^0.1.2"
|
|
48
49
|
},
|
|
49
50
|
"peerDependenciesMeta": {
|
|
51
|
+
"@astram/messaging": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
50
54
|
"@nestjs/platform-express": {
|
|
51
55
|
"optional": true
|
|
52
56
|
}
|
|
@@ -63,7 +67,13 @@
|
|
|
63
67
|
"supertest": "^7.0.0",
|
|
64
68
|
"typescript": "^5.7.0",
|
|
65
69
|
"unplugin-swc": "^1.5.1",
|
|
66
|
-
"vitest": "^2.1.8"
|
|
70
|
+
"vitest": "^2.1.8",
|
|
71
|
+
"@astram/messaging": "0.1.2"
|
|
72
|
+
},
|
|
73
|
+
"repository": {
|
|
74
|
+
"type": "git",
|
|
75
|
+
"url": "git+https://github.com/ASTRAM-2-0/astram-framework.git",
|
|
76
|
+
"directory": "packages/guard"
|
|
67
77
|
},
|
|
68
78
|
"scripts": {
|
|
69
79
|
"build": "tsc -p tsconfig.build.json",
|