@appsemble/types 0.23.9 → 0.24.1

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,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.23.9/config/assets/logo.svg) Appsemble Types
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.24.1/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.23.9/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.23.9)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.24.1/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.24.1)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](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.23.9/LICENSE.md) ©
29
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.24.1/LICENSE.md) ©
30
30
  [Appsemble](https://appsemble.com)
package/action.d.ts CHANGED
@@ -43,5 +43,5 @@ export type ResourcePatchAction = RequestLikeAction<'resource.patch'>;
43
43
  /**
44
44
  * An action that can be called from within a block.
45
45
  */
46
- export type Action = BaseAction<'analytics'> | 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<'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<'team.invite'> | BaseAction<'team.join'> | BaseAction<'team.list'> | BaseAction<'team.members'> | BaseAction<'throw'> | BaseAction<'user.create'> | BaseAction<'user.login'> | BaseAction<'user.logout'> | BaseAction<'user.register'> | BaseAction<'user.update'> | LinkAction | LogAction | RequestAction | ResourceCountAction | ResourceCreateAction | ResourceDeleteAction | ResourceGetAction | ResourcePatchAction | ResourceQueryAction | ResourceUpdateAction;
46
+ export type Action = BaseAction<'analytics'> | 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<'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<'team.invite'> | BaseAction<'team.join'> | BaseAction<'team.list'> | BaseAction<'team.members'> | BaseAction<'throw'> | BaseAction<'user.create'> | BaseAction<'user.login'> | BaseAction<'user.logout'> | BaseAction<'user.query'> | BaseAction<'user.register'> | BaseAction<'user.remove'> | BaseAction<'user.update'> | LinkAction | LogAction | RequestAction | ResourceCountAction | ResourceCreateAction | ResourceDeleteAction | ResourceGetAction | ResourcePatchAction | ResourceQueryAction | ResourceUpdateAction;
47
47
  export {};
package/index.d.ts CHANGED
@@ -650,6 +650,18 @@ export interface ResourceView {
650
650
  */
651
651
  remap: Remapper;
652
652
  }
653
+ export interface UserPropertyDefinition {
654
+ /**
655
+ * The JSON schema to validate user properties against before sending it to the backend.
656
+ */
657
+ schema: OpenAPIV3.SchemaObject;
658
+ /**
659
+ * The resource that is referenced by this user property.
660
+ */
661
+ reference?: {
662
+ resource: string;
663
+ };
664
+ }
653
665
  export interface ResourceDefinition {
654
666
  /**
655
667
  * The default list of roles used for permission checks for each action.
@@ -717,6 +729,14 @@ export interface ResourceDefinition {
717
729
  * @example '1d 8h 30m'
718
730
  */
719
731
  expires?: string;
732
+ /**
733
+ * Whether the resource should be able to be transferred when cloning the app it belongs to.
734
+ */
735
+ clonable?: boolean;
736
+ /**
737
+ * Whether the resource should be cleaned up regularly.
738
+ */
739
+ ephemeral?: boolean;
720
740
  }
721
741
  export interface BaseActionDefinition<T extends Action['type']> {
722
742
  /**
@@ -883,7 +903,7 @@ export interface LinkActionDefinition extends BaseActionDefinition<'link'> {
883
903
  *
884
904
  * This should be a page name.
885
905
  */
886
- to: string[] | string;
906
+ to: Remapper | string[] | string;
887
907
  }
888
908
  export interface NotifyActionDefinition extends BaseActionDefinition<'notify'> {
889
909
  /**
@@ -1074,6 +1094,10 @@ export interface UserRegisterAction extends BaseActionDefinition<'user.register'
1074
1094
  properties?: Remapper;
1075
1095
  }
1076
1096
  export interface UserCreateAction extends BaseActionDefinition<'user.create'> {
1097
+ /**
1098
+ * The display name of the user.
1099
+ */
1100
+ name: Remapper;
1077
1101
  /**
1078
1102
  * The email address to login with.
1079
1103
  */
@@ -1083,49 +1107,55 @@ export interface UserCreateAction extends BaseActionDefinition<'user.create'> {
1083
1107
  */
1084
1108
  password: Remapper;
1085
1109
  /**
1086
- * The display name of the user.
1110
+ * Custom properties that can be assigned freely.
1111
+ *
1112
+ * Every value will be converted to a string.
1087
1113
  */
1088
- displayName: Remapper;
1114
+ properties?: Remapper;
1089
1115
  /**
1090
1116
  * The role of the created user
1091
1117
  */
1092
1118
  role?: Remapper;
1119
+ }
1120
+ export interface UserQueryAction extends BaseActionDefinition<'user.query'> {
1093
1121
  /**
1094
- * Custom properties that can be assigned freely.
1095
- *
1096
- * Every value will be converted to a string.
1122
+ * The roles of the users to fetch.
1097
1123
  */
1098
- properties?: Remapper;
1124
+ roles?: Remapper;
1099
1125
  }
1100
1126
  export interface UserUpdateAction extends BaseActionDefinition<'user.update'> {
1101
1127
  /**
1102
- * The email address to update.
1103
- */
1104
- email?: Remapper;
1105
- /**
1106
- * The password to update.
1128
+ * The display name to update.
1107
1129
  */
1108
- password?: Remapper;
1130
+ name?: Remapper;
1109
1131
  /**
1110
- * The display name to update.
1132
+ * The email address of the user to update.
1111
1133
  */
1112
- displayName?: Remapper;
1134
+ currentEmail: Remapper;
1113
1135
  /**
1114
- * The role of the created user
1136
+ * The new email address of the user.
1115
1137
  */
1116
- role?: Remapper;
1138
+ newEmail?: Remapper;
1117
1139
  /**
1118
- * The profile picture to update.
1119
- *
1120
- * This must be a file, otherwise it’s ignored.
1140
+ * The password to update.
1121
1141
  */
1122
- picture?: Remapper;
1142
+ password?: Remapper;
1123
1143
  /**
1124
1144
  * Custom properties that can be assigned freely.
1125
1145
  *
1126
1146
  * Every value will be converted to a string.
1127
1147
  */
1128
1148
  properties?: Remapper;
1149
+ /**
1150
+ * The role of the created user
1151
+ */
1152
+ role?: Remapper;
1153
+ }
1154
+ export interface UserRemoveAction extends BaseActionDefinition<'user.remove'> {
1155
+ /**
1156
+ * The email address of the account to delete.
1157
+ */
1158
+ email: Remapper;
1129
1159
  }
1130
1160
  export interface RequestLikeActionDefinition<T extends Action['type'] = Action['type']> extends BaseActionDefinition<T> {
1131
1161
  /**
@@ -1245,7 +1275,7 @@ export type MessageActionDefinition = BaseActionDefinition<'message'> & BaseMess
1245
1275
  */
1246
1276
  body: Remapper;
1247
1277
  };
1248
- 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 | ControllerActionDefinition | DialogActionDefinition | DownloadActionDefinition | EachActionDefinition | EmailActionDefinition | EventActionDefinition | FlowToActionDefinition | LinkActionDefinition | LogActionDefinition | MatchActionDefinition | MessageActionDefinition | NotifyActionDefinition | RequestActionDefinition | ResourceCountActionDefinition | ResourceCreateActionDefinition | ResourceDeleteActionDefinition | ResourceGetActionDefinition | ResourcePatchActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageAppendActionDefinition | StorageDeleteActionDefinition | StorageReadActionDefinition | StorageSubtractActionDefinition | StorageUpdateActionDefinition | StorageWriteActionDefinition | TeamInviteActionDefinition | TeamMembersActionDefinition | UserCreateAction | UserLoginAction | UserLogoutAction | UserRegisterAction | UserUpdateAction;
1278
+ 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 | ControllerActionDefinition | DialogActionDefinition | DownloadActionDefinition | EachActionDefinition | EmailActionDefinition | EventActionDefinition | FlowToActionDefinition | LinkActionDefinition | LogActionDefinition | MatchActionDefinition | MessageActionDefinition | NotifyActionDefinition | RequestActionDefinition | ResourceCountActionDefinition | ResourceCreateActionDefinition | ResourceDeleteActionDefinition | ResourceGetActionDefinition | ResourcePatchActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageAppendActionDefinition | StorageDeleteActionDefinition | StorageReadActionDefinition | StorageSubtractActionDefinition | StorageUpdateActionDefinition | StorageWriteActionDefinition | TeamInviteActionDefinition | TeamMembersActionDefinition | UserCreateAction | UserLoginAction | UserLogoutAction | UserQueryAction | UserRegisterAction | UserRemoveAction | UserUpdateAction;
1249
1279
  export interface ActionType {
1250
1280
  /**
1251
1281
  * Whether or not app creators are required to define this action.
@@ -1460,6 +1490,9 @@ export interface AppDefinition {
1460
1490
  */
1461
1491
  pages: PageDefinition[];
1462
1492
  controller?: ControllerDefinition;
1493
+ users?: {
1494
+ properties: Record<string, UserPropertyDefinition>;
1495
+ };
1463
1496
  /**
1464
1497
  * Resource definitions that may be used by the app.
1465
1498
  */
@@ -1574,7 +1607,11 @@ export interface App {
1574
1607
  /**
1575
1608
  * Whether the app has clonable resources.
1576
1609
  */
1577
- resources?: boolean;
1610
+ hasClonableResources?: boolean;
1611
+ /**
1612
+ * Whether the app has clonable assets.
1613
+ */
1614
+ hasClonableAssets?: boolean;
1578
1615
  /**
1579
1616
  * A list of URLs to app screenshots
1580
1617
  */
@@ -1702,13 +1739,15 @@ export interface OrganizationInvite {
1702
1739
  role: string;
1703
1740
  }
1704
1741
  /**
1705
- * The controller of an app.
1742
+ * App member in an app.
1706
1743
  */
1707
1744
  export interface AppMember {
1708
1745
  id: string;
1709
1746
  name: string;
1710
1747
  primaryEmail: string;
1711
1748
  role: string;
1749
+ demo: boolean;
1750
+ properties: Record<string, any>;
1712
1751
  }
1713
1752
  /**
1714
1753
  * The layout used to store Appsemble messages.
@@ -1924,7 +1963,7 @@ export interface Training {
1924
1963
  /**
1925
1964
  * Tags related to competence of the training.
1926
1965
  */
1927
- competence: string;
1966
+ competences: string[];
1928
1967
  /**
1929
1968
  * Difficulty level of the training.
1930
1969
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/types",
3
- "version": "0.23.9",
3
+ "version": "0.24.1",
4
4
  "description": "TypeScript definitions reused within Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
package/resource.d.ts CHANGED
@@ -9,6 +9,15 @@ export interface Resource {
9
9
  * This only applies to template apps.
10
10
  */
11
11
  $clonable: boolean;
12
+ /**
13
+ * A boolean indicating whether the resource will be used for creating ephemeral
14
+ * resources in demo apps
15
+ */
16
+ $seed: boolean;
17
+ /**
18
+ * A boolean indicating whether the resource will be cleaned up regularly
19
+ */
20
+ $ephemeral: boolean;
12
21
  /**
13
22
  * When the resource was first created as an ISO 8601 formatted string.
14
23
  */