@powerhousedao/reactor-api 6.2.3-dev.47 → 6.2.3-dev.49
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.mts +273 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +241 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="dc27a51b-c565-5dcc-a85a-eac64c78db3e")}catch(e){}}();
|
|
3
3
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
4
4
|
import { A as AuthenticationRequiredError, C as callerSubject, D as AuthorizedDocumentHandle, E as AuthorizationPolicy, M as MalformedStoredOperationError, N as RefusalNotRecordedError, O as createAuthorizationService, S as BaseSubgraph, T as createCanonicalDocumentIdResolver, b as loadSubgraphs, c as piecesFromListModule, d as buildGraphQlDriveDocument, f as buildGraphqlOperation, g as extractUpgradeManifests, h as debounce, i as PIECE_SOURCE_LIST, j as ForbiddenError, k as AuthEvaluationUnsupportedError, l as extractDocumentModels, m as isSubgraphClass, o as pieceListLocation, p as buildGraphqlOperations, s as piecesFromCdnList, t as extractSubgraphs, u as buildGraphQlDocument, v as loadDocumentModels, w as CanonicalDocumentIdResolutionError, x as manifestDeclaredSubgraphs, y as loadProcessors } from "./subgraph-extraction-DTFoN_bS.mjs";
|
|
5
5
|
import { l as createDurableNodeFs, n as openCurrentPgliteForVerify, r as preparePgliteDataDir, u as resolvePgliteFsync } from "./pglite-node-Ow9i5Rb4.mjs";
|
|
@@ -8,7 +8,7 @@ import { AnalyticsQueryEngine } from "@powerhousedao/analytics-engine-core";
|
|
|
8
8
|
import { AnalyticsModel, AnalyticsResolvers, typedefs } from "@powerhousedao/analytics-engine-graphql";
|
|
9
9
|
import { gql } from "graphql-tag";
|
|
10
10
|
import { GraphQLError, Kind, Lexer, Source, TokenKind, parse, print, visit } from "graphql";
|
|
11
|
-
import { AuthEnforcementDisabledError, BareReadGate, ChannelError, ChannelErrorSource, DEFAULT_DRIVE_CONTAINER_TYPES, DriveCollectionId, JobStatus, ModelReadGate, PropagationMode as PropagationMode$1, SyncOperation, SyncScopeGate, consolidateSyncOperations, createReactorHostModuleBase, driveIdFromUrl, envelopesToSyncOperations, parseDriveUrl, readDecisionModel, supportsPurgeRefusals, syncOperationErrorType } from "@powerhousedao/reactor";
|
|
11
|
+
import { AuthEnforcementDisabledError, BareReadGate, BatchJobFailedError, ChannelError, ChannelErrorSource, DEFAULT_DRIVE_CONTAINER_TYPES, DriveCollectionId, JobStatus, ModelReadGate, PropagationMode as PropagationMode$1, SyncOperation, SyncScopeGate, consolidateSyncOperations, createReactorHostModuleBase, driveIdFromUrl, envelopesToSyncOperations, parseDriveUrl, readDecisionModel, supportsPurgeRefusals, syncOperationErrorType } from "@powerhousedao/reactor";
|
|
12
12
|
import { deserializeSignature, readPeerManifest, serializeSignature, setName, withSignaturePolicy } from "@powerhousedao/shared/document-model";
|
|
13
13
|
import { ConsoleLogger, childLogger, documentModelDocumentModelModule } from "document-model";
|
|
14
14
|
import path, { isAbsolute, join } from "node:path";
|
|
@@ -2231,6 +2231,16 @@ function DocumentOperationsFilterInputSchema() {
|
|
|
2231
2231
|
timestampTo: z$1.string().nullish()
|
|
2232
2232
|
});
|
|
2233
2233
|
}
|
|
2234
|
+
function ExecutionJobInputSchema() {
|
|
2235
|
+
return z$1.object({
|
|
2236
|
+
actions: z$1.array(z$1.lazy(() => ActionInputSchema())),
|
|
2237
|
+
branch: z$1.string().nullish(),
|
|
2238
|
+
dependsOn: z$1.array(z$1.string()),
|
|
2239
|
+
documentIdOrSlug: z$1.string(),
|
|
2240
|
+
key: z$1.string(),
|
|
2241
|
+
scope: z$1.string()
|
|
2242
|
+
});
|
|
2243
|
+
}
|
|
2234
2244
|
function OperationContextInputSchema() {
|
|
2235
2245
|
return z$1.object({
|
|
2236
2246
|
branch: z$1.string(),
|
|
@@ -2357,6 +2367,8 @@ const PhDocumentFieldsFragmentDoc = gql`
|
|
|
2357
2367
|
slug
|
|
2358
2368
|
name
|
|
2359
2369
|
documentType
|
|
2370
|
+
meta
|
|
2371
|
+
protocolVersions
|
|
2360
2372
|
state
|
|
2361
2373
|
revisionsList {
|
|
2362
2374
|
scope
|
|
@@ -2376,6 +2388,32 @@ const DocumentRelationshipFieldsFragmentDoc = gql`
|
|
|
2376
2388
|
updatedAt
|
|
2377
2389
|
}
|
|
2378
2390
|
`;
|
|
2391
|
+
const JobInfoFieldsFragmentDoc = gql`
|
|
2392
|
+
fragment JobInfoFields on JobInfo {
|
|
2393
|
+
id
|
|
2394
|
+
documentId
|
|
2395
|
+
status
|
|
2396
|
+
result
|
|
2397
|
+
error
|
|
2398
|
+
errorName
|
|
2399
|
+
createdAt
|
|
2400
|
+
completedAt
|
|
2401
|
+
consistencyToken {
|
|
2402
|
+
version
|
|
2403
|
+
createdAtUtcIso
|
|
2404
|
+
coordinates {
|
|
2405
|
+
documentId
|
|
2406
|
+
scope
|
|
2407
|
+
branch
|
|
2408
|
+
operationIndex
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
meta {
|
|
2412
|
+
batchId
|
|
2413
|
+
batchJobIds
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
`;
|
|
2379
2417
|
const GetDocumentModelsDocument = gql`
|
|
2380
2418
|
query GetDocumentModels($namespace: String, $paging: PagingInput) {
|
|
2381
2419
|
documentModels(namespace: $namespace, paging: $paging) {
|
|
@@ -2608,14 +2646,10 @@ const GetDocumentOperationsDocument = gql`
|
|
|
2608
2646
|
const GetJobStatusDocument = gql`
|
|
2609
2647
|
query GetJobStatus($jobId: String!) {
|
|
2610
2648
|
jobStatus(jobId: $jobId) {
|
|
2611
|
-
|
|
2612
|
-
status
|
|
2613
|
-
result
|
|
2614
|
-
error
|
|
2615
|
-
createdAt
|
|
2616
|
-
completedAt
|
|
2649
|
+
...JobInfoFields
|
|
2617
2650
|
}
|
|
2618
2651
|
}
|
|
2652
|
+
${JobInfoFieldsFragmentDoc}
|
|
2619
2653
|
`;
|
|
2620
2654
|
const EvaluateActionsDocument = gql`
|
|
2621
2655
|
query EvaluateActions(
|
|
@@ -2688,14 +2722,23 @@ const MutateDocumentAsyncDocument = gql`
|
|
|
2688
2722
|
actions: $actions
|
|
2689
2723
|
branch: $branch
|
|
2690
2724
|
) {
|
|
2691
|
-
|
|
2692
|
-
status
|
|
2693
|
-
result
|
|
2694
|
-
error
|
|
2695
|
-
createdAt
|
|
2696
|
-
completedAt
|
|
2725
|
+
...JobInfoFields
|
|
2697
2726
|
}
|
|
2698
2727
|
}
|
|
2728
|
+
${JobInfoFieldsFragmentDoc}
|
|
2729
|
+
`;
|
|
2730
|
+
const ExecuteBatchDocument = gql`
|
|
2731
|
+
mutation ExecuteBatch($jobs: [ExecutionJobInput!]!) {
|
|
2732
|
+
executeBatch(jobs: $jobs) {
|
|
2733
|
+
jobs {
|
|
2734
|
+
key
|
|
2735
|
+
job {
|
|
2736
|
+
...JobInfoFields
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2741
|
+
${JobInfoFieldsFragmentDoc}
|
|
2699
2742
|
`;
|
|
2700
2743
|
const RenameDocumentDocument = gql`
|
|
2701
2744
|
mutation RenameDocument(
|
|
@@ -2998,6 +3041,9 @@ function getSdk(requester) {
|
|
|
2998
3041
|
MutateDocumentAsync(variables, options) {
|
|
2999
3042
|
return requester(MutateDocumentAsyncDocument, variables, options);
|
|
3000
3043
|
},
|
|
3044
|
+
ExecuteBatch(variables, options) {
|
|
3045
|
+
return requester(ExecuteBatchDocument, variables, options);
|
|
3046
|
+
},
|
|
3001
3047
|
RenameDocument(variables, options) {
|
|
3002
3048
|
return requester(RenameDocumentDocument, variables, options);
|
|
3003
3049
|
},
|
|
@@ -3124,6 +3170,8 @@ function toGqlPhDocument(doc) {
|
|
|
3124
3170
|
documentType: doc.header.documentType,
|
|
3125
3171
|
slug: doc.header.slug,
|
|
3126
3172
|
preferredEditor: doc.header.meta?.preferredEditor ?? null,
|
|
3173
|
+
meta: doc.header.meta ?? null,
|
|
3174
|
+
protocolVersions: doc.header.protocolVersions ?? null,
|
|
3127
3175
|
createdAtUtcIso: doc.header.createdAtUtcIso,
|
|
3128
3176
|
lastModifiedAtUtcIso: doc.header.lastModifiedAtUtcIso,
|
|
3129
3177
|
revisionsList,
|
|
@@ -3136,11 +3184,27 @@ function toGqlPhDocument(doc) {
|
|
|
3136
3184
|
function toGqlJobInfo(job) {
|
|
3137
3185
|
return {
|
|
3138
3186
|
id: job.id,
|
|
3187
|
+
documentId: job.documentId,
|
|
3139
3188
|
status: job.status,
|
|
3140
3189
|
createdAt: job.createdAtUtcIso,
|
|
3141
3190
|
completedAt: job.completedAtUtcIso ?? null,
|
|
3142
3191
|
error: job.error?.message ?? null,
|
|
3143
|
-
|
|
3192
|
+
errorName: job.error?.name ?? null,
|
|
3193
|
+
result: job.result ?? null,
|
|
3194
|
+
consistencyToken: {
|
|
3195
|
+
version: job.consistencyToken.version,
|
|
3196
|
+
createdAtUtcIso: job.consistencyToken.createdAtUtcIso,
|
|
3197
|
+
coordinates: job.consistencyToken.coordinates.map((coordinate) => ({
|
|
3198
|
+
documentId: coordinate.documentId,
|
|
3199
|
+
scope: coordinate.scope,
|
|
3200
|
+
branch: coordinate.branch,
|
|
3201
|
+
operationIndex: coordinate.operationIndex
|
|
3202
|
+
}))
|
|
3203
|
+
},
|
|
3204
|
+
meta: {
|
|
3205
|
+
batchId: job.meta.batchId,
|
|
3206
|
+
batchJobIds: [...job.meta.batchJobIds]
|
|
3207
|
+
}
|
|
3144
3208
|
};
|
|
3145
3209
|
}
|
|
3146
3210
|
/**
|
|
@@ -3678,7 +3742,7 @@ function unknownJob(jobId) {
|
|
|
3678
3742
|
}
|
|
3679
3743
|
};
|
|
3680
3744
|
}
|
|
3681
|
-
async function jobStatus(reactorClient, args, serves) {
|
|
3745
|
+
async function jobStatus(reactorClient, args, serves, readable = serves) {
|
|
3682
3746
|
let result;
|
|
3683
3747
|
try {
|
|
3684
3748
|
result = await reactorClient.getJobStatus(args.jobId);
|
|
@@ -3686,6 +3750,15 @@ async function jobStatus(reactorClient, args, serves) {
|
|
|
3686
3750
|
throw new GraphQLError(`Failed to fetch job status: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
3687
3751
|
}
|
|
3688
3752
|
if (!await serves(result.documentId)) result = unknownJob(args.jobId);
|
|
3753
|
+
const coordinates = [];
|
|
3754
|
+
for (const coordinate of result.consistencyToken.coordinates) if (await readable(coordinate.documentId)) coordinates.push(coordinate);
|
|
3755
|
+
result = {
|
|
3756
|
+
...result,
|
|
3757
|
+
consistencyToken: {
|
|
3758
|
+
...result.consistencyToken,
|
|
3759
|
+
coordinates
|
|
3760
|
+
}
|
|
3761
|
+
};
|
|
3689
3762
|
try {
|
|
3690
3763
|
return toGqlJobInfo(result);
|
|
3691
3764
|
} catch (error) {
|
|
@@ -3913,6 +3986,88 @@ async function executeAsync(reactorClient, args) {
|
|
|
3913
3986
|
}
|
|
3914
3987
|
return toGqlJobInfo(job);
|
|
3915
3988
|
}
|
|
3989
|
+
/** Authorized as a create, so only createDocument's own shape is accepted. */
|
|
3990
|
+
function batchCreationOf(jobs) {
|
|
3991
|
+
const creating = jobs.filter((job) => job.actions.some((action) => action.type === "CREATE_DOCUMENT"));
|
|
3992
|
+
if (creating.length === 0) return;
|
|
3993
|
+
if (jobs.length > 1) throw new GraphQLError("A job that creates a document must be the only job in its batch");
|
|
3994
|
+
const [job] = creating;
|
|
3995
|
+
const [first, ...rest] = job.actions;
|
|
3996
|
+
if (first.type !== "CREATE_DOCUMENT") throw new GraphQLError("CREATE_DOCUMENT must be the first action of its job");
|
|
3997
|
+
const input = first.input;
|
|
3998
|
+
if (typeof input.documentId !== "string" || typeof input.model !== "string") throw new GraphQLError("CREATE_DOCUMENT input needs a documentId and model");
|
|
3999
|
+
const newId = input.documentId;
|
|
4000
|
+
if (newId !== job.documentIdOrSlug) throw new GraphQLError(`CREATE_DOCUMENT names "${newId}" but its job targets "${job.documentIdOrSlug}"`);
|
|
4001
|
+
const linkedFrom = /* @__PURE__ */ new Set();
|
|
4002
|
+
for (const action of rest) {
|
|
4003
|
+
const actionInput = action.input;
|
|
4004
|
+
if (action.type === "UPGRADE_DOCUMENT" && actionInput.documentId === newId) continue;
|
|
4005
|
+
if (action.type === "ADD_RELATIONSHIP" && actionInput.targetId === newId && typeof actionInput.sourceId === "string" && actionInput.sourceId !== newId) {
|
|
4006
|
+
linkedFrom.add(actionInput.sourceId);
|
|
4007
|
+
continue;
|
|
4008
|
+
}
|
|
4009
|
+
throw new GraphQLError(`A create job may only upgrade the new document and link it under parents; ${action.type} is not allowed`);
|
|
4010
|
+
}
|
|
4011
|
+
return {
|
|
4012
|
+
documentId: input.documentId,
|
|
4013
|
+
documentType: input.model,
|
|
4014
|
+
linkedFrom: [...linkedFrom]
|
|
4015
|
+
};
|
|
4016
|
+
}
|
|
4017
|
+
/**
|
|
4018
|
+
* Runs multiple mutation jobs in dependency order, waits for every one to
|
|
4019
|
+
* settle, and returns each job's final state keyed by plan key.
|
|
4020
|
+
*
|
|
4021
|
+
* Not atomic: each job commits on its own and a failed job still releases its
|
|
4022
|
+
* dependents, so a failure is reported per job as a FAILED entry rather than a
|
|
4023
|
+
* thrown error, which would lose what did commit.
|
|
4024
|
+
*/
|
|
4025
|
+
async function executeBatch(reactorClient, args) {
|
|
4026
|
+
const jobs = args.jobs.map((job) => ({
|
|
4027
|
+
key: job.key,
|
|
4028
|
+
documentId: job.documentIdOrSlug,
|
|
4029
|
+
scope: job.scope,
|
|
4030
|
+
branch: fromInputMaybe(job.branch) ?? DEFAULT_BRANCH,
|
|
4031
|
+
actions: toSubmittableActions(job.actions),
|
|
4032
|
+
dependsOn: [...job.dependsOn]
|
|
4033
|
+
}));
|
|
4034
|
+
let outcome;
|
|
4035
|
+
try {
|
|
4036
|
+
outcome = await reactorClient.executeBatch({ jobs });
|
|
4037
|
+
} catch (error) {
|
|
4038
|
+
if (!BatchJobFailedError.isError(error)) {
|
|
4039
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
4040
|
+
throw new GraphQLError(`Failed to execute batch: ${message}. Jobs dispatched before the failure may have committed.`);
|
|
4041
|
+
}
|
|
4042
|
+
outcome = error;
|
|
4043
|
+
}
|
|
4044
|
+
const settled = BatchJobFailedError.isError(outcome) ? outcome.jobs : await readBackJobs(reactorClient, jobs, outcome);
|
|
4045
|
+
try {
|
|
4046
|
+
return { jobs: jobs.map((job) => {
|
|
4047
|
+
if (!Object.hasOwn(settled, job.key)) throw new Error(`no job came back for plan key "${job.key}"`);
|
|
4048
|
+
return {
|
|
4049
|
+
key: job.key,
|
|
4050
|
+
job: toGqlJobInfo(settled[job.key])
|
|
4051
|
+
};
|
|
4052
|
+
}) };
|
|
4053
|
+
} catch (error) {
|
|
4054
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
4055
|
+
throw new GraphQLError(`Failed to convert batch result to GraphQL: ${message}`);
|
|
4056
|
+
}
|
|
4057
|
+
}
|
|
4058
|
+
/** The client hands back submission receipts; read each job's final state. */
|
|
4059
|
+
async function readBackJobs(reactorClient, jobs, result) {
|
|
4060
|
+
const entries = await Promise.all(jobs.map(async (job) => {
|
|
4061
|
+
if (!Object.hasOwn(result.jobs, job.key)) throw new GraphQLError(`Batch result is missing plan key "${job.key}"; the reactor returned jobs for [${Object.keys(result.jobs).join(", ")}]`);
|
|
4062
|
+
try {
|
|
4063
|
+
return [job.key, await reactorClient.getJobStatus(result.jobs[job.key].id)];
|
|
4064
|
+
} catch (error) {
|
|
4065
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
4066
|
+
throw new GraphQLError(`Failed to read batch job status: ${message}`);
|
|
4067
|
+
}
|
|
4068
|
+
}));
|
|
4069
|
+
return Object.fromEntries(entries);
|
|
4070
|
+
}
|
|
3916
4071
|
async function mutateDocument(reactorClient, args, subject) {
|
|
3917
4072
|
let validatedActions;
|
|
3918
4073
|
try {
|
|
@@ -5773,14 +5928,36 @@ const MoveRelationshipResultDTO = z.object({
|
|
|
5773
5928
|
source: PHDocumentDTO,
|
|
5774
5929
|
target: PHDocumentDTO
|
|
5775
5930
|
}).strip();
|
|
5776
|
-
const
|
|
5931
|
+
const ConsistencyTokenDTO = z.object({
|
|
5932
|
+
version: z.number().int(),
|
|
5933
|
+
createdAtUtcIso: z.string(),
|
|
5934
|
+
coordinates: z.array(z.object({
|
|
5935
|
+
documentId: z.string(),
|
|
5936
|
+
scope: z.string(),
|
|
5937
|
+
branch: z.string(),
|
|
5938
|
+
operationIndex: z.number().int()
|
|
5939
|
+
}).strip())
|
|
5940
|
+
}).strip();
|
|
5941
|
+
const JobInfoFieldsDTO = z.object({
|
|
5777
5942
|
id: z.string(),
|
|
5778
5943
|
status: z.string(),
|
|
5779
5944
|
result: JSONObjectDTO.nullable().optional(),
|
|
5780
5945
|
error: z.string().nullable().optional(),
|
|
5781
5946
|
createdAt: DateTimeDTO,
|
|
5782
5947
|
completedAt: DateTimeDTO.nullable().optional()
|
|
5948
|
+
}).strip().extend({
|
|
5949
|
+
documentId: z.string(),
|
|
5950
|
+
errorName: z.string().nullable().optional(),
|
|
5951
|
+
consistencyToken: ConsistencyTokenDTO,
|
|
5952
|
+
meta: z.object({
|
|
5953
|
+
batchId: z.string(),
|
|
5954
|
+
batchJobIds: z.array(z.string())
|
|
5955
|
+
}).strip()
|
|
5783
5956
|
}).strip();
|
|
5957
|
+
const BatchExecutionResultDTO = z.object({ jobs: z.array(z.object({
|
|
5958
|
+
key: z.string(),
|
|
5959
|
+
job: JobInfoFieldsDTO
|
|
5960
|
+
}).strip()) }).strip();
|
|
5784
5961
|
const ActionSignerUserDTO = z.object({
|
|
5785
5962
|
address: z.string(),
|
|
5786
5963
|
networkId: z.string(),
|
|
@@ -5880,7 +6057,7 @@ const operationValidators = {
|
|
|
5880
6057
|
if (data.documentOperations) OperationResultPageDTO.parse(data.documentOperations);
|
|
5881
6058
|
},
|
|
5882
6059
|
GetJobStatus: (data) => {
|
|
5883
|
-
if (data.jobStatus)
|
|
6060
|
+
if (data.jobStatus) JobInfoFieldsDTO.parse(data.jobStatus);
|
|
5884
6061
|
},
|
|
5885
6062
|
EvaluateActions: (data) => {
|
|
5886
6063
|
if (data.evaluateActions) ActionEvaluationsDTO.parse(data.evaluateActions);
|
|
@@ -5894,6 +6071,9 @@ const operationValidators = {
|
|
|
5894
6071
|
MutateDocument: (data) => {
|
|
5895
6072
|
if (data.mutateDocument) PHDocumentDTO.parse(data.mutateDocument);
|
|
5896
6073
|
},
|
|
6074
|
+
ExecuteBatch: (data) => {
|
|
6075
|
+
if (data.executeBatch) BatchExecutionResultDTO.parse(data.executeBatch);
|
|
6076
|
+
},
|
|
5897
6077
|
MutateDocumentAsync: (data) => {
|
|
5898
6078
|
if (data.mutateDocumentAsync) {}
|
|
5899
6079
|
},
|
|
@@ -5950,7 +6130,7 @@ function createReactorGraphQLClient(url, fetchImpl = fetch, headers) {
|
|
|
5950
6130
|
}
|
|
5951
6131
|
//#endregion
|
|
5952
6132
|
//#region src/graphql/reactor/schema.graphql
|
|
5953
|
-
var schema_default = "# Scalar types (for codegen - also defined in create-schema.ts)\nscalar JSONObject\nscalar DateTime\n\n# Input types\ninput PagingInput {\n limit: Int\n offset: Int\n cursor: String\n}\n\ninput ViewFilterInput {\n branch: String\n scopes: [String!]\n}\n\ninput SearchFilterInput {\n type: String\n parentId: String\n identifiers: [String!]\n @deprecated(reason: \"Ignored. Filter by type or parentId.\")\n}\n\ninput OperationsFilterInput {\n documentIdOrSlug: String\n documentId: String @deprecated(reason: \"Use documentIdOrSlug.\")\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\ninput DocumentOperationsFilterInput {\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\n# Enums\nenum PropagationMode {\n CASCADE\n ORPHAN\n}\n\nenum DocumentChangeType {\n CREATED\n DELETED\n UPDATED\n PARENT_ADDED\n PARENT_REMOVED\n CHILD_ADDED\n CHILD_REMOVED\n}\n\n# Object types\ntype DocumentModelGlobalState {\n id: String!\n name: String!\n namespace: String\n version: String\n specification: JSONObject!\n}\n\ntype DocumentModelResultPage {\n items: [DocumentModelGlobalState!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype Revision {\n scope: String!\n revision: Int!\n}\n\ntype PHDocument {\n id: String!\n slug: String\n preferredEditor: String\n name: String!\n documentType: String!\n state: JSONObject!\n revisionsList: [Revision!]!\n createdAtUtcIso: DateTime!\n lastModifiedAtUtcIso: DateTime!\n operations(\n filter: DocumentOperationsFilterInput\n paging: PagingInput\n ): ReactorOperationResultPage\n}\n\ntype PHDocumentResultPage {\n items: [PHDocument!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\n# A directed edge between two documents, with the metadata recorded against it.\ntype DocumentRelationship {\n sourceId: String!\n targetId: String!\n relationshipType: String!\n metadata: JSONObject\n createdAt: DateTime!\n updatedAt: DateTime!\n}\n\ntype DocumentRelationshipResultPage {\n items: [DocumentRelationship!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype ReactorOperationResultPage {\n items: [ReactorOperation!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype DeadLetterInfo {\n documentId: String!\n error: String!\n \"\"\"\n How the origin classified the failure. A peer needs this to mirror the origin's\n quarantine decision; without it a held auth operation would freeze the document\n on the peer side while the origin kept syncing.\n \"\"\"\n errorType: String\n jobId: String!\n branch: String!\n scopes: [String!]!\n operationCount: Int!\n}\n\ntype PollSyncEnvelopesResult {\n envelopes: [SyncEnvelope!]!\n ackOrdinal: Int!\n deadLetters: [DeadLetterInfo!]!\n hasMore: Boolean!\n # The server's current manifest revision\n manifestRevision: String\n # The client's manifest revision as the server holds it\n peerManifestRevision: String\n}\n\ntype SyncHoldReason {\n protocol: String!\n version: Int!\n peerSupports: [Int!]!\n}\n\n# A document held back from a remote whose peer cannot run its versions\ntype SyncHold {\n remoteName: String!\n documentId: String!\n branch: String!\n reason: SyncHoldReason!\n heldAtUtcMs: String!\n}\n\ntype PeerAgreementMember {\n remoteName: String!\n # False for a peer that announced nothing: it gets the baselines\n announced: Boolean!\n protocols: JSONObject!\n features: JSONObject!\n}\n\ntype PeerAgreementLimit {\n protocol: String!\n # The remotes whose peers lack the version new documents would take\n remoteNames: [String!]!\n}\n\ntype PeerAgreement {\n collectionId: String!\n local: JSONObject!\n members: [PeerAgreementMember!]!\n limitedBy: [PeerAgreementLimit!]!\n}\n\ntype DocumentWithChildren {\n document: PHDocument!\n childIds: [String!]!\n}\n\ntype MoveRelationshipResult {\n source: PHDocument!\n target: PHDocument!\n}\n\ntype JobInfo {\n id: String!\n status: String!\n\n \"\"\"\n What the job produced, once it has produced anything. Null until then, which\n is the state every job is in when it is handed back from a submission.\n \"\"\"\n result: JSONObject\n\n error: String\n createdAt: DateTime!\n completedAt: DateTime\n}\n\ntype DocumentChangeEvent {\n type: DocumentChangeType!\n documents: [PHDocument!]!\n context: DocumentChangeContext\n}\n\ntype DocumentChangeContext {\n parentId: String\n childId: String\n}\n\ntype JobChangeEvent {\n jobId: String!\n status: String!\n\n \"\"\"\n What the job produced, once it has produced anything. Nullable for the same\n reason as `JobInfo.result`: a job that has not written yet has produced\n nothing, and an empty object would claim otherwise.\n \"\"\"\n result: JSONObject\n\n error: String\n}\n\ntype ReactorSignerUser {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ntype ReactorSignerApp {\n name: String!\n key: String!\n}\n\ntype ReactorSigner {\n user: ReactorSignerUser\n app: ReactorSignerApp\n signatures: [String!]!\n}\n\ntype ActionContext {\n signer: ReactorSigner\n}\n\ntype Action {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContext\n}\n\n\"\"\"\nOne operation an authorization preflight predicts a verdict for.\n\n`input` is what a conditional grant reads, so a candidate standing for a\nfilled-in form carries that form's input. Omitting it predicts the verdict an\nempty input earns, not the verdict the filled-in form will get.\n\"\"\"\ninput ActionCandidateInput {\n scope: String!\n type: String!\n input: JSONObject\n}\n\nenum AuthDecision {\n ALLOW\n DENY\n}\n\n\"\"\"\nOne candidate's predicted verdict. `reason` carries the refusal a DENY is\nrecorded with, and is null on an ALLOW.\n\"\"\"\ntype ActionEvaluation {\n decision: AuthDecision!\n reason: String\n}\n\n\"\"\"\nThe predicted verdicts for a set of candidates, in the order they were given,\nwith the aggregates a caller branches on.\n\nThe aggregates are redundant -- a verdict is binary -- and all four are returned\nso a caller reads the one its question is phrased in rather than negating\nanother. Over no candidates every aggregate is false: nothing is allowed and\nnothing is denied.\n\"\"\"\ntype ActionEvaluations {\n evaluations: [ActionEvaluation!]!\n allAllowed: Boolean!\n anyAllowed: Boolean!\n allDenied: Boolean!\n anyDenied: Boolean!\n}\n\n# Input types for sync operations\n\"\"\"\nAn action's context, as a caller submits it.\n\nDeclares every field `ActionContext` carries, because an input object rejects a\nfield it does not declare: an action stamped with the head it applies to - which\nis what a signing client sends - is refused outright if these are missing, and\nthat refusal is a whole-request one, not a per-field one.\n\n`prevOpHash` and `prevOpIndex` are the scope head the action was composed\nagainst. They are recorded rather than enforced; a signature is verified from\nthe params carried in its own tuple, which do not include them.\n\"\"\"\ninput ActionContextInput {\n \"\"\"\n The index of the last operation in the scope the action applies to.\n \"\"\"\n prevOpIndex: Int\n\n \"\"\"\n The hash of the state the action applies to.\n \"\"\"\n prevOpHash: String\n\n \"\"\"\n Covers replay of an operation that would otherwise be a no-op.\n \"\"\"\n nonce: String\n\n signer: ReactorSignerInput\n}\n\ninput ReactorSignerInput {\n user: ReactorSignerUserInput\n app: ReactorSignerAppInput\n signatures: [String!]!\n}\n\ninput ReactorSignerUserInput {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ninput ReactorSignerAppInput {\n name: String!\n key: String!\n}\n\ninput ActionInput {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContextInput\n}\n\n# Synchronization types\ntype ReactorOperation {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: Action!\n}\n\ninput OperationInput {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: ActionInput!\n}\n\ntype OperationContext {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ninput OperationContextInput {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ntype OperationWithContext {\n operation: ReactorOperation!\n context: OperationContext!\n}\n\ninput OperationWithContextInput {\n operation: OperationInput!\n context: OperationContextInput!\n}\n\ntype ChannelMeta {\n id: String!\n}\n\ninput ChannelMetaInput {\n id: String!\n}\n\ntype RemoteCursor {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\ninput RemoteCursorInput {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\nenum SyncEnvelopeType {\n OPERATIONS\n ACK\n}\n\ntype SyncEnvelope {\n type: SyncEnvelopeType!\n channelMeta: ChannelMeta!\n operations: [OperationWithContext!]\n cursor: RemoteCursor\n key: String\n dependsOn: [String!]\n}\n\ninput SyncEnvelopeInput {\n type: SyncEnvelopeType!\n channelMeta: ChannelMetaInput!\n operations: [OperationWithContextInput!]\n cursor: RemoteCursorInput\n key: String\n dependsOn: [String!]\n}\n\ninput RemoteFilterInput {\n documentId: [String!]!\n scope: [String!]!\n branch: String!\n}\n\ninput SyncRefusalInput {\n documentId: String!\n branch: String!\n # \"marker\" for a refused purge marker; absent for UNSUPPORTED_PROTOCOL\n kind: String\n}\n\ninput TouchChannelInput {\n id: String!\n name: String!\n collectionId: String!\n filter: RemoteFilterInput!\n sinceTimestampUtcMs: String!\n # The client's peer manifest; absent from a client without peer agreement\n manifest: JSONObject\n}\n\ntype TouchChannelResult {\n success: Boolean!\n ackOrdinal: Int!\n # The server's peer manifest\n manifest: JSONObject\n}\n\ntype Query {\n # Get document models for a namespace\n documentModels(\n namespace: String\n paging: PagingInput\n ): DocumentModelResultPage!\n\n # Get a specific document by ID or slug\n document(\n idOrSlug: String\n identifier: String @deprecated(reason: \"Use idOrSlug.\")\n view: ViewFilterInput\n ): DocumentWithChildren\n\n # Get outgoing relationships of a given type from a source document\n documentOutgoingRelationships(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get incoming relationships of a given type to a target document\n documentIncomingRelationships(\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get the outgoing relationship edges of a source document. Unlike\n # documentOutgoingRelationships, which returns the documents at the far end,\n # this returns the edges themselves, carrying their metadata and timestamps.\n # Omit relationshipType to return edges of every type.\n documentOutgoingRelationshipEdges(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n relationshipType: String\n view: ViewFilterInput\n paging: PagingInput\n ): DocumentRelationshipResultPage!\n\n # Get the incoming relationship edges of a target document. Unlike\n # documentIncomingRelationships, which returns the documents at the far end,\n # this returns the edges themselves, carrying their metadata and timestamps.\n # Omit relationshipType to return edges of every type.\n documentIncomingRelationshipEdges(\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String\n view: ViewFilterInput\n paging: PagingInput\n ): DocumentRelationshipResultPage!\n\n # Find documents by search criteria\n findDocuments(\n search: SearchFilterInput\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get job status\n jobStatus(jobId: String!): JobInfo\n\n # Get operations for a document with filtering and pagination\n documentOperations(\n filter: OperationsFilterInput!\n paging: PagingInput\n ): ReactorOperationResultPage!\n\n \"\"\"\n Predicts whether the calling subject would be admitted to execute each of a\n set of candidate operations, without submitting any of them. A UI asks this to\n disable a control rather than offer an action that fails on submit.\n\n The answer is a prediction, not a promise:\n\n - Real admission compiles an append condition over everything it read and the\n store enforces it at write time. A preflight reads no future, so a policy\n change landing between this answer and the submit changes the verdict. The\n submit path stays the only authority.\n - The verdict is evaluated at the stream heads, so it is correct for a\n candidate about to be submitted. A backdated submission is out of contract;\n the reactor decides that one by position.\n - A candidate whose verdict depends on its input has to carry that input, since\n a conditional grant reads it.\n\n The subject is the authenticated caller and cannot be named in the request:\n answering for an arbitrary subject would disclose what a policy grants\n somebody else. It carries both the caller's address and the did:key of the app\n instance whose token authenticated the request, so a policy naming either\n matches the same principal the write path presents.\n\n Requires the reactor's authEnforcement feature flag. Without it the reactor\n holds no decision model, so this fails with extensions.code\n AUTH_EVALUATION_UNSUPPORTED rather than guessing.\n \"\"\"\n evaluateActions(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n branch: String\n candidates: [ActionCandidateInput!]!\n ): ActionEvaluations!\n\n \"\"\"\n Polls for sync envelopes from a channel.\n\n An operation stored before the API required an action id cannot be\n represented by this schema, and rather than serving a partial response beside\n a bare non-null violation, this fails with extensions.code\n MALFORMED_STORED_OPERATION naming the operation. That code means the failure\n is worth polling through: the document holding the operation needs repairing,\n but the channel serves every other document, and a peer that stopped polling\n would stop receiving those too.\n \"\"\"\n pollSyncEnvelopes(\n channelId: String!\n outboxAck: Int!\n outboxLatest: Int!\n # The client's manifest revision; absent from a client without peer agreement\n manifestRevision: String\n # Documents the client refused from earlier polls: held, or a refused marker\n refusals: [SyncRefusalInput!]\n ): PollSyncEnvelopesResult!\n\n # Supreme admin, or the address the named remote's channel is bound to\n syncHolds(remoteName: String, documentId: String): [SyncHold!]!\n\n # Supreme admin, or an address bound to a channel in the collection\n peerAgreement(collectionId: String!): PeerAgreement!\n}\n\ntype Mutation {\n # Create a new document\n createDocument(\n document: JSONObject!\n parentIdOrSlug: String\n parentIdentifier: String @deprecated(reason: \"Use parentIdOrSlug.\")\n ): PHDocument!\n\n # Create an empty document of specified type\n createEmptyDocument(\n documentType: String!\n parentIdOrSlug: String\n parentIdentifier: String @deprecated(reason: \"Use parentIdOrSlug.\")\n ): PHDocument!\n\n \"\"\"\n Applies actions to a document and waits for the result.\n\n Each action is coerced against `ActionInput`, so one missing a field the wire\n declares is refused before any work starts. The id in particular: it is hashed\n into the operation id and replay dedupes by it, so an action without one is\n stored under an operation id shared by every id-less operation on the same\n document, scope and branch.\n\n Named for `IReactorClient.execute`, which this is the wire form of. `branch`\n defaults to `main`.\n \"\"\"\n execute(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n actions: [ActionInput!]!\n branch: String\n ): PHDocument!\n\n \"\"\"\n Submits actions to a document and returns the job that will apply them.\n\n Coerced exactly as `execute` is, so a malformed action is refused here rather\n than surfacing later as a failed job. Returns the job rather than only its id,\n so a caller has the status and the creation time it would otherwise have to\n ask for; `result` is null until the job produces one.\n \"\"\"\n executeAsync(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n actions: [ActionInput!]!\n branch: String\n ): JobInfo!\n\n # Apply actions to a document (synchronous)\n mutateDocument(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): PHDocument!\n @deprecated(\n reason: \"Use execute. Actions here are untyped, so a malformed one is refused by a hand-written check rather than by the schema, and `view.scopes` is accepted but ignored.\"\n )\n\n # Submit actions to a document (asynchronous)\n mutateDocumentAsync(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): String!\n @deprecated(\n reason: \"Use executeAsync, which is typed and returns the job rather than only its id.\"\n )\n\n # Rename a document\n renameDocument(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n name: String!\n branch: String\n ): PHDocument!\n\n # Update the preferred editor recorded in the document header meta.\n # Pass null/omit to clear it.\n setPreferredEditor(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n preferredEditor: String\n branch: String\n ): PHDocument!\n\n # Add a relationship between two documents. Adding one that already exists is\n # a no-op, metadata included -- use updateRelationship to change an edge.\n addRelationship(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n metadata: JSONObject\n branch: String\n ): PHDocument!\n\n # Replace the metadata of an existing relationship, preserving its createdAt.\n # Omitting metadata, or passing null, clears it.\n updateRelationship(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n metadata: JSONObject\n branch: String\n ): PHDocument!\n\n # Remove a relationship between two documents\n removeRelationship(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n branch: String\n ): PHDocument!\n\n # Move a relationship from one source to another\n moveRelationship(\n sourceParentIdOrSlug: String\n sourceParentIdentifier: String\n @deprecated(reason: \"Use sourceParentIdOrSlug.\")\n targetParentIdOrSlug: String\n targetParentIdentifier: String\n @deprecated(reason: \"Use targetParentIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n branch: String\n ): MoveRelationshipResult!\n\n # Delete a single document\n deleteDocument(\n idOrSlug: String\n identifier: String @deprecated(reason: \"Use idOrSlug.\")\n propagate: PropagationMode\n ): Boolean!\n\n # Delete multiple documents\n deleteDocuments(\n idsOrSlugs: [String!]\n identifiers: [String!] @deprecated(reason: \"Use idsOrSlugs.\")\n propagate: PropagationMode\n ): Boolean!\n\n # Touch (create or update) a channel for sync\n touchChannel(input: TouchChannelInput!): TouchChannelResult!\n\n # Push sync envelopes to a channel\n pushSyncEnvelopes(\n envelopes: [SyncEnvelopeInput!]!\n # The server's manifest revision the client gated these envelopes under\n peerManifestRevision: String\n ): Boolean!\n}\n\ntype Subscription {\n # Subscribe to document changes\n documentChanges(\n search: SearchFilterInput\n view: ViewFilterInput\n ): DocumentChangeEvent!\n\n # Subscribe to job changes\n jobChanges(jobId: String!): JobChangeEvent!\n}\n";
|
|
6133
|
+
var schema_default = "# Scalar types (for codegen - also defined in create-schema.ts)\nscalar JSONObject\nscalar DateTime\n\n# Input types\ninput PagingInput {\n limit: Int\n offset: Int\n cursor: String\n}\n\ninput ViewFilterInput {\n branch: String\n scopes: [String!]\n}\n\ninput SearchFilterInput {\n type: String\n parentId: String\n identifiers: [String!]\n @deprecated(reason: \"Ignored. Filter by type or parentId.\")\n}\n\ninput OperationsFilterInput {\n documentIdOrSlug: String\n documentId: String @deprecated(reason: \"Use documentIdOrSlug.\")\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\ninput DocumentOperationsFilterInput {\n branch: String\n scopes: [String!]\n actionTypes: [String!]\n sinceRevision: Int\n timestampFrom: String\n timestampTo: String\n}\n\n# Enums\nenum PropagationMode {\n CASCADE\n ORPHAN\n}\n\nenum DocumentChangeType {\n CREATED\n DELETED\n UPDATED\n PARENT_ADDED\n PARENT_REMOVED\n CHILD_ADDED\n CHILD_REMOVED\n}\n\n# Object types\ntype DocumentModelGlobalState {\n id: String!\n name: String!\n namespace: String\n version: String\n specification: JSONObject!\n}\n\ntype DocumentModelResultPage {\n items: [DocumentModelGlobalState!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype Revision {\n scope: String!\n revision: Int!\n}\n\ntype PHDocument {\n id: String!\n slug: String\n preferredEditor: String\n meta: JSONObject\n protocolVersions: JSONObject\n name: String!\n documentType: String!\n state: JSONObject!\n revisionsList: [Revision!]!\n createdAtUtcIso: DateTime!\n lastModifiedAtUtcIso: DateTime!\n operations(\n filter: DocumentOperationsFilterInput\n paging: PagingInput\n ): ReactorOperationResultPage\n}\n\ntype PHDocumentResultPage {\n items: [PHDocument!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\n# A directed edge between two documents, with the metadata recorded against it.\ntype DocumentRelationship {\n sourceId: String!\n targetId: String!\n relationshipType: String!\n metadata: JSONObject\n createdAt: DateTime!\n updatedAt: DateTime!\n}\n\ntype DocumentRelationshipResultPage {\n items: [DocumentRelationship!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype ReactorOperationResultPage {\n items: [ReactorOperation!]!\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n cursor: String\n}\n\ntype DeadLetterInfo {\n documentId: String!\n error: String!\n \"\"\"\n How the origin classified the failure. A peer needs this to mirror the origin's\n quarantine decision; without it a held auth operation would freeze the document\n on the peer side while the origin kept syncing.\n \"\"\"\n errorType: String\n jobId: String!\n branch: String!\n scopes: [String!]!\n operationCount: Int!\n}\n\ntype PollSyncEnvelopesResult {\n envelopes: [SyncEnvelope!]!\n ackOrdinal: Int!\n deadLetters: [DeadLetterInfo!]!\n hasMore: Boolean!\n # The server's current manifest revision\n manifestRevision: String\n # The client's manifest revision as the server holds it\n peerManifestRevision: String\n}\n\ntype SyncHoldReason {\n protocol: String!\n version: Int!\n peerSupports: [Int!]!\n}\n\n# A document held back from a remote whose peer cannot run its versions\ntype SyncHold {\n remoteName: String!\n documentId: String!\n branch: String!\n reason: SyncHoldReason!\n heldAtUtcMs: String!\n}\n\ntype PeerAgreementMember {\n remoteName: String!\n # False for a peer that announced nothing: it gets the baselines\n announced: Boolean!\n protocols: JSONObject!\n features: JSONObject!\n}\n\ntype PeerAgreementLimit {\n protocol: String!\n # The remotes whose peers lack the version new documents would take\n remoteNames: [String!]!\n}\n\ntype PeerAgreement {\n collectionId: String!\n local: JSONObject!\n members: [PeerAgreementMember!]!\n limitedBy: [PeerAgreementLimit!]!\n}\n\ntype DocumentWithChildren {\n document: PHDocument!\n childIds: [String!]!\n}\n\ntype MoveRelationshipResult {\n source: PHDocument!\n target: PHDocument!\n}\n\ntype ConsistencyCoordinate {\n documentId: String!\n scope: String!\n branch: String!\n operationIndex: Int!\n}\n\n\"\"\"\nThe write positions a job reached, for read-after-write. Only meaningful once\nthe job has completed.\n\"\"\"\ntype ConsistencyToken {\n version: Int!\n createdAtUtcIso: String!\n coordinates: [ConsistencyCoordinate!]!\n}\n\n\"The batch a job was submitted in.\"\ntype JobBatchMeta {\n batchId: String!\n batchJobIds: [String!]!\n}\n\ntype JobInfo {\n id: String!\n\n \"\"\"\n The document the job operates on. Empty for a job this server does not know,\n which then comes back FAILED with \"Job not found\".\n \"\"\"\n documentId: String!\n status: String!\n\n \"\"\"\n What the job produced, once it has produced anything. Null until then, which\n is the state every job is in when it is handed back from a submission.\n \"\"\"\n result: JSONObject\n\n error: String\n\n \"The error's class name, such as `DocumentAlreadyExistsError`, when it failed.\"\n errorName: String\n createdAt: DateTime!\n completedAt: DateTime\n consistencyToken: ConsistencyToken!\n meta: JobBatchMeta!\n}\n\n\"\"\"\nOne job's outcome within a batch, pairing the plan key the caller gave with the\njob that applied it. Mirrors one entry of the `Record<string, JobInfo>` that\n`IReactor.executeBatch` returns (packages/reactor/src/core/types.ts).\n\"\"\"\ntype BatchJobResult {\n key: String!\n job: JobInfo!\n}\n\n\"\"\"\nThe outcome of a batch mutation, one entry per job the request named. The wire\nshape of `BatchExecutionResult` (`{ jobs }`), keyed on each entry by the plan\nkey rather than by position so the client can rebuild the record. The batch is\nnot atomic: each job commits on its own and a failed job releases its\ndependents, so each entry's status says what happened to that job, and\nre-submitting re-applies the jobs that succeeded.\n\"\"\"\ntype BatchExecutionResult {\n jobs: [BatchJobResult!]!\n}\n\ntype DocumentChangeEvent {\n type: DocumentChangeType!\n documents: [PHDocument!]!\n context: DocumentChangeContext\n}\n\ntype DocumentChangeContext {\n parentId: String\n childId: String\n}\n\ntype JobChangeEvent {\n jobId: String!\n status: String!\n\n \"\"\"\n What the job produced, once it has produced anything. Nullable for the same\n reason as `JobInfo.result`: a job that has not written yet has produced\n nothing, and an empty object would claim otherwise.\n \"\"\"\n result: JSONObject\n\n error: String\n}\n\ntype ReactorSignerUser {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ntype ReactorSignerApp {\n name: String!\n key: String!\n}\n\ntype ReactorSigner {\n user: ReactorSignerUser\n app: ReactorSignerApp\n signatures: [String!]!\n}\n\ntype ActionContext {\n signer: ReactorSigner\n}\n\ntype Action {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContext\n}\n\n\"\"\"\nOne operation an authorization preflight predicts a verdict for.\n\n`input` is what a conditional grant reads, so a candidate standing for a\nfilled-in form carries that form's input. Omitting it predicts the verdict an\nempty input earns, not the verdict the filled-in form will get.\n\"\"\"\ninput ActionCandidateInput {\n scope: String!\n type: String!\n input: JSONObject\n}\n\nenum AuthDecision {\n ALLOW\n DENY\n}\n\n\"\"\"\nOne candidate's predicted verdict. `reason` carries the refusal a DENY is\nrecorded with, and is null on an ALLOW.\n\"\"\"\ntype ActionEvaluation {\n decision: AuthDecision!\n reason: String\n}\n\n\"\"\"\nThe predicted verdicts for a set of candidates, in the order they were given,\nwith the aggregates a caller branches on.\n\nThe aggregates are redundant -- a verdict is binary -- and all four are returned\nso a caller reads the one its question is phrased in rather than negating\nanother. Over no candidates every aggregate is false: nothing is allowed and\nnothing is denied.\n\"\"\"\ntype ActionEvaluations {\n evaluations: [ActionEvaluation!]!\n allAllowed: Boolean!\n anyAllowed: Boolean!\n allDenied: Boolean!\n anyDenied: Boolean!\n}\n\n# Input types for sync operations\n\"\"\"\nAn action's context, as a caller submits it.\n\nDeclares every field `ActionContext` carries, because an input object rejects a\nfield it does not declare: an action stamped with the head it applies to - which\nis what a signing client sends - is refused outright if these are missing, and\nthat refusal is a whole-request one, not a per-field one.\n\n`prevOpHash` and `prevOpIndex` are the scope head the action was composed\nagainst. They are recorded rather than enforced; a signature is verified from\nthe params carried in its own tuple, which do not include them.\n\"\"\"\ninput ActionContextInput {\n \"\"\"\n The index of the last operation in the scope the action applies to.\n \"\"\"\n prevOpIndex: Int\n\n \"\"\"\n The hash of the state the action applies to.\n \"\"\"\n prevOpHash: String\n\n \"\"\"\n Covers replay of an operation that would otherwise be a no-op.\n \"\"\"\n nonce: String\n\n signer: ReactorSignerInput\n}\n\ninput ReactorSignerInput {\n user: ReactorSignerUserInput\n app: ReactorSignerAppInput\n signatures: [String!]!\n}\n\ninput ReactorSignerUserInput {\n address: String!\n networkId: String!\n chainId: Int!\n}\n\ninput ReactorSignerAppInput {\n name: String!\n key: String!\n}\n\ninput ActionInput {\n id: String!\n type: String!\n timestampUtcMs: String!\n input: JSONObject!\n scope: String!\n context: ActionContextInput\n}\n\n\"\"\"\nOne mutation job of a batch, mirroring the reactor's `ExecutionJobPlan`\n(packages/reactor/src/core/types.ts). The batch runs its jobs in dependency\norder only, not atomically: each job commits on its own with no batch rollback,\nand a failed job still releases its dependents.\n\n`documentIdOrSlug` is the document the job's actions apply to -- an id that does\nnot yet exist when the job's actions create it. `actions` are coerced against\n`ActionInput` and passed through exactly as `execute` does, so a client-signed\naction keeps its signature. `scope` is the single scope every action in the job\nshares, and `dependsOn` names the plan keys this job is ordered after. `branch`\ndefaults to `main`.\n\"\"\"\ninput ExecutionJobInput {\n key: String!\n documentIdOrSlug: String!\n scope: String!\n branch: String\n actions: [ActionInput!]!\n dependsOn: [String!]!\n}\n\n# Synchronization types\ntype ReactorOperation {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: Action!\n}\n\ninput OperationInput {\n index: Int!\n timestampUtcMs: String!\n hash: String!\n skip: Int!\n error: String\n deniedReason: String\n id: String\n action: ActionInput!\n}\n\ntype OperationContext {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ninput OperationContextInput {\n documentId: String!\n documentType: String!\n scope: String!\n branch: String!\n ordinal: Int!\n}\n\ntype OperationWithContext {\n operation: ReactorOperation!\n context: OperationContext!\n}\n\ninput OperationWithContextInput {\n operation: OperationInput!\n context: OperationContextInput!\n}\n\ntype ChannelMeta {\n id: String!\n}\n\ninput ChannelMetaInput {\n id: String!\n}\n\ntype RemoteCursor {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\ninput RemoteCursorInput {\n remoteName: String!\n cursorOrdinal: Int!\n lastSyncedAtUtcMs: String\n}\n\nenum SyncEnvelopeType {\n OPERATIONS\n ACK\n}\n\ntype SyncEnvelope {\n type: SyncEnvelopeType!\n channelMeta: ChannelMeta!\n operations: [OperationWithContext!]\n cursor: RemoteCursor\n key: String\n dependsOn: [String!]\n}\n\ninput SyncEnvelopeInput {\n type: SyncEnvelopeType!\n channelMeta: ChannelMetaInput!\n operations: [OperationWithContextInput!]\n cursor: RemoteCursorInput\n key: String\n dependsOn: [String!]\n}\n\ninput RemoteFilterInput {\n documentId: [String!]!\n scope: [String!]!\n branch: String!\n}\n\ninput SyncRefusalInput {\n documentId: String!\n branch: String!\n # \"marker\" for a refused purge marker; absent for UNSUPPORTED_PROTOCOL\n kind: String\n}\n\ninput TouchChannelInput {\n id: String!\n name: String!\n collectionId: String!\n filter: RemoteFilterInput!\n sinceTimestampUtcMs: String!\n # The client's peer manifest; absent from a client without peer agreement\n manifest: JSONObject\n}\n\ntype TouchChannelResult {\n success: Boolean!\n ackOrdinal: Int!\n # The server's peer manifest\n manifest: JSONObject\n}\n\ntype Query {\n # Get document models for a namespace\n documentModels(\n namespace: String\n paging: PagingInput\n ): DocumentModelResultPage!\n\n # Get a specific document by ID or slug\n document(\n idOrSlug: String\n identifier: String @deprecated(reason: \"Use idOrSlug.\")\n view: ViewFilterInput\n ): DocumentWithChildren\n\n # Get outgoing relationships of a given type from a source document\n documentOutgoingRelationships(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get incoming relationships of a given type to a target document\n documentIncomingRelationships(\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get the outgoing relationship edges of a source document. Unlike\n # documentOutgoingRelationships, which returns the documents at the far end,\n # this returns the edges themselves, carrying their metadata and timestamps.\n # Omit relationshipType to return edges of every type.\n documentOutgoingRelationshipEdges(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n relationshipType: String\n view: ViewFilterInput\n paging: PagingInput\n ): DocumentRelationshipResultPage!\n\n # Get the incoming relationship edges of a target document. Unlike\n # documentIncomingRelationships, which returns the documents at the far end,\n # this returns the edges themselves, carrying their metadata and timestamps.\n # Omit relationshipType to return edges of every type.\n documentIncomingRelationshipEdges(\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String\n view: ViewFilterInput\n paging: PagingInput\n ): DocumentRelationshipResultPage!\n\n # Find documents by search criteria\n findDocuments(\n search: SearchFilterInput\n view: ViewFilterInput\n paging: PagingInput\n ): PHDocumentResultPage!\n\n # Get job status\n jobStatus(jobId: String!): JobInfo\n\n # Get operations for a document with filtering and pagination\n documentOperations(\n filter: OperationsFilterInput!\n paging: PagingInput\n ): ReactorOperationResultPage!\n\n \"\"\"\n Predicts whether the calling subject would be admitted to execute each of a\n set of candidate operations, without submitting any of them. A UI asks this to\n disable a control rather than offer an action that fails on submit.\n\n The answer is a prediction, not a promise:\n\n - Real admission compiles an append condition over everything it read and the\n store enforces it at write time. A preflight reads no future, so a policy\n change landing between this answer and the submit changes the verdict. The\n submit path stays the only authority.\n - The verdict is evaluated at the stream heads, so it is correct for a\n candidate about to be submitted. A backdated submission is out of contract;\n the reactor decides that one by position.\n - A candidate whose verdict depends on its input has to carry that input, since\n a conditional grant reads it.\n\n The subject is the authenticated caller and cannot be named in the request:\n answering for an arbitrary subject would disclose what a policy grants\n somebody else. It carries both the caller's address and the did:key of the app\n instance whose token authenticated the request, so a policy naming either\n matches the same principal the write path presents.\n\n Requires the reactor's authEnforcement feature flag. Without it the reactor\n holds no decision model, so this fails with extensions.code\n AUTH_EVALUATION_UNSUPPORTED rather than guessing.\n \"\"\"\n evaluateActions(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n branch: String\n candidates: [ActionCandidateInput!]!\n ): ActionEvaluations!\n\n \"\"\"\n Polls for sync envelopes from a channel.\n\n An operation stored before the API required an action id cannot be\n represented by this schema, and rather than serving a partial response beside\n a bare non-null violation, this fails with extensions.code\n MALFORMED_STORED_OPERATION naming the operation. That code means the failure\n is worth polling through: the document holding the operation needs repairing,\n but the channel serves every other document, and a peer that stopped polling\n would stop receiving those too.\n \"\"\"\n pollSyncEnvelopes(\n channelId: String!\n outboxAck: Int!\n outboxLatest: Int!\n # The client's manifest revision; absent from a client without peer agreement\n manifestRevision: String\n # Documents the client refused from earlier polls: held, or a refused marker\n refusals: [SyncRefusalInput!]\n ): PollSyncEnvelopesResult!\n\n # Supreme admin, or the address the named remote's channel is bound to\n syncHolds(remoteName: String, documentId: String): [SyncHold!]!\n\n # Supreme admin, or an address bound to a channel in the collection\n peerAgreement(collectionId: String!): PeerAgreement!\n}\n\ntype Mutation {\n # Create a new document\n createDocument(\n document: JSONObject!\n parentIdOrSlug: String\n parentIdentifier: String @deprecated(reason: \"Use parentIdOrSlug.\")\n ): PHDocument!\n\n # Create an empty document of specified type\n createEmptyDocument(\n documentType: String!\n parentIdOrSlug: String\n parentIdentifier: String @deprecated(reason: \"Use parentIdOrSlug.\")\n ): PHDocument!\n\n \"\"\"\n Applies actions to a document and waits for the result.\n\n Each action is coerced against `ActionInput`, so one missing a field the wire\n declares is refused before any work starts. The id in particular: it is hashed\n into the operation id and replay dedupes by it, so an action without one is\n stored under an operation id shared by every id-less operation on the same\n document, scope and branch.\n\n Named for `IReactorClient.execute`, which this is the wire form of. `branch`\n defaults to `main`.\n \"\"\"\n execute(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n actions: [ActionInput!]!\n branch: String\n ): PHDocument!\n\n \"\"\"\n Submits actions to a document and returns the job that will apply them.\n\n Coerced exactly as `execute` is, so a malformed action is refused here rather\n than surfacing later as a failed job. Returns the job rather than only its id,\n so a caller has the status and the creation time it would otherwise have to\n ask for; `result` is null until the job produces one.\n \"\"\"\n executeAsync(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n actions: [ActionInput!]!\n branch: String\n ): JobInfo!\n\n \"\"\"\n Applies multiple mutation jobs in dependency order and waits for all of them,\n the wire form of `IReactorClient.executeBatch`. Each job's actions are coerced\n against `ActionInput` exactly as `execute` is, so client-signed actions pass\n through unchanged, and `dependsOn` orders the jobs. It is synchronous: the jobs\n are applied and awaited before the result returns, so every returned `JobInfo`\n is a completed one rather than the pending receipt the in-process reactor hands\n back. A batch is ordering, not a transaction: each job commits on its own, and\n a failed job still releases the jobs that depend on it, so any job, before or\n after a failure, may have committed. A failed job is therefore returned as a\n FAILED entry with its `error` and `errorName`, beside the final state of every\n other job, rather than failing the mutation. The mutation itself fails only\n when no job state can be reported.\n\n A job carrying `CREATE_DOCUMENT` must be the batch's only job, with the create\n as its first action naming the job's document. Its other actions may only be\n an `UPGRADE_DOCUMENT` of the new document and `ADD_RELATIONSHIP`s targeting\n it. It is authorized like `createDocument`: write on every source of those\n relationships, or the right to create when there is none.\n \"\"\"\n executeBatch(jobs: [ExecutionJobInput!]!): BatchExecutionResult!\n\n # Apply actions to a document (synchronous)\n mutateDocument(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): PHDocument!\n @deprecated(\n reason: \"Use execute. Actions here are untyped, so a malformed one is refused by a hand-written check rather than by the schema, and `view.scopes` is accepted but ignored.\"\n )\n\n # Submit actions to a document (asynchronous)\n mutateDocumentAsync(\n documentIdentifier: String!\n actions: [JSONObject!]!\n view: ViewFilterInput\n ): String!\n @deprecated(\n reason: \"Use executeAsync, which is typed and returns the job rather than only its id.\"\n )\n\n # Rename a document\n renameDocument(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n name: String!\n branch: String\n ): PHDocument!\n\n # Update the preferred editor recorded in the document header meta.\n # Pass null/omit to clear it.\n setPreferredEditor(\n documentIdOrSlug: String\n documentIdentifier: String @deprecated(reason: \"Use documentIdOrSlug.\")\n preferredEditor: String\n branch: String\n ): PHDocument!\n\n # Add a relationship between two documents. Adding one that already exists is\n # a no-op, metadata included -- use updateRelationship to change an edge.\n addRelationship(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n metadata: JSONObject\n branch: String\n ): PHDocument!\n\n # Replace the metadata of an existing relationship, preserving its createdAt.\n # Omitting metadata, or passing null, clears it.\n updateRelationship(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n metadata: JSONObject\n branch: String\n ): PHDocument!\n\n # Remove a relationship between two documents\n removeRelationship(\n sourceIdOrSlug: String\n sourceIdentifier: String @deprecated(reason: \"Use sourceIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n branch: String\n ): PHDocument!\n\n # Move a relationship from one source to another\n moveRelationship(\n sourceParentIdOrSlug: String\n sourceParentIdentifier: String\n @deprecated(reason: \"Use sourceParentIdOrSlug.\")\n targetParentIdOrSlug: String\n targetParentIdentifier: String\n @deprecated(reason: \"Use targetParentIdOrSlug.\")\n targetIdOrSlug: String\n targetIdentifier: String @deprecated(reason: \"Use targetIdOrSlug.\")\n relationshipType: String!\n branch: String\n ): MoveRelationshipResult!\n\n # Delete a single document\n deleteDocument(\n idOrSlug: String\n identifier: String @deprecated(reason: \"Use idOrSlug.\")\n propagate: PropagationMode\n ): Boolean!\n\n # Delete multiple documents\n deleteDocuments(\n idsOrSlugs: [String!]\n identifiers: [String!] @deprecated(reason: \"Use idsOrSlugs.\")\n propagate: PropagationMode\n ): Boolean!\n\n # Touch (create or update) a channel for sync\n touchChannel(input: TouchChannelInput!): TouchChannelResult!\n\n # Push sync envelopes to a channel\n pushSyncEnvelopes(\n envelopes: [SyncEnvelopeInput!]!\n # The server's manifest revision the client gated these envelopes under\n peerManifestRevision: String\n ): Boolean!\n}\n\ntype Subscription {\n # Subscribe to document changes\n documentChanges(\n search: SearchFilterInput\n view: ViewFilterInput\n ): DocumentChangeEvent!\n\n # Subscribe to job changes\n jobChanges(jobId: String!): JobChangeEvent!\n}\n";
|
|
5954
6134
|
//#endregion
|
|
5955
6135
|
//#region src/graphql/reactor/pubsub.ts
|
|
5956
6136
|
const pubSub = new PubSub();
|
|
@@ -6369,7 +6549,17 @@ var ReactorSubgraph = class extends BaseSubgraph {
|
|
|
6369
6549
|
jobStatus: async (_parent, args, ctx) => {
|
|
6370
6550
|
this.logger.debug("jobStatus(@args)", args);
|
|
6371
6551
|
try {
|
|
6372
|
-
|
|
6552
|
+
const admin = this.authorizationService.isSupremeAdmin(ctx.user?.address);
|
|
6553
|
+
const decisions = /* @__PURE__ */ new Map();
|
|
6554
|
+
const readable = (id) => {
|
|
6555
|
+
let decision = decisions.get(id);
|
|
6556
|
+
if (!decision) {
|
|
6557
|
+
decision = (async () => await this.servesDocument(id, ctx) && (admin || await this.canReadDocument(id, ctx)))();
|
|
6558
|
+
decisions.set(id, decision);
|
|
6559
|
+
}
|
|
6560
|
+
return decision;
|
|
6561
|
+
};
|
|
6562
|
+
return await jobStatus(this.reactorClient, args, readable, readable);
|
|
6373
6563
|
} catch (error) {
|
|
6374
6564
|
this.logger.error("Error in jobStatus: @Error", error);
|
|
6375
6565
|
throw error;
|
|
@@ -6537,6 +6727,33 @@ var ReactorSubgraph = class extends BaseSubgraph {
|
|
|
6537
6727
|
throw error;
|
|
6538
6728
|
}
|
|
6539
6729
|
},
|
|
6730
|
+
executeBatch: async (_parent, args, ctx) => {
|
|
6731
|
+
this.logger.debug("executeBatch(@args)", args);
|
|
6732
|
+
try {
|
|
6733
|
+
const creation = batchCreationOf(args.jobs);
|
|
6734
|
+
if (creation) {
|
|
6735
|
+
if (creation.linkedFrom.length > 0) for (const parent of creation.linkedFrom) await this.assertCanWrite(parent, ctx);
|
|
6736
|
+
else this.assertCanCreate(ctx);
|
|
6737
|
+
const result = await executeBatch(this.reactorClient, { jobs: args.jobs });
|
|
6738
|
+
if (result.jobs.some((entry) => entry.job.status !== "READ_READY")) return result;
|
|
6739
|
+
if (isDriveContainerType(creation.documentType)) this.graphqlManager.driveOwnershipCache.add(creation.documentId);
|
|
6740
|
+
if (ctx.user?.address) await this.documentPermissionService?.initializeDocumentProtection(creation.documentId, ctx.user.address, this.authorizationService.config.defaultProtection);
|
|
6741
|
+
return result;
|
|
6742
|
+
}
|
|
6743
|
+
const jobs = [];
|
|
6744
|
+
for (const job of args.jobs) {
|
|
6745
|
+
const handle = await this.assertCanExecuteOperations(job.documentIdOrSlug, job.actions, ctx);
|
|
6746
|
+
jobs.push({
|
|
6747
|
+
...job,
|
|
6748
|
+
documentIdOrSlug: handle.fetchIdentifier
|
|
6749
|
+
});
|
|
6750
|
+
}
|
|
6751
|
+
return await executeBatch(this.reactorClient, { jobs });
|
|
6752
|
+
} catch (error) {
|
|
6753
|
+
this.logger.error("Error in executeBatch(@args): @Error", args, error);
|
|
6754
|
+
throw error;
|
|
6755
|
+
}
|
|
6756
|
+
},
|
|
6540
6757
|
mutateDocument: async (_parent, args, ctx) => {
|
|
6541
6758
|
this.logger.debug("mutateDocument(@args)", args);
|
|
6542
6759
|
try {
|
|
@@ -6827,10 +7044,10 @@ const ADMIN_USERS = getAdminUsers();
|
|
|
6827
7044
|
//#endregion
|
|
6828
7045
|
//#region src/graphql/system/version.ts
|
|
6829
7046
|
function getVersion() {
|
|
6830
|
-
return "6.2.3-dev.
|
|
7047
|
+
return "6.2.3-dev.49";
|
|
6831
7048
|
}
|
|
6832
7049
|
function getGitHash() {
|
|
6833
|
-
return "
|
|
7050
|
+
return "390cca8ca3f2d6f76b5b104a4867c664f81f3801";
|
|
6834
7051
|
}
|
|
6835
7052
|
function getGitUrl() {
|
|
6836
7053
|
return buildTreeUrl(getGitHash());
|
|
@@ -10086,7 +10303,7 @@ var PackageManagementService = class {
|
|
|
10086
10303
|
}
|
|
10087
10304
|
};
|
|
10088
10305
|
//#endregion
|
|
10089
|
-
export { ADMIN_USERS, ActionCandidateInputSchema, ActionContextInputSchema, ActionInputSchema, AddRelationshipDocument, AnalyticsSubgraph, AttachmentAccessFailed, AttachmentAccessService, AttachmentAccessUnavailable, AttachmentClientProvider, AuthDecision, AuthDecisionSchema, AuthEvaluationUnsupportedError, AuthService, AuthSubgraph, AuthenticationRequiredError, AuthorizationPolicy, AuthorizedAttachmentService, AuthorizedDocumentHandle, BaseSubgraph, CORE_PACKAGE_NAME, CanonicalDocumentIdResolutionError, ChannelMetaInputSchema, CreateDocumentDocument, CreateEmptyDocumentDocument, DeleteDocumentDocument, DeleteDocumentsDocument, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentOperationsFilterInputSchema, DocumentPermissionService, DocumentRelationshipFieldsFragmentDoc, EvaluateActionsDocument, FindDocumentsDocument, ForbiddenError, GetDocumentDocument, GetDocumentIncomingRelationshipEdgesDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentModelsDocument, GetDocumentOperationsDocument, GetDocumentOutgoingRelationshipEdgesDocument, GetDocumentOutgoingRelationshipsDocument, GetDocumentWithOperationsDocument, GetJobStatusDocument, GraphQLManager, HttpDocumentModelLoader, HttpPackageLoader, HttpRouteService, ImportPackageLoader, InMemoryPackageStorage, InvalidNamespaceError, JobChangesDocument, MalformedStoredOperationError, MemoryWebhookStore, MoveRelationshipDocument, MutateDocumentAsyncDocument, MutateDocumentDocument, OperationContextInputSchema, OperationInputSchema, OperationWithContextInputSchema, OperationsFilterInputSchema, PACKAGE_ROUTE_SEGMENT, PGLITE_UTC_PARSERS, PackageManagementService, PackageManager, PackagesSubgraph, PagingInputSchema, PhDocumentFieldsFragmentDoc, PollSyncEnvelopesDocument, PrivacyPermissionAdapter, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, ReactorSignerAppInputSchema, ReactorSignerInputSchema, ReactorSignerUserInputSchema, ReactorSubgraph, RefusalNotRecordedError, RelationalWebhookStore, RemoteCursorInputSchema, RemoteFilterInputSchema, RemoveRelationshipDocument, RenameDocumentDocument, SearchFilterInputSchema, SetPreferredEditorDocument, SyncEnvelopeInputSchema, SyncEnvelopeType, SyncEnvelopeTypeSchema, SyncRefusalInputSchema, SystemSubgraph, TouchChannelDocument, TouchChannelInputSchema, UpdateRelationshipDocument, ViewFilterInputSchema, WEBHOOK_SEGMENT, WS_AUTH_CLOSE_REASONS, WS_CLOSE_REASON_AUTHENTICATION_REQUIRED, WS_CLOSE_REASON_BEARER_REJECTED, WebhookService, assertAttachmentPolicyReadsAllowed, assertAuthRequiredForDocumentPermissions, assertCredentialVerifierForSource, assertHostMountPath, assertRequireAuthenticatedCallerAllowed, assertSkipCredentialVerificationAllowed, buildGraphQlDocument, buildGraphQlDriveDocument, buildGraphqlOperation, buildGraphqlOperations, buildSubgraphSchemaModule, callerSubject, createAuthFetchMiddleware, createCanonicalDocumentIdResolver, createGatewayAdapter, createHttpAdapter, createMergedSchema, createReactorGraphQLClient, createRenownCredentialVerifier, createSchema, createWsAuthHandlers, decodeExplorerUrlState, definedNonNullAnySchema, driveIdFromUrl, extractSubgraphs, extractSubgraphsFromModule, generateDocumentModelSchema, getAuthContext, getDbClient, getDocumentModelSchemaName, getDocumentModelTypeDefs, getExplorerPrefix, getGitHash, getGitUrl, getSdk, getUniqueDocumentModels, getUniqueUpgradeManifests, getVersion, initAnalyticsStoreSql, initializeAndStartAPI, isDefinedNonNullAny, isExpectedLoaderMiss, isPostgresConnectionString, isSubgraphClass, namespacePath, namespaceSegments, newWebhookToken, parseDriveUrl, parseWebhookBody, piecesBaseUrl, redactHeaders, renderGraphqlPlayground, resolvePackageName, resolveRenownConfig, verifyWebhook };
|
|
10306
|
+
export { ADMIN_USERS, ActionCandidateInputSchema, ActionContextInputSchema, ActionInputSchema, AddRelationshipDocument, AnalyticsSubgraph, AttachmentAccessFailed, AttachmentAccessService, AttachmentAccessUnavailable, AttachmentClientProvider, AuthDecision, AuthDecisionSchema, AuthEvaluationUnsupportedError, AuthService, AuthSubgraph, AuthenticationRequiredError, AuthorizationPolicy, AuthorizedAttachmentService, AuthorizedDocumentHandle, BaseSubgraph, CORE_PACKAGE_NAME, CanonicalDocumentIdResolutionError, ChannelMetaInputSchema, CreateDocumentDocument, CreateEmptyDocumentDocument, DeleteDocumentDocument, DeleteDocumentsDocument, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentOperationsFilterInputSchema, DocumentPermissionService, DocumentRelationshipFieldsFragmentDoc, EvaluateActionsDocument, ExecuteBatchDocument, ExecutionJobInputSchema, FindDocumentsDocument, ForbiddenError, GetDocumentDocument, GetDocumentIncomingRelationshipEdgesDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentModelsDocument, GetDocumentOperationsDocument, GetDocumentOutgoingRelationshipEdgesDocument, GetDocumentOutgoingRelationshipsDocument, GetDocumentWithOperationsDocument, GetJobStatusDocument, GraphQLManager, HttpDocumentModelLoader, HttpPackageLoader, HttpRouteService, ImportPackageLoader, InMemoryPackageStorage, InvalidNamespaceError, JobChangesDocument, JobInfoFieldsFragmentDoc, MalformedStoredOperationError, MemoryWebhookStore, MoveRelationshipDocument, MutateDocumentAsyncDocument, MutateDocumentDocument, OperationContextInputSchema, OperationInputSchema, OperationWithContextInputSchema, OperationsFilterInputSchema, PACKAGE_ROUTE_SEGMENT, PGLITE_UTC_PARSERS, PackageManagementService, PackageManager, PackagesSubgraph, PagingInputSchema, PhDocumentFieldsFragmentDoc, PollSyncEnvelopesDocument, PrivacyPermissionAdapter, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, ReactorSignerAppInputSchema, ReactorSignerInputSchema, ReactorSignerUserInputSchema, ReactorSubgraph, RefusalNotRecordedError, RelationalWebhookStore, RemoteCursorInputSchema, RemoteFilterInputSchema, RemoveRelationshipDocument, RenameDocumentDocument, SearchFilterInputSchema, SetPreferredEditorDocument, SyncEnvelopeInputSchema, SyncEnvelopeType, SyncEnvelopeTypeSchema, SyncRefusalInputSchema, SystemSubgraph, TouchChannelDocument, TouchChannelInputSchema, UpdateRelationshipDocument, ViewFilterInputSchema, WEBHOOK_SEGMENT, WS_AUTH_CLOSE_REASONS, WS_CLOSE_REASON_AUTHENTICATION_REQUIRED, WS_CLOSE_REASON_BEARER_REJECTED, WebhookService, assertAttachmentPolicyReadsAllowed, assertAuthRequiredForDocumentPermissions, assertCredentialVerifierForSource, assertHostMountPath, assertRequireAuthenticatedCallerAllowed, assertSkipCredentialVerificationAllowed, buildGraphQlDocument, buildGraphQlDriveDocument, buildGraphqlOperation, buildGraphqlOperations, buildSubgraphSchemaModule, callerSubject, createAuthFetchMiddleware, createCanonicalDocumentIdResolver, createGatewayAdapter, createHttpAdapter, createMergedSchema, createReactorGraphQLClient, createRenownCredentialVerifier, createSchema, createWsAuthHandlers, decodeExplorerUrlState, definedNonNullAnySchema, driveIdFromUrl, extractSubgraphs, extractSubgraphsFromModule, generateDocumentModelSchema, getAuthContext, getDbClient, getDocumentModelSchemaName, getDocumentModelTypeDefs, getExplorerPrefix, getGitHash, getGitUrl, getSdk, getUniqueDocumentModels, getUniqueUpgradeManifests, getVersion, initAnalyticsStoreSql, initializeAndStartAPI, isDefinedNonNullAny, isExpectedLoaderMiss, isPostgresConnectionString, isSubgraphClass, namespacePath, namespaceSegments, newWebhookToken, parseDriveUrl, parseWebhookBody, piecesBaseUrl, redactHeaders, renderGraphqlPlayground, resolvePackageName, resolveRenownConfig, verifyWebhook };
|
|
10090
10307
|
|
|
10091
10308
|
//# sourceMappingURL=index.mjs.map
|
|
10092
|
-
//# debugId=
|
|
10309
|
+
//# debugId=dc27a51b-c565-5dcc-a85a-eac64c78db3e
|