@bringg/dashboard-sdk 9.88.0 → 9.90.0-pre.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/Service/Entity/ServiceEntity.d.ts +7 -3
- package/dist/Service/Entity/ServiceEntity.js +34 -2
- package/dist/Service/Entity/ServiceEntity.js.map +1 -1
- package/dist/Service/ServiceApi.d.ts +10 -2
- package/dist/Service/ServiceApi.js +34 -0
- package/dist/Service/ServiceApi.js.map +1 -1
- package/dist/Service/Services.consts.d.ts +31 -0
- package/dist/Service/Services.consts.js +3 -0
- package/dist/Service/Services.consts.js.map +1 -0
- package/dist/Shifts/Entity/Shifts.d.ts +1 -5
- package/dist/Shifts/Entity/Shifts.js +0 -46
- package/dist/Shifts/Entity/Shifts.js.map +1 -1
- package/dist/Shifts/Shifts.consts.d.ts +0 -29
- package/dist/Shifts/ShiftsApi.d.ts +1 -5
- package/dist/Shifts/ShiftsApi.js +0 -12
- package/dist/Shifts/ShiftsApi.js.map +1 -1
- package/dist/bringg-dashboard-sdk-cjs2.js +81 -62
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +17 -6
- package/dist/bringg-dashboard-sdk.min.js +1 -1
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DELETE_RESPONSE } from '../../Core/CrudService';
|
|
2
2
|
import Entity from '../../Core/Entity';
|
|
3
3
|
import Session from '../../Services/Identity/Session';
|
|
4
|
-
|
|
4
|
+
import { ServicesSetup, ServicesSetupAction, ServicesSetupCreateParams, ServicesSetupCreateResponse } from '../Services.consts';
|
|
5
|
+
export default class ServiceEntity extends Entity<ServicesSetup> {
|
|
5
6
|
constructor(session: Session);
|
|
6
|
-
getAll(): Promise<
|
|
7
|
+
getAll(): Promise<ServicesSetup[]>;
|
|
8
|
+
create(params: ServicesSetupCreateParams): Promise<ServicesSetupCreateResponse>;
|
|
9
|
+
delete(id: number): Promise<DELETE_RESPONSE>;
|
|
10
|
+
listActions(): Promise<ServicesSetupAction[]>;
|
|
7
11
|
}
|
|
@@ -75,13 +75,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
75
75
|
};
|
|
76
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
77
|
var Entity_1 = __importStar(require("../../Core/Entity"));
|
|
78
|
+
var ENTITY_NAME = 'services_setup';
|
|
78
79
|
var ServiceEntity = /** @class */ (function (_super) {
|
|
79
80
|
__extends(ServiceEntity, _super);
|
|
80
81
|
function ServiceEntity(session) {
|
|
81
82
|
return _super.call(this, {
|
|
82
83
|
session: session,
|
|
83
|
-
entityName:
|
|
84
|
-
routes: [Entity_1.BaseRoutes.GetAll]
|
|
84
|
+
entityName: ENTITY_NAME,
|
|
85
|
+
routes: [Entity_1.BaseRoutes.GetAll, Entity_1.BaseRoutes.Create, Entity_1.BaseRoutes.Delete]
|
|
85
86
|
}) || this;
|
|
86
87
|
}
|
|
87
88
|
ServiceEntity.prototype.getAll = function () {
|
|
@@ -94,6 +95,37 @@ var ServiceEntity = /** @class */ (function (_super) {
|
|
|
94
95
|
});
|
|
95
96
|
});
|
|
96
97
|
};
|
|
98
|
+
ServiceEntity.prototype.create = function (params) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
+
var _a;
|
|
101
|
+
return __generator(this, function (_b) {
|
|
102
|
+
switch (_b.label) {
|
|
103
|
+
case 0: return [4 /*yield*/, this.service.create((_a = {}, _a[ENTITY_NAME] = params, _a))];
|
|
104
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
ServiceEntity.prototype.delete = function (id) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
113
|
+
case 0: return [4 /*yield*/, this.service.delete(id)];
|
|
114
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
ServiceEntity.prototype.listActions = function () {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
123
|
+
.get("/".concat(ENTITY_NAME, "/list"))
|
|
124
|
+
.setException('failed to get services setup actions')
|
|
125
|
+
.invoke()];
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
97
129
|
return ServiceEntity;
|
|
98
130
|
}(Entity_1.default));
|
|
99
131
|
exports.default = ServiceEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceEntity.js","sourceRoot":"","sources":["../../../src/Service/Entity/ServiceEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ServiceEntity.js","sourceRoot":"","sources":["../../../src/Service/Entity/ServiceEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0DAAuD;AASvD,IAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;IAA2C,iCAAqB;IAC/D,uBAAY,OAAgB;eAC3B,kBAAM;YACL,OAAO,SAAA;YACP,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,CAAC,mBAAU,CAAC,MAAM,EAAE,mBAAU,CAAC,MAAM,EAAE,mBAAU,CAAC,MAAM,CAAC;SACjE,CAAC;IACH,CAAC;IAEY,8BAAM,GAAnB;;;;4BACQ,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAA;4BAAlC,sBAAO,SAA2B,EAAC;;;;KACnC;IAEY,8BAAM,GAAnB,UAAoB,MAAiC;;;;;4BAC7C,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,WAAG,GAAC,WAAW,IAAG,MAAM,MAAG,EAAA;4BAA3D,sBAAO,SAAoD,EAAC;;;;KAC5D;IAEY,8BAAM,GAAnB,UAAoB,EAAU;;;;4BACtB,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;4BAApC,sBAAO,SAA6B,EAAC;;;;KACrC;IAEY,mCAAW,GAAxB;;;gBACC,sBAAO,IAAI,CAAC,OAAO,CAAC,cAAc;yBAChC,GAAG,CAAC,WAAI,WAAW,UAAO,CAAC;yBAC3B,YAAY,CAAC,sCAAsC,CAAC;yBACpD,MAAM,EAAE,EAAC;;;KACX;IACF,oBAAC;AAAD,CAAC,AA3BD,CAA2C,gBAAM,GA2BhD"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DELETE_RESPONSE } from '../Core/CrudService';
|
|
2
2
|
import Session from '../Services/Identity/Session';
|
|
3
|
+
import { ServicesSetup, ServicesSetupAction, ServicesSetupCreateParams, ServicesSetupCreateResponse } from './Services.consts';
|
|
3
4
|
export default class ServiceApi {
|
|
4
5
|
private entity;
|
|
5
6
|
constructor(session: Session);
|
|
6
|
-
|
|
7
|
+
/** Every services API key configured for the merchant. */
|
|
8
|
+
getAll(): Promise<ServicesSetup[]>;
|
|
9
|
+
/** Mints a key for one endpoint. An unknown tag name creates a merchant tag. */
|
|
10
|
+
create(params: ServicesSetupCreateParams): Promise<ServicesSetupCreateResponse>;
|
|
11
|
+
/** Trashes a key. Requests using its URL fail from then on. */
|
|
12
|
+
delete(id: number): Promise<DELETE_RESPONSE>;
|
|
13
|
+
/** The endpoints this merchant may create a key for, public plus its allowed private ones. */
|
|
14
|
+
listActions(): Promise<ServicesSetupAction[]>;
|
|
7
15
|
}
|
|
@@ -44,6 +44,7 @@ var ServiceApi = /** @class */ (function () {
|
|
|
44
44
|
function ServiceApi(session) {
|
|
45
45
|
this.entity = new ServiceEntity_1.default(session);
|
|
46
46
|
}
|
|
47
|
+
/** Every services API key configured for the merchant. */
|
|
47
48
|
ServiceApi.prototype.getAll = function () {
|
|
48
49
|
return __awaiter(this, void 0, void 0, function () {
|
|
49
50
|
return __generator(this, function (_a) {
|
|
@@ -54,6 +55,39 @@ var ServiceApi = /** @class */ (function () {
|
|
|
54
55
|
});
|
|
55
56
|
});
|
|
56
57
|
};
|
|
58
|
+
/** Mints a key for one endpoint. An unknown tag name creates a merchant tag. */
|
|
59
|
+
ServiceApi.prototype.create = function (params) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
+
return __generator(this, function (_a) {
|
|
62
|
+
switch (_a.label) {
|
|
63
|
+
case 0: return [4 /*yield*/, this.entity.create(params)];
|
|
64
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
/** Trashes a key. Requests using its URL fail from then on. */
|
|
70
|
+
ServiceApi.prototype.delete = function (id) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0: return [4 /*yield*/, this.entity.delete(id)];
|
|
75
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
/** The endpoints this merchant may create a key for, public plus its allowed private ones. */
|
|
81
|
+
ServiceApi.prototype.listActions = function () {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
return __generator(this, function (_a) {
|
|
84
|
+
switch (_a.label) {
|
|
85
|
+
case 0: return [4 /*yield*/, this.entity.listActions()];
|
|
86
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
57
91
|
return ServiceApi;
|
|
58
92
|
}());
|
|
59
93
|
exports.default = ServiceApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceApi.js","sourceRoot":"","sources":["../../src/Service/ServiceApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ServiceApi.js","sourceRoot":"","sources":["../../src/Service/ServiceApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yEAAmD;AAQnD;IAGC,oBAAY,OAAgB;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,0DAA0D;IAC7C,2BAAM,GAAnB;;;;4BACQ,qBAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAA;4BAAjC,sBAAO,SAA0B,EAAC;;;;KAClC;IAED,gFAAgF;IACnE,2BAAM,GAAnB,UAAoB,MAAiC;;;;4BAC7C,qBAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAA;4BAAvC,sBAAO,SAAgC,EAAC;;;;KACxC;IAED,+DAA+D;IAClD,2BAAM,GAAnB,UAAoB,EAAU;;;;4BACtB,qBAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;4BAAnC,sBAAO,SAA4B,EAAC;;;;KACpC;IAED,8FAA8F;IACjF,gCAAW,GAAxB;;;;4BACQ,qBAAM,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAA;4BAAtC,sBAAO,SAA+B,EAAC;;;;KACvC;IACF,iBAAC;AAAD,CAAC,AA1BD,IA0BC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface ServicesSetup {
|
|
2
|
+
id: number;
|
|
3
|
+
action: string;
|
|
4
|
+
action_name: string;
|
|
5
|
+
first_auth_key: string;
|
|
6
|
+
second_auth_key: string;
|
|
7
|
+
tag: string | null;
|
|
8
|
+
user_id: number | null;
|
|
9
|
+
url: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ServicesSetupAction {
|
|
12
|
+
id: string;
|
|
13
|
+
action_name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
scope: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ServicesSetupCreateParams {
|
|
18
|
+
action: {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
tag?: string;
|
|
22
|
+
user_id?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A rejected action never reaches here: `handleAuthorizedRequest` turns a `success: false` body into
|
|
26
|
+
* a thrown `BringgException`, so the only body a caller can observe is the successful one.
|
|
27
|
+
*/
|
|
28
|
+
export interface ServicesSetupCreateResponse {
|
|
29
|
+
success: true;
|
|
30
|
+
service: ServicesSetup;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Services.consts.js","sourceRoot":"","sources":["../../src/Service/Services.consts.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import Entity from '../../Core/Entity';
|
|
2
2
|
import Session from '../../Services/Identity/Session';
|
|
3
|
-
import {
|
|
3
|
+
import { StartShiftResponse } from '../Shifts.consts';
|
|
4
4
|
export default class ShiftsEntity extends Entity<ShiftsEntity> {
|
|
5
5
|
constructor(session: Session);
|
|
6
|
-
getShifts(teamId: number): Promise<ShiftsResponse>;
|
|
7
|
-
updateShifts(teamId: number, configuration: ShiftsConfiguration[]): Promise<ShiftsResponse>;
|
|
8
|
-
getBreaks(teamId: number): Promise<BreaksResponse>;
|
|
9
|
-
updateBreaks(teamId: number, configuration: ShiftsConfiguration[]): Promise<BreaksResponse>;
|
|
10
6
|
startShift(userId: number, teamId?: number): Promise<StartShiftResponse>;
|
|
11
7
|
endShift(userId: number): Promise<boolean>;
|
|
12
8
|
}
|
|
@@ -60,52 +60,6 @@ var ShiftsEntity = /** @class */ (function (_super) {
|
|
|
60
60
|
function ShiftsEntity(session) {
|
|
61
61
|
return _super.call(this, { session: session, entityName: 'shifts' }) || this;
|
|
62
62
|
}
|
|
63
|
-
ShiftsEntity.prototype.getShifts = function (teamId) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
-
return __generator(this, function (_a) {
|
|
66
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
67
|
-
.get("/teams/".concat(teamId, "/shifts_schedule/"))
|
|
68
|
-
.setException('Failed to get shifts schedule')
|
|
69
|
-
.invoke()];
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
ShiftsEntity.prototype.updateShifts = function (teamId, configuration) {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
var request;
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
request = { id: teamId, configuration: configuration };
|
|
78
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
79
|
-
.put("/teams/".concat(teamId, "/shifts_schedule"))
|
|
80
|
-
.withPayload(request)
|
|
81
|
-
.setException('Failed update shifts schedule')
|
|
82
|
-
.invoke()];
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
ShiftsEntity.prototype.getBreaks = function (teamId) {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
90
|
-
.get("/teams/".concat(teamId, "/scheduled_breaks/"))
|
|
91
|
-
.setException('Failed to get shifts breaks')
|
|
92
|
-
.invoke()];
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
ShiftsEntity.prototype.updateBreaks = function (teamId, configuration) {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
-
var request;
|
|
99
|
-
return __generator(this, function (_a) {
|
|
100
|
-
request = { id: teamId, configuration: configuration };
|
|
101
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
102
|
-
.put("/teams/".concat(teamId, "/scheduled_breaks"))
|
|
103
|
-
.withPayload(request)
|
|
104
|
-
.setException('Failed update shift breaks')
|
|
105
|
-
.invoke()];
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
63
|
ShiftsEntity.prototype.startShift = function (userId, teamId) {
|
|
110
64
|
return __awaiter(this, void 0, void 0, function () {
|
|
111
65
|
return __generator(this, function (_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shifts.js","sourceRoot":"","sources":["../../../src/Shifts/Entity/Shifts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAuC;
|
|
1
|
+
{"version":3,"file":"Shifts.js","sourceRoot":"","sources":["../../../src/Shifts/Entity/Shifts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAuC;AAIvC;IAA0C,gCAAoB;IAC7D,sBAAY,OAAgB;eAC3B,kBAAM,EAAE,OAAO,SAAA,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;IACzC,CAAC;IAEY,iCAAU,GAAvB,UAAwB,MAAc,EAAE,MAAe;;;gBACtD,sBAAO,IAAI,CAAC,OAAO,CAAC,cAAc;yBAChC,IAAI,CAAC,iBAAU,MAAM,WAAQ,CAAC;yBAC9B,WAAW,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC;yBACvC,YAAY,CAAC,yBAAyB,CAAC;yBACvC,MAAM,EAAmD,EAAC;;;KAC5D;IAED,oGAAoG;IACpG,mGAAmG;IACnG,qEAAqE;IACxD,+BAAQ,GAArB,UAAsB,MAAc;;;gBACnC,sBAAO,IAAI,CAAC,OAAO,CAAC,cAAc;yBAChC,MAAM,CAAC,iBAAU,MAAM,WAAQ,CAAC;yBAChC,aAAa,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,OAAO,EAAhB,CAAgB,CAAC;yBAC3C,YAAY,CAAC,uBAAuB,CAAC;yBACrC,MAAM,EAAE,EAAC;;;KACX;IACF,mBAAC;AAAD,CAAC,AAvBD,CAA0C,gBAAM,GAuB/C"}
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
export interface ShiftsResponse {
|
|
2
|
-
success: boolean;
|
|
3
|
-
shift_schedules: ShiftSchedule[];
|
|
4
|
-
custom: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface BreaksResponse {
|
|
7
|
-
success: boolean;
|
|
8
|
-
scheduled_breaks: ShiftSchedule[];
|
|
9
|
-
custom: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface ShiftSchedule {
|
|
12
|
-
id: number;
|
|
13
|
-
user_id: number;
|
|
14
|
-
merchant_id: number;
|
|
15
|
-
created_at: Date;
|
|
16
|
-
updated_at: Date;
|
|
17
|
-
start_hour: number;
|
|
18
|
-
end_hour: number;
|
|
19
|
-
team_id: number;
|
|
20
|
-
}
|
|
21
|
-
export interface ShiftsUpdateRequest {
|
|
22
|
-
id: number;
|
|
23
|
-
configuration: ShiftsConfiguration[];
|
|
24
|
-
}
|
|
25
|
-
export interface ShiftsConfiguration {
|
|
26
|
-
start_hour: number;
|
|
27
|
-
end_hour: number;
|
|
28
|
-
}
|
|
29
1
|
export interface StartShiftResponse {
|
|
30
2
|
active_team_id: number;
|
|
31
3
|
end_shift: Date;
|
|
@@ -33,4 +5,3 @@ export interface StartShiftResponse {
|
|
|
33
5
|
start_shift: Date;
|
|
34
6
|
unavailable_start_time: Date;
|
|
35
7
|
}
|
|
36
|
-
export {};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import Session from '../Services/Identity/Session';
|
|
2
|
-
import {
|
|
2
|
+
import { StartShiftResponse } from './Shifts.consts';
|
|
3
3
|
export default class ShiftsApi {
|
|
4
4
|
private shiftsEntity;
|
|
5
5
|
constructor(session: Session);
|
|
6
|
-
getShifts(teamId: number): Promise<ShiftsResponse>;
|
|
7
|
-
updateShifts(teamId: number, configuration: ShiftsConfiguration[]): Promise<ShiftsResponse>;
|
|
8
|
-
getBreaks(teamId: number): Promise<BreaksResponse>;
|
|
9
|
-
updateBreaks(teamId: number, configuration: ShiftsConfiguration[]): Promise<BreaksResponse>;
|
|
10
6
|
startShift(userId: number, teamId?: number): Promise<StartShiftResponse>;
|
|
11
7
|
endShift(userId: number): Promise<boolean>;
|
|
12
8
|
}
|
package/dist/Shifts/ShiftsApi.js
CHANGED
|
@@ -8,18 +8,6 @@ var ShiftsApi = /** @class */ (function () {
|
|
|
8
8
|
function ShiftsApi(session) {
|
|
9
9
|
this.shiftsEntity = new Shifts_1.default(session);
|
|
10
10
|
}
|
|
11
|
-
ShiftsApi.prototype.getShifts = function (teamId) {
|
|
12
|
-
return this.shiftsEntity.getShifts(teamId);
|
|
13
|
-
};
|
|
14
|
-
ShiftsApi.prototype.updateShifts = function (teamId, configuration) {
|
|
15
|
-
return this.shiftsEntity.updateShifts(teamId, configuration);
|
|
16
|
-
};
|
|
17
|
-
ShiftsApi.prototype.getBreaks = function (teamId) {
|
|
18
|
-
return this.shiftsEntity.getBreaks(teamId);
|
|
19
|
-
};
|
|
20
|
-
ShiftsApi.prototype.updateBreaks = function (teamId, configuration) {
|
|
21
|
-
return this.shiftsEntity.updateBreaks(teamId, configuration);
|
|
22
|
-
};
|
|
23
11
|
ShiftsApi.prototype.startShift = function (userId, teamId) {
|
|
24
12
|
return this.shiftsEntity.startShift(userId, teamId);
|
|
25
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShiftsApi.js","sourceRoot":"","sources":["../../src/Shifts/ShiftsApi.ts"],"names":[],"mappings":";;;;;AACA,2DAAqC;AAGrC;IAGC,mBAAY,OAAgB;QAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,gBAAM,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,
|
|
1
|
+
{"version":3,"file":"ShiftsApi.js","sourceRoot":"","sources":["../../src/Shifts/ShiftsApi.ts"],"names":[],"mappings":";;;;;AACA,2DAAqC;AAGrC;IAGC,mBAAY,OAAgB;QAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,gBAAM,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,8BAAU,GAAjB,UAAkB,MAAc,EAAE,MAAe;QAChD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAEM,4BAAQ,GAAf,UAAgB,MAAc;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IACF,gBAAC;AAAD,CAAC,AAdD,IAcC"}
|
|
@@ -22381,13 +22381,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
22381
22381
|
};
|
|
22382
22382
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
22383
22383
|
var Entity_1 = __importStar(__webpack_require__(7483));
|
|
22384
|
+
var ENTITY_NAME = 'services_setup';
|
|
22384
22385
|
var ServiceEntity = /** @class */ (function (_super) {
|
|
22385
22386
|
__extends(ServiceEntity, _super);
|
|
22386
22387
|
function ServiceEntity(session) {
|
|
22387
22388
|
return _super.call(this, {
|
|
22388
22389
|
session: session,
|
|
22389
|
-
entityName:
|
|
22390
|
-
routes: [Entity_1.BaseRoutes.GetAll]
|
|
22390
|
+
entityName: ENTITY_NAME,
|
|
22391
|
+
routes: [Entity_1.BaseRoutes.GetAll, Entity_1.BaseRoutes.Create, Entity_1.BaseRoutes.Delete]
|
|
22391
22392
|
}) || this;
|
|
22392
22393
|
}
|
|
22393
22394
|
ServiceEntity.prototype.getAll = function () {
|
|
@@ -22400,6 +22401,37 @@ var ServiceEntity = /** @class */ (function (_super) {
|
|
|
22400
22401
|
});
|
|
22401
22402
|
});
|
|
22402
22403
|
};
|
|
22404
|
+
ServiceEntity.prototype.create = function (params) {
|
|
22405
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22406
|
+
var _a;
|
|
22407
|
+
return __generator(this, function (_b) {
|
|
22408
|
+
switch (_b.label) {
|
|
22409
|
+
case 0: return [4 /*yield*/, this.service.create((_a = {}, _a[ENTITY_NAME] = params, _a))];
|
|
22410
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
22411
|
+
}
|
|
22412
|
+
});
|
|
22413
|
+
});
|
|
22414
|
+
};
|
|
22415
|
+
ServiceEntity.prototype.delete = function (id) {
|
|
22416
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22417
|
+
return __generator(this, function (_a) {
|
|
22418
|
+
switch (_a.label) {
|
|
22419
|
+
case 0: return [4 /*yield*/, this.service.delete(id)];
|
|
22420
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
22421
|
+
}
|
|
22422
|
+
});
|
|
22423
|
+
});
|
|
22424
|
+
};
|
|
22425
|
+
ServiceEntity.prototype.listActions = function () {
|
|
22426
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22427
|
+
return __generator(this, function (_a) {
|
|
22428
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
22429
|
+
.get("/".concat(ENTITY_NAME, "/list"))
|
|
22430
|
+
.setException('failed to get services setup actions')
|
|
22431
|
+
.invoke()];
|
|
22432
|
+
});
|
|
22433
|
+
});
|
|
22434
|
+
};
|
|
22403
22435
|
return ServiceEntity;
|
|
22404
22436
|
}(Entity_1.default));
|
|
22405
22437
|
exports["default"] = ServiceEntity;
|
|
@@ -22457,6 +22489,7 @@ var ServiceApi = /** @class */ (function () {
|
|
|
22457
22489
|
function ServiceApi(session) {
|
|
22458
22490
|
this.entity = new ServiceEntity_1.default(session);
|
|
22459
22491
|
}
|
|
22492
|
+
/** Every services API key configured for the merchant. */
|
|
22460
22493
|
ServiceApi.prototype.getAll = function () {
|
|
22461
22494
|
return __awaiter(this, void 0, void 0, function () {
|
|
22462
22495
|
return __generator(this, function (_a) {
|
|
@@ -22467,6 +22500,39 @@ var ServiceApi = /** @class */ (function () {
|
|
|
22467
22500
|
});
|
|
22468
22501
|
});
|
|
22469
22502
|
};
|
|
22503
|
+
/** Mints a key for one endpoint. An unknown tag name creates a merchant tag. */
|
|
22504
|
+
ServiceApi.prototype.create = function (params) {
|
|
22505
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22506
|
+
return __generator(this, function (_a) {
|
|
22507
|
+
switch (_a.label) {
|
|
22508
|
+
case 0: return [4 /*yield*/, this.entity.create(params)];
|
|
22509
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
22510
|
+
}
|
|
22511
|
+
});
|
|
22512
|
+
});
|
|
22513
|
+
};
|
|
22514
|
+
/** Trashes a key. Requests using its URL fail from then on. */
|
|
22515
|
+
ServiceApi.prototype.delete = function (id) {
|
|
22516
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22517
|
+
return __generator(this, function (_a) {
|
|
22518
|
+
switch (_a.label) {
|
|
22519
|
+
case 0: return [4 /*yield*/, this.entity.delete(id)];
|
|
22520
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
22521
|
+
}
|
|
22522
|
+
});
|
|
22523
|
+
});
|
|
22524
|
+
};
|
|
22525
|
+
/** The endpoints this merchant may create a key for, public plus its allowed private ones. */
|
|
22526
|
+
ServiceApi.prototype.listActions = function () {
|
|
22527
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22528
|
+
return __generator(this, function (_a) {
|
|
22529
|
+
switch (_a.label) {
|
|
22530
|
+
case 0: return [4 /*yield*/, this.entity.listActions()];
|
|
22531
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
22532
|
+
}
|
|
22533
|
+
});
|
|
22534
|
+
});
|
|
22535
|
+
};
|
|
22470
22536
|
return ServiceApi;
|
|
22471
22537
|
}());
|
|
22472
22538
|
exports["default"] = ServiceApi;
|
|
@@ -22474,6 +22540,16 @@ exports["default"] = ServiceApi;
|
|
|
22474
22540
|
|
|
22475
22541
|
/***/ }),
|
|
22476
22542
|
|
|
22543
|
+
/***/ 60653:
|
|
22544
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
22545
|
+
|
|
22546
|
+
"use strict";
|
|
22547
|
+
|
|
22548
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
22549
|
+
//# sourceMappingURL=Services.consts.js.map
|
|
22550
|
+
|
|
22551
|
+
/***/ }),
|
|
22552
|
+
|
|
22477
22553
|
/***/ 73746:
|
|
22478
22554
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
22479
22555
|
|
|
@@ -24708,7 +24784,7 @@ var BringgException_1 = __webpack_require__(43605);
|
|
|
24708
24784
|
var client_page_1 = __webpack_require__(16573);
|
|
24709
24785
|
var Logger_1 = __importDefault(__webpack_require__(55860));
|
|
24710
24786
|
var abort_1 = __webpack_require__(34179);
|
|
24711
|
-
var version = '9.
|
|
24787
|
+
var version = '9.90.0-pre.0';
|
|
24712
24788
|
function logErrorResponse(response) {
|
|
24713
24789
|
var data = response.data, status = response.status;
|
|
24714
24790
|
try {
|
|
@@ -25114,52 +25190,6 @@ var ShiftsEntity = /** @class */ (function (_super) {
|
|
|
25114
25190
|
function ShiftsEntity(session) {
|
|
25115
25191
|
return _super.call(this, { session: session, entityName: 'shifts' }) || this;
|
|
25116
25192
|
}
|
|
25117
|
-
ShiftsEntity.prototype.getShifts = function (teamId) {
|
|
25118
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25119
|
-
return __generator(this, function (_a) {
|
|
25120
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
25121
|
-
.get("/teams/".concat(teamId, "/shifts_schedule/"))
|
|
25122
|
-
.setException('Failed to get shifts schedule')
|
|
25123
|
-
.invoke()];
|
|
25124
|
-
});
|
|
25125
|
-
});
|
|
25126
|
-
};
|
|
25127
|
-
ShiftsEntity.prototype.updateShifts = function (teamId, configuration) {
|
|
25128
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25129
|
-
var request;
|
|
25130
|
-
return __generator(this, function (_a) {
|
|
25131
|
-
request = { id: teamId, configuration: configuration };
|
|
25132
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
25133
|
-
.put("/teams/".concat(teamId, "/shifts_schedule"))
|
|
25134
|
-
.withPayload(request)
|
|
25135
|
-
.setException('Failed update shifts schedule')
|
|
25136
|
-
.invoke()];
|
|
25137
|
-
});
|
|
25138
|
-
});
|
|
25139
|
-
};
|
|
25140
|
-
ShiftsEntity.prototype.getBreaks = function (teamId) {
|
|
25141
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25142
|
-
return __generator(this, function (_a) {
|
|
25143
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
25144
|
-
.get("/teams/".concat(teamId, "/scheduled_breaks/"))
|
|
25145
|
-
.setException('Failed to get shifts breaks')
|
|
25146
|
-
.invoke()];
|
|
25147
|
-
});
|
|
25148
|
-
});
|
|
25149
|
-
};
|
|
25150
|
-
ShiftsEntity.prototype.updateBreaks = function (teamId, configuration) {
|
|
25151
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25152
|
-
var request;
|
|
25153
|
-
return __generator(this, function (_a) {
|
|
25154
|
-
request = { id: teamId, configuration: configuration };
|
|
25155
|
-
return [2 /*return*/, this.service.routeGenerator
|
|
25156
|
-
.put("/teams/".concat(teamId, "/scheduled_breaks"))
|
|
25157
|
-
.withPayload(request)
|
|
25158
|
-
.setException('Failed update shift breaks')
|
|
25159
|
-
.invoke()];
|
|
25160
|
-
});
|
|
25161
|
-
});
|
|
25162
|
-
};
|
|
25163
25193
|
ShiftsEntity.prototype.startShift = function (userId, teamId) {
|
|
25164
25194
|
return __awaiter(this, void 0, void 0, function () {
|
|
25165
25195
|
return __generator(this, function (_a) {
|
|
@@ -25206,18 +25236,6 @@ var ShiftsApi = /** @class */ (function () {
|
|
|
25206
25236
|
function ShiftsApi(session) {
|
|
25207
25237
|
this.shiftsEntity = new Shifts_1.default(session);
|
|
25208
25238
|
}
|
|
25209
|
-
ShiftsApi.prototype.getShifts = function (teamId) {
|
|
25210
|
-
return this.shiftsEntity.getShifts(teamId);
|
|
25211
|
-
};
|
|
25212
|
-
ShiftsApi.prototype.updateShifts = function (teamId, configuration) {
|
|
25213
|
-
return this.shiftsEntity.updateShifts(teamId, configuration);
|
|
25214
|
-
};
|
|
25215
|
-
ShiftsApi.prototype.getBreaks = function (teamId) {
|
|
25216
|
-
return this.shiftsEntity.getBreaks(teamId);
|
|
25217
|
-
};
|
|
25218
|
-
ShiftsApi.prototype.updateBreaks = function (teamId, configuration) {
|
|
25219
|
-
return this.shiftsEntity.updateBreaks(teamId, configuration);
|
|
25220
|
-
};
|
|
25221
25239
|
ShiftsApi.prototype.startShift = function (userId, teamId) {
|
|
25222
25240
|
return this.shiftsEntity.startShift(userId, teamId);
|
|
25223
25241
|
};
|
|
@@ -36680,7 +36698,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36680
36698
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36681
36699
|
};
|
|
36682
36700
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36683
|
-
exports.WorkflowsApi = exports.VehicleTypeConsts = exports.VehicleCategoryConsts = exports.VehicleGroup = exports.VehiclesApi = exports.AbortUtils = exports.UsersApi = exports.UserGroupValues = exports.UserGroupTypes = exports.UploadApi = exports.UploadConsts = exports.TasksExplorerApi = exports.TaskRejectReasonsApi = exports.TaskInventoryConsts = exports.TasksApi = exports.TaskGroupValues = exports.TaskGroupTypes = exports.TagConsts = exports.ServiceAreaApi = exports.ServiceAreaFilterGroups = exports.RunsApi = exports.RunStatus = exports.RunConsts = exports.ResourceUploadType = exports.ReasonToChangeInventory = exports.PrivilegesConsts = exports.PlannedRoutesConsts = exports.PlannedDeliveryWindowsApi = exports.RecurrenceType = exports.PlannedDeliveryWindowsFilterGroups = exports.OptimizationResultApi = exports.NotificationTypesConsts = exports.NotificationTemplateConsts = exports.LookupConsts = exports.LanguageConsts = exports.ExclusionWindowApiV2 = exports.ExclusionWindowsFilterGroups = exports.DeliveryWindowsApi = exports.DeliveryBlockConsts = exports.CrewConsts = exports.Responses = exports.clientPageFromLocation = exports.CLIENT_PAGE_HEADER = exports.ChatMessageConsts = exports.ChatConversationConsts = void 0;
|
|
36701
|
+
exports.WorkflowsApi = exports.VehicleTypeConsts = exports.VehicleCategoryConsts = exports.VehicleGroup = exports.VehiclesApi = exports.AbortUtils = exports.UsersApi = exports.UserGroupValues = exports.UserGroupTypes = exports.UploadApi = exports.UploadConsts = exports.TasksExplorerApi = exports.TaskRejectReasonsApi = exports.TaskInventoryConsts = exports.TasksApi = exports.TaskGroupValues = exports.TaskGroupTypes = exports.TagConsts = exports.ServiceAreaApi = exports.ServiceAreaFilterGroups = exports.ServicesSetupConsts = exports.RunsApi = exports.RunStatus = exports.RunConsts = exports.ResourceUploadType = exports.ReasonToChangeInventory = exports.PrivilegesConsts = exports.PlannedRoutesConsts = exports.PlannedDeliveryWindowsApi = exports.RecurrenceType = exports.PlannedDeliveryWindowsFilterGroups = exports.OptimizationResultApi = exports.NotificationTypesConsts = exports.NotificationTemplateConsts = exports.LookupConsts = exports.LanguageConsts = exports.ExclusionWindowApiV2 = exports.ExclusionWindowsFilterGroups = exports.DeliveryWindowsApi = exports.DeliveryBlockConsts = exports.CrewConsts = exports.Responses = exports.clientPageFromLocation = exports.CLIENT_PAGE_HEADER = exports.ChatMessageConsts = exports.ChatConversationConsts = void 0;
|
|
36684
36702
|
__exportStar(__webpack_require__(82661), exports);
|
|
36685
36703
|
__exportStar(__webpack_require__(37360), exports);
|
|
36686
36704
|
__exportStar(__webpack_require__(5655), exports);
|
|
@@ -36720,6 +36738,7 @@ var runs_consts_1 = __webpack_require__(4669);
|
|
|
36720
36738
|
Object.defineProperty(exports, "RunStatus", ({ enumerable: true, get: function () { return runs_consts_1.RunStatus; } }));
|
|
36721
36739
|
var runs_api_1 = __webpack_require__(83582);
|
|
36722
36740
|
Object.defineProperty(exports, "RunsApi", ({ enumerable: true, get: function () { return __importDefault(runs_api_1).default; } }));
|
|
36741
|
+
exports.ServicesSetupConsts = __importStar(__webpack_require__(60653));
|
|
36723
36742
|
var service_area_consts_1 = __webpack_require__(16410);
|
|
36724
36743
|
Object.defineProperty(exports, "ServiceAreaFilterGroups", ({ enumerable: true, get: function () { return service_area_consts_1.ServiceAreaFilterGroups; } }));
|
|
36725
36744
|
var service_area_api_1 = __webpack_require__(35248);
|