@datatechsolutions/ui 2.11.80 → 2.11.82

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.
Files changed (57) hide show
  1. package/dist/astrlabe/contracts.d.mts +24 -1
  2. package/dist/astrlabe/contracts.d.ts +24 -1
  3. package/dist/astrlabe/index.d.mts +25 -84
  4. package/dist/astrlabe/index.d.ts +25 -84
  5. package/dist/astrlabe/index.js +175 -4570
  6. package/dist/astrlabe/index.js.map +1 -1
  7. package/dist/astrlabe/index.mjs +3 -4535
  8. package/dist/astrlabe/index.mjs.map +1 -1
  9. package/dist/astrlabe/workflow-canvas.d.mts +69 -5
  10. package/dist/astrlabe/workflow-canvas.d.ts +69 -5
  11. package/dist/chunk-6PBTB5ZX.js +165 -0
  12. package/dist/chunk-6PBTB5ZX.js.map +1 -0
  13. package/dist/chunk-HAZP5J67.mjs +4781 -0
  14. package/dist/chunk-HAZP5J67.mjs.map +1 -0
  15. package/dist/chunk-HZ4LOVHM.js +46 -0
  16. package/dist/chunk-HZ4LOVHM.js.map +1 -0
  17. package/dist/chunk-K4QJV3GC.js +4825 -0
  18. package/dist/chunk-K4QJV3GC.js.map +1 -0
  19. package/dist/chunk-UHHPBREK.mjs +135 -0
  20. package/dist/chunk-UHHPBREK.mjs.map +1 -0
  21. package/dist/chunk-ZJPNP2YW.mjs +44 -0
  22. package/dist/chunk-ZJPNP2YW.mjs.map +1 -0
  23. package/dist/{workflow-canvas-NSxfr5dy.d.ts → index-AioB90qq.d.mts} +2 -67
  24. package/dist/{workflow-canvas-D4928AfA.d.mts → index-D5ai0cGZ.d.ts} +2 -67
  25. package/dist/platform/index.d.mts +41 -0
  26. package/dist/platform/index.d.ts +41 -0
  27. package/dist/platform/index.js +237 -0
  28. package/dist/platform/index.js.map +1 -0
  29. package/dist/platform/index.mjs +109 -0
  30. package/dist/platform/index.mjs.map +1 -0
  31. package/dist/platform/pages/index.d.mts +272 -0
  32. package/dist/platform/pages/index.d.ts +272 -0
  33. package/dist/platform/pages/index.js +1793 -0
  34. package/dist/platform/pages/index.js.map +1 -0
  35. package/dist/platform/pages/index.mjs +1777 -0
  36. package/dist/platform/pages/index.mjs.map +1 -0
  37. package/dist/platform/rbac.d.mts +41 -0
  38. package/dist/platform/rbac.d.ts +41 -0
  39. package/dist/platform/rbac.js +13 -0
  40. package/dist/platform/rbac.js.map +1 -0
  41. package/dist/platform/rbac.mjs +4 -0
  42. package/dist/platform/rbac.mjs.map +1 -0
  43. package/dist/platform/utils/index.d.mts +32 -0
  44. package/dist/platform/utils/index.d.ts +32 -0
  45. package/dist/platform/utils/index.js +131 -0
  46. package/dist/platform/utils/index.js.map +1 -0
  47. package/dist/platform/utils/index.mjs +119 -0
  48. package/dist/platform/utils/index.mjs.map +1 -0
  49. package/dist/platform/windsock-admin-client.d.mts +57 -0
  50. package/dist/platform/windsock-admin-client.d.ts +57 -0
  51. package/dist/platform/windsock-admin-client.js +125 -0
  52. package/dist/platform/windsock-admin-client.js.map +1 -0
  53. package/dist/platform/windsock-admin-client.mjs +4 -0
  54. package/dist/platform/windsock-admin-client.mjs.map +1 -0
  55. package/dist/rule-form-F5jBOeqk.d.mts +79 -0
  56. package/dist/rule-form-F5jBOeqk.d.ts +79 -0
  57. package/package.json +28 -1
