@zauru-sdk/common 2.14.0 → 2.15.1
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/CHANGELOG.md +16 -0
- package/dist/common.d.ts +0 -15
- package/dist/esm/common.js +0 -22
- package/package.json +3 -3
- package/src/common.ts +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.15.1](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.15.0...v2.15.1) (2025-08-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zauru-sdk/common
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.14.1](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.14.0...v2.14.1) (2025-08-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @zauru-sdk/common
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [2.14.0](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.13.0...v2.14.0) (2025-08-08)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @zauru-sdk/common
|
package/dist/common.d.ts
CHANGED
|
@@ -165,21 +165,6 @@ export declare function calculateTimeDifference(timestamp: string): {
|
|
|
165
165
|
minutes: number;
|
|
166
166
|
label: string;
|
|
167
167
|
};
|
|
168
|
-
/**
|
|
169
|
-
* Creates a unique code with a compact date format in uppercase.
|
|
170
|
-
*
|
|
171
|
-
* @param {string | null} suffix - An optional prefix to add to the code.
|
|
172
|
-
* @returns {string} A unique code consisting of a timestamp and an optional suffix.
|
|
173
|
-
*
|
|
174
|
-
* @example
|
|
175
|
-
* // Without suffix
|
|
176
|
-
* createCode(null); // Returns something like "1A2B3C4D"
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* // With suffix
|
|
180
|
-
* createCode("INV"); // Returns something like "INV-1A2B3C4D"
|
|
181
|
-
*/
|
|
182
|
-
export declare function createCode(suffix?: string | null): string;
|
|
183
168
|
/**
|
|
184
169
|
* Parses a code generated by createCode function to extract its components.
|
|
185
170
|
*
|
package/dist/esm/common.js
CHANGED
|
@@ -20,7 +20,6 @@ exports.capitalLetter = capitalLetter;
|
|
|
20
20
|
exports.handlePossibleAxiosErrors = handlePossibleAxiosErrors;
|
|
21
21
|
exports.createPostgresUrl = createPostgresUrl;
|
|
22
22
|
exports.calculateTimeDifference = calculateTimeDifference;
|
|
23
|
-
exports.createCode = createCode;
|
|
24
23
|
exports.parseCode = parseCode;
|
|
25
24
|
const moment_1 = __importDefault(require("moment"));
|
|
26
25
|
require("moment-timezone");
|
|
@@ -633,27 +632,6 @@ function calculateTimeDifference(timestamp) {
|
|
|
633
632
|
label: `${hours > 0 ? `${hours} ${hours > 1 ? "horas" : "hora"}` : ""}${hours > 0 && minutes > 0 ? " y " : ""}${minutes > 0 ? `${minutes} ${minutes > 1 ? "minutos" : "minuto"}` : ""}.`,
|
|
634
633
|
};
|
|
635
634
|
}
|
|
636
|
-
/**
|
|
637
|
-
* Creates a unique code with a compact date format in uppercase.
|
|
638
|
-
*
|
|
639
|
-
* @param {string | null} suffix - An optional prefix to add to the code.
|
|
640
|
-
* @returns {string} A unique code consisting of a timestamp and an optional suffix.
|
|
641
|
-
*
|
|
642
|
-
* @example
|
|
643
|
-
* // Without suffix
|
|
644
|
-
* createCode(null); // Returns something like "1A2B3C4D"
|
|
645
|
-
*
|
|
646
|
-
* @example
|
|
647
|
-
* // With suffix
|
|
648
|
-
* createCode("INV"); // Returns something like "INV-1A2B3C4D"
|
|
649
|
-
*/
|
|
650
|
-
function createCode(suffix) {
|
|
651
|
-
const timestamp = Math.floor(Date.now() / 1000)
|
|
652
|
-
.toString(36)
|
|
653
|
-
.toUpperCase(); // Timestamp in base 36 and converted to uppercase
|
|
654
|
-
const code = `${timestamp}`;
|
|
655
|
-
return suffix ? `${suffix}-${code}` : code;
|
|
656
|
-
}
|
|
657
635
|
/**
|
|
658
636
|
* Parses a code generated by createCode function to extract its components.
|
|
659
637
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.1",
|
|
4
4
|
"description": "Funciones de uso común en el desarrollo de webapps en Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@remix-run/node": "^2.8.1",
|
|
23
|
-
"@zauru-sdk/types": "^2.
|
|
23
|
+
"@zauru-sdk/types": "^2.15.1",
|
|
24
24
|
"moment": "^2.30.1",
|
|
25
25
|
"moment-timezone": "^0.5.45"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "98c47cc9e37e9e74611bfb81f0e63d9758d8b7e9"
|
|
28
28
|
}
|
package/src/common.ts
CHANGED
|
@@ -727,29 +727,6 @@ export function calculateTimeDifference(timestamp: string): {
|
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
729
|
|
|
730
|
-
/**
|
|
731
|
-
* Creates a unique code with a compact date format in uppercase.
|
|
732
|
-
*
|
|
733
|
-
* @param {string | null} suffix - An optional prefix to add to the code.
|
|
734
|
-
* @returns {string} A unique code consisting of a timestamp and an optional suffix.
|
|
735
|
-
*
|
|
736
|
-
* @example
|
|
737
|
-
* // Without suffix
|
|
738
|
-
* createCode(null); // Returns something like "1A2B3C4D"
|
|
739
|
-
*
|
|
740
|
-
* @example
|
|
741
|
-
* // With suffix
|
|
742
|
-
* createCode("INV"); // Returns something like "INV-1A2B3C4D"
|
|
743
|
-
*/
|
|
744
|
-
export function createCode(suffix?: string | null): string {
|
|
745
|
-
const timestamp = Math.floor(Date.now() / 1000)
|
|
746
|
-
.toString(36)
|
|
747
|
-
.toUpperCase(); // Timestamp in base 36 and converted to uppercase
|
|
748
|
-
const code = `${timestamp}`;
|
|
749
|
-
|
|
750
|
-
return suffix ? `${suffix}-${code}` : code;
|
|
751
|
-
}
|
|
752
|
-
|
|
753
730
|
/**
|
|
754
731
|
* Parses a code generated by createCode function to extract its components.
|
|
755
732
|
*
|