@rytass/cms-base-nestjs-graphql-module 0.0.5 → 0.0.7
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/decorators/language.decorator.d.ts +1 -0
- package/decorators/language.decorator.js +17 -10
- package/dto/article-version-content.input.d.ts +6 -0
- package/dto/article-version-content.input.js +42 -0
- package/dto/article.dto.js +1 -1
- package/dto/category-backstage.dto.js +1 -5
- package/dto/category-multi-language-name.input.d.ts +4 -0
- package/dto/category-multi-language-name.input.js +30 -0
- package/dto/create-article.args.d.ts +1 -6
- package/dto/create-article.args.js +3 -31
- package/dto/create-category.args.d.ts +1 -7
- package/dto/create-category.args.js +3 -29
- package/dto/update-category.args.d.ts +4 -0
- package/dto/update-category.args.js +24 -0
- package/index.cjs.js +201 -165
- package/mutations/category.mutations.d.ts +2 -1
- package/mutations/category.mutations.js +2 -1
- package/package.json +2 -2
- package/queries/article.queries.d.ts +2 -1
- package/queries/article.queries.js +10 -5
- package/dto/category-multi-language-name.dto.d.ts +0 -4
- /package/{data-loaders → dataloaders}/article-stage.dataloader.d.ts +0 -0
- /package/{data-loaders → dataloaders}/article.dataloader.d.ts +0 -0
- /package/{data-loaders → dataloaders}/category.dataloader.d.ts +0 -0
- /package/{data-loaders → dataloaders}/members.dataloader.d.ts +0 -0
- /package/{quadrats-element.scalar.d.ts → scalars/quadrats-element.scalar.d.ts} +0 -0
- /package/{quadrats-element.scalar.js → scalars/quadrats-element.scalar.js} +0 -0
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import { createParamDecorator } from '@nestjs/common';
|
|
2
|
+
import { DEFAULT_LANGUAGE } from '@rytass/cms-base-nestjs-module';
|
|
2
3
|
|
|
4
|
+
const LANGUAGE_HEADER_KEY = 'x-language';
|
|
3
5
|
const Language = createParamDecorator(async (data, context)=>{
|
|
4
6
|
const contextType = context.getType();
|
|
5
|
-
let language;
|
|
6
7
|
switch(contextType){
|
|
7
8
|
case 'graphql':
|
|
8
9
|
{
|
|
9
10
|
const { GqlExecutionContext } = await import('@nestjs/graphql');
|
|
10
11
|
const ctx = GqlExecutionContext.create(context).getContext();
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
const headers = ctx.req.headers;
|
|
13
|
+
const requestLanguage = headers[LANGUAGE_HEADER_KEY];
|
|
14
|
+
if (typeof requestLanguage === 'string') return requestLanguage;
|
|
15
|
+
const acceptLanguage = headers['accept-language'] ?? '';
|
|
16
|
+
if (!acceptLanguage || typeof acceptLanguage !== 'string') return DEFAULT_LANGUAGE;
|
|
17
|
+
return acceptLanguage.split(',')[0].split(';')[0].trim();
|
|
13
18
|
}
|
|
14
19
|
case 'http':
|
|
15
20
|
default:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
{
|
|
22
|
+
const headers = context.switchToHttp().getRequest().headers;
|
|
23
|
+
const requestLanguage = headers[LANGUAGE_HEADER_KEY];
|
|
24
|
+
if (typeof requestLanguage === 'string') return requestLanguage;
|
|
25
|
+
const acceptLanguage = headers['accept-language'] ?? '';
|
|
26
|
+
if (!acceptLanguage || typeof acceptLanguage !== 'string') return DEFAULT_LANGUAGE;
|
|
27
|
+
return acceptLanguage.split(',')[0].split(';')[0].trim();
|
|
28
|
+
}
|
|
21
29
|
}
|
|
22
|
-
return language.split(',')[0].split(';')[0].trim().toLowerCase();
|
|
23
30
|
});
|
|
24
31
|
|
|
25
|
-
export { Language };
|
|
32
|
+
export { LANGUAGE_HEADER_KEY, Language };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Field, InputType } from '@nestjs/graphql';
|
|
2
|
+
|
|
3
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
4
|
+
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
5
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
+
}
|
|
9
|
+
function _ts_metadata(k, v) {
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
+
}
|
|
12
|
+
class ArticleVersionContentInput {
|
|
13
|
+
language;
|
|
14
|
+
title;
|
|
15
|
+
description;
|
|
16
|
+
content;
|
|
17
|
+
}
|
|
18
|
+
_ts_decorate([
|
|
19
|
+
Field(()=>String, {
|
|
20
|
+
nullable: true
|
|
21
|
+
}),
|
|
22
|
+
_ts_metadata("design:type", Object)
|
|
23
|
+
], ArticleVersionContentInput.prototype, "language", void 0);
|
|
24
|
+
_ts_decorate([
|
|
25
|
+
Field(()=>String),
|
|
26
|
+
_ts_metadata("design:type", String)
|
|
27
|
+
], ArticleVersionContentInput.prototype, "title", void 0);
|
|
28
|
+
_ts_decorate([
|
|
29
|
+
Field(()=>String, {
|
|
30
|
+
nullable: true
|
|
31
|
+
}),
|
|
32
|
+
_ts_metadata("design:type", Object)
|
|
33
|
+
], ArticleVersionContentInput.prototype, "description", void 0);
|
|
34
|
+
_ts_decorate([
|
|
35
|
+
Field(()=>String),
|
|
36
|
+
_ts_metadata("design:type", String)
|
|
37
|
+
], ArticleVersionContentInput.prototype, "content", void 0);
|
|
38
|
+
ArticleVersionContentInput = _ts_decorate([
|
|
39
|
+
InputType('ArticleVersionContentInput')
|
|
40
|
+
], ArticleVersionContentInput);
|
|
41
|
+
|
|
42
|
+
export { ArticleVersionContentInput };
|
package/dto/article.dto.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Field, ObjectType } from '@nestjs/graphql';
|
|
2
2
|
import { BaseArticleDto } from './base-article.dto.js';
|
|
3
|
-
import { QuadratsContentScalar } from '../quadrats-element.scalar.js';
|
|
3
|
+
import { QuadratsContentScalar } from '../scalars/quadrats-element.scalar.js';
|
|
4
4
|
|
|
5
5
|
function _ts_decorate(decorators, target, key, desc) {
|
|
6
6
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
@@ -10,11 +10,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
10
10
|
class CategoryBackstageDto extends BaseCategoryDto {
|
|
11
11
|
}
|
|
12
12
|
CategoryBackstageDto = _ts_decorate([
|
|
13
|
-
ObjectType('CategoryBackstage'
|
|
14
|
-
implements: ()=>[
|
|
15
|
-
BaseCategoryDto
|
|
16
|
-
]
|
|
17
|
-
})
|
|
13
|
+
ObjectType('CategoryBackstage')
|
|
18
14
|
], CategoryBackstageDto);
|
|
19
15
|
|
|
20
16
|
export { CategoryBackstageDto };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Field, InputType } from '@nestjs/graphql';
|
|
2
|
+
|
|
3
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
4
|
+
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
5
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8
|
+
}
|
|
9
|
+
function _ts_metadata(k, v) {
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
|
+
}
|
|
12
|
+
class CategoryMultiLanguageNameInput {
|
|
13
|
+
language;
|
|
14
|
+
name;
|
|
15
|
+
}
|
|
16
|
+
_ts_decorate([
|
|
17
|
+
Field(()=>String, {
|
|
18
|
+
nullable: true
|
|
19
|
+
}),
|
|
20
|
+
_ts_metadata("design:type", Object)
|
|
21
|
+
], CategoryMultiLanguageNameInput.prototype, "language", void 0);
|
|
22
|
+
_ts_decorate([
|
|
23
|
+
Field(()=>String),
|
|
24
|
+
_ts_metadata("design:type", String)
|
|
25
|
+
], CategoryMultiLanguageNameInput.prototype, "name", void 0);
|
|
26
|
+
CategoryMultiLanguageNameInput = _ts_decorate([
|
|
27
|
+
InputType('CategoryMultiLanguageNameInput')
|
|
28
|
+
], CategoryMultiLanguageNameInput);
|
|
29
|
+
|
|
30
|
+
export { CategoryMultiLanguageNameInput };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ArticleVersionContentInput } from './article-version-content.input';
|
|
1
2
|
export declare class CreateArticleArgs {
|
|
2
3
|
categoryIds: string[];
|
|
3
4
|
tags: string[];
|
|
@@ -6,9 +7,3 @@ export declare class CreateArticleArgs {
|
|
|
6
7
|
submitted?: boolean | null;
|
|
7
8
|
signatureLevel?: string | null;
|
|
8
9
|
}
|
|
9
|
-
export declare class ArticleVersionContentInput {
|
|
10
|
-
language?: string | null;
|
|
11
|
-
title: string;
|
|
12
|
-
description?: string | null;
|
|
13
|
-
content: string;
|
|
14
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Field, ID, ArgsType
|
|
1
|
+
import { Field, ID, ArgsType } from '@nestjs/graphql';
|
|
2
|
+
import { ArticleVersionContentInput } from './article-version-content.input.js';
|
|
2
3
|
|
|
3
4
|
function _ts_decorate(decorators, target, key, desc) {
|
|
4
5
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
@@ -56,34 +57,5 @@ _ts_decorate([
|
|
|
56
57
|
CreateArticleArgs = _ts_decorate([
|
|
57
58
|
ArgsType()
|
|
58
59
|
], CreateArticleArgs);
|
|
59
|
-
class ArticleVersionContentInput {
|
|
60
|
-
language;
|
|
61
|
-
title;
|
|
62
|
-
description;
|
|
63
|
-
content;
|
|
64
|
-
}
|
|
65
|
-
_ts_decorate([
|
|
66
|
-
Field(()=>String, {
|
|
67
|
-
nullable: true
|
|
68
|
-
}),
|
|
69
|
-
_ts_metadata("design:type", Object)
|
|
70
|
-
], ArticleVersionContentInput.prototype, "language", void 0);
|
|
71
|
-
_ts_decorate([
|
|
72
|
-
Field(()=>String),
|
|
73
|
-
_ts_metadata("design:type", String)
|
|
74
|
-
], ArticleVersionContentInput.prototype, "title", void 0);
|
|
75
|
-
_ts_decorate([
|
|
76
|
-
Field(()=>String, {
|
|
77
|
-
nullable: true
|
|
78
|
-
}),
|
|
79
|
-
_ts_metadata("design:type", Object)
|
|
80
|
-
], ArticleVersionContentInput.prototype, "description", void 0);
|
|
81
|
-
_ts_decorate([
|
|
82
|
-
Field(()=>String),
|
|
83
|
-
_ts_metadata("design:type", String)
|
|
84
|
-
], ArticleVersionContentInput.prototype, "content", void 0);
|
|
85
|
-
ArticleVersionContentInput = _ts_decorate([
|
|
86
|
-
InputType()
|
|
87
|
-
], ArticleVersionContentInput);
|
|
88
60
|
|
|
89
|
-
export {
|
|
61
|
+
export { CreateArticleArgs };
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
+
import { CategoryMultiLanguageNameInput } from './category-multi-language-name.input';
|
|
1
2
|
export declare class CreateCategoryArgs {
|
|
2
3
|
parentIds?: string[] | null;
|
|
3
4
|
multiLanguageNames: CategoryMultiLanguageNameInput[];
|
|
4
5
|
}
|
|
5
|
-
export declare class CategoryMultiLanguageNameInput {
|
|
6
|
-
language?: string | null;
|
|
7
|
-
name: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class UpdateCategoryArgs extends CreateCategoryArgs {
|
|
10
|
-
id: string;
|
|
11
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Field, ID, ArgsType
|
|
1
|
+
import { Field, ID, ArgsType } from '@nestjs/graphql';
|
|
2
|
+
import { CategoryMultiLanguageNameInput } from './category-multi-language-name.input.js';
|
|
2
3
|
|
|
3
4
|
function _ts_decorate(decorators, target, key, desc) {
|
|
4
5
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
@@ -30,32 +31,5 @@ _ts_decorate([
|
|
|
30
31
|
CreateCategoryArgs = _ts_decorate([
|
|
31
32
|
ArgsType()
|
|
32
33
|
], CreateCategoryArgs);
|
|
33
|
-
class CategoryMultiLanguageNameInput {
|
|
34
|
-
language;
|
|
35
|
-
name;
|
|
36
|
-
}
|
|
37
|
-
_ts_decorate([
|
|
38
|
-
Field(()=>String, {
|
|
39
|
-
nullable: true
|
|
40
|
-
}),
|
|
41
|
-
_ts_metadata("design:type", Object)
|
|
42
|
-
], CategoryMultiLanguageNameInput.prototype, "language", void 0);
|
|
43
|
-
_ts_decorate([
|
|
44
|
-
Field(()=>String),
|
|
45
|
-
_ts_metadata("design:type", String)
|
|
46
|
-
], CategoryMultiLanguageNameInput.prototype, "name", void 0);
|
|
47
|
-
CategoryMultiLanguageNameInput = _ts_decorate([
|
|
48
|
-
InputType()
|
|
49
|
-
], CategoryMultiLanguageNameInput);
|
|
50
|
-
class UpdateCategoryArgs extends CreateCategoryArgs {
|
|
51
|
-
id;
|
|
52
|
-
}
|
|
53
|
-
_ts_decorate([
|
|
54
|
-
Field(()=>ID),
|
|
55
|
-
_ts_metadata("design:type", String)
|
|
56
|
-
], UpdateCategoryArgs.prototype, "id", void 0);
|
|
57
|
-
UpdateCategoryArgs = _ts_decorate([
|
|
58
|
-
ArgsType()
|
|
59
|
-
], UpdateCategoryArgs);
|
|
60
34
|
|
|
61
|
-
export {
|
|
35
|
+
export { CreateCategoryArgs };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Field, ID, ArgsType } from '@nestjs/graphql';
|
|
2
|
+
import { CreateCategoryArgs } from './create-category.args.js';
|
|
3
|
+
|
|
4
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
6
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9
|
+
}
|
|
10
|
+
function _ts_metadata(k, v) {
|
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
12
|
+
}
|
|
13
|
+
class UpdateCategoryArgs extends CreateCategoryArgs {
|
|
14
|
+
id;
|
|
15
|
+
}
|
|
16
|
+
_ts_decorate([
|
|
17
|
+
Field(()=>ID),
|
|
18
|
+
_ts_metadata("design:type", String)
|
|
19
|
+
], UpdateCategoryArgs.prototype, "id", void 0);
|
|
20
|
+
UpdateCategoryArgs = _ts_decorate([
|
|
21
|
+
ArgsType()
|
|
22
|
+
], UpdateCategoryArgs);
|
|
23
|
+
|
|
24
|
+
export { UpdateCategoryArgs };
|
package/index.cjs.js
CHANGED
|
@@ -6,13 +6,13 @@ var graphql = require('@nestjs/graphql');
|
|
|
6
6
|
var memberBaseNestjsModule = require('@rytass/member-base-nestjs-module');
|
|
7
7
|
var graphql$1 = require('graphql');
|
|
8
8
|
|
|
9
|
-
function _ts_decorate$
|
|
9
|
+
function _ts_decorate$l(decorators, target, key, desc) {
|
|
10
10
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
11
11
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
12
12
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
}
|
|
15
|
-
function _ts_metadata$
|
|
15
|
+
function _ts_metadata$j(k, v) {
|
|
16
16
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17
17
|
}
|
|
18
18
|
class BaseArticleDto {
|
|
@@ -20,58 +20,97 @@ class BaseArticleDto {
|
|
|
20
20
|
tags;
|
|
21
21
|
createdAt;
|
|
22
22
|
}
|
|
23
|
-
_ts_decorate$
|
|
23
|
+
_ts_decorate$l([
|
|
24
24
|
graphql.Field(()=>graphql.ID),
|
|
25
|
-
_ts_metadata$
|
|
25
|
+
_ts_metadata$j("design:type", String)
|
|
26
26
|
], BaseArticleDto.prototype, "id", void 0);
|
|
27
|
-
_ts_decorate$
|
|
27
|
+
_ts_decorate$l([
|
|
28
28
|
graphql.Field(()=>[
|
|
29
29
|
String
|
|
30
30
|
]),
|
|
31
|
-
_ts_metadata$
|
|
31
|
+
_ts_metadata$j("design:type", Array)
|
|
32
32
|
], BaseArticleDto.prototype, "tags", void 0);
|
|
33
|
-
_ts_decorate$
|
|
33
|
+
_ts_decorate$l([
|
|
34
34
|
graphql.Field(()=>Date),
|
|
35
|
-
_ts_metadata$
|
|
35
|
+
_ts_metadata$j("design:type", typeof Date === "undefined" ? Object : Date)
|
|
36
36
|
], BaseArticleDto.prototype, "createdAt", void 0);
|
|
37
|
-
BaseArticleDto = _ts_decorate$
|
|
37
|
+
BaseArticleDto = _ts_decorate$l([
|
|
38
38
|
graphql.ObjectType('BaseArticle')
|
|
39
39
|
], BaseArticleDto);
|
|
40
40
|
|
|
41
|
-
function _ts_decorate$
|
|
41
|
+
function _ts_decorate$k(decorators, target, key, desc) {
|
|
42
42
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
43
43
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
44
44
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
45
45
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
46
46
|
}
|
|
47
|
-
function _ts_metadata$
|
|
47
|
+
function _ts_metadata$i(k, v) {
|
|
48
48
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
49
49
|
}
|
|
50
50
|
class ArticleBackstageDto extends BaseArticleDto {
|
|
51
51
|
version;
|
|
52
52
|
deletedAt;
|
|
53
53
|
}
|
|
54
|
-
_ts_decorate$
|
|
54
|
+
_ts_decorate$k([
|
|
55
55
|
graphql.Field(()=>graphql.Int),
|
|
56
|
-
_ts_metadata$
|
|
56
|
+
_ts_metadata$i("design:type", Number)
|
|
57
57
|
], ArticleBackstageDto.prototype, "version", void 0);
|
|
58
|
-
_ts_decorate$
|
|
58
|
+
_ts_decorate$k([
|
|
59
59
|
graphql.Field(()=>Date, {
|
|
60
60
|
nullable: true
|
|
61
61
|
}),
|
|
62
|
-
_ts_metadata$
|
|
62
|
+
_ts_metadata$i("design:type", Object)
|
|
63
63
|
], ArticleBackstageDto.prototype, "deletedAt", void 0);
|
|
64
|
-
ArticleBackstageDto = _ts_decorate$
|
|
64
|
+
ArticleBackstageDto = _ts_decorate$k([
|
|
65
65
|
graphql.ObjectType('ArticleBackstage')
|
|
66
66
|
], ArticleBackstageDto);
|
|
67
67
|
|
|
68
|
-
function _ts_decorate$
|
|
68
|
+
function _ts_decorate$j(decorators, target, key, desc) {
|
|
69
69
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
70
70
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
71
71
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
72
72
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
73
73
|
}
|
|
74
|
-
function _ts_metadata$
|
|
74
|
+
function _ts_metadata$h(k, v) {
|
|
75
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
76
|
+
}
|
|
77
|
+
class ArticleVersionContentInput {
|
|
78
|
+
language;
|
|
79
|
+
title;
|
|
80
|
+
description;
|
|
81
|
+
content;
|
|
82
|
+
}
|
|
83
|
+
_ts_decorate$j([
|
|
84
|
+
graphql.Field(()=>String, {
|
|
85
|
+
nullable: true
|
|
86
|
+
}),
|
|
87
|
+
_ts_metadata$h("design:type", Object)
|
|
88
|
+
], ArticleVersionContentInput.prototype, "language", void 0);
|
|
89
|
+
_ts_decorate$j([
|
|
90
|
+
graphql.Field(()=>String),
|
|
91
|
+
_ts_metadata$h("design:type", String)
|
|
92
|
+
], ArticleVersionContentInput.prototype, "title", void 0);
|
|
93
|
+
_ts_decorate$j([
|
|
94
|
+
graphql.Field(()=>String, {
|
|
95
|
+
nullable: true
|
|
96
|
+
}),
|
|
97
|
+
_ts_metadata$h("design:type", Object)
|
|
98
|
+
], ArticleVersionContentInput.prototype, "description", void 0);
|
|
99
|
+
_ts_decorate$j([
|
|
100
|
+
graphql.Field(()=>String),
|
|
101
|
+
_ts_metadata$h("design:type", String)
|
|
102
|
+
], ArticleVersionContentInput.prototype, "content", void 0);
|
|
103
|
+
ArticleVersionContentInput = _ts_decorate$j([
|
|
104
|
+
graphql.InputType('ArticleVersionContentInput')
|
|
105
|
+
], ArticleVersionContentInput);
|
|
106
|
+
|
|
107
|
+
function _ts_decorate$i(decorators, target, key, desc) {
|
|
108
|
+
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
109
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
110
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
111
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
112
|
+
}
|
|
113
|
+
function _ts_metadata$g(k, v) {
|
|
75
114
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
76
115
|
}
|
|
77
116
|
class CreateArticleArgs {
|
|
@@ -82,102 +121,73 @@ class CreateArticleArgs {
|
|
|
82
121
|
submitted;
|
|
83
122
|
signatureLevel;
|
|
84
123
|
}
|
|
85
|
-
_ts_decorate$
|
|
124
|
+
_ts_decorate$i([
|
|
86
125
|
graphql.Field(()=>[
|
|
87
126
|
graphql.ID
|
|
88
127
|
]),
|
|
89
|
-
_ts_metadata$
|
|
128
|
+
_ts_metadata$g("design:type", Array)
|
|
90
129
|
], CreateArticleArgs.prototype, "categoryIds", void 0);
|
|
91
|
-
_ts_decorate$
|
|
130
|
+
_ts_decorate$i([
|
|
92
131
|
graphql.Field(()=>[
|
|
93
132
|
String
|
|
94
133
|
]),
|
|
95
|
-
_ts_metadata$
|
|
134
|
+
_ts_metadata$g("design:type", Array)
|
|
96
135
|
], CreateArticleArgs.prototype, "tags", void 0);
|
|
97
|
-
_ts_decorate$
|
|
136
|
+
_ts_decorate$i([
|
|
98
137
|
graphql.Field(()=>[
|
|
99
138
|
ArticleVersionContentInput
|
|
100
139
|
]),
|
|
101
|
-
_ts_metadata$
|
|
140
|
+
_ts_metadata$g("design:type", Array)
|
|
102
141
|
], CreateArticleArgs.prototype, "multiLanguageContents", void 0);
|
|
103
|
-
_ts_decorate$
|
|
142
|
+
_ts_decorate$i([
|
|
104
143
|
graphql.Field(()=>Date, {
|
|
105
144
|
nullable: true
|
|
106
145
|
}),
|
|
107
|
-
_ts_metadata$
|
|
146
|
+
_ts_metadata$g("design:type", Object)
|
|
108
147
|
], CreateArticleArgs.prototype, "releasedAt", void 0);
|
|
109
|
-
_ts_decorate$
|
|
148
|
+
_ts_decorate$i([
|
|
110
149
|
graphql.Field(()=>Boolean, {
|
|
111
150
|
nullable: true
|
|
112
151
|
}),
|
|
113
|
-
_ts_metadata$
|
|
152
|
+
_ts_metadata$g("design:type", Object)
|
|
114
153
|
], CreateArticleArgs.prototype, "submitted", void 0);
|
|
115
|
-
_ts_decorate$
|
|
154
|
+
_ts_decorate$i([
|
|
116
155
|
graphql.Field(()=>String, {
|
|
117
156
|
nullable: true
|
|
118
157
|
}),
|
|
119
|
-
_ts_metadata$
|
|
158
|
+
_ts_metadata$g("design:type", Object)
|
|
120
159
|
], CreateArticleArgs.prototype, "signatureLevel", void 0);
|
|
121
|
-
CreateArticleArgs = _ts_decorate$
|
|
160
|
+
CreateArticleArgs = _ts_decorate$i([
|
|
122
161
|
graphql.ArgsType()
|
|
123
162
|
], CreateArticleArgs);
|
|
124
|
-
class ArticleVersionContentInput {
|
|
125
|
-
language;
|
|
126
|
-
title;
|
|
127
|
-
description;
|
|
128
|
-
content;
|
|
129
|
-
}
|
|
130
|
-
_ts_decorate$g([
|
|
131
|
-
graphql.Field(()=>String, {
|
|
132
|
-
nullable: true
|
|
133
|
-
}),
|
|
134
|
-
_ts_metadata$e("design:type", Object)
|
|
135
|
-
], ArticleVersionContentInput.prototype, "language", void 0);
|
|
136
|
-
_ts_decorate$g([
|
|
137
|
-
graphql.Field(()=>String),
|
|
138
|
-
_ts_metadata$e("design:type", String)
|
|
139
|
-
], ArticleVersionContentInput.prototype, "title", void 0);
|
|
140
|
-
_ts_decorate$g([
|
|
141
|
-
graphql.Field(()=>String, {
|
|
142
|
-
nullable: true
|
|
143
|
-
}),
|
|
144
|
-
_ts_metadata$e("design:type", Object)
|
|
145
|
-
], ArticleVersionContentInput.prototype, "description", void 0);
|
|
146
|
-
_ts_decorate$g([
|
|
147
|
-
graphql.Field(()=>String),
|
|
148
|
-
_ts_metadata$e("design:type", String)
|
|
149
|
-
], ArticleVersionContentInput.prototype, "content", void 0);
|
|
150
|
-
ArticleVersionContentInput = _ts_decorate$g([
|
|
151
|
-
graphql.InputType()
|
|
152
|
-
], ArticleVersionContentInput);
|
|
153
163
|
|
|
154
|
-
function _ts_decorate$
|
|
164
|
+
function _ts_decorate$h(decorators, target, key, desc) {
|
|
155
165
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
156
166
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
157
167
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
158
168
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
159
169
|
}
|
|
160
|
-
function _ts_metadata$
|
|
170
|
+
function _ts_metadata$f(k, v) {
|
|
161
171
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
162
172
|
}
|
|
163
173
|
class UpdateArticleArgs extends CreateArticleArgs {
|
|
164
174
|
id;
|
|
165
175
|
}
|
|
166
|
-
_ts_decorate$
|
|
176
|
+
_ts_decorate$h([
|
|
167
177
|
graphql.Field(()=>graphql.ID),
|
|
168
|
-
_ts_metadata$
|
|
178
|
+
_ts_metadata$f("design:type", String)
|
|
169
179
|
], UpdateArticleArgs.prototype, "id", void 0);
|
|
170
|
-
UpdateArticleArgs = _ts_decorate$
|
|
180
|
+
UpdateArticleArgs = _ts_decorate$h([
|
|
171
181
|
graphql.ArgsType()
|
|
172
182
|
], UpdateArticleArgs);
|
|
173
183
|
|
|
174
|
-
function _ts_decorate$
|
|
184
|
+
function _ts_decorate$g(decorators, target, key, desc) {
|
|
175
185
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
176
186
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
177
187
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
178
188
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
179
189
|
}
|
|
180
|
-
function _ts_metadata$
|
|
190
|
+
function _ts_metadata$e(k, v) {
|
|
181
191
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
182
192
|
}
|
|
183
193
|
function _ts_param$3(paramIndex, decorator) {
|
|
@@ -256,43 +266,43 @@ class ArticleMutations {
|
|
|
256
266
|
return this.articleService.withdraw(id);
|
|
257
267
|
}
|
|
258
268
|
}
|
|
259
|
-
_ts_decorate$
|
|
269
|
+
_ts_decorate$g([
|
|
260
270
|
graphql.Mutation(()=>ArticleBackstageDto),
|
|
261
271
|
memberBaseNestjsModule.IsPublic(),
|
|
262
272
|
_ts_param$3(0, memberBaseNestjsModule.MemberId()),
|
|
263
273
|
_ts_param$3(1, graphql.Args()),
|
|
264
|
-
_ts_metadata$
|
|
265
|
-
_ts_metadata$
|
|
274
|
+
_ts_metadata$e("design:type", Function),
|
|
275
|
+
_ts_metadata$e("design:paramtypes", [
|
|
266
276
|
String,
|
|
267
277
|
typeof CreateArticleArgs === "undefined" ? Object : CreateArticleArgs
|
|
268
278
|
]),
|
|
269
|
-
_ts_metadata$
|
|
279
|
+
_ts_metadata$e("design:returntype", Promise)
|
|
270
280
|
], ArticleMutations.prototype, "createArticle", null);
|
|
271
|
-
_ts_decorate$
|
|
281
|
+
_ts_decorate$g([
|
|
272
282
|
graphql.Mutation(()=>ArticleBackstageDto),
|
|
273
283
|
memberBaseNestjsModule.IsPublic(),
|
|
274
284
|
_ts_param$3(0, memberBaseNestjsModule.MemberId()),
|
|
275
285
|
_ts_param$3(1, graphql.Args()),
|
|
276
|
-
_ts_metadata$
|
|
277
|
-
_ts_metadata$
|
|
286
|
+
_ts_metadata$e("design:type", Function),
|
|
287
|
+
_ts_metadata$e("design:paramtypes", [
|
|
278
288
|
String,
|
|
279
289
|
typeof UpdateArticleArgs === "undefined" ? Object : UpdateArticleArgs
|
|
280
290
|
]),
|
|
281
|
-
_ts_metadata$
|
|
291
|
+
_ts_metadata$e("design:returntype", Promise)
|
|
282
292
|
], ArticleMutations.prototype, "updateArticle", null);
|
|
283
|
-
_ts_decorate$
|
|
293
|
+
_ts_decorate$g([
|
|
284
294
|
graphql.Mutation(()=>Boolean),
|
|
285
295
|
memberBaseNestjsModule.IsPublic(),
|
|
286
296
|
_ts_param$3(0, graphql.Args('id', {
|
|
287
297
|
type: ()=>graphql.ID
|
|
288
298
|
})),
|
|
289
|
-
_ts_metadata$
|
|
290
|
-
_ts_metadata$
|
|
299
|
+
_ts_metadata$e("design:type", Function),
|
|
300
|
+
_ts_metadata$e("design:paramtypes", [
|
|
291
301
|
String
|
|
292
302
|
]),
|
|
293
|
-
_ts_metadata$
|
|
303
|
+
_ts_metadata$e("design:returntype", Promise)
|
|
294
304
|
], ArticleMutations.prototype, "deleteArticle", null);
|
|
295
|
-
_ts_decorate$
|
|
305
|
+
_ts_decorate$g([
|
|
296
306
|
graphql.Mutation(()=>ArticleBackstageDto),
|
|
297
307
|
memberBaseNestjsModule.IsPublic(),
|
|
298
308
|
_ts_param$3(0, memberBaseNestjsModule.MemberId()),
|
|
@@ -302,27 +312,27 @@ _ts_decorate$e([
|
|
|
302
312
|
_ts_param$3(2, graphql.Args('version', {
|
|
303
313
|
type: ()=>graphql.Int
|
|
304
314
|
})),
|
|
305
|
-
_ts_metadata$
|
|
306
|
-
_ts_metadata$
|
|
315
|
+
_ts_metadata$e("design:type", Function),
|
|
316
|
+
_ts_metadata$e("design:paramtypes", [
|
|
307
317
|
String,
|
|
308
318
|
String,
|
|
309
319
|
Number
|
|
310
320
|
]),
|
|
311
|
-
_ts_metadata$
|
|
321
|
+
_ts_metadata$e("design:returntype", Promise)
|
|
312
322
|
], ArticleMutations.prototype, "submitArticle", null);
|
|
313
|
-
_ts_decorate$
|
|
323
|
+
_ts_decorate$g([
|
|
314
324
|
graphql.Mutation(()=>ArticleBackstageDto),
|
|
315
325
|
memberBaseNestjsModule.IsPublic(),
|
|
316
326
|
_ts_param$3(0, graphql.Args('id', {
|
|
317
327
|
type: ()=>graphql.ID
|
|
318
328
|
})),
|
|
319
|
-
_ts_metadata$
|
|
320
|
-
_ts_metadata$
|
|
329
|
+
_ts_metadata$e("design:type", Function),
|
|
330
|
+
_ts_metadata$e("design:paramtypes", [
|
|
321
331
|
String
|
|
322
332
|
]),
|
|
323
|
-
_ts_metadata$
|
|
333
|
+
_ts_metadata$e("design:returntype", Promise)
|
|
324
334
|
], ArticleMutations.prototype, "approveArticle", null);
|
|
325
|
-
_ts_decorate$
|
|
335
|
+
_ts_decorate$g([
|
|
326
336
|
graphql.Mutation(()=>ArticleBackstageDto),
|
|
327
337
|
memberBaseNestjsModule.IsPublic(),
|
|
328
338
|
_ts_param$3(0, graphql.Args('id', {
|
|
@@ -332,14 +342,14 @@ _ts_decorate$e([
|
|
|
332
342
|
type: ()=>String,
|
|
333
343
|
nullable: true
|
|
334
344
|
})),
|
|
335
|
-
_ts_metadata$
|
|
336
|
-
_ts_metadata$
|
|
345
|
+
_ts_metadata$e("design:type", Function),
|
|
346
|
+
_ts_metadata$e("design:paramtypes", [
|
|
337
347
|
String,
|
|
338
348
|
Object
|
|
339
349
|
]),
|
|
340
|
-
_ts_metadata$
|
|
350
|
+
_ts_metadata$e("design:returntype", Promise)
|
|
341
351
|
], ArticleMutations.prototype, "rejectArticle", null);
|
|
342
|
-
_ts_decorate$
|
|
352
|
+
_ts_decorate$g([
|
|
343
353
|
graphql.Mutation(()=>ArticleBackstageDto),
|
|
344
354
|
memberBaseNestjsModule.IsPublic(),
|
|
345
355
|
_ts_param$3(0, memberBaseNestjsModule.MemberId()),
|
|
@@ -349,99 +359,99 @@ _ts_decorate$e([
|
|
|
349
359
|
_ts_param$3(2, graphql.Args('releasedAt', {
|
|
350
360
|
type: ()=>Date
|
|
351
361
|
})),
|
|
352
|
-
_ts_metadata$
|
|
353
|
-
_ts_metadata$
|
|
362
|
+
_ts_metadata$e("design:type", Function),
|
|
363
|
+
_ts_metadata$e("design:paramtypes", [
|
|
354
364
|
String,
|
|
355
365
|
String,
|
|
356
366
|
typeof Date === "undefined" ? Object : Date
|
|
357
367
|
]),
|
|
358
|
-
_ts_metadata$
|
|
368
|
+
_ts_metadata$e("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
359
369
|
], ArticleMutations.prototype, "releaseArticle", null);
|
|
360
|
-
_ts_decorate$
|
|
370
|
+
_ts_decorate$g([
|
|
361
371
|
graphql.Mutation(()=>ArticleBackstageDto),
|
|
362
372
|
memberBaseNestjsModule.IsPublic(),
|
|
363
373
|
_ts_param$3(0, graphql.Args('id', {
|
|
364
374
|
type: ()=>graphql.ID
|
|
365
375
|
})),
|
|
366
|
-
_ts_metadata$
|
|
367
|
-
_ts_metadata$
|
|
376
|
+
_ts_metadata$e("design:type", Function),
|
|
377
|
+
_ts_metadata$e("design:paramtypes", [
|
|
368
378
|
String
|
|
369
379
|
]),
|
|
370
|
-
_ts_metadata$
|
|
380
|
+
_ts_metadata$e("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
371
381
|
], ArticleMutations.prototype, "withdrawArticle", null);
|
|
372
|
-
ArticleMutations = _ts_decorate$
|
|
382
|
+
ArticleMutations = _ts_decorate$g([
|
|
373
383
|
graphql.Resolver(),
|
|
374
|
-
_ts_metadata$
|
|
375
|
-
_ts_metadata$
|
|
384
|
+
_ts_metadata$e("design:type", Function),
|
|
385
|
+
_ts_metadata$e("design:paramtypes", [
|
|
376
386
|
typeof cmsBaseNestjsModule.ArticleBaseService === "undefined" ? Object : cmsBaseNestjsModule.ArticleBaseService
|
|
377
387
|
])
|
|
378
388
|
], ArticleMutations);
|
|
379
389
|
|
|
380
|
-
function _ts_decorate$
|
|
390
|
+
function _ts_decorate$f(decorators, target, key, desc) {
|
|
381
391
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
382
392
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
383
393
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
384
394
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
385
395
|
}
|
|
386
|
-
function _ts_metadata$
|
|
396
|
+
function _ts_metadata$d(k, v) {
|
|
397
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
398
|
+
}
|
|
399
|
+
class CategoryMultiLanguageNameInput {
|
|
400
|
+
language;
|
|
401
|
+
name;
|
|
402
|
+
}
|
|
403
|
+
_ts_decorate$f([
|
|
404
|
+
graphql.Field(()=>String, {
|
|
405
|
+
nullable: true
|
|
406
|
+
}),
|
|
407
|
+
_ts_metadata$d("design:type", Object)
|
|
408
|
+
], CategoryMultiLanguageNameInput.prototype, "language", void 0);
|
|
409
|
+
_ts_decorate$f([
|
|
410
|
+
graphql.Field(()=>String),
|
|
411
|
+
_ts_metadata$d("design:type", String)
|
|
412
|
+
], CategoryMultiLanguageNameInput.prototype, "name", void 0);
|
|
413
|
+
CategoryMultiLanguageNameInput = _ts_decorate$f([
|
|
414
|
+
graphql.InputType('CategoryMultiLanguageNameInput')
|
|
415
|
+
], CategoryMultiLanguageNameInput);
|
|
416
|
+
|
|
417
|
+
function _ts_decorate$e(decorators, target, key, desc) {
|
|
418
|
+
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
419
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
420
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
421
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
422
|
+
}
|
|
423
|
+
function _ts_metadata$c(k, v) {
|
|
387
424
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
388
425
|
}
|
|
389
426
|
class CreateCategoryArgs {
|
|
390
427
|
parentIds;
|
|
391
428
|
multiLanguageNames;
|
|
392
429
|
}
|
|
393
|
-
_ts_decorate$
|
|
430
|
+
_ts_decorate$e([
|
|
394
431
|
graphql.Field(()=>[
|
|
395
432
|
graphql.ID
|
|
396
433
|
], {
|
|
397
434
|
nullable: true
|
|
398
435
|
}),
|
|
399
|
-
_ts_metadata$
|
|
436
|
+
_ts_metadata$c("design:type", Object)
|
|
400
437
|
], CreateCategoryArgs.prototype, "parentIds", void 0);
|
|
401
|
-
_ts_decorate$
|
|
438
|
+
_ts_decorate$e([
|
|
402
439
|
graphql.Field(()=>[
|
|
403
440
|
CategoryMultiLanguageNameInput
|
|
404
441
|
]),
|
|
405
|
-
_ts_metadata$
|
|
442
|
+
_ts_metadata$c("design:type", Array)
|
|
406
443
|
], CreateCategoryArgs.prototype, "multiLanguageNames", void 0);
|
|
407
|
-
CreateCategoryArgs = _ts_decorate$
|
|
444
|
+
CreateCategoryArgs = _ts_decorate$e([
|
|
408
445
|
graphql.ArgsType()
|
|
409
446
|
], CreateCategoryArgs);
|
|
410
|
-
class CategoryMultiLanguageNameInput {
|
|
411
|
-
language;
|
|
412
|
-
name;
|
|
413
|
-
}
|
|
414
|
-
_ts_decorate$d([
|
|
415
|
-
graphql.Field(()=>String, {
|
|
416
|
-
nullable: true
|
|
417
|
-
}),
|
|
418
|
-
_ts_metadata$b("design:type", Object)
|
|
419
|
-
], CategoryMultiLanguageNameInput.prototype, "language", void 0);
|
|
420
|
-
_ts_decorate$d([
|
|
421
|
-
graphql.Field(()=>String),
|
|
422
|
-
_ts_metadata$b("design:type", String)
|
|
423
|
-
], CategoryMultiLanguageNameInput.prototype, "name", void 0);
|
|
424
|
-
CategoryMultiLanguageNameInput = _ts_decorate$d([
|
|
425
|
-
graphql.InputType()
|
|
426
|
-
], CategoryMultiLanguageNameInput);
|
|
427
|
-
class UpdateCategoryArgs extends CreateCategoryArgs {
|
|
428
|
-
id;
|
|
429
|
-
}
|
|
430
|
-
_ts_decorate$d([
|
|
431
|
-
graphql.Field(()=>graphql.ID),
|
|
432
|
-
_ts_metadata$b("design:type", String)
|
|
433
|
-
], UpdateCategoryArgs.prototype, "id", void 0);
|
|
434
|
-
UpdateCategoryArgs = _ts_decorate$d([
|
|
435
|
-
graphql.ArgsType()
|
|
436
|
-
], UpdateCategoryArgs);
|
|
437
447
|
|
|
438
|
-
function _ts_decorate$
|
|
448
|
+
function _ts_decorate$d(decorators, target, key, desc) {
|
|
439
449
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
440
450
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
441
451
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
442
452
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
443
453
|
}
|
|
444
|
-
function _ts_metadata$
|
|
454
|
+
function _ts_metadata$b(k, v) {
|
|
445
455
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
446
456
|
}
|
|
447
457
|
class BaseCategoryDto {
|
|
@@ -449,23 +459,23 @@ class BaseCategoryDto {
|
|
|
449
459
|
createdAt;
|
|
450
460
|
updatedAt;
|
|
451
461
|
}
|
|
452
|
-
_ts_decorate$
|
|
462
|
+
_ts_decorate$d([
|
|
453
463
|
graphql.Field(()=>graphql.ID),
|
|
454
|
-
_ts_metadata$
|
|
464
|
+
_ts_metadata$b("design:type", String)
|
|
455
465
|
], BaseCategoryDto.prototype, "id", void 0);
|
|
456
|
-
_ts_decorate$
|
|
466
|
+
_ts_decorate$d([
|
|
457
467
|
graphql.Field(()=>Date),
|
|
458
|
-
_ts_metadata$
|
|
468
|
+
_ts_metadata$b("design:type", typeof Date === "undefined" ? Object : Date)
|
|
459
469
|
], BaseCategoryDto.prototype, "createdAt", void 0);
|
|
460
|
-
_ts_decorate$
|
|
470
|
+
_ts_decorate$d([
|
|
461
471
|
graphql.Field(()=>Date),
|
|
462
|
-
_ts_metadata$
|
|
472
|
+
_ts_metadata$b("design:type", typeof Date === "undefined" ? Object : Date)
|
|
463
473
|
], BaseCategoryDto.prototype, "updatedAt", void 0);
|
|
464
|
-
BaseCategoryDto = _ts_decorate$
|
|
474
|
+
BaseCategoryDto = _ts_decorate$d([
|
|
465
475
|
graphql.ObjectType('BaseCategory')
|
|
466
476
|
], BaseCategoryDto);
|
|
467
477
|
|
|
468
|
-
function _ts_decorate$
|
|
478
|
+
function _ts_decorate$c(decorators, target, key, desc) {
|
|
469
479
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
470
480
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
471
481
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -473,14 +483,30 @@ function _ts_decorate$b(decorators, target, key, desc) {
|
|
|
473
483
|
}
|
|
474
484
|
class CategoryBackstageDto extends BaseCategoryDto {
|
|
475
485
|
}
|
|
476
|
-
CategoryBackstageDto = _ts_decorate$
|
|
477
|
-
graphql.ObjectType('CategoryBackstage'
|
|
478
|
-
implements: ()=>[
|
|
479
|
-
BaseCategoryDto
|
|
480
|
-
]
|
|
481
|
-
})
|
|
486
|
+
CategoryBackstageDto = _ts_decorate$c([
|
|
487
|
+
graphql.ObjectType('CategoryBackstage')
|
|
482
488
|
], CategoryBackstageDto);
|
|
483
489
|
|
|
490
|
+
function _ts_decorate$b(decorators, target, key, desc) {
|
|
491
|
+
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
492
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
493
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
494
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
495
|
+
}
|
|
496
|
+
function _ts_metadata$a(k, v) {
|
|
497
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
498
|
+
}
|
|
499
|
+
class UpdateCategoryArgs extends CreateCategoryArgs {
|
|
500
|
+
id;
|
|
501
|
+
}
|
|
502
|
+
_ts_decorate$b([
|
|
503
|
+
graphql.Field(()=>graphql.ID),
|
|
504
|
+
_ts_metadata$a("design:type", String)
|
|
505
|
+
], UpdateCategoryArgs.prototype, "id", void 0);
|
|
506
|
+
UpdateCategoryArgs = _ts_decorate$b([
|
|
507
|
+
graphql.ArgsType()
|
|
508
|
+
], UpdateCategoryArgs);
|
|
509
|
+
|
|
484
510
|
function _ts_decorate$a(decorators, target, key, desc) {
|
|
485
511
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
486
512
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -618,26 +644,32 @@ graphql.registerEnumType(cmsBaseNestjsModule.ArticleStage, {
|
|
|
618
644
|
name: 'ArticleStage'
|
|
619
645
|
});
|
|
620
646
|
|
|
647
|
+
const LANGUAGE_HEADER_KEY = 'x-language';
|
|
621
648
|
const Language = common.createParamDecorator(async (data, context)=>{
|
|
622
649
|
const contextType = context.getType();
|
|
623
|
-
let language;
|
|
624
650
|
switch(contextType){
|
|
625
651
|
case 'graphql':
|
|
626
652
|
{
|
|
627
653
|
const { GqlExecutionContext } = await import('@nestjs/graphql');
|
|
628
654
|
const ctx = GqlExecutionContext.create(context).getContext();
|
|
629
|
-
|
|
630
|
-
|
|
655
|
+
const headers = ctx.req.headers;
|
|
656
|
+
const requestLanguage = headers[LANGUAGE_HEADER_KEY];
|
|
657
|
+
if (typeof requestLanguage === 'string') return requestLanguage;
|
|
658
|
+
const acceptLanguage = headers['accept-language'] ?? '';
|
|
659
|
+
if (!acceptLanguage || typeof acceptLanguage !== 'string') return cmsBaseNestjsModule.DEFAULT_LANGUAGE;
|
|
660
|
+
return acceptLanguage.split(',')[0].split(';')[0].trim();
|
|
631
661
|
}
|
|
632
662
|
case 'http':
|
|
633
663
|
default:
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
664
|
+
{
|
|
665
|
+
const headers = context.switchToHttp().getRequest().headers;
|
|
666
|
+
const requestLanguage = headers[LANGUAGE_HEADER_KEY];
|
|
667
|
+
if (typeof requestLanguage === 'string') return requestLanguage;
|
|
668
|
+
const acceptLanguage = headers['accept-language'] ?? '';
|
|
669
|
+
if (!acceptLanguage || typeof acceptLanguage !== 'string') return cmsBaseNestjsModule.DEFAULT_LANGUAGE;
|
|
670
|
+
return acceptLanguage.split(',')[0].split(';')[0].trim();
|
|
671
|
+
}
|
|
639
672
|
}
|
|
640
|
-
return language.split(',')[0].split(';')[0].trim().toLowerCase();
|
|
641
673
|
});
|
|
642
674
|
|
|
643
675
|
function _ts_decorate$8(decorators, target, key, desc) {
|
|
@@ -795,18 +827,20 @@ function _ts_param$1(paramIndex, decorator) {
|
|
|
795
827
|
}
|
|
796
828
|
class ArticleQueries {
|
|
797
829
|
articleService;
|
|
798
|
-
|
|
830
|
+
multiLanguage;
|
|
831
|
+
constructor(articleService, multiLanguage){
|
|
799
832
|
this.articleService = articleService;
|
|
833
|
+
this.multiLanguage = multiLanguage;
|
|
800
834
|
}
|
|
801
835
|
article(id, language = cmsBaseNestjsModule.DEFAULT_LANGUAGE) {
|
|
802
836
|
return this.articleService.findById(id, {
|
|
803
|
-
language: language ?? cmsBaseNestjsModule.DEFAULT_LANGUAGE
|
|
837
|
+
language: this.multiLanguage ? language ?? cmsBaseNestjsModule.DEFAULT_LANGUAGE : undefined
|
|
804
838
|
});
|
|
805
839
|
}
|
|
806
840
|
async articles(args, language = cmsBaseNestjsModule.DEFAULT_LANGUAGE) {
|
|
807
841
|
return this.articleService.findCollection({
|
|
808
842
|
...args,
|
|
809
|
-
language
|
|
843
|
+
language: this.multiLanguage ? language ?? cmsBaseNestjsModule.DEFAULT_LANGUAGE : undefined
|
|
810
844
|
});
|
|
811
845
|
}
|
|
812
846
|
backstageArticle(id) {
|
|
@@ -866,9 +900,11 @@ _ts_decorate$4([
|
|
|
866
900
|
], ArticleQueries.prototype, "backstageArticles", null);
|
|
867
901
|
ArticleQueries = _ts_decorate$4([
|
|
868
902
|
graphql.Resolver(),
|
|
903
|
+
_ts_param$1(1, common.Inject(cmsBaseNestjsModule.MULTIPLE_LANGUAGE_MODE)),
|
|
869
904
|
_ts_metadata$3("design:type", Function),
|
|
870
905
|
_ts_metadata$3("design:paramtypes", [
|
|
871
|
-
typeof cmsBaseNestjsModule.ArticleBaseService === "undefined" ? Object : cmsBaseNestjsModule.ArticleBaseService
|
|
906
|
+
typeof cmsBaseNestjsModule.ArticleBaseService === "undefined" ? Object : cmsBaseNestjsModule.ArticleBaseService,
|
|
907
|
+
Boolean
|
|
872
908
|
])
|
|
873
909
|
], ArticleQueries);
|
|
874
910
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CategoryBaseService } from '@rytass/cms-base-nestjs-module';
|
|
2
|
-
import { CreateCategoryArgs
|
|
2
|
+
import { CreateCategoryArgs } from '../dto/create-category.args';
|
|
3
3
|
import { CategoryBackstageDto } from '../dto/category-backstage.dto';
|
|
4
|
+
import { UpdateCategoryArgs } from '../dto/update-category.args';
|
|
4
5
|
export declare class CategoryMutations {
|
|
5
6
|
private readonly categoryService;
|
|
6
7
|
constructor(categoryService: CategoryBaseService);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Mutation, Args, ID, Resolver } from '@nestjs/graphql';
|
|
2
2
|
import { CategoryBaseService } from '@rytass/cms-base-nestjs-module';
|
|
3
|
-
import { CreateCategoryArgs
|
|
3
|
+
import { CreateCategoryArgs } from '../dto/create-category.args.js';
|
|
4
4
|
import { IsPublic } from '@rytass/member-base-nestjs-module';
|
|
5
5
|
import { CategoryBackstageDto } from '../dto/category-backstage.dto.js';
|
|
6
|
+
import { UpdateCategoryArgs } from '../dto/update-category.args.js';
|
|
6
7
|
|
|
7
8
|
function _ts_decorate(decorators, target, key, desc) {
|
|
8
9
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/cms-base-nestjs-graphql-module",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Rytass Content Management System NestJS Base GraphQL Module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rytass",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typeorm": "*"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@rytass/cms-base-nestjs-module": "^0.1.
|
|
29
|
+
"@rytass/cms-base-nestjs-module": "^0.1.84",
|
|
30
30
|
"@rytass/member-base-nestjs-module": "^0.1.64",
|
|
31
31
|
"dataloader": "^2.2.2",
|
|
32
32
|
"lru-cache": "^11.0.2"
|
|
@@ -6,7 +6,8 @@ import { ArticleBackstageDto } from '../dto/article-backstage.dto';
|
|
|
6
6
|
import { ArticleBackstageCollectionDto } from '../dto/article-backstage-collection.dto';
|
|
7
7
|
export declare class ArticleQueries {
|
|
8
8
|
private readonly articleService;
|
|
9
|
-
|
|
9
|
+
private readonly multiLanguage;
|
|
10
|
+
constructor(articleService: ArticleBaseService, multiLanguage: boolean);
|
|
10
11
|
article(id: string, language?: string): Promise<ArticleDto>;
|
|
11
12
|
articles(args: ArticlesArgs, language?: string): Promise<ArticleCollectionDto>;
|
|
12
13
|
backstageArticle(id: string): Promise<ArticleBackstageDto>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Query, Args, ID, Resolver } from '@nestjs/graphql';
|
|
2
|
-
import { ArticleBaseService, DEFAULT_LANGUAGE } from '@rytass/cms-base-nestjs-module';
|
|
2
|
+
import { MULTIPLE_LANGUAGE_MODE, ArticleBaseService, DEFAULT_LANGUAGE } from '@rytass/cms-base-nestjs-module';
|
|
3
3
|
import { ArticlesArgs } from '../dto/articles.args.js';
|
|
4
4
|
import { IsPublic } from '@rytass/member-base-nestjs-module';
|
|
5
5
|
import { Language } from '../decorators/language.decorator.js';
|
|
@@ -7,6 +7,7 @@ import { ArticleCollectionDto } from '../dto/article-collection.dto.js';
|
|
|
7
7
|
import { ArticleDto } from '../dto/article.dto.js';
|
|
8
8
|
import { ArticleBackstageDto } from '../dto/article-backstage.dto.js';
|
|
9
9
|
import { ArticleBackstageCollectionDto } from '../dto/article-backstage-collection.dto.js';
|
|
10
|
+
import { Inject } from '@nestjs/common';
|
|
10
11
|
|
|
11
12
|
function _ts_decorate(decorators, target, key, desc) {
|
|
12
13
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -24,18 +25,20 @@ function _ts_param(paramIndex, decorator) {
|
|
|
24
25
|
}
|
|
25
26
|
class ArticleQueries {
|
|
26
27
|
articleService;
|
|
27
|
-
|
|
28
|
+
multiLanguage;
|
|
29
|
+
constructor(articleService, multiLanguage){
|
|
28
30
|
this.articleService = articleService;
|
|
31
|
+
this.multiLanguage = multiLanguage;
|
|
29
32
|
}
|
|
30
33
|
article(id, language = DEFAULT_LANGUAGE) {
|
|
31
34
|
return this.articleService.findById(id, {
|
|
32
|
-
language: language ?? DEFAULT_LANGUAGE
|
|
35
|
+
language: this.multiLanguage ? language ?? DEFAULT_LANGUAGE : undefined
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
38
|
async articles(args, language = DEFAULT_LANGUAGE) {
|
|
36
39
|
return this.articleService.findCollection({
|
|
37
40
|
...args,
|
|
38
|
-
language
|
|
41
|
+
language: this.multiLanguage ? language ?? DEFAULT_LANGUAGE : undefined
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
backstageArticle(id) {
|
|
@@ -95,9 +98,11 @@ _ts_decorate([
|
|
|
95
98
|
], ArticleQueries.prototype, "backstageArticles", null);
|
|
96
99
|
ArticleQueries = _ts_decorate([
|
|
97
100
|
Resolver(),
|
|
101
|
+
_ts_param(1, Inject(MULTIPLE_LANGUAGE_MODE)),
|
|
98
102
|
_ts_metadata("design:type", Function),
|
|
99
103
|
_ts_metadata("design:paramtypes", [
|
|
100
|
-
typeof ArticleBaseService === "undefined" ? Object : ArticleBaseService
|
|
104
|
+
typeof ArticleBaseService === "undefined" ? Object : ArticleBaseService,
|
|
105
|
+
Boolean
|
|
101
106
|
])
|
|
102
107
|
], ArticleQueries);
|
|
103
108
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|