@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.
Files changed (71) hide show
  1. package/dist-server/graphql-local-client.js +4 -1
  2. package/dist-server/graphql-local-client.js.map +1 -1
  3. package/dist-server/initializers/database.js +8 -2
  4. package/dist-server/initializers/database.js.map +1 -1
  5. package/dist-server/middlewares/index.js +2 -2
  6. package/dist-server/middlewares/index.js.map +1 -1
  7. package/dist-server/migrations/1000000000000-SeedDomain.js +3 -1
  8. package/dist-server/migrations/1000000000000-SeedDomain.js.map +1 -1
  9. package/dist-server/pubsub-log-transport.js +4 -1
  10. package/dist-server/pubsub-log-transport.js.map +1 -1
  11. package/dist-server/pubsub.js +7 -3
  12. package/dist-server/pubsub.js.map +1 -1
  13. package/dist-server/schema.js +24 -5
  14. package/dist-server/schema.js.map +1 -1
  15. package/dist-server/server-dev.js +5 -3
  16. package/dist-server/server-dev.js.map +1 -1
  17. package/dist-server/server.js +5 -3
  18. package/dist-server/server.js.map +1 -1
  19. package/dist-server/service/attribute-set/attribute-set-item-type.d.ts +2 -2
  20. package/dist-server/service/attribute-set/attribute-set-item-type.js +37 -23
  21. package/dist-server/service/attribute-set/attribute-set-item-type.js.map +1 -1
  22. package/dist-server/service/attribute-set/attribute-set-mutation.js +43 -19
  23. package/dist-server/service/attribute-set/attribute-set-mutation.js.map +1 -1
  24. package/dist-server/service/attribute-set/attribute-set-query.js +13 -5
  25. package/dist-server/service/attribute-set/attribute-set-query.js.map +1 -1
  26. package/dist-server/service/attribute-set/attribute-set-type.js +22 -14
  27. package/dist-server/service/attribute-set/attribute-set-type.js.map +1 -1
  28. package/dist-server/service/attribute-set/attribute-set.js +12 -7
  29. package/dist-server/service/attribute-set/attribute-set.js.map +1 -1
  30. package/dist-server/service/common-types/index.js +2 -0
  31. package/dist-server/service/common-types/index.js.map +1 -1
  32. package/dist-server/service/common-types/list-param.js +17 -16
  33. package/dist-server/service/common-types/list-param.js.map +1 -1
  34. package/dist-server/service/common-types/log.js +5 -5
  35. package/dist-server/service/common-types/log.js.map +1 -1
  36. package/dist-server/service/common-types/object-ref.js +6 -4
  37. package/dist-server/service/common-types/object-ref.js.map +1 -1
  38. package/dist-server/service/common-types/scalar-any.js +1 -1
  39. package/dist-server/service/common-types/scalar-any.js.map +1 -1
  40. package/dist-server/service/common-types/scalar-date.js +1 -1
  41. package/dist-server/service/common-types/scalar-date.js.map +1 -1
  42. package/dist-server/service/common-types/scalar-object.js +1 -1
  43. package/dist-server/service/common-types/scalar-object.js.map +1 -1
  44. package/dist-server/service/directive-transaction/transaction.js +5 -3
  45. package/dist-server/service/directive-transaction/transaction.js.map +1 -1
  46. package/dist-server/service/domain/domain-mutation.js +22 -9
  47. package/dist-server/service/domain/domain-mutation.js.map +1 -1
  48. package/dist-server/service/domain/domain-query.js +14 -5
  49. package/dist-server/service/domain/domain-query.js.map +1 -1
  50. package/dist-server/service/domain/domain-types.js +30 -19
  51. package/dist-server/service/domain/domain-types.js.map +1 -1
  52. package/dist-server/service/domain/domain.js +28 -20
  53. package/dist-server/service/domain/domain.js.map +1 -1
  54. package/dist-server/service/subscription-data/data-resolver.js +5 -5
  55. package/dist-server/service/subscription-data/data-resolver.js.map +1 -1
  56. package/dist-server/service/subscription-data/data-types.js +9 -4
  57. package/dist-server/service/subscription-data/data-types.js.map +1 -1
  58. package/dist-server/service/subscription-data/index.js +3 -0
  59. package/dist-server/service/subscription-data/index.js.map +1 -1
  60. package/dist-server/tsconfig.tsbuildinfo +1 -1
  61. package/dist-server/utils/get-domain.js +6 -8
  62. package/dist-server/utils/get-domain.js.map +1 -1
  63. package/dist-server/utils/get-query-builder-from-list-params.js +4 -5
  64. package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
  65. package/dist-server/utils/get-times-for-period.js +2 -2
  66. package/dist-server/utils/get-times-for-period.js.map +1 -1
  67. package/dist-server/utils/list-params-converter.js +9 -6
  68. package/dist-server/utils/list-params-converter.js.map +1 -1
  69. package/dist-server/utils/list-query-builder.js +8 -9
  70. package/dist-server/utils/list-query-builder.js.map +1 -1
  71. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"domain-types.js","sourceRoot":"","sources":["../../../server/service/domain/domain-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,2CAA4C;AAC5C,uDAAkE;AAG3D,IAAM,WAAW,GAAjB,MAAM,WAAW;CASvB,CAAA;AATY,kCAAW;AAEtB;IADC,IAAA,oBAAK,GAAE;;yCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;sBARL,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CASvB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CA0CvB,CAAA;AA1CY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACf;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACb,OAAO;+CAAA;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACZ;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACpC,oBAAS;2CAAA;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACL;AAGrB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAChC;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACZ;sBAzCH,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CA0CvB;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAM,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.js'\nimport { ObjectRef, ScalarObject } from '../common-types/index.js'\n\n@InputType()\nexport class DomainInput {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n extType?: 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({ nullable: true })\n extType?: 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
+ {"version":3,"file":"domain-types.js","sourceRoot":"","sources":["../../../server/service/domain/domain-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,2CAA4C;AAC5C,uDAAkE;AAK3D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAavB,CAAA;AAbY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;yCACtC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;;gDACnD;AAOpB;IALC,IAAA,oBAAK,EAAC;QACL,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,uLAAuL;KAC1L,CAAC;;4CACc;sBAZL,WAAW;IAHvB,IAAA,wBAAS,EAAC;QACT,WAAW,EAAE,qGAAqG;KACnH,CAAC;GACW,WAAW,CAavB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CAiDvB,CAAA;AAjDY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;uCACpE;AAGX;IADC,IAAA,oBAAK,EAA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Y,EAAE;QAC3B,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,0DAA0D;KACxE,CAAC;;+CACc;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;;0CAClE;sBAhDH,WAAW;IADvB,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;GACpE,WAAW,CAiDvB;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAM,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.js'\nimport { ObjectRef, ScalarObject } from '../common-types/index.js'\n\n@InputType({\n description: 'Input type for creating a new domain entity, including name, description, and extended entity type.'\n})\nexport class DomainInput {\n @Field({ description: 'The name of the domain.' })\n name: string\n\n @Field({ nullable: true, description: 'A description of the domain.' })\n description?: string\n\n @Field({\n nullable: true,\n description:\n \"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.\"\n })\n extType?: string\n}\n\n@InputType({ description: 'Input type for updating an existing domain entity.' })\nexport class DomainPatch {\n @Field({ nullable: true, description: 'The unique identifier of the domain.' })\n id?: string\n\n @Field({ nullable: true, description: 'The name of the domain.' })\n name?: string\n\n @Field({ nullable: true, description: 'A description of the domain.' })\n description?: string\n\n @Field({ nullable: true, description: 'The timezone setting for the domain.' })\n timezone?: string\n\n @Field({ nullable: true, description: 'A flag indicating if the domain is a system domain.' })\n systemFlag?: Boolean\n\n @Field({ nullable: true, description: 'The subdomain associated with the domain.' })\n subdomain?: string\n\n @Field({ nullable: true, description: 'The unique identifier of the domain owner.' })\n owner?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'A reference to the parent domain, if any.' })\n parent?: ObjectRef\n\n @Field({ nullable: true, description: 'The brand name associated with the domain.' })\n brandName?: string\n\n @Field({ nullable: true, description: 'The brand image URL for the domain.' })\n brandImage?: string\n\n @Field({ nullable: true, description: 'The content image URL for the domain.' })\n contentImage?: string\n\n @Field({\n nullable: true,\n description:\n \"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.\"\n })\n extType?: string\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'Additional attributes for the domain in key-value pairs.'\n })\n attributes?: any\n\n @Field({ nullable: true, description: 'The theme associated with the domain.' })\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"]}
@@ -10,42 +10,45 @@ let Domain = class Domain {
10
10
  exports.Domain = Domain;
11
11
  tslib_1.__decorate([
12
12
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
13
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
13
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'The unique identifier of the domain.' }),
14
14
  tslib_1.__metadata("design:type", String)
15
15
  ], Domain.prototype, "id", void 0);
