rotacloud 1.0.56 → 1.0.58
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/cjs/interfaces/account.interface.d.ts +14 -14
- package/dist/cjs/interfaces/sdk-config.interface.d.ts +10 -2
- package/dist/cjs/interfaces/terminal.interface.d.ts +1 -0
- package/dist/cjs/models/account.model.d.ts +38 -0
- package/dist/cjs/models/account.model.js +1 -4
- package/dist/cjs/models/terminal.model.d.ts +1 -0
- package/dist/cjs/models/terminal.model.js +1 -0
- package/dist/cjs/services/service.js +3 -1
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/interfaces/account.interface.d.ts +14 -14
- package/dist/mjs/interfaces/sdk-config.interface.d.ts +10 -2
- package/dist/mjs/interfaces/terminal.interface.d.ts +1 -0
- package/dist/mjs/models/account.model.d.ts +38 -0
- package/dist/mjs/models/account.model.js +1 -4
- package/dist/mjs/models/terminal.model.d.ts +1 -0
- package/dist/mjs/models/terminal.model.js +1 -0
- package/dist/mjs/services/service.js +3 -1
- package/dist/mjs/version.js +1 -1
- package/package.json +1 -1
- package/src/interfaces/account.interface.ts +14 -14
- package/src/interfaces/sdk-config.interface.ts +13 -2
- package/src/interfaces/terminal.interface.ts +1 -0
- package/src/models/account.model.ts +38 -8
- package/src/models/terminal.model.ts +2 -0
- package/src/rotacloud.ts +2 -2
- package/src/services/service.ts +3 -1
- package/src/version.ts +1 -1
|
@@ -8,33 +8,33 @@ export interface ApiAccount {
|
|
|
8
8
|
owner: number;
|
|
9
9
|
timezone: number;
|
|
10
10
|
industry: number;
|
|
11
|
-
phone: string;
|
|
12
|
-
address_1: string;
|
|
13
|
-
address_2: string;
|
|
14
|
-
city: string;
|
|
15
|
-
county: string;
|
|
16
|
-
postcode: string;
|
|
11
|
+
phone: string | null;
|
|
12
|
+
address_1: string | null;
|
|
13
|
+
address_2: string | null;
|
|
14
|
+
city: string | null;
|
|
15
|
+
county: string | null;
|
|
16
|
+
postcode: string | null;
|
|
17
17
|
country: number;
|
|
18
18
|
services: ApiAccountServices[];
|
|
19
19
|
total_price: number;
|
|
20
20
|
pricing: object;
|
|
21
21
|
expires_in: number;
|
|
22
22
|
features_disabled: string[];
|
|
23
|
-
first_billed: string;
|
|
23
|
+
first_billed: string | null;
|
|
24
24
|
owed: number;
|
|
25
25
|
trial: boolean;
|
|
26
26
|
can_restart_trial: boolean;
|
|
27
27
|
next_billed: string;
|
|
28
28
|
hide_billing: boolean;
|
|
29
29
|
total_employees: number;
|
|
30
|
-
payment_card: string;
|
|
30
|
+
payment_card: string | null;
|
|
31
31
|
billing_type: string;
|
|
32
32
|
billing_term: string;
|
|
33
|
-
billing_email: string;
|
|
34
|
-
billing_address: string;
|
|
35
|
-
grouped_billing_parent: number;
|
|
36
|
-
grouped_billing_children: number[];
|
|
37
|
-
vat_number: string;
|
|
33
|
+
billing_email: string | null;
|
|
34
|
+
billing_address: string | null;
|
|
35
|
+
grouped_billing_parent: number | null;
|
|
36
|
+
grouped_billing_children: number[] | null;
|
|
37
|
+
vat_number: string | null;
|
|
38
38
|
suspended: boolean;
|
|
39
|
-
suspended_message: string;
|
|
39
|
+
suspended_message: string | null;
|
|
40
40
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { RetryOptions, RetryStrategy } from '../services/service.js';
|
|
2
|
-
export interface
|
|
2
|
+
export interface SDKBase {
|
|
3
3
|
baseUri?: string;
|
|
4
|
-
apiKey: string;
|
|
5
4
|
accountId?: number;
|
|
6
5
|
userId?: number;
|
|
7
6
|
retry?: false | `${RetryStrategy}` | RetryOptions;
|
|
8
7
|
[key: string]: unknown;
|
|
9
8
|
}
|
|
9
|
+
export interface SDKBearerAuth extends SDKBase {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
basicAuth?: never;
|
|
12
|
+
}
|
|
13
|
+
export interface SDKBasicAuth extends SDKBase {
|
|
14
|
+
apiKey?: never;
|
|
15
|
+
basicAuth: string;
|
|
16
|
+
}
|
|
17
|
+
export type SDKConfig = SDKBasicAuth | SDKBearerAuth;
|
|
@@ -4,5 +4,43 @@ export declare class Account {
|
|
|
4
4
|
name: string;
|
|
5
5
|
level: string;
|
|
6
6
|
created: number;
|
|
7
|
+
expired: boolean;
|
|
8
|
+
owner: number;
|
|
9
|
+
timezone: number;
|
|
10
|
+
industry: number;
|
|
11
|
+
phone: string | null;
|
|
12
|
+
address_1: string | null;
|
|
13
|
+
address_2: string | null;
|
|
14
|
+
city: string | null;
|
|
15
|
+
county: string | null;
|
|
16
|
+
postcode: string | null;
|
|
17
|
+
country: number;
|
|
18
|
+
services: any;
|
|
19
|
+
total_price: number;
|
|
20
|
+
pricing: {
|
|
21
|
+
current: boolean;
|
|
22
|
+
name: string;
|
|
23
|
+
max_employees: number;
|
|
24
|
+
total_price: number;
|
|
25
|
+
};
|
|
26
|
+
expires_in: number;
|
|
27
|
+
features_disabled: string[];
|
|
28
|
+
first_billed: string | null;
|
|
29
|
+
owed: number;
|
|
30
|
+
trial: boolean;
|
|
31
|
+
can_restart_trial: boolean;
|
|
32
|
+
next_billed: string;
|
|
33
|
+
hide_billing: boolean;
|
|
34
|
+
total_employees: number;
|
|
35
|
+
payment_card: string | null;
|
|
36
|
+
billing_type: string;
|
|
37
|
+
billing_term: string;
|
|
38
|
+
billing_email: string | null;
|
|
39
|
+
billing_address: string | null;
|
|
40
|
+
grouped_billing_parent: number | null;
|
|
41
|
+
grouped_billing_children: number[] | null;
|
|
42
|
+
vat_number: string | null;
|
|
43
|
+
suspended: boolean;
|
|
44
|
+
suspended_message: string | null;
|
|
7
45
|
constructor(account: ApiAccount);
|
|
8
46
|
}
|
|
@@ -3,10 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Account = void 0;
|
|
4
4
|
class Account {
|
|
5
5
|
constructor(account) {
|
|
6
|
-
this
|
|
7
|
-
this.name = account.name;
|
|
8
|
-
this.level = account.level;
|
|
9
|
-
this.created = account.created;
|
|
6
|
+
Object.assign(this, account);
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
9
|
exports.Account = Account;
|
|
@@ -96,7 +96,9 @@ class Service {
|
|
|
96
96
|
}
|
|
97
97
|
fetch(reqConfig, options) {
|
|
98
98
|
const headers = {
|
|
99
|
-
Authorization:
|
|
99
|
+
Authorization: rotacloud_js_1.RotaCloud.config.apiKey
|
|
100
|
+
? `Bearer ${rotacloud_js_1.RotaCloud.config.apiKey}`
|
|
101
|
+
: `Basic ${rotacloud_js_1.RotaCloud.config.basicAuth}`,
|
|
100
102
|
'SDK-Version': version_js_1.Version.version,
|
|
101
103
|
};
|
|
102
104
|
const extraHeaders = rotacloud_js_1.RotaCloud.config.headers;
|
package/dist/cjs/version.js
CHANGED
|
@@ -8,33 +8,33 @@ export interface ApiAccount {
|
|
|
8
8
|
owner: number;
|
|
9
9
|
timezone: number;
|
|
10
10
|
industry: number;
|
|
11
|
-
phone: string;
|
|
12
|
-
address_1: string;
|
|
13
|
-
address_2: string;
|
|
14
|
-
city: string;
|
|
15
|
-
county: string;
|
|
16
|
-
postcode: string;
|
|
11
|
+
phone: string | null;
|
|
12
|
+
address_1: string | null;
|
|
13
|
+
address_2: string | null;
|
|
14
|
+
city: string | null;
|
|
15
|
+
county: string | null;
|
|
16
|
+
postcode: string | null;
|
|
17
17
|
country: number;
|
|
18
18
|
services: ApiAccountServices[];
|
|
19
19
|
total_price: number;
|
|
20
20
|
pricing: object;
|
|
21
21
|
expires_in: number;
|
|
22
22
|
features_disabled: string[];
|
|
23
|
-
first_billed: string;
|
|
23
|
+
first_billed: string | null;
|
|
24
24
|
owed: number;
|
|
25
25
|
trial: boolean;
|
|
26
26
|
can_restart_trial: boolean;
|
|
27
27
|
next_billed: string;
|
|
28
28
|
hide_billing: boolean;
|
|
29
29
|
total_employees: number;
|
|
30
|
-
payment_card: string;
|
|
30
|
+
payment_card: string | null;
|
|
31
31
|
billing_type: string;
|
|
32
32
|
billing_term: string;
|
|
33
|
-
billing_email: string;
|
|
34
|
-
billing_address: string;
|
|
35
|
-
grouped_billing_parent: number;
|
|
36
|
-
grouped_billing_children: number[];
|
|
37
|
-
vat_number: string;
|
|
33
|
+
billing_email: string | null;
|
|
34
|
+
billing_address: string | null;
|
|
35
|
+
grouped_billing_parent: number | null;
|
|
36
|
+
grouped_billing_children: number[] | null;
|
|
37
|
+
vat_number: string | null;
|
|
38
38
|
suspended: boolean;
|
|
39
|
-
suspended_message: string;
|
|
39
|
+
suspended_message: string | null;
|
|
40
40
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { RetryOptions, RetryStrategy } from '../services/service.js';
|
|
2
|
-
export interface
|
|
2
|
+
export interface SDKBase {
|
|
3
3
|
baseUri?: string;
|
|
4
|
-
apiKey: string;
|
|
5
4
|
accountId?: number;
|
|
6
5
|
userId?: number;
|
|
7
6
|
retry?: false | `${RetryStrategy}` | RetryOptions;
|
|
8
7
|
[key: string]: unknown;
|
|
9
8
|
}
|
|
9
|
+
export interface SDKBearerAuth extends SDKBase {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
basicAuth?: never;
|
|
12
|
+
}
|
|
13
|
+
export interface SDKBasicAuth extends SDKBase {
|
|
14
|
+
apiKey?: never;
|
|
15
|
+
basicAuth: string;
|
|
16
|
+
}
|
|
17
|
+
export type SDKConfig = SDKBasicAuth | SDKBearerAuth;
|
|
@@ -4,5 +4,43 @@ export declare class Account {
|
|
|
4
4
|
name: string;
|
|
5
5
|
level: string;
|
|
6
6
|
created: number;
|
|
7
|
+
expired: boolean;
|
|
8
|
+
owner: number;
|
|
9
|
+
timezone: number;
|
|
10
|
+
industry: number;
|
|
11
|
+
phone: string | null;
|
|
12
|
+
address_1: string | null;
|
|
13
|
+
address_2: string | null;
|
|
14
|
+
city: string | null;
|
|
15
|
+
county: string | null;
|
|
16
|
+
postcode: string | null;
|
|
17
|
+
country: number;
|
|
18
|
+
services: any;
|
|
19
|
+
total_price: number;
|
|
20
|
+
pricing: {
|
|
21
|
+
current: boolean;
|
|
22
|
+
name: string;
|
|
23
|
+
max_employees: number;
|
|
24
|
+
total_price: number;
|
|
25
|
+
};
|
|
26
|
+
expires_in: number;
|
|
27
|
+
features_disabled: string[];
|
|
28
|
+
first_billed: string | null;
|
|
29
|
+
owed: number;
|
|
30
|
+
trial: boolean;
|
|
31
|
+
can_restart_trial: boolean;
|
|
32
|
+
next_billed: string;
|
|
33
|
+
hide_billing: boolean;
|
|
34
|
+
total_employees: number;
|
|
35
|
+
payment_card: string | null;
|
|
36
|
+
billing_type: string;
|
|
37
|
+
billing_term: string;
|
|
38
|
+
billing_email: string | null;
|
|
39
|
+
billing_address: string | null;
|
|
40
|
+
grouped_billing_parent: number | null;
|
|
41
|
+
grouped_billing_children: number[] | null;
|
|
42
|
+
vat_number: string | null;
|
|
43
|
+
suspended: boolean;
|
|
44
|
+
suspended_message: string | null;
|
|
7
45
|
constructor(account: ApiAccount);
|
|
8
46
|
}
|
|
@@ -72,7 +72,9 @@ export class Service {
|
|
|
72
72
|
}
|
|
73
73
|
fetch(reqConfig, options) {
|
|
74
74
|
const headers = {
|
|
75
|
-
Authorization:
|
|
75
|
+
Authorization: RotaCloud.config.apiKey
|
|
76
|
+
? `Bearer ${RotaCloud.config.apiKey}`
|
|
77
|
+
: `Basic ${RotaCloud.config.basicAuth}`,
|
|
76
78
|
'SDK-Version': Version.version,
|
|
77
79
|
};
|
|
78
80
|
const extraHeaders = RotaCloud.config.headers;
|
package/dist/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const Version = { version: '1.0.
|
|
1
|
+
export const Version = { version: '1.0.58' };
|
package/package.json
CHANGED
|
@@ -9,33 +9,33 @@ export interface ApiAccount {
|
|
|
9
9
|
owner: number;
|
|
10
10
|
timezone: number;
|
|
11
11
|
industry: number;
|
|
12
|
-
phone: string;
|
|
13
|
-
address_1: string;
|
|
14
|
-
address_2: string;
|
|
15
|
-
city: string;
|
|
16
|
-
county: string;
|
|
17
|
-
postcode: string;
|
|
12
|
+
phone: string | null;
|
|
13
|
+
address_1: string | null;
|
|
14
|
+
address_2: string | null;
|
|
15
|
+
city: string | null;
|
|
16
|
+
county: string | null;
|
|
17
|
+
postcode: string | null;
|
|
18
18
|
country: number;
|
|
19
19
|
services: ApiAccountServices[];
|
|
20
20
|
total_price: number;
|
|
21
21
|
pricing: object;
|
|
22
22
|
expires_in: number;
|
|
23
23
|
features_disabled: string[];
|
|
24
|
-
first_billed: string;
|
|
24
|
+
first_billed: string | null;
|
|
25
25
|
owed: number;
|
|
26
26
|
trial: boolean;
|
|
27
27
|
can_restart_trial: boolean;
|
|
28
28
|
next_billed: string;
|
|
29
29
|
hide_billing: boolean;
|
|
30
30
|
total_employees: number;
|
|
31
|
-
payment_card: string;
|
|
31
|
+
payment_card: string | null;
|
|
32
32
|
billing_type: string;
|
|
33
33
|
billing_term: string;
|
|
34
|
-
billing_email: string;
|
|
35
|
-
billing_address: string;
|
|
36
|
-
grouped_billing_parent: number;
|
|
37
|
-
grouped_billing_children: number[];
|
|
38
|
-
vat_number: string;
|
|
34
|
+
billing_email: string | null;
|
|
35
|
+
billing_address: string | null;
|
|
36
|
+
grouped_billing_parent: number | null;
|
|
37
|
+
grouped_billing_children: number[] | null;
|
|
38
|
+
vat_number: string | null;
|
|
39
39
|
suspended: boolean;
|
|
40
|
-
suspended_message: string;
|
|
40
|
+
suspended_message: string | null;
|
|
41
41
|
}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { RetryOptions, RetryStrategy } from '../services/service.js';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface SDKBase {
|
|
4
4
|
baseUri?: string;
|
|
5
|
-
apiKey: string;
|
|
6
5
|
accountId?: number;
|
|
7
6
|
userId?: number;
|
|
8
7
|
retry?: false | `${RetryStrategy}` | RetryOptions;
|
|
9
8
|
[key: string]: unknown;
|
|
10
9
|
}
|
|
10
|
+
|
|
11
|
+
export interface SDKBearerAuth extends SDKBase {
|
|
12
|
+
apiKey: string;
|
|
13
|
+
basicAuth?: never;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface SDKBasicAuth extends SDKBase {
|
|
17
|
+
apiKey?: never;
|
|
18
|
+
basicAuth: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type SDKConfig = SDKBasicAuth | SDKBearerAuth;
|
|
@@ -1,15 +1,45 @@
|
|
|
1
1
|
import { ApiAccount } from '../interfaces/index.js';
|
|
2
2
|
|
|
3
3
|
export class Account {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
level: string;
|
|
7
|
+
created: number;
|
|
8
|
+
expired: boolean;
|
|
9
|
+
owner: number;
|
|
10
|
+
timezone: number;
|
|
11
|
+
industry: number;
|
|
12
|
+
phone: string | null;
|
|
13
|
+
address_1: string | null;
|
|
14
|
+
address_2: string | null;
|
|
15
|
+
city: string | null;
|
|
16
|
+
county: string | null;
|
|
17
|
+
postcode: string | null;
|
|
18
|
+
country: number;
|
|
19
|
+
services: any;
|
|
20
|
+
total_price: number;
|
|
21
|
+
pricing: { current: boolean; name: string; max_employees: number; total_price: number };
|
|
22
|
+
expires_in: number;
|
|
23
|
+
features_disabled: string[];
|
|
24
|
+
first_billed: string | null;
|
|
25
|
+
owed: number;
|
|
26
|
+
trial: boolean;
|
|
27
|
+
can_restart_trial: boolean;
|
|
28
|
+
next_billed: string;
|
|
29
|
+
hide_billing: boolean;
|
|
30
|
+
total_employees: number;
|
|
31
|
+
payment_card: string | null;
|
|
32
|
+
billing_type: string;
|
|
33
|
+
billing_term: string;
|
|
34
|
+
billing_email: string | null;
|
|
35
|
+
billing_address: string | null;
|
|
36
|
+
grouped_billing_parent: number | null;
|
|
37
|
+
grouped_billing_children: number[] | null;
|
|
38
|
+
vat_number: string | null;
|
|
39
|
+
suspended: boolean;
|
|
40
|
+
suspended_message: string | null;
|
|
8
41
|
|
|
9
42
|
constructor(account: ApiAccount) {
|
|
10
|
-
this
|
|
11
|
-
this.name = account.name;
|
|
12
|
-
this.level = account.level;
|
|
13
|
-
this.created = account.created;
|
|
43
|
+
Object.assign(this, account);
|
|
14
44
|
}
|
|
15
45
|
}
|
|
@@ -13,6 +13,7 @@ export class Terminal {
|
|
|
13
13
|
public timezone: number;
|
|
14
14
|
public require_photo: boolean;
|
|
15
15
|
public require_photo_breaks: boolean;
|
|
16
|
+
public secret: string | null;
|
|
16
17
|
|
|
17
18
|
constructor(terminal: ApiTerminal) {
|
|
18
19
|
this.id = terminal.id;
|
|
@@ -27,5 +28,6 @@ export class Terminal {
|
|
|
27
28
|
this.timezone = terminal.timezone;
|
|
28
29
|
this.require_photo = terminal.require_photo;
|
|
29
30
|
this.require_photo_breaks = terminal.require_photo_breaks;
|
|
31
|
+
this.secret = terminal.secret;
|
|
30
32
|
}
|
|
31
33
|
}
|
package/src/rotacloud.ts
CHANGED
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
UsersService,
|
|
25
25
|
UsersClockInService,
|
|
26
26
|
} from './services/index.js';
|
|
27
|
-
import { SDKConfig } from './interfaces/index.js';
|
|
27
|
+
import { SDKBase, SDKConfig } from './interfaces/index.js';
|
|
28
28
|
import { PinsService } from './services/pins.service.js';
|
|
29
29
|
|
|
30
|
-
const DEFAULT_CONFIG: Partial<
|
|
30
|
+
const DEFAULT_CONFIG: Partial<SDKBase> = {
|
|
31
31
|
baseUri: 'https://api.rotacloud.com/v1',
|
|
32
32
|
retry: RetryStrategy.Exponential,
|
|
33
33
|
};
|
package/src/services/service.ts
CHANGED
|
@@ -111,7 +111,9 @@ export abstract class Service<ApiResponse = any> {
|
|
|
111
111
|
|
|
112
112
|
fetch<T = ApiResponse>(reqConfig: AxiosRequestConfig, options?: Options): Promise<AxiosResponse<T>> {
|
|
113
113
|
const headers: Record<string, string> = {
|
|
114
|
-
Authorization:
|
|
114
|
+
Authorization: RotaCloud.config.apiKey
|
|
115
|
+
? `Bearer ${RotaCloud.config.apiKey}`
|
|
116
|
+
: `Basic ${RotaCloud.config.basicAuth}`,
|
|
115
117
|
'SDK-Version': Version.version,
|
|
116
118
|
};
|
|
117
119
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const Version = { version: '1.0.
|
|
1
|
+
export const Version = { version: '1.0.58' };
|