@allthings/sdk 6.0.0 → 6.2.0-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.
@@ -0,0 +1,11 @@
1
+ import { DEFAULT_CLIENT_CONFIG as DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, IParameterStore } from './parameterStore';
2
+ declare const DEFAULT_AWS_CONFIGURATION: {
3
+ region: string;
4
+ };
5
+ export { DEFAULT_AWS_CONFIGURATION, DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, IParameterStore, };
6
+ declare const _default: {
7
+ parameterStore: (userConfig: IParameterStore) => {
8
+ getSecret: (param: string) => Promise<string>;
9
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { SSMClientConfig } from '@aws-sdk/client-ssm';
2
+ export interface IParameterStore {
3
+ clientConfig?: SSMClientConfig;
4
+ defaultValue?: string;
5
+ logger?: (message: string) => void;
6
+ onlyDefault?: boolean;
7
+ prefix?: string;
8
+ }
9
+ export declare const DEFAULT_CLIENT_CONFIG: IParameterStore;
10
+ declare const parameterStore: (userConfig: IParameterStore) => {
11
+ getSecret: (param: string) => Promise<string>;
12
+ };
13
+ export default parameterStore;
@@ -1,8 +1,8 @@
1
- export { default as restClient, EnumCommunicationPreferenceChannel, EnumUserPermissionRole, EnumUnitObjectType, EnumUnitType, EnumUserPermissionObjectType, EnumUserRelationType, EnumUtilisationPeriodType, } from './rest';
2
- export { EnumCountryCode, EnumLocale, EnumLookupUserType, EnumResource, EnumServiceProviderType, EnumTimezone, EnumCommunicationMethodType, EnumInputChannel, IAllthingsRestClient, IAllthingsRestClientOptions, } from './rest/types';
3
- export { IUser } from './rest/methods/user';
4
- export { ITicket } from './rest/methods/ticket';
1
+ export { default as createTokenStore } from './oauth/createTokenStore';
2
+ export { EnumCommunicationPreferenceChannel, EnumUnitObjectType, EnumUnitType, EnumUserPermissionObjectType, EnumUserPermissionRole, EnumUserRelationType, EnumUtilisationPeriodType, default as restClient, } from './rest';
5
3
  export { IApp } from './rest/methods/app';
6
4
  export { IProperty } from './rest/methods/property';
5
+ export { ITicket } from './rest/methods/ticket';
6
+ export { IUser } from './rest/methods/user';
7
7
  export { IUtilisationPeriod } from './rest/methods/utilisationPeriod';
8
- export { default as createTokenStore } from './oauth/createTokenStore';
8
+ export { EnumCommunicationMethodType, EnumCountryCode, EnumInputChannel, EnumLocale, EnumLookupUserType, EnumResource, EnumServiceProviderType, EnumTimezone, IAllthingsRestClient, IAllthingsRestClientOptions, } from './rest/types';
@@ -4,8 +4,8 @@ export interface IOAuthToken {
4
4
  readonly refreshToken?: string;
5
5
  }
6
6
  export interface ITokenStore {
7
- readonly set: (token: IOAuthToken) => void;
8
7
  readonly get: (key: keyof IOAuthToken) => string | undefined;
9
8
  readonly reset: () => void;
9
+ readonly set: (token: IOAuthToken) => void;
10
10
  }
11
11
  export type TokenRequester = (params: Record<string, any>) => Promise<IOAuthToken>;
@@ -3,5 +3,5 @@ import { EnumCommunicationPreferenceChannel, EnumUserPermissionObjectType, EnumU
3
3
  import { EnumUserRelationType } from './methods/userRelation';
4
4
  import { EnumUtilisationPeriodType } from './methods/utilisationPeriod';
5
5
  import { IAllthingsRestClient, IAllthingsRestClientOptions } from './types';
6
- export { EnumCommunicationPreferenceChannel, EnumUserPermissionRole, EnumUnitObjectType, EnumUnitType, EnumUserPermissionObjectType, EnumUserRelationType, EnumUtilisationPeriodType, };
6
+ export { EnumCommunicationPreferenceChannel, EnumUnitObjectType, EnumUnitType, EnumUserPermissionObjectType, EnumUserPermissionRole, EnumUserRelationType, EnumUtilisationPeriodType, };
7
7
  export default function restClient(userOptions?: Partial<IAllthingsRestClientOptions>): IAllthingsRestClient;
@@ -1,6 +1,6 @@
1
1
  import { EnumLocale, IAllthingsRestClient } from '../types';
2
2
  import { EnumUserPermissionObjectType, EnumUserPermissionRole, IUserPermission, PartialUser, UserResult } from './user';
3
- export type AgentPermissionsResult = Promise<ReadonlyArray<IUserPermission>>;
3
+ export type AgentPermissionsResult = Promise<readonly IUserPermission[]>;
4
4
  export type MethodAgentCreate = (appId: string, propertyManagerId: string, username: string, data: PartialUser & {
5
5
  readonly email: string;
6
6
  readonly locale: EnumLocale;
@@ -9,5 +9,5 @@ export declare function agentCreate(client: IAllthingsRestClient, appId: string,
9
9
  readonly email: string;
10
10
  readonly locale: EnumLocale;
11
11
  }, sendInvitation?: boolean, externalAgentCompany?: string): UserResult;
12
- export type MethodAgentCreatePermissions = (agentId: string, objectId: string, objectType: EnumUserPermissionObjectType, permissions: ReadonlyArray<EnumUserPermissionRole>, startDate?: Date, endDate?: Date) => Promise<boolean>;
13
- export declare function agentCreatePermissions(client: IAllthingsRestClient, agentId: string, objectId: string, objectType: EnumUserPermissionObjectType, permissions: ReadonlyArray<EnumUserPermissionRole>, startDate?: Date, endDate?: Date): Promise<boolean>;
12
+ export type MethodAgentCreatePermissions = (agentId: string, objectId: string, objectType: EnumUserPermissionObjectType, permissions: readonly EnumUserPermissionRole[], startDate?: Date, endDate?: Date) => Promise<boolean>;
13
+ export declare function agentCreatePermissions(client: IAllthingsRestClient, agentId: string, objectId: string, objectType: EnumUserPermissionObjectType, permissions: readonly EnumUserPermissionRole[], startDate?: Date, endDate?: Date): Promise<boolean>;
@@ -1,23 +1,23 @@
1
1
  import { IAllthingsRestClient } from '../types';
2
2
  export interface IApp {
3
+ readonly emailToTicketEnabled: boolean;
4
+ readonly emailToTicketForwardingEnabled: boolean;
3
5
  readonly id: string;
4
6
  readonly name: string;
5
7
  readonly siteUrl: string;
6
- readonly emailToTicketEnabled: boolean;
7
- readonly emailToTicketForwardingEnabled: boolean;
8
8
  }
9
9
  export type PartialApp = Partial<IApp>;
10
10
  export type AppResult = Promise<IApp>;
11
11
  export type CreateAppResult = Promise<IApp>;
12
12
  export type MethodAppCreate = (userId: string, data: PartialApp & {
13
13
  readonly name: string;
14
- readonly siteUrl: string;
15
14
  readonly notificationsEmailAddress: string;
15
+ readonly siteUrl: string;
16
16
  }) => CreateAppResult;
17
17
  export declare function appCreate(client: IAllthingsRestClient, userId: string, data: PartialApp & {
18
18
  readonly name: string;
19
- readonly siteUrl: string;
20
19
  readonly notificationsEmailAddress: string;
20
+ readonly siteUrl: string;
21
21
  }): CreateAppResult;
22
22
  export type MethodAppGetById = (appId: string) => AppResult;
23
23
  export declare function appGetById(client: IAllthingsRestClient, appId: string): AppResult;
@@ -1,19 +1,19 @@
1
1
  import { IAllthingsRestClient } from '../types';
2
2
  export type BucketResult = Promise<IBucket>;
3
3
  export interface IBucket {
4
+ readonly channels: readonly string[];
5
+ readonly files: readonly string[];
4
6
  readonly id: string;
5
- readonly channels: ReadonlyArray<string>;
6
- readonly files: ReadonlyArray<string>;
7
7
  readonly name: string;
8
8
  }
9
9
  export type MethodBucketGet = (bucketId: string) => BucketResult;
10
10
  export declare function bucketGet(client: IAllthingsRestClient, bucketId: string): BucketResult;
11
11
  export type MethodBucketCreate = (data: {
12
- readonly channels: ReadonlyArray<string>;
12
+ readonly channels: readonly string[];
13
13
  readonly name: string;
14
14
  }) => BucketResult;
15
15
  export declare function bucketCreate(client: IAllthingsRestClient, data: {
16
- readonly channels: ReadonlyArray<string>;
16
+ readonly channels: readonly string[];
17
17
  readonly name: string;
18
18
  }): BucketResult;
19
19
  export type MethodBucketAddFile = (bucketId: string, fileId: string) => Promise<boolean>;
@@ -1,14 +1,16 @@
1
1
  /// <reference types="node" />
2
2
  import { EnumCommunicationMethodType, EnumInputChannel, IAllthingsRestClient } from '../types';
3
3
  export interface IConversation {
4
- readonly id: string;
5
4
  readonly createdAt: string;
5
+ readonly id: string;
6
6
  }
7
7
  export interface IMessage {
8
+ readonly _embedded?: any;
9
+ readonly _links?: any;
8
10
  readonly content: {
9
11
  readonly content?: string;
10
12
  readonly description?: string;
11
- readonly files?: ReadonlyArray<string>;
13
+ readonly files?: readonly string[];
12
14
  };
13
15
  readonly createdAt: string;
14
16
  readonly id: string;
@@ -16,14 +18,12 @@ export interface IMessage {
16
18
  readonly internal: boolean;
17
19
  readonly read: boolean;
18
20
  readonly type: string;
19
- readonly _embedded?: any;
20
- readonly _links?: any;
21
21
  }
22
22
  export interface IMessagePayload {
23
- readonly attachments?: ReadonlyArray<{
23
+ readonly attachments?: readonly {
24
24
  readonly content: Buffer;
25
25
  readonly filename: string;
26
- }>;
26
+ }[];
27
27
  readonly body: string;
28
28
  readonly createdBy: {
29
29
  readonly type: EnumCommunicationMethodType;
@@ -2,29 +2,29 @@
2
2
  import { IAllthingsRestClient } from '../types';
3
3
  export type FileResult = Promise<IFile>;
4
4
  interface IFileUrl {
5
- readonly url: string;
5
+ readonly height: number;
6
6
  readonly size: number;
7
+ readonly url: string;
7
8
  readonly width: number;
8
- readonly height: number;
9
9
  }
10
10
  export interface IFile {
11
- readonly id: string;
12
- readonly name: string;
13
- readonly type: string;
14
- readonly size: number;
15
- readonly description: string;
16
- readonly originalFilename: string;
17
- readonly extension: string;
18
11
  readonly category: string;
19
- readonly path: string;
20
12
  readonly deletedAt: string;
13
+ readonly description: string;
14
+ readonly extension: string;
21
15
  readonly files: {
22
- readonly original: IFileUrl;
23
16
  readonly big: IFileUrl;
24
17
  readonly medium: IFileUrl;
18
+ readonly original: IFileUrl;
25
19
  readonly small: IFileUrl;
26
20
  readonly thumb: IFileUrl;
27
21
  };
22
+ readonly id: string;
23
+ readonly name: string;
24
+ readonly originalFilename: string;
25
+ readonly path: string;
26
+ readonly size: number;
27
+ readonly type: string;
28
28
  }
29
29
  export type MethodFileCreate = (data: {
30
30
  readonly file: Blob | Buffer | ReadableStream;
@@ -20,11 +20,11 @@ export interface IGroup {
20
20
  readonly propertyOwner: string;
21
21
  readonly readOnly: boolean;
22
22
  readonly stats: {
23
- readonly tenantCount: number | null;
23
+ readonly inhabitedUnits: number | null;
24
24
  readonly invitationCount: number | null;
25
25
  readonly occupancy: number | null;
26
+ readonly tenantCount: number | null;
26
27
  readonly unitCount: number | null;
27
- readonly inhabitedUnits: number | null;
28
28
  };
29
29
  }
30
30
  export type PartialGroup = Partial<IGroup>;
@@ -3,14 +3,14 @@ export type LookupIdResult = Promise<{
3
3
  readonly [externalId: string]: string | null;
4
4
  }>;
5
5
  export type MethodLookupIds = (appId: string, data: {
6
- readonly resource: EnumResource;
7
- readonly externalIds: string | ReadonlyArray<string>;
6
+ readonly externalIds: string | readonly string[];
8
7
  readonly parentId?: string;
8
+ readonly resource: EnumResource;
9
9
  readonly userType?: EnumLookupUserType;
10
10
  }) => LookupIdResult;
11
11
  export declare function lookupIds(client: IAllthingsRestClient, appId: string, data: {
12
- readonly resource: EnumResource;
13
- readonly externalIds: string | ReadonlyArray<string>;
12
+ readonly externalIds: string | readonly string[];
14
13
  readonly parentId?: string;
14
+ readonly resource: EnumResource;
15
15
  readonly userType?: EnumLookupUserType;
16
16
  }): LookupIdResult;
@@ -1,15 +1,15 @@
1
1
  import { IAllthingsRestClient } from '../types';
2
2
  export interface IRegistrationCodeTenant {
3
3
  readonly email?: string;
4
- readonly phone?: string;
5
4
  readonly name?: string;
5
+ readonly phone?: string;
6
6
  }
7
7
  export interface IRegistrationCodeOptions {
8
8
  readonly externalId?: string;
9
+ readonly instantTenantInviteActive?: boolean;
9
10
  readonly permanent?: boolean;
10
- readonly tenant?: IRegistrationCodeTenant;
11
11
  readonly readOnly?: boolean;
12
- readonly instantTenantInviteActive?: boolean;
12
+ readonly tenant?: IRegistrationCodeTenant;
13
13
  }
14
14
  export interface IRegistrationCode extends Required<IRegistrationCodeOptions> {
15
15
  readonly code: string;
@@ -18,13 +18,13 @@ export interface IRegistrationCode extends Required<IRegistrationCodeOptions> {
18
18
  readonly externalId: string;
19
19
  readonly id: string;
20
20
  readonly invitationSent: boolean;
21
- readonly utilisationPeriods: ReadonlyArray<string>;
21
+ readonly utilisationPeriods: readonly string[];
22
22
  }
23
23
  export type PartialRegistrationCode = Partial<IRegistrationCode>;
24
24
  export type RegistrationCodeResult = Promise<IRegistrationCode>;
25
25
  export declare const remapRegistationCodeResult: (registrationCode: any) => any;
26
- export type MethodRegistrationCodeCreate = (code: string, utilisationPeriods: string | ReadonlyArray<string>, options?: IRegistrationCodeOptions) => RegistrationCodeResult;
27
- export declare function registrationCodeCreate(client: IAllthingsRestClient, code: string, utilisationPeriods: string | ReadonlyArray<string>, options?: IRegistrationCodeOptions): RegistrationCodeResult;
26
+ export type MethodRegistrationCodeCreate = (code: string, utilisationPeriods: string | readonly string[], options?: IRegistrationCodeOptions) => RegistrationCodeResult;
27
+ export declare function registrationCodeCreate(client: IAllthingsRestClient, code: string, utilisationPeriods: string | readonly string[], options?: IRegistrationCodeOptions): RegistrationCodeResult;
28
28
  export type MethodRegistrationCodeUpdateById = (registrationCodeId: string, data: PartialRegistrationCode) => RegistrationCodeResult;
29
29
  export declare function registrationCodeUpdateById(client: IAllthingsRestClient, registrationCodeId: string, data: PartialRegistrationCode): RegistrationCodeResult;
30
30
  export type MethodRegistrationCodeGetById = (registrationCodeId: string) => RegistrationCodeResult;
@@ -25,24 +25,24 @@ export interface ICustomSettingsItem {
25
25
  readonly value: string;
26
26
  }
27
27
  export interface ITicketCreatePayload {
28
- readonly files?: ReadonlyArray<{
29
- readonly content: Buffer;
30
- readonly filename: string;
31
- }>;
32
28
  readonly category: string;
33
29
  readonly channel?: string;
34
30
  readonly createdByCommunicationMethod?: {
35
31
  readonly type: string;
36
32
  readonly value: string;
37
33
  };
34
+ readonly customSettings?: readonly ICustomSettingsItem[];
38
35
  readonly description: string;
36
+ readonly files?: readonly {
37
+ readonly content: Buffer;
38
+ readonly filename: string;
39
+ }[];
39
40
  readonly inputChannel: string;
40
- readonly title: string;
41
41
  readonly phoneNumber?: string;
42
- readonly customSettings?: ReadonlyArray<ICustomSettingsItem>;
42
+ readonly title: string;
43
43
  }
44
44
  interface ITicketParticipant extends IUser {
45
- readonly roles: ReadonlyArray<string>;
45
+ readonly roles: readonly string[];
46
46
  }
47
47
  export interface ITicket {
48
48
  readonly _embedded: {
@@ -51,18 +51,18 @@ export interface ITicket {
51
51
  readonly id: string;
52
52
  readonly name: IMessage;
53
53
  };
54
- readonly conversations: ReadonlyArray<{
55
- readonly id: string;
54
+ readonly conversations: readonly {
56
55
  readonly _embedded: {
57
- readonly participants: ReadonlyArray<ITicketParticipant>;
56
+ readonly participants: readonly ITicketParticipant[];
58
57
  };
59
- }>;
58
+ readonly id: string;
59
+ }[];
60
60
  readonly createdBy: IUser;
61
- readonly files: ReadonlyArray<IFile>;
61
+ readonly files: readonly IFile[];
62
62
  readonly group: {
63
63
  readonly address: object;
64
64
  };
65
- readonly labels: ReadonlyArray<ITicketLabel>;
65
+ readonly labels: readonly ITicketLabel[];
66
66
  readonly property: {
67
67
  readonly id: string;
68
68
  readonly name: string;
@@ -72,24 +72,24 @@ export interface ITicket {
72
72
  };
73
73
  };
74
74
  readonly category: string;
75
- readonly channels: ReadonlyArray<string>;
75
+ readonly channels: readonly string[];
76
76
  readonly commentCount: number;
77
77
  readonly createdAt: string;
78
+ readonly customSettings?: readonly ICustomSettingsItem[];
78
79
  readonly customerWaitingSinceIndicator: ETrafficLightColor;
79
- readonly customSettings?: ReadonlyArray<ICustomSettingsItem>;
80
80
  readonly description: string;
81
- readonly files: ReadonlyArray<string>;
81
+ readonly files: readonly string[];
82
82
  readonly id: string;
83
- readonly token?: string;
84
83
  readonly incrementID: string;
85
- readonly labels: ReadonlyArray<string>;
84
+ readonly labels: readonly string[];
86
85
  readonly lastStatusUpdate: string;
87
86
  readonly phoneNumber: string;
88
87
  readonly read: boolean;
89
88
  readonly sortHash: string;
90
89
  readonly status: ETicketStatus;
91
- readonly tags: ReadonlyArray<string>;
90
+ readonly tags: readonly string[];
92
91
  readonly title: string;
92
+ readonly token?: string;
93
93
  readonly unreadAdminMessages: number;
94
94
  readonly unreadUserMessages: number;
95
95
  readonly updatedAt: string;
@@ -17,10 +17,10 @@ export declare enum EnumCommunicationPreferenceChannel {
17
17
  email = "email"
18
18
  }
19
19
  export interface IUser {
20
- readonly communicationPreferences: ReadonlyArray<{
21
- readonly channels: ReadonlyArray<EnumCommunicationPreferenceChannel>;
20
+ readonly communicationPreferences: readonly {
21
+ readonly channels: readonly EnumCommunicationPreferenceChannel[];
22
22
  readonly event: string;
23
- }>;
23
+ }[];
24
24
  readonly createdAt: string;
25
25
  readonly deletionRequestedAt: string | null;
26
26
  readonly description: string;
@@ -32,20 +32,20 @@ export interface IUser {
32
32
  readonly inviteEmailSent: boolean;
33
33
  readonly lastLogin: string | null;
34
34
  readonly locale: EnumLocale;
35
- readonly nativeAppInstallIds: ReadonlyArray<string> | null;
35
+ readonly nativeAppInstallIds: readonly string[] | null;
36
36
  readonly passwordChanged: boolean;
37
37
  readonly phoneNumber: string | null;
38
38
  readonly profileImage: string | null;
39
- readonly properties: ReadonlyArray<string> | null;
39
+ readonly properties: readonly string[] | null;
40
40
  readonly publicProfile: boolean;
41
+ readonly readOnly: boolean;
41
42
  readonly receiveAdminNotifications: boolean;
42
- readonly roles: ReadonlyArray<string>;
43
+ readonly roles: readonly string[];
43
44
  readonly tenantIds: {
44
45
  readonly [key: string]: string;
45
46
  };
46
47
  readonly type: EnumUserType | null;
47
48
  readonly username: string;
48
- readonly readOnly: boolean;
49
49
  }
50
50
  export type PartialUser = Partial<IUser>;
51
51
  export type UserResult = Promise<IUser>;
@@ -80,21 +80,21 @@ export declare enum EnumUserPermissionObjectType {
80
80
  unit = "Unit"
81
81
  }
82
82
  export interface IUserPermission {
83
+ readonly endDate?: Date;
83
84
  readonly id: string;
84
85
  readonly label: string;
85
- readonly restricted: boolean;
86
- readonly restrictions: ReadonlyArray<object>;
87
- readonly role: string;
88
86
  readonly objectId: string;
89
87
  readonly objectType: EnumUserPermissionObjectType;
88
+ readonly restricted: boolean;
89
+ readonly restrictions: readonly object[];
90
+ readonly role: string;
90
91
  readonly startDate?: Date;
91
- readonly endDate?: Date;
92
92
  }
93
93
  export type PartialUserPermission = Partial<IUserPermission>;
94
94
  export type UserPermissionResult = Promise<IUserPermission>;
95
95
  export declare const remapEmbeddedUser: (embedded: {
96
96
  readonly [key: string]: any;
97
- }) => ReadonlyArray<IUser>;
97
+ }) => readonly IUser[];
98
98
  export type MethodUserCreate = (appId: string, username: string, data: PartialUser & {
99
99
  readonly email: string;
100
100
  readonly locale: EnumLocale;
@@ -114,39 +114,39 @@ export declare function userGetById(client: IAllthingsRestClient, userId: string
114
114
  export type MethodUserUpdateById = (userId: string, data: PartialUser) => UserResult;
115
115
  export declare function userUpdateById(client: IAllthingsRestClient, userId: string, data: PartialUser): UserResult;
116
116
  export type MethodUserCreatePermission = (userId: string, permission: PartialUserPermission & {
117
+ readonly endDate?: Date;
117
118
  readonly objectId: string;
118
119
  readonly objectType: EnumUserPermissionObjectType;
119
- readonly restrictions: ReadonlyArray<object>;
120
+ readonly restrictions: readonly object[];
120
121
  readonly role: EnumUserPermissionRole;
121
122
  readonly startDate?: Date;
122
- readonly endDate?: Date;
123
123
  }) => UserPermissionResult;
124
124
  export declare function userCreatePermission(client: IAllthingsRestClient, userId: string, data: PartialUserPermission & {
125
+ readonly endDate?: Date;
125
126
  readonly objectId: string;
126
127
  readonly objectType: EnumUserPermissionObjectType;
127
- readonly restrictions: ReadonlyArray<object>;
128
+ readonly restrictions: readonly object[];
128
129
  readonly role: EnumUserPermissionRole;
129
130
  readonly startDate?: Date;
130
- readonly endDate?: Date;
131
131
  }): UserPermissionResult;
132
132
  export type MethodUserCreatePermissionBatch = (userId: string, permissions: PartialUserPermission & {
133
+ readonly endDate?: Date;
133
134
  readonly objectId: string;
134
135
  readonly objectType: EnumUserPermissionObjectType;
135
- readonly restrictions: ReadonlyArray<object>;
136
- readonly roles: ReadonlyArray<EnumUserPermissionRole>;
136
+ readonly restrictions: readonly object[];
137
+ readonly roles: readonly EnumUserPermissionRole[];
137
138
  readonly startDate?: Date;
138
- readonly endDate?: Date;
139
139
  }) => Promise<boolean>;
140
140
  export declare function userCreatePermissionBatch(client: IAllthingsRestClient, userId: string, permissions: PartialUserPermission & {
141
+ readonly endDate?: Date;
141
142
  readonly objectId: string;
142
143
  readonly objectType: EnumUserPermissionObjectType;
143
- readonly restrictions: ReadonlyArray<object>;
144
- readonly roles: ReadonlyArray<EnumUserPermissionRole>;
144
+ readonly restrictions: readonly object[];
145
+ readonly roles: readonly EnumUserPermissionRole[];
145
146
  readonly startDate?: Date;
146
- readonly endDate?: Date;
147
147
  }): Promise<boolean>;
148
- export type MethodUserGetPermissions = (userId: string) => Promise<ReadonlyArray<IUserPermission>>;
149
- export declare function userGetPermissions(client: IAllthingsRestClient, userId: string): Promise<ReadonlyArray<IUserPermission>>;
148
+ export type MethodUserGetPermissions = (userId: string) => Promise<readonly IUserPermission[]>;
149
+ export declare function userGetPermissions(client: IAllthingsRestClient, userId: string): Promise<readonly IUserPermission[]>;
150
150
  export type MethodUserDeletePermission = (permissionId: string) => Promise<boolean>;
151
151
  export declare function userDeletePermission(client: IAllthingsRestClient, permissionId: string): Promise<boolean>;
152
152
  export type MethodUserGetUtilisationPeriods = (userId: string) => UtilisationPeriodResults;
@@ -1,15 +1,15 @@
1
1
  import { EntityResultList, EnumResource, IAllthingsRestClient } from '../types';
2
2
  export interface IUserRelation {
3
3
  readonly id: string;
4
- readonly user: string;
5
- readonly type: string;
6
- readonly responsibilities: ReadonlyArray<{
4
+ readonly readOnly: boolean;
5
+ readonly responsibilities: readonly {
6
+ readonly groups: readonly string[];
7
7
  readonly id: string;
8
+ readonly properties: readonly string[];
8
9
  readonly role?: string;
9
- readonly properties: ReadonlyArray<string>;
10
- readonly groups: ReadonlyArray<string>;
11
- }>;
12
- readonly readOnly: boolean;
10
+ }[];
11
+ readonly type: string;
12
+ readonly user: string;
13
13
  }
14
14
  export type UserRelationResult = Promise<IUserRelation>;
15
15
  export type UserRelationResultList = EntityResultList<IUserRelation>;
@@ -17,30 +17,30 @@ export declare enum EnumUserRelationType {
17
17
  isResponsible = "is-responsible"
18
18
  }
19
19
  export type MethodUserRelationCreate = (userId: string, data: {
20
- readonly ids: ReadonlyArray<string>;
20
+ readonly ids: readonly string[];
21
+ readonly level: EnumResource;
21
22
  readonly readOnly?: boolean;
22
23
  readonly role?: string;
23
24
  readonly type: EnumUserRelationType;
24
- readonly level: EnumResource;
25
25
  }) => UserRelationResult;
26
26
  export type MethodUserRelationDelete = (userId: string, data: {
27
- readonly ids: ReadonlyArray<string>;
27
+ readonly ids: readonly string[];
28
+ readonly level: EnumResource;
28
29
  readonly role?: string;
29
30
  readonly type: EnumUserRelationType;
30
- readonly level: EnumResource;
31
31
  }) => UserRelationResult;
32
32
  export type MethodUserRelationsGetByUser = (userId: string) => UserRelationResultList;
33
33
  export declare function userRelationCreate(client: IAllthingsRestClient, userId: string, data: {
34
- readonly ids: ReadonlyArray<string>;
34
+ readonly ids: readonly string[];
35
+ readonly level: EnumResource;
35
36
  readonly readOnly: boolean;
36
37
  readonly role?: string;
37
38
  readonly type: EnumUserRelationType;
38
- readonly level: EnumResource;
39
39
  }): UserRelationResult;
40
40
  export declare function userRelationDelete(client: IAllthingsRestClient, userId: string, data: {
41
- readonly ids: ReadonlyArray<string>;
41
+ readonly ids: readonly string[];
42
+ readonly level: EnumResource;
42
43
  readonly role?: string;
43
44
  readonly type: EnumUserRelationType;
44
- readonly level: EnumResource;
45
45
  }): UserRelationResult;
46
46
  export declare function userRelationsGetByUser(client: IAllthingsRestClient, userId: string): UserRelationResultList;
@@ -8,52 +8,52 @@ export declare enum EnumUtilisationPeriodType {
8
8
  }
9
9
  export interface IUtilisationPeriod {
10
10
  readonly _embedded: {
11
- readonly invitations: ReadonlyArray<any>;
12
11
  readonly [key: string]: any;
12
+ readonly invitations: readonly any[];
13
13
  };
14
14
  readonly endDate: string | null;
15
15
  readonly externalId: string | null;
16
16
  readonly id: string;
17
- readonly invitations: ReadonlyArray<IUtilisationPeriodInvite>;
17
+ readonly invitations: readonly IUtilisationPeriodInvite[];
18
18
  readonly name: string;
19
+ readonly readOnly: boolean;
19
20
  readonly startDate: string;
20
21
  readonly stats: {
21
- readonly tenantCount: number | null;
22
22
  readonly invitationCount: number | null;
23
+ readonly tenantCount: number | null;
23
24
  };
24
- readonly tenantIds: ReadonlyArray<string>;
25
+ readonly tenantIds: readonly string[];
25
26
  readonly type: EnumUtilisationPeriodType;
26
27
  readonly userCount: number | null;
27
- readonly users: ReadonlyArray<IUser>;
28
- readonly readOnly: boolean;
28
+ readonly users: readonly IUser[];
29
29
  }
30
30
  export interface IUtilisationPeriodInvite {
31
- readonly id: string;
32
31
  readonly code: string;
33
32
  readonly createdAt: string;
34
33
  readonly email: string | null;
35
34
  readonly expiresAt: string | null;
36
- readonly permanent: boolean;
37
- readonly utilisationPeriods: ReadonlyArray<string>;
38
- readonly invitationSent: boolean;
39
35
  readonly externalId: string;
40
- readonly organizations: ReadonlyArray<string>;
41
- readonly teams: ReadonlyArray<string>;
36
+ readonly id: string;
37
+ readonly invitationSent: boolean;
38
+ readonly organizations: readonly string[];
39
+ readonly permanent: boolean;
40
+ readonly resendAttempts: readonly string[];
41
+ readonly teams: readonly string[];
42
42
  readonly tenant: IRegistrationCodeTenant;
43
- readonly resendAttempts: ReadonlyArray<string>;
44
43
  readonly usedAt: string | null;
44
+ readonly utilisationPeriods: readonly string[];
45
45
  }
46
46
  export type PartialUtilisationPeriod = Partial<IUtilisationPeriod>;
47
47
  export type UtilisationPeriodResult = Promise<IUtilisationPeriod>;
48
- export type UtilisationPeriodResults = Promise<ReadonlyArray<IUtilisationPeriod>>;
48
+ export type UtilisationPeriodResults = Promise<readonly IUtilisationPeriod[]>;
49
49
  export type MethodUtilisationPeriodCreate = (unitId: string, data: PartialUtilisationPeriod & {
50
- readonly startDate: string;
51
50
  readonly endDate?: string;
51
+ readonly startDate: string;
52
52
  readonly type?: EnumUtilisationPeriodType;
53
53
  }) => UtilisationPeriodResult;
54
54
  export declare function utilisationPeriodCreate(client: IAllthingsRestClient, unitId: string, data: PartialUtilisationPeriod & {
55
- readonly startDate: string;
56
55
  readonly endDate?: string;
56
+ readonly startDate: string;
57
57
  readonly type?: EnumUtilisationPeriodType;
58
58
  }): UtilisationPeriodResult;
59
59
  export type MethodUtilisationPeriodGetById = (id: string) => UtilisationPeriodResult;
@@ -2,7 +2,7 @@
2
2
  import { ITokenStore, TokenRequester } from '../oauth/types';
3
3
  import { IAllthingsRestClientOptions } from './types';
4
4
  interface IFormOptions {
5
- readonly [key: string]: ReadonlyArray<any>;
5
+ readonly [key: string]: readonly any[];
6
6
  }
7
7
  interface IBodyFormData {
8
8
  readonly formData: IFormOptions;