@powerhousedao/reactor-api 6.2.0-dev.3 → 6.2.0-dev.5
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/README.md +0 -2
- package/dist/index.d.mts +37 -144
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +102 -278
- package/dist/index.mjs.map +1 -1
- package/dist/src/packages/vite-loader.mjs +1 -1
- package/dist/{utils-BFkbSO_H.mjs → utils-CtC8sjRo.mjs} +115 -34
- package/dist/utils-CtC8sjRo.mjs.map +1 -0
- package/package.json +13 -13
- package/dist/utils-BFkbSO_H.mjs.map +0 -1
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -352,72 +352,32 @@ declare class DocumentPermissionService {
|
|
|
352
352
|
}
|
|
353
353
|
//#endregion
|
|
354
354
|
//#region src/services/authorization.service.d.ts
|
|
355
|
+
declare const AuthorizationPolicy: {
|
|
356
|
+
readonly OPEN: "OPEN";
|
|
357
|
+
readonly ADMIN_ONLY: "ADMIN_ONLY";
|
|
358
|
+
readonly DOCUMENT_PERMISSIONS: "DOCUMENT_PERMISSIONS";
|
|
359
|
+
};
|
|
360
|
+
type AuthorizationPolicy = (typeof AuthorizationPolicy)[keyof typeof AuthorizationPolicy];
|
|
355
361
|
interface AuthorizationConfig {
|
|
356
362
|
admins: string[];
|
|
357
363
|
defaultProtection: boolean;
|
|
364
|
+
policy: AuthorizationPolicy;
|
|
358
365
|
}
|
|
359
366
|
/**
|
|
360
|
-
*
|
|
367
|
+
* Single source of truth for every permission decision. Always present (never
|
|
368
|
+
* null) so callers branch on data, not on the existence of a service.
|
|
361
369
|
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
* - READ: anyone (even anonymous) → ALLOW
|
|
367
|
-
* - WRITE: authenticated user → ALLOW
|
|
368
|
-
* b. PROTECTED:
|
|
369
|
-
* - READ: requires explicit READ/WRITE/ADMIN grant (direct or via group/parent)
|
|
370
|
-
* - WRITE: requires explicit WRITE/ADMIN grant (direct or via group/parent)
|
|
371
|
-
* 3. Operation restricted? → Check OperationUserPermission
|
|
372
|
-
* 4. Document owner = implicit ADMIN
|
|
373
|
-
* 5. Drive protected = all children effectively protected
|
|
370
|
+
* The policy selects an implementation once at boot:
|
|
371
|
+
* - OPEN: authentication disabled — everyone (incl. anonymous) is allowed.
|
|
372
|
+
* - ADMIN_ONLY: authentication on, document permissions off — only ADMINS.
|
|
373
|
+
* - DOCUMENT_PERMISSIONS: the full per-document protection + grant model.
|
|
374
374
|
*/
|
|
375
|
-
|
|
376
|
-
private readonly documentPermissionService;
|
|
375
|
+
interface IAuthorizationService {
|
|
377
376
|
readonly config: AuthorizationConfig;
|
|
378
|
-
constructor(documentPermissionService: DocumentPermissionService, config: AuthorizationConfig);
|
|
379
|
-
/**
|
|
380
|
-
* Check if a user is a supreme admin (from ADMINS env var).
|
|
381
|
-
*/
|
|
382
377
|
isSupremeAdmin(userAddress?: string): boolean;
|
|
383
|
-
/**
|
|
384
|
-
* Check if a user can read a document.
|
|
385
|
-
*
|
|
386
|
-
* - Supreme admin → yes
|
|
387
|
-
* - Not protected → anyone can read (even anonymous)
|
|
388
|
-
* - Protected → requires READ/WRITE/ADMIN grant (direct, group, or parent inheritance)
|
|
389
|
-
* - Owner → yes (implicit ADMIN)
|
|
390
|
-
*/
|
|
391
378
|
canRead(documentId: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
|
|
392
|
-
/**
|
|
393
|
-
* Check if a user can write to a document.
|
|
394
|
-
*
|
|
395
|
-
* - Supreme admin → yes
|
|
396
|
-
* - Not protected → anyone can write (even anonymous)
|
|
397
|
-
* - Protected → requires authentication + WRITE/ADMIN grant
|
|
398
|
-
* - Owner → yes (implicit ADMIN)
|
|
399
|
-
*/
|
|
400
379
|
canWrite(documentId: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
|
|
401
|
-
|
|
402
|
-
* Check if a user can manage a document (change permissions, protection, transfer ownership).
|
|
403
|
-
*
|
|
404
|
-
* - Supreme admin → yes
|
|
405
|
-
* - Owner → yes
|
|
406
|
-
* - Has ADMIN grant → yes
|
|
407
|
-
*/
|
|
408
|
-
canManage(documentId: string, userAddress?: string, _getParentIds?: GetParentIdsFn): Promise<boolean>;
|
|
409
|
-
/**
|
|
410
|
-
* Check if a user can execute a specific operation.
|
|
411
|
-
* If the operation is not restricted, falls through to the standard write check.
|
|
412
|
-
* If the operation is restricted, requires an explicit OperationUserPermission grant.
|
|
413
|
-
*/
|
|
414
|
-
canExecuteOperation(documentId: string, operationType: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
|
|
415
|
-
/**
|
|
416
|
-
* Combined check for mutations: can the user write + execute the operation?
|
|
417
|
-
* This enables READ-only users with operation grants to execute specific operations.
|
|
418
|
-
* For restricted operations, only the operation grant is checked (bypasses write check),
|
|
419
|
-
* allowing READ-only users with an explicit operation grant to execute that operation.
|
|
420
|
-
*/
|
|
380
|
+
canManage(documentId: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
|
|
421
381
|
canMutate(documentId: string, operationType: string, userAddress?: string, getParentIds?: GetParentIdsFn): Promise<boolean>;
|
|
422
382
|
}
|
|
423
383
|
//#endregion
|
|
@@ -428,14 +388,11 @@ type Context = {
|
|
|
428
388
|
document?: PHDocument;
|
|
429
389
|
headers: IncomingHttpHeaders;
|
|
430
390
|
db: unknown;
|
|
431
|
-
isAdmin?: (address: string) => boolean;
|
|
432
391
|
user?: {
|
|
433
392
|
address: string;
|
|
434
393
|
chainId: number;
|
|
435
394
|
networkId: string;
|
|
436
395
|
};
|
|
437
|
-
documentPermissionService?: DocumentPermissionService;
|
|
438
|
-
authorizationService?: AuthorizationService;
|
|
439
396
|
};
|
|
440
397
|
type ISubgraph = {
|
|
441
398
|
name: string;
|
|
@@ -454,7 +411,7 @@ type SubgraphArgs = {
|
|
|
454
411
|
graphqlManager: GraphQLManager$1;
|
|
455
412
|
syncManager: ISyncManager;
|
|
456
413
|
documentPermissionService?: DocumentPermissionService;
|
|
457
|
-
authorizationService
|
|
414
|
+
authorizationService: IAuthorizationService;
|
|
458
415
|
path?: string;
|
|
459
416
|
};
|
|
460
417
|
type GqlSigner = {
|
|
@@ -525,15 +482,15 @@ declare class BaseSubgraph implements ISubgraph$1 {
|
|
|
525
482
|
relationalDb: IRelationalDb;
|
|
526
483
|
syncManager: ISyncManager;
|
|
527
484
|
documentPermissionService?: DocumentPermissionService;
|
|
528
|
-
authorizationService
|
|
485
|
+
authorizationService: IAuthorizationService;
|
|
529
486
|
constructor(args: SubgraphArgs$1);
|
|
530
487
|
onSetup(): Promise<void>;
|
|
531
488
|
protected getParentIdsFn(): GetParentIdsFn;
|
|
532
|
-
protected hasGlobalAdminAccess(ctx: Context): boolean;
|
|
533
489
|
protected canReadDocument(documentId: string, ctx: Context): Promise<boolean>;
|
|
534
490
|
protected assertCanRead(documentId: string, ctx: Context): Promise<void>;
|
|
535
491
|
protected assertCanWrite(documentId: string, ctx: Context): Promise<void>;
|
|
536
492
|
protected assertCanExecuteOperation(documentId: string, operationType: string, ctx: Context): Promise<void>;
|
|
493
|
+
protected assertCanCreate(ctx: Context): void;
|
|
537
494
|
}
|
|
538
495
|
//#endregion
|
|
539
496
|
//#region src/graphql/analytics-subgraph.d.ts
|
|
@@ -676,7 +633,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
676
633
|
user?: {
|
|
677
634
|
address: string;
|
|
678
635
|
};
|
|
679
|
-
isAdmin?: (address: string) => boolean;
|
|
680
636
|
}) => Promise<DocumentProtectionInfo>;
|
|
681
637
|
transferDocumentOwnership: (_parent: unknown, args: {
|
|
682
638
|
documentId: string;
|
|
@@ -685,7 +641,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
685
641
|
user?: {
|
|
686
642
|
address: string;
|
|
687
643
|
};
|
|
688
|
-
isAdmin?: (address: string) => boolean;
|
|
689
644
|
}) => Promise<DocumentProtectionInfo>;
|
|
690
645
|
grantDocumentPermission: (_parent: unknown, args: {
|
|
691
646
|
documentId: string;
|
|
@@ -695,7 +650,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
695
650
|
user?: {
|
|
696
651
|
address: string;
|
|
697
652
|
};
|
|
698
|
-
isAdmin?: (address: string) => boolean;
|
|
699
653
|
}) => Promise<{
|
|
700
654
|
documentId: string;
|
|
701
655
|
userAddress: string;
|
|
@@ -711,7 +665,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
711
665
|
user?: {
|
|
712
666
|
address: string;
|
|
713
667
|
};
|
|
714
|
-
isAdmin?: (address: string) => boolean;
|
|
715
668
|
}) => Promise<boolean>;
|
|
716
669
|
createGroup: (_parent: unknown, args: {
|
|
717
670
|
name: string;
|
|
@@ -736,7 +689,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
736
689
|
user?: {
|
|
737
690
|
address: string;
|
|
738
691
|
};
|
|
739
|
-
isAdmin?: (address: string) => boolean;
|
|
740
692
|
}) => Promise<DocumentGroupPermission>;
|
|
741
693
|
revokeGroupPermission: (_parent: unknown, args: {
|
|
742
694
|
documentId: string;
|
|
@@ -745,7 +697,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
745
697
|
user?: {
|
|
746
698
|
address: string;
|
|
747
699
|
};
|
|
748
|
-
isAdmin?: (address: string) => boolean;
|
|
749
700
|
}) => Promise<boolean>;
|
|
750
701
|
grantOperationPermission: (_parent: unknown, args: {
|
|
751
702
|
documentId: string;
|
|
@@ -755,7 +706,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
755
706
|
user?: {
|
|
756
707
|
address: string;
|
|
757
708
|
};
|
|
758
|
-
isAdmin?: (address: string) => boolean;
|
|
759
709
|
}) => Promise<OperationUserPermission>;
|
|
760
710
|
revokeOperationPermission: (_parent: unknown, args: {
|
|
761
711
|
documentId: string;
|
|
@@ -765,7 +715,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
765
715
|
user?: {
|
|
766
716
|
address: string;
|
|
767
717
|
};
|
|
768
|
-
isAdmin?: (address: string) => boolean;
|
|
769
718
|
}) => Promise<boolean>;
|
|
770
719
|
grantGroupOperationPermission: (_parent: unknown, args: {
|
|
771
720
|
documentId: string;
|
|
@@ -775,7 +724,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
775
724
|
user?: {
|
|
776
725
|
address: string;
|
|
777
726
|
};
|
|
778
|
-
isAdmin?: (address: string) => boolean;
|
|
779
727
|
}) => Promise<OperationGroupPermission>;
|
|
780
728
|
revokeGroupOperationPermission: (_parent: unknown, args: {
|
|
781
729
|
documentId: string;
|
|
@@ -785,7 +733,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
785
733
|
user?: {
|
|
786
734
|
address: string;
|
|
787
735
|
};
|
|
788
|
-
isAdmin?: (address: string) => boolean;
|
|
789
736
|
}) => Promise<boolean>;
|
|
790
737
|
};
|
|
791
738
|
Group: {
|
|
@@ -811,7 +758,6 @@ declare class AuthSubgraph extends BaseSubgraph {
|
|
|
811
758
|
interface AuthConfig {
|
|
812
759
|
enabled: boolean;
|
|
813
760
|
admins: string[];
|
|
814
|
-
cacheTtl?: number;
|
|
815
761
|
skipCredentialVerification?: boolean;
|
|
816
762
|
}
|
|
817
763
|
interface User {
|
|
@@ -842,24 +788,6 @@ declare class AuthService {
|
|
|
842
788
|
* Extract user information from verification result
|
|
843
789
|
*/
|
|
844
790
|
private extractUserFromVerification;
|
|
845
|
-
/**
|
|
846
|
-
* Get additional context fields for GraphQL
|
|
847
|
-
*/
|
|
848
|
-
getAdditionalContextFields(): {
|
|
849
|
-
isAdmin: (address: string) => boolean;
|
|
850
|
-
};
|
|
851
|
-
/**
|
|
852
|
-
* Get user context for GraphQL
|
|
853
|
-
*/
|
|
854
|
-
getUserContext(user?: User): {
|
|
855
|
-
user?: undefined;
|
|
856
|
-
} | {
|
|
857
|
-
user: {
|
|
858
|
-
address: string;
|
|
859
|
-
chainId: number;
|
|
860
|
-
networkId: string;
|
|
861
|
-
};
|
|
862
|
-
};
|
|
863
791
|
/**
|
|
864
792
|
* Verify that the credential still exists on the Renown API
|
|
865
793
|
*/
|
|
@@ -1020,7 +948,6 @@ declare class GraphQLManager {
|
|
|
1020
948
|
private readonly documentPermissionService?;
|
|
1021
949
|
private readonly featureFlags;
|
|
1022
950
|
private readonly port;
|
|
1023
|
-
private readonly authorizationService?;
|
|
1024
951
|
private initialized;
|
|
1025
952
|
private coreSubgraphsMap;
|
|
1026
953
|
private contextFields;
|
|
@@ -1037,7 +964,8 @@ declare class GraphQLManager {
|
|
|
1037
964
|
* it for reactor-drive parents.
|
|
1038
965
|
*/
|
|
1039
966
|
readonly reactorDriveClient?: IDriveClient;
|
|
1040
|
-
|
|
967
|
+
private readonly authorizationService;
|
|
968
|
+
constructor(path: string, httpServer: http.Server, wsServer: WebSocketServer, reactorClient: IReactorClient, relationalDb: IRelationalDb, analyticsStore: IAnalyticsStore, syncManager: ISyncManager, logger: ILogger, httpAdapter: IHttpAdapter, gatewayAdapter: IGatewayAdapter<Context$1>, authConfig?: AuthConfig | undefined, documentPermissionService?: DocumentPermissionService | undefined, featureFlags?: GraphqlManagerFeatureFlags, port?: number, authorizationService?: IAuthorizationService, reactorDriveClient?: IDriveClient);
|
|
1041
969
|
init(coreSubgraphs: SubgraphClass$1[], authMiddleware?: AuthFetchMiddleware): Promise<void>;
|
|
1042
970
|
/**
|
|
1043
971
|
* Regenerate document model subgraphs when models are dynamically loaded.
|
|
@@ -1053,6 +981,12 @@ declare class GraphQLManager {
|
|
|
1053
981
|
* Get the base path used for subgraph registration.
|
|
1054
982
|
*/
|
|
1055
983
|
getBasePath(): string;
|
|
984
|
+
/**
|
|
985
|
+
* Get the authorization service shared with subgraphs. Use this when
|
|
986
|
+
* constructing a subgraph instance externally for
|
|
987
|
+
* {@link registerSubgraphInstance}.
|
|
988
|
+
*/
|
|
989
|
+
getAuthorizationService(): IAuthorizationService;
|
|
1056
990
|
registerSubgraph(subgraph: SubgraphClass$1, supergraph?: string, core?: boolean): Promise<ISubgraph$1>;
|
|
1057
991
|
updateRouter: (immediate?: boolean) => Promise<void>;
|
|
1058
992
|
private _updateRouter;
|
|
@@ -1091,6 +1025,10 @@ interface IReactorProcessorHostModule extends IProcessorHostModule {
|
|
|
1091
1025
|
client: IReactorClient;
|
|
1092
1026
|
attachments: IAttachmentClient;
|
|
1093
1027
|
}
|
|
1028
|
+
type ReadinessGate = {
|
|
1029
|
+
isReady: () => boolean;
|
|
1030
|
+
markReady: () => void;
|
|
1031
|
+
};
|
|
1094
1032
|
type API = {
|
|
1095
1033
|
httpAdapter: IHttpAdapter;
|
|
1096
1034
|
graphqlManager: GraphQLManager$1;
|
|
@@ -1323,7 +1261,6 @@ type Scalars = {
|
|
|
1323
1261
|
};
|
|
1324
1262
|
};
|
|
1325
1263
|
type Action = {
|
|
1326
|
-
readonly attachments?: Maybe<ReadonlyArray<Attachment>>;
|
|
1327
1264
|
readonly context?: Maybe<ActionContext>;
|
|
1328
1265
|
readonly id: Scalars["String"]["output"];
|
|
1329
1266
|
readonly input: Scalars["JSONObject"]["output"];
|
|
@@ -1338,7 +1275,6 @@ type ActionContextInput = {
|
|
|
1338
1275
|
readonly signer?: InputMaybe<ReactorSignerInput>;
|
|
1339
1276
|
};
|
|
1340
1277
|
type ActionInput = {
|
|
1341
|
-
readonly attachments?: InputMaybe<ReadonlyArray<AttachmentInput>>;
|
|
1342
1278
|
readonly context?: InputMaybe<ActionContextInput>;
|
|
1343
1279
|
readonly id: Scalars["String"]["input"];
|
|
1344
1280
|
readonly input: Scalars["JSONObject"]["input"];
|
|
@@ -1346,20 +1282,6 @@ type ActionInput = {
|
|
|
1346
1282
|
readonly timestampUtcMs: Scalars["String"]["input"];
|
|
1347
1283
|
readonly type: Scalars["String"]["input"];
|
|
1348
1284
|
};
|
|
1349
|
-
type Attachment = {
|
|
1350
|
-
readonly data: Scalars["String"]["output"];
|
|
1351
|
-
readonly extension?: Maybe<Scalars["String"]["output"]>;
|
|
1352
|
-
readonly fileName?: Maybe<Scalars["String"]["output"]>;
|
|
1353
|
-
readonly hash: Scalars["String"]["output"];
|
|
1354
|
-
readonly mimeType: Scalars["String"]["output"];
|
|
1355
|
-
};
|
|
1356
|
-
type AttachmentInput = {
|
|
1357
|
-
readonly data: Scalars["String"]["input"];
|
|
1358
|
-
readonly extension?: InputMaybe<Scalars["String"]["input"]>;
|
|
1359
|
-
readonly fileName?: InputMaybe<Scalars["String"]["input"]>;
|
|
1360
|
-
readonly hash: Scalars["String"]["input"];
|
|
1361
|
-
readonly mimeType: Scalars["String"]["input"];
|
|
1362
|
-
};
|
|
1363
1285
|
type ChannelMeta = {
|
|
1364
1286
|
readonly id: Scalars["String"]["output"];
|
|
1365
1287
|
};
|
|
@@ -1840,13 +1762,6 @@ type GetDocumentWithOperationsQuery = {
|
|
|
1840
1762
|
readonly timestampUtcMs: string;
|
|
1841
1763
|
readonly input: NonNullable<unknown>;
|
|
1842
1764
|
readonly scope: string;
|
|
1843
|
-
readonly attachments?: ReadonlyArray<{
|
|
1844
|
-
readonly data: string;
|
|
1845
|
-
readonly mimeType: string;
|
|
1846
|
-
readonly hash: string;
|
|
1847
|
-
readonly extension?: string | null | undefined;
|
|
1848
|
-
readonly fileName?: string | null | undefined;
|
|
1849
|
-
}> | null | undefined;
|
|
1850
1765
|
readonly context?: {
|
|
1851
1766
|
readonly signer?: {
|
|
1852
1767
|
readonly signatures: ReadonlyArray<string>;
|
|
@@ -1974,13 +1889,6 @@ type GetDocumentOperationsQuery = {
|
|
|
1974
1889
|
readonly timestampUtcMs: string;
|
|
1975
1890
|
readonly input: NonNullable<unknown>;
|
|
1976
1891
|
readonly scope: string;
|
|
1977
|
-
readonly attachments?: ReadonlyArray<{
|
|
1978
|
-
readonly data: string;
|
|
1979
|
-
readonly mimeType: string;
|
|
1980
|
-
readonly hash: string;
|
|
1981
|
-
readonly extension?: string | null | undefined;
|
|
1982
|
-
readonly fileName?: string | null | undefined;
|
|
1983
|
-
}> | null | undefined;
|
|
1984
1892
|
readonly context?: {
|
|
1985
1893
|
readonly signer?: {
|
|
1986
1894
|
readonly signatures: ReadonlyArray<string>;
|
|
@@ -2278,13 +2186,6 @@ type PollSyncEnvelopesQuery = {
|
|
|
2278
2186
|
readonly timestampUtcMs: string;
|
|
2279
2187
|
readonly input: NonNullable<unknown>;
|
|
2280
2188
|
readonly scope: string;
|
|
2281
|
-
readonly attachments?: ReadonlyArray<{
|
|
2282
|
-
readonly data: string;
|
|
2283
|
-
readonly mimeType: string;
|
|
2284
|
-
readonly hash: string;
|
|
2285
|
-
readonly extension?: string | null | undefined;
|
|
2286
|
-
readonly fileName?: string | null | undefined;
|
|
2287
|
-
}> | null | undefined;
|
|
2288
2189
|
readonly context?: {
|
|
2289
2190
|
readonly signer?: {
|
|
2290
2191
|
readonly signatures: ReadonlyArray<string>;
|
|
@@ -2365,8 +2266,6 @@ type ResolversTypes = ResolversObject<{
|
|
|
2365
2266
|
ActionContext: ResolverTypeWrapper<ActionContext>;
|
|
2366
2267
|
ActionContextInput: ActionContextInput;
|
|
2367
2268
|
ActionInput: ActionInput;
|
|
2368
|
-
Attachment: ResolverTypeWrapper<Attachment>;
|
|
2369
|
-
AttachmentInput: AttachmentInput;
|
|
2370
2269
|
Boolean: ResolverTypeWrapper<Scalars["Boolean"]["output"]>;
|
|
2371
2270
|
ChannelMeta: ResolverTypeWrapper<ChannelMeta>;
|
|
2372
2271
|
ChannelMetaInput: ChannelMetaInput;
|
|
@@ -2425,8 +2324,6 @@ type ResolversParentTypes = ResolversObject<{
|
|
|
2425
2324
|
ActionContext: ActionContext;
|
|
2426
2325
|
ActionContextInput: ActionContextInput;
|
|
2427
2326
|
ActionInput: ActionInput;
|
|
2428
|
-
Attachment: Attachment;
|
|
2429
|
-
AttachmentInput: AttachmentInput;
|
|
2430
2327
|
Boolean: Scalars["Boolean"]["output"];
|
|
2431
2328
|
ChannelMeta: ChannelMeta;
|
|
2432
2329
|
ChannelMetaInput: ChannelMetaInput;
|
|
@@ -2477,7 +2374,6 @@ type ResolversParentTypes = ResolversObject<{
|
|
|
2477
2374
|
ViewFilterInput: ViewFilterInput;
|
|
2478
2375
|
}>;
|
|
2479
2376
|
type ActionResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Action"] = ResolversParentTypes["Action"]> = ResolversObject<{
|
|
2480
|
-
attachments?: Resolver<Maybe<ReadonlyArray<ResolversTypes["Attachment"]>>, ParentType, ContextType>;
|
|
2481
2377
|
context?: Resolver<Maybe<ResolversTypes["ActionContext"]>, ParentType, ContextType>;
|
|
2482
2378
|
id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2483
2379
|
input?: Resolver<ResolversTypes["JSONObject"], ParentType, ContextType>;
|
|
@@ -2488,13 +2384,6 @@ type ActionResolvers<ContextType = Context, ParentType extends ResolversParentTy
|
|
|
2488
2384
|
type ActionContextResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ActionContext"] = ResolversParentTypes["ActionContext"]> = ResolversObject<{
|
|
2489
2385
|
signer?: Resolver<Maybe<ResolversTypes["ReactorSigner"]>, ParentType, ContextType>;
|
|
2490
2386
|
}>;
|
|
2491
|
-
type AttachmentResolvers<ContextType = Context, ParentType extends ResolversParentTypes["Attachment"] = ResolversParentTypes["Attachment"]> = ResolversObject<{
|
|
2492
|
-
data?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2493
|
-
extension?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
2494
|
-
fileName?: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
|
|
2495
|
-
hash?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2496
|
-
mimeType?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2497
|
-
}>;
|
|
2498
2387
|
type ChannelMetaResolvers<ContextType = Context, ParentType extends ResolversParentTypes["ChannelMeta"] = ResolversParentTypes["ChannelMeta"]> = ResolversObject<{
|
|
2499
2388
|
id?: Resolver<ResolversTypes["String"], ParentType, ContextType>;
|
|
2500
2389
|
}>;
|
|
@@ -2676,7 +2565,6 @@ type TouchChannelResultResolvers<ContextType = Context, ParentType extends Resol
|
|
|
2676
2565
|
type Resolvers<ContextType = Context> = ResolversObject<{
|
|
2677
2566
|
Action?: ActionResolvers<ContextType>;
|
|
2678
2567
|
ActionContext?: ActionContextResolvers<ContextType>;
|
|
2679
|
-
Attachment?: AttachmentResolvers<ContextType>;
|
|
2680
2568
|
ChannelMeta?: ChannelMetaResolvers<ContextType>;
|
|
2681
2569
|
DateTime?: GraphQLScalarType;
|
|
2682
2570
|
DeadLetterInfo?: DeadLetterInfoResolvers<ContextType>;
|
|
@@ -2716,7 +2604,6 @@ declare const PropagationModeSchema: z$1.ZodEnum<typeof PropagationMode>;
|
|
|
2716
2604
|
declare const SyncEnvelopeTypeSchema: z$1.ZodEnum<typeof SyncEnvelopeType>;
|
|
2717
2605
|
declare function ActionContextInputSchema(): z$1.ZodObject<Properties<ActionContextInput>>;
|
|
2718
2606
|
declare function ActionInputSchema(): z$1.ZodObject<Properties<ActionInput>>;
|
|
2719
|
-
declare function AttachmentInputSchema(): z$1.ZodObject<Properties<AttachmentInput>>;
|
|
2720
2607
|
declare function ChannelMetaInputSchema(): z$1.ZodObject<Properties<ChannelMetaInput>>;
|
|
2721
2608
|
declare function DocumentOperationsFilterInputSchema(): z$1.ZodObject<Properties<DocumentOperationsFilterInput>>;
|
|
2722
2609
|
declare function OperationContextInputSchema(): z$1.ZodObject<Properties<OperationContextInput>>;
|
|
@@ -3054,6 +2941,11 @@ type Options = {
|
|
|
3054
2941
|
attachmentStoragePath?: string;
|
|
3055
2942
|
};
|
|
3056
2943
|
type ProcessorInitializer = ProcessorFactoryBuilder;
|
|
2944
|
+
/**
|
|
2945
|
+
* Doc-perms require auth: with auth off no `user` is ever resolved, so every
|
|
2946
|
+
* authorization check fails closed. Refuse to boot rather than run broken.
|
|
2947
|
+
*/
|
|
2948
|
+
declare function assertAuthRequiredForDocumentPermissions(authEnabled: boolean, documentPermissionsRequested: boolean): void;
|
|
3057
2949
|
/**
|
|
3058
2950
|
* Initializes and starts the API server using an initializer function.
|
|
3059
2951
|
* This function first loads packages to get document models, then calls the initializer function
|
|
@@ -3077,6 +2969,7 @@ declare function initializeAndStartAPI(clientInitializer: (documentModels: Docum
|
|
|
3077
2969
|
client: IReactorClient;
|
|
3078
2970
|
syncManager: ISyncManager;
|
|
3079
2971
|
documentModelRegistry: IDocumentModelRegistry;
|
|
2972
|
+
readiness: ReadinessGate;
|
|
3080
2973
|
}>;
|
|
3081
2974
|
//#endregion
|
|
3082
2975
|
//#region src/utils/create-schema.d.ts
|
|
@@ -3112,5 +3005,5 @@ interface DocumentModelSchemaOptions {
|
|
|
3112
3005
|
*/
|
|
3113
3006
|
declare function generateDocumentModelSchema(documentModel: DocumentModelGlobalState$1, options?: DocumentModelSchemaOptions): DocumentNode;
|
|
3114
3007
|
//#endregion
|
|
3115
|
-
export { ADMIN_USERS, API, Action, ActionContext, ActionContextInput, ActionContextInputSchema, ActionContextResolvers, ActionInput, ActionInputSchema, ActionResolvers, AddRelationshipDocument, AddRelationshipMutation, AddRelationshipMutationVariables, AnalyticsSubgraph,
|
|
3008
|
+
export { ADMIN_USERS, API, Action, ActionContext, ActionContextInput, ActionContextInputSchema, ActionContextResolvers, ActionInput, ActionInputSchema, ActionResolvers, AddRelationshipDocument, AddRelationshipMutation, AddRelationshipMutationVariables, AnalyticsSubgraph, AuthConfig, AuthContext, AuthFetchMiddleware, AuthService, AuthSubgraph, BaseSubgraph, ChannelMeta, ChannelMetaInput, ChannelMetaInputSchema, ChannelMetaResolvers, ClientInitializerResult, Context, CreateDocumentDocument, CreateDocumentMutation, CreateDocumentMutationVariables, CreateEmptyDocumentDocument, CreateEmptyDocumentMutation, CreateEmptyDocumentMutationVariables, DateTimeScalarConfig, DbClient, DeadLetterInfo, DeadLetterInfoResolvers, DeleteDocumentDocument, DeleteDocumentMutation, DeleteDocumentMutationVariables, DeleteDocumentsDocument, DeleteDocumentsMutation, DeleteDocumentsMutationVariables, DirectiveResolverFn, DocumentChangeContext, DocumentChangeContextResolvers, DocumentChangeEvent, DocumentChangeEventResolvers, DocumentChangeType, DocumentChangeTypeSchema, DocumentChangesDocument, DocumentChangesSubscription, DocumentChangesSubscriptionVariables, DocumentGroupPermissionEntry, DocumentGroupPermissionTable, DocumentModelGlobalState, DocumentModelGlobalStateResolvers, DocumentModelResultPage, DocumentModelResultPageResolvers, DocumentModelSchemaOptions, DocumentOperationsFilterInput, DocumentOperationsFilterInputSchema, DocumentPermissionConfig, DocumentPermissionDatabase, DocumentPermissionEntry, DocumentPermissionLevel, DocumentPermissionService, DocumentPermissionTable, DocumentProtectionTable, DocumentWithChildren, DocumentWithChildrenResolvers, Exact, FetchHandler, FindDocumentsDocument, FindDocumentsQuery, FindDocumentsQueryVariables, GatewayAdapterType, GatewayContextFactory, GetDocumentDocument, GetDocumentIncomingRelationshipsDocument, GetDocumentIncomingRelationshipsQuery, GetDocumentIncomingRelationshipsQueryVariables, GetDocumentModelsDocument, GetDocumentModelsQuery, GetDocumentModelsQueryVariables, GetDocumentOperationsDocument, GetDocumentOperationsQuery, GetDocumentOperationsQueryVariables, GetDocumentOutgoingRelationshipsDocument, GetDocumentOutgoingRelationshipsQuery, GetDocumentOutgoingRelationshipsQueryVariables, GetDocumentQuery, GetDocumentQueryVariables, GetDocumentWithOperationsDocument, GetDocumentWithOperationsQuery, GetDocumentWithOperationsQueryVariables, GetJobStatusDocument, GetJobStatusQuery, GetJobStatusQueryVariables, GetParentIdsFn, GqlDocument, GqlDriveDocument, GqlOperation, GqlOperationContext, GqlSigner, GqlSignerApp, GqlSignerUser, GraphQLManager, GraphqlManagerFeatureFlags, Group, GroupTable, HttpAdapterSetup, HttpAdapterType, HttpDocumentModelLoader, HttpPackageLoader, HttpPackageLoaderLogger, HttpPackageLoaderOptions, IGatewayAdapter, IHttpAdapter, type IPackageLoader, type IPackageLoaderOptions, IPackageStorage, IReactorProcessorHostModule, ISubgraph, ImportPackageLoader, InMemoryPackageStorage, Incremental, InputMaybe, InstallPackageResult, InstalledPackageInfo, IsTypeOfResolverFn, JobChangeEvent, JobChangeEventResolvers, JobChangesDocument, JobChangesSubscription, JobChangesSubscriptionVariables, JobInfo, JobInfoResolvers, JsonObjectScalarConfig, MakeEmpty, MakeMaybe, MakeOptional, Maybe, MoveRelationshipDocument, MoveRelationshipMutation, MoveRelationshipMutationVariables, MoveRelationshipResult, MoveRelationshipResultResolvers, MutateDocumentAsyncDocument, MutateDocumentAsyncMutation, MutateDocumentAsyncMutationVariables, MutateDocumentDocument, MutateDocumentMutation, MutateDocumentMutationVariables, Mutation, MutationAddRelationshipArgs, MutationCreateDocumentArgs, MutationCreateEmptyDocumentArgs, MutationDeleteDocumentArgs, MutationDeleteDocumentsArgs, MutationMoveRelationshipArgs, MutationMutateDocumentArgs, MutationMutateDocumentAsyncArgs, MutationPushSyncEnvelopesArgs, MutationRemoveRelationshipArgs, MutationRenameDocumentArgs, MutationResolvers, MutationSetPreferredEditorArgs, MutationTouchChannelArgs, NextResolverFn, OperationContext, OperationContextInput, OperationContextInputSchema, OperationContextResolvers, OperationGroupPermissionEntry, OperationGroupPermissionTable, OperationInput, OperationInputSchema, OperationUserPermissionEntry, OperationUserPermissionTable, OperationWithContext, OperationWithContextInput, OperationWithContextInputSchema, OperationWithContextResolvers, OperationsFilterInput, OperationsFilterInputSchema, PackageManagementService, PackageManagementServiceOptions, PackageManager, PackagesSubgraph, type PackagesSubgraphArgs, PagingInput, PagingInputSchema, type ParsedDriveUrl, PgliteFactory, PhDocument, PhDocumentFieldsFragment, PhDocumentFieldsFragmentDoc, PhDocumentOperationsArgs, PhDocumentResolvers, PhDocumentResultPage, PhDocumentResultPageResolvers, PollSyncEnvelopesDocument, PollSyncEnvelopesQuery, PollSyncEnvelopesQueryVariables, PollSyncEnvelopesResult, PollSyncEnvelopesResultResolvers, Processor, ProcessorDriveFactory, ProcessorFactoryBuilder, PropagationMode, PropagationModeSchema, PushSyncEnvelopesDocument, PushSyncEnvelopesMutation, PushSyncEnvelopesMutationVariables, Query, QueryDocumentArgs, QueryDocumentIncomingRelationshipsArgs, QueryDocumentModelsArgs, QueryDocumentOperationsArgs, QueryDocumentOutgoingRelationshipsArgs, QueryFindDocumentsArgs, QueryJobStatusArgs, QueryPollSyncEnvelopesArgs, QueryResolvers, ReactorModule, ReactorOperation, ReactorOperationResolvers, ReactorOperationResultPage, ReactorOperationResultPageResolvers, ReactorSigner, ReactorSignerApp, ReactorSignerAppInput, ReactorSignerAppInputSchema, ReactorSignerAppResolvers, ReactorSignerInput, ReactorSignerInputSchema, ReactorSignerResolvers, ReactorSignerUser, ReactorSignerUserInput, ReactorSignerUserInputSchema, ReactorSignerUserResolvers, ReactorSubgraph, ReadinessGate, RemoteCursor, RemoteCursorInput, RemoteCursorInputSchema, RemoteCursorResolvers, RemoteFilterInput, RemoteFilterInputSchema, RemoveRelationshipDocument, RemoveRelationshipMutation, RemoveRelationshipMutationVariables, RenameDocumentDocument, RenameDocumentMutation, RenameDocumentMutationVariables, Requester, RequireFields, Resolver, ResolverFn, ResolverTypeWrapper, ResolverWithResolve, Resolvers, ResolversObject, ResolversParentTypes, ResolversTypes, Revision, RevisionResolvers, Scalars, Sdk, SearchFilterInput, SearchFilterInputSchema, SetPreferredEditorDocument, SetPreferredEditorMutation, SetPreferredEditorMutationVariables, SubgraphArgs, SubgraphClass, SubgraphDefinition, Subscription, SubscriptionDocumentChangesArgs, SubscriptionJobChangesArgs, SubscriptionObject, SubscriptionResolveFn, SubscriptionResolver, SubscriptionResolverObject, SubscriptionResolvers, SubscriptionSubscribeFn, SubscriptionSubscriberObject, SyncEnvelope, SyncEnvelopeInput, SyncEnvelopeInputSchema, SyncEnvelopeResolvers, SyncEnvelopeType, SyncEnvelopeTypeSchema, SystemSubgraph, TlsOptions, TouchChannelDocument, TouchChannelInput, TouchChannelInputSchema, TouchChannelMutation, TouchChannelMutationVariables, TouchChannelResult, TouchChannelResultResolvers, TypeResolveFn, User, UserGroupTable, ViewFilterInput, ViewFilterInputSchema, WithIndex, WsContextFactory, WsDisposer, assertAuthRequiredForDocumentPermissions, buildGraphQlDocument, buildGraphQlDriveDocument, buildGraphqlOperation, buildGraphqlOperations, buildSubgraphSchemaModule, createAuthFetchMiddleware, createGatewayAdapter, createHttpAdapter, createMergedSchema, createReactorGraphQLClient, createSchema, definedNonNullAnySchema, driveIdFromUrl, extractSubgraphsFromModule, generateDocumentModelSchema, getAuthContext, getDbClient, getDocumentModelSchemaName, getDocumentModelTypeDefs, getGitHash, getGitUrl, getSdk, getUniqueDocumentModels, getVersion, initAnalyticsStoreSql, initializeAndStartAPI, isDefinedNonNullAny, isExpectedLoaderMiss, isSubgraphClass, parseDriveUrl, renderGraphqlPlayground };
|
|
3116
3009
|
//# sourceMappingURL=index.d.mts.map
|