@utilix-tech/sdk 0.1.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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +199 -0
  3. package/dist/api-8aZtWhSj.d.cts +308 -0
  4. package/dist/api-8aZtWhSj.d.ts +308 -0
  5. package/dist/chunk-2CJSLYWI.js +520 -0
  6. package/dist/chunk-3BAHSW4C.js +1385 -0
  7. package/dist/chunk-6YPV2AB5.js +1246 -0
  8. package/dist/chunk-BPVAB4P2.js +1126 -0
  9. package/dist/chunk-FL53T24A.js +257 -0
  10. package/dist/chunk-L6KCTHUW.js +1086 -0
  11. package/dist/chunk-MLKGABMK.js +7 -0
  12. package/dist/chunk-ROTPLW7T.js +265 -0
  13. package/dist/chunk-TSAGO3XP.js +1253 -0
  14. package/dist/chunk-UC656APA.js +1080 -0
  15. package/dist/chunk-W4UBLYFU.js +1219 -0
  16. package/dist/chunk-XST6X3HT.js +896 -0
  17. package/dist/chunk-XXYZLLHI.js +2227 -0
  18. package/dist/chunk-ZKL2VX2G.js +2215 -0
  19. package/dist/chunk-ZPQZEIXP.js +685 -0
  20. package/dist/code-QNrdLIR3.d.cts +327 -0
  21. package/dist/code-QNrdLIR3.d.ts +327 -0
  22. package/dist/color-tPwZCr9H.d.cts +229 -0
  23. package/dist/color-tPwZCr9H.d.ts +229 -0
  24. package/dist/css-Cf7AMGM-.d.cts +318 -0
  25. package/dist/css-Cf7AMGM-.d.ts +318 -0
  26. package/dist/data-rMjWNiOJ.d.cts +215 -0
  27. package/dist/data-rMjWNiOJ.d.ts +215 -0
  28. package/dist/encoding-7gmq-vkV.d.cts +108 -0
  29. package/dist/encoding-7gmq-vkV.d.ts +108 -0
  30. package/dist/generators-BGtRGpJZ.d.cts +118 -0
  31. package/dist/generators-BGtRGpJZ.d.ts +118 -0
  32. package/dist/hashing-CnetQFD_.d.cts +76 -0
  33. package/dist/hashing-CnetQFD_.d.ts +76 -0
  34. package/dist/index.cjs +15466 -0
  35. package/dist/index.d.cts +18 -0
  36. package/dist/index.d.ts +18 -0
  37. package/dist/index.js +20 -0
  38. package/dist/json-BjSoIS1h.d.cts +198 -0
  39. package/dist/json-BjSoIS1h.d.ts +198 -0
  40. package/dist/misc-DcVBManm.d.cts +201 -0
  41. package/dist/misc-DcVBManm.d.ts +201 -0
  42. package/dist/network-CNtmrDeN.d.cts +170 -0
  43. package/dist/network-CNtmrDeN.d.ts +170 -0
  44. package/dist/text-DqAjPtQ0.d.cts +319 -0
  45. package/dist/text-DqAjPtQ0.d.ts +319 -0
  46. package/dist/time-DbT8fjaF.d.cts +145 -0
  47. package/dist/time-DbT8fjaF.d.ts +145 -0
  48. package/dist/tools/api.cjs +1216 -0
  49. package/dist/tools/api.d.cts +1 -0
  50. package/dist/tools/api.d.ts +1 -0
  51. package/dist/tools/api.js +2 -0
  52. package/dist/tools/code.cjs +2212 -0
  53. package/dist/tools/code.d.cts +1 -0
  54. package/dist/tools/code.d.ts +1 -0
  55. package/dist/tools/code.js +2 -0
  56. package/dist/tools/color.cjs +1122 -0
  57. package/dist/tools/color.d.cts +1 -0
  58. package/dist/tools/color.d.ts +1 -0
  59. package/dist/tools/color.js +2 -0
  60. package/dist/tools/css.cjs +1242 -0
  61. package/dist/tools/css.d.cts +1 -0
  62. package/dist/tools/css.d.ts +1 -0
  63. package/dist/tools/css.js +2 -0
  64. package/dist/tools/data.cjs +1097 -0
  65. package/dist/tools/data.d.cts +1 -0
  66. package/dist/tools/data.d.ts +1 -0
  67. package/dist/tools/data.js +2 -0
  68. package/dist/tools/encoding.cjs +261 -0
  69. package/dist/tools/encoding.d.cts +1 -0
  70. package/dist/tools/encoding.d.ts +1 -0
  71. package/dist/tools/encoding.js +2 -0
  72. package/dist/tools/generators.cjs +521 -0
  73. package/dist/tools/generators.d.cts +1 -0
  74. package/dist/tools/generators.d.ts +1 -0
  75. package/dist/tools/generators.js +2 -0
  76. package/dist/tools/hashing.cjs +259 -0
  77. package/dist/tools/hashing.d.cts +1 -0
  78. package/dist/tools/hashing.d.ts +1 -0
  79. package/dist/tools/hashing.js +2 -0
  80. package/dist/tools/json.cjs +1270 -0
  81. package/dist/tools/json.d.cts +1 -0
  82. package/dist/tools/json.d.ts +1 -0
  83. package/dist/tools/json.js +2 -0
  84. package/dist/tools/misc.cjs +1082 -0
  85. package/dist/tools/misc.d.cts +1 -0
  86. package/dist/tools/misc.d.ts +1 -0
  87. package/dist/tools/misc.js +2 -0
  88. package/dist/tools/network.cjs +1381 -0
  89. package/dist/tools/network.d.cts +1 -0
  90. package/dist/tools/network.d.ts +1 -0
  91. package/dist/tools/network.js +2 -0
  92. package/dist/tools/text.cjs +2224 -0
  93. package/dist/tools/text.d.cts +1 -0
  94. package/dist/tools/text.d.ts +1 -0
  95. package/dist/tools/text.js +2 -0
  96. package/dist/tools/time.cjs +681 -0
  97. package/dist/tools/time.d.cts +1 -0
  98. package/dist/tools/time.d.ts +1 -0
  99. package/dist/tools/time.js +2 -0
  100. package/dist/tools/units.cjs +892 -0
  101. package/dist/tools/units.d.cts +1 -0
  102. package/dist/tools/units.d.ts +1 -0
  103. package/dist/tools/units.js +2 -0
  104. package/dist/units-6lwDYBvX.d.cts +302 -0
  105. package/dist/units-6lwDYBvX.d.ts +302 -0
  106. package/package.json +148 -0
