@stapel/workspaces-react 0.6.0 → 0.8.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/CHANGELOG.md +56 -0
- package/dist/api/generated/schema.d.ts +774 -7
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/api/types.d.ts +104 -7
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/workspacesApi.d.ts +55 -1
- package/dist/api/workspacesApi.d.ts.map +1 -1
- package/dist/api/workspacesApi.js +23 -0
- package/dist/api/workspacesApi.js.map +1 -1
- package/dist/default/InviteAcceptPage.d.ts +28 -0
- package/dist/default/InviteAcceptPage.d.ts.map +1 -0
- package/dist/default/InviteAcceptPage.js +141 -0
- package/dist/default/InviteAcceptPage.js.map +1 -0
- package/dist/default/MembersManager.d.ts +4 -4
- package/dist/default/MembersManager.d.ts.map +1 -1
- package/dist/default/MembersManager.js +61 -56
- package/dist/default/MembersManager.js.map +1 -1
- package/dist/default/index.d.ts +2 -0
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +1 -0
- package/dist/default/index.js.map +1 -1
- package/dist/flows/inviteAcceptFlow.d.ts +155 -0
- package/dist/flows/inviteAcceptFlow.d.ts.map +1 -0
- package/dist/flows/inviteAcceptFlow.js +126 -0
- package/dist/flows/inviteAcceptFlow.js.map +1 -0
- package/dist/headless/Can.d.ts +40 -0
- package/dist/headless/Can.d.ts.map +1 -0
- package/dist/headless/Can.js +30 -0
- package/dist/headless/Can.js.map +1 -0
- package/dist/headless/InviteAcceptFlow.d.ts +44 -0
- package/dist/headless/InviteAcceptFlow.d.ts.map +1 -0
- package/dist/headless/InviteAcceptFlow.js +67 -0
- package/dist/headless/InviteAcceptFlow.js.map +1 -0
- package/dist/headless/RoleSelect.d.ts +41 -0
- package/dist/headless/RoleSelect.d.ts.map +1 -0
- package/dist/headless/RoleSelect.js +34 -0
- package/dist/headless/RoleSelect.js.map +1 -0
- package/dist/i18n/generated/errors.gen.d.ts +48 -0
- package/dist/i18n/generated/errors.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.gen.js +24 -0
- package/dist/i18n/generated/errors.gen.js.map +1 -1
- package/dist/i18n/generated/errors.ru.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.ru.gen.js +8 -0
- package/dist/i18n/generated/errors.ru.gen.js.map +1 -1
- package/dist/i18n/keys.d.ts +28 -0
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +64 -0
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +30 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/model/capabilities.d.ts +21 -0
- package/dist/model/capabilities.d.ts.map +1 -0
- package/dist/model/capabilities.js +32 -0
- package/dist/model/capabilities.js.map +1 -0
- package/dist/model/emailMask.d.ts +22 -0
- package/dist/model/emailMask.d.ts.map +1 -0
- package/dist/model/emailMask.js +36 -0
- package/dist/model/emailMask.js.map +1 -0
- package/dist/model/mutations.d.ts +107 -3
- package/dist/model/mutations.d.ts.map +1 -1
- package/dist/model/mutations.js +190 -1
- package/dist/model/mutations.js.map +1 -1
- package/dist/model/queries.d.ts +108 -2
- package/dist/model/queries.d.ts.map +1 -1
- package/dist/model/queries.js +139 -1
- package/dist/model/queries.js.map +1 -1
- package/dist/model/queryKeys.d.ts +12 -1
- package/dist/model/queryKeys.d.ts.map +1 -1
- package/dist/model/queryKeys.js +25 -0
- package/dist/model/queryKeys.js.map +1 -1
- package/dist/model/stepUp.d.ts +25 -0
- package/dist/model/stepUp.d.ts.map +1 -0
- package/dist/model/stepUp.js +79 -0
- package/dist/model/stepUp.js.map +1 -0
- package/llms.txt +49 -15
- package/manifest.json +346 -3
- package/package.json +5 -5
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +774 -7
- package/src/api/types.ts +113 -7
- package/src/api/workspacesApi.ts +137 -0
- package/src/default/InviteAcceptPage.tsx +373 -0
- package/src/default/MembersManager.tsx +155 -145
- package/src/default/index.ts +2 -0
- package/src/flows/inviteAcceptFlow.ts +289 -0
- package/src/headless/Can.tsx +49 -0
- package/src/headless/InviteAcceptFlow.tsx +105 -0
- package/src/headless/RoleSelect.tsx +58 -0
- package/src/i18n/generated/errors.gen.ts +24 -0
- package/src/i18n/generated/errors.json +62 -0
- package/src/i18n/generated/errors.ru.gen.ts +8 -0
- package/src/i18n/keys.ts +68 -0
- package/src/i18n/ru.ts +34 -0
- package/src/index.ts +54 -1
- package/src/model/capabilities.ts +37 -0
- package/src/model/emailMask.ts +37 -0
- package/src/model/mutations.ts +248 -4
- package/src/model/queries.ts +205 -2
- package/src/model/queryKeys.ts +45 -1
- package/src/model/stepUp.ts +96 -0
package/dist/i18n/ru.js
CHANGED
|
@@ -54,6 +54,36 @@ export const workspacesI18nBundleRu = {
|
|
|
54
54
|
"workspaces.members.role.admin": "Администратор",
|
|
55
55
|
"workspaces.members.role.member": "Участник",
|
|
56
56
|
"workspaces.members.role.viewer": "Наблюдатель",
|
|
57
|
+
// Role registry labels (builtin four; clients merge their own roles)
|
|
58
|
+
"workspaces.role.owner": "Владелец",
|
|
59
|
+
"workspaces.role.admin": "Администратор",
|
|
60
|
+
"workspaces.role.member": "Участник",
|
|
61
|
+
"workspaces.role.viewer": "Наблюдатель",
|
|
62
|
+
// Invite accept flow (org-program §B4)
|
|
63
|
+
"workspaces.invite.loading": "Загрузка приглашения…",
|
|
64
|
+
"workspaces.invite.acceptTitle": "Присоединиться к {workspace}",
|
|
65
|
+
"workspaces.invite.roleLine": "Вас пригласили с ролью {role}.",
|
|
66
|
+
"workspaces.invite.emailLine": "Приглашение для {email}",
|
|
67
|
+
"workspaces.invite.joinCta": "Присоединиться",
|
|
68
|
+
"workspaces.invite.declineCta": "Отклонить",
|
|
69
|
+
"workspaces.invite.accepted": "Вы присоединились к {workspace}.",
|
|
70
|
+
"workspaces.invite.declined": "Приглашение отклонено.",
|
|
71
|
+
"workspaces.invite.unavailable.expired": "Срок приглашения истёк. Попросите новое.",
|
|
72
|
+
"workspaces.invite.unavailable.revoked": "Приглашение было отозвано.",
|
|
73
|
+
"workspaces.invite.unavailable.accepted": "Приглашение уже использовано.",
|
|
74
|
+
"workspaces.invite.unavailable.declined": "Приглашение было отклонено.",
|
|
75
|
+
"workspaces.invite.wrongAccount": "Приглашение для другого аккаунта",
|
|
76
|
+
"workspaces.invite.wrongAccountHint": "Вы вошли как {email}, а приглашение отправлено на {invited}. Смените аккаунт, чтобы продолжить.",
|
|
77
|
+
"workspaces.invite.switchAccountCta": "Сменить аккаунт",
|
|
78
|
+
"workspaces.invite.loginTitle": "Войдите, чтобы принять приглашение",
|
|
79
|
+
"workspaces.invite.newUserHint": "Мы создадим подтверждённый аккаунт для {email} — без пароля и подтверждения почты.",
|
|
80
|
+
"workspaces.invite.createAccountCta": "Создать аккаунт и продолжить",
|
|
81
|
+
"workspaces.invite.claiming": "Создаём ваш аккаунт…",
|
|
82
|
+
"workspaces.invite.exchanging": "Выполняем вход…",
|
|
83
|
+
"workspaces.invite.exchangeFailed": "Не удалось завершить вход.",
|
|
84
|
+
"workspaces.invite.retryCta": "Попробовать ещё раз",
|
|
85
|
+
"workspaces.invite.basicDataTitle": "Настройте профиль",
|
|
86
|
+
"workspaces.invite.basicDataContinueCta": "Продолжить",
|
|
57
87
|
};
|
|
58
88
|
/**
|
|
59
89
|
* Register the pair's `ru` locale into a core i18n engine (call once at
|
package/dist/i18n/ru.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ru.js","sourceRoot":"","sources":["../../src/i18n/ru.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE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IACnC,uBAAuB,EAAE,eAAe;IACxC,wBAAwB,EAAE,UAAU;IACpC,wBAAwB,EAAE,aAAa;IAEvC,uCAAuC;IACvC,2BAA2B,EAAE,uBAAuB;IACpD,+BAA+B,EAAE,8BAA8B;IAC/D,4BAA4B,EAAE,gCAAgC;IAC9D,6BAA6B,EAAE,yBAAyB;IACxD,2BAA2B,EAAE,gBAAgB;IAC7C,8BAA8B,EAAE,WAAW;IAC3C,4BAA4B,EAAE,kCAAkC;IAChE,4BAA4B,EAAE,wBAAwB;IACtD,uCAAuC,EAAE,0CAA0C;IACnF,uCAAuC,EAAE,4BAA4B;IACrE,wCAAwC,EAAE,+BAA+B;IACzE,wCAAwC,EAAE,6BAA6B;IACvE,gCAAgC,EAAE,kCAAkC;IACpE,oCAAoC,EAClC,iGAAiG;IACnG,oCAAoC,EAAE,iBAAiB;IACvD,8BAA8B,EAAE,oCAAoC;IACpE,+BAA+B,EAC7B,oFAAoF;IACtF,oCAAoC,EAAE,8BAA8B;IACpE,4BAA4B,EAAE,sBAAsB;IACpD,8BAA8B,EAAE,iBAAiB;IACjD,kCAAkC,EAAE,4BAA4B;IAChE,4BAA4B,EAAE,qBAAqB;IACnD,kCAAkC,EAAE,mBAAmB;IACvD,wCAAwC,EAAE,YAAY;CACvD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAkB;IACzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;IACpD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;AACtD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,16 +14,23 @@ export type { Schemas } from "./api/types.js";
|
|
|
14
14
|
export { createFlowMachine, useFlow, isErrorCode } from "@stapel/core";
|
|
15
15
|
export type { FlowMachine, FlowMachineOptions, FlowStateBase, FlowError, } from "@stapel/core";
|
|
16
16
|
export { toFlowError } from "./flows/errors.js";
|
|
17
|
+
export { createInviteAcceptFlow } from "./flows/inviteAcceptFlow.js";
|
|
18
|
+
export type { InviteAcceptFlow as InviteAcceptFlowController, InviteAcceptFlowDeps, InviteAcceptState, } from "./flows/inviteAcceptFlow.js";
|
|
17
19
|
export { WORKSPACES_FLOWS, flowEndpoints } from "./flows/registry.js";
|
|
18
20
|
export type { WorkspacesFlowId, WorkspacesFlowSpec, FlowEndpoint, } from "./flows/registry.js";
|
|
19
21
|
export { createWorkspacesRuntime } from "./model/runtime.js";
|
|
20
22
|
export type { WorkspacesRuntime, CreateWorkspacesRuntimeOptions, } from "./model/runtime.js";
|
|
21
23
|
export { WorkspacesRuntimeContext, useWorkspacesRuntime, useWorkspacesApi, useWorkspacesAnalytics, } from "./model/context.js";
|
|
22
24
|
export { workspacesQueryKeys } from "./model/queryKeys.js";
|
|
23
|
-
export { useWorkspaces, useWorkspace, useMembers, } from "./model/queries.js";
|
|
24
|
-
export {
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export { useWorkspaces, useWorkspace, useMembers, useInvitations, useInfiniteInvitations, useRoles, useInvitationPreview, useCapabilities, useCapabilityGate, } from "./model/queries.js";
|
|
26
|
+
export type { CapabilitiesResult, CapabilityGate } from "./model/queries.js";
|
|
27
|
+
export { capabilityMatches, hasCapability } from "./model/capabilities.js";
|
|
28
|
+
export { BUILTIN_CAPABILITY_LEVELS, SENSITIVE_SCOPE, capabilityLevel, readVerificationEnrollment, } from "./model/stepUp.js";
|
|
29
|
+
export type { CapabilityLevel, VerificationEnrollment, } from "./model/stepUp.js";
|
|
30
|
+
export { maskEmail, emailMatchesMask } from "./model/emailMask.js";
|
|
31
|
+
export { useCreateWorkspace, useUpdateWorkspace, useDeleteWorkspace, useInviteMembers, useUpdateMemberRole, useRemoveMember, useAcceptInvitation, useClaimInvitation, useDeclineInvitation, useRevokeInvitation, useResendInvitation, useResetMemberPassword, useUpdateSecuritySettings, } from "./model/mutations.js";
|
|
32
|
+
export type { MemberRoleChange, MemberPasswordResetVars, } from "./model/mutations.js";
|
|
33
|
+
export type { Workspace as WorkspaceData, WorkspaceList as WorkspaceListData, WorkspaceCreate, WorkspaceUpdate, Member as MemberData, MemberPage as MemberListData, MembersParams, MemberInvite, MemberInviteResult, MemberRoleUpdate, Invitation, InvitationPage as InvitationListData, InvitationsParams, InvitationStatusFilter, InvitationAccept, InvitationPreview, InvitationClaim, MemberPasswordReset, MemberPasswordResetResult, ProvisionedUserPolicy, WorkspaceSecuritySettings, RoleInfo, RoleList, WorkspaceRole, WorkspaceKind, } from "./api/types.js";
|
|
27
34
|
export { WorkspacesProvider } from "./headless/WorkspacesProvider.js";
|
|
28
35
|
export { WorkspaceList } from "./headless/WorkspaceList.js";
|
|
29
36
|
export type { WorkspaceListBag } from "./headless/WorkspaceList.js";
|
|
@@ -31,6 +38,12 @@ export { Members } from "./headless/Members.js";
|
|
|
31
38
|
export type { MembersBag } from "./headless/Members.js";
|
|
32
39
|
export { AcceptInvitation } from "./headless/AcceptInvitation.js";
|
|
33
40
|
export type { AcceptInvitationBag } from "./headless/AcceptInvitation.js";
|
|
41
|
+
export { Can } from "./headless/Can.js";
|
|
42
|
+
export type { CanBag } from "./headless/Can.js";
|
|
43
|
+
export { RoleSelect } from "./headless/RoleSelect.js";
|
|
44
|
+
export type { RoleSelectBag } from "./headless/RoleSelect.js";
|
|
45
|
+
export { InviteAcceptFlow } from "./headless/InviteAcceptFlow.js";
|
|
46
|
+
export type { InviteAcceptFlowBag } from "./headless/InviteAcceptFlow.js";
|
|
34
47
|
export { WORKSPACES_I18N_KEYS, workspacesI18nBundleEn, registerWorkspacesI18n, } from "./i18n/keys.js";
|
|
35
48
|
export type { WorkspacesI18nKey } from "./i18n/keys.js";
|
|
36
49
|
export { WORKSPACES_ERRORS, WORKSPACES_ERROR_CODES, workspacesErrorBundleEn, explainWorkspacesError, } from "./i18n/errorsMap.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvE,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACtE,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,YAAY,EACV,iBAAiB,EACjB,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvE,YAAY,EACV,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AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAG1E,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,GACZ,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,20 +15,28 @@ export { createWorkspacesApi } from "./api/workspacesApi.js";
|
|
|
15
15
|
// every pair — frontend-core-architecture §4b). Re-exported for ergonomics.
|
|
16
16
|
export { createFlowMachine, useFlow, isErrorCode } from "@stapel/core";
|
|
17
17
|
export { toFlowError } from "./flows/errors.js";
|
|
18
|
+
export { createInviteAcceptFlow } from "./flows/inviteAcceptFlow.js";
|
|
18
19
|
export { WORKSPACES_FLOWS, flowEndpoints } from "./flows/registry.js";
|
|
19
20
|
// ── model (runtime wiring, query keys, context) ──────────────────────────────
|
|
20
21
|
export { createWorkspacesRuntime } from "./model/runtime.js";
|
|
21
22
|
export { WorkspacesRuntimeContext, useWorkspacesRuntime, useWorkspacesApi, useWorkspacesAnalytics, } from "./model/context.js";
|
|
22
23
|
export { workspacesQueryKeys } from "./model/queryKeys.js";
|
|
23
24
|
// ── model (read hooks) ───────────────────────────────────────────────────────
|
|
24
|
-
export { useWorkspaces, useWorkspace, useMembers, } from "./model/queries.js";
|
|
25
|
+
export { useWorkspaces, useWorkspace, useMembers, useInvitations, useInfiniteInvitations, useRoles, useInvitationPreview, useCapabilities, useCapabilityGate, } from "./model/queries.js";
|
|
26
|
+
// ── model (capability matcher + email-mask ports — backend-synced utils) ─────
|
|
27
|
+
export { capabilityMatches, hasCapability } from "./model/capabilities.js";
|
|
28
|
+
export { BUILTIN_CAPABILITY_LEVELS, SENSITIVE_SCOPE, capabilityLevel, readVerificationEnrollment, } from "./model/stepUp.js";
|
|
29
|
+
export { maskEmail, emailMatchesMask } from "./model/emailMask.js";
|
|
25
30
|
// ── model (write hooks) ──────────────────────────────────────────────────────
|
|
26
|
-
export { useCreateWorkspace, useUpdateWorkspace, useDeleteWorkspace, useInviteMembers, useUpdateMemberRole, useRemoveMember, useAcceptInvitation, } from "./model/mutations.js";
|
|
31
|
+
export { useCreateWorkspace, useUpdateWorkspace, useDeleteWorkspace, useInviteMembers, useUpdateMemberRole, useRemoveMember, useAcceptInvitation, useClaimInvitation, useDeclineInvitation, useRevokeInvitation, useResendInvitation, useResetMemberPassword, useUpdateSecuritySettings, } from "./model/mutations.js";
|
|
27
32
|
// ── headless (renderless components) ─────────────────────────────────────────
|
|
28
33
|
export { WorkspacesProvider } from "./headless/WorkspacesProvider.js";
|
|
29
34
|
export { WorkspaceList } from "./headless/WorkspaceList.js";
|
|
30
35
|
export { Members } from "./headless/Members.js";
|
|
31
36
|
export { AcceptInvitation } from "./headless/AcceptInvitation.js";
|
|
37
|
+
export { Can } from "./headless/Can.js";
|
|
38
|
+
export { RoleSelect } from "./headless/RoleSelect.js";
|
|
39
|
+
export { InviteAcceptFlow } from "./headless/InviteAcceptFlow.js";
|
|
32
40
|
// ── i18n ─────────────────────────────────────────────────────────────────────
|
|
33
41
|
export { WORKSPACES_I18N_KEYS, workspacesI18nBundleEn, registerWorkspacesI18n, } from "./i18n/keys.js";
|
|
34
42
|
// ── errors map (code → status/params/remediation/en; generated) ──────────────
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gFAAgF;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D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
* Client-side capability matcher (org-program §A1/§A2) — a PORT of
|
|
3
|
+
* stapel-workspaces' `capabilities.capability_matches` (which is itself
|
|
4
|
+
* mirrored by the consumer helper in `stapel_core.django.workspaces`).
|
|
5
|
+
* KEEP SEMANTICS IN SYNC with the backend: capability strings are namespaced
|
|
6
|
+
* `"<domain>.<action>"`, free-form for the client (`meetings.spotlight`,
|
|
7
|
+
* `records.view`, …); a granted string may be the exact capability, the
|
|
8
|
+
* global wildcard `"*"`, or a prefix wildcard like `"members.*"` (which
|
|
9
|
+
* matches `members.remove` AND deeper `members.role.change`).
|
|
10
|
+
*
|
|
11
|
+
* The client-side check is a UI convenience (hide/disable affordances) —
|
|
12
|
+
* NEVER an access decision: the backend re-checks every capability on every
|
|
13
|
+
* operation (`has_capability` in-service, `workspaces.check_capability`
|
|
14
|
+
* cross-service).
|
|
15
|
+
*/
|
|
16
|
+
/** Match one granted capability string against the requested one. */
|
|
17
|
+
export declare function capabilityMatches(capability: string, granted: string): boolean;
|
|
18
|
+
/** True if any of `granted` (verbatim registry strings, wildcards included)
|
|
19
|
+
* matches `capability`. Empty/absent grants deny — deny-by-default. */
|
|
20
|
+
export declare function hasCapability(granted: readonly string[] | null | undefined, capability: string): boolean;
|
|
21
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/model/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,qEAAqE;AACrE,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAMT;AAED;uEACuE;AACvE,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAC7C,UAAU,EAAE,MAAM,GACjB,OAAO,CAGT"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side capability matcher (org-program §A1/§A2) — a PORT of
|
|
3
|
+
* stapel-workspaces' `capabilities.capability_matches` (which is itself
|
|
4
|
+
* mirrored by the consumer helper in `stapel_core.django.workspaces`).
|
|
5
|
+
* KEEP SEMANTICS IN SYNC with the backend: capability strings are namespaced
|
|
6
|
+
* `"<domain>.<action>"`, free-form for the client (`meetings.spotlight`,
|
|
7
|
+
* `records.view`, …); a granted string may be the exact capability, the
|
|
8
|
+
* global wildcard `"*"`, or a prefix wildcard like `"members.*"` (which
|
|
9
|
+
* matches `members.remove` AND deeper `members.role.change`).
|
|
10
|
+
*
|
|
11
|
+
* The client-side check is a UI convenience (hide/disable affordances) —
|
|
12
|
+
* NEVER an access decision: the backend re-checks every capability on every
|
|
13
|
+
* operation (`has_capability` in-service, `workspaces.check_capability`
|
|
14
|
+
* cross-service).
|
|
15
|
+
*/
|
|
16
|
+
/** Match one granted capability string against the requested one. */
|
|
17
|
+
export function capabilityMatches(capability, granted) {
|
|
18
|
+
if (granted === "*" || granted === capability)
|
|
19
|
+
return true;
|
|
20
|
+
if (granted.endsWith(".*")) {
|
|
21
|
+
return capability.startsWith(granted.slice(0, -1));
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
/** True if any of `granted` (verbatim registry strings, wildcards included)
|
|
26
|
+
* matches `capability`. Empty/absent grants deny — deny-by-default. */
|
|
27
|
+
export function hasCapability(granted, capability) {
|
|
28
|
+
if (!granted)
|
|
29
|
+
return false;
|
|
30
|
+
return granted.some((g) => capabilityMatches(capability, g));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/model/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,qEAAqE;AACrE,MAAM,UAAU,iBAAiB,CAC/B,UAAkB,EAClB,OAAe;IAEf,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IAC3D,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;uEACuE;AACvE,MAAM,UAAU,aAAa,CAC3B,OAA6C,EAC7C,UAAkB;IAElB,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email masking — a PORT of stapel-workspaces' `views._mask_email` (the
|
|
3
|
+
* function that produces `InvitationPreviewResponse.email_masked`). KEEP IN
|
|
4
|
+
* SYNC with the backend: first character of the local part and of the domain
|
|
5
|
+
* name survive, the TLD stays readable — `m***@e***.com`.
|
|
6
|
+
*
|
|
7
|
+
* Why the client re-implements it: the public invitation preview deliberately
|
|
8
|
+
* carries only the MASKED email (harvest-proof, org-program §B2), yet the
|
|
9
|
+
* §B4 flow must route "session & email match" vs "wrong account" BEFORE
|
|
10
|
+
* attempting the accept. Masking the signed-in account's own (fully known)
|
|
11
|
+
* email with the same algorithm and comparing the two masks is the exact
|
|
12
|
+
* decision the backend would make — without ever exposing the invitee's
|
|
13
|
+
* address. A mask collision (two addresses masking identically) merely shows
|
|
14
|
+
* the accept prompt; the backend's real email-match on accept remains the
|
|
15
|
+
* enforcement point.
|
|
16
|
+
*/
|
|
17
|
+
/** Mask an email exactly like the backend's invitation preview does. */
|
|
18
|
+
export declare function maskEmail(email: string): string;
|
|
19
|
+
/** Whether `email`, masked by the backend's algorithm, equals `emailMasked`
|
|
20
|
+
* (case-insensitive on the email, as the backend matches `iexact`). */
|
|
21
|
+
export declare function emailMatchesMask(email: string, emailMasked: string): boolean;
|
|
22
|
+
//# sourceMappingURL=emailMask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailMask.d.ts","sourceRoot":"","sources":["../../src/model/emailMask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY/C;AAED;uEACuE;AACvE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAE5E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email masking — a PORT of stapel-workspaces' `views._mask_email` (the
|
|
3
|
+
* function that produces `InvitationPreviewResponse.email_masked`). KEEP IN
|
|
4
|
+
* SYNC with the backend: first character of the local part and of the domain
|
|
5
|
+
* name survive, the TLD stays readable — `m***@e***.com`.
|
|
6
|
+
*
|
|
7
|
+
* Why the client re-implements it: the public invitation preview deliberately
|
|
8
|
+
* carries only the MASKED email (harvest-proof, org-program §B2), yet the
|
|
9
|
+
* §B4 flow must route "session & email match" vs "wrong account" BEFORE
|
|
10
|
+
* attempting the accept. Masking the signed-in account's own (fully known)
|
|
11
|
+
* email with the same algorithm and comparing the two masks is the exact
|
|
12
|
+
* decision the backend would make — without ever exposing the invitee's
|
|
13
|
+
* address. A mask collision (two addresses masking identically) merely shows
|
|
14
|
+
* the accept prompt; the backend's real email-match on accept remains the
|
|
15
|
+
* enforcement point.
|
|
16
|
+
*/
|
|
17
|
+
/** Mask an email exactly like the backend's invitation preview does. */
|
|
18
|
+
export function maskEmail(email) {
|
|
19
|
+
const at = email.indexOf("@");
|
|
20
|
+
const local = at === -1 ? email : email.slice(0, at);
|
|
21
|
+
const domain = at === -1 ? "" : email.slice(at + 1);
|
|
22
|
+
const dot = domain.lastIndexOf(".");
|
|
23
|
+
const maskedLocal = `${local.slice(0, 1) || "*"}***`;
|
|
24
|
+
if (dot !== -1) {
|
|
25
|
+
const domainName = domain.slice(0, dot);
|
|
26
|
+
const tld = domain.slice(dot + 1);
|
|
27
|
+
return `${maskedLocal}@${domainName.slice(0, 1) || "*"}***.${tld}`;
|
|
28
|
+
}
|
|
29
|
+
return `${maskedLocal}@${domain.slice(0, 1) || "*"}***`;
|
|
30
|
+
}
|
|
31
|
+
/** Whether `email`, masked by the backend's algorithm, equals `emailMasked`
|
|
32
|
+
* (case-insensitive on the email, as the backend matches `iexact`). */
|
|
33
|
+
export function emailMatchesMask(email, emailMasked) {
|
|
34
|
+
return maskEmail(email.trim().toLowerCase()) === emailMasked.toLowerCase();
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=emailMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailMask.js","sourceRoot":"","sources":["../../src/model/emailMask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,wEAAwE;AACxE,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACpD,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;IACrD,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QAClC,OAAO,GAAG,WAAW,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC;IACrE,CAAC;IACD,OAAO,GAAG,WAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;AAC1D,CAAC;AAED;uEACuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,WAAmB;IACjE,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,WAAW,CAAC,WAAW,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UseMutationResult } from "@tanstack/react-query";
|
|
2
2
|
import type { StapelApiError } from "@stapel/core";
|
|
3
|
-
import type { Member, MemberInvite, MemberInviteResult, InvitationAccept, Workspace, WorkspaceCreate,
|
|
3
|
+
import type { Invitation, Member, MemberInvite, MemberInviteResult, MemberPasswordReset, MemberPasswordResetResult, InvitationAccept, InvitationClaim, Workspace, WorkspaceCreate, WorkspaceSecuritySettings, WorkspaceUpdate } from "../api/types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Write hooks (frontend-standard §2 — "мутации с инвалидацией"). Each mutation
|
|
6
6
|
* invalidates exactly the server state it can move. Membership and ownership are
|
|
@@ -29,10 +29,14 @@ export declare function useDeleteWorkspace(): UseMutationResult<void, StapelApiE
|
|
|
29
29
|
* there).
|
|
30
30
|
*/
|
|
31
31
|
export declare function useInviteMembers(workspaceId: string): UseMutationResult<MemberInviteResult, StapelApiError, MemberInvite>;
|
|
32
|
-
/** The variable for {@link useUpdateMemberRole}: which member, which new role.
|
|
32
|
+
/** The variable for {@link useUpdateMemberRole}: which member, which new role.
|
|
33
|
+
* `role` is an open string since stapel-workspaces 0.6.0 (org-program §A1):
|
|
34
|
+
* the effective registry is settings-extensible, so any key of GET /roles is
|
|
35
|
+
* valid — the backend validates against the registry. {@link WorkspaceRole}
|
|
36
|
+
* still names the builtin four for literals. */
|
|
33
37
|
export interface MemberRoleChange {
|
|
34
38
|
readonly userId: string;
|
|
35
|
-
readonly role:
|
|
39
|
+
readonly role: string;
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
42
|
* Change a member's role (admin+; the backend guards owner grants and the
|
|
@@ -45,6 +49,90 @@ export declare function useUpdateMemberRole(workspaceId: string): UseMutationRes
|
|
|
45
49
|
* variable is the member's `userId`. Refreshes the member list.
|
|
46
50
|
*/
|
|
47
51
|
export declare function useRemoveMember(workspaceId: string): UseMutationResult<void, StapelApiError, string>;
|
|
52
|
+
/**
|
|
53
|
+
* Withdraw a live invitation (POST /{id}/invitations/{invitationId}/revoke,
|
|
54
|
+
* #109). The variable is the invitation id; the reply is the UPDATED row, so
|
|
55
|
+
* it is written straight into the page cache the table reads — a revoke is
|
|
56
|
+
* the mirror of the invitee's decline and both must stay distinguishable in
|
|
57
|
+
* `status`, which a blind refetch-and-hope would blur. Only a `pending`
|
|
58
|
+
* invitation is revocable: the backend answers
|
|
59
|
+
* `error.400.invitation_already_used` / `_revoked` / `_expired` otherwise
|
|
60
|
+
* (each its own key, not a shrug). Also refreshes the member list — the seat
|
|
61
|
+
* the invitation reserved is freed on commit.
|
|
62
|
+
*/
|
|
63
|
+
export declare function useRevokeInvitation(workspaceId: string): UseMutationResult<Invitation, StapelApiError, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Send the invitation email again (POST /{id}/invitations/{invitationId}/resend,
|
|
66
|
+
* #109). The variable is the invitation id.
|
|
67
|
+
*
|
|
68
|
+
* This is NOT an idempotent "poke": the backend rotates the token and
|
|
69
|
+
* restarts the TTL, so every earlier link — including the one already in the
|
|
70
|
+
* invitee's inbox — stops working, and the row's `expires_at` moves. Hence
|
|
71
|
+
* the invalidation: a table still showing the old expiry would be lying about
|
|
72
|
+
* a live credential. An EXPIRED invitation is accepted on purpose (a dead TTL
|
|
73
|
+
* is the commonest reason to resend); reviving it re-reserves a seat, so a
|
|
74
|
+
* plan ceiling can answer 402 here.
|
|
75
|
+
*/
|
|
76
|
+
export declare function useResendInvitation(workspaceId: string): UseMutationResult<Invitation, StapelApiError, string>;
|
|
77
|
+
/** The variable for {@link useResetMemberPassword}: whose password, and the
|
|
78
|
+
* (optional) body — omit `password` to have the server generate one. */
|
|
79
|
+
export interface MemberPasswordResetVars {
|
|
80
|
+
readonly userId: string;
|
|
81
|
+
readonly body?: MemberPasswordReset;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Reset a member's password on the organization's order
|
|
85
|
+
* (POST /{id}/members/{userId}/password/reset, #110).
|
|
86
|
+
*
|
|
87
|
+
* **Step-up before the button.** Capability `members.password.reset` is
|
|
88
|
+
* declared `high`, so the backend wraps the endpoint in
|
|
89
|
+
* `requires_verification(scope="sensitive")`. Ask
|
|
90
|
+
* {@link "./queries.js".useCapabilityGate}(workspaceId,
|
|
91
|
+
* "members.password.reset") BEFORE offering the affordance: it answers both
|
|
92
|
+
* "may this caller" and "will a step-up be demanded". A step-up CHALLENGE is
|
|
93
|
+
* then driven by core's client and replayed transparently; the one case that
|
|
94
|
+
* is not transparent is the ENROLLMENT demand (the caller holds no factor to
|
|
95
|
+
* challenge) — read it off `error` with
|
|
96
|
+
* {@link "./stepUp.js".readVerificationEnrollment} and route to enrollment.
|
|
97
|
+
*
|
|
98
|
+
* **The one-shot credential.** `generated_password` comes back exactly once,
|
|
99
|
+
* only when the request omitted `password`, and can never be re-fetched. It
|
|
100
|
+
* is therefore deliberately kept OUT of the query cache: nothing here writes
|
|
101
|
+
* the response with `setQueryData`, and `gcTime: 0` drops the mutation result
|
|
102
|
+
* the moment the screen showing it unmounts. Writing it to a query would
|
|
103
|
+
* mean writing a live credential into every devtools panel AND into
|
|
104
|
+
* `localStorage`, because core's query runtime persists the whole per-user
|
|
105
|
+
* query cache (`createStapelQueryClient`). Hand it to the member out of band.
|
|
106
|
+
*
|
|
107
|
+
* Refreshes the member list (the reset moves the member's first-login state);
|
|
108
|
+
* a target that is not a resettable member of THIS workspace answers one
|
|
109
|
+
* byte-identical 404, never an existence oracle.
|
|
110
|
+
*/
|
|
111
|
+
export declare function useResetMemberPassword(workspaceId: string): UseMutationResult<MemberPasswordResetResult, StapelApiError, MemberPasswordResetVars>;
|
|
112
|
+
/**
|
|
113
|
+
* Update a workspace's SECURITY settings (the `security` block of
|
|
114
|
+
* `PATCH /{id}`, org-program §C3) — `require_mfa` and the first-login
|
|
115
|
+
* `provisioned_user_policies`.
|
|
116
|
+
*
|
|
117
|
+
* Separate from {@link useUpdateWorkspace} because the backend treats this
|
|
118
|
+
* block as a different endpoint in all but the URL: an extra capability
|
|
119
|
+
* (`workspace.security.manage`, declared `high`) plus a step-up on the same
|
|
120
|
+
* `sensitive` scope as the password reset, and turning `require_mfa` on
|
|
121
|
+
* sweeps the current members. See {@link useResetMemberPassword} for how to
|
|
122
|
+
* wire that in front of the control.
|
|
123
|
+
*
|
|
124
|
+
* `provisioned_user_policies` is a LIST since stapel-workspaces 0.13.0 (#90)
|
|
125
|
+
* — independent checkboxes, not alternatives. An explicit `[]` is a
|
|
126
|
+
* deliberate, auditable choice ("demand nothing"), so it is sent as such and
|
|
127
|
+
* never dropped as "empty means unset".
|
|
128
|
+
*
|
|
129
|
+
* MERGES, because the backend does not: `PATCH` assigns `settings` wholesale
|
|
130
|
+
* (`ws.settings = data.settings`), so sending a bare `{security: …}` would
|
|
131
|
+
* silently drop every other key the workspace holds. The merge reads the
|
|
132
|
+
* workspace fresh rather than trusting the detail cache — a stale snapshot
|
|
133
|
+
* here would resurrect settings somebody else has since removed.
|
|
134
|
+
*/
|
|
135
|
+
export declare function useUpdateSecuritySettings(workspaceId: string): UseMutationResult<Workspace, StapelApiError, WorkspaceSecuritySettings>;
|
|
48
136
|
/**
|
|
49
137
|
* Accept an invitation by its token — the caller joins the workspace. A dead
|
|
50
138
|
* token surfaces a localizable `StapelApiError` (`error.400.invitation_expired`
|
|
@@ -52,4 +140,20 @@ export declare function useRemoveMember(workspaceId: string): UseMutationResult<
|
|
|
52
140
|
* Refreshes the workspace list (the new membership appears there).
|
|
53
141
|
*/
|
|
54
142
|
export declare function useAcceptInvitation(): UseMutationResult<Member, StapelApiError, InvitationAccept>;
|
|
143
|
+
/**
|
|
144
|
+
* Mint a login grant for a NOT-yet-registered invitee (POST
|
|
145
|
+
* /invitations/{token}/claim, AllowAny — org-program §B2/§B3). The variable
|
|
146
|
+
* is the invite token; the result carries the single-use `grant_token` to
|
|
147
|
+
* exchange at AUTH's `POST /grant/exchange/` (the auth-react api — this pair
|
|
148
|
+
* deliberately does not call it; see `InviteAcceptFlow`'s `onLoginGrant`
|
|
149
|
+
* seam). 409 `email_already_registered` → switch to login. The invitation is
|
|
150
|
+
* NOT consumed here. The grant token is a credential: never log it.
|
|
151
|
+
*/
|
|
152
|
+
export declare function useClaimInvitation(): UseMutationResult<InvitationClaim, StapelApiError, string>;
|
|
153
|
+
/**
|
|
154
|
+
* Decline an invitation (POST /invitations/{token}/decline, authenticated +
|
|
155
|
+
* email-match — org-program §B2). The variable is the invite token. Decline ≠
|
|
156
|
+
* revoke — the preview's `status` becomes `declined`.
|
|
157
|
+
*/
|
|
158
|
+
export declare function useDeclineInvitation(): UseMutationResult<void, StapelApiError, string>;
|
|
55
159
|
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,eAAe,EACf,yBAAyB,EACzB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAIzB;;;;;;;;;;;GAWG;AAEH,wEAAwE;AACxE,wBAAgB,kBAAkB,IAAI,iBAAiB,CACrD,SAAS,EACT,cAAc,EACd,eAAe,CAChB,CAaA;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,GAClB,iBAAiB,CAAC,SAAS,EAAE,cAAc,EAAE,eAAe,CAAC,CAiB/D;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,IAAI,iBAAiB,CACrD,IAAI,EACJ,cAAc,EACd,MAAM,CACP,CAeA;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,GAClB,iBAAiB,CAAC,kBAAkB,EAAE,cAAc,EAAE,YAAY,CAAC,CAgBrE;AAED;;;;gDAIgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,GA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