@things-factory/shell 7.0.1-beta.7 → 7.0.1-rc.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/client/themes/app-theme.css +25 -34
- package/client/themes/dark.css +0 -100
- package/client/themes/grist-theme.css +12 -10
- package/client/themes/layout-theme.css +0 -5
- package/client/themes/light.css +0 -100
- package/client/themes/oops-theme.css +2 -2
- package/client/themes/report-theme.css +47 -0
- package/client/themes/state-color.css +1 -1
- package/dist-server/initializers/database.js +6 -6
- package/dist-server/initializers/database.js.map +1 -1
- package/dist-server/middlewares/domain-middleware.js +1 -2
- package/dist-server/middlewares/domain-middleware.js.map +1 -1
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/pubsub.js +0 -1
- package/dist-server/pubsub.js.map +1 -1
- package/dist-server/routers/global-router.js.map +1 -1
- package/dist-server/schema.js +1 -2
- package/dist-server/schema.js.map +1 -1
- package/dist-server/server-dev.js.map +1 -1
- package/dist-server/server.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-item-type.js +5 -5
- package/dist-server/service/attribute-set/attribute-set-item-type.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-mutation.js +2 -2
- package/dist-server/service/attribute-set/attribute-set-mutation.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-query.js +3 -3
- package/dist-server/service/attribute-set/attribute-set-query.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-type.js +6 -6
- package/dist-server/service/attribute-set/attribute-set-type.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set.js +2 -2
- package/dist-server/service/attribute-set/attribute-set.js.map +1 -1
- package/dist-server/service/common-types/list-param.js +9 -9
- package/dist-server/service/common-types/list-param.js.map +1 -1
- package/dist-server/service/common-types/log.js +2 -2
- package/dist-server/service/common-types/log.js.map +1 -1
- package/dist-server/service/common-types/object-ref.js +2 -2
- package/dist-server/service/common-types/object-ref.js.map +1 -1
- package/dist-server/service/common-types/scalar-any.js.map +1 -1
- package/dist-server/service/common-types/scalar-date.js.map +1 -1
- package/dist-server/service/directive-transaction/transaction.js.map +1 -1
- package/dist-server/service/domain/{domain-Mutation.js → domain-mutation.js} +3 -3
- package/dist-server/service/domain/domain-mutation.js.map +1 -0
- package/dist-server/service/domain/domain-query.js +3 -3
- package/dist-server/service/domain/domain-query.js.map +1 -1
- package/dist-server/service/domain/domain-types.js +6 -6
- package/dist-server/service/domain/domain-types.js.map +1 -1
- package/dist-server/service/domain/domain.js +6 -7
- package/dist-server/service/domain/domain.js.map +1 -1
- package/dist-server/service/domain/index.d.ts +1 -1
- package/dist-server/service/domain/index.js +2 -2
- package/dist-server/service/domain/index.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/service/subscription-data/data-resolver.js +2 -2
- package/dist-server/service/subscription-data/data-resolver.js.map +1 -1
- package/dist-server/service/subscription-data/data-types.js +2 -2
- package/dist-server/service/subscription-data/data-types.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/typeorm/encrypt-transform.js +1 -1
- package/dist-server/typeorm/encrypt-transform.js.map +1 -1
- package/dist-server/typeorm/get-data-encryption-key.js.map +1 -1
- package/dist-server/typeorm/json5-transform.js.map +1 -1
- package/dist-server/utils/condition-builder.js.map +1 -1
- package/dist-server/utils/get-domain.d.ts +0 -1
- package/dist-server/utils/get-domain.js +7 -8
- package/dist-server/utils/get-domain.js.map +1 -1
- package/dist-server/utils/get-query-builder-from-list-params.js +1 -2
- package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
- package/dist-server/utils/get-times-for-period.js +2 -3
- package/dist-server/utils/get-times-for-period.js.map +1 -1
- package/dist-server/utils/list-param-adjuster.js +1 -2
- package/dist-server/utils/list-param-adjuster.js.map +1 -1
- package/dist-server/utils/list-params-converter.js +1 -2
- package/dist-server/utils/list-params-converter.js.map +1 -1
- package/dist-server/utils/list-query-builder.js.map +1 -1
- package/dist-server/utils/publish-progress.js +1 -2
- package/dist-server/utils/publish-progress.js.map +1 -1
- package/package.json +14 -14
- package/server/service/attribute-set/attribute-set-query.ts +1 -1
- package/server/service/domain/domain-query.ts +1 -1
- package/server/service/domain/index.ts +1 -1
- package/dist-server/service/domain/domain-Mutation.js.map +0 -1
- /package/dist-server/service/domain/{domain-Mutation.d.ts → domain-mutation.d.ts} +0 -0
@@ -9,12 +9,13 @@ var InheritedValueType;
|
|
9
9
|
InheritedValueType["None"] = "None";
|
10
10
|
InheritedValueType["Only"] = "Only";
|
11
11
|
InheritedValueType["Include"] = "Include";
|
12
|
-
})(InheritedValueType
|
12
|
+
})(InheritedValueType || (exports.InheritedValueType = InheritedValueType = {}));
|
13
13
|
(0, type_graphql_1.registerEnumType)(InheritedValueType, {
|
14
14
|
name: 'InheritedValueType'
|
15
15
|
});
|
16
16
|
let Sorting = class Sorting {
|
17
17
|
};
|
18
|
+
exports.Sorting = Sorting;
|
18
19
|
tslib_1.__decorate([
|
19
20
|
(0, type_graphql_1.Field)({ description: 'Field name to sort by' }),
|
20
21
|
tslib_1.__metadata("design:type", String)
|
@@ -23,12 +24,12 @@ tslib_1.__decorate([
|
|
23
24
|
(0, type_graphql_1.Field)({ nullable: true, description: 'Set to true if descending sort. Default is "false"' }),
|
24
25
|
tslib_1.__metadata("design:type", Boolean)
|
25
26
|
], Sorting.prototype, "desc", void 0);
|
26
|
-
Sorting = tslib_1.__decorate([
|
27
|
+
exports.Sorting = Sorting = tslib_1.__decorate([
|
27
28
|
(0, type_graphql_1.InputType)()
|
28
29
|
], Sorting);
|
29
|
-
exports.Sorting = Sorting;
|
30
30
|
let Pagination = class Pagination {
|
31
31
|
};
|
32
|
+
exports.Pagination = Pagination;
|
32
33
|
tslib_1.__decorate([
|
33
34
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
34
35
|
tslib_1.__metadata("design:type", Number)
|
@@ -37,12 +38,12 @@ tslib_1.__decorate([
|
|
37
38
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
38
39
|
tslib_1.__metadata("design:type", Number)
|
39
40
|
], Pagination.prototype, "limit", void 0);
|
40
|
-
Pagination = tslib_1.__decorate([
|
41
|
+
exports.Pagination = Pagination = tslib_1.__decorate([
|
41
42
|
(0, type_graphql_1.InputType)()
|
42
43
|
], Pagination);
|
43
|
-
exports.Pagination = Pagination;
|
44
44
|
let Filter = class Filter {
|
45
45
|
};
|
46
|
+
exports.Filter = Filter;
|
46
47
|
tslib_1.__decorate([
|
47
48
|
(0, type_graphql_1.Field)(),
|
48
49
|
tslib_1.__metadata("design:type", String)
|
@@ -59,12 +60,12 @@ tslib_1.__decorate([
|
|
59
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
60
61
|
tslib_1.__metadata("design:type", Boolean)
|
61
62
|
], Filter.prototype, "relation", void 0);
|
62
|
-
Filter = tslib_1.__decorate([
|
63
|
+
exports.Filter = Filter = tslib_1.__decorate([
|
63
64
|
(0, type_graphql_1.InputType)()
|
64
65
|
], Filter);
|
65
|
-
exports.Filter = Filter;
|
66
66
|
let ListParam = class ListParam {
|
67
67
|
};
|
68
|
+
exports.ListParam = ListParam;
|
68
69
|
tslib_1.__decorate([
|
69
70
|
(0, type_graphql_1.Field)(type => [Filter], { nullable: true }),
|
70
71
|
tslib_1.__metadata("design:type", Array)
|
@@ -81,8 +82,7 @@ tslib_1.__decorate([
|
|
81
82
|
(0, type_graphql_1.Field)(type => InheritedValueType, { nullable: true }),
|
82
83
|
tslib_1.__metadata("design:type", String)
|
83
84
|
], ListParam.prototype, "inherited", void 0);
|
84
|
-
ListParam = tslib_1.__decorate([
|
85
|
+
exports.ListParam = ListParam = tslib_1.__decorate([
|
85
86
|
(0, type_graphql_1.ArgsType)()
|
86
87
|
], ListParam);
|
87
|
-
exports.ListParam = ListParam;
|
88
88
|
//# sourceMappingURL=list-param.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,6CAAwC;AAExC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,yCAAmB,CAAA;AACrB,CAAC,EAJW,kBAAkB,
|
1
|
+
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,6CAAwC;AAExC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,yCAAmB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B;AAED,IAAA,+BAAgB,EAAC,kBAAkB,EAAE;IACnC,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAA;AAGK,IAAM,OAAO,GAAb,MAAM,OAAO;CAMnB,CAAA;AANY,0BAAO;AAElB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;qCACpC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;;qCAC/E;kBALH,OAAO;IADnB,IAAA,wBAAS,GAAE;GACC,OAAO,CAMnB;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC1B;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACzB;qBALH,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAMtB;AAGM,IAAM,MAAM,GAAZ,MAAM,MAAM;CAYlB,CAAA;AAZY,wBAAM;AAEjB;IADC,IAAA,oBAAK,GAAE;;oCACI;AAGZ;IADC,IAAA,oBAAK,GAAE;;wCACQ;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCAClC;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACR;iBAXP,MAAM;IADlB,IAAA,wBAAS,GAAE;GACC,MAAM,CAYlB;AAGM,IAAM,SAAS,GAAf,MAAM,SAAS;CAYrB,CAAA;AAZY,8BAAS;AAEpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC1B;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,UAAU;6CAAA;AAGvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACzB;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACxB;oBAXnB,SAAS;IADrB,IAAA,uBAAQ,GAAE;GACE,SAAS,CAYrB","sourcesContent":["import { ArgsType, Field, InputType, Int, registerEnumType } from 'type-graphql'\n\nimport { ScalarAny } from './scalar-any'\n\nexport enum InheritedValueType {\n None = 'None',\n Only = 'Only',\n Include = 'Include'\n}\n\nregisterEnumType(InheritedValueType, {\n name: 'InheritedValueType'\n})\n\n@InputType()\nexport class Sorting {\n @Field({ description: 'Field name to sort by' })\n name: string\n\n @Field({ nullable: true, description: 'Set to true if descending sort. Default is \"false\"' })\n desc?: boolean\n}\n\n@InputType()\nexport class Pagination {\n @Field(type => Int, { nullable: true })\n page?: number\n\n @Field(type => Int, { nullable: true })\n limit?: number\n}\n\n@InputType()\nexport class Filter {\n @Field()\n name: string\n\n @Field()\n operator: string\n\n @Field(type => ScalarAny, { nullable: true })\n value?: any\n\n @Field({ nullable: true })\n relation?: boolean\n}\n\n@ArgsType()\nexport class ListParam {\n @Field(type => [Filter], { nullable: true })\n filters?: Filter[]\n\n @Field(type => Pagination, { nullable: true })\n pagination?: Pagination\n\n @Field(type => [Sorting], { nullable: true })\n sortings?: Sorting[]\n\n @Field(type => InheritedValueType, { nullable: true })\n inherited?: InheritedValueType\n}\n"]}
|
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
|
|
6
6
|
const scalar_object_1 = require("./scalar-object");
|
7
7
|
let Log = class Log {
|
8
8
|
};
|
9
|
+
exports.Log = Log;
|
9
10
|
tslib_1.__decorate([
|
10
11
|
(0, type_graphql_1.Field)(() => scalar_object_1.ScalarObject, { description: 'the source of the log' }),
|
11
12
|
tslib_1.__metadata("design:type", Object)
|
@@ -22,8 +23,7 @@ tslib_1.__decorate([
|
|
22
23
|
(0, type_graphql_1.Field)({ description: 'timestamp the log occurred' }),
|
23
24
|
tslib_1.__metadata("design:type", String)
|
24
25
|
], Log.prototype, "timestamp", void 0);
|
25
|
-
Log = tslib_1.__decorate([
|
26
|
+
exports.Log = Log = tslib_1.__decorate([
|
26
27
|
(0, type_graphql_1.ObjectType)()
|
27
28
|
], Log);
|
28
|
-
exports.Log = Log;
|
29
29
|
//# sourceMappingURL=log.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../server/service/common-types/log.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,mDAA8C;AAGvC,IAAM,GAAG,GAAT,MAAM,GAAG;CAYf,CAAA;
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../server/service/common-types/log.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,mDAA8C;AAGvC,IAAM,GAAG,GAAT,MAAM,GAAG;CAYf,CAAA;AAZY,kBAAG;AAEd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,4BAAY,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;mCACtD;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;kCAClD;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;;oCAC5B;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;sCACpC;cAXN,GAAG;IADf,IAAA,yBAAU,GAAE;GACA,GAAG,CAYf","sourcesContent":["import { ObjectType, Field } from 'type-graphql'\nimport { ScalarObject } from './scalar-object'\n\n@ObjectType()\nexport class Log {\n @Field(() => ScalarObject, { description: 'the source of the log' })\n source: object\n\n @Field({ description: 'log level (error, warning, info, ..)' })\n level: string\n\n @Field({ description: 'log body message' })\n message: string\n\n @Field({ description: 'timestamp the log occurred' })\n timestamp: string\n}\n"]}
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
6
|
let ObjectRef = class ObjectRef {
|
7
7
|
};
|
8
|
+
exports.ObjectRef = ObjectRef;
|
8
9
|
tslib_1.__decorate([
|
9
10
|
(0, type_graphql_1.Field)(() => type_graphql_1.ID, { description: 'Field id' }),
|
10
11
|
tslib_1.__metadata("design:type", String)
|
@@ -17,8 +18,7 @@ tslib_1.__decorate([
|
|
17
18
|
(0, type_graphql_1.Field)({ nullable: true, description: 'Field description' }),
|
18
19
|
tslib_1.__metadata("design:type", String)
|
19
20
|
], ObjectRef.prototype, "description", void 0);
|
20
|
-
ObjectRef = tslib_1.__decorate([
|
21
|
+
exports.ObjectRef = ObjectRef = tslib_1.__decorate([
|
21
22
|
(0, type_graphql_1.InputType)()
|
22
23
|
], ObjectRef);
|
23
|
-
exports.ObjectRef = ObjectRef;
|
24
24
|
//# sourceMappingURL=object-ref.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"object-ref.js","sourceRoot":"","sources":["../../../server/service/common-types/object-ref.ts"],"names":[],"mappings":";;;;AAAA,+CAAmD;AAG5C,IAAM,SAAS,GAAf,MAAM,SAAS;CASrB,CAAA;
|
1
|
+
{"version":3,"file":"object-ref.js","sourceRoot":"","sources":["../../../server/service/common-types/object-ref.ts"],"names":[],"mappings":";;;;AAAA,+CAAmD;AAG5C,IAAM,SAAS,GAAf,MAAM,SAAS;CASrB,CAAA;AATY,8BAAS;AAEpB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;qCACnC;AAGV;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;uCACxC;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;8CACxC;oBART,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CASrB","sourcesContent":["import { InputType, Field, ID } from 'type-graphql'\n\n@InputType()\nexport class ObjectRef {\n @Field(() => ID, { description: 'Field id' })\n id: string\n\n @Field({ nullable: true, description: 'Field name' })\n name?: string\n\n @Field({ nullable: true, description: 'Field description' })\n description?: string\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scalar-any.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-any.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEjD,SAAS,WAAW,CAAC,GAAG;IACtB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACjC,GAAG,CA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CAAA;QACzB;YACE,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC;AAEY,QAAA,SAAS,GAAG,IAAI,2BAAiB,CAAC;IAC7C,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,6DAA6D;IAC1E,SAAS,CAAC,KAAK;QACb,oEAAoE;QACpE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,UAAU,CAAC,KAAK;QACd,oEAAoE;QACpE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,YAAY,CAAC,GAAG;QACd,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\n\nfunction parseObject(ast) {\n const value = Object.create(null)\n ast.fields.forEach(field => {\n value[field.name.value] = parseAst(field.value)\n })\n return value\n}\n\nfunction parseAst(ast) {\n switch (ast.kind) {\n case Kind.INT:\n return parseInt(ast.value)\n case Kind.FLOAT:\n return parseFloat(ast.value)\n case Kind.BOOLEAN:\n return ast.value\n case Kind.STRING:\n return ast.value\n case Kind.LIST:\n return ast.values.map(parseAst)\n case Kind.OBJECT:\n return parseObject(ast)\n default:\n return null\n }\n}\n\nexport const ScalarAny = new GraphQLScalarType({\n name: 'Any',\n description: 'Any Scalar type (String, Boolean, Int, Float, Object, List)',\n serialize(value) {\n // Implement your own behavior here by setting the 'result' variable\n return value\n },\n parseValue(value) {\n // Implement your own behavior here by setting the 'result' variable\n return value\n },\n parseLiteral(ast) {\n return parseAst(ast)\n }\n})\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scalar-date.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-date.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEpC,QAAA,UAAU,GAAG,IAAI,2BAAiB,CAAC;IAC9C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,yBAAyB;IACtC,UAAU,CAAC,KAAK;QACd,OAAO,IAAI,IAAI,CAAC,KAAwB,CAAC,CAAA,CAAC,wBAAwB;IACpE,CAAC;IACD,SAAS,CAAC,KAAK;QACb;;;WAGG;QACH,OAAO,IAAI,IAAI,CAAC,KAAY,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,2BAA2B;IACrE,CAAC;IACD,YAAY,CAAC,GAAG;QACd,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,GAAG,EAAE;
|
1
|
+
{"version":3,"file":"scalar-date.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-date.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEpC,QAAA,UAAU,GAAG,IAAI,2BAAiB,CAAC;IAC9C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,yBAAyB;IACtC,UAAU,CAAC,KAAK;QACd,OAAO,IAAI,IAAI,CAAC,KAAwB,CAAC,CAAA,CAAC,wBAAwB;IACpE,CAAC;IACD,SAAS,CAAC,KAAK;QACb;;;WAGG;QACH,OAAO,IAAI,IAAI,CAAC,KAAY,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,2BAA2B;IACrE,CAAC;IACD,YAAY,CAAC,GAAG;QACd,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,GAAG,EAAE,CAAC;YAC1B,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA,CAAC,uCAAuC;QACrE,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\n\nexport const ScalarDate = new GraphQLScalarType({\n name: 'Date',\n description: 'Date custom scalar type',\n parseValue(value) {\n return new Date(value as string | number) // value from the client\n },\n serialize(value) {\n /**\n * Note: Allow value to be date only like \"2021-01-31\" to be serialize before passing data to clientside for TypeGraphql.\n * Usage: When database column datatype is \"date\" and data do not contain any time component.\n */\n return new Date(value as any).getTime() // value sent to the client\n },\n parseLiteral(ast) {\n if (ast.kind === Kind.INT) {\n return new Date(+ast.value) // ast value is always in string format\n }\n return null\n }\n})\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAA6D;AAC7D,sEAA6B;AAE7B,gDAA0E;AAE1E,0DAA2D;AAE3D,MAAM,SAAS,GAAG,aAAa,CAAA;AAElB,QAAA,4BAA4B,GAAG,IAAA,qBAAG,EAAA;iBAC9B,SAAS;GACvB,CAAA;AACI,MAAM,4BAA4B,GAAG,CAAC,MAAqB,EAAE,EAAE,CACpE,IAAA,iBAAS,EAAC,MAAM,EAAE;IAChB,CAAC,kBAAU,CAAC,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE;;QACpD,MAAM,oBAAoB,GAAG,MAAA,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,0CAAG,CAAC,CAAC,CAAA;QAC9E,IAAI,oBAAoB,EAAE;
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAA6D;AAC7D,sEAA6B;AAE7B,gDAA0E;AAE1E,0DAA2D;AAE3D,MAAM,SAAS,GAAG,aAAa,CAAA;AAElB,QAAA,4BAA4B,GAAG,IAAA,qBAAG,EAAA;iBAC9B,SAAS;GACvB,CAAA;AACI,MAAM,4BAA4B,GAAG,CAAC,MAAqB,EAAE,EAAE,CACpE,IAAA,iBAAS,EAAC,MAAM,EAAE;IAChB,CAAC,kBAAU,CAAC,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE;;QACpD,MAAM,oBAAoB,GAAG,MAAA,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,0CAAG,CAAC,CAAC,CAAA;QAC9E,IAAI,oBAAoB,EAAE,CAAC;YACzB,MAAM,EAAE,OAAO,GAAG,8BAAoB,EAAE,GAAG,WAAW,CAAA;YAEtD,WAAW,CAAC,OAAO,GAAG,KAAK,WAAW,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI;gBAC/D,OAAO,MAAM,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,WAAW,CAAC,KAAK,EAAC,EAAE,EAAC,EAAE;oBACtD,0FAA0F;oBAC1F,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;oBAE1E,IAAI,CAAC,KAAK,mCACL,OAAO,CAAC,KAAK,KAChB,EAAE,GACH,CAAA;oBACD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAA;oBAElB,IAAI,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;oBAE/D,OAAO,MAAM,CAAA;gBACf,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA;YAED,OAAO,WAAW,CAAA;QACpB,CAAC;IACH,CAAC;CACF,CAAC,CAAA;AA3BS,QAAA,4BAA4B,gCA2BrC","sourcesContent":["import { defaultFieldResolver, GraphQLSchema } from 'graphql'\nimport gql from 'graphql-tag'\n\nimport { getDirective, MapperKind, mapSchema } from '@graphql-tools/utils'\n\nimport { getDataSource } from '../../initializers/database'\n\nconst DIRECTIVE = 'transaction'\n\nexport const transactionDirectiveTypeDefs = gql`\n directive @${DIRECTIVE} on FIELD_DEFINITION\n `\nexport const transactionDirectiveResolver = (schema: GraphQLSchema) =>\n mapSchema(schema, {\n [MapperKind.OBJECT_FIELD]: (fieldConfig, fieldName) => {\n const transactionDirective = getDirective(schema, fieldConfig, DIRECTIVE)?.[0]\n if (transactionDirective) {\n const { resolve = defaultFieldResolver } = fieldConfig\n\n fieldConfig.resolve = async function (source, args, context, info) {\n return await getDataSource('tx').transaction(async tx => {\n /* local-graphql-client로부터 invoke인 경우에는 context.req, context.res 가 없으므로, 빈 오브젝트로 대체해준다. */\n let wrap = context.app.createContext(context.req || {}, context.res || {})\n\n wrap.state = {\n ...context.state,\n tx\n }\n wrap.t = context.t\n\n let result = await resolve.call(this, source, args, wrap, info)\n\n return result\n })\n }\n\n return fieldConfig\n }\n }\n })\n"]}
|
@@ -61,6 +61,7 @@ let DomainMutation = class DomainMutation {
|
|
61
61
|
return result;
|
62
62
|
}
|
63
63
|
};
|
64
|
+
exports.DomainMutation = DomainMutation;
|
64
65
|
tslib_1.__decorate([
|
65
66
|
(0, type_graphql_1.Directive)('@transaction'),
|
66
67
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
@@ -123,8 +124,7 @@ tslib_1.__decorate([
|
|
123
124
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
124
125
|
tslib_1.__metadata("design:returntype", Promise)
|
125
126
|
], DomainMutation.prototype, "updateSecureIPList", null);
|
126
|
-
DomainMutation = tslib_1.__decorate([
|
127
|
+
exports.DomainMutation = DomainMutation = tslib_1.__decorate([
|
127
128
|
(0, type_graphql_1.Resolver)(domain_1.Domain)
|
128
129
|
], DomainMutation);
|
129
|
-
|
130
|
-
//# sourceMappingURL=domain-Mutation.js.map
|
130
|
+
//# sourceMappingURL=domain-mutation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"domain-mutation.js","sourceRoot":"","sources":["../../../server/service/domain/domain-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAyF;AACzF,qCAAwC;AAExC,iDAA+C;AAE/C,0DAA2D;AAE3D,qCAAyC;AACzC,iDAA4C;AAC5C,kDAA8C;AAGvC,IAAM,cAAc,GAApB,MAAM,cAAc;IAInB,AAAN,KAAK,CAAC,YAAY,CAAqB,WAAwB;QAC7D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,WAAW,CAAA;QACzC,MAAM,UAAU,GAA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A8D;KAC5E,CAAC;IACkB,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAA;;qDAAQ,0BAAW;;kDAYhG;AAOK;IALL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE;QAC5B,WAAW,EAAE,wEAAwE;KACtF,CAAC;IACmB,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC,CAAA;;;;mDAyBvD;AAOK;IALL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EACR,2GAA2G,CAC5G;IACA,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAEvG,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,2BAAY,CAAC,CAAA;IACnC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAYP;yBA1GU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,eAAM,CAAC;GACJ,cAAc,CA2G1B","sourcesContent":["import { Arg, Args, Ctx, Directive, Mutation, Query, Resolver, Root } from 'type-graphql'\nimport { In, Repository } from 'typeorm'\n\nimport { slugger } from '@things-factory/utils'\n\nimport { getRepository } from '../../initializers/database'\n\nimport { Domain, IPList } from './domain'\nimport { DomainPatch } from './domain-types'\nimport { ScalarObject } from '../common-types'\n\n@Resolver(Domain)\nexport class DomainMutation {\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Domain, { description: 'To create domain (Only superuser is granted this privilege.)' })\n async createDomain(@Arg('domainInput') domainInput: DomainPatch) {\n const { name, description } = domainInput\n const domainRepo: Repository<Domain> = getRepository(Domain)\n const subdomain: string = slugger(name)\n\n const domain: Domain = await domainRepo.findOneBy({ subdomain })\n if (domain) {\n throw new Error('domain is duplicated')\n }\n\n return await domainRepo.save({ name, description, subdomain })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Domain, { description: 'To delete domain (Only superuser is granted this privilege.)' })\n async deleteDomain(@Arg('name') name: string) {\n return await getRepository(Domain).delete({ name })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, {\n description: 'To delete multiple domains (Only superuser is granted this privilege.)'\n })\n async deleteDomains(@Arg('names', () => [String]) names: string[]) {\n const domains: Domain[] = await getRepository(Domain).find({ where: { name: In(names) } })\n const domainIds: string[] = domains.map(domain => domain.id)\n\n await getRepository(Domain).delete({ id: In(domainIds) })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Domain, {\n description: 'To update domain (Only superuser is granted this privilege.)'\n })\n async updateDomain(@Arg('name') name: string, @Arg('patch', () => DomainPatch) patch: DomainPatch) {\n const repository = getRepository(Domain)\n const domain: Domain = await repository.findOneBy({ name })\n\n if (patch.parent && patch.parent.id == domain.id) {\n delete patch.parent\n }\n\n return await repository.save({\n ...domain,\n ...patch\n } as any)\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, {\n description: 'To update multiple domains (Only superuser is granted this privilege.)'\n })\n async updateDomains(@Arg('patches', () => [DomainPatch]) patches: DomainPatch[]): Promise<boolean> {\n const domainRepo: Repository<Domain> = getRepository(Domain)\n\n const patchIds = patches.filter((patch: any) => patch.id)\n\n if (patchIds.length > 0) {\n patchIds.forEach(async updateRecord => {\n const domain: Domain = await domainRepo.findOne({ where: { id: updateRecord.id } })\n\n if (updateRecord.name) {\n updateRecord.subdomain = slugger(updateRecord.name)\n }\n\n if (updateRecord.parent && updateRecord.parent.id == domain.id) {\n delete updateRecord.parent\n }\n\n await domainRepo.save({\n ...domain,\n ...updateRecord\n } as any)\n })\n }\n\n return true\n }\n\n @Directive('@transaction')\n @Directive(\n '@privilege(category: \"security\", privilege: \"mutation\", domainOwnerGranted: true, superUserGranted: true)'\n )\n @Mutation(returns => ScalarObject, { nullable: true, description: 'To update secure IP list for domain' })\n async updateSecureIPList(\n @Arg('iplist', type => ScalarObject) iplist: IPList,\n @Ctx() context: any\n ): Promise<IPList | null> {\n const { domain } = context.state\n const repository = getRepository(Domain)\n // const domain: Domain = await repository.findOneBy({ id })\n\n const { iplist: result } = await repository.save({\n ...domain,\n iplist\n } as any)\n\n return result\n }\n}\n"]}
|
@@ -32,6 +32,7 @@ let DomainQuery = class DomainQuery {
|
|
32
32
|
return domain.parentId && (await (0, database_1.getRepository)(domain_1.Domain).findOneBy({ id: domain.parentId }));
|
33
33
|
}
|
34
34
|
};
|
35
|
+
exports.DomainQuery = DomainQuery;
|
35
36
|
tslib_1.__decorate([
|
36
37
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
37
38
|
(0, type_graphql_1.Query)(returns => domain_1.Domain, { description: 'To fetch domain' }),
|
@@ -44,7 +45,7 @@ tslib_1.__decorate([
|
|
44
45
|
tslib_1.__decorate([
|
45
46
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
46
47
|
(0, type_graphql_1.Query)(returns => domain_types_1.DomainList, { description: 'To fetch all domains (Only superuser is granted this privilege.)' }),
|
47
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
48
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)(type => list_param_1.ListParam)),
|
48
49
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
49
50
|
tslib_1.__metadata("design:type", Function),
|
50
51
|
tslib_1.__metadata("design:paramtypes", [list_param_1.ListParam, Object]),
|
@@ -65,8 +66,7 @@ tslib_1.__decorate([
|
|
65
66
|
tslib_1.__metadata("design:paramtypes", [domain_1.Domain]),
|
66
67
|
tslib_1.__metadata("design:returntype", Promise)
|
67
68
|
], DomainQuery.prototype, "parent", null);
|
68
|
-
DomainQuery = tslib_1.__decorate([
|
69
|
+
exports.DomainQuery = DomainQuery = tslib_1.__decorate([
|
69
70
|
(0, type_graphql_1.Resolver)(domain_1.Domain)
|
70
71
|
], DomainQuery);
|
71
|
-
exports.DomainQuery = DomainQuery;
|
72
72
|
//# sourceMappingURL=domain-query.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain-query.js","sourceRoot":"","sources":["../../../server/service/domain/domain-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwG;AAGxG,0DAA2D;AAC3D,uGAA8F;AAE9F,2DAAsD;AACtD,qCAAyC;AACzC,iDAA2C;AAC3C,kDAA8C;AAGvC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAGhB,AAAN,KAAK,CAAC,MAAM,CAAY,EAAU,EAAS,OAAY;QACrD,MAAM,UAAU,GAAG,IAAA,wBAAa,EAAC,eAAM,CAAC,CAAA;QAExC,OAAO,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAC3C,CAAC;IAIK,AAAN,KAAK,CAAC,OAAO,
|
1
|
+
{"version":3,"file":"domain-query.js","sourceRoot":"","sources":["../../../server/service/domain/domain-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwG;AAGxG,0DAA2D;AAC3D,uGAA8F;AAE9F,2DAAsD;AACtD,qCAAyC;AACzC,iDAA2C;AAC3C,kDAA8C;AAGvC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAGhB,AAAN,KAAK,CAAC,MAAM,CAAY,EAAU,EAAS,OAAY;QACrD,MAAM,UAAU,GAAG,IAAA,wBAAa,EAAC,eAAM,CAAC,CAAA;QAExC,OAAO,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IA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AAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,sBAAS;;0CAWvD;AAIK;IAFL,IAAA,wBAAS,EAAC,wGAAwG,CAAC;IACnH,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAGxB;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,eAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,eAAM;;yCAElC;sBAlCU,WAAW;IADvB,IAAA,uBAAQ,EAAC,eAAM,CAAC;GACJ,WAAW,CAmCvB","sourcesContent":["import { Arg, Args, Ctx, Directive, Mutation, Query, Resolver, FieldResolver, Root } from 'type-graphql'\nimport { In, Repository } from 'typeorm'\n\nimport { getRepository } from '../../initializers/database'\nimport { getQueryBuilderFromListParams } from '../../utils/get-query-builder-from-list-params'\n\nimport { ListParam } from '../common-types/list-param'\nimport { Domain, IPList } from './domain'\nimport { DomainList } from './domain-types'\nimport { ScalarObject } from '../common-types'\n\n@Resolver(Domain)\nexport class DomainQuery {\n @Directive('@privilege(superUserGranted: true)')\n @Query(returns => Domain, { description: 'To fetch domain' })\n async domain(@Arg('id') id: string, @Ctx() context: any): Promise<Domain> {\n const repository = getRepository(Domain)\n\n return await repository.findOneBy({ id })\n }\n\n @Directive('@privilege(superUserGranted: true)')\n @Query(returns => DomainList, { description: 'To fetch all domains (Only superuser is granted this privilege.)' })\n async domains(@Args(type => ListParam) params: ListParam, @Ctx() context: any): Promise<DomainList> {\n const queryBuilder = await getQueryBuilderFromListParams({\n repository: getRepository(Domain),\n alias: 'ContactPoint',\n params,\n searchables: ['name', 'description', 'subdomain']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true, superUserGranted: true)')\n @Query(returns => ScalarObject, { nullable: true, description: 'To fetch domain' })\n async secureIPList(@Ctx() context: any): Promise<IPList | null> {\n const { domain } = context.state\n return domain.iplist\n }\n\n @FieldResolver(type => Domain)\n async parent(@Root() domain: Domain): Promise<Domain> {\n return domain.parentId && (await getRepository(Domain).findOneBy({ id: domain.parentId }))\n }\n}\n"]}
|
@@ -7,6 +7,7 @@ const domain_1 = require("./domain");
|
|
7
7
|
const common_types_1 = require("../common-types");
|
8
8
|
let DomainInput = class DomainInput {
|
9
9
|
};
|
10
|
+
exports.DomainInput = DomainInput;
|
10
11
|
tslib_1.__decorate([
|
11
12
|
(0, type_graphql_1.Field)(),
|
12
13
|
tslib_1.__metadata("design:type", String)
|
@@ -15,12 +16,12 @@ tslib_1.__decorate([
|
|
15
16
|
(0, type_graphql_1.Field)({ nullable: true }),
|
16
17
|
tslib_1.__metadata("design:type", String)
|
17
18
|
], DomainInput.prototype, "description", void 0);
|
18
|
-
DomainInput = tslib_1.__decorate([
|
19
|
+
exports.DomainInput = DomainInput = tslib_1.__decorate([
|
19
20
|
(0, type_graphql_1.InputType)()
|
20
21
|
], DomainInput);
|
21
|
-
exports.DomainInput = DomainInput;
|
22
22
|
let DomainPatch = class DomainPatch {
|
23
23
|
};
|
24
|
+
exports.DomainPatch = DomainPatch;
|
24
25
|
tslib_1.__decorate([
|
25
26
|
(0, type_graphql_1.Field)({ nullable: true }),
|
26
27
|
tslib_1.__metadata("design:type", String)
|
@@ -73,12 +74,12 @@ tslib_1.__decorate([
|
|
73
74
|
(0, type_graphql_1.Field)({ nullable: true }),
|
74
75
|
tslib_1.__metadata("design:type", String)
|
75
76
|
], DomainPatch.prototype, "theme", void 0);
|
76
|
-
DomainPatch = tslib_1.__decorate([
|
77
|
+
exports.DomainPatch = DomainPatch = tslib_1.__decorate([
|
77
78
|
(0, type_graphql_1.InputType)()
|
78
79
|
], DomainPatch);
|
79
|
-
exports.DomainPatch = DomainPatch;
|
80
80
|
let DomainList = class DomainList {
|
81
81
|
};
|
82
|
+
exports.DomainList = DomainList;
|
82
83
|
tslib_1.__decorate([
|
83
84
|
(0, type_graphql_1.Field)(type => [domain_1.Domain], { nullable: true }),
|
84
85
|
tslib_1.__metadata("design:type", Array)
|
@@ -87,8 +88,7 @@ tslib_1.__decorate([
|
|
87
88
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
88
89
|
tslib_1.__metadata("design:type", Number)
|
89
90
|
], DomainList.prototype, "total", void 0);
|
90
|
-
DomainList = tslib_1.__decorate([
|
91
|
+
exports.DomainList = DomainList = tslib_1.__decorate([
|
91
92
|
(0, type_graphql_1.ObjectType)()
|
92
93
|
], DomainList);
|
93
|
-
exports.DomainList = DomainList;
|
94
94
|
//# sourceMappingURL=domain-types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain-types.js","sourceRoot":"","sources":["../../../server/service/domain/domain-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,qCAAyC;AACzC,kDAAyD;AAGlD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;
|
1
|
+
{"version":3,"file":"domain-types.js","sourceRoot":"","sources":["../../../server/service/domain/domain-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,qCAAyC;AACzC,kDAAyD;AAGlD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;IADC,IAAA,oBAAK,GAAE;;yCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;sBALT,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CAMvB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CAuCvB,CAAA;AAvCY,kCAAW;AAEtB;IADC,IAAA,oBAAK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CAAC,CAAC,eAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC7B;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC1B;qBALF,UAAU;IADtB,IAAA,yBAAU,GAAE;GACA,UAAU,CAMtB","sourcesContent":["import { ObjectType, InputType, Field, Int } from 'type-graphql'\nimport { Domain, IPList } from './domain'\nimport { ObjectRef, ScalarObject } from '../common-types'\n\n@InputType()\nexport class DomainInput {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class DomainPatch {\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n timezone?: string\n\n @Field({ nullable: true })\n systemFlag?: Boolean\n\n @Field({ nullable: true })\n subdomain?: string\n\n @Field({ nullable: true })\n owner?: string\n\n @Field(type => ObjectRef, { nullable: true })\n parent?: ObjectRef\n\n @Field({ nullable: true })\n brandName?: string\n\n @Field({ nullable: true })\n brandImage?: string\n\n @Field({ nullable: true })\n contentImage?: string\n\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @Field({ nullable: true })\n theme?: string\n}\n\n@ObjectType()\nexport class DomainList {\n @Field(type => [Domain], { nullable: true })\n items: Domain[]\n\n @Field(type => Int, { nullable: true })\n total: number\n}\n"]}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var Domain_1;
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
3
|
exports.Domain = void 0;
|
5
4
|
const tslib_1 = require("tslib");
|
@@ -12,8 +11,9 @@ const generatedStrategy = ['uuid', 'rowid', 'increment', 'identity'];
|
|
12
11
|
const domainPrimaryOption = env_1.config.get('domainPrimaryOption');
|
13
12
|
const domainPrimaryType = domainPrimaryOption === null || domainPrimaryOption === void 0 ? void 0 : domainPrimaryOption.type;
|
14
13
|
const domainPrimaryStrategy = domainPrimaryOption === null || domainPrimaryOption === void 0 ? void 0 : domainPrimaryOption.strategy;
|
15
|
-
let Domain =
|
14
|
+
let Domain = class Domain {
|
16
15
|
};
|
16
|
+
exports.Domain = Domain;
|
17
17
|
tslib_1.__decorate([
|
18
18
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
19
19
|
(0, typeorm_1.Column)(domainPrimaryOption
|
@@ -80,7 +80,7 @@ tslib_1.__decorate([
|
|
80
80
|
], Domain.prototype, "subdomain", void 0);
|
81
81
|
tslib_1.__decorate([
|
82
82
|
(0, type_graphql_1.Field)({ nullable: true }),
|
83
|
-
(0, typeorm_1.ManyToOne)(type =>
|
83
|
+
(0, typeorm_1.ManyToOne)(type => Domain, { nullable: true }),
|
84
84
|
tslib_1.__metadata("design:type", Domain)
|
85
85
|
], Domain.prototype, "parent", void 0);
|
86
86
|
tslib_1.__decorate([
|
@@ -88,8 +88,8 @@ tslib_1.__decorate([
|
|
88
88
|
tslib_1.__metadata("design:type", String)
|
89
89
|
], Domain.prototype, "parentId", void 0);
|
90
90
|
tslib_1.__decorate([
|
91
|
-
(0, typeorm_1.OneToMany)(type =>
|
92
|
-
(0, type_graphql_1.Field)(type =>
|
91
|
+
(0, typeorm_1.OneToMany)(type => Domain, domain => domain.parent),
|
92
|
+
(0, type_graphql_1.Field)(type => Domain, { nullable: true }),
|
93
93
|
tslib_1.__metadata("design:type", Array)
|
94
94
|
], Domain.prototype, "children", void 0);
|
95
95
|
tslib_1.__decorate([
|
@@ -142,7 +142,7 @@ tslib_1.__decorate([
|
|
142
142
|
(0, type_graphql_1.Field)({ nullable: true }),
|
143
143
|
tslib_1.__metadata("design:type", Date)
|
144
144
|
], Domain.prototype, "deletedAt", void 0);
|
145
|
-
Domain =
|
145
|
+
exports.Domain = Domain = tslib_1.__decorate([
|
146
146
|
(0, typeorm_1.Entity)(),
|
147
147
|
(0, typeorm_1.Index)('ix_domain_0', (domain) => [domain.subdomain, domain.deletedAt], {
|
148
148
|
unique: true,
|
@@ -150,5 +150,4 @@ Domain = Domain_1 = tslib_1.__decorate([
|
|
150
150
|
}),
|
151
151
|
(0, type_graphql_1.ObjectType)()
|
152
152
|
], Domain);
|
153
|
-
exports.Domain = Domain;
|
154
153
|
//# sourceMappingURL=domain.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../server/service/domain/domain.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../server/service/domain/domain.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAA+D;AAC/D,6CAA4C;AAC5C,kDAA8C;AAE9C,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAA;AAC7G,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;AACpE,MAAM,mBAAmB,GAAG,YAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AAC7D,MAAM,iBAAiB,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,IAAI,CAAA;AACnD,MAAM,qBAAqB,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,QAAQ,CAAA;AAkBpD,IAAM,MAAM,GAAZ,MAAM,MAAM;CA6GlB,CAAA;AA7GY,wBAAM;AAgCR;IA/BR,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;IACjB,IAAA,gBAAM,EACL,mBAAmB;QACjB,CAAC,CAAC;YACE,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE;gBACX,uCAAuC;gBACvC,IAAI,EAAE,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any,\n RelationId,\n Entity,\n Index,\n UpdateDateColumn,\n DeleteDateColumn\n} from 'typeorm'\nimport { ObjectType, Directive, Field, ID } from 'type-graphql'\nimport { config } from '@things-factory/env'\nimport { ScalarObject } from '../common-types'\n\nconst numericTypes = ['int', 'int2', 'int4', 'int8', 'integer', 'tinyint', 'smallint', 'mediumint', 'bigint']\nconst generatedStrategy = ['uuid', 'rowid', 'increment', 'identity']\nconst domainPrimaryOption = config.get('domainPrimaryOption')\nconst domainPrimaryType = domainPrimaryOption?.type\nconst domainPrimaryStrategy = domainPrimaryOption?.strategy\n\nexport type IPList = {\n whitelist?: string[]\n blacklist?: string[]\n protectedlist?: string[]\n privileges?: {\n category: string\n privilege: string\n }[]\n}\n\n@Entity()\n@Index('ix_domain_0', (domain: Domain) => [domain.subdomain, domain.deletedAt], {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n})\n@ObjectType()\nexport class Domain {\n @Field(type => ID)\n @Column(\n domainPrimaryOption\n ? {\n type: domainPrimaryType,\n primary: true,\n transformer: {\n //from(value: DatabaseType): EntityType\n from: value => {\n return value\n },\n //to(value: EntityType): DatabaseType\n to: value => {\n if (!value) {\n value = 0\n }\n if (numericTypes.indexOf(domainPrimaryType) >= 0) {\n return parseInt(value)\n } else {\n return value\n }\n }\n },\n generated: generatedStrategy.indexOf(domainPrimaryStrategy) >= 0 ? domainPrimaryStrategy : false\n }\n : {\n type: 'uuid',\n primary: true,\n generated: 'uuid'\n }\n )\n readonly id: string\n\n @Field()\n @Column({ unique: true })\n name: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n description: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n extType: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n timezone: string\n\n @Directive('@deprecated(reason: \"Use `parent`\")')\n @Field({ nullable: true })\n @Column({ default: false })\n systemFlag: boolean\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n subdomain: string\n\n @Field({ nullable: true })\n @ManyToOne(type => Domain, { nullable: true })\n parent: Domain\n\n @RelationId((domain: Domain) => domain.parent)\n parentId?: string\n\n @OneToMany(type => Domain, domain => domain.parent)\n @Field(type => Domain, { nullable: true })\n children: Domain[]\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n brandName: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n brandImage: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n contentImage: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n owner: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n theme: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true })\n iplist?: IPList\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @Field({ nullable: true })\n @CreateDateColumn()\n createdAt: Date\n\n @Field({ nullable: true })\n @UpdateDateColumn()\n updatedAt: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n}\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Domain } from './domain';
|
2
2
|
import { DomainQuery } from './domain-query';
|
3
|
-
import { DomainMutation } from './domain-
|
3
|
+
import { DomainMutation } from './domain-mutation';
|
4
4
|
export declare const entities: (typeof Domain)[];
|
5
5
|
export declare const resolvers: (typeof DomainQuery | typeof DomainMutation)[];
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolvers = exports.entities = void 0;
|
4
4
|
const domain_1 = require("./domain");
|
5
5
|
const domain_query_1 = require("./domain-query");
|
6
|
-
const
|
6
|
+
const domain_mutation_1 = require("./domain-mutation");
|
7
7
|
exports.entities = [domain_1.Domain];
|
8
|
-
exports.resolvers = [domain_query_1.DomainQuery,
|
8
|
+
exports.resolvers = [domain_query_1.DomainQuery, domain_mutation_1.DomainMutation];
|
9
9
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/domain/index.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AACjC,iDAA4C;AAC5C,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,eAAM,CAAC,CAAA;AACnB,QAAA,SAAS,GAAG,CAAC,0BAAW,EAAE,gCAAc,CAAC,CAAA","sourcesContent":["import { Domain } from './domain'\nimport { DomainQuery } from './domain-query'\nimport { DomainMutation } from './domain-
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/domain/index.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AACjC,iDAA4C;AAC5C,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,eAAM,CAAC,CAAA;AACnB,QAAA,SAAS,GAAG,CAAC,0BAAW,EAAE,gCAAc,CAAC,CAAA","sourcesContent":["import { Domain } from './domain'\nimport { DomainQuery } from './domain-query'\nimport { DomainMutation } from './domain-mutation'\n\nexport const entities = [Domain]\nexport const resolvers = [DomainQuery, DomainMutation]\n"]}
|
@@ -8,7 +8,7 @@ export declare const schema: {
|
|
8
8
|
typeDefs: {
|
9
9
|
transactionDirectiveTypeDefs: import("graphql").DocumentNode;
|
10
10
|
};
|
11
|
-
resolverClasses: (typeof import("./domain/domain-query").DomainQuery | typeof import("./domain/domain-
|
11
|
+
resolverClasses: (typeof import("./domain/domain-query").DomainQuery | typeof import("./domain/domain-mutation").DomainMutation | typeof import("./attribute-set/attribute-set-query").AttributeSetQuery | typeof import("./attribute-set/attribute-set-mutation").AttributeSetMutation | typeof import("./subscription-data/data-resolver").DataResolver)[];
|
12
12
|
directives: {
|
13
13
|
transaction: (schema: import("graphql").GraphQLSchema) => import("graphql").GraphQLSchema;
|
14
14
|
};
|
@@ -11,6 +11,7 @@ let DataResolver = class DataResolver {
|
|
11
11
|
return payload.data;
|
12
12
|
}
|
13
13
|
};
|
14
|
+
exports.DataResolver = DataResolver;
|
14
15
|
tslib_1.__decorate([
|
15
16
|
(0, type_graphql_1.Subscription)({
|
16
17
|
subscribe: ({ args, context, info }) => {
|
@@ -37,8 +38,7 @@ tslib_1.__decorate([
|
|
37
38
|
tslib_1.__metadata("design:paramtypes", [Object, String]),
|
38
39
|
tslib_1.__metadata("design:returntype", data_types_1.Data)
|
39
40
|
], DataResolver.prototype, "data", null);
|
40
|
-
DataResolver = tslib_1.__decorate([
|
41
|
+
exports.DataResolver = DataResolver = tslib_1.__decorate([
|
41
42
|
(0, type_graphql_1.Resolver)()
|
42
43
|
], DataResolver);
|
43
|
-
exports.DataResolver = DataResolver;
|
44
44
|
//# sourceMappingURL=data-resolver.js.map
|
@@ -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;AAG5B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAyBvB,IAAI,CAAS,OAAuB,EAAc,GAAW;QAC3D,OAAO,OAAO,CAAC,IAAI,CAAA;IACrB,CAAC;CACF,CAAA;
|
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;AAG5B,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()\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"]}
|
@@ -7,6 +7,7 @@ const scalar_object_1 = require("../common-types/scalar-object");
|
|
7
7
|
const domain_1 = require("../domain/domain");
|
8
8
|
let Data = class Data {
|
9
9
|
};
|
10
|
+
exports.Data = Data;
|
10
11
|
tslib_1.__decorate([
|
11
12
|
(0, type_graphql_1.Field)(type => domain_1.Domain, { nullable: true, description: 'The domain where the data originated' }),
|
12
13
|
tslib_1.__metadata("design:type", domain_1.Domain)
|
@@ -19,8 +20,7 @@ tslib_1.__decorate([
|
|
19
20
|
(0, type_graphql_1.Field)(type => scalar_object_1.ScalarObject, { nullable: true, description: 'Data delivered by subscription' }),
|
20
21
|
tslib_1.__metadata("design:type", Object)
|
21
22
|
], Data.prototype, "data", void 0);
|
22
|
-
Data = tslib_1.__decorate([
|
23
|
+
exports.Data = Data = tslib_1.__decorate([
|
23
24
|
(0, type_graphql_1.ObjectType)()
|
24
25
|
], Data);
|
25
|
-
exports.Data = Data;
|
26
26
|
//# sourceMappingURL=data-types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data-types.js","sourceRoot":"","sources":["../../../server/service/subscription-data/data-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAEhD,iEAA4D;AAC5D,6CAAyC;AAGlC,IAAM,IAAI,GAAV,MAAM,IAAI;CAShB,CAAA;
|
1
|
+
{"version":3,"file":"data-types.js","sourceRoot":"","sources":["../../../server/service/subscription-data/data-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAEhD,iEAA4D;AAC5D,6CAAyC;AAGlC,IAAM,IAAI,GAAV,MAAM,IAAI;CAShB,CAAA;AATY,oBAAI;AAEf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,eAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;sCACtF,eAAM;oCAAA;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;iCACzC;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;sCACxF,MAAM;kCAAA;eARF,IAAI;IADhB,IAAA,yBAAU,GAAE;GACA,IAAI,CAShB","sourcesContent":["import { Field, ObjectType } from 'type-graphql'\n\nimport { ScalarObject } from '../common-types/scalar-object'\nimport { Domain } from '../domain/domain'\n\n@ObjectType()\nexport class Data {\n @Field(type => Domain, { nullable: true, description: 'The domain where the data originated' })\n domain?: Domain\n\n @Field({ description: 'Tag name attached to data' })\n tag: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'Data delivered by subscription' })\n data?: Object\n}\n"]}
|