16
16
  tslib_1.__decorate([
17
- (0, type_graphql_1.Field)(),
17
+ (0, type_graphql_1.Field)({ description: 'The name of the domain.' }),
18
18
  (0, typeorm_1.Column)({ unique: true }),
19
19
  tslib_1.__metadata("design:type", String)
20
20
  ], Domain.prototype, "name", void 0);
21
21
  tslib_1.__decorate([
22
- (0, type_graphql_1.Field)({ nullable: true }),
22
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A description of the domain.' }),
23
23
  (0, typeorm_1.Column)({ nullable: true }),
24
24
  tslib_1.__metadata("design:type", String)
25
25
  ], Domain.prototype, "description", void 0);
26
26
  tslib_1.__decorate([
27
- (0, type_graphql_1.Field)({ nullable: true }),
27
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The external type of the domain, if applicable.' }),
28
28
  (0, typeorm_1.Column)({ nullable: true }),
29
29
  tslib_1.__metadata("design:type", String)
30
30
  ], Domain.prototype, "extType", void 0);
31
31
  tslib_1.__decorate([
32
- (0, type_graphql_1.Field)({ nullable: true }),
32
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The timezone of the domain, if applicable.' }),
33
33
  (0, typeorm_1.Column)({ nullable: true }),
34
34
  tslib_1.__metadata("design:type", String)
35
35
  ], Domain.prototype, "timezone", void 0);
