@powerhousedao/reactor-group 6.2.2-dev.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/dist/chunk-pbuEa-1d.js +13 -0
- package/dist/document-models/index.d.ts +2 -0
- package/dist/document-models/index.js +2 -0
- package/dist/document-models/reactor-group/index.d.ts +12 -0
- package/dist/document-models/reactor-group/index.d.ts.map +1 -0
- package/dist/document-models/reactor-group/index.js +84 -0
- package/dist/document-models/reactor-group/index.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/module-DYPG91AA.d.ts +376 -0
- package/dist/module-DYPG91AA.d.ts.map +1 -0
- package/dist/module-DuRVS7HX.js +395 -0
- package/dist/module-DuRVS7HX.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
+
import { BaseDocumentHeaderSchema, BaseDocumentStateSchema, baseActions, baseCreateDocument, baseLoadFromInputVersioned, baseSaveToFileHandle, createAction, createBaseState, createReducer, createState, defaultBaseState, isDocumentAction } from "document-model";
|
|
3
|
+
import * as z$1 from "zod";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region document-models/reactor-group/v1/gen/schema/zod.ts
|
|
6
|
+
const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
|
|
7
|
+
const definedNonNullAnySchema = z$1.any().refine((v) => isDefinedNonNullAny(v));
|
|
8
|
+
function AddMemberInputSchema() {
|
|
9
|
+
return z$1.object({ address: z$1.string() });
|
|
10
|
+
}
|
|
11
|
+
function ReactorGroupStateSchema() {
|
|
12
|
+
return z$1.object({
|
|
13
|
+
__typename: z$1.literal("ReactorGroupState").optional(),
|
|
14
|
+
description: z$1.string(),
|
|
15
|
+
members: z$1.array(z$1.string()),
|
|
16
|
+
name: z$1.string()
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function RemoveMemberInputSchema() {
|
|
20
|
+
return z$1.object({ address: z$1.string() });
|
|
21
|
+
}
|
|
22
|
+
function SetGroupDescriptionInputSchema() {
|
|
23
|
+
return z$1.object({ description: z$1.string() });
|
|
24
|
+
}
|
|
25
|
+
function SetGroupNameInputSchema() {
|
|
26
|
+
return z$1.object({ name: z$1.string() });
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region document-models/reactor-group/v1/gen/group/creators.ts
|
|
30
|
+
/**
|
|
31
|
+
* WARNING: DO NOT EDIT
|
|
32
|
+
* This file is auto-generated and updated by codegen
|
|
33
|
+
*/
|
|
34
|
+
var creators_exports = /* @__PURE__ */ __exportAll({
|
|
35
|
+
addMember: () => addMember,
|
|
36
|
+
removeMember: () => removeMember,
|
|
37
|
+
setGroupDescription: () => setGroupDescription,
|
|
38
|
+
setGroupName: () => setGroupName
|
|
39
|
+
});
|
|
40
|
+
const setGroupName = (input) => createAction("SET_GROUP_NAME", { ...input }, void 0, SetGroupNameInputSchema, "global");
|
|
41
|
+
const setGroupDescription = (input) => createAction("SET_GROUP_DESCRIPTION", { ...input }, void 0, SetGroupDescriptionInputSchema, "global");
|
|
42
|
+
const addMember = (input) => createAction("ADD_MEMBER", { ...input }, void 0, AddMemberInputSchema, "global");
|
|
43
|
+
const removeMember = (input) => createAction("REMOVE_MEMBER", { ...input }, void 0, RemoveMemberInputSchema, "global");
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region document-models/reactor-group/v1/actions.ts
|
|
46
|
+
/**
|
|
47
|
+
* WARNING: DO NOT EDIT
|
|
48
|
+
* This file is auto-generated and updated by codegen
|
|
49
|
+
*/
|
|
50
|
+
/** Actions for the ReactorGroup document model */
|
|
51
|
+
const actions = {
|
|
52
|
+
...baseActions,
|
|
53
|
+
...creators_exports
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region document-models/reactor-group/v1/gen/document-model.ts
|
|
57
|
+
const documentModel = {
|
|
58
|
+
id: "powerhouse/reactor-group",
|
|
59
|
+
name: "Reactor Group",
|
|
60
|
+
author: {
|
|
61
|
+
name: "Powerhouse",
|
|
62
|
+
website: "https://powerhouse.inc"
|
|
63
|
+
},
|
|
64
|
+
extension: ".phrg",
|
|
65
|
+
description: "A group of member addresses referenced by { group } principals in the auth scope. Group membership is folded at an operation's position during auth evaluation, so reducers are strict and deterministic: duplicate or unknown members are errors, and membership is capped.",
|
|
66
|
+
specifications: [{
|
|
67
|
+
state: {
|
|
68
|
+
local: {
|
|
69
|
+
schema: "",
|
|
70
|
+
examples: [],
|
|
71
|
+
initialValue: ""
|
|
72
|
+
},
|
|
73
|
+
global: {
|
|
74
|
+
schema: "\"\"\"\nA member address list gated by the group document's own auth scope. Addresses\nare stored as given and compared case-insensitively, matching how { address }\nprincipals are compared during auth evaluation.\n\"\"\"\ntype ReactorGroupState {\n \"\"\"Display name of the group.\"\"\"\n name: String!\n \"\"\"Free-text description of the group's purpose.\"\"\"\n description: String!\n \"\"\"Member wallet addresses. No duplicates under case-insensitive comparison.\"\"\"\n members: [String!]!\n}",
|
|
75
|
+
examples: [],
|
|
76
|
+
initialValue: "{\n \"name\": \"\",\n \"description\": \"\",\n \"members\": []\n}"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
modules: [{
|
|
80
|
+
id: "efd6d9bb-869e-4565-b1ca-d9b74385eaf7",
|
|
81
|
+
name: "group",
|
|
82
|
+
description: "Manage the group's identity and its member address list.",
|
|
83
|
+
operations: [
|
|
84
|
+
{
|
|
85
|
+
id: "43da2b3d-bad7-40b8-8a84-4cdf892f1519",
|
|
86
|
+
name: "SET_GROUP_NAME",
|
|
87
|
+
description: "Set the display name of the group. The name must be non-empty after trimming and at most 200 characters.",
|
|
88
|
+
schema: "input SetGroupNameInput {\n name: String!\n}",
|
|
89
|
+
template: "",
|
|
90
|
+
reducer: "",
|
|
91
|
+
errors: [{
|
|
92
|
+
id: "8be0d16c-1f21-4d95-9536-c5a5867d2ba1",
|
|
93
|
+
code: "InvalidGroupName",
|
|
94
|
+
name: "InvalidGroupName",
|
|
95
|
+
description: "The group name is empty after trimming or longer than 200 characters.",
|
|
96
|
+
template: ""
|
|
97
|
+
}],
|
|
98
|
+
examples: [],
|
|
99
|
+
scope: "global"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "aa493898-ce6b-4b28-baf3-1b6fd8425138",
|
|
103
|
+
name: "SET_GROUP_DESCRIPTION",
|
|
104
|
+
description: "Set the free-text description of the group. The description is at most 2000 characters.",
|
|
105
|
+
schema: "input SetGroupDescriptionInput {\n description: String!\n}",
|
|
106
|
+
template: "",
|
|
107
|
+
reducer: "",
|
|
108
|
+
errors: [{
|
|
109
|
+
id: "9f0f77a4-6a86-4f5c-9a3f-13a44be29de3",
|
|
110
|
+
code: "InvalidGroupDescription",
|
|
111
|
+
name: "InvalidGroupDescription",
|
|
112
|
+
description: "The group description is longer than 2000 characters.",
|
|
113
|
+
template: ""
|
|
114
|
+
}],
|
|
115
|
+
examples: [],
|
|
116
|
+
scope: "global"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "e7990be2-2e40-4624-9f96-df759703ba6b",
|
|
120
|
+
name: "ADD_MEMBER",
|
|
121
|
+
description: "Add a member address to the group. The address must be non-empty after trimming, must not already be a member under case-insensitive comparison, and the group must be below the member cap.",
|
|
122
|
+
schema: "input AddMemberInput {\n address: String!\n}",
|
|
123
|
+
template: "",
|
|
124
|
+
reducer: "",
|
|
125
|
+
errors: [
|
|
126
|
+
{
|
|
127
|
+
id: "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
|
|
128
|
+
code: "InvalidMemberAddress",
|
|
129
|
+
name: "InvalidMemberAddress",
|
|
130
|
+
description: "The member address is empty after trimming.",
|
|
131
|
+
template: ""
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "b2c1a9de-58e6-4f3f-9f2a-7f6b1e2d4c5a",
|
|
135
|
+
code: "DuplicateMember",
|
|
136
|
+
name: "DuplicateMember",
|
|
137
|
+
description: "The address is already a member of the group under case-insensitive comparison.",
|
|
138
|
+
template: ""
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "c4d5e6f7-0a1b-4c2d-8e3f-9a0b1c2d3e4f",
|
|
142
|
+
code: "GroupMemberLimitExceeded",
|
|
143
|
+
name: "GroupMemberLimitExceeded",
|
|
144
|
+
description: "The group already holds the maximum number of members.",
|
|
145
|
+
template: ""
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
examples: [],
|
|
149
|
+
scope: "global"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "b1309319-48b7-42b2-a40e-1fecef9a09a4",
|
|
153
|
+
name: "REMOVE_MEMBER",
|
|
154
|
+
description: "Remove a member address from the group, matched case-insensitively. Removing an address that is not a member is an error.",
|
|
155
|
+
schema: "input RemoveMemberInput {\n address: String!\n}",
|
|
156
|
+
template: "",
|
|
157
|
+
reducer: "",
|
|
158
|
+
errors: [{
|
|
159
|
+
id: "d6e7f8a9-1b2c-4d3e-9f4a-0b1c2d3e4f5a",
|
|
160
|
+
code: "MemberNotFound",
|
|
161
|
+
name: "MemberNotFound",
|
|
162
|
+
description: "The address is not a member of the group under case-insensitive comparison.",
|
|
163
|
+
template: ""
|
|
164
|
+
}],
|
|
165
|
+
examples: [],
|
|
166
|
+
scope: "global"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}],
|
|
170
|
+
version: 1,
|
|
171
|
+
changeLog: []
|
|
172
|
+
}]
|
|
173
|
+
};
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region document-models/reactor-group/v1/gen/group/error.ts
|
|
176
|
+
var InvalidGroupName = class extends Error {
|
|
177
|
+
errorCode = "InvalidGroupName";
|
|
178
|
+
constructor(message = "InvalidGroupName") {
|
|
179
|
+
super(message);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
var InvalidGroupDescription = class extends Error {
|
|
183
|
+
errorCode = "InvalidGroupDescription";
|
|
184
|
+
constructor(message = "InvalidGroupDescription") {
|
|
185
|
+
super(message);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
var InvalidMemberAddress = class extends Error {
|
|
189
|
+
errorCode = "InvalidMemberAddress";
|
|
190
|
+
constructor(message = "InvalidMemberAddress") {
|
|
191
|
+
super(message);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
var DuplicateMember = class extends Error {
|
|
195
|
+
errorCode = "DuplicateMember";
|
|
196
|
+
constructor(message = "DuplicateMember") {
|
|
197
|
+
super(message);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var GroupMemberLimitExceeded = class extends Error {
|
|
201
|
+
errorCode = "GroupMemberLimitExceeded";
|
|
202
|
+
constructor(message = "GroupMemberLimitExceeded") {
|
|
203
|
+
super(message);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
var MemberNotFound = class extends Error {
|
|
207
|
+
errorCode = "MemberNotFound";
|
|
208
|
+
constructor(message = "MemberNotFound") {
|
|
209
|
+
super(message);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region document-models/reactor-group/v1/src/reducers/group.ts
|
|
214
|
+
/** Every replica folds group state during auth evaluation, so membership is capped. */
|
|
215
|
+
const MAX_GROUP_MEMBERS = 1e3;
|
|
216
|
+
const MAX_GROUP_DESCRIPTION_LENGTH = 2e3;
|
|
217
|
+
/** Addresses are compared case-insensitively, matching { address } principals. */
|
|
218
|
+
function sameAddress(a, b) {
|
|
219
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
220
|
+
}
|
|
221
|
+
const reactorGroupGroupOperations = {
|
|
222
|
+
setGroupNameOperation(state, action) {
|
|
223
|
+
const name = action.input.name.trim();
|
|
224
|
+
if (name === "" || name.length > 200) throw new InvalidGroupName(`Group name must be non-empty and at most 200 characters`);
|
|
225
|
+
state.name = name;
|
|
226
|
+
},
|
|
227
|
+
setGroupDescriptionOperation(state, action) {
|
|
228
|
+
const description = action.input.description;
|
|
229
|
+
if (description.length > 2e3) throw new InvalidGroupDescription(`Group description must be at most ${MAX_GROUP_DESCRIPTION_LENGTH} characters`);
|
|
230
|
+
state.description = description;
|
|
231
|
+
},
|
|
232
|
+
addMemberOperation(state, action) {
|
|
233
|
+
const address = action.input.address.trim();
|
|
234
|
+
if (address === "") throw new InvalidMemberAddress("Member address must be non-empty");
|
|
235
|
+
if (state.members.some((member) => sameAddress(member, address))) throw new DuplicateMember(`Address is already a member: ${address}`);
|
|
236
|
+
if (state.members.length >= 1e3) throw new GroupMemberLimitExceeded(`A group holds at most ${MAX_GROUP_MEMBERS} members`);
|
|
237
|
+
state.members.push(address);
|
|
238
|
+
},
|
|
239
|
+
removeMemberOperation(state, action) {
|
|
240
|
+
const address = action.input.address.trim();
|
|
241
|
+
const index = state.members.findIndex((member) => sameAddress(member, address));
|
|
242
|
+
if (index === -1) throw new MemberNotFound(`Address is not a member: ${address}`);
|
|
243
|
+
state.members.splice(index, 1);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region document-models/reactor-group/v1/gen/reducer.ts
|
|
248
|
+
const stateReducer = (state, action, dispatch) => {
|
|
249
|
+
if (isDocumentAction(action)) return state;
|
|
250
|
+
switch (action.type) {
|
|
251
|
+
case "SET_GROUP_NAME":
|
|
252
|
+
SetGroupNameInputSchema().parse(action.input);
|
|
253
|
+
reactorGroupGroupOperations.setGroupNameOperation(state[action.scope], action, dispatch);
|
|
254
|
+
break;
|
|
255
|
+
case "SET_GROUP_DESCRIPTION":
|
|
256
|
+
SetGroupDescriptionInputSchema().parse(action.input);
|
|
257
|
+
reactorGroupGroupOperations.setGroupDescriptionOperation(state[action.scope], action, dispatch);
|
|
258
|
+
break;
|
|
259
|
+
case "ADD_MEMBER":
|
|
260
|
+
AddMemberInputSchema().parse(action.input);
|
|
261
|
+
reactorGroupGroupOperations.addMemberOperation(state[action.scope], action, dispatch);
|
|
262
|
+
break;
|
|
263
|
+
case "REMOVE_MEMBER":
|
|
264
|
+
RemoveMemberInputSchema().parse(action.input);
|
|
265
|
+
reactorGroupGroupOperations.removeMemberOperation(state[action.scope], action, dispatch);
|
|
266
|
+
break;
|
|
267
|
+
default: return state;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const reducer = createReducer(stateReducer);
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region document-models/reactor-group/upgrades/versions.ts
|
|
273
|
+
const supportedVersions = [1];
|
|
274
|
+
const latestVersion = supportedVersions[0];
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region document-models/reactor-group/upgrades/upgrade-manifest.ts
|
|
277
|
+
const reactorGroupUpgradeManifest = {
|
|
278
|
+
documentType: "powerhouse/reactor-group",
|
|
279
|
+
latestVersion,
|
|
280
|
+
supportedVersions,
|
|
281
|
+
upgrades: {}
|
|
282
|
+
};
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region document-models/reactor-group/v1/gen/document-type.ts
|
|
285
|
+
/**
|
|
286
|
+
* WARNING: DO NOT EDIT
|
|
287
|
+
* This file is auto-generated and updated by codegen
|
|
288
|
+
*/
|
|
289
|
+
const reactorGroupDocumentType = "powerhouse/reactor-group";
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region document-models/reactor-group/v1/gen/document-schema.ts
|
|
292
|
+
/**
|
|
293
|
+
* WARNING: DO NOT EDIT
|
|
294
|
+
* This file is auto-generated and updated by codegen
|
|
295
|
+
*/
|
|
296
|
+
/** Schema for validating the header object of a ReactorGroup document */
|
|
297
|
+
const ReactorGroupDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: z.literal(reactorGroupDocumentType) });
|
|
298
|
+
/** Schema for validating the state object of a ReactorGroup document */
|
|
299
|
+
const ReactorGroupPHStateSchema = BaseDocumentStateSchema.extend({ global: ReactorGroupStateSchema() });
|
|
300
|
+
const ReactorGroupDocumentSchema = z.object({
|
|
301
|
+
header: ReactorGroupDocumentHeaderSchema,
|
|
302
|
+
state: ReactorGroupPHStateSchema,
|
|
303
|
+
initialState: ReactorGroupPHStateSchema
|
|
304
|
+
});
|
|
305
|
+
/** Simple helper function to check if a state object is a ReactorGroup document state object */
|
|
306
|
+
function isReactorGroupState(state) {
|
|
307
|
+
return ReactorGroupPHStateSchema.safeParse(state).success;
|
|
308
|
+
}
|
|
309
|
+
/** Simple helper function to assert that a document state object is a ReactorGroup document state object */
|
|
310
|
+
function assertIsReactorGroupState(state) {
|
|
311
|
+
ReactorGroupPHStateSchema.parse(state);
|
|
312
|
+
}
|
|
313
|
+
/** Simple helper function to check if a document is a ReactorGroup document */
|
|
314
|
+
function isReactorGroupDocument(document) {
|
|
315
|
+
return ReactorGroupDocumentSchema.safeParse(document).success;
|
|
316
|
+
}
|
|
317
|
+
/** Simple helper function to assert that a document is a ReactorGroup document */
|
|
318
|
+
function assertIsReactorGroupDocument(document) {
|
|
319
|
+
ReactorGroupDocumentSchema.parse(document);
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region document-models/reactor-group/v1/gen/utils.ts
|
|
323
|
+
const initialGlobalState = {
|
|
324
|
+
name: "",
|
|
325
|
+
description: "",
|
|
326
|
+
members: []
|
|
327
|
+
};
|
|
328
|
+
const initialLocalState = {};
|
|
329
|
+
const utils$1 = {
|
|
330
|
+
fileExtension: ".phrg",
|
|
331
|
+
createState(state) {
|
|
332
|
+
return {
|
|
333
|
+
...createBaseState(state?.auth, {
|
|
334
|
+
version: 1,
|
|
335
|
+
...state?.document
|
|
336
|
+
}),
|
|
337
|
+
global: {
|
|
338
|
+
...initialGlobalState,
|
|
339
|
+
...state?.global
|
|
340
|
+
},
|
|
341
|
+
local: {
|
|
342
|
+
...initialLocalState,
|
|
343
|
+
...state?.local
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
},
|
|
347
|
+
createDocument(state) {
|
|
348
|
+
return baseCreateDocument(utils$1.createState, state, reactorGroupDocumentType);
|
|
349
|
+
},
|
|
350
|
+
saveToFileHandle(document, input) {
|
|
351
|
+
return baseSaveToFileHandle(document, input);
|
|
352
|
+
},
|
|
353
|
+
loadFromInput(input) {
|
|
354
|
+
return baseLoadFromInputVersioned(input, {
|
|
355
|
+
reducers: { 1: reducer },
|
|
356
|
+
upgradeManifest: reactorGroupUpgradeManifest
|
|
357
|
+
});
|
|
358
|
+
},
|
|
359
|
+
isStateOfType(state) {
|
|
360
|
+
return isReactorGroupState(state);
|
|
361
|
+
},
|
|
362
|
+
assertIsStateOfType(state) {
|
|
363
|
+
return assertIsReactorGroupState(state);
|
|
364
|
+
},
|
|
365
|
+
isDocumentOfType(document) {
|
|
366
|
+
return isReactorGroupDocument(document);
|
|
367
|
+
},
|
|
368
|
+
assertIsDocumentOfType(document) {
|
|
369
|
+
return assertIsReactorGroupDocument(document);
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region document-models/reactor-group/v1/src/utils.ts
|
|
374
|
+
var utils_exports = /* @__PURE__ */ __exportAll({});
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region document-models/reactor-group/v1/utils.ts
|
|
377
|
+
/** Utils for the ReactorGroup document model */
|
|
378
|
+
const utils = {
|
|
379
|
+
...utils$1,
|
|
380
|
+
...utils_exports
|
|
381
|
+
};
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region document-models/reactor-group/v1/module.ts
|
|
384
|
+
/** Document model module for the ReactorGroup document type */
|
|
385
|
+
const ReactorGroup = {
|
|
386
|
+
version: 1,
|
|
387
|
+
reducer,
|
|
388
|
+
actions,
|
|
389
|
+
utils,
|
|
390
|
+
documentModel: createState(defaultBaseState(), documentModel)
|
|
391
|
+
};
|
|
392
|
+
//#endregion
|
|
393
|
+
export { definedNonNullAnySchema as A, setGroupDescription as C, RemoveMemberInputSchema as D, ReactorGroupStateSchema as E, SetGroupDescriptionInputSchema as O, removeMember as S, AddMemberInputSchema as T, reducer as _, utils$1 as a, addMember as b, ReactorGroupPHStateSchema as c, isReactorGroupDocument as d, isReactorGroupState as f, supportedVersions as g, latestVersion as h, initialLocalState as i, isDefinedNonNullAny as j, SetGroupNameInputSchema as k, assertIsReactorGroupDocument as l, reactorGroupUpgradeManifest as m, utils as n, ReactorGroupDocumentHeaderSchema as o, reactorGroupDocumentType as p, initialGlobalState as r, ReactorGroupDocumentSchema as s, ReactorGroup as t, assertIsReactorGroupState as u, documentModel as v, setGroupName as w, creators_exports as x, actions as y };
|
|
394
|
+
|
|
395
|
+
//# sourceMappingURL=module-DuRVS7HX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-DuRVS7HX.js","names":["z","reactorGroupGroupActions","utils","genUtils","customUtils"],"sources":["../document-models/reactor-group/v1/gen/schema/zod.ts","../document-models/reactor-group/v1/gen/group/creators.ts","../document-models/reactor-group/v1/actions.ts","../document-models/reactor-group/v1/gen/document-model.ts","../document-models/reactor-group/v1/gen/group/error.ts","../document-models/reactor-group/v1/src/reducers/group.ts","../document-models/reactor-group/v1/gen/reducer.ts","../document-models/reactor-group/upgrades/versions.ts","../document-models/reactor-group/upgrades/upgrade-manifest.ts","../document-models/reactor-group/v1/gen/document-type.ts","../document-models/reactor-group/v1/gen/document-schema.ts","../document-models/reactor-group/v1/gen/utils.ts","../document-models/reactor-group/v1/src/utils.ts","../document-models/reactor-group/v1/utils.ts","../document-models/reactor-group/v1/module.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as z from \"zod\";\nimport type {\n AddMemberInput,\n ReactorGroupState,\n RemoveMemberInput,\n SetGroupDescriptionInput,\n SetGroupNameInput,\n} from \"./types.js\";\n\ntype Properties<T> = Required<{\n [K in keyof T]: z.ZodType<T[K]>;\n}>;\n\ntype definedNonNullAny = {};\n\nexport const isDefinedNonNullAny = (v: any): v is definedNonNullAny =>\n v !== undefined && v !== null;\n\nexport const definedNonNullAnySchema = z\n .any()\n .refine((v) => isDefinedNonNullAny(v));\n\nexport function AddMemberInputSchema(): z.ZodObject<\n Properties<AddMemberInput>\n> {\n return z.object({\n address: z.string(),\n });\n}\n\nexport function ReactorGroupStateSchema(): z.ZodObject<\n Properties<ReactorGroupState>\n> {\n return z.object({\n __typename: z.literal(\"ReactorGroupState\").optional(),\n description: z.string(),\n members: z.array(z.string()),\n name: z.string(),\n });\n}\n\nexport function RemoveMemberInputSchema(): z.ZodObject<\n Properties<RemoveMemberInput>\n> {\n return z.object({\n address: z.string(),\n });\n}\n\nexport function SetGroupDescriptionInputSchema(): z.ZodObject<\n Properties<SetGroupDescriptionInput>\n> {\n return z.object({\n description: z.string(),\n });\n}\n\nexport function SetGroupNameInputSchema(): z.ZodObject<\n Properties<SetGroupNameInput>\n> {\n return z.object({\n name: z.string(),\n });\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from \"document-model\";\nimport {\n AddMemberInputSchema,\n RemoveMemberInputSchema,\n SetGroupDescriptionInputSchema,\n SetGroupNameInputSchema,\n} from \"../schema/zod.js\";\nimport type {\n AddMemberInput,\n RemoveMemberInput,\n SetGroupDescriptionInput,\n SetGroupNameInput,\n} from \"../types.js\";\nimport type {\n AddMemberAction,\n RemoveMemberAction,\n SetGroupDescriptionAction,\n SetGroupNameAction,\n} from \"./actions.js\";\n\nexport const setGroupName = (input: SetGroupNameInput) =>\n createAction<SetGroupNameAction>(\n \"SET_GROUP_NAME\",\n { ...input },\n undefined,\n SetGroupNameInputSchema,\n \"global\",\n );\n\nexport const setGroupDescription = (input: SetGroupDescriptionInput) =>\n createAction<SetGroupDescriptionAction>(\n \"SET_GROUP_DESCRIPTION\",\n { ...input },\n undefined,\n SetGroupDescriptionInputSchema,\n \"global\",\n );\n\nexport const addMember = (input: AddMemberInput) =>\n createAction<AddMemberAction>(\n \"ADD_MEMBER\",\n { ...input },\n undefined,\n AddMemberInputSchema,\n \"global\",\n );\n\nexport const removeMember = (input: RemoveMemberInput) =>\n createAction<RemoveMemberAction>(\n \"REMOVE_MEMBER\",\n { ...input },\n undefined,\n RemoveMemberInputSchema,\n \"global\",\n );\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { baseActions } from \"document-model\";\nimport { reactorGroupGroupActions } from \"./gen/creators.js\";\n\n/** Actions for the ReactorGroup document model */\n\nexport const actions = { ...baseActions, ...reactorGroupGroupActions };\n","import type { DocumentModelGlobalState } from \"document-model\";\n\nexport const documentModel: DocumentModelGlobalState = {\n id: \"powerhouse/reactor-group\",\n name: \"Reactor Group\",\n author: {\n name: \"Powerhouse\",\n website: \"https://powerhouse.inc\",\n },\n extension: \".phrg\",\n description:\n \"A group of member addresses referenced by { group } principals in the auth scope. Group membership is folded at an operation's position during auth evaluation, so reducers are strict and deterministic: duplicate or unknown members are errors, and membership is capped.\",\n specifications: [\n {\n state: {\n local: {\n schema: \"\",\n examples: [],\n initialValue: \"\",\n },\n global: {\n schema:\n '\"\"\"\\nA member address list gated by the group document\\'s own auth scope. Addresses\\nare stored as given and compared case-insensitively, matching how { address }\\nprincipals are compared during auth evaluation.\\n\"\"\"\\ntype ReactorGroupState {\\n \"\"\"Display name of the group.\"\"\"\\n name: String!\\n \"\"\"Free-text description of the group\\'s purpose.\"\"\"\\n description: String!\\n \"\"\"Member wallet addresses. No duplicates under case-insensitive comparison.\"\"\"\\n members: [String!]!\\n}',\n examples: [],\n initialValue:\n '{\\n \"name\": \"\",\\n \"description\": \"\",\\n \"members\": []\\n}',\n },\n },\n modules: [\n {\n id: \"efd6d9bb-869e-4565-b1ca-d9b74385eaf7\",\n name: \"group\",\n description:\n \"Manage the group's identity and its member address list.\",\n operations: [\n {\n id: \"43da2b3d-bad7-40b8-8a84-4cdf892f1519\",\n name: \"SET_GROUP_NAME\",\n description:\n \"Set the display name of the group. The name must be non-empty after trimming and at most 200 characters.\",\n schema: \"input SetGroupNameInput {\\n name: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [\n {\n id: \"8be0d16c-1f21-4d95-9536-c5a5867d2ba1\",\n code: \"InvalidGroupName\",\n name: \"InvalidGroupName\",\n description:\n \"The group name is empty after trimming or longer than 200 characters.\",\n template: \"\",\n },\n ],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"aa493898-ce6b-4b28-baf3-1b6fd8425138\",\n name: \"SET_GROUP_DESCRIPTION\",\n description:\n \"Set the free-text description of the group. The description is at most 2000 characters.\",\n schema:\n \"input SetGroupDescriptionInput {\\n description: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [\n {\n id: \"9f0f77a4-6a86-4f5c-9a3f-13a44be29de3\",\n code: \"InvalidGroupDescription\",\n name: \"InvalidGroupDescription\",\n description:\n \"The group description is longer than 2000 characters.\",\n template: \"\",\n },\n ],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"e7990be2-2e40-4624-9f96-df759703ba6b\",\n name: \"ADD_MEMBER\",\n description:\n \"Add a member address to the group. The address must be non-empty after trimming, must not already be a member under case-insensitive comparison, and the group must be below the member cap.\",\n schema: \"input AddMemberInput {\\n address: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [\n {\n id: \"3f2504e0-4f89-41d3-9a0c-0305e82c3301\",\n code: \"InvalidMemberAddress\",\n name: \"InvalidMemberAddress\",\n description: \"The member address is empty after trimming.\",\n template: \"\",\n },\n {\n id: \"b2c1a9de-58e6-4f3f-9f2a-7f6b1e2d4c5a\",\n code: \"DuplicateMember\",\n name: \"DuplicateMember\",\n description:\n \"The address is already a member of the group under case-insensitive comparison.\",\n template: \"\",\n },\n {\n id: \"c4d5e6f7-0a1b-4c2d-8e3f-9a0b1c2d3e4f\",\n code: \"GroupMemberLimitExceeded\",\n name: \"GroupMemberLimitExceeded\",\n description:\n \"The group already holds the maximum number of members.\",\n template: \"\",\n },\n ],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"b1309319-48b7-42b2-a40e-1fecef9a09a4\",\n name: \"REMOVE_MEMBER\",\n description:\n \"Remove a member address from the group, matched case-insensitively. Removing an address that is not a member is an error.\",\n schema: \"input RemoveMemberInput {\\n address: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [\n {\n id: \"d6e7f8a9-1b2c-4d3e-9f4a-0b1c2d3e4f5a\",\n code: \"MemberNotFound\",\n name: \"MemberNotFound\",\n description:\n \"The address is not a member of the group under case-insensitive comparison.\",\n template: \"\",\n },\n ],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export type ErrorCode =\n | \"InvalidGroupName\"\n | \"InvalidGroupDescription\"\n | \"InvalidMemberAddress\"\n | \"DuplicateMember\"\n | \"GroupMemberLimitExceeded\"\n | \"MemberNotFound\";\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidGroupName extends Error implements ReducerError {\n errorCode = \"InvalidGroupName\" as ErrorCode;\n constructor(message = \"InvalidGroupName\") {\n super(message);\n }\n}\n\nexport class InvalidGroupDescription extends Error implements ReducerError {\n errorCode = \"InvalidGroupDescription\" as ErrorCode;\n constructor(message = \"InvalidGroupDescription\") {\n super(message);\n }\n}\n\nexport class InvalidMemberAddress extends Error implements ReducerError {\n errorCode = \"InvalidMemberAddress\" as ErrorCode;\n constructor(message = \"InvalidMemberAddress\") {\n super(message);\n }\n}\n\nexport class DuplicateMember extends Error implements ReducerError {\n errorCode = \"DuplicateMember\" as ErrorCode;\n constructor(message = \"DuplicateMember\") {\n super(message);\n }\n}\n\nexport class GroupMemberLimitExceeded extends Error implements ReducerError {\n errorCode = \"GroupMemberLimitExceeded\" as ErrorCode;\n constructor(message = \"GroupMemberLimitExceeded\") {\n super(message);\n }\n}\n\nexport class MemberNotFound extends Error implements ReducerError {\n errorCode = \"MemberNotFound\" as ErrorCode;\n constructor(message = \"MemberNotFound\") {\n super(message);\n }\n}\n\nexport const errors = {\n SetGroupName: { InvalidGroupName },\n\n SetGroupDescription: { InvalidGroupDescription },\n\n AddMember: {\n InvalidMemberAddress,\n DuplicateMember,\n GroupMemberLimitExceeded,\n },\n\n RemoveMember: { MemberNotFound },\n};\n","import type { ReactorGroupGroupOperations } from \"document-models/reactor-group/v1\";\nimport {\n DuplicateMember,\n GroupMemberLimitExceeded,\n InvalidGroupDescription,\n InvalidGroupName,\n InvalidMemberAddress,\n MemberNotFound,\n} from \"../../gen/group/error.js\";\n\n/** Every replica folds group state during auth evaluation, so membership is capped. */\nexport const MAX_GROUP_MEMBERS = 1000;\n\nexport const MAX_GROUP_NAME_LENGTH = 200;\n\nexport const MAX_GROUP_DESCRIPTION_LENGTH = 2000;\n\n/** Addresses are compared case-insensitively, matching { address } principals. */\nfunction sameAddress(a: string, b: string): boolean {\n return a.toLowerCase() === b.toLowerCase();\n}\n\nexport const reactorGroupGroupOperations: ReactorGroupGroupOperations = {\n setGroupNameOperation(state, action) {\n const name = action.input.name.trim();\n if (name === \"\" || name.length > MAX_GROUP_NAME_LENGTH) {\n throw new InvalidGroupName(\n `Group name must be non-empty and at most ${MAX_GROUP_NAME_LENGTH} characters`,\n );\n }\n state.name = name;\n },\n setGroupDescriptionOperation(state, action) {\n const description = action.input.description;\n if (description.length > MAX_GROUP_DESCRIPTION_LENGTH) {\n throw new InvalidGroupDescription(\n `Group description must be at most ${MAX_GROUP_DESCRIPTION_LENGTH} characters`,\n );\n }\n state.description = description;\n },\n addMemberOperation(state, action) {\n const address = action.input.address.trim();\n if (address === \"\") {\n throw new InvalidMemberAddress(\"Member address must be non-empty\");\n }\n if (state.members.some((member) => sameAddress(member, address))) {\n throw new DuplicateMember(`Address is already a member: ${address}`);\n }\n if (state.members.length >= MAX_GROUP_MEMBERS) {\n throw new GroupMemberLimitExceeded(\n `A group holds at most ${MAX_GROUP_MEMBERS} members`,\n );\n }\n state.members.push(address);\n },\n removeMemberOperation(state, action) {\n const address = action.input.address.trim();\n const index = state.members.findIndex((member) =>\n sameAddress(member, address),\n );\n if (index === -1) {\n throw new MemberNotFound(`Address is not a member: ${address}`);\n }\n state.members.splice(index, 1);\n },\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport type { Reducer, StateReducer } from \"document-model\";\nimport { createReducer, isDocumentAction } from \"document-model\";\nimport type { ReactorGroupPHState } from \"document-models/reactor-group/v1\";\n\nimport { reactorGroupGroupOperations } from \"../src/reducers/group.js\";\n\nimport {\n AddMemberInputSchema,\n RemoveMemberInputSchema,\n SetGroupDescriptionInputSchema,\n SetGroupNameInputSchema,\n} from \"./schema/zod.js\";\n\nconst stateReducer: StateReducer<ReactorGroupPHState> = (\n state,\n action,\n dispatch,\n) => {\n if (isDocumentAction(action)) {\n return state;\n }\n switch (action.type) {\n case \"SET_GROUP_NAME\": {\n SetGroupNameInputSchema().parse(action.input);\n\n reactorGroupGroupOperations.setGroupNameOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_GROUP_DESCRIPTION\": {\n SetGroupDescriptionInputSchema().parse(action.input);\n\n reactorGroupGroupOperations.setGroupDescriptionOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"ADD_MEMBER\": {\n AddMemberInputSchema().parse(action.input);\n\n reactorGroupGroupOperations.addMemberOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"REMOVE_MEMBER\": {\n RemoveMemberInputSchema().parse(action.input);\n\n reactorGroupGroupOperations.removeMemberOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n default:\n return state;\n }\n};\n\nexport const reducer: Reducer<ReactorGroupPHState> =\n createReducer(stateReducer);\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const reactorGroupUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/reactor-group\",\n latestVersion,\n supportedVersions,\n upgrades: {},\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nexport const reactorGroupDocumentType = \"powerhouse/reactor-group\";\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport {\n BaseDocumentHeaderSchema,\n BaseDocumentStateSchema,\n} from \"document-model\";\nimport { z } from \"zod\";\nimport { reactorGroupDocumentType } from \"./document-type.js\";\nimport { ReactorGroupStateSchema } from \"./schema/zod.js\";\nimport type { ReactorGroupDocument, ReactorGroupPHState } from \"./types.js\";\n\n/** Schema for validating the header object of a ReactorGroup document */\nexport const ReactorGroupDocumentHeaderSchema = BaseDocumentHeaderSchema.extend(\n {\n documentType: z.literal(reactorGroupDocumentType),\n },\n);\n\n/** Schema for validating the state object of a ReactorGroup document */\nexport const ReactorGroupPHStateSchema = BaseDocumentStateSchema.extend({\n global: ReactorGroupStateSchema(),\n});\n\nexport const ReactorGroupDocumentSchema = z.object({\n header: ReactorGroupDocumentHeaderSchema,\n state: ReactorGroupPHStateSchema,\n initialState: ReactorGroupPHStateSchema,\n});\n\n/** Simple helper function to check if a state object is a ReactorGroup document state object */\nexport function isReactorGroupState(\n state: unknown,\n): state is ReactorGroupPHState {\n return ReactorGroupPHStateSchema.safeParse(state).success;\n}\n\n/** Simple helper function to assert that a document state object is a ReactorGroup document state object */\nexport function assertIsReactorGroupState(\n state: unknown,\n): asserts state is ReactorGroupPHState {\n ReactorGroupPHStateSchema.parse(state);\n}\n\n/** Simple helper function to check if a document is a ReactorGroup document */\nexport function isReactorGroupDocument(\n document: unknown,\n): document is ReactorGroupDocument {\n return ReactorGroupDocumentSchema.safeParse(document).success;\n}\n\n/** Simple helper function to assert that a document is a ReactorGroup document */\nexport function assertIsReactorGroupDocument(\n document: unknown,\n): asserts document is ReactorGroupDocument {\n ReactorGroupDocumentSchema.parse(document);\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils, PHBaseState, Reducer } from \"document-model\";\nimport {\n baseCreateDocument,\n baseLoadFromInputVersioned,\n baseSaveToFileHandle,\n createBaseState,\n} from \"document-model\";\nimport { reactorGroupUpgradeManifest } from \"../../upgrades/upgrade-manifest.js\";\nimport {\n assertIsReactorGroupDocument,\n assertIsReactorGroupState,\n isReactorGroupDocument,\n isReactorGroupState,\n} from \"./document-schema.js\";\nimport { reactorGroupDocumentType } from \"./document-type.js\";\nimport { reducer } from \"./reducer.js\";\nimport type {\n ReactorGroupGlobalState,\n ReactorGroupLocalState,\n ReactorGroupPHState,\n} from \"./types.js\";\n\nexport const initialGlobalState: ReactorGroupGlobalState = {\n name: \"\",\n description: \"\",\n members: [],\n};\nexport const initialLocalState: ReactorGroupLocalState = {};\n\nexport const utils: DocumentModelUtils<ReactorGroupPHState> = {\n fileExtension: \".phrg\",\n createState(state) {\n return {\n ...createBaseState(state?.auth, { version: 1, ...state?.document }),\n global: { ...initialGlobalState, ...state?.global },\n local: { ...initialLocalState, ...state?.local },\n };\n },\n createDocument(state) {\n return baseCreateDocument(\n utils.createState,\n state,\n reactorGroupDocumentType,\n );\n },\n saveToFileHandle(document, input) {\n return baseSaveToFileHandle(document, input);\n },\n loadFromInput(input) {\n return baseLoadFromInputVersioned(input, {\n reducers: { 1: reducer as unknown as Reducer<PHBaseState> },\n upgradeManifest: reactorGroupUpgradeManifest,\n });\n },\n isStateOfType(state) {\n return isReactorGroupState(state);\n },\n assertIsStateOfType(state) {\n return assertIsReactorGroupState(state);\n },\n isDocumentOfType(document) {\n return isReactorGroupDocument(document);\n },\n assertIsDocumentOfType(document) {\n return assertIsReactorGroupDocument(document);\n },\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from \"document-model\";\nimport type { ReactorGroupPHState } from \"./gen/types.js\";\nimport { utils as genUtils } from \"./gen/utils.js\";\nimport * as customUtils from \"./src/utils.js\";\n\n/** Utils for the ReactorGroup document model */\nexport const utils: DocumentModelUtils<ReactorGroupPHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from \"document-model\";\nimport { createState, defaultBaseState } from \"document-model\";\nimport { actions } from \"./actions.js\";\nimport { documentModel } from \"./gen/document-model.js\";\nimport { reducer } from \"./gen/reducer.js\";\nimport type { ReactorGroupPHState } from \"./gen/types.js\";\nimport { utils } from \"./utils.js\";\n\n/** Document model module for the ReactorGroup document type */\nexport const ReactorGroup = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<ReactorGroupPHState>;\n"],"mappings":";;;;;AAiBA,MAAa,uBAAuB,MAClC,MAAM,KAAA,KAAa,MAAM;AAE3B,MAAa,0BAA0BA,IACpC,KAAK,CACL,QAAQ,MAAM,oBAAoB,EAAE,CAAC;AAExC,SAAgB,uBAEd;AACA,QAAOA,IAAE,OAAO,EACd,SAASA,IAAE,QAAQ,EACpB,CAAC;;AAGJ,SAAgB,0BAEd;AACA,QAAOA,IAAE,OAAO;EACd,YAAYA,IAAE,QAAQ,oBAAoB,CAAC,UAAU;EACrD,aAAaA,IAAE,QAAQ;EACvB,SAASA,IAAE,MAAMA,IAAE,QAAQ,CAAC;EAC5B,MAAMA,IAAE,QAAQ;EACjB,CAAC;;AAGJ,SAAgB,0BAEd;AACA,QAAOA,IAAE,OAAO,EACd,SAASA,IAAE,QAAQ,EACpB,CAAC;;AAGJ,SAAgB,iCAEd;AACA,QAAOA,IAAE,OAAO,EACd,aAAaA,IAAE,QAAQ,EACxB,CAAC;;AAGJ,SAAgB,0BAEd;AACA,QAAOA,IAAE,OAAO,EACd,MAAMA,IAAE,QAAQ,EACjB,CAAC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AM;;CAE9C,cAAc,OAAO;AACnB,SAAO,2BAA2B,OAAO;GACvC,UAAU,EAAE,GAAG,SAA4C;GAC3D,iBAAiB;GAClB,CAAC;;CAEJ,cAAc,OAAO;AACnB,SAAO,oBAAoB,MAAM;;CAEnC,oBAAoB,OAAO;AACzB,SAAO,0BAA0B,MAAM;;CAEzC,iBAAiB,UAAU;AACzB,SAAO,uBAAuB,SAAS;;CAEzC,uBAAuB,UAAU;AAC/B,SAAO,6BAA6B,SAAS;;CAEhD;;;;;;;AE5DD,MAAa,QAAiD;CAC5D,GAAGC;CACH,GAAGC;CACJ;;;;ACAD,MAAa,eAAe;CAC1B,SAAS;CACT;CACA;CACA;CACA,eAAe,YAAY,kBAAkB,EAAE,cAAc;CAC9D"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@powerhousedao/reactor-group",
|
|
3
|
+
"version": "6.2.2-dev.44",
|
|
4
|
+
"description": "Platform document model for groups of member addresses, referenced by { group } principals in the auth scope.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"powerhouse",
|
|
7
|
+
"vetra",
|
|
8
|
+
"document-model",
|
|
9
|
+
"local-first",
|
|
10
|
+
"event-sourcing",
|
|
11
|
+
"auth",
|
|
12
|
+
"groups"
|
|
13
|
+
],
|
|
14
|
+
"license": "AGPL-3.0-only",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/powerhouse-inc/powerhouse",
|
|
20
|
+
"directory": "packages/reactor-group"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"source": "./index.ts",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./document-models": {
|
|
35
|
+
"source": "./document-models/index.ts",
|
|
36
|
+
"types": "./dist/document-models/index.d.ts",
|
|
37
|
+
"import": "./dist/document-models/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./document-models/*": {
|
|
40
|
+
"source": "./document-models/*/index.ts",
|
|
41
|
+
"types": "./dist/document-models/*/index.d.ts",
|
|
42
|
+
"import": "./dist/document-models/*/index.js"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"zod": "4.3.6",
|
|
47
|
+
"@powerhousedao/reactor-browser": "6.2.2-dev.44",
|
|
48
|
+
"@powerhousedao/shared": "6.2.2-dev.44",
|
|
49
|
+
"document-model": "6.2.2-dev.44"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@electric-sql/pglite": "0.3.15",
|
|
53
|
+
"kysely": "0.28.16",
|
|
54
|
+
"kysely-pglite-dialect": "1.2.0",
|
|
55
|
+
"tsdown": "0.21.1",
|
|
56
|
+
"vitest": "4.1.1",
|
|
57
|
+
"@powerhousedao/reactor": "6.2.2-dev.44"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"tsc": "tsc",
|
|
61
|
+
"lint": "eslint",
|
|
62
|
+
"build": "tsdown",
|
|
63
|
+
"test": "vitest --run",
|
|
64
|
+
"generate": "ph-cli generate"
|
|
65
|
+
}
|
|
66
|
+
}
|