mailschema 0.2.0 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -7
- data/README.md +29 -88
- data/artifacts/context.jsonld +50 -0
- data/artifacts/contract.schema.json +206 -0
- data/artifacts/core.schema.json +210 -0
- data/artifacts/implementation.schema.json +173 -0
- data/artifacts/profile.json +27 -0
- data/lib/mailschema/artifacts.rb +32 -75
- data/lib/mailschema/authentication.rb +77 -0
- data/lib/mailschema/contract.rb +184 -281
- data/lib/mailschema/description.rb +56 -0
- data/lib/mailschema/formats.rb +77 -0
- data/lib/mailschema/header.rb +75 -0
- data/lib/mailschema/implementation.rb +27 -0
- data/lib/mailschema/jcs.rb +11 -10
- data/lib/mailschema/json.rb +190 -0
- data/lib/mailschema/message.rb +127 -12
- data/lib/mailschema/origin.rb +18 -0
- data/lib/mailschema/patterns.rb +173 -0
- data/lib/mailschema/subschemas.rb +70 -0
- data/lib/mailschema/version.rb +1 -1
- data/lib/mailschema.rb +16 -26
- data/sig/mailschema.rbs +76 -68
- metadata +29 -54
- data/contexts/map-0.2.jsonld +0 -91
- data/lib/mailschema/capability.rb +0 -41
- data/lib/mailschema/document.rb +0 -79
- data/lib/mailschema/documents.rb +0 -127
- data/lib/mailschema/forms.rb +0 -41
- data/lib/mailschema/http.rb +0 -25
- data/lib/mailschema/limits.rb +0 -56
- data/lib/mailschema/pointer.rb +0 -46
- data/lib/mailschema/references.rb +0 -62
- data/lib/mailschema/schema_walk.rb +0 -29
- data/schemas/contribution.schema.json +0 -874
- data/schemas/forms-0.1.schema.json +0 -329
- data/schemas/map-0.2.schema.json +0 -1033
- data/schemas/type-contract-0.2.schema.json +0 -179
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://mailschema.org/schemas/type-contract-0.2.schema.json",
|
|
4
|
-
"title": "MailSchema type contract for MAP 0.2",
|
|
5
|
-
"description": "A versioned interaction contract: the details, inputs, results, authority, repeatability and consequences of each operation, with every schema it depends on pinned by digest.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"properties": {
|
|
9
|
-
"kind": {
|
|
10
|
-
"const": "MapTypeContract"
|
|
11
|
-
},
|
|
12
|
-
"id": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"pattern": "^https://mailschema\\.org/types/[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
15
|
-
"maxLength": 2048
|
|
16
|
-
},
|
|
17
|
-
"version": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"pattern": "^[0-9]+\\.[0-9]+(?:\\.[0-9]+)?(?:-[a-zA-Z0-9.-]+)?$",
|
|
20
|
-
"maxLength": 80
|
|
21
|
-
},
|
|
22
|
-
"profile": {
|
|
23
|
-
"const": "https://mailschema.org/profiles/map/0.2"
|
|
24
|
-
},
|
|
25
|
-
"target": {
|
|
26
|
-
"$ref": "#/$defs/prose"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"type": "array",
|
|
30
|
-
"minItems": 1,
|
|
31
|
-
"maxItems": 20,
|
|
32
|
-
"items": {
|
|
33
|
-
"$ref": "#/$defs/schemaReference"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"detailsSchema": {
|
|
37
|
-
"type": "object"
|
|
38
|
-
},
|
|
39
|
-
"requestSchema": {
|
|
40
|
-
"$ref": "#/$defs/schemaReference"
|
|
41
|
-
},
|
|
42
|
-
"operations": {
|
|
43
|
-
"type": "array",
|
|
44
|
-
"minItems": 1,
|
|
45
|
-
"maxItems": 100,
|
|
46
|
-
"items": {
|
|
47
|
-
"type": "object",
|
|
48
|
-
"additionalProperties": false,
|
|
49
|
-
"properties": {
|
|
50
|
-
"id": {
|
|
51
|
-
"$ref": "#/$defs/token"
|
|
52
|
-
},
|
|
53
|
-
"effect": {
|
|
54
|
-
"$ref": "#/$defs/prose"
|
|
55
|
-
},
|
|
56
|
-
"authority": {
|
|
57
|
-
"type": "array",
|
|
58
|
-
"items": {
|
|
59
|
-
"enum": ["credential", "possession"]
|
|
60
|
-
},
|
|
61
|
-
"minItems": 1,
|
|
62
|
-
"maxItems": 2,
|
|
63
|
-
"uniqueItems": true
|
|
64
|
-
},
|
|
65
|
-
"consequences": {
|
|
66
|
-
"type": "array",
|
|
67
|
-
"items": {
|
|
68
|
-
"enum": [
|
|
69
|
-
"refusal",
|
|
70
|
-
"protection",
|
|
71
|
-
"record",
|
|
72
|
-
"disclosure",
|
|
73
|
-
"commitment",
|
|
74
|
-
"authorization",
|
|
75
|
-
"assertion"
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
"minItems": 1,
|
|
79
|
-
"maxItems": 7,
|
|
80
|
-
"uniqueItems": true
|
|
81
|
-
},
|
|
82
|
-
"repeatable": {
|
|
83
|
-
"type": "boolean"
|
|
84
|
-
},
|
|
85
|
-
"fieldBindings": {
|
|
86
|
-
"type": "array",
|
|
87
|
-
"minItems": 1,
|
|
88
|
-
"maxItems": 10,
|
|
89
|
-
"items": {
|
|
90
|
-
"type": "object",
|
|
91
|
-
"additionalProperties": false,
|
|
92
|
-
"properties": {
|
|
93
|
-
"input": {
|
|
94
|
-
"$ref": "#/$defs/pointer"
|
|
95
|
-
},
|
|
96
|
-
"fields": {
|
|
97
|
-
"$ref": "#/$defs/pointer"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"required": ["input", "fields"]
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
"results": {
|
|
104
|
-
"type": "array",
|
|
105
|
-
"minItems": 1,
|
|
106
|
-
"maxItems": 5,
|
|
107
|
-
"items": {
|
|
108
|
-
"type": "object",
|
|
109
|
-
"additionalProperties": false,
|
|
110
|
-
"properties": {
|
|
111
|
-
"state": {
|
|
112
|
-
"enum": ["accepted", "completed", "failed", "pending", "approval-required"]
|
|
113
|
-
},
|
|
114
|
-
"reasons": {
|
|
115
|
-
"type": "array",
|
|
116
|
-
"items": {
|
|
117
|
-
"$ref": "#/$defs/token"
|
|
118
|
-
},
|
|
119
|
-
"minItems": 1,
|
|
120
|
-
"maxItems": 20,
|
|
121
|
-
"uniqueItems": true
|
|
122
|
-
},
|
|
123
|
-
"outputSchema": {
|
|
124
|
-
"type": "object"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"required": ["state", "outputSchema"]
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"required": ["id", "effect", "authority", "consequences", "results"]
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"required": [
|
|
136
|
-
"kind",
|
|
137
|
-
"id",
|
|
138
|
-
"version",
|
|
139
|
-
"profile",
|
|
140
|
-
"target",
|
|
141
|
-
"dependencies",
|
|
142
|
-
"requestSchema",
|
|
143
|
-
"operations"
|
|
144
|
-
],
|
|
145
|
-
"$defs": {
|
|
146
|
-
"prose": {
|
|
147
|
-
"type": "string",
|
|
148
|
-
"minLength": 1,
|
|
149
|
-
"maxLength": 12000,
|
|
150
|
-
"pattern": "[^\\t\\n\\u000b\\f\\r \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]"
|
|
151
|
-
},
|
|
152
|
-
"token": {
|
|
153
|
-
"type": "string",
|
|
154
|
-
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
155
|
-
"maxLength": 100
|
|
156
|
-
},
|
|
157
|
-
"pointer": {
|
|
158
|
-
"type": "string",
|
|
159
|
-
"pattern": "^(?:/(?:[^~/]|~[01])*)+$",
|
|
160
|
-
"maxLength": 1000
|
|
161
|
-
},
|
|
162
|
-
"schemaReference": {
|
|
163
|
-
"type": "object",
|
|
164
|
-
"additionalProperties": false,
|
|
165
|
-
"properties": {
|
|
166
|
-
"url": {
|
|
167
|
-
"type": "string",
|
|
168
|
-
"pattern": "^https://mailschema\\.org/schemas/[a-z0-9.-]+\\.json$",
|
|
169
|
-
"maxLength": 2048
|
|
170
|
-
},
|
|
171
|
-
"canonicalDigest": {
|
|
172
|
-
"type": "string",
|
|
173
|
-
"pattern": "^sha-256:[a-f0-9]{64}$"
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
"required": ["url", "canonicalDigest"]
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|