@powerhousedao/reactor-api 1.27.0 → 1.28.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/dist/src/subgraphs/auth/utils/session.d.ts +4 -4
- package/dist/src/subgraphs/auth/utils/session.d.ts.map +1 -1
- package/dist/src/subgraphs/manager.d.ts +5 -5
- package/dist/src/subgraphs/manager.d.ts.map +1 -1
- package/dist/src/subgraphs/manager.js +5 -1
- package/dist/src/subgraphs/system/index.d.ts +2 -2
- package/dist/src/subgraphs/system/index.d.ts.map +1 -1
- package/dist/src/subgraphs/system/index.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Session } from "../types.js";
|
|
1
|
+
import { type Context } from "#subgraphs/types.js";
|
|
2
|
+
import { type Db } from "#types.js";
|
|
3
|
+
import { type SiweMessage } from "siwe";
|
|
4
|
+
import { type Session } from "../types.js";
|
|
5
5
|
export declare const createAuthenticationSession: (db: Db, userId: string, allowedOrigins?: string[]) => Promise<{
|
|
6
6
|
token: string;
|
|
7
7
|
session: number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/subgraphs/auth/utils/session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/subgraphs/auth/utils/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAO3C,eAAO,MAAM,2BAA2B,OAClC,EAAE,UACE,MAAM;;;EAef,CAAC;AAEF,eAAO,MAAM,mBAAmB,OAC1B,EAAE,UACE,MAAM,WACL;IACP,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;;;EAIF,CAAC;AAEF,eAAO,MAAM,YAAY,OAAc,EAAE,UAAU,MAAM,uBAExD,CAAC;AAEF,eAAO,MAAM,MAAM,OAAc,EAAE,aAAa,MAAM,UAAU,MAAM,kBAwBrE,CAAC;AAEF,eAAO,MAAM,YAAY,YAAmB,OAAO,qBAYlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,OACxB,EAAE,WACG,MAAM,UACP,MAAM,qBAoCf,CAAC;AAEF,eAAO,MAAM,eAAe,kBACX,WAAW,aACf,MAAM,yCAWlB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Db } from "#types.js";
|
|
2
|
-
import { IAnalyticsStore } from "@powerhousedao/analytics-engine-core";
|
|
3
|
-
import { IDocumentDriveServer } from "document-drive";
|
|
4
|
-
import express from "express";
|
|
5
|
-
import { SubgraphClass } from "./index.js";
|
|
1
|
+
import { type Db } from "#types.js";
|
|
2
|
+
import { type IAnalyticsStore } from "@powerhousedao/analytics-engine-core";
|
|
3
|
+
import { type IDocumentDriveServer } from "document-drive";
|
|
4
|
+
import type express from "express";
|
|
5
|
+
import { type SubgraphClass } from "./index.js";
|
|
6
6
|
export declare class SubgraphManager {
|
|
7
7
|
#private;
|
|
8
8
|
private readonly path;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/subgraphs/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/subgraphs/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAKnC,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAI/D,qBAAa,eAAe;;IAMxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc;IATjC,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,aAAa,CAA2B;IAChD,OAAO,CAAC,SAAS,CAAkB;gBAGhB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,OAAO,CAAC,OAAO,EACpB,OAAO,EAAE,oBAAoB,EAC7B,gBAAgB,EAAE,EAAE,EACpB,cAAc,EAAE,eAAe;IAS5C,IAAI;IAqBJ,YAAY;IA+CZ,gBAAgB,CAAC,QAAQ,EAAE,aAAa;IAmB9C,0BAA0B,4BAExB;IAEF,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGvD"}
|
|
@@ -2,6 +2,7 @@ import { createSchema } from "#utils/create-schema.js";
|
|
|
2
2
|
import { ApolloServer } from "@apollo/server";
|
|
3
3
|
import { expressMiddleware } from "@apollo/server/express4";
|
|
4
4
|
import { ApolloServerPluginInlineTraceDisabled } from "@apollo/server/plugin/disabled";
|
|
5
|
+
import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin/landingPage/default";
|
|
5
6
|
import bodyParser from "body-parser";
|
|
6
7
|
import cors from "cors";
|
|
7
8
|
import { Router } from "express";
|
|
@@ -58,7 +59,10 @@ export class SubgraphManager {
|
|
|
58
59
|
const server = new ApolloServer({
|
|
59
60
|
schema,
|
|
60
61
|
introspection: true,
|
|
61
|
-
plugins: [
|
|
62
|
+
plugins: [
|
|
63
|
+
ApolloServerPluginInlineTraceDisabled(),
|
|
64
|
+
ApolloServerPluginLandingPageLocalDefault(),
|
|
65
|
+
],
|
|
62
66
|
});
|
|
63
67
|
// start apollo server
|
|
64
68
|
await server.start();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Subgraph } from "#subgraphs/base/index.js";
|
|
2
|
-
import { DriveInput } from "document-drive";
|
|
3
|
-
import { SystemContext } from "./types.js";
|
|
2
|
+
import { type DriveInput } from "document-drive";
|
|
3
|
+
import { type SystemContext } from "./types.js";
|
|
4
4
|
export declare class SystemSubgraph extends Subgraph {
|
|
5
5
|
name: string;
|
|
6
6
|
typeDefs: import("graphql").DocumentNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/subgraphs/system/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/subgraphs/system/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,IAAI,SAAY;IAEhB,QAAQ,iCAsBN;IAEF,SAAS;;;;;+BAQK,OAAO,QACT,UAAU,GAAG;gBAAE,eAAe,CAAC,EAAE,MAAM,CAAA;aAAE,OAC1C,aAAa;;MAkBtB;IAEI,OAAO;CAgBd"}
|
|
@@ -53,7 +53,9 @@ export class SystemSubgraph extends Subgraph {
|
|
|
53
53
|
await super.onSetup();
|
|
54
54
|
this.subgraphManager.setAdditionalContextFields({
|
|
55
55
|
isAdmin: (ctx) => {
|
|
56
|
-
const adminUsers = process.env.ADMIN_USERS?.split(",")
|
|
56
|
+
const adminUsers = process.env.ADMIN_USERS?.split(",")
|
|
57
|
+
.map((user) => user.trim())
|
|
58
|
+
.filter(Boolean) ?? [];
|
|
57
59
|
return (adminUsers.length === 0 ||
|
|
58
60
|
(ctx.session.address &&
|
|
59
61
|
adminUsers.includes(ctx.session.address.toLocaleLowerCase())));
|