@rebasepro/server 0.16.1-canary.gef08a6e → 0.17.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.
Files changed (33) hide show
  1. package/dist/{admin_block-BeypnEfb.js → admin_block-BX6YULvJ.js} +8 -8
  2. package/dist/admin_block-BX6YULvJ.js.map +1 -0
  3. package/dist/api/ast-schema-editor.d.ts +1 -1
  4. package/dist/api/rest/idempotency.d.ts +1 -1
  5. package/dist/{ast-schema-editor-BrarYZCq.js → ast-schema-editor-BLADP9O2.js} +3 -3
  6. package/dist/ast-schema-editor-BLADP9O2.js.map +1 -0
  7. package/dist/auth/crypto-utils.d.ts +4 -0
  8. package/dist/auth/jwt-crypto.d.ts +91 -0
  9. package/dist/auth/jwt.d.ts +10 -9
  10. package/dist/auth/middleware.d.ts +1 -1
  11. package/dist/auth/rate-limiter.d.ts +10 -3
  12. package/dist/{auth-DU-nUjPp.js → auth-BVPx33qB.js} +49 -76
  13. package/dist/auth-BVPx33qB.js.map +1 -0
  14. package/dist/boot/fetch-bundle.d.ts +18 -1
  15. package/dist/collections/validate-config.d.ts +14 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.es.js +248 -66
  18. package/dist/index.es.js.map +1 -1
  19. package/dist/{jwt-DoHkMMWF.js → jwt-5VN4C6ln.js} +230 -38
  20. package/dist/jwt-5VN4C6ln.js.map +1 -0
  21. package/dist/{schema-editor-routes-Bf5h5Emf.js → schema-editor-routes-BWCIqZoT.js} +2 -2
  22. package/dist/{schema-editor-routes-Bf5h5Emf.js.map → schema-editor-routes-BWCIqZoT.js.map} +1 -1
  23. package/dist/src-B-CmIFMr.js.map +1 -1
  24. package/dist/src-Cdsw7DqV.js.map +1 -1
  25. package/dist/storage/keys.d.ts +21 -0
  26. package/dist/utils/ip-address.d.ts +30 -0
  27. package/dist/utils/portable-crypto.d.ts +71 -0
  28. package/dist/utils/request-id.d.ts +20 -0
  29. package/package.json +5 -5
  30. package/dist/admin_block-BeypnEfb.js.map +0 -1
  31. package/dist/ast-schema-editor-BrarYZCq.js.map +0 -1
  32. package/dist/auth-DU-nUjPp.js.map +0 -1
  33. package/dist/jwt-DoHkMMWF.js.map +0 -1
@@ -18,6 +18,23 @@ export declare const BUNDLE_TOKEN_ENV = "REBASE_BUNDLE_TOKEN";
18
18
  * here, do not fetch at all" — this only says where to put one.
19
19
  */
20
20
  export declare const BUNDLE_FETCH_DIR_ENV = "REBASE_BUNDLE_FETCH_DIR";