36
36
  tslib_1.__decorate([
37
37
  (0, type_graphql_1.Directive)('@deprecated(reason: "Use `parent`")'),
38
- (0, type_graphql_1.Field)({ nullable: true }),
38
+ (0, type_graphql_1.Field)({
39
+ nullable: true,
40
+ description: 'A flag indicating if the domain is a system domain. Deprecated, use `parent` instead.'
41
+ }),
39
42
  (0, typeorm_1.Column)({ default: false }),
40
43
  tslib_1.__metadata("design:type", Boolean)
41
44
  ], Domain.prototype, "systemFlag", void 0);
42
45
  tslib_1.__decorate([
43
- (0, type_graphql_1.Field)({ nullable: true }),
46
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The subdomain of the domain, if applicable.' }),
44
47
  (0, typeorm_1.Column)({ nullable: true }),
45
48
  tslib_1.__metadata("design:type", String)
46
49
  ], Domain.prototype, "subdomain", void 0);
47
50
  tslib_1.__decorate([
48
- (0, type_graphql_1.Field)({ nullable: true }),
51
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The parent domain, if this domain is a subdomain.' }),
49
52
  (0, typeorm_1.ManyToOne)(type => Domain, { nullable: true }),
50
53
  tslib_1.__metadata("design:type", Domain)
51
54
  ], Domain.prototype, "parent", void 0);
