@movalib/movalib-commons 1.1.83 → 1.1.85

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/index.d.ts CHANGED
@@ -42,7 +42,7 @@ export type { APIRequest, APIResponse } from './src/helpers/ApiHelper';
42
42
  export type { DaySchedule, DayInterval } from './src/ScheduleFields';
43
43
  export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval, MovaVehicleForm, AddressFieldName } from './src/helpers/Types';
44
44
  export { readCookie, deleteCookie } from './src/helpers/CookieUtils';
45
- export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel, capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals, findScheduleByDayOfWeek, getDayOfWeekLabel } from './src/helpers/Tools';
45
+ export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel, capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals, findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS } from './src/helpers/Tools';
46
46
  export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
47
47
  export { formatDateByCountryCode, getLongFormattedDateTime } from './src/helpers/DateUtils';
48
48
  export { request } from './src/helpers/ApiHelper';
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.formatPhoneNumber = exports.flexLeftRow = exports.capitalizeFirstLetter = exports.getApplicationShortLabel = exports.isEmpty = exports.formatFrenchVehiclePlate = exports.formatVehicleTire = exports.validateField = exports.deleteCookie = exports.readCookie = exports.VehicleTire = exports.Event = exports.Schedule = exports.Garage = exports.Document = exports.Vehicle = exports.Address = exports.Role = exports.User = exports.Customer = exports.Logger = exports.Operation = exports.Prestation = exports.Product = exports.Supplier = exports.Employee = exports.Absence = exports.GenderSelector = exports.ConfirmationDialog = exports.MovaVehicleTireField = exports.MovaCopyright = exports.MovaSignUp = exports.MovaLogin = exports.MovaSnackbar = exports.TestButton = exports.VehiclePlateField = exports.QRCode = exports.MovaDialog = exports.Loader = exports.MovaDigitalPassport = exports.VehicleFullCard = exports.ScheduleFields = exports.AddressFields = exports.AccountValidation = exports.GaragePLV = exports.IbanInput = exports.UserService = exports.GarageService = exports.AuthenticationService = exports.VehicleService = void 0;
8
- exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = void 0;
8
+ exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = void 0;
9
9
  // Export des services
10
10
  var VehicleService_1 = require("./src/services/VehicleService");
11
11
  Object.defineProperty(exports, "VehicleService", { enumerable: true, get: function () { return __importDefault(VehicleService_1).default; } });
