@updraft-solutions/mcrit-sdk 0.3.1 → 0.5.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/chunk-AKLFMP7G.cjs +2525 -0
- package/dist/{chunk-MF7G76QS.cjs → chunk-IVMOR5SW.cjs} +26 -1
- package/dist/{chunk-D5DUVW34.js → chunk-KIMCBEY7.js} +26 -1
- package/dist/chunk-YCIXOVEC.js +2525 -0
- package/dist/format/index.cjs +2 -2
- package/dist/format/index.d.cts +13 -4
- package/dist/format/index.d.ts +13 -4
- package/dist/format/index.js +1 -1
- package/dist/index.cjs +201 -5
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +208 -12
- package/dist/schemas/index.cjs +198 -2
- package/dist/schemas/index.d.cts +3157 -128
- package/dist/schemas/index.d.ts +3157 -128
- package/dist/schemas/index.js +201 -5
- package/dist/{models-BWmpcfR8.d.cts → training-Der1DPU-.d.cts} +23757 -6528
- package/dist/{models-BWmpcfR8.d.ts → training-Der1DPU-.d.ts} +23757 -6528
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +277 -6
- package/dist/types/index.d.ts +277 -6
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/src/format/index.ts +51 -5
- package/src/index.ts +39 -0
- package/src/schemas/common.ts +37 -0
- package/src/schemas/course-milestone.ts +78 -0
- package/src/schemas/equipment.ts +27 -0
- package/src/schemas/form-template.ts +413 -0
- package/src/schemas/index.ts +7 -1
- package/src/schemas/location-map.ts +175 -0
- package/src/schemas/models.ts +110 -28
- package/src/schemas/newsletter.ts +362 -0
- package/src/schemas/todo.ts +46 -0
- package/src/schemas/training.ts +500 -0
- package/src/types/ai.ts +85 -0
- package/src/types/aircraft-block.ts +23 -0
- package/src/types/api.ts +3 -1
- package/src/types/background-task.ts +28 -0
- package/src/types/compliance.ts +27 -3
- package/src/types/index.ts +5 -0
- package/src/types/landing-fee.ts +92 -0
- package/src/types/models.ts +44 -0
- package/src/types/roles.ts +26 -0
- package/dist/chunk-7QF3OJ45.cjs +0 -1325
- package/dist/chunk-FS5I4MBG.js +0 -1325
- package/src/schemas/fee.ts +0 -37
- /package/dist/{chunk-LXNCAKJZ.js → chunk-2WJHTRIE.js} +0 -0
- /package/dist/{chunk-MOOGM3DW.cjs → chunk-DCEOET63.cjs} +0 -0
|
@@ -109,11 +109,36 @@ function timeString(date, timezone = DEFAULT_TZ, includeTimezone = false) {
|
|
|
109
109
|
}
|
|
110
110
|
return formatted;
|
|
111
111
|
}
|
|
112
|
+
var RELATIVE_TIME_UNITS = [
|
|
113
|
+
{ unit: "year", ms: 365 * 24 * 60 * 60 * 1e3 },
|
|
114
|
+
{ unit: "month", ms: 30 * 24 * 60 * 60 * 1e3 },
|
|
115
|
+
{ unit: "day", ms: 24 * 60 * 60 * 1e3 },
|
|
116
|
+
{ unit: "hour", ms: 60 * 60 * 1e3 },
|
|
117
|
+
{ unit: "minute", ms: 60 * 1e3 }
|
|
118
|
+
];
|
|
112
119
|
function timeUntil(dateTime, locale = "de") {
|
|
113
120
|
if (!dateTime) {
|
|
114
121
|
return "";
|
|
115
122
|
}
|
|
116
|
-
|
|
123
|
+
const target = dateTime instanceof Date ? dateTime.getTime() : Date.parse(dateTime);
|
|
124
|
+
if (Number.isNaN(target)) {
|
|
125
|
+
return "";
|
|
126
|
+
}
|
|
127
|
+
const diff = target - Date.now();
|
|
128
|
+
let resolved = "de";
|
|
129
|
+
try {
|
|
130
|
+
if (Intl.RelativeTimeFormat.supportedLocalesOf(locale).length > 0) {
|
|
131
|
+
resolved = locale;
|
|
132
|
+
}
|
|
133
|
+
} catch (e) {
|
|
134
|
+
}
|
|
135
|
+
const formatter = new Intl.RelativeTimeFormat(resolved, { numeric: "auto" });
|
|
136
|
+
for (const { unit, ms } of RELATIVE_TIME_UNITS) {
|
|
137
|
+
if (Math.abs(diff) >= ms) {
|
|
138
|
+
return formatter.format(Math.round(diff / ms), unit);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return formatter.format(Math.round(diff / 1e3), "second");
|
|
117
142
|
}
|
|
118
143
|
function minutesFormatted(minutes) {
|
|
119
144
|
if (minutes == null) {
|
|
@@ -109,11 +109,36 @@ function timeString(date, timezone = DEFAULT_TZ, includeTimezone = false) {
|
|
|
109
109
|
}
|
|
110
110
|
return formatted;
|
|
111
111
|
}
|
|
112
|
+
var RELATIVE_TIME_UNITS = [
|
|
113
|
+
{ unit: "year", ms: 365 * 24 * 60 * 60 * 1e3 },
|
|
114
|
+
{ unit: "month", ms: 30 * 24 * 60 * 60 * 1e3 },
|
|
115
|
+
{ unit: "day", ms: 24 * 60 * 60 * 1e3 },
|
|
116
|
+
{ unit: "hour", ms: 60 * 60 * 1e3 },
|
|
117
|
+
{ unit: "minute", ms: 60 * 1e3 }
|
|
118
|
+
];
|
|
112
119
|
function timeUntil(dateTime, locale = "de") {
|
|
113
120
|
if (!dateTime) {
|
|
114
121
|
return "";
|
|
115
122
|
}
|
|
116
|
-
|
|
123
|
+
const target = dateTime instanceof Date ? dateTime.getTime() : Date.parse(dateTime);
|
|
124
|
+
if (Number.isNaN(target)) {
|
|
125
|
+
return "";
|
|
126
|
+
}
|
|
127
|
+
const diff = target - Date.now();
|
|
128
|
+
let resolved = "de";
|
|
129
|
+
try {
|
|
130
|
+
if (Intl.RelativeTimeFormat.supportedLocalesOf(locale).length > 0) {
|
|
131
|
+
resolved = locale;
|
|
132
|
+
}
|
|
133
|
+
} catch {
|
|
134
|
+
}
|
|
135
|
+
const formatter = new Intl.RelativeTimeFormat(resolved, { numeric: "auto" });
|
|
136
|
+
for (const { unit, ms } of RELATIVE_TIME_UNITS) {
|
|
137
|
+
if (Math.abs(diff) >= ms) {
|
|
138
|
+
return formatter.format(Math.round(diff / ms), unit);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return formatter.format(Math.round(diff / 1e3), "second");
|
|
117
142
|
}
|
|
118
143
|
function minutesFormatted(minutes) {
|
|
119
144
|
if (minutes == null) {
|