@appsemble/types 0.20.2 → 0.20.5

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/dist/app.d.ts CHANGED
@@ -9,3 +9,28 @@
9
9
  * - **private**: The app is only visible to people who are part of the organization.
10
10
  */
11
11
  export declare type AppVisibility = 'private' | 'public' | 'unlisted';
12
+ /**
13
+ * This defines how teams are handled by an app.
14
+ */
15
+ export interface TeamsDefinition {
16
+ /**
17
+ * If this is set to `anyone`, any logged in user may join a team. If this is set to `invite`,
18
+ * only users may join who have been invited.
19
+ */
20
+ join: 'anyone' | 'invite';
21
+ /**
22
+ * A list of app roles which may create a team.
23
+ *
24
+ * By default teams can only be created from Appsemble Studio.
25
+ *
26
+ * @default []
27
+ */
28
+ create?: string[];
29
+ /**
30
+ * The roles here determine which users may invite a team member.
31
+ *
32
+ * The special roles `$team:member` and `$team:manager` mean that users who are already member of
33
+ * manager of the team may also invite new members.
34
+ */
35
+ invite: string[];
36
+ }
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { IconName } from '@fortawesome/fontawesome-common-types';
3
3
  import { Schema } from 'jsonschema';
4
4
  import { OpenAPIV3 } from 'openapi-types';
5
5
  import { JsonObject, RequireExactlyOne } from 'type-fest';
6
- import { AppVisibility } from './app';
6
+ import { AppVisibility, TeamsDefinition } from './app';
7
7
  export * from './app';
8
8
  export * from './appMember';
9
9
  export * from './asset';
@@ -13,6 +13,7 @@ export * from './snapshot';
13
13
  export * from './resource';
14
14
  export * from './saml';
15
15
  export * from './ssl';
16
+ export * from './team';
16
17
  export * from './template';
17
18
  export * from './user';
18
19
  export { Theme };
@@ -330,6 +331,10 @@ export interface Security {
330
331
  policy?: 'everyone' | 'invite' | 'organization';
331
332
  };
332
333
  roles: Record<string, RoleDefinition>;
334
+ /**
335
+ * Define how teams are handled by the app.
336
+ */
337
+ teams?: TeamsDefinition;
333
338
  }
334
339
  export declare type Navigation = 'bottom' | 'hidden' | 'left-menu';
335
340
  export declare type LayoutPosition = 'hidden' | 'navbar' | 'navigation';
@@ -608,6 +613,16 @@ export interface StorageWriteActionDefinition extends BaseActionDefinition<'stor
608
613
  */
609
614
  storage?: StorageType;
610
615
  }
616
+ export interface TeamInviteActionDefinition extends BaseActionDefinition<'team.invite'> {
617
+ /**
618
+ * The ID of the team to invite the user to.
619
+ */
620
+ id?: Remapper;
621
+ /**
622
+ * The email address of the user to invite.
623
+ */
624
+ email?: Remapper;
625
+ }
611
626
  export interface UserLoginAction extends BaseActionDefinition<'user.login'> {
612
627
  /**
613
628
  * The email address to login with.
@@ -751,7 +766,7 @@ export declare type MessageActionDefinition = BaseActionDefinition<'message'> &
751
766
  */
752
767
  body: Remapper;
753
768
  };
754
- 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 | EmailActionDefinition | EventActionDefinition | FlowToActionDefinition | LinkActionDefinition | LogActionDefinition | MessageActionDefinition | RequestActionDefinition | ResourceCountActionDefinition | ResourceCreateActionDefinition | ResourceDeleteActionDefinition | ResourceGetActionDefinition | ResourceQueryActionDefinition | ResourceSubscriptionStatusActionDefinition | ResourceSubscriptionSubscribeActionDefinition | ResourceSubscriptionToggleActionDefinition | ResourceSubscriptionUnsubscribeActionDefinition | ResourceUpdateActionDefinition | ShareActionDefinition | StaticActionDefinition | StorageReadActionDefinition | StorageWriteActionDefinition | UserLoginAction | UserRegisterAction | UserUpdateAction;
769
+ 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 | 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;
755
770
  export interface ActionType {
756
771
  /**
757
772
  * Whether or not app creators are required to define this action.
@@ -1203,26 +1218,6 @@ export interface Organization {
1203
1218
  */
1204
1219
  iconUrl: string;
1205
1220
  }
1206
- /**
1207
- * Represents a team within an organization.
1208
- */
1209
- export interface Team {
1210
- /**
1211
- * The ID of the team.
1212
- */
1213
- id: number;
1214
- /**
1215
- * The display name of the team.
1216
- */
1217
- name: string;
1218
- /**
1219
- * Custom annotations for the team.
1220
- */
1221
- annotations?: Record<string, string>;
1222
- }
1223
- export interface TeamMember extends Team {
1224
- role: 'manager' | 'member';
1225
- }
1226
1221
  /**
1227
1222
  * An invite for an organizaton.
1228
1223
  */
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export * from './snapshot';
7
7
  export * from './resource';
8
8
  export * from './saml';
9
9
  export * from './ssl';
10
+ export * from './team';
10
11
  export * from './template';
11
12
  export * from './user';
12
13
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
package/dist/team.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Represents a team within an organization.
3
+ */
4
+ export interface Team {
5
+ /**
6
+ * The ID of the team.
7
+ */
8
+ id: number;
9
+ /**
10
+ * The display name of the team.
11
+ */
12
+ name: string;
13
+ /**
14
+ * Custom annotations for the team.
15
+ */
16
+ annotations?: Record<string, string>;
17
+ }
18
+ export interface TeamMember extends Team {
19
+ role: 'manager' | 'member';
20
+ }
package/dist/team.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../src/team.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/types",
3
- "version": "0.20.2",
3
+ "version": "0.20.5",
4
4
  "description": "TypeScript definitions reused within Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
@@ -30,8 +30,8 @@
30
30
  "test": "jest"
31
31
  },
32
32
  "dependencies": {
33
- "@appsemble/sdk": "0.20.2",
34
- "@fortawesome/fontawesome-common-types": "^0.3.0",
33
+ "@appsemble/sdk": "0.20.5",
34
+ "@fortawesome/fontawesome-common-types": "^6.0.0",
35
35
  "jsonschema": "^1.0.0",
36
36
  "openapi-types": "^10.0.0",
37
37
  "type-fest": "^2.0.0"