@powerhousedao/reactor-api 1.12.1 → 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 CHANGED
@@ -1,12 +1,20 @@
1
- ## 1.12.1 (2024-12-18)
1
+ ## 1.14.0 (2025-01-06)
2
2
 
3
- ### 🩹 Fixes
3
+ ### 🚀 Features
4
+
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))
7
+
8
+ ### 🧱 Updated Dependencies
4
9
 
5
- - **reactor-api:** update graphql dependency ([ed063402](https://github.com/powerhouse-inc/powerhouse/commit/ed063402))
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
6
14
 
7
15
  ### ❤️ Thank You
8
16
 
9
- - Frank
17
+ - Guillermo Puente Sandoval @gpuente
10
18
 
11
19
  ## 1.2.0 (2024-10-29)
12
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 as GraphQLResolverMap$1 } from '@apollo/subgraph/dist/schema-helper/resolverMap.js';
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: GraphQLResolverMap<Context>;
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,29 +348,52 @@ declare class AnalyticsSubgraph extends Subgraph {
347
348
  analyticsModel: AnalyticsModel;
348
349
  name: string;
349
350
  typeDefs: graphql.DocumentNode;
350
- resolvers: GraphQLResolverMap$1<Context>;
351
+ resolvers: GraphQLResolverMap<Context>;
351
352
  constructor(args: SubgraphArgs);
352
353
  onSetup(): Promise<void>;
353
354
  }
354
355
 
355
- type index$2_AnalyticsSubgraph = AnalyticsSubgraph;
356
- declare const index$2_AnalyticsSubgraph: typeof AnalyticsSubgraph;
357
- declare namespace index$2 {
358
- export { index$2_AnalyticsSubgraph as AnalyticsSubgraph };
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$1_DriveSubgraph = DriveSubgraph;
368
- declare const index$1_DriveSubgraph: typeof DriveSubgraph;
369
- declare namespace index$1 {
370
- export { index$1_DriveSubgraph as DriveSubgraph };
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 };
371
372
  }
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;
388
+ }
389
+ type AuthContext = Context & {
390
+ session: Session;
391
+ };
392
+
393
+ type SystemContext = AuthContext & {
394
+ isAdmin: (ctx: AuthContext) => boolean;
395
+ };
396
+
373
397
  declare class SystemSubgraph extends Subgraph {
374
398
  name: string;
375
399
  typeDefs: graphql.DocumentNode;
@@ -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 };
384
415
  }
385
416
 
386
- type index_SystemSubgraph = SystemSubgraph;
387
- declare const index_SystemSubgraph: typeof SystemSubgraph;
417
+ declare class AuthSubgraph extends Subgraph {
418
+ #private;
419
+ name: string;
420
+ typeDefs: graphql.DocumentNode;
421
+ resolvers: GraphQLResolverMap$1<AuthContext>;
422
+ onSetup(): Promise<void>;
423
+ }
424
+
425
+ type index_AuthSubgraph = AuthSubgraph;
426
+ declare const index_AuthSubgraph: typeof AuthSubgraph;
388
427
  declare namespace index {
389
- export { index_SystemSubgraph as SystemSubgraph };
428
+ export { index_AuthSubgraph as AuthSubgraph };
390
429
  }
391
430
 
392
431
  type SubgraphClass = typeof Subgraph;
@@ -448,9 +487,15 @@ 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
 
493
+ declare abstract class OperationalProcessor<D extends Document = Document, S extends OperationScope = OperationScope> extends Processor<D, S> {
494
+ protected operationalStore: Db;
495
+ constructor(args: ProcessorSetupArgs, options?: ProcessorOptions);
496
+ onSetup(args: ProcessorSetupArgs): void;
497
+ }
498
+
454
499
  declare class ProcessorManager implements IProcessorManager {
455
500
  #private;
456
501
  private operationalStore;
@@ -461,4 +506,4 @@ declare class ProcessorManager implements IProcessorManager {
461
506
  registerProcessor(module: IProcessor | ProcessorClass): Promise<IProcessor>;
462
507
  }
463
508
 
464
- export { type API, AnalyticsProcessor, BaseProcessor, type Context, type Db, type IProcessor, type IProcessorManager, type ISubgraph, Processor, type ProcessorClass, ProcessorManager, type ProcessorOptions, type ProcessorSetupArgs, type ProcessorType, type ProcessorUpdate, Subgraph, type SubgraphArgs, type SubgraphClass, SubgraphManager, index$2 as analyticsSubgraph, createSchema, index$1 as driveSubgraph, getDbClient, getDocumentModelTypeDefs, isProcessorClass, isSubgraphClass, startAPI, index as systemSubgraph };
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 };