@emulators/google 0.5.0 → 0.6.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/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -66,6 +66,7 @@ var LABEL_ALIASES = {
|
|
|
66
66
|
updates: "CATEGORY_UPDATES",
|
|
67
67
|
forums: "CATEGORY_FORUMS"
|
|
68
68
|
};
|
|
69
|
+
var lastGeneratedHistoryId = 0n;
|
|
69
70
|
function generateUid(prefix = "") {
|
|
70
71
|
const id = randomBytes(12).toString("base64url").slice(0, 20);
|
|
71
72
|
return prefix ? `${prefix}_${id}` : id;
|
|
@@ -76,7 +77,12 @@ function generateDraftId() {
|
|
|
76
77
|
}
|
|
77
78
|
function generateHistoryId() {
|
|
78
79
|
const entropy = randomBytes(3).readUIntBE(0, 3).toString().padStart(8, "0");
|
|
79
|
-
|
|
80
|
+
let next = BigInt(`${Date.now()}${entropy}`);
|
|
81
|
+
if (next <= lastGeneratedHistoryId) {
|
|
82
|
+
next = lastGeneratedHistoryId + 1n;
|
|
83
|
+
}
|
|
84
|
+
lastGeneratedHistoryId = next;
|
|
85
|
+
return next.toString();
|
|
80
86
|
}
|
|
81
87
|
function getAuthenticatedEmail(c) {
|
|
82
88
|
const authUser = c.get("authUser");
|
|
@@ -2596,8 +2602,6 @@ import { createHash, randomBytes as randomBytes2 } from "crypto";
|
|
|
2596
2602
|
import { SignJWT } from "jose";
|
|
2597
2603
|
|
|
2598
2604
|
// ../core/dist/index.js
|
|
2599
|
-
import { Hono } from "hono";
|
|
2600
|
-
import { cors } from "hono/cors";
|
|
2601
2605
|
import { jwtVerify, importPKCS8 } from "jose";
|
|
2602
2606
|
import { readFileSync } from "fs";
|
|
2603
2607
|
import { fileURLToPath } from "url";
|