@@ -55,57 +58,60 @@ tslib_1.__decorate([
55
58
  ], Domain.prototype, "parentId", void 0);
56
59
  tslib_1.__decorate([
57
60
  (0, typeorm_1.OneToMany)(type => Domain, domain => domain.parent),
58
- (0, type_graphql_1.Field)(type => Domain, { nullable: true }),
61
+ (0, type_graphql_1.Field)(type => Domain, { nullable: true, description: 'The child domains, if any, under this domain.' }),
59
62
  tslib_1.__metadata("design:type", Array)
60
63
  ], Domain.prototype, "children", void 0);
61
64
  tslib_1.__decorate([
62
- (0, type_graphql_1.Field)({ nullable: true }),
65
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The brand name associated with the domain, if any.' }),
63
66
  (0, typeorm_1.Column)({ nullable: true }),
64
67
  tslib_1.__metadata("design:type", String)
65
68
  ], Domain.prototype, "brandName", void 0);
66
69
  tslib_1.__decorate([
67
- (0, type_graphql_1.Field)({ nullable: true }),
70
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The brand image URL associated with the domain, if any.' }),
68
71
  (0, typeorm_1.Column)({ nullable: true }),
69
72
  tslib_1.__metadata("design:type", String)
70
73
  ], Domain.prototype, "brandImage", void 0);
71
74
  tslib_1.__decorate([
72
- (0, type_graphql_1.Field)({ nullable: true }),
75
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The content image URL associated with the domain, if any.' }),
73
76
  (0, typeorm_1.Column)({ nullable: true }),
74
77
  tslib_1.__metadata("design:type", String)
75
78
  ], Domain.prototype, "contentImage", void 0);
76
79
  tslib_1.__decorate([
77
- (0, type_graphql_1.Field)({ nullable: true }),
80
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The owner of the domain, if applicable.' }),
78
81
  (0, typeorm_1.Column)({ nullable: true }),
79
82
  tslib_1.__metadata("design:type", String)
80
83
  ], Domain.prototype, "owner", void 0);
81
84
  tslib_1.__decorate([
82
- (0, type_graphql_1.Field)({ nullable: true }),
85
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The theme associated with the domain, if any.' }),
83
86
  (0, typeorm_1.Column)({ nullable: true }),
84
87
  tslib_1.__metadata("design:type", String)
85
88
  ], Domain.prototype, "theme", void 0);
86
89
  tslib_1.__decorate([
87
90
  (0, typeorm_1.Column)('simple-json', { nullable: true }),
88
- (0, type_graphql_1.Field)(type => scalar_object_js_1.ScalarObject, { nullable: true }),
91
+ (0, type_graphql_1.Field)(type => scalar_object_js_1.ScalarObject, {
92
+ nullable: true,
93
+ description: 'A list of IPs and their associated access levels for the domain.'
94
+ }),
89
95
  tslib_1.__metadata("design:type", Object)
90
96
  ], Domain.prototype, "iplist", void 0);
91
97
  tslib_1.__decorate([
92
98
  (0, typeorm_1.Column)('simple-json', { nullable: true }),
93
- (0, type_graphql_1.Field)(type => scalar_object_js_1.ScalarObject, { nullable: true }),
99
+ (0, type_graphql_1.Field)(type => scalar_object_js_1.ScalarObject, { nullable: true, description: 'Additional attributes associated with the domain.' }),
94
100
  tslib_1.__metadata("design:type", Object)
95
101
  ], Domain.prototype, "attributes", void 0);
96
102
  tslib_1.__decorate([
97
- (0, type_graphql_1.Field)({ nullable: true }),
103
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the domain was created.' }),
98
104
  (0, typeorm_1.CreateDateColumn)(),
99
105
  tslib_1.__metadata("design:type", Date)
100
106
  ], Domain.prototype, "createdAt", void 0);
