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

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.
@@ -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,71 @@
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", "install_type_pack", "list_timers", "put_timer", "cancel_timer", "reconcile_timers"]
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", "error"],
55
+ "properties": {
56
+ "type": { "const": "encrypted_operation_rejected" },
57
+ "protocol_version": { "const": 1 },
58
+ "request_id": { "$ref": "#/$defs/uuid" },
59
+ "error": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["code", "message"],
63
+ "properties": {
64
+ "code": { "const": "encrypted_relay_rejected" },
65
+ "message": { "type": "string" }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/action-cancellation.schema.json",
4
+ "title": "mdbase action cancellation request",
5
+ "$ref": "profile.schema.json#/$defs/actionCancellation"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/action-invocation.schema.json",
4
+ "title": "mdbase admitted action invocation",
5
+ "$ref": "profile.schema.json#/$defs/actionInvocation"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/action-outcome.schema.json",
4
+ "title": "mdbase action outcome",
5
+ "$ref": "profile.schema.json#/$defs/actionOutcome"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/action-provider-declaration.schema.json",
4
+ "title": "mdbase action-provider declaration",
5
+ "$ref": "profile.schema.json#/$defs/actionProviderDeclaration"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/action-request.schema.json",
4
+ "title": "mdbase action request",
5
+ "$ref": "profile.schema.json#/$defs/actionRequest"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/conformance-claim.schema.json",
4
+ "title": "mdbase interoperability conformance claim",
5
+ "$ref": "profile.schema.json#/$defs/conformanceClaim"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/event-source-declaration.schema.json",
4
+ "title": "mdbase event-source declaration",
5
+ "$ref": "profile.schema.json#/$defs/eventSourceDeclaration"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/schemas/interop/v0.1/event.schema.json",
4
+ "title": "mdbase CloudEvents event envelope",
5
+ "$ref": "profile.schema.json#/$defs/event"
6
+ }