@things-factory/shell 7.0.6 → 7.0.14
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.
@@ -6,6 +6,7 @@ const graphql_yoga_1 = require("graphql-yoga");
|
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
7
7
|
const pubsub_1 = require("../../pubsub");
|
8
8
|
const data_types_1 = require("./data-types");
|
9
|
+
/* 이 Resolver는 @things-factory/integration-base 에서 Overide 된다. (state-register를 사용하기 위해서) */
|
9
10
|
let DataResolver = class DataResolver {
|
10
11
|
data(payload, tag) {
|
11
12
|
return payload.data;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data-resolver.js","sourceRoot":"","sources":["../../../server/service/subscription-data/data-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,yCAAqC;AACrC,6CAAmC;
|
1
|
+
{"version":3,"file":"data-resolver.js","sourceRoot":"","sources":["../../../server/service/subscription-data/data-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,yCAAqC;AACrC,6CAAmC;AAEnC,4FAA4F;AAErF,IAAM,YAAY,GAAlB,MAAM,YAAY;IAyBvB,IAAI,CAAS,OAAuB,EAAc,GAAW;QAC3D,OAAO,OAAO,CAAC,IAAI,CAAA;IACrB,CAAC;CACF,CAAA;AA5BY,oCAAY;AAyBvB;IAxBC,IAAA,2BAAY,EAAC;QACZ,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;;YACrC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;YACtC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;YACpB,MAAM,SAAS,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA;YAEnC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;YAC5C,CAAC;YAED,YAAY;YACZ,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,CAAA,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;gBACnG,MAAM,IAAI,KAAK,CAAC,UAAU,SAAS,6BAA6B,IAAI,CAAC,KAAK,IAAI,CAAC,CAAA;YACjF,CAAC;YAED,OAAO,IAAA,mBAAI,EACT,eAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EACxB,IAAA,qBAAM,EAAC,CAAC,OAAuB,EAAE,EAAE;gBACjC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAA;gBACzD,OAAO,GAAG,KAAK,IAAI,IAAI,SAAS,MAAK,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAA,CAAA;YACzD,CAAC,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAC;IACI,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAA2B,mBAAA,IAAA,kBAAG,EAAC,KAAK,CAAC,CAAA;;;4CAAe,iBAAI;wCAEnE;uBA3BU,YAAY;IADxB,IAAA,uBAAQ,GAAE;GACE,YAAY,CA4BxB","sourcesContent":["import { filter, pipe } from 'graphql-yoga'\nimport { Arg, Resolver, Root, Subscription } from 'type-graphql'\n\nimport { pubsub } from '../../pubsub'\nimport { Data } from './data-types'\n\n/* 이 Resolver는 @things-factory/integration-base 에서 Overide 된다. (state-register를 사용하기 위해서) */\n@Resolver()\nexport class DataResolver {\n @Subscription({\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const { tag } = args\n const subdomain = domain?.subdomain\n\n if (!domain || !tag) {\n throw new Error('domain and tag required')\n }\n\n //@ts-ignore\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n return pipe(\n pubsub.subscribe('data'),\n filter((payload: { data: Data }) => {\n const { domain: pdomain, tag: ptag, data } = payload.data\n return tag === ptag && subdomain === pdomain?.subdomain\n })\n )\n }\n })\n data(@Root() payload: { data: Data }, @Arg('tag') tag: string): Data {\n return payload.data\n }\n}\n"]}
|