@appsemble/types 0.30.14-test.6 → 0.32.1-test.15
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 +3 -3
- package/action.d.ts +4 -1
- package/index.d.ts +238 -76
- package/index.js +1 -0
- package/package.json +9 -6
- package/permissions.d.ts +1 -25
- package/permissions.js +0 -24
- package/resource.d.ts +2 -2
- package/roles.js +0 -10
- package/training.d.ts +60 -0
- package/training.js +2 -0
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Types
|
|
2
2
|
|
|
3
3
|
> Reusable TypeScript types
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/types)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.32.1-test.15)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -26,5 +26,5 @@ not guaranteed.
|
|
|
26
26
|
|
|
27
27
|
## License
|
|
28
28
|
|
|
29
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.32.1-test.15/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
package/action.d.ts
CHANGED
|
@@ -35,6 +35,9 @@ interface RequestLikeAction<T extends Action['type']> extends BaseAction<T> {
|
|
|
35
35
|
export type RequestAction = RequestLikeAction<'request'>;
|
|
36
36
|
export type ResourceCreateAction = RequestLikeAction<'resource.create'>;
|
|
37
37
|
export type ResourceDeleteAction = RequestLikeAction<'resource.delete'>;
|
|
38
|
+
export type ResourceUpdatePositionsAction = RequestLikeAction<'resource.update.positions'>;
|
|
39
|
+
export type ResourceDeleteAllAction = RequestLikeAction<'resource.delete.all'>;
|
|
40
|
+
export type ResourceDeleteBulkAction = RequestLikeAction<'resource.delete.bulk'>;
|
|
38
41
|
export type ResourceGetAction = RequestLikeAction<'resource.get'>;
|
|
39
42
|
export type ResourceHistoryGetAction = RequestLikeAction<'resource.history.get'>;
|
|
40
43
|
export type ResourceQueryAction = RequestLikeAction<'resource.query'>;
|
|
@@ -44,7 +47,7 @@ export type ResourcePatchAction = RequestLikeAction<'resource.patch'>;
|
|
|
44
47
|
/**
|
|
45
48
|
* An action that can be called from within a block.
|
|
46
49
|
*/
|
|
47
|
-
export type Action = BaseAction<'analytics'> | BaseAction<'app.member.current.patch'> | BaseAction<'app.member.delete'> | BaseAction<'app.member.invite'> | BaseAction<'app.member.login'> | BaseAction<'app.member.logout'> | BaseAction<'app.member.properties.patch'> | BaseAction<'app.member.query'> | BaseAction<'app.member.register'> | BaseAction<'app.member.role.update'> | BaseAction<'condition'> | BaseAction<'controller'> | BaseAction<'dialog.error'> | BaseAction<'dialog.ok'> | BaseAction<'dialog'> | BaseAction<'download'> | BaseAction<'each'> | BaseAction<'email'> | BaseAction<'event'> | BaseAction<'flow.back'> | BaseAction<'flow.cancel'> | BaseAction<'flow.finish'> | BaseAction<'flow.next'> | BaseAction<'flow.to'> | BaseAction<'group.member.delete'> | BaseAction<'group.member.invite'> | BaseAction<'group.member.query'> | BaseAction<'group.member.role.update'> | BaseAction<'group.query'> | BaseAction<'link.back'> | BaseAction<'link.next'> | BaseAction<'match'> | BaseAction<'message'> | BaseAction<'noop'> | BaseAction<'notify'> | BaseAction<'resource.subscription.status'> | BaseAction<'resource.subscription.subscribe'> | BaseAction<'resource.subscription.toggle'> | BaseAction<'resource.subscription.unsubscribe'> | BaseAction<'share'> | BaseAction<'static'> | BaseAction<'storage.append'> | BaseAction<'storage.delete'> | BaseAction<'storage.read'> | BaseAction<'storage.subtract'> | BaseAction<'storage.update'> | BaseAction<'storage.write'> | BaseAction<'throw'> | LinkAction | LogAction | RequestAction | ResourceCountAction | ResourceCreateAction | ResourceDeleteAction | ResourceGetAction | ResourceHistoryGetAction | ResourcePatchAction | ResourceQueryAction | ResourceUpdateAction;
|
|
50
|
+
export type Action = BaseAction<'analytics'> | BaseAction<'app.member.current.patch'> | BaseAction<'app.member.delete'> | BaseAction<'app.member.invite'> | BaseAction<'app.member.login'> | BaseAction<'app.member.logout'> | BaseAction<'app.member.properties.patch'> | BaseAction<'app.member.query'> | BaseAction<'app.member.register'> | BaseAction<'app.member.role.update'> | BaseAction<'condition'> | BaseAction<'controller'> | BaseAction<'dialog.error'> | BaseAction<'dialog.ok'> | BaseAction<'dialog'> | BaseAction<'download'> | BaseAction<'each'> | BaseAction<'email'> | BaseAction<'event'> | BaseAction<'flow.back'> | BaseAction<'flow.cancel'> | BaseAction<'flow.finish'> | BaseAction<'flow.next'> | BaseAction<'flow.to'> | BaseAction<'group.member.delete'> | BaseAction<'group.member.invite'> | BaseAction<'group.member.query'> | BaseAction<'group.member.role.update'> | BaseAction<'group.query'> | BaseAction<'link.back'> | BaseAction<'link.next'> | BaseAction<'match'> | BaseAction<'message'> | BaseAction<'noop'> | BaseAction<'notify'> | BaseAction<'resource.subscription.status'> | BaseAction<'resource.subscription.subscribe'> | BaseAction<'resource.subscription.toggle'> | BaseAction<'resource.subscription.unsubscribe'> | BaseAction<'share'> | BaseAction<'static'> | BaseAction<'storage.append'> | BaseAction<'storage.delete'> | BaseAction<'storage.read'> | BaseAction<'storage.subtract'> | BaseAction<'storage.update'> | BaseAction<'storage.write'> | BaseAction<'throw'> | LinkAction | LogAction | RequestAction | ResourceCountAction | ResourceCreateAction | ResourceDeleteAction | ResourceDeleteAllAction | ResourceDeleteBulkAction | ResourceGetAction | ResourceHistoryGetAction | ResourcePatchAction | ResourceQueryAction | ResourceUpdateAction | ResourceUpdatePositionsAction;
|
|
48
51
|
interface ActionErrorOptions<D extends ActionDefinition> {
|
|
49
52
|
/**
|
|
50
53
|
* What caused the error to be thrown.
|
package/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './ssl.js';
|
|
|
25
25
|
export * from './template.js';
|
|
26
26
|
export * from './theme.js';
|
|
27
27
|
export * from './oauth2.js';
|
|
28
|
+
export * from './training.js';
|
|
28
29
|
export * from './quota.js';
|
|
29
30
|
export * from './permissions.js';
|
|
30
31
|
export * from './roles.js';
|
|
@@ -155,6 +156,7 @@ export interface UserInfo extends BaseUserInfo {
|
|
|
155
156
|
* If the user is subscribed to the newsletter
|
|
156
157
|
*/
|
|
157
158
|
subscribed?: boolean;
|
|
159
|
+
hasPassword?: boolean;
|
|
158
160
|
}
|
|
159
161
|
export interface AppMemberInfo extends BaseUserInfo {
|
|
160
162
|
/**
|
|
@@ -267,6 +269,22 @@ interface EndTimeICSRemapper extends BaseICSRemapper {
|
|
|
267
269
|
*/
|
|
268
270
|
end: Remapper;
|
|
269
271
|
}
|
|
272
|
+
export interface SubstringCaseType {
|
|
273
|
+
/**
|
|
274
|
+
* Whether to match the case of the substring.
|
|
275
|
+
*/
|
|
276
|
+
strict?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Substring to match.
|
|
279
|
+
*/
|
|
280
|
+
substring: string;
|
|
281
|
+
}
|
|
282
|
+
type FilterParams = Record<string, {
|
|
283
|
+
type: 'Boolean' | 'Date' | 'Guid' | 'Number' | 'String';
|
|
284
|
+
value: Remapper;
|
|
285
|
+
comparator: 'eq' | 'ge' | 'gt' | 'le' | 'lt' | 'ne';
|
|
286
|
+
}>;
|
|
287
|
+
type OrderParams = Record<string, 'asc' | 'desc'>;
|
|
270
288
|
export interface Remappers {
|
|
271
289
|
/**
|
|
272
290
|
* Get app metadata.
|
|
@@ -353,6 +371,22 @@ export interface Remappers {
|
|
|
353
371
|
* If only one remapper or none is passed, the remapper value gets computed and then inverted.
|
|
354
372
|
*/
|
|
355
373
|
not: Remapper[];
|
|
374
|
+
/**
|
|
375
|
+
* Compare all computed remapper values against each other.
|
|
376
|
+
*
|
|
377
|
+
* Returns `true` if all entries are true, otherwise `false`.
|
|
378
|
+
*
|
|
379
|
+
* If only one remapper is passed, the remapper is returned.
|
|
380
|
+
*/
|
|
381
|
+
and: Remapper[];
|
|
382
|
+
/**
|
|
383
|
+
* Compare all computed remapper values against each other.
|
|
384
|
+
*
|
|
385
|
+
* Returns `false` if all entries are false, otherwise `true`.
|
|
386
|
+
*
|
|
387
|
+
* If only one remapper is passed, the remapper is returned.
|
|
388
|
+
*/
|
|
389
|
+
or: Remapper[];
|
|
356
390
|
/**
|
|
357
391
|
* Get data stored at the current flow page step
|
|
358
392
|
*/
|
|
@@ -437,7 +471,7 @@ export interface Remappers {
|
|
|
437
471
|
*
|
|
438
472
|
* Returns nothing if array.map’s context isn’t set.
|
|
439
473
|
*/
|
|
440
|
-
array: 'index' | 'item' | 'length';
|
|
474
|
+
array: 'index' | 'item' | 'length' | 'nextItem' | 'prevItem';
|
|
441
475
|
/**
|
|
442
476
|
*
|
|
443
477
|
* Returns an array containing the items matching the specified conditions.
|
|
@@ -487,6 +521,85 @@ export interface Remappers {
|
|
|
487
521
|
* ```
|
|
488
522
|
*/
|
|
489
523
|
'object.omit': (string[] | string)[];
|
|
524
|
+
/**
|
|
525
|
+
* Compare two objects to each other and get an array of differences
|
|
526
|
+
*
|
|
527
|
+
* Nested object keys are returned as a path array.
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```yaml
|
|
531
|
+
* object.compare:
|
|
532
|
+
* - object.from:
|
|
533
|
+
* name: Alice
|
|
534
|
+
* age: 25
|
|
535
|
+
* address:
|
|
536
|
+
* object.from:
|
|
537
|
+
* city: Paris
|
|
538
|
+
* zip: 7500
|
|
539
|
+
* - object.from:
|
|
540
|
+
* name: Alice
|
|
541
|
+
* age: 26
|
|
542
|
+
* address:
|
|
543
|
+
* object.from:
|
|
544
|
+
* city: Lyon
|
|
545
|
+
* country: France
|
|
546
|
+
* ```
|
|
547
|
+
*
|
|
548
|
+
* Returns:
|
|
549
|
+
* ```javascript
|
|
550
|
+
* [
|
|
551
|
+
* { path: ['age'], type: 'changed', from: 25, to: 26 },
|
|
552
|
+
* { path: ['address', 'city'], type: 'changed', from: 'Paris', to: 'Lyon' },
|
|
553
|
+
* { path: ['address', 'zip'], type: 'removed', value: 7500 },
|
|
554
|
+
* { path: ['address', 'country'], type: 'added', value: 'France' }
|
|
555
|
+
* ]
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
'object.compare': [Remapper, Remapper];
|
|
559
|
+
/**
|
|
560
|
+
* Takes an object with an array property and transforms it into an array of objects.
|
|
561
|
+
*
|
|
562
|
+
* Each object in the resulting array contains all the entries of the original object
|
|
563
|
+
* plus all the entries of the corresponding array item from the array property.
|
|
564
|
+
*
|
|
565
|
+
* > **Note**
|
|
566
|
+
* > If one of the items in the array contains a key, which exists in the original object
|
|
567
|
+
* > it will overwrite the original key
|
|
568
|
+
*
|
|
569
|
+
* > **Note**
|
|
570
|
+
* > Nested arrays or objects are not exploded
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* Input:
|
|
574
|
+
* ```javascript
|
|
575
|
+
* {
|
|
576
|
+
* ownerName: 'John',
|
|
577
|
+
* country: 'USA',
|
|
578
|
+
* pets: [
|
|
579
|
+
* { name: 'Milka' },
|
|
580
|
+
* { name: 'Sven', country: 'Sweden' },
|
|
581
|
+
* { name: 'Tom', likes: ['mice', 'fish'] },
|
|
582
|
+
* { name: 'Jerry', looks: { color: 'brown' } }
|
|
583
|
+
* ]
|
|
584
|
+
* }
|
|
585
|
+
* ```
|
|
586
|
+
*
|
|
587
|
+
* Remapper:
|
|
588
|
+
* ```yaml
|
|
589
|
+
* object.explode: pets
|
|
590
|
+
* ```
|
|
591
|
+
*
|
|
592
|
+
* Returns:
|
|
593
|
+
* ```javascript
|
|
594
|
+
* [
|
|
595
|
+
* { ownerName: 'John', name: 'Milka', country: 'USA' },
|
|
596
|
+
* { ownerName: 'John', name: 'Sven', country: 'Sweden' },
|
|
597
|
+
* { ownerName: 'John', name: 'Tom', country: 'USA', likes: ['mice', 'fish'] },
|
|
598
|
+
* { ownerName: 'John', name: 'Jerry', country: 'USA', looks: { color: 'brown' } }
|
|
599
|
+
* ]
|
|
600
|
+
* ```
|
|
601
|
+
*/
|
|
602
|
+
'object.explode': string;
|
|
490
603
|
/**
|
|
491
604
|
* Use a static value.
|
|
492
605
|
*/
|
|
@@ -530,6 +643,11 @@ export interface Remappers {
|
|
|
530
643
|
choice: string;
|
|
531
644
|
length: number;
|
|
532
645
|
};
|
|
646
|
+
/**
|
|
647
|
+
* This remapper returns the length of the input array or a string, this remapper
|
|
648
|
+
* doesn't require array to be in the context unlike `{ array: length }` remapper.
|
|
649
|
+
*/
|
|
650
|
+
len: null;
|
|
533
651
|
/**
|
|
534
652
|
* Get the input data as it was initially passed to the remap function.
|
|
535
653
|
*/
|
|
@@ -601,6 +719,18 @@ export interface Remappers {
|
|
|
601
719
|
* Convert an input to lower or upper case.
|
|
602
720
|
*/
|
|
603
721
|
'string.case': 'lower' | 'upper';
|
|
722
|
+
/**
|
|
723
|
+
* Check if the initial characters of the string matches with the input string.
|
|
724
|
+
*/
|
|
725
|
+
'string.startsWith': SubstringCaseType | string;
|
|
726
|
+
/**
|
|
727
|
+
* Check if the last characters of the string matches with the input string.
|
|
728
|
+
*/
|
|
729
|
+
'string.endsWith': SubstringCaseType | string;
|
|
730
|
+
/**
|
|
731
|
+
* Extract a section of the string or an array.
|
|
732
|
+
*/
|
|
733
|
+
slice: number | [number, number];
|
|
604
734
|
/**
|
|
605
735
|
* Format a string using remapped input variables.
|
|
606
736
|
*/
|
|
@@ -629,10 +759,32 @@ export interface Remappers {
|
|
|
629
759
|
*/
|
|
630
760
|
translate: string;
|
|
631
761
|
container: string;
|
|
762
|
+
/**
|
|
763
|
+
* Construct an OData $filter
|
|
764
|
+
*/
|
|
765
|
+
'filter.from': FilterParams;
|
|
766
|
+
/**
|
|
767
|
+
* Construct an OData $orderby
|
|
768
|
+
*/
|
|
769
|
+
'order.from': OrderParams;
|
|
770
|
+
/**
|
|
771
|
+
* Parse an xml string to a JavaScript object
|
|
772
|
+
*/
|
|
773
|
+
'xml.parse': Remapper;
|
|
774
|
+
/**
|
|
775
|
+
* Check if the value is defined
|
|
776
|
+
*
|
|
777
|
+
* @example
|
|
778
|
+
* "" -> true
|
|
779
|
+
* 0 -> true
|
|
780
|
+
* null -> false
|
|
781
|
+
* undefined -> false
|
|
782
|
+
*/
|
|
783
|
+
defined: Remapper;
|
|
632
784
|
}
|
|
633
785
|
export type ObjectRemapper = RequireExactlyOne<Remappers>;
|
|
634
786
|
export type ArrayRemapper = (ArrayRemapper | ObjectRemapper)[];
|
|
635
|
-
export type Remapper = ArrayRemapper | ObjectRemapper | boolean | number | string;
|
|
787
|
+
export type Remapper = ArrayRemapper | ObjectRemapper | boolean | number | string | null;
|
|
636
788
|
export interface SubscriptionResponseResource {
|
|
637
789
|
create: boolean;
|
|
638
790
|
update: boolean;
|
|
@@ -648,7 +800,7 @@ export declare const resourceSubscribableAction: readonly ["create", "update", "
|
|
|
648
800
|
export type ResourceSubscribableAction = (typeof resourceSubscribableAction)[number];
|
|
649
801
|
export type ResourceViewAction = 'get' | 'query';
|
|
650
802
|
export type OwnResourceAction = ResourceViewAction | 'delete' | 'patch' | 'update';
|
|
651
|
-
export type ResourceAction = ResourceViewAction | 'create' | 'delete' | 'history.get' | 'patch' | 'update';
|
|
803
|
+
export type ResourceAction = ResourceViewAction | 'create' | 'delete' | 'history.get' | 'patch' | 'update.positions' | 'update';
|
|
652
804
|
export type CustomAppResourcePermission = `$resource:${string}:${ResourceAction}`;
|
|
653
805
|
export type CustomAppOwnResourcePermission = `$resource:${string}:own:${OwnResourceAction}`;
|
|
654
806
|
export type CustomAppResourceViewPermission = `$resource:${string}:${ResourceViewAction}:${string}`;
|
|
@@ -658,6 +810,10 @@ export interface GuestDefinition {
|
|
|
658
810
|
permissions?: CustomAppPermission[];
|
|
659
811
|
inherits?: AppRole[];
|
|
660
812
|
}
|
|
813
|
+
export interface CronSecurityDefinition {
|
|
814
|
+
permissions?: CustomAppPermission[];
|
|
815
|
+
inherits?: AppRole[];
|
|
816
|
+
}
|
|
661
817
|
export interface RoleDefinition {
|
|
662
818
|
description?: string;
|
|
663
819
|
defaultPage?: string;
|
|
@@ -667,6 +823,7 @@ export interface RoleDefinition {
|
|
|
667
823
|
export type SecurityPolicy = 'everyone' | 'invite' | 'organization';
|
|
668
824
|
export interface MinimalSecurity {
|
|
669
825
|
guest: GuestDefinition;
|
|
826
|
+
cron?: CronSecurityDefinition;
|
|
670
827
|
default?: {
|
|
671
828
|
role: AppRole;
|
|
672
829
|
policy?: SecurityPolicy;
|
|
@@ -675,6 +832,7 @@ export interface MinimalSecurity {
|
|
|
675
832
|
}
|
|
676
833
|
export interface StrictSecurity {
|
|
677
834
|
guest?: GuestDefinition;
|
|
835
|
+
cron?: CronSecurityDefinition;
|
|
678
836
|
default: {
|
|
679
837
|
role: AppRole;
|
|
680
838
|
policy?: SecurityPolicy;
|
|
@@ -762,6 +920,11 @@ export interface ResourceDefinition {
|
|
|
762
920
|
* A definition of how versioning should happen for instances of this resource.
|
|
763
921
|
*/
|
|
764
922
|
history?: ResourceHistoryDefinition | boolean;
|
|
923
|
+
/**
|
|
924
|
+
* Whether to enable position column for the instances of this resource. This is used for keeping
|
|
925
|
+
* an ordered list to enable custom sorting of the data using drag and drop features.
|
|
926
|
+
*/
|
|
927
|
+
positioning?: boolean;
|
|
765
928
|
/**
|
|
766
929
|
* The definition for the `resource.create` action.
|
|
767
930
|
*/
|
|
@@ -1321,18 +1484,27 @@ interface OwnResourceDefinition {
|
|
|
1321
1484
|
*/
|
|
1322
1485
|
own?: boolean;
|
|
1323
1486
|
}
|
|
1487
|
+
interface ResourceActionWithIdDefinition {
|
|
1488
|
+
/**
|
|
1489
|
+
* Id of the resource to fetch
|
|
1490
|
+
*/
|
|
1491
|
+
id?: Remapper;
|
|
1492
|
+
}
|
|
1324
1493
|
export interface ControllerActionDefinition extends BaseActionDefinition<'controller'> {
|
|
1325
1494
|
handler: string;
|
|
1326
1495
|
}
|
|
1327
1496
|
export type RequestActionDefinition = RequestLikeActionDefinition<'request'>;
|
|
1328
1497
|
export type ResourceCreateActionDefinition = ResourceActionDefinition<'resource.create'>;
|
|
1329
1498
|
export type ResourceDeleteActionDefinition = ResourceActionDefinition<'resource.delete'>;
|
|
1499
|
+
export type ResourceDeleteAllActionDefinition = ResourceActionDefinition<'resource.delete.all'>;
|
|
1500
|
+
export type ResourceDeleteBulkActionDefinition = ResourceActionDefinition<'resource.delete.bulk'>;
|
|
1330
1501
|
export type ResourceHistoryGetActionDefinition = ResourceActionDefinition<'resource.history.get'>;
|
|
1331
|
-
export type ResourceGetActionDefinition = ResourceActionDefinition<'resource.get'> & ViewResourceDefinition;
|
|
1502
|
+
export type ResourceGetActionDefinition = ResourceActionDefinition<'resource.get'> & ResourceActionWithIdDefinition & ViewResourceDefinition;
|
|
1332
1503
|
export type ResourceQueryActionDefinition = OwnResourceDefinition & ResourceActionDefinition<'resource.query'> & ViewResourceDefinition;
|
|
1333
1504
|
export type ResourceCountActionDefinition = OwnResourceDefinition & ResourceActionDefinition<'resource.count'>;
|
|
1334
1505
|
export type ResourceUpdateActionDefinition = ResourceActionDefinition<'resource.update'>;
|
|
1335
|
-
export type
|
|
1506
|
+
export type ResourceUpdatePositionsActionDefinition = ResourceActionDefinition<'resource.update.positions'> & ResourceActionWithIdDefinition;
|
|
1507
|
+
export type ResourcePatchActionDefinition = ResourceActionDefinition<'resource.patch'> & ResourceActionWithIdDefinition;
|
|
1336
1508
|
export type AppMemberLogoutAction = BaseActionDefinition<'app.member.logout'>;
|
|
1337
1509
|
export interface BaseResourceSubscribeActionDefinition<T extends Action['type']> extends BaseActionDefinition<T> {
|
|
1338
1510
|
/**
|
|
@@ -1398,7 +1570,7 @@ export type MessageActionDefinition = BaseActionDefinition<'message'> & BaseMess
|
|
|
1398
1570
|
*/
|
|
1399
1571
|
body: Remapper;
|
|
1400
1572
|
};
|
|
1401
|
-
export type ActionDefinition = AnalyticsAction | AppMemberCurrentPatchAction | AppMemberDeleteAction | AppMemberInviteAction | AppMemberLoginAction | AppMemberLogoutAction | AppMemberPropertiesPatchAction | AppMemberQueryAction | AppMemberRegisterAction | AppMemberRoleUpdateAction | BaseActionDefinition<'dialog.error'> | BaseActionDefinition<'dialog.ok'> | BaseActionDefinition<'flow.back'> | BaseActionDefinition<'flow.cancel'> | BaseActionDefinition<'flow.finish'> | BaseActionDefinition<'flow.next'> | BaseActionDefinition<'group.query'> | BaseActionDefinition<'link.back'> | BaseActionDefinition<'link.next'> | BaseActionDefinition<'noop'> | BaseActionDefinition<'throw'> | ConditionActionDefinition | ControllerActionDefinition | DialogActionDefinition | DownloadActionDefinition | EachActionDefinition | EmailActionDefinition | EventActionDefinition | FlowToActionDefinition | GroupMemberDeleteActionDefinition | GroupMemberInviteActionDefinition | GroupMemberQueryActionDefinition | GroupMemberRoleUpdateActionDefinition | LinkActionDefinition | LogActionDefinition | MatchActionDefinition | MessageActionDefinition | NotifyActionDefinition | RequestActionDefinition | ResourceCountActionDefinition | ResourceCreateActionDefinition | ResourceDeleteActionDefinition | ResourceGetActionDefinition | ResourceHistoryGetActionDefinition | ResourcePatchActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageAppendActionDefinition | StorageDeleteActionDefinition | StorageReadActionDefinition | StorageSubtractActionDefinition | StorageUpdateActionDefinition | StorageWriteActionDefinition;
|
|
1573
|
+
export type ActionDefinition = AnalyticsAction | AppMemberCurrentPatchAction | AppMemberDeleteAction | AppMemberInviteAction | AppMemberLoginAction | AppMemberLogoutAction | AppMemberPropertiesPatchAction | AppMemberQueryAction | AppMemberRegisterAction | AppMemberRoleUpdateAction | BaseActionDefinition<'dialog.error'> | BaseActionDefinition<'dialog.ok'> | BaseActionDefinition<'flow.back'> | BaseActionDefinition<'flow.cancel'> | BaseActionDefinition<'flow.finish'> | BaseActionDefinition<'flow.next'> | BaseActionDefinition<'group.query'> | BaseActionDefinition<'link.back'> | BaseActionDefinition<'link.next'> | BaseActionDefinition<'noop'> | BaseActionDefinition<'throw'> | ConditionActionDefinition | ControllerActionDefinition | DialogActionDefinition | DownloadActionDefinition | EachActionDefinition | EmailActionDefinition | EventActionDefinition | FlowToActionDefinition | GroupMemberDeleteActionDefinition | GroupMemberInviteActionDefinition | GroupMemberQueryActionDefinition | GroupMemberRoleUpdateActionDefinition | LinkActionDefinition | LogActionDefinition | MatchActionDefinition | MessageActionDefinition | NotifyActionDefinition | RequestActionDefinition | ResourceCountActionDefinition | ResourceCreateActionDefinition | ResourceDeleteActionDefinition | ResourceDeleteAllActionDefinition | ResourceDeleteBulkActionDefinition | ResourceGetActionDefinition | ResourceHistoryGetActionDefinition | ResourcePatchActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ResourceUpdatePositionsActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageAppendActionDefinition | StorageDeleteActionDefinition | StorageReadActionDefinition | StorageSubtractActionDefinition | StorageUpdateActionDefinition | StorageWriteActionDefinition;
|
|
1402
1574
|
export interface ActionType {
|
|
1403
1575
|
/**
|
|
1404
1576
|
* Whether or not app creators are required to define this action.
|
|
@@ -1523,14 +1695,14 @@ export interface LoopPageDefinition extends BasePageDefinition {
|
|
|
1523
1695
|
/**
|
|
1524
1696
|
* Template step that the loop will pass data onto
|
|
1525
1697
|
*/
|
|
1526
|
-
foreach
|
|
1698
|
+
foreach: SubPageDefinition;
|
|
1527
1699
|
/**
|
|
1528
1700
|
* A mapping of actions that can be fired by the page to action handlers.
|
|
1529
1701
|
*/
|
|
1530
1702
|
actions?: {
|
|
1531
1703
|
onFlowCancel?: ActionDefinition;
|
|
1532
1704
|
onFlowFinish?: ActionDefinition;
|
|
1533
|
-
onLoad
|
|
1705
|
+
onLoad: ActionDefinition;
|
|
1534
1706
|
};
|
|
1535
1707
|
/**
|
|
1536
1708
|
* The method used to display the progress of the flow page.
|
|
@@ -1572,7 +1744,7 @@ export interface AppDefinition {
|
|
|
1572
1744
|
*
|
|
1573
1745
|
* This determines the default path of the app.
|
|
1574
1746
|
*/
|
|
1575
|
-
name
|
|
1747
|
+
name: string;
|
|
1576
1748
|
/**
|
|
1577
1749
|
* The description of the app.
|
|
1578
1750
|
*/
|
|
@@ -1619,6 +1791,14 @@ export interface AppDefinition {
|
|
|
1619
1791
|
* @default 'navbar'
|
|
1620
1792
|
*/
|
|
1621
1793
|
feedback?: LayoutPosition;
|
|
1794
|
+
/**
|
|
1795
|
+
* The location of the install button.
|
|
1796
|
+
*
|
|
1797
|
+
* If set to `navigation`, it will only be visible if `login` is also visible in `navigation`.
|
|
1798
|
+
*
|
|
1799
|
+
* @default 'navbar'
|
|
1800
|
+
*/
|
|
1801
|
+
install?: LayoutPosition;
|
|
1622
1802
|
/**
|
|
1623
1803
|
* The navigation type to use.
|
|
1624
1804
|
*
|
|
@@ -1660,6 +1840,10 @@ export interface AppDefinition {
|
|
|
1660
1840
|
* Cron jobs associated with the app.
|
|
1661
1841
|
*/
|
|
1662
1842
|
cron?: Record<string, CronDefinition>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Webhooks associated with the app.
|
|
1845
|
+
*/
|
|
1846
|
+
webhooks?: Record<string, WebhookDefinition>;
|
|
1663
1847
|
/**
|
|
1664
1848
|
* Companion containers of the app.
|
|
1665
1849
|
*/
|
|
@@ -1677,6 +1861,13 @@ export interface CronDefinition {
|
|
|
1677
1861
|
schedule: string;
|
|
1678
1862
|
action: ActionDefinition;
|
|
1679
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* The definition of a webhook for an app.
|
|
1866
|
+
*/
|
|
1867
|
+
export interface WebhookDefinition {
|
|
1868
|
+
schema: OpenAPIV3.SchemaObject;
|
|
1869
|
+
action: ActionDefinition;
|
|
1870
|
+
}
|
|
1680
1871
|
export interface App {
|
|
1681
1872
|
/**
|
|
1682
1873
|
* The unique identifier for the app.
|
|
@@ -1687,7 +1878,7 @@ export interface App {
|
|
|
1687
1878
|
/**
|
|
1688
1879
|
* A domain name on which this app should be served.
|
|
1689
1880
|
*/
|
|
1690
|
-
domain?: string;
|
|
1881
|
+
domain?: string | null;
|
|
1691
1882
|
/**
|
|
1692
1883
|
* The name used for emails
|
|
1693
1884
|
*/
|
|
@@ -1695,7 +1886,7 @@ export interface App {
|
|
|
1695
1886
|
/**
|
|
1696
1887
|
* The id of the organization this app belongs to.
|
|
1697
1888
|
*/
|
|
1698
|
-
OrganizationId
|
|
1889
|
+
OrganizationId: string;
|
|
1699
1890
|
/**
|
|
1700
1891
|
* The name of the organization this app belongs to.
|
|
1701
1892
|
*/
|
|
@@ -1732,6 +1923,14 @@ export interface App {
|
|
|
1732
1923
|
* Whether the Appsemble password login method should be shown.
|
|
1733
1924
|
*/
|
|
1734
1925
|
showAppsembleLogin: boolean;
|
|
1926
|
+
/**
|
|
1927
|
+
* Whether to display App member's name in the title bar.
|
|
1928
|
+
*/
|
|
1929
|
+
displayAppMemberName: boolean;
|
|
1930
|
+
/**
|
|
1931
|
+
* Whether to display the installation prompt to the app members.
|
|
1932
|
+
*/
|
|
1933
|
+
displayInstallationPrompt: boolean;
|
|
1735
1934
|
/**
|
|
1736
1935
|
* Whether the Appsemble OAuth2 login method should be shown.
|
|
1737
1936
|
*/
|
|
@@ -1743,11 +1942,11 @@ export interface App {
|
|
|
1743
1942
|
/**
|
|
1744
1943
|
* The Sentry DSN of the app.
|
|
1745
1944
|
*/
|
|
1746
|
-
sentryDsn
|
|
1945
|
+
sentryDsn?: string;
|
|
1747
1946
|
/**
|
|
1748
1947
|
* The Sentry environment associated with the Sentry DSN.
|
|
1749
1948
|
*/
|
|
1750
|
-
sentryEnvironment
|
|
1949
|
+
sentryEnvironment?: string;
|
|
1751
1950
|
/**
|
|
1752
1951
|
* The app definition.
|
|
1753
1952
|
*/
|
|
@@ -1755,7 +1954,7 @@ export interface App {
|
|
|
1755
1954
|
/**
|
|
1756
1955
|
* The app definition formatted as YAML.
|
|
1757
1956
|
*/
|
|
1758
|
-
yaml
|
|
1957
|
+
yaml?: string;
|
|
1759
1958
|
/**
|
|
1760
1959
|
* An app rating.
|
|
1761
1960
|
*/
|
|
@@ -2034,7 +2233,7 @@ export interface Messages {
|
|
|
2034
2233
|
/**
|
|
2035
2234
|
* A mapping of message id to message content.
|
|
2036
2235
|
*/
|
|
2037
|
-
messages
|
|
2236
|
+
messages?: AppsembleMessages;
|
|
2038
2237
|
}
|
|
2039
2238
|
export interface AppMessages {
|
|
2040
2239
|
/**
|
|
@@ -2132,6 +2331,13 @@ export interface AppServiceSecretDefinition {
|
|
|
2132
2331
|
* The custom certificate authority used for client-certificate method.
|
|
2133
2332
|
*/
|
|
2134
2333
|
ca?: string;
|
|
2334
|
+
/**
|
|
2335
|
+
* If a secret is marked public, it can be applied to the unauthenticated users, e.g. in the
|
|
2336
|
+
* requests originating in a custom sign up or login page.
|
|
2337
|
+
*
|
|
2338
|
+
* @default false
|
|
2339
|
+
*/
|
|
2340
|
+
public: boolean;
|
|
2135
2341
|
}
|
|
2136
2342
|
export interface AppServiceSecret extends AppServiceSecretDefinition {
|
|
2137
2343
|
/**
|
|
@@ -2139,6 +2345,22 @@ export interface AppServiceSecret extends AppServiceSecretDefinition {
|
|
|
2139
2345
|
*/
|
|
2140
2346
|
id: number;
|
|
2141
2347
|
}
|
|
2348
|
+
export interface AppWebhookSecretDefinition {
|
|
2349
|
+
/**
|
|
2350
|
+
* The name of the webhook this secret is tied to.
|
|
2351
|
+
*/
|
|
2352
|
+
webhookName: string;
|
|
2353
|
+
/**
|
|
2354
|
+
* An optional name to give extra clarity what the secret is used for.
|
|
2355
|
+
*/
|
|
2356
|
+
name?: string;
|
|
2357
|
+
}
|
|
2358
|
+
export interface AppWebhookSecret extends AppWebhookSecretDefinition {
|
|
2359
|
+
/**
|
|
2360
|
+
* An autogenerated ID.
|
|
2361
|
+
*/
|
|
2362
|
+
id: string;
|
|
2363
|
+
}
|
|
2142
2364
|
export interface AppOAuth2Secret extends OAuth2Provider {
|
|
2143
2365
|
/**
|
|
2144
2366
|
* An autogenerated ID.
|
|
@@ -2205,66 +2427,6 @@ export interface AppSamlSecret extends WritableAppSamlSecret {
|
|
|
2205
2427
|
*/
|
|
2206
2428
|
spCertificate?: string;
|
|
2207
2429
|
}
|
|
2208
|
-
export interface Training {
|
|
2209
|
-
/**
|
|
2210
|
-
* Id of the training
|
|
2211
|
-
*/
|
|
2212
|
-
id: number;
|
|
2213
|
-
/**
|
|
2214
|
-
* Title of the training.
|
|
2215
|
-
*/
|
|
2216
|
-
title: string;
|
|
2217
|
-
/**
|
|
2218
|
-
* A brief overview of what the training is about.
|
|
2219
|
-
*/
|
|
2220
|
-
description: string;
|
|
2221
|
-
/**
|
|
2222
|
-
* Tags related to competence of the training.
|
|
2223
|
-
*/
|
|
2224
|
-
competences: string[];
|
|
2225
|
-
/**
|
|
2226
|
-
* Difficulty level of the training.
|
|
2227
|
-
*/
|
|
2228
|
-
difficultyLevel: number;
|
|
2229
|
-
/**
|
|
2230
|
-
* The creation date of the training.
|
|
2231
|
-
*/
|
|
2232
|
-
$created?: string;
|
|
2233
|
-
/**
|
|
2234
|
-
* The date when the training was last updated.
|
|
2235
|
-
*/
|
|
2236
|
-
$updated?: string;
|
|
2237
|
-
}
|
|
2238
|
-
export interface TrainingBlock {
|
|
2239
|
-
/**
|
|
2240
|
-
* ID of the training block
|
|
2241
|
-
*/
|
|
2242
|
-
id: string;
|
|
2243
|
-
/**
|
|
2244
|
-
* Title of the block.
|
|
2245
|
-
*/
|
|
2246
|
-
title: string;
|
|
2247
|
-
/**
|
|
2248
|
-
* Id of the parent training.
|
|
2249
|
-
*/
|
|
2250
|
-
trainingId: number;
|
|
2251
|
-
/**
|
|
2252
|
-
* A link pointing to the documentation of Appsemble.
|
|
2253
|
-
*/
|
|
2254
|
-
documentationLink?: string;
|
|
2255
|
-
/**
|
|
2256
|
-
* A link pointing to a video regarding the topic.
|
|
2257
|
-
*/
|
|
2258
|
-
videoLink?: string;
|
|
2259
|
-
/**
|
|
2260
|
-
* Link to an external resource.
|
|
2261
|
-
*/
|
|
2262
|
-
externalResource?: string;
|
|
2263
|
-
/**
|
|
2264
|
-
* Example code for the user to try out.
|
|
2265
|
-
*/
|
|
2266
|
-
exampleCode?: string;
|
|
2267
|
-
}
|
|
2268
2430
|
export type SAMLStatus = 'badsignature' | 'emailconflict' | 'invalidrelaystate' | 'invalidsecret' | 'invalidstatuscode' | 'invalidsubjectconfirmation' | 'missingnameid' | 'missingsubject';
|
|
2269
2431
|
export interface ProjectConfig {
|
|
2270
2432
|
/**
|
|
@@ -2331,7 +2493,7 @@ export interface BlockManifest extends ProjectManifest {
|
|
|
2331
2493
|
/**
|
|
2332
2494
|
* The URL that can be used to fetch this block’s icon.
|
|
2333
2495
|
*/
|
|
2334
|
-
iconUrl?: string;
|
|
2496
|
+
iconUrl?: string | null;
|
|
2335
2497
|
/**
|
|
2336
2498
|
* The languages that are supported by the block by default.
|
|
2337
2499
|
*
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1-test.15",
|
|
4
4
|
"description": "TypeScript definitions reused within Appsemble internally",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -23,14 +23,16 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"type": "module",
|
|
25
25
|
"exports": {
|
|
26
|
-
".":
|
|
27
|
-
"./index.
|
|
28
|
-
"./index.
|
|
29
|
-
|
|
26
|
+
".": {
|
|
27
|
+
"ts-source": "./index.ts",
|
|
28
|
+
"default": "./index.js"
|
|
29
|
+
}
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"**/*.d.ts",
|
|
33
33
|
"**/*.js",
|
|
34
|
+
"!**/*.test.js",
|
|
35
|
+
"!**/*.test.d.ts",
|
|
34
36
|
"!*.config.js"
|
|
35
37
|
],
|
|
36
38
|
"scripts": {
|
|
@@ -39,8 +41,9 @@
|
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
42
|
-
"jsonschema": "
|
|
44
|
+
"jsonschema": "~1.4.1",
|
|
43
45
|
"openapi-types": "^12.0.0",
|
|
46
|
+
"react": "^18.0.0",
|
|
44
47
|
"type-fest": "^4.0.0"
|
|
45
48
|
}
|
|
46
49
|
}
|
package/permissions.d.ts
CHANGED
|
@@ -370,31 +370,7 @@ export declare enum OrganizationPermission {
|
|
|
370
370
|
/**
|
|
371
371
|
* The permission to send manual push notifications for an app.
|
|
372
372
|
*/
|
|
373
|
-
PushAppNotifications = 65
|
|
374
|
-
/**
|
|
375
|
-
* The permission to create trainings.
|
|
376
|
-
*/
|
|
377
|
-
CreateTrainings = 66,
|
|
378
|
-
/**
|
|
379
|
-
* The permission to update trainings.
|
|
380
|
-
*/
|
|
381
|
-
UpdateTrainings = 67,
|
|
382
|
-
/**
|
|
383
|
-
* The permission to delete trainings.
|
|
384
|
-
*/
|
|
385
|
-
DeleteTrainings = 68,
|
|
386
|
-
/**
|
|
387
|
-
* The permission to create training blocks.
|
|
388
|
-
*/
|
|
389
|
-
CreateTrainingBlocks = 69,
|
|
390
|
-
/**
|
|
391
|
-
* The permission to update training blocks.
|
|
392
|
-
*/
|
|
393
|
-
UpdateTrainingBlocks = 70,
|
|
394
|
-
/**
|
|
395
|
-
* The permission to delete training blocks.
|
|
396
|
-
*/
|
|
397
|
-
DeleteTrainingBlocks = 71
|
|
373
|
+
PushAppNotifications = 65
|
|
398
374
|
}
|
|
399
375
|
export declare const appOrganizationPermissionMapping: {
|
|
400
376
|
[key in AppPermission]: OrganizationPermission;
|
package/permissions.js
CHANGED
|
@@ -373,30 +373,6 @@ export var OrganizationPermission;
|
|
|
373
373
|
* The permission to send manual push notifications for an app.
|
|
374
374
|
*/
|
|
375
375
|
OrganizationPermission[OrganizationPermission["PushAppNotifications"] = 65] = "PushAppNotifications";
|
|
376
|
-
/**
|
|
377
|
-
* The permission to create trainings.
|
|
378
|
-
*/
|
|
379
|
-
OrganizationPermission[OrganizationPermission["CreateTrainings"] = 66] = "CreateTrainings";
|
|
380
|
-
/**
|
|
381
|
-
* The permission to update trainings.
|
|
382
|
-
*/
|
|
383
|
-
OrganizationPermission[OrganizationPermission["UpdateTrainings"] = 67] = "UpdateTrainings";
|
|
384
|
-
/**
|
|
385
|
-
* The permission to delete trainings.
|
|
386
|
-
*/
|
|
387
|
-
OrganizationPermission[OrganizationPermission["DeleteTrainings"] = 68] = "DeleteTrainings";
|
|
388
|
-
/**
|
|
389
|
-
* The permission to create training blocks.
|
|
390
|
-
*/
|
|
391
|
-
OrganizationPermission[OrganizationPermission["CreateTrainingBlocks"] = 69] = "CreateTrainingBlocks";
|
|
392
|
-
/**
|
|
393
|
-
* The permission to update training blocks.
|
|
394
|
-
*/
|
|
395
|
-
OrganizationPermission[OrganizationPermission["UpdateTrainingBlocks"] = 70] = "UpdateTrainingBlocks";
|
|
396
|
-
/**
|
|
397
|
-
* The permission to delete training blocks.
|
|
398
|
-
*/
|
|
399
|
-
OrganizationPermission[OrganizationPermission["DeleteTrainingBlocks"] = 71] = "DeleteTrainingBlocks";
|
|
400
376
|
})(OrganizationPermission || (OrganizationPermission = {}));
|
|
401
377
|
export const appOrganizationPermissionMapping = {
|
|
402
378
|
[AppPermission.CreateAppInvites]: OrganizationPermission.CreateAppInvites,
|
package/resource.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface ResourceAuthor {
|
|
|
51
51
|
/**
|
|
52
52
|
* The display name of the user.
|
|
53
53
|
*/
|
|
54
|
-
name
|
|
54
|
+
name?: string;
|
|
55
55
|
}
|
|
56
56
|
export interface ResourceGroup {
|
|
57
57
|
/**
|
|
@@ -66,5 +66,5 @@ export interface ResourceGroup {
|
|
|
66
66
|
export interface ResourceVersion {
|
|
67
67
|
created: string;
|
|
68
68
|
data: Record<string, unknown>;
|
|
69
|
-
author
|
|
69
|
+
author?: ResourceAuthor;
|
|
70
70
|
}
|
package/roles.js
CHANGED
|
@@ -85,20 +85,10 @@ const OrganizationBlockManagerPermissions = [
|
|
|
85
85
|
OrganizationPermission.PublishBlocks,
|
|
86
86
|
OrganizationPermission.DeleteBlocks,
|
|
87
87
|
];
|
|
88
|
-
const OrganizationTrainingManagerPermissions = [
|
|
89
|
-
...OrganizationMemberPermissions,
|
|
90
|
-
OrganizationPermission.CreateTrainings,
|
|
91
|
-
OrganizationPermission.UpdateTrainings,
|
|
92
|
-
OrganizationPermission.DeleteTrainings,
|
|
93
|
-
OrganizationPermission.CreateTrainingBlocks,
|
|
94
|
-
OrganizationPermission.UpdateTrainingBlocks,
|
|
95
|
-
OrganizationPermission.DeleteTrainingBlocks,
|
|
96
|
-
];
|
|
97
88
|
const OrganizationMaintainerPermissions = [
|
|
98
89
|
...OrganizationAppManagerPermissions,
|
|
99
90
|
...OrganizationAppCollectionManagerPermissions,
|
|
100
91
|
...OrganizationBlockManagerPermissions,
|
|
101
|
-
...OrganizationTrainingManagerPermissions,
|
|
102
92
|
OrganizationPermission.CreateApps,
|
|
103
93
|
OrganizationPermission.DeleteApps,
|
|
104
94
|
OrganizationPermission.CreateOrganizationInvites,
|
package/training.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
export type TrainingStatus = 'available' | 'blocked' | 'completed' | 'in progress';
|
|
3
|
+
export interface TrainingChapter {
|
|
4
|
+
/**
|
|
5
|
+
* ID of the chapter.
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Title of the chapter
|
|
10
|
+
*/
|
|
11
|
+
title: string;
|
|
12
|
+
/**
|
|
13
|
+
* List of trainings that make up this chapter.
|
|
14
|
+
*/
|
|
15
|
+
trainings: Training[];
|
|
16
|
+
/**
|
|
17
|
+
* The ID of the chapter that has to be completed before this one can be accessed.
|
|
18
|
+
*/
|
|
19
|
+
blockedBy?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The status of the chapter
|
|
22
|
+
*/
|
|
23
|
+
status: TrainingStatus;
|
|
24
|
+
}
|
|
25
|
+
export interface Training {
|
|
26
|
+
/**
|
|
27
|
+
* Id of the training.
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* Title of the training
|
|
32
|
+
*/
|
|
33
|
+
title: string;
|
|
34
|
+
/**
|
|
35
|
+
* The path of the training page to route to.
|
|
36
|
+
*/
|
|
37
|
+
path: string;
|
|
38
|
+
/**
|
|
39
|
+
* The content of the training to render.
|
|
40
|
+
*/
|
|
41
|
+
content?: ComponentType;
|
|
42
|
+
/**
|
|
43
|
+
* The status of the training
|
|
44
|
+
*/
|
|
45
|
+
status: TrainingStatus;
|
|
46
|
+
}
|
|
47
|
+
export interface TrainingChapterProperties {
|
|
48
|
+
/**
|
|
49
|
+
* The ID of the chapter that has to be completed before this one can be accessed.
|
|
50
|
+
*/
|
|
51
|
+
blockedBy: string;
|
|
52
|
+
/**
|
|
53
|
+
* Title of the chapter
|
|
54
|
+
*/
|
|
55
|
+
title: string;
|
|
56
|
+
/**
|
|
57
|
+
* The order in which the trainings must be completed
|
|
58
|
+
*/
|
|
59
|
+
trainingOrder: string[];
|
|
60
|
+
}
|
package/training.js
ADDED