@cat-factory/workspaces 0.15.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/workspaces/WorkspaceMemberService.d.ts +73 -0
- package/dist/modules/workspaces/WorkspaceMemberService.d.ts.map +1 -0
- package/dist/modules/workspaces/WorkspaceMemberService.js +147 -0
- package/dist/modules/workspaces/WorkspaceMemberService.js.map +1 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { WorkspaceService, type WorkspaceServiceDependencies, } from './modules/workspaces/WorkspaceService.js';
|
|
2
|
+
export { WorkspaceMemberService, type WorkspaceMemberServiceDependencies, } from './modules/workspaces/WorkspaceMemberService.js';
|
|
2
3
|
export { AccountService, type AccountServiceDependencies, type AccountUser, } from './modules/accounts/AccountService.js';
|
|
3
4
|
export { UserService, type UserServiceDependencies, type IdentityProfile, } from './modules/users/UserService.js';
|
|
4
5
|
export { InvitationService, type InvitationServiceDependencies, type CreatedInvitation, } from './modules/invitations/InvitationService.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,4BAA4B,GAClC,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACL,cAAc,EACd,KAAK,0BAA0B,EAC/B,KAAK,WAAW,GACjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,WAAW,EACX,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACrB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,iBAAiB,EACjB,KAAK,6BAA6B,EAClC,KAAK,iBAAiB,GACvB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EACL,oBAAoB,EACpB,KAAK,gCAAgC,EACrC,KAAK,WAAW,GACjB,MAAM,wCAAwC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,4BAA4B,GAClC,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACL,sBAAsB,EACtB,KAAK,kCAAkC,GACxC,MAAM,gDAAgD,CAAA;AACvD,OAAO,EACL,cAAc,EACd,KAAK,0BAA0B,EAC/B,KAAK,WAAW,GACjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,WAAW,EACX,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACrB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,iBAAiB,EACjB,KAAK,6BAA6B,EAClC,KAAK,iBAAiB,GACvB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EACL,oBAAoB,EACpB,KAAK,gCAAgC,EACrC,KAAK,WAAW,GACjB,MAAM,wCAAwC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Public surface of the tenancy base layer.
|
|
2
2
|
export { WorkspaceService, } from './modules/workspaces/WorkspaceService.js';
|
|
3
|
+
export { WorkspaceMemberService, } from './modules/workspaces/WorkspaceMemberService.js';
|
|
3
4
|
export { AccountService, } from './modules/accounts/AccountService.js';
|
|
4
5
|
export { UserService, } from './modules/users/UserService.js';
|
|
5
6
|
export { InvitationService, } from './modules/invitations/InvitationService.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EACL,gBAAgB,GAEjB,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACL,cAAc,GAGf,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,WAAW,GAGZ,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,iBAAiB,GAGlB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EACL,oBAAoB,GAGrB,MAAM,wCAAwC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EACL,gBAAgB,GAEjB,MAAM,0CAA0C,CAAA;AACjD,OAAO,EACL,sBAAsB,GAEvB,MAAM,gDAAgD,CAAA;AACvD,OAAO,EACL,cAAc,GAGf,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,WAAW,GAGZ,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,iBAAiB,GAGlB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EACL,oBAAoB,GAGrB,MAAM,wCAAwC,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { WorkspaceAccessMode, WorkspaceMember, WorkspaceRole, Workspace } from '@cat-factory/kernel';
|
|
2
|
+
import type { GroupCacheHandle, MembershipRepository, UserRepository, WorkspaceAccessCacheValue, WorkspaceMemberRepository, WorkspaceRepository } from '@cat-factory/kernel';
|
|
3
|
+
import type { Clock } from '@cat-factory/kernel';
|
|
4
|
+
export interface WorkspaceMemberServiceDependencies {
|
|
5
|
+
workspaceMemberRepository: WorkspaceMemberRepository;
|
|
6
|
+
workspaceRepository: WorkspaceRepository;
|
|
7
|
+
/** Enforces the "target must belong to the owning account" rule (account membership is a prerequisite). */
|
|
8
|
+
membershipRepository: MembershipRepository;
|
|
9
|
+
clock: Clock;
|
|
10
|
+
/** Optional: resolve member display details (name/email/avatar) for the roster. */
|
|
11
|
+
userRepository?: UserRepository;
|
|
12
|
+
/**
|
|
13
|
+
* The `workspaceAccess` cache slice. When wired, every roster/access-mode write invalidates the
|
|
14
|
+
* board's group so the gate re-resolves on the next request. Optional — absent (tests / no cache)
|
|
15
|
+
* ⇒ the write skips invalidation (the gate reads live).
|
|
16
|
+
*/
|
|
17
|
+
workspaceAccessCache?: GroupCacheHandle<WorkspaceAccessCacheValue>;
|
|
18
|
+
}
|
|
19
|
+
/** Manages a board's explicit member roster and its account/restricted access mode. */
|
|
20
|
+
export declare class WorkspaceMemberService {
|
|
21
|
+
private readonly members;
|
|
22
|
+
private readonly workspaces;
|
|
23
|
+
private readonly memberships;
|
|
24
|
+
private readonly clock;
|
|
25
|
+
private readonly users?;
|
|
26
|
+
private readonly cache?;
|
|
27
|
+
constructor(deps: WorkspaceMemberServiceDependencies);
|
|
28
|
+
/**
|
|
29
|
+
* The board's roster, enriched with each member's display details (name/email/avatar) via ONE
|
|
30
|
+
* batched `listByIds` — the {@link AccountService.members} pattern, never a per-member point-read.
|
|
31
|
+
* 404s a non-existent board (an empty roster and a missing board must not read the same to the
|
|
32
|
+
* caller).
|
|
33
|
+
*/
|
|
34
|
+
list(workspaceId: string): Promise<WorkspaceMember[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Add (or re-role, upsert semantics) a member. The target MUST already belong to the board's
|
|
37
|
+
* owning account — a `restricted` board narrows WITHIN an account, it never grants across the
|
|
38
|
+
* account boundary; a non-account-member is a {@link ValidationError}. A legacy board
|
|
39
|
+
* (`account_id IS NULL`) is auto-healed into an account first ({@link ensureAccountScoped}).
|
|
40
|
+
*/
|
|
41
|
+
add(workspaceId: string, userId: string, role: WorkspaceRole, addedByUserId: string | null): Promise<WorkspaceMember>;
|
|
42
|
+
/** Change an existing member's role (404 when they hold no row). Preserves the audit metadata. */
|
|
43
|
+
setRole(workspaceId: string, userId: string, role: WorkspaceRole): Promise<WorkspaceMember>;
|
|
44
|
+
/** Remove a member's row. Idempotent (removing an absent row is a no-op). */
|
|
45
|
+
remove(workspaceId: string, userId: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Flip a board's access mode (`account` ⇄ `restricted`). Returns the updated board so the SPA can
|
|
48
|
+
* patch it in place. Auto-heals a legacy board first ({@link ensureAccountScoped}) — an access
|
|
49
|
+
* mode on an unscoped board is a silent no-op (resolution's legacy branch ignores it), so the
|
|
50
|
+
* flip only means something once the board is account-scoped. Invalidates the access cache — the
|
|
51
|
+
* mode is a direct input to resolution for every user.
|
|
52
|
+
*/
|
|
53
|
+
setAccessMode(workspaceId: string, mode: WorkspaceAccessMode): Promise<Workspace>;
|
|
54
|
+
/**
|
|
55
|
+
* The board's owning account id — auto-healing a legacy (`account_id IS NULL`) board on the way.
|
|
56
|
+
* Member management requires an account: a `restricted` board narrows WITHIN an account, and an
|
|
57
|
+
* unscoped board is invisible to resolution's account tier (only its owner sees it), so a roster
|
|
58
|
+
* / access-mode change on it would silently do nothing. Rather than refuse (the old behaviour) we
|
|
59
|
+
* LINK the board to an account and proceed — "drop support for legacy boards" means heal them.
|
|
60
|
+
*
|
|
61
|
+
* The adopt target is the board OWNER's sole account: on a legacy board the owner is the only
|
|
62
|
+
* principal resolution lets reach member management (the account-admin escape hatch does not
|
|
63
|
+
* apply to the `account_id IS NULL` branch), so the caller here IS the owner. Ambiguous — no
|
|
64
|
+
* owner, or the owner belongs to several accounts — throws a {@link ValidationError} telling the
|
|
65
|
+
* caller to link the board explicitly (auto-heal never guesses which account to expose a board
|
|
66
|
+
* to). On heal we also (re)assert the owner's `admin` member row so a follow-up flip to
|
|
67
|
+
* `restricted` can't lock the owner out, mirroring the creator auto-enroll in `WorkspaceService`.
|
|
68
|
+
*/
|
|
69
|
+
private ensureAccountScoped;
|
|
70
|
+
/** Drop the board's cached access decisions after a write commits (no-op when unwired). */
|
|
71
|
+
private invalidate;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=WorkspaceMemberService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceMemberService.d.ts","sourceRoot":"","sources":["../../../src/modules/workspaces/WorkspaceMemberService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,SAAS,EACV,MA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Aa,GAClB,OAAO,CAAC,eAAe,CAAC,CAO1B;IAED,6EAA6E;IACvE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/D;IAED;;;;;;OAMG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAKtF;IAED;;;;;;;;;;;;;;OAcG;YACW,mBAAmB;IAkCjC,2FAA2F;YAC7E,UAAU;CAGzB"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { NotFoundError, ValidationError, assertFound, requireWorkspace } from '@cat-factory/kernel';
|
|
2
|
+
/** Manages a board's explicit member roster and its account/restricted access mode. */
|
|
3
|
+
export class WorkspaceMemberService {
|
|
4
|
+
members;
|
|
5
|
+
workspaces;
|
|
6
|
+
memberships;
|
|
7
|
+
clock;
|
|
8
|
+
users;
|
|
9
|
+
cache;
|
|
10
|
+
constructor(deps) {
|
|
11
|
+
this.members = deps.workspaceMemberRepository;
|
|
12
|
+
this.workspaces = deps.workspaceRepository;
|
|
13
|
+
this.memberships = deps.membershipRepository;
|
|
14
|
+
this.clock = deps.clock;
|
|
15
|
+
this.users = deps.userRepository;
|
|
16
|
+
this.cache = deps.workspaceAccessCache;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The board's roster, enriched with each member's display details (name/email/avatar) via ONE
|
|
20
|
+
* batched `listByIds` — the {@link AccountService.members} pattern, never a per-member point-read.
|
|
21
|
+
* 404s a non-existent board (an empty roster and a missing board must not read the same to the
|
|
22
|
+
* caller).
|
|
23
|
+
*/
|
|
24
|
+
async list(workspaceId) {
|
|
25
|
+
await requireWorkspace(this.workspaces, workspaceId);
|
|
26
|
+
const rows = await this.members.listByWorkspace(workspaceId);
|
|
27
|
+
if (!this.users || rows.length === 0)
|
|
28
|
+
return rows.map(toWire);
|
|
29
|
+
const records = await this.users.listByIds(rows.map((m) => m.userId));
|
|
30
|
+
const byId = new Map(records.map((u) => [u.id, u]));
|
|
31
|
+
return rows.map((m) => {
|
|
32
|
+
const user = byId.get(m.userId);
|
|
33
|
+
return {
|
|
34
|
+
...toWire(m),
|
|
35
|
+
name: user?.name ?? null,
|
|
36
|
+
email: user?.email ?? null,
|
|
37
|
+
avatarUrl: user?.avatarUrl ?? null,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Add (or re-role, upsert semantics) a member. The target MUST already belong to the board's
|
|
43
|
+
* owning account — a `restricted` board narrows WITHIN an account, it never grants across the
|
|
44
|
+
* account boundary; a non-account-member is a {@link ValidationError}. A legacy board
|
|
45
|
+
* (`account_id IS NULL`) is auto-healed into an account first ({@link ensureAccountScoped}).
|
|
46
|
+
*/
|
|
47
|
+
async add(workspaceId, userId, role, addedByUserId) {
|
|
48
|
+
const accountId = await this.ensureAccountScoped(workspaceId);
|
|
49
|
+
if (!(await this.memberships.get(accountId, userId))) {
|
|
50
|
+
throw new ValidationError('A workspace member must first belong to the board’s owning account');
|
|
51
|
+
}
|
|
52
|
+
// Upsert preserves the ORIGINAL grant metadata on conflict (both repos `ON CONFLICT DO UPDATE`
|
|
53
|
+
// only `role`), so a re-add of an existing member must return THOSE stored values — never a
|
|
54
|
+
// fresh `createdAt` / `addedBy` the persisted row (and every later read) wouldn't reflect.
|
|
55
|
+
const existing = await this.members.get(workspaceId, userId);
|
|
56
|
+
const record = existing
|
|
57
|
+
? { ...existing, role }
|
|
58
|
+
: { workspaceId, userId, role, createdAt: this.clock.now(), addedByUserId };
|
|
59
|
+
await this.members.upsert(record);
|
|
60
|
+
await this.invalidate(workspaceId);
|
|
61
|
+
return toWire(record);
|
|
62
|
+
}
|
|
63
|
+
/** Change an existing member's role (404 when they hold no row). Preserves the audit metadata. */
|
|
64
|
+
async setRole(workspaceId, userId, role) {
|
|
65
|
+
const existing = await this.members.get(workspaceId, userId);
|
|
66
|
+
if (!existing)
|
|
67
|
+
throw new NotFoundError('Workspace member', userId);
|
|
68
|
+
const record = { ...existing, role };
|
|
69
|
+
await this.members.upsert(record);
|
|
70
|
+
await this.invalidate(workspaceId);
|
|
71
|
+
return toWire(record);
|
|
72
|
+
}
|
|
73
|
+
/** Remove a member's row. Idempotent (removing an absent row is a no-op). */
|
|
74
|
+
async remove(workspaceId, userId) {
|
|
75
|
+
await this.members.remove(workspaceId, userId);
|
|
76
|
+
await this.invalidate(workspaceId);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Flip a board's access mode (`account` ⇄ `restricted`). Returns the updated board so the SPA can
|
|
80
|
+
* patch it in place. Auto-heals a legacy board first ({@link ensureAccountScoped}) — an access
|
|
81
|
+
* mode on an unscoped board is a silent no-op (resolution's legacy branch ignores it), so the
|
|
82
|
+
* flip only means something once the board is account-scoped. Invalidates the access cache — the
|
|
83
|
+
* mode is a direct input to resolution for every user.
|
|
84
|
+
*/
|
|
85
|
+
async setAccessMode(workspaceId, mode) {
|
|
86
|
+
await this.ensureAccountScoped(workspaceId);
|
|
87
|
+
await this.workspaces.setAccessMode(workspaceId, mode);
|
|
88
|
+
await this.invalidate(workspaceId);
|
|
89
|
+
return requireWorkspace(this.workspaces, workspaceId);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The board's owning account id — auto-healing a legacy (`account_id IS NULL`) board on the way.
|
|
93
|
+
* Member management requires an account: a `restricted` board narrows WITHIN an account, and an
|
|
94
|
+
* unscoped board is invisible to resolution's account tier (only its owner sees it), so a roster
|
|
95
|
+
* / access-mode change on it would silently do nothing. Rather than refuse (the old behaviour) we
|
|
96
|
+
* LINK the board to an account and proceed — "drop support for legacy boards" means heal them.
|
|
97
|
+
*
|
|
98
|
+
* The adopt target is the board OWNER's sole account: on a legacy board the owner is the only
|
|
99
|
+
* principal resolution lets reach member management (the account-admin escape hatch does not
|
|
100
|
+
* apply to the `account_id IS NULL` branch), so the caller here IS the owner. Ambiguous — no
|
|
101
|
+
* owner, or the owner belongs to several accounts — throws a {@link ValidationError} telling the
|
|
102
|
+
* caller to link the board explicitly (auto-heal never guesses which account to expose a board
|
|
103
|
+
* to). On heal we also (re)assert the owner's `admin` member row so a follow-up flip to
|
|
104
|
+
* `restricted` can't lock the owner out, mirroring the creator auto-enroll in `WorkspaceService`.
|
|
105
|
+
*/
|
|
106
|
+
async ensureAccountScoped(workspaceId) {
|
|
107
|
+
const row = assertFound(await this.workspaces.accessRowOf(workspaceId), 'Workspace', workspaceId);
|
|
108
|
+
if (row.accountId !== null)
|
|
109
|
+
return row.accountId;
|
|
110
|
+
const { ownerUserId } = row;
|
|
111
|
+
if (!ownerUserId) {
|
|
112
|
+
throw new ValidationError('This board is not linked to an account and has no owner to link it through — assign it to an account first');
|
|
113
|
+
}
|
|
114
|
+
const accounts = await this.memberships.listByUser(ownerUserId);
|
|
115
|
+
if (accounts.length !== 1) {
|
|
116
|
+
throw new ValidationError('This board is not linked to an account — link it to one of its owner’s accounts to manage members');
|
|
117
|
+
}
|
|
118
|
+
const accountId = accounts[0].accountId;
|
|
119
|
+
await this.workspaces.linkAccount(workspaceId, accountId);
|
|
120
|
+
// Keep the owner in admin control post-heal (a restricted board reads member rows only). System
|
|
121
|
+
// grant ⇒ `addedByUserId: null`; upsert preserves an existing row's audit metadata.
|
|
122
|
+
await this.members.upsert({
|
|
123
|
+
workspaceId,
|
|
124
|
+
userId: ownerUserId,
|
|
125
|
+
role: 'admin',
|
|
126
|
+
createdAt: this.clock.now(),
|
|
127
|
+
addedByUserId: null,
|
|
128
|
+
});
|
|
129
|
+
await this.invalidate(workspaceId);
|
|
130
|
+
return accountId;
|
|
131
|
+
}
|
|
132
|
+
/** Drop the board's cached access decisions after a write commits (no-op when unwired). */
|
|
133
|
+
async invalidate(workspaceId) {
|
|
134
|
+
await this.cache?.invalidateGroup(workspaceId);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** Map a persistence record to its wire shape (audit `addedByUserId` → `addedBy`). */
|
|
138
|
+
function toWire(record) {
|
|
139
|
+
return {
|
|
140
|
+
workspaceId: record.workspaceId,
|
|
141
|
+
userId: record.userId,
|
|
142
|
+
role: record.role,
|
|
143
|
+
createdAt: record.createdAt,
|
|
144
|
+
addedBy: record.addedByUserId,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=WorkspaceMemberService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceMemberService.js","sourceRoot":"","sources":["../../../src/modules/workspaces/WorkspaceMemberService.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAoCnG,uFAAuF;AACvF,MAAM,OAAO,sBAAsB;IAChB,OAAO,CAA2B;IAClC,UAAU,CAAqB;IAC/B,WAAW,CAAsB;IACjC,KAAK,CAAO;IACZ,KAAK,CAAiB;IACtB,KAAK,CAA8C;IAEpE,YAAY,IAAwC;QAClD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAA;QAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAA;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAA;QAC5C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,CAAA;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAA;IACxC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,WAAmB;QAC5B,MAAM,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;QACpD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAA;QAC5D,IAAI,CAAC,IAAI,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AAE,IAAI;SACpB,CAAC,CAAA;QACF,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;QAClC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,2FAA2F;IACnF,KAAK,CAAC,UAAU,CAAC,WAAmB;QAC1C,MAAM,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,CAAC,CAAA;IAChD,CAAC;CACF;AAED,sFAAsF;AACtF,SAAS,MAAM,CAAC,MAA6B;IAC3C,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,OAAO,EAAE,MAAM,CAAC,aAAa;KAC9B,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/workspaces",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Tenancy base services (workspaces and accounts) for the Agent Architecture Board.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cat-factory/contracts": "0.
|
|
28
|
-
"@cat-factory/kernel": "0.
|
|
27
|
+
"@cat-factory/contracts": "0.145.0",
|
|
28
|
+
"@cat-factory/kernel": "0.138.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "7.0.2",
|