@things-factory/shell 9.0.0-beta.71 → 9.0.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-server/graphql-local-client.js +4 -1
- package/dist-server/graphql-local-client.js.map +1 -1
- package/dist-server/initializers/database.js +8 -2
- package/dist-server/initializers/database.js.map +1 -1
- package/dist-server/middlewares/index.js +2 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/1000000000000-SeedDomain.js +3 -1
- package/dist-server/migrations/1000000000000-SeedDomain.js.map +1 -1
- package/dist-server/pubsub-log-transport.js +4 -1
- package/dist-server/pubsub-log-transport.js.map +1 -1
- package/dist-server/pubsub.js +7 -3
- package/dist-server/pubsub.js.map +1 -1
- package/dist-server/schema.js +24 -5
- package/dist-server/schema.js.map +1 -1
- package/dist-server/server-dev.js +5 -3
- package/dist-server/server-dev.js.map +1 -1
- package/dist-server/server.js +5 -3
- package/dist-server/server.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-item-type.d.ts +2 -2
- package/dist-server/service/attribute-set/attribute-set-item-type.js +37 -23
- package/dist-server/service/attribute-set/attribute-set-item-type.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-mutation.js +43 -19
- package/dist-server/service/attribute-set/attribute-set-mutation.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-query.js +13 -5
- package/dist-server/service/attribute-set/attribute-set-query.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-type.js +22 -14
- package/dist-server/service/attribute-set/attribute-set-type.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set.js +12 -7
- package/dist-server/service/attribute-set/attribute-set.js.map +1 -1
- package/dist-server/service/common-types/index.js +2 -0
- package/dist-server/service/common-types/index.js.map +1 -1
- package/dist-server/service/common-types/list-param.js +17 -16
- package/dist-server/service/common-types/list-param.js.map +1 -1
- package/dist-server/service/common-types/log.js +5 -5
- package/dist-server/service/common-types/log.js.map +1 -1
- package/dist-server/service/common-types/object-ref.js +6 -4
- package/dist-server/service/common-types/object-ref.js.map +1 -1
- package/dist-server/service/common-types/scalar-any.js +1 -1
- package/dist-server/service/common-types/scalar-any.js.map +1 -1
- package/dist-server/service/common-types/scalar-date.js +1 -1
- package/dist-server/service/common-types/scalar-date.js.map +1 -1
- package/dist-server/service/common-types/scalar-object.js +1 -1
- package/dist-server/service/common-types/scalar-object.js.map +1 -1
- package/dist-server/service/directive-transaction/transaction.js +5 -3
- package/dist-server/service/directive-transaction/transaction.js.map +1 -1
- package/dist-server/service/domain/domain-mutation.js +22 -9
- package/dist-server/service/domain/domain-mutation.js.map +1 -1
- package/dist-server/service/domain/domain-query.js +14 -5
- package/dist-server/service/domain/domain-query.js.map +1 -1
- package/dist-server/service/domain/domain-types.js +30 -19
- package/dist-server/service/domain/domain-types.js.map +1 -1
- package/dist-server/service/domain/domain.js +28 -20
- package/dist-server/service/domain/domain.js.map +1 -1
- package/dist-server/service/subscription-data/data-resolver.js +5 -5
- package/dist-server/service/subscription-data/data-resolver.js.map +1 -1
- package/dist-server/service/subscription-data/data-types.js +9 -4
- package/dist-server/service/subscription-data/data-types.js.map +1 -1
- package/dist-server/service/subscription-data/index.js +3 -0
- package/dist-server/service/subscription-data/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/utils/get-domain.js +6 -8
- package/dist-server/utils/get-domain.js.map +1 -1
- package/dist-server/utils/get-query-builder-from-list-params.js +4 -5
- package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
- package/dist-server/utils/get-times-for-period.js +2 -2
- package/dist-server/utils/get-times-for-period.js.map +1 -1
- package/dist-server/utils/list-params-converter.js +9 -6
- package/dist-server/utils/list-params-converter.js.map +1 -1
- package/dist-server/utils/list-query-builder.js +8 -9
- package/dist-server/utils/list-query-builder.js.map +1 -1
- package/package.json +12 -12
@@ -11,75 +11,76 @@ var InheritedValueType;
|
|
11
11
|
InheritedValueType["Include"] = "Include";
|
12
12
|
})(InheritedValueType || (exports.InheritedValueType = InheritedValueType = {}));
|
13
13
|
(0, type_graphql_1.registerEnumType)(InheritedValueType, {
|
14
|
-
name: 'InheritedValueType'
|
14
|
+
name: 'InheritedValueType',
|
15
|
+
description: 'Enumeration for inherited value types: None, Only, or Include. Used to specify how values are inherited in queries or filters.'
|
15
16
|
});
|
16
17
|
let Sorting = class Sorting {
|
17
18
|
};
|
18
19
|
exports.Sorting = Sorting;
|
19
20
|
tslib_1.__decorate([
|
20
|
-
(0, type_graphql_1.Field)({ description: '
|
21
|
+
(0, type_graphql_1.Field)({ description: 'The field name to sort the results by.' }),
|
21
22
|
tslib_1.__metadata("design:type", String)
|
22
23
|
], Sorting.prototype, "name", void 0);
|
23
24
|
tslib_1.__decorate([
|
24
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'Set to true
|
25
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Set to true for descending order. Default is false (ascending).' }),
|
25
26
|
tslib_1.__metadata("design:type", Boolean)
|
26
27
|
], Sorting.prototype, "desc", void 0);
|
27
28
|
exports.Sorting = Sorting = tslib_1.__decorate([
|
28
|
-
(0, type_graphql_1.InputType)()
|
29
|
+
(0, type_graphql_1.InputType)({ description: 'Input type for specifying sorting options in a list query.' })
|
29
30
|
], Sorting);
|
30
31
|
let Pagination = class Pagination {
|
31
32
|
};
|
32
33
|
exports.Pagination = Pagination;
|
33
34
|
tslib_1.__decorate([
|
34
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
35
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The page number to retrieve.' }),
|
35
36
|
tslib_1.__metadata("design:type", Number)
|
36
37
|
], Pagination.prototype, "page", void 0);
|
37
38
|
tslib_1.__decorate([
|
38
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
39
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The maximum number of items per page.' }),
|
39
40
|
tslib_1.__metadata("design:type", Number)
|
40
41
|
], Pagination.prototype, "limit", void 0);
|
41
42
|
exports.Pagination = Pagination = tslib_1.__decorate([
|
42
|
-
(0, type_graphql_1.InputType)()
|
43
|
+
(0, type_graphql_1.InputType)({ description: 'Input type for specifying pagination options in a list query.' })
|
43
44
|
], Pagination);
|
44
45
|
let Filter = class Filter {
|
45
46
|
};
|
46
47
|
exports.Filter = Filter;
|
47
48
|
tslib_1.__decorate([
|
48
|
-
(0, type_graphql_1.Field)(),
|
49
|
+
(0, type_graphql_1.Field)({ description: 'The field name to apply the filter on.' }),
|
49
50
|
tslib_1.__metadata("design:type", String)
|
50
51
|
], Filter.prototype, "name", void 0);
|
51
52
|
tslib_1.__decorate([
|
52
|
-
(0, type_graphql_1.Field)(),
|
53
|
+
(0, type_graphql_1.Field)({ description: 'The operator to use for filtering (e.g., eq, ne, gt, lt, in, etc.).' }),
|
53
54
|
tslib_1.__metadata("design:type", String)
|
54
55
|
], Filter.prototype, "operator", void 0);
|
55
56
|
tslib_1.__decorate([
|
56
|
-
(0, type_graphql_1.Field)(type => scalar_any_js_1.ScalarAny, { nullable: true }),
|
57
|
+
(0, type_graphql_1.Field)(type => scalar_any_js_1.ScalarAny, { nullable: true, description: 'The value to compare the field against.' }),
|
57
58
|
tslib_1.__metadata("design:type", Object)
|
58
59
|
], Filter.prototype, "value", void 0);
|
59
60
|
tslib_1.__decorate([
|
60
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Set to true if the filter applies to a relation field.' }),
|
61
62
|
tslib_1.__metadata("design:type", Boolean)
|
62
63
|
], Filter.prototype, "relation", void 0);
|
63
64
|
exports.Filter = Filter = tslib_1.__decorate([
|
64
|
-
(0, type_graphql_1.InputType)()
|
65
|
+
(0, type_graphql_1.InputType)({ description: 'Input type for specifying a filter condition in a list query.' })
|
65
66
|
], Filter);
|
66
67
|
let ListParam = class ListParam {
|
67
68
|
};
|
68
69
|
exports.ListParam = ListParam;
|
69
70
|
tslib_1.__decorate([
|
70
|
-
(0, type_graphql_1.Field)(type => [Filter], { nullable: true }),
|
71
|
+
(0, type_graphql_1.Field)(type => [Filter], { nullable: true, description: 'An array of filter conditions to apply to the list query.' }),
|
71
72
|
tslib_1.__metadata("design:type", Array)
|
72
73
|
], ListParam.prototype, "filters", void 0);
|
73
74
|
tslib_1.__decorate([
|
74
|
-
(0, type_graphql_1.Field)(type => Pagination, { nullable: true }),
|
75
|
+
(0, type_graphql_1.Field)(type => Pagination, { nullable: true, description: 'Pagination options for the list query.' }),
|
75
76
|
tslib_1.__metadata("design:type", Pagination)
|
76
77
|
], ListParam.prototype, "pagination", void 0);
|
77
78
|
tslib_1.__decorate([
|
78
|
-
(0, type_graphql_1.Field)(type => [Sorting], { nullable: true }),
|
79
|
+
(0, type_graphql_1.Field)(type => [Sorting], { nullable: true, description: 'Sorting options for the list query.' }),
|
79
80
|
tslib_1.__metadata("design:type", Array)
|
80
81
|
], ListParam.prototype, "sortings", void 0);
|
81
82
|
tslib_1.__decorate([
|
82
|
-
(0, type_graphql_1.Field)(type => InheritedValueType, { nullable: true }),
|
83
|
+
(0, type_graphql_1.Field)(type => InheritedValueType, { nullable: true, description: 'Inherited value type for the list query.' }),
|
83
84
|
tslib_1.__metadata("design:type", String)
|
84
85
|
], ListParam.prototype, "inherited", void 0);
|
85
86
|
exports.ListParam = ListParam = tslib_1.__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,mDAA2C;AAE3C,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,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, Field, InputType, Int, registerEnumType } from 'type-graphql'\n\nimport { ScalarAny } from './scalar-any.js'\n\nexport enum InheritedValueType {\n None = 'None',\n Only = 'Only',\n Include = 'Include'\n}\n\nregisterEnumType(InheritedValueType, {\n name: 'InheritedValueType',\n description:\n 'Enumeration for inherited value types: None, Only, or Include. Used to specify how values are inherited in queries or filters.'\n})\n\n@InputType({ description: 'Input type for specifying sorting options in a list query.' })\nexport class Sorting {\n @Field({ description: 'The field name to sort the results by.' })\n name: string\n\n @Field({ nullable: true, description: 'Set to true for descending order. Default is false (ascending).' })\n desc?: boolean\n}\n\n@InputType({ description: 'Input type for specifying pagination options in a list query.' })\nexport class Pagination {\n @Field(type => Int, { nullable: true, description: 'The page number to retrieve.' })\n page?: number\n\n @Field(type => Int, { nullable: true, description: 'The maximum number of items per page.' })\n limit?: number\n}\n\n@InputType({ description: 'Input type for specifying a filter condition in a list query.' })\nexport class Filter {\n @Field({ description: 'The field name to apply the filter on.' })\n name: string\n\n @Field({ description: 'The operator to use for filtering (e.g., eq, ne, gt, lt, in, etc.).' })\n operator: string\n\n @Field(type => ScalarAny, { nullable: true, description: 'The value to compare the field against.' })\n value?: any\n\n @Field({ nullable: true, description: 'Set to true if the filter applies to a relation field.' })\n relation?: boolean\n}\n\n@ArgsType()\nexport class ListParam {\n @Field(type => [Filter], { nullable: true, description: 'An array of filter conditions to apply to the list query.' })\n filters?: Filter[]\n\n @Field(type => Pagination, { nullable: true, description: 'Pagination options for the list query.' })\n pagination?: Pagination\n\n @Field(type => [Sorting], { nullable: true, description: 'Sorting options for the list query.' })\n sortings?: Sorting[]\n\n @Field(type => InheritedValueType, { nullable: true, description: 'Inherited value type for the list query.' })\n inherited?: InheritedValueType\n}\n"]}
|
@@ -8,22 +8,22 @@ let Log = class Log {
|
|
8
8
|
};
|
9
9
|
exports.Log = Log;
|
10
10
|
tslib_1.__decorate([
|
11
|
-
(0, type_graphql_1.Field)(() => scalar_object_js_1.ScalarObject, { description: '
|
11
|
+
(0, type_graphql_1.Field)(() => scalar_object_js_1.ScalarObject, { description: 'The source object or context from which the log originated.' }),
|
12
12
|
tslib_1.__metadata("design:type", Object)
|
13
13
|
], Log.prototype, "source", void 0);
|
14
14
|
tslib_1.__decorate([
|
15
|
-
(0, type_graphql_1.Field)({ description: '
|
15
|
+
(0, type_graphql_1.Field)({ description: 'The severity level of the log entry (e.g., error, warning, info).' }),
|
16
16
|
tslib_1.__metadata("design:type", String)
|
17
17
|
], Log.prototype, "level", void 0);
|
18
18
|
tslib_1.__decorate([
|
19
|
-
(0, type_graphql_1.Field)({ description: '
|
19
|
+
(0, type_graphql_1.Field)({ description: 'The main message or content of the log entry.' }),
|
20
20
|
tslib_1.__metadata("design:type", String)
|
21
21
|
], Log.prototype, "message", void 0);
|
22
22
|
tslib_1.__decorate([
|
23
|
-
(0, type_graphql_1.Field)({ description: 'timestamp the log
|
23
|
+
(0, type_graphql_1.Field)({ description: 'The timestamp indicating when the log entry was created.' }),
|
24
24
|
tslib_1.__metadata("design:type", String)
|
25
25
|
], Log.prototype, "timestamp", void 0);
|
26
26
|
exports.Log = Log = tslib_1.__decorate([
|
27
|
-
(0, type_graphql_1.ObjectType)()
|
27
|
+
(0, type_graphql_1.ObjectType)({ description: 'Represents a log entry, including its source, level, message, and timestamp.' })
|
28
28
|
], 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,yDAAiD;AAG1C,IAAM,GAAG,GAAT,MAAM,GAAG;CAYf,CAAA;AAZY,kBAAG;AAEd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,+BAAY,EAAE,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../server/service/common-types/log.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,yDAAiD;AAG1C,IAAM,GAAG,GAAT,MAAM,GAAG;CAYf,CAAA;AAZY,kBAAG;AAEd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,+BAAY,EAAE,EAAE,WAAW,EAAE,6DAA6D,EAAE,CAAC;;mCAC5F;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,mEAAmE,EAAE,CAAC;;kCAC/E;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;;oCACzD;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,0DAA0D,EAAE,CAAC;;sCAClE;cAXN,GAAG;IADf,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,8EAA8E,EAAE,CAAC;GAC/F,GAAG,CAYf","sourcesContent":["import { ObjectType, Field } from 'type-graphql'\nimport { ScalarObject } from './scalar-object.js'\n\n@ObjectType({ description: 'Represents a log entry, including its source, level, message, and timestamp.' })\nexport class Log {\n @Field(() => ScalarObject, { description: 'The source object or context from which the log originated.' })\n source: object\n\n @Field({ description: 'The severity level of the log entry (e.g., error, warning, info).' })\n level: string\n\n @Field({ description: 'The main message or content of the log entry.' })\n message: string\n\n @Field({ description: 'The timestamp indicating when the log entry was created.' })\n timestamp: string\n}\n"]}
|
@@ -7,18 +7,20 @@ let ObjectRef = class ObjectRef {
|
|
7
7
|
};
|
8
8
|
exports.ObjectRef = ObjectRef;
|
9
9
|
tslib_1.__decorate([
|
10
|
-
(0, type_graphql_1.Field)(() => type_graphql_1.ID, { description: '
|
10
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.ID, { description: 'The unique identifier of the referenced object.' }),
|
11
11
|
tslib_1.__metadata("design:type", String)
|
12
12
|
], ObjectRef.prototype, "id", void 0);
|
13
13
|
tslib_1.__decorate([
|
14
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
14
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The name of the referenced object.' }),
|
15
15
|
tslib_1.__metadata("design:type", String)
|
16
16
|
], ObjectRef.prototype, "name", void 0);
|
17
17
|
tslib_1.__decorate([
|
18
|
-
(0, type_graphql_1.Field)({ nullable: true, description: '
|
18
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A description of the referenced object.' }),
|
19
19
|
tslib_1.__metadata("design:type", String)
|
20
20
|
], ObjectRef.prototype, "description", void 0);
|
21
21
|
exports.ObjectRef = ObjectRef = tslib_1.__decorate([
|
22
|
-
(0, type_graphql_1.InputType)(
|
22
|
+
(0, type_graphql_1.InputType)({
|
23
|
+
description: 'Input type for referencing another object by its unique identifier, with optional name and description.'
|
24
|
+
})
|
23
25
|
], ObjectRef);
|
24
26
|
//# 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;
|
1
|
+
{"version":3,"file":"object-ref.js","sourceRoot":"","sources":["../../../server/service/common-types/object-ref.ts"],"names":[],"mappings":";;;;AAAA,+CAAmD;AAK5C,IAAM,SAAS,GAAf,MAAM,SAAS;CASrB,CAAA;AATY,8BAAS;AAEpB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;qCAC1E;AAGV;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;;uCAChE;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;;8CAC9D;oBART,SAAS;IAHrB,IAAA,wBAAS,EAAC;QACT,WAAW,EAAE,yGAAyG;KACvH,CAAC;GACW,SAAS,CASrB","sourcesContent":["import { InputType, Field, ID } from 'type-graphql'\n\n@InputType({\n description: 'Input type for referencing another object by its unique identifier, with optional name and description.'\n})\nexport class ObjectRef {\n @Field(() => ID, { description: 'The unique identifier of the referenced object.' })\n id: string\n\n @Field({ nullable: true, description: 'The name of the referenced object.' })\n name?: string\n\n @Field({ nullable: true, description: 'A description of the referenced object.' })\n description?: string\n}\n"]}
|
@@ -29,7 +29,7 @@ function parseAst(ast) {
|
|
29
29
|
}
|
30
30
|
exports.ScalarAny = new graphql_1.GraphQLScalarType({
|
31
31
|
name: 'Any',
|
32
|
-
description: '
|
32
|
+
description: 'A flexible scalar type that can represent any GraphQL value, including String, Boolean, Int, Float, Object, or List. Use this type for fields or arguments that may accept or return various data types.',
|
33
33
|
serialize(value) {
|
34
34
|
// Implement your own behavior here by setting the 'result' variable
|
35
35
|
return value;
|
@@ -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,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IACF,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,QAAQ,CAAC,GAAG;IACnB,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,cAAI,CAAC,GAAG;YACX,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC5B,KAAK,cAAI,CAAC,KAAK;YACb,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC9B,KAAK,cAAI,CAAC,OAAO;YACf,OAAO,GAAG,CAAC,KAAK,CAAA;QAClB,KAAK,cAAI,CAAC,MAAM;YACd,OAAO,GAA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AAC,MAAM;YACd,OAAO,WAAW,CAAC,GAAG,CAAC,CAAA;QACzB;YACE,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC;AAEY,QAAA,SAAS,GAAG,IAAI,2BAAiB,CAAC;IAC7C,IAAI,EAAE,KAAK;IACX,WAAW,EACT,0MAA0M;IAC5M,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:\n 'A flexible scalar type that can represent any GraphQL value, including String, Boolean, Int, Float, Object, or List. Use this type for fields or arguments that may accept or return various data types.',\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"]}
|
@@ -4,7 +4,7 @@ exports.ScalarDate = void 0;
|
|
4
4
|
const graphql_1 = require("graphql");
|
5
5
|
exports.ScalarDate = new graphql_1.GraphQLScalarType({
|
6
6
|
name: 'Date',
|
7
|
-
description: '
|
7
|
+
description: 'A custom scalar type for representing date values. Accepts and serializes dates as either timestamps (milliseconds since epoch) or ISO date strings. Use this type for fields or arguments that require date-only values without time components.',
|
8
8
|
parseValue(value) {
|
9
9
|
return new Date(value); // value from the client
|
10
10
|
},
|
@@ -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,
|
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,EACT,mPAAmP;IACrP,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:\n 'A custom scalar type for representing date values. Accepts and serializes dates as either timestamps (milliseconds since epoch) or ISO date strings. Use this type for fields or arguments that require date-only values without time components.',\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"]}
|
@@ -4,7 +4,7 @@ exports.ScalarObject = void 0;
|
|
4
4
|
const graphql_1 = require("graphql");
|
5
5
|
exports.ScalarObject = new graphql_1.GraphQLScalarType({
|
6
6
|
name: 'Object',
|
7
|
-
description: '
|
7
|
+
description: 'A custom scalar type for representing arbitrary JSON objects. Use this type for fields or arguments that require flexible, structured data beyond standard GraphQL scalar types.',
|
8
8
|
parseValue(value) {
|
9
9
|
return value;
|
10
10
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scalar-object.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-object.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAE9B,QAAA,YAAY,GAAG,IAAI,2BAAiB,CAAC;IAChD,IAAI,EAAE,QAAQ;IACd,WAAW,
|
1
|
+
{"version":3,"file":"scalar-object.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-object.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAE9B,QAAA,YAAY,GAAG,IAAI,2BAAiB,CAAC;IAChD,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,kLAAkL;IACpL,UAAU,CAAC,KAAK;QACd,OAAO,KAAK,CAAA;IACd,CAAC;IACD,SAAS,CAAC,KAAK;QACb,OAAO,KAAK,CAAA;IACd,CAAC;IACD,YAAY,CAAC,GAAG;QACd,OAAO,GAAG,CAAA;IACZ,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { GraphQLScalarType } from 'graphql'\n\nexport const ScalarObject = new GraphQLScalarType({\n name: 'Object',\n description:\n 'A custom scalar type for representing arbitrary JSON objects. Use this type for fields or arguments that require flexible, structured data beyond standard GraphQL scalar types.',\n parseValue(value) {\n return value\n },\n serialize(value) {\n return value\n },\n parseLiteral(ast) {\n return ast\n }\n})\n"]}
|
@@ -12,15 +12,17 @@ exports.transactionDirectiveTypeDefs = (0, graphql_tag_1.default) `
|
|
12
12
|
`;
|
13
13
|
const transactionDirectiveResolver = (schema) => (0, utils_1.mapSchema)(schema, {
|
14
14
|
[utils_1.MapperKind.OBJECT_FIELD]: (fieldConfig, fieldName) => {
|
15
|
-
|
16
|
-
const transactionDirective = (_a = (0, utils_1.getDirective)(schema, fieldConfig, DIRECTIVE)) === null || _a === void 0 ? void 0 : _a[0];
|
15
|
+
const transactionDirective = (0, utils_1.getDirective)(schema, fieldConfig, DIRECTIVE)?.[0];
|
17
16
|
if (transactionDirective) {
|
18
17
|
const { resolve = graphql_1.defaultFieldResolver } = fieldConfig;
|
19
18
|
fieldConfig.resolve = async function (source, args, context, info) {
|
20
19
|
return await (0, database_js_1.getDataSource)('tx').transaction(async (tx) => {
|
21
20
|
/* local-graphql-client로부터 invoke인 경우에는 context.req, context.res 가 없으므로, 빈 오브젝트로 대체해준다. */
|
22
21
|
let wrap = context.app.createContext(context.req || {}, context.res || {});
|
23
|
-
wrap.state =
|
22
|
+
wrap.state = {
|
23
|
+
...context.state,
|
24
|
+
tx
|
25
|
+
};
|
24
26
|
wrap.t = context.t;
|
25
27
|
let result = await resolve.call(this, source, args, wrap, info);
|
26
28
|
return result;
|
@@ -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,gEAA8D;AAE9D,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
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAA6D;AAC7D,sEAA6B;AAE7B,gDAA0E;AAE1E,gEAA8D;AAE9D,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,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC,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,2BAAa,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,GAAG;wBACX,GAAG,OAAO,CAAC,KAAK;wBAChB,EAAE;qBACH,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.js'\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"]}
|
@@ -34,7 +34,10 @@ let DomainMutation = class DomainMutation {
|
|
34
34
|
if (patch.parent && patch.parent.id == domain.id) {
|
35
35
|
delete patch.parent;
|
36
36
|
}
|
37
|
-
return await repository.save(
|
37
|
+
return await repository.save({
|
38
|
+
...domain,
|
39
|
+
...patch
|
40
|
+
});
|
38
41
|
}
|
39
42
|
async updateDomains(patches) {
|
40
43
|
const domainRepo = (0, database_js_1.getRepository)(domain_js_1.Domain);
|
@@ -48,7 +51,10 @@ let DomainMutation = class DomainMutation {
|
|
48
51
|
if (updateRecord.parent && updateRecord.parent.id == domain.id) {
|
49
52
|
delete updateRecord.parent;
|
50
53
|
}
|
51
|
-
await domainRepo.save(
|
54
|
+
await domainRepo.save({
|
55
|
+
...domain,
|
56
|
+
...updateRecord
|
57
|
+
});
|
52
58
|
});
|
53
59
|
}
|
54
60
|
return true;
|
@@ -57,7 +63,10 @@ let DomainMutation = class DomainMutation {
|
|
57
63
|
const { domain } = context.state;
|
58
64
|
const repository = (0, database_js_1.getRepository)(domain_js_1.Domain);
|
59
65
|
// const domain: Domain = await repository.findOneBy({ id })
|
60
|
-
const { iplist: result } = await repository.save(
|
66
|
+
const { iplist: result } = await repository.save({
|
67
|
+
...domain,
|
68
|
+
iplist
|
69
|
+
});
|
61
70
|
return result;
|
62
71
|
}
|
63
72
|
};
|
@@ -65,8 +74,10 @@ exports.DomainMutation = DomainMutation;
|
|
65
74
|
tslib_1.__decorate([
|
66
75
|
(0, type_graphql_1.Directive)('@transaction'),
|
67
76
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
68
|
-
(0, type_graphql_1.Mutation)(returns => domain_js_1.Domain, {
|
69
|
-
|
77
|
+
(0, type_graphql_1.Mutation)(returns => domain_js_1.Domain, {
|
78
|
+
description: 'Creates a new domain entity. Only superusers are granted this privilege. Use this mutation to register a new domain with a unique subdomain.'
|
79
|
+
}),
|
80
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('domainInput', { description: 'The input object containing the new domain details.' })),
|
70
81
|
tslib_1.__metadata("design:type", Function),
|
71
82
|
tslib_1.__metadata("design:paramtypes", [domain_types_js_1.DomainPatch]),
|
72
83
|
tslib_1.__metadata("design:returntype", Promise)
|
@@ -74,8 +85,10 @@ tslib_1.__decorate([
|
|
74
85
|
tslib_1.__decorate([
|
75
86
|
(0, type_graphql_1.Directive)('@transaction'),
|
76
87
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
77
|
-
(0, type_graphql_1.Mutation)(returns => domain_js_1.Domain, {
|
78
|
-
|
88
|
+
(0, type_graphql_1.Mutation)(returns => domain_js_1.Domain, {
|
89
|
+
description: 'Deletes a domain entity by its name. Only superusers are granted this privilege. Use this mutation to permanently remove a domain.'
|
90
|
+
}),
|
91
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name', { description: 'The name of the domain to delete.' })),
|
79
92
|
tslib_1.__metadata("design:type", Function),
|
80
93
|
tslib_1.__metadata("design:paramtypes", [String]),
|
81
94
|
tslib_1.__metadata("design:returntype", Promise)
|
@@ -84,9 +97,9 @@ tslib_1.__decorate([
|
|
84
97
|
(0, type_graphql_1.Directive)('@transaction'),
|
85
98
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
86
99
|
(0, type_graphql_1.Mutation)(returns => Boolean, {
|
87
|
-
description: '
|
100
|
+
description: 'Deletes multiple domain entities by their names. Only superusers are granted this privilege. Use this mutation to remove several domains at once.'
|
88
101
|
}),
|
89
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('names', () => [String])),
|
102
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('names', () => [String], { description: 'An array of domain names to delete.' })),
|
90
103
|
tslib_1.__metadata("design:type", Function),
|
91
104
|
tslib_1.__metadata("design:paramtypes", [Array]),
|
92
105
|
tslib_1.__metadata("design:returntype", Promise)
|
@@ -1 +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,gEAA8D;AAE9D,2CAA4C;AAC5C,uDAA+C;AAC/C,uEAA+D;AAGxD,IAAM,cAAc,GAApB,MAAM,cAAc;
|
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,gEAA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,kBAAM,CAAC;GACJ,cAAc,CAsH1B","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.js'\n\nimport { Domain, IPList } from './domain.js'\nimport { DomainPatch } from './domain-types.js'\nimport { ScalarObject } from '../common-types/scalar-object.js'\n\n@Resolver(Domain)\nexport class DomainMutation {\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Domain, {\n description:\n 'Creates a new domain entity. Only superusers are granted this privilege. Use this mutation to register a new domain with a unique subdomain.'\n })\n async createDomain(\n @Arg('domainInput', { description: 'The input object containing the new domain details.' }) domainInput: DomainPatch\n ) {\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, {\n description:\n 'Deletes a domain entity by its name. Only superusers are granted this privilege. Use this mutation to permanently remove a domain.'\n })\n async deleteDomain(@Arg('name', { description: 'The name of the domain to delete.' }) 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:\n 'Deletes multiple domain entities by their names. Only superusers are granted this privilege. Use this mutation to remove several domains at once.'\n })\n async deleteDomains(\n @Arg('names', () => [String], { description: 'An array of domain names to delete.' }) names: string[]\n ) {\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"]}
|
@@ -39,7 +39,9 @@ let DomainQuery = class DomainQuery {
|
|
39
39
|
exports.DomainQuery = DomainQuery;
|
40
40
|
tslib_1.__decorate([
|
41
41
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
42
|
-
(0, type_graphql_1.Query)(returns => [String], {
|
42
|
+
(0, type_graphql_1.Query)(returns => [String], {
|
43
|
+
description: 'Fetches the list of available domain types from configuration. Only superusers are granted this privilege.'
|
44
|
+
}),
|
43
45
|
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
44
46
|
tslib_1.__metadata("design:type", Function),
|
45
47
|
tslib_1.__metadata("design:paramtypes", [Object]),
|
@@ -47,8 +49,10 @@ tslib_1.__decorate([
|
|
47
49
|
], DomainQuery.prototype, "domainTypes", null);
|
48
50
|
tslib_1.__decorate([
|
49
51
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
50
|
-
(0, type_graphql_1.Query)(returns => domain_js_1.Domain, {
|
51
|
-
|
52
|
+
(0, type_graphql_1.Query)(returns => domain_js_1.Domain, {
|
53
|
+
description: 'Fetches a single domain entity by its unique identifier. Only superusers are granted this privilege.'
|
54
|
+
}),
|
55
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id', { description: 'The unique identifier of the domain to fetch.' })),
|
52
56
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
53
57
|
tslib_1.__metadata("design:type", Function),
|
54
58
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
@@ -56,7 +60,9 @@ tslib_1.__decorate([
|
|
56
60
|
], DomainQuery.prototype, "domain", null);
|
57
61
|
tslib_1.__decorate([
|
58
62
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
59
|
-
(0, type_graphql_1.Query)(returns => domain_types_js_1.DomainList, {
|
63
|
+
(0, type_graphql_1.Query)(returns => domain_types_js_1.DomainList, {
|
64
|
+
description: 'Fetches all domain entities with pagination and filtering options. Only superusers are granted this privilege.'
|
65
|
+
}),
|
60
66
|
tslib_1.__param(0, (0, type_graphql_1.Args)(type => list_param_js_1.ListParam)),
|
61
67
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
62
68
|
tslib_1.__metadata("design:type", Function),
|
@@ -65,7 +71,10 @@ tslib_1.__decorate([
|
|
65
71
|
], DomainQuery.prototype, "domains", null);
|
66
72
|
tslib_1.__decorate([
|
67
73
|
(0, type_graphql_1.Directive)('@privilege(category: "security", privilege: "query", domainOwnerGranted: true, superUserGranted: true)'),
|
68
|
-
(0, type_graphql_1.Query)(returns => scalar_object_js_1.ScalarObject, {
|
74
|
+
(0, type_graphql_1.Query)(returns => scalar_object_js_1.ScalarObject, {
|
75
|
+
nullable: true,
|
76
|
+
description: 'Fetches the secure IP list (whitelist, blacklist, etc.) for the current domain. Only domain owners and superusers are granted this privilege.'
|
77
|
+
}),
|
69
78
|
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
70
79
|
tslib_1.__metadata("design:type", Function),
|
71
80
|
tslib_1.__metadata("design:paramtypes", [Object]),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain-query.js","sourceRoot":"","sources":["../../../server/service/domain/domain-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwG;AAExG,gEAA8D;AAC9D,6GAAiG;AAEjG,iEAAyD;AACzD,2CAA4C;AAC5C,uDAA8C;AAC9C,uEAA+D;AAC/D,6CAA4C;AAGrC,IAAM,WAAW,GAAjB,MAAM,WAAW;
|
1
|
+
{"version":3,"file":"domain-query.js","sourceRoot":"","sources":["../../../server/service/domain/domain-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwG;AAExG,gEAA8D;AAC9D,6GAAiG;AAEjG,iEAAyD;AACzD,2CAA4C;AAC5C,uDAA8C;AAC9C,uEAA+D;AAC/D,6CAA4C;AAGrC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAMhB,AAAN,KAAK,CAAC,WAAW,CAAQ,OAAY;QACnC,OAAO,YAAM,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAChD,CAAC;IAMK,AAAN,KAAK,CAAC,MAAM,CACmE,EAAU,EAChF,OAAY;QAEnB,MAAM,UAAU,GAAG,IAAA,2BAAa,EAAC,kBAAM,CAAC,CAAA;QAExC,OAAO,MAA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,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,IAAI,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC,CAAA;IAC3E,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yCAKP;AAOK;IALL,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,4BAAU,EAAE;QAC5B,WAAW,EACT,gHAAgH;KACnH,CAAC;IACa,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,yBAAS,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,yBAAS;;0CAWvD;AAQK;IANL,IAAA,wBAAS,EAAC,wGAAwG,CAAC;IACnH,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,+BAAY,EAAE;QAC9B,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,+IAA+I;KAClJ,CAAC;IACkB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAGxB;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,kBAAM;;yCAElC;sBAvDU,WAAW;IADvB,IAAA,uBAAQ,EAAC,kBAAM,CAAC;GACJ,WAAW,CAwDvB","sourcesContent":["import { Arg, Args, Ctx, Directive, Mutation, Query, Resolver, FieldResolver, Root } from 'type-graphql'\n\nimport { getRepository } from '../../initializers/database.js'\nimport { getQueryBuilderFromListParams } from '../../utils/get-query-builder-from-list-params.js'\n\nimport { ListParam } from '../common-types/list-param.js'\nimport { Domain, IPList } from './domain.js'\nimport { DomainList } from './domain-types.js'\nimport { ScalarObject } from '../common-types/scalar-object.js'\nimport { config } from '@things-factory/env'\n\n@Resolver(Domain)\nexport class DomainQuery {\n @Directive('@privilege(superUserGranted: true)')\n @Query(returns => [String], {\n description:\n 'Fetches the list of available domain types from configuration. Only superusers are granted this privilege.'\n })\n async domainTypes(@Ctx() context: any): Promise<String[]> {\n return config.get('domainTypes') || ['domain']\n }\n\n @Directive('@privilege(superUserGranted: true)')\n @Query(returns => Domain, {\n description: 'Fetches a single domain entity by its unique identifier. Only superusers are granted this privilege.'\n })\n async domain(\n @Arg('id', { description: 'The unique identifier of the domain to fetch.' }) id: string,\n @Ctx() context: any\n ): 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, {\n description:\n 'Fetches all domain entities with pagination and filtering options. Only superusers are granted this privilege.'\n })\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, {\n nullable: true,\n description:\n 'Fetches the secure IP list (whitelist, blacklist, etc.) for the current domain. Only domain owners and superusers are granted this privilege.'\n })\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"]}
|
@@ -9,81 +9,92 @@ let DomainInput = class DomainInput {
|
|
9
9
|
};
|
10
10
|
exports.DomainInput = DomainInput;
|
11
11
|
tslib_1.__decorate([
|
12
|
-
(0, type_graphql_1.Field)(),
|
12
|
+
(0, type_graphql_1.Field)({ description: 'The name of the domain.' }),
|
13
13
|
tslib_1.__metadata("design:type", String)
|
14
14
|
], DomainInput.prototype, "name", void 0);
|
15
15
|
tslib_1.__decorate([
|
16
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
16
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A description of the domain.' }),
|
17
17
|
tslib_1.__metadata("design:type", String)
|
18
18
|
], DomainInput.prototype, "description", void 0);
|
19
19
|
tslib_1.__decorate([
|
20
|
-
(0, type_graphql_1.Field)({
|
20
|
+
(0, type_graphql_1.Field)({
|
21
|
+
nullable: true,
|
22
|
+
description: "The 'extType' field stands for 'extended entity type' and specifies the business or organizational category this domain represents, such as company, department, factory, or project."
|
23
|
+
}),
|
21
24
|
tslib_1.__metadata("design:type", String)
|
22
25
|
], DomainInput.prototype, "extType", void 0);
|
23
26
|
exports.DomainInput = DomainInput = tslib_1.__decorate([
|
24
|
-
(0, type_graphql_1.InputType)(
|
27
|
+
(0, type_graphql_1.InputType)({
|
28
|
+
description: 'Input type for creating a new domain entity, including name, description, and extended entity type.'
|
29
|
+
})
|
25
30
|
], DomainInput);
|
26
31
|
let DomainPatch = class DomainPatch {
|
27
32
|
};
|
28
33
|
exports.DomainPatch = DomainPatch;
|
29
34
|
tslib_1.__decorate([
|
30
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
35
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The unique identifier of the domain.' }),
|
31
36
|
tslib_1.__metadata("design:type", String)
|
32
37
|
], DomainPatch.prototype, "id", void 0);
|
33
38
|
tslib_1.__decorate([
|
34
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
39
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The name of the domain.' }),
|
35
40
|
tslib_1.__metadata("design:type", String)
|
36
41
|
], DomainPatch.prototype, "name", void 0);
|
37
42
|
tslib_1.__decorate([
|
38
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
43
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A description of the domain.' }),
|
39
44
|
tslib_1.__metadata("design:type", String)
|
40
45
|
], DomainPatch.prototype, "description", void 0);
|
41
46
|
tslib_1.__decorate([
|
42
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
47
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timezone setting for the domain.' }),
|
43
48
|
tslib_1.__metadata("design:type", String)
|
44
49
|
], DomainPatch.prototype, "timezone", void 0);
|
45
50
|
tslib_1.__decorate([
|
46
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A flag indicating if the domain is a system domain.' }),
|
47
52
|
tslib_1.__metadata("design:type", Boolean)
|
48
53
|
], DomainPatch.prototype, "systemFlag", void 0);
|
49
54
|
tslib_1.__decorate([
|
50
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The subdomain associated with the domain.' }),
|
51
56
|
tslib_1.__metadata("design:type", String)
|
52
57
|
], DomainPatch.prototype, "subdomain", void 0);
|
53
58
|
tslib_1.__decorate([
|
54
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
59
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The unique identifier of the domain owner.' }),
|
55
60
|
tslib_1.__metadata("design:type", String)
|
56
61
|
], DomainPatch.prototype, "owner", void 0);
|
57
62
|
tslib_1.__decorate([
|
58
|
-
(0, type_graphql_1.Field)(type => index_js_1.ObjectRef, { nullable: true }),
|
63
|
+
(0, type_graphql_1.Field)(type => index_js_1.ObjectRef, { nullable: true, description: 'A reference to the parent domain, if any.' }),
|
59
64
|
tslib_1.__metadata("design:type", index_js_1.ObjectRef)
|
60
65
|
], DomainPatch.prototype, "parent", void 0);
|
61
66
|
tslib_1.__decorate([
|
62
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
67
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The brand name associated with the domain.' }),
|
63
68
|
tslib_1.__metadata("design:type", String)
|
64
69
|
], DomainPatch.prototype, "brandName", void 0);
|
65
70
|
tslib_1.__decorate([
|
66
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
71
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The brand image URL for the domain.' }),
|
67
72
|
tslib_1.__metadata("design:type", String)
|
68
73
|
], DomainPatch.prototype, "brandImage", void 0);
|
69
74
|
tslib_1.__decorate([
|
70
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The content image URL for the domain.' }),
|
71
76
|
tslib_1.__metadata("design:type", String)
|
72
77
|
], DomainPatch.prototype, "contentImage", void 0);
|
73
78
|
tslib_1.__decorate([
|
74
|
-
(0, type_graphql_1.Field)({
|
79
|
+
(0, type_graphql_1.Field)({
|
80
|
+
nullable: true,
|
81
|
+
description: "The 'extType' field stands for 'extended entity type' and specifies the business or organizational category this domain represents, such as company, department, factory, or project."
|
82
|
+
}),
|
75
83
|
tslib_1.__metadata("design:type", String)
|
76
84
|
], DomainPatch.prototype, "extType", void 0);
|
77
85
|
tslib_1.__decorate([
|
78
|
-
(0, type_graphql_1.Field)(type => index_js_1.ScalarObject, {
|
86
|
+
(0, type_graphql_1.Field)(type => index_js_1.ScalarObject, {
|
87
|
+
nullable: true,
|
88
|
+
description: 'Additional attributes for the domain in key-value pairs.'
|
89
|
+
}),
|
79
90
|
tslib_1.__metadata("design:type", Object)
|
80
91
|
], DomainPatch.prototype, "attributes", void 0);
|
81
92
|
tslib_1.__decorate([
|
82
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The theme associated with the domain.' }),
|
83
94
|
tslib_1.__metadata("design:type", String)
|
84
95
|
], DomainPatch.prototype, "theme", void 0);
|
85
96
|
exports.DomainPatch = DomainPatch = tslib_1.__decorate([
|
86
|
-
(0, type_graphql_1.InputType)()
|
97
|
+
(0, type_graphql_1.InputType)({ description: 'Input type for updating an existing domain entity.' })
|
87
98
|
], DomainPatch);
|
88
99
|
let DomainList = class DomainList {
|
89
100
|
};
|