@@ -106,6 +106,7 @@ Object.defineProperty(exports, "getFormattedSchedule", { enumerable: true, get:
106
106
  Object.defineProperty(exports, "getFormattedIntervals", { enumerable: true, get: function () { return Tools_1.getFormattedIntervals; } });
107
107
  Object.defineProperty(exports, "findScheduleByDayOfWeek", { enumerable: true, get: function () { return Tools_1.findScheduleByDayOfWeek; } });
108
108
  Object.defineProperty(exports, "getDayOfWeekLabel", { enumerable: true, get: function () { return Tools_1.getDayOfWeekLabel; } });
109
+ Object.defineProperty(exports, "isSafariOniOS", { enumerable: true, get: function () { return Tools_1.isSafariOniOS; } });
109
110
  var Validator_1 = require("./src/helpers/Validator");
110
111
  Object.defineProperty(exports, "validatePhoneNumber", { enumerable: true, get: function () { return Validator_1.validatePhoneNumber; } });
111
112
  Object.defineProperty(exports, "validateText", { enumerable: true, get: function () { return Validator_1.validateText; } });
@@ -3,6 +3,7 @@ import { MovaFormField, MovaInterval } from "./Types";
3
3
  import { CSSProperties } from "react";
4
4
  import { DayOfWeek, PartsApplicationType } from "./Enums";
5
5
  import Schedule from "../models/Schedule";
6
+ export declare const isSafariOniOS: () => boolean;
6
7
  export declare const FR_WEEK_DAYS: string[];
7
8
  export declare const getDayOfWeekLabel: (day: DayOfWeek) => string | undefined;
8
9
  export declare const getDayOfWeekIndex: (day: DayOfWeek) => number;
@@ -1,7 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateField = exports.formatVehicleTireStr = exports.formatVehicleTire = exports.formatFrenchVehiclePlate = exports.isEmpty = exports.flexCenter = exports.flexEnd = exports.getApplicationShortLabel = exports.capitalizeFirstLetter = exports.flexLeftRow = exports.getFrenchDayLabel = exports.getDayOfWeek = exports.findScheduleByDayOfWeek = exports.formatTime = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.getDayOfWeekIndex = exports.getDayOfWeekLabel = exports.FR_WEEK_DAYS = void 0;
3
+ exports.validateField = exports.formatVehicleTireStr = exports.formatVehicleTire = exports.formatFrenchVehiclePlate = exports.isEmpty = exports.flexCenter = exports.flexEnd = exports.getApplicationShortLabel = exports.capitalizeFirstLetter = exports.flexLeftRow = exports.getFrenchDayLabel = exports.getDayOfWeek = exports.findScheduleByDayOfWeek = exports.formatTime = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.getDayOfWeekIndex = exports.getDayOfWeekLabel = exports.FR_WEEK_DAYS = exports.isSafariOniOS = void 0;
4
4
  var Enums_1 = require("./Enums");
5
+ var isSafariOniOS = function () {
6
+ var userAgent = window.navigator.userAgent;
7
+ var iOS = !!userAgent.match(/iPad/i) || !!userAgent.match(/iPhone/i) || !!userAgent.match(/iPod/i);
8
+ var webkit = !!userAgent.match(/WebKit/i);
9
+ var criOS = !!userAgent.match(/CriOS/i);
10
+ return iOS && webkit && !criOS;
11
+ };
12
+ exports.isSafariOniOS = isSafariOniOS;
5
13
  exports.FR_WEEK_DAYS = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'];
6
14
  var getDayOfWeekLabel = function (day) {
7
15
  if (day) {
@@ -2,6 +2,7 @@ import { APIResponse } from "../helpers/ApiHelper";
2
2
  import Employee from "../models/Employee";
3
3
  import Garage from "../models/Garage";
4
4
  export default class GarageService {
5
+ static updateGaragePrestation(garageId: string, prestationId: string, req: any): Promise<APIResponse<string>>;
5
6
  static deleteGarageEmployeePrestationType(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
6
7
  static createGarageEmployeePrestationType(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
7
8
  static deleteGarageEmployeeAbsence(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>>;
@@ -5,6 +5,14 @@ var Enums_1 = require("../helpers/Enums");
5
5
  var GarageService = /** @class */ (function () {
6
6
  function GarageService() {
7
7
  }
8
+ GarageService.updateGaragePrestation = function (garageId, prestationId, req) {
9
+ return (0, ApiHelper_1.request)({
10
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/prestations/").concat(prestationId),
11
+ method: Enums_1.APIMethod.PATCH,
12
+ appType: Enums_1.MovaAppType.GARAGE,
13
+ body: JSON.stringify(req)
14
+ });
15
+ };
8
16
  GarageService.deleteGarageEmployeePrestationType = function (garageId, employeeId, req) {
9
17
  return (0, ApiHelper_1.request)({
10
18
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/employees/").concat(employeeId, "/prestations-type"),
package/index.ts CHANGED
@@ -55,7 +55,8 @@ export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval,
55
55
  // Export des méthodes utilitaires
56
56
  export { readCookie, deleteCookie } from './src/helpers/CookieUtils';
57
57
  export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel,
58
- capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals, findScheduleByDayOfWeek, getDayOfWeekLabel } from './src/helpers/Tools';
58
+ capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals,
59
+ findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS } from './src/helpers/Tools';
59
60
  export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
60
61
  export { formatDateByCountryCode, getLongFormattedDateTime } from './src/helpers/DateUtils';
61
62
  export { request } from './src/helpers/ApiHelper';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.1.83",
3
+ "version": "1.1.85",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/public/index.html CHANGED
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="fr">
3
3
  <head>
4
4
  <title>Movalib Commons</title>
5
5
  <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap" rel="stylesheet">
@@ -5,6 +5,16 @@ import { CSSProperties } from "react";
5
5
  import { DayOfWeek, PartsApplicationType, VehiclePlateFormat } from "./Enums";
6
6
  import Schedule from "../models/Schedule";
7
7
 
8
+ export const isSafariOniOS = ():boolean => {
9
+ const userAgent = window.navigator.userAgent;
10
+ const iOS = !!userAgent.match(/iPad/i) || !!userAgent.match(/iPhone/i) || !!userAgent.match(/iPod/i);
11
+ const webkit = !!userAgent.match(/WebKit/i);
12
+ const criOS = !!userAgent.match(/CriOS/i);
13
+
14
+ return iOS && webkit && !criOS;
15
+ }
16
+
17
+
8
18
  export const FR_WEEK_DAYS: string[] = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'];
9
19
 
10
20
  export const getDayOfWeekLabel = (day: DayOfWeek) => {
@@ -5,6 +5,15 @@ import Garage from "../models/Garage";
5
5
 
6
6
  export default class GarageService {
7
7
 
8
+ static updateGaragePrestation(garageId: string, prestationId: string, req: any): Promise<APIResponse<string>> {
9
+ return request({
10
+ url: `${API_BASE_URL}/garage/${garageId}/prestations/${prestationId}`,
11
+ method: APIMethod.PATCH,
12
+ appType: MovaAppType.GARAGE,
13
+ body: JSON.stringify(req)
14
+ });
15
+ }
16
+
8
17
  static deleteGarageEmployeePrestationType(garageId: string, employeeId: string, req: any): Promise<APIResponse<string>> {
9
18
  return request({
10
19
  url: `${API_BASE_URL}/garage/${garageId}/employees/${employeeId}/prestations-type`,