21
+ /**
22
+ * Records which URL produced the tree sitting in the fetch directory.
23
+ *
24
+ * Reusing an already-unpacked bundle is what makes a restart cheap, but "there
25
+ * is a bundle here" is not the same question as "is it the bundle we were told
26
+ * to run". Anything that fills the directory behind the runtime's back — an
27
+ * orphaned `fetch-bundle` init container left on a Deployment, a stale volume —
28
+ * used to win over the URL, and the pod then served whatever it found while
29
+ * every deploy reported success. The URL is the instruction; this is how a
30
+ * restart tells whether the disk already satisfies it.
31
+ *
32
+ * `infra/docker/entrypoint.mjs` reads this file by the same name to decide
33
+ * whether to fetch at all — keep the two in step.
34
+ */
35
+ export declare const BUNDLE_SOURCE_FILENAME = ".rebase-bundle-source";
36
+ /** What the tree in `destination` was fetched from, or null if unknown. */
37
+ export declare function unpackedBundleSource(destination: string): string | null;
21
38
  export interface FetchBundleOptions {
22
39
  url: string;
23
40
  token?: string;
@@ -100,7 +117,7 @@ export declare function installBundleDependencies(bundleRoot: string, exec?: (cm
100
117
  * ready. Seen in production as every custom-function route 500ing while
101
118
  * `/api/data/*` served fine.
102
119
  *
103
- * It arrives transitively: `@rebasepro/admin` and `@rebasepro/server-postgres`
120
+ * It arrives transitively: `@rebasepro/cms` and `@rebasepro/server-postgres`
104
121
  * both depend on it, and nearly every project declares one of them.
105
122
  *
106
123
  * NOT every package the image ships. The image installs the narrow set of
@@ -22,7 +22,7 @@
22
22
  * Everything is reported in one pass. Someone migrating a project wants the
23
23
  * whole list once, not fifty-five sequential boots.
24
24
  *
25
- * This is not `validateCollectionJson` in `@rebasepro/admin`. That one parses a
25
+ * This is not `validateCollectionJson` in `@rebasepro/cms`. That one parses a
26
26
  * JSON string pasted into the panel's import dialog and checks value *shapes*
27
27
  * against the flat `AdminCollection` view model. This one checks key *identity*
28
28
  * against the authoring contract, on live objects, in a package that may not
@@ -33,6 +33,19 @@
33
33
  export type UnknownKeyPolicy = "warn" | "error" | "off";
34
34
  export interface ConfigProblem {
35
35
  severity: "error" | "warning";
36
+ /**
37
+ * What kind of wrong this is, because the two read very differently and the
38
+ * remedies differ.
39
+ *
40
+ * - `"key"` — a key this version does not read, whether renamed, removed or
41
+ * simply unrecognised. The feature it configures is absent; the config is
42
+ * otherwise coherent. `REBASE_STRICT_COLLECTION_CONFIG` governs how loud
43
+ * the unrecognised half of this is.
44
+ * - `"incoherent"` — every key is recognised and the *combination* cannot do
45
+ * what it says. That policy has no bearing on these, and saying it did
46
+ * sent people to an environment variable that would not have helped.
47
+ */
48
+ kind: "key" | "incoherent";
36
49
  /** Dotted path into the config, e.g. `posts.properties.author`. */
37
50
  path: string;
38
51
  message: string;
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { loadCollectionsFromDirectory, applyCollectionDefaults, type CollectionD
14
14
  export { assertCollectionConfigs, findCollectionConfigProblems, unknownKeyPolicyFromEnv, type ConfigProblem, type UnknownKeyPolicy, type ValidateCollectionConfigOptions } from "./collections/validate-config.js";
15
15
  export * from "./db/interfaces.js";
16
16
  export * from "./auth/interfaces.js";
17
- export { requireAuth, requireAdmin, optionalAuth, queryTokenAuth, fileTokenAuth, extractUserFromToken, hashPassword, verifyPassword, validatePasswordStrength, generateSecurePassword, resolveAuthHooks, createBuiltinAuthAdapter, createCustomAuthAdapter, createGoogleProvider, createLinkedinProvider, createGitHubProvider, createMicrosoftProvider, createAppleProvider, createFacebookProvider, createTwitterProvider, createDiscordProvider, createGitLabProvider, createBitbucketProvider, createSlackProvider, createSpotifyProvider, oauthCodeFlowSchema, pkceTokenParams, providerVerifiedEmail, verifyOidcIdToken, tryVerifyOidcIdToken, isApiKeyToken, validateApiKey, httpMethodToOperation, isOperationAllowed, safeCompare, getJwks, hasAsymmetricSigningKey, createJwksRoutes } from "./auth/index.js";
17
+ export { requireAuth, requireAdmin, optionalAuth, queryTokenAuth, fileTokenAuth, extractUserFromToken, hashPassword, verifyPassword, validatePasswordStrength, generateSecurePassword, resolveAuthHooks, createBuiltinAuthAdapter, createCustomAuthAdapter, createGoogleProvider, createLinkedinProvider, createGitHubProvider, createMicrosoftProvider, createAppleProvider, createFacebookProvider, createTwitterProvider, createDiscordProvider, createGitLabProvider, createBitbucketProvider, createSlackProvider, createSpotifyProvider, oauthCodeFlowSchema, pkceTokenParams, providerVerifiedEmail, verifyOidcIdToken, tryVerifyOidcIdToken, isApiKeyToken, validateApiKey, httpMethodToOperation, isOperationAllowed, safeCompare, getJwks, hasAsymmetricSigningKey, createJwksRoutes, configureJwt } from "./auth/index.js";
18
18
  export type { JwtSigningKeyConfig, JwtSigningAlgorithm, PublicJwk, AccessTokenPayload, PasswordValidationResult, AuthHooks, AuthMethod, ResolvedAuthHooks, BuiltinAuthAdapterConfig, GoogleProviderConfig, AuthMiddlewareOptions, AuthResult, ApiKey, ApiKeyMasked, ApiKeyPermission, ApiKeyWithSecret, CreateApiKeyRequest, UpdateApiKeyRequest, ApiKeyStore, ApiKeyOperation } from "./auth/index.js";
19
19
  export * from "./api/types.js";
20
20
  export * from "./api/errors.js";