@mdbase-dev/connect-protocol 0.1.0-beta.100

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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/dist/application-authorization.d.ts +32 -0
  3. package/dist/application-authorization.js +207 -0
  4. package/dist/capabilities.d.ts +73 -0
  5. package/dist/capabilities.js +92 -0
  6. package/dist/collection-setup.d.ts +90 -0
  7. package/dist/collection-setup.js +1 -0
  8. package/dist/compatibility.d.ts +37 -0
  9. package/dist/compatibility.js +65 -0
  10. package/dist/connect-problems.generated.d.ts +1388 -0
  11. package/dist/connect-problems.generated.js +574 -0
  12. package/dist/files.d.ts +269 -0
  13. package/dist/files.js +426 -0
  14. package/dist/index.d.ts +878 -0
  15. package/dist/index.js +94 -0
  16. package/dist/manifest.d.ts +62 -0
  17. package/dist/manifest.js +527 -0
  18. package/dist/mutation-fingerprint.d.ts +6 -0
  19. package/dist/mutation-fingerprint.js +116 -0
  20. package/dist/operations.d.ts +15 -0
  21. package/dist/operations.js +194 -0
  22. package/dist/type-packs.d.ts +133 -0
  23. package/dist/type-packs.js +30 -0
  24. package/package.json +42 -0
  25. package/schemas/application-capability-catalog.v1.json +40 -0
  26. package/schemas/application-capability-catalog.v2.json +68 -0
  27. package/schemas/catalog.json +17 -0
  28. package/schemas/connect-problem.v1.schema.json +5132 -0
  29. package/schemas/connect-problems.v1.catalog.json +351 -0
  30. package/schemas/connect-protocol.v1.schema.json +800 -0
  31. package/schemas/data-contract.schema.json +163 -0
  32. package/schemas/encrypted-relay.v1.schema.json +63 -0
  33. package/schemas/encrypted-relay.v2.schema.json +63 -0
  34. package/schemas/encrypted-relay.v3.schema.json +64 -0
  35. package/schemas/files.v1.schema.json +507 -0
  36. package/schemas/interop/v0.1/action-cancellation.schema.json +6 -0
  37. package/schemas/interop/v0.1/action-invocation.schema.json +6 -0
  38. package/schemas/interop/v0.1/action-outcome.schema.json +6 -0
  39. package/schemas/interop/v0.1/action-provider-declaration.schema.json +6 -0
  40. package/schemas/interop/v0.1/action-request.schema.json +6 -0
  41. package/schemas/interop/v0.1/conformance-claim.schema.json +6 -0
  42. package/schemas/interop/v0.1/event-source-declaration.schema.json +6 -0
  43. package/schemas/interop/v0.1/event.schema.json +6 -0
  44. package/schemas/interop/v0.1/profile.schema.json +456 -0
  45. package/schemas/mdbase-app.legacy-v1.schema.json +405 -0
  46. package/schemas/mdbase-app.schema.json +381 -0
  47. package/schemas/mdbase-query.v0.3.schema.json +171 -0
  48. package/schemas/notification-webhook.v1.schema.json +56 -0
  49. package/schemas/operation-catalog.v1.json +42 -0
  50. package/schemas/operation-mutation-classification.v1.json +537 -0
  51. package/schemas/sync.v1.schema.json +483 -0
