rotacloud 1.0.27 → 1.0.28
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/auth.interface.d.ts +8 -0
- package/dist/cjs/interfaces/auth.interface.js +2 -0
- package/dist/cjs/interfaces/index.d.ts +1 -0
- package/dist/cjs/interfaces/index.js +1 -0
- package/dist/cjs/models/auth.model.d.ts +6 -0
- package/dist/cjs/models/auth.model.js +10 -0
- package/dist/cjs/rotacloud.d.ts +2 -1
- package/dist/cjs/rotacloud.js +1 -0
- package/dist/cjs/services/auth.service.d.ts +11 -0
- package/dist/cjs/services/auth.service.js +16 -0
- package/dist/cjs/services/index.d.ts +1 -0
- package/dist/cjs/services/index.js +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/interfaces/auth.interface.d.ts +8 -0
- package/dist/mjs/interfaces/auth.interface.js +1 -0
- package/dist/mjs/interfaces/index.d.ts +1 -0
- package/dist/mjs/interfaces/index.js +1 -0
- package/dist/mjs/models/auth.model.d.ts +6 -0
- package/dist/mjs/models/auth.model.js +6 -0
- package/dist/mjs/rotacloud.d.ts +2 -1
- package/dist/mjs/rotacloud.js +2 -1
- package/dist/mjs/services/auth.service.d.ts +11 -0
- package/dist/mjs/services/auth.service.js +12 -0
- package/dist/mjs/services/index.d.ts +1 -0
- package/dist/mjs/services/index.js +1 -0
- package/dist/mjs/version.js +1 -1
- package/package.json +1 -1
- package/src/interfaces/auth.interface.ts +9 -0
- package/src/interfaces/index.ts +1 -0
- package/src/models/auth.model.ts +11 -0
- package/src/rotacloud.ts +2 -0
- package/src/services/auth.service.ts +19 -0
- package/src/services/index.ts +1 -0
- package/src/version.ts +1 -1
|
@@ -2,6 +2,7 @@ export * from './account-service.interface.js';
|
|
|
2
2
|
export * from './account-services.interface.js';
|
|
3
3
|
export * from './account.interface.js';
|
|
4
4
|
export * from './attendance.interface.js';
|
|
5
|
+
export * from './auth.interface.js';
|
|
5
6
|
export * from './availability-pattern.interface.js';
|
|
6
7
|
export * from './availability.interface.js';
|
|
7
8
|
export * from './daily-budgets.interface.js';
|
|
@@ -14,6 +14,7 @@ __exportStar(require("./account-service.interface.js"), exports);
|
|
|
14
14
|
__exportStar(require("./account-services.interface.js"), exports);
|
|
15
15
|
__exportStar(require("./account.interface.js"), exports);
|
|
16
16
|
__exportStar(require("./attendance.interface.js"), exports);
|
|
17
|
+
__exportStar(require("./auth.interface.js"), exports);
|
|
17
18
|
__exportStar(require("./availability-pattern.interface.js"), exports);
|
|
18
19
|
__exportStar(require("./availability.interface.js"), exports);
|
|
19
20
|
__exportStar(require("./daily-budgets.interface.js"), exports);
|
package/dist/cjs/rotacloud.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AccountsService, AttendanceService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService } from './services/index.js';
|
|
1
|
+
import { AccountsService, AttendanceService, AuthService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService } from './services/index.js';
|
|
2
2
|
import { SDKConfig } from './interfaces/index.js';
|
|
3
3
|
export declare class RotaCloud {
|
|
4
4
|
static config: SDKConfig;
|
|
5
5
|
defaultAPIURI: string;
|
|
6
6
|
accounts: AccountsService;
|
|
7
7
|
attendance: AttendanceService;
|
|
8
|
+
auth: AuthService;
|
|
8
9
|
availability: AvailabilityService;
|
|
9
10
|
dailyBudgets: DailyBudgetsService;
|
|
10
11
|
dailyRevenue: DailyRevenueService;
|
package/dist/cjs/rotacloud.js
CHANGED
|
@@ -17,6 +17,7 @@ class RotaCloud {
|
|
|
17
17
|
this.defaultAPIURI = 'https://api.rotacloud.com/v1';
|
|
18
18
|
this.accounts = new index_js_1.AccountsService();
|
|
19
19
|
this.attendance = new index_js_1.AttendanceService();
|
|
20
|
+
this.auth = new index_js_1.AuthService();
|
|
20
21
|
this.availability = new index_js_1.AvailabilityService();
|
|
21
22
|
this.dailyBudgets = new index_js_1.DailyBudgetsService();
|
|
22
23
|
this.dailyRevenue = new index_js_1.DailyRevenueService();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { ApiAuth } from '../interfaces/index.js';
|
|
3
|
+
import { Service, Options } from './index.js';
|
|
4
|
+
import { Auth } from '../models/auth.model.js';
|
|
5
|
+
export declare class AuthService extends Service {
|
|
6
|
+
private apiPath;
|
|
7
|
+
get(options?: {
|
|
8
|
+
rawResponse: true;
|
|
9
|
+
} & Options): Promise<AxiosResponse<ApiAuth, any>>;
|
|
10
|
+
get(options?: Options): Promise<Auth>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthService = void 0;
|
|
4
|
+
const index_js_1 = require("./index.js");
|
|
5
|
+
const auth_model_js_1 = require("../models/auth.model.js");
|
|
6
|
+
const error_response_model_js_1 = require("../models/error-response.model.js");
|
|
7
|
+
class AuthService extends index_js_1.Service {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.apiPath = '/auth';
|
|
11
|
+
}
|
|
12
|
+
get(options) {
|
|
13
|
+
return super.fetch({ url: this.apiPath }, options).then((res) => Promise.resolve((options === null || options === void 0 ? void 0 : options.rawResponse) ? res : new auth_model_js_1.Auth(res.data)), (err) => Promise.reject((options === null || options === void 0 ? void 0 : options.rawResponse) ? err : new error_response_model_js_1.ErrorResponse(err)));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.AuthService = AuthService;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './service.js';
|
|
2
2
|
export * from './accounts.service.js';
|
|
3
3
|
export * from './attendance.service.js';
|
|
4
|
+
export * from './auth.service.js';
|
|
4
5
|
export * from './availability.service.js';
|
|
5
6
|
export * from './daily-budgets.service.js';
|
|
6
7
|
export * from './daily-revenue.service.js';
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./service.js"), exports);
|
|
14
14
|
__exportStar(require("./accounts.service.js"), exports);
|
|
15
15
|
__exportStar(require("./attendance.service.js"), exports);
|
|
16
|
+
__exportStar(require("./auth.service.js"), exports);
|
|
16
17
|
__exportStar(require("./availability.service.js"), exports);
|
|
17
18
|
__exportStar(require("./daily-budgets.service.js"), exports);
|
|
18
19
|
__exportStar(require("./daily-revenue.service.js"), exports);
|
package/dist/cjs/version.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ export * from './account-service.interface.js';
|
|
|
2
2
|
export * from './account-services.interface.js';
|
|
3
3
|
export * from './account.interface.js';
|
|
4
4
|
export * from './attendance.interface.js';
|
|
5
|
+
export * from './auth.interface.js';
|
|
5
6
|
export * from './availability-pattern.interface.js';
|
|
6
7
|
export * from './availability.interface.js';
|
|
7
8
|
export * from './daily-budgets.interface.js';
|
|
@@ -2,6 +2,7 @@ export * from './account-service.interface.js';
|
|
|
2
2
|
export * from './account-services.interface.js';
|
|
3
3
|
export * from './account.interface.js';
|
|
4
4
|
export * from './attendance.interface.js';
|
|
5
|
+
export * from './auth.interface.js';
|
|
5
6
|
export * from './availability-pattern.interface.js';
|
|
6
7
|
export * from './availability.interface.js';
|
|
7
8
|
export * from './daily-budgets.interface.js';
|
package/dist/mjs/rotacloud.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AccountsService, AttendanceService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService } from './services/index.js';
|
|
1
|
+
import { AccountsService, AttendanceService, AuthService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService } from './services/index.js';
|
|
2
2
|
import { SDKConfig } from './interfaces/index.js';
|
|
3
3
|
export declare class RotaCloud {
|
|
4
4
|
static config: SDKConfig;
|
|
5
5
|
defaultAPIURI: string;
|
|
6
6
|
accounts: AccountsService;
|
|
7
7
|
attendance: AttendanceService;
|
|
8
|
+
auth: AuthService;
|
|
8
9
|
availability: AvailabilityService;
|
|
9
10
|
dailyBudgets: DailyBudgetsService;
|
|
10
11
|
dailyRevenue: DailyRevenueService;
|
package/dist/mjs/rotacloud.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AccountsService, AttendanceService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService, } from './services/index.js';
|
|
1
|
+
import { AccountsService, AttendanceService, AuthService, AvailabilityService, DailyBudgetsService, DailyRevenueService, DaysOffService, GroupsService, LeaveEmbargoesService, LeaveRequestService, LeaveService, LocationsService, RolesService, ShiftsService, UsersService, } from './services/index.js';
|
|
2
2
|
export class RotaCloud {
|
|
3
3
|
constructor(config) {
|
|
4
4
|
this.defaultAPIURI = 'https://api.rotacloud.com/v1';
|
|
5
5
|
this.accounts = new AccountsService();
|
|
6
6
|
this.attendance = new AttendanceService();
|
|
7
|
+
this.auth = new AuthService();
|
|
7
8
|
this.availability = new AvailabilityService();
|
|
8
9
|
this.dailyBudgets = new DailyBudgetsService();
|
|
9
10
|
this.dailyRevenue = new DailyRevenueService();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { ApiAuth } from '../interfaces/index.js';
|
|
3
|
+
import { Service, Options } from './index.js';
|
|
4
|
+
import { Auth } from '../models/auth.model.js';
|
|
5
|
+
export declare class AuthService extends Service {
|
|
6
|
+
private apiPath;
|
|
7
|
+
get(options?: {
|
|
8
|
+
rawResponse: true;
|
|
9
|
+
} & Options): Promise<AxiosResponse<ApiAuth, any>>;
|
|
10
|
+
get(options?: Options): Promise<Auth>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Service } from './index.js';
|
|
2
|
+
import { Auth } from '../models/auth.model.js';
|
|
3
|
+
import { ErrorResponse } from '../models/error-response.model.js';
|
|
4
|
+
export class AuthService extends Service {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.apiPath = '/auth';
|
|
8
|
+
}
|
|
9
|
+
get(options) {
|
|
10
|
+
return super.fetch({ url: this.apiPath }, options).then((res) => Promise.resolve(options?.rawResponse ? res : new Auth(res.data)), (err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err)));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './service.js';
|
|
2
2
|
export * from './accounts.service.js';
|
|
3
3
|
export * from './attendance.service.js';
|
|
4
|
+
export * from './auth.service.js';
|
|
4
5
|
export * from './availability.service.js';
|
|
5
6
|
export * from './daily-budgets.service.js';
|
|
6
7
|
export * from './daily-revenue.service.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './service.js';
|
|
2
2
|
export * from './accounts.service.js';
|
|
3
3
|
export * from './attendance.service.js';
|
|
4
|
+
export * from './auth.service.js';
|
|
4
5
|
export * from './availability.service.js';
|
|
5
6
|
export * from './daily-budgets.service.js';
|
|
6
7
|
export * from './daily-revenue.service.js';
|
package/dist/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const Version = { version: '1.0.
|
|
1
|
+
export const Version = { version: '1.0.28' };
|
package/package.json
CHANGED
package/src/interfaces/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './account-service.interface.js';
|
|
|
2
2
|
export * from './account-services.interface.js';
|
|
3
3
|
export * from './account.interface.js';
|
|
4
4
|
export * from './attendance.interface.js';
|
|
5
|
+
export * from './auth.interface.js';
|
|
5
6
|
export * from './availability-pattern.interface.js';
|
|
6
7
|
export * from './availability.interface.js';
|
|
7
8
|
export * from './daily-budgets.interface.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiAuth, ApiAuthAccount } from '../interfaces/index.js';
|
|
2
|
+
|
|
3
|
+
export class Auth {
|
|
4
|
+
public two_factor_enabled: boolean;
|
|
5
|
+
public accounts: ApiAuthAccount[];
|
|
6
|
+
|
|
7
|
+
constructor(auth: ApiAuth) {
|
|
8
|
+
this.two_factor_enabled = auth.two_factor_enabled;
|
|
9
|
+
this.accounts = auth.accounts;
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/rotacloud.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AccountsService,
|
|
3
3
|
AttendanceService,
|
|
4
|
+
AuthService,
|
|
4
5
|
AvailabilityService,
|
|
5
6
|
DailyBudgetsService,
|
|
6
7
|
DailyRevenueService,
|
|
@@ -22,6 +23,7 @@ export class RotaCloud {
|
|
|
22
23
|
public defaultAPIURI = 'https://api.rotacloud.com/v1';
|
|
23
24
|
public accounts = new AccountsService();
|
|
24
25
|
public attendance = new AttendanceService();
|
|
26
|
+
public auth = new AuthService();
|
|
25
27
|
public availability = new AvailabilityService();
|
|
26
28
|
public dailyBudgets = new DailyBudgetsService();
|
|
27
29
|
public dailyRevenue = new DailyRevenueService();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { ApiAuth } from '../interfaces/index.js';
|
|
3
|
+
import { Service, Options } from './index.js';
|
|
4
|
+
|
|
5
|
+
import { Auth } from '../models/auth.model.js';
|
|
6
|
+
import { ErrorResponse } from '../models/error-response.model.js';
|
|
7
|
+
|
|
8
|
+
export class AuthService extends Service {
|
|
9
|
+
private apiPath = '/auth';
|
|
10
|
+
|
|
11
|
+
get(options?: { rawResponse: true } & Options): Promise<AxiosResponse<ApiAuth, any>>;
|
|
12
|
+
get(options?: Options): Promise<Auth>;
|
|
13
|
+
get(options?: Options) {
|
|
14
|
+
return super.fetch<ApiAuth>({ url: this.apiPath }, options).then(
|
|
15
|
+
(res) => Promise.resolve(options?.rawResponse ? res : new Auth(res.data)),
|
|
16
|
+
(err) => Promise.reject(options?.rawResponse ? err : new ErrorResponse(err))
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/services/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './service.js';
|
|
2
2
|
export * from './accounts.service.js';
|
|
3
3
|
export * from './attendance.service.js';
|
|
4
|
+
export * from './auth.service.js';
|
|
4
5
|
export * from './availability.service.js';
|
|
5
6
|
export * from './daily-budgets.service.js';
|
|
6
7
|
export * from './daily-revenue.service.js';
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const Version = { version: '1.0.
|
|
1
|
+
export const Version = { version: '1.0.28' };
|