@wix/patterns-fields-utils 1.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/@wix/patterns-fields-bundled-cm-media-utils/dist/cjs/index.d.ts +176 -0
- package/@wix/patterns-fields-bundled-cm-media-utils/dist/cjs/index.js +7103 -0
- package/@wix/patterns-fields-bundled-cm-media-utils/dist/cjs/index.js.map +1 -0
- package/@wix/patterns-fields-bundled-cm-media-utils/dist/esm/index.d.mts +176 -0
- package/@wix/patterns-fields-bundled-cm-media-utils/dist/esm/index.mjs +7118 -0
- package/@wix/patterns-fields-bundled-cm-media-utils/dist/esm/index.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-cm-media-utils/package.json +37 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.css.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.d.ts +115 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.global.css +1536 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.js +76375 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.js.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/cjs/move-POMANKZG.svg +3 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-ANOFRNLZ.mjs +302 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-ANOFRNLZ.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-D3Y2XBAR.mjs +9573 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-D3Y2XBAR.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-FOPGQED5.mjs +60 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-FOPGQED5.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-KK6IAXDC.mjs +61 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-KK6IAXDC.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-LSMTMMMM.mjs +999 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-LSMTMMMM.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/hls-X7Z2O2CI.mjs +32977 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/hls-X7Z2O2CI.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/html2canvas.esm-26SHFSHQ.mjs +7813 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/html2canvas.esm-26SHFSHQ.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.css.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.d.mts +115 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.global.css +1537 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.mjs +23054 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/lib-INOZ3X5B.mjs +6427 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/lib-INOZ3X5B.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/move-POMANKZG.svg +3 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/player.es-EHCCDTX6.mjs +1600 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/player.es-EHCCDTX6.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/validateTypes-OWSYRJSG.mjs +85 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/validateTypes-OWSYRJSG.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoItem-QVVYW7GT.mjs +311 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoItem-QVVYW7GT.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoScrollHelper-HX35Z6JI.mjs +307 -0
- package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoScrollHelper-HX35Z6JI.mjs.map +1 -0
- package/@wix/patterns-fields-bundled-organize-media/package.json +70 -0
- package/@wix/wix-data-schema-types/.nvmrc +1 -0
- package/@wix/wix-data-schema-types/index.d.ts +1 -0
- package/@wix/wix-data-schema-types/lib/capabilities.d.ts +18 -0
- package/@wix/wix-data-schema-types/lib/capabilities.js +3 -0
- package/@wix/wix-data-schema-types/lib/capabilities.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/defaultMaxPageSize.d.ts +4 -0
- package/@wix/wix-data-schema-types/lib/defaultMaxPageSize.js +9 -0
- package/@wix/wix-data-schema-types/lib/defaultMaxPageSize.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/field.d.ts +350 -0
- package/@wix/wix-data-schema-types/lib/field.js +173 -0
- package/@wix/wix-data-schema-types/lib/field.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/fieldPlugins.d.ts +23 -0
- package/@wix/wix-data-schema-types/lib/fieldPlugins.js +8 -0
- package/@wix/wix-data-schema-types/lib/fieldPlugins.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/filter.d.ts +261 -0
- package/@wix/wix-data-schema-types/lib/filter.js +41 -0
- package/@wix/wix-data-schema-types/lib/filter.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/index.d.ts +9 -0
- package/@wix/wix-data-schema-types/lib/index.js +26 -0
- package/@wix/wix-data-schema-types/lib/index.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/order.d.ts +24 -0
- package/@wix/wix-data-schema-types/lib/order.js +9 -0
- package/@wix/wix-data-schema-types/lib/order.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/pagingMode.d.ts +4 -0
- package/@wix/wix-data-schema-types/lib/pagingMode.js +9 -0
- package/@wix/wix-data-schema-types/lib/pagingMode.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/plugins.d.ts +76 -0
- package/@wix/wix-data-schema-types/lib/plugins.js +27 -0
- package/@wix/wix-data-schema-types/lib/plugins.js.map +1 -0
- package/@wix/wix-data-schema-types/lib/schema.d.ts +202 -0
- package/@wix/wix-data-schema-types/lib/schema.js +106 -0
- package/@wix/wix-data-schema-types/lib/schema.js.map +1 -0
- package/@wix/wix-data-schema-types/package.json +45 -0
- package/@wix/wix-data-schema-types/src/capabilities.ts +19 -0
- package/@wix/wix-data-schema-types/src/defaultMaxPageSize.ts +6 -0
- package/@wix/wix-data-schema-types/src/field.ts +355 -0
- package/@wix/wix-data-schema-types/src/fieldPlugins.ts +28 -0
- package/@wix/wix-data-schema-types/src/filter.ts +280 -0
- package/@wix/wix-data-schema-types/src/index.ts +9 -0
- package/@wix/wix-data-schema-types/src/order.ts +26 -0
- package/@wix/wix-data-schema-types/src/pagingMode.ts +4 -0
- package/@wix/wix-data-schema-types/src/plugins.ts +97 -0
- package/@wix/wix-data-schema-types/src/schema.ts +222 -0
- package/@wix/wix-data-schema-types/tsconfig.json +18 -0
- package/@wix/wix-data-schema-types/tslint.json +3 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type Filter
|
|
3
|
+
* @description Filter is a single condition filter or a combination of conditions through And or Or filters.
|
|
4
|
+
*/
|
|
5
|
+
export type Filter = And | Or | Not | Eq | Ne | Lt | Lte | Gt | Gte | HasSome | HasAll | Contains | StartsWith | EndsWith | Urlized;
|
|
6
|
+
/**
|
|
7
|
+
* @enum Operator
|
|
8
|
+
* @description Provides values for filter operator.
|
|
9
|
+
* @member and to combine multiple filters with an and.
|
|
10
|
+
* @member or to combine multiple filters with an or.
|
|
11
|
+
* @member not to add filter witch has to be not matched.
|
|
12
|
+
* @member eq to add `equality` condition to filter.
|
|
13
|
+
* @member ne to add `not equal` condition to filter.
|
|
14
|
+
* @member lt to add `les than` condition to filter.
|
|
15
|
+
* @member lte to add `tess than or equal` condition to filter.
|
|
16
|
+
* @member gt to add `greater than` condition to filter.
|
|
17
|
+
* @member gte to add `greater than or equal` condition to filter.
|
|
18
|
+
* @member hasSome to add `has some values of provided` condition to filter.
|
|
19
|
+
* @member hasAll to add `has all values of provided` condition to filter.
|
|
20
|
+
* @member contains to add `field value contains provided value` condition to filter.
|
|
21
|
+
* @member startsWith to add `field value starts with provided value` condition to filter.
|
|
22
|
+
* @member endsWith to add `ends with provided value` condition to filter.
|
|
23
|
+
* @member urlized to add `urlized provided value` condition to filter.
|
|
24
|
+
*/
|
|
25
|
+
export declare enum Operator {
|
|
26
|
+
and = "$and",
|
|
27
|
+
or = "$or",
|
|
28
|
+
not = "$not",
|
|
29
|
+
eq = "$eq",
|
|
30
|
+
ne = "$ne",
|
|
31
|
+
lt = "$lt",
|
|
32
|
+
lte = "$lte",
|
|
33
|
+
gt = "$gt",
|
|
34
|
+
gte = "$gte",
|
|
35
|
+
hasSome = "$hasSome",
|
|
36
|
+
hasAll = "$hasAll",
|
|
37
|
+
contains = "$contains",
|
|
38
|
+
startsWith = "$startsWith",
|
|
39
|
+
endsWith = "$endsWith",
|
|
40
|
+
urlized = "$urlized"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @type Literal
|
|
44
|
+
* @description Describes types used in some of filters
|
|
45
|
+
*/
|
|
46
|
+
export type Literal = string | number | Date | null;
|
|
47
|
+
export interface FilterInterface {
|
|
48
|
+
kind: 'filter';
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @interface And
|
|
52
|
+
* @member operator - `and` operator.
|
|
53
|
+
* @member value - `Array` of `Filter`.
|
|
54
|
+
* @description A filter with an `and` returns all the items that match all filters in `and` filter array.
|
|
55
|
+
* @example Filter where `someField` is between 6 and 12
|
|
56
|
+
* const andFilter: And = {
|
|
57
|
+
* operator: Operator.and,
|
|
58
|
+
* value: [
|
|
59
|
+
* {operator: Operator.gt, fieldName: 'someField', value:6},
|
|
60
|
+
* {operator: Operator.lt, fieldName: 'someField', value:12}
|
|
61
|
+
* ]
|
|
62
|
+
* }
|
|
63
|
+
*/
|
|
64
|
+
export interface And extends FilterInterface {
|
|
65
|
+
operator: Operator.and;
|
|
66
|
+
value: Filter[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @interface Or
|
|
70
|
+
* @member operator - `or` operator
|
|
71
|
+
* @member value - `Array` of `Filter`.
|
|
72
|
+
* @description A filter with an `or` returns all the items that match at least one filter in `or` filter array.
|
|
73
|
+
* @example Filter where `someField` equals "hi" or "bye"
|
|
74
|
+
* const orFilter: Or = {
|
|
75
|
+
* operator: Operator.or,
|
|
76
|
+
* value: [
|
|
77
|
+
* {operator: Operator.eq, fieldName: 'someField', value:'hi'},
|
|
78
|
+
* {operator: Operator.eq, fieldName: 'someField', value:'bye'}
|
|
79
|
+
* ]
|
|
80
|
+
* }
|
|
81
|
+
*/
|
|
82
|
+
export interface Or extends FilterInterface {
|
|
83
|
+
operator: Operator.or;
|
|
84
|
+
value: Filter[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @interface Not
|
|
88
|
+
* @member operator - `not` operator.
|
|
89
|
+
* @member value - `Filter`.
|
|
90
|
+
* @description A query with a `not` returns all the items that match the filter as defined up to the `not`
|
|
91
|
+
* operator, but don't match the filter under the `not` operator.
|
|
92
|
+
* @example Filter where `someField` not equals "hi"
|
|
93
|
+
* const notFilter: Not = {
|
|
94
|
+
* operator: Operator.not,
|
|
95
|
+
* value: {operator: Operator.eq, fieldName: 'someField', value: 'hi'}
|
|
96
|
+
* }
|
|
97
|
+
*/
|
|
98
|
+
export interface Not extends FilterInterface {
|
|
99
|
+
operator: Operator.not;
|
|
100
|
+
value: Filter;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @interface Eq
|
|
104
|
+
* @member operator - `eq`
|
|
105
|
+
* @member fieldName - field witch has to be equal to `value`
|
|
106
|
+
* @member value - value to match a field value. Value can be any type.
|
|
107
|
+
* @example Filter where `someField` equals "hi"
|
|
108
|
+
* const eq: Eq = {operator: Operator.eq, fieldName: 'someField', value: 'hi'}
|
|
109
|
+
*/
|
|
110
|
+
export interface Eq extends FilterInterface {
|
|
111
|
+
operator: Operator.eq;
|
|
112
|
+
fieldName: string;
|
|
113
|
+
value: any;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* @interface Ne
|
|
117
|
+
* @member operator - `ne` not equal
|
|
118
|
+
* @member fieldName - field witch has to be not equal to `value`
|
|
119
|
+
* @member value - value to not match a field value. Value can be any type.
|
|
120
|
+
* @example Filter where `someField` not equals "hi"
|
|
121
|
+
* const ne: Ne = {operator: Operator.ne, fieldName: 'someField', value: 'hi'}
|
|
122
|
+
*/
|
|
123
|
+
export interface Ne extends FilterInterface {
|
|
124
|
+
operator: Operator.ne;
|
|
125
|
+
fieldName: string;
|
|
126
|
+
value: any;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @interface Lt
|
|
130
|
+
* @member operator - `lt` less than
|
|
131
|
+
* @member fieldName - field witch has to be less than to `value`
|
|
132
|
+
* @member value - value compare field value to.
|
|
133
|
+
* @example Filter where `someField` is less than 6
|
|
134
|
+
* const lt: Lt = {operator: Operator.lt, fieldName: 'someField', value: 6}
|
|
135
|
+
*/
|
|
136
|
+
export interface Lt extends FilterInterface {
|
|
137
|
+
operator: Operator.lt;
|
|
138
|
+
fieldName: string;
|
|
139
|
+
value: Literal;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @interface Lte
|
|
143
|
+
* @member operator - `lte` less than or equal
|
|
144
|
+
* @member fieldName - field witch has to be less than or equal to `value`
|
|
145
|
+
* @member value - value compare field value to.
|
|
146
|
+
* @example Filter where `someField` is less than or equal to 6
|
|
147
|
+
* const lte: Lte = {operator: Operator.lte, fieldName: 'someField', value: 6}
|
|
148
|
+
*/
|
|
149
|
+
export interface Lte extends FilterInterface {
|
|
150
|
+
operator: Operator.lte;
|
|
151
|
+
fieldName: string;
|
|
152
|
+
value: Literal;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @interface Gt
|
|
156
|
+
* @member operator - `gt` greater than
|
|
157
|
+
* @member fieldName - field witch has to be greater than to `value`
|
|
158
|
+
* @member value - value compare field value to.
|
|
159
|
+
* @example Filter where `someField` is greater than 6
|
|
160
|
+
* const gt: Gt = {operator: Operator.gt, fieldName: 'someField', value: 6}
|
|
161
|
+
*/
|
|
162
|
+
export interface Gt extends FilterInterface {
|
|
163
|
+
operator: Operator.gt;
|
|
164
|
+
fieldName: string;
|
|
165
|
+
value: Literal;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* @interface Gte
|
|
169
|
+
* @member operator - `gte` greater than or equal
|
|
170
|
+
* @member fieldName - field witch has to be greater than or equal to `value`
|
|
171
|
+
* @member value - value compare field value to.
|
|
172
|
+
* @example Filter where `someField` is greater than or equal to 6
|
|
173
|
+
* const gte: Gte = {operator: Operator.gte, fieldName: 'someField', value: 6}
|
|
174
|
+
*/
|
|
175
|
+
export interface Gte extends FilterInterface {
|
|
176
|
+
operator: Operator.gte;
|
|
177
|
+
fieldName: string;
|
|
178
|
+
value: Literal;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* @interface StartsWith
|
|
182
|
+
* @member operator - `startsWith` starts with
|
|
183
|
+
* @member fieldName - field witch has to start with `value`
|
|
184
|
+
* @member value - value compare field value to.
|
|
185
|
+
* @example Filter where `someField` starts with "hel"
|
|
186
|
+
* const startsWith: StartsWith = {operator: Operator.startsWith, fieldName: 'someField', value: 'hel'}
|
|
187
|
+
*/
|
|
188
|
+
export interface StartsWith extends FilterInterface {
|
|
189
|
+
operator: Operator.startsWith;
|
|
190
|
+
fieldName: string;
|
|
191
|
+
value: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* @interface EndsWith
|
|
195
|
+
* @member operator - `endsWith` starts with
|
|
196
|
+
* @member fieldName - field witch has to end with `value`
|
|
197
|
+
* @member value - value compare field value to.
|
|
198
|
+
* @example Filter where `someField` ends with "lo"
|
|
199
|
+
* const endsWith: EndsWith = {operator: Operator.endsWith, fieldName: 'someField', value: 'lo'}
|
|
200
|
+
*/
|
|
201
|
+
export interface EndsWith extends FilterInterface {
|
|
202
|
+
operator: Operator.endsWith;
|
|
203
|
+
fieldName: string;
|
|
204
|
+
value: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @interface Urlized
|
|
208
|
+
* Tokens should be joined using `-` or ` `. I.e. value ["hello", "world"] matches "hello world" and "hello-world".
|
|
209
|
+
* @member operator - `urlized`
|
|
210
|
+
* @member ignoreCase - case sensative or not
|
|
211
|
+
* @member fieldName - field witch has to match urlized `value`
|
|
212
|
+
* @member value - array of tokens
|
|
213
|
+
* @example Filter where `someField` matches ["hello", "world"]
|
|
214
|
+
* const matches: Matches = {operator: Operator.matches,
|
|
215
|
+
* ignoreCase: true, fieldName: 'someField', value: ['hello', 'world']}
|
|
216
|
+
*/
|
|
217
|
+
export interface Urlized extends FilterInterface {
|
|
218
|
+
operator: Operator.urlized;
|
|
219
|
+
ignoreCase: boolean;
|
|
220
|
+
fieldName: string;
|
|
221
|
+
value: string[];
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @interface Contains
|
|
225
|
+
* @member operator - `contains`
|
|
226
|
+
* @member fieldName - field witch has to contain `value`
|
|
227
|
+
* @member value - value compare field value to.
|
|
228
|
+
* @example Filter where `someField` contains "ell"
|
|
229
|
+
* const contains: Contains = {operator: Operator.contains, fieldName: 'someField', value: 'ell'}
|
|
230
|
+
*/
|
|
231
|
+
export interface Contains extends FilterInterface {
|
|
232
|
+
operator: Operator.contains;
|
|
233
|
+
fieldName: string;
|
|
234
|
+
value: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @interface HasSome
|
|
238
|
+
* @member operator - `hasSome`
|
|
239
|
+
* @member fieldName - field witch has to contain some of the values.
|
|
240
|
+
* @member value - values compare field values to.
|
|
241
|
+
* @example Filter where `someField` contains at least one of [1,2,3]
|
|
242
|
+
* const hasSome: HasSome = {operator: Operator.hasSome, fieldName: 'someField', value: [1,2,3]}
|
|
243
|
+
*/
|
|
244
|
+
export interface HasSome extends FilterInterface {
|
|
245
|
+
operator: Operator.hasSome;
|
|
246
|
+
fieldName: string;
|
|
247
|
+
value: Literal[];
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @interface HasAll
|
|
251
|
+
* @member operator - `hasAll`
|
|
252
|
+
* @member fieldName - field witch has to contain all of the values.
|
|
253
|
+
* @member value - values compare field values to.
|
|
254
|
+
* @example Filter where `someField` contains all of [1,2,3]
|
|
255
|
+
* const hasAll: HasAll = {operator: Operator.hasAll, fieldName: 'someField', value: [1,2,3]}
|
|
256
|
+
*/
|
|
257
|
+
export interface HasAll extends FilterInterface {
|
|
258
|
+
operator: Operator.hasAll;
|
|
259
|
+
fieldName: string;
|
|
260
|
+
value: Literal[];
|
|
261
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Operator = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @enum Operator
|
|
6
|
+
* @description Provides values for filter operator.
|
|
7
|
+
* @member and to combine multiple filters with an and.
|
|
8
|
+
* @member or to combine multiple filters with an or.
|
|
9
|
+
* @member not to add filter witch has to be not matched.
|
|
10
|
+
* @member eq to add `equality` condition to filter.
|
|
11
|
+
* @member ne to add `not equal` condition to filter.
|
|
12
|
+
* @member lt to add `les than` condition to filter.
|
|
13
|
+
* @member lte to add `tess than or equal` condition to filter.
|
|
14
|
+
* @member gt to add `greater than` condition to filter.
|
|
15
|
+
* @member gte to add `greater than or equal` condition to filter.
|
|
16
|
+
* @member hasSome to add `has some values of provided` condition to filter.
|
|
17
|
+
* @member hasAll to add `has all values of provided` condition to filter.
|
|
18
|
+
* @member contains to add `field value contains provided value` condition to filter.
|
|
19
|
+
* @member startsWith to add `field value starts with provided value` condition to filter.
|
|
20
|
+
* @member endsWith to add `ends with provided value` condition to filter.
|
|
21
|
+
* @member urlized to add `urlized provided value` condition to filter.
|
|
22
|
+
*/
|
|
23
|
+
var Operator;
|
|
24
|
+
(function (Operator) {
|
|
25
|
+
Operator["and"] = "$and";
|
|
26
|
+
Operator["or"] = "$or";
|
|
27
|
+
Operator["not"] = "$not";
|
|
28
|
+
Operator["eq"] = "$eq";
|
|
29
|
+
Operator["ne"] = "$ne";
|
|
30
|
+
Operator["lt"] = "$lt";
|
|
31
|
+
Operator["lte"] = "$lte";
|
|
32
|
+
Operator["gt"] = "$gt";
|
|
33
|
+
Operator["gte"] = "$gte";
|
|
34
|
+
Operator["hasSome"] = "$hasSome";
|
|
35
|
+
Operator["hasAll"] = "$hasAll";
|
|
36
|
+
Operator["contains"] = "$contains";
|
|
37
|
+
Operator["startsWith"] = "$startsWith";
|
|
38
|
+
Operator["endsWith"] = "$endsWith";
|
|
39
|
+
Operator["urlized"] = "$urlized";
|
|
40
|
+
})(Operator = exports.Operator || (exports.Operator = {}));
|
|
41
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../src/filter.ts"],"names":[],"mappings":";;;AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,IAAY,QAgBX;AAhBD,WAAY,QAAQ;IAChB,wBAAY,CAAA;IACZ,sBAAU,CAAA;IACV,wBAAY,CAAA;IACZ,sBAAU,CAAA;IACV,sBAAU,CAAA;IACV,sBAAU,CAAA;IACV,wBAAY,CAAA;IACZ,sBAAU,CAAA;IACV,wBAAY,CAAA;IACZ,gCAAoB,CAAA;IACpB,8BAAkB,CAAA;IAClB,kCAAsB,CAAA;IACtB,sCAA0B,CAAA;IAC1B,kCAAsB,CAAA;IACtB,gCAAoB,CAAA;AACxB,CAAC,EAhBW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAgBnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './order';
|
|
2
|
+
export * from './filter';
|
|
3
|
+
export * from './field';
|
|
4
|
+
export * from './schema';
|
|
5
|
+
export * from './pagingMode';
|
|
6
|
+
export * from './plugins';
|
|
7
|
+
export * from './defaultMaxPageSize';
|
|
8
|
+
export * from './fieldPlugins';
|
|
9
|
+
export * from './capabilities';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./order"), exports);
|
|
18
|
+
__exportStar(require("./filter"), exports);
|
|
19
|
+
__exportStar(require("./field"), exports);
|
|
20
|
+
__exportStar(require("./schema"), exports);
|
|
21
|
+
__exportStar(require("./pagingMode"), exports);
|
|
22
|
+
__exportStar(require("./plugins"), exports);
|
|
23
|
+
__exportStar(require("./defaultMaxPageSize"), exports);
|
|
24
|
+
__exportStar(require("./fieldPlugins"), exports);
|
|
25
|
+
__exportStar(require("./capabilities"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,2CAAwB;AACxB,0CAAuB;AACvB,2CAAwB;AACxB,+CAA4B;AAC5B,4CAAyB;AACzB,uDAAoC;AACpC,iDAA8B;AAC9B,iDAA8B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type OrderBy
|
|
3
|
+
* @description Describes and order with a list of order specifications
|
|
4
|
+
* @example `someField` ordered ascending, `otherField` ordered descending
|
|
5
|
+
* const orderBy: OrderBy = [
|
|
6
|
+
* {fieldName: 'someField', direction: Direction.asc},
|
|
7
|
+
* {fieldName: 'otherField', direction: Direction.desc}
|
|
8
|
+
* ]
|
|
9
|
+
*/
|
|
10
|
+
export type OrderBy = OrderSpec[];
|
|
11
|
+
/**
|
|
12
|
+
* @interface OrderSpec
|
|
13
|
+
* @description Order specification for single field.
|
|
14
|
+
* @example `someField` ordered ascending
|
|
15
|
+
* const ascOrder: OrderSpec = {fieldName: 'someField', direction: Direction.asc}
|
|
16
|
+
*/
|
|
17
|
+
export interface OrderSpec {
|
|
18
|
+
fieldName: string;
|
|
19
|
+
direction: Direction;
|
|
20
|
+
}
|
|
21
|
+
export declare enum Direction {
|
|
22
|
+
asc = "asc",
|
|
23
|
+
desc = "desc"
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Direction = void 0;
|
|
4
|
+
var Direction;
|
|
5
|
+
(function (Direction) {
|
|
6
|
+
Direction["asc"] = "asc";
|
|
7
|
+
Direction["desc"] = "desc";
|
|
8
|
+
})(Direction = exports.Direction || (exports.Direction = {}));
|
|
9
|
+
//# sourceMappingURL=order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.js","sourceRoot":"","sources":["../src/order.ts"],"names":[],"mappings":";;;AAsBA,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACjB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PagingMode = void 0;
|
|
4
|
+
var PagingMode;
|
|
5
|
+
(function (PagingMode) {
|
|
6
|
+
PagingMode["Offset"] = "OFFSET";
|
|
7
|
+
PagingMode["Cursor"] = "CURSOR";
|
|
8
|
+
})(PagingMode = exports.PagingMode || (exports.PagingMode = {}));
|
|
9
|
+
//# sourceMappingURL=pagingMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagingMode.js","sourceRoot":"","sources":["../src/pagingMode.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACrB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { OrderSpec } from './order';
|
|
2
|
+
export declare const PUBLISHING_PLUGIN_ID: "publishing";
|
|
3
|
+
export declare const PUBLISH_STATUS_FIELD_KEY: "_publishStatus";
|
|
4
|
+
export declare const PUBLISH_DATE_FIELD_KEY: "_publishDate";
|
|
5
|
+
export declare const DRAFT_DATE_FIELD_KEY: "_draftDate";
|
|
6
|
+
export declare enum PublishingStatus {
|
|
7
|
+
DRAFT = "DRAFT",
|
|
8
|
+
PUBLISHED = "PUBLISHED"
|
|
9
|
+
}
|
|
10
|
+
export interface PublishingPlugin {
|
|
11
|
+
defaultStatus: PublishingStatus;
|
|
12
|
+
}
|
|
13
|
+
export declare const GRID_APPLESS_PLUGIN_ID = "gridAppless";
|
|
14
|
+
export interface GridApplessPlugin {
|
|
15
|
+
isMigrated: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const SINGLES_PLUGIN_ID: "singleItem";
|
|
18
|
+
export interface SinglesPlugin {
|
|
19
|
+
singleItemId: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const URLIZED_PLUGIN_ID: "urlized";
|
|
22
|
+
export declare enum UrlizedFormat {
|
|
23
|
+
PLAIN = "plain",
|
|
24
|
+
ORIGINAL = "original"
|
|
25
|
+
}
|
|
26
|
+
export interface UrlizedPlugin {
|
|
27
|
+
format: UrlizedFormat;
|
|
28
|
+
}
|
|
29
|
+
export declare const MULTILINGUAL_PLUGIN_ID: "multilingual";
|
|
30
|
+
export interface MultilingualPlugin {
|
|
31
|
+
translatable: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare const SHARED_PLUGIN_ID: "shared";
|
|
34
|
+
export interface SharedPlugin {
|
|
35
|
+
}
|
|
36
|
+
export declare const PAGE_LINK_PLUGIN_ID: "persistentPageLink";
|
|
37
|
+
export interface PageLinkPlugin {
|
|
38
|
+
isPersisted: boolean;
|
|
39
|
+
isUpdatable: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare const CMS_PLUGIN_ID = "cms";
|
|
42
|
+
export interface CmsPlugin {
|
|
43
|
+
siteSort?: {
|
|
44
|
+
sort: OrderSpec[];
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export declare const CATALOG_PLUGIN_ID = "CATALOG";
|
|
48
|
+
export interface CatalogOptions {
|
|
49
|
+
name?: string;
|
|
50
|
+
price?: string;
|
|
51
|
+
url?: string | null;
|
|
52
|
+
description?: string | null;
|
|
53
|
+
image?: string | null;
|
|
54
|
+
quantity?: string | null;
|
|
55
|
+
}
|
|
56
|
+
export interface CatalogPlugin {
|
|
57
|
+
catalogOptions?: CatalogOptions;
|
|
58
|
+
}
|
|
59
|
+
export declare const CATEGORIES_PLUGIN_ID = "categories";
|
|
60
|
+
export interface CategoriesPlugin {
|
|
61
|
+
}
|
|
62
|
+
export interface KnownSchemaPlugins {
|
|
63
|
+
[PUBLISHING_PLUGIN_ID]?: PublishingPlugin;
|
|
64
|
+
[GRID_APPLESS_PLUGIN_ID]?: GridApplessPlugin;
|
|
65
|
+
[SINGLES_PLUGIN_ID]?: SinglesPlugin;
|
|
66
|
+
[URLIZED_PLUGIN_ID]?: UrlizedPlugin;
|
|
67
|
+
[MULTILINGUAL_PLUGIN_ID]?: MultilingualPlugin;
|
|
68
|
+
[SHARED_PLUGIN_ID]?: SharedPlugin;
|
|
69
|
+
[PAGE_LINK_PLUGIN_ID]?: PageLinkPlugin;
|
|
70
|
+
[CMS_PLUGIN_ID]?: CmsPlugin;
|
|
71
|
+
[CATALOG_PLUGIN_ID]?: CatalogPlugin;
|
|
72
|
+
[CATEGORIES_PLUGIN_ID]?: CategoriesPlugin;
|
|
73
|
+
}
|
|
74
|
+
export type SchemaPlugins = KnownSchemaPlugins & Record<string, object>;
|
|
75
|
+
export type SchemaPluginId = keyof KnownSchemaPlugins;
|
|
76
|
+
export type SchemaPlugin = Required<KnownSchemaPlugins>[SchemaPluginId];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CATEGORIES_PLUGIN_ID = exports.CATALOG_PLUGIN_ID = exports.CMS_PLUGIN_ID = exports.PAGE_LINK_PLUGIN_ID = exports.SHARED_PLUGIN_ID = exports.MULTILINGUAL_PLUGIN_ID = exports.UrlizedFormat = exports.URLIZED_PLUGIN_ID = exports.SINGLES_PLUGIN_ID = exports.GRID_APPLESS_PLUGIN_ID = exports.PublishingStatus = exports.DRAFT_DATE_FIELD_KEY = exports.PUBLISH_DATE_FIELD_KEY = exports.PUBLISH_STATUS_FIELD_KEY = exports.PUBLISHING_PLUGIN_ID = void 0;
|
|
4
|
+
exports.PUBLISHING_PLUGIN_ID = 'publishing';
|
|
5
|
+
exports.PUBLISH_STATUS_FIELD_KEY = '_publishStatus';
|
|
6
|
+
exports.PUBLISH_DATE_FIELD_KEY = '_publishDate';
|
|
7
|
+
exports.DRAFT_DATE_FIELD_KEY = '_draftDate';
|
|
8
|
+
var PublishingStatus;
|
|
9
|
+
(function (PublishingStatus) {
|
|
10
|
+
PublishingStatus["DRAFT"] = "DRAFT";
|
|
11
|
+
PublishingStatus["PUBLISHED"] = "PUBLISHED";
|
|
12
|
+
})(PublishingStatus = exports.PublishingStatus || (exports.PublishingStatus = {}));
|
|
13
|
+
exports.GRID_APPLESS_PLUGIN_ID = 'gridAppless';
|
|
14
|
+
exports.SINGLES_PLUGIN_ID = 'singleItem';
|
|
15
|
+
exports.URLIZED_PLUGIN_ID = 'urlized';
|
|
16
|
+
var UrlizedFormat;
|
|
17
|
+
(function (UrlizedFormat) {
|
|
18
|
+
UrlizedFormat["PLAIN"] = "plain";
|
|
19
|
+
UrlizedFormat["ORIGINAL"] = "original";
|
|
20
|
+
})(UrlizedFormat = exports.UrlizedFormat || (exports.UrlizedFormat = {}));
|
|
21
|
+
exports.MULTILINGUAL_PLUGIN_ID = 'multilingual';
|
|
22
|
+
exports.SHARED_PLUGIN_ID = 'shared';
|
|
23
|
+
exports.PAGE_LINK_PLUGIN_ID = 'persistentPageLink';
|
|
24
|
+
exports.CMS_PLUGIN_ID = 'cms';
|
|
25
|
+
exports.CATALOG_PLUGIN_ID = 'CATALOG';
|
|
26
|
+
exports.CATEGORIES_PLUGIN_ID = 'categories';
|
|
27
|
+
//# sourceMappingURL=plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAG,YAAqB,CAAA;AAE5C,QAAA,wBAAwB,GAAG,gBAAyB,CAAA;AACpD,QAAA,sBAAsB,GAAG,cAAuB,CAAA;AAChD,QAAA,oBAAoB,GAAG,YAAqB,CAAA;AAEzD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,2CAAuB,CAAA;AACzB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAMY,QAAA,sBAAsB,GAAG,aAAa,CAAA;AAMtC,QAAA,iBAAiB,GAAG,YAAqB,CAAA;AAMzC,QAAA,iBAAiB,GAAG,SAAkB,CAAA;AAEnD,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,sCAAqB,CAAA;AACvB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAMY,QAAA,sBAAsB,GAAG,cAAuB,CAAA;AAMhD,QAAA,gBAAgB,GAAG,QAAiB,CAAA;AAIpC,QAAA,mBAAmB,GAAG,oBAA6B,CAAA;AAMnD,QAAA,aAAa,GAAG,KAAK,CAAA;AAOrB,QAAA,iBAAiB,GAAG,SAAS,CAAA;AAc7B,QAAA,oBAAoB,GAAG,YAAY,CAAA"}
|