@@ -0,0 +1,135 @@
1
+ "use client";
2
+ import { HttpResponseError } from '@datatechsolutions/shared-domain/common';
3
+
4
+ // src/platform/windsock-admin-client.ts
5
+ var _adminClient = null;
6
+ var _issuer = null;
7
+ var _authFetch = fetch;
8
+ function setWindsockAdminClient(client, issuer, authFetch) {
9
+ _adminClient = client;
10
+ _issuer = issuer.replace(/\/$/, "");
11
+ _authFetch = authFetch;
12
+ }
13
+ function requireClient() {
14
+ if (!_adminClient) {
15
+ throw new Error("Windsock admin client not initialized \u2014 did providers mount?");
16
+ }
17
+ return _adminClient;
18
+ }
19
+ async function listUsers(params) {
20
+ return requireClient().listUsers(params);
21
+ }
22
+ async function createUser(data) {
23
+ return requireClient().createUser(data);
24
+ }
25
+ async function updateUser(userId, data) {
26
+ return requireClient().updateUser(userId, data);
27
+ }
28
+ async function deleteUser(userId) {
29
+ return requireClient().deleteUser(userId);
30
+ }
31
+ async function resetUserPassword(userId, password) {
32
+ return requireClient().resetUserPassword(userId, password);
33
+ }
34
+ async function listOrganizations() {
35
+ return requireClient().listOrganizations();
36
+ }
37
+ async function createOrganization(data) {
38
+ return requireClient().createOrganization(data);
39
+ }
40
+ async function updateOrganization(organizationId, data) {
41
+ return requireClient().updateOrganization(organizationId, data);
42
+ }
43
+ async function deleteOrganization(organizationId) {
44
+ return requireClient().deleteOrganization(organizationId);
45
+ }
46
+ async function listOrganizationMembers(organizationId) {
47
+ return requireClient().listOrganizationMembers(organizationId);
48
+ }
49
+ async function addOrganizationMember(organizationId, userId, role) {
50
+ return requireClient().addOrganizationMember(organizationId, userId, role);
51
+ }
52
+ async function removeOrganizationMember(organizationId, userId) {
53
+ return requireClient().removeOrganizationMember(organizationId, userId);
54
+ }
55
+ async function listOrganizationInvitations(organizationId) {
56
+ return requireClient().listOrganizationInvitations(organizationId);
57
+ }
58
+ async function createOrganizationInvitation(organizationId, data) {
59
+ return requireClient().createOrganizationInvitation(organizationId, data);
60
+ }
61
+ async function listOrganizationDomains(organizationId) {
62
+ return requireClient().listOrganizationDomains(organizationId);
63
+ }
64
+ async function addOrganizationDomain(organizationId, domain) {
65
+ return requireClient().addOrganizationDomain(organizationId, domain);
66
+ }
67
+ async function verifyOrganizationDomain(organizationId, domain) {
68
+ return requireClient().verifyOrganizationDomain(organizationId, domain);
69
+ }
70
+ async function listPermissions() {
71
+ return requireClient().listPermissions();
72
+ }
73
+ async function createPermission(data) {
74
+ return requireClient().createPermission(data);
75
+ }
76
+ async function updatePermission(permissionId, data) {
77
+ return requireClient().updatePermission(permissionId, data);
78
+ }
79
+ async function deletePermission(permissionId) {
80
+ return requireClient().deletePermission(permissionId);
81
+ }
82
+ async function getUserPermissions(userId) {
83
+ return requireClient().getUserPermissions(userId);
84
+ }
85
+ async function setUserPermissions(userId, permissionIds) {
86
+ return requireClient().setUserPermissions(userId, permissionIds);
87
+ }
88
+ async function secretsRequest(path, init) {
89
+ if (!_issuer) throw new Error("Windsock issuer not initialized");
90
+ const response = await _authFetch(`${_issuer}${path}`, {
91
+ ...init,
92
+ credentials: init?.credentials ?? "include",
93
+ headers: {
94
+ "Content-Type": "application/json",
95
+ ...init?.headers
96
+ }
97
+ });
98
+ if (response.status === 204) return void 0;
99
+ const payload = await response.json().catch(() => null);
100
+ if (!response.ok) {
101
+ const message = payload?.message ?? payload?.error ?? `HTTP ${response.status}: ${response.statusText}`;
102
+ throw new HttpResponseError(message, response.status);
103
+ }
104
+ if (payload && typeof payload === "object" && "success" in payload && payload.success && "data" in payload) {
105
+ return payload.data;
106
+ }
107
+ return payload;
108
+ }
109
+ async function listSecrets(organizationId) {
110
+ return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets`);
111
+ }
112
+ async function getSecret(organizationId, secretId) {
113
+ return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets/${encodeURIComponent(secretId)}`);
114
+ }
115
+ async function createSecret(organizationId, input) {
116
+ return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets`, {
117
+ method: "POST",
118
+ body: JSON.stringify(input)
119
+ });
120
+ }
121
+ async function rotateSecret(organizationId, secretId, input) {
122
+ return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets/${encodeURIComponent(secretId)}`, {
123
+ method: "PATCH",
124
+ body: JSON.stringify(input)
125
+ });
126
+ }
127
+ async function disableSecret(organizationId, secretId) {
128
+ return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets/${encodeURIComponent(secretId)}`, {
129
+ method: "DELETE"
130
+ });
131
+ }
132
+
133
+ export { addOrganizationDomain, addOrganizationMember, createOrganization, createOrganizationInvitation, createPermission, createSecret, createUser, deleteOrganization, deletePermission, deleteUser, disableSecret, getSecret, getUserPermissions, listOrganizationDomains, listOrganizationInvitations, listOrganizationMembers, listOrganizations, listPermissions, listSecrets, listUsers, removeOrganizationMember, resetUserPassword, rotateSecret, setUserPermissions, setWindsockAdminClient, updateOrganization, updatePermission, updateUser, verifyOrganizationDomain };
134
+ //# sourceMappingURL=chunk-UHHPBREK.mjs.map
135
+ //# sourceMappingURL=chunk-UHHPBREK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/platform/windsock-admin-client.ts"],"names":[],"mappings":";;;AAqBA,IAAI,YAAA,GAAmC,IAAA;AACvC,IAAI,OAAA,GAAyB,IAAA;AAC7B,IAAI,UAAA,GAA2B,KAAA;AAExB,SAAS,sBAAA,CAAuB,MAAA,EAAqB,MAAA,EAAgB,SAAA,EAA+B;AACzG,EAAA,YAAA,GAAe,MAAA;AACf,EAAA,OAAA,GAAU,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAClC,EAAA,UAAA,GAAa,SAAA;AACf;AAEA,SAAS,aAAA,GAA6B;AACpC,EAAA,IAAI,CAAC,YAAA,EAAc;AACjB,IAAA,MAAM,IAAI,MAAM,mEAA8D,CAAA;AAAA,EAChF;AACA,EAAA,OAAO,YAAA;AACT;AAGA,eAAsB,UAAU,MAAA,EAAsE;AACpG,EAAA,OAAO,aAAA,EAAc,CAAE,SAAA,CAAU,MAAM,CAAA;AACzC;AACA,eAAsB,WAAW,IAAA,EAAuD;AACtF,EAAA,OAAO,aAAA,EAAc,CAAE,UAAA,CAAW,IAAI,CAAA;AACxC;AACA,eAAsB,UAAA,CAAW,QAAgB,IAAA,EAA2C;AAC1F,EAAA,OAAO,aAAA,EAAc,CAAE,UAAA,CAAW,MAAA,EAAQ,IAAI,CAAA;AAChD;AACA,eAAsB,WAAW,MAAA,EAA+B;AAC9D,EAAA,OAAO,aAAA,EAAc,CAAE,UAAA,CAAW,MAAM,CAAA;AAC1C;AACA,eAAsB,iBAAA,CAAkB,QAAgB,QAAA,EAAiC;AACvF,EAAA,OAAO,a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AAK;AAAA,GAC3B,CAAA;AACH;AAEA,eAAsB,YAAA,CAAa,cAAA,EAAwB,QAAA,EAAkB,KAAA,EAAkD;AAC7H,EAAA,OAAO,cAAA,CAAe,kBAAkB,kBAAA,CAAmB,cAAc,CAAC,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA,EAAI;AAAA,IACpH,MAAA,EAAQ,OAAA;AAAA,IACR,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,KAAK;AAAA,GAC3B,CAAA;AACH;AAEA,eAAsB,aAAA,CAAc,gBAAwB,QAAA,EAAiC;AAC3F,EAAA,OAAO,cAAA,CAAe,kBAAkB,kBAAA,CAAmB,cAAc,CAAC,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA,EAAI;AAAA,IACpH,MAAA,EAAQ;AAAA,GACT,CAAA;AACH","file":"chunk-UHHPBREK.mjs","sourcesContent":["import type {\n AdminClient,\n AdminUserSummary,\n AdminListParams,\n AdminListResult,\n AdminCreateUserInput,\n AdminUpdateUserInput,\n AdminCreateOrganizationInput,\n AdminUpdateOrganizationInput,\n AdminOrganizationMember,\n AdminCreatePermissionInput,\n AdminUpdatePermissionInput,\n AdminCreateInvitationInput,\n AdminPermission,\n AuthOrganization,\n AuthOrganizationDomain,\n AuthOrganizationInvitation,\n AuthOrganizationRole,\n} from '@datatechsolutions/shared-domain'\nimport { HttpResponseError } from '@datatechsolutions/shared-domain/common'\n\nlet _adminClient: AdminClient | null = null\nlet _issuer: string | null = null\nlet _authFetch: typeof fetch = fetch\n\nexport function setWindsockAdminClient(client: AdminClient, issuer: string, authFetch: typeof fetch): void {\n _adminClient = client\n _issuer = issuer.replace(/\\/$/, '')\n _authFetch = authFetch\n}\n\nfunction requireClient(): AdminClient {\n if (!_adminClient) {\n throw new Error('Windsock admin client not initialized — did providers mount?')\n }\n return _adminClient\n}\n\n// ── Users ──────────────────────────────────────────────────────────────────\nexport async function listUsers(params?: AdminListParams): Promise<AdminListResult<AdminUserSummary>> {\n return requireClient().listUsers(params)\n}\nexport async function createUser(data: AdminCreateUserInput): Promise<AdminUserSummary> {\n return requireClient().createUser(data)\n}\nexport async function updateUser(userId: string, data: AdminUpdateUserInput): Promise<void> {\n return requireClient().updateUser(userId, data)\n}\nexport async function deleteUser(userId: string): Promise<void> {\n return requireClient().deleteUser(userId)\n}\nexport async function resetUserPassword(userId: string, password: string): Promise<void> {\n return requireClient().resetUserPassword(userId, password)\n}\n\n// ── Organizations ──────────────────────────────────────────────────────────\nexport async function listOrganizations(): Promise<AuthOrganization[]> {\n return requireClient().listOrganizations()\n}\nexport async function createOrganization(data: AdminCreateOrganizationInput): Promise<AuthOrganization> {\n return requireClient().createOrganization(data)\n}\nexport async function updateOrganization(organizationId: string, data: AdminUpdateOrganizationInput): Promise<AuthOrganization> {\n return requireClient().updateOrganization(organizationId, data)\n}\nexport async function deleteOrganization(organizationId: string): Promise<void> {\n return requireClient().deleteOrganization(organizationId)\n}\n\n// ── Organization Members ───────────────────────────────────────────────────\nexport async function listOrganizationMembers(organizationId: string): Promise<AdminOrganizationMember[]> {\n return requireClient().listOrganizationMembers(organizationId)\n}\nexport async function addOrganizationMember(organizationId: string, userId: string, role?: AuthOrganizationRole): Promise<void> {\n return requireClient().addOrganizationMember(organizationId, userId, role)\n}\nexport async function removeOrganizationMember(organizationId: string, userId: string): Promise<void> {\n return requireClient().removeOrganizationMember(organizationId, userId)\n}\n\n// ── Organization Invitations ───────────────────────────────────────────────\nexport async function listOrganizationInvitations(organizationId: string): Promise<AuthOrganizationInvitation[]> {\n return requireClient().listOrganizationInvitations(organizationId)\n}\nexport async function createOrganizationInvitation(organizationId: string, data: AdminCreateInvitationInput): Promise<void> {\n return requireClient().createOrganizationInvitation(organizationId, data)\n}\n\n// ── Organization Domains ───────────────────────────────────────────────────\nexport async function listOrganizationDomains(organizationId: string): Promise<AuthOrganizationDomain[]> {\n return requireClient().listOrganizationDomains(organizationId)\n}\nexport async function addOrganizationDomain(organizationId: string, domain: string): Promise<AuthOrganizationDomain> {\n return requireClient().addOrganizationDomain(organizationId, domain)\n}\nexport async function verifyOrganizationDomain(organizationId: string, domain: string): Promise<void> {\n return requireClient().verifyOrganizationDomain(organizationId, domain)\n}\n\n// ── Permissions ────────────────────────────────────────────────────────────\nexport async function listPermissions(): Promise<AdminPermission[]> {\n return requireClient().listPermissions()\n}\nexport async function createPermission(data: AdminCreatePermissionInput): Promise<AdminPermission> {\n return requireClient().createPermission(data)\n}\nexport async function updatePermission(permissionId: string, data: AdminUpdatePermissionInput): Promise<void> {\n return requireClient().updatePermission(permissionId, data)\n}\nexport async function deletePermission(permissionId: string): Promise<void> {\n return requireClient().deletePermission(permissionId)\n}\nexport async function getUserPermissions(userId: string): Promise<AdminPermission[]> {\n return requireClient().getUserPermissions(userId)\n}\nexport async function setUserPermissions(userId: string, permissionIds: string[]): Promise<void> {\n return requireClient().setUserPermissions(userId, permissionIds)\n}\n\n// ── Secrets (not in AdminClient SDK — windsock_org_secrets handler) ────────\n\nexport type SecretSummary = {\n secretId: string\n name: string\n secretType: string\n description: string | null\n expiresAt: string | null\n createdAt: string\n updatedAt: string\n disabled: boolean\n}\n\nexport type SecretDetail = SecretSummary & {\n value?: string\n}\n\nexport type CreateSecretInput = {\n name: string\n value: string\n secretType?: string\n description?: string\n leaseTtlSeconds?: number\n}\n\nexport type UpdateSecretInput = {\n value: string\n leaseTtlSeconds?: number\n}\n\nasync function secretsRequest<T>(path: string, init?: RequestInit): Promise<T> {\n if (!_issuer) throw new Error('Windsock issuer not initialized')\n const response = await _authFetch(`${_issuer}${path}`, {\n ...init,\n credentials: init?.credentials ?? 'include',\n headers: {\n 'Content-Type': 'application/json',\n ...(init?.headers as Record<string, string> | undefined),\n },\n })\n if (response.status === 204) return undefined as T\n const payload = await response.json().catch(() => null)\n if (!response.ok) {\n const message = (payload as { error?: string; message?: string })?.message\n ?? (payload as { error?: string })?.error\n ?? `HTTP ${response.status}: ${response.statusText}`\n throw new HttpResponseError(message, response.status)\n }\n if (payload && typeof payload === 'object' && 'success' in payload && (payload as { success: boolean }).success && 'data' in payload) {\n return (payload as { data: T }).data\n }\n return payload as T\n}\n\nexport async function listSecrets(organizationId: string): Promise<SecretSummary[]> {\n return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets`)\n}\n\nexport async function getSecret(organizationId: string, secretId: string): Promise<SecretDetail> {\n return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets/${encodeURIComponent(secretId)}`)\n}\n\nexport async function createSecret(organizationId: string, input: CreateSecretInput): Promise<SecretSummary> {\n return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets`, {\n method: 'POST',\n body: JSON.stringify(input),\n })\n}\n\nexport async function rotateSecret(organizationId: string, secretId: string, input: UpdateSecretInput): Promise<SecretSummary> {\n return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets/${encodeURIComponent(secretId)}`, {\n method: 'PATCH',\n body: JSON.stringify(input),\n })\n}\n\nexport async function disableSecret(organizationId: string, secretId: string): Promise<void> {\n return secretsRequest(`/organizations/${encodeURIComponent(organizationId)}/secrets/${encodeURIComponent(secretId)}`, {\n method: 'DELETE',\n })\n}\n"]}
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ // src/platform/rbac.ts
3
+ function matchPermission(pattern, target) {
4
+ if (pattern === "*") return true;
5
+ if (pattern === target) return true;
6
+ const patternParts = pattern.split(":");
7
+ const targetParts = target.split(":");
8
+ for (let i = 0; i < patternParts.length; i++) {
9
+ if (patternParts[i] === "*") return true;
10
+ if (patternParts[i] !== targetParts[i]) return false;
11
+ }
12
+ return patternParts.length === targetParts.length;
13
+ }
14
+ function createPlatformRbac(opts) {
15
+ const ROLE_DEFINITIONS = opts.roles;
16
+ const MODULE_PERMISSIONS = opts.modulePermissions ?? {};
17
+ const PERMISSION_CLAIMS_MAP = opts.permissionClaimsMap;
18
+ const knownRoles = Object.keys(ROLE_DEFINITIONS);
19
+ const fallbackRole = opts.defaultRole ?? knownRoles[0];
20
+ function normalizePlatformRole(input) {
21
+ if (typeof input === "string" && input in ROLE_DEFINITIONS) {
22
+ return input;
23
+ }
24
+ return fallbackRole;
25
+ }
26
+ function can(user, permission) {
27
+ if (!user) return false;
28
+ const userClaims = user.permissions ?? [];
29
+ const requiredClaims = PERMISSION_CLAIMS_MAP[permission] ?? [];
30
+ return requiredClaims.some(
31
+ (claim) => userClaims.some((userClaim) => matchPermission(userClaim, claim))
32
+ );
33
+ }
34
+ return {
35
+ ROLE_DEFINITIONS,
36
+ MODULE_PERMISSIONS,
37
+ normalizePlatformRole,
38
+ can
39
+ };
40
+ }
41
+
42
+ export { createPlatformRbac };
43
+ //# sourceMappingURL=chunk-ZJPNP2YW.mjs.map
44
+ //# sourceMappingURL=chunk-ZJPNP2YW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/platform/rbac.ts"],"names":[],"mappings":";AAiDA,SAAS,eAAA,CAAgB,SAAiB,MAAA,EAAyB;AACjE,EAAA,IAAI,OAAA,KAAY,KAAK,OAAO,IAAA;AAC5B,EAAA,IAAI,OAAA,KAAY,QAAQ,OAAO,IAAA;AAC/B,EAAA,MAAM,YAAA,GAAe,OAAA,CAAQ,KAAA,CAAM,GAAG,CAAA;AACtC,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,KAAA,CAAM,GAAG,CAAA;AACpC,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,YAAA,CAAa,QAAQ,CAAA,EAAA,EAAK;AAC5C,IAAA,IAAI,YAAA,CAAa,CAAC,CAAA,KAAM,GAAA,EAAK,OAAO,IAAA;AACpC,IAAA,IAAI,aAAa,CAAC,CAAA,KAAM,WAAA,CAAY,CAAC,GAAG,OAAO,KAAA;AAAA,EACjD;AACA,EAAA,OAAO,YAAA,CAAa,WAAW,WAAA,CAAY,MAAA;AAC7C;AAEO,SAAS,mBAGd,IAAA,EAAuF;AACvF,EAAA,MAAM,mBAAmB,IAAA,CAAK,KAAA;AAC9B,EAAA,MAAM,kBAAA,GAAqB,IAAA,CAAK,iBAAA,IAAsB,EAAC;AACvD,EAAA,MAAM,wBAAwB,IAAA,CAAK,mBAAA;AAInC,EAAA,MAAM,UAAA,GAAa,MAAA,CAAO,IAAA,CAAK,gBAAgB,CAAA;AAC/C,EAAA,MAAM,YAAA,GAAsB,IAAA,CAAK,WAAA,IAAgB,UAAA,CAAW,CAAC,CAAA;AAE7D,EAAA,SAAS,sBAAsB,KAAA,EAAuB;AACpD,IAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAa,KAAA,IAAmB,gBAAA,EAAkB;AACrE,MAAA,OAAO,KAAA;AAAA,IACT;AACA,IAAA,OAAO,YAAA;AAAA,EACT;AAEA,EAAA,SAAS,GAAA,CAAI,MAAuB,UAAA,EAAkC;AACpE,IAAA,IAAI,CAAC,MAAM,OAAO,KAAA;AAClB,IAAA,MAAM,UAAA,GAAc,IAAA,CAAK,WAAA,IAAe,EAAC;AAEzC,IAAA,MAAM,cAAA,GAAiB,qBAAA,CAAsB,UAAU,CAAA,IAAK,EAAC;AAC7D,IAAA,OAAO,cAAA,CAAe,IAAA;AAAA,MAAK,CAAC,UAC1B,UAAA,CAAW,IAAA,CAAK,CAAC,SAAA,KAAc,eAAA,CAAgB,SAAA,EAAW,KAAK,CAAC;AAAA,KAClE;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,qBAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-ZJPNP2YW.mjs","sourcesContent":["import type { AuthUser } from '@datatechsolutions/windsock/client'\n\n/**\n * Generic role-based access factory shared across platform apps (astrlabe,\n * kori-erp, etc). Each app instantiates this with its own role + permission\n * unions and seed-claim mapping. The factory closes over the config and\n * exports `ROLE_DEFINITIONS`, `MODULE_PERMISSIONS`, `normalizePlatformRole`,\n * and `can()` — the same surface the per-app file used to expose.\n *\n * The factory deliberately does not hardcode any specific role enum here —\n * astrlabe, kori-erp, and future apps each pick their own union (admin,\n * manager, analyst, viewer, …) and pass the role definitions in.\n */\n\nexport type PlatformRoleDefinition<TRole extends string> = {\n id: TRole\n label: string\n description: string\n}\n\nexport type CreatePlatformRbacOptions<\n TRole extends string,\n TPermission extends string,\n> = {\n /** Definitions for every role the app supports (id/label/description). */\n roles: Record<TRole, PlatformRoleDefinition<TRole>>\n /**\n * Maps each app-level permission to one or more JWT permission claim\n * strings. `can()` returns true when ANY of the listed claims (using\n * wildcard matching) is present in the user's JWT permissions.\n */\n permissionClaimsMap: Record<TPermission, readonly string[]>\n /** Optional map from navigation/module IDs to required permissions. */\n modulePermissions?: Record<string, TPermission>\n /** Role to fall back to when an unknown role string comes in. */\n defaultRole?: TRole\n}\n\nexport type PlatformRbac<TRole extends string, TPermission extends string> = {\n ROLE_DEFINITIONS: Record<TRole, PlatformRoleDefinition<TRole>>\n MODULE_PERMISSIONS: Record<string, TPermission>\n normalizePlatformRole: (input: unknown) => TRole\n can: (user: AuthUser | null, permission: TPermission) => boolean\n}\n\n/**\n * Match a permission string against a pattern (supports wildcards).\n * Same logic as windsock's usePermissionChecker.\n */\nfunction matchPermission(pattern: string, target: string): boolean {\n if (pattern === '*') return true\n if (pattern === target) return true\n const patternParts = pattern.split(':')\n const targetParts = target.split(':')\n for (let i = 0; i < patternParts.length; i++) {\n if (patternParts[i] === '*') return true\n if (patternParts[i] !== targetParts[i]) return false\n }\n return patternParts.length === targetParts.length\n}\n\nexport function createPlatformRbac<\n TRole extends string,\n TPermission extends string,\n>(opts: CreatePlatformRbacOptions<TRole, TPermission>): PlatformRbac<TRole, TPermission> {\n const ROLE_DEFINITIONS = opts.roles\n const MODULE_PERMISSIONS = opts.modulePermissions ?? ({} as Record<string, TPermission>)\n const PERMISSION_CLAIMS_MAP = opts.permissionClaimsMap\n\n // Pick the fallback role: explicit `defaultRole` first, then the first\n // entry in the roles map. We assume there's at least one role.\n const knownRoles = Object.keys(ROLE_DEFINITIONS) as TRole[]\n const fallbackRole: TRole = opts.defaultRole ?? (knownRoles[0] as TRole)\n\n function normalizePlatformRole(input: unknown): TRole {\n if (typeof input === 'string' && (input as TRole) in ROLE_DEFINITIONS) {\n return input as TRole\n }\n return fallbackRole\n }\n\n function can(user: AuthUser | null, permission: TPermission): boolean {\n if (!user) return false\n const userClaims = (user.permissions ?? []) as string[]\n\n const requiredClaims = PERMISSION_CLAIMS_MAP[permission] ?? []\n return requiredClaims.some((claim) =>\n userClaims.some((userClaim) => matchPermission(userClaim, claim))\n )\n }\n\n return {\n ROLE_DEFINITIONS,\n MODULE_PERMISSIONS,\n normalizePlatformRole,\n can,\n }\n}\n"]}
@@ -1,7 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentProps } from 'react';
3
- import { NodeTypes } from '@xyflow/react';
4
- import { AgentConfig, AnswerNodeConfig, CodeNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, ModelProviderNodeConfig, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, AgentRule, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, WorkflowTool, VariableAggregatorNodeConfig, VariableAssignerNodeConfig, AgentModel, AgentTool, WorkflowGraph, LogicNodeConfig } from './astrlabe/contracts.js';
1
+ import { AgentConfig, AnswerNodeConfig, CodeNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, ModelProviderNodeConfig, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, AgentRule, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, WorkflowTool, VariableAggregatorNodeConfig, VariableAssignerNodeConfig } from './astrlabe/contracts.mjs';
5
2
 
6
3
  type WorkflowCardDisplayMode = 'detailed' | 'compact';
7
4
  type WorkflowEntityDefinition = {
@@ -208,66 +205,4 @@ type GroupNodeData = {
208
205
  onRemoveFromCanvas?: (nodeId: string) => void;
209
206
  };
210
207
 
211
- type AgentModalRenderProps = {
212
- agent: AgentWithPrompts | null;
213
- models: AgentModel[];
214
- open: boolean;
215
- isCreateMode: boolean;
216
- onClose: () => void;
217
- onSaved: () => void;
218
- };
219
- type LogicNodeModalRenderProps = {
220
- nodeId: string | null;
221
- nodeLabel: string;
222
- config: LogicNodeConfig | null;
223
- open: boolean;
224
- onClose: () => void;
225
- onSave: (nodeId: string, updatedConfig: LogicNodeConfig) => void;
226
- entities: WorkflowEntityDefinition[];
227
- };
228
- type WorkflowCanvasProps = {
229
- agents: AgentWithPrompts[];
230
- models: AgentModel[];
231
- tools?: WorkflowTool[];
232
- agentTools?: AgentTool[];
233
- rules?: AgentRule[];
234
- entities?: WorkflowEntityDefinition[];
235
- datasources?: Array<{
236
- id: string;
237
- name: string;
238
- dialect: string;
239
- }>;
240
- onLoadTables?: (datasourceId: string) => Promise<string[]>;
241
- onLoadSchema?: (datasourceId: string, table: string) => Promise<Array<{
242
- name: string;
243
- type: string;
244
- nullable?: boolean;
245
- }>>;
246
- initialGraph?: WorkflowGraph | null;
247
- onGraphChange?: (graph: WorkflowGraph) => void;
248
- onEditTool?: (tool: WorkflowTool) => void;
249
- onToggleTool?: (tool: WorkflowTool) => void;
250
- onEditRule?: (rule: AgentRule) => void;
251
- onToggleRule?: (rule: AgentRule) => void;
252
- onCancelCreateAgent?: () => void;
253
- onAgentSaved?: () => void;
254
- isCreatingAgent?: boolean;
255
- /** Custom node type components — merged with built-in edge types */
256
- nodeTypes?: NodeTypes;
257
- /** Optional: render the AgentModal externally (frontend provides the component) */
258
- renderAgentModal?: (props: AgentModalRenderProps) => React.ReactNode;
259
- /** Optional: render a custom LogicNodeModal; defaults to internal modal */
260
- renderLogicNodeModal?: (props: LogicNodeModalRenderProps) => React.ReactNode;
261
- };
262
- declare function WorkflowCanvas(props: WorkflowCanvasProps): react_jsx_runtime.JSX.Element;
263
-
264
- type BuilderCanvasProps = ComponentProps<typeof WorkflowCanvas>;
265
- type WorkspaceProps = {
266
- locale?: string;
267
- messages?: Record<string, unknown>;
268
- className?: string;
269
- workflowId?: string;
270
- } & Partial<BuilderCanvasProps>;
271
- declare function Workspace({ locale, messages, className, workflowId, ...canvasProps }: WorkspaceProps): react_jsx_runtime.JSX.Element;
272
-
273
- export { type AgentWithPrompts as A, type CodeNodeData as C, type DocumentExtractorNodeData as D, type EntityNodeData as E, type GroupNodeData as G, type HttpRequestNodeData as H, type IfElseNodeData as I, type KnowledgeBaseNodeData as K, type ListOperatorNodeData as L, type ModelProviderNodeData as M, type NoteNodeData as N, type ParameterExtractorNodeData as P, type QuestionClassifierNodeData as Q, type RuleNodeData as R, type StartNodeData as S, type ToolCanvasData as T, type VariableAssignerNodeData as V, type WorkflowEntityDefinition as W, type AgentNodeData as a, type EndNodeData as b, type TemplateTransformNodeData as c, type IterationNodeData as d, type AnswerNodeData as e, type VariableAggregatorNodeData as f, type IterationStartNodeData as g, type WorkspaceProps as h, type AgentNodeTool as i, Workspace as j };
208
+ export type { AgentWithPrompts as A, CodeNodeData as C, DocumentExtractorNodeData as D, EntityNodeData as E, GroupNodeData as G, HttpRequestNodeData as H, IfElseNodeData as I, KnowledgeBaseNodeData as K, ListOperatorNodeData as L, ModelProviderNodeData as M, NoteNodeData as N, ParameterExtractorNodeData as P, QuestionClassifierNodeData as Q, RuleNodeData as R, StartNodeData as S, ToolCanvasData as T, VariableAssignerNodeData as V, WorkflowEntityDefinition as W, AgentNodeData as a, EndNodeData as b, TemplateTransformNodeData as c, IterationNodeData as d, AnswerNodeData as e, VariableAggregatorNodeData as f, IterationStartNodeData as g, AgentNodeTool as h };
@@ -1,7 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentProps } from 'react';
3
- import { NodeTypes } from '@xyflow/react';
4
- import { AgentConfig, AnswerNodeConfig, CodeNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, ModelProviderNodeConfig, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, AgentRule, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, WorkflowTool, VariableAggregatorNodeConfig, VariableAssignerNodeConfig, AgentModel, AgentTool, WorkflowGraph, LogicNodeConfig } from './astrlabe/contracts.mjs';
1
+ import { AgentConfig, AnswerNodeConfig, CodeNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, ModelProviderNodeConfig, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, AgentRule, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, WorkflowTool, VariableAggregatorNodeConfig, VariableAssignerNodeConfig } from './astrlabe/contracts.js';
5
2
 
6
3
  type WorkflowCardDisplayMode = 'detailed' | 'compact';
7
4
  type WorkflowEntityDefinition = {
@@ -208,66 +205,4 @@ type GroupNodeData = {
208
205
  onRemoveFromCanvas?: (nodeId: string) => void;
209
206
  };
210
207
 
211
- type AgentModalRenderProps = {
212
- agent: AgentWithPrompts | null;
213
- models: AgentModel[];
214
- open: boolean;
215
- isCreateMode: boolean;
216
- onClose: () => void;
217
- onSaved: () => void;
218
- };
219
- type LogicNodeModalRenderProps = {
220
- nodeId: string | null;
221
- nodeLabel: string;
222
- config: LogicNodeConfig | null;
223
- open: boolean;
224
- onClose: () => void;
225
- onSave: (nodeId: string, updatedConfig: LogicNodeConfig) => void;
226
- entities: WorkflowEntityDefinition[];
227
- };
228
- type WorkflowCanvasProps = {
229
- agents: AgentWithPrompts[];
230
- models: AgentModel[];
231
- tools?: WorkflowTool[];
232
- agentTools?: AgentTool[];
233
- rules?: AgentRule[];
234
- entities?: WorkflowEntityDefinition[];
235
- datasources?: Array<{
236
- id: string;
237
- name: string;
238
- dialect: string;
239
- }>;
240
- onLoadTables?: (datasourceId: string) => Promise<string[]>;
241
- onLoadSchema?: (datasourceId: string, table: string) => Promise<Array<{
242
- name: string;
243
- type: string;
244
- nullable?: boolean;
245
- }>>;
246
- initialGraph?: WorkflowGraph | null;
247
- onGraphChange?: (graph: WorkflowGraph) => void;
248
- onEditTool?: (tool: WorkflowTool) => void;
249
- onToggleTool?: (tool: WorkflowTool) => void;
250
- onEditRule?: (rule: AgentRule) => void;
251
- onToggleRule?: (rule: AgentRule) => void;
252
- onCancelCreateAgent?: () => void;
253
- onAgentSaved?: () => void;
254
- isCreatingAgent?: boolean;
255
- /** Custom node type components — merged with built-in edge types */
256
- nodeTypes?: NodeTypes;
257
- /** Optional: render the AgentModal externally (frontend provides the component) */
258
- renderAgentModal?: (props: AgentModalRenderProps) => React.ReactNode;
259
- /** Optional: render a custom LogicNodeModal; defaults to internal modal */
260
- renderLogicNodeModal?: (props: LogicNodeModalRenderProps) => React.ReactNode;
261
- };
262
- declare function WorkflowCanvas(props: WorkflowCanvasProps): react_jsx_runtime.JSX.Element;
263
-
264
- type BuilderCanvasProps = ComponentProps<typeof WorkflowCanvas>;
265
- type WorkspaceProps = {
266
- locale?: string;
267
- messages?: Record<string, unknown>;
268
- className?: string;
269
- workflowId?: string;
270
- } & Partial<BuilderCanvasProps>;
271
- declare function Workspace({ locale, messages, className, workflowId, ...canvasProps }: WorkspaceProps): react_jsx_runtime.JSX.Element;
272
-
273
- export { type AgentWithPrompts as A, type CodeNodeData as C, type DocumentExtractorNodeData as D, type EntityNodeData as E, type GroupNodeData as G, type HttpRequestNodeData as H, type IfElseNodeData as I, type KnowledgeBaseNodeData as K, type ListOperatorNodeData as L, type ModelProviderNodeData as M, type NoteNodeData as N, type ParameterExtractorNodeData as P, type QuestionClassifierNodeData as Q, type RuleNodeData as R, type StartNodeData as S, type ToolCanvasData as T, type VariableAssignerNodeData as V, type WorkflowEntityDefinition as W, type AgentNodeData as a, type EndNodeData as b, type TemplateTransformNodeData as c, type IterationNodeData as d, type AnswerNodeData as e, type VariableAggregatorNodeData as f, type IterationStartNodeData as g, type WorkspaceProps as h, type AgentNodeTool as i, Workspace as j };
208
+ export type { AgentWithPrompts as A, CodeNodeData as C, DocumentExtractorNodeData as D, EntityNodeData as E, GroupNodeData as G, HttpRequestNodeData as H, IfElseNodeData as I, KnowledgeBaseNodeData as K, ListOperatorNodeData as L, ModelProviderNodeData as M, NoteNodeData as N, ParameterExtractorNodeData as P, QuestionClassifierNodeData as Q, RuleNodeData as R, StartNodeData as S, ToolCanvasData as T, VariableAssignerNodeData as V, WorkflowEntityDefinition as W, AgentNodeData as a, EndNodeData as b, TemplateTransformNodeData as c, IterationNodeData as d, AnswerNodeData as e, VariableAggregatorNodeData as f, IterationStartNodeData as g, AgentNodeTool as h };
@@ -0,0 +1,41 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SessionSwitcherProps, ManagedUser, Organization } from '@datatechsolutions/shared-domain/common';
3
+ import { ReactNode } from 'react';
4
+ import { AuthUser } from '@datatechsolutions/windsock/client';
5
+ export { CreatePlatformRbacOptions, PlatformRbac, PlatformRoleDefinition, createPlatformRbac } from './rbac.mjs';
6
+ export { CreateSecretInput, SecretDetail, SecretSummary, UpdateSecretInput, addOrganizationDomain, addOrganizationMember, createOrganization, createOrganizationInvitation, createPermission, createSecret, createUser, deleteOrganization, deletePermission, deleteUser, disableSecret, getSecret, getUserPermissions, listOrganizationDomains, listOrganizationInvitations, listOrganizationMembers, listOrganizations, listPermissions, listSecrets, listUsers, removeOrganizationMember, resetUserPassword, rotateSecret, setUserPermissions, setWindsockAdminClient, updateOrganization, updatePermission, updateUser, verifyOrganizationDomain } from './windsock-admin-client.mjs';
7
+ import { AdminUserSummary, AuthOrganization } from '@datatechsolutions/shared-domain';
8
+
9
+ declare function SessionSwitcher({ organizations, users, organizationId, userEmail, onOrganizationChange, onUserChange, }: SessionSwitcherProps): react_jsx_runtime.JSX.Element;
10
+
11
+ type PlatformState = {
12
+ currentOrganizationId: string;
13
+ actor: AuthUser | null;
14
+ };
15
+ type PlatformStateProviderProps = {
16
+ children: ReactNode;
17
+ /**
18
+ * Function that converts a JWT role claim to the app's canonical role
19
+ * union (the same `normalizePlatformRole` produced by
20
+ * `createPlatformRbac()` in this app). Lifted out as a prop because
21
+ * each consuming app uses its own role enum.
22
+ */
23
+ normalizeRole: (input: unknown) => string;
24
+ };
25
+ declare function PlatformStateProvider({ children, normalizeRole }: PlatformStateProviderProps): react_jsx_runtime.JSX.Element;
26
+ declare function usePlatformState(): PlatformState;
27
+
28
+ /** Maps a windsock AuthOrganization to the app-level Organization shape used by UI pages. */
29
+ declare function mapAuthOrg(raw: AuthOrganization): Organization;
30
+ /**
31
+ * Maps a windsock AdminUserSummary to the app-level ManagedUser shape.
32
+ * Takes `normalizeRole` as a parameter so each consuming app can plug in
33
+ * the role normalizer produced by its own `createPlatformRbac()` call —
34
+ * we deliberately don't hardcode an app-specific role enum here.
35
+ */
36
+ declare function mapAdminUser(row: AdminUserSummary, normalizeRole: (input: unknown) => string): ManagedUser;
37
+ /** Maps an app-level UserRole to a windsock AuthOrganizationRole. */
38
+ declare const ORG_ROLE_MAP: Record<string, 'owner' | 'admin' | 'member' | 'viewer'>;
39
+ declare function mapRoleToOrgRole(role: string): 'owner' | 'admin' | 'member' | 'viewer';
40
+
41
+ export { ORG_ROLE_MAP, PlatformStateProvider, type PlatformStateProviderProps, SessionSwitcher, mapAdminUser, mapAuthOrg, mapRoleToOrgRole, usePlatformState };
@@ -0,0 +1,41 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SessionSwitcherProps, ManagedUser, Organization } from '@datatechsolutions/shared-domain/common';
3
+ import { ReactNode } from 'react';
4
+ import { AuthUser } from '@datatechsolutions/windsock/client';
5
+ export { CreatePlatformRbacOptions, PlatformRbac, PlatformRoleDefinition, createPlatformRbac } from './rbac.js';
6
+ export { CreateSecretInput, SecretDetail, SecretSummary, UpdateSecretInput, addOrganizationDomain, addOrganizationMember, createOrganization, createOrganizationInvitation, createPermission, createSecret, createUser, deleteOrganization, deletePermission, deleteUser, disableSecret, getSecret, getUserPermissions, listOrganizationDomains, listOrganizationInvitations, listOrganizationMembers, listOrganizations, listPermissions, listSecrets, listUsers, removeOrganizationMember, resetUserPassword, rotateSecret, setUserPermissions, setWindsockAdminClient, updateOrganization, updatePermission, updateUser, verifyOrganizationDomain } from './windsock-admin-client.js';
7
+ import { AdminUserSummary, AuthOrganization } from '@datatechsolutions/shared-domain';
8
+
9
+ declare function SessionSwitcher({ organizations, users, organizationId, userEmail, onOrganizationChange, onUserChange, }: SessionSwitcherProps): react_jsx_runtime.JSX.Element;
10
+
11
+ type PlatformState = {
12
+ currentOrganizationId: string;
13
+ actor: AuthUser | null;
14
+ };
15
+ type PlatformStateProviderProps = {
16
+ children: ReactNode;
17
+ /**
18
+ * Function that converts a JWT role claim to the app's canonical role
19
+ * union (the same `normalizePlatformRole` produced by
20
+ * `createPlatformRbac()` in this app). Lifted out as a prop because
21
+ * each consuming app uses its own role enum.
22
+ */
23
+ normalizeRole: (input: unknown) => string;
24
+ };
25
+ declare function PlatformStateProvider({ children, normalizeRole }: PlatformStateProviderProps): react_jsx_runtime.JSX.Element;
26
+ declare function usePlatformState(): PlatformState;
27
+
28
+ /** Maps a windsock AuthOrganization to the app-level Organization shape used by UI pages. */
29
+ declare function mapAuthOrg(raw: AuthOrganization): Organization;
30
+ /**
31
+ * Maps a windsock AdminUserSummary to the app-level ManagedUser shape.
32
+ * Takes `normalizeRole` as a parameter so each consuming app can plug in
33
+ * the role normalizer produced by its own `createPlatformRbac()` call —
34
+ * we deliberately don't hardcode an app-specific role enum here.
35
+ */
36
+ declare function mapAdminUser(row: AdminUserSummary, normalizeRole: (input: unknown) => string): ManagedUser;
37
+ /** Maps an app-level UserRole to a windsock AuthOrganizationRole. */
38
+ declare const ORG_ROLE_MAP: Record<string, 'owner' | 'admin' | 'member' | 'viewer'>;
39
+ declare function mapRoleToOrgRole(role: string): 'owner' | 'admin' | 'member' | 'viewer';
40
+
41
+ export { ORG_ROLE_MAP, PlatformStateProvider, type PlatformStateProviderProps, SessionSwitcher, mapAdminUser, mapAuthOrg, mapRoleToOrgRole, usePlatformState };