@things-factory/dataset 9.0.2 → 9.0.3

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 (68) hide show
  1. package/dist-client/tsconfig.tsbuildinfo +1 -1
  2. package/dist-server/service/data-archive/data-archive-mutation.js +18 -6
  3. package/dist-server/service/data-archive/data-archive-mutation.js.map +1 -1
  4. package/dist-server/service/data-archive/data-archive-query.js +15 -5
  5. package/dist-server/service/data-archive/data-archive-query.js.map +1 -1
  6. package/dist-server/service/data-archive/data-archive-type.js +11 -8
  7. package/dist-server/service/data-archive/data-archive-type.js.map +1 -1
  8. package/dist-server/service/data-archive/data-archive.js +10 -5
  9. package/dist-server/service/data-archive/data-archive.js.map +1 -1
  10. package/dist-server/service/data-key-set/data-key-item-type.js +10 -8
  11. package/dist-server/service/data-key-set/data-key-item-type.js.map +1 -1
  12. package/dist-server/service/data-key-set/data-key-set-mutation.js +18 -6
  13. package/dist-server/service/data-key-set/data-key-set-mutation.js.map +1 -1
  14. package/dist-server/service/data-key-set/data-key-set-query.js +19 -6
  15. package/dist-server/service/data-key-set/data-key-set-query.js.map +1 -1
  16. package/dist-server/service/data-key-set/data-key-set-type.js +17 -11
  17. package/dist-server/service/data-key-set/data-key-set-type.js.map +1 -1
  18. package/dist-server/service/data-key-set/data-key-set.js +8 -3
  19. package/dist-server/service/data-key-set/data-key-set.js.map +1 -1
  20. package/dist-server/service/data-ooc/data-ooc-mutation.js +6 -2
  21. package/dist-server/service/data-ooc/data-ooc-mutation.js.map +1 -1
  22. package/dist-server/service/data-ooc/data-ooc-query.js +27 -9
  23. package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
  24. package/dist-server/service/data-ooc/data-ooc-subscription.d.ts +5 -0
  25. package/dist-server/service/data-ooc/data-ooc-subscription.js +15 -1
  26. package/dist-server/service/data-ooc/data-ooc-subscription.js.map +1 -1
  27. package/dist-server/service/data-ooc/data-ooc-type.js +29 -20
  28. package/dist-server/service/data-ooc/data-ooc-type.js.map +1 -1
  29. package/dist-server/service/data-ooc/data-ooc.js +11 -6
  30. package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
  31. package/dist-server/service/data-sample/data-sample-mutation.js +3 -1
  32. package/dist-server/service/data-sample/data-sample-mutation.js.map +1 -1
  33. package/dist-server/service/data-sample/data-sample-query.js +24 -8
  34. package/dist-server/service/data-sample/data-sample-query.js.map +1 -1
  35. package/dist-server/service/data-sample/data-sample-type.js +13 -13
  36. package/dist-server/service/data-sample/data-sample-type.js.map +1 -1
  37. package/dist-server/service/data-sample/data-sample.js +11 -6
  38. package/dist-server/service/data-sample/data-sample.js.map +1 -1
  39. package/dist-server/service/data-sensor/data-sensor-mutation.js +15 -5
  40. package/dist-server/service/data-sensor/data-sensor-mutation.js.map +1 -1
  41. package/dist-server/service/data-sensor/data-sensor-query.js +24 -8
  42. package/dist-server/service/data-sensor/data-sensor-query.js.map +1 -1
  43. package/dist-server/service/data-sensor/data-sensor-type.js +19 -19
  44. package/dist-server/service/data-sensor/data-sensor-type.js.map +1 -1
  45. package/dist-server/service/data-sensor/data-sensor.js +11 -9
  46. package/dist-server/service/data-sensor/data-sensor.js.map +1 -1
  47. package/dist-server/service/data-set/data-set-mutation.js +25 -9
  48. package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
  49. package/dist-server/service/data-set/data-set-query.js +24 -8
  50. package/dist-server/service/data-set/data-set-query.js.map +1 -1
  51. package/dist-server/service/data-set/data-set-type.js +3 -1
  52. package/dist-server/service/data-set/data-set-type.js.map +1 -1
  53. package/dist-server/service/data-set-history/data-set-history-type.js +3 -3
  54. package/dist-server/service/data-set-history/data-set-history-type.js.map +1 -1
  55. package/dist-server/service/data-set-history/data-set-history.js +56 -37
  56. package/dist-server/service/data-set-history/data-set-history.js.map +1 -1
  57. package/dist-server/service/data-spec/data-spec.js +24 -14
  58. package/dist-server/service/data-spec/data-spec.js.map +1 -1
  59. package/dist-server/service/data-summary/data-summary-mutation.js +6 -2
  60. package/dist-server/service/data-summary/data-summary-mutation.js.map +1 -1
  61. package/dist-server/service/data-summary/data-summary-query.js +25 -8
  62. package/dist-server/service/data-summary/data-summary-query.js.map +1 -1
  63. package/dist-server/service/data-summary/data-summary-type.js +25 -23
  64. package/dist-server/service/data-summary/data-summary-type.js.map +1 -1
  65. package/dist-server/service/data-summary/data-summary.js +8 -6
  66. package/dist-server/service/data-summary/data-summary.js.map +1 -1
  67. package/dist-server/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +2 -2
@@ -49,7 +49,10 @@ let DataKeySetQuery = class DataKeySetQuery {
49
49
  };
50
50
  exports.DataKeySetQuery = DataKeySetQuery;
