@studio-west/employees 0.5.24 → 0.5.25

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.
@@ -1,5 +1,5 @@
1
1
  import u from "js-cookie";
2
- function g(t, e) {
2
+ function h(t, e) {
3
3
  if (arguments.length === 0 || !t)
4
4
  return null;
5
5
  const o = e || "{Y}-{m}-{d} {G}:{i}:{s}";
@@ -18,17 +18,21 @@ function g(t, e) {
18
18
  F: new Intl.DateTimeFormat(a, { month: "long" }).format(r),
19
19
  M: new Intl.DateTimeFormat(a, { month: "short" }).format(r)
20
20
  };
21
- return o.replace(/{(dd|[YmdGHisDFM])+}/g, (f, c) => l[c]);
21
+ return o.replace(/{(dd|[YmdGHisDFM])+}/g, (p, c) => l[c]);
22
22
  }
23
- function h(t, e) {
23
+ function g(t) {
24
+ let e = t.split(t.match(/\D.*?\D?/));
25
+ return e[0].length > 2 ? e.join("-") + "T00:00:01" : e.reverse().join("-") + "T00:00:01";
26
+ }
27
+ function m(t, e) {
24
28
  let r = t.replace(/[0-9]/g, "").split("").reverse().map((a) => a.charCodeAt(0));
25
29
  return s(r, e, 0), r.map((a) => String.fromCharCode(a)).reverse().join("");
26
30
  }
27
- function m(t) {
31
+ function y(t) {
28
32
  return t.split(" ", 3).map((e, o) => o !== 0 ? e.slice(0, 1) + "." : e).join(" ");
29
33
  }
30
34
  let n = {};
31
- async function y() {
35
+ async function d() {
32
36
  if (n != null && n.holidays) return n;
33
37
  try {
34
38
  const t = await fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday", {
@@ -39,7 +43,7 @@ async function y() {
39
43
  headers: {
40
44
  "Content-Type": "application/json",
41
45
  Accept: "text/html",
42
- "X-Token": p(),
46
+ "X-Token": i(),
43
47
  // Предполагается, что эта функция определена где-то в коде
44
48
  "Cache-Control": "no-cache"
45
49
  },
@@ -194,10 +198,11 @@ function s(t, e, o) {
194
198
  t[o] = (t[o] - 65 + e) % 26 + 65, s(t, r, o + 1);
195
199
  }
196
200
  }
197
- const p = () => u.get("X-Token") || !1;
201
+ const i = () => u.get("X-Token") || !1;
198
202
  export {
199
- m as b,
200
- h as c,
201
- y as h,
202
- g as p
203
+ g as a,
204
+ y as b,
205
+ m as c,
206
+ d as h,
207
+ h as p
203
208
  };
@@ -1 +1 @@
1
- "use strict";const i=require("js-cookie");function u(t,e){if(arguments.length===0||!t)return null;const o=e||"{Y}-{m}-{d} {G}:{i}:{s}";let r;typeof t=="object"?r=t:(typeof t=="string"&&(/^[0-9]+$/.test(t)?t=parseInt(t):t=t.replace(new RegExp(/-/gm),"/")),typeof t=="number"&&t.toString().length===10&&(t=t*1e3),r=new Date(t));const a="ru-RU",l={Y:r.getFullYear(),m:(r.getMonth()+1).toString().padStart(2,"0"),d:r.getDate(),dd:r.getDate().toString().padStart(2,"0"),G:r.getHours(),H:r.getHours().toString().padStart(2,"0"),i:r.getMinutes().toString().padStart(2,"0"),s:r.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(a,{weekday:"short"}).format(r),F:new Intl.DateTimeFormat(a,{month:"long"}).format(r),M:new Intl.DateTimeFormat(a,{month:"short"}).format(r)};return o.replace(/{(dd|[YmdGHisDFM])+}/g,(y,c)=>l[c])}function f(t,e){let r=t.replace(/[0-9]/g,"").split("").reverse().map(a=>a.charCodeAt(0));return s(r,e,0),r.map(a=>String.fromCharCode(a)).reverse().join("")}function p(t){return t.split(" ",3).map((e,o)=>o!==0?e.slice(0,1)+".":e).join(" ")}let n={};async function g(){if(n!=null&&n.holidays)return n;try{const t=await fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",{method:"GET",mode:"cors",cache:"default",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"text/html","X-Token":h(),"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"});if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);const e=await t.json();return e.result.holiday=["2024-01-01","2024-01-02","2024-01-03","2024-01-04","2024-01-05","2024-01-06","2024-01-07","2024-01-08","2024-02-23","2024-03-08","2024-05-01","2024-05-09","2024-06-12","2024-11-04","2025-01-01","2025-01-02","2025-01-03","2025-01-04","2025-01-05","2025-01-06","2025-01-07","2025-01-08","2025-02-23","2025-03-08","2025-05-01","2025-05-09","2025-06-12","2025-11-04","2026-01-01","2026-01-02","2026-01-03","2026-01-04","2026-01-05","2026-01-06","2026-01-07","2026-01-08","2026-02-23","2026-03-08","2026-05-01","2026-05-09","2026-06-12","2026-11-04","2027-01-01","2027-01-02","2027-01-03","2027-01-04","2027-01-05","2027-01-06","2027-01-07","2027-01-08","2027-02-23","2027-03-08","2027-05-01","2027-05-09","2027-06-12","2027-11-04","2024-05-14","2025-04-29","2026-04-21","2027-05-11","2028-04-25","2029-04-17","2030-05-07","2031-04-22","2032-05-11","2033-05-03","2034-04-18","2035-05-08","2036-04-29","2037-04-14","2038-05-04","2039-04-26","2040-05-15","2041-04-30","2042-04-22","2043-05-12","2044-05-03","2045-04-18","2046-05-08","2047-04-30"],e.result.holidays.push("2024-05-14","2025-04-29","2026-04-21","2027-05-11","2028-04-25","2029-04-17","2030-05-07","2031-04-22","2032-05-11","2033-05-03","2034-04-18","2035-05-08","2036-04-29","2037-04-14","2038-05-04","2039-04-26","2040-05-15","2041-04-30","2042-04-22","2043-05-12","2044-05-03","2045-04-18","2046-05-08","2047-04-30"),e.result.preholidays.push("2024-05-13","2025-04-28","2026-04-20","2027-05-10","2028-04-24","2029-04-16","2030-05-06","2031-04-21","2032-05-10","2033-05-02","2034-04-17","2035-05-07","2036-04-28","2037-04-13","2038-05-03","2039-04-25","2040-05-14","2041-04-29","2042-04-21","2043-05-11","2044-05-02","2045-04-17","2046-05-07","2047-04-29"),n=e.result,n}catch(t){throw console.error("Ошибка загрузки данных о праздниках:",t),t}}function s(t,e,o){if(typeof e!="number"||e<1)return!0;if(e=e-1,(typeof t[o]!="number"||t[o]<65)&&(t[o]=65),t[o]+e<=90)t[o]=t[o]+e;else{let r=Math.floor((t[o]-65+e)/26);t[o]=(t[o]-65+e)%26+65,s(t,r,o+1)}}const h=()=>i.get("X-Token")||!1;exports.byInitials=p;exports.cellsDynamically=f;exports.holidays=g;exports.parseTime=u;
1
+ "use strict";const i=require("js-cookie");function u(t,e){if(arguments.length===0||!t)return null;const o=e||"{Y}-{m}-{d} {G}:{i}:{s}";let r;typeof t=="object"?r=t:(typeof t=="string"&&(/^[0-9]+$/.test(t)?t=parseInt(t):t=t.replace(new RegExp(/-/gm),"/")),typeof t=="number"&&t.toString().length===10&&(t=t*1e3),r=new Date(t));const a="ru-RU",l={Y:r.getFullYear(),m:(r.getMonth()+1).toString().padStart(2,"0"),d:r.getDate(),dd:r.getDate().toString().padStart(2,"0"),G:r.getHours(),H:r.getHours().toString().padStart(2,"0"),i:r.getMinutes().toString().padStart(2,"0"),s:r.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(a,{weekday:"short"}).format(r),F:new Intl.DateTimeFormat(a,{month:"long"}).format(r),M:new Intl.DateTimeFormat(a,{month:"short"}).format(r)};return o.replace(/{(dd|[YmdGHisDFM])+}/g,(y,c)=>l[c])}function p(t){let e=t.split(t.match(/\D.*?\D?/));return e[0].length>2?e.join("-")+"T00:00:01":e.reverse().join("-")+"T00:00:01"}function f(t,e){let r=t.replace(/[0-9]/g,"").split("").reverse().map(a=>a.charCodeAt(0));return s(r,e,0),r.map(a=>String.fromCharCode(a)).reverse().join("")}function h(t){return t.split(" ",3).map((e,o)=>o!==0?e.slice(0,1)+".":e).join(" ")}let n={};async function g(){if(n!=null&&n.holidays)return n;try{const t=await fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",{method:"GET",mode:"cors",cache:"default",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"text/html","X-Token":m(),"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"});if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);const e=await t.json();return e.result.holiday=["2024-01-01","2024-01-02","2024-01-03","2024-01-04","2024-01-05","2024-01-06","2024-01-07","2024-01-08","2024-02-23","2024-03-08","2024-05-01","2024-05-09","2024-06-12","2024-11-04","2025-01-01","2025-01-02","2025-01-03","2025-01-04","2025-01-05","2025-01-06","2025-01-07","2025-01-08","2025-02-23","2025-03-08","2025-05-01","2025-05-09","2025-06-12","2025-11-04","2026-01-01","2026-01-02","2026-01-03","2026-01-04","2026-01-05","2026-01-06","2026-01-07","2026-01-08","2026-02-23","2026-03-08","2026-05-01","2026-05-09","2026-06-12","2026-11-04","2027-01-01","2027-01-02","2027-01-03","2027-01-04","2027-01-05","2027-01-06","2027-01-07","2027-01-08","2027-02-23","2027-03-08","2027-05-01","2027-05-09","2027-06-12","2027-11-04","2024-05-14","2025-04-29","2026-04-21","2027-05-11","2028-04-25","2029-04-17","2030-05-07","2031-04-22","2032-05-11","2033-05-03","2034-04-18","2035-05-08","2036-04-29","2037-04-14","2038-05-04","2039-04-26","2040-05-15","2041-04-30","2042-04-22","2043-05-12","2044-05-03","2045-04-18","2046-05-08","2047-04-30"],e.result.holidays.push("2024-05-14","2025-04-29","2026-04-21","2027-05-11","2028-04-25","2029-04-17","2030-05-07","2031-04-22","2032-05-11","2033-05-03","2034-04-18","2035-05-08","2036-04-29","2037-04-14","2038-05-04","2039-04-26","2040-05-15","2041-04-30","2042-04-22","2043-05-12","2044-05-03","2045-04-18","2046-05-08","2047-04-30"),e.result.preholidays.push("2024-05-13","2025-04-28","2026-04-20","2027-05-10","2028-04-24","2029-04-16","2030-05-06","2031-04-21","2032-05-10","2033-05-02","2034-04-17","2035-05-07","2036-04-28","2037-04-13","2038-05-03","2039-04-25","2040-05-14","2041-04-29","2042-04-21","2043-05-11","2044-05-02","2045-04-17","2046-05-07","2047-04-29"),n=e.result,n}catch(t){throw console.error("Ошибка загрузки данных о праздниках:",t),t}}function s(t,e,o){if(typeof e!="number"||e<1)return!0;if(e=e-1,(typeof t[o]!="number"||t[o]<65)&&(t[o]=65),t[o]+e<=90)t[o]=t[o]+e;else{let r=Math.floor((t[o]-65+e)/26);t[o]=(t[o]-65+e)%26+65,s(t,r,o+1)}}const m=()=>i.get("X-Token")||!1;exports.byInitials=h;exports.cellsDynamically=f;exports.holidays=g;exports.parseDate=p;exports.parseTime=u;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/employees",
3
- "version": "0.5.24",
3
+ "version": "0.5.25",
4
4
  "files": [
5
5
  "dist"
6
6
  ],