@appsemble/types 0.29.11 → 0.30.2

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/index.d.ts CHANGED
@@ -3,13 +3,14 @@ import { type Schema } from 'jsonschema';
3
3
  import { type OpenAPIV3 } from 'openapi-types';
4
4
  import { type JsonObject, type RequireExactlyOne } from 'type-fest';
5
5
  import { type Action, type LogAction } from './action.js';
6
- import { type AppVisibility, type TeamsDefinition } from './app.js';
6
+ import { type AppVisibility } from './app.js';
7
7
  import { type BulmaColor } from './bulma.js';
8
8
  import { type HTTPMethods } from './http.js';
9
+ import { type AppPermission } from './permissions.js';
10
+ import { type AppRole, type PredefinedAppRole, type PredefinedOrganizationRole } from './roles.js';
9
11
  import { type Theme } from './theme.js';
10
12
  export * from './action.js';
11
13
  export * from './app.js';
12
- export * from './appMember.js';
13
14
  export * from './asset.js';
14
15
  export * from './authentication.js';
15
16
  export * from './author.js';
@@ -21,11 +22,12 @@ export * from './snapshot.js';
21
22
  export * from './resource.js';
22
23
  export * from './saml.js';
23
24
  export * from './ssl.js';
24
- export * from './team.js';
25
25
  export * from './template.js';
26
26
  export * from './theme.js';
27
- export * from './user.js';
27
+ export * from './oauth2.js';
28
28
  export * from './quota.js';
29
+ export * from './permissions.js';
30
+ export * from './roles.js';
29
31
  /**
30
32
  * A representation of a generated OAuth2 authorization code response.
31
33
  */
