@appsemble/types 0.20.19 → 0.20.21

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 CHANGED
@@ -1,10 +1,10 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.20.19/config/assets/logo.svg) Appsemble Types
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.20.21/config/assets/logo.svg) Appsemble Types
2
2
 
3
3
  > Reusable TypeScript types
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/types)](https://www.npmjs.com/package/@appsemble/types)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.20.19/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.20.19)
7
- [![Code coverage](https://codecov.io/gl/appsemble/appsemble/branch/0.20.19/graph/badge.svg)](https://codecov.io/gl/appsemble/appsemble)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.20.21/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.20.21)
7
+ [![Code coverage](https://codecov.io/gl/appsemble/appsemble/branch/0.20.21/graph/badge.svg)](https://codecov.io/gl/appsemble/appsemble)
8
8
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
9
9
 
10
10
  ## Installation
@@ -21,5 +21,5 @@ not guaranteed.
21
21
 
22
22
  ## License
23
23
 
24
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.19/LICENSE.md) ©
24
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.20.21/LICENSE.md) ©
25
25
  [Appsemble](https://appsemble.com)
package/action.d.ts CHANGED
@@ -32,15 +32,15 @@ interface RequestLikeAction<T extends Action['type']> extends BaseAction<T> {
32
32
  */
33
33
  url: Remapper;
34
34
  }
35
- export declare type RequestAction = RequestLikeAction<'request'>;
36
- export declare type ResourceCreateAction = RequestLikeAction<'resource.create'>;
37
- export declare type ResourceDeleteAction = RequestLikeAction<'resource.delete'>;
38
- export declare type ResourceGetAction = RequestLikeAction<'resource.get'>;
39
- export declare type ResourceQueryAction = RequestLikeAction<'resource.query'>;
40
- export declare type ResourceCountAction = RequestLikeAction<'resource.count'>;
41
- export declare type ResourceUpdateAction = RequestLikeAction<'resource.update'>;
35
+ export type RequestAction = RequestLikeAction<'request'>;
36
+ export type ResourceCreateAction = RequestLikeAction<'resource.create'>;
37
+ export type ResourceDeleteAction = RequestLikeAction<'resource.delete'>;
38
+ export type ResourceGetAction = RequestLikeAction<'resource.get'>;
39
+ export type ResourceQueryAction = RequestLikeAction<'resource.query'>;
40
+ export type ResourceCountAction = RequestLikeAction<'resource.count'>;
41
+ export type ResourceUpdateAction = RequestLikeAction<'resource.update'>;
42
42
  /**
43
43
  * An action that can be called from within a block.
44
44
  */
45
- export declare type Action = BaseAction<'analytics'> | BaseAction<'condition'> | 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<'link.back'> | BaseAction<'link.next'> | BaseAction<'message'> | BaseAction<'noop'> | BaseAction<'resource.subscription.status'> | BaseAction<'resource.subscription.subscribe'> | BaseAction<'resource.subscription.toggle'> | BaseAction<'resource.subscription.unsubscribe'> | BaseAction<'share'> | BaseAction<'static'> | BaseAction<'storage.read'> | BaseAction<'storage.write'> | BaseAction<'team.invite'> | BaseAction<'team.join'> | BaseAction<'team.list'> | BaseAction<'throw'> | BaseAction<'user.login'> | BaseAction<'user.register'> | BaseAction<'user.update'> | LinkAction | LogAction | RequestAction | ResourceCountAction | ResourceCreateAction | ResourceDeleteAction | ResourceGetAction | ResourceQueryAction | ResourceUpdateAction;
45
+ export type Action = BaseAction<'analytics'> | BaseAction<'condition'> | 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<'link.back'> | BaseAction<'link.next'> | BaseAction<'message'> | BaseAction<'noop'> | BaseAction<'resource.subscription.status'> | BaseAction<'resource.subscription.subscribe'> | BaseAction<'resource.subscription.toggle'> | BaseAction<'resource.subscription.unsubscribe'> | BaseAction<'share'> | BaseAction<'static'> | BaseAction<'storage.read'> | BaseAction<'storage.write'> | BaseAction<'team.invite'> | BaseAction<'team.join'> | BaseAction<'team.list'> | BaseAction<'throw'> | BaseAction<'user.login'> | BaseAction<'user.register'> | BaseAction<'user.update'> | LinkAction | LogAction | RequestAction | ResourceCountAction | ResourceCreateAction | ResourceDeleteAction | ResourceGetAction | ResourceQueryAction | ResourceUpdateAction;
46
46
  export {};
package/app.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * Appsemble app store.
9
9
  * - **private**: The app is only visible to people who are part of the organization.
10
10
  */
11
- export declare type AppVisibility = 'private' | 'public' | 'unlisted';
11
+ export type AppVisibility = 'private' | 'public' | 'unlisted';
12
12
  /**
13
13
  * This defines how teams are handled by an app.
14
14
  */
package/bulma.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * A color known to Bulma.
3
3
  */
4
- export declare type BulmaColor = 'danger' | 'dark' | 'info' | 'link' | 'primary' | 'success' | 'warning' | 'white';
5
- export declare type BulmaSize = 'large' | 'medium' | 'normal' | 'small';
4
+ export type BulmaColor = 'danger' | 'dark' | 'info' | 'link' | 'primary' | 'success' | 'warning' | 'white';
5
+ export type BulmaSize = 'large' | 'medium' | 'normal' | 'small';
package/http.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Common HTTP methods, but either all upper case or all lower case.
3
3
  */
4
- export declare type HTTPMethods = 'DELETE' | 'delete' | 'GET' | 'get' | 'PATCH' | 'patch' | 'POST' | 'post' | 'PUT' | 'put';
4
+ export type HTTPMethods = 'DELETE' | 'delete' | 'GET' | 'get' | 'PATCH' | 'patch' | 'POST' | 'post' | 'PUT' | 'put';
package/index.d.ts CHANGED
@@ -322,11 +322,13 @@ export interface Remappers {
322
322
  */
323
323
  'array.append': Remapper[];
324
324
  /**
325
- * Remove item(s) from an array given a predefined array of indices.
325
+ * Remove item(s) from an array given a predefined array of remappable indices.
326
+ *
327
+ * Only the remapped values that are turned into numbers are applied.
326
328
  *
327
329
  * If the input is not an array an empty array is returned.
328
330
  */
329
- 'array.omit': number[];
331
+ 'array.omit': Remapper[];
330
332
  /**
331
333
  * Create a new object given some predefined mapper keys.
332
334
  */
@@ -402,6 +404,21 @@ export interface Remappers {
402
404
  * 0 is the index of the first item in the history stack.
403
405
  */
404
406
  history: number;
407
+ /**
408
+ * Create a new object with properties from the history stack at a certain index.
409
+ */
410
+ 'from.history': {
411
+ /**
412
+ * The index of the history stack item to apply.
413
+ *
414
+ * 0 is the index of the first item in the history stack.
415
+ */
416
+ index: number;
417
+ /**
418
+ * Predefined mapper keys to choose what properties to apply.
419
+ */
420
+ props: Record<string, Remapper>;
421
+ };
405
422
  /**
406
423
  * Assign properties from the history stack at a certain index to an existing object.
407
424
  */
@@ -477,7 +494,7 @@ export interface Remappers {
477
494
  translate: string;
478
495
  user: keyof UserInfo;
479
496
  }
480
- export declare type Remapper = RequireExactlyOne<Remappers> | RequireExactlyOne<Remappers>[] | boolean | number | string;
497
+ export type Remapper = RequireExactlyOne<Remappers> | RequireExactlyOne<Remappers>[] | boolean | number | string;
481
498
  export interface SubscriptionResponseResource {
482
499
  create: boolean;
483
500
  update: boolean;
@@ -488,7 +505,7 @@ export interface SubscriptionResponseResource {
488
505
  delete: boolean;
489
506
  }>;
490
507
  }
491
- export declare type SubscriptionResponse = Record<string, SubscriptionResponseResource>;
508
+ export type SubscriptionResponse = Record<string, SubscriptionResponseResource>;
492
509
  export interface RoleDefinition {
493
510
  description?: string;
494
511
  inherits?: string[];
@@ -505,8 +522,8 @@ export interface Security {
505
522
  */
506
523
  teams?: TeamsDefinition;
507
524
  }
508
- export declare type Navigation = 'bottom' | 'hidden' | 'left-menu';
509
- export declare type LayoutPosition = 'hidden' | 'navbar' | 'navigation';
525
+ export type Navigation = 'bottom' | 'hidden' | 'left-menu';
526
+ export type LayoutPosition = 'hidden' | 'navbar' | 'navigation';
510
527
  export interface NotificationDefinition {
511
528
  to?: string[];
512
529
  subscribe?: 'all' | 'both' | 'single';
@@ -804,7 +821,7 @@ export interface ShareActionDefinition extends BaseActionDefinition<'share'> {
804
821
  */
805
822
  title?: Remapper;
806
823
  }
807
- declare type StorageType = 'indexedDB' | 'localStorage' | 'sessionStorage';
824
+ type StorageType = 'indexedDB' | 'localStorage' | 'sessionStorage';
808
825
  export interface StorageReadActionDefinition extends BaseActionDefinition<'storage.read'> {
809
826
  /**
810
827
  * The key of the entry to read from the app’s storage.
@@ -947,13 +964,13 @@ interface ViewResourceDefinition {
947
964
  */
948
965
  view?: string;
949
966
  }
950
- export declare type RequestActionDefinition = RequestLikeActionDefinition<'request'>;
951
- export declare type ResourceCreateActionDefinition = ResourceActionDefinition<'resource.create'>;
952
- export declare type ResourceDeleteActionDefinition = ResourceActionDefinition<'resource.delete'>;
953
- export declare type ResourceGetActionDefinition = ResourceActionDefinition<'resource.get'> & ViewResourceDefinition;
954
- export declare type ResourceQueryActionDefinition = ResourceActionDefinition<'resource.query'> & ViewResourceDefinition;
955
- export declare type ResourceCountActionDefinition = ResourceActionDefinition<'resource.count'>;
956
- export declare type ResourceUpdateActionDefinition = ResourceActionDefinition<'resource.update'>;
967
+ export type RequestActionDefinition = RequestLikeActionDefinition<'request'>;
968
+ export type ResourceCreateActionDefinition = ResourceActionDefinition<'resource.create'>;
969
+ export type ResourceDeleteActionDefinition = ResourceActionDefinition<'resource.delete'>;
970
+ export type ResourceGetActionDefinition = ResourceActionDefinition<'resource.get'> & ViewResourceDefinition;
971
+ export type ResourceQueryActionDefinition = ResourceActionDefinition<'resource.query'> & ViewResourceDefinition;
972
+ export type ResourceCountActionDefinition = ResourceActionDefinition<'resource.count'>;
973
+ export type ResourceUpdateActionDefinition = ResourceActionDefinition<'resource.update'>;
957
974
  export interface BaseResourceSubscribeActionDefinition<T extends Action['type']> extends BaseActionDefinition<T> {
958
975
  /**
959
976
  * The name of the resource.
@@ -964,10 +981,10 @@ export interface BaseResourceSubscribeActionDefinition<T extends Action['type']>
964
981
  */
965
982
  action?: 'create' | 'delete' | 'update';
966
983
  }
967
- export declare type ResourceSubscriptionSubscribeActionDefinition = BaseResourceSubscribeActionDefinition<'resource.subscription.subscribe'>;
968
- export declare type ResourceSubscriptionUnsubscribeActionDefinition = BaseResourceSubscribeActionDefinition<'resource.subscription.unsubscribe'>;
969
- export declare type ResourceSubscriptionToggleActionDefinition = BaseResourceSubscribeActionDefinition<'resource.subscription.toggle'>;
970
- export declare type ResourceSubscriptionStatusActionDefinition = Omit<BaseResourceSubscribeActionDefinition<'resource.subscription.status'>, 'action'>;
984
+ export type ResourceSubscriptionSubscribeActionDefinition = BaseResourceSubscribeActionDefinition<'resource.subscription.subscribe'>;
985
+ export type ResourceSubscriptionUnsubscribeActionDefinition = BaseResourceSubscribeActionDefinition<'resource.subscription.unsubscribe'>;
986
+ export type ResourceSubscriptionToggleActionDefinition = BaseResourceSubscribeActionDefinition<'resource.subscription.toggle'>;
987
+ export type ResourceSubscriptionStatusActionDefinition = Omit<BaseResourceSubscribeActionDefinition<'resource.subscription.status'>, 'action'>;
971
988
  export interface EventActionDefinition extends BaseActionDefinition<'event'> {
972
989
  /**
973
990
  * The name of the event to emit to.
@@ -1006,13 +1023,13 @@ export interface BaseMessage {
1006
1023
  */
1007
1024
  dismissable?: boolean;
1008
1025
  }
1009
- export declare type MessageActionDefinition = BaseActionDefinition<'message'> & BaseMessage & {
1026
+ export type MessageActionDefinition = BaseActionDefinition<'message'> & BaseMessage & {
1010
1027
  /**
1011
1028
  * The content of the message to display.
1012
1029
  */
1013
1030
  body: Remapper;
1014
1031
  };
1015
- export declare type ActionDefinition = AnalyticsAction | BaseActionDefinition<'dialog.error'> | BaseActionDefinition<'dialog.ok'> | BaseActionDefinition<'flow.back'> | BaseActionDefinition<'flow.cancel'> | BaseActionDefinition<'flow.finish'> | BaseActionDefinition<'flow.next'> | BaseActionDefinition<'link.back'> | BaseActionDefinition<'link.next'> | BaseActionDefinition<'noop'> | BaseActionDefinition<'team.join'> | BaseActionDefinition<'team.list'> | BaseActionDefinition<'throw'> | ConditionActionDefinition | DialogActionDefinition | DownloadActionDefinition | EachActionDefinition | EmailActionDefinition | EventActionDefinition | FlowToActionDefinition | LinkActionDefinition | LogActionDefinition | MessageActionDefinition | RequestActionDefinition | ResourceCountActionDefinition | ResourceCreateActionDefinition | ResourceDeleteActionDefinition | ResourceGetActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageReadActionDefinition | StorageWriteActionDefinition | TeamInviteActionDefinition | UserLoginAction | UserRegisterAction | UserUpdateAction;
1032
+ export type ActionDefinition = AnalyticsAction | BaseActionDefinition<'dialog.error'> | BaseActionDefinition<'dialog.ok'> | BaseActionDefinition<'flow.back'> | BaseActionDefinition<'flow.cancel'> | BaseActionDefinition<'flow.finish'> | BaseActionDefinition<'flow.next'> | BaseActionDefinition<'link.back'> | BaseActionDefinition<'link.next'> | BaseActionDefinition<'noop'> | BaseActionDefinition<'team.join'> | BaseActionDefinition<'team.list'> | BaseActionDefinition<'throw'> | ConditionActionDefinition | DialogActionDefinition | DownloadActionDefinition | EachActionDefinition | EmailActionDefinition | EventActionDefinition | FlowToActionDefinition | LinkActionDefinition | LogActionDefinition | MessageActionDefinition | RequestActionDefinition | ResourceCountActionDefinition | ResourceCreateActionDefinition | ResourceDeleteActionDefinition | ResourceGetActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageReadActionDefinition | StorageWriteActionDefinition | TeamInviteActionDefinition | UserLoginAction | UserRegisterAction | UserUpdateAction;
1016
1033
  export interface ActionType {
1017
1034
  /**
1018
1035
  * Whether or not app creators are required to define this action.
@@ -1118,6 +1135,10 @@ export interface BasePageDefinition {
1118
1135
  * The name of the page is used to determine the URL path of the page.
1119
1136
  */
1120
1137
  name: string;
1138
+ /**
1139
+ * Whether or not the page name should be displayed in the *app bar*.
1140
+ */
1141
+ hideName?: boolean;
1121
1142
  /**
1122
1143
  * The name of the page when displayed in the navigation menu.
1123
1144
  *
@@ -1179,12 +1200,20 @@ export interface FlowPageDefinition extends BasePageDefinition {
1179
1200
  * @default 'corner-dots'
1180
1201
  */
1181
1202
  progress?: 'corner-dots' | 'hidden';
1203
+ /**
1204
+ * Whether to retain the flow data when navigating away to another page outside the flow.
1205
+ *
1206
+ * By default the flow page retains it's data after navigating once. Set to false to clear it.
1207
+ *
1208
+ * @default true
1209
+ */
1210
+ retainFlowData?: boolean;
1182
1211
  }
1183
1212
  export interface TabsPageDefinition extends BasePageDefinition {
1184
1213
  type: 'tabs';
1185
1214
  tabs: SubPage[];
1186
1215
  }
1187
- export declare type PageDefinition = BasicPageDefinition | FlowPageDefinition | TabsPageDefinition;
1216
+ export type PageDefinition = BasicPageDefinition | FlowPageDefinition | TabsPageDefinition;
1188
1217
  export interface AppDefinition {
1189
1218
  /**
1190
1219
  * The name of the app.
@@ -1654,7 +1683,7 @@ export interface AppSamlSecret extends WritableAppSamlSecret {
1654
1683
  */
1655
1684
  spCertificate?: string;
1656
1685
  }
1657
- export declare type SAMLStatus = 'badsignature' | 'emailconflict' | 'invalidrelaystate' | 'invalidsecret' | 'invalidstatuscode' | 'invalidsubjectconfirmation' | 'missingnameid' | 'missingsubject';
1686
+ export type SAMLStatus = 'badsignature' | 'emailconflict' | 'invalidrelaystate' | 'invalidsecret' | 'invalidstatuscode' | 'invalidsubjectconfirmation' | 'missingnameid' | 'missingsubject';
1658
1687
  /**
1659
1688
  * The block configuration that’s used by the CLI when building a block.
1660
1689
  *
package/index.ts CHANGED
@@ -378,11 +378,13 @@ export interface Remappers {
378
378
  'array.append': Remapper[];
379
379
 
380
380
  /**
381
- * Remove item(s) from an array given a predefined array of indices.
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.
382
384
  *
383
385
  * If the input is not an array an empty array is returned.
384
386
  */
385
- 'array.omit': number[];
387
+ 'array.omit': Remapper[];
386
388
 
387
389
  /**
388
390
  * Create a new object given some predefined mapper keys.
@@ -467,6 +469,23 @@ export interface Remappers {
467
469
  */
468
470
  history: number;
469
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
+
470
489
  /**
471
490
  * Assign properties from the history stack at a certain index to an existing object.
472
491
  */
@@ -1383,6 +1402,11 @@ export interface BasePageDefinition {
1383
1402
  */
1384
1403
  name: string;
1385
1404
 
1405
+ /**
1406
+ * Whether or not the page name should be displayed in the *app bar*.
1407
+ */
1408
+ hideName?: boolean;
1409
+
1386
1410
  /**
1387
1411
  * The name of the page when displayed in the navigation menu.
1388
1412
  *
@@ -1455,6 +1479,15 @@ export interface FlowPageDefinition extends BasePageDefinition {
1455
1479
  * @default 'corner-dots'
1456
1480
  */
1457
1481
  progress?: 'corner-dots' | 'hidden';
1482
+
1483
+ /**
1484
+ * Whether to retain the flow data when navigating away to another page outside the flow.
1485
+ *
1486
+ * By default the flow page retains it's data after navigating once. Set to false to clear it.
1487
+ *
1488
+ * @default true
1489
+ */
1490
+ retainFlowData?: boolean;
1458
1491
  }
1459
1492
 
1460
1493
  export interface TabsPageDefinition extends BasePageDefinition {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/types",
3
- "version": "0.20.19",
3
+ "version": "0.20.21",
4
4
  "description": "TypeScript definitions reused within Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
package/ssl.d.ts CHANGED
@@ -7,8 +7,8 @@
7
7
  * - `ready` means the SSL certificate is ready to serve.
8
8
  * - `unknown` means the status is unknown, probably due to an unexpected state.
9
9
  */
10
- export declare type SSLStatus = 'error' | 'missing' | 'pending' | 'ready' | 'unknown';
10
+ export type SSLStatus = 'error' | 'missing' | 'pending' | 'ready' | 'unknown';
11
11
  /**
12
12
  * A mapping of domain names to an SSL certificate status.
13
13
  */
14
- export declare type SSLStatusMap = Record<string, SSLStatus>;
14
+ export type SSLStatusMap = Record<string, SSLStatus>;