@rebasepro/server 0.25.0-canary.ge06257e → 0.25.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/{GCSStorageController-CAKa_EFW.js → GCSStorageController-C7ARrDAp.js} +3 -3
- package/dist/{GCSStorageController-CAKa_EFW.js.map → GCSStorageController-C7ARrDAp.js.map} +1 -1
- package/dist/{S3StorageController-Kt-LJpf3.js → S3StorageController-qevJ0pVE.js} +3 -3
- package/dist/{S3StorageController-Kt-LJpf3.js.map → S3StorageController-qevJ0pVE.js.map} +1 -1
- package/dist/api/errors.d.ts +6 -10
- package/dist/{auth-xk37vrHO.js → auth-CteGWxsL.js} +20 -20
- package/dist/{auth-xk37vrHO.js.map → auth-CteGWxsL.js.map} +1 -1
- package/dist/{backup-CpaJWXSc.js → backup-Dq0lyJ_D.js} +4 -4
- package/dist/{backup-CpaJWXSc.js.map → backup-Dq0lyJ_D.js.map} +1 -1
- package/dist/boot/boot.d.ts +10 -0
- package/dist/{cron-routes-CPIhdasM.js → cron-routes-Dhf82HzT.js} +3 -3
- package/dist/{cron-routes-CPIhdasM.js.map → cron-routes-Dhf82HzT.js.map} +1 -1
- package/dist/{errors-CHSJYpoy.js → errors-_ytoGi8A.js} +11 -18
- package/dist/errors-_ytoGi8A.js.map +1 -0
- package/dist/{function-routes-C0emkHtX.js → function-routes-DNV4RUF0.js} +2 -2
- package/dist/{function-routes-C0emkHtX.js.map → function-routes-DNV4RUF0.js.map} +1 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/index.es.js +128 -41
- package/dist/index.es.js.map +1 -1
- package/dist/{logs-routes-BM2cDory.js → logs-routes-CelTiS7C.js} +2 -2
- package/dist/{logs-routes-BM2cDory.js.map → logs-routes-CelTiS7C.js.map} +1 -1
- package/dist/{openapi-generator-IKwDAQGO.js → openapi-generator-BamY6-ga.js} +2 -2
- package/dist/{openapi-generator-IKwDAQGO.js.map → openapi-generator-BamY6-ga.js.map} +1 -1
- package/dist/{query-parser-BnhugNwZ.js → query-parser-CGohjyWI.js} +3 -3
- package/dist/{query-parser-BnhugNwZ.js.map → query-parser-CGohjyWI.js.map} +1 -1
- package/dist/{request-timeout-LiGpCCP1.js → request-timeout-CRny5KD0.js} +2 -2
- package/dist/{request-timeout-LiGpCCP1.js.map → request-timeout-CRny5KD0.js.map} +1 -1
- package/dist/{schema-editor-routes-zjVKreVQ.js → schema-editor-routes-CnNGCayU.js} +2 -2
- package/dist/{schema-editor-routes-zjVKreVQ.js.map → schema-editor-routes-CnNGCayU.js.map} +1 -1
- package/dist/{soft-delete-params-uHxJoETb.js → soft-delete-params-BAgpmBvp.js} +2 -2
- package/dist/{soft-delete-params-uHxJoETb.js.map → soft-delete-params-BAgpmBvp.js.map} +1 -1
- package/dist/{sql-export-routes-D86u7N9i.js → sql-export-routes-BgTJ7K3S.js} +2 -2
- package/dist/{sql-export-routes-D86u7N9i.js.map → sql-export-routes-BgTJ7K3S.js.map} +1 -1
- package/dist/{upload-validation-pXcDy_EQ.js → upload-validation-I9cCUBIW.js} +2 -2
- package/dist/{upload-validation-pXcDy_EQ.js.map → upload-validation-I9cCUBIW.js.map} +1 -1
- package/package.json +5 -5
- package/dist/errors-CHSJYpoy.js.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -7,37 +7,37 @@ import { a as MAX_LIST_LIMIT, c as RebaseClientError, l as isUnsupported, n as s
|
|
|
7
7
|
import { C as isFieldOperation, T as EntityRelation, _ as normalizeOrderBy, b as BATCH_REF_KEY, c as collectAllPages, g as OrderBySpecError, l as paginateFind, m as normalizeInclude, p as mergeIncludeSpecs, r as deserializeFilter, t as RESERVED_QUERY_KEYS, u as resolveFindWindow, v as serializeOrderBy, x as FIELD_OPERATORS, y as withRelationReferencesOnly } from "./filter-dialect-O1HK6Nvr.js";
|
|
8
8
|
import { A as DEFAULT_RESOURCE_KEY, C as declaredSubscriptions, D as setTopicRuntime, E as setQueueRuntime, F as resourceKind, G as DEFAULT_DATA_SOURCE_KEY, H as getDeclaredSubcollections, I as resourceKinds, K as getDataSourceCapabilities, L as RLS_JWT_SQL, M as resolveResourceRefs, N as resourceEnvSuffix, O as DEFAULT_STORAGE_SOURCE_KEY, P as resourceKeyOf, R as RLS_ROLES_SQL, S as declaredQueueConsumers, T as resourceToStorageSource, U as isPostgresCollectionConfig, V as getCollectionDataPath, _ as scopesForRoles, c as intersectScopes, et as sortKeyToString, h as scopeGrantsAny, j as buildResourceGraph, k as storageEnvSuffix, m as scopeGrants, p as parseScope, q as ALL_WHERE_FILTER_OPS, s as hasAdminRole, w as resourceToDataSource, y as summarizeScopes, z as RLS_UID_SQL } from "./src-D5Y3N-S4.js";
|
|
9
9
|
import { a as nestCollectionPatchPaths, c as ADMIN_PROPERTY_KEYS, i as isCollectionPatch, n as collectionPatchProblems, r as diffCollections, s as ADMIN_COLLECTION_KEYS, t as applyCollectionPatch } from "./collection_patch-BRu-BvDv.js";
|
|
10
|
-
import { a as softDeleteFieldOf, c as JUNCTION_PIVOT_KEY, i as restoresSoftDeletedRow, l as hasForeignKeyOnTarget, n as buildCollectionSchema, o as buildTenantSecurityRule, s as INCLUDE_COUNT_KEY, t as buildCollectionInputSchema, u as isManyToMany } from "./openapi-generator-
|
|
10
|
+
import { a as softDeleteFieldOf, c as JUNCTION_PIVOT_KEY, i as restoresSoftDeletedRow, l as hasForeignKeyOnTarget, n as buildCollectionSchema, o as buildTenantSecurityRule, s as INCLUDE_COUNT_KEY, t as buildCollectionInputSchema, u as isManyToMany } from "./openapi-generator-BamY6-ga.js";
|
|
11
11
|
import { n as isAnonymousUid, r as policy } from "./policy-PdzX-Opd.js";
|
|
12
12
|
import { n as isSchemaEditingAdmin, t as isSQLAdmin } from "./backend-DTAOsLQc.js";
|
|
13
13
|
import { a as parseEnvBoolean, i as validateCronExpression, t as CronScheduler } from "./cron-scheduler-D1DT0nw5.js";
|
|
14
14
|
import { n as isValidAppHost, r as reservedPrefixFor, t as SCHEMA_VERSION_HEADER } from "./project_manifest-R6y_KHms.js";
|
|
15
15
|
import { n as createContractRoutes, r as computeSchemaVersion } from "./contract-routes-DiFwiLg2.js";
|
|
16
|
-
import { $ as optionalAuth, $t as raw, A as createAuthLimiters, At as setDefaultAccessControl, B as registerDevEmailSink, Bt as resolveEmailLinkBase, C as createPersonalKeyRoutes, Ct as configureAccess, D as configureUserPicking, Dt as processAccessControl, E as createBuiltinAuthAdapter, Et as keyOwnerResolverFor, F as MemoryRateLimitStore, Ft as supportsRlsScoping, G as validatePasswordStrength, Gt as getMagicLinkTemplate, H as createEmailService, Ht as getEmailChangeTemplate, I as activeDevEmailSink, It as isAccessTokenRevoked, J as createAdapterAuthMiddleware, Jt as getWelcomeEmailTemplate, K as verifyPassword, Kt as getPasswordResetTemplate, L as clearActiveDevEmailSink, Lt as completeUserCreation, M as createDataRateLimiter, Mt as safeCompare, N as createRateLimiter, Nt as SERVICE_IDENTITY, O as isBootstrapWindowOpen, Ot as requireScope, P as setSharedRateLimitStore, Pt as scopeDataDriver, Q as fileTokenAuth, Qt as html, R as createDevEmailSink, Rt as generateSecurePassword, S as createApiKeyRoutes, St as callerScopes, T as createJwksRoutes, Tt as hasScope, U as resolveAuthHooks, Ut as getEmailOtpTemplate, V as SMTPEmailService, Vt as getEmailChangeNoticeTemplate, W as hashPassword, Wt as getEmailVerificationTemplate, X as createRequireAuth, Xt as RawHtml, Y as createAuthMiddleware, Yt as resolveEmailBranding, Z as extractUserFromToken, Zt as escapeHtml, _ as oauthCodeFlowSchema, _t as isApiKeyToken, a as createBitbucketProvider, an as storageObjectPath, at as userFromToken, b as resolveRateLimitStoreKind, bt as accessModelFromCollections, c as createTwitterProvider, ct as isPublicObjectGrant, d as createMicrosoftProvider, dt as storageRequestWildcard, en as httpMethodToOperation, et as publicObjectAuth, f as tryVerifyOidcIdToken, ft as decideImpersonation, g as createGoogleProvider, gt as createTusScopeGuard, h as createLinkedinProvider, ht as createFunctionScopeGuard, i as createSlackProvider, in as isPublicStoragePath, it as requireAuth, j as createDataRateLimitCheck, jt as extractBearerToken, k as DEFAULT_FUNCTIONS_ANONYMOUS_LIMIT, kt as requireScopeByMethod, l as createFacebookProvider, lt as requestedStorageObject, m as createGitHubProvider, mt as createApiKeyPreAuth, n as createCustomAuthAdapter, nn as PUBLIC_STORAGE_PREFIX, nt as refuse$1, o as createGitLabProvider, ot as PUBLIC_OBJECT_PRINCIPAL, p as verifyOidcIdToken, pt as refuseUnhonouredImpersonation, q as adapterRefusal, qt as getUserInvitationTemplate, r as createSpotifyProvider, rn as isPublicStorageKey, rt as requireAdmin, s as createDiscordProvider, st as isDownloadTokenGrant, tn as securityRuleToConditions, tt as queryTokenAuth, u as createAppleProvider, ut as storageObjectOfPath, v as pkceTokenParams, vt as resolveApiKey, w as createApiKeyStore, wt as getAccessModel, x as createSqlRateLimitStore, xt as accessOf, y as providerVerifiedEmail, yt as validateApiKey, z as extractLinks, zt as assertEmailLinkBases } from "./auth-
|
|
16
|
+
import { $ as optionalAuth, $t as raw, A as createAuthLimiters, At as setDefaultAccessControl, B as registerDevEmailSink, Bt as resolveEmailLinkBase, C as createPersonalKeyRoutes, Ct as configureAccess, D as configureUserPicking, Dt as processAccessControl, E as createBuiltinAuthAdapter, Et as keyOwnerResolverFor, F as MemoryRateLimitStore, Ft as supportsRlsScoping, G as validatePasswordStrength, Gt as getMagicLinkTemplate, H as createEmailService, Ht as getEmailChangeTemplate, I as activeDevEmailSink, It as isAccessTokenRevoked, J as createAdapterAuthMiddleware, Jt as getWelcomeEmailTemplate, K as verifyPassword, Kt as getPasswordResetTemplate, L as clearActiveDevEmailSink, Lt as completeUserCreation, M as createDataRateLimiter, Mt as safeCompare, N as createRateLimiter, Nt as SERVICE_IDENTITY, O as isBootstrapWindowOpen, Ot as requireScope, P as setSharedRateLimitStore, Pt as scopeDataDriver, Q as fileTokenAuth, Qt as html, R as createDevEmailSink, Rt as generateSecurePassword, S as createApiKeyRoutes, St as callerScopes, T as createJwksRoutes, Tt as hasScope, U as resolveAuthHooks, Ut as getEmailOtpTemplate, V as SMTPEmailService, Vt as getEmailChangeNoticeTemplate, W as hashPassword, Wt as getEmailVerificationTemplate, X as createRequireAuth, Xt as RawHtml, Y as createAuthMiddleware, Yt as resolveEmailBranding, Z as extractUserFromToken, Zt as escapeHtml, _ as oauthCodeFlowSchema, _t as isApiKeyToken, a as createBitbucketProvider, an as storageObjectPath, at as userFromToken, b as resolveRateLimitStoreKind, bt as accessModelFromCollections, c as createTwitterProvider, ct as isPublicObjectGrant, d as createMicrosoftProvider, dt as storageRequestWildcard, en as httpMethodToOperation, et as publicObjectAuth, f as tryVerifyOidcIdToken, ft as decideImpersonation, g as createGoogleProvider, gt as createTusScopeGuard, h as createLinkedinProvider, ht as createFunctionScopeGuard, i as createSlackProvider, in as isPublicStoragePath, it as requireAuth, j as createDataRateLimitCheck, jt as extractBearerToken, k as DEFAULT_FUNCTIONS_ANONYMOUS_LIMIT, kt as requireScopeByMethod, l as createFacebookProvider, lt as requestedStorageObject, m as createGitHubProvider, mt as createApiKeyPreAuth, n as createCustomAuthAdapter, nn as PUBLIC_STORAGE_PREFIX, nt as refuse$1, o as createGitLabProvider, ot as PUBLIC_OBJECT_PRINCIPAL, p as verifyOidcIdToken, pt as refuseUnhonouredImpersonation, q as adapterRefusal, qt as getUserInvitationTemplate, r as createSpotifyProvider, rn as isPublicStorageKey, rt as requireAdmin, s as createDiscordProvider, st as isDownloadTokenGrant, tn as securityRuleToConditions, tt as queryTokenAuth, u as createAppleProvider, ut as storageObjectOfPath, v as pkceTokenParams, vt as resolveApiKey, w as createApiKeyStore, wt as getAccessModel, x as createSqlRateLimitStore, xt as accessOf, y as providerVerifiedEmail, yt as validateApiKey, z as extractLinks, zt as assertEmailLinkBases } from "./auth-CteGWxsL.js";
|
|
17
17
|
import { a as redactSensitiveText, i as rawQueryLoggingEnabled, l as hostEnv, n as describeCauseChain, o as setLogLevel, r as logger, s as setLogOutput } from "./logger-Bt32sHFw.js";
|
|
18
|
-
import { a as apiHiddenFieldNames, c as fieldKeyForColumn, d as isJunctionBackedRelation, g as toWireKey, h as resolveRelation, l as findRelation, m as resolveCollectionRelations, n as HARD_DELETE_QUERY_PARAM, p as relationDeclaringProperty, r as parseHardDelete, s as restrictedFieldNames, u as getTableName } from "./soft-delete-params-
|
|
18
|
+
import { a as apiHiddenFieldNames, c as fieldKeyForColumn, d as isJunctionBackedRelation, g as toWireKey, h as resolveRelation, l as findRelation, m as resolveCollectionRelations, n as HARD_DELETE_QUERY_PARAM, p as relationDeclaringProperty, r as parseHardDelete, s as restrictedFieldNames, u as getTableName } from "./soft-delete-params-BAgpmBvp.js";
|
|
19
19
|
import { c as createTransport, d as parseRebaseJson, h as unref, l as defaultCodeForStatus, m as withETag, o as createCollectionClient, p as etagOf, r as SDKQueryBuilder, u as invalidBulkBody } from "./offline-store-BhYXViha-BW5j1We_.js";
|
|
20
20
|
import "./resumable-upload-threshold-CKv-Ry0l.js";
|
|
21
21
|
import { n as revokeInternalTableSql } from "./internal-tables-L2t39RdT.js";
|
|
22
22
|
import { i as warnDeprecated } from "./load-failure-L5hvfDoG.js";
|
|
23
|
-
import { a as resolveListLimitParam, c as assertReadableFields, d as decodeCursor$1, f as reconcileCursorOrder, i as parseQueryOptions, l as requestViewer, n as parseAggregateSelect, o as assertNoHiddenAggregateNames, r as parseGroupBy, s as assertQueryFieldsReadable, t as orderByEntriesToTuples, u as cursorToStartAfter } from "./query-parser-
|
|
24
|
-
import { a as isDataException, i as errorHandler, n as DATABASE_UNAVAILABLE_MESSAGE, o as isDatabaseUnreachable, r as declaredErrorAnswer, s as schemaDriftRemedy, t as ApiError } from "./errors-
|
|
23
|
+
import { a as resolveListLimitParam, c as assertReadableFields, d as decodeCursor$1, f as reconcileCursorOrder, i as parseQueryOptions, l as requestViewer, n as parseAggregateSelect, o as assertNoHiddenAggregateNames, r as parseGroupBy, s as assertQueryFieldsReadable, t as orderByEntriesToTuples, u as cursorToStartAfter } from "./query-parser-CGohjyWI.js";
|
|
24
|
+
import { a as isDataException, i as errorHandler, n as DATABASE_UNAVAILABLE_MESSAGE, o as isDatabaseUnreachable, r as declaredErrorAnswer, s as schemaDriftRemedy, t as ApiError } from "./errors-_ytoGi8A.js";
|
|
25
25
|
import { C as randomHex, E as sha256Hex, S as constantTimeEqual, T as sha256Bytes, b as normalizePemFromEnv, d as hasAsymmetricSigningKey, g as setDefaultJwtService, h as processJwtService, l as getJwks, m as jwtOf, n as configureJwt, r as createJwtService, y as verifyJwt } from "./jwt-YhciR93H.js";
|
|
26
26
|
import { a as canonicalStorageId, i as canonicalStorageBucket, n as InvalidStorageBucketError, o as canonicalStorageKey, r as InvalidStorageKeyError, t as InvalidListOptionsError } from "./keys-COzQ2aE8.js";
|
|
27
|
-
import { t as logMiddleware } from "./logs-routes-
|
|
28
|
-
import { a as readStreamFully, c as DOCUMENT_MIME_TYPES, i as fileWebStream, l as IMAGE_MIME_TYPES, r as bytesView, s as DEFAULT_MAX_FILE_SIZE, t as validateUploadedFile } from "./upload-validation-
|
|
29
|
-
import { t as S3StorageController } from "./S3StorageController-
|
|
30
|
-
import { t as GCSStorageController } from "./GCSStorageController-
|
|
27
|
+
import { t as logMiddleware } from "./logs-routes-CelTiS7C.js";
|
|
28
|
+
import { a as readStreamFully, c as DOCUMENT_MIME_TYPES, i as fileWebStream, l as IMAGE_MIME_TYPES, r as bytesView, s as DEFAULT_MAX_FILE_SIZE, t as validateUploadedFile } from "./upload-validation-I9cCUBIW.js";
|
|
29
|
+
import { t as S3StorageController } from "./S3StorageController-qevJ0pVE.js";
|
|
30
|
+
import { t as GCSStorageController } from "./GCSStorageController-C7ARrDAp.js";
|
|
31
31
|
import { a as isDuplicateObjectRace, i as isConcurrentDdlRace, n as createDdlBootstrapper, t as CONCURRENT_DDL_SQLSTATES } from "./ddl-bootstrap-BNqi2NZe.js";
|
|
32
32
|
import { t as createCronStore } from "./cron-store-DEpVstUU.js";
|
|
33
33
|
import { i as loadFunctionsWithDiagnostics, n as loadFunctions, r as loadFunctionsFromDirectory } from "./function-loader-DbCSoNJj.js";
|
|
34
|
-
import { a as getDriver, c as getUser, d as identityResolved, f as isAdmin, i as getApiKey, l as getUserId, m as requireDriver, o as getRequestId, p as isAuthenticated, r as requireRole, s as getRoles, t as createFunctionRoutes, u as hasRole } from "./function-routes-
|
|
34
|
+
import { a as getDriver, c as getUser, d as identityResolved, f as isAdmin, i as getApiKey, l as getUserId, m as requireDriver, o as getRequestId, p as isAuthenticated, r as requireRole, s as getRoles, t as createFunctionRoutes, u as hasRole } from "./function-routes-DNV4RUF0.js";
|
|
35
35
|
import "./proxy-BEKbsil6.js";
|
|
36
|
-
import "./request-timeout-
|
|
36
|
+
import "./request-timeout-CRny5KD0.js";
|
|
37
37
|
import { t as FunctionSelectionError } from "./selection-CRpqKUbt.js";
|
|
38
38
|
import { a as loadCrons, i as loadCronJobsWithDiagnostics, n as declareCrons, r as loadCronJobsFromDirectory } from "./cron-loader-NHqRfKF0.js";
|
|
39
|
-
import { t as createCronRoutes } from "./cron-routes-
|
|
40
|
-
import { a as listBackupObjects, c as readBackupBytes, i as backupStorageFromEnv, n as createBackupLinkRoutes, o as parseBackupDestination, r as createBackupRoutes, s as parseBackupTimestamp } from "./backup-
|
|
39
|
+
import { t as createCronRoutes } from "./cron-routes-Dhf82HzT.js";
|
|
40
|
+
import { a as listBackupObjects, c as readBackupBytes, i as backupStorageFromEnv, n as createBackupLinkRoutes, o as parseBackupDestination, r as createBackupRoutes, s as parseBackupTimestamp } from "./backup-Dq0lyJ_D.js";
|
|
41
41
|
import { a as defaultBackoff, i as createJobQueue, n as createJobStore, o as currentAmbientTransaction, r as PermanentJobError } from "./jobs-8G-_agld.js";
|
|
42
42
|
import { t as METRIC_SERIES } from "./history-store-DPofGVDp.js";
|
|
43
43
|
import { createHash, createSign, randomBytes } from "node:crypto";
|
|
@@ -92,6 +92,41 @@ import { pipeline as pipeline$1 } from "node:stream/promises";
|
|
|
92
92
|
*/
|
|
93
93
|
var DEFAULT_COMMIT_PATHS = { schemaFile: "backend/src/schema.generated.ts" };
|
|
94
94
|
//#endregion
|
|
95
|
+
//#region ../types/src/types/content_hash.ts
|
|
96
|
+
/**
|
|
97
|
+
* Whether a static build's file name carries a content hash: the files the
|
|
98
|
+
* runtime serves `immutable` for a year, and the ones `rebase build` writes
|
|
99
|
+
* `.br` and `.gz` beside. One rule for both, so a file is never precompressed
|
|
100
|
+
* and revalidated, or cached for a year and compressed on every request.
|
|
101
|
+
*
|
|
102
|
+
* Two shapes count:
|
|
103
|
+
*
|
|
104
|
+
* - **Vite's own**, `[name]-[hash]`: the last eight characters of the name,
|
|
105
|
+
* after a `-`. They are base64url, an alphabet with `-` and `_` in it, so
|
|
106
|
+
* about one hash in eight holds a `-` (`index-C-WpENHZ.js`,
|
|
107
|
+
* `page10-D6Dq--fD.js`), and the last `-` is not where it starts.
|
|
108
|
+
* - **A longer one** with no `-` in it, eight characters or more after the last
|
|
109
|
+
* `-` (`[hash:12]`, another bundler's names).
|
|
110
|
+
*
|
|
111
|
+
* Either must hold a digit or a capital. That is the evidence of a hash: a
|
|
112
|
+
* hand-written `vendor-analytics.js` is not taken for one, and gets revalidated
|
|
113
|
+
* rather than pinned in every visitor's cache with no way to recall it.
|
|
114
|
+
*/
|
|
115
|
+
function isContentHashedFileName(fileName) {
|
|
116
|
+
const dot = fileName.lastIndexOf(".");
|
|
117
|
+
if (dot <= 0) return false;
|
|
118
|
+
const stem = fileName.slice(0, dot);
|
|
119
|
+
if (stem.length > 9 && stem[stem.length - 9] === "-" && looksLikeHash(stem.slice(-8))) return true;
|
|
120
|
+
const dash = stem.lastIndexOf("-");
|
|
121
|
+
if (dash < 0) return false;
|
|
122
|
+
const suffix = stem.slice(dash + 1);
|
|
123
|
+
return suffix.length >= 8 && looksLikeHash(suffix);
|
|
124
|
+
}
|
|
125
|
+
/** Base64url throughout, with a digit or a capital somewhere in it. */
|
|
126
|
+
function looksLikeHash(text) {
|
|
127
|
+
return /^[A-Za-z0-9_-]+$/.test(text) && /[0-9A-Z]/.test(text);
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
95
130
|
//#region ../types/src/controllers/storage-references.ts
|
|
96
131
|
/**
|
|
97
132
|
* The scheme of a **storage reference**: a stored object named inside text.
|
|
@@ -18407,11 +18442,11 @@ async function createStorageController(config) {
|
|
|
18407
18442
|
switch (config.type) {
|
|
18408
18443
|
case "local": return new LocalStorageController(config);
|
|
18409
18444
|
case "s3": {
|
|
18410
|
-
const { S3StorageController } = await import("./S3StorageController-
|
|
18445
|
+
const { S3StorageController } = await import("./S3StorageController-qevJ0pVE.js").then((n) => n.n);
|
|
18411
18446
|
return new S3StorageController(config);
|
|
18412
18447
|
}
|
|
18413
18448
|
case "gcs": {
|
|
18414
|
-
const { GCSStorageController } = await import("./GCSStorageController-
|
|
18449
|
+
const { GCSStorageController } = await import("./GCSStorageController-C7ARrDAp.js").then((n) => n.n);
|
|
18415
18450
|
return new GCSStorageController(config);
|
|
18416
18451
|
}
|
|
18417
18452
|
default: throw new Error(`Unknown storage type: ${config.type}. Built-in types: local, s3, gcs. For other providers, implement the StorageController interface directly.`);
|
|
@@ -18650,7 +18685,7 @@ function noCollectionsCause(unprotected) {
|
|
|
18650
18685
|
* routes wherever and as often as the application asks.
|
|
18651
18686
|
*/
|
|
18652
18687
|
async function loadOpenApiGenerator() {
|
|
18653
|
-
const { generateOpenApiSpec } = await import("./openapi-generator-
|
|
18688
|
+
const { generateOpenApiSpec } = await import("./openapi-generator-BamY6-ga.js").then((n) => n.r);
|
|
18654
18689
|
return generateOpenApiSpec;
|
|
18655
18690
|
}
|
|
18656
18691
|
/**
|
|
@@ -25207,8 +25242,14 @@ function assertNoSharedLocation(resolved, env, options) {
|
|
|
25207
25242
|
if (other) {
|
|
25208
25243
|
const [moved, kept] = key === "(default)" ? [other.key, key] : [key, other.key];
|
|
25209
25244
|
const movedLocation = moved === key ? location : other.location;
|
|
25245
|
+
const keptLocation = moved === key ? other.location : location;
|
|
25210
25246
|
const variable = `${movedLocation.variable}${envSuffixForKey(moved, DEFAULT_STORAGE_SOURCE_KEY)}`;
|
|
25211
|
-
|
|
25247
|
+
const alias = kept === "(default)" ? ` If uploads that name no \`storageSource\` belong in "${moved}", mark it instead — bucket("${moved}", { default: true }).` : "";
|
|
25248
|
+
if (movedLocation.local !== void 0 && keptLocation.local !== void 0 && movedLocation.local !== keptLocation.local) {
|
|
25249
|
+
const inside = movedLocation.local.startsWith(keptLocation.local + path$1.sep);
|
|
25250
|
+
throw new BundleError(`Storage source "${moved}" would store its files in ${movedLocation.local}, which ${inside ? "is inside" : "holds"} ${keptLocation.local}, where "${kept}" stores its own, so each would list, serve and delete the other's files.`, `Give "${moved}" a directory ${inside ? "outside" : "apart from"} ${keptLocation.local} with ${variable} (it is ${movedLocation.local} now).${alias}`);
|
|
25251
|
+
}
|
|
25252
|
+
throw new BundleError(`Storage sources "${moved}" and "${kept}" would both store files in ${movedLocation.describe}, so each would list, serve and delete the other's files.`, `Give "${moved}" a ${movedLocation.local !== void 0 ? "directory" : "bucket"} of its own with ${variable}.${alias}`);
|
|
25212
25253
|
}
|
|
25213
25254
|
seen.push({
|
|
25214
25255
|
key,
|
|
@@ -26229,7 +26270,7 @@ async function createRebaseBackend(options) {
|
|
|
26229
26270
|
const platformTokenPreAuth = createPlatformTokenPreAuth(await platformTokensFromEnv(process.env));
|
|
26230
26271
|
let backupLinkRouter;
|
|
26231
26272
|
if (surfaces.admin) {
|
|
26232
|
-
const { createBackupLinkRoutes, backupDestinationFromEnv } = await import("./backup-
|
|
26273
|
+
const { createBackupLinkRoutes, backupDestinationFromEnv } = await import("./backup-Dq0lyJ_D.js").then((n) => n.t);
|
|
26233
26274
|
backupLinkRouter = createBackupLinkRoutes({ getDestination: () => backupDestinationFromEnv(process.env) });
|
|
26234
26275
|
}
|
|
26235
26276
|
const apiKeyRouter = apiKeyStore && surfaces.admin ? createApiKeyRoutes({
|
|
@@ -26374,7 +26415,7 @@ async function createRebaseBackend(options) {
|
|
|
26374
26415
|
]) {
|
|
26375
26416
|
const providerConfig = safeAuthConfig[key];
|
|
26376
26417
|
if (providerConfig && requiredFields.every((f) => Boolean(providerConfig[f]))) {
|
|
26377
|
-
const createFn = (await import("./auth-
|
|
26418
|
+
const createFn = (await import("./auth-CteGWxsL.js").then((n) => n.t))[factory];
|
|
26378
26419
|
oauthProviders.push(createFn(providerConfig));
|
|
26379
26420
|
}
|
|
26380
26421
|
}
|
|
@@ -26550,7 +26591,7 @@ async function createRebaseBackend(options) {
|
|
|
26550
26591
|
let schemaEditorRoutes;
|
|
26551
26592
|
let schemaSourceEditor;
|
|
26552
26593
|
if (!schemaEditorOff && config.collectionsDir) try {
|
|
26553
|
-
const editorModule = await import("./schema-editor-routes-
|
|
26594
|
+
const editorModule = await import("./schema-editor-routes-CnNGCayU.js");
|
|
26554
26595
|
schemaSourceEditor = editorModule.createSchemaSourceEditor(config.collectionsDir);
|
|
26555
26596
|
schemaEditorRoutes = editorModule.createSchemaEditorRoutes(schemaSourceEditor);
|
|
26556
26597
|
} catch (err) {
|
|
@@ -26890,8 +26931,8 @@ async function createRebaseBackend(options) {
|
|
|
26890
26931
|
let functionsSurface;
|
|
26891
26932
|
if ((config.functionsDir || config.functions) && surfaces.functions) {
|
|
26892
26933
|
const { functionList, readFunctionsDirectory } = await import("./function-loader-DbCSoNJj.js").then((n) => n.t);
|
|
26893
|
-
const { createFunctionRoutes } = await import("./function-routes-
|
|
26894
|
-
const { createFunctionsRequestTimeout, resolveFunctionsTimeoutMs } = await import("./request-timeout-
|
|
26934
|
+
const { createFunctionRoutes } = await import("./function-routes-DNV4RUF0.js").then((n) => n.n);
|
|
26935
|
+
const { createFunctionsRequestTimeout, resolveFunctionsTimeoutMs } = await import("./request-timeout-CRny5KD0.js").then((n) => n.t);
|
|
26895
26936
|
const { functions: functionRecord, problems } = config.functions ? {
|
|
26896
26937
|
functions: config.functions,
|
|
26897
26938
|
problems: []
|
|
@@ -26952,7 +26993,7 @@ async function createRebaseBackend(options) {
|
|
|
26952
26993
|
if (surfaces.cron || (config.cronsDir || config.crons) && ownership.cronScheduler) {
|
|
26953
26994
|
const { cronJobsFrom, readCronsDirectory } = await import("./cron-loader-NHqRfKF0.js").then((n) => n.t);
|
|
26954
26995
|
const { CronScheduler } = await import("./cron-scheduler-D1DT0nw5.js").then((n) => n.n);
|
|
26955
|
-
const { createCronRoutes } = await import("./cron-routes-
|
|
26996
|
+
const { createCronRoutes } = await import("./cron-routes-Dhf82HzT.js").then((n) => n.n);
|
|
26956
26997
|
const { createCronStore } = await import("./cron-store-DEpVstUU.js").then((n) => n.n);
|
|
26957
26998
|
const { crons: cronRecord, problems: cronProblems } = config.crons ? {
|
|
26958
26999
|
crons: config.crons,
|
|
@@ -27063,7 +27104,7 @@ Use a driver that supports the job queue, or remove the declarations. Refusing t
|
|
|
27063
27104
|
let logsSurface;
|
|
27064
27105
|
let metaSurface;
|
|
27065
27106
|
if (surfaces.admin) {
|
|
27066
|
-
const { createBackupRoutes, backupDestinationFromEnv, readBackupSchedule } = await import("./backup-
|
|
27107
|
+
const { createBackupRoutes, backupDestinationFromEnv, readBackupSchedule } = await import("./backup-Dq0lyJ_D.js").then((n) => n.t);
|
|
27067
27108
|
const backupRouter = new Hono();
|
|
27068
27109
|
applyAdminGate(backupRouter, "Backup", "backups:read");
|
|
27069
27110
|
const scheduler = cronScheduler;
|
|
@@ -27084,7 +27125,7 @@ Use a driver that supports the job queue, or remove the declarations. Refusing t
|
|
|
27084
27125
|
rlsAuditSurface = rlsAuditRouter;
|
|
27085
27126
|
}
|
|
27086
27127
|
if (surfaces.admin) {
|
|
27087
|
-
const { createSqlExportRoutes } = await import("./sql-export-routes-
|
|
27128
|
+
const { createSqlExportRoutes } = await import("./sql-export-routes-BgTJ7K3S.js");
|
|
27088
27129
|
const sqlExportRouter = new Hono();
|
|
27089
27130
|
applyAdminGate(sqlExportRouter, "SQL export", "database:write");
|
|
27090
27131
|
sqlExportRouter.route("/", createSqlExportRoutes({ getAdmin: () => defaultDriver.admin }));
|
|
@@ -27114,7 +27155,7 @@ Use a driver that supports the job queue, or remove the declarations. Refusing t
|
|
|
27114
27155
|
devMailSurface = devMailRouter;
|
|
27115
27156
|
}
|
|
27116
27157
|
if (surfaces.admin) {
|
|
27117
|
-
const { createLogsRoutes } = await import("./logs-routes-
|
|
27158
|
+
const { createLogsRoutes } = await import("./logs-routes-CelTiS7C.js").then((n) => n.n);
|
|
27118
27159
|
const logsRouter = new Hono();
|
|
27119
27160
|
applyAdminGate(logsRouter, "Logs", "logs:read");
|
|
27120
27161
|
logsRouter.route("/", createLogsRoutes({}, { closeSignal: longLivedResponses.signal }));
|
|
@@ -29587,26 +29628,17 @@ function isAssetRequest(requestPath, destination) {
|
|
|
29587
29628
|
* Erring toward "not hashed" is therefore the safe direction: the cost is a
|
|
29588
29629
|
* revalidation that usually answers 304, against serving a year-stale file with
|
|
29589
29630
|
* no way to recall it. So this demands positive evidence of a hash rather than
|
|
29590
|
-
* assuming one
|
|
29591
|
-
*
|
|
29592
|
-
*
|
|
29593
|
-
* `vendor-analytics.js`
|
|
29631
|
+
* assuming one, by the rule `rebase build` precompresses with
|
|
29632
|
+
* (`isContentHashedFileName`): Vite's eight base64url characters after a `-`,
|
|
29633
|
+
* or 8+ after the last `-`, with a digit or a capital in them. A hand-written
|
|
29634
|
+
* `vendor-analytics.js` has neither, and gets revalidated.
|
|
29594
29635
|
*
|
|
29595
29636
|
* Deliberately not "everything under /assets/": that is a Vite convention, not a
|
|
29596
29637
|
* guarantee, and a build that drops an unhashed file there would have it pinned
|
|
29597
29638
|
* in every visitor's cache for a year with no way to correct it.
|
|
29598
29639
|
*/
|
|
29599
29640
|
function isContentHashed(requestPath) {
|
|
29600
|
-
|
|
29601
|
-
const dot = lastSegment.lastIndexOf(".");
|
|
29602
|
-
if (dot <= 0) return false;
|
|
29603
|
-
const stem = lastSegment.slice(0, dot);
|
|
29604
|
-
const dash = stem.lastIndexOf("-");
|
|
29605
|
-
if (dash < 0) return false;
|
|
29606
|
-
const suffix = stem.slice(dash + 1);
|
|
29607
|
-
if (suffix.length < 8) return false;
|
|
29608
|
-
if (!/^[A-Za-z0-9_-]+$/.test(suffix)) return false;
|
|
29609
|
-
return /[0-9A-Z]/.test(suffix);
|
|
29641
|
+
return isContentHashedFileName(requestPath.slice(requestPath.lastIndexOf("/") + 1));
|
|
29610
29642
|
}
|
|
29611
29643
|
/** A year, and never revalidated: the URL changes when the bytes do. */
|
|
29612
29644
|
var IMMUTABLE_CACHE = "public, max-age=31536000, immutable";
|
|
@@ -32134,7 +32166,7 @@ async function bootFromBundle(options = {}) {
|
|
|
32134
32166
|
}
|
|
32135
32167
|
const server = createRuntimeHttpServer(getRequestListener(app.fetch));
|
|
32136
32168
|
const usersCollection = await loadUsersCollection(bundle);
|
|
32137
|
-
const storage =
|
|
32169
|
+
const storage = resolveBootStorage(bundle, process.env, storageSourceDefs, isProduction);
|
|
32138
32170
|
warnOnUnusableBundleShape(bundle);
|
|
32139
32171
|
installUnhandledRejectionHandler();
|
|
32140
32172
|
const createdBackend = await createRebaseBackend({
|
|
@@ -32524,6 +32556,61 @@ function warnOnDriverSkew(dataSources, runtimeVersion) {
|
|
|
32524
32556
|
}
|
|
32525
32557
|
}
|
|
32526
32558
|
/**
|
|
32559
|
+
* The storage step of {@link bootFromBundle}: every storage source this process
|
|
32560
|
+
* serves, from the declarations and the environment.
|
|
32561
|
+
*
|
|
32562
|
+
* Local storage that `STORAGE_PATH` does not place keeps its files in
|
|
32563
|
+
* {@link defaultStorageDirectory}.
|
|
32564
|
+
*/
|
|
32565
|
+
function resolveBootStorage(bundle, env, definitions, production) {
|
|
32566
|
+
const directory = defaultStorageDirectory(bundle);
|
|
32567
|
+
const storage = resolveStorageSources(env, definitions, directory, { production });
|
|
32568
|
+
if (!env.STORAGE_PATH?.trim()) warnOnUploadsLeftInBundle(bundle, directory);
|
|
32569
|
+
return storage;
|
|
32570
|
+
}
|
|
32571
|
+
/**
|
|
32572
|
+
* Where local storage keeps its files when `STORAGE_PATH` names no directory:
|
|
32573
|
+
* `<project>/uploads`, where `rebase dev` and the server `rebase eject` writes
|
|
32574
|
+
* keep them too.
|
|
32575
|
+
*
|
|
32576
|
+
* A built bundle that sits inside a project — `rebase start` boots
|
|
32577
|
+
* `<project>/dist-bundle` — stores there too, found by the project's
|
|
32578
|
+
* `rebase.json`, so `rebase start` serves what `rebase dev` stored. Not inside
|
|
32579
|
+
* the bundle: the next `rebase build` deletes that directory and writes it
|
|
32580
|
+
* again, and every file in it would go while the rows naming them stay.
|
|
32581
|
+
*
|
|
32582
|
+
* A bundle with no project around it stores inside the bundle: the runtime
|
|
32583
|
+
* image's `/bundle`, a bundle the runtime fetched. A container names its volume
|
|
32584
|
+
* with `STORAGE_PATH`, which wins over this either way.
|
|
32585
|
+
*/
|
|
32586
|
+
function defaultStorageDirectory(bundle) {
|
|
32587
|
+
const root = bundle.isSource ? bundle.dir : findProjectRoot(path$1.dirname(bundle.dir)) ?? bundle.dir;
|
|
32588
|
+
return path$1.join(root, "uploads");
|
|
32589
|
+
}
|
|
32590
|
+
/**
|
|
32591
|
+
* Name the uploads inside a bundle whose local storage is in the project:
|
|
32592
|
+
* nothing serves them, and the next `rebase build` deletes them. Silent for a
|
|
32593
|
+
* bundle that stores inside itself, and for one that holds none.
|
|
32594
|
+
*/
|
|
32595
|
+
function warnOnUploadsLeftInBundle(bundle, directory) {
|
|
32596
|
+
if (path$1.dirname(directory) === bundle.dir) return;
|
|
32597
|
+
let entries;
|
|
32598
|
+
try {
|
|
32599
|
+
entries = fs.readdirSync(bundle.dir, { withFileTypes: true });
|
|
32600
|
+
} catch {
|
|
32601
|
+
return;
|
|
32602
|
+
}
|
|
32603
|
+
const left = entries.filter((entry) => entry.isDirectory() && /^uploads(__.+)?$/.test(entry.name)).map((entry) => path$1.join(bundle.dir, entry.name)).filter((dir) => {
|
|
32604
|
+
try {
|
|
32605
|
+
return fs.readdirSync(dir).length > 0;
|
|
32606
|
+
} catch {
|
|
32607
|
+
return false;
|
|
32608
|
+
}
|
|
32609
|
+
});
|
|
32610
|
+
if (left.length === 0) return;
|
|
32611
|
+
logger.warn(`Uploads an earlier version stored inside the bundle are no longer served: ${left.join(", ")}. Local storage keeps its files in ${directory} now, where \`rebase dev\` keeps them, and the next \`rebase build\` deletes the bundle's copy. Move them there (a named bucket's \`uploads__<key>\` goes beside it), or set STORAGE_PATH=${path$1.join(bundle.dir, "uploads")} to keep serving them where they are.`);
|
|
32612
|
+
}
|
|
32613
|
+
/**
|
|
32527
32614
|
* Warn about a bundle whose shape makes provisioning impossible.
|
|
32528
32615
|
*
|
|
32529
32616
|
* `createRebaseBackend` provisions the collection schema for every boot
|