@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,350 @@
|
|
|
1
|
+
import { FieldPlugins } from './fieldPlugins';
|
|
2
|
+
/**
|
|
3
|
+
* @interface FieldSpec
|
|
4
|
+
* @member displayName {string} - Defines UI-friendly name of a field. This name is used in Content Manager
|
|
5
|
+
* header and when binding to the field in Data Binding.
|
|
6
|
+
* @member type {FieldType} - Defines field data type.
|
|
7
|
+
* @member systemField {boolean} - Defines field is system or user created field.
|
|
8
|
+
* @member queryOperators {Array<AllowedFilterOperator>} - Denotes which filter operators can be used on field. This limits
|
|
9
|
+
* the filters that are available in Content Manager and Dataset. Wix Data, however, will not validate filters
|
|
10
|
+
* passed by user from code. Undefined implies default type operators are supported, empty array - no filters
|
|
11
|
+
* are supported on the field.
|
|
12
|
+
* @member sortable {boolean} - Defines the field is sortable or not. Similarly to queryOperators, impacts
|
|
13
|
+
* Content Manager and Data Binding.
|
|
14
|
+
* @member isDeleted {boolean} - Deleted fields are hidden from data results, also excluded from sorts
|
|
15
|
+
* and filters.
|
|
16
|
+
* @member index {number} - Defines field order in cases where fields are ordered, e.g., Content Manager.
|
|
17
|
+
* @member pii {boolean} - Indicates that field contains PII data and should be encrypted.
|
|
18
|
+
* @member calculator {Calculator} - Defines how virtual data should be generated.
|
|
19
|
+
* @member linkedRouterPage {string} - Defines reference to router pattern in the site document
|
|
20
|
+
* @member minValue {number} - Min possible value for the field.
|
|
21
|
+
* @member maxValue {number} - Max possible value for the field.
|
|
22
|
+
* @member minStrLength {number} - Min length for the string field.
|
|
23
|
+
* @member maxStrLength {number} - Max length for the string field.
|
|
24
|
+
* @member minArraySize {number} - Min size for the repeated field.
|
|
25
|
+
* @member maxArraySize {number} - Max size for the repeated field.
|
|
26
|
+
* @member readOnly {boolean} - Indicates that the field cannot be set by the client. E.g. Id field assigned by the server.
|
|
27
|
+
* @member immutable {boolean} - Indicates that the field can be set by the client, but can never be changed or updated.
|
|
28
|
+
* @member required {boolean} - Indicates that the field is required.
|
|
29
|
+
*/
|
|
30
|
+
export type FieldSpec = {
|
|
31
|
+
displayName: string;
|
|
32
|
+
type: FieldType;
|
|
33
|
+
systemField: boolean;
|
|
34
|
+
queryOperators?: AllowedFilterOperator[];
|
|
35
|
+
sortable?: boolean;
|
|
36
|
+
isDeleted?: boolean;
|
|
37
|
+
index?: number;
|
|
38
|
+
pii?: boolean;
|
|
39
|
+
calculator?: Calculator;
|
|
40
|
+
linkedRouterPage?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
minValue?: number;
|
|
43
|
+
maxValue?: number;
|
|
44
|
+
minStrLength?: number;
|
|
45
|
+
maxStrLength?: number;
|
|
46
|
+
minArraySize?: number;
|
|
47
|
+
maxArraySize?: number;
|
|
48
|
+
readOnly?: boolean;
|
|
49
|
+
immutable?: boolean;
|
|
50
|
+
required?: boolean;
|
|
51
|
+
plugin?: string;
|
|
52
|
+
plugins?: FieldPlugins;
|
|
53
|
+
pageLinkType?: PageLinkType;
|
|
54
|
+
condition?: Condition;
|
|
55
|
+
} & ValidFieldTypes;
|
|
56
|
+
export type NestedFieldSpec = {
|
|
57
|
+
type: FieldType;
|
|
58
|
+
displayName?: string;
|
|
59
|
+
queryOperators?: AllowedFilterOperator[];
|
|
60
|
+
sortable?: boolean;
|
|
61
|
+
} & ValidNestedFieldTypes;
|
|
62
|
+
export type ValidFieldTypes = ReferenceField | MultiReferenceField | ValidNestedFieldTypes | SlugField;
|
|
63
|
+
export type ValidNestedFieldTypes = TextField | NumberField | DateTimeField | DateField | ImageField | BoolField | DocumentField | UrlField | EmailField | RichTextField | VideoField | PageLinkField | MediaGalleryField | AddressField | AnyField | ArrayStringField | ArrayDocumentField | AudioField | TimeField | LanguageField | RichContentField | ColorField | ArrayField | ObjectField;
|
|
64
|
+
export interface Calculator {
|
|
65
|
+
config: {
|
|
66
|
+
pattern: string;
|
|
67
|
+
lowercase: boolean;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export declare enum FieldType {
|
|
71
|
+
/**
|
|
72
|
+
* JSON Number (Ex. 2 or 26.7)
|
|
73
|
+
*/
|
|
74
|
+
number = "number",
|
|
75
|
+
/**
|
|
76
|
+
* JSON String
|
|
77
|
+
*/
|
|
78
|
+
text = "text",
|
|
79
|
+
/**
|
|
80
|
+
* Wix Media or HTTP(S) url to an image,
|
|
81
|
+
* image://...
|
|
82
|
+
*/
|
|
83
|
+
image = "image",
|
|
84
|
+
/**
|
|
85
|
+
* JSON Boolean (true, false)
|
|
86
|
+
*/
|
|
87
|
+
boolean = "boolean",
|
|
88
|
+
/**
|
|
89
|
+
* Wix Media link to a document, in form wix:media://...
|
|
90
|
+
*/
|
|
91
|
+
document = "document",
|
|
92
|
+
/**
|
|
93
|
+
* HTTP(S) URL as a JSON String
|
|
94
|
+
*/
|
|
95
|
+
url = "url",
|
|
96
|
+
/**
|
|
97
|
+
* Email address as a JSON String
|
|
98
|
+
*/
|
|
99
|
+
email = "email",
|
|
100
|
+
/**
|
|
101
|
+
* HTML String with tags allowed in Wix RichText.
|
|
102
|
+
*/
|
|
103
|
+
richText = "richtext",
|
|
104
|
+
/**
|
|
105
|
+
* Date type represented as an object with $date attribute
|
|
106
|
+
* holding ISO 8601 string with UTC date.
|
|
107
|
+
*
|
|
108
|
+
* Example: { $date: '2018-04-01T00:00:00Z' }
|
|
109
|
+
*
|
|
110
|
+
* This will get transformed to JavaScript Date on the client side.
|
|
111
|
+
* It is similar to 'dateTime', except for the time part:
|
|
112
|
+
* time always is 00:00:00Z
|
|
113
|
+
*/
|
|
114
|
+
date = "date",
|
|
115
|
+
/**
|
|
116
|
+
* Date time type represented as an object with $date attribute
|
|
117
|
+
* holding ISO 8601 string with UTC date.
|
|
118
|
+
*
|
|
119
|
+
* Example: { $date: '2018-04-01T00:00:00Z' }
|
|
120
|
+
*
|
|
121
|
+
* This will get transformed to JavaScript Date on the client side.
|
|
122
|
+
*/
|
|
123
|
+
dateTime = "datetime",
|
|
124
|
+
/**
|
|
125
|
+
* Wix Media link to video
|
|
126
|
+
*/
|
|
127
|
+
video = "video",
|
|
128
|
+
/**
|
|
129
|
+
* String ID to referenced item.
|
|
130
|
+
*
|
|
131
|
+
* If specified in a collection together with referencedCollectionName,
|
|
132
|
+
* Wix Data will handle the includes by making additional request to
|
|
133
|
+
* included collection using hasSome filter and passing down ids of the
|
|
134
|
+
* items to be included.
|
|
135
|
+
*/
|
|
136
|
+
reference = "reference",
|
|
137
|
+
/**
|
|
138
|
+
* Multi-reference fields are not yet directly supported in DB Drivers.
|
|
139
|
+
* Consult Wix Data team before trying to use it.
|
|
140
|
+
*/
|
|
141
|
+
multiReference = "multi-reference",
|
|
142
|
+
/**
|
|
143
|
+
* Relative URL to a page in a site.
|
|
144
|
+
*/
|
|
145
|
+
pageLink = "pagelink",
|
|
146
|
+
/**
|
|
147
|
+
* JSON Object as plain JSON.
|
|
148
|
+
*/
|
|
149
|
+
object = "object",
|
|
150
|
+
/**
|
|
151
|
+
* Gallery type for binding to Pro Gallery components.
|
|
152
|
+
*/
|
|
153
|
+
mediaGallery = "media-gallery",
|
|
154
|
+
/**
|
|
155
|
+
* Address type.
|
|
156
|
+
* See https://docs.google.com/document/d/1pwZKxnBBxR1mBnJGiS6M6qSdjKd1YDJ2OAM4nHJjFS8/edit#heading=h.5ndfgx3b0knm
|
|
157
|
+
*
|
|
158
|
+
* Items should at very least contain 'formatted' property.
|
|
159
|
+
*/
|
|
160
|
+
address = "address",
|
|
161
|
+
/**
|
|
162
|
+
* Array of strings type.
|
|
163
|
+
*/
|
|
164
|
+
stringArray = "array<string>",
|
|
165
|
+
/**
|
|
166
|
+
* JSON Color Hex String
|
|
167
|
+
*/
|
|
168
|
+
color = "color",
|
|
169
|
+
/**
|
|
170
|
+
* Wix Media link to audio
|
|
171
|
+
*/
|
|
172
|
+
audio = "audio",
|
|
173
|
+
/**
|
|
174
|
+
* JSON String holding time in a following format: '00:00:00'
|
|
175
|
+
*/
|
|
176
|
+
time = "time",
|
|
177
|
+
/**
|
|
178
|
+
* Array
|
|
179
|
+
*/
|
|
180
|
+
array = "array",
|
|
181
|
+
/**
|
|
182
|
+
* RichContent type for binding to RichContentEditor/RichContentViewer components
|
|
183
|
+
* based on Ricos https://github.com/wix-incubator/rich-content
|
|
184
|
+
*/
|
|
185
|
+
richContent = "rich-content",
|
|
186
|
+
/**
|
|
187
|
+
* Text string holding language name in which row content is translated. Complies with BCP47 standard: https://tools.ietf.org/html/bcp47#appendix-A
|
|
188
|
+
*/
|
|
189
|
+
language = "language",
|
|
190
|
+
/**
|
|
191
|
+
* Array of documents, see {@link FieldType.document}
|
|
192
|
+
*/
|
|
193
|
+
documentArray = "array<document>",
|
|
194
|
+
/**
|
|
195
|
+
* Any JSON data type
|
|
196
|
+
*/
|
|
197
|
+
any = "any",
|
|
198
|
+
/**
|
|
199
|
+
* Slug type used for dynamic page URLs.
|
|
200
|
+
*/
|
|
201
|
+
slug = "slug",
|
|
202
|
+
legacyBook = "bookType",
|
|
203
|
+
legacyExternalUrl = "externalUrl",
|
|
204
|
+
legacyBrokenRef = "broken-reference",
|
|
205
|
+
legacyExternalVideo = "externalVideo",
|
|
206
|
+
legacyImage = "Image"
|
|
207
|
+
}
|
|
208
|
+
export type TextField = {
|
|
209
|
+
type: FieldType.text;
|
|
210
|
+
};
|
|
211
|
+
export type NumberField = {
|
|
212
|
+
type: FieldType.number;
|
|
213
|
+
};
|
|
214
|
+
export type DateTimeField = {
|
|
215
|
+
type: FieldType.dateTime;
|
|
216
|
+
};
|
|
217
|
+
export type DateField = {
|
|
218
|
+
type: FieldType.date;
|
|
219
|
+
};
|
|
220
|
+
export type ImageField = {
|
|
221
|
+
type: FieldType.image;
|
|
222
|
+
};
|
|
223
|
+
export type BoolField = {
|
|
224
|
+
type: FieldType.boolean;
|
|
225
|
+
};
|
|
226
|
+
export type DocumentField = {
|
|
227
|
+
type: FieldType.document;
|
|
228
|
+
};
|
|
229
|
+
export type UrlField = {
|
|
230
|
+
type: FieldType.url;
|
|
231
|
+
};
|
|
232
|
+
export type EmailField = {
|
|
233
|
+
type: FieldType.email;
|
|
234
|
+
};
|
|
235
|
+
export type RichTextField = {
|
|
236
|
+
type: FieldType.richText;
|
|
237
|
+
};
|
|
238
|
+
export type VideoField = {
|
|
239
|
+
type: FieldType.video;
|
|
240
|
+
};
|
|
241
|
+
export type PageLinkField = {
|
|
242
|
+
type: FieldType.pageLink;
|
|
243
|
+
};
|
|
244
|
+
export type MediaGalleryField = {
|
|
245
|
+
type: FieldType.mediaGallery;
|
|
246
|
+
};
|
|
247
|
+
export type AddressField = {
|
|
248
|
+
type: FieldType.address;
|
|
249
|
+
};
|
|
250
|
+
export type AnyField = {
|
|
251
|
+
type: FieldType.any;
|
|
252
|
+
};
|
|
253
|
+
export type ArrayStringField = {
|
|
254
|
+
type: FieldType.stringArray;
|
|
255
|
+
};
|
|
256
|
+
export type ArrayDocumentField = {
|
|
257
|
+
type: FieldType.documentArray;
|
|
258
|
+
};
|
|
259
|
+
export type AudioField = {
|
|
260
|
+
type: FieldType.audio;
|
|
261
|
+
};
|
|
262
|
+
export type TimeField = {
|
|
263
|
+
type: FieldType.time;
|
|
264
|
+
};
|
|
265
|
+
export type LanguageField = {
|
|
266
|
+
type: FieldType.language;
|
|
267
|
+
};
|
|
268
|
+
export type RichContentField = {
|
|
269
|
+
type: FieldType.richContent;
|
|
270
|
+
};
|
|
271
|
+
export type ColorField = {
|
|
272
|
+
type: FieldType.color;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* @member referencedCollection {string} - Denotes referenced collection name.
|
|
276
|
+
*/
|
|
277
|
+
export type ReferenceField = {
|
|
278
|
+
type: FieldType.reference;
|
|
279
|
+
referencedCollection: string;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* @member referencedCollection {string} - Denotes referenced collection name.
|
|
283
|
+
* @member referencingFieldKey {string} - Denotes the field key to represent current collection items
|
|
284
|
+
* in referenced collection.
|
|
285
|
+
* @member referencingDisplayName {string} - Defines UI-friendly name for field that represents current
|
|
286
|
+
* collection items in referenced collection. This name is used in Content Manager header and when
|
|
287
|
+
* binding to the field in Data Binding.
|
|
288
|
+
*/
|
|
289
|
+
export type MultiReferenceField = {
|
|
290
|
+
type: FieldType.multiReference;
|
|
291
|
+
referencedCollection: string;
|
|
292
|
+
referencingFieldKey: string;
|
|
293
|
+
referencingDisplayName?: string;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* @member elementType {NestedFieldSpec} - Denotes type of elements in array.
|
|
297
|
+
*/
|
|
298
|
+
export type ArrayField = {
|
|
299
|
+
type: FieldType.array;
|
|
300
|
+
elementType?: ValidNestedFieldTypes;
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* @member elementType { [fieldName: string]: NestedFieldSpec } - Denotes structure of the the object.
|
|
304
|
+
*/
|
|
305
|
+
export type ObjectField = {
|
|
306
|
+
type: FieldType.object;
|
|
307
|
+
fields?: {
|
|
308
|
+
[fieldName: string]: NestedFieldSpec;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* @member pattern {string} - Denotes pattern for generating slug values.
|
|
313
|
+
*/
|
|
314
|
+
export type SlugField = {
|
|
315
|
+
type: FieldType.slug;
|
|
316
|
+
pattern: string;
|
|
317
|
+
};
|
|
318
|
+
export declare enum AllowedFilterOperator {
|
|
319
|
+
eq = "eq",
|
|
320
|
+
ne = "ne",
|
|
321
|
+
lt = "lt",
|
|
322
|
+
lte = "lte",
|
|
323
|
+
gt = "gt",
|
|
324
|
+
gte = "gte",
|
|
325
|
+
hasSome = "hasSome",
|
|
326
|
+
hasAll = "hasAll",
|
|
327
|
+
contains = "contains",
|
|
328
|
+
startsWith = "startsWith",
|
|
329
|
+
endsWith = "endsWith",
|
|
330
|
+
urlized = "urlized",
|
|
331
|
+
exists = "exists"
|
|
332
|
+
}
|
|
333
|
+
export declare enum PageLinkType {
|
|
334
|
+
COLLECTION_DEFINED = "COLLECTION_DEFINED",
|
|
335
|
+
ROUTER_DEFINED = "ROUTER_DEFINED"
|
|
336
|
+
}
|
|
337
|
+
export declare enum FieldPermission {
|
|
338
|
+
/** No special permissions required to read the field (visitors) */
|
|
339
|
+
ANYONE = 0,
|
|
340
|
+
/**
|
|
341
|
+
* Special permissions required to read the field (members, contributors, etc.)
|
|
342
|
+
*/
|
|
343
|
+
RESTRICTED = 1
|
|
344
|
+
}
|
|
345
|
+
export type Condition = {
|
|
346
|
+
/** Conditional (requested) field enum value */
|
|
347
|
+
groupName?: string;
|
|
348
|
+
/** Who can read the field? */
|
|
349
|
+
permission: FieldPermission;
|
|
350
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldPermission = exports.PageLinkType = exports.AllowedFilterOperator = exports.FieldType = void 0;
|
|
4
|
+
var FieldType;
|
|
5
|
+
(function (FieldType) {
|
|
6
|
+
/**
|
|
7
|
+
* JSON Number (Ex. 2 or 26.7)
|
|
8
|
+
*/
|
|
9
|
+
FieldType["number"] = "number";
|
|
10
|
+
/**
|
|
11
|
+
* JSON String
|
|
12
|
+
*/
|
|
13
|
+
FieldType["text"] = "text";
|
|
14
|
+
/**
|
|
15
|
+
* Wix Media or HTTP(S) url to an image,
|
|
16
|
+
* image://...
|
|
17
|
+
*/
|
|
18
|
+
FieldType["image"] = "image";
|
|
19
|
+
/**
|
|
20
|
+
* JSON Boolean (true, false)
|
|
21
|
+
*/
|
|
22
|
+
FieldType["boolean"] = "boolean";
|
|
23
|
+
/**
|
|
24
|
+
* Wix Media link to a document, in form wix:media://...
|
|
25
|
+
*/
|
|
26
|
+
FieldType["document"] = "document";
|
|
27
|
+
/**
|
|
28
|
+
* HTTP(S) URL as a JSON String
|
|
29
|
+
*/
|
|
30
|
+
FieldType["url"] = "url";
|
|
31
|
+
/**
|
|
32
|
+
* Email address as a JSON String
|
|
33
|
+
*/
|
|
34
|
+
FieldType["email"] = "email";
|
|
35
|
+
/**
|
|
36
|
+
* HTML String with tags allowed in Wix RichText.
|
|
37
|
+
*/
|
|
38
|
+
FieldType["richText"] = "richtext";
|
|
39
|
+
/**
|
|
40
|
+
* Date type represented as an object with $date attribute
|
|
41
|
+
* holding ISO 8601 string with UTC date.
|
|
42
|
+
*
|
|
43
|
+
* Example: { $date: '2018-04-01T00:00:00Z' }
|
|
44
|
+
*
|
|
45
|
+
* This will get transformed to JavaScript Date on the client side.
|
|
46
|
+
* It is similar to 'dateTime', except for the time part:
|
|
47
|
+
* time always is 00:00:00Z
|
|
48
|
+
*/
|
|
49
|
+
FieldType["date"] = "date";
|
|
50
|
+
/**
|
|
51
|
+
* Date time type represented as an object with $date attribute
|
|
52
|
+
* holding ISO 8601 string with UTC date.
|
|
53
|
+
*
|
|
54
|
+
* Example: { $date: '2018-04-01T00:00:00Z' }
|
|
55
|
+
*
|
|
56
|
+
* This will get transformed to JavaScript Date on the client side.
|
|
57
|
+
*/
|
|
58
|
+
FieldType["dateTime"] = "datetime";
|
|
59
|
+
/**
|
|
60
|
+
* Wix Media link to video
|
|
61
|
+
*/
|
|
62
|
+
FieldType["video"] = "video";
|
|
63
|
+
/**
|
|
64
|
+
* String ID to referenced item.
|
|
65
|
+
*
|
|
66
|
+
* If specified in a collection together with referencedCollectionName,
|
|
67
|
+
* Wix Data will handle the includes by making additional request to
|
|
68
|
+
* included collection using hasSome filter and passing down ids of the
|
|
69
|
+
* items to be included.
|
|
70
|
+
*/
|
|
71
|
+
FieldType["reference"] = "reference";
|
|
72
|
+
/**
|
|
73
|
+
* Multi-reference fields are not yet directly supported in DB Drivers.
|
|
74
|
+
* Consult Wix Data team before trying to use it.
|
|
75
|
+
*/
|
|
76
|
+
FieldType["multiReference"] = "multi-reference";
|
|
77
|
+
/**
|
|
78
|
+
* Relative URL to a page in a site.
|
|
79
|
+
*/
|
|
80
|
+
FieldType["pageLink"] = "pagelink";
|
|
81
|
+
/**
|
|
82
|
+
* JSON Object as plain JSON.
|
|
83
|
+
*/
|
|
84
|
+
FieldType["object"] = "object";
|
|
85
|
+
/**
|
|
86
|
+
* Gallery type for binding to Pro Gallery components.
|
|
87
|
+
*/
|
|
88
|
+
FieldType["mediaGallery"] = "media-gallery";
|
|
89
|
+
/**
|
|
90
|
+
* Address type.
|
|
91
|
+
* See https://docs.google.com/document/d/1pwZKxnBBxR1mBnJGiS6M6qSdjKd1YDJ2OAM4nHJjFS8/edit#heading=h.5ndfgx3b0knm
|
|
92
|
+
*
|
|
93
|
+
* Items should at very least contain 'formatted' property.
|
|
94
|
+
*/
|
|
95
|
+
FieldType["address"] = "address";
|
|
96
|
+
/**
|
|
97
|
+
* Array of strings type.
|
|
98
|
+
*/
|
|
99
|
+
FieldType["stringArray"] = "array<string>";
|
|
100
|
+
/**
|
|
101
|
+
* JSON Color Hex String
|
|
102
|
+
*/
|
|
103
|
+
FieldType["color"] = "color";
|
|
104
|
+
/**
|
|
105
|
+
* Wix Media link to audio
|
|
106
|
+
*/
|
|
107
|
+
FieldType["audio"] = "audio";
|
|
108
|
+
/**
|
|
109
|
+
* JSON String holding time in a following format: '00:00:00'
|
|
110
|
+
*/
|
|
111
|
+
FieldType["time"] = "time";
|
|
112
|
+
/**
|
|
113
|
+
* Array
|
|
114
|
+
*/
|
|
115
|
+
FieldType["array"] = "array";
|
|
116
|
+
/**
|
|
117
|
+
* RichContent type for binding to RichContentEditor/RichContentViewer components
|
|
118
|
+
* based on Ricos https://github.com/wix-incubator/rich-content
|
|
119
|
+
*/
|
|
120
|
+
FieldType["richContent"] = "rich-content";
|
|
121
|
+
/**
|
|
122
|
+
* Text string holding language name in which row content is translated. Complies with BCP47 standard: https://tools.ietf.org/html/bcp47#appendix-A
|
|
123
|
+
*/
|
|
124
|
+
FieldType["language"] = "language";
|
|
125
|
+
/**
|
|
126
|
+
* Array of documents, see {@link FieldType.document}
|
|
127
|
+
*/
|
|
128
|
+
FieldType["documentArray"] = "array<document>";
|
|
129
|
+
/**
|
|
130
|
+
* Any JSON data type
|
|
131
|
+
*/
|
|
132
|
+
FieldType["any"] = "any";
|
|
133
|
+
/**
|
|
134
|
+
* Slug type used for dynamic page URLs.
|
|
135
|
+
*/
|
|
136
|
+
FieldType["slug"] = "slug";
|
|
137
|
+
FieldType["legacyBook"] = "bookType";
|
|
138
|
+
FieldType["legacyExternalUrl"] = "externalUrl";
|
|
139
|
+
FieldType["legacyBrokenRef"] = "broken-reference";
|
|
140
|
+
FieldType["legacyExternalVideo"] = "externalVideo";
|
|
141
|
+
FieldType["legacyImage"] = "Image";
|
|
142
|
+
})(FieldType = exports.FieldType || (exports.FieldType = {}));
|
|
143
|
+
var AllowedFilterOperator;
|
|
144
|
+
(function (AllowedFilterOperator) {
|
|
145
|
+
AllowedFilterOperator["eq"] = "eq";
|
|
146
|
+
AllowedFilterOperator["ne"] = "ne";
|
|
147
|
+
AllowedFilterOperator["lt"] = "lt";
|
|
148
|
+
AllowedFilterOperator["lte"] = "lte";
|
|
149
|
+
AllowedFilterOperator["gt"] = "gt";
|
|
150
|
+
AllowedFilterOperator["gte"] = "gte";
|
|
151
|
+
AllowedFilterOperator["hasSome"] = "hasSome";
|
|
152
|
+
AllowedFilterOperator["hasAll"] = "hasAll";
|
|
153
|
+
AllowedFilterOperator["contains"] = "contains";
|
|
154
|
+
AllowedFilterOperator["startsWith"] = "startsWith";
|
|
155
|
+
AllowedFilterOperator["endsWith"] = "endsWith";
|
|
156
|
+
AllowedFilterOperator["urlized"] = "urlized";
|
|
157
|
+
AllowedFilterOperator["exists"] = "exists";
|
|
158
|
+
})(AllowedFilterOperator = exports.AllowedFilterOperator || (exports.AllowedFilterOperator = {}));
|
|
159
|
+
var PageLinkType;
|
|
160
|
+
(function (PageLinkType) {
|
|
161
|
+
PageLinkType["COLLECTION_DEFINED"] = "COLLECTION_DEFINED";
|
|
162
|
+
PageLinkType["ROUTER_DEFINED"] = "ROUTER_DEFINED";
|
|
163
|
+
})(PageLinkType = exports.PageLinkType || (exports.PageLinkType = {}));
|
|
164
|
+
var FieldPermission;
|
|
165
|
+
(function (FieldPermission) {
|
|
166
|
+
/** No special permissions required to read the field (visitors) */
|
|
167
|
+
FieldPermission[FieldPermission["ANYONE"] = 0] = "ANYONE";
|
|
168
|
+
/**
|
|
169
|
+
* Special permissions required to read the field (members, contributors, etc.)
|
|
170
|
+
*/
|
|
171
|
+
FieldPermission[FieldPermission["RESTRICTED"] = 1] = "RESTRICTED";
|
|
172
|
+
})(FieldPermission = exports.FieldPermission || (exports.FieldPermission = {}));
|
|
173
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../src/field.ts"],"names":[],"mappings":";;;AA6EA,IAAY,SAwKX;AAxKD,WAAY,SAAS;IACnB;;OAEG;IACH,8BAAiB,CAAA;IAEjB;;OAEG;IACH,0BAAa,CAAA;IAEb;;;OAGG;IACH,4BAAe,CAAA;IAEf;;OAEG;IACH,gCAAmB,CAAA;IAEnB;;OAEG;IACH,kCAAqB,CAAA;IAErB;;OAEG;IACH,wBAAW,CAAA;IAEX;;OAEG;IACH,4BAAe,CAAA;IAEf;;OAEG;IACH,kCAAqB,CAAA;IAErB;;;;;;;;;OASG;IACF,0BAAa,CAAA;IAEd;;;;;;;OAOG;IACH,kCAAqB,CAAA;IAErB;;OAEG;IACH,4BAAe,CAAA;IAEf;;;;;;;OAOG;IACH,oCAAuB,CAAA;IAEvB;;;OAGG;IACH,+CAAkC,CAAA;IAElC;;OAEG;IACH,kCAAqB,CAAA;IAErB;;OAEG;IACH,8BAAiB,CAAA;IAEjB;;OAEG;IACH,2CAA8B,CAAA;IAE9B;;;;;OAKG;IACH,gCAAmB,CAAA;IAEnB;;OAEG;IACH,0CAA6B,CAAA;IAE7B;;OAEG;IACH,4BAAe,CAAA;IAEf;;OAEG;IACH,4BAAe,CAAA;IAEf;;OAEG;IACH,0BAAa,CAAA;IAEb;;OAEG;IACH,4BAAe,CAAA;IAEf;;;OAGG;IACH,yCAA4B,CAAA;IAE5B;;OAEG;IACH,kCAAqB,CAAA;IAErB;;OAEG;IACH,8CAAiC,CAAA;IAEjC;;OAEG;IACH,wBAAW,CAAA;IAEX;;OAEG;IACH,0BAAa,CAAA;IAEb,oCAAuB,CAAA;IAEvB,8CAAiC,CAAA;IAEjC,iDAAoC,CAAA;IAEpC,kDAAqC,CAAA;IAErC,kCAAqB,CAAA;AACvB,CAAC,EAxKW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAwKpB;AAwED,IAAY,qBAcX;AAdD,WAAY,qBAAqB;IAC/B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,oCAAW,CAAA;IACX,kCAAS,CAAA;IACT,oCAAW,CAAA;IACX,4CAAmB,CAAA;IACnB,0CAAiB,CAAA;IACjB,8CAAqB,CAAA;IACrB,kDAAyB,CAAA;IACzB,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,0CAAiB,CAAA;AACnB,CAAC,EAdW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAchC;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,yDAAyC,CAAA;IACzC,iDAAiC,CAAA;AACnC,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,mEAAmE;IACnE,yDAAM,CAAA;IAEN;;OAEG;IACH,iEAAU,CAAA;AACZ,CAAC,EARW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAQ1B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const CMS_FIELD_PLUGIN_ID = "cms";
|
|
2
|
+
export interface CmsFieldPlugin {
|
|
3
|
+
internal: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const CATEGORY_FIELD_PLUGIN_ID = "categoryField";
|
|
6
|
+
export interface CategoryFieldPlugin {
|
|
7
|
+
isPrimary: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const PRIMARY_CATEGORY_FIELD_PLUGIN_ID = "primaryCategoryField";
|
|
10
|
+
export interface PrimaryCategoryFieldPlugin {
|
|
11
|
+
}
|
|
12
|
+
export declare const CATEGORY_CONSUMER_FIELD_PLUGIN_ID = "categoryConsumer";
|
|
13
|
+
export interface CategoryConsumerFieldPlugin {
|
|
14
|
+
}
|
|
15
|
+
export interface KnownFieldPlugins {
|
|
16
|
+
[CMS_FIELD_PLUGIN_ID]?: CmsFieldPlugin;
|
|
17
|
+
[CATEGORY_FIELD_PLUGIN_ID]?: CategoryFieldPlugin;
|
|
18
|
+
[PRIMARY_CATEGORY_FIELD_PLUGIN_ID]?: PrimaryCategoryFieldPlugin;
|
|
19
|
+
[CATEGORY_CONSUMER_FIELD_PLUGIN_ID]?: CategoryConsumerFieldPlugin;
|
|
20
|
+
}
|
|
21
|
+
export type FieldPlugins = KnownFieldPlugins & Record<string, object>;
|
|
22
|
+
export type FieldPluginId = keyof KnownFieldPlugins;
|
|
23
|
+
export type FieldPlugin = Required<KnownFieldPlugins>[FieldPluginId];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CATEGORY_CONSUMER_FIELD_PLUGIN_ID = exports.PRIMARY_CATEGORY_FIELD_PLUGIN_ID = exports.CATEGORY_FIELD_PLUGIN_ID = exports.CMS_FIELD_PLUGIN_ID = void 0;
|
|
4
|
+
exports.CMS_FIELD_PLUGIN_ID = 'cms';
|
|
5
|
+
exports.CATEGORY_FIELD_PLUGIN_ID = 'categoryField';
|
|
6
|
+
exports.PRIMARY_CATEGORY_FIELD_PLUGIN_ID = 'primaryCategoryField';
|
|
7
|
+
exports.CATEGORY_CONSUMER_FIELD_PLUGIN_ID = 'categoryConsumer';
|
|
8
|
+
//# sourceMappingURL=fieldPlugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldPlugins.js","sourceRoot":"","sources":["../src/fieldPlugins.ts"],"names":[],"mappings":";;;AACa,QAAA,mBAAmB,GAAG,KAAK,CAAA;AAM3B,QAAA,wBAAwB,GAAG,eAAe,CAAA;AAK1C,QAAA,gCAAgC,GAAG,sBAAsB,CAAA;AAGzD,QAAA,iCAAiC,GAAG,kBAAkB,CAAA"}
|