@appsemble/types 0.20.0 → 0.20.3

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.
@@ -829,6 +844,15 @@ export interface BlockManifest {
829
844
  * If the block has no messages, this property is `null`.
830
845
  */
831
846
  languages: string[] | null;
847
+ /**
848
+ * Whether the block should be listed publicly
849
+ * for users who aren’t part of the block’s organization.
850
+ *
851
+ * - **`public`**: The block is visible for everyone.
852
+ * - **`unlisted`**: The block will only be visible if the user is
853
+ * logged in and is part of the block’s organization.
854
+ */
855
+ visibility?: 'public' | 'unlisted';
832
856
  /**
833
857
  * Whether action validation for wildcard action is skipped.
834
858
  */
@@ -1194,26 +1218,6 @@ export interface Organization {
1194
1218
  */
1195
1219
  iconUrl: string;
1196
1220
  }
1197
- /**
1198
- * Represents a team within an organization.
1199
- */
1200
- export interface Team {
1201
- /**
1202
- * The ID of the team.
1203
- */
1204
- id: number;
1205
- /**
1206
- * The display name of the team.
1207
- */
1208
- name: string;
1209
- /**
1210
- * Custom annotations for the team.
1211
- */
1212
- annotations?: Record<string, string>;
1213
- }
1214
- export interface TeamMember extends Team {
1215
- role: 'manager' | 'member';
1216
- }
1217
1221
  /**
1218
1222
  * An invite for an organizaton.
1219
1223
  */
@@ -1409,7 +1413,7 @@ export declare type SAMLStatus = 'badsignature' | 'emailconflict' | 'invalidrela
1409
1413
  *
1410
1414
  * This configuration is also passed to the Webpack configuration function as the `env` variable.
1411
1415
  */
1412
- export interface BlockConfig extends Pick<BlockManifest, 'actions' | 'description' | 'events' | 'layout' | 'longDescription' | 'messages' | 'name' | 'parameters' | 'version' | 'wildcardActions'> {
1416
+ export interface BlockConfig extends Pick<BlockManifest, 'actions' | 'description' | 'events' | 'layout' | 'longDescription' | 'messages' | 'name' | 'parameters' | 'version' | 'visibility' | 'wildcardActions'> {
1413
1417
  /**
1414
1418
  * The path to the webpack configuration file relative to the block project directory.
1415
1419
  */
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.0",
3
+ "version": "0.20.3",
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.0",
34
- "@fortawesome/fontawesome-common-types": "^0.2.0",
33
+ "@appsemble/sdk": "0.20.3",
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"