@powerhousedao/reactor-api 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -13
- package/dist/index.d.ts +58 -19
- package/dist/index.js +1221 -4159
- package/dist/index.js.map +1 -1
- package/package.json +14 -5
- package/src/subgraphs/auth/env/getters.ts +30 -0
- package/src/subgraphs/auth/env/index.ts +15 -0
- package/src/subgraphs/auth/index.ts +323 -0
- package/src/subgraphs/auth/types.ts +39 -0
- package/src/subgraphs/auth/utils/helpers.ts +136 -0
- package/src/subgraphs/auth/utils/session.ts +149 -0
- package/src/subgraphs/auth/utils/user.ts +40 -0
- package/src/subgraphs/base/index.ts +4 -1
- package/src/subgraphs/index.ts +1 -0
- package/src/subgraphs/manager.ts +4 -2
- package/src/subgraphs/system/env/getters.ts +7 -0
- package/src/subgraphs/system/env/index.ts +6 -0
- package/src/subgraphs/system/index.ts +26 -1
- package/src/subgraphs/system/types.ts +5 -0
- package/src/utils/db.ts +4 -3
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
## 1.
|
|
1
|
+
## 1.14.0 (2025-01-06)
|
|
2
2
|
|
|
3
3
|
### 🚀 Features
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- **
|
|
7
|
-
- **reactor-api:** added operational processor ([e3dfb4da](https://github.com/powerhouse-inc/powerhouse/commit/e3dfb4da))
|
|
8
|
-
|
|
9
|
-
### 🩹 Fixes
|
|
10
|
-
|
|
11
|
-
- **reactor-api:** set proper operational datasource ([d040acfb](https://github.com/powerhouse-inc/powerhouse/commit/d040acfb))
|
|
5
|
+
- removed document-model editor v1 ([#745](https://github.com/powerhouse-inc/powerhouse/pull/745))
|
|
6
|
+
- **reactor-browser:** initial package setup ([ad637dcb](https://github.com/powerhouse-inc/powerhouse/commit/ad637dcb))
|
|
12
7
|
|
|
13
8
|
### 🧱 Updated Dependencies
|
|
14
9
|
|
|
15
|
-
- Updated document-model-libs to 1.
|
|
16
|
-
- Updated document-drive to 1.
|
|
17
|
-
- Updated
|
|
10
|
+
- Updated document-model-libs to 1.125.0
|
|
11
|
+
- Updated document-drive to 1.13.0
|
|
12
|
+
- Updated document-model to 2.15.0
|
|
13
|
+
- Updated @powerhousedao/scalars to 1.16.0
|
|
18
14
|
|
|
19
15
|
### ❤️ Thank You
|
|
20
16
|
|
|
21
|
-
-
|
|
22
|
-
- Frank
|
|
17
|
+
- Guillermo Puente Sandoval @gpuente
|
|
23
18
|
|
|
24
19
|
## 1.2.0 (2024-10-29)
|
|
25
20
|
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ import { IncomingHttpHeaders } from 'http';
|
|
|
11
11
|
import * as graphql from 'graphql';
|
|
12
12
|
import { DocumentNode } from 'graphql';
|
|
13
13
|
import { Knex } from 'knex';
|
|
14
|
-
import { GraphQLResolverMap } from '@apollo/subgraph/dist/schema-helper';
|
|
14
|
+
import { GraphQLResolverMap as GraphQLResolverMap$1 } from '@apollo/subgraph/dist/schema-helper';
|
|
15
15
|
import { AnalyticsModel } from '@powerhousedao/analytics-engine-graphql';
|
|
16
|
-
import { GraphQLResolverMap
|
|
16
|
+
import { GraphQLResolverMap } from '@apollo/subgraph/dist/schema-helper/resolverMap.js';
|
|
17
17
|
|
|
18
18
|
type StrandUpdateSource = {
|
|
19
19
|
type: "local";
|
|
@@ -333,9 +333,10 @@ type SubgraphArgs = {
|
|
|
333
333
|
|
|
334
334
|
declare class Subgraph implements ISubgraph {
|
|
335
335
|
name: string;
|
|
336
|
-
resolvers:
|
|
336
|
+
resolvers: Record<string, any>;
|
|
337
337
|
typeDefs: DocumentNode;
|
|
338
338
|
reactor: IDocumentDriveServer;
|
|
339
|
+
subgraphManager: SubgraphManager;
|
|
339
340
|
operationalStore: Db;
|
|
340
341
|
constructor(args: SubgraphArgs);
|
|
341
342
|
onSetup(): Promise<void>;
|
|
@@ -347,28 +348,51 @@ declare class AnalyticsSubgraph extends Subgraph {
|
|
|
347
348
|
analyticsModel: AnalyticsModel;
|
|
348
349
|
name: string;
|
|
349
350
|
typeDefs: graphql.DocumentNode;
|
|
350
|
-
resolvers: GraphQLResolverMap
|
|
351
|
+
resolvers: GraphQLResolverMap<Context>;
|
|
351
352
|
constructor(args: SubgraphArgs);
|
|
352
353
|
onSetup(): Promise<void>;
|
|
353
354
|
}
|
|
354
355
|
|
|
355
|
-
type index$
|
|
356
|
-
declare const index$
|
|
357
|
-
declare namespace index$
|
|
358
|
-
export { index$
|
|
356
|
+
type index$3_AnalyticsSubgraph = AnalyticsSubgraph;
|
|
357
|
+
declare const index$3_AnalyticsSubgraph: typeof AnalyticsSubgraph;
|
|
358
|
+
declare namespace index$3 {
|
|
359
|
+
export { index$3_AnalyticsSubgraph as AnalyticsSubgraph };
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
declare class DriveSubgraph extends Subgraph {
|
|
362
363
|
name: string;
|
|
363
364
|
typeDefs: graphql.DocumentNode;
|
|
364
|
-
resolvers: GraphQLResolverMap<Context>;
|
|
365
|
+
resolvers: GraphQLResolverMap$1<Context>;
|
|
365
366
|
}
|
|
366
367
|
|
|
367
|
-
type index$
|
|
368
|
-
declare const index$
|
|
369
|
-
declare namespace index$
|
|
370
|
-
export { index$
|
|
368
|
+
type index$2_DriveSubgraph = DriveSubgraph;
|
|
369
|
+
declare const index$2_DriveSubgraph: typeof DriveSubgraph;
|
|
370
|
+
declare namespace index$2 {
|
|
371
|
+
export { index$2_DriveSubgraph as DriveSubgraph };
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
interface Session {
|
|
375
|
+
id: string;
|
|
376
|
+
userId: string;
|
|
377
|
+
address: string;
|
|
378
|
+
name?: string;
|
|
379
|
+
expiresAt: string;
|
|
380
|
+
createdAt: string;
|
|
381
|
+
updatedAt: string;
|
|
382
|
+
revokedAt: string | null;
|
|
383
|
+
allowedOrigins: string;
|
|
384
|
+
referenceExpiryDate: string;
|
|
385
|
+
referenceTokenId: string;
|
|
386
|
+
isUserCreated: boolean;
|
|
387
|
+
createdBy: string;
|
|
371
388
|
}
|
|
389
|
+
type AuthContext = Context & {
|
|
390
|
+
session: Session;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
type SystemContext = AuthContext & {
|
|
394
|
+
isAdmin: (ctx: AuthContext) => boolean;
|
|
395
|
+
};
|
|
372
396
|
|
|
373
397
|
declare class SystemSubgraph extends Subgraph {
|
|
374
398
|
name: string;
|
|
@@ -378,15 +402,30 @@ declare class SystemSubgraph extends Subgraph {
|
|
|
378
402
|
drives: () => Promise<string[]>;
|
|
379
403
|
};
|
|
380
404
|
Mutation: {
|
|
381
|
-
addDrive: (parent: unknown, args: DriveInput) => Promise<document_model_libs_document_drive.DocumentDriveState>;
|
|
405
|
+
addDrive: (parent: unknown, args: DriveInput, ctx: SystemContext) => Promise<document_model_libs_document_drive.DocumentDriveState>;
|
|
382
406
|
};
|
|
383
407
|
};
|
|
408
|
+
onSetup(): Promise<void>;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
type index$1_SystemSubgraph = SystemSubgraph;
|
|
412
|
+
declare const index$1_SystemSubgraph: typeof SystemSubgraph;
|
|
413
|
+
declare namespace index$1 {
|
|
414
|
+
export { index$1_SystemSubgraph as SystemSubgraph };
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
declare class AuthSubgraph extends Subgraph {
|
|
418
|
+
#private;
|
|
419
|
+
name: string;
|
|
420
|
+
typeDefs: graphql.DocumentNode;
|
|
421
|
+
resolvers: GraphQLResolverMap$1<AuthContext>;
|
|
422
|
+
onSetup(): Promise<void>;
|
|
384
423
|
}
|
|
385
424
|
|
|
386
|
-
type
|
|
387
|
-
declare const
|
|
425
|
+
type index_AuthSubgraph = AuthSubgraph;
|
|
426
|
+
declare const index_AuthSubgraph: typeof AuthSubgraph;
|
|
388
427
|
declare namespace index {
|
|
389
|
-
export {
|
|
428
|
+
export { index_AuthSubgraph as AuthSubgraph };
|
|
390
429
|
}
|
|
391
430
|
|
|
392
431
|
type SubgraphClass = typeof Subgraph;
|
|
@@ -448,7 +487,7 @@ type Options = {
|
|
|
448
487
|
};
|
|
449
488
|
declare function startAPI(reactor: IDocumentDriveServer, options: Options): Promise<API>;
|
|
450
489
|
|
|
451
|
-
declare const createSchema: (documentDriveServer: IDocumentDriveServer, resolvers: GraphQLResolverMap<Context>, typeDefs: DocumentNode) => graphql.GraphQLSchema;
|
|
490
|
+
declare const createSchema: (documentDriveServer: IDocumentDriveServer, resolvers: GraphQLResolverMap$1<Context>, typeDefs: DocumentNode) => graphql.GraphQLSchema;
|
|
452
491
|
declare const getDocumentModelTypeDefs: (documentDriveServer: IDocumentDriveServer, typeDefs: DocumentNode) => DocumentNode;
|
|
453
492
|
|
|
454
493
|
declare abstract class OperationalProcessor<D extends Document = Document, S extends OperationScope = OperationScope> extends Processor<D, S> {
|
|
@@ -467,4 +506,4 @@ declare class ProcessorManager implements IProcessorManager {
|
|
|
467
506
|
registerProcessor(module: IProcessor | ProcessorClass): Promise<IProcessor>;
|
|
468
507
|
}
|
|
469
508
|
|
|
470
|
-
export { type API, AnalyticsProcessor, BaseProcessor, type Context, type Db, type IProcessor, type IProcessorManager, type ISubgraph, OperationalProcessor, Processor, type ProcessorClass, ProcessorManager, type ProcessorOptions, type ProcessorSetupArgs, type ProcessorType, type ProcessorUpdate, Subgraph, type SubgraphArgs, type SubgraphClass, SubgraphManager, index$
|
|
509
|
+
export { type API, AnalyticsProcessor, BaseProcessor, type Context, type Db, type IProcessor, type IProcessorManager, type ISubgraph, OperationalProcessor, Processor, type ProcessorClass, ProcessorManager, type ProcessorOptions, type ProcessorSetupArgs, type ProcessorType, type ProcessorUpdate, Subgraph, type SubgraphArgs, type SubgraphClass, SubgraphManager, index$3 as analyticsSubgraph, index as authSubgraph, createSchema, index$2 as driveSubgraph, getDbClient, getDocumentModelTypeDefs, isProcessorClass, isSubgraphClass, startAPI, index$1 as systemSubgraph };
|