@@ -103,7 +105,7 @@ export interface BlockDefinition extends ControllerDefinition {
103
105
  /**
104
106
  * A list of roles that are allowed to view this block.
105
107
  */
106
- roles?: string[];
108
+ roles?: ViewRole[];
107
109
  /**
108
110
  * A free form mapping of named parameters.
109
111
  *
@@ -118,7 +120,7 @@ export interface BlockDefinition extends ControllerDefinition {
118
120
  * The Connect2id server can be set up to provide additional custom claims, such as roles and
119
121
  * permissions.
120
122
  */
121
- export interface UserInfo {
123
+ export interface BaseUserInfo {
122
124
  /**
123
125
  * The subject (end-user) identifier. This member is always present in a claims set.
124
126
  */
@@ -139,10 +141,6 @@ export interface UserInfo {
139
141
  * The URL of the profile picture for the end-user.
140
142
  */
141
143
  picture?: string;
142
- /**
143
- * A URL that links to the user profile.
144
- */
145
- profile?: string;
146
144
  /**
147
145
  * The end-user’s locale, represented as a BCP47 language tag.
148
146
  */
@@ -151,22 +149,41 @@ export interface UserInfo {
151
149
  * The end-user’s time zone.
152
150
  */
153
151
  zoneinfo?: string;
154
- /**
155
- * The end-user's additional properties
156
- */
157
- properties?: Record<string, any>;
152
+ }
153
+ export interface UserInfo extends BaseUserInfo {
158
154
  /**
159
155
  * If the user is subscribed to the newsletter
160
156
  */
161
157
  subscribed?: boolean;
158
+ }
159
+ export interface AppMemberInfo extends BaseUserInfo {
162
160
  /**
163
- * The properties of the currently logged in member of the app
161
+ * The role of the app member.
164
162
  */
165
- appMember?: AppMember;
163
+ role: AppRole;
166
164
  /**
167
- * Returns `true` if the user has no Oauth connections and no password.
165
+ * The end-user's additional properties
168
166
  */
169
- hasNoLoginMethods?: boolean;
167
+ properties?: Record<string, any>;
168
+ /**
169
+ * Whether this app member is used for demonstration purposes
170
+ */
171
+ demo: boolean;
172
+ }
173
+ export interface SSOConfiguration {
174
+ type: 'oauth2' | 'saml';
175
+ url: string;
176
+ icon: IconName;
177
+ name: string;
178
+ }
179
+ export interface AppAccount {
180
+ app: App;
181
+ appMemberInfo: AppMemberInfo;
182
+ sso: SSOConfiguration[];
183
+ }
184
+ export interface EmailAuthorization {
185
+ email: string;
186
+ verified: boolean;
170
187
  }
171
188
  /**
172
189
  * The payload stored in our JSON web tokens
@@ -266,13 +283,17 @@ export interface Remappers {
266
283
  *
267
284
  * Supported properties:
268
285
  *
269
- * - `memberId`: Get the id of the AppMember.
270
- * - `userId`: Get the id of the user associated with AppMember object.
271
- * - `role`: Get the role of the app member
272
- * - `primaryEmail`: Get the primary email of the user associated with AppMember object.
273
- * - `name`: Get the name of the user associated with AppMember object.
286
+ * - `sub`: Get the id of the app member.
287
+ * - `name`: Get the name of the app member.
288
+ * - `email`: Get the email of the app member.
289
+ * - `email_verified`: Whether the email of the app member is verified.
290
+ * - `picture`: Get the picture of the app member.
291
+ * - `locale`: Get the locale of the app member.
292
+ * - `zoneinfo`: Get the zoneinfo of the app member.
293
+ * - `role`: Get the role of the app member.
294
+ * - `properties`: Get the custom properties of the app member.
274
295
  */
275
- appMember: keyof AppMember;
296
+ 'app.member': keyof AppMemberInfo;
276
297
  /**
277
298
  * Get a predefined app variable by name.
278
299
  */
@@ -354,6 +375,10 @@ export interface Remappers {
354
375
  * The value to set is the log level.
355
376
  */
356
377
  log: 'error' | 'info' | 'warn';
378
+ /**
379
+ * Get input object type.
380
+ */
381
+ type: null;
357
382
  /**
358
383
  * Builds an array based on the given data and remappers.
359
384
  *
@@ -413,6 +438,11 @@ export interface Remappers {
413
438
  * Returns nothing if array.map’s context isn’t set.
414
439
  */
415
440
  array: 'index' | 'item' | 'length';
441
+ /**
442
+ *
443
+ * Returns an array containing the items matching the specified conditions.
444
+ */
445
+ 'array.filter': Remapper;
416
446
  /**
417
447
  * Returns an object based on the specified condition
418
448
  */
@@ -598,7 +628,6 @@ export interface Remappers {
598
628
  * This does not support parameters, for more nuanced translations use `string.format`.
599
629
  */
600
630
  translate: string;
601
- user: keyof UserInfo;
602
631
  container: string;
603
632
  }
604
633
  export type ObjectRemapper = RequireExactlyOne<Remappers>;
@@ -615,22 +644,42 @@ export interface SubscriptionResponseResource {
615
644
  }>;
616
645
  }
617
646
  export type SubscriptionResponse = Record<string, SubscriptionResponseResource>;
647
+ export type ResourceViewAction = 'get' | 'query';
648
+ export type OwnResourceAction = ResourceViewAction | 'delete' | 'patch' | 'update';
649
+ export type ResourceAction = ResourceViewAction | 'create' | 'delete' | 'patch' | 'update';
650
+ export type CustomAppResourcePermission = `$resource:${string}:${ResourceAction}`;
651
+ export type CustomAppOwnResourcePermission = `$resource:${string}:own:${OwnResourceAction}`;
652
+ export type CustomAppResourceViewPermission = `$resource:${string}:${ResourceViewAction}:${string}`;
653
+ export type CustomAppGuestPermission = AppPermission | CustomAppResourcePermission | CustomAppResourceViewPermission;
654
+ export type CustomAppPermission = CustomAppGuestPermission | CustomAppOwnResourcePermission;
655
+ export interface GuestDefinition {
656
+ permissions?: CustomAppPermission[];
657
+ inherits?: AppRole[];
658
+ }
618
659
  export interface RoleDefinition {
619
660
  description?: string;
620
- inherits?: string[];
621
661
  defaultPage?: string;
662
+ inherits?: AppRole[];
663
+ permissions?: CustomAppPermission[];
664
+ }
665
+ export type SecurityPolicy = 'everyone' | 'invite' | 'organization';
666
+ export interface MinimalSecurity {
667
+ guest: GuestDefinition;
668
+ default?: {
669
+ role: AppRole;
670
+ policy?: SecurityPolicy;
671
+ };
672
+ roles?: Record<Exclude<string, PredefinedAppRole>, RoleDefinition>;
622
673
  }
623
- export interface Security {
674
+ export interface StrictSecurity {
675
+ guest?: GuestDefinition;
624
676
  default: {
625
- role: string;
626
- policy?: 'everyone' | 'invite' | 'organization';
677
+ role: AppRole;
678
+ policy?: SecurityPolicy;
627
679
  };
628
680
  roles: Record<string, RoleDefinition>;
629
- /**
630
- * Define how teams are handled by the app.
631
- */
632
- teams?: TeamsDefinition;
633
681
  }
682
+ export type Security = MinimalSecurity | StrictSecurity;
634
683
  export type Navigation = 'bottom' | 'hidden' | 'left-menu';
635
684
  export type LayoutPosition = 'hidden' | 'navbar' | 'navigation';
636
685
  export interface NotificationDefinition {
@@ -665,10 +714,6 @@ export interface ResourceCall {
665
714
  * Query parameters to pass along with the request.
666
715
  */
667
716
  query?: Remapper;
668
- /**
669
- * The roles that are allowed to perform this action.
670
- */
671
- roles?: string[];
672
717
  }
673
718
  export interface ResourceReferenceActionTrigger {
674
719
  type: 'create' | 'delete' | 'update';
@@ -693,16 +738,12 @@ export interface ResourceHistoryDefinition {
693
738
  data: boolean;
694
739
  }
695
740
  export interface ResourceView {
696
- /**
697
- * The roles required to use this view.
698
- */
699
- roles: string[];
700
741
  /**
701
742
  * The remappers used to transform the output.
702
743
  */
703
744
  remap: Remapper;
704
745
  }
705
- export interface UserPropertyDefinition {
746
+ export interface AppMemberPropertyDefinition {
706
747
  /**
707
748
  * The JSON schema to validate user properties against before sending it to the backend.
708
749
  */
@@ -715,10 +756,6 @@ export interface UserPropertyDefinition {
715
756
  };
716
757
  }
717
758
  export interface ResourceDefinition {
718
- /**
719
- * The default list of roles used for permission checks for each action.
720
- */
721
- roles?: string[];
722
759
  /**
723
760
  * A definition of how versioning should happen for instances of this resource.
724
761
  */
@@ -1083,35 +1120,55 @@ export interface StorageWriteActionDefinition extends BaseActionDefinition<'stor
1083
1120
  */
1084
1121
  storage?: StorageType;
1085
1122
  }
1086
- export interface TeamInviteActionDefinition extends BaseActionDefinition<'team.invite'> {
1123
+ export interface GroupMemberInviteActionDefinition extends BaseActionDefinition<'group.member.invite'> {
1087
1124
  /**
1088
- * The ID of the team to invite the user to.
1125
+ * The ID of the group to invite the user to.
1089
1126
  */
1090
- id?: Remapper;
1127
+ id: Remapper;
1091
1128
  /**
1092
1129
  * The email address of the user to invite.
1093
1130
  */
1094
- email?: Remapper;
1131
+ email: Remapper;
1132
+ /**
1133
+ * The role of the invited group member.
1134
+ */
1135
+ role: Remapper;
1136
+ }
1137
+ export interface GroupMemberQueryActionDefinition extends BaseActionDefinition<'group.member.query'> {
1138
+ /**
1139
+ * The ID of the group to query the members of.
1140
+ */
1141
+ id: Remapper;
1095
1142
  }
1096
- export interface TeamMembersActionDefinition extends BaseActionDefinition<'team.members'> {
1143
+ export interface GroupMemberDeleteActionDefinition extends BaseActionDefinition<'group.member.delete'> {
1097
1144
  /**
1098
- * The ID of the team to get the members from.
1145
+ * The ID of the group member to delete.
1099
1146
  */
1100
1147
  id: Remapper;
1101
1148
  }
1102
- export interface UserLoginAction extends BaseActionDefinition<'user.login'> {
1149
+ export interface GroupMemberRoleUpdateActionDefinition extends BaseActionDefinition<'group.member.role.update'> {
1103
1150
  /**
1104
- * The email address to login with.
1151
+ * The ID of the group member to update the role of.
1152
+ */
1153
+ id: Remapper;
1154
+ /**
1155
+ * The role to invite the app member with.
1156
+ */
1157
+ role: Remapper;
1158
+ }
1159
+ export interface AppMemberLoginAction extends BaseActionDefinition<'app.member.login'> {
1160
+ /**
1161
+ * The email address to log in with.
1105
1162
  */
1106
1163
  email: Remapper;
1107
1164
  /**
1108
- * The password to login with.
1165
+ * The password to log in with.
1109
1166
  */
1110
1167
  password: Remapper;
1111
1168
  }
1112
- export interface UserRegisterAction extends BaseActionDefinition<'user.register'> {
1169
+ export interface AppMemberRegisterAction extends BaseActionDefinition<'app.member.register'> {
1113
1170
  /**
1114
- * The email address to login with.
1171
+ * The email address to register with.
1115
1172
  */
1116
1173
  email: Remapper;
1117
1174
  /**
@@ -1119,15 +1176,9 @@ export interface UserRegisterAction extends BaseActionDefinition<'user.register'
1119
1176
  */
1120
1177
  password: Remapper;
1121
1178
  /**
1122
- * The display name of the user.
1179
+ * The full name of the app member.
1123
1180
  */
1124
- displayName: Remapper;
1125
- /**
1126
- * Whether to login after registering.
1127
- *
1128
- * @default true
1129
- */
1130
- login?: boolean;
1181
+ name: Remapper;
1131
1182
  /**
1132
1183
  * The profile picture to use.
1133
1184
  *
@@ -1140,54 +1191,56 @@ export interface UserRegisterAction extends BaseActionDefinition<'user.register'
1140
1191
  * Every value will be converted to a string.
1141
1192
  */
1142
1193
  properties?: Remapper;
1143
- }
1144
- export interface UserCreateAction extends BaseActionDefinition<'user.create'> {
1145
1194
  /**
1146
- * The display name of the user.
1195
+ * Whether to login after registering.
1196
+ *
1197
+ * @default true
1147
1198
  */
1148
- name: Remapper;
1199
+ login?: boolean;
1200
+ }
1201
+ export interface AppMemberInviteAction extends BaseActionDefinition<'app.member.invite'> {
1149
1202
  /**
1150
- * The email address to login with.
1203
+ * The email address to invite the app member with.
1151
1204
  */
1152
1205
  email: Remapper;
1153
1206
  /**
1154
- * The password to login with.
1155
- */
1156
- password: Remapper;
1157
- /**
1158
- * Custom properties that can be assigned freely.
1159
- *
1160
- * Every value will be converted to a string.
1207
+ * The role to invite the app member with.
1161
1208
  */
1162
- properties?: Remapper;
1163
- /**
1164
- * The role of the created user
1165
- */
1166
- role?: Remapper;
1209
+ role: Remapper;
1167
1210
  }
1168
- export interface UserQueryAction extends BaseActionDefinition<'user.query'> {
1211
+ export interface AppMemberQueryAction extends BaseActionDefinition<'app.member.query'> {
1169
1212
  /**
1170
1213
  * The roles of the users to fetch.
1171
1214
  */
1172
1215
  roles?: Remapper;
1173
1216
  }
1174
- export interface UserUpdateAction extends BaseActionDefinition<'user.update'> {
1217
+ export interface AppMemberRoleUpdateAction extends BaseActionDefinition<'app.member.role.update'> {
1175
1218
  /**
1176
- * The display name to update.
1219
+ * The id of the app member to update.
1177
1220
  */
1178
- name?: Remapper;
1221
+ sub: Remapper;
1179
1222
  /**
1180
- * The email address of the user to update.
1223
+ * The role of the updated app member
1181
1224
  */
1182
- currentEmail: Remapper;
1225
+ role: Remapper;
1226
+ }
1227
+ export interface AppMemberPropertiesPatchAction extends BaseActionDefinition<'app.member.properties.patch'> {
1183
1228
  /**
1184
- * The new email address of the user.
1229
+ * The id of the app member to update.
1230
+ */
1231
+ sub: Remapper;
1232
+ /**
1233
+ * Custom properties that can be assigned freely.
1234
+ *
1235
+ * Every value will be converted to a string.
1185
1236
  */
1186
- newEmail?: Remapper;
1237
+ properties: Remapper;
1238
+ }
1239
+ export interface AppMemberCurrentPatchAction extends BaseActionDefinition<'app.member.current.patch'> {
1187
1240
  /**
1188
- * The password to update.
1241
+ * The display name to update.
1189
1242
  */
1190
- password?: Remapper;
1243
+ name?: Remapper;
1191
1244
  /**
1192
1245
  * Custom properties that can be assigned freely.
1193
1246
  *
@@ -1195,15 +1248,17 @@ export interface UserUpdateAction extends BaseActionDefinition<'user.update'> {
1195
1248
  */
1196
1249
  properties?: Remapper;
1197
1250
  /**
1198
- * The role of the created user
1251
+ * The profile picture to use.
1252
+ *
1253
+ * This must be a file, otherwise it’s discarded.
1199
1254
  */
1200
- role?: Remapper;
1255
+ picture?: Remapper;
1201
1256
  }
1202
- export interface UserRemoveAction extends BaseActionDefinition<'user.remove'> {
1257
+ export interface AppMemberDeleteAction extends BaseActionDefinition<'app.member.delete'> {
1203
1258
  /**
1204
- * The email address of the account to delete.
1259
+ * The id of the app member to remove.
1205
1260
  */
1206
- email: Remapper;
1261
+ sub: Remapper;
1207
1262
  }
1208
1263
  export interface RequestLikeActionDefinition<T extends Action['type'] = Action['type']> extends BaseActionDefinition<T> {
1209
1264
  /**
@@ -1247,6 +1302,12 @@ interface ViewResourceDefinition {
1247
1302
  */
1248
1303
  view?: string;
1249
1304
  }
1305
+ interface OwnResourceDefinition {
1306
+ /**
1307
+ * If only the resources created by the authenticated app member should be included
1308
+ */
1309
+ own?: boolean;
1310
+ }
1250
1311
  export interface ControllerActionDefinition extends BaseActionDefinition<'controller'> {
1251
1312
  handler: string;
1252
1313
  }
@@ -1254,11 +1315,11 @@ export type RequestActionDefinition = RequestLikeActionDefinition<'request'>;
1254
1315
  export type ResourceCreateActionDefinition = ResourceActionDefinition<'resource.create'>;
1255
1316
  export type ResourceDeleteActionDefinition = ResourceActionDefinition<'resource.delete'>;
1256
1317
  export type ResourceGetActionDefinition = ResourceActionDefinition<'resource.get'> & ViewResourceDefinition;
1257
- export type ResourceQueryActionDefinition = ResourceActionDefinition<'resource.query'> & ViewResourceDefinition;
1258
- export type ResourceCountActionDefinition = ResourceActionDefinition<'resource.count'>;
1318
+ export type ResourceQueryActionDefinition = OwnResourceDefinition & ResourceActionDefinition<'resource.query'> & ViewResourceDefinition;
1319
+ export type ResourceCountActionDefinition = OwnResourceDefinition & ResourceActionDefinition<'resource.count'>;
1259
1320
  export type ResourceUpdateActionDefinition = ResourceActionDefinition<'resource.update'>;
1260
1321
  export type ResourcePatchActionDefinition = ResourceActionDefinition<'resource.patch'>;
1261
- export type UserLogoutAction = BaseActionDefinition<'user.logout'>;
1322
+ export type AppMemberLogoutAction = BaseActionDefinition<'app.member.logout'>;
1262
1323
  export interface BaseResourceSubscribeActionDefinition<T extends Action['type']> extends BaseActionDefinition<T> {
1263
1324
  /**
1264
1325
  * The name of the resource.
@@ -1323,7 +1384,7 @@ export type MessageActionDefinition = BaseActionDefinition<'message'> & BaseMess
1323
1384
  */
1324
1385
  body: Remapper;
1325
1386
  };
1326
- 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;
1387
+ 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 | ResourcePatchActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageAppendActionDefinition | StorageDeleteActionDefinition | StorageReadActionDefinition | StorageSubtractActionDefinition | StorageUpdateActionDefinition | StorageWriteActionDefinition;
1327
1388
  export interface ActionType {
1328
1389
  /**
1329
1390
  * Whether or not app creators are required to define this action.
@@ -1340,6 +1401,7 @@ export interface EventType {
1340
1401
  */
1341
1402
  description?: string;
1342
1403
  }
1404
+ export type ViewRole = AppRole | '$guest';
1343
1405
  /**
1344
1406
  * This describes what a page will look like in the app.
1345
1407
  */
@@ -1375,7 +1437,7 @@ export interface BasePageDefinition {
1375
1437
  /**
1376
1438
  * A list of roles that may view the page.
1377
1439
  */
1378
- roles?: string[];
1440
+ roles?: ViewRole[];
1379
1441
  /**
1380
1442
  * An optional icon from the fontawesome icon set
1381
1443
  *
@@ -1390,13 +1452,23 @@ export interface BasePageDefinition {
1390
1452
  * The global theme for the page.
1391
1453
  */
1392
1454
  theme?: Partial<Theme>;
1455
+ /**
1456
+ * A Remapper that resolves to a number to be visible in the side-menu.
1457
+ */
1458
+ badgeCount?: Remapper;
1459
+ /**
1460
+ * A mapping of actions that can be fired by the page to action handlers.
1461
+ */
1462
+ actions?: {
1463
+ onLoad?: ActionDefinition;
1464
+ };
1393
1465
  }
1394
1466
  /**
1395
1467
  * A subset of page for use within flow pages and tab pages.
1396
1468
  */
1397
- export interface SubPage {
1469
+ export interface SubPageDefinition {
1398
1470
  name: Remapper;
1399
- roles?: string[];
1471
+ roles?: ViewRole[];
1400
1472
  blocks: BlockDefinition[];
1401
1473
  }
1402
1474
  export interface BasicPageDefinition extends BasePageDefinition {
@@ -1407,9 +1479,9 @@ export interface ContainerPageDefinition extends BasePageDefinition {
1407
1479
  type: 'container';
1408
1480
  pages: PageDefinition[];
1409
1481
  }
1410
- export interface FlowPageDefinition extends BasePageDefinition {
1482
+ export interface FlowPageDefinition extends Omit<BasePageDefinition, 'actions'> {
1411
1483
  type: 'flow';
1412
- steps: SubPage[];
1484
+ steps: SubPageDefinition[];
1413
1485
  /**
1414
1486
  * A mapping of actions that can be fired by the page to action handlers.
1415
1487
  */
@@ -1437,7 +1509,7 @@ export interface LoopPageDefinition extends BasePageDefinition {
1437
1509
  /**
1438
1510
  * Template step that the loop will pass data onto
1439
1511
  */
1440
- foreach?: SubPage;
1512
+ foreach?: SubPageDefinition;
1441
1513
  /**
1442
1514
  * A mapping of actions that can be fired by the page to action handlers.
1443
1515
  */
@@ -1462,7 +1534,7 @@ export interface LoopPageDefinition extends BasePageDefinition {
1462
1534
  retainFlowData?: boolean;
1463
1535
  }
1464
1536
  export interface AlternateTabsDefinition {
1465
- foreach: SubPage;
1537
+ foreach: SubPageDefinition;
1466
1538
  events: {
1467
1539
  listen?: Record<string, string>;
1468
1540
  emit?: Record<string, string>;
@@ -1470,7 +1542,7 @@ export interface AlternateTabsDefinition {
1470
1542
  }
1471
1543
  export interface TabsPageDefinition extends BasePageDefinition {
1472
1544
  type: 'tabs';
1473
- tabs?: SubPage[];
1545
+ tabs?: SubPageDefinition[];
1474
1546
  definition?: AlternateTabsDefinition;
1475
1547
  /**
1476
1548
  * A mapping of actions that can be fired by the page to action handlers.
@@ -1503,10 +1575,6 @@ export interface AppDefinition {
1503
1575
  * This determines user roles and login behavior.
1504
1576
  */
1505
1577
  security?: Security;
1506
- /**
1507
- * A list of roles that are required to view pages. Specific page roles override this property.
1508
- */
1509
- roles?: string[];
1510
1578
  /**
1511
1579
  * The default page of the app.
1512
1580
  */
@@ -1557,8 +1625,8 @@ export interface AppDefinition {
1557
1625
  */
1558
1626
  pages: PageDefinition[];
1559
1627
  controller?: ControllerDefinition;
1560
- users?: {
1561
- properties: Record<string, UserPropertyDefinition>;
1628
+ members?: {
1629
+ properties: Record<string, AppMemberPropertyDefinition>;
1562
1630
  };
1563
1631
  /**
1564
1632
  * Resource definitions that may be used by the app.
@@ -1602,6 +1670,9 @@ export interface App {
1602
1670
  * This value will be generated automatically by the API.
1603
1671
  */
1604
1672
  id?: number;
1673
+ /**
1674
+ * A domain name on which this app should be served.
1675
+ */
1605
1676
  domain?: string;
1606
1677
  /**
1607
1678
  * The name used for emails
@@ -1820,19 +1891,81 @@ export interface OrganizationInvite {
1820
1891
  /**
1821
1892
  * The role the user should get when accepting the invite.
1822
1893
  */
1894
+ role: PredefinedOrganizationRole;
1895
+ }
1896
+ /**
1897
+ * An invite for an app.
1898
+ */
1899
+ export interface AppInvite {
1900
+ /**
1901
+ * The email address of the app member to invite.
1902
+ */
1903
+ email: string;
1904
+ /**
1905
+ * The role the app member should get when accepting the invite.
1906
+ */
1823
1907
  role: string;
1824
1908
  }
1825
1909
  /**
1826
- * App member in an app.
1910
+ * An invite for a group.
1911
+ */
1912
+ export interface GroupInvite {
1913
+ /**
1914
+ * The name of the group.
1915
+ */
1916
+ groupId?: number;
1917
+ /**
1918
+ * The name of the group.
1919
+ */
1920
+ groupName?: string;
1921
+ /**
1922
+ * The email address of the group member to invite.
1923
+ */
1924
+ email: string;
1925
+ /**
1926
+ * The role the group member should get when accepting the invite.
1927
+ */
1928
+ role: AppRole;
1929
+ }
1930
+ /**
1931
+ * Represents a group within an organization.
1827
1932
  */
1828
- export interface AppMember {
1829
- userId: string;
1830
- memberId: string;
1933
+ export interface Group {
1934
+ /**
1935
+ * The ID of the group.
1936
+ */
1937
+ id: number;
1938
+ /**
1939
+ * The display name of the group.
1940
+ */
1831
1941
  name: string;
1832
- primaryEmail: string;
1942
+ /**
1943
+ * Custom annotations for the group.
1944
+ */
1945
+ annotations?: Record<string, string>;
1946
+ }
1947
+ /**
1948
+ * Group member in a group.
1949
+ */
1950
+ export interface GroupMember {
1951
+ id: string;
1833
1952
  role: string;
1834
- demo: boolean;
1835
- properties: Record<string, any>;
1953
+ name: string;
1954
+ email: string;
1955
+ }
1956
+ export interface AppMemberGroup {
1957
+ /**
1958
+ * The ID of the group.
1959
+ */
1960
+ id: number;
1961
+ /**
1962
+ * The display name of the group.
1963
+ */
1964
+ name: string;
1965
+ /**
1966
+ * The role of the app member inside the group.
1967
+ */
1968
+ role: AppRole;
1836
1969
  }
1837
1970
  /**
1838
1971
  * The layout used to store Appsemble messages.