@powerhousedao/shared 6.2.2-dev.43 → 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.
@@ -1024,7 +1024,14 @@ const actions = {
1024
1024
  //#endregion
1025
1025
  //#region document-model/document-type.ts
1026
1026
  const documentModelDocumentType = "powerhouse/document-model";
1027
- const groupDocumentType = "@powerhousedao/document-group";
1027
+ const groupDocumentType = "powerhouse/reactor-group";
1028
+ /**
1029
+ * The group-model action types that change membership. The groups projection
1030
+ * filters its reads to these, so any other group operation is invisible to a
1031
+ * decision. Kept here so the reactor never depends on the group package; a
1032
+ * reactor-group test guards against drift.
1033
+ */
1034
+ const groupMembershipActionTypes = ["ADD_MEMBER", "REMOVE_MEMBER"];
1028
1035
  //#endregion
1029
1036
  //#region document-model/auth-v1.ts
1030
1037
  /** Maximum number of grants in a policy. */
@@ -1230,7 +1237,7 @@ function assertValidGrant(grant, documentType) {
1230
1237
  const grantId = isPlainValue(grant) && typeof grant.id === "string" ? grant.id : "";
1231
1238
  const problem = grantProblem(grant);
1232
1239
  if (problem !== null) throw new InvalidGrantError(grantId, problem);
1233
- if (documentType === "@powerhousedao/document-group" && "group" in grant.principal) throw new GroupPrincipalNotAllowedError(grantId);
1240
+ if (documentType === "powerhouse/reactor-group" && "group" in grant.principal) throw new GroupPrincipalNotAllowedError(grantId);
1234
1241
  }
1235
1242
  /**
1236
1243
  * Validates an initial grant list: the count cap, every grant, and — on a
@@ -1304,6 +1311,158 @@ function assertAuthAdministrationRetained(creator, previous, next, grantId) {
1304
1311
  if (creator !== void 0) return;
1305
1312
  if (administrationReachable(previous) && !administrationReachable(next)) throw new AuthAdministrationLockoutError(grantId);
1306
1313
  }
1314
+ /**
1315
+ * An operand whose shape validation would have rejected. Distinguished from
1316
+ * an unresolved path so a structurally malformed operand poisons its whole
1317
+ * condition to false rather than reading as "absent", which `not` would
1318
+ * otherwise widen to true.
1319
+ */
1320
+ const INVALID_OPERAND = Symbol("invalid-operand");
1321
+ /**
1322
+ * Narrows to the values conditions compare. An object, array, or non-finite
1323
+ * number resolves to undefined, and every comparison involving undefined is
1324
+ * false.
1325
+ */
1326
+ function asConditionValue(value) {
1327
+ if (value === null || typeof value === "string" || typeof value === "boolean") return value;
1328
+ if (typeof value === "number" && Number.isFinite(value)) return value;
1329
+ }
1330
+ /**
1331
+ * Resolves one operand. Attr roots: `subject.*`, `doc.<scope>.*` where the
1332
+ * scope must be the executing scope (validation already rejects any other,
1333
+ * but resolution stays total), and `action.input.*`. Path steps read own
1334
+ * properties only, so prototype members can never influence a verdict.
1335
+ */
1336
+ function resolveOperand(operand, subject, request, conditions) {
1337
+ if (!isPlainValue(operand)) return INVALID_OPERAND;
1338
+ const keys = Object.keys(operand);
1339
+ if (keys.length !== 1) return INVALID_OPERAND;
1340
+ if (keys[0] === "lit") {
1341
+ const value = asConditionValue(operand.lit);
1342
+ return value === void 0 ? INVALID_OPERAND : value;
1343
+ }
1344
+ if (keys[0] !== "attr") return INVALID_OPERAND;
1345
+ const attr = operand.attr;
1346
+ if (typeof attr !== "string" || attr.length === 0) return INVALID_OPERAND;
1347
+ const path = attr.split(".");
1348
+ let value;
1349
+ let rest;
1350
+ if (path[0] === "subject") {
1351
+ value = subject;
1352
+ rest = path.slice(1);
1353
+ } else if (path[0] === "doc") {
1354
+ if (path[1] !== request.scope) return;
1355
+ value = conditions.scopeState;
1356
+ rest = path.slice(2);
1357
+ } else if (path[0] === "action" && path[1] === "input") {
1358
+ value = conditions.actionInput;
1359
+ rest = path.slice(2);
1360
+ } else return;
1361
+ for (const segment of rest) {
1362
+ if (!isPlainValue(value) || !Object.hasOwn(value, segment)) return;
1363
+ value = value[segment];
1364
+ }
1365
+ return asConditionValue(value);
1366
+ }
1367
+ /**
1368
+ * Total order within one type: numbers numerically, strings by code point.
1369
+ * Everything else, including mixed types, does not order.
1370
+ */
1371
+ function compareValues(left, right) {
1372
+ if (typeof left === "number" && typeof right === "number") return left < right ? -1 : left > right ? 1 : 0;
1373
+ if (typeof left === "string" && typeof right === "string") {
1374
+ const leftPoints = Array.from(left);
1375
+ const rightPoints = Array.from(right);
1376
+ const shared = Math.min(leftPoints.length, rightPoints.length);
1377
+ for (let i = 0; i < shared; i++) {
1378
+ const a = leftPoints[i].codePointAt(0) ?? 0;
1379
+ const b = rightPoints[i].codePointAt(0) ?? 0;
1380
+ if (a !== b) return a < b ? -1 : 1;
1381
+ }
1382
+ return leftPoints.length === rightPoints.length ? 0 : leftPoints.length < rightPoints.length ? -1 : 1;
1383
+ }
1384
+ }
1385
+ /**
1386
+ * Tri-state evaluation: undefined marks a structurally invalid node, which
1387
+ * poisons the whole tree to false at the top — and a structurally malformed
1388
+ * operand poisons its condition the same way. Both are distinct from an
1389
+ * operand whose path fails to resolve, which is a valid comparison that is
1390
+ * false. The distinction keeps `not` from widening over malformed input.
1391
+ */
1392
+ function evaluateNode(node, subject, request, conditions) {
1393
+ if (!isPlainValue(node)) return;
1394
+ const keys = Object.keys(node);
1395
+ if (keys.length !== 1) return;
1396
+ const kind = keys[0];
1397
+ const body = node[kind];
1398
+ switch (kind) {
1399
+ case "eq":
1400
+ case "ne":
1401
+ case "lt":
1402
+ case "lte":
1403
+ case "gt":
1404
+ case "gte": {
1405
+ if (!Array.isArray(body) || body.length !== 2) return;
1406
+ const left = resolveOperand(body[0], subject, request, conditions);
1407
+ const right = resolveOperand(body[1], subject, request, conditions);
1408
+ if (left === INVALID_OPERAND || right === INVALID_OPERAND) return;
1409
+ if (left === void 0 || right === void 0) return false;
1410
+ if (kind === "eq") return left === right;
1411
+ if (kind === "ne") return left !== right;
1412
+ const order = compareValues(left, right);
1413
+ if (order === void 0) return false;
1414
+ switch (kind) {
1415
+ case "lt": return order < 0;
1416
+ case "lte": return order <= 0;
1417
+ case "gt": return order > 0;
1418
+ case "gte": return order >= 0;
1419
+ }
1420
+ return;
1421
+ }
1422
+ case "in":
1423
+ case "notIn": {
1424
+ if (!Array.isArray(body) || body.length !== 2 || !Array.isArray(body[1])) return;
1425
+ const left = resolveOperand(body[0], subject, request, conditions);
1426
+ if (left === INVALID_OPERAND) return;
1427
+ const elements = body[1].map((element) => resolveOperand(element, subject, request, conditions));
1428
+ if (elements.some((value) => value === INVALID_OPERAND)) return;
1429
+ if (left === void 0) return false;
1430
+ const found = elements.some((value) => value !== void 0 && value === left);
1431
+ return kind === "in" ? found : !found;
1432
+ }
1433
+ case "exists": {
1434
+ const value = resolveOperand(body, subject, request, conditions);
1435
+ if (value === INVALID_OPERAND) return;
1436
+ return value !== void 0;
1437
+ }
1438
+ case "and":
1439
+ case "or": {
1440
+ if (!Array.isArray(body)) return;
1441
+ let result = kind === "and";
1442
+ for (const child of body) {
1443
+ const value = evaluateNode(child, subject, request, conditions);
1444
+ if (value === void 0) return;
1445
+ if (kind === "and") result = result && value;
1446
+ else result = result || value;
1447
+ }
1448
+ return result;
1449
+ }
1450
+ case "not": {
1451
+ const value = evaluateNode(body, subject, request, conditions);
1452
+ return value === void 0 ? void 0 : !value;
1453
+ }
1454
+ default: return;
1455
+ }
1456
+ }
1457
+ /**
1458
+ * Evaluates a version-1 condition. Deterministic, total, and pure: any input
1459
+ * shape yields a boolean and never throws, and a malformed condition is
1460
+ * false. These are consensus semantics, versioned by `PHAuthState.version`;
1461
+ * changing them requires a new version.
1462
+ */
1463
+ function evaluateCondition(condition, subject, request, conditions) {
1464
+ return evaluateNode(condition, subject, request, conditions) === true;
1465
+ }
1307
1466
  function capabilityCovers(capability, request) {
1308
1467
  if (capability.can !== request.verb) return false;
1309
1468
  const scope = capability.scope;
@@ -1314,21 +1473,46 @@ function capabilityCovers(capability, request) {
1314
1473
  }
1315
1474
  return true;
1316
1475
  }
1317
- function principalMatches(principal, subject) {
1476
+ function principalMatches(principal, subject, request, groups, conditions) {
1318
1477
  if ("anyone" in principal) return true;
1319
1478
  if ("address" in principal) return subject.address !== void 0 && subject.address.toLowerCase() === principal.address.toLowerCase();
1479
+ if ("group" in principal) {
1480
+ if (groups === void 0 || subject.address === void 0) return false;
1481
+ const group = groups[principal.group];
1482
+ if (group === void 0 || !Array.isArray(group.members)) return false;
1483
+ const address = subject.address.toLowerCase();
1484
+ return group.members.some((member) => member.toLowerCase() === address);
1485
+ }
1486
+ if ("match" in principal) {
1487
+ if (conditions === void 0) return false;
1488
+ return evaluateCondition(principal.match, subject, request, conditions);
1489
+ }
1320
1490
  return false;
1321
1491
  }
1322
1492
  /**
1493
+ * The group document ids named by `{ group }` principals in a grant list, in
1494
+ * order of first appearance. These are the streams the groups projection reads.
1495
+ */
1496
+ function referencedGroupIds(grants) {
1497
+ const ids = [];
1498
+ for (const grant of grants) if ("group" in grant.principal && !ids.includes(grant.principal.group)) ids.push(grant.principal.group);
1499
+ return ids;
1500
+ }
1501
+ /**
1323
1502
  * Evaluates a v1 grant stack: default deny, last applicable grant wins, and
1324
- * reports which grant decided it. Group and match principals and `where`
1325
- * conditions are not evaluated yet; a grant that uses any of them never applies.
1503
+ * reports which grant decided it. Group principals match only against a
1504
+ * supplied groups map, and `where` clauses and { match } principals evaluate
1505
+ * only against a supplied condition context; a grant that uses an unsupplied
1506
+ * feature never applies.
1326
1507
  */
1327
- function evaluateGrantStack(grants, subject, request) {
1508
+ function evaluateGrantStack(grants, subject, request, groups, conditions) {
1328
1509
  let applicable;
1329
1510
  for (const grant of grants) {
1330
- if (grant.where !== void 0) continue;
1331
- if (capabilityCovers(grant.capability, request) && principalMatches(grant.principal, subject)) applicable = grant;
1511
+ if (grant.where !== void 0) {
1512
+ if (conditions === void 0) continue;
1513
+ if (!evaluateCondition(grant.where, subject, request, conditions)) continue;
1514
+ }
1515
+ if (capabilityCovers(grant.capability, request) && principalMatches(grant.principal, subject, request, groups, conditions)) applicable = grant;
1332
1516
  }
1333
1517
  if (applicable === void 0) return {
1334
1518
  decision: "deny",
@@ -1345,8 +1529,8 @@ function evaluateGrantStack(grants, subject, request) {
1345
1529
  * Evaluates a v1 grant stack: default deny, last applicable grant wins. This is
1346
1530
  * {@link evaluateGrantStack} with the reason dropped.
1347
1531
  */
1348
- function evaluateGrants(grants, subject, request) {
1349
- return evaluateGrantStack(grants, subject, request).decision;
1532
+ function evaluateGrants(grants, subject, request, groups, conditions) {
1533
+ return evaluateGrantStack(grants, subject, request, groups, conditions).decision;
1350
1534
  }
1351
1535
  //#endregion
1352
1536
  //#region document-model/constants.ts
@@ -2271,22 +2455,49 @@ function assertAuthScopeActionAllowed(action) {
2271
2455
  * An uninitialized policy (version 0, absent auth state, or a legacy `{}`
2272
2456
  * auth scope serialized before PHAuthState had a version) leaves the document
2273
2457
  * open. Once a policy exists the default is deny, and grants stack in order.
2458
+ *
2459
+ * Group principals match only against a supplied groups map (the groups
2460
+ * projection, present when authGroups is on); with no map they never apply.
2461
+ * `where` clauses and { match } principals likewise evaluate only against a
2462
+ * supplied condition context (present when authConditions is on).
2274
2463
  */
2275
- function evaluate(auth, subject, request) {
2464
+ function evaluate(auth, subject, request, groups, conditions) {
2276
2465
  if (!auth || !auth.version) return { decision: "allow" };
2277
2466
  if (request.verb === "execute" && request.scope === "auth" && subject.key !== void 0 && subject.key === auth.creator) return { decision: "allow" };
2278
2467
  if (auth.version > 1) return {
2279
2468
  decision: "deny",
2280
2469
  refusal: "version-unsupported"
2281
2470
  };
2282
- return evaluateGrantStack(auth.grants, subject, request);
2471
+ return evaluateGrantStack(auth.grants, subject, request, groups, conditions);
2283
2472
  }
2284
2473
  /**
2285
2474
  * Evaluates the auth policy for a single request. Pure and deterministic. This
2286
2475
  * is {@link evaluate} with the reason dropped.
2287
2476
  */
2288
- function decide(auth, subject, request) {
2289
- return evaluate(auth, subject, request).decision;
2477
+ function decide(auth, subject, request, groups, conditions) {
2478
+ return evaluate(auth, subject, request, groups, conditions).decision;
2479
+ }
2480
+ /**
2481
+ * The group document ids a single auth action's input names with `{ group }`
2482
+ * principals. INITIALIZE_AUTH contributes the groups named across its grants,
2483
+ * SET_GRANT the groups named by its one grant; REMOVE_GRANT and MOVE_GRANT
2484
+ * contribute nothing. Total over any input shape, because references are read
2485
+ * from the input as it arrived, including inputs later stored as errors.
2486
+ */
2487
+ function mentionedGroupIds(action) {
2488
+ const input = action.input;
2489
+ const candidates = [];
2490
+ if (action.type === "INITIALIZE_AUTH" && Array.isArray(input?.grants)) candidates.push(...input.grants);
2491
+ if (action.type === "SET_GRANT" && input?.grant !== void 0) candidates.push(input.grant);
2492
+ const ids = [];
2493
+ for (const candidate of candidates) {
2494
+ if (typeof candidate !== "object" || candidate === null) continue;
2495
+ const principal = candidate.principal;
2496
+ if (typeof principal !== "object" || principal === null) continue;
2497
+ const group = principal.group;
2498
+ if (typeof group === "string" && group !== "" && !ids.includes(group)) ids.push(group);
2499
+ }
2500
+ return ids;
2290
2501
  }
2291
2502
  //#endregion
2292
2503
  //#region document-model/denied.ts
@@ -4769,6 +4980,6 @@ const getFileBrowser = (file) => {
4769
4980
  return Promise.resolve().then(() => readFileBrowser(file));
4770
4981
  };
4771
4982
  //#endregion
4772
- export { AUTH_ACTION_TYPES, AUTH_DENIED_BY_GRANT_REASON, AUTH_NO_GRANT_REASON, AUTH_VERSION_UNSUPPORTED_REASON, AddChangeLogItemInputSchema, AddModuleInputSchema, AddOperationErrorInputSchema, AddOperationExampleInputSchema, AddOperationInputSchema, AddStateExampleInputSchema, AuthActionNotAllowedError, AuthAdministrationLockoutError, AuthAdministrationMissingError, AuthAlreadyInitializedError, AuthInitializerNotCreatorError, AuthPolicyNotPreservedError, AuthorSchema, BaseDocumentHeaderSchema, BaseDocumentStateSchema, CodeExampleSchema, ConfigEntrySchema, ConfigEntryTypeSchema, DOCUMENT_DELETED_REASON, DeleteChangeLogItemInputSchema, DeleteModuleInputSchema, DeleteOperationErrorInputSchema, DeleteOperationExampleInputSchema, DeleteOperationInputSchema, DeleteStateExampleInputSchema, DocumentActionSchema, DocumentModelGlobalStateSchema, DocumentModelHeaderSchema, DocumentModelInputSchema, DocumentModelPHStateSchema, DocumentModelSchema, DocumentSpecificationSchema, DowngradeNotSupportedError, FileSystemError, GrantNotFoundError, GrantSchema, GroupPrincipalNotAllowedError, HASH_ALGORITHM_SHA1, HASH_ALGORITHM_SHA256, HASH_ALGORITHM_SHA512, HASH_ENCODING_BASE64, HASH_ENCODING_HEX, HashMismatchError, InitializeAuthActionInputSchema, IntegrityIssueSubType, IntegrityIssueType, InvalidActionInputError, InvalidActionInputZodError, InvalidAuthVersionError, InvalidGrantError, LoadStateActionInputSchema, LoadStateActionSchema, LoadStateActionStateInputSchema, Load_StateSchema, MAX_AUTH_GRANTS, MAX_CAPABILITY_OPERATIONS, MAX_CONDITION_DEPTH, MAX_CONDITION_NODES, MAX_SUPPORTED_AUTH_VERSION, ManifestSchema, ModuleSchema, MoveGrantActionInputSchema, MoveOperationInputSchema, OPERATION_NAME_PATTERN, OperationErrorSchema, OperationScopeSchema, OperationSpecificationSchema, PowerhouseModuleSchema, PowerhouseModulesSchema, PruneActionInputSchema, PruneActionSchema, PruneSchema, PublisherSchema, PwaConfigSchema, RESERVED_OPERATION_NAMES, RedoActionInputSchema, RedoActionSchema, RedoSchema, RemoveGrantActionInputSchema, ReorderChangeLogItemsInputSchema, ReorderModuleOperationsInputSchema, ReorderModulesInputSchema, ReorderOperationErrorsInputSchema, ReorderOperationExamplesInputSchema, ReorderStateExamplesInputSchema, ScopeStateSchema, SetAuthorNameInputSchema, SetAuthorWebsiteInputSchema, SetGrantActionInputSchema, SetInitialStateInputSchema, SetModelDescriptionInputSchema, SetModelExtensionInputSchema, SetModelIdInputSchema, SetModelNameInputSchema, SetModuleDescriptionInputSchema, SetModuleNameInputSchema, SetNameActionInputSchema, SetNameActionSchema, SetOperationDescriptionInputSchema, SetOperationErrorCodeInputSchema, SetOperationErrorDescriptionInputSchema, SetOperationErrorNameInputSchema, SetOperationErrorTemplateInputSchema, SetOperationNameInputSchema, SetOperationReducerInputSchema, SetOperationSchemaInputSchema, SetOperationScopeInputSchema, SetOperationTemplateInputSchema, SetPreferredEditorActionInputSchema, SetPreferredEditorActionSchema, SetStateSchemaInputSchema, Set_NameSchema, Set_PreferredEditorSchema, StateSchema, UndoActionInputSchema, UndoActionSchema, UndoSchema, UnsupportedDocumentModelVersionError, UpdateChangeLogItemInputSchema, UpdateOperationExampleInputSchema, UpdateStateExampleInputSchema, ab2hex, actionContext, actionFromAction, actionSigner, actions, addChangeLogItem, addModule, addOperation, addOperationError, addOperationExample, addStateExample, addUndo, appendWithoutApplying, applyAuthAction, applyDeleteDocumentAction, applyInitializeAuthAction, applyMoveGrantAction, applyRemoveGrantAction, applySetGrantAction, applyUpgradeDocumentAction, assertAuthAdministrationRetained, assertAuthPreservedOnDuplicate, assertAuthScopeActionAllowed, assertIsDocumentModelDocument, assertIsDocumentModelState, assertModuleIdUnique, assertOperationErrorIdUnique, assertOperationExampleIdUnique, assertOperationIdUnique, assertValidGrant, assertValidGrantUpsert, assertValidInitialGrants, attachBranch, backfillAuthState, base58Decode, base64UrlToBytes, baseActions, baseCreateDocument, baseLoadFromInput, baseLoadFromInputVersioned, baseReducer, baseReducerVersion, baseSaveToFileHandle, buildOperationSignature, buildOperationSignatureMessage, buildOperationSignatureParams, buildSignedAction, checkCleanedOperationsIntegrity, checkOperationsIntegrity, computeUpgradeTransitions, createAction, createAuthState, createBaseState, createDocumentState, createGlobalState, createLocalState, createMinimalZip, createPresignedHeader, createReducer, createSignedHeader, createSignedHeaderForSigner, createState, createVerificationSigner, createZip, decide, defaultAuthState, defaultBaseState, defaultDocumentState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteChangeLogItem, deleteModule, deleteOperation, deleteOperationError, deleteOperationExample, deleteStateExample, deriveOperationId, diffOperations, documentModelActions, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelHeaderReducer, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelModuleReducer, documentModelOperationErrorReducer, documentModelOperationExampleReducer, documentModelOperationReducer, documentModelReducer, documentModelSaveToFileHandle, documentModelStateReducer, documentModelStateSchemaReducer, documentModelVersioningReducer, evaluate, evaluateGrantStack, evaluateGrants, fetchFileBrowser, filterDocumentOperationsResultingState, filterDuplicatedOperations, findModuleOrThrow, findOperationErrorOrThrow, findOperationExampleOrThrow, findOperationOrThrow, garbageCollect, garbageCollectDocumentOperations, garbageCollectV2, generateId, generateMock, getAllOperationNames, getDocumentLastModified, getFileBrowser, getUnixTimestamp, grantProblem, groupDocumentType, groupOperationsByScope, hashBrowser, hashDocumentStateForScope, hex2ab, initializeAuth, isAuthAction, isDefinedNonNullAny, isDenied, isDocumentAction, isDocumentCreator, isDocumentModelDocument, isDocumentModelState, isNoopOperation, isPlainValue, isReservedOperationName, isUndo, isUndoRedo, isValidOperationNameFormat, loadState, loadStateOperation, mapSkippedOperations, mapSkippedOperationsV2, merge, moveGrant, moveOperation, nextSkipNumber, noop, normalizeDocumentModelVersion, operationExampleCreators, operationFromAction, operationFromOperation, operationOutcome, operationWithContext, operationsAreEqual, parseResultingState, precedes, prepareOperations, processUndoRedo, prune, pruneOperation, readFileBrowser, readOnly, redo, redoOperation, releaseNewVersion, removeExistingOperations, removeGrant, reorderChangeLogItems, reorderModuleOperations, reorderModules, reorderOperationErrors, reorderOperationExamples, reorderStateExamples, replayDocument, replayDocumentVersioned, replayOperations, reshuffleByTimestamp, reshuffleByTimestampAndIndex, resolveSnapshotAuth, setAuthorName, setAuthorWebsite, setGrant, setInitialState, setModelDescription, setModelExtension, setModelId, setModelName, setModuleDescription, setModuleName, setName, setNameOperation, setOperationDescription, setOperationErrorCode, setOperationErrorDescription, setOperationErrorName, setOperationErrorTemplate, setOperationName, setOperationReducer, setOperationSchema, setOperationScope, setOperationTemplate, setPreferredEditor, setPreferredEditorOperation, setStateSchema, sign, skipHeaderOperations, sortMappedOperations, sortOperations, split, undo, undoOperation, undoOperationV2, updateChangeLogItem, updateDocument, updateHeaderRevision, updateOperationExample, updateStateExample, validateHeader, validateInitialState, validateModule, validateModuleOperation, validateModules, validateOperationName, validateOperations, validateStateSchemaName, verify, verifyOperationSignature, writeFileBrowser };
4983
+ export { AUTH_ACTION_TYPES, AUTH_DENIED_BY_GRANT_REASON, AUTH_NO_GRANT_REASON, AUTH_VERSION_UNSUPPORTED_REASON, AddChangeLogItemInputSchema, AddModuleInputSchema, AddOperationErrorInputSchema, AddOperationExampleInputSchema, AddOperationInputSchema, AddStateExampleInputSchema, AuthActionNotAllowedError, AuthAdministrationLockoutError, AuthAdministrationMissingError, AuthAlreadyInitializedError, AuthInitializerNotCreatorError, AuthPolicyNotPreservedError, AuthorSchema, BaseDocumentHeaderSchema, BaseDocumentStateSchema, CodeExampleSchema, ConfigEntrySchema, ConfigEntryTypeSchema, DOCUMENT_DELETED_REASON, DeleteChangeLogItemInputSchema, DeleteModuleInputSchema, DeleteOperationErrorInputSchema, DeleteOperationExampleInputSchema, DeleteOperationInputSchema, DeleteStateExampleInputSchema, DocumentActionSchema, DocumentModelGlobalStateSchema, DocumentModelHeaderSchema, DocumentModelInputSchema, DocumentModelPHStateSchema, DocumentModelSchema, DocumentSpecificationSchema, DowngradeNotSupportedError, FileSystemError, GrantNotFoundError, GrantSchema, GroupPrincipalNotAllowedError, HASH_ALGORITHM_SHA1, HASH_ALGORITHM_SHA256, HASH_ALGORITHM_SHA512, HASH_ENCODING_BASE64, HASH_ENCODING_HEX, HashMismatchError, InitializeAuthActionInputSchema, IntegrityIssueSubType, IntegrityIssueType, InvalidActionInputError, InvalidActionInputZodError, InvalidAuthVersionError, InvalidGrantError, LoadStateActionInputSchema, LoadStateActionSchema, LoadStateActionStateInputSchema, Load_StateSchema, MAX_AUTH_GRANTS, MAX_CAPABILITY_OPERATIONS, MAX_CONDITION_DEPTH, MAX_CONDITION_NODES, MAX_SUPPORTED_AUTH_VERSION, ManifestSchema, ModuleSchema, MoveGrantActionInputSchema, MoveOperationInputSchema, OPERATION_NAME_PATTERN, OperationErrorSchema, OperationScopeSchema, OperationSpecificationSchema, PowerhouseModuleSchema, PowerhouseModulesSchema, PruneActionInputSchema, PruneActionSchema, PruneSchema, PublisherSchema, PwaConfigSchema, RESERVED_OPERATION_NAMES, RedoActionInputSchema, RedoActionSchema, RedoSchema, RemoveGrantActionInputSchema, ReorderChangeLogItemsInputSchema, ReorderModuleOperationsInputSchema, ReorderModulesInputSchema, ReorderOperationErrorsInputSchema, ReorderOperationExamplesInputSchema, ReorderStateExamplesInputSchema, ScopeStateSchema, SetAuthorNameInputSchema, SetAuthorWebsiteInputSchema, SetGrantActionInputSchema, SetInitialStateInputSchema, SetModelDescriptionInputSchema, SetModelExtensionInputSchema, SetModelIdInputSchema, SetModelNameInputSchema, SetModuleDescriptionInputSchema, SetModuleNameInputSchema, SetNameActionInputSchema, SetNameActionSchema, SetOperationDescriptionInputSchema, SetOperationErrorCodeInputSchema, SetOperationErrorDescriptionInputSchema, SetOperationErrorNameInputSchema, SetOperationErrorTemplateInputSchema, SetOperationNameInputSchema, SetOperationReducerInputSchema, SetOperationSchemaInputSchema, SetOperationScopeInputSchema, SetOperationTemplateInputSchema, SetPreferredEditorActionInputSchema, SetPreferredEditorActionSchema, SetStateSchemaInputSchema, Set_NameSchema, Set_PreferredEditorSchema, StateSchema, UndoActionInputSchema, UndoActionSchema, UndoSchema, UnsupportedDocumentModelVersionError, UpdateChangeLogItemInputSchema, UpdateOperationExampleInputSchema, UpdateStateExampleInputSchema, ab2hex, actionContext, actionFromAction, actionSigner, actions, addChangeLogItem, addModule, addOperation, addOperationError, addOperationExample, addStateExample, addUndo, appendWithoutApplying, applyAuthAction, applyDeleteDocumentAction, applyInitializeAuthAction, applyMoveGrantAction, applyRemoveGrantAction, applySetGrantAction, applyUpgradeDocumentAction, assertAuthAdministrationRetained, assertAuthPreservedOnDuplicate, assertAuthScopeActionAllowed, assertIsDocumentModelDocument, assertIsDocumentModelState, assertModuleIdUnique, assertOperationErrorIdUnique, assertOperationExampleIdUnique, assertOperationIdUnique, assertValidGrant, assertValidGrantUpsert, assertValidInitialGrants, attachBranch, backfillAuthState, base58Decode, base64UrlToBytes, baseActions, baseCreateDocument, baseLoadFromInput, baseLoadFromInputVersioned, baseReducer, baseReducerVersion, baseSaveToFileHandle, buildOperationSignature, buildOperationSignatureMessage, buildOperationSignatureParams, buildSignedAction, checkCleanedOperationsIntegrity, checkOperationsIntegrity, computeUpgradeTransitions, createAction, createAuthState, createBaseState, createDocumentState, createGlobalState, createLocalState, createMinimalZip, createPresignedHeader, createReducer, createSignedHeader, createSignedHeaderForSigner, createState, createVerificationSigner, createZip, decide, defaultAuthState, defaultBaseState, defaultDocumentState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteChangeLogItem, deleteModule, deleteOperation, deleteOperationError, deleteOperationExample, deleteStateExample, deriveOperationId, diffOperations, documentModelActions, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelHeaderReducer, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelModuleReducer, documentModelOperationErrorReducer, documentModelOperationExampleReducer, documentModelOperationReducer, documentModelReducer, documentModelSaveToFileHandle, documentModelStateReducer, documentModelStateSchemaReducer, documentModelVersioningReducer, evaluate, evaluateCondition, evaluateGrantStack, evaluateGrants, fetchFileBrowser, filterDocumentOperationsResultingState, filterDuplicatedOperations, findModuleOrThrow, findOperationErrorOrThrow, findOperationExampleOrThrow, findOperationOrThrow, garbageCollect, garbageCollectDocumentOperations, garbageCollectV2, generateId, generateMock, getAllOperationNames, getDocumentLastModified, getFileBrowser, getUnixTimestamp, grantProblem, groupDocumentType, groupMembershipActionTypes, groupOperationsByScope, hashBrowser, hashDocumentStateForScope, hex2ab, initializeAuth, isAuthAction, isDefinedNonNullAny, isDenied, isDocumentAction, isDocumentCreator, isDocumentModelDocument, isDocumentModelState, isNoopOperation, isPlainValue, isReservedOperationName, isUndo, isUndoRedo, isValidOperationNameFormat, loadState, loadStateOperation, mapSkippedOperations, mapSkippedOperationsV2, mentionedGroupIds, merge, moveGrant, moveOperation, nextSkipNumber, noop, normalizeDocumentModelVersion, operationExampleCreators, operationFromAction, operationFromOperation, operationOutcome, operationWithContext, operationsAreEqual, parseResultingState, precedes, prepareOperations, processUndoRedo, prune, pruneOperation, readFileBrowser, readOnly, redo, redoOperation, referencedGroupIds, releaseNewVersion, removeExistingOperations, removeGrant, reorderChangeLogItems, reorderModuleOperations, reorderModules, reorderOperationErrors, reorderOperationExamples, reorderStateExamples, replayDocument, replayDocumentVersioned, replayOperations, reshuffleByTimestamp, reshuffleByTimestampAndIndex, resolveSnapshotAuth, setAuthorName, setAuthorWebsite, setGrant, setInitialState, setModelDescription, setModelExtension, setModelId, setModelName, setModuleDescription, setModuleName, setName, setNameOperation, setOperationDescription, setOperationErrorCode, setOperationErrorDescription, setOperationErrorName, setOperationErrorTemplate, setOperationName, setOperationReducer, setOperationSchema, setOperationScope, setOperationTemplate, setPreferredEditor, setPreferredEditorOperation, setStateSchema, sign, skipHeaderOperations, sortMappedOperations, sortOperations, split, undo, undoOperation, undoOperationV2, updateChangeLogItem, updateDocument, updateHeaderRevision, updateOperationExample, updateStateExample, validateHeader, validateInitialState, validateModule, validateModuleOperation, validateModules, validateOperationName, validateOperations, validateStateSchemaName, verify, verifyOperationSignature, writeFileBrowser };
4773
4984
 
4774
4985
  //# sourceMappingURL=index.js.map