@sockethub/schemas 3.0.0-beta.1 → 3.0.0-beta.3
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/dist/contexts/platform/email/v1.jsonld +8 -0
- package/dist/contexts/platform/instagram/v1.jsonld +8 -0
- package/dist/contexts/platform/messenger/v1.jsonld +8 -0
- package/dist/contexts/platform/whatsapp/v1.jsonld +8 -0
- package/dist/index.js +33 -9
- package/dist/index.js.map +4 -4
- package/dist/maps/context-map.json +14 -2
- package/dist/schemas/json/activity-stream.json +1 -1
- package/dist/schemas/json/platform.json +1 -1
- package/dist/schemas/json/service-descriptor.json +1 -1
- package/dist/schemas/json/sockethub-config.json +36 -1
- package/dist/schemas/platform/caldav/v1/messages.schema.json +7 -0
- package/dist/schemas/platform/email/v1/credentials.schema.json +139 -0
- package/dist/schemas/platform/email/v1/messages.schema.json +289 -0
- package/dist/schemas/platform/instagram/v1/credentials.schema.json +67 -0
- package/dist/schemas/platform/instagram/v1/messages.schema.json +72 -0
- package/dist/schemas/platform/messenger/v1/credentials.schema.json +31 -0
- package/dist/schemas/platform/messenger/v1/messages.schema.json +72 -0
- package/dist/schemas/platform/whatsapp/v1/credentials.schema.json +31 -0
- package/dist/schemas/platform/whatsapp/v1/messages.schema.json +68 -0
- package/dist/schemas/sockethub-config.d.ts +31 -0
- package/dist/types.d.ts +4 -0
- package/dist/validator.d.ts +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"required": [
|
|
3
|
+
"type",
|
|
4
|
+
"actor",
|
|
5
|
+
"target",
|
|
6
|
+
"object"
|
|
7
|
+
],
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"enum": [
|
|
11
|
+
"send"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"actor": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": [
|
|
17
|
+
"id",
|
|
18
|
+
"type"
|
|
19
|
+
],
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"properties": {
|
|
22
|
+
"id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[0-9]+$",
|
|
25
|
+
"maxLength": 128
|
|
26
|
+
},
|
|
27
|
+
"type": {
|
|
28
|
+
"const": "person"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"target": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"required": [
|
|
35
|
+
"id",
|
|
36
|
+
"type"
|
|
37
|
+
],
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"properties": {
|
|
40
|
+
"id": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"pattern": "^[0-9]+$",
|
|
43
|
+
"maxLength": 128
|
|
44
|
+
},
|
|
45
|
+
"type": {
|
|
46
|
+
"const": "person"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"object": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"required": [
|
|
53
|
+
"type",
|
|
54
|
+
"content"
|
|
55
|
+
],
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"type": {
|
|
59
|
+
"const": "message"
|
|
60
|
+
},
|
|
61
|
+
"content": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"minLength": 1,
|
|
64
|
+
"maxLength": 1000
|
|
65
|
+
},
|
|
66
|
+
"humanAgent": {
|
|
67
|
+
"type": "boolean"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"required": [
|
|
3
|
+
"object"
|
|
4
|
+
],
|
|
5
|
+
"properties": {
|
|
6
|
+
"object": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"type",
|
|
10
|
+
"token",
|
|
11
|
+
"apiVersion"
|
|
12
|
+
],
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {
|
|
15
|
+
"type": {
|
|
16
|
+
"const": "credentials"
|
|
17
|
+
},
|
|
18
|
+
"token": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"maxLength": 8192,
|
|
22
|
+
"pattern": "^[^\\r\\n]+$"
|
|
23
|
+
},
|
|
24
|
+
"apiVersion": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"pattern": "^v[0-9]{1,3}\\.[0-9]{1,2}$"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"required": [
|
|
3
|
+
"type",
|
|
4
|
+
"actor",
|
|
5
|
+
"target",
|
|
6
|
+
"object"
|
|
7
|
+
],
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"enum": [
|
|
11
|
+
"send"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"actor": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": [
|
|
17
|
+
"id",
|
|
18
|
+
"type"
|
|
19
|
+
],
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"properties": {
|
|
22
|
+
"id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[0-9]+$",
|
|
25
|
+
"maxLength": 128
|
|
26
|
+
},
|
|
27
|
+
"type": {
|
|
28
|
+
"const": "person"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"target": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"required": [
|
|
35
|
+
"id",
|
|
36
|
+
"type"
|
|
37
|
+
],
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"properties": {
|
|
40
|
+
"id": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"pattern": "^[0-9]+$",
|
|
43
|
+
"maxLength": 128
|
|
44
|
+
},
|
|
45
|
+
"type": {
|
|
46
|
+
"const": "person"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"object": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"required": [
|
|
53
|
+
"type",
|
|
54
|
+
"content"
|
|
55
|
+
],
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"type": {
|
|
59
|
+
"const": "message"
|
|
60
|
+
},
|
|
61
|
+
"content": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"minLength": 1,
|
|
64
|
+
"maxLength": 2000
|
|
65
|
+
},
|
|
66
|
+
"humanAgent": {
|
|
67
|
+
"type": "boolean"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"required": [
|
|
3
|
+
"object"
|
|
4
|
+
],
|
|
5
|
+
"properties": {
|
|
6
|
+
"object": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"type",
|
|
10
|
+
"token",
|
|
11
|
+
"apiVersion"
|
|
12
|
+
],
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {
|
|
15
|
+
"type": {
|
|
16
|
+
"const": "credentials"
|
|
17
|
+
},
|
|
18
|
+
"token": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"maxLength": 8192,
|
|
22
|
+
"pattern": "^[^\\r\\n]+$"
|
|
23
|
+
},
|
|
24
|
+
"apiVersion": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"pattern": "^v[0-9]{1,3}\\.[0-9]{1,2}$"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"required": [
|
|
3
|
+
"type",
|
|
4
|
+
"actor",
|
|
5
|
+
"target",
|
|
6
|
+
"object"
|
|
7
|
+
],
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"enum": [
|
|
11
|
+
"send"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"actor": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": [
|
|
17
|
+
"id",
|
|
18
|
+
"type"
|
|
19
|
+
],
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"properties": {
|
|
22
|
+
"id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[0-9]+$",
|
|
25
|
+
"maxLength": 128
|
|
26
|
+
},
|
|
27
|
+
"type": {
|
|
28
|
+
"const": "person"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"target": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"required": [
|
|
35
|
+
"id",
|
|
36
|
+
"type"
|
|
37
|
+
],
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"properties": {
|
|
40
|
+
"id": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"pattern": "^\\+?[1-9][0-9]{6,14}$"
|
|
43
|
+
},
|
|
44
|
+
"type": {
|
|
45
|
+
"const": "person"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"object": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"required": [
|
|
52
|
+
"type",
|
|
53
|
+
"content"
|
|
54
|
+
],
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"properties": {
|
|
57
|
+
"type": {
|
|
58
|
+
"const": "message"
|
|
59
|
+
},
|
|
60
|
+
"content": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"minLength": 1,
|
|
63
|
+
"maxLength": 4096
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -116,6 +116,10 @@ export declare const SockethubConfigSchema: {
|
|
|
116
116
|
type: string;
|
|
117
117
|
minimum: number;
|
|
118
118
|
};
|
|
119
|
+
discoveryCacheTtlMs: {
|
|
120
|
+
type: string;
|
|
121
|
+
minimum: number;
|
|
122
|
+
};
|
|
119
123
|
};
|
|
120
124
|
};
|
|
121
125
|
"@sockethub/platform-caldav": {
|
|
@@ -136,6 +140,24 @@ export declare const SockethubConfigSchema: {
|
|
|
136
140
|
type: string;
|
|
137
141
|
minimum: number;
|
|
138
142
|
};
|
|
143
|
+
discoveryCacheTtlMs: {
|
|
144
|
+
type: string;
|
|
145
|
+
minimum: number;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
"@sockethub/platform-email": {
|
|
150
|
+
type: string;
|
|
151
|
+
additionalProperties: boolean;
|
|
152
|
+
properties: {
|
|
153
|
+
connectTimeoutMs: {
|
|
154
|
+
type: string;
|
|
155
|
+
minimum: number;
|
|
156
|
+
maximum: number;
|
|
157
|
+
};
|
|
158
|
+
allowPrivateAddresses: {
|
|
159
|
+
type: string;
|
|
160
|
+
};
|
|
139
161
|
};
|
|
140
162
|
};
|
|
141
163
|
"@sockethub/platform-dummy": {
|
|
@@ -171,6 +193,9 @@ export declare const SockethubConfigSchema: {
|
|
|
171
193
|
connectTimeoutMs: {
|
|
172
194
|
type: string;
|
|
173
195
|
};
|
|
196
|
+
allowPrivateAddresses: {
|
|
197
|
+
type: string;
|
|
198
|
+
};
|
|
174
199
|
};
|
|
175
200
|
};
|
|
176
201
|
"@sockethub/platform-xmpp": {
|
|
@@ -289,6 +314,12 @@ export declare const SockethubConfigSchema: {
|
|
|
289
314
|
default: number;
|
|
290
315
|
description: string;
|
|
291
316
|
};
|
|
317
|
+
maxStartsPerIpPerMinute: {
|
|
318
|
+
type: string;
|
|
319
|
+
minimum: number;
|
|
320
|
+
default: number;
|
|
321
|
+
description: string;
|
|
322
|
+
};
|
|
292
323
|
maxPlatformInstances: {
|
|
293
324
|
type: string;
|
|
294
325
|
minimum: number;
|
package/dist/types.d.ts
CHANGED
|
@@ -111,6 +111,10 @@ export interface StatelessPlatformConfig extends BasePlatformConfig {
|
|
|
111
111
|
* These always require credentials because persistent state is actor-specific.
|
|
112
112
|
*/
|
|
113
113
|
export interface PersistentPlatformConfig extends BasePlatformConfig {
|
|
114
|
+
/** Disable connection sharing when state belongs to a single client session. */
|
|
115
|
+
shareConnections?: boolean;
|
|
116
|
+
/** Disable replay after a worker crash for actions such as SMTP submission. */
|
|
117
|
+
retryStalledJobs?: boolean;
|
|
114
118
|
persist: true;
|
|
115
119
|
/** Message types requiring credentials (must be non-empty for persistent platforms) */
|
|
116
120
|
requireCredentials: string[];
|
package/dist/validator.d.ts
CHANGED
|
@@ -37,7 +37,8 @@ export declare function validateCredentials(msg: ActivityStream): string;
|
|
|
37
37
|
export declare function validatePlatformSchema(schema: Schema): string;
|
|
38
38
|
/**
|
|
39
39
|
* Register a platform's message or credentials schema with the validators, so
|
|
40
|
-
* local validation uses the same canonical sources as the server.
|
|
40
|
+
* local validation uses the same canonical sources as the server. Replaces any
|
|
41
|
+
* schema already registered for the same platform type. No-op when
|
|
41
42
|
* code generation is unavailable.
|
|
42
43
|
*/
|
|
43
44
|
export declare function addPlatformSchema(schema: Schema, platform_type: string): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockethub/schemas",
|
|
3
3
|
"description": "JSON schema files for validating Sockethub Activity Streams",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -71,6 +71,6 @@
|
|
|
71
71
|
"ajv-formats": "^2.1.1",
|
|
72
72
|
"ajv-formats-draft2019": "^1.6.1"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "603d4edd90e1f0f0b70c4ab759be5f70b24020ea",
|
|
75
75
|
"types": "./dist/index.d.ts"
|
|
76
76
|
}
|