@sprucelabs/mercury-types 46.0.299 → 47.0.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.
- package/build/.spruce/errors/errors.types.js +0 -2
- package/build/.spruce/errors/mercury/invalidEventContract.schema.js +1 -1
- package/build/.spruce/errors/options.types.d.ts +2 -2
- package/build/.spruce/schemas/fields/fields.types.d.ts +1 -1
- package/build/.spruce/schemas/mercury/v2020_12_25/eventContract.schema.js +6 -6
- package/build/.spruce/schemas/mercury/v2020_12_25/eventSignature.schema.js +18 -18
- package/build/.spruce/schemas/mercury/v2020_12_25/eventSignaturesByName.schema.js +1 -1
- package/build/.spruce/schemas/mercury/v2020_12_25/feedOptions.schema.js +9 -9
- package/build/.spruce/schemas/mercury/v2020_12_25/permission.schema.js +13 -13
- package/build/.spruce/schemas/mercury/v2020_12_25/permissionContract.schema.js +12 -12
- package/build/.spruce/schemas/mercury/v2020_12_25/permissionDefaults.schema.js +17 -17
- package/build/.spruce/schemas/mercury/v2020_12_25/permissionReference.schema.js +8 -6
- package/build/.spruce/schemas/mercury/v2020_12_25/statusFlags.schema.js +12 -12
- package/build/.spruce/schemas/schemas.types.d.ts +87 -88
- package/build/.spruce/schemas/schemas.types.js +0 -2
- package/build/errors/SpruceError.d.ts +1 -1
- package/build/errors/SpruceError.js +2 -2
- package/build/esm/.spruce/errors/errors.types.js +0 -2
- package/build/esm/.spruce/errors/options.types.d.ts +2 -2
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/eventContract.schema.js +6 -6
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/eventSignature.schema.js +18 -18
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/eventSignaturesByName.schema.js +1 -1
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/feedOptions.schema.js +9 -9
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/permission.schema.js +13 -13
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/permissionContract.schema.js +12 -12
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/permissionDefaults.schema.js +17 -17
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/permissionReference.schema.js +8 -6
- package/build/esm/.spruce/schemas/mercury/v2020_12_25/statusFlags.schema.js +12 -12
- package/build/esm/.spruce/schemas/schemas.types.d.ts +87 -88
- package/build/esm/.spruce/schemas/schemas.types.js +0 -2
- package/build/esm/errors/SpruceError.d.ts +1 -1
- package/build/esm/schemas/v2020_12_25/eventContract.builder.js +6 -2
- package/build/esm/types/mercury.types.d.ts +2 -4
- package/build/schemas/v2020_12_25/eventContract.builder.js +6 -2
- package/build/schemas/v2020_12_25/permissionContract.builder.js +25 -29
- package/build/types/mercury.types.d.ts +2 -4
- package/package.json +15 -15
|
@@ -4,10 +4,7 @@ import * as SpruceSchema from '@sprucelabs/schema';
|
|
|
4
4
|
import * as MercuryTypes from '../../';
|
|
5
5
|
declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schemas.types' {
|
|
6
6
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
7
|
-
|
|
8
|
-
/** . */
|
|
9
|
-
[eventName: string]: SpruceSchemas.Mercury.v2020_12_25.EventSignature;
|
|
10
|
-
}
|
|
7
|
+
type EventSignaturesByName = Record<string, SpruceSchemas.Mercury.v2020_12_25.EventSignature>;
|
|
11
8
|
interface EventSignaturesByNameSchema extends SpruceSchema.Schema {
|
|
12
9
|
id: 'eventSignaturesByName';
|
|
13
10
|
version: 'v2020_12_25';
|
|
@@ -29,25 +26,25 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
29
26
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
30
27
|
/** A Mercury Event Contract. */
|
|
31
28
|
interface EventContract {
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
id?: string | undefined | null;
|
|
30
|
+
eventSignatures: SpruceSchemas.Mercury.v2020_12_25.EventSignaturesByName;
|
|
34
31
|
}
|
|
35
32
|
interface EventContractSchema extends SpruceSchema.Schema {
|
|
36
33
|
id: 'eventContract';
|
|
37
34
|
version: 'v2020_12_25';
|
|
38
35
|
namespace: 'Mercury';
|
|
39
36
|
name: 'Event contract';
|
|
40
|
-
importsWhenRemote: [
|
|
37
|
+
importsWhenRemote: ["import '@sprucelabs/mercury-types'"];
|
|
41
38
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
42
39
|
description: 'A Mercury Event Contract.';
|
|
43
40
|
fields: {
|
|
44
41
|
/** . */
|
|
45
|
-
|
|
42
|
+
id: {
|
|
46
43
|
type: 'id';
|
|
47
44
|
options: undefined;
|
|
48
45
|
};
|
|
49
46
|
/** . */
|
|
50
|
-
|
|
47
|
+
eventSignatures: {
|
|
51
48
|
type: 'schema';
|
|
52
49
|
isRequired: true;
|
|
53
50
|
options: {
|
|
@@ -62,32 +59,32 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
62
59
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
63
60
|
/** A Mercury Permission Contract */
|
|
64
61
|
interface PermissionContract {
|
|
65
|
-
|
|
62
|
+
id: string;
|
|
66
63
|
/** Name. Human readable name for this contract */
|
|
67
|
-
|
|
64
|
+
name: string;
|
|
68
65
|
/** Description. */
|
|
69
|
-
|
|
66
|
+
description?: string | undefined | null;
|
|
70
67
|
/** Require all permissions. */
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
requireAllPermissions?: boolean | undefined | null;
|
|
69
|
+
permissions: SpruceSchemas.Mercury.v2020_12_25.Permission[];
|
|
73
70
|
}
|
|
74
71
|
interface PermissionContractSchema extends SpruceSchema.Schema {
|
|
75
72
|
id: 'permissionContract';
|
|
76
73
|
version: 'v2020_12_25';
|
|
77
74
|
namespace: 'Mercury';
|
|
78
75
|
name: 'Permission contract';
|
|
79
|
-
importsWhenRemote: [
|
|
76
|
+
importsWhenRemote: ["import '@sprucelabs/mercury-types'"];
|
|
80
77
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
81
78
|
description: 'A Mercury Permission Contract';
|
|
82
79
|
fields: {
|
|
83
80
|
/** . */
|
|
84
|
-
|
|
81
|
+
id: {
|
|
85
82
|
type: 'text';
|
|
86
83
|
isRequired: true;
|
|
87
84
|
options: undefined;
|
|
88
85
|
};
|
|
89
86
|
/** Name. Human readable name for this contract */
|
|
90
|
-
|
|
87
|
+
name: {
|
|
91
88
|
label: 'Name';
|
|
92
89
|
type: 'text';
|
|
93
90
|
isRequired: true;
|
|
@@ -95,20 +92,20 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
95
92
|
options: undefined;
|
|
96
93
|
};
|
|
97
94
|
/** Description. */
|
|
98
|
-
|
|
95
|
+
description: {
|
|
99
96
|
label: 'Description';
|
|
100
97
|
type: 'text';
|
|
101
98
|
options: undefined;
|
|
102
99
|
};
|
|
103
100
|
/** Require all permissions. */
|
|
104
|
-
|
|
101
|
+
requireAllPermissions: {
|
|
105
102
|
label: 'Require all permissions';
|
|
106
103
|
type: 'boolean';
|
|
107
104
|
defaultValue: false;
|
|
108
105
|
options: undefined;
|
|
109
106
|
};
|
|
110
107
|
/** . */
|
|
111
|
-
|
|
108
|
+
permissions: {
|
|
112
109
|
type: 'schema';
|
|
113
110
|
isRequired: true;
|
|
114
111
|
isArray: true;
|
|
@@ -125,15 +122,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
125
122
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
126
123
|
interface StatusFlags {
|
|
127
124
|
/** . What is the fallback if no status is set? */
|
|
128
|
-
|
|
125
|
+
default?: boolean | undefined | null;
|
|
129
126
|
/** Clocked in. Is the person clocked in and ready to rock? */
|
|
130
|
-
|
|
127
|
+
clockedIn?: boolean | undefined | null;
|
|
131
128
|
/** Clocked out. When someone is not working (off the clock). */
|
|
132
|
-
|
|
129
|
+
clockedOut?: boolean | undefined | null;
|
|
133
130
|
/** On premises. Are they at work (maybe working, maybe visiting). */
|
|
134
|
-
|
|
131
|
+
onPrem?: boolean | undefined | null;
|
|
135
132
|
/** Off premises. They aren't at the office or shop. */
|
|
136
|
-
|
|
133
|
+
offPrem?: boolean | undefined | null;
|
|
137
134
|
}
|
|
138
135
|
interface StatusFlagsSchema extends SpruceSchema.Schema {
|
|
139
136
|
id: 'statusFlags';
|
|
@@ -143,37 +140,37 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
143
140
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
144
141
|
fields: {
|
|
145
142
|
/** . What is the fallback if no status is set? */
|
|
146
|
-
|
|
143
|
+
default: {
|
|
147
144
|
type: 'boolean';
|
|
148
145
|
hint: 'What is the fallback if no status is set?';
|
|
149
146
|
options: undefined;
|
|
150
147
|
};
|
|
151
148
|
/** Clocked in. Is the person clocked in and ready to rock? */
|
|
152
|
-
|
|
149
|
+
clockedIn: {
|
|
153
150
|
label: 'Clocked in';
|
|
154
151
|
type: 'boolean';
|
|
155
152
|
hint: 'Is the person clocked in and ready to rock?';
|
|
156
153
|
options: undefined;
|
|
157
154
|
};
|
|
158
155
|
/** Clocked out. When someone is not working (off the clock). */
|
|
159
|
-
|
|
156
|
+
clockedOut: {
|
|
160
157
|
label: 'Clocked out';
|
|
161
158
|
type: 'boolean';
|
|
162
159
|
hint: 'When someone is not working (off the clock).';
|
|
163
160
|
options: undefined;
|
|
164
161
|
};
|
|
165
162
|
/** On premises. Are they at work (maybe working, maybe visiting). */
|
|
166
|
-
|
|
163
|
+
onPrem: {
|
|
167
164
|
label: 'On premises';
|
|
168
165
|
type: 'boolean';
|
|
169
166
|
hint: 'Are they at work (maybe working, maybe visiting).';
|
|
170
167
|
options: undefined;
|
|
171
168
|
};
|
|
172
169
|
/** Off premises. They aren't at the office or shop. */
|
|
173
|
-
|
|
170
|
+
offPrem: {
|
|
174
171
|
label: 'Off premises';
|
|
175
172
|
type: 'boolean';
|
|
176
|
-
hint:
|
|
173
|
+
hint: "They aren't at the office or shop.";
|
|
177
174
|
options: undefined;
|
|
178
175
|
};
|
|
179
176
|
};
|
|
@@ -183,21 +180,21 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
183
180
|
}
|
|
184
181
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
185
182
|
interface PermissionDefaults {
|
|
186
|
-
|
|
183
|
+
skill?: boolean | undefined | null;
|
|
187
184
|
/** Owner. */
|
|
188
|
-
|
|
185
|
+
owner?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
189
186
|
/** Group manager. */
|
|
190
|
-
|
|
187
|
+
groupManager?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
191
188
|
/** Manager. */
|
|
192
|
-
|
|
189
|
+
manager?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
193
190
|
/** Teammate. */
|
|
194
|
-
|
|
191
|
+
teammate?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
195
192
|
/** Anonymous. */
|
|
196
|
-
|
|
193
|
+
anonymous?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
197
194
|
/** Logged in. */
|
|
198
|
-
|
|
195
|
+
loggedIn?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
199
196
|
/** Guest. */
|
|
200
|
-
|
|
197
|
+
guest?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
201
198
|
}
|
|
202
199
|
interface PermissionDefaultsSchema extends SpruceSchema.Schema {
|
|
203
200
|
id: 'permissionDefaults';
|
|
@@ -207,12 +204,12 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
207
204
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
208
205
|
fields: {
|
|
209
206
|
/** . */
|
|
210
|
-
|
|
207
|
+
skill: {
|
|
211
208
|
type: 'boolean';
|
|
212
209
|
options: undefined;
|
|
213
210
|
};
|
|
214
211
|
/** Owner. */
|
|
215
|
-
|
|
212
|
+
owner: {
|
|
216
213
|
label: 'Owner';
|
|
217
214
|
type: 'schema';
|
|
218
215
|
options: {
|
|
@@ -220,7 +217,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
220
217
|
};
|
|
221
218
|
};
|
|
222
219
|
/** Group manager. */
|
|
223
|
-
|
|
220
|
+
groupManager: {
|
|
224
221
|
label: 'Group manager';
|
|
225
222
|
type: 'schema';
|
|
226
223
|
options: {
|
|
@@ -228,7 +225,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
228
225
|
};
|
|
229
226
|
};
|
|
230
227
|
/** Manager. */
|
|
231
|
-
|
|
228
|
+
manager: {
|
|
232
229
|
label: 'Manager';
|
|
233
230
|
type: 'schema';
|
|
234
231
|
options: {
|
|
@@ -236,7 +233,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
236
233
|
};
|
|
237
234
|
};
|
|
238
235
|
/** Teammate. */
|
|
239
|
-
|
|
236
|
+
teammate: {
|
|
240
237
|
label: 'Teammate';
|
|
241
238
|
type: 'schema';
|
|
242
239
|
options: {
|
|
@@ -244,7 +241,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
244
241
|
};
|
|
245
242
|
};
|
|
246
243
|
/** Anonymous. */
|
|
247
|
-
|
|
244
|
+
anonymous: {
|
|
248
245
|
label: 'Anonymous';
|
|
249
246
|
type: 'schema';
|
|
250
247
|
options: {
|
|
@@ -252,7 +249,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
252
249
|
};
|
|
253
250
|
};
|
|
254
251
|
/** Logged in. */
|
|
255
|
-
|
|
252
|
+
loggedIn: {
|
|
256
253
|
label: 'Logged in';
|
|
257
254
|
type: 'schema';
|
|
258
255
|
options: {
|
|
@@ -260,7 +257,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
260
257
|
};
|
|
261
258
|
};
|
|
262
259
|
/** Guest. */
|
|
263
|
-
|
|
260
|
+
guest: {
|
|
264
261
|
label: 'Guest';
|
|
265
262
|
type: 'schema';
|
|
266
263
|
options: {
|
|
@@ -275,15 +272,15 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
275
272
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
276
273
|
interface Permission {
|
|
277
274
|
/** id. Hyphen separated id for this permission, e.g. can-unlock-doors */
|
|
278
|
-
|
|
275
|
+
id: string;
|
|
279
276
|
/** Name. Human readable name for this permission */
|
|
280
|
-
|
|
277
|
+
name: string;
|
|
281
278
|
/** Description. */
|
|
282
|
-
|
|
279
|
+
description?: string | undefined | null;
|
|
283
280
|
/** Require all statuses. */
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
281
|
+
requireAllStatuses?: boolean | undefined | null;
|
|
282
|
+
defaults?: SpruceSchemas.Mercury.v2020_12_25.PermissionDefaults | undefined | null;
|
|
283
|
+
can?: SpruceSchemas.Mercury.v2020_12_25.StatusFlags | undefined | null;
|
|
287
284
|
}
|
|
288
285
|
interface PermissionSchema extends SpruceSchema.Schema {
|
|
289
286
|
id: 'permission';
|
|
@@ -293,7 +290,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
293
290
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
294
291
|
fields: {
|
|
295
292
|
/** id. Hyphen separated id for this permission, e.g. can-unlock-doors */
|
|
296
|
-
|
|
293
|
+
id: {
|
|
297
294
|
label: 'id';
|
|
298
295
|
type: 'text';
|
|
299
296
|
isRequired: true;
|
|
@@ -301,7 +298,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
301
298
|
options: undefined;
|
|
302
299
|
};
|
|
303
300
|
/** Name. Human readable name for this permission */
|
|
304
|
-
|
|
301
|
+
name: {
|
|
305
302
|
label: 'Name';
|
|
306
303
|
type: 'text';
|
|
307
304
|
isRequired: true;
|
|
@@ -309,27 +306,27 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
309
306
|
options: undefined;
|
|
310
307
|
};
|
|
311
308
|
/** Description. */
|
|
312
|
-
|
|
309
|
+
description: {
|
|
313
310
|
label: 'Description';
|
|
314
311
|
type: 'text';
|
|
315
312
|
options: undefined;
|
|
316
313
|
};
|
|
317
314
|
/** Require all statuses. */
|
|
318
|
-
|
|
315
|
+
requireAllStatuses: {
|
|
319
316
|
label: 'Require all statuses';
|
|
320
317
|
type: 'boolean';
|
|
321
318
|
defaultValue: false;
|
|
322
319
|
options: undefined;
|
|
323
320
|
};
|
|
324
321
|
/** . */
|
|
325
|
-
|
|
322
|
+
defaults: {
|
|
326
323
|
type: 'schema';
|
|
327
324
|
options: {
|
|
328
325
|
schema: SpruceSchemas.Mercury.v2020_12_25.PermissionDefaultsSchema;
|
|
329
326
|
};
|
|
330
327
|
};
|
|
331
328
|
/** . */
|
|
332
|
-
|
|
329
|
+
can: {
|
|
333
330
|
type: 'schema';
|
|
334
331
|
options: {
|
|
335
332
|
schema: SpruceSchemas.Mercury.v2020_12_25.StatusFlagsSchema;
|
|
@@ -342,20 +339,22 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
342
339
|
}
|
|
343
340
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
344
341
|
interface PermissionReference<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId> {
|
|
345
|
-
|
|
346
|
-
|
|
342
|
+
contractId: ContractId;
|
|
343
|
+
permissionIdsAny?: MercuryTypes.PermissionId<ContractId>[] | undefined | null;
|
|
347
344
|
}
|
|
348
345
|
interface PermissionReferenceSchema extends SpruceSchema.Schema {
|
|
349
346
|
id: 'permissionReference';
|
|
350
347
|
version: 'v2020_12_25';
|
|
351
348
|
namespace: 'Mercury';
|
|
352
349
|
name: '';
|
|
353
|
-
importsWhenRemote: [
|
|
350
|
+
importsWhenRemote: [
|
|
351
|
+
"import * as MercuryTypes from '@sprucelabs/mercury-types'"
|
|
352
|
+
];
|
|
354
353
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
355
354
|
typeSuffix: '<ContractId extends MercuryTypes.PermissionContractId = MercuryTypes.PermissionContractId>';
|
|
356
355
|
fields: {
|
|
357
356
|
/** . */
|
|
358
|
-
|
|
357
|
+
contractId: {
|
|
359
358
|
type: 'raw';
|
|
360
359
|
isRequired: true;
|
|
361
360
|
options: {
|
|
@@ -363,7 +362,7 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
363
362
|
};
|
|
364
363
|
};
|
|
365
364
|
/** . */
|
|
366
|
-
|
|
365
|
+
permissionIdsAny: {
|
|
367
366
|
type: 'raw';
|
|
368
367
|
isArray: true;
|
|
369
368
|
options: {
|
|
@@ -378,10 +377,10 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
378
377
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
379
378
|
interface FeedOptions {
|
|
380
379
|
/** . A handlebarsjs template used to render the chat bubbles in the feed. You will have both the entire target and payload available to you in the template. See http://developer.spruce.bot for more details. */
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
380
|
+
template?: string | undefined | null;
|
|
381
|
+
pathsToLinks?: string[] | undefined | null;
|
|
382
|
+
pathsToChoices?: string[] | undefined | null;
|
|
383
|
+
pathToContext?: string | undefined | null;
|
|
385
384
|
}
|
|
386
385
|
interface FeedOptionsSchema extends SpruceSchema.Schema {
|
|
387
386
|
id: 'feedOptions';
|
|
@@ -391,27 +390,27 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
391
390
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
392
391
|
fields: {
|
|
393
392
|
/** . A handlebarsjs template used to render the chat bubbles in the feed. You will have both the entire target and payload available to you in the template. See http://developer.spruce.bot for more details. */
|
|
394
|
-
|
|
393
|
+
template: {
|
|
395
394
|
type: 'text';
|
|
396
395
|
hint: 'A handlebarsjs template used to render the chat bubbles in the feed. You will have both the entire target and payload available to you in the template. See http://developer.spruce.bot for more details.';
|
|
397
396
|
options: undefined;
|
|
398
397
|
};
|
|
399
398
|
/** . */
|
|
400
|
-
|
|
399
|
+
pathsToLinks: {
|
|
401
400
|
type: 'text';
|
|
402
401
|
isArray: true;
|
|
403
402
|
minArrayLength: 0;
|
|
404
403
|
options: undefined;
|
|
405
404
|
};
|
|
406
405
|
/** . */
|
|
407
|
-
|
|
406
|
+
pathsToChoices: {
|
|
408
407
|
type: 'text';
|
|
409
408
|
isArray: true;
|
|
410
409
|
minArrayLength: 0;
|
|
411
410
|
options: undefined;
|
|
412
411
|
};
|
|
413
412
|
/** . */
|
|
414
|
-
|
|
413
|
+
pathToContext: {
|
|
415
414
|
type: 'text';
|
|
416
415
|
options: undefined;
|
|
417
416
|
};
|
|
@@ -422,14 +421,14 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
422
421
|
}
|
|
423
422
|
namespace SpruceSchemas.Mercury.v2020_12_25 {
|
|
424
423
|
interface EventSignature {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
424
|
+
isGlobal?: boolean | undefined | null;
|
|
425
|
+
responsePayloadSchema?: SpruceSchema.Schema | undefined | null;
|
|
426
|
+
emitPayloadSchema?: SpruceSchema.Schema | undefined | null;
|
|
427
|
+
feed?: SpruceSchemas.Mercury.v2020_12_25.FeedOptions | undefined | null;
|
|
428
|
+
listenPermissions?: SpruceSchemas.Mercury.v2020_12_25.PermissionReference | undefined | null;
|
|
429
|
+
emitPermissions?: SpruceSchemas.Mercury.v2020_12_25.PermissionReference | undefined | null;
|
|
430
|
+
listenPermissionContract?: SpruceSchemas.Mercury.v2020_12_25.PermissionContract | undefined | null;
|
|
431
|
+
emitPermissionContract?: SpruceSchemas.Mercury.v2020_12_25.PermissionContract | undefined | null;
|
|
433
432
|
}
|
|
434
433
|
interface EventSignatureSchema extends SpruceSchema.Schema {
|
|
435
434
|
id: 'eventSignature';
|
|
@@ -439,55 +438,55 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
|
|
|
439
438
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types';
|
|
440
439
|
fields: {
|
|
441
440
|
/** . */
|
|
442
|
-
|
|
441
|
+
isGlobal: {
|
|
443
442
|
type: 'boolean';
|
|
444
443
|
defaultValue: false;
|
|
445
444
|
options: undefined;
|
|
446
445
|
};
|
|
447
446
|
/** . */
|
|
448
|
-
|
|
447
|
+
responsePayloadSchema: {
|
|
449
448
|
type: 'raw';
|
|
450
449
|
options: {
|
|
451
450
|
valueType: `SpruceSchema.Schema`;
|
|
452
451
|
};
|
|
453
452
|
};
|
|
454
453
|
/** . */
|
|
455
|
-
|
|
454
|
+
emitPayloadSchema: {
|
|
456
455
|
type: 'raw';
|
|
457
456
|
options: {
|
|
458
457
|
valueType: `SpruceSchema.Schema`;
|
|
459
458
|
};
|
|
460
459
|
};
|
|
461
460
|
/** . */
|
|
462
|
-
|
|
461
|
+
feed: {
|
|
463
462
|
type: 'schema';
|
|
464
463
|
options: {
|
|
465
464
|
schema: SpruceSchemas.Mercury.v2020_12_25.FeedOptionsSchema;
|
|
466
465
|
};
|
|
467
466
|
};
|
|
468
467
|
/** . */
|
|
469
|
-
|
|
468
|
+
listenPermissions: {
|
|
470
469
|
type: 'schema';
|
|
471
470
|
options: {
|
|
472
471
|
schema: SpruceSchemas.Mercury.v2020_12_25.PermissionReferenceSchema;
|
|
473
472
|
};
|
|
474
473
|
};
|
|
475
474
|
/** . */
|
|
476
|
-
|
|
475
|
+
emitPermissions: {
|
|
477
476
|
type: 'schema';
|
|
478
477
|
options: {
|
|
479
478
|
schema: SpruceSchemas.Mercury.v2020_12_25.PermissionReferenceSchema;
|
|
480
479
|
};
|
|
481
480
|
};
|
|
482
481
|
/** . */
|
|
483
|
-
|
|
482
|
+
listenPermissionContract: {
|
|
484
483
|
type: 'schema';
|
|
485
484
|
options: {
|
|
486
485
|
schema: SpruceSchemas.Mercury.v2020_12_25.PermissionContractSchema;
|
|
487
486
|
};
|
|
488
487
|
};
|
|
489
488
|
/** . */
|
|
490
|
-
|
|
489
|
+
emitPermissionContract: {
|
|
491
490
|
type: 'schema';
|
|
492
491
|
options: {
|
|
493
492
|
schema: SpruceSchemas.Mercury.v2020_12_25.PermissionContractSchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseSpruceError from '@sprucelabs/error';
|
|
2
|
-
import ErrorOptions from
|
|
2
|
+
import ErrorOptions from './../.spruce/errors/options.types';
|
|
3
3
|
export default class SpruceError extends BaseSpruceError<ErrorOptions> {
|
|
4
4
|
/** An easy to understand version of the errors */
|
|
5
5
|
friendlyMessage(): string;
|
|
@@ -10,10 +10,10 @@ class SpruceError extends error_1.default {
|
|
|
10
10
|
friendlyMessage() {
|
|
11
11
|
const { options } = this;
|
|
12
12
|
let message;
|
|
13
|
-
switch (options
|
|
13
|
+
switch (options?.code) {
|
|
14
14
|
case 'INVALID_EVENT_CONTRACT': {
|
|
15
15
|
message = `Yikes! This event contract is not valid!`;
|
|
16
|
-
const { originalError } = options
|
|
16
|
+
const { originalError } = options ?? {};
|
|
17
17
|
if (originalError instanceof schema_1.SchemaError &&
|
|
18
18
|
originalError.options.code === 'VALIDATION_FAILED') {
|
|
19
19
|
message = '\n\n' + originalError.message;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ErrorOptions as ISpruceErrorOptions } from '@sprucelabs/error';
|
|
2
|
+
import { SpruceErrors } from './errors.types';
|
|
3
3
|
export interface InvalidEventContractErrorOptions extends SpruceErrors.Mercury.InvalidEventContract, ISpruceErrorOptions {
|
|
4
4
|
code: 'INVALID_EVENT_CONTRACT';
|
|
5
5
|
}
|
|
@@ -5,22 +5,22 @@ const eventContractSchema = {
|
|
|
5
5
|
version: 'v2020_12_25',
|
|
6
6
|
namespace: 'Mercury',
|
|
7
7
|
name: 'Event contract',
|
|
8
|
-
importsWhenRemote: [
|
|
8
|
+
importsWhenRemote: ["import '@sprucelabs/mercury-types'"],
|
|
9
9
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types',
|
|
10
10
|
description: 'A Mercury Event Contract.',
|
|
11
11
|
fields: {
|
|
12
12
|
/** . */
|
|
13
|
-
|
|
13
|
+
id: {
|
|
14
14
|
type: 'id',
|
|
15
|
-
options: undefined
|
|
15
|
+
options: undefined,
|
|
16
16
|
},
|
|
17
17
|
/** . */
|
|
18
|
-
|
|
18
|
+
eventSignatures: {
|
|
19
19
|
type: 'schema',
|
|
20
20
|
isRequired: true,
|
|
21
|
-
options: { schema: eventSignaturesByNameSchema_v2020_12_25
|
|
21
|
+
options: { schema: eventSignaturesByNameSchema_v2020_12_25 },
|
|
22
22
|
},
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
24
|
};
|
|
25
25
|
SchemaRegistry.getInstance().trackSchema(eventContractSchema);
|
|
26
26
|
export default eventContractSchema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaRegistry } from '@sprucelabs/schema';
|
|
2
2
|
import feedOptionsSchema_v2020_12_25 from './feedOptions.schema.js';
|
|
3
|
-
import permissionReferenceSchema_v2020_12_25 from './permissionReference.schema.js';
|
|
4
3
|
import permissionContractSchema_v2020_12_25 from './permissionContract.schema.js';
|
|
4
|
+
import permissionReferenceSchema_v2020_12_25 from './permissionReference.schema.js';
|
|
5
5
|
const eventSignatureSchema = {
|
|
6
6
|
id: 'eventSignature',
|
|
7
7
|
version: 'v2020_12_25',
|
|
@@ -10,47 +10,47 @@ const eventSignatureSchema = {
|
|
|
10
10
|
moduleToImportFromWhenRemote: '@sprucelabs/mercury-types',
|
|
11
11
|
fields: {
|
|
12
12
|
/** . */
|
|
13
|
-
|
|
13
|
+
isGlobal: {
|
|
14
14
|
type: 'boolean',
|
|
15
15
|
defaultValue: false,
|
|
16
|
-
options: undefined
|
|
16
|
+
options: undefined,
|
|
17
17
|
},
|
|
18
18
|
/** . */
|
|
19
|
-
|
|
19
|
+
responsePayloadSchema: {
|
|
20
20
|
type: 'raw',
|
|
21
|
-
options: { valueType: `SpruceSchema.Schema
|
|
21
|
+
options: { valueType: `SpruceSchema.Schema` },
|
|
22
22
|
},
|
|
23
23
|
/** . */
|
|
24
|
-
|
|
24
|
+
emitPayloadSchema: {
|
|
25
25
|
type: 'raw',
|
|
26
|
-
options: { valueType: `SpruceSchema.Schema
|
|
26
|
+
options: { valueType: `SpruceSchema.Schema` },
|
|
27
27
|
},
|
|
28
28
|
/** . */
|
|
29
|
-
|
|
29
|
+
feed: {
|
|
30
30
|
type: 'schema',
|
|
31
|
-
options: { schema: feedOptionsSchema_v2020_12_25
|
|
31
|
+
options: { schema: feedOptionsSchema_v2020_12_25 },
|
|
32
32
|
},
|
|
33
33
|
/** . */
|
|
34
|
-
|
|
34
|
+
listenPermissions: {
|
|
35
35
|
type: 'schema',
|
|
36
|
-
options: { schema: permissionReferenceSchema_v2020_12_25
|
|
36
|
+
options: { schema: permissionReferenceSchema_v2020_12_25 },
|
|
37
37
|
},
|
|
38
38
|
/** . */
|
|
39
|
-
|
|
39
|
+
emitPermissions: {
|
|
40
40
|
type: 'schema',
|
|
41
|
-
options: { schema: permissionReferenceSchema_v2020_12_25
|
|
41
|
+
options: { schema: permissionReferenceSchema_v2020_12_25 },
|
|
42
42
|
},
|
|
43
43
|
/** . */
|
|
44
|
-
|
|
44
|
+
listenPermissionContract: {
|
|
45
45
|
type: 'schema',
|
|
46
|
-
options: { schema: permissionContractSchema_v2020_12_25
|
|
46
|
+
options: { schema: permissionContractSchema_v2020_12_25 },
|
|
47
47
|
},
|
|
48
48
|
/** . */
|
|
49
|
-
|
|
49
|
+
emitPermissionContract: {
|
|
50
50
|
type: 'schema',
|
|
51
|
-
options: { schema: permissionContractSchema_v2020_12_25
|
|
51
|
+
options: { schema: permissionContractSchema_v2020_12_25 },
|
|
52
52
|
},
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
54
|
};
|
|
55
55
|
SchemaRegistry.getInstance().trackSchema(eventSignatureSchema);
|
|
56
56
|
export default eventSignatureSchema;
|