@fluxmail/core 0.24.0 → 0.26.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/access/conformance.d.ts +89 -0
- package/dist/access/conformance.d.ts.map +1 -0
- package/dist/access/conformance.js +628 -0
- package/dist/access/conformance.js.map +1 -0
- package/dist/access/index.d.ts +3 -0
- package/dist/access/index.d.ts.map +1 -0
- package/dist/access/index.js +3 -0
- package/dist/access/index.js.map +1 -0
- package/dist/access/rules.d.ts +149 -0
- package/dist/access/rules.d.ts.map +1 -0
- package/dist/access/rules.js +243 -0
- package/dist/access/rules.js.map +1 -0
- package/dist/mcp/clients.d.ts.map +1 -1
- package/dist/mcp/clients.js +4 -0
- package/dist/mcp/clients.js.map +1 -1
- package/dist/mcp/tools.d.ts +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.generated.d.ts.map +1 -1
- package/dist/mcp/tools.generated.js +137 -5
- package/dist/mcp/tools.generated.js.map +1 -1
- package/dist/mcp/tools.js +19 -2
- package/dist/mcp/tools.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type AccessCredential, type AccessDecision, type AccessDenialReason, type AccessMailbox, type AccessMember, type MailboxAccess, type MemberRole } from './rules.js';
|
|
2
|
+
export declare const ACCESS_PRODUCTS: readonly ["self-hosted", "cloud"];
|
|
3
|
+
export type AccessProduct = (typeof ACCESS_PRODUCTS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Members, mailboxes and credentials a product stores before running an action.
|
|
6
|
+
* Every id a world refers to is defined in it, so a product can insert it under
|
|
7
|
+
* its own foreign keys.
|
|
8
|
+
*/
|
|
9
|
+
export interface AccessWorld {
|
|
10
|
+
members: readonly AccessMember[];
|
|
11
|
+
mailboxes: readonly AccessMailbox[];
|
|
12
|
+
credentials?: readonly AccessCredential[];
|
|
13
|
+
}
|
|
14
|
+
export type AccessAction = {
|
|
15
|
+
type: 'read_mailbox';
|
|
16
|
+
actorId: string;
|
|
17
|
+
mailboxId: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'credential_read_mailbox';
|
|
20
|
+
credentialId: string;
|
|
21
|
+
mailboxId: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'see_mailbox_metadata';
|
|
24
|
+
actorId: string;
|
|
25
|
+
mailboxId: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'manage_mailbox';
|
|
28
|
+
actorId: string;
|
|
29
|
+
mailboxId: string;
|
|
30
|
+
} | {
|
|
31
|
+
type: 'change_mailbox_connection';
|
|
32
|
+
actorId: string;
|
|
33
|
+
mailboxId: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'change_mailbox_access';
|
|
36
|
+
actorId: string;
|
|
37
|
+
mailboxId: string;
|
|
38
|
+
access: MailboxAccess;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'reassign_mailbox';
|
|
41
|
+
actorId: string;
|
|
42
|
+
mailboxId: string;
|
|
43
|
+
newOwnerId: string;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'connect_mailbox';
|
|
46
|
+
actorId: string;
|
|
47
|
+
ownerId: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'issue_credential';
|
|
50
|
+
actorId: string;
|
|
51
|
+
ownerId: string;
|
|
52
|
+
mailboxIds: readonly string[] | null;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'manage_member';
|
|
55
|
+
actorId: string;
|
|
56
|
+
targetId: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'remove_member';
|
|
59
|
+
actorId: string;
|
|
60
|
+
targetId: string;
|
|
61
|
+
newOwnerId: string | null;
|
|
62
|
+
} | {
|
|
63
|
+
type: 'assign_role';
|
|
64
|
+
actorId: string;
|
|
65
|
+
targetId: string;
|
|
66
|
+
role: MemberRole;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'transfer_ownership';
|
|
69
|
+
actorId: string;
|
|
70
|
+
targetId: string;
|
|
71
|
+
};
|
|
72
|
+
/** Every action type, so products can check that they run each one. */
|
|
73
|
+
export declare const ACCESS_ACTION_TYPES: AccessAction["type"][];
|
|
74
|
+
export interface AccessConformanceCase {
|
|
75
|
+
name: string;
|
|
76
|
+
/**
|
|
77
|
+
* Products that offer this behavior and must pass the case. An empty list marks
|
|
78
|
+
* a rule neither product offers yet, kept so a product that adds it inherits it.
|
|
79
|
+
*/
|
|
80
|
+
products: readonly AccessProduct[];
|
|
81
|
+
world: AccessWorld;
|
|
82
|
+
action: AccessAction;
|
|
83
|
+
/** `true`, or the reason it is refused. Read checks are refused with `no_mailbox_access`. */
|
|
84
|
+
expected: true | AccessDenialReason;
|
|
85
|
+
}
|
|
86
|
+
/** Runs one action against the shared rules. Products run the same world and action against their storage. */
|
|
87
|
+
export declare function evaluateAccessAction(world: AccessWorld, action: AccessAction): AccessDecision;
|
|
88
|
+
export declare const ACCESS_CONFORMANCE_CASES: readonly AccessConformanceCase[];
|
|
89
|
+
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../src/access/conformance.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,eAAe,mCAAoC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;IACpC,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC3C;AAED,MAAM,MAAM,YAAY,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