@things-factory/attachment-base 5.0.0-alpha.51 → 5.0.0-alpha.52
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.
|
@@ -20,8 +20,9 @@ const shell_1 = require("@things-factory/shell");
|
|
|
20
20
|
const __1 = require("../");
|
|
21
21
|
const attachment_1 = require("./attachment");
|
|
22
22
|
let AttachmentQuery = class AttachmentQuery {
|
|
23
|
-
async attachments(context,
|
|
24
|
-
const
|
|
23
|
+
async attachments(context, params) {
|
|
24
|
+
const { domain } = context.state;
|
|
25
|
+
const convertedParams = (0, shell_1.convertListParams)(params, { domain, searchables: ['name', 'description'] });
|
|
25
26
|
const [items, total] = await (0, typeorm_1.getRepository)(attachment_1.Attachment).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'creator', 'updater'] }));
|
|
26
27
|
return { items, total };
|
|
27
28
|
}
|
|
@@ -35,11 +36,9 @@ let AttachmentQuery = class AttachmentQuery {
|
|
|
35
36
|
__decorate([
|
|
36
37
|
(0, type_graphql_1.Query)(returns => __1.AttachmentList),
|
|
37
38
|
__param(0, (0, type_graphql_1.Ctx)()),
|
|
38
|
-
__param(1, (0, type_graphql_1.
|
|
39
|
-
__param(2, (0, type_graphql_1.Arg)('pagination', type => shell_1.Pagination, { nullable: true })),
|
|
40
|
-
__param(3, (0, type_graphql_1.Arg)('sortings', type => [shell_1.Sorting], { nullable: true })),
|
|
39
|
+
__param(1, (0, type_graphql_1.Args)()),
|
|
41
40
|
__metadata("design:type", Function),
|
|
42
|
-
__metadata("design:paramtypes", [Object,
|
|
41
|
+
__metadata("design:paramtypes", [Object, typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object]),
|
|
43
42
|
__metadata("design:returntype", Promise)
|
|
44
43
|
], AttachmentQuery.prototype, "attachments", null);
|
|
45
44
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-query.js","sourceRoot":"","sources":["../../../server/service/attachment/attachment-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"attachment-query.js","sourceRoot":"","sources":["../../../server/service/attachment/attachment-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8D;AAC9D,qCAAuC;AAEvC,iDAAoE;AAEpE,2BAAoC;AACpC,6CAAyC;AAGzC,IAAa,eAAe,GAA5B,MAAa,eAAe;IAE1B,KAAK,CAAC,WAAW,CAAQ,OAAY,EAAU,MAAiB;QAC9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC,CAAA;QACnG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,uBAAU,CAAC,CAAC,YAAY,iCAC9D,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,IAC3C,CAAA;QAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAY;QACzD,OAAO,MAAM,IAAA,uBAAa,EAAC,uBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;YAC3C,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAnBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,kBAAc,CAAC;IACd,WAAA,IAAA,kBAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,mBAAI,GAAE,CAAA;;iEAAS,iBAAS,oBAAT,iBAAS;;kDAU/D;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,uBAAU,CAAC;IACX,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAK7C;AApBU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,uBAAU,CAAC;GACR,eAAe,CAqB3B;AArBY,0CAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/attachment-base",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.52",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"@aws-sdk/lib-storage": "^3.46.0",
|
|
29
29
|
"@aws-sdk/s3-presigned-post": "^3.46.0",
|
|
30
30
|
"@koa/multer": "^3.0.0",
|
|
31
|
-
"@things-factory/auth-base": "^5.0.0-alpha.
|
|
32
|
-
"@things-factory/env": "^5.0.0-alpha.
|
|
33
|
-
"@things-factory/shell": "^5.0.0-alpha.
|
|
31
|
+
"@things-factory/auth-base": "^5.0.0-alpha.52",
|
|
32
|
+
"@things-factory/env": "^5.0.0-alpha.52",
|
|
33
|
+
"@things-factory/shell": "^5.0.0-alpha.52",
|
|
34
34
|
"memfs": "^3.0.1",
|
|
35
35
|
"mime": "^2.4.4",
|
|
36
36
|
"multer": "^1.3.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "dd9c8f2e256e256e42bd9bd26db5eaa955f85620"
|
|
39
39
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Arg, Ctx, Query, Resolver } from 'type-graphql'
|
|
1
|
+
import { Arg, Args, Ctx, Query, Resolver } from 'type-graphql'
|
|
2
2
|
import { getRepository } from 'typeorm'
|
|
3
3
|
|
|
4
|
-
import { convertListParams,
|
|
4
|
+
import { convertListParams, ListParam } from '@things-factory/shell'
|
|
5
5
|
|
|
6
6
|
import { AttachmentList } from '../'
|
|
7
7
|
import { Attachment } from './attachment'
|
|
@@ -9,13 +9,10 @@ import { Attachment } from './attachment'
|
|
|
9
9
|
@Resolver(Attachment)
|
|
10
10
|
export class AttachmentQuery {
|
|
11
11
|
@Query(returns => AttachmentList)
|
|
12
|
-
async attachments(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@Arg('sortings', type => [Sorting], { nullable: true }) sortings?: Sorting[]
|
|
17
|
-
): Promise<AttachmentList> {
|
|
18
|
-
const convertedParams = convertListParams({ filters, pagination, sortings }, context.state.domain.id)
|
|
12
|
+
async attachments(@Ctx() context: any, @Args() params: ListParam): Promise<AttachmentList> {
|
|
13
|
+
const { domain } = context.state
|
|
14
|
+
|
|
15
|
+
const convertedParams = convertListParams(params, { domain, searchables: ['name', 'description'] })
|
|
19
16
|
const [items, total] = await getRepository(Attachment).findAndCount({
|
|
20
17
|
...convertedParams,
|
|
21
18
|
relations: ['domain', 'creator', 'updater']
|