@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,163 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/v0.3/data-contract.schema.json",
4
+ "title": "mdbase v0.3 contract frontmatter",
5
+ "type": "object",
6
+ "required": ["kind", "contract_type", "id", "version"],
7
+ "properties": {
8
+ "kind": {
9
+ "const": "mdbase.contract"
10
+ },
11
+ "contract_type": {
12
+ "enum": ["record", "event", "action"]
13
+ },
14
+ "id": {
15
+ "$ref": "#/$defs/contractId"
16
+ },
17
+ "version": {
18
+ "$ref": "#/$defs/semanticVersion"
19
+ },
20
+ "name": {
21
+ "type": "string",
22
+ "minLength": 1
23
+ },
24
+ "description": {
25
+ "type": "string"
26
+ },
27
+ "record_schema": {
28
+ "$ref": "#/$defs/schemaWrapper"
29
+ },
30
+ "binding_schema": {
31
+ "$ref": "#/$defs/schemaWrapper"
32
+ },
33
+ "data_schema": {
34
+ "$ref": "#/$defs/schemaWrapper"
35
+ },
36
+ "source_schema": {
37
+ "$ref": "#/$defs/schemaWrapper"
38
+ },
39
+ "input_schema": {
40
+ "$ref": "#/$defs/schemaWrapper"
41
+ },
42
+ "output_schema": {
43
+ "$ref": "#/$defs/schemaWrapper"
44
+ },
45
+ "error_schema": {
46
+ "$ref": "#/$defs/schemaWrapper"
47
+ },
48
+ "provider_schema": {
49
+ "$ref": "#/$defs/schemaWrapper"
50
+ },
51
+ "behavior": {
52
+ "$ref": "#/$defs/actionBehavior"
53
+ }
54
+ },
55
+ "patternProperties": {
56
+ "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": true
57
+ },
58
+ "oneOf": [
59
+ {
60
+ "properties": {
61
+ "contract_type": { "const": "record" },
62
+ "record_schema": true,
63
+ "binding_schema": true,
64
+ "data_schema": false,
65
+ "source_schema": false,
66
+ "input_schema": false,
67
+ "output_schema": false,
68
+ "error_schema": false,
69
+ "provider_schema": false,
70
+ "behavior": false
71
+ },
72
+ "required": ["record_schema"]
73
+ },
74
+ {
75
+ "properties": {
76
+ "contract_type": { "const": "event" },
77
+ "record_schema": false,
78
+ "binding_schema": false,
79
+ "data_schema": true,
80
+ "source_schema": true,
81
+ "input_schema": false,
82
+ "output_schema": false,
83
+ "error_schema": false,
84
+ "provider_schema": false,
85
+ "behavior": false
86
+ },
87
+ "required": ["data_schema"]
88
+ },
89
+ {
90
+ "properties": {
91
+ "contract_type": { "const": "action" },
92
+ "record_schema": false,
93
+ "binding_schema": false,
94
+ "data_schema": false,
95
+ "source_schema": false,
96
+ "input_schema": true,
97
+ "output_schema": true,
98
+ "error_schema": true,
99
+ "provider_schema": true,
100
+ "behavior": true
101
+ },
102
+ "required": ["input_schema"]
103
+ }
104
+ ],
105
+ "additionalProperties": false,
106
+ "$defs": {
107
+ "contractId": {
108
+ "type": "string",
109
+ "minLength": 3,
110
+ "maxLength": 128,
111
+ "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)+$"
112
+ },
113
+ "semanticVersion": {
114
+ "type": "string",
115
+ "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-]+)*)?$"
116
+ },
117
+ "schemaWrapper": {
118
+ "type": "object",
119
+ "required": ["dialect"],
120
+ "properties": {
121
+ "dialect": {
122
+ "const": "json-schema-2020-12"
123
+ },
124
+ "value": {
125
+ "type": "object"
126
+ },
127
+ "ref": {
128
+ "type": "string",
129
+ "minLength": 1
130
+ }
131
+ },
132
+ "oneOf": [
133
+ {
134
+ "required": ["value"],
135
+ "properties": {
136
+ "value": true,
137
+ "ref": false
138
+ }
139
+ },
140
+ {
141
+ "required": ["ref"],
142
+ "properties": {
143
+ "ref": true,
144
+ "value": false
145
+ }
146
+ }
147
+ ],
148
+ "additionalProperties": false
149
+ },
150
+ "actionBehavior": {
151
+ "type": "object",
152
+ "properties": {
153
+ "idempotency": {
154
+ "enum": ["none", "optional", "required"]
155
+ },
156
+ "cancellation": {
157
+ "enum": ["none", "cooperative"]
158
+ }
159
+ },
160
+ "additionalProperties": false
161
+ }
162
+ }
163
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/connect/schemas/encrypted-relay.v1.json",
4
+ "title": "mdbase connect encrypted relay protocol 1",
5
+ "description": "Opaque authenticated operation envelopes routed between an application and connector.",
6
+ "oneOf": [
7
+ { "$ref": "#/$defs/request" },
8
+ { "$ref": "#/$defs/response" },
9
+ { "$ref": "#/$defs/rejected" }
10
+ ],
11
+ "$defs": {
12
+ "uuid": {
13
+ "type": "string",
14
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
15
+ },
16
+ "operation": {
17
+ "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "assess_collection_setup", "apply_collection_setup", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "file_control"]
18
+ },
19
+ "envelope": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["type", "protocol_version", "suite", "request_id", "grant_id", "application_id", "connector_id", "collection_id", "operation", "scope_epoch", "key_id", "counter", "ciphertext"],
23
+ "properties": {
24
+ "type": { "enum": ["encrypted_operation_request", "encrypted_operation_response"] },
25
+ "protocol_version": { "const": 1 },
26
+ "suite": { "const": "P256-HKDF-SHA256-AES256GCM" },
27
+ "request_id": { "$ref": "#/$defs/uuid" },
28
+ "grant_id": { "$ref": "#/$defs/uuid" },
29
+ "application_id": { "$ref": "#/$defs/uuid" },
30
+ "connector_id": { "$ref": "#/$defs/uuid" },
31
+ "collection_id": { "$ref": "#/$defs/uuid" },
32
+ "operation": { "$ref": "#/$defs/operation" },
33
+ "scope_epoch": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
34
+ "key_id": { "type": "string", "minLength": 1, "maxLength": 200 },
35
+ "counter": { "type": "string", "pattern": "^[1-9][0-9]{0,19}$" },
36
+ "ciphertext": { "type": "string", "minLength": 1, "maxLength": 2800000, "pattern": "^[A-Za-z0-9_-]+$" }
37
+ }
38
+ },
39
+ "request": {
40
+ "allOf": [
41
+ { "$ref": "#/$defs/envelope" },
42
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_request" } } }
43
+ ]
44
+ },
45
+ "response": {
46
+ "allOf": [
47
+ { "$ref": "#/$defs/envelope" },
48
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_response" } } }
49
+ ]
50
+ },
51
+ "rejected": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["type", "protocol_version", "request_id", "problem"],
55
+ "properties": {
56
+ "type": { "const": "encrypted_operation_rejected" },
57
+ "protocol_version": { "const": 1 },
58
+ "request_id": { "$ref": "#/$defs/uuid" },
59
+ "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" }
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/connect/schemas/encrypted-relay.v2.json",
4
+ "title": "mdbase connect encrypted operation transport 2",
5
+ "description": "Opaque authenticated operation envelopes routed between an application and authority.",
6
+ "oneOf": [
7
+ { "$ref": "#/$defs/request" },
8
+ { "$ref": "#/$defs/response" },
9
+ { "$ref": "#/$defs/rejected" }
10
+ ],
11
+ "$defs": {
12
+ "uuid": {
13
+ "type": "string",
14
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
15
+ },
16
+ "operation": {
17
+ "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "assess_collection_setup", "apply_collection_setup", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "sync", "file_control"]
18
+ },
19
+ "envelope": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["type", "protocol_version", "suite", "request_id", "grant_id", "application_id", "connector_id", "collection_id", "operation", "scope_epoch", "key_id", "counter", "ciphertext"],
23
+ "properties": {
24
+ "type": { "enum": ["encrypted_operation_request", "encrypted_operation_response"] },
25
+ "protocol_version": { "const": 2 },
26
+ "suite": { "const": "P256-HKDF-SHA256-AES256GCM" },
27
+ "request_id": { "$ref": "#/$defs/uuid" },
28
+ "grant_id": { "$ref": "#/$defs/uuid" },
29
+ "application_id": { "$ref": "#/$defs/uuid" },
30
+ "connector_id": { "$ref": "#/$defs/uuid" },
31
+ "collection_id": { "$ref": "#/$defs/uuid" },
32
+ "operation": { "$ref": "#/$defs/operation" },
33
+ "scope_epoch": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
34
+ "key_id": { "type": "string", "minLength": 1, "maxLength": 200 },
35
+ "counter": { "type": "string", "pattern": "^[1-9][0-9]{0,19}$" },
36
+ "ciphertext": { "type": "string", "minLength": 1, "maxLength": 2800000, "pattern": "^[A-Za-z0-9_-]+$" }
37
+ }
38
+ },
39
+ "request": {
40
+ "allOf": [
41
+ { "$ref": "#/$defs/envelope" },
42
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_request" } } }
43
+ ]
44
+ },
45
+ "response": {
46
+ "allOf": [
47
+ { "$ref": "#/$defs/envelope" },
48
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_response" } } }
49
+ ]
50
+ },
51
+ "rejected": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["type", "protocol_version", "request_id", "problem"],
55
+ "properties": {
56
+ "type": { "const": "encrypted_operation_rejected" },
57
+ "protocol_version": { "const": 2 },
58
+ "request_id": { "$ref": "#/$defs/uuid" },
59
+ "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" }
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/connect/schemas/encrypted-relay.v3.json",
4
+ "title": "mdbase connect encrypted operation transport 3",
5
+ "description": "Opaque authenticated operation envelopes routed between an application and authority.",
6
+ "oneOf": [
7
+ { "$ref": "#/$defs/request" },
8
+ { "$ref": "#/$defs/response" },
9
+ { "$ref": "#/$defs/rejected" }
10
+ ],
11
+ "$defs": {
12
+ "uuid": {
13
+ "type": "string",
14
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
15
+ },
16
+ "operation": {
17
+ "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "assess_collection_setup", "apply_collection_setup", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "sync", "file_control"]
18
+ },
19
+ "envelope": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["type", "protocol_version", "suite", "request_id", "grant_id", "application_id", "connector_id", "collection_id", "operation", "scope_epoch", "key_id", "counter", "ciphertext"],
23
+ "properties": {
24
+ "type": { "enum": ["encrypted_operation_request", "encrypted_operation_response"] },
25
+ "protocol_version": { "const": 3 },
26
+ "suite": { "const": "P256-HKDF-SHA256-AES256GCM" },
27
+ "request_id": { "$ref": "#/$defs/uuid" },
28
+ "grant_id": { "$ref": "#/$defs/uuid" },
29
+ "application_id": { "$ref": "#/$defs/uuid" },
30
+ "connector_id": { "$ref": "#/$defs/uuid" },
31
+ "collection_id": { "$ref": "#/$defs/uuid" },
32
+ "operation": { "$ref": "#/$defs/operation" },
33
+ "scope_epoch": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
34
+ "key_id": { "type": "string", "minLength": 1, "maxLength": 200 },
35
+ "counter": { "type": "string", "pattern": "^[1-9][0-9]{0,19}$" },
36
+ "deadline_unix_ms": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
37
+ "ciphertext": { "type": "string", "minLength": 1, "maxLength": 2800000, "pattern": "^[A-Za-z0-9_-]+$" }
38
+ }
39
+ },
40
+ "request": {
41
+ "allOf": [
42
+ { "$ref": "#/$defs/envelope" },
43
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_request" } } }
44
+ ]
45
+ },
46
+ "response": {
47
+ "allOf": [
48
+ { "$ref": "#/$defs/envelope" },
49
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_response" } } }
50
+ ]
51
+ },
52
+ "rejected": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["type", "protocol_version", "request_id", "problem"],
56
+ "properties": {
57
+ "type": { "const": "encrypted_operation_rejected" },
58
+ "protocol_version": { "const": 3 },
59
+ "request_id": { "$ref": "#/$defs/uuid" },
60
+ "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" }
61
+ }
62
+ }
63
+ }
64
+ }