@jini-ai/admin 0.1.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/LICENSE +201 -0
- package/README.md +138 -0
- package/dist/browser/index.d.ts +8 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +8 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/navigation.d.ts +39 -0
- package/dist/browser/navigation.d.ts.map +1 -0
- package/dist/browser/navigation.js +113 -0
- package/dist/browser/navigation.js.map +1 -0
- package/dist/core/gated/types.d.ts +87 -0
- package/dist/core/gated/types.d.ts.map +1 -0
- package/dist/core/gated/types.js +37 -0
- package/dist/core/gated/types.js.map +1 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/manifest/rules.d.ts +84 -0
- package/dist/core/manifest/rules.d.ts.map +1 -0
- package/dist/core/manifest/rules.js +130 -0
- package/dist/core/manifest/rules.js.map +1 -0
- package/dist/core/manifest/types.d.ts +154 -0
- package/dist/core/manifest/types.d.ts.map +1 -0
- package/dist/core/manifest/types.js +31 -0
- package/dist/core/manifest/types.js.map +1 -0
- package/dist/core/permissions/rules.d.ts +32 -0
- package/dist/core/permissions/rules.d.ts.map +1 -0
- package/dist/core/permissions/rules.js +34 -0
- package/dist/core/permissions/rules.js.map +1 -0
- package/dist/core/ports/analytics.d.ts +35 -0
- package/dist/core/ports/analytics.d.ts.map +1 -0
- package/dist/core/ports/analytics.js +14 -0
- package/dist/core/ports/analytics.js.map +1 -0
- package/dist/core/ports/auth.d.ts +49 -0
- package/dist/core/ports/auth.d.ts.map +1 -0
- package/dist/core/ports/auth.js +19 -0
- package/dist/core/ports/auth.js.map +1 -0
- package/dist/core/ports/comments.d.ts +90 -0
- package/dist/core/ports/comments.d.ts.map +1 -0
- package/dist/core/ports/comments.js +24 -0
- package/dist/core/ports/comments.js.map +1 -0
- package/dist/core/ports/database.d.ts +101 -0
- package/dist/core/ports/database.d.ts.map +1 -0
- package/dist/core/ports/database.js +2 -0
- package/dist/core/ports/database.js.map +1 -0
- package/dist/core/ports/forms.d.ts +130 -0
- package/dist/core/ports/forms.d.ts.map +1 -0
- package/dist/core/ports/forms.js +62 -0
- package/dist/core/ports/forms.js.map +1 -0
- package/dist/core/ports/identity.d.ts +114 -0
- package/dist/core/ports/identity.d.ts.map +1 -0
- package/dist/core/ports/identity.js +28 -0
- package/dist/core/ports/identity.js.map +1 -0
- package/dist/core/ports/index.d.ts +21 -0
- package/dist/core/ports/index.d.ts.map +1 -0
- package/dist/core/ports/index.js +6 -0
- package/dist/core/ports/index.js.map +1 -0
- package/dist/core/ports/integrations.d.ts +81 -0
- package/dist/core/ports/integrations.d.ts.map +1 -0
- package/dist/core/ports/integrations.js +21 -0
- package/dist/core/ports/integrations.js.map +1 -0
- package/dist/core/ports/media.d.ts +74 -0
- package/dist/core/ports/media.d.ts.map +1 -0
- package/dist/core/ports/media.js +28 -0
- package/dist/core/ports/media.js.map +1 -0
- package/dist/core/ports/members.d.ts +50 -0
- package/dist/core/ports/members.d.ts.map +1 -0
- package/dist/core/ports/members.js +17 -0
- package/dist/core/ports/members.js.map +1 -0
- package/dist/core/ports/menus.d.ts +179 -0
- package/dist/core/ports/menus.d.ts.map +1 -0
- package/dist/core/ports/menus.js +70 -0
- package/dist/core/ports/menus.js.map +1 -0
- package/dist/core/ports/plugins.d.ts +68 -0
- package/dist/core/ports/plugins.d.ts.map +1 -0
- package/dist/core/ports/plugins.js +27 -0
- package/dist/core/ports/plugins.js.map +1 -0
- package/dist/core/ports/recovery.d.ts +171 -0
- package/dist/core/ports/recovery.d.ts.map +1 -0
- package/dist/core/ports/recovery.js +2 -0
- package/dist/core/ports/recovery.js.map +1 -0
- package/dist/core/ports/redirects.d.ts +139 -0
- package/dist/core/ports/redirects.d.ts.map +1 -0
- package/dist/core/ports/redirects.js +55 -0
- package/dist/core/ports/redirects.js.map +1 -0
- package/dist/core/ports/seo.d.ts +147 -0
- package/dist/core/ports/seo.d.ts.map +1 -0
- package/dist/core/ports/seo.js +39 -0
- package/dist/core/ports/seo.js.map +1 -0
- package/dist/core/ports/settings.d.ts +87 -0
- package/dist/core/ports/settings.d.ts.map +1 -0
- package/dist/core/ports/settings.js +23 -0
- package/dist/core/ports/settings.js.map +1 -0
- package/dist/core/ports/workspace.d.ts +44 -0
- package/dist/core/ports/workspace.d.ts.map +1 -0
- package/dist/core/ports/workspace.js +29 -0
- package/dist/core/ports/workspace.js.map +1 -0
- package/dist/core/routing/rules.d.ts +54 -0
- package/dist/core/routing/rules.d.ts.map +1 -0
- package/dist/core/routing/rules.js +113 -0
- package/dist/core/routing/rules.js.map +1 -0
- package/dist/core/routing/types.d.ts +36 -0
- package/dist/core/routing/types.d.ts.map +1 -0
- package/dist/core/routing/types.js +17 -0
- package/dist/core/routing/types.js.map +1 -0
- package/dist/core/transport/errors.d.ts +53 -0
- package/dist/core/transport/errors.d.ts.map +1 -0
- package/dist/core/transport/errors.js +63 -0
- package/dist/core/transport/errors.js.map +1 -0
- package/dist/core/transport/http.d.ts +63 -0
- package/dist/core/transport/http.d.ts.map +1 -0
- package/dist/core/transport/http.js +63 -0
- package/dist/core/transport/http.js.map +1 -0
- package/dist/core/transport/index.d.ts +5 -0
- package/dist/core/transport/index.d.ts.map +1 -0
- package/dist/core/transport/index.js +3 -0
- package/dist/core/transport/index.js.map +1 -0
- package/dist/core/transport/types.d.ts +81 -0
- package/dist/core/transport/types.d.ts.map +1 -0
- package/dist/core/transport/types.js +43 -0
- package/dist/core/transport/types.js.map +1 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.d.ts +40 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.d.ts.map +1 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.d.ts +22 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.d.ts.map +1 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js +59 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js.map +1 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.js +40 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.js.map +1 -0
- package/dist/react/components/ConfirmButton.d.ts +39 -0
- package/dist/react/components/ConfirmButton.d.ts.map +1 -0
- package/dist/react/components/ConfirmButton.js +79 -0
- package/dist/react/components/ConfirmButton.js.map +1 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts +90 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +49 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts.map +1 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +81 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js.map +1 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.js +92 -0
- package/dist/react/components/ConfirmDialog/ConfirmDialog.js.map +1 -0
- package/dist/react/components/ConfirmDialog.d.ts +57 -0
- package/dist/react/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/react/components/ConfirmDialog.js +85 -0
- package/dist/react/components/ConfirmDialog.js.map +1 -0
- package/dist/react/components/DataTable.d.ts +97 -0
- package/dist/react/components/DataTable.d.ts.map +1 -0
- package/dist/react/components/DataTable.js +20 -0
- package/dist/react/components/DataTable.js.map +1 -0
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +25 -0
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts.map +1 -0
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +148 -0
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js.map +1 -0
- package/dist/react/components/RowMenu/RowMenu.d.ts +77 -0
- package/dist/react/components/RowMenu/RowMenu.d.ts.map +1 -0
- package/dist/react/components/RowMenu/RowMenu.hooks.d.ts +30 -0
- package/dist/react/components/RowMenu/RowMenu.hooks.d.ts.map +1 -0
- package/dist/react/components/RowMenu/RowMenu.hooks.js +154 -0
- package/dist/react/components/RowMenu/RowMenu.hooks.js.map +1 -0
- package/dist/react/components/RowMenu/RowMenu.js +46 -0
- package/dist/react/components/RowMenu/RowMenu.js.map +1 -0
- package/dist/react/components/RowMenu.d.ts +44 -0
- package/dist/react/components/RowMenu.d.ts.map +1 -0
- package/dist/react/components/RowMenu.js +149 -0
- package/dist/react/components/RowMenu.js.map +1 -0
- package/dist/react/components/Sidebar.d.ts +128 -0
- package/dist/react/components/Sidebar.d.ts.map +1 -0
- package/dist/react/components/Sidebar.js +168 -0
- package/dist/react/components/Sidebar.js.map +1 -0
- package/dist/react/hooks/use-nav-sections.d.ts +50 -0
- package/dist/react/hooks/use-nav-sections.d.ts.map +1 -0
- package/dist/react/hooks/use-nav-sections.js +112 -0
- package/dist/react/hooks/use-nav-sections.js.map +1 -0
- package/dist/react/hooks/use-sidebar-rail.d.ts +39 -0
- package/dist/react/hooks/use-sidebar-rail.d.ts.map +1 -0
- package/dist/react/hooks/use-sidebar-rail.js +93 -0
- package/dist/react/hooks/use-sidebar-rail.js.map +1 -0
- package/dist/react/index.d.ts +53 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +53 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/types.d.ts +28 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/types.js +23 -0
- package/dist/react/types.js.map +1 -0
- package/dist/server/composio/bounded-data.d.ts +36 -0
- package/dist/server/composio/bounded-data.d.ts.map +1 -0
- package/dist/server/composio/bounded-data.js +181 -0
- package/dist/server/composio/bounded-data.js.map +1 -0
- package/dist/server/composio/catalog.d.ts +147 -0
- package/dist/server/composio/catalog.d.ts.map +1 -0
- package/dist/server/composio/catalog.js +126 -0
- package/dist/server/composio/catalog.js.map +1 -0
- package/dist/server/composio/composio-config.d.ts +42 -0
- package/dist/server/composio/composio-config.d.ts.map +1 -0
- package/dist/server/composio/composio-config.js +145 -0
- package/dist/server/composio/composio-config.js.map +1 -0
- package/dist/server/composio/composio-descriptions.d.ts +16 -0
- package/dist/server/composio/composio-descriptions.d.ts.map +1 -0
- package/dist/server/composio/composio-descriptions.js +766 -0
- package/dist/server/composio/composio-descriptions.js.map +1 -0
- package/dist/server/composio/composio.d.ts +364 -0
- package/dist/server/composio/composio.d.ts.map +1 -0
- package/dist/server/composio/composio.js +1902 -0
- package/dist/server/composio/composio.js.map +1 -0
- package/dist/server/composio/errors.d.ts +15 -0
- package/dist/server/composio/errors.d.ts.map +1 -0
- package/dist/server/composio/errors.js +16 -0
- package/dist/server/composio/errors.js.map +1 -0
- package/dist/server/composio/file-lock.d.ts +13 -0
- package/dist/server/composio/file-lock.d.ts.map +1 -0
- package/dist/server/composio/file-lock.js +92 -0
- package/dist/server/composio/file-lock.js.map +1 -0
- package/dist/server/composio/index.d.ts +18 -0
- package/dist/server/composio/index.d.ts.map +1 -0
- package/dist/server/composio/index.js +7 -0
- package/dist/server/composio/index.js.map +1 -0
- package/dist/server/composio/json-schema.d.ts +93 -0
- package/dist/server/composio/json-schema.d.ts.map +1 -0
- package/dist/server/composio/json-schema.js +498 -0
- package/dist/server/composio/json-schema.js.map +1 -0
- package/dist/server/composio/output-protection.d.ts +32 -0
- package/dist/server/composio/output-protection.d.ts.map +1 -0
- package/dist/server/composio/output-protection.js +105 -0
- package/dist/server/composio/output-protection.js.map +1 -0
- package/dist/server/composio/service.d.ts +181 -0
- package/dist/server/composio/service.d.ts.map +1 -0
- package/dist/server/composio/service.js +758 -0
- package/dist/server/composio/service.js.map +1 -0
- package/dist/server/index.d.ts +15 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +15 -0
- package/dist/server/index.js.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `AdminIdentityPort` — operator users, roles, and policies.
|
|
3
|
+
*
|
|
4
|
+
* The first port extracted, and the pattern-setter for the other eleven. Chosen first because it
|
|
5
|
+
* is the largest coherent generic group in the corpus (17 of `api.ts`'s 134 methods), it carries
|
|
6
|
+
* no CMS vocabulary, and the reference implementation is already CRUD-complete.
|
|
7
|
+
*
|
|
8
|
+
* ## Two things deliberately NOT in this port
|
|
9
|
+
*
|
|
10
|
+
* **Deleting a user.** The reference implementation has no route for it (its admin user routes cover create,
|
|
11
|
+
* disable, enable, update, reset-password, and grant operations, nothing else), and disable is
|
|
12
|
+
* the correct primitive for an audited system — a deleted principal orphans its audit trail.
|
|
13
|
+
* Adding `deleteUser` here would put a method on the contract that the reference implementation
|
|
14
|
+
* cannot satisfy.
|
|
15
|
+
*
|
|
16
|
+
* **An error-code enum.** Codes like `GRANT_EXCEEDS_ISSUER` and `OWNER_REQUIRED` are real and
|
|
17
|
+
* load-bearing, but their operator-facing *wording* is host-specific — see `transport/errors.ts`
|
|
18
|
+
* on why a shared code->message table is a regression. Panels read `AdminApiError.code` and map
|
|
19
|
+
* it themselves.
|
|
20
|
+
*
|
|
21
|
+
* ## `members` is a different port
|
|
22
|
+
*
|
|
23
|
+
* Operator users (who administer the site) and members (end users who signed up) are distinct
|
|
24
|
+
* populations with distinct lifecycles — the reference implementation keeps them in separate route groups and so does
|
|
25
|
+
* this. `AdminMembersPort` is separate.
|
|
26
|
+
*/
|
|
27
|
+
/** An operator principal. */
|
|
28
|
+
export interface AdminIdentityUser {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly username: string;
|
|
31
|
+
readonly email?: string;
|
|
32
|
+
readonly disabled?: boolean;
|
|
33
|
+
readonly roleIds?: readonly string[];
|
|
34
|
+
readonly policyIds?: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/** A named bundle of policies. */
|
|
37
|
+
export interface AdminRole {
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly description?: string;
|
|
41
|
+
readonly policyIds?: readonly string[];
|
|
42
|
+
}
|
|
43
|
+
/** A named bundle of permission strings. */
|
|
44
|
+
export interface AdminPolicy {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly description?: string;
|
|
48
|
+
readonly permissions?: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
export interface AdminIdentityPort {
|
|
51
|
+
listUsers(): Promise<readonly AdminIdentityUser[]>;
|
|
52
|
+
createUser(input: {
|
|
53
|
+
username: string;
|
|
54
|
+
password: string;
|
|
55
|
+
email?: string;
|
|
56
|
+
}): Promise<AdminIdentityUser>;
|
|
57
|
+
updateUser(id: string, patch: {
|
|
58
|
+
email?: string;
|
|
59
|
+
}): Promise<AdminIdentityUser>;
|
|
60
|
+
/** Reversible; the audited alternative to deletion. See the file header. */
|
|
61
|
+
disableUser(id: string): Promise<AdminIdentityUser>;
|
|
62
|
+
enableUser(id: string): Promise<AdminIdentityUser>;
|
|
63
|
+
resetUserPassword(id: string, input: {
|
|
64
|
+
password: string;
|
|
65
|
+
}): Promise<{
|
|
66
|
+
ok: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Grants a role.
|
|
70
|
+
*
|
|
71
|
+
* Expect a `GRANT_EXCEEDS_ISSUER`-class rejection when the caller does not themselves hold
|
|
72
|
+
* everything the role confers — privilege escalation via grant is the obvious attack here, and
|
|
73
|
+
* the check is server-side. A panel must not pre-filter the role list as if that were the
|
|
74
|
+
* boundary; it may hide options as an affordance, but the rejection is authoritative.
|
|
75
|
+
*/
|
|
76
|
+
assignRole(userId: string, roleId: string): Promise<{
|
|
77
|
+
ok: boolean;
|
|
78
|
+
}>;
|
|
79
|
+
attachPolicy(userId: string, policyId: string): Promise<{
|
|
80
|
+
ok: boolean;
|
|
81
|
+
}>;
|
|
82
|
+
listRoles(): Promise<readonly AdminRole[]>;
|
|
83
|
+
createRole(input: {
|
|
84
|
+
name: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
}): Promise<AdminRole>;
|
|
87
|
+
updateRole(id: string, patch: {
|
|
88
|
+
name?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
}): Promise<AdminRole>;
|
|
91
|
+
/** Expect a conflict rejection when the role is still referenced by a principal. */
|
|
92
|
+
deleteRole(id: string): Promise<{
|
|
93
|
+
ok: boolean;
|
|
94
|
+
}>;
|
|
95
|
+
listPolicies(): Promise<readonly AdminPolicy[]>;
|
|
96
|
+
createPolicy(input: {
|
|
97
|
+
name: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
}): Promise<AdminPolicy>;
|
|
100
|
+
updatePolicy(id: string, patch: {
|
|
101
|
+
name?: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
}): Promise<AdminPolicy>;
|
|
104
|
+
deletePolicy(id: string): Promise<{
|
|
105
|
+
ok: boolean;
|
|
106
|
+
}>;
|
|
107
|
+
/** Adds or removes a single permission string on a policy. Granular by design: a whole-array
|
|
108
|
+
* replace makes two concurrent editors silently clobber each other. */
|
|
109
|
+
writePolicyPermission(policyId: string, input: {
|
|
110
|
+
permission: string;
|
|
111
|
+
granted: boolean;
|
|
112
|
+
}): Promise<AdminPolicy>;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/core/ports/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,6BAA6B;AAC7B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS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A;KAAE,CAAC,CAAC;IACnD;4EACwE;IACxE,qBAAqB,CACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAC9C,OAAO,CAAC,WAAW,CAAC,CAAC;CACzB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `AdminIdentityPort` — operator users, roles, and policies.
|
|
3
|
+
*
|
|
4
|
+
* The first port extracted, and the pattern-setter for the other eleven. Chosen first because it
|
|
5
|
+
* is the largest coherent generic group in the corpus (17 of `api.ts`'s 134 methods), it carries
|
|
6
|
+
* no CMS vocabulary, and the reference implementation is already CRUD-complete.
|
|
7
|
+
*
|
|
8
|
+
* ## Two things deliberately NOT in this port
|
|
9
|
+
*
|
|
10
|
+
* **Deleting a user.** The reference implementation has no route for it (its admin user routes cover create,
|
|
11
|
+
* disable, enable, update, reset-password, and grant operations, nothing else), and disable is
|
|
12
|
+
* the correct primitive for an audited system — a deleted principal orphans its audit trail.
|
|
13
|
+
* Adding `deleteUser` here would put a method on the contract that the reference implementation
|
|
14
|
+
* cannot satisfy.
|
|
15
|
+
*
|
|
16
|
+
* **An error-code enum.** Codes like `GRANT_EXCEEDS_ISSUER` and `OWNER_REQUIRED` are real and
|
|
17
|
+
* load-bearing, but their operator-facing *wording* is host-specific — see `transport/errors.ts`
|
|
18
|
+
* on why a shared code->message table is a regression. Panels read `AdminApiError.code` and map
|
|
19
|
+
* it themselves.
|
|
20
|
+
*
|
|
21
|
+
* ## `members` is a different port
|
|
22
|
+
*
|
|
23
|
+
* Operator users (who administer the site) and members (end users who signed up) are distinct
|
|
24
|
+
* populations with distinct lifecycles — the reference implementation keeps them in separate route groups and so does
|
|
25
|
+
* this. `AdminMembersPort` is separate.
|
|
26
|
+
*/
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/core/ports/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Barrel for every `@jini-ai/admin/core` port. See `README.md` in this directory for the one
|
|
3
|
+
* port that is deliberately absent (`execution`) and why.
|
|
4
|
+
*/
|
|
5
|
+
export type { AdminAuthPort, AdminAuthUser } from './auth.js';
|
|
6
|
+
export type { AdminMember, AdminMembersPort } from './members.js';
|
|
7
|
+
export type { AdminMedia, AdminMediaPort } from './media.js';
|
|
8
|
+
export type { AdminSettingsPort, SettingResolvedValue, SettingResetResponse, SettingScope, SettingValueResponse, } from './settings.js';
|
|
9
|
+
export type { AdminDatabasePort, AdminLedgerRow, AdminRestorePoint, AdminRestorePointSummary, MigrateForwardResult, RestorePointCostClass, } from './database.js';
|
|
10
|
+
export type { AdminDegradedBanner, AdminDisclosureResult, AdminRecoveryDeepLinkResult, AdminRecoveryPort, AdminRecoveryStatus, CategoryCount, DatabaseContextEnvelope, DegradedBannerActionKind, DegradedBannerKind, RestoreConfirmInput, RestoreExecuteInput, RestoreExecuteResult, } from './recovery.js';
|
|
11
|
+
export type { AdminIntegrationDelivery, AdminIntegrationDeliverySummary, AdminIntegrationSubscription, AdminIntegrationsPort, } from './integrations.js';
|
|
12
|
+
export type { AdminComment, AdminCommentsPort, AdminCommentsQueuePage, CommentModerationAction, CommentsSettings, CommentStatus, } from './comments.js';
|
|
13
|
+
export type { AdminExtensionEnabledResult, AdminExtensionsPort, AdminPlugin } from './plugins.js';
|
|
14
|
+
export type { AdminAnalyticsHit, AdminAnalyticsPort } from './analytics.js';
|
|
15
|
+
export type { AdminWorkspace, AdminWorkspacePort } from './workspace.js';
|
|
16
|
+
export type { AdminIdentityPort, AdminIdentityUser, AdminPolicy, AdminRole, } from './identity.js';
|
|
17
|
+
export type { AdminSeoAnalysis, AdminSeoIssue, AdminSeoMeta, AdminSeoOpenGraph, AdminSeoOverrides, AdminSeoPort, AdminSeoRobotsDirective, AdminSeoRobotsRule, AdminSeoSettings, AdminSeoTwitterCard, SeoIssueSeverity, SeoOpenGraphType, SeoTwitterCardKind, } from './seo.js';
|
|
18
|
+
export type { AdminRedirect, AdminRedirectCreateInput, AdminRedirectHitStats, AdminRedirectImportFailure, AdminRedirectImportResult, AdminRedirectListFilter, AdminRedirectsPort, AdminRedirectUpdatePatch, RedirectMatchType, RedirectSource, RedirectStatus, RedirectStatusCode, } from './redirects.js';
|
|
19
|
+
export type { AdminAssignMenuLocationResult, AdminDeleteMenuResult, AdminMenu, AdminMenuBinding, AdminMenuCreateInput, AdminMenuCustomTarget, AdminMenuEntryTarget, AdminMenuItem, AdminMenuItemAttrs, AdminMenuRouteTarget, AdminMenusPort, AdminMenuTarget, AdminMenuTermTarget, AdminMenuUpdateTreeInput, AdminMenuUrlTarget, MenuStatus, NavTargetKind, } from './menus.js';
|
|
20
|
+
export type { AdminFormCreateInput, AdminFormDefinition, AdminFormField, AdminFormNotifyConfig, AdminFormsPort, AdminFormSubmission, AdminFormSubmissionPage, AdminFormUpdatePatch, FormDefinitionStatus, FormFieldType, } from './forms.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/ports/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC9D,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,iBAAi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B,YAAY,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,UAAU,EACV,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,GACd,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/ports/index.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `AdminIntegrationsPort` — outbound webhook subscriptions and their delivery history.
|
|
3
|
+
*
|
|
4
|
+
* "Integrations" here specifically means outbound webhooks (a subscription that fires HTTP calls
|
|
5
|
+
* to a target URL when a topic occurs), not a broader per-provider connector concept — the
|
|
6
|
+
* reference implementation has exactly one integration mechanism. A host that later adds other
|
|
7
|
+
* integration kinds (inbound, OAuth-connected third parties, ...) would need a wider port; this
|
|
8
|
+
* one should not be stretched to cover those by convention alone.
|
|
9
|
+
*
|
|
10
|
+
* ## `deleteIntegrationSubscription` is a soft delete
|
|
11
|
+
*
|
|
12
|
+
* Unlike `AdminMediaPort.deleteMedia` (a genuine hard purge), the reference implementation's subscription "delete" sets
|
|
13
|
+
* `status: "disabled"` and stamps a disabled timestamp for audit durability — the row is never
|
|
14
|
+
* removed, and the response echoes the now-disabled subscription rather than a bare
|
|
15
|
+
* acknowledgement. Do not render this action as irreversible in a panel; it is closer in spirit to
|
|
16
|
+
* `AdminIdentityPort.disableUser` than to a real delete. (No `restoreIntegrationSubscription`
|
|
17
|
+
* exists on the reference server to undo it from the admin UI, so a panel still should not promise
|
|
18
|
+
* a reachable undo — only that the underlying data was not destroyed.)
|
|
19
|
+
*/
|
|
20
|
+
/** A summary of a subscription's most recent delivery attempt — the `lastDelivery` field embedded
|
|
21
|
+
* on `AdminIntegrationSubscription`, kept intentionally thin (the full record is
|
|
22
|
+
* `AdminIntegrationDelivery`, fetched separately via `listIntegrationDeliveries`). */
|
|
23
|
+
export interface AdminIntegrationDeliverySummary {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly status: "pending" | "delivering" | "delivered" | "failed" | "dead" | "canceled";
|
|
26
|
+
readonly attempts: number;
|
|
27
|
+
readonly lastResponseStatus: number | null;
|
|
28
|
+
readonly lastError: string | null;
|
|
29
|
+
readonly createdAt: string;
|
|
30
|
+
readonly deliveredAt: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface AdminIntegrationSubscription {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly label: string;
|
|
35
|
+
readonly targetUrl: string;
|
|
36
|
+
readonly topics: readonly string[];
|
|
37
|
+
readonly status: "active" | "paused" | "disabled";
|
|
38
|
+
/** Increments whenever the signing secret rotates; a host may expose this so an operator can
|
|
39
|
+
* confirm a receiving endpoint has picked up the latest secret. */
|
|
40
|
+
readonly secretVersion: number;
|
|
41
|
+
readonly previousSecretVersion: number | null;
|
|
42
|
+
readonly createdAt: string;
|
|
43
|
+
readonly updatedAt: string;
|
|
44
|
+
readonly disabledAt: string | null;
|
|
45
|
+
readonly lastDelivery: AdminIntegrationDeliverySummary | null;
|
|
46
|
+
}
|
|
47
|
+
/** One delivery attempt's full record, as listed by `listIntegrationDeliveries`. */
|
|
48
|
+
export interface AdminIntegrationDelivery {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly subscriptionId: string;
|
|
51
|
+
/** The source event this delivery is carrying — distinct from `id`, since one event can produce
|
|
52
|
+
* more than one delivery attempt (retries). */
|
|
53
|
+
readonly eventId: string;
|
|
54
|
+
readonly topic: string;
|
|
55
|
+
readonly status: AdminIntegrationDeliverySummary["status"];
|
|
56
|
+
readonly attempts: number;
|
|
57
|
+
readonly nextAttemptAt: string;
|
|
58
|
+
readonly lastResponseStatus: number | null;
|
|
59
|
+
readonly lastError: string | null;
|
|
60
|
+
/** Which secret version signed this attempt's payload — lets a receiving endpoint mid-rotation
|
|
61
|
+
* determine which key to verify against. */
|
|
62
|
+
readonly signedWithVersion: number | null;
|
|
63
|
+
readonly createdAt: string;
|
|
64
|
+
readonly deliveredAt: string | null;
|
|
65
|
+
readonly deadAt: string | null;
|
|
66
|
+
}
|
|
67
|
+
export interface AdminIntegrationsPort {
|
|
68
|
+
listIntegrationSubscriptions(): Promise<readonly AdminIntegrationSubscription[]>;
|
|
69
|
+
createIntegrationSubscription(input: {
|
|
70
|
+
label: string;
|
|
71
|
+
targetUrl: string;
|
|
72
|
+
topics: readonly string[];
|
|
73
|
+
}): Promise<AdminIntegrationSubscription>;
|
|
74
|
+
pauseIntegrationSubscription(id: string, input: {
|
|
75
|
+
paused: boolean;
|
|
76
|
+
}): Promise<AdminIntegrationSubscription>;
|
|
77
|
+
/** Soft delete — see the file header. */
|
|
78
|
+
deleteIntegrationSubscription(id: string): Promise<AdminIntegrationSubscription>;
|
|
79
|
+
listIntegrationDeliveries(subscriptionId: string): Promise<readonly AdminIntegrationDelivery[]>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/core/ports/integrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;uFAEuF;AACvF,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,UA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Q,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;iDAC6C;IAC7C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,4BAA4B,IAAI,OAAO,CAAC,SAAS,4BAA4B,EAAE,CAAC,CAAC;IACjF,6BAA6B,CAAC,KAAK,EAAE;QACnC,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;KAC3B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC1C,4BAA4B,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC5G,yCAAyC;IACzC,6BAA6B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACjF,yBAAyB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,wBAAwB,EAAE,CAAC,CAAC;CACjG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `AdminIntegrationsPort` — outbound webhook subscriptions and their delivery history.
|
|
3
|
+
*
|
|
4
|
+
* "Integrations" here specifically means outbound webhooks (a subscription that fires HTTP calls
|
|
5
|
+
* to a target URL when a topic occurs), not a broader per-provider connector concept — the
|
|
6
|
+
* reference implementation has exactly one integration mechanism. A host that later adds other
|
|
7
|
+
* integration kinds (inbound, OAuth-connected third parties, ...) would need a wider port; this
|
|
8
|
+
* one should not be stretched to cover those by convention alone.
|
|
9
|
+
*
|
|
10
|
+
* ## `deleteIntegrationSubscription` is a soft delete
|
|
11
|
+
*
|
|
12
|
+
* Unlike `AdminMediaPort.deleteMedia` (a genuine hard purge), the reference implementation's subscription "delete" sets
|
|
13
|
+
* `status: "disabled"` and stamps a disabled timestamp for audit durability — the row is never
|
|
14
|
+
* removed, and the response echoes the now-disabled subscription rather than a bare
|
|
15
|
+
* acknowledgement. Do not render this action as irreversible in a panel; it is closer in spirit to
|
|
16
|
+
* `AdminIdentityPort.disableUser` than to a real delete. (No `restoreIntegrationSubscription`
|
|
17
|
+
* exists on the reference server to undo it from the admin UI, so a panel still should not promise
|
|
18
|
+
* a reachable undo — only that the underlying data was not destroyed.)
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=integrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/core/ports/integrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `AdminMediaPort` — uploaded binary assets (images, video, documents) and their metadata.
|
|
3
|
+
*
|
|
4
|
+
* ## Media has a genuine hard delete; identity and members do not
|
|
5
|
+
*
|
|
6
|
+
* `AdminIdentityPort` deliberately has no `deleteUser` (disable is the audited primitive — see
|
|
7
|
+
* that file's header), and `AdminMembersPort` has no delete at all. Media is different: the
|
|
8
|
+
* reference implementation's media route group implements a real two-rung deletion ladder (`trashMedia` soft-deletes,
|
|
9
|
+
* `deleteMedia` hard-purges the row and the underlying blob) because the audit-trail argument for
|
|
10
|
+
* principals does not apply to binary assets the same way, and unbounded blob storage is a real
|
|
11
|
+
* operational cost a purely-soft-delete model would leave unaddressed. `deleteMedia` is gated by a
|
|
12
|
+
* narrower permission than `trashMedia` in the reference implementation (a `.force`-suffixed
|
|
13
|
+
* permission), and the backend rejects a purge attempt on an asset that has not been trashed first
|
|
14
|
+
* — a host should surface that rejection rather than let a caller purge directly. Once
|
|
15
|
+
* `deleteMedia` succeeds it is genuinely irreversible; do not render it with "undo" affordances.
|
|
16
|
+
*
|
|
17
|
+
* ## `mediaOriginalUrl` is synchronous and returns a URL, not a `Promise`
|
|
18
|
+
*
|
|
19
|
+
* Every other method here fetches JSON. This one does not — it hands back the byte-serving URL for
|
|
20
|
+
* an asset's original file, meant to be assigned directly to an `<img src>`/`<video src>` (or
|
|
21
|
+
* similar) so the browser issues its own authenticated, same-origin request. Wrapping it in a
|
|
22
|
+
* `Promise<string>` would force every caller through an `await` for a value that is really just
|
|
23
|
+
* string formatting. A host serves the asset's `Content-Type` sniffed from file content server
|
|
24
|
+
* side, not trusted from upload metadata — expect non-renderable content types (e.g. a sniffed
|
|
25
|
+
* HTML/SVG) to come back as a non-rendering attachment rather than inline-rendered.
|
|
26
|
+
*/
|
|
27
|
+
/** A previously-uploaded binary asset and its editable metadata. */
|
|
28
|
+
export interface AdminMedia {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly title: string;
|
|
31
|
+
readonly alt: string;
|
|
32
|
+
readonly caption: string;
|
|
33
|
+
readonly credit: string;
|
|
34
|
+
/** Content hash of the stored blob — a host may use this for de-duplication or integrity checks;
|
|
35
|
+
* not meant to be operator-facing. */
|
|
36
|
+
readonly sha256: string;
|
|
37
|
+
readonly status: "active" | "trashed";
|
|
38
|
+
readonly createdAt: string;
|
|
39
|
+
readonly updatedAt: string;
|
|
40
|
+
readonly version: number;
|
|
41
|
+
}
|
|
42
|
+
export interface AdminMediaPort {
|
|
43
|
+
listMedia(): Promise<readonly AdminMedia[]>;
|
|
44
|
+
/** Synchronous URL builder, not a request — see the file header. */
|
|
45
|
+
mediaOriginalUrl(id: string): string;
|
|
46
|
+
uploadMedia(input: {
|
|
47
|
+
filename: string;
|
|
48
|
+
contentType: string;
|
|
49
|
+
dataBase64: string;
|
|
50
|
+
}, options?: {
|
|
51
|
+
alt?: string;
|
|
52
|
+
caption?: string;
|
|
53
|
+
credit?: string;
|
|
54
|
+
}): Promise<AdminMedia>;
|
|
55
|
+
updateMedia(id: string, patch: {
|
|
56
|
+
title?: string;
|
|
57
|
+
alt?: string;
|
|
58
|
+
caption?: string;
|
|
59
|
+
credit?: string;
|
|
60
|
+
}): Promise<AdminMedia>;
|
|
61
|
+
/** Soft delete — reversible via `deleteMedia`'s counterpart trash state. Safe to offer as an
|
|
62
|
+
* undoable action in a panel. */
|
|
63
|
+
trashMedia(id: string): Promise<AdminMedia>;
|
|
64
|
+
/**
|
|
65
|
+
* Hard purge. Irreversible — see the file header. Expect a conflict-class rejection (with a
|
|
66
|
+
* referencing-entities list on the error body, per `../transport/errors.ts`'s "`body` is kept
|
|
67
|
+
* raw" decision) when the asset is still trashed-but-referenced elsewhere, and a not-found-class
|
|
68
|
+
* rejection when it has not been trashed first.
|
|
69
|
+
*/
|
|
70
|
+
deleteMedia(id: string): Promise<{
|
|
71
|
+
purged: boolean;
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/core/ports/media.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,oEAAoE;AACpE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;2CACuC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,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a genuine hard delete; identity and members do not
|
|
5
|
+
*
|
|
6
|
+
* `AdminIdentityPort` deliberately has no `deleteUser` (disable is the audited primitive — see
|
|
7
|
+
* that file's header), and `AdminMembersPort` has no delete at all. Media is different: the
|
|
8
|
+
* reference implementation's media route group implements a real two-rung deletion ladder (`trashMedia` soft-deletes,
|
|
9
|
+
* `deleteMedia` hard-purges the row and the underlying blob) because the audit-trail argument for
|
|
10
|
+
* principals does not apply to binary assets the same way, and unbounded blob storage is a real
|
|
11
|
+
* operational cost a purely-soft-delete model would leave unaddressed. `deleteMedia` is gated by a
|
|
12
|
+
* narrower permission than `trashMedia` in the reference implementation (a `.force`-suffixed
|
|
13
|
+
* permission), and the backend rejects a purge attempt on an asset that has not been trashed first
|
|
14
|
+
* — a host should surface that rejection rather than let a caller purge directly. Once
|
|
15
|
+
* `deleteMedia` succeeds it is genuinely irreversible; do not render it with "undo" affordances.
|
|
16
|
+
*
|
|
17
|
+
* ## `mediaOriginalUrl` is synchronous and returns a URL, not a `Promise`
|
|
18
|
+
*
|
|
19
|
+
* Every other method here fetches JSON. This one does not — it hands back the byte-serving URL for
|
|
20
|
+
* an asset's original file, meant to be assigned directly to an `<img src>`/`<video src>` (or
|
|
21
|
+
* similar) so the browser issues its own authenticated, same-origin request. Wrapping it in a
|
|
22
|
+
* `Promise<string>` would force every caller through an `await` for a value that is really just
|
|
23
|
+
* string formatting. A host serves the asset's `Content-Type` sniffed from file content server
|
|
24
|
+
* side, not trusted from upload metadata — expect non-renderable content types (e.g. a sniffed
|
|
25
|
+
* HTML/SVG) to come back as a non-rendering attachment rather than inline-rendered.
|
|
26
|
+
*/
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/core/ports/media.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `AdminMembersPort` — end users who signed up on the site, as distinct from operators.
|
|
3
|
+
*
|
|
4
|
+
* Members are not principals in the `AdminIdentityPort` sense: they cannot sign in to this admin
|
|
5
|
+
* surface, they have no roles or policies, and the reference implementation keeps them in a wholly separate route group.
|
|
6
|
+
* See `identity.ts`'s file header for the fuller "why two ports" rationale.
|
|
7
|
+
*
|
|
8
|
+
* ## No `enableMember` on the contract
|
|
9
|
+
*
|
|
10
|
+
* Unlike `AdminIdentityPort`'s `disableUser`/`enableUser` pair, this port has disable only.
|
|
11
|
+
* The reference implementation's members route group has `list`, `get-by-id`,
|
|
12
|
+
* `disable`, and `request-magic-link` — no re-enable route exists. Adding `enableMember` here would
|
|
13
|
+
* put a method on the contract the reference implementation cannot satisfy. If a host needs it,
|
|
14
|
+
* that is new route-level work, not a client-side gap.
|
|
15
|
+
*/
|
|
16
|
+
/** An end user who signed up on the site (not an operator — see the file header). */
|
|
17
|
+
export interface AdminMember {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly email: string;
|
|
20
|
+
readonly name?: string;
|
|
21
|
+
readonly status: "pending" | "active" | "disabled";
|
|
22
|
+
/** Set once the member has verified their email; absent until then. */
|
|
23
|
+
readonly emailVerifiedAt?: string;
|
|
24
|
+
readonly createdAt: string;
|
|
25
|
+
readonly updatedAt: string;
|
|
26
|
+
/** Optimistic-concurrency version. Not currently required by `disableMember` — the reference
|
|
27
|
+
* implementation's route takes only an id — but carried on the read shape for parity with the other versioned
|
|
28
|
+
* entities in this package, and in case a future disable route adds the guard. */
|
|
29
|
+
readonly version: number;
|
|
30
|
+
}
|
|
31
|
+
export interface AdminMembersPort {
|
|
32
|
+
listMembers(): Promise<readonly AdminMember[]>;
|
|
33
|
+
getMember(id: string): Promise<AdminMember>;
|
|
34
|
+
/** No `enableMember` counterpart — see the file header. */
|
|
35
|
+
disableMember(id: string): Promise<AdminMember>;
|
|
36
|
+
/**
|
|
37
|
+
* Sends a passwordless sign-in link to the given address. Always resolves `{ delivered: true }`
|
|
38
|
+
* regardless of whether the address belongs to a real member — an enumeration-safe response, not
|
|
39
|
+
* a bug. `redirectPath` is where the link lands the member after it is followed; a host that
|
|
40
|
+
* ignores it falls back to its own default landing location.
|
|
41
|
+
*/
|
|
42
|
+
requestMemberMagicLink(input: {
|
|
43
|
+
email: string;
|
|
44
|
+
}, options?: {
|
|
45
|
+
redirectPath?: string;
|
|
46
|
+
}): Promise<{
|
|
47
|
+
delivered: true;
|
|
48
|
+
}>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../../src/core/ports/members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,qFAAqF;AACrF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IACnD,uEAAuE;IACvE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;uFAEmF;IACnF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,IAAI,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAC;IAC/C,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,2DAA2D;IAC3D,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAChD;;;;;OAKG;IACH,sBAAsB,CACpB,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EACxB,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAClC,OAAO,CAAC;QAAE,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;CACjC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `AdminMembersPort` — end users who signed up on the site, as distinct from operators.
|
|
3
|
+
*
|
|
4
|
+
* Members are not principals in the `AdminIdentityPort` sense: they cannot sign in to this admin
|
|
5
|
+
* surface, they have no roles or policies, and the reference implementation keeps them in a wholly separate route group.
|
|
6
|
+
* See `identity.ts`'s file header for the fuller "why two ports" rationale.
|
|
7
|
+
*
|
|
8
|
+
* ## No `enableMember` on the contract
|
|
9
|
+
*
|
|
10
|
+
* Unlike `AdminIdentityPort`'s `disableUser`/`enableUser` pair, this port has disable only.
|
|
11
|
+
* The reference implementation's members route group has `list`, `get-by-id`,
|
|
12
|
+
* `disable`, and `request-magic-link` — no re-enable route exists. Adding `enableMember` here would
|
|
13
|
+
* put a method on the contract the reference implementation cannot satisfy. If a host needs it,
|
|
14
|
+
* that is new route-level work, not a client-side gap.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/core/ports/members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|