rotacloud 1.0.28 → 1.0.30
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/models/attendance.model.d.ts +21 -1
- package/dist/cjs/models/attendance.model.js +20 -0
- package/dist/cjs/services/accounts.service.d.ts +7 -1
- package/dist/cjs/services/accounts.service.js +4 -0
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/models/attendance.model.d.ts +21 -1
- package/dist/mjs/models/attendance.model.js +20 -0
- package/dist/mjs/services/accounts.service.d.ts +7 -1
- package/dist/mjs/services/accounts.service.js +4 -0
- package/dist/mjs/version.js +1 -1
- package/package.json +1 -1
- package/src/models/attendance.model.ts +41 -1
- package/src/services/accounts.service.ts +12 -0
- package/src/version.ts +1 -1
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import { ApiAttendance } from '../interfaces/index.js';
|
|
1
|
+
import { ApiAttendance, ApiAttendanceLocation, ApiShift } from '../interfaces/index.js';
|
|
2
2
|
export declare class Attendance {
|
|
3
3
|
id: number;
|
|
4
|
+
deleted: boolean;
|
|
4
5
|
approved: boolean;
|
|
6
|
+
in_time: number;
|
|
7
|
+
out_time: number;
|
|
8
|
+
minutes_break: number;
|
|
9
|
+
user: number;
|
|
5
10
|
location: number;
|
|
11
|
+
role: number;
|
|
12
|
+
minutes_late: number;
|
|
13
|
+
hours: number;
|
|
14
|
+
hours_auto: number;
|
|
15
|
+
hours_is_auto: boolean;
|
|
16
|
+
notes: string | null;
|
|
17
|
+
shift: ApiShift | null;
|
|
18
|
+
in_method: string;
|
|
19
|
+
out_method: string;
|
|
20
|
+
in_location: ApiAttendanceLocation;
|
|
21
|
+
out_location: ApiAttendanceLocation;
|
|
22
|
+
in_device: number;
|
|
23
|
+
out_device: number;
|
|
24
|
+
in_terminal: null;
|
|
25
|
+
out_terminal: null;
|
|
6
26
|
constructor(attendance: ApiAttendance);
|
|
7
27
|
}
|
|
@@ -4,8 +4,28 @@ exports.Attendance = void 0;
|
|
|
4
4
|
class Attendance {
|
|
5
5
|
constructor(attendance) {
|
|
6
6
|
this.id = attendance.id;
|
|
7
|
+
this.deleted = attendance.deleted;
|
|
7
8
|
this.approved = attendance.approved;
|
|
9
|
+
this.in_time = attendance.in_time;
|
|
10
|
+
this.out_time = attendance.out_time;
|
|
11
|
+
this.minutes_break = attendance.minutes_break;
|
|
12
|
+
this.user = attendance.user;
|
|
8
13
|
this.location = attendance.location;
|
|
14
|
+
this.role = attendance.role;
|
|
15
|
+
this.minutes_late = attendance.minutes_late;
|
|
16
|
+
this.hours = attendance.hours;
|
|
17
|
+
this.hours_auto = attendance.hours_auto;
|
|
18
|
+
this.hours_is_auto = attendance.hours_is_auto;
|
|
19
|
+
this.notes = attendance.notes;
|
|
20
|
+
this.shift = attendance.shift;
|
|
21
|
+
this.in_method = attendance.in_method;
|
|
22
|
+
this.out_method = attendance.out_method;
|
|
23
|
+
this.in_location = attendance.in_location;
|
|
24
|
+
this.out_location = attendance.out_location;
|
|
25
|
+
this.in_device = attendance.in_device;
|
|
26
|
+
this.out_device = attendance.out_device;
|
|
27
|
+
this.in_terminal = attendance.in_terminal;
|
|
28
|
+
this.out_terminal = attendance.out_terminal;
|
|
9
29
|
}
|
|
10
30
|
}
|
|
11
31
|
exports.Attendance = Attendance;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
1
2
|
import { Account } from '../models/account.model.js';
|
|
2
3
|
import { Service, Options } from './index.js';
|
|
3
4
|
import { ApiAccount } from '../interfaces/index.js';
|
|
4
5
|
declare class AccountsService extends Service {
|
|
5
6
|
private apiPath;
|
|
7
|
+
get(id: number): Promise<Account>;
|
|
8
|
+
get(id: number, options: {
|
|
9
|
+
rawResponse: true;
|
|
10
|
+
} & Options): Promise<AxiosResponse<ApiAccount, any>>;
|
|
11
|
+
get(id: number, options: Options): Promise<Account>;
|
|
6
12
|
list(options?: Options): AsyncGenerator<Account, void, unknown>;
|
|
7
13
|
listAll(options?: Options): Promise<Account[]>;
|
|
8
|
-
listByPage(options?: Options): AsyncGenerator<
|
|
14
|
+
listByPage(options?: Options): AsyncGenerator<AxiosResponse<ApiAccount[], any>, any, unknown>;
|
|
9
15
|
}
|
|
10
16
|
export { AccountsService };
|
|
@@ -31,11 +31,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
31
31
|
exports.AccountsService = void 0;
|
|
32
32
|
const account_model_js_1 = require("../models/account.model.js");
|
|
33
33
|
const index_js_1 = require("./index.js");
|
|
34
|
+
const error_response_model_js_1 = require("../models/error-response.model.js");
|
|
34
35
|
class AccountsService extends index_js_1.Service {
|
|
35
36
|
constructor() {
|
|
36
37
|
super(...arguments);
|
|
37
38
|
this.apiPath = '/accounts';
|
|
38
39
|
}
|
|
40
|
+
get(id, options) {
|
|
41
|
+
return super.fetch({ url: `${this.apiPath}/${id}` }, options).then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res : new account_model_js_1.Account(res.data)), (err) => Promise.reject((options === null || options === void 0 ? void 0 : options.rawResponse) ? err : new error_response_model_js_1.ErrorResponse(err)));
|
|
42
|
+
}
|
|
39
43
|
list(options) {
|
|
40
44
|
const _super = Object.create(null, {
|
|
41
45
|
iterator: { get: () => super.iterator }
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import { ApiAttendance } from '../interfaces/index.js';
|
|
1
|
+
import { ApiAttendance, ApiAttendanceLocation, ApiShift } from '../interfaces/index.js';
|
|
2
2
|
export declare class Attendance {
|
|
3
3
|
id: number;
|
|
4
|
+
deleted: boolean;
|
|
4
5
|
approved: boolean;
|
|
6
|
+
in_time: number;
|
|
7
|
+
out_time: number;
|
|
8
|
+
minutes_break: number;
|
|
9
|
+
user: number;
|
|
5
10
|
location: number;
|
|
11
|
+
role: number;
|
|
12
|
+
minutes_late: number;
|
|
13
|
+
hours: number;
|
|
14
|
+
hours_auto: number;
|
|
15
|
+
hours_is_auto: boolean;
|
|
16
|
+
notes: string | null;
|
|
17
|
+
shift: ApiShift | null;
|
|
18
|
+
in_method: string;
|
|
19
|
+
out_method: string;
|
|
20
|
+
in_location: ApiAttendanceLocation;
|
|
21
|
+
out_location: ApiAttendanceLocation;
|
|
22
|
+
in_device: number;
|
|
23
|
+
out_device: number;
|
|
24
|
+
in_terminal: null;
|
|
25
|
+
out_terminal: null;
|
|
6
26
|
constructor(attendance: ApiAttendance);
|
|
7
27
|
}
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
export class Attendance {
|
|
2
2
|
constructor(attendance) {
|
|
3
3
|
this.id = attendance.id;
|
|
4
|
+
this.deleted = attendance.deleted;
|
|
4
5
|
this.approved = attendance.approved;
|
|
6
|
+
this.in_time = attendance.in_time;
|
|
7
|
+
this.out_time = attendance.out_time;
|
|
8
|
+
this.minutes_break = attendance.minutes_break;
|
|
9
|
+
this.user = attendance.user;
|
|
5
10
|
this.location = attendance.location;
|
|
11
|
+
this.role = attendance.role;
|
|
12
|
+
this.minutes_late = attendance.minutes_late;
|
|
13
|
+
this.hours = attendance.hours;
|
|
14
|
+
this.hours_auto = attendance.hours_auto;
|
|
15
|
+
this.hours_is_auto = attendance.hours_is_auto;
|
|
16
|
+
this.notes = attendance.notes;
|
|
17
|
+
this.shift = attendance.shift;
|
|
18
|
+
this.in_method = attendance.in_method;
|
|
19
|
+
this.out_method = attendance.out_method;
|
|
20
|
+
this.in_location = attendance.in_location;
|
|
21
|
+
this.out_location = attendance.out_location;
|
|
22
|
+
this.in_device = attendance.in_device;
|
|
23
|
+
this.out_device = attendance.out_device;
|
|
24
|
+
this.in_terminal = attendance.in_terminal;
|
|
25
|
+
this.out_terminal = attendance.out_terminal;
|
|
6
26
|
}
|
|
7
27
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
1
2
|
import { Account } from '../models/account.model.js';
|
|
2
3
|
import { Service, Options } from './index.js';
|
|
3
4
|
import { ApiAccount } from '../interfaces/index.js';
|
|
4
5
|
declare class AccountsService extends Service {
|
|
5
6
|
private apiPath;
|
|
7
|
+
get(id: number): Promise<Account>;
|
|
8
|
+
get(id: number, options: {
|
|
9
|
+
rawResponse: true;
|
|
10
|
+
} & Options): Promise<AxiosResponse<ApiAccount, any>>;
|
|
11
|
+
get(id: number, options: Options): Promise<Account>;
|
|
6
12
|
list(options?: Options): AsyncGenerator<Account, void, unknown>;
|
|
7
13
|
listAll(options?: Options): Promise<Account[]>;
|
|
8
|
-
listByPage(options?: Options): AsyncGenerator<
|
|
14
|
+
listByPage(options?: Options): AsyncGenerator<AxiosResponse<ApiAccount[], any>, any, unknown>;
|
|
9
15
|
}
|
|
10
16
|
export { AccountsService };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Account } from '../models/account.model.js';
|
|
2
2
|
import { Service } from './index.js';
|
|
3
|
+
import { ErrorResponse } from '../models/error-response.model.js';
|
|
3
4
|
class AccountsService extends Service {
|
|
4
5
|
constructor() {
|
|
5
6
|
super(...arguments);
|
|
6
7
|
this.apiPath = '/accounts';
|
|
7
8
|
}
|
|
9
|
+
get(id, options) {
|
|
10
|
+
return super.fetch({ url: `${this.apiPath}/${id}` }, options).then((res) => Promise.resolve(options?.rawResponse ? res : new Account(res.data)), (err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err)));
|
|
11
|
+
}
|
|
8
12
|
async *list(options) {
|
|
9
13
|
for await (const res of super.iterator({ url: this.apiPath }, options)) {
|
|
10
14
|
yield new Account(res);
|
package/dist/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const Version = { version: '1.0.
|
|
1
|
+
export const Version = { version: '1.0.30' };
|
package/package.json
CHANGED
|
@@ -1,13 +1,53 @@
|
|
|
1
|
-
import { ApiAttendance } from '../interfaces/index.js';
|
|
1
|
+
import { ApiAttendance, ApiAttendanceLocation, ApiShift } from '../interfaces/index.js';
|
|
2
2
|
|
|
3
3
|
export class Attendance {
|
|
4
4
|
public id: number;
|
|
5
|
+
public deleted: boolean;
|
|
5
6
|
public approved: boolean;
|
|
7
|
+
public in_time: number;
|
|
8
|
+
public out_time: number;
|
|
9
|
+
public minutes_break: number;
|
|
10
|
+
public user: number;
|
|
6
11
|
public location: number;
|
|
12
|
+
public role: number;
|
|
13
|
+
public minutes_late: number;
|
|
14
|
+
public hours: number;
|
|
15
|
+
public hours_auto: number;
|
|
16
|
+
public hours_is_auto: boolean;
|
|
17
|
+
public notes: string | null;
|
|
18
|
+
public shift: ApiShift | null;
|
|
19
|
+
public in_method: string;
|
|
20
|
+
public out_method: string;
|
|
21
|
+
public in_location: ApiAttendanceLocation;
|
|
22
|
+
public out_location: ApiAttendanceLocation;
|
|
23
|
+
public in_device: number;
|
|
24
|
+
public out_device: number;
|
|
25
|
+
public in_terminal: null;
|
|
26
|
+
public out_terminal: null;
|
|
7
27
|
|
|
8
28
|
constructor(attendance: ApiAttendance) {
|
|
9
29
|
this.id = attendance.id;
|
|
30
|
+
this.deleted = attendance.deleted;
|
|
10
31
|
this.approved = attendance.approved;
|
|
32
|
+
this.in_time = attendance.in_time;
|
|
33
|
+
this.out_time = attendance.out_time;
|
|
34
|
+
this.minutes_break = attendance.minutes_break;
|
|
35
|
+
this.user = attendance.user;
|
|
11
36
|
this.location = attendance.location;
|
|
37
|
+
this.role = attendance.role;
|
|
38
|
+
this.minutes_late = attendance.minutes_late;
|
|
39
|
+
this.hours = attendance.hours;
|
|
40
|
+
this.hours_auto = attendance.hours_auto;
|
|
41
|
+
this.hours_is_auto = attendance.hours_is_auto;
|
|
42
|
+
this.notes = attendance.notes;
|
|
43
|
+
this.shift = attendance.shift;
|
|
44
|
+
this.in_method = attendance.in_method;
|
|
45
|
+
this.out_method = attendance.out_method;
|
|
46
|
+
this.in_location = attendance.in_location;
|
|
47
|
+
this.out_location = attendance.out_location;
|
|
48
|
+
this.in_device = attendance.in_device;
|
|
49
|
+
this.out_device = attendance.out_device;
|
|
50
|
+
this.in_terminal = attendance.in_terminal;
|
|
51
|
+
this.out_terminal = attendance.out_terminal;
|
|
12
52
|
}
|
|
13
53
|
}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
1
2
|
import { Account } from '../models/account.model.js';
|
|
2
3
|
import { Service, Options } from './index.js';
|
|
3
4
|
|
|
4
5
|
import { ApiAccount } from '../interfaces/index.js';
|
|
6
|
+
import { ErrorResponse } from '../models/error-response.model.js';
|
|
5
7
|
|
|
6
8
|
class AccountsService extends Service {
|
|
7
9
|
private apiPath = '/accounts';
|
|
8
10
|
|
|
11
|
+
get(id: number): Promise<Account>;
|
|
12
|
+
get(id: number, options: { rawResponse: true } & Options): Promise<AxiosResponse<ApiAccount, any>>;
|
|
13
|
+
get(id: number, options: Options): Promise<Account>;
|
|
14
|
+
get(id: number, options?: Options) {
|
|
15
|
+
return super.fetch<ApiAccount>({ url: `${this.apiPath}/${id}` }, options).then(
|
|
16
|
+
(res) => Promise.resolve(options?.rawResponse ? res : new Account(res.data)),
|
|
17
|
+
(err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
9
21
|
async *list(options?: Options) {
|
|
10
22
|
for await (const res of super.iterator<ApiAccount>({ url: this.apiPath }, options)) {
|
|
11
23
|
yield new Account(res);
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const Version = { version: '1.0.
|
|
1
|
+
export const Version = { version: '1.0.30' };
|