@maioradv/cms-basic-lib 1.7.5 → 1.7.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/dist/bundles/types.d.ts +3 -1
- package/dist/collections/types.d.ts +3 -1
- package/dist/core/dto/clauses/index.d.ts +4 -1
- package/dist/core/dto/clauses/index.js +17 -1
- package/dist/linkCollections/types.d.ts +5 -1
- package/dist/popups/types.d.ts +3 -1
- package/dist/productAttributes/types.d.ts +5 -3
- package/dist/products/types.d.ts +3 -1
- package/dist/reservations/types.d.ts +5 -4
- package/dist/settings/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/bundles/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from "../collections/types";
|
|
2
|
-
import { BooleanClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
2
|
+
import { BooleanClause, ObjectClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
3
3
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
4
4
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
5
5
|
import { Product } from "../products/types";
|
|
@@ -80,5 +80,7 @@ export type ClausesBundleDto = WhereClausesDto<{
|
|
|
80
80
|
collectionId?: NumberClause;
|
|
81
81
|
published?: BooleanClause;
|
|
82
82
|
noCollections?: BooleanClause;
|
|
83
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
84
|
+
translations?: ObjectClause<Partial<Translation>>;
|
|
83
85
|
}>;
|
|
84
86
|
export type QueryBundleDto = QueryParamsDto<SortingBundleDto, ClausesBundleDto>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bundle, BundleCollection, BundleProduct, BundleVariant } from "../bundles/types";
|
|
2
|
-
import { BooleanClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
2
|
+
import { BooleanClause, ObjectClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
3
3
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
4
4
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
5
5
|
import { CreateImageDto, Image } from "../images/types";
|
|
@@ -48,6 +48,8 @@ export type ClausesCollectionDto = WhereClausesDto<{
|
|
|
48
48
|
hasParent?: BooleanClause;
|
|
49
49
|
hasImages?: BooleanClause;
|
|
50
50
|
allowChildren?: BooleanClause;
|
|
51
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
52
|
+
translations?: ObjectClause<Partial<Translation>>;
|
|
51
53
|
}>;
|
|
52
54
|
export type QueryCollectionDto = QueryParamsDto<SortingCollectionDto, ClausesCollectionDto>;
|
|
53
55
|
export type FindOneCollectionDto = WithRelations<Collection, {
|
|
@@ -3,7 +3,8 @@ export type StringClause = string | undefined;
|
|
|
3
3
|
export type DateClause = string | Date | undefined;
|
|
4
4
|
export type BooleanClause = boolean | undefined;
|
|
5
5
|
export type EnumClause<T> = T | T[] | undefined;
|
|
6
|
-
export type
|
|
6
|
+
export type ObjectClause<T> = T | T[] | undefined;
|
|
7
|
+
export type ClausesDto = Record<string, NumberClause | StringClause | DateClause | BooleanClause | EnumClause<unknown> | ObjectClause<unknown>>;
|
|
7
8
|
export type DefaultClausesDto = {
|
|
8
9
|
id?: NumberClause;
|
|
9
10
|
createdAt?: DateClause;
|
|
@@ -14,4 +15,6 @@ export type DefaultClausesDto = {
|
|
|
14
15
|
maxUpdatedAt?: DateClause;
|
|
15
16
|
};
|
|
16
17
|
export declare function where(args: ClausesDto): Record<string, any>;
|
|
18
|
+
export declare function MetafieldStringify(object: Record<string, string>): string;
|
|
19
|
+
export declare function TranslationStringify(object: Record<string, string>): string;
|
|
17
20
|
export type WhereClausesDto<T extends ClausesDto> = T & DefaultClausesDto;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.where = where;
|
|
4
|
+
exports.MetafieldStringify = MetafieldStringify;
|
|
5
|
+
exports.TranslationStringify = TranslationStringify;
|
|
4
6
|
function where(args) {
|
|
5
7
|
const res = {};
|
|
6
8
|
Object.keys(args).forEach(function (key) {
|
|
7
|
-
|
|
9
|
+
if (key === 'metafields') {
|
|
10
|
+
res[key] = args[key] instanceof Array ? args[key].map(MetafieldStringify).join() : MetafieldStringify(args[key]);
|
|
11
|
+
}
|
|
12
|
+
else if (key === 'translations') {
|
|
13
|
+
res[key] = args[key] instanceof Array ? args[key].map(TranslationStringify).join() : TranslationStringify(args[key]);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
res[key] = args[key] instanceof Array ? args[key].join() : args[key];
|
|
17
|
+
}
|
|
8
18
|
});
|
|
9
19
|
return res;
|
|
10
20
|
}
|
|
21
|
+
function MetafieldStringify(object) {
|
|
22
|
+
return `${object.key || ''}:${object.value || ''}`;
|
|
23
|
+
}
|
|
24
|
+
function TranslationStringify(object) {
|
|
25
|
+
return `${object.key || ''}:${object.locale || ''}:${object.value || ''}`;
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
1
|
+
import { BooleanClause, ObjectClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
2
2
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
3
3
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
4
4
|
import { CreateImageDto, Image } from "../images/types";
|
|
@@ -56,11 +56,15 @@ export type SortingLinkDto = SortingParamsDto<{
|
|
|
56
56
|
export type ClausesLinkCollectionDto = WhereClausesDto<{
|
|
57
57
|
search?: StringClause;
|
|
58
58
|
published?: BooleanClause;
|
|
59
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
60
|
+
translations?: ObjectClause<Partial<Translation>>;
|
|
59
61
|
}>;
|
|
60
62
|
export type ClausesLinkDto = WhereClausesDto<{
|
|
61
63
|
search?: StringClause;
|
|
62
64
|
linkCollectionId?: NumberClause;
|
|
63
65
|
published?: BooleanClause;
|
|
66
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
67
|
+
translations?: ObjectClause<Partial<Translation>>;
|
|
64
68
|
}>;
|
|
65
69
|
export type QueryLinkCollectionDto = QueryParamsDto<SortingLinkCollectionDto, ClausesLinkCollectionDto>;
|
|
66
70
|
export type QueryLinkDto = QueryParamsDto<SortingLinkDto, ClausesLinkDto>;
|
package/dist/popups/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanClause, EnumClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
1
|
+
import { BooleanClause, EnumClause, ObjectClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
2
2
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
3
3
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
4
4
|
import { CreateImageDto, Image } from "../images/types";
|
|
@@ -69,5 +69,7 @@ export type ClausesPopupDto = WhereClausesDto<{
|
|
|
69
69
|
name?: StringClause;
|
|
70
70
|
published?: BooleanClause;
|
|
71
71
|
target?: EnumClause<PopupTarget>;
|
|
72
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
73
|
+
translations?: ObjectClause<Partial<Translation>>;
|
|
72
74
|
}>;
|
|
73
75
|
export type QueryPopupDto = QueryParamsDto<SortingPopupDto, ClausesPopupDto>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
1
|
+
import { BooleanClause, ObjectClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
2
2
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
3
3
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
4
4
|
import { Metafield, OmitRequire, Translation } from "../types";
|
|
@@ -35,7 +35,7 @@ export type SortingProductAttributeDto = SortingParamsDto<{
|
|
|
35
35
|
export type ClausesProductAttributeDto = WhereClausesDto<{
|
|
36
36
|
name?: StringClause;
|
|
37
37
|
published?: BooleanClause;
|
|
38
|
-
slug?: StringClause[];
|
|
38
|
+
slug?: StringClause | StringClause[];
|
|
39
39
|
}>;
|
|
40
40
|
export type QueryProductAttributeDto = QueryParamsDto<SortingProductAttributeDto, ClausesProductAttributeDto>;
|
|
41
41
|
export type SortingProductAttributeValueDto = SortingParamsDto<{
|
|
@@ -46,10 +46,12 @@ export type ClausesProductAttributeValueDto = WhereClausesDto<{
|
|
|
46
46
|
search?: StringClause;
|
|
47
47
|
name?: StringClause;
|
|
48
48
|
published?: BooleanClause;
|
|
49
|
-
attributeSlug?: StringClause[];
|
|
49
|
+
attributeSlug?: StringClause | StringClause[];
|
|
50
50
|
productAttributeId?: NumberClause;
|
|
51
51
|
collections?: NumberClause;
|
|
52
52
|
bundles?: NumberClause;
|
|
53
53
|
hasProducts?: BooleanClause;
|
|
54
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
55
|
+
translations?: ObjectClause<Partial<Translation>>;
|
|
54
56
|
}>;
|
|
55
57
|
export type QueryProductAttributeValueDto = QueryParamsDto<SortingProductAttributeValueDto, ClausesProductAttributeValueDto>;
|
package/dist/products/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from "../collections/types";
|
|
2
|
-
import { BooleanClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
2
|
+
import { BooleanClause, ObjectClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
3
3
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
4
4
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
5
5
|
import { CreateImageDto, Image } from "../images/types";
|
|
@@ -115,5 +115,7 @@ export type ClausesProductDto = WhereClausesDto<{
|
|
|
115
115
|
published?: BooleanClause;
|
|
116
116
|
noCollections?: BooleanClause;
|
|
117
117
|
hasImages?: BooleanClause;
|
|
118
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
119
|
+
translations?: ObjectClause<Partial<Translation>>;
|
|
118
120
|
}>;
|
|
119
121
|
export type QueryProductDto = QueryParamsDto<SortingProductDto, ClausesProductDto>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateClause, EnumClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
1
|
+
import { DateClause, EnumClause, NumberClause, ObjectClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
2
2
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
3
3
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
4
4
|
import { Metafield, OmitRequire } from "../types";
|
|
@@ -51,8 +51,9 @@ export type ClausesReservationDto = WhereClausesDto<{
|
|
|
51
51
|
date?: DateClause;
|
|
52
52
|
minDate?: DateClause;
|
|
53
53
|
maxDate?: DateClause;
|
|
54
|
-
source?: EnumClause<ReservationSource
|
|
55
|
-
status?: EnumClause<ReservationStatus
|
|
56
|
-
guestCount?: NumberClause
|
|
54
|
+
source?: EnumClause<ReservationSource>;
|
|
55
|
+
status?: EnumClause<ReservationStatus>;
|
|
56
|
+
guestCount?: NumberClause;
|
|
57
|
+
metafields?: ObjectClause<Partial<Metafield>>;
|
|
57
58
|
}>;
|
|
58
59
|
export type QueryReservationDto = QueryParamsDto<SortingReservationDto, ClausesReservationDto>;
|
package/dist/settings/types.d.ts
CHANGED
|
@@ -21,6 +21,6 @@ export type SortingSettingDto = SortingParamsDto<{
|
|
|
21
21
|
export type ClausesSettingDto = WhereClausesDto<{
|
|
22
22
|
name?: StringClause;
|
|
23
23
|
description?: StringClause;
|
|
24
|
-
namespace?: StringClause[];
|
|
24
|
+
namespace?: StringClause | StringClause[];
|
|
25
25
|
}>;
|
|
26
26
|
export type QuerySettingDto = QueryParamsDto<SortingSettingDto, ClausesSettingDto>;
|