@movalib/movalib-commons 1.68.27 → 1.68.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.
|
@@ -72,9 +72,15 @@ var request = function (options) {
|
|
|
72
72
|
}
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
|
+
if (options.headers) {
|
|
76
|
+
Object.entries(options.headers).forEach(function (_a) {
|
|
77
|
+
var key = _a[0], value = _a[1];
|
|
78
|
+
headers.set(key, value);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
75
81
|
// On intègre les headers aux options
|
|
76
82
|
var defaults = { headers: headers };
|
|
77
|
-
options = Object.assign({}, defaults, options);
|
|
83
|
+
options = Object.assign({}, defaults, options, { headers: headers });
|
|
78
84
|
Logger_1.default.info(options);
|
|
79
85
|
// Appel API
|
|
80
86
|
return fetch(options.url, options)
|
|
@@ -107,7 +107,8 @@ export default class Event {
|
|
|
107
107
|
quoteFirstSendingTime?: Date;
|
|
108
108
|
lastQuoteCreationDate?: Date;
|
|
109
109
|
urgent?: boolean;
|
|
110
|
-
|
|
110
|
+
schedulable?: boolean;
|
|
111
|
+
constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date, quoteLastSendingTime?: Date, invoiceSendingDate?: Date, orders?: Order[], creationDate?: Date, updatedDate?: Date, lastQuoteCreationDate?: Date, quoteFirstSendingTime?: Date, urgent?: boolean, garageVehicleBookings?: LoanVehicle[], goodForAgreement?: boolean, schedulable?: boolean);
|
|
111
112
|
static getPrestationsList(event: Event): string[];
|
|
112
113
|
static getCurrentQuote(event: Event): Document | null;
|
|
113
114
|
}
|
package/dist/src/models/Event.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Enums_1 = require("../helpers/Enums");
|
|
4
4
|
var Event = /** @class */ (function () {
|
|
5
|
-
function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime, urgent, garageVehicleBookings, goodForAgreement) {
|
|
5
|
+
function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime, urgent, garageVehicleBookings, goodForAgreement, schedulable) {
|
|
6
6
|
this.id = id;
|
|
7
7
|
this.notes = notes;
|
|
8
8
|
this.ownerId = ownerId;
|
|
@@ -50,6 +50,7 @@ var Event = /** @class */ (function () {
|
|
|
50
50
|
this.urgent = urgent;
|
|
51
51
|
this.garageVehicleBookings = garageVehicleBookings;
|
|
52
52
|
this.goodForAgreement = goodForAgreement;
|
|
53
|
+
this.schedulable = schedulable;
|
|
53
54
|
}
|
|
54
55
|
Event.getPrestationsList = function (event) {
|
|
55
56
|
if (event && event.prestations) {
|
package/package.json
CHANGED
package/src/helpers/ApiHelper.ts
CHANGED
|
@@ -28,7 +28,8 @@ export type APIRequest = {
|
|
|
28
28
|
url: string,
|
|
29
29
|
method: APIMethod,
|
|
30
30
|
appType?: MovaAppType,
|
|
31
|
-
body?: string | FormData
|
|
31
|
+
body?: string | FormData,
|
|
32
|
+
headers?: any,
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
function handleError(error: Error): APIResponse<null> {
|
|
@@ -107,9 +108,16 @@ export const request = (options:APIRequest): Promise<APIResponse<any>> => {
|
|
|
107
108
|
break;
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
if (options.headers) {
|
|
112
|
+
Object.entries(options.headers).forEach(([key, value]) => {
|
|
113
|
+
headers.set(key, value as string);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
110
117
|
// On intègre les headers aux options
|
|
111
|
-
const defaults = {headers: headers};
|
|
112
|
-
options = Object.assign({}, defaults, options);
|
|
118
|
+
const defaults = { headers: headers };
|
|
119
|
+
options = Object.assign({}, defaults, options, { headers: headers });
|
|
120
|
+
|
|
113
121
|
|
|
114
122
|
Logger.info(options);
|
|
115
123
|
|
package/src/models/Event.ts
CHANGED
|
@@ -122,6 +122,7 @@ export default class Event {
|
|
|
122
122
|
quoteFirstSendingTime?: Date;
|
|
123
123
|
lastQuoteCreationDate?: Date;
|
|
124
124
|
urgent?: boolean;
|
|
125
|
+
schedulable?:boolean;
|
|
125
126
|
constructor(
|
|
126
127
|
id: string,
|
|
127
128
|
ownerId: number,
|
|
@@ -158,6 +159,7 @@ export default class Event {
|
|
|
158
159
|
urgent?: boolean,
|
|
159
160
|
garageVehicleBookings?: LoanVehicle[],
|
|
160
161
|
goodForAgreement?:boolean,
|
|
162
|
+
schedulable?:boolean
|
|
161
163
|
) {
|
|
162
164
|
this.id = id;
|
|
163
165
|
this.notes = notes;
|
|
@@ -207,6 +209,7 @@ export default class Event {
|
|
|
207
209
|
this.urgent = urgent;
|
|
208
210
|
this.garageVehicleBookings = garageVehicleBookings;
|
|
209
211
|
this.goodForAgreement = goodForAgreement;
|
|
212
|
+
this.schedulable = schedulable;
|
|
210
213
|
}
|
|
211
214
|
|
|
212
215
|
static getPrestationsList(event: Event): string[] {
|