51
51
  tslib_1.__decorate([
52
- (0, type_graphql_1.Query)(returns => data_key_set_js_1.DataKeySet, { nullable: true, description: 'To fetch a DataKeySet' }),
52
+ (0, type_graphql_1.Query)(returns => data_key_set_js_1.DataKeySet, {
53
+ nullable: true,
54
+ description: 'Retrieves a single data key set by its unique identifier. This query fetches detailed information about a key set including its key items, configuration, and metadata. Data key sets define the indexing and categorization structure for data samples and summaries.'
55
+ }),
53
56
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
54
57
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
55
58
  tslib_1.__metadata("design:type", Function),
@@ -57,7 +60,9 @@ tslib_1.__decorate([
57
60
  tslib_1.__metadata("design:returntype", Promise)
58
61
  ], DataKeySetQuery.prototype, "dataKeySet", null);
59
62
  tslib_1.__decorate([
60
- (0, type_graphql_1.Query)(returns => data_key_set_type_js_1.DataKeySetList, { description: 'To fetch multiple DataKeySets' }),
63
+ (0, type_graphql_1.Query)(returns => data_key_set_type_js_1.DataKeySetList, {
64
+ description: 'Retrieves multiple data key sets with pagination and filtering support. This query allows searching key sets by name and description, and is used for listing and managing data categorization structures across all datasets.'
65
+ }),
61
66
  tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
62
67
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
63
68
  tslib_1.__metadata("design:type", Function),
@@ -65,28 +70,36 @@ tslib_1.__decorate([
65
70
  tslib_1.__metadata("design:returntype", Promise)
66
71
  ], DataKeySetQuery.prototype, "dataKeySets", null);
67
72
  tslib_1.__decorate([
68
- (0, type_graphql_1.FieldResolver)(type => String),
73
+ (0, type_graphql_1.FieldResolver)(type => String, {
74
+ description: 'Retrieves the thumbnail image path for this data key set. This field resolver provides access to visual representation of the key set, typically used for display purposes in user interfaces.'
75
+ }),
69
76
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
70
77
  tslib_1.__metadata("design:type", Function),
71
78
  tslib_1.__metadata("design:paramtypes", [data_key_set_js_1.DataKeySet]),
72
79
  tslib_1.__metadata("design:returntype", Promise)
73
80
  ], DataKeySetQuery.prototype, "thumbnail", null);
74
81
  tslib_1.__decorate([
75
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
82
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain, {
83
+ description: 'Retrieves the domain that this data key set belongs to. This field resolver provides access to the organizational context and settings associated with the key set.'
84
+ }),
76
85
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
77
86
  tslib_1.__metadata("design:type", Function),
78
87
  tslib_1.__metadata("design:paramtypes", [data_key_set_js_1.DataKeySet]),
79
88
  tslib_1.__metadata("design:returntype", Promise)
80
89
  ], DataKeySetQuery.prototype, "domain", null);
81
90
  tslib_1.__decorate([
82
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
91
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, {
92
+ description: 'Retrieves the user who last updated this data key set. This field resolver identifies the person responsible for the most recent modifications to the key set configuration.'
93
+ }),
83
94
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
84
95
  tslib_1.__metadata("design:type", Function),
85
96
  tslib_1.__metadata("design:paramtypes", [data_key_set_js_1.DataKeySet]),
86
97
  tslib_1.__metadata("design:returntype", Promise)
87
98
  ], DataKeySetQuery.prototype, "updater", null);
88
99
  tslib_1.__decorate([
89
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
100
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, {
101
+ description: 'Retrieves the user who created this data key set. This field resolver identifies the person responsible for initially defining the key set structure and configuration.'
102
+ }),
90
103
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
91
104
  tslib_1.__metadata("design:type", Function),
92
105
  tslib_1.__metadata("design:paramtypes", [data_key_set_js_1.DataKeySet]),
@@ -1 +1 @@
1
- {"version":3,"file":"data-key-set-query.js","sourceRoot":"","sources":["../../../server/service/data-key-set/data-key-set-query.ts"],"names":[],"mappings":";;;;AAAA,qCAA4B;AAC5B,+CAAmF;AAEnF,qEAA4D;AAC5D,yDAAgD;AAChD,iDAAuG;AAEvG,uDAA8C;AAC9C,iEAAuD;AAGhD,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,4BAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAA,YAAE,EAAC,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;SAChF,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CACU,MAAiB,EACnC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,4BAAU,CAAC;YAC3C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAA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C,EAAE,CAAC,4BAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACtE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAM7C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,qCAAc,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAEhF,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IACvB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAD2B,iBAAS;;kDAe3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;gDAU7C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;8CAE3C;0BAvDU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,4BAAU,CAAC;GACR,eAAe,CAwD3B","sourcesContent":["import { In } from 'typeorm'\nimport { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { DataKeySet } from './data-key-set.js'\nimport { DataKeySetList } from './data-key-set-type.js'\n\n@Resolver(DataKeySet)\nexport class DataKeySetQuery {\n @Query(returns => DataKeySet!, { nullable: true, description: 'To fetch a DataKeySet' })\n async dataKeySet(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<DataKeySet> {\n const { domain } = context.state\n\n return await getRepository(DataKeySet).findOne({\n where: { domain: { id: In([domain.id, domain.parentId].filter(Boolean)) }, id }\n })\n }\n\n @Query(returns => DataKeySetList, { description: 'To fetch multiple DataKeySets' })\n async dataKeySets(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<DataKeySetList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(DataKeySet),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() dataKeySet: DataKeySet): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: dataKeySet.domainId },\n refType: DataKeySet.name,\n refBy: dataKeySet.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() dataKeySet: DataKeySet): Promise<Domain> {\n return dataKeySet.domainId && (await getRepository(Domain).findOneBy({ id: dataKeySet.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() dataKeySet: DataKeySet): Promise<User> {\n return dataKeySet.updaterId && (await getRepository(User).findOneBy({ id: dataKeySet.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() dataKeySet: DataKeySet): Promise<User> {\n return dataKeySet.creatorId && (await getRepository(User).findOneBy({ id: dataKeySet.creatorId }))\n }\n}\n"]}
1
+ {"version":3,"file":"data-key-set-query.js","sourceRoot":"","sources":["../../../server/service/data-key-set/data-key-set-query.ts"],"names":[],"mappings":";;;;AAAA,qCAA4B;AAC5B,+CAAmF;AAEnF,q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kDAe3C;AAMK;IAJL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE;QAC7B,WAAW,EACT,gMAAgM;KACnM,CAAC;IACe,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;gDAU7C;AAMK;IAJL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE;QAC7B,WAAW,EACT,qKAAqK;KACxK,CAAC;IACY,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;6CAE1C;AAMK;IAJL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QAC3B,WAAW,EACT,8KAA8K;KACjL,CAAC;IACa,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;8CAE3C;AAMK;IAJL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QAC3B,WAAW,EACT,yKAAyK;KAC5K,CAAC;IACa,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,4BAAU;;8CAE3C;0BA1EU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,4BAAU,CAAC;GACR,eAAe,CA2E3B","sourcesContent":["import { In } from 'typeorm'\nimport { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { DataKeySet } from './data-key-set.js'\nimport { DataKeySetList } from './data-key-set-type.js'\n\n@Resolver(DataKeySet)\nexport class DataKeySetQuery {\n @Query(returns => DataKeySet!, {\n nullable: true,\n description:\n 'Retrieves a single data key set by its unique identifier. This query fetches detailed information about a key set including its key items, configuration, and metadata. Data key sets define the indexing and categorization structure for data samples and summaries.'\n })\n async dataKeySet(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<DataKeySet> {\n const { domain } = context.state\n\n return await getRepository(DataKeySet).findOne({\n where: { domain: { id: In([domain.id, domain.parentId].filter(Boolean)) }, id }\n })\n }\n\n @Query(returns => DataKeySetList, {\n description:\n 'Retrieves multiple data key sets with pagination and filtering support. This query allows searching key sets by name and description, and is used for listing and managing data categorization structures across all datasets.'\n })\n async dataKeySets(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<DataKeySetList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(DataKeySet),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String, {\n description:\n 'Retrieves the thumbnail image path for this data key set. This field resolver provides access to visual representation of the key set, typically used for display purposes in user interfaces.'\n })\n async thumbnail(@Root() dataKeySet: DataKeySet): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: dataKeySet.domainId },\n refType: DataKeySet.name,\n refBy: dataKeySet.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain, {\n description:\n 'Retrieves the domain that this data key set belongs to. This field resolver provides access to the organizational context and settings associated with the key set.'\n })\n async domain(@Root() dataKeySet: DataKeySet): Promise<Domain> {\n return dataKeySet.domainId && (await getRepository(Domain).findOneBy({ id: dataKeySet.domainId }))\n }\n\n @FieldResolver(type => User, {\n description:\n 'Retrieves the user who last updated this data key set. This field resolver identifies the person responsible for the most recent modifications to the key set configuration.'\n })\n async updater(@Root() dataKeySet: DataKeySet): Promise<User> {\n return dataKeySet.updaterId && (await getRepository(User).findOneBy({ id: dataKeySet.updaterId }))\n }\n\n @FieldResolver(type => User, {\n description:\n 'Retrieves the user who created this data key set. This field resolver identifies the person responsible for initially defining the key set structure and configuration.'\n })\n async creator(@Root() dataKeySet: DataKeySet): Promise<User> {\n return dataKeySet.creatorId && (await getRepository(User).findOneBy({ id: dataKeySet.creatorId }))\n }\n}\n"]}
@@ -11,7 +11,7 @@ let NewDataKeySet = class NewDataKeySet {
11
11
  };
12
12
  exports.NewDataKeySet = NewDataKeySet;
13
13
  tslib_1.__decorate([
14
- (0, type_graphql_1.Field)(),
14
+ (0, type_graphql_1.Field)({ description: 'Name of the data key set for identification.' }),
15
15
  tslib_1.__metadata("design:type", String)
16
16
  ], NewDataKeySet.prototype, "name", void 0);
17
17
  tslib_1.__decorate([
@@ -53,31 +53,37 @@ tslib_1.__decorate([
53
53
  tslib_1.__metadata("design:type", String)
54
54
  ], DataKeySetPatch.prototype, "name", void 0);
55
55
  tslib_1.__decorate([
56
- (0, type_graphql_1.Field)({ nullable: true }),
56
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Description of the data key set.' }),
57
57
  tslib_1.__metadata("design:type", String)
58
58
  ], DataKeySetPatch.prototype, "description", void 0);
59
59
  tslib_1.__decorate([
60
- (0, type_graphql_1.Field)({ nullable: true }),
60
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the data key set is active.' }),
61
61
  tslib_1.__metadata("design:type", Boolean)
62
62
  ], DataKeySetPatch.prototype, "active", void 0);
63
63
  tslib_1.__decorate([
64
- (0, type_graphql_1.Field)({ nullable: true }),
64
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Type of report to generate for this key set.' }),
65
65
  tslib_1.__metadata("design:type", String)
66
66
  ], DataKeySetPatch.prototype, "reportType", void 0);
67
67
  tslib_1.__decorate([
68
- (0, type_graphql_1.Field)({ nullable: true }),
68
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Custom report view for this key set.' }),
69
69
  tslib_1.__metadata("design:type", String)
70
70
  ], DataKeySetPatch.prototype, "reportView", void 0);
71
71
  tslib_1.__decorate([
72
- (0, type_graphql_1.Field)(type => [data_key_item_type_js_1.DataKeyItemPatch], { nullable: true }),
72
+ (0, type_graphql_1.Field)(type => [data_key_item_type_js_1.DataKeyItemPatch], {
73
+ nullable: true,
74
+ description: 'The key items that define the categorization structure for this key set.'
75
+ }),
73
76
  tslib_1.__metadata("design:type", Array)
74
77
  ], DataKeySetPatch.prototype, "dataKeyItems", void 0);
75
78
  tslib_1.__decorate([
76
- (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
79
+ (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, {
80
+ nullable: true,
81
+ description: 'Thumbnail image for visual representation of the key set.'
82
+ }),
77
83
  tslib_1.__metadata("design:type", Object)
78
84
  ], DataKeySetPatch.prototype, "thumbnail", void 0);
79
85
  tslib_1.__decorate([
80
- (0, type_graphql_1.Field)({ nullable: true }),
86
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Create/Update flag for batch operations.' }),
81
87
  tslib_1.__metadata("design:type", String)
82
88
  ], DataKeySetPatch.prototype, "cuFlag", void 0);
83
89
  exports.DataKeySetPatch = DataKeySetPatch = tslib_1.__decorate([
@@ -87,14 +93,14 @@ let DataKeySetList = class DataKeySetList {
87
93
  };
88
94
  exports.DataKeySetList = DataKeySetList;
89
95
  tslib_1.__decorate([
90
- (0, type_graphql_1.Field)(type => [data_key_set_js_1.DataKeySet]),
96
+ (0, type_graphql_1.Field)(type => [data_key_set_js_1.DataKeySet], { description: 'List of data key sets.' }),
91
97
  tslib_1.__metadata("design:type", Array)
92
98
  ], DataKeySetList.prototype, "items", void 0);
93
99
  tslib_1.__decorate([
94
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
100
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Total number of data key sets in the list.' }),
95
101
  tslib_1.__metadata("design:type", Number)
96
102
  ], DataKeySetList.prototype, "total", void 0);
97
103
  exports.DataKeySetList = DataKeySetList = tslib_1.__decorate([
98
- (0, type_graphql_1.ObjectType)()
104
+ (0, type_graphql_1.ObjectType)({ description: 'Represents a paginated list of data key sets.' })
99
105
  ], DataKeySetList);
100
106
  //# sourceMappingURL=data-key-set-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-key-set-type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AI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACI;AAG9B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACP;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wCAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACrB;AAGjC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC3B;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;0BA1BJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CA2B3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { DataKeyItemPatch } from './data-key-item-type.js'\nimport { DataKeySet } from './data-key-set.js'\nimport { DataSetReportType } from '../data-set/data-set.js'\n\n@InputType()\nexport class NewDataKeySet {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n reportType?: DataSetReportType\n\n @Field({ nullable: true })\n reportView?: string\n\n @Field(type => [DataKeyItemPatch], { nullable: true })\n dataKeyItems?: DataKeyItemPatch[]\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class DataKeySetPatch {\n @Field(type => ID, { 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 active?: boolean\n\n @Field({ nullable: true })\n reportType?: DataSetReportType\n\n @Field({ nullable: true })\n reportView?: string\n\n @Field(type => [DataKeyItemPatch], { nullable: true })\n dataKeyItems?: DataKeyItemPatch[]\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class DataKeySetList {\n @Field(type => [DataKeySet])\n items: DataKeySet[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"data-key-set-type.js","sourceRoot":"","sources":["../../../server/service/data-key-set/data-key-set-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAoE;AAEpE,mEAA0D;AAC1D,uDAA8C;AAC9C,yDAA2D;AAGpD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAqBzB,CAAA;AArBY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;;2CAC3D;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACI;AAG9B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACP;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wCAAgB,CAAC,EAAE,EAA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IAAI,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;+CACpE;0BAhCJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAiC3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAU,CAAC,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;6CACpD;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;6CACrE;yBALF,cAAc;IAD1B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;GAChE,cAAc,CAM1B","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { DataKeyItemPatch } from './data-key-item-type.js'\nimport { DataKeySet } from './data-key-set.js'\nimport { DataSetReportType } from '../data-set/data-set.js'\n\n@InputType()\nexport class NewDataKeySet {\n @Field({ description: 'Name of the data key set for identification.' })\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n reportType?: DataSetReportType\n\n @Field({ nullable: true })\n reportView?: string\n\n @Field(type => [DataKeyItemPatch], { nullable: true })\n dataKeyItems?: DataKeyItemPatch[]\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class DataKeySetPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true, description: 'Description of the data key set.' })\n description?: string\n\n @Field({ nullable: true, description: 'Indicates if the data key set is active.' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Type of report to generate for this key set.' })\n reportType?: DataSetReportType\n\n @Field({ nullable: true, description: 'Custom report view for this key set.' })\n reportView?: string\n\n @Field(type => [DataKeyItemPatch], {\n nullable: true,\n description: 'The key items that define the categorization structure for this key set.'\n })\n dataKeyItems?: DataKeyItemPatch[]\n\n @Field(type => GraphQLUpload, {\n nullable: true,\n description: 'Thumbnail image for visual representation of the key set.'\n })\n thumbnail?: FileUpload\n\n @Field({ nullable: true, description: 'Create/Update flag for batch operations.' })\n cuFlag?: string\n}\n\n@ObjectType({ description: 'Represents a paginated list of data key sets.' })\nexport class DataKeySetList {\n @Field(type => [DataKeySet], { description: 'List of data key sets.' })\n items: DataKeySet[]\n\n @Field(type => Int, { description: 'Total number of data key sets in the list.' })\n total: number\n}\n"]}
@@ -13,7 +13,7 @@ let DataKeySet = class DataKeySet {
13
13
  exports.DataKeySet = DataKeySet;
14
14
  tslib_1.__decorate([
15
15
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
16
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
16
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the data key set.' }),
17
17
  tslib_1.__metadata("design:type", String)
18
18
  ], DataKeySet.prototype, "id", void 0);
19
19
  tslib_1.__decorate([
@@ -56,7 +56,10 @@ tslib_1.__decorate([
56
56
  ], DataKeySet.prototype, "reportView", void 0);
57
57
  tslib_1.__decorate([
58
58
  (0, typeorm_1.Column)('simple-json', { nullable: true }),
59
- (0, type_graphql_1.Field)(type => [data_key_item_type_js_1.DataKeyItem], { nullable: true }),
59
+ (0, type_graphql_1.Field)(type => [data_key_item_type_js_1.DataKeyItem], {
60
+ nullable: true,
61
+ description: 'The key items that define the categorization structure for this key set.'
62
+ }),
60
63
  tslib_1.__metadata("design:type", Array)
61
64
  ], DataKeySet.prototype, "dataKeyItems", void 0);
62
65
  tslib_1.__decorate([
@@ -94,6 +97,8 @@ tslib_1.__decorate([
94
97
  exports.DataKeySet = DataKeySet = tslib_1.__decorate([
95
98
  (0, typeorm_1.Entity)(),
96
99
  (0, typeorm_1.Index)('ix_data_key_set_0', (dataKeySet) => [dataKeySet.domain, dataKeySet.name], { unique: true }),
97
- (0, type_graphql_1.ObjectType)({ description: 'Entity for DataKeySet' })
100
+ (0, type_graphql_1.ObjectType)({
101
+ description: 'Represents a data key set that defines the categorization and indexing structure for data samples. This entity organizes data using key items for efficient search and partitioning.'
102
+ })
98
103
  ], DataKeySet);
99
104
  //# sourceMappingURL=data-key-set.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-key-set.js","sourceRoot":"","sources":["../../../server/service/data-key-set/data-key-set.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,mEAAqD;AACrD,yDAA2D;AAKpD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAgEtB,CAAA;AAhEY,gCAAU;AAGZ;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;0CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;;4CACzC;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;wCACI;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAMpB;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAA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AAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACxB;qBA/DP,UAAU;IAHtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9G,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CAgEtB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { DataKeyItem } from './data-key-item-type.js'\nimport { DataSetReportType } from '../data-set/data-set.js'\n\n@Entity()\n@Index('ix_data_key_set_0', (dataKeySet: DataKeySet) => [dataKeySet.domain, dataKeySet.name], { unique: true })\n@ObjectType({ description: 'Entity for DataKeySet' })\nexport class DataKeySet {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((dataKeySet: DataKeySet) => dataKeySet.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reportType?: DataSetReportType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reportView?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => [DataKeyItem], { nullable: true })\n dataKeyItems: DataKeyItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((dataKeySet: DataKeySet) => dataKeySet.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((dataKeySet: DataKeySet) => dataKeySet.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n}\n"]}
1
+ {"version":3,"file":"data-key-set.js","sourceRoot":"","sources":["../../../server/service/data-key-set/data-key-set.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,mEAAqD;AACrD,yDAA2D;AAQpD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAmEtB,CAAA;AAnEY,gCAAU;AAGZ;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;;sCAC3D;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;0CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;;4CACzC;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;wCACI;AAMZ;IAJC,IAAA,gBAAM,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,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACxB;qBAlEP,UAAU;IANtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9G,IAAA,yBAAU,EAAC;QACV,WAAW,EACT,sLAAsL;KACzL,CAAC;GACW,UAAU,CAmEtB","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { DataKeyItem } from './data-key-item-type.js'\nimport { DataSetReportType } from '../data-set/data-set.js'\n\n@Entity()\n@Index('ix_data_key_set_0', (dataKeySet: DataKeySet) => [dataKeySet.domain, dataKeySet.name], { unique: true })\n@ObjectType({\n description:\n 'Represents a data key set that defines the categorization and indexing structure for data samples. This entity organizes data using key items for efficient search and partitioning.'\n})\nexport class DataKeySet {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the data key set.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((dataKeySet: DataKeySet) => dataKeySet.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reportType?: DataSetReportType\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reportView?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => [DataKeyItem], {\n nullable: true,\n description: 'The key items that define the categorization structure for this key set.'\n })\n dataKeyItems: DataKeyItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((dataKeySet: DataKeySet) => dataKeySet.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((dataKeySet: DataKeySet) => dataKeySet.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n}\n"]}
@@ -68,7 +68,9 @@ exports.DataOocMutation = DataOocMutation;
68
68
  tslib_1.__decorate([
69
69
  (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "mutation", domainOwnerGranted: true)'),
70
70
  (0, type_graphql_1.Directive)('@transaction'),
71
- (0, type_graphql_1.Mutation)(returns => data_ooc_js_1.DataOoc, { description: 'To create new DataOoc' }),
71
+ (0, type_graphql_1.Mutation)(returns => data_ooc_js_1.DataOoc, {
72
+ description: 'Creates a new out-of-control (OOC) record for quality management. This mutation initiates the corrective action workflow for data samples that exceed control limits.'
73
+ }),
72
74
  tslib_1.__param(0, (0, type_graphql_1.Arg)('dataOoc')),
73
75
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
74
76
  tslib_1.__metadata("design:type", Function),
@@ -78,7 +80,9 @@ tslib_1.__decorate([
78
80
  tslib_1.__decorate([
79
81
  (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "mutation", domainOwnerGranted: true)'),
80
82
  (0, type_graphql_1.Directive)('@transaction'),
81
- (0, type_graphql_1.Mutation)(returns => data_ooc_js_1.DataOoc, { description: 'To modify DataOoc information' }),
83
+ (0, type_graphql_1.Mutation)(returns => data_ooc_js_1.DataOoc, {
84
+ description: 'Updates an out-of-control record with new status, corrective actions, and workflow progress. This mutation tracks the resolution process for quality issues.'
85
+ }),
82
86
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
83
87
  tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
84
88
  tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
@@ -1 +1 @@
1
- {"version":3,"file":"data-ooc-mutation.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,+CAAsD;AACtD,yDAA6D;AAGtD,IAAM,eAAe,GAArB,MAAM,eAAe;IAIpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,2BAAa,CAAC,MAAM,CAAA;QACnD,MAAM,OAAO,GAAG;YACd;gBACE,IAAI,EAAE;oBACJ,EAAE,EAAE,IAAI,CAAC,EAAE;oBACX,IAAI,EAAE,IAAI,CAAC,IAAI;iBAChB;gBACD,KAAK;gBACL,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB;SACF,CAAA;QAED,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,qBA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AED,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC;YAC3B,GAAG,OAAO;YACV,GAAG,KAAK;YACR,GAAG,IAAI;YACP,KAAK;YACL,OAAO;YACP,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;CAwEF,CAAA;AAnJY,0CAAe;AAIpB;IAHL,IAAA,wBAAS,EAAC,mFAAmF,CAAC;IAC9F,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,qBAAO,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;IAClD,mBAAA,IAAA,kBAAG,EAAC,SAAS,CAAC,CAAA;IAAuB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAlB,6BAAU;;oDAuBtD;AAKK;IAHL,IAAA,wBAAS,EAAC,mFAAmF,CAAC;IAC9F,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,qBAAO,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAE5E,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,+BAAY;;oDAyClC;0BA3EU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,qBAAO,CAAC;GACL,eAAe,CAmJ3B","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\n\nimport { DataOoc, DataOocStatus } from './data-ooc.js'\nimport { DataOocPatch, NewDataOoc } from './data-ooc-type.js'\n\n@Resolver(DataOoc)\nexport class DataOocMutation {\n @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => DataOoc, { description: 'To create new DataOoc' })\n async createDataOoc(@Arg('dataOoc') dataOoc: NewDataOoc, @Ctx() context: ResolverContext): Promise<DataOoc> {\n const { domain, user, tx } = context.state\n\n const state = dataOoc.state || DataOocStatus.ISSUED\n const history = [\n {\n user: {\n id: user.id,\n name: user.name\n },\n state,\n timestamp: Date.now()\n }\n ]\n\n return await tx.getRepository(DataOoc).save({\n ...dataOoc,\n state,\n domain,\n history,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => DataOoc, { description: 'To modify DataOoc information' })\n async updateDataOoc(\n @Arg('id') id: string,\n @Arg('patch') patch: DataOocPatch,\n @Ctx() context: ResolverContext\n ): Promise<DataOoc> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(DataOoc)\n const dataOoc = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const state = patch.state || dataOoc.state\n\n const history = dataOoc.history || []\n history.push({\n user: {\n id: user.id,\n name: user.name\n },\n state,\n comment: patch.correctiveAction || '',\n timestamp: Date.now()\n })\n\n const more = {} as any\n\n if (dataOoc.state !== patch.state) {\n if (patch.state === DataOocStatus.CORRECTED) {\n more.corrector = user\n } else {\n more.corrector = null\n }\n }\n\n return await repository.save({\n ...dataOoc,\n ...patch,\n ...more,\n state,\n history,\n updater: user\n })\n }\n\n // @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n // @Directive('@transaction')\n // @Mutation(returns => [DataOoc], { description: \"To modify multiple DataOoc' information\" })\n // async updateMultipleDataOoc(\n // @Arg('patches', type => [DataOocPatch]) patches: DataOocPatch[],\n // @Ctx() context: ResolverContext\n // ): Promise<DataOoc[]> {\n // const { domain, user, tx } = context.state\n\n // let results = []\n // const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n // const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n // const dataOocRepo = tx.getRepository(DataOoc)\n\n // if (_createRecords.length > 0) {\n // for (let i = 0; i < _createRecords.length; i++) {\n // const newRecord = _createRecords[i]\n\n // const result = await dataOocRepo.save({\n // ...newRecord,\n // domain,\n // creator: user,\n // updater: user\n // })\n\n // results.push({ ...result, cuFlag: '+' })\n // }\n // }\n\n // if (_updateRecords.length > 0) {\n // for (let i = 0; i < _updateRecords.length; i++) {\n // const newRecord = _updateRecords[i]\n // const dataOoc = await dataOocRepo.findOneBy({id: newRecord.id})\n\n // const result = await dataOocRepo.save({\n // ...dataOoc,\n // ...newRecord,\n // updater: user\n // })\n\n // results.push({ ...result, cuFlag: 'M' })\n // }\n // }\n\n // return results\n // }\n\n // @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n // @Directive('@transaction')\n // @Mutation(returns => Boolean, { description: 'To delete DataOoc' })\n // async deleteDataOoc(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n // const { domain, tx } = context.state\n\n // await tx.getRepository(DataOoc).delete({ domain: { id: domain.id }, id })\n // return true\n // }\n\n // @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n // @Directive('@transaction')\n // @Mutation(returns => Boolean, { description: 'To delete multiple dataOocs' })\n // async deleteDataOocs(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n // const { domain, tx } = context.state\n\n // await tx.getRepository(DataOoc).delete({\n // domain,\n // id: In(ids)\n // })\n\n // return true\n // }\n}\n"]}
1
+ {"version":3,"file":"data-ooc-mutation.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,+CAAsD;AACtD,yDAA6D;AAGtD,IAAM,eAAe,GAArB,MAAM,eAAe;IAOpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK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eAAe,CAyJ3B","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\n\nimport { DataOoc, DataOocStatus } from './data-ooc.js'\nimport { DataOocPatch, NewDataOoc } from './data-ooc-type.js'\n\n@Resolver(DataOoc)\nexport class DataOocMutation {\n @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => DataOoc, {\n description:\n 'Creates a new out-of-control (OOC) record for quality management. This mutation initiates the corrective action workflow for data samples that exceed control limits.'\n })\n async createDataOoc(@Arg('dataOoc') dataOoc: NewDataOoc, @Ctx() context: ResolverContext): Promise<DataOoc> {\n const { domain, user, tx } = context.state\n\n const state = dataOoc.state || DataOocStatus.ISSUED\n const history = [\n {\n user: {\n id: user.id,\n name: user.name\n },\n state,\n timestamp: Date.now()\n }\n ]\n\n return await tx.getRepository(DataOoc).save({\n ...dataOoc,\n state,\n domain,\n history,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => DataOoc, {\n description:\n 'Updates an out-of-control record with new status, corrective actions, and workflow progress. This mutation tracks the resolution process for quality issues.'\n })\n async updateDataOoc(\n @Arg('id') id: string,\n @Arg('patch') patch: DataOocPatch,\n @Ctx() context: ResolverContext\n ): Promise<DataOoc> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(DataOoc)\n const dataOoc = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const state = patch.state || dataOoc.state\n\n const history = dataOoc.history || []\n history.push({\n user: {\n id: user.id,\n name: user.name\n },\n state,\n comment: patch.correctiveAction || '',\n timestamp: Date.now()\n })\n\n const more = {} as any\n\n if (dataOoc.state !== patch.state) {\n if (patch.state === DataOocStatus.CORRECTED) {\n more.corrector = user\n } else {\n more.corrector = null\n }\n }\n\n return await repository.save({\n ...dataOoc,\n ...patch,\n ...more,\n state,\n history,\n updater: user\n })\n }\n\n // @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n // @Directive('@transaction')\n // @Mutation(returns => [DataOoc], { description: \"To modify multiple DataOoc' information\" })\n // async updateMultipleDataOoc(\n // @Arg('patches', type => [DataOocPatch]) patches: DataOocPatch[],\n // @Ctx() context: ResolverContext\n // ): Promise<DataOoc[]> {\n // const { domain, user, tx } = context.state\n\n // let results = []\n // const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n // const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n // const dataOocRepo = tx.getRepository(DataOoc)\n\n // if (_createRecords.length > 0) {\n // for (let i = 0; i < _createRecords.length; i++) {\n // const newRecord = _createRecords[i]\n\n // const result = await dataOocRepo.save({\n // ...newRecord,\n // domain,\n // creator: user,\n // updater: user\n // })\n\n // results.push({ ...result, cuFlag: '+' })\n // }\n // }\n\n // if (_updateRecords.length > 0) {\n // for (let i = 0; i < _updateRecords.length; i++) {\n // const newRecord = _updateRecords[i]\n // const dataOoc = await dataOocRepo.findOneBy({id: newRecord.id})\n\n // const result = await dataOocRepo.save({\n // ...dataOoc,\n // ...newRecord,\n // updater: user\n // })\n\n // results.push({ ...result, cuFlag: 'M' })\n // }\n // }\n\n // return results\n // }\n\n // @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n // @Directive('@transaction')\n // @Mutation(returns => Boolean, { description: 'To delete DataOoc' })\n // async deleteDataOoc(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n // const { domain, tx } = context.state\n\n // await tx.getRepository(DataOoc).delete({ domain: { id: domain.id }, id })\n // return true\n // }\n\n // @Directive('@privilege(category: \"data-ooc\", privilege: \"mutation\", domainOwnerGranted: true)')\n // @Directive('@transaction')\n // @Mutation(returns => Boolean, { description: 'To delete multiple dataOocs' })\n // async deleteDataOocs(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n // const { domain, tx } = context.state\n\n // await tx.getRepository(DataOoc).delete({\n // domain,\n // id: In(ids)\n // })\n\n // return true\n // }\n}\n"]}
@@ -73,7 +73,9 @@ let DataOocQuery = class DataOocQuery {
73
73
  exports.DataOocQuery = DataOocQuery;
74
74
  tslib_1.__decorate([
75
75
  (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "query", domainOwnerGranted: true)'),
76
- (0, type_graphql_1.Query)(returns => data_ooc_js_1.DataOoc, { description: 'To fetch a DataOoc' }),
76
+ (0, type_graphql_1.Query)(returns => data_ooc_js_1.DataOoc, {
77
+ description: 'Retrieves a single out-of-control (OOC) record by its unique identifier. This query fetches detailed information about an OOC event including its status, corrective actions, review process, and associated data sample.'
78
+ }),
77
79
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
78
80
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
79
81
  tslib_1.__metadata("design:type", Function),
@@ -82,7 +84,9 @@ tslib_1.__decorate([
82
84
  ], DataOocQuery.prototype, "dataOoc", null);
83
85
  tslib_1.__decorate([
84
86
  (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "query", domainOwnerGranted: true)'),
85
- (0, type_graphql_1.Query)(returns => data_ooc_type_js_1.DataOocList, { description: 'To fetch multiple DataOoc' }),
87
+ (0, type_graphql_1.Query)(returns => data_ooc_type_js_1.DataOocList, {
88
+ description: 'Retrieves multiple out-of-control (OOC) records with pagination and filtering support. This query allows searching OOC events by name and description, and is used for monitoring and managing quality control issues across all datasets.'
89
+ }),
86
90
  tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
87
91
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
88
92
  tslib_1.__metadata("design:type", Function),
@@ -90,49 +94,63 @@ tslib_1.__decorate([
90
94
  tslib_1.__metadata("design:returntype", Promise)
91
95
  ], DataOocQuery.prototype, "dataOocs", null);
92
96
  tslib_1.__decorate([
93
- (0, type_graphql_1.FieldResolver)(type => [data_item_type_js_1.DataItem]),
97
+ (0, type_graphql_1.FieldResolver)(type => [data_item_type_js_1.DataItem], {
98
+ description: 'Retrieves the data items (field definitions) associated with this OOC record. These items define the structure and validation rules for the OOC data, including field names, types, and constraints.'
99
+ }),
94
100
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
95
101
  tslib_1.__metadata("design:type", Function),
96
102
  tslib_1.__metadata("design:paramtypes", [data_ooc_js_1.DataOoc]),
97
103
  tslib_1.__metadata("design:returntype", Promise)
98
104
  ], DataOocQuery.prototype, "dataItems", null);
99
105
  tslib_1.__decorate([
100
- (0, type_graphql_1.FieldResolver)(type => data_sample_js_1.DataSample),
106
+ (0, type_graphql_1.FieldResolver)(type => data_sample_js_1.DataSample, {
107
+ description: 'Retrieves the original data sample that triggered this OOC event. This field resolver provides access to the source data that was flagged as out of control or out of specification.'
108
+ }),
101
109
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
102
110
  tslib_1.__metadata("design:type", Function),
103
111
  tslib_1.__metadata("design:paramtypes", [data_ooc_js_1.DataOoc]),
104
112
  tslib_1.__metadata("design:returntype", Promise)
105
113
  ], DataOocQuery.prototype, "dataSample", null);
106
114
  tslib_1.__decorate([
107
- (0, type_graphql_1.FieldResolver)(type => data_set_js_1.DataSet),
115
+ (0, type_graphql_1.FieldResolver)(type => data_set_js_1.DataSet, {
116
+ description: 'Retrieves the dataset that this OOC event belongs to. This field resolver provides access to the dataset configuration and settings associated with the OOC event.'
117
+ }),
108
118
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
109
119
  tslib_1.__metadata("design:type", Function),
110
120
  tslib_1.__metadata("design:paramtypes", [data_ooc_js_1.DataOoc]),
111
121
  tslib_1.__metadata("design:returntype", Promise)
112
122
  ], DataOocQuery.prototype, "dataSet", null);
113
123
  tslib_1.__decorate([
114
- (0, type_graphql_1.FieldResolver)(type => worklist_1.ActivityInstance),
124
+ (0, type_graphql_1.FieldResolver)(type => worklist_1.ActivityInstance, {
125
+ description: 'Retrieves the review activity instance associated with this OOC event. This field resolver provides access to the workflow process for reviewing and approving the OOC event.'
126
+ }),
115
127
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
116
128
  tslib_1.__metadata("design:type", Function),
117
129
  tslib_1.__metadata("design:paramtypes", [data_ooc_js_1.DataOoc]),
118
130
  tslib_1.__metadata("design:returntype", Promise)
119
131
  ], DataOocQuery.prototype, "reviewActivityInstance", null);
120
132
  tslib_1.__decorate([
121
- (0, type_graphql_1.FieldResolver)(type => worklist_1.ActivityInstance),
133
+ (0, type_graphql_1.FieldResolver)(type => worklist_1.ActivityInstance, {
134
+ description: 'Retrieves the resolution activity instance associated with this OOC event. This field resolver provides access to the workflow process for implementing corrective actions and resolving the OOC issue.'
135
+ }),
122
136
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
123
137
  tslib_1.__metadata("design:type", Function),
124
138
  tslib_1.__metadata("design:paramtypes", [data_ooc_js_1.DataOoc]),
125
139
  tslib_1.__metadata("design:returntype", Promise)
126
140
  ], DataOocQuery.prototype, "resolveActivityInstance", null);
127
141
  tslib_1.__decorate([
128
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
142
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, {
143
+ description: 'Retrieves the user who implemented the corrective action for this OOC event. This field resolver identifies the person responsible for resolving the out-of-control situation.'
144
+ }),
129
145
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
130
146
  tslib_1.__metadata("design:type", Function),
131
147
  tslib_1.__metadata("design:paramtypes", [data_ooc_js_1.DataOoc]),
132
148
  tslib_1.__metadata("design:returntype", Promise)
133
149
  ], DataOocQuery.prototype, "corrector", null);
134
150
  tslib_1.__decorate([
135
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
151
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User, {
152
+ description: 'Retrieves the user who reviewed this OOC event. This field resolver identifies the person responsible for reviewing and approving the out-of-control situation.'
153
+ }),
136
154
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
137
155
  tslib_1.__metadata("design:type", Function),
138
156
  tslib_1.__metadata("design:paramtypes", [data_ooc_js_1.DataOoc]),
@@ -1 +1 @@
1
- {"version":3,"file":"data-ooc-query.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAE9F,yDAAgD;AAChD,iDAAuG;AACvG,uDAA2D;AAE3D,iFAAwE;AACxE,qEAAwD;AACxD,yDAAiD;AACjD,kEAA0D;AAC1D,+CAAuC;AACvC,yDAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,qBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,QAAQ,CAA0B,MAAiB,EAAS,OAAwB;QACxF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,UAAU,EAAE,IAAA,qBAAa,EAAC,qBAAO,CAAC;YAClC,MAAM;YACN,MAAM;YACN,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAS,OAAgB;QACtC,MAAM,cAAc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gBAAI,CAAC;IACZ,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;4CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;0CAEpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;2CAErC;uBA1FU,YAAY;IADxB,IAAA,uBAAQ,EAAC,qBAAO,CAAC;GACL,YAAY,CA2FxB","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { ActivityInstance } from '@things-factory/worklist'\n\nimport { DataSetHistory } from '../data-set-history/data-set-history.js'\nimport { DataItem } from '../data-set/data-item-type.js'\nimport { DataSet } from '../data-set/data-set.js'\nimport { DataSample } from '../data-sample/data-sample.js'\nimport { DataOoc } from './data-ooc.js'\nimport { DataOocList } from './data-ooc-type.js'\n\n@Resolver(DataOoc)\nexport class DataOocQuery {\n @Directive('@privilege(category: \"data-ooc\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => DataOoc, { description: 'To fetch a DataOoc' })\n async dataOoc(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<DataOoc> {\n const { domain } = context.state\n\n return await getRepository(DataOoc).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"data-ooc\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => DataOocList, { description: 'To fetch multiple DataOoc' })\n async dataOocs(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<DataOocList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(DataOoc),\n params,\n domain,\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => [DataItem])\n async dataItems(@Root() dataOoc: DataOoc): Promise<DataItem[]> {\n const dataSetHistory: DataSetHistory =\n dataOoc.dataSetId &&\n (await getRepository(DataSetHistory).findOne({\n where: {\n originalId: dataOoc.dataSetId,\n version: dataOoc.dataSetVersion\n }\n }))\n return dataSetHistory?.dataItems.filter(item => item.active) || []\n }\n\n @FieldResolver(type => DataSample)\n async dataSample(@Root() dataOoc: DataOoc): Promise<DataSample> {\n return dataOoc.dataSampleId && (await getRepository(DataSample).findOneBy({ id: dataOoc.dataSampleId }))\n }\n\n @FieldResolver(type => DataSet)\n async dataSet(@Root() dataOoc: DataOoc): Promise<DataSet> {\n return dataOoc.dataSetId && (await getRepository(DataSet).findOneBy({ id: dataOoc.dataSetId }))\n }\n\n @FieldResolver(type => ActivityInstance)\n async reviewActivityInstance(@Root() dataOoc: DataOoc): Promise<ActivityInstance> {\n return (\n dataOoc.reviewActivityInstanceId &&\n (await getRepository(ActivityInstance).findOneBy({ id: dataOoc.reviewActivityInstanceId }))\n )\n }\n\n @FieldResolver(type => ActivityInstance)\n async resolveActivityInstance(@Root() dataOoc: DataOoc): Promise<ActivityInstance> {\n return (\n dataOoc.resolveActivityInstanceId &&\n (await getRepository(ActivityInstance).findOneBy({ id: dataOoc.resolveActivityInstanceId }))\n )\n }\n\n @FieldResolver(type => User)\n async corrector(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.correctorId && (await getRepository(User).findOneBy({ id: dataOoc.correctorId }))\n }\n\n @FieldResolver(type => User)\n async reviewer(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.reviewerId && (await getRepository(User).findOneBy({ id: dataOoc.reviewerId }))\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() dataOoc: DataOoc): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: dataOoc.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.updaterId && (await getRepository(User).findOneBy({ id: dataOoc.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.creatorId && (await getRepository(User).findOneBy({ id: dataOoc.creatorId }))\n }\n}\n"]}
1
+ {"version":3,"file":"data-ooc-query.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAE9F,yDAAgD;AAChD,iDAAuG;AACvG,uDAA2D;AAE3D,iFAAwE;AACxE,qEAAwD;AACxD,yDAAiD;AACjD,kEAA0D;AAC1D,+CAAuC;AACvC,yDAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAMjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,qBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAOK,AAAN,KAAK,CAAC,QAAQ,CAA0B,MAAiB,EAAS,OAAwB;QACxF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,UAAU,EAAE,IAAA,qBAAa,EAAC,qBAAO,CAAC;YAClC,MAAM;YACN,MAAM;YACN,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa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;IAC4B,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;0DAKpD;AAMK;IAJL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,2BAAgB,EAAE;QACvC,WAAW,EACT,yMAAyM;KAC5M,CAAC;IAC6B,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;2DAKrD;AAMK;IAJL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QAC3B,WAAW,EACT,gLAAgL;KACnL,CAAC;IACe,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;6CAEvC;AAMK;IAJL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QAC3B,WAAW,EACT,iKAAiK;KACpK,CAAC;IACc,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;4CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;0CAEpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,qBAAO;;2CAErC;uBArHU,YAAY;IADxB,IAAA,uBAAQ,EAAC,qBAAO,CAAC;GACL,YAAY,CAsHxB","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { ActivityInstance } from '@things-factory/worklist'\n\nimport { DataSetHistory } from '../data-set-history/data-set-history.js'\nimport { DataItem } from '../data-set/data-item-type.js'\nimport { DataSet } from '../data-set/data-set.js'\nimport { DataSample } from '../data-sample/data-sample.js'\nimport { DataOoc } from './data-ooc.js'\nimport { DataOocList } from './data-ooc-type.js'\n\n@Resolver(DataOoc)\nexport class DataOocQuery {\n @Directive('@privilege(category: \"data-ooc\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => DataOoc, {\n description:\n 'Retrieves a single out-of-control (OOC) record by its unique identifier. This query fetches detailed information about an OOC event including its status, corrective actions, review process, and associated data sample.'\n })\n async dataOoc(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<DataOoc> {\n const { domain } = context.state\n\n return await getRepository(DataOoc).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"data-ooc\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => DataOocList, {\n description:\n 'Retrieves multiple out-of-control (OOC) records with pagination and filtering support. This query allows searching OOC events by name and description, and is used for monitoring and managing quality control issues across all datasets.'\n })\n async dataOocs(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<DataOocList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(DataOoc),\n params,\n domain,\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => [DataItem], {\n description:\n 'Retrieves the data items (field definitions) associated with this OOC record. These items define the structure and validation rules for the OOC data, including field names, types, and constraints.'\n })\n async dataItems(@Root() dataOoc: DataOoc): Promise<DataItem[]> {\n const dataSetHistory: DataSetHistory =\n dataOoc.dataSetId &&\n (await getRepository(DataSetHistory).findOne({\n where: {\n originalId: dataOoc.dataSetId,\n version: dataOoc.dataSetVersion\n }\n }))\n return dataSetHistory?.dataItems.filter(item => item.active) || []\n }\n\n @FieldResolver(type => DataSample, {\n description:\n 'Retrieves the original data sample that triggered this OOC event. This field resolver provides access to the source data that was flagged as out of control or out of specification.'\n })\n async dataSample(@Root() dataOoc: DataOoc): Promise<DataSample> {\n return dataOoc.dataSampleId && (await getRepository(DataSample).findOneBy({ id: dataOoc.dataSampleId }))\n }\n\n @FieldResolver(type => DataSet, {\n description:\n 'Retrieves the dataset that this OOC event belongs to. This field resolver provides access to the dataset configuration and settings associated with the OOC event.'\n })\n async dataSet(@Root() dataOoc: DataOoc): Promise<DataSet> {\n return dataOoc.dataSetId && (await getRepository(DataSet).findOneBy({ id: dataOoc.dataSetId }))\n }\n\n @FieldResolver(type => ActivityInstance, {\n description:\n 'Retrieves the review activity instance associated with this OOC event. This field resolver provides access to the workflow process for reviewing and approving the OOC event.'\n })\n async reviewActivityInstance(@Root() dataOoc: DataOoc): Promise<ActivityInstance> {\n return (\n dataOoc.reviewActivityInstanceId &&\n (await getRepository(ActivityInstance).findOneBy({ id: dataOoc.reviewActivityInstanceId }))\n )\n }\n\n @FieldResolver(type => ActivityInstance, {\n description:\n 'Retrieves the resolution activity instance associated with this OOC event. This field resolver provides access to the workflow process for implementing corrective actions and resolving the OOC issue.'\n })\n async resolveActivityInstance(@Root() dataOoc: DataOoc): Promise<ActivityInstance> {\n return (\n dataOoc.resolveActivityInstanceId &&\n (await getRepository(ActivityInstance).findOneBy({ id: dataOoc.resolveActivityInstanceId }))\n )\n }\n\n @FieldResolver(type => User, {\n description:\n 'Retrieves the user who implemented the corrective action for this OOC event. This field resolver identifies the person responsible for resolving the out-of-control situation.'\n })\n async corrector(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.correctorId && (await getRepository(User).findOneBy({ id: dataOoc.correctorId }))\n }\n\n @FieldResolver(type => User, {\n description:\n 'Retrieves the user who reviewed this OOC event. This field resolver identifies the person responsible for reviewing and approving the out-of-control situation.'\n })\n async reviewer(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.reviewerId && (await getRepository(User).findOneBy({ id: dataOoc.reviewerId }))\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() dataOoc: DataOoc): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: dataOoc.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.updaterId && (await getRepository(User).findOneBy({ id: dataOoc.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() dataOoc: DataOoc): Promise<User> {\n return dataOoc.creatorId && (await getRepository(User).findOneBy({ id: dataOoc.creatorId }))\n }\n}\n"]}
@@ -1,5 +1,10 @@
1
1
  import { DataOoc } from './data-ooc.js';
2
2
  export declare class DataOocSubscription {
3
+ /**
4
+ * Real-time subscription for out-of-control (OOC) events.
5
+ * This subscription allows users with supervisory roles to receive immediate notifications
6
+ * when new OOC events are created or updated in their domain.
7
+ */
3
8
  dataOoc(payload: {
4
9
  dataOoc: DataOoc;
5
10
  supervisoryRoleId: string;
@@ -8,29 +8,43 @@ const auth_base_1 = require("@things-factory/auth-base");
8
8
  const shell_1 = require("@things-factory/shell");
9
9
  const data_ooc_js_1 = require("./data-ooc.js");
10
10
  let DataOocSubscription = class DataOocSubscription {
11
+ /**
12
+ * Real-time subscription for out-of-control (OOC) events.
13
+ * This subscription allows users with supervisory roles to receive immediate notifications
14
+ * when new OOC events are created or updated in their domain.
15
+ */
11
16
  dataOoc(payload) {
17
+ /**
18
+ * Returns the OOC event data from the subscription payload.
19
+ * This resolver extracts the DataOoc object from the subscription payload
20
+ * and provides it to the client for real-time updates.
21
+ */
12
22
  return payload.dataOoc;
13
23
  }
14
24
  };
15
25
  exports.DataOocSubscription = DataOocSubscription;
16
26
  tslib_1.__decorate([
17
27
  (0, type_graphql_1.Subscription)({
28
+ description: 'Real-time subscription for out-of-control (OOC) events. Users with supervisory roles receive immediate notifications when OOC events occur in their domain.',
18
29
  subscribe: ({ args, context, info }) => {
19
30
  const { domain, user } = context.state;
20
31
  const subdomain = domain?.subdomain;
32
+ // Validate domain access
21
33
  if (!domain) {
22
34
  throw new Error('domain required');
23
35
  }
36
+ // Check user domain access permissions
24
37
  if (!user.domains?.find(d => d.subdomain === subdomain) && !process.superUserGranted(domain, user)) {
25
38
  throw new Error(`domain(${subdomain}) is not working for user(${user.email}).`);
26
39
  }
27
40
  return (0, graphql_yoga_1.pipe)(shell_1.pubsub.subscribe('data-ooc'), (0, graphql_yoga_1.filter)(async (payload) => {
28
41
  const { dataOoc, supervisoryRoleId } = payload;
29
42
  const { domain } = dataOoc;
43
+ // Filter by domain to ensure users only receive events from their domain
30
44
  if (subdomain !== domain?.subdomain) {
31
45
  return false;
32
46
  }
33
- // check if the user has that role
47
+ // Check if the user has the supervisory role required for this OOC event
34
48
  const userWithRoles = await (0, shell_1.getRepository)(auth_base_1.User).findOne({
35
49
  where: { id: user.id },
36
50
  relations: ['roles']
@@ -1 +1 @@
1
- {"version":3,"file":"data-ooc-subscription.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-subscription.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAA2D;AAE3D,yDAAgD;AAChD,iDAA6D;AAE7D,+CAAuC;AAGhC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAmC9B,OAAO,CAAS,OAAwD;QACtE,OAAO,OAAO,CAAC,OAAO,CAAA;IACxB,CAAC;CACF,CAAA;AAtCY,kDAAmB;AAmC9B;IAlCC,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,SAAS,GAAG,MAAM,EAAE,SAAS,CAAA;YAEnC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;YACpC,CAAC;YAED,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,cAAM,CAAC,SAAS,CAAC,UAAU,CAAC,EAC5B,IAAA,qBAAM,EAAC,KAAK,EAAE,OAAwD,EAAE,EAAE;gBACxE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAA;gBAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;gBAE1B,IAAI,SAAS,KAAK,MAAM,EAAE,SAAS,EAAE,CAAC;oBACpC,OAAO,KAAK,CAAA;gBACd,CAAC;gBAED,kCAAkC;gBAClC,MAAM,aAAa,GAAS,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC;oBAC5D,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;oBACtB,SAAS,EAAE,CAAC,OAAO,CAAC;iBACrB,CAAC,CAAA;gBAEF,OAAO,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,iBAAiB,CAAC,CAAA;YAC1E,CAAC,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAC;IACO,mBAAA,IAAA,mBAAI,GAAE,CAAA;;;4CAA4D,qBAAO;kDAEjF;8BArCU,mBAAmB;IAD/B,IAAA,uBAAQ,EAAC,qBAAO,CAAC;GACL,mBAAmB,CAsC/B","sourcesContent":["import { filter, pipe } from 'graphql-yoga'\nimport { Resolver, Root, Subscription } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { getRepository, pubsub } from '@things-factory/shell'\n\nimport { DataOoc } from './data-ooc.js'\n\n@Resolver(DataOoc)\nexport class DataOocSubscription {\n @Subscription({\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const subdomain = domain?.subdomain\n\n if (!domain) {\n throw new Error('domain required')\n }\n\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-ooc'),\n filter(async (payload: { dataOoc: DataOoc; supervisoryRoleId: string }) => {\n const { dataOoc, supervisoryRoleId } = payload\n const { domain } = dataOoc\n\n if (subdomain !== domain?.subdomain) {\n return false\n }\n\n // check if the user has that role\n const userWithRoles: User = await getRepository(User).findOne({\n where: { id: user.id },\n relations: ['roles']\n })\n\n return !!userWithRoles.roles.find(role => role.id === supervisoryRoleId)\n })\n )\n }\n })\n dataOoc(@Root() payload: { dataOoc: DataOoc; supervisoryRoleId: string }): DataOoc {\n return payload.dataOoc\n }\n}\n"]}
1
+ {"version":3,"file":"data-ooc-subscription.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-subscription.ts"],"names":[],"mappings":";;;;AAAA,+CAA2C;AAC3C,+CAA2D;AAE3D,yDAAgD;AAChD,iDAA6D;AAE7D,+CAAuC;AAGhC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B;;;;OAIG;IAwCH,OAAO,CAAS,OAAwD;QACtE;;;;WAIG;QACH,OAAO,OAAO,CAAC,OAAO,CAAA;IACxB,CAAC;CACF,CAAA;AArDY,kDAAmB;AA6C9B;IAvCC,IAAA,2BAAY,EAAC;QACZ,WAAW,EACT,6JAA6J;QAC/J,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,SAAS,GAAG,MAAM,EAAE,SAAS,CAAA;YAEnC,yBAAyB;YACzB,IAAI,CAAC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AC,qBAAO,CAAC;GACL,mBAAmB,CAqD/B","sourcesContent":["import { filter, pipe } from 'graphql-yoga'\nimport { Resolver, Root, Subscription } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { getRepository, pubsub } from '@things-factory/shell'\n\nimport { DataOoc } from './data-ooc.js'\n\n@Resolver(DataOoc)\nexport class DataOocSubscription {\n /**\n * Real-time subscription for out-of-control (OOC) events.\n * This subscription allows users with supervisory roles to receive immediate notifications\n * when new OOC events are created or updated in their domain.\n */\n @Subscription({\n description:\n 'Real-time subscription for out-of-control (OOC) events. Users with supervisory roles receive immediate notifications when OOC events occur in their domain.',\n subscribe: ({ args, context, info }) => {\n const { domain, user } = context.state\n const subdomain = domain?.subdomain\n\n // Validate domain access\n if (!domain) {\n throw new Error('domain required')\n }\n\n // Check user domain access permissions\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-ooc'),\n filter(async (payload: { dataOoc: DataOoc; supervisoryRoleId: string }) => {\n const { dataOoc, supervisoryRoleId } = payload\n const { domain } = dataOoc\n\n // Filter by domain to ensure users only receive events from their domain\n if (subdomain !== domain?.subdomain) {\n return false\n }\n\n // Check if the user has the supervisory role required for this OOC event\n const userWithRoles: User = await getRepository(User).findOne({\n where: { id: user.id },\n relations: ['roles']\n })\n\n return !!userWithRoles.roles.find(role => role.id === supervisoryRoleId)\n })\n )\n }\n })\n dataOoc(@Root() payload: { dataOoc: DataOoc; supervisoryRoleId: string }): DataOoc {\n /**\n * Returns the OOC event data from the subscription payload.\n * This resolver extracts the DataOoc object from the subscription payload\n * and provides it to the client for real-time updates.\n */\n return payload.dataOoc\n }\n}\n"]}