@allthings/sdk 6.2.2 → 6.4.0-dev.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.
@@ -1,6 +1,7 @@
1
1
  import { SSMClient, SSMClientConfig } from '@aws-sdk/client-ssm';
2
2
  export interface IParameterStore {
3
3
  clientConfig?: SSMClientConfig;
4
+ endpoint?: string;
4
5
  logger?: (message: string) => void;
5
6
  onlyDefault?: boolean;
6
7
  prefix?: string;
@@ -0,0 +1,16 @@
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';
@@ -0,0 +1,55 @@
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/sdk",
3
- "version": "6.2.2",
3
+ "version": "6.4.0-dev.0",
4
4
  "description": "",
5
5
  "author": "Allthings GmbH",
6
6
  "keywords": [
@@ -52,15 +52,15 @@
52
52
  "test:authorization-code": "open http://localhost:3333/test/fixtures/authorization-code?clientId=$ALLTHINGS_OAUTH_CLIENT_ID&clientSecret=$ALLTHINGS_OAUTH_CLIENT_SECRET"
53
53
  },
54
54
  "dependencies": {
55
- "@aws-sdk/client-ssm": "3.621.0",
55
+ "@aws-sdk/client-ssm": "3.645.0",
56
56
  "bottleneck": "2.19.5",
57
57
  "cross-fetch": "4.0.0",
58
58
  "query-string": "7.1.3"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@allthings/eslint-config": "1.1.0",
62
- "@commitlint/cli": "19.3.0",
63
- "@commitlint/config-conventional": "19.2.2",
62
+ "@commitlint/cli": "19.4.1",
63
+ "@commitlint/config-conventional": "19.4.1",
64
64
  "@rollup/plugin-commonjs": "26.0.1",
65
65
  "@rollup/plugin-json": "6.1.0",
66
66
  "@rollup/plugin-node-resolve": "15.2.3",
@@ -68,20 +68,20 @@
68
68
  "@rollup/plugin-terser": "0.4.4",
69
69
  "@types/form-data": "2.5.0",
70
70
  "@types/jest": "26.0.24",
71
- "@types/node": "18.19.39",
71
+ "@types/node": "18.19.48",
72
72
  "@types/query-string": "6.3.0",
73
73
  "aws-sdk-client-mock": "4.0.1",
74
74
  "coveralls": "3.1.1",
75
75
  "eslint": "8.57.0",
76
76
  "form-data": "4.0.0",
77
- "husky": "9.1.1",
77
+ "husky": "9.1.5",
78
78
  "jest": "26.6.3",
79
79
  "jest-environment-jsdom": "26.6.2",
80
- "lint-staged": "15.2.7",
80
+ "lint-staged": "15.2.10",
81
81
  "nanoid": "3.3.7",
82
82
  "prettier": "3.3.3",
83
- "rimraf": "5.0.9",
84
- "rollup": "4.19.0",
83
+ "rimraf": "5.0.10",
84
+ "rollup": "4.21.2",
85
85
  "rollup-plugin-hashbang": "2.2.2",
86
86
  "semantic-release": "19.0.5",
87
87
  "ts-jest": "26.5.6",