@things-factory/shell 6.0.113 → 6.0.115
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/common-types/list-param.d.ts +6 -0
- package/dist-server/service/common-types/list-param.js +14 -1
- package/dist-server/service/common-types/list-param.js.map +1 -1
- package/dist-server/service/domain/domain.d.ts +1 -0
- package/dist-server/service/domain/domain.js +5 -0
- package/dist-server/service/domain/domain.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/utils/get-query-builder-from-list-params.js +16 -1
- package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
- package/dist-server/utils/list-query-builder.d.ts +2 -1
- package/dist-server/utils/list-query-builder.js +17 -2
- package/dist-server/utils/list-query-builder.js.map +1 -1
- package/package.json +2 -2
- package/server/service/common-types/list-param.ts +14 -1
- package/server/service/domain/domain.ts +5 -1
- package/server/utils/get-query-builder-from-list-params.ts +13 -2
- package/server/utils/list-query-builder.ts +17 -4
@@ -1,3 +1,8 @@
|
|
1
|
+
export declare enum InheritedValueType {
|
2
|
+
None = "None",
|
3
|
+
Only = "Only",
|
4
|
+
Include = "Include"
|
5
|
+
}
|
1
6
|
export declare class Sorting {
|
2
7
|
name: string;
|
3
8
|
desc?: boolean;
|
@@ -16,4 +21,5 @@ export declare class ListParam {
|
|
16
21
|
filters?: Filter[];
|
17
22
|
pagination?: Pagination;
|
18
23
|
sortings?: Sorting[];
|
24
|
+
inherited?: InheritedValueType;
|
19
25
|
}
|
@@ -1,9 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.ListParam = exports.Filter = exports.Pagination = exports.Sorting = void 0;
|
3
|
+
exports.ListParam = exports.Filter = exports.Pagination = exports.Sorting = exports.InheritedValueType = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
6
|
const scalar_any_1 = require("./scalar-any");
|
7
|
+
var InheritedValueType;
|
8
|
+
(function (InheritedValueType) {
|
9
|
+
InheritedValueType["None"] = "None";
|
10
|
+
InheritedValueType["Only"] = "Only";
|
11
|
+
InheritedValueType["Include"] = "Include";
|
12
|
+
})(InheritedValueType = exports.InheritedValueType || (exports.InheritedValueType = {}));
|
13
|
+
(0, type_graphql_1.registerEnumType)(InheritedValueType, {
|
14
|
+
name: 'InheritedValueType'
|
15
|
+
});
|
7
16
|
let Sorting = class Sorting {
|
8
17
|
};
|
9
18
|
tslib_1.__decorate([
|
@@ -68,6 +77,10 @@ tslib_1.__decorate([
|
|
68
77
|
(0, type_graphql_1.Field)(type => [Sorting], { nullable: true }),
|
69
78
|
tslib_1.__metadata("design:type", Array)
|
70
79
|
], ListParam.prototype, "sortings", void 0);
|
80
|
+
tslib_1.__decorate([
|
81
|
+
(0, type_graphql_1.Field)(type => InheritedValueType, { nullable: true }),
|
82
|
+
tslib_1.__metadata("design:type", String)
|
83
|
+
], ListParam.prototype, "inherited", void 0);
|
71
84
|
ListParam = tslib_1.__decorate([
|
72
85
|
(0, type_graphql_1.ArgsType)()
|
73
86
|
], ListParam);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+
|
1
|
+
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,6CAAwC;AAExC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,yCAAmB,CAAA;AACrB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAED,IAAA,+BAAgB,EAAC,kBAAkB,EAAE;IACnC,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAA;AAGK,IAAM,O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,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,UAAU;6CAAA;AAEvB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACzB;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACxB;AAXnB,SAAS;IADrB,IAAA,uBAAQ,GAAE;GACE,SAAS,CAYrB;AAZY,8BAAS","sourcesContent":["import { ArgsType, Field, InputType, Int, registerEnumType } from 'type-graphql'\n\nimport { ScalarAny } from './scalar-any'\n\nexport enum InheritedValueType {\n None = 'None',\n Only = 'Only',\n Include = 'Include'\n}\n\nregisterEnumType(InheritedValueType, {\n name: 'InheritedValueType'\n})\n\n@InputType()\nexport class Sorting {\n @Field({ description: 'Field name to sort by' })\n name: string\n\n @Field({ nullable: true, description: 'Set to true if descending sort. Default is \"false\"' })\n desc?: boolean\n}\n\n@InputType()\nexport class Pagination {\n @Field(type => Int, { nullable: true })\n page?: number\n\n @Field(type => Int, { nullable: true })\n limit?: number\n}\n\n@InputType()\nexport class Filter {\n @Field()\n name: string\n\n @Field()\n operator: string\n\n @Field(type => ScalarAny, { nullable: true })\n value?: any\n\n @Field({ nullable: true })\n relation?: boolean\n}\n\n@ArgsType()\nexport class ListParam {\n @Field(type => [Filter], { nullable: true })\n filters?: Filter[]\n\n @Field(type => Pagination, { nullable: true })\n pagination?: Pagination\n\n @Field(type => [Sorting], { nullable: true })\n sortings?: Sorting[]\n\n @Field(type => InheritedValueType, { nullable: true })\n inherited?: InheritedValueType\n}\n"]}
|
@@ -87,6 +87,11 @@ tslib_1.__decorate([
|
|
87
87
|
(0, typeorm_1.RelationId)((domain) => domain.parent),
|
88
88
|
tslib_1.__metadata("design:type", String)
|
89
89
|
], Domain.prototype, "parentId", void 0);
|
90
|
+
tslib_1.__decorate([
|
91
|
+
(0, typeorm_1.OneToMany)(type => Domain_1, domain => domain.parent),
|
92
|
+
(0, type_graphql_1.Field)(type => Domain_1, { nullable: true }),
|
93
|
+
tslib_1.__metadata("design:type", Array)
|
94
|
+
], Domain.prototype, "children", void 0);
|
90
95
|
tslib_1.__decorate([
|
91
96
|
(0, type_graphql_1.Field)({ nullable: true }),
|
92
97
|
(0, typeorm_1.Column)({ nullable: true }),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../server/service/domain/domain.ts"],"names":[],"mappings":";;;;;AAAA,
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../server/service/domain/domain.ts"],"names":[],"mappings":";;;;;AAAA,qCAAqH;AACrH,+CAA+D;AAC/D,6CAA4C;AAC5C,kDAA8C;AAE9C,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAA;AAC7G,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;AACpE,MAAM,mBAAmB,GAAG,YAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AAC7D,MAAM,iBAAiB,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,IAAI,CAAA;AACnD,MAAM,qBAAqB,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,QAAQ,CAAA;AAKpD,IAAM,MAAM,cAAZ,MAAM,MAAM;CAqGlB,CAAA;AApGC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;IACjB,IAAA,gBAAM,EACL,mBAAmB;QACjB,CAAC,CAAC;YACE,IAAI,EAAE,iBAAiB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AE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCACd;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCACd;AAEb;IAAC,IAAA,gBAAM,EAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,2BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAChC;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,0BAAgB,GAAE;sCACR,IAAI;yCAAA;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,IAAA,0BAAgB,GAAE;sCACR,IAAI;yCAAA;AApGJ,MAAM;IAHlB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,aAAa,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9E,IAAA,yBAAU,GAAE;GACA,MAAM,CAqGlB;AArGY,wBAAM","sourcesContent":["import { Column, CreateDateColumn, ManyToOne, OneToMany, RelationId, Entity, Index, UpdateDateColumn } from 'typeorm'\nimport { ObjectType, Directive, Field, ID } from 'type-graphql'\nimport { config } from '@things-factory/env'\nimport { ScalarObject } from '../common-types'\n\nconst numericTypes = ['int', 'int2', 'int4', 'int8', 'integer', 'tinyint', 'smallint', 'mediumint', 'bigint']\nconst generatedStrategy = ['uuid', 'rowid', 'increment', 'identity']\nconst domainPrimaryOption = config.get('domainPrimaryOption')\nconst domainPrimaryType = domainPrimaryOption?.type\nconst domainPrimaryStrategy = domainPrimaryOption?.strategy\n\n@Entity()\n@Index('ix_domain_0', (domain: Domain) => [domain.subdomain], { unique: true })\n@ObjectType()\nexport class Domain {\n @Field(type => ID)\n @Column(\n domainPrimaryOption\n ? {\n type: domainPrimaryType,\n primary: true,\n transformer: {\n //from(value: DatabaseType): EntityType\n from: value => {\n return value\n },\n //to(value: EntityType): DatabaseType\n to: value => {\n if (!value) {\n value = 0\n }\n if (numericTypes.indexOf(domainPrimaryType) >= 0) {\n return parseInt(value)\n } else {\n return value\n }\n }\n },\n generated: generatedStrategy.indexOf(domainPrimaryStrategy) >= 0 ? domainPrimaryStrategy : false\n }\n : {\n type: 'uuid',\n primary: true,\n generated: 'uuid'\n }\n )\n readonly id: string\n\n @Field()\n @Column({ unique: true })\n name: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n description: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n extType: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n timezone: string\n\n @Directive('@deprecated(reason: \"Use `parent`\")')\n @Field({ nullable: true })\n @Column({ default: false })\n systemFlag: boolean\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n subdomain: string\n\n @Field({ nullable: true })\n @ManyToOne(type => Domain, { nullable: true })\n parent: Domain\n\n @RelationId((domain: Domain) => domain.parent)\n parentId?: string\n\n @OneToMany(type => Domain, domain => domain.parent)\n @Field(type => Domain, { nullable: true })\n children: Domain[]\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n brandName: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n brandImage: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n contentImage: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n owner: string\n\n @Field({ nullable: true })\n @Column({ nullable: true })\n theme: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @Field({ nullable: true })\n @CreateDateColumn()\n createdAt: Date\n\n @Field({ nullable: true })\n @UpdateDateColumn()\n updatedAt: Date\n}\n"]}
|
@@ -8,7 +8,7 @@ export declare const schema: {
|
|
8
8
|
typeDefs: {
|
9
9
|
transactionDirectiveTypeDefs: import("graphql").DocumentNode;
|
10
10
|
};
|
11
|
-
resolverClasses: (typeof import("./
|
11
|
+
resolverClasses: (typeof import("./domain/domain-resolver").DomainResolver | typeof import("./attribute-set/attribute-set-query").AttributeSetQuery | typeof import("./attribute-set/attribute-set-mutation").AttributeSetMutation | typeof import("./subscription-data/data-resolver").DataResolver)[];
|
12
12
|
directives: {
|
13
13
|
transaction: (schema: import("graphql").GraphQLSchema) => import("graphql").GraphQLSchema;
|
14
14
|
};
|