beanbagdb 0.5.80 → 0.6.1
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/package.json +1 -1
- package/src/index.js +214 -117
- package/src/system_schema.js +251 -151
- package/test/operations.test.js +266 -589
- package/test/pouchdb.js +69 -22
- package/src/plugins/text_command.js +0 -191
- package/test/plugin.test.js +0 -52
package/src/system_schema.js
CHANGED
|
@@ -1,138 +1,160 @@
|
|
|
1
1
|
export const default_app = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
description:
|
|
2
|
+
app_id: "beanbagdb_system",
|
|
3
|
+
meta: {
|
|
4
|
+
description:
|
|
5
|
+
"This is the default system app required for proper functioning of the database",
|
|
5
6
|
},
|
|
6
|
-
schemas:[
|
|
7
|
+
schemas: [
|
|
7
8
|
{
|
|
8
9
|
name: "schema",
|
|
9
|
-
active:true,
|
|
10
|
-
description:"Meta-schema or the schema for defining other schemas",
|
|
11
|
-
system_generated:true,
|
|
12
|
-
version:0.
|
|
13
|
-
title:"Schema document",
|
|
10
|
+
active: true,
|
|
11
|
+
description: "Meta-schema or the schema for defining other schemas",
|
|
12
|
+
system_generated: true,
|
|
13
|
+
version: 0.88,
|
|
14
|
+
title: "Schema document",
|
|
14
15
|
schema: {
|
|
15
16
|
type: "object",
|
|
16
17
|
additionalProperties: false,
|
|
17
18
|
properties: {
|
|
18
|
-
system_generated:{
|
|
19
|
-
title:"System generated schema",
|
|
20
|
-
type:"boolean",
|
|
21
|
-
default:false
|
|
19
|
+
system_generated: {
|
|
20
|
+
title: "System generated schema",
|
|
21
|
+
type: "boolean",
|
|
22
|
+
default: false,
|
|
22
23
|
},
|
|
23
|
-
active:{
|
|
24
|
-
title:"
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
active: {
|
|
25
|
+
title:"Active",
|
|
26
|
+
description: "This indicates where new documents can be created using this schema or not. Old documents can still be edited",
|
|
27
|
+
type: "boolean",
|
|
28
|
+
default: false,
|
|
27
29
|
},
|
|
28
30
|
version: {
|
|
29
31
|
type: "number",
|
|
30
|
-
title:"Version",
|
|
32
|
+
title: "Version",
|
|
31
33
|
minimum: 0,
|
|
32
34
|
default: 1,
|
|
33
|
-
description:
|
|
34
|
-
|
|
35
|
+
description:
|
|
36
|
+
"This is an optional field.To be used primarily for system schemas",
|
|
37
|
+
},
|
|
35
38
|
name: {
|
|
36
39
|
type: "string",
|
|
37
|
-
title:"Name",
|
|
40
|
+
title: "Name",
|
|
38
41
|
minLength: 4,
|
|
39
42
|
maxLength: 50,
|
|
40
43
|
pattern: "^[a-zA-Z][a-zA-Z0-9_]*$",
|
|
41
|
-
description:
|
|
44
|
+
description:
|
|
45
|
+
"This is the name of the schema.It cannot be changed later",
|
|
42
46
|
},
|
|
43
|
-
title:{
|
|
44
|
-
type:"string",
|
|
45
|
-
title:"Title",
|
|
46
|
-
minLength:0,
|
|
47
|
-
maxLength:1000,
|
|
48
|
-
description:"A title to display with records."
|
|
47
|
+
title: {
|
|
48
|
+
type: "string",
|
|
49
|
+
title: "Title",
|
|
50
|
+
minLength: 0,
|
|
51
|
+
maxLength: 1000,
|
|
52
|
+
description: "A title to display with records.",
|
|
49
53
|
},
|
|
50
|
-
description:{
|
|
51
|
-
type:"string",
|
|
52
|
-
title:"About",
|
|
53
|
-
minLength:0,
|
|
54
|
-
maxLength:1000,
|
|
55
|
-
description:
|
|
54
|
+
description: {
|
|
55
|
+
type: "string",
|
|
56
|
+
title: "About",
|
|
57
|
+
minLength: 0,
|
|
58
|
+
maxLength: 1000,
|
|
59
|
+
description:
|
|
60
|
+
"A small description of what data in this schema stores.",
|
|
56
61
|
},
|
|
57
62
|
schema: {
|
|
58
63
|
type: "object",
|
|
59
|
-
title:"JSON Schema specification",
|
|
64
|
+
title: "JSON Schema specification",
|
|
60
65
|
additionalProperties: true,
|
|
61
66
|
minProperties: 1,
|
|
62
67
|
maxProperties: 50,
|
|
63
|
-
description:
|
|
64
|
-
|
|
68
|
+
description:
|
|
69
|
+
"This must be a valid JSON Schema which will be used to validate documents created with this schema.See this https://tour.json-schema.org/",
|
|
70
|
+
default: {},
|
|
65
71
|
},
|
|
66
72
|
settings: {
|
|
67
73
|
type: "object",
|
|
68
|
-
title:"Additional Settings",
|
|
74
|
+
title: "Additional Settings",
|
|
69
75
|
additionalProperties: true,
|
|
70
76
|
properties: {
|
|
71
77
|
primary_keys: {
|
|
72
|
-
title:"Primary key",
|
|
78
|
+
title: "Primary key",
|
|
73
79
|
type: "array",
|
|
74
80
|
default: [],
|
|
75
81
|
items: {
|
|
76
82
|
type: "string",
|
|
77
83
|
},
|
|
78
84
|
maxItems: 10,
|
|
79
|
-
description:
|
|
85
|
+
description:
|
|
86
|
+
"Fields that makes each document unique in the schema.Leave it blank if you do not need it. You can still be able to distinguish documents using the link field and the document id.",
|
|
80
87
|
},
|
|
81
88
|
non_editable_fields: {
|
|
82
89
|
type: "array",
|
|
83
|
-
title:"Non editable fields",
|
|
90
|
+
title: "Non editable fields",
|
|
84
91
|
default: [],
|
|
85
92
|
items: {
|
|
86
93
|
type: "string",
|
|
87
94
|
},
|
|
88
95
|
maxItems: 50,
|
|
89
|
-
minItems:0,
|
|
90
|
-
description:
|
|
96
|
+
minItems: 0,
|
|
97
|
+
description:
|
|
98
|
+
"The list of fields whose values are added when the document is created but cannot be edited later in future.",
|
|
91
99
|
},
|
|
92
100
|
encrypted_fields: {
|
|
93
101
|
type: "array",
|
|
94
|
-
title:"List of fields encrypted",
|
|
102
|
+
title: "List of fields encrypted",
|
|
95
103
|
default: [],
|
|
96
104
|
items: {
|
|
97
105
|
type: "string",
|
|
98
106
|
},
|
|
99
107
|
maxItems: 50,
|
|
100
|
-
description:
|
|
108
|
+
description:
|
|
109
|
+
"Once set, all the data in this field will be encrypted before storing it in the database. Encryption key must be provided during the time of BeanBagDB initialization and must be managed by the user as it is NOT stored in the database",
|
|
101
110
|
},
|
|
102
111
|
display_fields: {
|
|
103
112
|
type: "array",
|
|
104
|
-
title:"List of fields to show in short view",
|
|
113
|
+
title: "List of fields to show in short view",
|
|
105
114
|
default: [],
|
|
106
115
|
items: {
|
|
107
116
|
type: "string",
|
|
108
117
|
},
|
|
109
118
|
maxItems: 50,
|
|
110
|
-
description:
|
|
111
|
-
|
|
119
|
+
description:
|
|
120
|
+
"These fields will be used when a record is displayed in short",
|
|
121
|
+
},
|
|
122
|
+
install_source: {
|
|
123
|
+
type: "string",
|
|
124
|
+
title: "Installation source",
|
|
125
|
+
default: "human",
|
|
126
|
+
description:
|
|
127
|
+
"Describes how this schema was installed in database. This is determined by the system. By default the value is human. Possible value: name of the app , where it was cloned from etc...",
|
|
128
|
+
},
|
|
112
129
|
},
|
|
113
|
-
required
|
|
130
|
+
required: [
|
|
131
|
+
"primary_keys",
|
|
132
|
+
"non_editable_fields",
|
|
133
|
+
"encrypted_fields",
|
|
134
|
+
],
|
|
114
135
|
},
|
|
115
136
|
},
|
|
116
|
-
required: ["name","description","schema", "settings","title"],
|
|
137
|
+
required: ["name", "description", "schema", "settings", "title"],
|
|
117
138
|
},
|
|
118
139
|
settings: {
|
|
119
140
|
primary_keys: ["name"],
|
|
120
|
-
non_editable_fields:["system_generated"],
|
|
121
|
-
encrypted_fields:[],
|
|
122
|
-
display_fields:["name","version","description","title","active"]
|
|
141
|
+
non_editable_fields: ["system_generated"],
|
|
142
|
+
encrypted_fields: [],
|
|
143
|
+
display_fields: ["name", "version", "description", "title", "active"],
|
|
123
144
|
},
|
|
124
145
|
},
|
|
125
146
|
{
|
|
126
|
-
system_generated:true,
|
|
127
|
-
version:0.63,
|
|
128
|
-
description:
|
|
147
|
+
system_generated: true,
|
|
148
|
+
version: 0.63,
|
|
149
|
+
description:
|
|
150
|
+
"To store user defined key. this can include anything like API tokens etc. There is a special method to fetch this. The values are encrypted",
|
|
129
151
|
name: "system_key",
|
|
130
|
-
title:"System key",
|
|
131
|
-
active:true,
|
|
152
|
+
title: "System key",
|
|
153
|
+
active: true,
|
|
132
154
|
schema: {
|
|
133
155
|
type: "object",
|
|
134
156
|
additionalProperties: true,
|
|
135
|
-
required:["name","value"],
|
|
157
|
+
required: ["name", "value"],
|
|
136
158
|
properties: {
|
|
137
159
|
name: {
|
|
138
160
|
type: "string",
|
|
@@ -145,7 +167,7 @@ export const default_app = {
|
|
|
145
167
|
minLength: 5,
|
|
146
168
|
maxLength: 5000,
|
|
147
169
|
pattern: "^[^\n\r]*$",
|
|
148
|
-
description:"Must be a single line string"
|
|
170
|
+
description: "Must be a single line string",
|
|
149
171
|
},
|
|
150
172
|
note: {
|
|
151
173
|
type: "string",
|
|
@@ -156,19 +178,20 @@ export const default_app = {
|
|
|
156
178
|
},
|
|
157
179
|
settings: {
|
|
158
180
|
primary_keys: ["name"],
|
|
159
|
-
encrypted_fields:["value"],
|
|
160
|
-
non_editable_fields:[]
|
|
181
|
+
encrypted_fields: ["value"],
|
|
182
|
+
non_editable_fields: [],
|
|
161
183
|
},
|
|
162
184
|
},
|
|
163
185
|
{
|
|
164
|
-
version:0.67,
|
|
165
|
-
system_generated:true,
|
|
166
|
-
description:
|
|
186
|
+
version: 0.67,
|
|
187
|
+
system_generated: true,
|
|
188
|
+
description:
|
|
189
|
+
"The system relies on these settings for proper functioning or enabling optional features.",
|
|
167
190
|
name: "system_setting",
|
|
168
|
-
title:"System Setting",
|
|
169
|
-
active:true,
|
|
191
|
+
title: "System Setting",
|
|
192
|
+
active: true,
|
|
170
193
|
schema: {
|
|
171
|
-
required:["name","value"],
|
|
194
|
+
required: ["name", "value"],
|
|
172
195
|
type: "object",
|
|
173
196
|
additionalProperties: true,
|
|
174
197
|
properties: {
|
|
@@ -179,81 +202,84 @@ export const default_app = {
|
|
|
179
202
|
pattern: "^[a-zA-Z][a-zA-Z0-9_]*$",
|
|
180
203
|
},
|
|
181
204
|
value: {
|
|
182
|
-
type: ["array","object"]
|
|
183
|
-
}
|
|
205
|
+
type: ["array", "object"],
|
|
206
|
+
},
|
|
184
207
|
},
|
|
185
208
|
},
|
|
186
209
|
settings: {
|
|
187
210
|
primary_keys: ["name"],
|
|
188
211
|
non_editable_fields: ["name"],
|
|
189
|
-
encrypted_fields:[]
|
|
212
|
+
encrypted_fields: [],
|
|
190
213
|
},
|
|
191
214
|
},
|
|
192
215
|
{
|
|
193
|
-
name:"system_edge_constraint",
|
|
194
|
-
title:"Edge constraint",
|
|
195
|
-
system_generated:true,
|
|
196
|
-
active:true,
|
|
197
|
-
version:0.52,
|
|
198
|
-
description:
|
|
199
|
-
|
|
216
|
+
name: "system_edge_constraint",
|
|
217
|
+
title: "Edge constraint",
|
|
218
|
+
system_generated: true,
|
|
219
|
+
active: true,
|
|
220
|
+
version: 0.52,
|
|
221
|
+
description:
|
|
222
|
+
"To define edge constraints for simple directed graph of records.",
|
|
223
|
+
schema: {
|
|
200
224
|
type: "object",
|
|
201
225
|
additionalProperties: true,
|
|
202
|
-
required:["node1","node2","edge_type"],
|
|
226
|
+
required: ["node1", "node2", "edge_type"],
|
|
203
227
|
properties: {
|
|
204
228
|
node1: {
|
|
205
229
|
type: "string",
|
|
206
230
|
minLength: 1,
|
|
207
231
|
maxLength: 500,
|
|
208
|
-
pattern:
|
|
232
|
+
pattern:
|
|
233
|
+
"^(\\*|(\\*-[a-zA-Z0-9_-]+)(,[a-zA-Z0-9_-]+)*|[a-zA-Z0-9_-]+(,[a-zA-Z0-9_-]+)*)$",
|
|
209
234
|
},
|
|
210
235
|
node2: {
|
|
211
236
|
type: "string",
|
|
212
237
|
minLength: 1,
|
|
213
238
|
maxLength: 500,
|
|
214
|
-
pattern:
|
|
239
|
+
pattern:
|
|
240
|
+
"^(\\*|(\\*-[a-zA-Z0-9_-]+)(,[a-zA-Z0-9_-]+)*|[a-zA-Z0-9_-]+(,[a-zA-Z0-9_-]+)*)$",
|
|
215
241
|
},
|
|
216
|
-
name:{
|
|
242
|
+
name: {
|
|
217
243
|
type: "string",
|
|
218
244
|
minLength: 1,
|
|
219
245
|
maxLength: 500,
|
|
220
246
|
pattern: "^[a-zA-Z][a-zA-Z0-9_]*$",
|
|
221
247
|
},
|
|
222
|
-
label:{
|
|
248
|
+
label: {
|
|
223
249
|
type: "string",
|
|
224
250
|
maxLength: 500,
|
|
225
251
|
},
|
|
226
|
-
note:{
|
|
252
|
+
note: {
|
|
227
253
|
type: "string",
|
|
228
254
|
maxLength: 5000,
|
|
229
255
|
},
|
|
230
|
-
max_from_node1:{
|
|
231
|
-
type:"number",
|
|
256
|
+
max_from_node1: {
|
|
257
|
+
type: "number",
|
|
232
258
|
default: -1,
|
|
233
259
|
},
|
|
234
|
-
max_to_node2:{
|
|
235
|
-
type:"number",
|
|
260
|
+
max_to_node2: {
|
|
261
|
+
type: "number",
|
|
236
262
|
default: -1,
|
|
237
|
-
}
|
|
238
|
-
}
|
|
263
|
+
},
|
|
264
|
+
},
|
|
239
265
|
},
|
|
240
266
|
settings: {
|
|
241
267
|
primary_keys: ["name"],
|
|
242
|
-
non_editable_fields:["name"],
|
|
243
|
-
encrypted_fields:[]
|
|
268
|
+
non_editable_fields: ["name"],
|
|
269
|
+
encrypted_fields: [],
|
|
244
270
|
},
|
|
245
271
|
},
|
|
246
272
|
{
|
|
247
|
-
name:"system_edge",
|
|
248
|
-
title:"Edge in the system graph",
|
|
249
|
-
active:true,
|
|
250
|
-
system_generated:true,
|
|
251
|
-
version:0.52,
|
|
273
|
+
name: "system_edge",
|
|
274
|
+
title: "Edge in the system graph",
|
|
275
|
+
active: true,
|
|
276
|
+
system_generated: true,
|
|
277
|
+
version: 0.52,
|
|
252
278
|
description: "To define edges in the simple directed graph of records.",
|
|
253
|
-
schema:{
|
|
279
|
+
schema: {
|
|
254
280
|
type: "object",
|
|
255
281
|
additionalProperties: true,
|
|
256
|
-
required:["node1","node2","edge_type"],
|
|
282
|
+
required: ["node1", "node2", "edge_type"],
|
|
257
283
|
properties: {
|
|
258
284
|
node1: {
|
|
259
285
|
type: "string",
|
|
@@ -261,60 +287,60 @@ export const default_app = {
|
|
|
261
287
|
node2: {
|
|
262
288
|
type: "string",
|
|
263
289
|
},
|
|
264
|
-
edge_name:{
|
|
290
|
+
edge_name: {
|
|
265
291
|
type: "string",
|
|
266
|
-
}
|
|
267
|
-
}
|
|
292
|
+
},
|
|
293
|
+
},
|
|
268
294
|
},
|
|
269
295
|
settings: {
|
|
270
|
-
primary_keys: ["node1","node2","edge_type"],
|
|
271
|
-
non_editable_fields:["edge_type"],
|
|
272
|
-
encrypted_fields:[]
|
|
296
|
+
primary_keys: ["node1", "node2", "edge_type"],
|
|
297
|
+
non_editable_fields: ["edge_type"],
|
|
298
|
+
encrypted_fields: [],
|
|
273
299
|
},
|
|
274
300
|
},
|
|
275
301
|
{
|
|
276
|
-
name:"system_media",
|
|
277
|
-
title:"Media content",
|
|
278
|
-
active:true,
|
|
279
|
-
system_generated:true,
|
|
280
|
-
version:0.62,
|
|
302
|
+
name: "system_media",
|
|
303
|
+
title: "Media content",
|
|
304
|
+
active: true,
|
|
305
|
+
system_generated: true,
|
|
306
|
+
version: 0.62,
|
|
281
307
|
description: "To store images as Base64",
|
|
282
|
-
schema:{
|
|
308
|
+
schema: {
|
|
283
309
|
type: "object",
|
|
284
310
|
additionalProperties: true,
|
|
285
|
-
required:["imageBase64","caption","source"],
|
|
311
|
+
required: ["imageBase64", "caption", "source"],
|
|
286
312
|
properties: {
|
|
287
313
|
imageBase64: {
|
|
288
314
|
type: "string",
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
315
|
+
media: {
|
|
316
|
+
binaryEncoding: "base64",
|
|
317
|
+
},
|
|
292
318
|
},
|
|
293
319
|
caption: {
|
|
294
320
|
type: "string",
|
|
295
321
|
},
|
|
296
|
-
source:{
|
|
322
|
+
source: {
|
|
297
323
|
type: "string",
|
|
298
|
-
}
|
|
299
|
-
}
|
|
324
|
+
},
|
|
325
|
+
},
|
|
300
326
|
},
|
|
301
327
|
settings: {
|
|
302
328
|
primary_keys: ["caption"],
|
|
303
|
-
non_editable_fields:[],
|
|
304
|
-
encrypted_fields:[]
|
|
329
|
+
non_editable_fields: [],
|
|
330
|
+
encrypted_fields: [],
|
|
305
331
|
},
|
|
306
332
|
},
|
|
307
333
|
{
|
|
308
|
-
name:"system_log",
|
|
309
|
-
system_generated:true,
|
|
310
|
-
title:"System log",
|
|
311
|
-
active:true,
|
|
312
|
-
version:0.52,
|
|
334
|
+
name: "system_log",
|
|
335
|
+
system_generated: true,
|
|
336
|
+
title: "System log",
|
|
337
|
+
active: true,
|
|
338
|
+
version: 0.52,
|
|
313
339
|
description: "To define edges in the simple directed graph of records.",
|
|
314
|
-
schema:{
|
|
340
|
+
schema: {
|
|
315
341
|
type: "object",
|
|
316
342
|
additionalProperties: true,
|
|
317
|
-
required:["text"],
|
|
343
|
+
required: ["text"],
|
|
318
344
|
properties: {
|
|
319
345
|
text: {
|
|
320
346
|
type: "string",
|
|
@@ -323,42 +349,116 @@ export const default_app = {
|
|
|
323
349
|
type: "object",
|
|
324
350
|
additionalProperties: true,
|
|
325
351
|
},
|
|
326
|
-
app:{
|
|
352
|
+
app: {
|
|
327
353
|
type: "string",
|
|
328
354
|
},
|
|
329
|
-
time:{
|
|
330
|
-
type:"string"
|
|
355
|
+
time: {
|
|
356
|
+
type: "string",
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
settings: {
|
|
361
|
+
primary_keys: [],
|
|
362
|
+
non_editable_fields: [],
|
|
363
|
+
encrypted_fields: [],
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: "system_script",
|
|
368
|
+
system_generated: true,
|
|
369
|
+
title: "Executable script",
|
|
370
|
+
active: true,
|
|
371
|
+
version: 0.1,
|
|
372
|
+
description: "To create scripts that implement some logic. Can run both on browser and client.",
|
|
373
|
+
schema: {
|
|
374
|
+
type: "object",
|
|
375
|
+
additionalProperties: true,
|
|
376
|
+
required: ["script","type","version"],
|
|
377
|
+
properties: {
|
|
378
|
+
type: {
|
|
379
|
+
type: "string",
|
|
380
|
+
default:"JS"
|
|
381
|
+
},
|
|
382
|
+
script: {
|
|
383
|
+
type: "string",
|
|
384
|
+
description:"The script",
|
|
385
|
+
default:""
|
|
386
|
+
},
|
|
387
|
+
usage:{
|
|
388
|
+
type:"string",
|
|
389
|
+
description:"Documentation",
|
|
390
|
+
default:" "
|
|
391
|
+
},
|
|
392
|
+
version :{
|
|
393
|
+
type:"number",
|
|
394
|
+
default:0.1
|
|
395
|
+
},
|
|
396
|
+
log_execution:{
|
|
397
|
+
type:"boolean",
|
|
398
|
+
default:false
|
|
331
399
|
}
|
|
332
|
-
}
|
|
400
|
+
},
|
|
333
401
|
},
|
|
334
402
|
settings: {
|
|
335
403
|
primary_keys: [],
|
|
336
|
-
non_editable_fields:[],
|
|
337
|
-
encrypted_fields:[]
|
|
404
|
+
non_editable_fields: [],
|
|
405
|
+
encrypted_fields: [],
|
|
338
406
|
},
|
|
339
|
-
}
|
|
340
|
-
],
|
|
341
|
-
records:[]
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
407
|
+
},
|
|
408
|
+
],
|
|
409
|
+
records: [],
|
|
410
|
+
};
|
|
345
411
|
|
|
346
412
|
// this is not stored in the DB. only for validating the metadata during doc update
|
|
347
413
|
export const editable_metadata_schema = {
|
|
348
414
|
additionalProperties: false,
|
|
349
|
-
type:"object",
|
|
350
|
-
properties:{
|
|
351
|
-
tags:{
|
|
352
|
-
type:"array",
|
|
353
|
-
items:{type:"string"},
|
|
354
|
-
default:[],
|
|
415
|
+
type: "object",
|
|
416
|
+
properties: {
|
|
417
|
+
tags: {
|
|
418
|
+
type: "array",
|
|
419
|
+
items: { type: "string" },
|
|
420
|
+
default: [],
|
|
355
421
|
maxItems: 40,
|
|
356
422
|
},
|
|
357
|
-
link:{
|
|
423
|
+
link: {
|
|
424
|
+
type: "string",
|
|
425
|
+
minLength: 2,
|
|
426
|
+
maxLength: 2000,
|
|
427
|
+
pattern: "^[a-zA-Z0-9-]+$",
|
|
428
|
+
},
|
|
429
|
+
title:{
|
|
358
430
|
type:"string",
|
|
359
|
-
|
|
360
|
-
maxLength:2000,
|
|
361
|
-
pattern: "^[a-zA-Z0-9-]+$"
|
|
431
|
+
maxLength:10000
|
|
362
432
|
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
export const app_data_schema = {
|
|
437
|
+
additionalProperties: true,
|
|
438
|
+
type: "object",
|
|
439
|
+
required: ["app_id"],
|
|
440
|
+
properties: {
|
|
441
|
+
app_id: {
|
|
442
|
+
type: "string",
|
|
443
|
+
},
|
|
444
|
+
meta: {
|
|
445
|
+
type: "object",
|
|
446
|
+
additionalProperties: true,
|
|
447
|
+
},
|
|
448
|
+
schemas: {
|
|
449
|
+
type: "array",
|
|
450
|
+
minItems: 1,
|
|
451
|
+
// each schema must have a version
|
|
452
|
+
},
|
|
453
|
+
records: {
|
|
454
|
+
type: "array",
|
|
455
|
+
// each record must have a version
|
|
456
|
+
default:[]
|
|
457
|
+
},
|
|
458
|
+
default_setting:{
|
|
459
|
+
type: "object",
|
|
460
|
+
additionalProperties:true,
|
|
461
|
+
default : {}
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
};
|