@allthings/sdk 5.0.1 → 5.0.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/dist/cli.js +4 -1
- package/dist/lib.cjs.js +4 -1
- package/dist/lib.esm.js +4 -1
- package/dist/lib.umd.min.js +1 -1
- package/dist/src/oauth/types.d.ts +1 -1
- package/dist/src/rest/delete.d.ts +2 -2
- package/dist/src/rest/get.d.ts +2 -2
- package/dist/src/rest/methods/agent.d.ts +3 -3
- package/dist/src/rest/methods/app.d.ts +6 -6
- package/dist/src/rest/methods/booking.d.ts +4 -4
- package/dist/src/rest/methods/bucket.d.ts +6 -6
- package/dist/src/rest/methods/conversation.d.ts +4 -4
- package/dist/src/rest/methods/file.d.ts +3 -3
- package/dist/src/rest/methods/group.d.ts +7 -7
- package/dist/src/rest/methods/idLookup.d.ts +2 -2
- package/dist/src/rest/methods/notification.d.ts +6 -6
- package/dist/src/rest/methods/notificationSettings.d.ts +4 -4
- package/dist/src/rest/methods/property.d.ts +7 -7
- package/dist/src/rest/methods/registrationCode.d.ts +6 -6
- package/dist/src/rest/methods/serviceProvider.d.ts +5 -5
- package/dist/src/rest/methods/ticket.d.ts +4 -4
- package/dist/src/rest/methods/unit.d.ts +7 -7
- package/dist/src/rest/methods/user.d.ts +18 -18
- package/dist/src/rest/methods/userRelation.d.ts +5 -5
- package/dist/src/rest/methods/utilisationPeriod.d.ts +10 -10
- package/dist/src/rest/patch.d.ts +2 -2
- package/dist/src/rest/post.d.ts +2 -2
- package/dist/src/rest/put.d.ts +2 -2
- package/dist/src/rest/request.d.ts +4 -4
- package/dist/src/rest/types.d.ts +1 -1
- package/dist/src/utils/functional.d.ts +1 -1
- package/dist/src/utils/logger.d.ts +1 -1
- package/dist/test/helpers.d.ts +1 -1
- package/package.json +14 -14
|
@@ -8,4 +8,4 @@ export interface ITokenStore {
|
|
|
8
8
|
readonly get: (key: keyof IOAuthToken) => string | undefined;
|
|
9
9
|
readonly reset: () => void;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type TokenRequester = (params: Record<string, any>) => Promise<IOAuthToken>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MethodHttpRequest } from './request';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type DeleteResult = Promise<any>;
|
|
3
|
+
export type MethodHttpDelete = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean) => DeleteResult;
|
|
4
4
|
export default function del(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean): DeleteResult;
|
package/dist/src/rest/get.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MethodHttpRequest } from './request';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type GetResult = Promise<any>;
|
|
3
|
+
export type MethodHttpGet = (method: string, query?: Record<string, any>, returnRawResultObject?: boolean) => GetResult;
|
|
4
4
|
export default function get(request: MethodHttpRequest, method: string, query: Record<string, any>, returnRawResultObject?: boolean): GetResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EnumLocale, IAllthingsRestClient } from '../types';
|
|
2
2
|
import { EnumUserPermissionObjectType, EnumUserPermissionRole, IUserPermission, PartialUser, UserResult } from './user';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type AgentPermissionsResult = Promise<ReadonlyArray<IUserPermission>>;
|
|
4
|
+
export type MethodAgentCreate = (appId: string, propertyManagerId: string, username: string, data: PartialUser & {
|
|
5
5
|
readonly email: string;
|
|
6
6
|
readonly locale: EnumLocale;
|
|
7
7
|
}, sendInvitation?: boolean, externalAgentCompany?: string) => UserResult;
|
|
@@ -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
|
|
12
|
+
export type MethodAgentCreatePermissions = (agentId: string, objectId: string, objectType: EnumUserPermissionObjectType, permissions: ReadonlyArray<EnumUserPermissionRole>, startDate?: Date, endDate?: Date) => Promise<boolean>;
|
|
13
13
|
export declare function agentCreatePermissions(client: IAllthingsRestClient, agentId: string, objectId: string, objectType: EnumUserPermissionObjectType, permissions: ReadonlyArray<EnumUserPermissionRole>, startDate?: Date, endDate?: Date): Promise<boolean>;
|
|
@@ -6,10 +6,10 @@ export interface IApp {
|
|
|
6
6
|
readonly emailToTicketEnabled: boolean;
|
|
7
7
|
readonly emailToTicketForwardingEnabled: boolean;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
9
|
+
export type PartialApp = Partial<IApp>;
|
|
10
|
+
export type AppResult = Promise<IApp>;
|
|
11
|
+
export type CreateAppResult = Promise<IApp>;
|
|
12
|
+
export type MethodAppCreate = (userId: string, data: PartialApp & {
|
|
13
13
|
readonly name: string;
|
|
14
14
|
readonly siteUrl: string;
|
|
15
15
|
readonly notificationsEmailAddress: string;
|
|
@@ -19,9 +19,9 @@ export declare function appCreate(client: IAllthingsRestClient, userId: string,
|
|
|
19
19
|
readonly siteUrl: string;
|
|
20
20
|
readonly notificationsEmailAddress: string;
|
|
21
21
|
}): CreateAppResult;
|
|
22
|
-
export
|
|
22
|
+
export type MethodAppGetById = (appId: string) => AppResult;
|
|
23
23
|
export declare function appGetById(client: IAllthingsRestClient, appId: string): AppResult;
|
|
24
|
-
export
|
|
24
|
+
export type MethodActiveUnitsGetByAppId = (appId: string) => PartialApp & {
|
|
25
25
|
readonly activeUnitCount: number;
|
|
26
26
|
};
|
|
27
27
|
export declare function activeUnitsGetByAppId(client: IAllthingsRestClient, appId: string): AppResult;
|
|
@@ -7,9 +7,9 @@ export interface IBooking {
|
|
|
7
7
|
readonly message: string;
|
|
8
8
|
readonly phoneNumber: string;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
10
|
+
export type PartialBooking = Partial<IBooking>;
|
|
11
|
+
export type BookingResult = Promise<IBooking>;
|
|
12
|
+
export type MethodBookingGetById = (bookingId: string) => BookingResult;
|
|
13
13
|
export declare function bookingGetById(client: IAllthingsRestClient, bookingId: string): BookingResult;
|
|
14
|
-
export
|
|
14
|
+
export type MethodBookingUpdateById = (bookingId: string, data: PartialBooking) => BookingResult;
|
|
15
15
|
export declare function bookingUpdateById(client: IAllthingsRestClient, bookingId: string, data: PartialBooking): BookingResult;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { IAllthingsRestClient } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type BucketResult = Promise<IBucket>;
|
|
3
3
|
export interface IBucket {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly channels: ReadonlyArray<string>;
|
|
6
6
|
readonly files: ReadonlyArray<string>;
|
|
7
7
|
readonly name: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type MethodBucketGet = (bucketId: string) => BucketResult;
|
|
10
10
|
export declare function bucketGet(client: IAllthingsRestClient, bucketId: string): BucketResult;
|
|
11
|
-
export
|
|
11
|
+
export type MethodBucketCreate = (data: {
|
|
12
12
|
readonly channels: ReadonlyArray<string>;
|
|
13
13
|
readonly name: string;
|
|
14
14
|
}) => BucketResult;
|
|
@@ -16,11 +16,11 @@ export declare function bucketCreate(client: IAllthingsRestClient, data: {
|
|
|
16
16
|
readonly channels: ReadonlyArray<string>;
|
|
17
17
|
readonly name: string;
|
|
18
18
|
}): BucketResult;
|
|
19
|
-
export
|
|
19
|
+
export type MethodBucketAddFile = (bucketId: string, fileId: string) => Promise<boolean>;
|
|
20
20
|
export declare function bucketAddFile(client: IAllthingsRestClient, bucketId: string, fileId: string): Promise<boolean>;
|
|
21
|
-
export
|
|
21
|
+
export type MethodBucketRemoveFile = (bucketId: string, fileId: string) => Promise<boolean>;
|
|
22
22
|
export declare function bucketRemoveFile(client: IAllthingsRestClient, bucketId: string, fileId: string): Promise<boolean>;
|
|
23
|
-
export
|
|
23
|
+
export type MethodBucketRemoveFilesInPath = (bucketId: string, data: {
|
|
24
24
|
readonly path: string;
|
|
25
25
|
}) => Promise<boolean>;
|
|
26
26
|
export declare function bucketRemoveFilesInPath(client: IAllthingsRestClient, bucketId: string, data: {
|
|
@@ -31,9 +31,9 @@ export interface IMessagePayload {
|
|
|
31
31
|
};
|
|
32
32
|
readonly inputChannel?: string;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
34
|
+
export type ConversationResult = Promise<IConversation>;
|
|
35
|
+
export type ConversationCreateMessageResult = Promise<IMessage>;
|
|
36
|
+
export type MethodConversationGetById = (conversationId: string) => ConversationResult;
|
|
37
37
|
export declare function conversationGetById(client: IAllthingsRestClient, conversationId: string): ConversationResult;
|
|
38
|
-
export
|
|
38
|
+
export type MethodConversationCreateMessage = (conversationId: string, messageData: IMessagePayload) => ConversationCreateMessageResult;
|
|
39
39
|
export declare function conversationCreateMessage(client: IAllthingsRestClient, conversationId: string, messageData: IMessagePayload): ConversationCreateMessageResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IAllthingsRestClient } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export type FileResult = Promise<IFile>;
|
|
4
4
|
interface IFileUrl {
|
|
5
5
|
readonly url: string;
|
|
6
6
|
readonly size: number;
|
|
@@ -26,7 +26,7 @@ export interface IFile {
|
|
|
26
26
|
readonly thumb: IFileUrl;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type MethodFileCreate = (data: {
|
|
30
30
|
readonly file: Blob | Buffer | ReadableStream;
|
|
31
31
|
readonly name: string;
|
|
32
32
|
readonly path?: string;
|
|
@@ -36,6 +36,6 @@ export declare function fileCreate(client: IAllthingsRestClient, data: {
|
|
|
36
36
|
readonly name: string;
|
|
37
37
|
readonly path?: string;
|
|
38
38
|
}): FileResult;
|
|
39
|
-
export
|
|
39
|
+
export type MethodFileDelete = (fileId: string) => Promise<boolean>;
|
|
40
40
|
export declare function fileDelete(client: IAllthingsRestClient, fileId: string): Promise<boolean>;
|
|
41
41
|
export {};
|
|
@@ -27,10 +27,10 @@ export interface IGroup {
|
|
|
27
27
|
readonly inhabitedUnits: number | null;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
30
|
+
export type PartialGroup = Partial<IGroup>;
|
|
31
|
+
export type GroupResult = Promise<IGroup>;
|
|
32
|
+
export type GroupResultList = EntityResultList<IGroup>;
|
|
33
|
+
export type MethodGroupCreate = (propertyId: string, data: PartialGroup & {
|
|
34
34
|
readonly name: string;
|
|
35
35
|
readonly propertyManagerId: string;
|
|
36
36
|
}) => GroupResult;
|
|
@@ -38,9 +38,9 @@ export declare function groupCreate(client: IAllthingsRestClient, propertyId: st
|
|
|
38
38
|
readonly name: string;
|
|
39
39
|
readonly propertyManagerId: string;
|
|
40
40
|
}): GroupResult;
|
|
41
|
-
export
|
|
41
|
+
export type MethodGroupGetById = (id: string) => GroupResult;
|
|
42
42
|
export declare function groupGetById(client: IAllthingsRestClient, groupId: string): GroupResult;
|
|
43
|
-
export
|
|
43
|
+
export type MethodGroupUpdateById = (groupId: string, data: PartialGroup) => GroupResult;
|
|
44
44
|
export declare function groupUpdateById(client: IAllthingsRestClient, groupId: string, data: PartialGroup): GroupResult;
|
|
45
|
-
export
|
|
45
|
+
export type MethodGetGroups = (page?: number, limit?: number, filter?: Record<string, any>) => GroupResultList;
|
|
46
46
|
export declare function getGroups(client: IAllthingsRestClient, page?: number, limit?: number, filter?: {}): GroupResultList;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EnumLookupUserType, EnumResource, IAllthingsRestClient } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type LookupIdResult = Promise<{
|
|
3
3
|
readonly [externalId: string]: string | null;
|
|
4
4
|
}>;
|
|
5
|
-
export
|
|
5
|
+
export type MethodLookupIds = (appId: string, data: {
|
|
6
6
|
readonly resource: EnumResource;
|
|
7
7
|
readonly externalIds: string | ReadonlyArray<string>;
|
|
8
8
|
readonly parentId?: string;
|
|
@@ -46,16 +46,16 @@ export interface INotification extends IBasicNotification {
|
|
|
46
46
|
readonly objectId: string;
|
|
47
47
|
readonly referencedObjectId: string | null;
|
|
48
48
|
}
|
|
49
|
-
export
|
|
49
|
+
export type NotificationResultList = EntityResultList<INotification, {
|
|
50
50
|
readonly metaData: {
|
|
51
51
|
readonly unreadNotifications: number;
|
|
52
52
|
};
|
|
53
53
|
}>;
|
|
54
|
-
export
|
|
54
|
+
export type MethodNotificationsGetByUser = (userId: string, page?: number, limit?: number) => NotificationResultList;
|
|
55
55
|
export declare function notificationsGetByUser(client: IAllthingsRestClient, userId: string, page?: number, limit?: number): NotificationResultList;
|
|
56
|
-
export
|
|
57
|
-
export
|
|
56
|
+
export type NotificationsUpdateReadByUserResult = Promise<null>;
|
|
57
|
+
export type MethodNotificationsUpdateReadByUser = (userId: string, lastReadAt?: Date) => NotificationsUpdateReadByUserResult;
|
|
58
58
|
export declare function notificationsUpdateReadByUser(client: IAllthingsRestClient, userId: string, lastReadAt?: Date): NotificationsUpdateReadByUserResult;
|
|
59
|
-
export
|
|
60
|
-
export
|
|
59
|
+
export type NotificationUpdateReadResult = Promise<INotification>;
|
|
60
|
+
export type MethodNotificationUpdateRead = (notificationId: string) => NotificationUpdateReadResult;
|
|
61
61
|
export declare function notificationUpdateRead(client: IAllthingsRestClient, notificationId: string): NotificationUpdateReadResult;
|
|
@@ -24,9 +24,9 @@ export declare enum EnumNotificationSettingsValue {
|
|
|
24
24
|
biweekly = "biweekly",
|
|
25
25
|
monthly = "monthly"
|
|
26
26
|
}
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
27
|
+
export type PartialNotificationSettings = Partial<INotificationSettings>;
|
|
28
|
+
export type NotificationSettingsResult = Promise<INotificationSettings>;
|
|
29
|
+
export type MethodNotificationSettingsUpdateByUser = (userId: string, data: PartialNotificationSettings) => NotificationSettingsResult;
|
|
30
30
|
export declare function notificationSettingsUpdateByUser(client: IAllthingsRestClient, userId: string, data: PartialNotificationSettings): NotificationSettingsResult;
|
|
31
|
-
export
|
|
31
|
+
export type MethodNotificationSettingsResetByUser = (userId: string) => NotificationSettingsResult;
|
|
32
32
|
export declare function notificationSettingsResetByUser(client: IAllthingsRestClient, userId: string): NotificationSettingsResult;
|
|
@@ -11,10 +11,10 @@ export interface IProperty {
|
|
|
11
11
|
readonly readOnly: boolean;
|
|
12
12
|
readonly timezone: string;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
14
|
+
export type PartialProperty = Partial<IProperty>;
|
|
15
|
+
export type PropertyResult = Promise<IProperty>;
|
|
16
|
+
export type PropertyResultList = EntityResultList<IProperty>;
|
|
17
|
+
export type MethodPropertyCreate = (appId: string, data: PartialProperty & {
|
|
18
18
|
readonly name: string;
|
|
19
19
|
readonly timezone: string;
|
|
20
20
|
}) => PropertyResult;
|
|
@@ -22,9 +22,9 @@ export declare function propertyCreate(client: IAllthingsRestClient, appId: stri
|
|
|
22
22
|
readonly name: string;
|
|
23
23
|
readonly timezone: string;
|
|
24
24
|
}): PropertyResult;
|
|
25
|
-
export
|
|
25
|
+
export type MethodPropertyGetById = (propertyId: string) => PropertyResult;
|
|
26
26
|
export declare function propertyGetById(client: IAllthingsRestClient, propertyId: string): PropertyResult;
|
|
27
|
-
export
|
|
27
|
+
export type MethodPropertyUpdateById = (propertyId: string, data: PartialProperty) => PropertyResult;
|
|
28
28
|
export declare function propertyUpdateById(client: IAllthingsRestClient, propertyId: string, data: PartialProperty): PropertyResult;
|
|
29
|
-
export
|
|
29
|
+
export type MethodGetProperties = (page?: number, limit?: number, filter?: Record<string, any>) => PropertyResultList;
|
|
30
30
|
export declare function getProperties(client: IAllthingsRestClient, page?: number, limit?: number, filter?: {}): PropertyResultList;
|
|
@@ -21,14 +21,14 @@ export interface IRegistrationCode extends Required<IRegistrationCodeOptions> {
|
|
|
21
21
|
readonly invitationSent: boolean;
|
|
22
22
|
readonly utilisationPeriods: ReadonlyArray<string>;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export type PartialRegistrationCode = Partial<IRegistrationCode>;
|
|
25
|
+
export type RegistrationCodeResult = Promise<IRegistrationCode>;
|
|
26
26
|
export declare const remapRegistationCodeResult: (registrationCode: any) => any;
|
|
27
|
-
export
|
|
27
|
+
export type MethodRegistrationCodeCreate = (code: string, utilisationPeriods: string | ReadonlyArray<string>, options?: IRegistrationCodeOptions) => RegistrationCodeResult;
|
|
28
28
|
export declare function registrationCodeCreate(client: IAllthingsRestClient, code: string, utilisationPeriods: string | ReadonlyArray<string>, options?: IRegistrationCodeOptions): RegistrationCodeResult;
|
|
29
|
-
export
|
|
29
|
+
export type MethodRegistrationCodeUpdateById = (registrationCodeId: string, data: PartialRegistrationCode) => RegistrationCodeResult;
|
|
30
30
|
export declare function registrationCodeUpdateById(client: IAllthingsRestClient, registrationCodeId: string, data: PartialRegistrationCode): RegistrationCodeResult;
|
|
31
|
-
export
|
|
31
|
+
export type MethodRegistrationCodeGetById = (registrationCodeId: string) => RegistrationCodeResult;
|
|
32
32
|
export declare function registrationCodeGetById(client: IAllthingsRestClient, registrationCodeId: string): RegistrationCodeResult;
|
|
33
|
-
export
|
|
33
|
+
export type MethodRegistrationCodeDelete = (registrationCodeId: string) => RegistrationCodeResult;
|
|
34
34
|
export declare function registrationCodeDelete(client: IAllthingsRestClient, registrationCodeId: string): Promise<boolean>;
|
|
@@ -20,15 +20,15 @@ export interface IServiceProvider {
|
|
|
20
20
|
readonly type: EnumServiceProviderType;
|
|
21
21
|
readonly website: string | null;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
23
|
+
export type PartialServiceProvider = Partial<IServiceProvider>;
|
|
24
|
+
export type ServiceProviderResult = Promise<IServiceProvider>;
|
|
25
|
+
export type MethodServiceProviderCreate = (data: PartialServiceProvider & {
|
|
26
26
|
readonly name: string;
|
|
27
27
|
}) => ServiceProviderResult;
|
|
28
28
|
export declare function serviceProviderCreate(client: IAllthingsRestClient, data: PartialServiceProvider & {
|
|
29
29
|
readonly name: string;
|
|
30
30
|
}): ServiceProviderResult;
|
|
31
|
-
export
|
|
31
|
+
export type MethodServiceProviderGetById = (propertyId: string) => ServiceProviderResult;
|
|
32
32
|
export declare function serviceProviderGetById(client: IAllthingsRestClient, serviceProviderId: string): ServiceProviderResult;
|
|
33
|
-
export
|
|
33
|
+
export type MethodServiceProviderUpdateById = (serviceProviderId: string, data: PartialServiceProvider) => ServiceProviderResult;
|
|
34
34
|
export declare function serviceProviderUpdateById(client: IAllthingsRestClient, serviceProviderId: string, data: PartialServiceProvider): ServiceProviderResult;
|
|
@@ -94,11 +94,11 @@ export interface ITicket {
|
|
|
94
94
|
readonly unreadUserMessages: number;
|
|
95
95
|
readonly updatedAt: string;
|
|
96
96
|
}
|
|
97
|
-
export
|
|
98
|
-
export
|
|
97
|
+
export type TicketResult = Promise<ITicket>;
|
|
98
|
+
export type MethodTicketGetById = (ticketId: string) => TicketResult;
|
|
99
99
|
export declare function ticketGetById(client: IAllthingsRestClient, ticketId: string): TicketResult;
|
|
100
|
-
export
|
|
100
|
+
export type MethodTicketCreateOnUser = (userId: string, utilisationPeriodId: string, payload: ITicketCreatePayload) => TicketResult;
|
|
101
101
|
export declare function ticketCreateOnUser(client: IAllthingsRestClient, userId: string, utilisationPeriodId: string, payload: ITicketCreatePayload): TicketResult;
|
|
102
|
-
export
|
|
102
|
+
export type MethodTicketCreateOnServiceProvider = (serviceProviderId: string, payload: ITicketCreatePayload) => TicketResult;
|
|
103
103
|
export declare function ticketCreateOnServiceProvider(client: IAllthingsRestClient, serviceProviderId: string, payload: ITicketCreatePayload): TicketResult;
|
|
104
104
|
export {};
|
|
@@ -91,10 +91,10 @@ export interface IUnit {
|
|
|
91
91
|
};
|
|
92
92
|
readonly type: EnumUnitType;
|
|
93
93
|
}
|
|
94
|
-
export
|
|
95
|
-
export
|
|
96
|
-
export
|
|
97
|
-
export
|
|
94
|
+
export type PartialUnit = Partial<IUnit>;
|
|
95
|
+
export type UnitResult = Promise<IUnit>;
|
|
96
|
+
export type UnitResultList = EntityResultList<IUnit>;
|
|
97
|
+
export type MethodUnitCreate = (groupId: string, data: PartialUnit & {
|
|
98
98
|
readonly name: string;
|
|
99
99
|
readonly type: EnumUnitType;
|
|
100
100
|
}) => UnitResult;
|
|
@@ -102,9 +102,9 @@ export declare function unitCreate(client: IAllthingsRestClient, groupId: string
|
|
|
102
102
|
readonly name: string;
|
|
103
103
|
readonly type: EnumUnitType;
|
|
104
104
|
}): UnitResult;
|
|
105
|
-
export
|
|
105
|
+
export type MethodUnitGetById = (id: string) => UnitResult;
|
|
106
106
|
export declare function unitGetById(client: IAllthingsRestClient, unitId: string): UnitResult;
|
|
107
|
-
export
|
|
107
|
+
export type MethodUnitUpdateById = (unitId: string, data: PartialUnit) => UnitResult;
|
|
108
108
|
export declare function unitUpdateById(client: IAllthingsRestClient, unitId: string, data: PartialUnit): UnitResult;
|
|
109
|
-
export
|
|
109
|
+
export type MethodGetUnits = (page?: number, limit?: number, filter?: Record<string, any>) => UnitResultList;
|
|
110
110
|
export declare function getUnits(client: IAllthingsRestClient, page?: number, limit?: number, filter?: {}): UnitResultList;
|
|
@@ -47,9 +47,9 @@ export interface IUser {
|
|
|
47
47
|
readonly username: string;
|
|
48
48
|
readonly readOnly: boolean;
|
|
49
49
|
}
|
|
50
|
-
export
|
|
51
|
-
export
|
|
52
|
-
export
|
|
50
|
+
export type PartialUser = Partial<IUser>;
|
|
51
|
+
export type UserResult = Promise<IUser>;
|
|
52
|
+
export type UserResultList = EntityResultList<IUser>;
|
|
53
53
|
export declare enum EnumUserPermissionRole {
|
|
54
54
|
appAdmin = "app-admin",
|
|
55
55
|
appOwner = "app-owner",
|
|
@@ -90,12 +90,12 @@ export interface IUserPermission {
|
|
|
90
90
|
readonly startDate?: Date;
|
|
91
91
|
readonly endDate?: Date;
|
|
92
92
|
}
|
|
93
|
-
export
|
|
94
|
-
export
|
|
93
|
+
export type PartialUserPermission = Partial<IUserPermission>;
|
|
94
|
+
export type UserPermissionResult = Promise<IUserPermission>;
|
|
95
95
|
export declare const remapEmbeddedUser: (embedded: {
|
|
96
96
|
readonly [key: string]: any;
|
|
97
97
|
}) => ReadonlyArray<IUser>;
|
|
98
|
-
export
|
|
98
|
+
export type MethodUserCreate = (appId: string, username: string, data: PartialUser & {
|
|
99
99
|
readonly email: string;
|
|
100
100
|
readonly locale: EnumLocale;
|
|
101
101
|
readonly plainPassword?: string;
|
|
@@ -105,15 +105,15 @@ export declare function userCreate(client: IAllthingsRestClient, appId: string,
|
|
|
105
105
|
readonly locale: EnumLocale;
|
|
106
106
|
readonly plainPassword?: string;
|
|
107
107
|
}): UserResult;
|
|
108
|
-
export
|
|
108
|
+
export type MethodGetUsers = (page?: number, limit?: number, filter?: Record<string, any>) => UserResultList;
|
|
109
109
|
export declare function getUsers(client: IAllthingsRestClient, page?: number, limit?: number, filter?: {}): UserResultList;
|
|
110
|
-
export
|
|
110
|
+
export type MethodGetCurrentUser = () => UserResult;
|
|
111
111
|
export declare function getCurrentUser(client: IAllthingsRestClient): UserResult;
|
|
112
|
-
export
|
|
112
|
+
export type MethodUserGetById = (id: string) => UserResult;
|
|
113
113
|
export declare function userGetById(client: IAllthingsRestClient, userId: string): UserResult;
|
|
114
|
-
export
|
|
114
|
+
export type MethodUserUpdateById = (userId: string, data: PartialUser) => UserResult;
|
|
115
115
|
export declare function userUpdateById(client: IAllthingsRestClient, userId: string, data: PartialUser): UserResult;
|
|
116
|
-
export
|
|
116
|
+
export type MethodUserCreatePermission = (userId: string, permission: PartialUserPermission & {
|
|
117
117
|
readonly objectId: string;
|
|
118
118
|
readonly objectType: EnumUserPermissionObjectType;
|
|
119
119
|
readonly restrictions: ReadonlyArray<object>;
|
|
@@ -129,7 +129,7 @@ export declare function userCreatePermission(client: IAllthingsRestClient, userI
|
|
|
129
129
|
readonly startDate?: Date;
|
|
130
130
|
readonly endDate?: Date;
|
|
131
131
|
}): UserPermissionResult;
|
|
132
|
-
export
|
|
132
|
+
export type MethodUserCreatePermissionBatch = (userId: string, permissions: PartialUserPermission & {
|
|
133
133
|
readonly objectId: string;
|
|
134
134
|
readonly objectType: EnumUserPermissionObjectType;
|
|
135
135
|
readonly restrictions: ReadonlyArray<object>;
|
|
@@ -145,15 +145,15 @@ export declare function userCreatePermissionBatch(client: IAllthingsRestClient,
|
|
|
145
145
|
readonly startDate?: Date;
|
|
146
146
|
readonly endDate?: Date;
|
|
147
147
|
}): Promise<boolean>;
|
|
148
|
-
export
|
|
148
|
+
export type MethodUserGetPermissions = (userId: string) => Promise<ReadonlyArray<IUserPermission>>;
|
|
149
149
|
export declare function userGetPermissions(client: IAllthingsRestClient, userId: string): Promise<ReadonlyArray<IUserPermission>>;
|
|
150
|
-
export
|
|
150
|
+
export type MethodUserDeletePermission = (permissionId: string) => Promise<boolean>;
|
|
151
151
|
export declare function userDeletePermission(client: IAllthingsRestClient, permissionId: string): Promise<boolean>;
|
|
152
|
-
export
|
|
152
|
+
export type MethodUserGetUtilisationPeriods = (userId: string) => UtilisationPeriodResults;
|
|
153
153
|
export declare function userGetUtilisationPeriods(client: IAllthingsRestClient, userId: string): UtilisationPeriodResults;
|
|
154
|
-
export
|
|
154
|
+
export type MethodUserCheckInToUtilisationPeriod = (userId: string, utilisationPeriodId: string) => UtilisationPeriodResults;
|
|
155
155
|
export declare function userCheckInToUtilisationPeriod(client: IAllthingsRestClient, userId: string, utilisationPeriodId: string): UtilisationPeriodResult;
|
|
156
|
-
export
|
|
156
|
+
export type MethodUserGetByEmail = (email: string) => UserResultList;
|
|
157
157
|
export declare function userGetByEmail(client: IAllthingsRestClient, email: string, page?: number, limit?: number): UserResultList;
|
|
158
|
-
export
|
|
158
|
+
export type MethodUserChangePassword = (userId: string, currentPassword: string, newPassword: string) => Promise<boolean>;
|
|
159
159
|
export declare function userChangePassword(client: IAllthingsRestClient, userId: string, currentPassword: string, newPassword: string): Promise<boolean>;
|
|
@@ -11,25 +11,25 @@ export interface IUserRelation {
|
|
|
11
11
|
}>;
|
|
12
12
|
readonly readOnly: boolean;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type UserRelationResult = Promise<IUserRelation>;
|
|
15
|
+
export type UserRelationResultList = EntityResultList<IUserRelation>;
|
|
16
16
|
export declare enum EnumUserRelationType {
|
|
17
17
|
isResponsible = "is-responsible"
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type MethodUserRelationCreate = (userId: string, data: {
|
|
20
20
|
readonly ids: ReadonlyArray<string>;
|
|
21
21
|
readonly readOnly?: boolean;
|
|
22
22
|
readonly role?: string;
|
|
23
23
|
readonly type: EnumUserRelationType;
|
|
24
24
|
readonly level: EnumResource;
|
|
25
25
|
}) => UserRelationResult;
|
|
26
|
-
export
|
|
26
|
+
export type MethodUserRelationDelete = (userId: string, data: {
|
|
27
27
|
readonly ids: ReadonlyArray<string>;
|
|
28
28
|
readonly role?: string;
|
|
29
29
|
readonly type: EnumUserRelationType;
|
|
30
30
|
readonly level: EnumResource;
|
|
31
31
|
}) => UserRelationResult;
|
|
32
|
-
export
|
|
32
|
+
export type MethodUserRelationsGetByUser = (userId: string) => UserRelationResultList;
|
|
33
33
|
export declare function userRelationCreate(client: IAllthingsRestClient, userId: string, data: {
|
|
34
34
|
readonly ids: ReadonlyArray<string>;
|
|
35
35
|
readonly readOnly: boolean;
|
|
@@ -43,10 +43,10 @@ export interface IUtilisationPeriodInvite {
|
|
|
43
43
|
readonly resendAttempts: ReadonlyArray<string>;
|
|
44
44
|
readonly usedAt: string | null;
|
|
45
45
|
}
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
export
|
|
49
|
-
export
|
|
46
|
+
export type PartialUtilisationPeriod = Partial<IUtilisationPeriod>;
|
|
47
|
+
export type UtilisationPeriodResult = Promise<IUtilisationPeriod>;
|
|
48
|
+
export type UtilisationPeriodResults = Promise<ReadonlyArray<IUtilisationPeriod>>;
|
|
49
|
+
export type MethodUtilisationPeriodCreate = (unitId: string, data: PartialUtilisationPeriod & {
|
|
50
50
|
readonly startDate: string;
|
|
51
51
|
readonly endDate?: string;
|
|
52
52
|
readonly type?: EnumUtilisationPeriodType;
|
|
@@ -56,21 +56,21 @@ export declare function utilisationPeriodCreate(client: IAllthingsRestClient, un
|
|
|
56
56
|
readonly endDate?: string;
|
|
57
57
|
readonly type?: EnumUtilisationPeriodType;
|
|
58
58
|
}): UtilisationPeriodResult;
|
|
59
|
-
export
|
|
59
|
+
export type MethodUtilisationPeriodGetById = (id: string) => UtilisationPeriodResult;
|
|
60
60
|
export declare function utilisationPeriodGetById(client: IAllthingsRestClient, utilisationPeriodId: string): UtilisationPeriodResult;
|
|
61
|
-
export
|
|
61
|
+
export type MethodUtilisationPeriodUpdateById = (unitId: string, data: PartialUtilisationPeriod) => UtilisationPeriodResult;
|
|
62
62
|
export declare function utilisationPeriodUpdateById(client: IAllthingsRestClient, utilisationPeriodId: string, data: PartialUtilisationPeriod & {
|
|
63
63
|
readonly startDate: string;
|
|
64
64
|
}): UtilisationPeriodResult;
|
|
65
|
-
export
|
|
65
|
+
export type MethodUtilisationPeriodDelete = (utilisationPeriodId: string) => Promise<boolean>;
|
|
66
66
|
export declare function utilisationPeriodDelete(client: IAllthingsRestClient, utilisationPeriodId: string): Promise<boolean>;
|
|
67
|
-
export
|
|
67
|
+
export type MethodUtilisationPeriodCheckInUser = (utilisationPeriodId: string, data: {
|
|
68
68
|
readonly email: string;
|
|
69
69
|
}) => UtilisationPeriodResult;
|
|
70
70
|
export declare function utilisationPeriodCheckInUser(client: IAllthingsRestClient, utilisationPeriodId: string, data: {
|
|
71
71
|
readonly email: string;
|
|
72
72
|
}): UtilisationPeriodResult;
|
|
73
|
-
export
|
|
73
|
+
export type MethodUtilisationPeriodCheckOutUser = (utilisationPeriodId: string, userId: string) => UtilisationPeriodResult;
|
|
74
74
|
export declare function utilisationPeriodCheckOutUser(client: IAllthingsRestClient, utilisationPeriodId: string, userId: string): Promise<boolean>;
|
|
75
|
-
export
|
|
75
|
+
export type MethodUtilisationPeriodAddRegistrationCode = (utilisationPeriodId: string, code: string, tenant?: IRegistrationCodeTenant, permanent?: boolean) => Promise<IUtilisationPeriodInvite>;
|
|
76
76
|
export declare function utilisationPeriodAddRegistrationCode(client: IAllthingsRestClient, utilisationPeriodId: string, code: string, tenant?: IRegistrationCodeTenant, permanent?: boolean): Promise<IUtilisationPeriodInvite>;
|
package/dist/src/rest/patch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MethodHttpRequest } from './request';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type PatchResult = Promise<any>;
|
|
3
|
+
export type MethodHttpPatch = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean) => PatchResult;
|
|
4
4
|
export default function patch(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean): PatchResult;
|
package/dist/src/rest/post.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MethodHttpRequest } from './request';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type PostResult = Promise<any>;
|
|
3
|
+
export type MethodHttpPost = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean) => PostResult;
|
|
4
4
|
export default function post(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean): PostResult;
|
package/dist/src/rest/put.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MethodHttpRequest } from './request';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type PutResult = Promise<any>;
|
|
3
|
+
export type MethodHttpPut = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean) => PutResult;
|
|
4
4
|
export default function put(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean): PutResult;
|
|
@@ -19,10 +19,10 @@ export interface IRequestOptions {
|
|
|
19
19
|
readonly [parameter: string]: string;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
22
|
+
export type RequestResult = Promise<any>;
|
|
23
|
+
export type HttpVerb = 'delete' | 'get' | 'head' | 'patch' | 'post' | 'put';
|
|
24
|
+
export type MethodHttpRequest = (httpMethod: string, apiMethod: string, payload?: IRequestOptions, returnRawResultObject?: boolean) => RequestResult;
|
|
25
|
+
export type IntervalSet = Set<NodeJS.Timer>;
|
|
26
26
|
export declare function responseWasSuccessful(response: Response): boolean;
|
|
27
27
|
export declare function makeApiRequest(oauthTokenStore: ITokenStore, oauthTokenRequester: TokenRequester, options: IAllthingsRestClientOptions, httpMethod: HttpVerb, apiMethod: string, payload?: IRequestOptions, returnRawResultObject?: boolean): (previousResult: any, iteration: number) => Promise<Response>;
|
|
28
28
|
export default function request(oauthTokenStore: ITokenStore, oauthTokenRequester: TokenRequester, options: IAllthingsRestClientOptions, httpMethod: HttpVerb, apiMethod: string, payload?: IRequestOptions, returnRawResultObject?: boolean): RequestResult;
|
package/dist/src/rest/types.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare enum EnumLookupUserType {
|
|
|
76
76
|
agent = "agent",
|
|
77
77
|
tenant = "tenant"
|
|
78
78
|
}
|
|
79
|
-
export
|
|
79
|
+
export type EntityResultList<Entity, ExtensionInterface = {}> = Promise<{
|
|
80
80
|
readonly _embedded: {
|
|
81
81
|
readonly items: ReadonlyArray<Entity>;
|
|
82
82
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
export
|
|
2
|
+
export type List<T> = ReadonlyArray<T>;
|
|
3
3
|
export declare const partial: (fn: (...args: any[]) => any | Promise<any>, ...partialArgs: any[]) => (...args: any[]) => any;
|
|
4
4
|
export declare function times<T>(fn: (item: number, index: number) => T, n: number): List<T>;
|
|
5
5
|
export declare function until<A, B>(predicate: (value: B, iteration: number) => boolean | Promise<boolean>, transformer: (value: A | B | undefined, iteration: number) => B | Promise<B>, initialValue?: A | B, iterationCount?: number): Promise<B>;
|
package/dist/test/helpers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IUser } from '../src/rest/methods/user';
|
|
2
2
|
import { IUtilisationPeriod } from '../src/rest/methods/utilisationPeriod';
|
|
3
3
|
import { IAllthingsRestClient } from '../src/rest/types';
|
|
4
|
-
export
|
|
4
|
+
export type CreateUserAndClientResult = Promise<{
|
|
5
5
|
readonly client: IAllthingsRestClient;
|
|
6
6
|
readonly user: IUser;
|
|
7
7
|
}>;
|