@pax2pay/model-banking 0.1.124 → 0.1.125
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/Identifier.ts +10 -3
- package/dist/Identifier.d.ts +2 -1
- package/dist/Identifier.js +7 -2
- package/dist/Identifier.js.map +1 -1
- package/package.json +2 -2
package/Identifier.ts
CHANGED
|
@@ -3,10 +3,17 @@ import { isoly } from "isoly"
|
|
|
3
3
|
|
|
4
4
|
export namespace Identifier {
|
|
5
5
|
export function generate(
|
|
6
|
+
date: isoly.DateTime = isoly.DateTime.now(),
|
|
6
7
|
length: cryptly.Identifier.Length = 16,
|
|
7
|
-
ordering: "ordered" | "reversed" = "reversed"
|
|
8
|
-
date: isoly.DateTime = isoly.DateTime.now()
|
|
8
|
+
ordering: "ordered" | "reversed" = "reversed"
|
|
9
9
|
): string {
|
|
10
|
-
return cryptly.Identifier.generate(length, ordering, isoly.DateTime.epoch(date))
|
|
10
|
+
return cryptly.Identifier.generate(length, ordering, isoly.DateTime.epoch(date, "milliseconds"))
|
|
11
|
+
}
|
|
12
|
+
export function timeOf(
|
|
13
|
+
identifier: cryptly.Identifier,
|
|
14
|
+
ordering: "ordered" | "reversed" = "reversed"
|
|
15
|
+
): isoly.DateTime {
|
|
16
|
+
const decoded = cryptly.Base64.decode(identifier, ordering)
|
|
17
|
+
return isoly.DateTime.create(Number(new BigUint64Array(decoded.slice(decoded.length - 8).buffer)), "milliseconds")
|
|
11
18
|
}
|
|
12
19
|
}
|
package/dist/Identifier.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cryptly } from "cryptly";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
3
|
export declare namespace Identifier {
|
|
4
|
-
function generate(length?: cryptly.Identifier.Length, ordering?: "ordered" | "reversed"
|
|
4
|
+
function generate(date?: isoly.DateTime, length?: cryptly.Identifier.Length, ordering?: "ordered" | "reversed"): string;
|
|
5
|
+
function timeOf(identifier: cryptly.Identifier, ordering?: "ordered" | "reversed"): isoly.DateTime;
|
|
5
6
|
}
|
package/dist/Identifier.js
CHANGED
|
@@ -2,9 +2,14 @@ import { cryptly } from "cryptly";
|
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
3
|
export var Identifier;
|
|
4
4
|
(function (Identifier) {
|
|
5
|
-
function generate(length = 16, ordering = "reversed"
|
|
6
|
-
return cryptly.Identifier.generate(length, ordering, isoly.DateTime.epoch(date));
|
|
5
|
+
function generate(date = isoly.DateTime.now(), length = 16, ordering = "reversed") {
|
|
6
|
+
return cryptly.Identifier.generate(length, ordering, isoly.DateTime.epoch(date, "milliseconds"));
|
|
7
7
|
}
|
|
8
8
|
Identifier.generate = generate;
|
|
9
|
+
function timeOf(identifier, ordering = "reversed") {
|
|
10
|
+
const decoded = cryptly.Base64.decode(identifier, ordering);
|
|
11
|
+
return isoly.DateTime.create(Number(new BigUint64Array(decoded.slice(decoded.length - 8).buffer)), "milliseconds");
|
|
12
|
+
}
|
|
13
|
+
Identifier.timeOf = timeOf;
|
|
9
14
|
})(Identifier || (Identifier = {}));
|
|
10
15
|
//# sourceMappingURL=Identifier.js.map
|
package/dist/Identifier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Identifier.js","sourceRoot":"../","sources":["Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,KAAW,UAAU,
|
|
1
|
+
{"version":3,"file":"Identifier.js","sourceRoot":"../","sources":["Identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,KAAW,UAAU,CAe1B;AAfD,WAAiB,UAAU;IAC1B,SAAgB,QAAQ,CACvB,OAAuB,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,EAC3C,SAAoC,EAAE,EACtC,WAAmC,UAAU;QAE7C,OAAO,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAA;IACjG,CAAC;IANe,mBAAQ,WAMvB,CAAA;IACD,SAAgB,MAAM,CACrB,UAA8B,EAC9B,WAAmC,UAAU;QAE7C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAC3D,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IACnH,CAAC;IANe,iBAAM,SAMrB,CAAA;AACF,CAAC,EAfgB,UAAU,KAAV,UAAU,QAe1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pax2pay/model-banking",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.125",
|
|
4
4
|
"description": "Library containing data model types and functions for the Pax2Pay Banking API.",
|
|
5
5
|
"author": "Pax2Pay Ltd",
|
|
6
6
|
"license": "MIT",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"authly": "^3.0.6",
|
|
75
75
|
"cloudly-http": "^0.1.6",
|
|
76
76
|
"cloudly-rest": "^0.1.3",
|
|
77
|
-
"cryptly": "3.0.
|
|
77
|
+
"cryptly": "^3.0.8",
|
|
78
78
|
"gracely": "^2.0.4",
|
|
79
79
|
"isoly": "^2.0.20",
|
|
80
80
|
"isly": "0.1.7",
|