101
107
  tslib_1.__decorate([
102
- (0, type_graphql_1.Field)({ nullable: true }),
108
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the domain was last updated.' }),
103
109
  (0, typeorm_1.UpdateDateColumn)(),
104
110
  tslib_1.__metadata("design:type", Date)
105
111
  ], Domain.prototype, "updatedAt", void 0);
106
112
  tslib_1.__decorate([
107
113
  (0, typeorm_1.DeleteDateColumn)(),
108
- (0, type_graphql_1.Field)({ nullable: true }),
114
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The date and time when the domain was deleted, if applicable.' }),
109
115
  tslib_1.__metadata("design:type", Date)
110
116
  ], Domain.prototype, "deletedAt", void 0);
111
117
  exports.Domain = Domain = tslib_1.__decorate([
@@ -114,6 +120,8 @@ exports.Domain = Domain = tslib_1.__decorate([
114
120
  unique: true,
115
121
  where: '"deleted_at" IS NULL'
116
122
  }),
117
- (0, type_graphql_1.ObjectType)()
123
+ (0, type_graphql_1.ObjectType)({
124
+ description: 'Represents a domain entity, which is a logical grouping of users, roles, and resources within the system.'
125
+ })
118
126
  ], Domain);
119
127
  //# sourceMappingURL=domain.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../server/service/domain/domain.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA+D;AAC/D,uEAA+D;AAkBxD,IAAM,MAAM,GAAZ,MAAM,MAAM;CAgFlB,CAAA;AAhFY,wBAAM;AAGR;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;kCACC;AAInB;IAFC,IAAA,oBAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;oCACb;AAIZ;IAFC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACR;AAInB;IAFC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACZ;AAIf;IAFC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACX;AAKhB;IAHC,IAAA,wBAAS,EAAC,qCAAqC,CAAC;IAChD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC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n\n} from 'typeorm'\nimport { ObjectType, Directive, Field, ID } from 'type-graphql'\nimport { ScalarObject } from '../common-types/scalar-object.js'\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 @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\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 delet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AAE,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE;QAC9E,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,yBAAU,EAAC;QACV,WAAW,EACT,2GAA2G;KAC9G,CAAC;GACW,MAAM,CAsFlB","sourcesContent":["import {\n Column,\n CreateDateColumn,\n ManyToOne,\n OneToMany,\n RelationId,\n Entity,\n Index,\n UpdateDateColumn,\n DeleteDateColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Directive, Field, ID } from 'type-graphql'\nimport { ScalarObject } from '../common-types/scalar-object.js'\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({\n description:\n 'Represents a domain entity, which is a logical grouping of users, roles, and resources within the system.'\n})\nexport class Domain {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'The unique identifier of the domain.' })\n readonly id: string\n\n @Field({ description: 'The name of the domain.' })\n @Column({ unique: true })\n name: string\n\n @Field({ nullable: true, description: 'A description of the domain.' })\n @Column({ nullable: true })\n description: string\n\n @Field({ nullable: true, description: 'The external type of the domain, if applicable.' })\n @Column({ nullable: true })\n extType: string\n\n @Field({ nullable: true, description: 'The timezone of the domain, if applicable.' })\n @Column({ nullable: true })\n timezone: string\n\n @Directive('@deprecated(reason: \"Use `parent`\")')\n @Field({\n nullable: true,\n description: 'A flag indicating if the domain is a system domain. Deprecated, use `parent` instead.'\n })\n @Column({ default: false })\n systemFlag: boolean\n\n @Field({ nullable: true, description: 'The subdomain of the domain, if applicable.' })\n @Column({ nullable: true })\n subdomain: string\n\n @Field({ nullable: true, description: 'The parent domain, if this domain is a subdomain.' })\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, description: 'The child domains, if any, under this domain.' })\n children: Domain[]\n\n @Field({ nullable: true, description: 'The brand name associated with the domain, if any.' })\n @Column({ nullable: true })\n brandName: string\n\n @Field({ nullable: true, description: 'The brand image URL associated with the domain, if any.' })\n @Column({ nullable: true })\n brandImage: string\n\n @Field({ nullable: true, description: 'The content image URL associated with the domain, if any.' })\n @Column({ nullable: true })\n contentImage: string\n\n @Field({ nullable: true, description: 'The owner of the domain, if applicable.' })\n @Column({ nullable: true })\n owner: string\n\n @Field({ nullable: true, description: 'The theme associated with the domain, if any.' })\n @Column({ nullable: true })\n theme: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'A list of IPs and their associated access levels for the domain.'\n })\n iplist?: IPList\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true, description: 'Additional attributes associated with the domain.' })\n attributes?: any\n\n @Field({ nullable: true, description: 'The date and time when the domain was created.' })\n @CreateDateColumn()\n createdAt: Date\n\n @Field({ nullable: true, description: 'The date and time when the domain was last updated.' })\n @UpdateDateColumn()\n updatedAt: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The date and time when the domain was deleted, if applicable.' })\n deletedAt?: Date\n}\n"]}