@@ -0,0 +1,405 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/connect/schemas/mdbase-app.legacy-v1.json",
4
+ "title": "mdbase connect bundled application manifest v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["manifest_version", "id", "name"],
8
+ "properties": {
9
+ "manifest_version": { "const": 1 },
10
+ "distribution": {
11
+ "enum": ["web", "portable"],
12
+ "description": "Portable declarations use device authorization and do not claim a browser origin."
13
+ },
14
+ "id": {
15
+ "type": "string",
16
+ "minLength": 5,
17
+ "maxLength": 150,
18
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*){2,}$",
19
+ "description": "Stable reverse-domain application identifier. This is presentation metadata, not publisher authentication."
20
+ },
21
+ "name": { "type": "string", "minLength": 1, "maxLength": 100 },
22
+ "homepage": { "type": "string", "format": "uri", "pattern": "^https://" },
23
+ "project_url": { "type": "string", "format": "uri", "pattern": "^https://" },
24
+ "icon": { "type": "string", "format": "uri", "pattern": "^https://" },
25
+ "redirect_uris": {
26
+ "type": "array",
27
+ "minItems": 1,
28
+ "maxItems": 10,
29
+ "uniqueItems": true,
30
+ "items": {
31
+ "type": "string",
32
+ "format": "uri",
33
+ "description": "An HTTPS URI on the homepage origin or a private-use scheme derived from the application ID."
34
+ }
35
+ },
36
+ "requirements": { "$ref": "#/$defs/requirements" },
37
+ "provisions": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": ["type_packs"],
41
+ "properties": {
42
+ "configuration": {
43
+ "type": "array",
44
+ "maxItems": 50,
45
+ "items": { "$ref": "#/$defs/configurationProvision" }
46
+ },
47
+ "type_packs": {
48
+ "type": "array",
49
+ "maxItems": 20,
50
+ "items": { "$ref": "#/$defs/typePackProvision" }
51
+ }
52
+ }
53
+ },
54
+ "notifications": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["criteria"],
58
+ "properties": {
59
+ "criteria": {
60
+ "type": "array",
61
+ "maxItems": 50,
62
+ "items": { "$ref": "#/$defs/notificationCriterion" }
63
+ },
64
+ "native_delivery": { "$ref": "#/$defs/nativeNotificationDelivery" }
65
+ }
66
+ }
67
+ },
68
+ "oneOf": [
69
+ {
70
+ "required": ["homepage", "redirect_uris"],
71
+ "properties": {
72
+ "distribution": { "const": "web" },
73
+ "homepage": true,
74
+ "redirect_uris": true,
75
+ "project_url": false
76
+ }
77
+ },
78
+ {
79
+ "required": ["distribution"],
80
+ "properties": {
81
+ "distribution": { "const": "portable" },
82
+ "homepage": false,
83
+ "redirect_uris": false
84
+ }
85
+ }
86
+ ],
87
+ "$defs": {
88
+ "identifier": {
89
+ "type": "string",
90
+ "minLength": 1,
91
+ "maxLength": 100,
92
+ "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
93
+ },
94
+ "duration": {
95
+ "type": "string",
96
+ "pattern": "^[0-9]+(ms|s|m|h|d)$"
97
+ },
98
+ "contract": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["id", "version", "digest"],
102
+ "properties": {
103
+ "id": { "$ref": "#/$defs/identifier" },
104
+ "version": {
105
+ "type": "string",
106
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
107
+ },
108
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
109
+ }
110
+ },
111
+ "requirements": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": ["access", "contracts"],
115
+ "properties": {
116
+ "capabilities": { "$ref": "#/$defs/capabilityRequirements" },
117
+ "access": {
118
+ "const": "full_collection",
119
+ "description": "Compatibility declaration for collection-level application authorization."
120
+ },
121
+ "collection_kind": {
122
+ "const": "hosted",
123
+ "description": "Require a durable provider-backed collection with direct sync support."
124
+ },
125
+ "files": { "$ref": "#/$defs/fileRequirement" },
126
+ "configuration": {
127
+ "type": "array",
128
+ "maxItems": 50,
129
+ "items": { "$ref": "#/$defs/configurationRequirement" }
130
+ },
131
+ "contracts": {
132
+ "type": "array",
133
+ "maxItems": 20,
134
+ "uniqueItems": true,
135
+ "items": { "$ref": "#/$defs/contract" }
136
+ }
137
+ }
138
+ },
139
+ "capabilityRequirements": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": ["contract_version", "required"],
143
+ "properties": {
144
+ "contract_version": { "const": 1 },
145
+ "required": {
146
+ "type": "array",
147
+ "maxItems": 32,
148
+ "uniqueItems": true,
149
+ "items": { "$ref": "#/$defs/applicationCapability" }
150
+ },
151
+ "optional": {
152
+ "type": "array",
153
+ "maxItems": 32,
154
+ "uniqueItems": true,
155
+ "items": { "$ref": "#/$defs/applicationCapability" }
156
+ }
157
+ }
158
+ },
159
+ "configurationValue": {
160
+ "anyOf": [
161
+ { "type": "string" },
162
+ { "type": "number" },
163
+ { "type": "boolean" },
164
+ { "type": "null" }
165
+ ]
166
+ },
167
+ "configurationRequirement": {
168
+ "type": "object",
169
+ "additionalProperties": false,
170
+ "required": ["id", "path", "predicate", "value"],
171
+ "properties": {
172
+ "id": {
173
+ "type": "string",
174
+ "minLength": 1,
175
+ "maxLength": 100,
176
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
177
+ },
178
+ "path": { "type": "string", "minLength": 1, "maxLength": 1024 },
179
+ "predicate": { "const": "contains" },
180
+ "value": { "$ref": "#/$defs/configurationValue" }
181
+ }
182
+ },
183
+ "configurationProvision": {
184
+ "type": "object",
185
+ "additionalProperties": false,
186
+ "required": ["requirement", "operation", "path", "value"],
187
+ "properties": {
188
+ "requirement": {
189
+ "type": "string",
190
+ "minLength": 1,
191
+ "maxLength": 100,
192
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
193
+ },
194
+ "operation": { "const": "set_add" },
195
+ "path": { "type": "string", "minLength": 1, "maxLength": 1024 },
196
+ "value": { "$ref": "#/$defs/configurationValue" }
197
+ }
198
+ },
199
+ "applicationCapability": {
200
+ "enum": [
201
+ "collection.inspect",
202
+ "records.watch",
203
+ "records.read",
204
+ "records.query",
205
+ "records.validate",
206
+ "records.create",
207
+ "records.update",
208
+ "records.delete",
209
+ "records.rename",
210
+ "views.list",
211
+ "views.execute",
212
+ "views.source.read",
213
+ "views.source.create",
214
+ "views.source.update",
215
+ "views.source.delete",
216
+ "definitions.contracts.current",
217
+ "definitions.read",
218
+ "definitions.create",
219
+ "definitions.update",
220
+ "definitions.type-pack.inspect",
221
+ "definitions.type-pack.apply",
222
+ "collection.setup.apply",
223
+ "timers.list",
224
+ "timers.put",
225
+ "timers.cancel",
226
+ "timers.reconcile",
227
+ "sync.offline-replica",
228
+ "notifications.background-delivery",
229
+ "files.list",
230
+ "files.read",
231
+ "files.add",
232
+ "files.replace",
233
+ "files.move",
234
+ "files.delete"
235
+ ]
236
+ },
237
+ "fileRequirement": {
238
+ "type": "object",
239
+ "additionalProperties": false,
240
+ "required": ["actions", "scope"],
241
+ "properties": {
242
+ "actions": {
243
+ "type": "array",
244
+ "minItems": 1,
245
+ "maxItems": 6,
246
+ "uniqueItems": true,
247
+ "items": {
248
+ "enum": ["list", "read", "add", "replace", "move", "delete"]
249
+ }
250
+ },
251
+ "scope": { "$ref": "#/$defs/fileScope" }
252
+ }
253
+ },
254
+ "fileScope": {
255
+ "oneOf": [
256
+ {
257
+ "type": "object",
258
+ "additionalProperties": false,
259
+ "required": ["kind", "folders"],
260
+ "properties": {
261
+ "kind": { "const": "selected_folders" },
262
+ "folders": {
263
+ "type": "array",
264
+ "minItems": 1,
265
+ "maxItems": 100,
266
+ "uniqueItems": true,
267
+ "items": {
268
+ "type": "string",
269
+ "minLength": 1,
270
+ "maxLength": 1024,
271
+ "pattern": "^(?!/)(?!\\.)(?!.*//)(?!.*\\\\)(?!.*/\\.)(?!(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*\\/(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*/$).+$"
272
+ }
273
+ }
274
+ }
275
+ },
276
+ {
277
+ "type": "object",
278
+ "additionalProperties": false,
279
+ "required": ["kind"],
280
+ "properties": { "kind": { "const": "collection" } }
281
+ }
282
+ ]
283
+ },
284
+ "typePackProvision": {
285
+ "type": "object",
286
+ "additionalProperties": false,
287
+ "required": ["manifest", "resources", "provides"],
288
+ "properties": {
289
+ "manifest": { "$ref": "#/$defs/typePackManifest" },
290
+ "resources": {
291
+ "type": "array",
292
+ "minItems": 1,
293
+ "maxItems": 100,
294
+ "items": { "$ref": "#/$defs/typePackSourceResource" }
295
+ },
296
+ "provides": {
297
+ "type": "array",
298
+ "maxItems": 20,
299
+ "uniqueItems": true,
300
+ "items": { "$ref": "#/$defs/contract" }
301
+ }
302
+ }
303
+ },
304
+ "typePackManifest": {
305
+ "type": "object",
306
+ "required": ["kind", "id", "version", "resources"],
307
+ "properties": {
308
+ "kind": { "const": "mdbase.type-pack" },
309
+ "id": { "$ref": "#/$defs/identifier" },
310
+ "version": { "$ref": "#/$defs/contract/properties/version" },
311
+ "name": { "type": "string", "minLength": 1, "maxLength": 100 },
312
+ "description": { "type": "string", "maxLength": 500 },
313
+ "resources": {
314
+ "type": "array",
315
+ "minItems": 1,
316
+ "maxItems": 100,
317
+ "items": { "$ref": "#/$defs/typePackManifestResource" }
318
+ }
319
+ },
320
+ "patternProperties": { "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": true },
321
+ "additionalProperties": false
322
+ },
323
+ "typePackManifestResource": {
324
+ "type": "object",
325
+ "additionalProperties": false,
326
+ "required": ["kind", "mode", "source", "target", "digest"],
327
+ "properties": {
328
+ "kind": { "enum": ["contract", "type", "schema"] },
329
+ "mode": { "enum": ["managed", "seed"] },
330
+ "source": { "type": "string", "minLength": 1, "maxLength": 240 },
331
+ "target": { "type": "string", "minLength": 1, "maxLength": 240 },
332
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
333
+ }
334
+ },
335
+ "typePackSourceResource": {
336
+ "type": "object",
337
+ "additionalProperties": false,
338
+ "required": ["source", "document"],
339
+ "properties": {
340
+ "source": { "type": "string", "minLength": 1, "maxLength": 240 },
341
+ "document": { "type": "string", "maxLength": 262144 }
342
+ }
343
+ },
344
+ "notificationCriterion": {
345
+ "type": "object",
346
+ "additionalProperties": false,
347
+ "required": ["id", "event", "presentation"],
348
+ "properties": {
349
+ "id": { "$ref": "#/$defs/identifier" },
350
+ "event": { "$ref": "#/$defs/contract" },
351
+ "if": {
352
+ "type": "object",
353
+ "additionalProperties": false,
354
+ "required": ["$expr"],
355
+ "properties": {
356
+ "$expr": { "type": "string", "minLength": 1, "maxLength": 4096 }
357
+ }
358
+ },
359
+ "debounce": { "$ref": "#/$defs/duration" },
360
+ "minimum_interval": { "$ref": "#/$defs/duration" },
361
+ "presentation": {
362
+ "type": "object",
363
+ "additionalProperties": false,
364
+ "required": ["title"],
365
+ "properties": {
366
+ "title": { "type": "string", "minLength": 1, "maxLength": 80 },
367
+ "body": { "type": "string", "maxLength": 160 },
368
+ "tag": { "type": "string", "minLength": 1, "maxLength": 80 }
369
+ }
370
+ }
371
+ }
372
+ },
373
+ "nativeNotificationDelivery": {
374
+ "oneOf": [
375
+ {
376
+ "type": "object",
377
+ "additionalProperties": false,
378
+ "required": ["mode", "firebase_project_id"],
379
+ "properties": {
380
+ "mode": { "const": "managed_fcm" },
381
+ "firebase_project_id": {
382
+ "type": "string",
383
+ "minLength": 6,
384
+ "maxLength": 63,
385
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$"
386
+ }
387
+ }
388
+ },
389
+ {
390
+ "type": "object",
391
+ "additionalProperties": false,
392
+ "required": ["mode", "url"],
393
+ "properties": {
394
+ "mode": { "const": "webhook" },
395
+ "url": {
396
+ "type": "string",
397
+ "format": "uri",
398
+ "pattern": "^https://"
399
+ }
400
+ }
401
+ }
402
+ ]
403
+ }
404
+ }
405
+ }