@@ -0,0 +1,145 @@
1
+ /**
2
+ * @module time
3
+ * Tools covered:
4
+ * - unix-time : fromUnix, fromIsoString, getNow, formatRelative
5
+ * - cron-parser : parseCron, COMMON_CRONS
6
+ * - date-diff : parseDate, humanizeDiff, diffDates, COMMON_DATE_PRESETS
7
+ * - timezone : TIMEZONES, getTimezoneOffset, convertTime, formatInTimezone, getAllZonesForTime
8
+ * - cron-next : parseCronExpression, getNextRuns, formatRunDate, getRunInterval
9
+ */
10
+ interface TimestampResult {
11
+ unix: number;
12
+ unixMs: number;
13
+ iso: string;
14
+ utc: string;
15
+ local: string;
16
+ relative: string;
17
+ }
18
+ declare function formatRelative(diffMs: number): string;
19
+ declare function fromUnix(ts: number): TimestampResult;
20
+ declare function fromIsoString(iso: string): TimestampResult | {
21
+ error: string;
22
+ };
23
+ declare function getNow(): TimestampResult;
24
+ interface CronField {
25
+ raw: string;
26
+ description: string;
27
+ valid: boolean;
28
+ }
29
+ interface CronResult {
30
+ raw: string;
31
+ fields: {
32
+ minute: CronField;
33
+ hour: CronField;
34
+ day: CronField;
35
+ month: CronField;
36
+ weekday: CronField;
37
+ };
38
+ summary: string;
39
+ valid: boolean;
40
+ error?: string;
41
+ }
42
+ declare function parseCron(expr: string): CronResult;
43
+ declare const COMMON_CRONS: Array<{
44
+ expr: string;
45
+ label: string;
46
+ }>;
47
+ interface DateDiffResult {
48
+ years: number;
49
+ months: number;
50
+ weeks: number;
51
+ days: number;
52
+ hours: number;
53
+ minutes: number;
54
+ seconds: number;
55
+ totalDays: number;
56
+ totalHours: number;
57
+ totalMinutes: number;
58
+ totalSeconds: number;
59
+ isPast: boolean;
60
+ humanReadable: string;
61
+ }
62
+ declare function parseDate(input: string): Date | null;
63
+ declare function humanizeDiff(result: DateDiffResult): string;
64
+ declare function diffDates(from: string, to: string): DateDiffResult | {
65
+ error: string;
66
+ };
67
+ declare const COMMON_DATE_PRESETS: Array<{
68
+ label: string;
69
+ from: () => string;
70
+ to: () => string;
71
+ }>;
72
+ interface TimezoneEntry {
73
+ tz: string;
74
+ label: string;
75
+ offset: string;
76
+ }
77
+ declare const TIMEZONES: TimezoneEntry[];
78
+ declare function getTimezoneOffset(tz: string, isoString: string): string;
79
+ declare function convertTime(isoString: string, fromTz: string, toTz: string): {
80
+ result: string;
81
+ error?: string;
82
+ };
83
+ declare function formatInTimezone(isoString: string, tz: string): {
84
+ date: string;
85
+ time: string;
86
+ offset: string;
87
+ label: string;
88
+ };
89
+ declare function getAllZonesForTime(isoString: string): Array<TimezoneEntry & {
90
+ localTime: string;
91
+ }>;
92
+ interface CronNextField {
93
+ raw: string;
94
+ values: number[];
95
+ min: number;
96
+ max: number;
97
+ }
98
+ interface ParsedCron {
99
+ minute: CronNextField;
100
+ hour: CronNextField;
101
+ dayOfMonth: CronNextField;
102
+ month: CronNextField;
103
+ dayOfWeek: CronNextField;
104
+ timezone?: string;
105
+ }
106
+ declare function parseCronExpression(expr: string): ParsedCron | {
107
+ error: string;
108
+ };
109
+ declare function getNextRuns(expr: string, count?: number, fromDate?: Date): Date[] | {
110
+ error: string;
111
+ };
112
+ declare function formatRunDate(date: Date, timezone?: string): string;
113
+ declare function getRunInterval(dates: Date[]): string;
114
+
115
+ declare const time_COMMON_CRONS: typeof COMMON_CRONS;
116
+ declare const time_COMMON_DATE_PRESETS: typeof COMMON_DATE_PRESETS;
117
+ type time_CronField = CronField;
118
+ type time_CronNextField = CronNextField;
119
+ type time_CronResult = CronResult;
120
+ type time_DateDiffResult = DateDiffResult;
121
+ type time_ParsedCron = ParsedCron;
122
+ declare const time_TIMEZONES: typeof TIMEZONES;
123
+ type time_TimestampResult = TimestampResult;
124
+ type time_TimezoneEntry = TimezoneEntry;
125
+ declare const time_convertTime: typeof convertTime;
126
+ declare const time_diffDates: typeof diffDates;
127
+ declare const time_formatInTimezone: typeof formatInTimezone;
128
+ declare const time_formatRelative: typeof formatRelative;
129
+ declare const time_formatRunDate: typeof formatRunDate;
130
+ declare const time_fromIsoString: typeof fromIsoString;
131
+ declare const time_fromUnix: typeof fromUnix;
132
+ declare const time_getAllZonesForTime: typeof getAllZonesForTime;
133
+ declare const time_getNextRuns: typeof getNextRuns;
134
+ declare const time_getNow: typeof getNow;
135
+ declare const time_getRunInterval: typeof getRunInterval;
136
+ declare const time_getTimezoneOffset: typeof getTimezoneOffset;
137
+ declare const time_humanizeDiff: typeof humanizeDiff;
138
+ declare const time_parseCron: typeof parseCron;
139
+ declare const time_parseCronExpression: typeof parseCronExpression;
140
+ declare const time_parseDate: typeof parseDate;
141
+ declare namespace time {
142
+ export { time_COMMON_CRONS as COMMON_CRONS, time_COMMON_DATE_PRESETS as COMMON_DATE_PRESETS, type time_CronField as CronField, type time_CronNextField as CronNextField, type time_CronResult as CronResult, type time_DateDiffResult as DateDiffResult, type time_ParsedCron as ParsedCron, time_TIMEZONES as TIMEZONES, type time_TimestampResult as TimestampResult, type time_TimezoneEntry as TimezoneEntry, time_convertTime as convertTime, time_diffDates as diffDates, time_formatInTimezone as formatInTimezone, time_formatRelative as formatRelative, time_formatRunDate as formatRunDate, time_fromIsoString as fromIsoString, time_fromUnix as fromUnix, time_getAllZonesForTime as getAllZonesForTime, time_getNextRuns as getNextRuns, time_getNow as getNow, time_getRunInterval as getRunInterval, time_getTimezoneOffset as getTimezoneOffset, time_humanizeDiff as humanizeDiff, time_parseCron as parseCron, time_parseCronExpression as parseCronExpression, time_parseDate as parseDate };
143
+ }
144
+
145
+ export { COMMON_CRONS as C, type DateDiffResult as D, type ParsedCron as P, TIMEZONES as T, COMMON_DATE_PRESETS as a, type CronField as b, type CronNextField as c, type CronResult as d, type TimestampResult as e, type TimezoneEntry as f, convertTime as g, diffDates as h, formatInTimezone as i, formatRelative as j, formatRunDate as k, fromIsoString as l, fromUnix as m, getAllZonesForTime as n, getNextRuns as o, getNow as p, getRunInterval as q, getTimezoneOffset as r, humanizeDiff as s, time as t, parseCron as u, parseCronExpression as v, parseDate as w };
@@ -0,0 +1,145 @@
1
+ /**
2
+ * @module time
3
+ * Tools covered:
4
+ * - unix-time : fromUnix, fromIsoString, getNow, formatRelative
5
+ * - cron-parser : parseCron, COMMON_CRONS
6
+ * - date-diff : parseDate, humanizeDiff, diffDates, COMMON_DATE_PRESETS
7
+ * - timezone : TIMEZONES, getTimezoneOffset, convertTime, formatInTimezone, getAllZonesForTime
8
+ * - cron-next : parseCronExpression, getNextRuns, formatRunDate, getRunInterval
9
+ */
10
+ interface TimestampResult {
11
+ unix: number;
12
+ unixMs: number;
13
+ iso: string;
14
+ utc: string;
15
+ local: string;
16
+ relative: string;
17
+ }
18
+ declare function formatRelative(diffMs: number): string;
19
+ declare function fromUnix(ts: number): TimestampResult;
20
+ declare function fromIsoString(iso: string): TimestampResult | {
21
+ error: string;
22
+ };
23
+ declare function getNow(): TimestampResult;
24
+ interface CronField {
25
+ raw: string;
26
+ description: string;
27
+ valid: boolean;
28
+ }
29
+ interface CronResult {
30
+ raw: string;
31
+ fields: {
32
+ minute: CronField;
33
+ hour: CronField;
34
+ day: CronField;
35
+ month: CronField;
36
+ weekday: CronField;
37
+ };
38
+ summary: string;
39
+ valid: boolean;
40
+ error?: string;
41
+ }
42
+ declare function parseCron(expr: string): CronResult;
43
+ declare const COMMON_CRONS: Array<{
44
+ expr: string;
45
+ label: string;
46
+ }>;
47
+ interface DateDiffResult {
48
+ years: number;
49
+ months: number;
50
+ weeks: number;
51
+ days: number;
52
+ hours: number;
53
+ minutes: number;
54
+ seconds: number;
55
+ totalDays: number;
56
+ totalHours: number;
57
+ totalMinutes: number;
58
+ totalSeconds: number;
59
+ isPast: boolean;
60
+ humanReadable: string;
61
+ }
62
+ declare function parseDate(input: string): Date | null;
63
+ declare function humanizeDiff(result: DateDiffResult): string;
64
+ declare function diffDates(from: string, to: string): DateDiffResult | {
65
+ error: string;
66
+ };
67
+ declare const COMMON_DATE_PRESETS: Array<{
68
+ label: string;
69
+ from: () => string;
70
+ to: () => string;
71
+ }>;
72
+ interface TimezoneEntry {
73
+ tz: string;
74
+ label: string;
75
+ offset: string;
76
+ }
77
+ declare const TIMEZONES: TimezoneEntry[];
78
+ declare function getTimezoneOffset(tz: string, isoString: string): string;
79
+ declare function convertTime(isoString: string, fromTz: string, toTz: string): {
80
+ result: string;
81
+ error?: string;
82
+ };
83
+ declare function formatInTimezone(isoString: string, tz: string): {
84
+ date: string;
85
+ time: string;
86
+ offset: string;
87
+ label: string;
88
+ };
89
+ declare function getAllZonesForTime(isoString: string): Array<TimezoneEntry & {
90
+ localTime: string;
91
+ }>;
92
+ interface CronNextField {
93
+ raw: string;
94
+ values: number[];
95
+ min: number;
96
+ max: number;
97
+ }
98
+ interface ParsedCron {
99
+ minute: CronNextField;
100
+ hour: CronNextField;
101
+ dayOfMonth: CronNextField;
102
+ month: CronNextField;
103
+ dayOfWeek: CronNextField;
104
+ timezone?: string;
105
+ }
106
+ declare function parseCronExpression(expr: string): ParsedCron | {
107
+ error: string;
108
+ };
109
+ declare function getNextRuns(expr: string, count?: number, fromDate?: Date): Date[] | {
110
+ error: string;
111
+ };
112
+ declare function formatRunDate(date: Date, timezone?: string): string;
113
+ declare function getRunInterval(dates: Date[]): string;
114
+
115
+ declare const time_COMMON_CRONS: typeof COMMON_CRONS;
116
+ declare const time_COMMON_DATE_PRESETS: typeof COMMON_DATE_PRESETS;
117
+ type time_CronField = CronField;
118
+ type time_CronNextField = CronNextField;
119
+ type time_CronResult = CronResult;
120
+ type time_DateDiffResult = DateDiffResult;
121
+ type time_ParsedCron = ParsedCron;
122
+ declare const time_TIMEZONES: typeof TIMEZONES;
123
+ type time_TimestampResult = TimestampResult;
124
+ type time_TimezoneEntry = TimezoneEntry;
125
+ declare const time_convertTime: typeof convertTime;
126
+ declare const time_diffDates: typeof diffDates;
127
+ declare const time_formatInTimezone: typeof formatInTimezone;
128
+ declare const time_formatRelative: typeof formatRelative;
129
+ declare const time_formatRunDate: typeof formatRunDate;
130
+ declare const time_fromIsoString: typeof fromIsoString;
131
+ declare const time_fromUnix: typeof fromUnix;
132
+ declare const time_getAllZonesForTime: typeof getAllZonesForTime;
133
+ declare const time_getNextRuns: typeof getNextRuns;
134
+ declare const time_getNow: typeof getNow;
135
+ declare const time_getRunInterval: typeof getRunInterval;
136
+ declare const time_getTimezoneOffset: typeof getTimezoneOffset;
137
+ declare const time_humanizeDiff: typeof humanizeDiff;
138
+ declare const time_parseCron: typeof parseCron;
139
+ declare const time_parseCronExpression: typeof parseCronExpression;
140
+ declare const time_parseDate: typeof parseDate;
141
+ declare namespace time {
142
+ export { time_COMMON_CRONS as COMMON_CRONS, time_COMMON_DATE_PRESETS as COMMON_DATE_PRESETS, type time_CronField as CronField, type time_CronNextField as CronNextField, type time_CronResult as CronResult, type time_DateDiffResult as DateDiffResult, type time_ParsedCron as ParsedCron, time_TIMEZONES as TIMEZONES, type time_TimestampResult as TimestampResult, type time_TimezoneEntry as TimezoneEntry, time_convertTime as convertTime, time_diffDates as diffDates, time_formatInTimezone as formatInTimezone, time_formatRelative as formatRelative, time_formatRunDate as formatRunDate, time_fromIsoString as fromIsoString, time_fromUnix as fromUnix, time_getAllZonesForTime as getAllZonesForTime, time_getNextRuns as getNextRuns, time_getNow as getNow, time_getRunInterval as getRunInterval, time_getTimezoneOffset as getTimezoneOffset, time_humanizeDiff as humanizeDiff, time_parseCron as parseCron, time_parseCronExpression as parseCronExpression, time_parseDate as parseDate };
143
+ }
144
+
145
+ export { COMMON_CRONS as C, type DateDiffResult as D, type ParsedCron as P, TIMEZONES as T, COMMON_DATE_PRESETS as a, type CronField as b, type CronNextField as c, type CronResult as d, type TimestampResult as e, type TimezoneEntry as f, convertTime as g, diffDates as h, formatInTimezone as i, formatRelative as j, formatRunDate as k, fromIsoString as l, fromUnix as m, getAllZonesForTime as n, getNextRuns as o, getNow as p, getRunInterval as q, getTimezoneOffset as r, humanizeDiff as s, time as t, parseCron as u, parseCronExpression as v, parseDate as w };