@allthings/sdk 6.6.0-dev.0 → 6.6.0
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 +1 -1
- package/dist/lib.cjs.js +1 -1
- package/dist/lib.esm.js +1 -1
- package/dist/lib.umd.min.js +1 -1
- package/dist/src/rest/methods/group.d.ts +2 -3
- package/dist/src/rest/methods/property.d.ts +1 -2
- package/dist/src/rest/methods/registrationCode.d.ts +0 -1
- package/dist/src/rest/methods/unit.d.ts +0 -1
- package/dist/src/rest/methods/user.d.ts +0 -8
- package/dist/src/rest/methods/utilisationPeriod.d.ts +1 -2
- package/package.json +1 -1
- package/dist/test/constants.js +0 -16
- package/dist/test/helpers.js +0 -55
|
@@ -12,9 +12,8 @@ export interface IGroup {
|
|
|
12
12
|
}>;
|
|
13
13
|
readonly billingPeriodEndDate: string;
|
|
14
14
|
readonly billingPeriodStartDate: string;
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly externalId?: string;
|
|
15
|
+
readonly description: string | null;
|
|
16
|
+
readonly externalId: string | null;
|
|
18
17
|
readonly id: string;
|
|
19
18
|
readonly name: string;
|
|
20
19
|
readonly propertyManagerId: string;
|
|
@@ -3,8 +3,7 @@ export interface IProperty {
|
|
|
3
3
|
readonly _embedded: any;
|
|
4
4
|
readonly billingPeriodEndDate: string;
|
|
5
5
|
readonly billingPeriodStartDate: string;
|
|
6
|
-
readonly
|
|
7
|
-
readonly externalId?: string;
|
|
6
|
+
readonly externalId: string;
|
|
8
7
|
readonly id: string;
|
|
9
8
|
readonly label: string;
|
|
10
9
|
readonly name: string;
|
|
@@ -78,7 +78,6 @@ export declare enum EnumUnitType {
|
|
|
78
78
|
export interface IUnit {
|
|
79
79
|
readonly billingPeriodEndDate: string;
|
|
80
80
|
readonly billingPeriodStartDate: string;
|
|
81
|
-
readonly dataSource?: string;
|
|
82
81
|
readonly externalId?: string;
|
|
83
82
|
readonly id: string;
|
|
84
83
|
readonly name: string;
|
|
@@ -16,12 +16,6 @@ export declare enum EnumCommunicationPreferenceChannel {
|
|
|
16
16
|
push = "push",
|
|
17
17
|
email = "email"
|
|
18
18
|
}
|
|
19
|
-
export interface IExternalData {
|
|
20
|
-
dataSource?: string;
|
|
21
|
-
externalId?: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
phoneNumber?: string;
|
|
24
|
-
}
|
|
25
19
|
export interface IUser {
|
|
26
20
|
readonly communicationPreferences: readonly {
|
|
27
21
|
readonly channels: readonly EnumCommunicationPreferenceChannel[];
|
|
@@ -32,9 +26,7 @@ export interface IUser {
|
|
|
32
26
|
readonly description: string;
|
|
33
27
|
readonly email: string;
|
|
34
28
|
readonly emailValidated: boolean;
|
|
35
|
-
readonly externalAgentsData: IExternalData[] | null;
|
|
36
29
|
readonly externalId: string | null;
|
|
37
|
-
readonly externalTenantsData: IExternalData[] | null;
|
|
38
30
|
readonly gender: EnumGender;
|
|
39
31
|
readonly id: string;
|
|
40
32
|
readonly inviteEmailSent: boolean;
|
|
@@ -11,9 +11,8 @@ export interface IUtilisationPeriod {
|
|
|
11
11
|
readonly [key: string]: any;
|
|
12
12
|
readonly invitations: readonly any[];
|
|
13
13
|
};
|
|
14
|
-
readonly dataSource?: string;
|
|
15
14
|
readonly endDate: string | null;
|
|
16
|
-
readonly externalId
|
|
15
|
+
readonly externalId: string | null;
|
|
17
16
|
readonly id: string;
|
|
18
17
|
readonly invitations: readonly IUtilisationPeriodInvite[];
|
|
19
18
|
readonly name: string;
|
package/package.json
CHANGED
package/dist/test/constants.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EnumCommunicationMethodType, EnumInputChannel, } from '../src/rest/types';
|
|
2
|
-
export const APP_ID = '575027e58178f56a008b4568';
|
|
3
|
-
export const APP_CHANNEL = 'App-575027e58178f56a008b4568';
|
|
4
|
-
export const APP_PROPERTY_MANAGER_ID = '5a818c07ef5f2f00441146a2';
|
|
5
|
-
export const CATEGORY_ID = '5eb9a4ff2a4433163d0e540a';
|
|
6
|
-
export const COMMUNICATION_METHOD = {
|
|
7
|
-
id: '5dd7ca6bfbdbb4af89be9c37',
|
|
8
|
-
type: EnumCommunicationMethodType.email,
|
|
9
|
-
value: 'pr-coreyplatt@allthings.me',
|
|
10
|
-
};
|
|
11
|
-
export const CONVERSATION_ID = '5aa7cd7bd4959e004112e136';
|
|
12
|
-
export const INPUT_CHANNEL = EnumInputChannel.EMAIL;
|
|
13
|
-
export const SERVICE_PROVIDER_ID = '5a818c07ef5f2f00441146a2';
|
|
14
|
-
export const USER_ID = '50f66beaeabc88ab0e000000';
|
|
15
|
-
export const UTILISATION_PERIOD_ID = '5a9d65cd0ecb330045742be3';
|
|
16
|
-
export const BOOKING_ID = '5aa68870d4959e00447d6f87';
|
package/dist/test/helpers.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { nanoid as generateId } from 'nanoid';
|
|
2
|
-
import restClient, { EnumUnitType } from '../src/rest';
|
|
3
|
-
import { EnumLocale, EnumTimezone, } from '../src/rest/types';
|
|
4
|
-
import { APP_ID, APP_PROPERTY_MANAGER_ID } from './constants';
|
|
5
|
-
export async function createUserAndClient() {
|
|
6
|
-
const defaultClient = restClient();
|
|
7
|
-
const email = `${generateId()}@foobar.test`;
|
|
8
|
-
const password = generateId();
|
|
9
|
-
const data = {
|
|
10
|
-
description: 'Foobar User',
|
|
11
|
-
email,
|
|
12
|
-
externalId: generateId(),
|
|
13
|
-
locale: EnumLocale.en_US,
|
|
14
|
-
plainPassword: password,
|
|
15
|
-
};
|
|
16
|
-
return {
|
|
17
|
-
client: restClient({
|
|
18
|
-
password,
|
|
19
|
-
username: email,
|
|
20
|
-
}),
|
|
21
|
-
user: await defaultClient.userCreate(APP_ID, generateId(), data),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export async function createUtilisationPeriod() {
|
|
25
|
-
const defaultClient = restClient();
|
|
26
|
-
const property = await defaultClient.propertyCreate(APP_ID, {
|
|
27
|
-
name: 'CommunityArticleStatsGetByUser Test Property',
|
|
28
|
-
timezone: EnumTimezone.EuropeBerlin,
|
|
29
|
-
});
|
|
30
|
-
const group = await defaultClient.groupCreate(property.id, {
|
|
31
|
-
name: 'CommunityArticleStatsGetByUser Test Group',
|
|
32
|
-
propertyManagerId: APP_PROPERTY_MANAGER_ID,
|
|
33
|
-
});
|
|
34
|
-
const unit = await defaultClient.unitCreate(group.id, {
|
|
35
|
-
name: 'CommunityArticleStatsGetByUser Test Unit',
|
|
36
|
-
type: EnumUnitType.rented,
|
|
37
|
-
});
|
|
38
|
-
return defaultClient.utilisationPeriodCreate(unit.id, {
|
|
39
|
-
endDate: '2050-01-03',
|
|
40
|
-
externalId: generateId(),
|
|
41
|
-
startDate: '2015-01-03',
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export async function createUserWithUtilizationPeriod() {
|
|
45
|
-
const defaultClient = restClient();
|
|
46
|
-
const [utilisationPeriod, { client, user }] = await Promise.all([
|
|
47
|
-
await createUtilisationPeriod(),
|
|
48
|
-
await createUserAndClient(),
|
|
49
|
-
]);
|
|
50
|
-
await defaultClient.userCheckInToUtilisationPeriod(user.id, utilisationPeriod.id);
|
|
51
|
-
return {
|
|
52
|
-
client,
|
|
53
|
-
user,
|
|
54
|
-
};
|
|
55
|
-
}
|