@appsemble/types 0.20.27 → 0.20.29
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/README.md +4 -4
- package/index.d.ts +34 -1
- package/package.json +1 -1
- package/action.js.map +0 -1
- package/action.ts +0 -98
- package/app.js.map +0 -1
- package/app.ts +0 -39
- package/appMember.js.map +0 -1
- package/appMember.ts +0 -22
- package/asset.js.map +0 -1
- package/asset.ts +0 -31
- package/authentication.js.map +0 -1
- package/authentication.ts +0 -5
- package/author.js.map +0 -1
- package/author.ts +0 -14
- package/bulma.js.map +0 -1
- package/bulma.ts +0 -14
- package/changed/added/.gitkeep +0 -0
- package/changed/changed/.gitkeep +0 -0
- package/changed/deprecated/.gitkeep +0 -0
- package/changed/fixed/.gitkeep +0 -0
- package/changed/removed/.gitkeep +0 -0
- package/changed/security/.gitkeep +0 -0
- package/http.js.map +0 -1
- package/http.ts +0 -14
- package/index.js.map +0 -1
- package/index.ts +0 -2181
- package/jest.config.js +0 -3
- package/resource.js.map +0 -1
- package/resource.ts +0 -56
- package/saml.js.map +0 -1
- package/saml.ts +0 -3
- package/snapshot.js.map +0 -1
- package/snapshot.ts +0 -26
- package/ssl.js.map +0 -1
- package/ssl.ts +0 -15
- package/team.js.map +0 -1
- package/team.ts +0 -23
- package/template.js.map +0 -1
- package/template.ts +0 -33
- package/theme.js.map +0 -1
- package/theme.ts +0 -65
- package/tsconfig.json +0 -4
- package/user.js.map +0 -1
- package/user.ts +0 -66
package/index.ts
DELETED
|
@@ -1,2181 +0,0 @@
|
|
|
1
|
-
import { IconName } from '@fortawesome/fontawesome-common-types';
|
|
2
|
-
import { Schema } from 'jsonschema';
|
|
3
|
-
import { OpenAPIV3 } from 'openapi-types';
|
|
4
|
-
import { JsonObject, RequireExactlyOne } from 'type-fest';
|
|
5
|
-
|
|
6
|
-
import { Action, LogAction } from './action.js';
|
|
7
|
-
import { AppVisibility, TeamsDefinition } from './app.js';
|
|
8
|
-
import { BulmaColor } from './bulma.js';
|
|
9
|
-
import { HTTPMethods } from './http.js';
|
|
10
|
-
import { Theme } from './theme.js';
|
|
11
|
-
|
|
12
|
-
export * from './action.js';
|
|
13
|
-
export * from './app.js';
|
|
14
|
-
export * from './appMember.js';
|
|
15
|
-
export * from './asset.js';
|
|
16
|
-
export * from './authentication.js';
|
|
17
|
-
export * from './author.js';
|
|
18
|
-
export * from './bulma.js';
|
|
19
|
-
export * from './http.js';
|
|
20
|
-
export * from './snapshot.js';
|
|
21
|
-
export * from './resource.js';
|
|
22
|
-
export * from './saml.js';
|
|
23
|
-
export * from './ssl.js';
|
|
24
|
-
export * from './team.js';
|
|
25
|
-
export * from './template.js';
|
|
26
|
-
export * from './theme.js';
|
|
27
|
-
export * from './user.js';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* A representation of a generated OAuth2 authorization code response.
|
|
31
|
-
*/
|
|
32
|
-
export interface OAuth2AuthorizationCode {
|
|
33
|
-
/**
|
|
34
|
-
* The authorization code.
|
|
35
|
-
*/
|
|
36
|
-
code: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* A block that is displayed on a page.
|
|
41
|
-
*/
|
|
42
|
-
export interface BlockDefinition {
|
|
43
|
-
/**
|
|
44
|
-
* The type of the block.
|
|
45
|
-
*
|
|
46
|
-
* A block type follow the format `@organization/name`.
|
|
47
|
-
* If the organization is _appsemble_, it may be omitted.
|
|
48
|
-
*
|
|
49
|
-
* Pattern:
|
|
50
|
-
* ^(@[a-z]([a-z\d-]{0,30}[a-z\d])?\/)?[a-z]([a-z\d-]{0,30}[a-z\d])$
|
|
51
|
-
*
|
|
52
|
-
* Examples:
|
|
53
|
-
* - `form`
|
|
54
|
-
* - `@amsterdam/splash`
|
|
55
|
-
*/
|
|
56
|
-
type: string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* A [semver](https://semver.org) representation of the block version.
|
|
60
|
-
*
|
|
61
|
-
* Pattern:
|
|
62
|
-
* ^\d+\.\d+\.\d+$
|
|
63
|
-
*/
|
|
64
|
-
version: string;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* An optional header to render above the block.
|
|
68
|
-
*/
|
|
69
|
-
header?: Remapper;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* An override of the block’s default layout.
|
|
73
|
-
*/
|
|
74
|
-
layout?: 'float' | 'grow' | 'static';
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* For floating blocks this propert defines where the block should float.
|
|
78
|
-
*/
|
|
79
|
-
position?:
|
|
80
|
-
| 'bottom left'
|
|
81
|
-
| 'bottom right'
|
|
82
|
-
| 'bottom'
|
|
83
|
-
| 'left'
|
|
84
|
-
| 'right'
|
|
85
|
-
| 'top left'
|
|
86
|
-
| 'top right'
|
|
87
|
-
| 'top';
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* The theme of the block.
|
|
91
|
-
*/
|
|
92
|
-
theme?: Partial<Theme>;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* A free form mapping of named parameters.
|
|
96
|
-
*
|
|
97
|
-
* The exact meaning of the parameters depends on the block type.
|
|
98
|
-
*/
|
|
99
|
-
parameters?: JsonObject;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* A mapping of actions that can be fired by the block to action handlers.
|
|
103
|
-
*
|
|
104
|
-
* The exact meaning of the parameters depends on the block type.
|
|
105
|
-
*/
|
|
106
|
-
actions?: Record<string, ActionDefinition>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Mapping of the events the block can listen to and emit.
|
|
110
|
-
*
|
|
111
|
-
* The exact meaning of the parameters depends on the block type.
|
|
112
|
-
*/
|
|
113
|
-
events?: {
|
|
114
|
-
listen?: Record<string, string>;
|
|
115
|
-
emit?: Record<string, string>;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* A list of roles that are allowed to view this block.
|
|
120
|
-
*/
|
|
121
|
-
roles?: string[];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* OpenID Connect specifies a set of standard claims about the end-user, which cover common profile
|
|
126
|
-
* information such as name, contact details, date of birth and locale.
|
|
127
|
-
*
|
|
128
|
-
* The Connect2id server can be set up to provide additional custom claims, such as roles and
|
|
129
|
-
* permissions.
|
|
130
|
-
*/
|
|
131
|
-
export interface UserInfo {
|
|
132
|
-
/**
|
|
133
|
-
* The subject (end-user) identifier. This member is always present in a claims set.
|
|
134
|
-
*/
|
|
135
|
-
sub: string;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* The full name of the end-user, with optional language tag.
|
|
139
|
-
*/
|
|
140
|
-
name: string;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* The end-user's preferred email address.
|
|
144
|
-
*/
|
|
145
|
-
email: string;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* True if the end-user's email address has been verified, else false.
|
|
149
|
-
*/
|
|
150
|
-
email_verified: boolean;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* The URL of the profile picture for the end-user.
|
|
154
|
-
*/
|
|
155
|
-
picture?: string;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* A URL that links to the user profile.
|
|
159
|
-
*/
|
|
160
|
-
profile?: string;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* The end-user’s locale, represented as a BCP47 language tag.
|
|
164
|
-
*/
|
|
165
|
-
locale?: string;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* The end-user’s time zone.
|
|
169
|
-
*/
|
|
170
|
-
zoneinfo?: string;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* The payload stored in our JSON web tokens
|
|
175
|
-
*/
|
|
176
|
-
export interface JwtPayload {
|
|
177
|
-
aud: string;
|
|
178
|
-
exp: number;
|
|
179
|
-
iat: string;
|
|
180
|
-
iss: string;
|
|
181
|
-
scope: string;
|
|
182
|
-
sub: string;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* A response for a login token request
|
|
187
|
-
*/
|
|
188
|
-
export interface TokenResponse {
|
|
189
|
-
/**
|
|
190
|
-
* The bearer access token to use for authenticating requests.
|
|
191
|
-
*/
|
|
192
|
-
access_token: string;
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* How long until the access token expires in seconds from now.
|
|
196
|
-
*/
|
|
197
|
-
expires_in?: number;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* The OpenID ID token as a JWT.
|
|
201
|
-
*
|
|
202
|
-
* This field is only present on OpenID connect providers.
|
|
203
|
-
*/
|
|
204
|
-
id_token?: string;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* A refresh token for getting a new access token.
|
|
208
|
-
*/
|
|
209
|
-
refresh_token?: string;
|
|
210
|
-
|
|
211
|
-
token_type: 'bearer';
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
interface BaseICSRemapper {
|
|
215
|
-
/**
|
|
216
|
-
* The start of the icalendar event.
|
|
217
|
-
*/
|
|
218
|
-
start: Remapper;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* The title of the event.
|
|
222
|
-
*/
|
|
223
|
-
title: Remapper;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* An optional description of the event.
|
|
227
|
-
*/
|
|
228
|
-
description?: Remapper;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* An optional link to attach to the event.
|
|
232
|
-
*/
|
|
233
|
-
url?: Remapper;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* An optional location description to attach to the event.
|
|
237
|
-
*/
|
|
238
|
-
location?: Remapper;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* An optional geolocation description to attach to the event.
|
|
242
|
-
*
|
|
243
|
-
* This must be an object with the properties `lat` or `latitude`, and `lon`, `lng` or
|
|
244
|
-
* `longitude`.
|
|
245
|
-
*/
|
|
246
|
-
coordinates?: Remapper;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
interface DurationICSRemapper extends BaseICSRemapper {
|
|
250
|
-
/**
|
|
251
|
-
* The duration of the event.
|
|
252
|
-
*
|
|
253
|
-
* @example '1w 3d 10h 30m'
|
|
254
|
-
*/
|
|
255
|
-
duration: Remapper;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
interface EndTimeICSRemapper extends BaseICSRemapper {
|
|
259
|
-
/**
|
|
260
|
-
* The end time of the event as a date or a date string.
|
|
261
|
-
*/
|
|
262
|
-
end: Remapper;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export interface Remappers {
|
|
266
|
-
/**
|
|
267
|
-
* Get app metadata.
|
|
268
|
-
*
|
|
269
|
-
* Supported properties:
|
|
270
|
-
*
|
|
271
|
-
* - `id`: Get the app id.
|
|
272
|
-
* - `locale`: Get the current locale of the app.
|
|
273
|
-
* - `url`: Get the base URL of the app.
|
|
274
|
-
*/
|
|
275
|
-
app: 'id' | 'locale' | 'url';
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Get page metadata.
|
|
279
|
-
*
|
|
280
|
-
* Supported properties:
|
|
281
|
-
*
|
|
282
|
-
* - `data`: Get the current page data.
|
|
283
|
-
* - `url`: Get the URL of the current page.
|
|
284
|
-
*/
|
|
285
|
-
page: 'data' | 'url';
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Get a property from the context.
|
|
289
|
-
*/
|
|
290
|
-
context: string;
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Convert a string to a date using a given format.
|
|
294
|
-
*/
|
|
295
|
-
'date.parse': string;
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Returns the current date.
|
|
299
|
-
*/
|
|
300
|
-
'date.now': unknown;
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Adds to a date.
|
|
304
|
-
*/
|
|
305
|
-
'date.add': string;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Compare all computed remapper values against each other.
|
|
309
|
-
*
|
|
310
|
-
* Returns `true` if all entries are equal, otherwise `false`.
|
|
311
|
-
*/
|
|
312
|
-
equals: Remapper[];
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Compares the first computed remapper value with the second computed remapper value.
|
|
316
|
-
*
|
|
317
|
-
* Returns `true` of the first entry is greater than the second entry.
|
|
318
|
-
*/
|
|
319
|
-
gt: [Remapper, Remapper];
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Compares the first computed remapper value with the second computed remapper value.
|
|
323
|
-
*
|
|
324
|
-
* Returns `true` of the first entry is less than the second entry.
|
|
325
|
-
*/
|
|
326
|
-
lt: [Remapper, Remapper];
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Builds an array based on the given data and remappers.
|
|
330
|
-
*
|
|
331
|
-
* The remappers gets applied to each item in the array.
|
|
332
|
-
*
|
|
333
|
-
* Always returns an array, can be empty if supplied data isn’t an array.
|
|
334
|
-
*/
|
|
335
|
-
'array.map': Remapper;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Filters out unique entries from an array.
|
|
339
|
-
*
|
|
340
|
-
* The value Remapper is applied to each entry in the array,
|
|
341
|
-
* using its result to determine uniqueness.
|
|
342
|
-
*
|
|
343
|
-
* If the value Remapper result in `undefined` or `null`, the entire entry is used for uniqueness.
|
|
344
|
-
*
|
|
345
|
-
* If the input is not an array, the input is returned without any modifications.
|
|
346
|
-
*/
|
|
347
|
-
'array.unique': Remapper;
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Create an icalendar event.
|
|
351
|
-
*/
|
|
352
|
-
ics: DurationICSRemapper | EndTimeICSRemapper;
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Checks if condition results in a truthy value.
|
|
356
|
-
*
|
|
357
|
-
* Returns value of then if condition is truthy, otherwise it returns the value of else.
|
|
358
|
-
*/
|
|
359
|
-
if: { condition: Remapper; then: Remapper; else: Remapper };
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Get the current array.map’s index or length.
|
|
363
|
-
*
|
|
364
|
-
* Returns nothing if array.map’s context isn’t set.
|
|
365
|
-
*/
|
|
366
|
-
array: 'index' | 'length';
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Create a new array with an array of predefined remappers.
|
|
370
|
-
*/
|
|
371
|
-
'array.from': Remapper[];
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Append new values to the end of an array.
|
|
375
|
-
*
|
|
376
|
-
* If the input is not an array an empty array is returned.
|
|
377
|
-
*/
|
|
378
|
-
'array.append': Remapper[];
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Remove item(s) from an array given a predefined array of remappable indices.
|
|
382
|
-
*
|
|
383
|
-
* Only the remapped values that are turned into numbers are applied.
|
|
384
|
-
*
|
|
385
|
-
* If the input is not an array an empty array is returned.
|
|
386
|
-
*/
|
|
387
|
-
'array.omit': Remapper[];
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* Create a new object given some predefined mapper keys.
|
|
391
|
-
*/
|
|
392
|
-
'object.from': Record<string, Remapper>;
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Assign properties to an existing object given some predefined mapper keys.
|
|
396
|
-
*/
|
|
397
|
-
'object.assign': Record<string, Remapper>;
|
|
398
|
-
|
|
399
|
-
/**
|
|
400
|
-
* Remove properties from an existing object based on the given the object keys.
|
|
401
|
-
*
|
|
402
|
-
* Nested properties can be removed using arrays of keys.
|
|
403
|
-
*
|
|
404
|
-
* @example
|
|
405
|
-
* ```yaml
|
|
406
|
-
* object.omit:
|
|
407
|
-
* - foo # Removes the property foo
|
|
408
|
-
* - - bar # Removes the property baz inside of bar
|
|
409
|
-
* - baz
|
|
410
|
-
* ```
|
|
411
|
-
*/
|
|
412
|
-
'object.omit': (string[] | string)[];
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Use a static value.
|
|
416
|
-
*/
|
|
417
|
-
static: any;
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Get a property from an object.
|
|
421
|
-
*
|
|
422
|
-
* If the prop is an array, nested properties will be retrieved in sequence.
|
|
423
|
-
*/
|
|
424
|
-
prop: number[] | string[] | number | string;
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Recursively strip all nullish values from an object or array.
|
|
428
|
-
*/
|
|
429
|
-
'null.strip': {
|
|
430
|
-
depth: number;
|
|
431
|
-
} | null;
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Pick and return a random entry from an array.
|
|
435
|
-
*
|
|
436
|
-
* If the input is not an array, the input is returned as-is.
|
|
437
|
-
*/
|
|
438
|
-
'random.choice': null;
|
|
439
|
-
/**
|
|
440
|
-
* Pick and return a random entry from an array.
|
|
441
|
-
*
|
|
442
|
-
* If the input is not an array, the input is returned as-is.
|
|
443
|
-
*/
|
|
444
|
-
'random.integer': [number, number];
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Pick and return a random entry from an array.
|
|
448
|
-
*
|
|
449
|
-
* If the input is not an array, the input is returned as-is.
|
|
450
|
-
*/
|
|
451
|
-
'random.float': [number, number];
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* Pick and return a random entry from an array.
|
|
455
|
-
*
|
|
456
|
-
* If the input is not an array, the input is returned as-is.
|
|
457
|
-
*/
|
|
458
|
-
'random.string': { choice: string; length: number };
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Get the input data as it was initially passed to the remap function.
|
|
462
|
-
*/
|
|
463
|
-
root: null;
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Get the data at a certain index from the history stack prior to an action.
|
|
467
|
-
*
|
|
468
|
-
* 0 is the index of the first item in the history stack.
|
|
469
|
-
*/
|
|
470
|
-
history: number;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Create a new object with properties from the history stack at a certain index.
|
|
474
|
-
*/
|
|
475
|
-
'from.history': {
|
|
476
|
-
/**
|
|
477
|
-
* The index of the history stack item to apply.
|
|
478
|
-
*
|
|
479
|
-
* 0 is the index of the first item in the history stack.
|
|
480
|
-
*/
|
|
481
|
-
index: number;
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Predefined mapper keys to choose what properties to apply.
|
|
485
|
-
*/
|
|
486
|
-
props: Record<string, Remapper>;
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Assign properties from the history stack at a certain index to an existing object.
|
|
491
|
-
*/
|
|
492
|
-
'assign.history': {
|
|
493
|
-
/**
|
|
494
|
-
* The index of the history stack item to assign.
|
|
495
|
-
*
|
|
496
|
-
* 0 is the index of the first item in the history stack.
|
|
497
|
-
*/
|
|
498
|
-
index: number;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Predefined mapper keys to choose what properties to assign.
|
|
502
|
-
*/
|
|
503
|
-
props: Record<string, Remapper>;
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Assign properties from the history stack at a certain index and exclude the unwanted.
|
|
508
|
-
*/
|
|
509
|
-
'omit.history': {
|
|
510
|
-
/**
|
|
511
|
-
* The index of the history stack item to assign.
|
|
512
|
-
*
|
|
513
|
-
* 0 is the index of the first item in the history stack.
|
|
514
|
-
*/
|
|
515
|
-
index: number;
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* Exclude properties from the history stack item, based on the given object keys.
|
|
519
|
-
*
|
|
520
|
-
* Nested properties can be excluded using arrays of keys.
|
|
521
|
-
*
|
|
522
|
-
* @example
|
|
523
|
-
* ```yaml
|
|
524
|
-
* omit.history:
|
|
525
|
-
* index: 0
|
|
526
|
-
* keys:
|
|
527
|
-
* - foo # Excludes the property foo
|
|
528
|
-
* - - bar # Excludes the property baz inside of bar
|
|
529
|
-
* - baz
|
|
530
|
-
* ```
|
|
531
|
-
*/
|
|
532
|
-
keys: (string[] | string)[];
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Convert an input to lower or upper case.
|
|
537
|
-
*/
|
|
538
|
-
'string.case': 'lower' | 'upper';
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* Format a string using remapped input variables.
|
|
542
|
-
*/
|
|
543
|
-
'string.format': {
|
|
544
|
-
/**
|
|
545
|
-
* The message id pointing to the template string to format.
|
|
546
|
-
*/
|
|
547
|
-
messageId?: string;
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* The template default string to format.
|
|
551
|
-
*/
|
|
552
|
-
template?: string;
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* A set of remappers to convert the input to usable values.
|
|
556
|
-
*/
|
|
557
|
-
values?: Record<string, Remapper>;
|
|
558
|
-
};
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* Match the content with the regex in the key, and replace it with its value.
|
|
562
|
-
*/
|
|
563
|
-
'string.replace': Record<string, string>;
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* Translate using a messageID.
|
|
567
|
-
*
|
|
568
|
-
* This does not support parameters, for more nuanced translations use `string.format`.
|
|
569
|
-
*/
|
|
570
|
-
translate: string;
|
|
571
|
-
|
|
572
|
-
user: keyof UserInfo;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
export type Remapper =
|
|
576
|
-
| RequireExactlyOne<Remappers>
|
|
577
|
-
| RequireExactlyOne<Remappers>[]
|
|
578
|
-
| boolean
|
|
579
|
-
| number
|
|
580
|
-
| string;
|
|
581
|
-
|
|
582
|
-
export interface SubscriptionResponseResource {
|
|
583
|
-
create: boolean;
|
|
584
|
-
update: boolean;
|
|
585
|
-
delete: boolean;
|
|
586
|
-
subscriptions?: Record<
|
|
587
|
-
string,
|
|
588
|
-
{
|
|
589
|
-
create?: boolean;
|
|
590
|
-
update: boolean;
|
|
591
|
-
delete: boolean;
|
|
592
|
-
}
|
|
593
|
-
>;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
export type SubscriptionResponse = Record<string, SubscriptionResponseResource>;
|
|
597
|
-
|
|
598
|
-
export interface RoleDefinition {
|
|
599
|
-
description?: string;
|
|
600
|
-
inherits?: string[];
|
|
601
|
-
defaultPage?: string;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
export interface Security {
|
|
605
|
-
default: {
|
|
606
|
-
role: string;
|
|
607
|
-
policy?: 'everyone' | 'invite' | 'organization';
|
|
608
|
-
};
|
|
609
|
-
|
|
610
|
-
roles: Record<string, RoleDefinition>;
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Define how teams are handled by the app.
|
|
614
|
-
*/
|
|
615
|
-
teams?: TeamsDefinition;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
export type Navigation = 'bottom' | 'hidden' | 'left-menu';
|
|
619
|
-
export type LayoutPosition = 'hidden' | 'navbar' | 'navigation';
|
|
620
|
-
|
|
621
|
-
export interface NotificationDefinition {
|
|
622
|
-
to?: string[];
|
|
623
|
-
subscribe?: 'all' | 'both' | 'single';
|
|
624
|
-
data?: {
|
|
625
|
-
title: string;
|
|
626
|
-
content: string;
|
|
627
|
-
link: string;
|
|
628
|
-
};
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* A collection of hooks that are triggered upon calling a resource actions.
|
|
633
|
-
*/
|
|
634
|
-
export interface ResourceHooks {
|
|
635
|
-
notification: NotificationDefinition;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
export interface ResourceCall {
|
|
639
|
-
/**
|
|
640
|
-
* The HTTP method to use for making the HTTP request.
|
|
641
|
-
*/
|
|
642
|
-
method?: HTTPMethods;
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* The URL to which to make the resource request.
|
|
646
|
-
*/
|
|
647
|
-
url?: string;
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* The associated hooks with the resource action.
|
|
651
|
-
*/
|
|
652
|
-
hooks?: ResourceHooks;
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* Query parameters to pass along with the request.
|
|
656
|
-
*/
|
|
657
|
-
query?: Remapper;
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* The roles that are allowed to perform this action.
|
|
661
|
-
*/
|
|
662
|
-
roles?: string[];
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
interface ResourceReferenceAction {
|
|
666
|
-
trigger: ('create' | 'delete' | 'update')[];
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
interface ResourceReference {
|
|
670
|
-
/**
|
|
671
|
-
* The name of the referenced resource.
|
|
672
|
-
*/
|
|
673
|
-
resource: string;
|
|
674
|
-
|
|
675
|
-
create?: ResourceReferenceAction;
|
|
676
|
-
update?: ResourceReferenceAction;
|
|
677
|
-
delete?: ResourceReferenceAction;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
export interface ResourceHistoryDefinition {
|
|
681
|
-
/**
|
|
682
|
-
* If set to `false`, edits are still tracked, but exactly what changed is lost.
|
|
683
|
-
*/
|
|
684
|
-
data: boolean;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
export interface ResourceView {
|
|
688
|
-
/**
|
|
689
|
-
* The roles required to use this view.
|
|
690
|
-
*/
|
|
691
|
-
roles: string[];
|
|
692
|
-
|
|
693
|
-
/**
|
|
694
|
-
* The remappers used to transform the output.
|
|
695
|
-
*/
|
|
696
|
-
remap: Remapper;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
export interface ResourceDefinition {
|
|
700
|
-
/**
|
|
701
|
-
* The default list of roles used for permission checks for each action.
|
|
702
|
-
*/
|
|
703
|
-
roles?: string[];
|
|
704
|
-
|
|
705
|
-
/**
|
|
706
|
-
* A definition of how versioning should happen for instances of this resource.
|
|
707
|
-
*/
|
|
708
|
-
history?: ResourceHistoryDefinition | boolean;
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* The definition for the `resource.create` action.
|
|
712
|
-
*/
|
|
713
|
-
create?: ResourceCall;
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* The definition for the `resource.delete` action.
|
|
717
|
-
*/
|
|
718
|
-
delete?: ResourceCall;
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* The definition for the `resource.get` action.
|
|
722
|
-
*/
|
|
723
|
-
get?: ResourceCall;
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* The definition for the `resource.query` action.
|
|
727
|
-
*/
|
|
728
|
-
query?: ResourceCall;
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* The definition for the `resource.count` action.
|
|
732
|
-
*/
|
|
733
|
-
count?: ResourceCall;
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* The definition for the `resource.update` action.
|
|
737
|
-
*/
|
|
738
|
-
update?: ResourceCall;
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* The property to use as the id.
|
|
742
|
-
*
|
|
743
|
-
* @default `id`
|
|
744
|
-
*/
|
|
745
|
-
id?: string;
|
|
746
|
-
|
|
747
|
-
/**
|
|
748
|
-
* The JSON schema to validate resources against before sending it to the backend.
|
|
749
|
-
*/
|
|
750
|
-
schema: OpenAPIV3.SchemaObject;
|
|
751
|
-
|
|
752
|
-
/**
|
|
753
|
-
* The URL to post the resource to.
|
|
754
|
-
*
|
|
755
|
-
* @default autogenerated for use with the Appsemble resource API.
|
|
756
|
-
*/
|
|
757
|
-
url?: string;
|
|
758
|
-
|
|
759
|
-
/**
|
|
760
|
-
* The alternate views of this resource.
|
|
761
|
-
*/
|
|
762
|
-
views?: Record<string, ResourceView>;
|
|
763
|
-
|
|
764
|
-
/**
|
|
765
|
-
* The references this resources has to other resources.
|
|
766
|
-
*/
|
|
767
|
-
references?: Record<string, ResourceReference>;
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* A time string representing when a resource should expire.
|
|
771
|
-
*
|
|
772
|
-
* @example '1d 8h 30m'
|
|
773
|
-
*/
|
|
774
|
-
expires?: string;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
export interface BaseActionDefinition<T extends Action['type']> {
|
|
778
|
-
/**
|
|
779
|
-
* The type of the action.
|
|
780
|
-
*/
|
|
781
|
-
type: T;
|
|
782
|
-
|
|
783
|
-
/**
|
|
784
|
-
* A remapper function. This may be used to remap data before it is passed into the action
|
|
785
|
-
* function.
|
|
786
|
-
*
|
|
787
|
-
* @deprecated Since 0.20.10, use {@link remapBefore} instead.
|
|
788
|
-
*/
|
|
789
|
-
remap?: Remapper;
|
|
790
|
-
|
|
791
|
-
/**
|
|
792
|
-
* A remapper function. This may be used to remap data before it is passed into the action
|
|
793
|
-
* function.
|
|
794
|
-
*/
|
|
795
|
-
remapBefore?: Remapper;
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
* The remapper used to transfrom the output before passing it to the next action.
|
|
799
|
-
*/
|
|
800
|
-
remapAfter?: Remapper;
|
|
801
|
-
|
|
802
|
-
/**
|
|
803
|
-
* Another action that is dispatched when the action has been dispatched successfully.
|
|
804
|
-
*/
|
|
805
|
-
onSuccess?: ActionDefinition;
|
|
806
|
-
|
|
807
|
-
/**
|
|
808
|
-
* Another action that is dispatched when the action has failed to dispatch successfully.
|
|
809
|
-
*/
|
|
810
|
-
onError?: ActionDefinition;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
export interface AnalyticsAction extends BaseActionDefinition<'analytics'> {
|
|
814
|
-
/**
|
|
815
|
-
* The analytics event target name.
|
|
816
|
-
*/
|
|
817
|
-
target: string;
|
|
818
|
-
|
|
819
|
-
/**
|
|
820
|
-
* Additional config to pass to analytics.
|
|
821
|
-
*/
|
|
822
|
-
config?: Remapper;
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
export interface ConditionActionDefinition extends BaseActionDefinition<'condition'> {
|
|
826
|
-
/**
|
|
827
|
-
* The condition to check for.
|
|
828
|
-
*/
|
|
829
|
-
if: Remapper;
|
|
830
|
-
|
|
831
|
-
/**
|
|
832
|
-
* The action to run if the condition is true.
|
|
833
|
-
*/
|
|
834
|
-
then: ActionDefinition;
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
* The action to run if the condition is false.
|
|
838
|
-
*/
|
|
839
|
-
else: ActionDefinition;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
export interface DialogActionDefinition extends BaseActionDefinition<'dialog'> {
|
|
843
|
-
/**
|
|
844
|
-
* If false, the dialog cannot be closed by clicking outside of the dialog or on the close button.
|
|
845
|
-
*/
|
|
846
|
-
closable?: boolean;
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
* If true, the dialog will be displayed full screen.
|
|
850
|
-
*/
|
|
851
|
-
fullscreen?: boolean;
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Blocks to render on the dialog.
|
|
855
|
-
*/
|
|
856
|
-
blocks: BlockDefinition[];
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* The title to show in the dialog.
|
|
860
|
-
*/
|
|
861
|
-
title?: Remapper;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
export interface DownloadActionDefinition extends BaseActionDefinition<'download'> {
|
|
865
|
-
/**
|
|
866
|
-
* The filename to download the file as. It must include a file extension.
|
|
867
|
-
*/
|
|
868
|
-
filename: string;
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
export interface EachActionDefinition extends BaseActionDefinition<'each'> {
|
|
872
|
-
/**
|
|
873
|
-
* Run an action for each entry in an array.
|
|
874
|
-
*
|
|
875
|
-
* The actions are run in parallel.
|
|
876
|
-
*
|
|
877
|
-
* If the input is not an array, the action will be applied to the input instead.
|
|
878
|
-
*/
|
|
879
|
-
do: ActionDefinition;
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
export interface EmailActionDefinition extends BaseActionDefinition<'email'> {
|
|
883
|
-
/**
|
|
884
|
-
* The recipient of the email.
|
|
885
|
-
*/
|
|
886
|
-
to?: Remapper;
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* The name of the sender.
|
|
890
|
-
*
|
|
891
|
-
* The default value depends on the email server.
|
|
892
|
-
*/
|
|
893
|
-
from?: Remapper;
|
|
894
|
-
|
|
895
|
-
/**
|
|
896
|
-
* The recipients to CC the email to.
|
|
897
|
-
*/
|
|
898
|
-
cc?: Remapper;
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* The recipients to BCC the email to.
|
|
902
|
-
*/
|
|
903
|
-
bcc?: Remapper;
|
|
904
|
-
|
|
905
|
-
/**
|
|
906
|
-
* The subject of the email.
|
|
907
|
-
*/
|
|
908
|
-
subject: Remapper;
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* The body of the email.
|
|
912
|
-
*/
|
|
913
|
-
body: Remapper;
|
|
914
|
-
|
|
915
|
-
/**
|
|
916
|
-
* The attachments to include in the email.
|
|
917
|
-
*
|
|
918
|
-
* The remapper must resolve to an object containing the following properties:
|
|
919
|
-
*
|
|
920
|
-
* - \`target\`: The asset ID or link to download contents from to add as an attachment. This is
|
|
921
|
-
* mutually exclusive with \`content\`.
|
|
922
|
-
* - \`content\`: The raw content to include as the file content. This is mutually exclusive with
|
|
923
|
-
* \`target\`.
|
|
924
|
-
* - \`filename\`: The filename to include the attachment as.
|
|
925
|
-
* - \`accept\` If the target is a URL, this will be set as the HTTP \`Accept\` header when
|
|
926
|
-
* downloading the file.
|
|
927
|
-
*
|
|
928
|
-
* If the attachment is a string, it will be treated as the target.
|
|
929
|
-
*/
|
|
930
|
-
attachments?: Remapper;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
export interface FlowToActionDefinition extends BaseActionDefinition<'flow.to'> {
|
|
934
|
-
/**
|
|
935
|
-
* The flow step to go to.
|
|
936
|
-
*/
|
|
937
|
-
step: Remapper;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
export interface LinkActionDefinition extends BaseActionDefinition<'link'> {
|
|
941
|
-
/**
|
|
942
|
-
* Where to link to.
|
|
943
|
-
*
|
|
944
|
-
* This should be a page name.
|
|
945
|
-
*/
|
|
946
|
-
to: string[] | string;
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
export interface LogActionDefinition extends BaseActionDefinition<'log'> {
|
|
950
|
-
/**
|
|
951
|
-
* The logging level on which to log.
|
|
952
|
-
*
|
|
953
|
-
* @default `info`.
|
|
954
|
-
*/
|
|
955
|
-
level?: LogAction['level'];
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
export interface ShareActionDefinition extends BaseActionDefinition<'share'> {
|
|
959
|
-
/**
|
|
960
|
-
* The URL that is being shared.
|
|
961
|
-
*/
|
|
962
|
-
url?: Remapper;
|
|
963
|
-
|
|
964
|
-
/**
|
|
965
|
-
* The main body that is being shared.
|
|
966
|
-
*/
|
|
967
|
-
text?: Remapper;
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* The title that is being shared, if supported.
|
|
971
|
-
*/
|
|
972
|
-
title?: Remapper;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
export type StorageType = 'appStorage' | 'indexedDB' | 'localStorage' | 'sessionStorage';
|
|
976
|
-
|
|
977
|
-
export interface StorageAppendActionDefinition extends BaseActionDefinition<'storage.append'> {
|
|
978
|
-
/**
|
|
979
|
-
* The key of the entry to write to the app’s storage.
|
|
980
|
-
*/
|
|
981
|
-
key: Remapper;
|
|
982
|
-
|
|
983
|
-
/**
|
|
984
|
-
* The data to write to the app’s storage.
|
|
985
|
-
*/
|
|
986
|
-
value: Remapper;
|
|
987
|
-
|
|
988
|
-
/**
|
|
989
|
-
* The mechanism used to read the data from.
|
|
990
|
-
*
|
|
991
|
-
* @default 'indexedDB'
|
|
992
|
-
*/
|
|
993
|
-
storage?: StorageType;
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
export interface StorageDeleteActionDefinition extends BaseActionDefinition<'storage.delete'> {
|
|
997
|
-
/**
|
|
998
|
-
* The key of the entry to delete from the app’s storage.
|
|
999
|
-
*/
|
|
1000
|
-
key: Remapper;
|
|
1001
|
-
|
|
1002
|
-
/**
|
|
1003
|
-
* The mechanism used to delete the data from.
|
|
1004
|
-
*
|
|
1005
|
-
* @default 'indexedDB'
|
|
1006
|
-
*/
|
|
1007
|
-
storage?: StorageType;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
export interface StorageSubtractActionDefinition extends BaseActionDefinition<'storage.subtract'> {
|
|
1011
|
-
/**
|
|
1012
|
-
* The key of the entry to subtract the last entry from
|
|
1013
|
-
*/
|
|
1014
|
-
key: Remapper;
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* The mechanism used to read the data from.
|
|
1018
|
-
*
|
|
1019
|
-
* @default 'indexedDB'
|
|
1020
|
-
*/
|
|
1021
|
-
storage?: StorageType;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
export interface StorageUpdateActionDefinition extends BaseActionDefinition<'storage.update'> {
|
|
1025
|
-
/**
|
|
1026
|
-
* The key of the entry to write to the app’s storage.
|
|
1027
|
-
*/
|
|
1028
|
-
key: Remapper;
|
|
1029
|
-
|
|
1030
|
-
/**
|
|
1031
|
-
* The key of the item to update.
|
|
1032
|
-
*/
|
|
1033
|
-
item: Remapper;
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
* The data to update the specified item with.
|
|
1037
|
-
*/
|
|
1038
|
-
value: Remapper;
|
|
1039
|
-
|
|
1040
|
-
/**
|
|
1041
|
-
* The mechanism used to read the data from.
|
|
1042
|
-
*
|
|
1043
|
-
* @default 'indexedDB'
|
|
1044
|
-
*/
|
|
1045
|
-
storage?: StorageType;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
export interface StorageReadActionDefinition extends BaseActionDefinition<'storage.read'> {
|
|
1049
|
-
/**
|
|
1050
|
-
* The key of the entry to read from the app’s storage.
|
|
1051
|
-
*/
|
|
1052
|
-
key: Remapper;
|
|
1053
|
-
|
|
1054
|
-
/**
|
|
1055
|
-
* The mechanism used to read the data from.
|
|
1056
|
-
*
|
|
1057
|
-
* @default 'indexedDB'
|
|
1058
|
-
*/
|
|
1059
|
-
storage?: StorageType;
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
export interface StorageWriteActionDefinition extends BaseActionDefinition<'storage.write'> {
|
|
1063
|
-
/**
|
|
1064
|
-
* The key of the entry to write to the app’s storage.
|
|
1065
|
-
*/
|
|
1066
|
-
key: Remapper;
|
|
1067
|
-
|
|
1068
|
-
/**
|
|
1069
|
-
* The data to write to the app’s storage.
|
|
1070
|
-
*/
|
|
1071
|
-
value: Remapper;
|
|
1072
|
-
|
|
1073
|
-
/**
|
|
1074
|
-
* The mechanism used to read the data from.
|
|
1075
|
-
*
|
|
1076
|
-
* @default 'indexedDB'
|
|
1077
|
-
*/
|
|
1078
|
-
storage?: StorageType;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
export interface TeamInviteActionDefinition extends BaseActionDefinition<'team.invite'> {
|
|
1082
|
-
/**
|
|
1083
|
-
* The ID of the team to invite the user to.
|
|
1084
|
-
*/
|
|
1085
|
-
id?: Remapper;
|
|
1086
|
-
|
|
1087
|
-
/**
|
|
1088
|
-
* The email address of the user to invite.
|
|
1089
|
-
*/
|
|
1090
|
-
email?: Remapper;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
export interface UserLoginAction extends BaseActionDefinition<'user.login'> {
|
|
1094
|
-
/**
|
|
1095
|
-
* The email address to login with.
|
|
1096
|
-
*/
|
|
1097
|
-
email: Remapper;
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* The password to login with.
|
|
1101
|
-
*/
|
|
1102
|
-
password: Remapper;
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
export interface UserRegisterAction extends BaseActionDefinition<'user.register'> {
|
|
1106
|
-
/**
|
|
1107
|
-
* The email address to login with.
|
|
1108
|
-
*/
|
|
1109
|
-
email: Remapper;
|
|
1110
|
-
|
|
1111
|
-
/**
|
|
1112
|
-
* The password to login with.
|
|
1113
|
-
*/
|
|
1114
|
-
password: Remapper;
|
|
1115
|
-
|
|
1116
|
-
/**
|
|
1117
|
-
* The display name of the user.
|
|
1118
|
-
*/
|
|
1119
|
-
displayName: Remapper;
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* The profile picture to use.
|
|
1123
|
-
*
|
|
1124
|
-
* This must be a file, otherwise it’s discarded.
|
|
1125
|
-
*/
|
|
1126
|
-
picture?: Remapper;
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* Custom properties that can be assigned freely.
|
|
1130
|
-
*
|
|
1131
|
-
* Every value will be converted to a string.
|
|
1132
|
-
*/
|
|
1133
|
-
properties?: Remapper;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
export interface UserUpdateAction extends BaseActionDefinition<'user.update'> {
|
|
1137
|
-
/**
|
|
1138
|
-
* The email address to update.
|
|
1139
|
-
*/
|
|
1140
|
-
email?: Remapper;
|
|
1141
|
-
|
|
1142
|
-
/**
|
|
1143
|
-
* The password to update.
|
|
1144
|
-
*/
|
|
1145
|
-
password?: Remapper;
|
|
1146
|
-
|
|
1147
|
-
/**
|
|
1148
|
-
* The display name to update.
|
|
1149
|
-
*/
|
|
1150
|
-
displayName?: Remapper;
|
|
1151
|
-
|
|
1152
|
-
/**
|
|
1153
|
-
* The profile picture to update.
|
|
1154
|
-
*
|
|
1155
|
-
* This must be a file, otherwise it’s ignored.
|
|
1156
|
-
*/
|
|
1157
|
-
picture?: Remapper;
|
|
1158
|
-
|
|
1159
|
-
/**
|
|
1160
|
-
* Custom properties that can be assigned freely.
|
|
1161
|
-
*
|
|
1162
|
-
* Every value will be converted to a string.
|
|
1163
|
-
*/
|
|
1164
|
-
properties?: Remapper;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
export interface RequestLikeActionDefinition<T extends Action['type'] = Action['type']>
|
|
1168
|
-
extends BaseActionDefinition<T> {
|
|
1169
|
-
/**
|
|
1170
|
-
* The HTTP method to use for making a request.
|
|
1171
|
-
*/
|
|
1172
|
-
method?: HTTPMethods;
|
|
1173
|
-
|
|
1174
|
-
/**
|
|
1175
|
-
* Whether or not to proxy the request through the Appsemble proxy endpoint.
|
|
1176
|
-
*
|
|
1177
|
-
* @default true
|
|
1178
|
-
*/
|
|
1179
|
-
proxy?: boolean;
|
|
1180
|
-
|
|
1181
|
-
/**
|
|
1182
|
-
* A JSON schema against which to validate data before uploading.
|
|
1183
|
-
*/
|
|
1184
|
-
schema?: OpenAPIV3.SchemaObject;
|
|
1185
|
-
|
|
1186
|
-
/**
|
|
1187
|
-
* Query parameters to pass along with the request.
|
|
1188
|
-
*/
|
|
1189
|
-
query?: Remapper;
|
|
1190
|
-
|
|
1191
|
-
/**
|
|
1192
|
-
* The URL to which to make the request.
|
|
1193
|
-
*/
|
|
1194
|
-
url?: Remapper;
|
|
1195
|
-
|
|
1196
|
-
/**
|
|
1197
|
-
* A remapper for the request body.
|
|
1198
|
-
*
|
|
1199
|
-
* If this isn’t specified, the raw input data is used.
|
|
1200
|
-
*/
|
|
1201
|
-
body?: Remapper;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
interface ResourceActionDefinition<T extends Action['type']>
|
|
1205
|
-
extends RequestLikeActionDefinition<T> {
|
|
1206
|
-
/**
|
|
1207
|
-
* The name of the resource.
|
|
1208
|
-
*/
|
|
1209
|
-
resource: string;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
interface ViewResourceDefinition {
|
|
1213
|
-
/**
|
|
1214
|
-
* The view to use for the request.
|
|
1215
|
-
*/
|
|
1216
|
-
view?: string;
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
export type RequestActionDefinition = RequestLikeActionDefinition<'request'>;
|
|
1220
|
-
export type ResourceCreateActionDefinition = ResourceActionDefinition<'resource.create'>;
|
|
1221
|
-
export type ResourceDeleteActionDefinition = ResourceActionDefinition<'resource.delete'>;
|
|
1222
|
-
export type ResourceGetActionDefinition = ResourceActionDefinition<'resource.get'> &
|
|
1223
|
-
ViewResourceDefinition;
|
|
1224
|
-
export type ResourceQueryActionDefinition = ResourceActionDefinition<'resource.query'> &
|
|
1225
|
-
ViewResourceDefinition;
|
|
1226
|
-
export type ResourceCountActionDefinition = ResourceActionDefinition<'resource.count'>;
|
|
1227
|
-
export type ResourceUpdateActionDefinition = ResourceActionDefinition<'resource.update'>;
|
|
1228
|
-
|
|
1229
|
-
export interface BaseResourceSubscribeActionDefinition<T extends Action['type']>
|
|
1230
|
-
extends BaseActionDefinition<T> {
|
|
1231
|
-
/**
|
|
1232
|
-
* The name of the resource.
|
|
1233
|
-
*/
|
|
1234
|
-
resource: string;
|
|
1235
|
-
|
|
1236
|
-
/**
|
|
1237
|
-
* The action to subscribe to. Defaults to `update` if not specified.
|
|
1238
|
-
*/
|
|
1239
|
-
action?: 'create' | 'delete' | 'update';
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
export type ResourceSubscriptionSubscribeActionDefinition =
|
|
1243
|
-
BaseResourceSubscribeActionDefinition<'resource.subscription.subscribe'>;
|
|
1244
|
-
|
|
1245
|
-
export type ResourceSubscriptionUnsubscribeActionDefinition =
|
|
1246
|
-
BaseResourceSubscribeActionDefinition<'resource.subscription.unsubscribe'>;
|
|
1247
|
-
|
|
1248
|
-
export type ResourceSubscriptionToggleActionDefinition =
|
|
1249
|
-
BaseResourceSubscribeActionDefinition<'resource.subscription.toggle'>;
|
|
1250
|
-
|
|
1251
|
-
export type ResourceSubscriptionStatusActionDefinition = Omit<
|
|
1252
|
-
BaseResourceSubscribeActionDefinition<'resource.subscription.status'>,
|
|
1253
|
-
'action'
|
|
1254
|
-
>;
|
|
1255
|
-
|
|
1256
|
-
export interface EventActionDefinition extends BaseActionDefinition<'event'> {
|
|
1257
|
-
/**
|
|
1258
|
-
* The name of the event to emit to.
|
|
1259
|
-
*/
|
|
1260
|
-
event: string;
|
|
1261
|
-
|
|
1262
|
-
/**
|
|
1263
|
-
* An event to wait for before resolving.
|
|
1264
|
-
*
|
|
1265
|
-
* If this is unspecified, the action will resolve with the input data.
|
|
1266
|
-
*/
|
|
1267
|
-
waitFor?: string;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
export interface StaticActionDefinition extends BaseActionDefinition<'static'> {
|
|
1271
|
-
/**
|
|
1272
|
-
* The value to return.
|
|
1273
|
-
*/
|
|
1274
|
-
value: any;
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
export interface BaseMessage {
|
|
1278
|
-
/**
|
|
1279
|
-
* The color to use for the message.
|
|
1280
|
-
*
|
|
1281
|
-
* @default 'info'
|
|
1282
|
-
*/
|
|
1283
|
-
color?: BulmaColor;
|
|
1284
|
-
|
|
1285
|
-
/**
|
|
1286
|
-
* The timeout period for this message (in milliseconds).
|
|
1287
|
-
*
|
|
1288
|
-
* @default 5000
|
|
1289
|
-
*/
|
|
1290
|
-
timeout?: number;
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* Whether or not to show the dismiss button.
|
|
1294
|
-
*
|
|
1295
|
-
* @default false
|
|
1296
|
-
*/
|
|
1297
|
-
dismissable?: boolean;
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
export type MessageActionDefinition = BaseActionDefinition<'message'> &
|
|
1301
|
-
BaseMessage & {
|
|
1302
|
-
/**
|
|
1303
|
-
* The content of the message to display.
|
|
1304
|
-
*/
|
|
1305
|
-
body: Remapper;
|
|
1306
|
-
};
|
|
1307
|
-
|
|
1308
|
-
export type ActionDefinition =
|
|
1309
|
-
| AnalyticsAction
|
|
1310
|
-
| BaseActionDefinition<'dialog.error'>
|
|
1311
|
-
| BaseActionDefinition<'dialog.ok'>
|
|
1312
|
-
| BaseActionDefinition<'flow.back'>
|
|
1313
|
-
| BaseActionDefinition<'flow.cancel'>
|
|
1314
|
-
| BaseActionDefinition<'flow.finish'>
|
|
1315
|
-
| BaseActionDefinition<'flow.next'>
|
|
1316
|
-
| BaseActionDefinition<'link.back'>
|
|
1317
|
-
| BaseActionDefinition<'link.next'>
|
|
1318
|
-
| BaseActionDefinition<'noop'>
|
|
1319
|
-
| BaseActionDefinition<'team.join'>
|
|
1320
|
-
| BaseActionDefinition<'team.list'>
|
|
1321
|
-
| BaseActionDefinition<'throw'>
|
|
1322
|
-
| ConditionActionDefinition
|
|
1323
|
-
| DialogActionDefinition
|
|
1324
|
-
| DownloadActionDefinition
|
|
1325
|
-
| EachActionDefinition
|
|
1326
|
-
| EmailActionDefinition
|
|
1327
|
-
| EventActionDefinition
|
|
1328
|
-
| FlowToActionDefinition
|
|
1329
|
-
| LinkActionDefinition
|
|
1330
|
-
| LogActionDefinition
|
|
1331
|
-
| MessageActionDefinition
|
|
1332
|
-
| RequestActionDefinition
|
|
1333
|
-
| ResourceCountActionDefinition
|
|
1334
|
-
| ResourceCreateActionDefinition
|
|
1335
|
-
| ResourceDeleteActionDefinition
|
|
1336
|
-
| ResourceGetActionDefinition
|
|
1337
|
-
| ResourceQueryActionDefinition
|
|
1338
|
-
| ResourceSubscriptionStatusActionDefinition
|
|
1339
|
-
| ResourceSubscriptionSubscribeActionDefinition
|
|
1340
|
-
| ResourceSubscriptionToggleActionDefinition
|
|
1341
|
-
| ResourceSubscriptionUnsubscribeActionDefinition
|
|
1342
|
-
| ResourceUpdateActionDefinition
|
|
1343
|
-
| ShareActionDefinition
|
|
1344
|
-
| StaticActionDefinition
|
|
1345
|
-
| StorageAppendActionDefinition
|
|
1346
|
-
| StorageDeleteActionDefinition
|
|
1347
|
-
| StorageReadActionDefinition
|
|
1348
|
-
| StorageSubtractActionDefinition
|
|
1349
|
-
| StorageUpdateActionDefinition
|
|
1350
|
-
| StorageWriteActionDefinition
|
|
1351
|
-
| TeamInviteActionDefinition
|
|
1352
|
-
| UserLoginAction
|
|
1353
|
-
| UserRegisterAction
|
|
1354
|
-
| UserUpdateAction;
|
|
1355
|
-
|
|
1356
|
-
export interface ActionType {
|
|
1357
|
-
/**
|
|
1358
|
-
* Whether or not app creators are required to define this action.
|
|
1359
|
-
*/
|
|
1360
|
-
required?: boolean;
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* The description of the action.
|
|
1364
|
-
*/
|
|
1365
|
-
description?: string;
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
export interface EventType {
|
|
1369
|
-
/**
|
|
1370
|
-
* The description of the action.
|
|
1371
|
-
*/
|
|
1372
|
-
description?: string;
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
export interface BlockManifest {
|
|
1376
|
-
/**
|
|
1377
|
-
* A block manifest as it is available to the app and in the SDK.
|
|
1378
|
-
* pattern: ^@[a-z]([a-z\d-]{0,30}[a-z\d])?\/[a-z]([a-z\d-]{0,30}[a-z\d])$
|
|
1379
|
-
* The name of a block.
|
|
1380
|
-
*/
|
|
1381
|
-
name: string;
|
|
1382
|
-
|
|
1383
|
-
/**
|
|
1384
|
-
* The description of the block.
|
|
1385
|
-
*/
|
|
1386
|
-
description?: string;
|
|
1387
|
-
|
|
1388
|
-
/**
|
|
1389
|
-
* The long description of the block.
|
|
1390
|
-
*
|
|
1391
|
-
* This is displayed when rendering block documentation and supports Markdown.
|
|
1392
|
-
*/
|
|
1393
|
-
longDescription?: string;
|
|
1394
|
-
|
|
1395
|
-
/**
|
|
1396
|
-
* A [semver](https://semver.org) representation of the block version.
|
|
1397
|
-
*
|
|
1398
|
-
* Pattern:
|
|
1399
|
-
* ^\d+\.\d+\.\d+$
|
|
1400
|
-
*/
|
|
1401
|
-
version: string;
|
|
1402
|
-
|
|
1403
|
-
/**
|
|
1404
|
-
* The type of layout to be used for the block.
|
|
1405
|
-
*/
|
|
1406
|
-
layout?: 'float' | 'grow' | 'hidden' | 'static' | null;
|
|
1407
|
-
|
|
1408
|
-
/**
|
|
1409
|
-
* Array of urls associated to the files of the block.
|
|
1410
|
-
*/
|
|
1411
|
-
files: string[];
|
|
1412
|
-
|
|
1413
|
-
/**
|
|
1414
|
-
* The actions that are supported by a block.
|
|
1415
|
-
*/
|
|
1416
|
-
actions?: Record<string, ActionType>;
|
|
1417
|
-
|
|
1418
|
-
/**
|
|
1419
|
-
* The messages that are supported by a block.
|
|
1420
|
-
*/
|
|
1421
|
-
messages?: Record<string, Record<string, any> | never>;
|
|
1422
|
-
|
|
1423
|
-
/**
|
|
1424
|
-
* The events that are supported by a block.
|
|
1425
|
-
*/
|
|
1426
|
-
events?: {
|
|
1427
|
-
listen?: Record<string, EventType>;
|
|
1428
|
-
emit?: Record<string, EventType>;
|
|
1429
|
-
};
|
|
1430
|
-
|
|
1431
|
-
/**
|
|
1432
|
-
* A JSON schema to validate block parameters.
|
|
1433
|
-
*/
|
|
1434
|
-
parameters?: Schema;
|
|
1435
|
-
|
|
1436
|
-
/**
|
|
1437
|
-
* The URL that can be used to fetch this block’s icon.
|
|
1438
|
-
*/
|
|
1439
|
-
iconUrl?: string;
|
|
1440
|
-
|
|
1441
|
-
/**
|
|
1442
|
-
* The languages that are supported by the block by default.
|
|
1443
|
-
*
|
|
1444
|
-
* If the block has no messages, this property is `null`.
|
|
1445
|
-
*/
|
|
1446
|
-
languages: string[] | null;
|
|
1447
|
-
|
|
1448
|
-
examples?: string[];
|
|
1449
|
-
|
|
1450
|
-
/**
|
|
1451
|
-
* Whether the block should be listed publicly
|
|
1452
|
-
* for users who aren’t part of the block’s organization.
|
|
1453
|
-
*
|
|
1454
|
-
* - **`public`**: The block is visible for everyone.
|
|
1455
|
-
* - **`unlisted`**: The block will only be visible if the user is
|
|
1456
|
-
* logged in and is part of the block’s organization.
|
|
1457
|
-
*/
|
|
1458
|
-
visibility?: 'public' | 'unlisted';
|
|
1459
|
-
|
|
1460
|
-
/**
|
|
1461
|
-
* Whether action validation for wildcard action is skipped.
|
|
1462
|
-
*/
|
|
1463
|
-
wildcardActions?: boolean;
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
/**
|
|
1467
|
-
* This describes what a page will look like in the app.
|
|
1468
|
-
*/
|
|
1469
|
-
export interface BasePageDefinition {
|
|
1470
|
-
/**
|
|
1471
|
-
* The name of the page.
|
|
1472
|
-
*
|
|
1473
|
-
* This will be displayed at the *app bar* of each page and in the side menu,
|
|
1474
|
-
* unless @see navTitle is set.
|
|
1475
|
-
*
|
|
1476
|
-
* The name of the page is used to determine the URL path of the page.
|
|
1477
|
-
*/
|
|
1478
|
-
name: string;
|
|
1479
|
-
|
|
1480
|
-
/**
|
|
1481
|
-
* Whether or not the page name should be displayed in the *app bar*.
|
|
1482
|
-
*/
|
|
1483
|
-
hideName?: boolean;
|
|
1484
|
-
|
|
1485
|
-
/**
|
|
1486
|
-
* The name of the page when displayed in the navigation menu.
|
|
1487
|
-
*
|
|
1488
|
-
* Context property `name` can be used to access the name of the page.
|
|
1489
|
-
*/
|
|
1490
|
-
navTitle?: Remapper;
|
|
1491
|
-
|
|
1492
|
-
/**
|
|
1493
|
-
* Whether or not the page should be displayed in navigational menus.
|
|
1494
|
-
*/
|
|
1495
|
-
hideNavTitle?: boolean;
|
|
1496
|
-
|
|
1497
|
-
/**
|
|
1498
|
-
* The navigation type to use for the page.
|
|
1499
|
-
* Setting this will override the default navigation for the app.
|
|
1500
|
-
*/
|
|
1501
|
-
navigation?: Navigation;
|
|
1502
|
-
|
|
1503
|
-
/**
|
|
1504
|
-
* A list of roles that may view the page.
|
|
1505
|
-
*/
|
|
1506
|
-
roles?: string[];
|
|
1507
|
-
|
|
1508
|
-
/**
|
|
1509
|
-
* An optional icon from the fontawesome icon set
|
|
1510
|
-
*
|
|
1511
|
-
* This will be displayed in the navigation menu.
|
|
1512
|
-
*/
|
|
1513
|
-
icon?: IconName;
|
|
1514
|
-
|
|
1515
|
-
/**
|
|
1516
|
-
* Page parameters can be used for linking to a page that should display a single resource.
|
|
1517
|
-
*/
|
|
1518
|
-
parameters?: string[];
|
|
1519
|
-
|
|
1520
|
-
/**
|
|
1521
|
-
* The global theme for the page.
|
|
1522
|
-
*/
|
|
1523
|
-
theme?: Partial<Theme>;
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
|
-
/**
|
|
1527
|
-
* A subset of page for use within flow pages and tab pages.
|
|
1528
|
-
*/
|
|
1529
|
-
export interface SubPage {
|
|
1530
|
-
name: string;
|
|
1531
|
-
blocks: BlockDefinition[];
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
export interface BasicPageDefinition extends BasePageDefinition {
|
|
1535
|
-
type?: 'page';
|
|
1536
|
-
blocks: BlockDefinition[];
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
export interface FlowPageDefinition extends BasePageDefinition {
|
|
1540
|
-
type: 'flow';
|
|
1541
|
-
steps: SubPage[];
|
|
1542
|
-
|
|
1543
|
-
/**
|
|
1544
|
-
* A mapping of actions that can be fired by the page to action handlers.
|
|
1545
|
-
*/
|
|
1546
|
-
actions?: {
|
|
1547
|
-
onFlowCancel?: ActionDefinition;
|
|
1548
|
-
onFlowFinish?: ActionDefinition;
|
|
1549
|
-
};
|
|
1550
|
-
|
|
1551
|
-
/**
|
|
1552
|
-
* The method used to display the progress of the flow page.
|
|
1553
|
-
*
|
|
1554
|
-
* @default 'corner-dots'
|
|
1555
|
-
*/
|
|
1556
|
-
progress?: 'corner-dots' | 'hidden';
|
|
1557
|
-
|
|
1558
|
-
/**
|
|
1559
|
-
* Whether to retain the flow data when navigating away to another page outside the flow.
|
|
1560
|
-
*
|
|
1561
|
-
* By default the flow page retains it's data after navigating once. Set to false to clear it.
|
|
1562
|
-
*
|
|
1563
|
-
* @default true
|
|
1564
|
-
*/
|
|
1565
|
-
retainFlowData?: boolean;
|
|
1566
|
-
}
|
|
1567
|
-
|
|
1568
|
-
export interface TabsPageDefinition extends BasePageDefinition {
|
|
1569
|
-
type: 'tabs';
|
|
1570
|
-
tabs: SubPage[];
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
export type PageDefinition = BasicPageDefinition | FlowPageDefinition | TabsPageDefinition;
|
|
1574
|
-
|
|
1575
|
-
export interface AppDefinition {
|
|
1576
|
-
/**
|
|
1577
|
-
* The name of the app.
|
|
1578
|
-
*
|
|
1579
|
-
* This determines the default path of the app.
|
|
1580
|
-
*/
|
|
1581
|
-
name?: string;
|
|
1582
|
-
|
|
1583
|
-
/**
|
|
1584
|
-
* The description of the app.
|
|
1585
|
-
*/
|
|
1586
|
-
description?: string;
|
|
1587
|
-
|
|
1588
|
-
/**
|
|
1589
|
-
* The default language of the app.
|
|
1590
|
-
*
|
|
1591
|
-
* @default 'en'
|
|
1592
|
-
*/
|
|
1593
|
-
defaultLanguage?: string;
|
|
1594
|
-
|
|
1595
|
-
/**
|
|
1596
|
-
* The security definition of the app.
|
|
1597
|
-
*
|
|
1598
|
-
* This determines user roles and login behavior.
|
|
1599
|
-
*/
|
|
1600
|
-
security?: Security;
|
|
1601
|
-
|
|
1602
|
-
/**
|
|
1603
|
-
* A list of roles that are required to view pages. Specific page roles override this property.
|
|
1604
|
-
*/
|
|
1605
|
-
roles?: string[];
|
|
1606
|
-
|
|
1607
|
-
/**
|
|
1608
|
-
* The default page of the app.
|
|
1609
|
-
*/
|
|
1610
|
-
defaultPage: string;
|
|
1611
|
-
|
|
1612
|
-
/**
|
|
1613
|
-
* The settings for the layout of the app.
|
|
1614
|
-
*/
|
|
1615
|
-
layout?: {
|
|
1616
|
-
/**
|
|
1617
|
-
* The location of the login button.
|
|
1618
|
-
*
|
|
1619
|
-
* @default 'navbar'
|
|
1620
|
-
*/
|
|
1621
|
-
login?: LayoutPosition;
|
|
1622
|
-
|
|
1623
|
-
/**
|
|
1624
|
-
* The location of the settings button.
|
|
1625
|
-
*
|
|
1626
|
-
* If set to `navigation`, it will only be visible if `login` is also visible in `navigation`.
|
|
1627
|
-
*
|
|
1628
|
-
* @default 'navbar'
|
|
1629
|
-
*/
|
|
1630
|
-
settings?: LayoutPosition;
|
|
1631
|
-
|
|
1632
|
-
/**
|
|
1633
|
-
* The location of the feedback button
|
|
1634
|
-
*
|
|
1635
|
-
* If set to `navigation`, it will only be visible if `login` is also visible in `navigation`.
|
|
1636
|
-
*
|
|
1637
|
-
* @default 'navbar'
|
|
1638
|
-
*/
|
|
1639
|
-
feedback?: LayoutPosition;
|
|
1640
|
-
|
|
1641
|
-
/**
|
|
1642
|
-
* The navigation type to use.
|
|
1643
|
-
*
|
|
1644
|
-
* If this is omitted, a collapsable side navigation menu will be rendered on the left.
|
|
1645
|
-
*
|
|
1646
|
-
* @default 'left-menu'
|
|
1647
|
-
*/
|
|
1648
|
-
navigation?: Navigation;
|
|
1649
|
-
};
|
|
1650
|
-
|
|
1651
|
-
/**
|
|
1652
|
-
* The strategy to use for apps to subscribe to push notifications.
|
|
1653
|
-
*
|
|
1654
|
-
* If this is omitted, push notifications can not be sent.
|
|
1655
|
-
*/
|
|
1656
|
-
notifications?: 'opt-in' | 'startup';
|
|
1657
|
-
|
|
1658
|
-
/**
|
|
1659
|
-
* The pages of the app.
|
|
1660
|
-
*/
|
|
1661
|
-
pages: PageDefinition[];
|
|
1662
|
-
|
|
1663
|
-
/**
|
|
1664
|
-
* Resource definitions that may be used by the app.
|
|
1665
|
-
*/
|
|
1666
|
-
resources?: Record<string, ResourceDefinition>;
|
|
1667
|
-
|
|
1668
|
-
/**
|
|
1669
|
-
* The global theme for the app.
|
|
1670
|
-
*/
|
|
1671
|
-
theme?: Partial<Theme>;
|
|
1672
|
-
|
|
1673
|
-
/**
|
|
1674
|
-
* Helper property that can be used to store YAML anchors.
|
|
1675
|
-
*
|
|
1676
|
-
* This is omitted any time the API serves the app definition.
|
|
1677
|
-
*/
|
|
1678
|
-
anchors?: any[];
|
|
1679
|
-
|
|
1680
|
-
/**
|
|
1681
|
-
* Cron jobs associated with the app.
|
|
1682
|
-
*/
|
|
1683
|
-
cron?: Record<string, CronDefinition>;
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
/**
|
|
1687
|
-
* The definition of a cron job for an app.
|
|
1688
|
-
*/
|
|
1689
|
-
export interface CronDefinition {
|
|
1690
|
-
schedule: string;
|
|
1691
|
-
action: ActionDefinition;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
export interface App {
|
|
1695
|
-
/**
|
|
1696
|
-
* The unique identifier for the app.
|
|
1697
|
-
*
|
|
1698
|
-
* This value will be generated automatically by the API.
|
|
1699
|
-
*/
|
|
1700
|
-
id?: number;
|
|
1701
|
-
|
|
1702
|
-
/*
|
|
1703
|
-
* A domain name on which this app should be served.
|
|
1704
|
-
*/
|
|
1705
|
-
domain?: string;
|
|
1706
|
-
|
|
1707
|
-
/**
|
|
1708
|
-
* The name used for emails
|
|
1709
|
-
*/
|
|
1710
|
-
emailName?: string;
|
|
1711
|
-
|
|
1712
|
-
/**
|
|
1713
|
-
* The id of the organization this app belongs to.
|
|
1714
|
-
*/
|
|
1715
|
-
OrganizationId?: string;
|
|
1716
|
-
|
|
1717
|
-
/**
|
|
1718
|
-
* The name of the organization this app belongs to.
|
|
1719
|
-
*/
|
|
1720
|
-
OrganizationName?: string;
|
|
1721
|
-
|
|
1722
|
-
/**
|
|
1723
|
-
* The long description of the app.
|
|
1724
|
-
*/
|
|
1725
|
-
longDescription: string;
|
|
1726
|
-
|
|
1727
|
-
/**
|
|
1728
|
-
* The path the app is available from.
|
|
1729
|
-
*/
|
|
1730
|
-
path: string;
|
|
1731
|
-
|
|
1732
|
-
/**
|
|
1733
|
-
* Visibility of the app in the public app store.
|
|
1734
|
-
*/
|
|
1735
|
-
visibility: AppVisibility;
|
|
1736
|
-
|
|
1737
|
-
/**
|
|
1738
|
-
* Whether or not the app definition is exposed for display in Appsemble Studio.
|
|
1739
|
-
*/
|
|
1740
|
-
showAppDefinition: boolean;
|
|
1741
|
-
|
|
1742
|
-
/**
|
|
1743
|
-
* The Google analytics ID of the app.
|
|
1744
|
-
*/
|
|
1745
|
-
googleAnalyticsID?: string;
|
|
1746
|
-
|
|
1747
|
-
/**
|
|
1748
|
-
* Whether the app is currently locked.
|
|
1749
|
-
*/
|
|
1750
|
-
locked: boolean;
|
|
1751
|
-
|
|
1752
|
-
/**
|
|
1753
|
-
* Whether the Appsemble password login method should be shown.
|
|
1754
|
-
*/
|
|
1755
|
-
showAppsembleLogin: boolean;
|
|
1756
|
-
|
|
1757
|
-
/**
|
|
1758
|
-
* Whether the Appsemble OAuth2 login method should be shown.
|
|
1759
|
-
*/
|
|
1760
|
-
showAppsembleOAuth2Login: boolean;
|
|
1761
|
-
|
|
1762
|
-
/**
|
|
1763
|
-
* The Sentry DSN of the app.
|
|
1764
|
-
*/
|
|
1765
|
-
sentryDsn: string;
|
|
1766
|
-
|
|
1767
|
-
/**
|
|
1768
|
-
* The Sentry environment associated with the Sentry DSN.
|
|
1769
|
-
*/
|
|
1770
|
-
sentryEnvironment: string;
|
|
1771
|
-
|
|
1772
|
-
/**
|
|
1773
|
-
* The app definition.
|
|
1774
|
-
*/
|
|
1775
|
-
definition: AppDefinition;
|
|
1776
|
-
|
|
1777
|
-
/**
|
|
1778
|
-
* The app definition formatted as YAML.
|
|
1779
|
-
*/
|
|
1780
|
-
yaml: string;
|
|
1781
|
-
|
|
1782
|
-
/**
|
|
1783
|
-
* An app rating.
|
|
1784
|
-
*/
|
|
1785
|
-
rating?: {
|
|
1786
|
-
/**
|
|
1787
|
-
* The number of people who rated the app.
|
|
1788
|
-
*/
|
|
1789
|
-
count: number;
|
|
1790
|
-
|
|
1791
|
-
/**
|
|
1792
|
-
* The average app rating.
|
|
1793
|
-
*/
|
|
1794
|
-
average: number;
|
|
1795
|
-
};
|
|
1796
|
-
|
|
1797
|
-
/**
|
|
1798
|
-
* Whether the app has clonable resources.
|
|
1799
|
-
*/
|
|
1800
|
-
resources?: boolean;
|
|
1801
|
-
|
|
1802
|
-
/**
|
|
1803
|
-
* A list of URLs to app screenshots
|
|
1804
|
-
*/
|
|
1805
|
-
screenshotUrls?: string[];
|
|
1806
|
-
|
|
1807
|
-
/**
|
|
1808
|
-
* True if the app has its own icon.
|
|
1809
|
-
*/
|
|
1810
|
-
hasIcon: boolean;
|
|
1811
|
-
|
|
1812
|
-
/**
|
|
1813
|
-
* True if the app supports a maskable icon.
|
|
1814
|
-
*/
|
|
1815
|
-
hasMaskableIcon: boolean;
|
|
1816
|
-
|
|
1817
|
-
/**
|
|
1818
|
-
* The background color used for maskable icons.
|
|
1819
|
-
*/
|
|
1820
|
-
iconBackground: string;
|
|
1821
|
-
|
|
1822
|
-
/**
|
|
1823
|
-
* An app icon url
|
|
1824
|
-
*/
|
|
1825
|
-
iconUrl?: string;
|
|
1826
|
-
|
|
1827
|
-
/**
|
|
1828
|
-
* The creation date of the app.
|
|
1829
|
-
*/
|
|
1830
|
-
$created?: string;
|
|
1831
|
-
|
|
1832
|
-
/**
|
|
1833
|
-
* The date when the app was last updated.
|
|
1834
|
-
*/
|
|
1835
|
-
$updated?: string;
|
|
1836
|
-
|
|
1837
|
-
/**
|
|
1838
|
-
* Any pre-included translations of the app.
|
|
1839
|
-
*/
|
|
1840
|
-
messages?: AppsembleMessages;
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
/**
|
|
1844
|
-
* A rating given to an app.
|
|
1845
|
-
*/
|
|
1846
|
-
export interface Rating {
|
|
1847
|
-
/**
|
|
1848
|
-
* A value ranging between 1 and 5 representing the rating
|
|
1849
|
-
*/
|
|
1850
|
-
rating: number;
|
|
1851
|
-
|
|
1852
|
-
/**
|
|
1853
|
-
* An optional description of why the rating was given
|
|
1854
|
-
*/
|
|
1855
|
-
description?: string;
|
|
1856
|
-
|
|
1857
|
-
/**
|
|
1858
|
-
* The name of the user who rated the app.
|
|
1859
|
-
*/
|
|
1860
|
-
name: string;
|
|
1861
|
-
|
|
1862
|
-
/**
|
|
1863
|
-
* The ID of the user who rated the app.
|
|
1864
|
-
*/
|
|
1865
|
-
UserId: string;
|
|
1866
|
-
|
|
1867
|
-
/**
|
|
1868
|
-
* The creation date of the rating.
|
|
1869
|
-
*/
|
|
1870
|
-
$created: string;
|
|
1871
|
-
|
|
1872
|
-
/**
|
|
1873
|
-
* The date of the last time the rating was updated
|
|
1874
|
-
*/
|
|
1875
|
-
$updated: string;
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
/**
|
|
1879
|
-
* The representation of an organization within Appsemble.
|
|
1880
|
-
*/
|
|
1881
|
-
export interface Organization {
|
|
1882
|
-
/**
|
|
1883
|
-
* The ID of the organization.
|
|
1884
|
-
*
|
|
1885
|
-
* This typically is prepended with an `@`
|
|
1886
|
-
*/
|
|
1887
|
-
id: string;
|
|
1888
|
-
|
|
1889
|
-
/**
|
|
1890
|
-
* The display name of the organization.
|
|
1891
|
-
*/
|
|
1892
|
-
name: string;
|
|
1893
|
-
|
|
1894
|
-
/**
|
|
1895
|
-
* The description of the organization.
|
|
1896
|
-
*/
|
|
1897
|
-
description: string;
|
|
1898
|
-
|
|
1899
|
-
/**
|
|
1900
|
-
* The website of the organization.
|
|
1901
|
-
*/
|
|
1902
|
-
website: string;
|
|
1903
|
-
|
|
1904
|
-
/**
|
|
1905
|
-
* The email address that can be used to contact the organization.
|
|
1906
|
-
*/
|
|
1907
|
-
email: string;
|
|
1908
|
-
|
|
1909
|
-
/**
|
|
1910
|
-
* The URL at which the organization’s icon can be found.
|
|
1911
|
-
*/
|
|
1912
|
-
iconUrl: string;
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
/**
|
|
1916
|
-
* An invite for an organization.
|
|
1917
|
-
*/
|
|
1918
|
-
export interface OrganizationInvite {
|
|
1919
|
-
/**
|
|
1920
|
-
* The email address of the user to invite.
|
|
1921
|
-
*/
|
|
1922
|
-
email: string;
|
|
1923
|
-
|
|
1924
|
-
/**
|
|
1925
|
-
* The role the user should get when accepting the invite.
|
|
1926
|
-
*/
|
|
1927
|
-
role: string;
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
/**
|
|
1931
|
-
* A member of an app.
|
|
1932
|
-
*/
|
|
1933
|
-
export interface AppMember {
|
|
1934
|
-
id: string;
|
|
1935
|
-
name: string;
|
|
1936
|
-
primaryEmail: string;
|
|
1937
|
-
role: string;
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
/**
|
|
1941
|
-
* The layout used to store Appsemble messages.
|
|
1942
|
-
*/
|
|
1943
|
-
export interface AppsembleMessages {
|
|
1944
|
-
/**
|
|
1945
|
-
* Messages related to the Appsemble core.
|
|
1946
|
-
*
|
|
1947
|
-
* This may be an empty object if the language is the default locale.
|
|
1948
|
-
*/
|
|
1949
|
-
core: Record<string, string>;
|
|
1950
|
-
|
|
1951
|
-
/**
|
|
1952
|
-
* Translations for global block messages and meta properties of the app.
|
|
1953
|
-
*
|
|
1954
|
-
* This may be an empty object if the language is the default locale.
|
|
1955
|
-
*/
|
|
1956
|
-
app: Record<string, string>;
|
|
1957
|
-
|
|
1958
|
-
/**
|
|
1959
|
-
* A list of messages specific to the app.
|
|
1960
|
-
*/
|
|
1961
|
-
messageIds: Record<string, string>;
|
|
1962
|
-
|
|
1963
|
-
/**
|
|
1964
|
-
* A list of messages specific to each block used in the app.
|
|
1965
|
-
*
|
|
1966
|
-
* At root the keys represent a block type.
|
|
1967
|
-
* One layer deep the keys represent a block version.
|
|
1968
|
-
* Two layers deep the keys represent the key/message pairs.
|
|
1969
|
-
*
|
|
1970
|
-
* @example
|
|
1971
|
-
* {
|
|
1972
|
-
* "<at>example/test": {
|
|
1973
|
-
* "0.0.0": {
|
|
1974
|
-
* "exampleKey": "Example Message"
|
|
1975
|
-
* }
|
|
1976
|
-
* }
|
|
1977
|
-
* }
|
|
1978
|
-
*/
|
|
1979
|
-
blocks: Record<string, Record<string, Record<string, string>>>;
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
/**
|
|
1983
|
-
* Translated messages for an app or block.
|
|
1984
|
-
*/
|
|
1985
|
-
export interface Messages {
|
|
1986
|
-
/**
|
|
1987
|
-
* If true, force update app messages.
|
|
1988
|
-
*/
|
|
1989
|
-
force?: boolean;
|
|
1990
|
-
|
|
1991
|
-
/**
|
|
1992
|
-
* The language represented by these messages.
|
|
1993
|
-
*/
|
|
1994
|
-
language: string;
|
|
1995
|
-
|
|
1996
|
-
/**
|
|
1997
|
-
* A mapping of message id to message content.
|
|
1998
|
-
*/
|
|
1999
|
-
messages: AppsembleMessages;
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
export interface AppMessages {
|
|
2003
|
-
/**
|
|
2004
|
-
* The language represented by these messages.
|
|
2005
|
-
*/
|
|
2006
|
-
language: string;
|
|
2007
|
-
|
|
2008
|
-
/**
|
|
2009
|
-
* The messages available to the app
|
|
2010
|
-
*/
|
|
2011
|
-
messages: AppsembleMessages;
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
/**
|
|
2015
|
-
* A representation of an OAuth2 provider in Appsemble.
|
|
2016
|
-
*
|
|
2017
|
-
* This interface holds the properties needed to render a redirect button on the login or profile
|
|
2018
|
-
* screen.
|
|
2019
|
-
*/
|
|
2020
|
-
export interface OAuth2Provider {
|
|
2021
|
-
type?: 'oauth2';
|
|
2022
|
-
|
|
2023
|
-
/**
|
|
2024
|
-
* The OAuth2 redirect URL.
|
|
2025
|
-
*
|
|
2026
|
-
* The user will be redirected here. On this page the user will have to grant access to Appsemble
|
|
2027
|
-
* to log them in.
|
|
2028
|
-
*/
|
|
2029
|
-
authorizationUrl: string;
|
|
2030
|
-
|
|
2031
|
-
/**
|
|
2032
|
-
* The public client id which identifies Appsemble to the authorization server.
|
|
2033
|
-
*/
|
|
2034
|
-
clientId: string;
|
|
2035
|
-
|
|
2036
|
-
/**
|
|
2037
|
-
* A Font Awesome icon which represents the OAuth2 provider.
|
|
2038
|
-
*/
|
|
2039
|
-
icon: IconName;
|
|
2040
|
-
|
|
2041
|
-
/**
|
|
2042
|
-
* A display name which represents the OAuth2 provider.
|
|
2043
|
-
*
|
|
2044
|
-
* I.e. `Facebook`, `GitLab`, or `Google`.
|
|
2045
|
-
*/
|
|
2046
|
-
name: string;
|
|
2047
|
-
|
|
2048
|
-
/**
|
|
2049
|
-
* The login scope that will be requested from the authorization server.
|
|
2050
|
-
*
|
|
2051
|
-
* This is represented as a space separated list of scopes.
|
|
2052
|
-
*/
|
|
2053
|
-
scope: string;
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
|
-
export interface AppOAuth2Secret extends OAuth2Provider {
|
|
2057
|
-
/**
|
|
2058
|
-
* An autogenerated ID.
|
|
2059
|
-
*/
|
|
2060
|
-
id?: number;
|
|
2061
|
-
|
|
2062
|
-
/**
|
|
2063
|
-
* The OAuth2 client secret used to identify Appsemble as a client to the authorization server.
|
|
2064
|
-
*/
|
|
2065
|
-
clientSecret: string;
|
|
2066
|
-
|
|
2067
|
-
/**
|
|
2068
|
-
* The URL where tokens may be requested using the authorization code flow.
|
|
2069
|
-
*/
|
|
2070
|
-
tokenUrl: string;
|
|
2071
|
-
|
|
2072
|
-
/**
|
|
2073
|
-
* The URL from where to fetch user info.
|
|
2074
|
-
*/
|
|
2075
|
-
userInfoUrl?: string;
|
|
2076
|
-
|
|
2077
|
-
/**
|
|
2078
|
-
* The remapper to apply on the user info data.
|
|
2079
|
-
*/
|
|
2080
|
-
remapper: Remapper;
|
|
2081
|
-
}
|
|
2082
|
-
|
|
2083
|
-
export interface WritableAppSamlSecret {
|
|
2084
|
-
/**
|
|
2085
|
-
* The name that will be displayed on the login button.
|
|
2086
|
-
*/
|
|
2087
|
-
name: string;
|
|
2088
|
-
|
|
2089
|
-
/**
|
|
2090
|
-
* The icon that will be displayed on the login button.
|
|
2091
|
-
*/
|
|
2092
|
-
icon: IconName;
|
|
2093
|
-
|
|
2094
|
-
/**
|
|
2095
|
-
* The certificate of the identity provider.
|
|
2096
|
-
*/
|
|
2097
|
-
idpCertificate: string;
|
|
2098
|
-
|
|
2099
|
-
/**
|
|
2100
|
-
* The URL of the identity provider where SAML metadata is hosted.
|
|
2101
|
-
*/
|
|
2102
|
-
entityId: string;
|
|
2103
|
-
|
|
2104
|
-
/**
|
|
2105
|
-
* The URL of the identity provider where the user will be redirected to in order to login.
|
|
2106
|
-
*/
|
|
2107
|
-
ssoUrl: string;
|
|
2108
|
-
|
|
2109
|
-
/**
|
|
2110
|
-
* The custom SAML attribute that’s used to specify the user display name.
|
|
2111
|
-
*/
|
|
2112
|
-
nameAttribute: string;
|
|
2113
|
-
|
|
2114
|
-
/**
|
|
2115
|
-
* The custom SAML attribute that’s used to specify the user email address.
|
|
2116
|
-
*/
|
|
2117
|
-
emailAttribute: string;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
export interface AppSamlSecret extends WritableAppSamlSecret {
|
|
2121
|
-
/**
|
|
2122
|
-
* The unique ID of the secret.
|
|
2123
|
-
*/
|
|
2124
|
-
id?: number;
|
|
2125
|
-
|
|
2126
|
-
/**
|
|
2127
|
-
* When the secret was last updated.
|
|
2128
|
-
*/
|
|
2129
|
-
updated?: string;
|
|
2130
|
-
|
|
2131
|
-
/**
|
|
2132
|
-
* The SAML service provider certificate.
|
|
2133
|
-
*/
|
|
2134
|
-
spCertificate?: string;
|
|
2135
|
-
}
|
|
2136
|
-
|
|
2137
|
-
export type SAMLStatus =
|
|
2138
|
-
| 'badsignature'
|
|
2139
|
-
| 'emailconflict'
|
|
2140
|
-
| 'invalidrelaystate'
|
|
2141
|
-
| 'invalidsecret'
|
|
2142
|
-
| 'invalidstatuscode'
|
|
2143
|
-
| 'invalidsubjectconfirmation'
|
|
2144
|
-
| 'missingnameid'
|
|
2145
|
-
| 'missingsubject';
|
|
2146
|
-
|
|
2147
|
-
/**
|
|
2148
|
-
* The block configuration that’s used by the CLI when building a block.
|
|
2149
|
-
*
|
|
2150
|
-
* This configuration is also passed to the Webpack configuration function as the `env` variable.
|
|
2151
|
-
*/
|
|
2152
|
-
export interface BlockConfig
|
|
2153
|
-
extends Pick<
|
|
2154
|
-
BlockManifest,
|
|
2155
|
-
| 'actions'
|
|
2156
|
-
| 'description'
|
|
2157
|
-
| 'events'
|
|
2158
|
-
| 'layout'
|
|
2159
|
-
| 'longDescription'
|
|
2160
|
-
| 'messages'
|
|
2161
|
-
| 'name'
|
|
2162
|
-
| 'parameters'
|
|
2163
|
-
| 'version'
|
|
2164
|
-
| 'visibility'
|
|
2165
|
-
| 'wildcardActions'
|
|
2166
|
-
> {
|
|
2167
|
-
/**
|
|
2168
|
-
* The path to the webpack configuration file relative to the block project directory.
|
|
2169
|
-
*/
|
|
2170
|
-
webpack: string;
|
|
2171
|
-
|
|
2172
|
-
/**
|
|
2173
|
-
* The build output directory relative to the block project directory.
|
|
2174
|
-
*/
|
|
2175
|
-
output: string;
|
|
2176
|
-
|
|
2177
|
-
/**
|
|
2178
|
-
* The absolute directory of the block project.
|
|
2179
|
-
*/
|
|
2180
|
-
dir: string;
|
|
2181
|
-
}
|