@@ -15,26 +15,26 @@ let DataResolver = class DataResolver {
15
15
  exports.DataResolver = DataResolver;
16
16
  tslib_1.__decorate([
17
17
  (0, type_graphql_1.Subscription)({
18
+ description: 'Subscribes to real-time data updates for a specific tag within the current domain. Only users belonging to the domain or superusers are allowed to subscribe.',
18
19
  subscribe: ({ args, context, info }) => {
19
- var _a;
20
20
  const { domain, user } = context.state;
21
21
  const { tag } = args;
22
- const subdomain = domain === null || domain === void 0 ? void 0 : domain.subdomain;
22
+ const subdomain = domain?.subdomain;
23
23
  if (!domain || !tag) {
24
24
  throw new Error('domain and tag required');
25
25
  }
26
26
  //@ts-ignore
27
- if (!((_a = user.domains) === null || _a === void 0 ? void 0 : _a.find(d => d.subdomain === subdomain)) && !process.superUserGranted(domain, user)) {
27
+ if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {
28
28
  throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`);
29
29
  }
30
30
  return (0, graphql_yoga_1.pipe)(pubsub_js_1.pubsub.subscribe('data'), (0, graphql_yoga_1.filter)((payload) => {
31
31
  const { domain: pdomain, tag: ptag, data } = payload.data;
32
- return tag === ptag && subdomain === (pdomain === null || pdomain === void 0 ? void 0 : pdomain.subdomain);
32
+ return tag === ptag && subdomain === pdomain?.subdomain;
33
33
  }));
34
34
  }
35
35
  }),
36
36
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
37
- tslib_1.__param(1, (0, type_graphql_1.Arg)('tag')),
37
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('tag', { description: 'The tag used to filter and identify the data stream for subscription.' })),
38
38
  tslib_1.__metadata("design:type", Function),
39
39
  tslib_1.__metadata("design:paramtypes", [Object, String]),
40
40
  tslib_1.__metadata("design:returntype", data_types_js_1.Data)
@@ -1 +1 @@
1
- {"version":3,"file":"data-resolver.js","sourceRoot":"","sources":["../../../server/service/subscription-data/data-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,+CAAwC;AACxC,mDAAsC;AAEtC,4FAA4F;AAErF,IAAM,YAAY,GAAlB,MAAM,YAAY;IAyBvB,IAAI,CAAS,OAAuB,EAAc,GAAW;QAC3D,OAAO,OAAO,CAAC,IAAI,CAAA;IACrB,CAAC;CACF,CAAA;AA5BY,oCAAY;AAyBvB;IAxBC,IAAA,2BAAY,EAAC;QACZ,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;;YACrC,MAAM,EAAE,MAAM,EAAE,IAA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port { pubsub } from '../../pubsub.js'\nimport { Data } from './data-types.js'\n\n/* 이 Resolver는 @things-factory/integration-base 에서 Overide 된다. (state-register를 사용하기 위해서) */\n@Resolver()\nexport class DataResolver {\n @Subscription({\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const { tag } = args\n const subdomain = domain?.subdomain\n\n if (!domain || !tag) {\n throw new Error('domain and tag required')\n }\n\n //@ts-ignore\n if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {\n throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`)\n }\n\n return pipe(\n pubsub.subscribe('data'),\n filter((payload: { data: Data }) => {\n const { domain: pdomain, tag: ptag, data } = payload.data\n return tag === ptag && subdomain === pdomain?.subdomain\n })\n )\n }\n })\n data(@Root() payload: { data: Data }, @Arg('tag') tag: string): Data {\n return payload.data\n }\n}\n"]}
1
+ {"version":3,"file":"data-resolver.js","sourceRoot":"","sources":["../../../server/service/subscription-data/data-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAAgE;AAEhE,+CAAwC;AACxC,mDAAsC;AAEtC,4FAA4F;AAErF,IAAM,YAAY,GAAlB,MAAM,YAAY;IA2BvB,IAAI,CACM,OAAuB,EACuE,GAAW;QAEjH,OAAO,OAAO,CAAC,IAAI,CAAA;IACrB,CAAC;CACF,CAAA;AAjCY,oCAAY;AA2BvB;IA1BC,IAAA,2BAAY,EAAC;QACZ,WAAW,EACT,+JAA+J;QACjK,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,EAAE,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,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,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,kBAAM,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,KAAK,OAAO,EAAE,SAAS,CAAA;YACzD,CAAC,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAC;IAEC,mBAAA,IAAA,mBAAI,GAAE,CAAA;IACN,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,uEAAuE,EAAE,CAAC,CAAA;;;4CACpG,oBAAI;wCAEN;uBAhCU,YAAY;IADxB,IAAA,uBAAQ,GAAE;GACE,YAAY,CAiCxB","sourcesContent":["import { filter, pipe } from 'graphql-yoga'\nimport { Arg, Resolver, Root, Subscription } from 'type-graphql'\n\nimport { pubsub } from '../../pubsub.js'\nimport { Data } from './data-types.js'\n\n/* 이 Resolver는 @things-factory/integration-base 에서 Overide 된다. (state-register를 사용하기 위해서) */\n@Resolver()\nexport class DataResolver {\n @Subscription({\n description:\n 'Subscribes to real-time data updates for a specific tag within the current domain. Only users belonging to the domain or superusers are allowed to subscribe.',\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(\n @Root() payload: { data: Data },\n @Arg('tag', { description: 'The tag used to filter and identify the data stream for subscription.' }) tag: string\n ): Data {\n return payload.data\n }\n}\n"]}
@@ -9,18 +9,23 @@ let Data = class Data {
9
9
  };
10
10
  exports.Data = Data;
11
11
  tslib_1.__decorate([
12
- (0, type_graphql_1.Field)(type => domain_js_1.Domain, { nullable: true, description: 'The domain where the data originated' }),
12
+ (0, type_graphql_1.Field)(type => domain_js_1.Domain, { nullable: true, description: 'The domain where the data originated.' }),
13
13
  tslib_1.__metadata("design:type", domain_js_1.Domain)
14
14
  ], Data.prototype, "domain", void 0);
15
15
  tslib_1.__decorate([
16
- (0, type_graphql_1.Field)({ description: 'Tag name attached to data' }),
16
+ (0, type_graphql_1.Field)({ description: 'The tag name attached to the data, used for filtering and identification.' }),
17
17
  tslib_1.__metadata("design:type", String)
18
18
  ], Data.prototype, "tag", void 0);
19
19
  tslib_1.__decorate([
20
- (0, type_graphql_1.Field)(type => scalar_object_js_1.ScalarObject, { nullable: true, description: 'Data delivered by subscription' }),
20
+ (0, type_graphql_1.Field)(type => scalar_object_js_1.ScalarObject, {
21
+ nullable: true,
22
+ description: 'The actual data content delivered by the subscription.'
23
+ }),
21
24
  tslib_1.__metadata("design:type", Object)
22
25
  ], Data.prototype, "data", void 0);
23
26
  exports.Data = Data = tslib_1.__decorate([
24
- (0, type_graphql_1.ObjectType)()
27
+ (0, type_graphql_1.ObjectType)({
28
+ description: 'Represents a data payload delivered via subscription, including its domain, tag, and content.'
29
+ })
25
30
  ], Data);
26
31
  //# 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,uEAA+D;AAC/D,mDAA4C;AAGrC,IAAM,IAAI,GAAV,MAAM,IAAI;CAShB,CAAA;AATY,oBAAI;AAEf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;sCACtF,kBAAM;oCAAA;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;iCACzC;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,+BAAY,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.js'\nimport { Domain } from '../domain/domain.js'\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"]}
1
+ {"version":3,"file":"data-types.js","sourceRoot":"","sources":["../../../server/service/subscription-data/data-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAEhD,uEAA+D;AAC/D,mDAA4C;AAKrC,IAAM,IAAI,GAAV,MAAM,IAAI;CAYhB,CAAA;AAZY,oBAAI;AAEf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;sCACvF,kBAAM;oCAAA;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2EAA2E,EAAE,CAAC;;iCACzF;AAMX;IAJC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,+BAAY,EAAE;QAC3B,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,wDAAwD;KACtE,CAAC;sCACK,MAAM;kCAAA;eAXF,IAAI;IAHhB,IAAA,yBAAU,EAAC;QACV,WAAW,EAAE,+FAA+F;KAC7G,CAAC;GACW,IAAI,CAYhB","sourcesContent":["import { Field, ObjectType } from 'type-graphql'\n\nimport { ScalarObject } from '../common-types/scalar-object.js'\nimport { Domain } from '../domain/domain.js'\n\n@ObjectType({\n description: 'Represents a data payload delivered via subscription, including its domain, tag, and content.'\n})\nexport class Data {\n @Field(type => Domain, { nullable: true, description: 'The domain where the data originated.' })\n domain?: Domain\n\n @Field({ description: 'The tag name attached to the data, used for filtering and identification.' })\n tag: string\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'The actual data content delivered by the subscription.'\n })\n data?: Object\n}\n"]}
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ // This module provides GraphQL resolvers and types for real-time data subscriptions.
3
+ // It enables clients to subscribe to data updates filtered by tag and domain.
4
+ // Use this module to implement pub/sub patterns for live data delivery in the application.
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.resolvers = exports.entities = void 0;
4
7
  const data_resolver_js_1 = require("./data-resolver.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/subscription-data/index.ts"],"names":[],"mappings":";;;AAAA,yDAAiD;AAEpC,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,+BAAY,CAAC,CAAA","sourcesContent":["import { DataResolver } from './data-resolver.js'\n\nexport const entities = []\nexport const resolvers = [DataResolver]\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/subscription-data/index.ts"],"names":[],"mappings":";AAAA,qFAAqF;AACrF,8EAA8E;AAC9E,2FAA2F;;;AAE3F,yDAAiD;AAEpC,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,+BAAY,CAAC,CAAA","sourcesContent":["// This module provides GraphQL resolvers and types for real-time data subscriptions.\n// It enables clients to subscribe to data updates filtered by tag and domain.\n// Use this module to implement pub/sub patterns for live data delivery in the application.\n\nimport { DataResolver } from './data-resolver.js'\n\nexport const entities = []\nexport const resolvers = [DataResolver]\n"]}