@hot-updater/firebase 1.2.0-rc.4 → 1.2.0-rc.41
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/firebase/functions/index.cjs +983 -176
- package/dist/index.cjs +143 -35
- package/dist/index.d.cts +4 -5
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +143 -35
- package/dist/init/index.cjs +23 -14
- package/dist/init/index.d.cts +2 -2
- package/dist/init/index.d.mts +2 -2
- package/dist/init/index.mjs +23 -14
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -202,11 +202,14 @@ const firebaseDatabase = (config) => ({
|
|
|
202
202
|
//#region src/firebaseStorage.ts
|
|
203
203
|
/** Signed URLs kept per adapter, enough for a few Bundles' assets. */
|
|
204
204
|
const MAX_CACHED_SIGNED_URLS = 1e4;
|
|
205
|
+
/** Objects deleted at once: Cloud Storage deletes one object a request. */
|
|
206
|
+
const DELETE_CONCURRENCY = 16;
|
|
205
207
|
const firebaseStorage = (config) => {
|
|
206
208
|
const app = (0, firebase_admin_app.getApps)().length ? (0, firebase_admin_app.getApp)() : (0, firebase_admin_app.initializeApp)(config);
|
|
207
209
|
let opened;
|
|
208
210
|
const bucket = () => opened ??= (0, firebase_admin_storage.getStorage)(app).bucket(config.storageBucket);
|
|
209
211
|
const getStorageKey = (0, _hot_updater_plugin_core.createStorageKeyBuilder)(config.basePath);
|
|
212
|
+
const basePrefix = getStorageKey() ? `${getStorageKey()}/` : "";
|
|
210
213
|
/**
|
|
211
214
|
* Signed URLs by object. Without a private key, as in Cloud Functions, each
|
|
212
215
|
* signature is an IAM signBlob request, and an update check returns a URL
|
|
@@ -295,6 +298,39 @@ const firebaseStorage = (config) => {
|
|
|
295
298
|
const { key } = parseAndValidate(storageUri);
|
|
296
299
|
await bucket().file(key).delete({ ignoreNotFound: true });
|
|
297
300
|
return { deleted: true };
|
|
301
|
+
},
|
|
302
|
+
async listObjects(prefix) {
|
|
303
|
+
const folder = getStorageKey(prefix ?? "");
|
|
304
|
+
const [files] = await bucket().getFiles({
|
|
305
|
+
autoPaginate: true,
|
|
306
|
+
prefix: folder ? `${folder}/` : ""
|
|
307
|
+
});
|
|
308
|
+
const objects = [];
|
|
309
|
+
for (const file of files) {
|
|
310
|
+
if (!file.name.startsWith(basePrefix)) continue;
|
|
311
|
+
let storageUri;
|
|
312
|
+
try {
|
|
313
|
+
storageUri = (0, _hot_updater_plugin_core.createStorageUri)({
|
|
314
|
+
bucket: config.storageBucket,
|
|
315
|
+
key: file.name,
|
|
316
|
+
protocol: "gs"
|
|
317
|
+
});
|
|
318
|
+
} catch {
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
const { size, updated } = file.metadata;
|
|
322
|
+
objects.push({
|
|
323
|
+
key: file.name.slice(basePrefix.length),
|
|
324
|
+
...updated ? { lastModifiedAt: new Date(updated) } : {},
|
|
325
|
+
size: Number(size ?? 0),
|
|
326
|
+
storageUri
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
return objects;
|
|
330
|
+
},
|
|
331
|
+
async deleteObjects(relativeKeys) {
|
|
332
|
+
const keys = relativeKeys.map((key) => getStorageKey(key));
|
|
333
|
+
for (let offset = 0; offset < keys.length; offset += DELETE_CONCURRENCY) await Promise.all(keys.slice(offset, offset + DELETE_CONCURRENCY).map((key) => bucket().file(key).delete({ ignoreNotFound: true })));
|
|
298
334
|
}
|
|
299
335
|
});
|
|
300
336
|
};
|
|
@@ -356,22 +392,61 @@ const crc32c = (bytes) => {
|
|
|
356
392
|
/** The version IDs the secret's annotation lists. */
|
|
357
393
|
const trackedVersions = (secret) => (secret.annotations?.[VERSIONS_ANNOTATION] ?? "").split(",").map((entry) => entry.trim()).filter((entry) => VERSION_ID_PATTERN.test(entry));
|
|
358
394
|
const versionOf = (name) => typeof name === "string" ? name.slice(name.lastIndexOf("/") + 1) : "";
|
|
359
|
-
|
|
395
|
+
/** An error of one line each, for a terminal. */
|
|
396
|
+
const failure = (lines, cause) => new Error(lines.join("\n"), cause === void 0 ? void 0 : { cause });
|
|
397
|
+
/**
|
|
398
|
+
* The one step that can fix the credentials in use, by the order they're
|
|
399
|
+
* tried: signing in with gcloud changes nothing while a variable comes first.
|
|
400
|
+
*/
|
|
401
|
+
const signInHint = (credentials) => {
|
|
402
|
+
if (credentials) return [`Check the credentials passed to ${ADAPTER_NAME}().`];
|
|
403
|
+
const variable = ACCESS_TOKEN_ENV_NAMES.find((name) => process.env[name]?.trim()) ?? (process.env["GOOGLE_APPLICATION_CREDENTIALS"]?.trim() ? "GOOGLE_APPLICATION_CREDENTIALS" : void 0);
|
|
404
|
+
if (variable) return [`Fix or unset ${variable}.`];
|
|
405
|
+
return process.env["CI"] ? ["Use google-github-actions/auth."] : ["Sign in:", "gcloud auth application-default login"];
|
|
406
|
+
};
|
|
407
|
+
const hint = (response, permission, signIn, projectId) => {
|
|
360
408
|
const { status, error } = response;
|
|
361
|
-
if (error.details?.some((detail) => detail.reason === "SERVICE_DISABLED")) return "
|
|
362
|
-
if (status === 401) return "
|
|
363
|
-
if (status === 403) return `
|
|
364
|
-
if (status === 429) return "
|
|
365
|
-
return
|
|
409
|
+
if (error.details?.some((detail) => detail.reason === "SERVICE_DISABLED")) return ["Enable the Secret Manager API in the project:", `gcloud services enable secretmanager.googleapis.com --project ${projectId}`];
|
|
410
|
+
if (status === 401) return ["Google rejected the access token.", ...signIn];
|
|
411
|
+
if (status === 403) return [`The identity needs ${permission}.`];
|
|
412
|
+
if (status === 429) return ["Secret Manager's quota is exhausted: try again later."];
|
|
413
|
+
return [];
|
|
366
414
|
};
|
|
367
415
|
/**
|
|
368
|
-
* An error for a failed request: the HTTP status,
|
|
369
|
-
*
|
|
416
|
+
* An error for a failed request on `resource`, a line each: the HTTP status,
|
|
417
|
+
* the resource, `notes`, and what to fix, or Google's own status and message,
|
|
418
|
+
* which name resources but never a value, when nothing here says what to fix.
|
|
370
419
|
*/
|
|
371
|
-
const
|
|
420
|
+
const requestErrorOf = (signIn, projectId, action, resource, response, permission, notes = []) => {
|
|
372
421
|
const { status, message } = response.error;
|
|
373
|
-
const
|
|
374
|
-
|
|
422
|
+
const fix = hint(response, permission, signIn, projectId);
|
|
423
|
+
if (response.status === 401 && notes.length === 0) return failure(fix);
|
|
424
|
+
return failure([
|
|
425
|
+
`${ADAPTER_NAME} couldn't ${action} (${response.status}).`,
|
|
426
|
+
resourceLine(resource),
|
|
427
|
+
...notes,
|
|
428
|
+
...fix.length > 0 ? fix : [[status, message?.slice(0, 300)].filter(Boolean).join(": ")]
|
|
429
|
+
]);
|
|
430
|
+
};
|
|
431
|
+
/** The line that names a secret: its resource name is a line's worth. */
|
|
432
|
+
const resourceLine = (secret) => `Secret: ${secret}`;
|
|
433
|
+
let metadataWarningFiltered = false;
|
|
434
|
+
/**
|
|
435
|
+
* Drops the one warning `gcp-metadata` emits when its probe for a Google
|
|
436
|
+
* runtime fails oddly: credentials are about to be reported as missing, and
|
|
437
|
+
* the warning has nothing to act on. It stays filtered for the process, as
|
|
438
|
+
* the library caches the probe; every other warning passes through.
|
|
439
|
+
* `METADATA_SERVER_DETECTION=none` would also silence it, but skips the probe,
|
|
440
|
+
* and with it the credentials of a Google runtime.
|
|
441
|
+
*/
|
|
442
|
+
const filterMetadataWarning = () => {
|
|
443
|
+
if (metadataWarningFiltered) return;
|
|
444
|
+
metadataWarningFiltered = true;
|
|
445
|
+
const emitWarning = process.emitWarning;
|
|
446
|
+
process.emitWarning = ((warning, ...rest) => {
|
|
447
|
+
if (rest[0] === "MetadataLookupWarning") return;
|
|
448
|
+
Reflect.apply(emitWarning, process, [warning, ...rest]);
|
|
449
|
+
});
|
|
375
450
|
};
|
|
376
451
|
/** Masks a value in the CLI's output, which loads `@hot-updater/cli-tools`. */
|
|
377
452
|
const mask = async (value) => {
|
|
@@ -408,10 +483,11 @@ const createAccessToken = (credentials, projectId) => {
|
|
|
408
483
|
throw error;
|
|
409
484
|
});
|
|
410
485
|
const client = await auth;
|
|
486
|
+
filterMetadataWarning();
|
|
411
487
|
try {
|
|
412
488
|
return await client.getAccessToken() ?? void 0;
|
|
413
489
|
} catch (error) {
|
|
414
|
-
throw
|
|
490
|
+
throw failure([`${ADAPTER_NAME} found no Google credentials.`, ...signInHint(void 0)], error);
|
|
415
491
|
}
|
|
416
492
|
};
|
|
417
493
|
return async () => {
|
|
@@ -433,14 +509,19 @@ const createAccessToken = (credentials, projectId) => {
|
|
|
433
509
|
*/
|
|
434
510
|
const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
435
511
|
const accessToken = createAccessToken(credentials, projectId);
|
|
512
|
+
const requestError = (action, resource, response, permission, notes) => requestErrorOf(signInHint(credentials), projectId, action, resource, response, permission, notes);
|
|
436
513
|
const projectPath = () => {
|
|
437
|
-
if (typeof projectId !== "string" || !PROJECT_PATTERN.test(projectId)) throw
|
|
438
|
-
if (!PREFIX_PATTERN.test(prefix)) throw
|
|
514
|
+
if (typeof projectId !== "string" || !PROJECT_PATTERN.test(projectId)) throw failure([`${ADAPTER_NAME} can't use the projectId ${JSON.stringify(projectId)}.`, "Set the Google Cloud project's ID or number."]);
|
|
515
|
+
if (!PREFIX_PATTERN.test(prefix)) throw failure([`${ADAPTER_NAME} can't use the prefix ${JSON.stringify(prefix)}.`, "It takes letters, digits, \"-\", and \"_\"."]);
|
|
439
516
|
return `projects/${projectId}`;
|
|
440
517
|
};
|
|
441
518
|
const secretId = (name) => {
|
|
442
519
|
const id = `${prefix}${name}`;
|
|
443
|
-
if (!SECRET_ID_PATTERN.test(id)) throw
|
|
520
|
+
if (!SECRET_ID_PATTERN.test(id)) throw failure([
|
|
521
|
+
`${ADAPTER_NAME} can't name a secret ${JSON.stringify(name)}.`,
|
|
522
|
+
`Secret: ${id}`,
|
|
523
|
+
"Secret Manager's IDs take up to 255 letters, digits, \"-\", and \"_\"."
|
|
524
|
+
]);
|
|
444
525
|
return id;
|
|
445
526
|
};
|
|
446
527
|
const request = async (token, method, path, body) => {
|
|
@@ -475,14 +556,18 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
475
556
|
const accessLatest = async (token, secret) => {
|
|
476
557
|
const response = await request(token, "GET", `${secret}/versions/latest:access`);
|
|
477
558
|
if (response.status === 404) return void 0;
|
|
478
|
-
if (!response.ok) throw requestError(
|
|
559
|
+
if (!response.ok) throw requestError("read", secret, response, "roles/secretmanager.secretAccessor on the secret");
|
|
479
560
|
const body = isRecord(response.body) ? response.body : void 0;
|
|
480
561
|
const payload = body?.payload;
|
|
481
562
|
const data = isRecord(payload) ? payload.data : void 0;
|
|
482
|
-
if (typeof data !== "string") throw
|
|
563
|
+
if (typeof data !== "string") throw failure([`${ADAPTER_NAME} read no payload.`, resourceLine(secret)]);
|
|
483
564
|
const bytes = Buffer.from(data, "base64");
|
|
484
565
|
const checksum = isRecord(payload) ? payload.dataCrc32c : void 0;
|
|
485
|
-
if (checksum !== void 0 && Number(checksum) !== crc32c(bytes)) throw
|
|
566
|
+
if (checksum !== void 0 && Number(checksum) !== crc32c(bytes)) throw failure([
|
|
567
|
+
`${ADAPTER_NAME} can't trust what it read.`,
|
|
568
|
+
resourceLine(secret),
|
|
569
|
+
"Its checksum doesn't match its payload."
|
|
570
|
+
]);
|
|
486
571
|
const value = bytes.toString("utf8");
|
|
487
572
|
await mask(value);
|
|
488
573
|
return {
|
|
@@ -515,7 +600,7 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
515
600
|
const readSecret = async (token, secret) => {
|
|
516
601
|
const response = await request(token, "GET", secret);
|
|
517
602
|
if (response.status === 404) return void 0;
|
|
518
|
-
if (!response.ok) throw requestError(
|
|
603
|
+
if (!response.ok) throw requestError("read", secret, response, "secretmanager.secrets.get on the secret");
|
|
519
604
|
return response.body;
|
|
520
605
|
};
|
|
521
606
|
const getOrCreateSecret = async (token, parent, id) => {
|
|
@@ -528,14 +613,19 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
528
613
|
const raced = await readSecret(token, secret);
|
|
529
614
|
if (raced) return raced;
|
|
530
615
|
}
|
|
531
|
-
throw requestError(
|
|
616
|
+
throw requestError("create", secret, created, `secretmanager.secrets.create on ${parent}`);
|
|
532
617
|
};
|
|
533
618
|
const assertCanSet = async (token, secret) => {
|
|
534
619
|
const response = await request(token, "POST", `${secret}:testIamPermissions`, { permissions: SET_PERMISSIONS });
|
|
535
|
-
if (!response.ok) throw requestError(
|
|
620
|
+
if (!response.ok) throw requestError("check its permissions", secret, response, SET_PERMISSIONS.join(", "));
|
|
536
621
|
const held = isRecord(response.body) && Array.isArray(response.body.permissions) ? response.body.permissions : [];
|
|
537
622
|
const missing = SET_PERMISSIONS.filter((name) => !held.includes(name));
|
|
538
|
-
if (missing.length > 0) throw
|
|
623
|
+
if (missing.length > 0) throw failure([
|
|
624
|
+
`${ADAPTER_NAME} can't store a value.`,
|
|
625
|
+
resourceLine(secret),
|
|
626
|
+
`The identity lacks ${missing.join(", ")} on it.`,
|
|
627
|
+
"Grant roles/secretmanager.admin."
|
|
628
|
+
]);
|
|
539
629
|
};
|
|
540
630
|
/**
|
|
541
631
|
* Destroys `version` of `secret`: true once it is destroyed, or already
|
|
@@ -568,10 +658,11 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
568
658
|
/**
|
|
569
659
|
* Adds `value` as the secret's newest version, creating the secret when
|
|
570
660
|
* it is missing, and waits until the `latest` alias resolves to it. Then
|
|
571
|
-
* it destroys the
|
|
572
|
-
* `hot-updater-versions` annotation lists
|
|
573
|
-
*
|
|
574
|
-
*
|
|
661
|
+
* it destroys the versions this adapter added before the previous one,
|
|
662
|
+
* which the secret's `hot-updater-versions` annotation lists, keeping
|
|
663
|
+
* the previous value: versions added any other way are never touched.
|
|
664
|
+
* The permissions this needs are checked on the secret, once it exists,
|
|
665
|
+
* before any version is added. A version that could not be destroyed stays
|
|
575
666
|
* listed for the next `set`. The annotation is updated against the
|
|
576
667
|
* secret's etag, so a concurrent `set` loses no listed version. When
|
|
577
668
|
* `latest` does not resolve to the new version in time, or the
|
|
@@ -582,7 +673,7 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
582
673
|
const parent = projectPath();
|
|
583
674
|
const id = secretId(name);
|
|
584
675
|
const secret = `${parent}/secrets/${id}`;
|
|
585
|
-
if (typeof value !== "string" || value === "") throw
|
|
676
|
+
if (typeof value !== "string" || value === "") throw failure([`${ADAPTER_NAME} can't store an empty value.`, resourceLine(secret)]);
|
|
586
677
|
await mask(value);
|
|
587
678
|
const token = await accessToken();
|
|
588
679
|
const current = await getOrCreateSecret(token, parent, id);
|
|
@@ -593,17 +684,20 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
593
684
|
dataCrc32c: String(crc32c(data))
|
|
594
685
|
} });
|
|
595
686
|
const version = versionOf(isRecord(added.body) ? added.body.name : void 0);
|
|
596
|
-
if (!added.ok || !VERSION_ID_PATTERN.test(version)) throw requestError(
|
|
687
|
+
if (!added.ok || !VERSION_ID_PATTERN.test(version)) throw requestError("add a version", secret, added, "secretmanager.versions.add on the secret");
|
|
688
|
+
const own = trackedVersions(current).filter((entry) => Number(entry) < Number(version));
|
|
689
|
+
const previous = own.reduce((newest, entry) => newest === void 0 || Number(entry) > Number(newest) ? entry : newest, void 0);
|
|
597
690
|
const visible = await waitForLatest(token, secret, version);
|
|
598
691
|
const destroyed = /* @__PURE__ */ new Set();
|
|
599
692
|
if (visible) {
|
|
600
|
-
const older =
|
|
693
|
+
const older = own.filter((entry) => entry !== previous);
|
|
601
694
|
const results = await Promise.all(older.map((entry) => destroy(token, secret, entry)));
|
|
602
695
|
older.forEach((entry, index) => {
|
|
603
696
|
if (results[index]) destroyed.add(entry);
|
|
604
697
|
});
|
|
605
698
|
}
|
|
606
|
-
const notListed = `
|
|
699
|
+
const notListed = `record version ${version}, which it stored`;
|
|
700
|
+
const notDestroyed = `The next set won't destroy it: ${VERSIONS_ANNOTATION} misses it.`;
|
|
607
701
|
let base = current;
|
|
608
702
|
let updated;
|
|
609
703
|
try {
|
|
@@ -612,7 +706,11 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
612
706
|
await delay(LATEST_RETRY_DELAYS_MS[attempt - 1] ?? 0);
|
|
613
707
|
base = await readSecret(token, secret) ?? {};
|
|
614
708
|
}
|
|
615
|
-
const listed = [.../* @__PURE__ */ new Set([
|
|
709
|
+
const listed = [.../* @__PURE__ */ new Set([
|
|
710
|
+
version,
|
|
711
|
+
...previous === void 0 ? [] : [previous],
|
|
712
|
+
...trackedVersions(base)
|
|
713
|
+
])].filter((entry) => !destroyed.has(entry));
|
|
616
714
|
updated = await request(token, "PATCH", `${secret}?updateMask=annotations`, {
|
|
617
715
|
...base.etag === void 0 ? {} : { etag: base.etag },
|
|
618
716
|
annotations: {
|
|
@@ -623,14 +721,24 @@ const secretManager = ({ projectId, prefix = "hot-updater-", credentials }) => {
|
|
|
623
721
|
if (updated.error.status !== "FAILED_PRECONDITION") break;
|
|
624
722
|
}
|
|
625
723
|
} catch (error) {
|
|
626
|
-
throw
|
|
724
|
+
throw failure([
|
|
725
|
+
`${ADAPTER_NAME} couldn't ${notListed}.`,
|
|
726
|
+
resourceLine(secret),
|
|
727
|
+
error instanceof Error ? error.message : String(error),
|
|
728
|
+
notDestroyed
|
|
729
|
+
], error);
|
|
627
730
|
}
|
|
628
|
-
if (!updated?.ok) throw requestError(notListed, updated, "secretmanager.secrets.update on the secret");
|
|
629
|
-
if (!visible) throw
|
|
731
|
+
if (!updated?.ok) throw requestError(notListed, secret, updated, "secretmanager.secrets.update on the secret", [notDestroyed]);
|
|
732
|
+
if (!visible) throw failure([
|
|
733
|
+
`${ADAPTER_NAME} stored version ${version}.`,
|
|
734
|
+
resourceLine(secret),
|
|
735
|
+
"Its latest alias doesn't resolve to that version yet.",
|
|
736
|
+
"It kept the versions it added before: the next set destroys them."
|
|
737
|
+
]);
|
|
630
738
|
},
|
|
631
739
|
describe: (name) => {
|
|
632
740
|
const id = `${prefix}${name}`;
|
|
633
|
-
return `
|
|
741
|
+
return `the secret ${JSON.stringify(id)} in Google Secret Manager (https://console.cloud.google.com/security/secret-manager/secret/${encodeURIComponent(id)}/versions?project=${encodeURIComponent(projectId)})`;
|
|
634
742
|
}
|
|
635
743
|
};
|
|
636
744
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -11,9 +11,8 @@ type FirebaseDatabaseConfig = AppOptions & {
|
|
|
11
11
|
readonly collection?: string;
|
|
12
12
|
/**
|
|
13
13
|
* Firestore bills each document write, so Insights' aggregates are
|
|
14
|
-
* batched: through log rows a compaction merges (the default)
|
|
15
|
-
*
|
|
16
|
-
* each event.
|
|
14
|
+
* batched: through log rows a compaction merges (the default). `false` commits
|
|
15
|
+
* them with each event.
|
|
17
16
|
*/
|
|
18
17
|
readonly aggregateBatching?: EngineDatabase["aggregateBatching"] | false;
|
|
19
18
|
};
|
|
@@ -37,7 +36,7 @@ interface FirebaseStorageConfig extends AppOptions {
|
|
|
37
36
|
/** Firebase signed URL lifetime in seconds. @default 3600 */
|
|
38
37
|
signedUrlExpiresIn?: number;
|
|
39
38
|
}
|
|
40
|
-
declare const firebaseStorage: (config: FirebaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
39
|
+
declare const firebaseStorage: (config: FirebaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete" | "listObjects" | "deleteObjects">;
|
|
41
40
|
//#endregion
|
|
42
41
|
//#region src/secretManager.d.ts
|
|
43
42
|
/**
|
|
@@ -56,7 +55,7 @@ interface SecretManagerOptions {
|
|
|
56
55
|
/** The Google Cloud project ID or number that holds the secrets. */
|
|
57
56
|
readonly projectId: string;
|
|
58
57
|
/**
|
|
59
|
-
* Put before each name to make its secret ID, so `secret
|
|
58
|
+
* Put before each name to make its secret ID, so `secret("asc-api-key")`
|
|
60
59
|
* reads `hot-updater-asc-api-key`. Letters, digits, `-`, and `_`.
|
|
61
60
|
*
|
|
62
61
|
* @default "hot-updater-"
|
package/dist/index.d.mts
CHANGED
|
@@ -11,9 +11,8 @@ type FirebaseDatabaseConfig = AppOptions & {
|
|
|
11
11
|
readonly collection?: string;
|
|
12
12
|
/**
|
|
13
13
|
* Firestore bills each document write, so Insights' aggregates are
|
|
14
|
-
* batched: through log rows a compaction merges (the default)
|
|
15
|
-
*
|
|
16
|
-
* each event.
|
|
14
|
+
* batched: through log rows a compaction merges (the default). `false` commits
|
|
15
|
+
* them with each event.
|
|
17
16
|
*/
|
|
18
17
|
readonly aggregateBatching?: EngineDatabase["aggregateBatching"] | false;
|
|
19
18
|
};
|
|
@@ -37,7 +36,7 @@ interface FirebaseStorageConfig extends AppOptions {
|
|
|
37
36
|
/** Firebase signed URL lifetime in seconds. @default 3600 */
|
|
38
37
|
signedUrlExpiresIn?: number;
|
|
39
38
|
}
|
|
40
|
-
declare const firebaseStorage: (config: FirebaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
39
|
+
declare const firebaseStorage: (config: FirebaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete" | "listObjects" | "deleteObjects">;
|
|
41
40
|
//#endregion
|
|
42
41
|
//#region src/secretManager.d.ts
|
|
43
42
|
/**
|
|
@@ -56,7 +55,7 @@ interface SecretManagerOptions {
|
|
|
56
55
|
/** The Google Cloud project ID or number that holds the secrets. */
|
|
57
56
|
readonly projectId: string;
|
|
58
57
|
/**
|
|
59
|
-
* Put before each name to make its secret ID, so `secret
|
|
58
|
+
* Put before each name to make its secret ID, so `secret("asc-api-key")`
|
|
60
59
|
* reads `hot-updater-asc-api-key`. Letters, digits, `-`, and `_`.
|
|
61
60
|
*
|
|
62
61
|
* @default "hot-updater-"
|