@things-factory/integration-base 9.0.0-beta.80 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/service/analysis/analysis-query.d.ts +3 -0
- package/dist-server/service/analysis/analysis-query.js +6 -1
- package/dist-server/service/analysis/analysis-query.js.map +1 -1
- package/dist-server/service/connection/connection-mutation.js +10 -8
- package/dist-server/service/connection/connection-mutation.js.map +1 -1
- package/dist-server/service/connection/connection-query.d.ts +3 -0
- package/dist-server/service/connection/connection-query.js +10 -3
- package/dist-server/service/connection/connection-query.js.map +1 -1
- package/dist-server/service/connection/connection-subscription.js +5 -1
- package/dist-server/service/connection/connection-subscription.js.map +1 -1
- package/dist-server/service/connection/connection-type.d.ts +1 -1
- package/dist-server/service/connection/connection-type.js +52 -46
- package/dist-server/service/connection/connection-type.js.map +1 -1
- package/dist-server/service/connector/connector-query.d.ts +4 -1
- package/dist-server/service/connector/connector-query.js +8 -5
- package/dist-server/service/connector/connector-query.js.map +1 -1
- package/dist-server/service/connector/connector-type.js +12 -9
- package/dist-server/service/connector/connector-type.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-mutation.js +5 -5
- package/dist-server/service/payload-log/payload-log-mutation.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-query.d.ts +3 -0
- package/dist-server/service/payload-log/payload-log-query.js +5 -2
- package/dist-server/service/payload-log/payload-log-query.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-type.js +11 -11
- package/dist-server/service/payload-log/payload-log-type.js.map +1 -1
- package/dist-server/service/payload-log/payload-log.d.ts +1 -1
- package/dist-server/service/payload-log/payload-log.js +18 -14
- package/dist-server/service/payload-log/payload-log.js.map +1 -1
- package/dist-server/service/property-spec.js +12 -7
- package/dist-server/service/property-spec.js.map +1 -1
- package/dist-server/service/scenario/scenario-mutation.js +15 -14
- package/dist-server/service/scenario/scenario-mutation.js.map +1 -1
- package/dist-server/service/scenario/scenario-query.d.ts +3 -0
- package/dist-server/service/scenario/scenario-query.js +5 -2
- package/dist-server/service/scenario/scenario-query.js.map +1 -1
- package/dist-server/service/scenario/scenario-type.js +27 -24
- package/dist-server/service/scenario/scenario-type.js.map +1 -1
- package/dist-server/service/scenario/scenario.js +22 -19
- package/dist-server/service/scenario/scenario.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js +8 -3
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-query.d.ts +3 -0
- package/dist-server/service/scenario-instance/scenario-instance-query.js +5 -2
- package/dist-server/service/scenario-instance/scenario-instance-query.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-subscription.js +4 -1
- package/dist-server/service/scenario-instance/scenario-instance-subscription.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-type.js +50 -41
- package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
- package/dist-server/service/scenario-queue/scenario-queue-subscription.js +1 -0
- package/dist-server/service/scenario-queue/scenario-queue-subscription.js.map +1 -1
- package/dist-server/service/scenario-queue/scenario-queue-type.js +8 -8
- package/dist-server/service/scenario-queue/scenario-queue-type.js.map +1 -1
- package/dist-server/service/state-register/state-register-mutation.js +9 -7
- package/dist-server/service/state-register/state-register-mutation.js.map +1 -1
- package/dist-server/service/state-register/state-register-query.d.ts +3 -0
- package/dist-server/service/state-register/state-register-query.js +6 -3
- package/dist-server/service/state-register/state-register-query.js.map +1 -1
- package/dist-server/service/state-register/state-register-type.js +3 -3
- package/dist-server/service/state-register/state-register-type.js.map +1 -1
- package/dist-server/service/state-register/state-register.js +4 -2
- package/dist-server/service/state-register/state-register.js.map +1 -1
- package/dist-server/service/step/step-mutation.js +4 -2
- package/dist-server/service/step/step-mutation.js.map +1 -1
- package/dist-server/service/step/step-query.d.ts +3 -0
- package/dist-server/service/step/step-query.js +5 -2
- package/dist-server/service/step/step-query.js.map +1 -1
- package/dist-server/service/step/step-type.js +32 -32
- package/dist-server/service/step/step-type.js.map +1 -1
- package/dist-server/service/task-type/task-type-query.js +5 -3
- package/dist-server/service/task-type/task-type-query.js.map +1 -1
- package/dist-server/service/task-type/task-type-type.js +12 -9
- package/dist-server/service/task-type/task-type-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
@@ -2,6 +2,9 @@ import { Domain, ListParam } from '@things-factory/shell';
|
|
2
2
|
import { User } from '@things-factory/auth-base';
|
3
3
|
import { StateRegister } from './state-register';
|
4
4
|
import { StateRegisterList } from './state-register-type';
|
5
|
+
/**
|
6
|
+
* @description Provides GraphQL resolvers for the StateRegister entity.
|
7
|
+
*/
|
5
8
|
export declare class StateRegisterQuery {
|
6
9
|
stateRegister(id: string, context: ResolverContext): Promise<StateRegister>;
|
7
10
|
stateRegisterByName(name: string, context: ResolverContext): Promise<StateRegister>;
|
@@ -7,6 +7,9 @@ const shell_1 = require("@things-factory/shell");
|
|
7
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
8
8
|
const state_register_1 = require("./state-register");
|
9
9
|
const state_register_type_1 = require("./state-register-type");
|
10
|
+
/**
|
11
|
+
* @description Provides GraphQL resolvers for the StateRegister entity.
|
12
|
+
*/
|
10
13
|
let StateRegisterQuery = class StateRegisterQuery {
|
11
14
|
async stateRegister(id, context) {
|
12
15
|
const { domain } = context.state;
|
@@ -57,7 +60,7 @@ let StateRegisterQuery = class StateRegisterQuery {
|
|
57
60
|
exports.StateRegisterQuery = StateRegisterQuery;
|
58
61
|
tslib_1.__decorate([
|
59
62
|
(0, type_graphql_1.Directive)('@privilege(category: "state-register", privilege: "query", domainOwnerGranted: true)'),
|
60
|
-
(0, type_graphql_1.Query)(returns => state_register_1.StateRegister, { nullable: true, description: '
|
63
|
+
(0, type_graphql_1.Query)(returns => state_register_1.StateRegister, { nullable: true, description: 'Fetches a single state register by its ID.' }),
|
61
64
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
62
65
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
63
66
|
tslib_1.__metadata("design:type", Function),
|
@@ -66,7 +69,7 @@ tslib_1.__decorate([
|
|
66
69
|
], StateRegisterQuery.prototype, "stateRegister", null);
|
67
70
|
tslib_1.__decorate([
|
68
71
|
(0, type_graphql_1.Directive)('@privilege(category: "state-register", privilege: "query", domainOwnerGranted: true)'),
|
69
|
-
(0, type_graphql_1.Query)(returns => state_register_1.StateRegister, { nullable: true, description: '
|
72
|
+
(0, type_graphql_1.Query)(returns => state_register_1.StateRegister, { nullable: true, description: 'Fetches a single state register by its name.' }),
|
70
73
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
71
74
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
72
75
|
tslib_1.__metadata("design:type", Function),
|
@@ -75,7 +78,7 @@ tslib_1.__decorate([
|
|
75
78
|
], StateRegisterQuery.prototype, "stateRegisterByName", null);
|
76
79
|
tslib_1.__decorate([
|
77
80
|
(0, type_graphql_1.Directive)('@privilege(category: "state-register", privilege: "query", domainOwnerGranted: true)'),
|
78
|
-
(0, type_graphql_1.Query)(returns => state_register_type_1.StateRegisterList, { description: '
|
81
|
+
(0, type_graphql_1.Query)(returns => state_register_type_1.StateRegisterList, { description: 'Fetches a paginated list of state registers.' }),
|
79
82
|
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
80
83
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
81
84
|
tslib_1.__metadata("design:type", Function),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-register-query.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAqH;AACrH,yDAAgD;AAChD,qDAAgD;AAChD,+DAAyD;
|
1
|
+
{"version":3,"file":"state-register-query.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;A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BAAa;;gDAEhD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACd,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,8BAAa;;gDAEhD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,8BAAa;;iDAEjD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,8BAAa;;iDAEjD;6BAvEU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,kBAAkB,CAwE9B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam, ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { StateRegister } from './state-register'\nimport { StateRegisterList } from './state-register-type'\n\n/**\n * @description Provides GraphQL resolvers for the StateRegister entity.\n */\n@Resolver(StateRegister)\nexport class StateRegisterQuery {\n @Directive('@privilege(category: \"state-register\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => StateRegister!, { nullable: true, description: 'Fetches a single state register by its ID.' })\n async stateRegister(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<StateRegister> {\n const { domain } = context.state\n\n return await getRepository(StateRegister).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"state-register\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => StateRegister!, { nullable: true, description: 'Fetches a single state register by its name.' })\n async stateRegisterByName(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<StateRegister> {\n const { domain } = context.state\n\n return await getRepository(StateRegister).findOne({\n where: { domain: { id: domain.id }, name }\n })\n }\n\n @Directive('@privilege(category: \"state-register\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => StateRegisterList, { description: 'Fetches a paginated list of state registers.' })\n async stateRegisters(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<StateRegisterList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(StateRegister),\n searchables: ['name', 'description', 'group']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => ScalarObject)\n async state(@Root() stateRegister: StateRegister): Promise<any> {\n const { state, wroteAt, ttl } = stateRegister\n\n if (!isNaN(ttl) && Number(ttl) > 0) {\n const expired = (wroteAt?.getTime() || 0) + Number(ttl) * 1000 < Date.now()\n return expired ? null : state\n } else {\n return state\n }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() stateRegister: StateRegister): Promise<Domain> {\n return stateRegister.domainId && (await getRepository(Domain).findOneBy({ id: stateRegister.domainId }))\n }\n\n @FieldResolver(type => User)\n async writer(@Root() stateRegister: StateRegister): Promise<User> {\n return stateRegister.writerId && (await getRepository(User).findOneBy({ id: stateRegister.writerId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() stateRegister: StateRegister): Promise<User> {\n return stateRegister.updaterId && (await getRepository(User).findOneBy({ id: stateRegister.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() stateRegister: StateRegister): Promise<User> {\n return stateRegister.creatorId && (await getRepository(User).findOneBy({ id: stateRegister.creatorId }))\n }\n}\n"]}
|
@@ -45,7 +45,7 @@ tslib_1.__decorate([
|
|
45
45
|
tslib_1.__metadata("design:type", String)
|
46
46
|
], NewStateRegister.prototype, "refBy", void 0);
|
47
47
|
exports.NewStateRegister = NewStateRegister = tslib_1.__decorate([
|
48
|
-
(0, type_graphql_1.InputType)()
|
48
|
+
(0, type_graphql_1.InputType)({ description: 'Input for creating a new state register.' })
|
49
49
|
], NewStateRegister);
|
50
50
|
let StateRegisterPatch = class StateRegisterPatch {
|
51
51
|
};
|
@@ -95,7 +95,7 @@ tslib_1.__decorate([
|
|
95
95
|
tslib_1.__metadata("design:type", String)
|
96
96
|
], StateRegisterPatch.prototype, "cuFlag", void 0);
|
97
97
|
exports.StateRegisterPatch = StateRegisterPatch = tslib_1.__decorate([
|
98
|
-
(0, type_graphql_1.InputType)()
|
98
|
+
(0, type_graphql_1.InputType)({ description: 'Input for updating (patching) an existing state register.' })
|
99
99
|
], StateRegisterPatch);
|
100
100
|
let StateRegisterList = class StateRegisterList {
|
101
101
|
};
|
@@ -109,6 +109,6 @@ tslib_1.__decorate([
|
|
109
109
|
tslib_1.__metadata("design:type", Number)
|
110
110
|
], StateRegisterList.prototype, "total", void 0);
|
111
111
|
exports.StateRegisterList = StateRegisterList = tslib_1.__decorate([
|
112
|
-
(0, type_graphql_1.ObjectType)()
|
112
|
+
(0, type_graphql_1.ObjectType)({ description: 'A paginated list of state registers.' })
|
113
113
|
], StateRegisterList);
|
114
114
|
//# sourceMappingURL=state-register-type.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-register-type.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iDAAoD;AAEpD,qDAAgD;AAGzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CA2B5B,CAAA;AA3BY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;8CACzC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;qDACxD;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;+CAC9D;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;8CAC/C;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;;+CACnF;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;8CACrD;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;+CACzE;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;;6CACvF;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yEAAyE,EAAE,CAAC;;+CACpG;2BA1BH,gBAAgB;IAD5B,IAAA,wBAAS,
|
1
|
+
{"version":3,"file":"state-register-type.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iDAAoD;AAEpD,qDAAgD;AAGzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CA2B5B,CAAA;AA3BY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;8CACzC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;qDACxD;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;+CAC9D;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE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,iBAAiB;IAD7B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;GACvD,iBAAiB,CAM7B","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\n\nimport { StateRegister } from './state-register'\n\n@InputType({ description: 'Input for creating a new state register.' })\nexport class NewStateRegister {\n @Field({ description: 'Name of the state register' })\n name: string\n\n @Field({ nullable: true, description: 'Description of the state register' })\n description?: string\n\n @Field({ nullable: true, description: 'Group name for the state register' })\n group?: string\n\n @Field({ nullable: true, description: 'Type of the state' })\n type?: string\n\n @Field({ nullable: true, description: 'Number of decimal places if the state is a number type' })\n place?: string\n\n @Field({ nullable: true, description: 'Unit of the state value' })\n unit?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'Current state value' })\n state?: any\n\n @Field(type => Int, { nullable: true, description: 'Time to live for the state value in seconds' })\n ttl?: number\n\n @Field({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' })\n refBy?: string\n}\n\n@InputType({ description: 'Input for updating (patching) an existing state register.' })\nexport class StateRegisterPatch {\n @Field(type => ID, { nullable: true, description: 'ID of the state register' })\n id?: string\n\n @Field({ nullable: true, description: 'Name of the state register' })\n name?: string\n\n @Field({ nullable: true, description: 'Description of the state register' })\n description?: string\n\n @Field({ nullable: true, description: 'Group name for the state register' })\n group?: string\n\n @Field({ nullable: true, description: 'Type of the state' })\n type?: string\n\n @Field({ nullable: true, description: 'Number of decimal places if the state is a number type' })\n place?: string\n\n @Field({ nullable: true, description: 'Unit of the state value' })\n unit?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'Current state value' })\n state?: any\n\n @Field(type => Int, { nullable: true, description: 'Time to live for the state value in seconds' })\n ttl?: number\n\n @Field({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' })\n refBy?: string\n\n @Field({ nullable: true, description: 'Flag indicating create/update operations' })\n cuFlag?: string\n}\n\n@ObjectType({ description: 'A paginated list of state registers.' })\nexport class StateRegisterList {\n @Field(type => [StateRegister], { description: 'List of state registers' })\n items: StateRegister[]\n\n @Field(type => Int, { description: 'Total number of state registers' })\n total: number\n}\n"]}
|
@@ -11,7 +11,7 @@ let StateRegister = class StateRegister {
|
|
11
11
|
exports.StateRegister = StateRegister;
|
12
12
|
tslib_1.__decorate([
|
13
13
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
14
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
14
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier for the state register.' }),
|
15
15
|
tslib_1.__metadata("design:type", String)
|
16
16
|
], StateRegister.prototype, "id", void 0);
|
17
17
|
tslib_1.__decorate([
|
@@ -123,6 +123,8 @@ exports.StateRegister = StateRegister = tslib_1.__decorate([
|
|
123
123
|
unique: true,
|
124
124
|
where: '"group" IS NOT NULL'
|
125
125
|
}),
|
126
|
-
(0, type_graphql_1.ObjectType)({
|
126
|
+
(0, type_graphql_1.ObjectType)({
|
127
|
+
description: 'Represents a key-value store for maintaining the state of various entities within a domain.'
|
128
|
+
})
|
127
129
|
], StateRegister);
|
128
130
|
//# sourceMappingURL=state-register.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-register.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAyD;AAEzD,iDAA4D;AAC5D,yDAAgD;
|
1
|
+
{"version":3,"file":"state-register.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAyD;AAEzD,iDAA4D;AAC5D,yDAAgD;AAiBzC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAoFzB,CAAA;AApFY,sCAAa;AAGf;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBA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,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;;gDAC3E;wBAnFP,aAAa;IAfzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE;QAC1G,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,eAAK,EACJ,qBAAqB,EACrB,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,EACjG;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,qBAAqB;KAC7B,CACF;IACA,IAAA,yBAAU,EAAC;QACV,WAAW,EAAE,6FAA6F;KAC3G,CAAC;GACW,aAAa,CAoFzB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { Domain, ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_state_register_0', (stateRegister: StateRegister) => [stateRegister.domain, stateRegister.name], {\n unique: true\n})\n@Index(\n 'ix_state_register_1',\n (stateRegister: StateRegister) => [stateRegister.domain, stateRegister.group, stateRegister.name],\n {\n unique: true,\n where: '\"group\" IS NOT NULL'\n }\n)\n@ObjectType({\n description: 'Represents a key-value store for maintaining the state of various entities within a domain.'\n})\nexport class StateRegister {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the state register.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { description: 'Associated domain for the state register' })\n domain?: Domain\n\n @RelationId((stateRegister: StateRegister) => stateRegister.domain)\n @Field({ description: 'ID of the associated domain' })\n domainId?: string\n\n @Column()\n @Field({ nullable: true, description: 'Name of the state register' })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Description of the state register' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Group name for the state register' })\n group?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Type of the state' })\n type?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Number of decimal places if the state is a number type' })\n place?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Unit of the state value' })\n unit?: string\n\n @Column('simple-json', { nullable: true, default: null })\n @Field(type => ScalarObject, { nullable: true, description: 'Current state value' })\n state?: any\n\n @Column({ nullable: true, default: null })\n @Field(type => Int, { nullable: true, description: 'Time to live for the state value in seconds' })\n ttl?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' })\n refBy?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Time when the state was recorded' })\n wroteAt?: Date\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Creation time of the state register' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Last update time of the state register' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who wrote the state' })\n writer?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.writer)\n @Field({ nullable: true, description: 'ID of the user who wrote the state' })\n writerId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the state register' })\n creator?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.creator)\n @Field({ nullable: true, description: 'ID of the user who created the state register' })\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated the state register' })\n updater?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated the state register' })\n updaterId?: string\n}\n"]}
|
@@ -38,7 +38,9 @@ let StepMutation = class StepMutation {
|
|
38
38
|
exports.StepMutation = StepMutation;
|
39
39
|
tslib_1.__decorate([
|
40
40
|
(0, type_graphql_1.Directive)('@transaction'),
|
41
|
-
(0, type_graphql_1.Mutation)(returns => [step_type_1.Step], {
|
41
|
+
(0, type_graphql_1.Mutation)(returns => [step_type_1.Step], {
|
42
|
+
description: 'Updates multiple steps within a specific scenario. This operation replaces all existing steps for the scenario.'
|
43
|
+
}),
|
42
44
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('scenarioId')),
|
43
45
|
tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [step_type_1.StepPatch])),
|
44
46
|
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
@@ -48,7 +50,7 @@ tslib_1.__decorate([
|
|
48
50
|
], StepMutation.prototype, "updateMultipleStep", null);
|
49
51
|
tslib_1.__decorate([
|
50
52
|
(0, type_graphql_1.Directive)('@transaction'),
|
51
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: '
|
53
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'Deletes multiple scenario steps by their IDs.' }),
|
52
54
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
53
55
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
54
56
|
tslib_1.__metadata("design:type", Function),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"step-mutation.js","sourceRoot":"","sources":["../../../server/service/step/step-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA+C;AAC/C,2CAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAY;
|
1
|
+
{"version":3,"file":"step-mutation.js","sourceRoot":"","sources":["../../../server/service/step/step-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA+C;AAC/C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AC,CAAC,MAAM,CAAC;YAClC,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE;YACzB,EAAE,EAAE,IAAA,YAAE,EAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SAC5B,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AA/CY,oCAAY;AAMjB;IALL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,gBAAI,CAAC,EAAE;QAC3B,WAAW,EACT,iHAAiH;KACpH,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,YAAY,CAAC,CAAA;IACjB,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAS,CAAC,CAAC,CAAA;IACnC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDAwBP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;IAC5E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CASpE;uBA9CU,YAAY;IADxB,IAAA,uBAAQ,EAAC,gBAAI,CAAC;GACF,YAAY,CA+CxB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Scenario } from '../scenario/scenario'\nimport { Step, StepPatch } from './step-type'\n\n@Resolver(Step)\nexport class StepMutation {\n @Directive('@transaction')\n @Mutation(returns => [Step], {\n description:\n 'Updates multiple steps within a specific scenario. This operation replaces all existing steps for the scenario.'\n })\n async updateMultipleStep(\n @Arg('scenarioId') scenarioId: string,\n @Arg('patches', type => [StepPatch]) patches: StepPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Step[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const stepRepo = tx.getRepository(Step)\n const scenario = await tx.getRepository(Scenario).findOneBy({ id: scenarioId })\n\n await stepRepo.delete({ domain: { id: domain.id }, scenario: { id: scenarioId } })\n\n for (let i = 0; i < patches.length; i++) {\n const result = await stepRepo.save({\n ...patches[i],\n sequence: i,\n scenario,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'Deletes multiple scenario steps by their IDs.' })\n async deleteSteps(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Step).delete({\n domain: { id: domain.id },\n id: In(ids.filter(Boolean))\n })\n\n return true\n }\n}\n"]}
|
@@ -2,6 +2,9 @@ import { User } from '@things-factory/auth-base';
|
|
2
2
|
import { Domain, ListParam } from '@things-factory/shell';
|
3
3
|
import { Scenario } from '../scenario/scenario';
|
4
4
|
import { Step, StepList } from './step-type';
|
5
|
+
/**
|
6
|
+
* @description Provides GraphQL resolvers for scenario steps.
|
7
|
+
*/
|
5
8
|
export declare class StepQuery {
|
6
9
|
step(name: string, context: ResolverContext): Promise<Step>;
|
7
10
|
steps(params: ListParam, context: ResolverContext): Promise<StepList>;
|
@@ -7,6 +7,9 @@ const auth_base_1 = require("@things-factory/auth-base");
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
8
8
|
const scenario_1 = require("../scenario/scenario");
|
9
9
|
const step_type_1 = require("./step-type");
|
10
|
+
/**
|
11
|
+
* @description Provides GraphQL resolvers for scenario steps.
|
12
|
+
*/
|
10
13
|
let StepQuery = class StepQuery {
|
11
14
|
async step(name, context) {
|
12
15
|
const { domain } = context.state;
|
@@ -40,7 +43,7 @@ let StepQuery = class StepQuery {
|
|
40
43
|
};
|
41
44
|
exports.StepQuery = StepQuery;
|
42
45
|
tslib_1.__decorate([
|
43
|
-
(0, type_graphql_1.Query)(returns => step_type_1.Step, { description: '
|
46
|
+
(0, type_graphql_1.Query)(returns => step_type_1.Step, { description: 'Fetches a single scenario step by its name.' }),
|
44
47
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
45
48
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
46
49
|
tslib_1.__metadata("design:type", Function),
|
@@ -48,7 +51,7 @@ tslib_1.__decorate([
|
|
48
51
|
tslib_1.__metadata("design:returntype", Promise)
|
49
52
|
], StepQuery.prototype, "step", null);
|
50
53
|
tslib_1.__decorate([
|
51
|
-
(0, type_graphql_1.Query)(returns => step_type_1.StepList, { description: '
|
54
|
+
(0, type_graphql_1.Query)(returns => step_type_1.StepList, { description: 'Fetches a paginated list of scenario steps.' }),
|
52
55
|
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
53
56
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
54
57
|
tslib_1.__metadata("design:type", Function),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"step-query.js","sourceRoot":"","sources":["../../../server/service/step/step-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,mDAA+C;AAC/C,2CAA4C;
|
1
|
+
{"version":3,"file":"step-query.js","sourceRoot":"","sources":["../../../server/service/step/step-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,mDAA+C;AAC/C,2CAA4C;AAE5C;;GAEG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAS;IAEd,AAAN,KAAK,CAAC,IAAI,CAAc,IAAY,EAAS,OAAwB;QACnE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBA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-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Scenario } from '../scenario/scenario'\nimport { Step, StepList } from './step-type'\n\n/**\n * @description Provides GraphQL resolvers for scenario steps.\n */\n@Resolver(Step)\nexport class StepQuery {\n @Query(returns => Step, { description: 'Fetches a single scenario step by its name.' })\n async step(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<Step> {\n const { domain } = context.state\n\n return await getRepository(Step).findOne({\n where: { domain: { id: domain.id }, name }\n })\n }\n\n @Query(returns => StepList, { description: 'Fetches a paginated list of scenario steps.' })\n async steps(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<StepList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(Step),\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 => Scenario)\n async scenario(@Root() step: Step) {\n return await getRepository(Scenario).findOneBy({ id: step.scenarioId })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() step: Step) {\n return await getRepository(Domain).findOneBy({ id: step.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() step: Step): Promise<User> {\n return await getRepository(User).findOneBy({ id: step.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() step: Step): Promise<User> {\n return await getRepository(User).findOneBy({ id: step.creatorId })\n }\n}\n"]}
|
@@ -21,12 +21,12 @@ let Step = class Step {
|
|
21
21
|
exports.Step = Step;
|
22
22
|
tslib_1.__decorate([
|
23
23
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
24
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
24
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'The unique identifier for the step.' }),
|
25
25
|
tslib_1.__metadata("design:type", String)
|
26
26
|
], Step.prototype, "id", void 0);
|
27
27
|
tslib_1.__decorate([
|
28
28
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
29
|
-
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
29
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain to which this step belongs.' }),
|
30
30
|
tslib_1.__metadata("design:type", shell_1.Domain
|
31
31
|
/**
|
32
32
|
* The ID of the domain associated with this step.
|
@@ -39,17 +39,17 @@ tslib_1.__decorate([
|
|
39
39
|
], Step.prototype, "domainId", void 0);
|
40
40
|
tslib_1.__decorate([
|
41
41
|
(0, typeorm_1.Column)({ nullable: true }),
|
42
|
-
(0, type_graphql_1.Field)(),
|
42
|
+
(0, type_graphql_1.Field)({ description: 'The name of the step.' }),
|
43
43
|
tslib_1.__metadata("design:type", String)
|
44
44
|
], Step.prototype, "name", void 0);
|
45
45
|
tslib_1.__decorate([
|
46
46
|
(0, typeorm_1.Column)({ nullable: true }),
|
47
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
47
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description of what the step involves.' }),
|
48
48
|
tslib_1.__metadata("design:type", String)
|
49
49
|
], Step.prototype, "description", void 0);
|
50
50
|
tslib_1.__decorate([
|
51
51
|
(0, typeorm_1.ManyToOne)(type => scenario_1.Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' }),
|
52
|
-
(0, type_graphql_1.Field)(type => scenario_1.Scenario, { nullable: true }),
|
52
|
+
(0, type_graphql_1.Field)(type => scenario_1.Scenario, { nullable: true, description: 'The scenario that includes this step.' }),
|
53
53
|
tslib_1.__metadata("design:type", scenario_1.Scenario
|
54
54
|
/**
|
55
55
|
* The ID of the scenario associated with this step.
|
@@ -62,27 +62,27 @@ tslib_1.__decorate([
|
|
62
62
|
], Step.prototype, "scenarioId", void 0);
|
63
63
|
tslib_1.__decorate([
|
64
64
|
(0, typeorm_1.Column)(),
|
65
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The sequence number of the step within its scenario.' }),
|
66
66
|
tslib_1.__metadata("design:type", Number)
|
67
67
|
], Step.prototype, "sequence", void 0);
|
68
68
|
tslib_1.__decorate([
|
69
69
|
(0, typeorm_1.Column)(),
|
70
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
70
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The specific task type associated with this step.' }),
|
71
71
|
tslib_1.__metadata("design:type", String)
|
72
72
|
], Step.prototype, "task", void 0);
|
73
73
|
tslib_1.__decorate([
|
74
74
|
(0, typeorm_1.Column)({ nullable: true }),
|
75
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the step should be skipped during execution.' }),
|
76
76
|
tslib_1.__metadata("design:type", Boolean)
|
77
77
|
], Step.prototype, "skip", void 0);
|
78
78
|
tslib_1.__decorate([
|
79
79
|
(0, typeorm_1.Column)({ nullable: true }),
|
80
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
80
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the step execution should be logged.' }),
|
81
81
|
tslib_1.__metadata("design:type", Boolean)
|
82
82
|
], Step.prototype, "log", void 0);
|
83
83
|
tslib_1.__decorate([
|
84
84
|
(0, typeorm_1.Column)({ nullable: true }),
|
85
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
85
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The name of the connection to be used for this step.' }),
|
86
86
|
tslib_1.__metadata("design:type", String)
|
87
87
|
], Step.prototype, "connection", void 0);
|
88
88
|
tslib_1.__decorate([
|
@@ -103,20 +103,20 @@ tslib_1.__decorate([
|
|
103
103
|
}
|
104
104
|
: undefined
|
105
105
|
}),
|
106
|
-
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
106
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'A key-value map of parameters for the step task.' }),
|
107
107
|
tslib_1.__metadata("design:type", Object)
|
108
108
|
], Step.prototype, "params", void 0);
|
109
109
|
tslib_1.__decorate([
|
110
110
|
(0, typeorm_1.Column)({ nullable: true, default: true }),
|
111
111
|
(0, type_graphql_1.Field)({
|
112
112
|
nullable: true,
|
113
|
-
description: 'A boolean attribute indicating the
|
113
|
+
description: 'A boolean attribute indicating whether the result of this step should be included in the final output.'
|
114
114
|
}),
|
115
115
|
tslib_1.__metadata("design:type", Boolean)
|
116
116
|
], Step.prototype, "result", void 0);
|
117
117
|
tslib_1.__decorate([
|
118
118
|
(0, typeorm_1.CreateDateColumn)(),
|
119
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
119
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the step was created.' }),
|
120
120
|
tslib_1.__metadata("design:type", Date
|
121
121
|
/**
|
122
122
|
* The timestamp when
|
@@ -126,7 +126,7 @@ tslib_1.__decorate([
|
|
126
126
|
], Step.prototype, "createdAt", void 0);
|
127
127
|
tslib_1.__decorate([
|
128
128
|
(0, typeorm_1.UpdateDateColumn)(),
|
129
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
129
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the step was last updated.' }),
|
130
130
|
tslib_1.__metadata("design:type", Date
|
131
131
|
/**
|
132
132
|
* The user who created this step.
|
@@ -135,7 +135,7 @@ tslib_1.__decorate([
|
|
135
135
|
], Step.prototype, "updatedAt", void 0);
|
136
136
|
tslib_1.__decorate([
|
137
137
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
138
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
138
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created this step.' }),
|
139
139
|
tslib_1.__metadata("design:type", auth_base_1.User
|
140
140
|
/**
|
141
141
|
* The ID of the user who created this step.
|
@@ -148,7 +148,7 @@ tslib_1.__decorate([
|
|
148
148
|
], Step.prototype, "creatorId", void 0);
|
149
149
|
tslib_1.__decorate([
|
150
150
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
151
|
-
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
151
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated this step.' }),
|
152
152
|
tslib_1.__metadata("design:type", auth_base_1.User
|
153
153
|
/**
|
154
154
|
* The ID of the user who last updated this step.
|
@@ -162,70 +162,70 @@ tslib_1.__decorate([
|
|
162
162
|
exports.Step = Step = tslib_1.__decorate([
|
163
163
|
(0, typeorm_1.Entity)(),
|
164
164
|
(0, typeorm_1.Index)('ix_step_0', (step) => [step.scenario, step.sequence], { unique: true }),
|
165
|
-
(0, type_graphql_1.ObjectType)()
|
165
|
+
(0, type_graphql_1.ObjectType)({ description: 'Represents a single step within a scenario, defining a specific task to be executed.' })
|
166
166
|
], Step);
|
167
167
|
let StepPatch = class StepPatch {
|
168
168
|
};
|
169
169
|
exports.StepPatch = StepPatch;
|
170
170
|
tslib_1.__decorate([
|
171
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
171
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'The unique identifier of the step to update.' }),
|
172
172
|
tslib_1.__metadata("design:type", String)
|
173
173
|
], StepPatch.prototype, "id", void 0);
|
174
174
|
tslib_1.__decorate([
|
175
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
175
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new name for the step.' }),
|
176
176
|
tslib_1.__metadata("design:type", String)
|
177
177
|
], StepPatch.prototype, "name", void 0);
|
178
178
|
tslib_1.__decorate([
|
179
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
179
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new description for the step.' }),
|
180
180
|
tslib_1.__metadata("design:type", String)
|
181
181
|
], StepPatch.prototype, "description", void 0);
|
182
182
|
tslib_1.__decorate([
|
183
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
183
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The new sequence number for the step.' }),
|
184
184
|
tslib_1.__metadata("design:type", Number)
|
185
185
|
], StepPatch.prototype, "sequence", void 0);
|
186
186
|
tslib_1.__decorate([
|
187
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
187
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new task type for the step.' }),
|
188
188
|
tslib_1.__metadata("design:type", String)
|
189
189
|
], StepPatch.prototype, "task", void 0);
|
190
190
|
tslib_1.__decorate([
|
191
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
191
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new skip status for the step.' }),
|
192
192
|
tslib_1.__metadata("design:type", Boolean)
|
193
193
|
], StepPatch.prototype, "skip", void 0);
|
194
194
|
tslib_1.__decorate([
|
195
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
195
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new log status for the step.' }),
|
196
196
|
tslib_1.__metadata("design:type", Boolean)
|
197
197
|
], StepPatch.prototype, "log", void 0);
|
198
198
|
tslib_1.__decorate([
|
199
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
199
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new connection for the step.' }),
|
200
200
|
tslib_1.__metadata("design:type", String)
|
201
201
|
], StepPatch.prototype, "connection", void 0);
|
202
202
|
tslib_1.__decorate([
|
203
|
-
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
203
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'The new parameters for the step.' }),
|
204
204
|
tslib_1.__metadata("design:type", Object)
|
205
205
|
], StepPatch.prototype, "params", void 0);
|
206
206
|
tslib_1.__decorate([
|
207
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
207
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The new result inclusion status for the step.' }),
|
208
208
|
tslib_1.__metadata("design:type", Boolean)
|
209
209
|
], StepPatch.prototype, "result", void 0);
|
210
210
|
tslib_1.__decorate([
|
211
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
211
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'A flag indicating whether the step is being created, updated, or deleted.' }),
|
212
212
|
tslib_1.__metadata("design:type", String)
|
213
213
|
], StepPatch.prototype, "cuFlag", void 0);
|
214
214
|
exports.StepPatch = StepPatch = tslib_1.__decorate([
|
215
|
-
(0, type_graphql_1.InputType)()
|
215
|
+
(0, type_graphql_1.InputType)({ description: 'Input for updating (patching) an existing step.' })
|
216
216
|
], StepPatch);
|
217
217
|
let StepList = class StepList {
|
218
218
|
};
|
219
219
|
exports.StepList = StepList;
|
220
220
|
tslib_1.__decorate([
|
221
|
-
(0, type_graphql_1.Field)(type => [Step]),
|
221
|
+
(0, type_graphql_1.Field)(type => [Step], { description: 'The list of step items.' }),
|
222
222
|
tslib_1.__metadata("design:type", Array)
|
223
223
|
], StepList.prototype, "items", void 0);
|
224
224
|
tslib_1.__decorate([
|
225
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
225
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The total number of steps.' }),
|
226
226
|
tslib_1.__metadata("design:type", Number)
|
227
227
|
], StepList.prototype, "total", void 0);
|
228
228
|
exports.StepList = StepList = tslib_1.__decorate([
|
229
|
-
(0, type_graphql_1.ObjectType)()
|
229
|
+
(0, type_graphql_1.ObjectType)({ description: 'A paginated list of steps.' })
|
230
230
|
], StepList);
|
231
231
|
//# sourceMappingURL=step-type.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"step-type.js","sourceRoot":"","sources":["../../../server/service/step/step-type.ts"],"names":[],"mappings":";;;;AAAA,+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AAE,IAAI,EAAE,CAAC;;yCACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACX;oBAhCJ,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CAiCrB;AAUM,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAMpB,CAAA;AANY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;;uCACT;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;uCACN;mBALF,QAAQ;IADpB,IAAA,yBAAU,GAAE;GACA,QAAQ,CAMpB","sourcesContent":["import { Field, ID, InputType, Int, 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, ScalarObject } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\n\nimport { Scenario } from '../scenario/scenario'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index('ix_step_0', (step: Step) => [step.scenario, step.sequence], { unique: true })\n@ObjectType()\nexport class Step {\n /**\n * The unique identifier for each step.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id?: string\n\n /**\n * The domain to which this step belongs.\n */\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n /**\n * The ID of the domain associated with this step.\n */\n @RelationId((step: Step) => step.domain)\n domainId?: string\n\n /**\n * The name of the step.\n */\n @Column({ nullable: true })\n @Field()\n name?: string\n\n /**\n * A description of what the step involves.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n /**\n * The scenario that includes this step.\n */\n @ManyToOne(type => Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' })\n @Field(type => Scenario, { nullable: true })\n scenario?: Scenario\n\n /**\n * The ID of the scenario associated with this step.\n */\n @RelationId((step: Step) => step.scenario)\n scenarioId?: string\n\n /**\n * The sequence number of the step within its scenario.\n */\n @Column()\n @Field({ nullable: true })\n sequence?: number\n\n /**\n * The specific task associated with this step.\n */\n @Column()\n @Field({ nullable: true })\n task?: string\n\n /**\n * Boolean value to indicate if the step should be skipped.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n skip?: boolean\n\n /**\n * Boolean value to indicate if the step should be logged.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n log?: boolean\n\n /**\n * The connection details associated with this step.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n connection?: string\n\n /**\n * The parameters for the step.\n *\n * [Caution]\n * 이 컬럼타입은 postgres 데이터베이스에서는 varchar 타입을 유지한다.\n * 이는 데이터베이스 타입을 변경하면 기존 데이터가 손실될 수 있기 때문이다.\n * 'simple-json' 타입으로 변경 전에 postgres 데이타베이스에 이미 varchar 타입으로 사용한 사례가 많기 때문이다.\n */\n @Column({\n type: DATABASE_TYPE == 'postgres' ? 'varchar' : 'simple-json',\n nullable: true,\n transformer:\n DATABASE_TYPE == 'postgres'\n ? {\n to: (value: any) => JSON.stringify(value),\n from: (value: string) => {\n try {\n return JSON.parse(value)\n } catch (error) {\n return null\n }\n }\n }\n : undefined\n })\n @Field(type => ScalarObject, { nullable: true })\n params?: { [key: string]: any }\n\n /**\n * A boolean attribute indicating the inclusion status of an element in the result.\n */\n @Column({ nullable: true, default: true })\n @Field({\n nullable: true,\n description: 'A boolean attribute indicating the inclusion status of an element in the result'\n })\n result?: boolean = true\n\n /**\n * The timestamp when the step was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n /** \n * The timestamp when\n the step was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n /**\n * The user who created this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n /**\n * The ID of the user who created this step.\n */\n @RelationId((step: Step) => step.creator)\n creatorId?: string\n\n /**\n * The user who last updated this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n /**\n * The ID of the user who last updated this step.\n */\n @RelationId((step: Step) => step.updater)\n updaterId?: string\n}\n\n@InputType()\nexport class StepPatch {\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(type => Int, { nullable: true })\n sequence?: number\n\n @Field({ nullable: true })\n task?: string\n\n @Field({ nullable: true })\n skip?: boolean\n\n @Field({ nullable: true })\n log?: boolean\n\n @Field({ nullable: true })\n connection?: string\n\n @Field(type => ScalarObject, { nullable: true })\n params?: { [key: string]: any }\n\n @Field({ nullable: true })\n result?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n/**\n * Step의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n *\n */\nexport interface InputStep extends Step {}\n\n@ObjectType()\nexport class StepList {\n @Field(type => [Step])\n items: Step[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
1
|
+
{"version":3,"file":"step-type.js","sourceRoot":"","sources":["../../../server/service/step/step-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,qCASgB;AAEhB,yDAAgD;AAChD,iDAA4D;AAC5D,6CAA4C;AAE5C,mDAA+C;AAE/C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAK7B,IAAM,IAAI,GAAV,MAAM,IAAI;IAAV;QA+GL;;WAEG;QAOH,WAAM,GAAa,IAAI,CAAA;IA0CzB,CAAC;CAAA,CAAA;AAlKY,oBAAI;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C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;sCAC9D;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;6CACxD;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;yCAClE;AAG/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;;yCACxE;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,2EAA2E,EAAE,CAAC;;yCACrG;oBAhCJ,SAAS;IADrB,IAAA,wBAAS,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;GACjE,SAAS,CAiCrB;AAUM,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAMpB,CAAA;AANY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;uCACrD;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;uCACrD;mBALF,QAAQ;IADpB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,QAAQ,CAMpB","sourcesContent":["import { Field, ID, InputType, Int, 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, ScalarObject } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\n\nimport { Scenario } from '../scenario/scenario'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index('ix_step_0', (step: Step) => [step.scenario, step.sequence], { unique: true })\n@ObjectType({ description: 'Represents a single step within a scenario, defining a specific task to be executed.' })\nexport class Step {\n /**\n * The unique identifier for each step.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'The unique identifier for the step.' })\n readonly id?: string\n\n /**\n * The domain to which this step belongs.\n */\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain to which this step belongs.' })\n domain?: Domain\n\n /**\n * The ID of the domain associated with this step.\n */\n @RelationId((step: Step) => step.domain)\n domainId?: string\n\n /**\n * The name of the step.\n */\n @Column({ nullable: true })\n @Field({ description: 'The name of the step.' })\n name?: string\n\n /**\n * A description of what the step involves.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'A detailed description of what the step involves.' })\n description?: string\n\n /**\n * The scenario that includes this step.\n */\n @ManyToOne(type => Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' })\n @Field(type => Scenario, { nullable: true, description: 'The scenario that includes this step.' })\n scenario?: Scenario\n\n /**\n * The ID of the scenario associated with this step.\n */\n @RelationId((step: Step) => step.scenario)\n scenarioId?: string\n\n /**\n * The sequence number of the step within its scenario.\n */\n @Column()\n @Field({ nullable: true, description: 'The sequence number of the step within its scenario.' })\n sequence?: number\n\n /**\n * The specific task associated with this step.\n */\n @Column()\n @Field({ nullable: true, description: 'The specific task type associated with this step.' })\n task?: string\n\n /**\n * Boolean value to indicate if the step should be skipped.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates if the step should be skipped during execution.' })\n skip?: boolean\n\n /**\n * Boolean value to indicate if the step should be logged.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates if the step execution should be logged.' })\n log?: boolean\n\n /**\n * The connection details associated with this step.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The name of the connection to be used for this step.' })\n connection?: string\n\n /**\n * The parameters for the step.\n *\n * [Caution]\n * 이 컬럼타입은 postgres 데이터베이스에서는 varchar 타입을 유지한다.\n * 이는 데이터베이스 타입을 변경하면 기존 데이터가 손실될 수 있기 때문이다.\n * 'simple-json' 타입으로 변경 전에 postgres 데이타베이스에 이미 varchar 타입으로 사용한 사례가 많기 때문이다.\n */\n @Column({\n type: DATABASE_TYPE == 'postgres' ? 'varchar' : 'simple-json',\n nullable: true,\n transformer:\n DATABASE_TYPE == 'postgres'\n ? {\n to: (value: any) => JSON.stringify(value),\n from: (value: string) => {\n try {\n return JSON.parse(value)\n } catch (error) {\n return null\n }\n }\n }\n : undefined\n })\n @Field(type => ScalarObject, { nullable: true, description: 'A key-value map of parameters for the step task.' })\n params?: { [key: string]: any }\n\n /**\n * A boolean attribute indicating the inclusion status of an element in the result.\n */\n @Column({ nullable: true, default: true })\n @Field({\n nullable: true,\n description:\n 'A boolean attribute indicating whether the result of this step should be included in the final output.'\n })\n result?: boolean = true\n\n /**\n * The timestamp when the step was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the step was created.' })\n createdAt?: Date\n\n /** \n * The timestamp when\n the step was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the step was last updated.' })\n updatedAt?: Date\n\n /**\n * The user who created this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created this step.' })\n creator?: User\n\n /**\n * The ID of the user who created this step.\n */\n @RelationId((step: Step) => step.creator)\n creatorId?: string\n\n /**\n * The user who last updated this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated this step.' })\n updater?: User\n\n /**\n * The ID of the user who last updated this step.\n */\n @RelationId((step: Step) => step.updater)\n updaterId?: string\n}\n\n@InputType({ description: 'Input for updating (patching) an existing step.' })\nexport class StepPatch {\n @Field(type => ID, { nullable: true, description: 'The unique identifier of the step to update.' })\n id: string\n\n @Field({ nullable: true, description: 'The new name for the step.' })\n name: string\n\n @Field({ nullable: true, description: 'The new description for the step.' })\n description?: string\n\n @Field(type => Int, { nullable: true, description: 'The new sequence number for the step.' })\n sequence?: number\n\n @Field({ nullable: true, description: 'The new task type for the step.' })\n task?: string\n\n @Field({ nullable: true, description: 'The new skip status for the step.' })\n skip?: boolean\n\n @Field({ nullable: true, description: 'The new log status for the step.' })\n log?: boolean\n\n @Field({ nullable: true, description: 'The new connection for the step.' })\n connection?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'The new parameters for the step.' })\n params?: { [key: string]: any }\n\n @Field({ nullable: true, description: 'The new result inclusion status for the step.' })\n result?: boolean\n\n @Field({ nullable: true, description: 'A flag indicating whether the step is being created, updated, or deleted.' })\n cuFlag?: string\n}\n\n/**\n * Step의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n *\n */\nexport interface InputStep extends Step {}\n\n@ObjectType({ description: 'A paginated list of steps.' })\nexport class StepList {\n @Field(type => [Step], { description: 'The list of step items.' })\n items: Step[]\n\n @Field(type => Int, { description: 'The total number of steps.' })\n total: number\n}\n"]}
|
@@ -80,7 +80,7 @@ let TaskTypeQuery = class TaskTypeQuery {
|
|
80
80
|
};
|
81
81
|
exports.TaskTypeQuery = TaskTypeQuery;
|
82
82
|
tslib_1.__decorate([
|
83
|
-
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskType, { description: '
|
83
|
+
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskType, { description: 'Fetches a single task type by its name.' }),
|
84
84
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
85
85
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
86
86
|
tslib_1.__metadata("design:type", Function),
|
@@ -88,14 +88,16 @@ tslib_1.__decorate([
|
|
88
88
|
tslib_1.__metadata("design:returntype", task_type_type_1.TaskType)
|
89
89
|
], TaskTypeQuery.prototype, "taskType", null);
|
90
90
|
tslib_1.__decorate([
|
91
|
-
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, { description: '
|
91
|
+
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, { description: 'Fetches a list of all available task types.' }),
|
92
92
|
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
93
93
|
tslib_1.__metadata("design:type", Function),
|
94
94
|
tslib_1.__metadata("design:paramtypes", [Object]),
|
95
95
|
tslib_1.__metadata("design:returntype", task_type_type_1.TaskTypeList)
|
96
96
|
], TaskTypeQuery.prototype, "taskTypes", null);
|
97
97
|
tslib_1.__decorate([
|
98
|
-
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, {
|
98
|
+
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, {
|
99
|
+
description: 'Fetches a list of task types that are compatible with a specific connection.'
|
100
|
+
}),
|
99
101
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('connectionName')),
|
100
102
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
101
103
|
tslib_1.__metadata("design:type", Function),
|