@decocms/blocks 8.1.0-next.0 → 8.1.0-next.2
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/bin/deco.js +5 -12
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol/assets.d.ts +46 -0
- package/dist/protocol/assets.d.ts.map +1 -0
- package/dist/protocol/assets.js +105 -0
- package/dist/protocol/assets.js.map +1 -0
- package/dist/protocol/canonical.d.ts +8 -0
- package/dist/protocol/canonical.d.ts.map +1 -0
- package/dist/protocol/canonical.js +8 -0
- package/dist/protocol/canonical.js.map +1 -0
- package/dist/protocol/ciphertext.d.ts +7 -0
- package/dist/protocol/ciphertext.d.ts.map +1 -0
- package/dist/protocol/ciphertext.js +7 -0
- package/dist/protocol/ciphertext.js.map +1 -0
- package/dist/protocol/client.d.ts +54 -0
- package/dist/protocol/client.d.ts.map +1 -0
- package/dist/protocol/client.js +104 -0
- package/dist/protocol/client.js.map +1 -0
- package/dist/protocol/conformance/cases/assets.d.ts +3 -0
- package/dist/protocol/conformance/cases/assets.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/assets.js +71 -0
- package/dist/protocol/conformance/cases/assets.js.map +1 -0
- package/dist/protocol/conformance/cases/guards.d.ts +3 -0
- package/dist/protocol/conformance/cases/guards.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/guards.js +265 -0
- package/dist/protocol/conformance/cases/guards.js.map +1 -0
- package/dist/protocol/conformance/cases/reads.d.ts +3 -0
- package/dist/protocol/conformance/cases/reads.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/reads.js +140 -0
- package/dist/protocol/conformance/cases/reads.js.map +1 -0
- package/dist/protocol/conformance/cases/types.d.ts +9 -0
- package/dist/protocol/conformance/cases/types.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/types.js +2 -0
- package/dist/protocol/conformance/cases/types.js.map +1 -0
- package/dist/protocol/conformance/cases/wire.d.ts +3 -0
- package/dist/protocol/conformance/cases/wire.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/wire.js +130 -0
- package/dist/protocol/conformance/cases/wire.js.map +1 -0
- package/dist/protocol/conformance/cases/writes.d.ts +3 -0
- package/dist/protocol/conformance/cases/writes.d.ts.map +1 -0
- package/dist/protocol/conformance/cases/writes.js +278 -0
- package/dist/protocol/conformance/cases/writes.js.map +1 -0
- package/dist/protocol/conformance/contentHashFixtures.d.ts +22 -0
- package/dist/protocol/conformance/contentHashFixtures.d.ts.map +1 -0
- package/dist/protocol/conformance/contentHashFixtures.js +64 -0
- package/dist/protocol/conformance/contentHashFixtures.js.map +1 -0
- package/dist/protocol/conformance/context.d.ts +100 -0
- package/dist/protocol/conformance/context.d.ts.map +1 -0
- package/dist/protocol/conformance/context.js +155 -0
- package/dist/protocol/conformance/context.js.map +1 -0
- package/dist/protocol/conformance/index.d.ts +32 -0
- package/dist/protocol/conformance/index.d.ts.map +1 -0
- package/dist/protocol/conformance/index.js +90 -0
- package/dist/protocol/conformance/index.js.map +1 -0
- package/dist/protocol/errors.d.ts +85 -0
- package/dist/protocol/errors.d.ts.map +1 -0
- package/dist/protocol/errors.js +62 -0
- package/dist/protocol/errors.js.map +1 -0
- package/dist/protocol/index.d.ts +25 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +25 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/keys.d.ts +101 -0
- package/dist/protocol/keys.d.ts.map +1 -0
- package/dist/protocol/keys.js +223 -0
- package/dist/protocol/keys.js.map +1 -0
- package/dist/protocol/params.d.ts +10 -0
- package/dist/protocol/params.d.ts.map +1 -0
- package/dist/protocol/params.js +54 -0
- package/dist/protocol/params.js.map +1 -0
- package/dist/protocol/secrets.d.ts +22 -0
- package/dist/protocol/secrets.d.ts.map +1 -0
- package/dist/protocol/secrets.js +200 -0
- package/dist/protocol/secrets.js.map +1 -0
- package/dist/protocol/server/assets.d.ts +20 -0
- package/dist/protocol/server/assets.d.ts.map +1 -0
- package/dist/protocol/server/assets.js +77 -0
- package/dist/protocol/server/assets.js.map +1 -0
- package/dist/protocol/server/auth.d.ts +31 -0
- package/dist/protocol/server/auth.d.ts.map +1 -0
- package/dist/protocol/server/auth.js +32 -0
- package/dist/protocol/server/auth.js.map +1 -0
- package/dist/protocol/server/bodyCache.d.ts +28 -0
- package/dist/protocol/server/bodyCache.d.ts.map +1 -0
- package/dist/protocol/server/bodyCache.js +75 -0
- package/dist/protocol/server/bodyCache.js.map +1 -0
- package/dist/protocol/server/content.d.ts +44 -0
- package/dist/protocol/server/content.d.ts.map +1 -0
- package/dist/protocol/server/content.js +132 -0
- package/dist/protocol/server/content.js.map +1 -0
- package/dist/protocol/server/core.d.ts +63 -0
- package/dist/protocol/server/core.d.ts.map +1 -0
- package/dist/protocol/server/core.js +77 -0
- package/dist/protocol/server/core.js.map +1 -0
- package/dist/protocol/server/handler.d.ts +5 -0
- package/dist/protocol/server/handler.d.ts.map +1 -0
- package/dist/protocol/server/handler.js +70 -0
- package/dist/protocol/server/handler.js.map +1 -0
- package/dist/protocol/server/http.d.ts +24 -0
- package/dist/protocol/server/http.d.ts.map +1 -0
- package/dist/protocol/server/http.js +133 -0
- package/dist/protocol/server/http.js.map +1 -0
- package/dist/protocol/server/index.d.ts +11 -0
- package/dist/protocol/server/index.d.ts.map +1 -0
- package/dist/protocol/server/index.js +9 -0
- package/dist/protocol/server/index.js.map +1 -0
- package/dist/protocol/server/methods/apply.d.ts +4 -0
- package/dist/protocol/server/methods/apply.d.ts.map +1 -0
- package/dist/protocol/server/methods/apply.js +275 -0
- package/dist/protocol/server/methods/apply.js.map +1 -0
- package/dist/protocol/server/methods/read.d.ts +14 -0
- package/dist/protocol/server/methods/read.d.ts.map +1 -0
- package/dist/protocol/server/methods/read.js +132 -0
- package/dist/protocol/server/methods/read.js.map +1 -0
- package/dist/protocol/server/rpc.d.ts +7 -0
- package/dist/protocol/server/rpc.d.ts.map +1 -0
- package/dist/protocol/server/rpc.js +115 -0
- package/dist/protocol/server/rpc.js.map +1 -0
- package/dist/protocol/storage/fs/hash.d.ts +8 -0
- package/dist/protocol/storage/fs/hash.d.ts.map +1 -0
- package/dist/protocol/storage/fs/hash.js +20 -0
- package/dist/protocol/storage/fs/hash.js.map +1 -0
- package/dist/protocol/storage/fs/index.d.ts +30 -0
- package/dist/protocol/storage/fs/index.d.ts.map +1 -0
- package/dist/protocol/storage/fs/index.js +301 -0
- package/dist/protocol/storage/fs/index.js.map +1 -0
- package/dist/protocol/storage/fs/lock.d.ts +8 -0
- package/dist/protocol/storage/fs/lock.d.ts.map +1 -0
- package/dist/protocol/storage/fs/lock.js +61 -0
- package/dist/protocol/storage/fs/lock.js.map +1 -0
- package/dist/protocol/storage/fs/transaction.d.ts +19 -0
- package/dist/protocol/storage/fs/transaction.d.ts.map +1 -0
- package/dist/protocol/storage/fs/transaction.js +174 -0
- package/dist/protocol/storage/fs/transaction.js.map +1 -0
- package/dist/protocol/storage/fs/unsupported.d.ts +10 -0
- package/dist/protocol/storage/fs/unsupported.d.ts.map +1 -0
- package/dist/protocol/storage/fs/unsupported.js +4 -0
- package/dist/protocol/storage/fs/unsupported.js.map +1 -0
- package/dist/protocol/storage/memory.d.ts +40 -0
- package/dist/protocol/storage/memory.d.ts.map +1 -0
- package/dist/protocol/storage/memory.js +179 -0
- package/dist/protocol/storage/memory.js.map +1 -0
- package/dist/protocol/storage.d.ts +178 -0
- package/dist/protocol/storage.d.ts.map +1 -0
- package/dist/protocol/storage.js +29 -0
- package/dist/protocol/storage.js.map +1 -0
- package/dist/protocol/types.d.ts +194 -0
- package/dist/protocol/types.d.ts.map +1 -0
- package/dist/protocol/types.js +31 -0
- package/dist/protocol/types.js.map +1 -0
- package/dist/v8/analytics.d.ts +31 -0
- package/dist/v8/analytics.d.ts.map +1 -0
- package/dist/v8/analytics.js +46 -0
- package/dist/v8/analytics.js.map +1 -0
- package/dist/v8/background.d.ts +26 -0
- package/dist/v8/background.d.ts.map +1 -0
- package/dist/v8/background.js +95 -0
- package/dist/v8/background.js.map +1 -0
- package/dist/v8/builtins/data.d.ts +15 -0
- package/dist/v8/builtins/data.d.ts.map +1 -0
- package/dist/v8/builtins/data.js +18 -0
- package/dist/v8/builtins/data.js.map +1 -0
- package/dist/v8/builtins/index.d.ts +9 -0
- package/dist/v8/builtins/index.d.ts.map +1 -0
- package/dist/v8/builtins/index.js +24 -0
- package/dist/v8/builtins/index.js.map +1 -0
- package/dist/v8/builtins/lazy.d.ts +17 -0
- package/dist/v8/builtins/lazy.d.ts.map +1 -0
- package/dist/v8/builtins/lazy.js +13 -0
- package/dist/v8/builtins/lazy.js.map +1 -0
- package/dist/v8/builtins/legacy.d.ts +41 -0
- package/dist/v8/builtins/legacy.d.ts.map +1 -0
- package/dist/v8/builtins/legacy.js +62 -0
- package/dist/v8/builtins/legacy.js.map +1 -0
- package/dist/v8/builtins/matchers.d.ts +19 -0
- package/dist/v8/builtins/matchers.d.ts.map +1 -0
- package/dist/v8/builtins/matchers.js +24 -0
- package/dist/v8/builtins/matchers.js.map +1 -0
- package/dist/v8/builtins/multivariate.d.ts +15 -0
- package/dist/v8/builtins/multivariate.d.ts.map +1 -0
- package/dist/v8/builtins/multivariate.js +18 -0
- package/dist/v8/builtins/multivariate.js.map +1 -0
- package/dist/v8/builtins/secret.d.ts +7 -0
- package/dist/v8/builtins/secret.d.ts.map +1 -0
- package/dist/v8/builtins/secret.js +68 -0
- package/dist/v8/builtins/secret.js.map +1 -0
- package/dist/v8/canonical.d.ts +42 -0
- package/dist/v8/canonical.d.ts.map +1 -0
- package/dist/v8/canonical.js +111 -0
- package/dist/v8/canonical.js.map +1 -0
- package/dist/v8/ciphertext.d.ts +58 -0
- package/dist/v8/ciphertext.d.ts.map +1 -0
- package/dist/v8/ciphertext.js +134 -0
- package/dist/v8/ciphertext.js.map +1 -0
- package/dist/v8/cli/builtins.d.ts +11 -0
- package/dist/v8/cli/builtins.d.ts.map +1 -0
- package/dist/v8/cli/builtins.js +18 -0
- package/dist/v8/cli/builtins.js.map +1 -0
- package/dist/v8/cli/check/index.d.ts +41 -0
- package/dist/v8/cli/check/index.d.ts.map +1 -0
- package/dist/v8/cli/check/index.js +713 -0
- package/dist/v8/cli/check/index.js.map +1 -0
- package/dist/v8/cli/check/messages.d.ts +24 -0
- package/dist/v8/cli/check/messages.d.ts.map +1 -0
- package/dist/v8/cli/check/messages.js +150 -0
- package/dist/v8/cli/check/messages.js.map +1 -0
- package/dist/v8/cli/content.d.ts +60 -0
- package/dist/v8/cli/content.d.ts.map +1 -0
- package/dist/v8/cli/content.js +231 -0
- package/dist/v8/cli/content.js.map +1 -0
- package/dist/v8/cli/index.d.ts +18 -0
- package/dist/v8/cli/index.d.ts.map +1 -0
- package/dist/v8/cli/index.js +18 -0
- package/dist/v8/cli/index.js.map +1 -0
- package/dist/v8/cli/log.d.ts +9 -0
- package/dist/v8/cli/log.d.ts.map +1 -0
- package/dist/v8/cli/log.js +11 -0
- package/dist/v8/cli/log.js.map +1 -0
- package/dist/v8/cli/main.d.ts +2 -0
- package/dist/v8/cli/main.d.ts.map +1 -0
- package/dist/v8/cli/main.js +9 -0
- package/dist/v8/cli/main.js.map +1 -0
- package/dist/v8/cli/root.d.ts +28 -0
- package/dist/v8/cli/root.d.ts.map +1 -0
- package/dist/v8/cli/root.js +64 -0
- package/dist/v8/cli/root.js.map +1 -0
- package/dist/v8/cli/run.d.ts +13 -0
- package/dist/v8/cli/run.d.ts.map +1 -0
- package/dist/v8/cli/run.js +210 -0
- package/dist/v8/cli/run.js.map +1 -0
- package/dist/v8/cli/schema/builtinSchemas.d.ts +22 -0
- package/dist/v8/cli/schema/builtinSchemas.d.ts.map +1 -0
- package/dist/v8/cli/schema/builtinSchemas.js +213 -0
- package/dist/v8/cli/schema/builtinSchemas.js.map +1 -0
- package/dist/v8/cli/schema/generate.d.ts +50 -0
- package/dist/v8/cli/schema/generate.d.ts.map +1 -0
- package/dist/v8/cli/schema/generate.js +415 -0
- package/dist/v8/cli/schema/generate.js.map +1 -0
- package/dist/v8/cli/schema/index.d.ts +21 -0
- package/dist/v8/cli/schema/index.d.ts.map +1 -0
- package/dist/v8/cli/schema/index.js +51 -0
- package/dist/v8/cli/schema/index.js.map +1 -0
- package/dist/v8/cli/schema/tsProgram.d.ts +120 -0
- package/dist/v8/cli/schema/tsProgram.d.ts.map +1 -0
- package/dist/v8/cli/schema/tsProgram.js +418 -0
- package/dist/v8/cli/schema/tsProgram.js.map +1 -0
- package/dist/v8/cli/schema/typeToSchema.d.ts +81 -0
- package/dist/v8/cli/schema/typeToSchema.d.ts.map +1 -0
- package/dist/v8/cli/schema/typeToSchema.js +683 -0
- package/dist/v8/cli/schema/typeToSchema.js.map +1 -0
- package/dist/v8/cli/serve/server.d.ts +31 -0
- package/dist/v8/cli/serve/server.d.ts.map +1 -0
- package/dist/v8/cli/serve/server.js +247 -0
- package/dist/v8/cli/serve/server.js.map +1 -0
- package/dist/v8/cli/watch.d.ts +20 -0
- package/dist/v8/cli/watch.d.ts.map +1 -0
- package/dist/v8/cli/watch.js +79 -0
- package/dist/v8/cli/watch.js.map +1 -0
- package/dist/v8/client.d.ts +20 -0
- package/dist/v8/client.d.ts.map +1 -0
- package/dist/v8/client.js +115 -0
- package/dist/v8/client.js.map +1 -0
- package/dist/v8/cms.d.ts +9 -0
- package/dist/v8/cms.d.ts.map +1 -0
- package/dist/v8/cms.js +206 -0
- package/dist/v8/cms.js.map +1 -0
- package/dist/v8/content.d.ts +35 -0
- package/dist/v8/content.d.ts.map +1 -0
- package/dist/v8/content.js +183 -0
- package/dist/v8/content.js.map +1 -0
- package/dist/v8/draft.d.ts +44 -0
- package/dist/v8/draft.d.ts.map +1 -0
- package/dist/v8/draft.js +133 -0
- package/dist/v8/draft.js.map +1 -0
- package/dist/v8/errors.d.ts +21 -0
- package/dist/v8/errors.d.ts.map +1 -0
- package/dist/v8/errors.js +39 -0
- package/dist/v8/errors.js.map +1 -0
- package/dist/v8/fetch.d.ts +26 -0
- package/dist/v8/fetch.d.ts.map +1 -0
- package/dist/v8/fetch.js +98 -0
- package/dist/v8/fetch.js.map +1 -0
- package/dist/v8/identity.d.ts +19 -0
- package/dist/v8/identity.d.ts.map +1 -0
- package/dist/v8/identity.js +54 -0
- package/dist/v8/identity.js.map +1 -0
- package/dist/v8/index.d.ts +11 -0
- package/dist/v8/index.d.ts.map +1 -0
- package/dist/v8/index.js +10 -0
- package/dist/v8/index.js.map +1 -0
- package/dist/v8/json.d.ts +19 -0
- package/dist/v8/json.d.ts.map +1 -0
- package/dist/v8/json.js +65 -0
- package/dist/v8/json.js.map +1 -0
- package/dist/v8/matchRoute.d.ts +30 -0
- package/dist/v8/matchRoute.d.ts.map +1 -0
- package/dist/v8/matchRoute.js +175 -0
- package/dist/v8/matchRoute.js.map +1 -0
- package/dist/v8/remoteLoader.d.ts +16 -0
- package/dist/v8/remoteLoader.d.ts.map +1 -0
- package/dist/v8/remoteLoader.js +243 -0
- package/dist/v8/remoteLoader.js.map +1 -0
- package/dist/v8/resolver.d.ts +34 -0
- package/dist/v8/resolver.d.ts.map +1 -0
- package/dist/v8/resolver.js +219 -0
- package/dist/v8/resolver.js.map +1 -0
- package/dist/v8/secrets.d.ts +9 -0
- package/dist/v8/secrets.d.ts.map +1 -0
- package/dist/v8/secrets.js +14 -0
- package/dist/v8/secrets.js.map +1 -0
- package/dist/v8/telemetry.d.ts +61 -0
- package/dist/v8/telemetry.d.ts.map +1 -0
- package/dist/v8/telemetry.js +460 -0
- package/dist/v8/telemetry.js.map +1 -0
- package/dist/v8/types.d.ts +214 -0
- package/dist/v8/types.d.ts.map +1 -0
- package/dist/v8/types.js +2 -0
- package/dist/v8/types.js.map +1 -0
- package/package.json +65 -105
- package/src/index.ts +3 -13
- package/src/protocol/canonical.ts +1 -1
- package/src/protocol/ciphertext.ts +1 -1
- package/src/protocol/client.ts +2 -2
- package/src/protocol/conformance/cases/assets.ts +3 -3
- package/src/protocol/conformance/cases/guards.ts +4 -4
- package/src/protocol/conformance/cases/reads.ts +4 -4
- package/src/protocol/conformance/cases/types.ts +1 -1
- package/src/protocol/conformance/cases/wire.ts +4 -4
- package/src/protocol/conformance/cases/writes.ts +4 -4
- package/src/protocol/conformance/context.ts +4 -4
- package/src/protocol/conformance/index.ts +10 -10
- package/src/protocol/index.ts +6 -6
- package/src/protocol/params.ts +2 -2
- package/src/protocol/secrets.ts +3 -3
- package/src/protocol/server/assets.ts +6 -6
- package/src/protocol/server/auth.ts +1 -1
- package/src/protocol/server/content.ts +5 -5
- package/src/protocol/server/core.ts +12 -6
- package/src/protocol/server/handler.ts +6 -6
- package/src/protocol/server/http.ts +1 -1
- package/src/protocol/server/index.ts +3 -3
- package/src/protocol/server/methods/apply.ts +9 -9
- package/src/protocol/server/methods/read.ts +5 -5
- package/src/protocol/server/rpc.ts +6 -6
- package/src/protocol/storage/fs/index.ts +7 -7
- package/src/protocol/storage/fs/lock.ts +1 -1
- package/src/protocol/storage/fs/unsupported.ts +2 -2
- package/src/protocol/storage/memory.ts +5 -5
- package/src/protocol/storage.ts +1 -1
- package/src/v8/analytics.ts +2 -2
- package/src/v8/background.ts +3 -3
- package/src/v8/builtins/data.ts +1 -1
- package/src/v8/builtins/index.ts +6 -6
- package/src/v8/builtins/lazy.ts +1 -1
- package/src/v8/builtins/legacy.ts +2 -2
- package/src/v8/builtins/multivariate.ts +1 -1
- package/src/v8/builtins/secret.ts +2 -2
- package/src/v8/cli/builtins.ts +2 -2
- package/src/v8/cli/check/index.ts +11 -11
- package/src/v8/cli/content.ts +6 -6
- package/src/v8/cli/index.ts +8 -8
- package/src/v8/cli/main.ts +1 -1
- package/src/v8/cli/run.ts +7 -7
- package/src/v8/cli/schema/builtinSchemas.ts +1 -1
- package/src/v8/cli/schema/generate.ts +6 -6
- package/src/v8/cli/schema/index.ts +4 -4
- package/src/v8/cli/schema/tsProgram.ts +1 -1
- package/src/v8/cli/schema/typeToSchema.ts +24 -2
- package/src/v8/cli/serve/server.ts +9 -9
- package/src/v8/client.ts +5 -5
- package/src/v8/cms.ts +9 -9
- package/src/v8/content.ts +4 -4
- package/src/v8/draft.ts +1 -1
- package/src/v8/errors.ts +1 -1
- package/src/v8/fetch.ts +9 -28
- package/src/v8/identity.ts +1 -1
- package/src/v8/index.ts +5 -5
- package/src/v8/matchRoute.ts +1 -1
- package/src/v8/remoteLoader.ts +7 -7
- package/src/v8/resolver.ts +6 -6
- package/src/v8/secrets.ts +1 -1
- package/src/v8/telemetry.ts +6 -6
- package/src/cms/applySectionConventions.ts +0 -148
- package/src/cms/blockSource.ts +0 -228
- package/src/cms/client.ts +0 -85
- package/src/cms/deferredTrigger.ts +0 -58
- package/src/cms/draftSource.ts +0 -476
- package/src/cms/index.ts +0 -180
- package/src/cms/loadDecofileDirectory.ts +0 -89
- package/src/cms/loader.ts +0 -563
- package/src/cms/registry.ts +0 -264
- package/src/cms/renderJson.ts +0 -179
- package/src/cms/resolve.ts +0 -2583
- package/src/cms/schema.ts +0 -1219
- package/src/cms/sectionLoaderContext.ts +0 -113
- package/src/cms/sectionLoaders.ts +0 -686
- package/src/cms/sectionMixins.ts +0 -153
- package/src/flags/audience.ts +0 -56
- package/src/flags/everyone.ts +0 -29
- package/src/flags/flag.ts +0 -15
- package/src/flags/multivariate/image.ts +0 -11
- package/src/flags/multivariate/message.ts +0 -11
- package/src/flags/multivariate/page.ts +0 -16
- package/src/flags/multivariate/section.ts +0 -16
- package/src/flags/multivariate.ts +0 -1
- package/src/flags/types.ts +0 -59
- package/src/flags/utils/multivariate.ts +0 -20
- package/src/hooks/Image.tsx +0 -314
- package/src/hooks/JsonLd.tsx +0 -353
- package/src/hooks/LazySection.tsx +0 -121
- package/src/hooks/LiveControls.tsx +0 -144
- package/src/hooks/Picture.tsx +0 -127
- package/src/hooks/RenderSection.tsx +0 -91
- package/src/hooks/SectionErrorFallback.tsx +0 -97
- package/src/hooks/Stats.tsx +0 -134
- package/src/hooks/index.ts +0 -35
- package/src/hooks/useLoadMore.ts +0 -100
- package/src/matchers/builtins.ts +0 -459
- package/src/matchers/countryNames.ts +0 -104
- package/src/matchers/override.ts +0 -136
- package/src/matchers/posthog.ts +0 -154
- package/src/middleware/decoState.ts +0 -55
- package/src/middleware/healthMetrics.ts +0 -133
- package/src/middleware/hydrationContext.ts +0 -79
- package/src/middleware/index.ts +0 -88
- package/src/middleware/liveness.ts +0 -21
- package/src/middleware/observability.ts +0 -800
- package/src/middleware/validateSection.ts +0 -100
- package/src/preview/DraftPreviewBadge.tsx +0 -306
- package/src/preview/decoMark.ts +0 -11
- package/src/preview/index.ts +0 -8
- package/src/sdk/abTesting.ts +0 -556
- package/src/sdk/analytics.ts +0 -147
- package/src/sdk/cacheHeaders.ts +0 -633
- package/src/sdk/cacheStorage.ts +0 -287
- package/src/sdk/cachedLoader.ts +0 -556
- package/src/sdk/clx.ts +0 -5
- package/src/sdk/cn.ts +0 -28
- package/src/sdk/composite.ts +0 -114
- package/src/sdk/cookie.ts +0 -129
- package/src/sdk/crypto.ts +0 -199
- package/src/sdk/csp.ts +0 -59
- package/src/sdk/deepOmit.ts +0 -52
- package/src/sdk/detectDevice.ts +0 -45
- package/src/sdk/djb2.ts +0 -20
- package/src/sdk/encoding.ts +0 -44
- package/src/sdk/env.ts +0 -54
- package/src/sdk/experiments.ts +0 -314
- package/src/sdk/fetchCache.ts +0 -269
- package/src/sdk/fetchTimeout.ts +0 -58
- package/src/sdk/flags.ts +0 -138
- package/src/sdk/http.ts +0 -124
- package/src/sdk/index.ts +0 -97
- package/src/sdk/inflightTimeout.ts +0 -53
- package/src/sdk/instrumentedFetch.ts +0 -362
- package/src/sdk/invoke.ts +0 -298
- package/src/sdk/logger.ts +0 -304
- package/src/sdk/mergeCacheControl.ts +0 -150
- package/src/sdk/nonce.ts +0 -46
- package/src/sdk/normalizeUrls.ts +0 -91
- package/src/sdk/observability.ts +0 -116
- package/src/sdk/otel.ts +0 -1118
- package/src/sdk/otelAdapters/clickhouseCollector.ts +0 -65
- package/src/sdk/otelAdapters.ts +0 -144
- package/src/sdk/otelHttpLog.ts +0 -419
- package/src/sdk/otelHttpMeter.ts +0 -532
- package/src/sdk/otelHttpTracer.ts +0 -543
- package/src/sdk/redirects.ts +0 -336
- package/src/sdk/requestContext.ts +0 -281
- package/src/sdk/requestContextStorage.browser.ts +0 -43
- package/src/sdk/requestContextStorage.ts +0 -35
- package/src/sdk/responseCache.ts +0 -82
- package/src/sdk/retry.ts +0 -45
- package/src/sdk/serverTimings.ts +0 -68
- package/src/sdk/signal.ts +0 -42
- package/src/sdk/sitemap.ts +0 -160
- package/src/sdk/urlRedaction.ts +0 -82
- package/src/sdk/urlUtils.ts +0 -183
- package/src/sdk/useDevice.ts +0 -89
- package/src/sdk/useDeviceContext.tsx +0 -108
- package/src/sdk/useId.ts +0 -7
- package/src/sdk/useScript.ts +0 -210
- package/src/sdk/useSuggestions.ts +0 -188
- package/src/sdk/wrapCaughtErrors.ts +0 -107
- package/src/setup.ts +0 -120
- package/src/types/index.ts +0 -53
- package/src/types/widgets.ts +0 -14
package/src/protocol/index.ts
CHANGED
|
@@ -24,7 +24,7 @@ export {
|
|
|
24
24
|
canonicalJson,
|
|
25
25
|
computeContentRevision,
|
|
26
26
|
sha256Hex,
|
|
27
|
-
} from "./canonical";
|
|
27
|
+
} from "./canonical.ts";
|
|
28
28
|
export {
|
|
29
29
|
assertSupportedEndpoint,
|
|
30
30
|
type BatchCall,
|
|
@@ -32,8 +32,8 @@ export {
|
|
|
32
32
|
type ContentClient,
|
|
33
33
|
type ContentClientOptions,
|
|
34
34
|
createContentClient,
|
|
35
|
-
} from "./client";
|
|
36
|
-
export * from "./errors";
|
|
37
|
-
export * from "./keys";
|
|
38
|
-
export * from "./storage";
|
|
39
|
-
export * from "./types";
|
|
35
|
+
} from "./client.ts";
|
|
36
|
+
export * from "./errors.ts";
|
|
37
|
+
export * from "./keys.ts";
|
|
38
|
+
export * from "./storage.ts";
|
|
39
|
+
export * from "./types.ts";
|
package/src/protocol/params.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* parsed copy of a record would turn an own `__proto__` key into a prototype.
|
|
8
8
|
*/
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
import { invalidParams } from "./errors";
|
|
11
|
-
import type { BlocksApplyParams, MethodName, ReadParams } from "./types";
|
|
10
|
+
import { invalidParams } from "./errors.ts";
|
|
11
|
+
import type { BlocksApplyParams, MethodName, ReadParams } from "./types.ts";
|
|
12
12
|
|
|
13
13
|
const opaque = z.string().min(1).max(1024);
|
|
14
14
|
|
package/src/protocol/secrets.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* The schema marks a `Secret` field with `"format": "secret"` — the contract
|
|
12
12
|
* `deco schema` emits for the `Secret` type. Browser-safe.
|
|
13
13
|
*/
|
|
14
|
-
import { parseCiphertext } from "./ciphertext";
|
|
15
|
-
import type { BlockViolation } from "./errors";
|
|
16
|
-
import type { DecoMeta } from "./types";
|
|
14
|
+
import { parseCiphertext } from "./ciphertext.ts";
|
|
15
|
+
import type { BlockViolation } from "./errors.ts";
|
|
16
|
+
import type { DecoMeta } from "./types.ts";
|
|
17
17
|
|
|
18
18
|
/** The built-in block type that holds an encrypted value. */
|
|
19
19
|
export const SECRET_BLOCK_TYPE = "secret";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
assetNameForType,
|
|
18
18
|
isAcceptedAssetType,
|
|
19
19
|
sanitizeAssetName,
|
|
20
|
-
} from "../assets";
|
|
20
|
+
} from "../assets.ts";
|
|
21
21
|
import {
|
|
22
22
|
type ContentProtocolError,
|
|
23
23
|
ErrorCode,
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
readOnly,
|
|
28
28
|
unauthorized,
|
|
29
29
|
unsupported,
|
|
30
|
-
} from "../errors";
|
|
31
|
-
import type { ContentStorage } from "../storage";
|
|
32
|
-
import { ASSETS_URL_PREFIX } from "../types";
|
|
33
|
-
import { type AuthOptions, assertAuthOptions, authenticate } from "./auth";
|
|
34
|
-
import { BodyEncodingError, BodyTooLargeError, jsonResponse, readBody } from "./http";
|
|
30
|
+
} from "../errors.ts";
|
|
31
|
+
import type { ContentStorage } from "../storage.ts";
|
|
32
|
+
import { ASSETS_URL_PREFIX } from "../types.ts";
|
|
33
|
+
import { type AuthOptions, assertAuthOptions, authenticate } from "./auth.ts";
|
|
34
|
+
import { BodyEncodingError, BodyTooLargeError, jsonResponse, readBody } from "./http.ts";
|
|
35
35
|
|
|
36
36
|
const STATUS: Record<number, number> = {
|
|
37
37
|
[ErrorCode.Unauthorized]: 401,
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* Shared by `blocks.list` (which needs every body) and `blocks.apply` (which
|
|
5
5
|
* needs bodies only to break ties between spellings).
|
|
6
6
|
*/
|
|
7
|
-
import { limitExceeded, unavailable } from "../errors";
|
|
8
|
-
import { entryHasPath, fullyDecodeFileName, isBlockFileName, resolveSpellings } from "../keys";
|
|
9
|
-
import type { ContentStorage, StorageFile, StorageSnapshot } from "../storage";
|
|
10
|
-
import type { Diagnostic, Limits } from "../types";
|
|
11
|
-
import { type BodyCache, type ParsedBody, parseBody } from "./bodyCache";
|
|
7
|
+
import { limitExceeded, unavailable } from "../errors.ts";
|
|
8
|
+
import { entryHasPath, fullyDecodeFileName, isBlockFileName, resolveSpellings } from "../keys.ts";
|
|
9
|
+
import type { ContentStorage, StorageFile, StorageSnapshot } from "../storage.ts";
|
|
10
|
+
import type { Diagnostic, Limits } from "../types.ts";
|
|
11
|
+
import { type BodyCache, type ParsedBody, parseBody } from "./bodyCache.ts";
|
|
12
12
|
|
|
13
13
|
export interface LoadedEntry {
|
|
14
14
|
file: string;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The shared state of one content handler: its storage, options and caches.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
ContentProtocolError,
|
|
6
|
+
invalidBlock,
|
|
7
|
+
notFound,
|
|
8
|
+
unavailable,
|
|
9
|
+
unsupported,
|
|
10
|
+
} from "../errors.ts";
|
|
11
|
+
import { blockNameFromFile } from "../keys.ts";
|
|
6
12
|
import {
|
|
7
13
|
type ContentStorage,
|
|
8
14
|
type StorageDescription,
|
|
9
15
|
StorageInvalidFileError,
|
|
10
16
|
StorageNotFoundError,
|
|
11
17
|
StorageUnavailableError,
|
|
12
|
-
} from "../storage";
|
|
13
|
-
import { DEFAULT_LIMITS, type DecoMeta, type Limits } from "../types";
|
|
14
|
-
import type { AuthOptions } from "./auth";
|
|
15
|
-
import { BodyCache } from "./bodyCache";
|
|
18
|
+
} from "../storage.ts";
|
|
19
|
+
import { DEFAULT_LIMITS, type DecoMeta, type Limits } from "../types.ts";
|
|
20
|
+
import type { AuthOptions } from "./auth.ts";
|
|
21
|
+
import { BodyCache } from "./bodyCache.ts";
|
|
16
22
|
|
|
17
23
|
export interface ContentHandlerOptions extends AuthOptions {
|
|
18
24
|
/** Reported by `describe`, such as `{ name: "deco-cli", version: "8.0.0" }`. */
|
|
@@ -23,18 +23,18 @@ import {
|
|
|
23
23
|
limitExceeded,
|
|
24
24
|
parseError,
|
|
25
25
|
unauthorized,
|
|
26
|
-
} from "../errors";
|
|
27
|
-
import type { ContentStorage } from "../storage";
|
|
28
|
-
import { assertAuthOptions, authenticate } from "./auth";
|
|
29
|
-
import { type ContentHandlerOptions, Core } from "./core";
|
|
26
|
+
} from "../errors.ts";
|
|
27
|
+
import type { ContentStorage } from "../storage.ts";
|
|
28
|
+
import { assertAuthOptions, authenticate } from "./auth.ts";
|
|
29
|
+
import { type ContentHandlerOptions, Core } from "./core.ts";
|
|
30
30
|
import {
|
|
31
31
|
BodyEncodingError,
|
|
32
32
|
BodyTooLargeError,
|
|
33
33
|
isJsonContentType,
|
|
34
34
|
jsonResponse,
|
|
35
35
|
readBody,
|
|
36
|
-
} from "./http";
|
|
37
|
-
import { dispatch } from "./rpc";
|
|
36
|
+
} from "./http.ts";
|
|
37
|
+
import { dispatch } from "./rpc.ts";
|
|
38
38
|
|
|
39
39
|
export type ContentHandler = (request: Request) => Promise<Response>;
|
|
40
40
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* only (Request, Response, CompressionStream), so it runs on Node, Bun,
|
|
5
5
|
* Workers and Deno.
|
|
6
6
|
*/
|
|
7
|
-
import { sha256Hex } from "../canonical";
|
|
7
|
+
import { sha256Hex } from "../canonical.ts";
|
|
8
8
|
|
|
9
9
|
/** The body was larger than allowed (after decompression). */
|
|
10
10
|
export class BodyTooLargeError extends Error {
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* and Deno. (`deco serve`'s asset uploads use `./assets`, which isn't public.)
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export type { AuthOptions, AuthorizeResult } from "./auth";
|
|
10
|
-
export type { ContentHandlerOptions } from "./core";
|
|
11
|
-
export { type ContentHandler, createContentHandler } from "./handler";
|
|
9
|
+
export type { AuthOptions, AuthorizeResult } from "./auth.ts";
|
|
10
|
+
export type { ContentHandlerOptions } from "./core.ts";
|
|
11
|
+
export { type ContentHandler, createContentHandler } from "./handler.ts";
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* key reserved meanwhile) is retried against a new snapshot after a jittered
|
|
19
19
|
* backoff, rechecking every guard, up to `maxCommitAttempts` times.
|
|
20
20
|
*/
|
|
21
|
-
import { applyRequestDigest, canonicalJson } from "../../canonical";
|
|
21
|
+
import { applyRequestDigest, canonicalJson } from "../../canonical.ts";
|
|
22
22
|
import {
|
|
23
23
|
type BlockViolation,
|
|
24
24
|
conflict,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
unavailable,
|
|
30
30
|
unsupported,
|
|
31
31
|
type VersionMismatch,
|
|
32
|
-
} from "../../errors";
|
|
32
|
+
} from "../../errors.ts";
|
|
33
33
|
import {
|
|
34
34
|
blockFileName,
|
|
35
35
|
blockNameFromFile,
|
|
@@ -39,13 +39,13 @@ import {
|
|
|
39
39
|
isBlockFileName,
|
|
40
40
|
serializeBlock,
|
|
41
41
|
spellingKey,
|
|
42
|
-
} from "../../keys";
|
|
43
|
-
import { checkSecrets } from "../../secrets";
|
|
44
|
-
import type { StorageDescription, StoredReceipt } from "../../storage";
|
|
45
|
-
import type { BlocksApplyParams, BlocksApplyResult, DecoMeta, Limits } from "../../types";
|
|
46
|
-
import { type LoadedContent, type LoadedEntry, loadCurrentContent } from "../content";
|
|
47
|
-
import type { Core } from "../core";
|
|
48
|
-
import { parseSchema, readSchema } from "./read";
|
|
42
|
+
} from "../../keys.ts";
|
|
43
|
+
import { checkSecrets } from "../../secrets.ts";
|
|
44
|
+
import type { StorageDescription, StoredReceipt } from "../../storage.ts";
|
|
45
|
+
import type { BlocksApplyParams, BlocksApplyResult, DecoMeta, Limits } from "../../types.ts";
|
|
46
|
+
import { type LoadedContent, type LoadedEntry, loadCurrentContent } from "../content.ts";
|
|
47
|
+
import type { Core } from "../core.ts";
|
|
48
|
+
import { parseSchema, readSchema } from "./read.ts";
|
|
49
49
|
|
|
50
50
|
const utf8 = new TextEncoder();
|
|
51
51
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The three read methods: `describe`, `schema.get` and `blocks.list`.
|
|
3
3
|
*/
|
|
4
|
-
import { publicKeyDerFromPem } from "../../ciphertext";
|
|
5
|
-
import { limitExceeded, notFound, unavailable } from "../../errors";
|
|
4
|
+
import { publicKeyDerFromPem } from "../../ciphertext.ts";
|
|
5
|
+
import { limitExceeded, notFound, unavailable } from "../../errors.ts";
|
|
6
6
|
import {
|
|
7
7
|
ASSETS_URL_PREFIX,
|
|
8
8
|
type BlocksListResult,
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
type ReadParams,
|
|
14
14
|
SCHEMA_FORMAT,
|
|
15
15
|
type SchemaGetResult,
|
|
16
|
-
} from "../../types";
|
|
17
|
-
import { loadCurrentContent } from "../content";
|
|
18
|
-
import type { Core } from "../core";
|
|
16
|
+
} from "../../types.ts";
|
|
17
|
+
import { loadCurrentContent } from "../content.ts";
|
|
18
|
+
import type { Core } from "../core.ts";
|
|
19
19
|
|
|
20
20
|
const DEFAULT_SERVER = { name: "deco-blocks", version: "unknown" };
|
|
21
21
|
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
invalidRequest,
|
|
16
16
|
limitExceeded,
|
|
17
17
|
methodNotFound,
|
|
18
|
-
} from "../errors";
|
|
19
|
-
import { validateParams } from "../params";
|
|
20
|
-
import { MAX_BATCH_CALLS, METHOD_NAMES, type MethodName, type RpcId } from "../types";
|
|
21
|
-
import { type Core, toProtocolError } from "./core";
|
|
22
|
-
import { blocksApply } from "./methods/apply";
|
|
23
|
-
import { blocksList, describe, schemaGet } from "./methods/read";
|
|
18
|
+
} from "../errors.ts";
|
|
19
|
+
import { validateParams } from "../params.ts";
|
|
20
|
+
import { MAX_BATCH_CALLS, METHOD_NAMES, type MethodName, type RpcId } from "../types.ts";
|
|
21
|
+
import { type Core, toProtocolError } from "./core.ts";
|
|
22
|
+
import { blocksApply } from "./methods/apply.ts";
|
|
23
|
+
import { blocksList, describe, schemaGet } from "./methods/read.ts";
|
|
24
24
|
|
|
25
25
|
const utf8 = new TextEncoder();
|
|
26
26
|
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { lstat, mkdir, open, readdir, readFile, stat } from "node:fs/promises";
|
|
23
23
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
24
|
-
import { suffixedAssetName } from "../../assets";
|
|
25
|
-
import { isBlockFileName } from "../../keys";
|
|
24
|
+
import { suffixedAssetName } from "../../assets.ts";
|
|
25
|
+
import { isBlockFileName } from "../../keys.ts";
|
|
26
26
|
import {
|
|
27
27
|
type CommitResult,
|
|
28
28
|
type ContentStorage,
|
|
@@ -34,11 +34,11 @@ import {
|
|
|
34
34
|
StorageUnavailableError,
|
|
35
35
|
type StoredFileBody,
|
|
36
36
|
type StoredSchema,
|
|
37
|
-
} from "../../storage";
|
|
38
|
-
import type { Limits } from "../../types";
|
|
39
|
-
import { gitBlobHash, revisionOf } from "./hash";
|
|
40
|
-
import { withCommitLock } from "./lock";
|
|
41
|
-
import { applyFileChange, sweepStaleTransactions } from "./transaction";
|
|
37
|
+
} from "../../storage.ts";
|
|
38
|
+
import type { Limits } from "../../types.ts";
|
|
39
|
+
import { gitBlobHash, revisionOf } from "./hash.ts";
|
|
40
|
+
import { withCommitLock } from "./lock.ts";
|
|
41
|
+
import { applyFileChange, sweepStaleTransactions } from "./transaction.ts";
|
|
42
42
|
|
|
43
43
|
export interface FsStorageOptions {
|
|
44
44
|
/** The app root: the folder that contains `.deco/`. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { open, rm, stat } from "node:fs/promises";
|
|
7
7
|
import { join } from "node:path";
|
|
8
|
-
import { StorageUnavailableError } from "../../storage";
|
|
8
|
+
import { StorageUnavailableError } from "../../storage.ts";
|
|
9
9
|
|
|
10
10
|
const LOCK_FILE = ".blocks.lock";
|
|
11
11
|
const queues = new Map<string, Promise<unknown>>();
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* filesystem storage needs `node:fs`; on Workers or in a browser, implement
|
|
5
5
|
* `ContentStorage` over the storage you have instead.
|
|
6
6
|
*/
|
|
7
|
-
import type { createFsStorage as nodeCreateFsStorage } from "./index";
|
|
7
|
+
import type { createFsStorage as nodeCreateFsStorage } from "./index.ts";
|
|
8
8
|
|
|
9
|
-
export type { FsStorage, FsStorageOptions } from "./index";
|
|
9
|
+
export type { FsStorage, FsStorageOptions } from "./index.ts";
|
|
10
10
|
|
|
11
11
|
export const createFsStorage: typeof nodeCreateFsStorage = () => {
|
|
12
12
|
throw new Error(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* An in-memory `ContentStorage` (internal; not a package subpath).
|
|
3
3
|
*
|
|
4
4
|
* A reference implementation of the storage contract, including durable
|
|
5
5
|
* request-key receipts persisted atomically with each commit, and a fixture
|
|
6
6
|
* for tests: its state can be dumped and restored to simulate a restart, and
|
|
7
7
|
* hooks let a test change files between a snapshot and a commit. Browser-safe.
|
|
8
8
|
*/
|
|
9
|
-
import { suffixedAssetName } from "../assets";
|
|
10
|
-
import { sha256Hex } from "../canonical";
|
|
11
|
-
import { isBlockFileName } from "../keys";
|
|
9
|
+
import { suffixedAssetName } from "../assets.ts";
|
|
10
|
+
import { sha256Hex } from "../canonical.ts";
|
|
11
|
+
import { isBlockFileName } from "../keys.ts";
|
|
12
12
|
import {
|
|
13
13
|
type CommitAttempt,
|
|
14
14
|
type CommitResult,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
type StoredFileBody,
|
|
21
21
|
type StoredReceipt,
|
|
22
22
|
type StoredSchema,
|
|
23
|
-
} from "../storage";
|
|
23
|
+
} from "../storage.ts";
|
|
24
24
|
|
|
25
25
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
26
26
|
|
package/src/protocol/storage.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Browser-safe: types and small error classes only.
|
|
12
12
|
*/
|
|
13
|
-
import type { Limits, StorageKind } from "./types";
|
|
13
|
+
import type { Limits, StorageKind } from "./types.ts";
|
|
14
14
|
|
|
15
15
|
/** What a storage tells `describe`. */
|
|
16
16
|
export interface StorageDescription {
|
package/src/v8/analytics.ts
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* `navigator.sendBeacon` or a `POST`.
|
|
18
18
|
*/
|
|
19
19
|
import { createElement, type ReactNode } from "react";
|
|
20
|
-
import { HOSTED_ANALYTICS_COLLECTOR } from "./builtins/data";
|
|
21
|
-
import type { Analytics } from "./types";
|
|
20
|
+
import { HOSTED_ANALYTICS_COLLECTOR } from "./builtins/data.ts";
|
|
21
|
+
import type { Analytics } from "./types.ts";
|
|
22
22
|
|
|
23
23
|
const GLOBAL = "__decoAnalytics";
|
|
24
24
|
|
package/src/v8/background.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* /next/telemetry-internals#sending-in-the-background).
|
|
5
5
|
*
|
|
6
6
|
* Where it runs, in order:
|
|
7
|
-
* - a
|
|
7
|
+
* - a hook the host installs under {@link BACKGROUND_HOOK};
|
|
8
8
|
* - on Cloudflare Workers, which run no timers between requests, the
|
|
9
9
|
* platform's `waitUntil` (from `cloudflare:workers`), so the task runs
|
|
10
10
|
* after the response with no binding and no user code: the core installs
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* A task never throws into its caller: errors and rejections are swallowed.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
/** Where a
|
|
20
|
+
/** Where a host installs `(task) => void` to run background work its own way. */
|
|
21
21
|
const BACKGROUND_HOOK = Symbol.for("decocms.blocks.background");
|
|
22
22
|
|
|
23
23
|
type Task = () => unknown;
|
|
@@ -101,7 +101,7 @@ export function later(ms: number, callback: () => void): void {
|
|
|
101
101
|
timer?.unref?.();
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
/** Whether a
|
|
104
|
+
/** Whether a host installed a background hook (then batches go out after each response). */
|
|
105
105
|
export function hasBackgroundHook(): boolean {
|
|
106
106
|
return typeof (globalThis as BackgroundGlobals)[BACKGROUND_HOOK] === "function";
|
|
107
107
|
}
|
package/src/v8/builtins/data.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Analytics, Redirect, Telemetry } from "../types";
|
|
1
|
+
import type { Analytics, Redirect, Telemetry } from "../types.ts";
|
|
2
2
|
|
|
3
3
|
/** The hosted Deco CMS collector: where page views go when `collector` is left out. */
|
|
4
4
|
export const HOSTED_ANALYTICS_COLLECTOR = "https://d.lilstts.com/events";
|
package/src/v8/builtins/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { BlockFunction } from "../types";
|
|
2
|
-
import { analytics, page, redirect, telemetry } from "./data";
|
|
3
|
-
import { lazy } from "./lazy";
|
|
4
|
-
import { always, date, never } from "./matchers";
|
|
5
|
-
import { multivariate } from "./multivariate";
|
|
6
|
-
import { secretBlock } from "./secret";
|
|
1
|
+
import type { BlockFunction } from "../types.ts";
|
|
2
|
+
import { analytics, page, redirect, telemetry } from "./data.ts";
|
|
3
|
+
import { lazy } from "./lazy.ts";
|
|
4
|
+
import { always, date, never } from "./matchers.ts";
|
|
5
|
+
import { multivariate } from "./multivariate.ts";
|
|
6
|
+
import { secretBlock } from "./secret.ts";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The built-in blocks every block map gets. `secret` here has no key, so it
|
package/src/v8/builtins/lazy.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* - Legacy variants are saved as plain values; on the way to `multivariate`
|
|
17
17
|
* each one is wrapped in a `lazy` block, so only the chosen one runs.
|
|
18
18
|
*/
|
|
19
|
-
import { isPlainObject, type JsonObject } from "../json";
|
|
19
|
+
import { isPlainObject, type JsonObject } from "../json.ts";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Legacy type name → built-in. The one table: the runtime falls back to it,
|
|
@@ -25,7 +25,7 @@ import { isPlainObject, type JsonObject } from "../json";
|
|
|
25
25
|
* (/next/studio-compatibility#well-known-types-and-the-alias-table); other
|
|
26
26
|
* legacy names (`$live/…`, the per-kind multivariate files, the date
|
|
27
27
|
* matcher) are rewritten to these by the one-time migration
|
|
28
|
-
* (
|
|
28
|
+
* (the `deco-v7-to-v8-migration` skill), and types with no built-in counterpart are
|
|
29
29
|
* left to the site's block map.
|
|
30
30
|
*/
|
|
31
31
|
export const LEGACY_ALIASES: Readonly<Record<string, string>> = Object.freeze({
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* telemetry). A decrypted value stays on the server because it's resolved
|
|
18
18
|
* there; tainting it (React's taint API) is up to the site's own code.
|
|
19
19
|
*/
|
|
20
|
-
import { parseCiphertext } from "../ciphertext";
|
|
21
|
-
import type { BlockFunction } from "../types";
|
|
20
|
+
import { parseCiphertext } from "../ciphertext.ts";
|
|
21
|
+
import type { BlockFunction } from "../types.ts";
|
|
22
22
|
|
|
23
23
|
/** True in a browser, where a secret must never be decrypted. */
|
|
24
24
|
function inBrowser(): boolean {
|
package/src/v8/cli/builtins.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Names the CLI knows without reading any code: the built-in blocks (the
|
|
3
3
|
* core's reserved names) and the legacy alias table.
|
|
4
4
|
*/
|
|
5
|
-
import { RESERVED_NAMES } from "../builtins";
|
|
5
|
+
import { RESERVED_NAMES } from "../builtins/index.ts";
|
|
6
6
|
|
|
7
7
|
/** Spec: built-in-blocks. Every block map gets these, in this order. */
|
|
8
8
|
export const BUILT_IN_BLOCKS: readonly string[] = [...RESERVED_NAMES];
|
|
@@ -17,4 +17,4 @@ export function isBuiltIn(name: string): boolean {
|
|
|
17
17
|
* editor's special screens still look types up by these names (spec:
|
|
18
18
|
* studio-compatibility › Well-known types and the alias table).
|
|
19
19
|
*/
|
|
20
|
-
export { LEGACY_ALIASES, storesPlainVariants } from "../builtins/legacy";
|
|
20
|
+
export { LEGACY_ALIASES, storesPlainVariants } from "../builtins/legacy.ts";
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import fs from "node:fs";
|
|
21
|
-
import Ajv,
|
|
22
|
-
import { isWellFormedCiphertext } from "../../../protocol/secrets";
|
|
23
|
-
import { isBlock, own } from "../../json";
|
|
24
|
-
import { findRouteConflicts } from "../../matchRoute";
|
|
25
|
-
import { isBuiltIn, storesPlainVariants } from "../builtins";
|
|
26
|
-
import { readSavedBlocks, type SavedBlocks } from "../content";
|
|
27
|
-
import { consoleReporter, type Reporter } from "../log";
|
|
28
|
-
import { CliError, decoPaths, findDecoRoot } from "../root";
|
|
29
|
-
import type { DecoMeta } from "../schema/generate";
|
|
30
|
-
import { SECTION_REF_KEY, toBase64 } from "../schema/typeToSchema";
|
|
31
|
-
import { BLOCK_DEF, joinPath, rewriteErrors } from "./messages";
|
|
21
|
+
import { Ajv, type ValidateFunction } from "ajv";
|
|
22
|
+
import { isWellFormedCiphertext } from "../../../protocol/secrets.ts";
|
|
23
|
+
import { isBlock, own } from "../../json.ts";
|
|
24
|
+
import { findRouteConflicts } from "../../matchRoute.ts";
|
|
25
|
+
import { isBuiltIn, storesPlainVariants } from "../builtins.ts";
|
|
26
|
+
import { readSavedBlocks, type SavedBlocks } from "../content.ts";
|
|
27
|
+
import { consoleReporter, type Reporter } from "../log.ts";
|
|
28
|
+
import { CliError, decoPaths, findDecoRoot } from "../root.ts";
|
|
29
|
+
import type { DecoMeta } from "../schema/generate.ts";
|
|
30
|
+
import { SECTION_REF_KEY, toBase64 } from "../schema/typeToSchema.ts";
|
|
31
|
+
import { BLOCK_DEF, joinPath, rewriteErrors } from "./messages.ts";
|
|
32
32
|
|
|
33
33
|
export interface Problem {
|
|
34
34
|
/** The saved block's file, relative to the root: `.deco/blocks/HomePage.json`. */
|
package/src/v8/cli/content.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import { computeContentRevision } from "../../protocol/canonical";
|
|
8
|
+
import { computeContentRevision } from "../../protocol/canonical.ts";
|
|
9
9
|
import {
|
|
10
10
|
blockNameFromFile,
|
|
11
11
|
checkBlockName,
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
isBlockFileName,
|
|
14
14
|
resolveSpellings,
|
|
15
15
|
type SpellingCandidate,
|
|
16
|
-
} from "../../protocol/keys";
|
|
17
|
-
import { isPlainObject } from "../json";
|
|
18
|
-
import { LEGACY_ALIASES } from "./builtins";
|
|
19
|
-
import { consoleReporter, type Reporter } from "./log";
|
|
20
|
-
import { CliError, type DecoPaths, decoPaths, findDecoRoot } from "./root";
|
|
16
|
+
} from "../../protocol/keys.ts";
|
|
17
|
+
import { isPlainObject } from "../json.ts";
|
|
18
|
+
import { LEGACY_ALIASES } from "./builtins.ts";
|
|
19
|
+
import { consoleReporter, type Reporter } from "./log.ts";
|
|
20
|
+
import { CliError, type DecoPaths, decoPaths, findDecoRoot } from "./root.ts";
|
|
21
21
|
|
|
22
22
|
export interface ContentDiagnostic {
|
|
23
23
|
/** The file name inside `.deco/blocks`. */
|
package/src/v8/cli/index.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* reaches an app bundle.
|
|
6
6
|
*
|
|
7
7
|
* The four commands and their options, plus what the one-time migration
|
|
8
|
-
* (
|
|
8
|
+
* (the `deco-v7-to-v8-migration` skill) reads: the built-in block names, the alias
|
|
9
9
|
* table and the saved-blocks reader.
|
|
10
10
|
*/
|
|
11
|
-
export { BUILT_IN_BLOCKS, LEGACY_ALIASES } from "./builtins";
|
|
12
|
-
export { type CheckOptions, check } from "./check/index";
|
|
13
|
-
export { type ContentOptions, content, readSavedBlocks, type SavedBlocks } from "./content";
|
|
14
|
-
export { type Reporter, silentReporter } from "./log";
|
|
15
|
-
export { runCli } from "./run";
|
|
16
|
-
export { type SchemaOptions, schema } from "./schema/index";
|
|
17
|
-
export { type ServeOptions, serve } from "./serve/server";
|
|
11
|
+
export { BUILT_IN_BLOCKS, LEGACY_ALIASES } from "./builtins.ts";
|
|
12
|
+
export { type CheckOptions, check } from "./check/index.ts";
|
|
13
|
+
export { type ContentOptions, content, readSavedBlocks, type SavedBlocks } from "./content.ts";
|
|
14
|
+
export { type Reporter, silentReporter } from "./log.ts";
|
|
15
|
+
export { runCli } from "./run.ts";
|
|
16
|
+
export { type SchemaOptions, schema } from "./schema/index.ts";
|
|
17
|
+
export { type ServeOptions, serve } from "./serve/server.ts";
|
package/src/v8/cli/main.ts
CHANGED
package/src/v8/cli/run.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* The `deco` command line: `deco <schema|content|check|serve> [flags]`
|
|
3
3
|
* (spec: cli). Parses flags, runs one command and returns its exit code.
|
|
4
4
|
*/
|
|
5
|
-
import { check } from "./check/index";
|
|
6
|
-
import { content, writeContent } from "./content";
|
|
7
|
-
import { consoleReporter, type Reporter } from "./log";
|
|
8
|
-
import { CliError, decoPaths, findDecoRoot } from "./root";
|
|
9
|
-
import { reportSchema, schema, writeSchema } from "./schema/index";
|
|
10
|
-
import { serve, startServer } from "./serve/server";
|
|
11
|
-
import { watchFiles, watchTree } from "./watch";
|
|
5
|
+
import { check } from "./check/index.ts";
|
|
6
|
+
import { content, writeContent } from "./content.ts";
|
|
7
|
+
import { consoleReporter, type Reporter } from "./log.ts";
|
|
8
|
+
import { CliError, decoPaths, findDecoRoot } from "./root.ts";
|
|
9
|
+
import { reportSchema, schema, writeSchema } from "./schema/index.ts";
|
|
10
|
+
import { serve, startServer } from "./serve/server.ts";
|
|
11
|
+
import { watchFiles, watchTree } from "./watch.ts";
|
|
12
12
|
|
|
13
13
|
type FlagKind = "string" | "boolean" | "list";
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* in api-reference › Types). They're always in the schema, unless the block
|
|
4
4
|
* map declares the same key, which replaces the built-in.
|
|
5
5
|
*/
|
|
6
|
-
import { lazySchema, resolvableRef, sectionRef } from "./typeToSchema";
|
|
6
|
+
import { lazySchema, resolvableRef, sectionRef } from "./typeToSchema.ts";
|
|
7
7
|
|
|
8
8
|
export type ManifestGroup = "sections" | "matchers" | "loaders" | "pages" | "redirects" | "content";
|
|
9
9
|
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import fs from "node:fs";
|
|
14
14
|
import path from "node:path";
|
|
15
|
-
import { SCHEMA_FORMAT } from "../../../protocol/types";
|
|
16
|
-
import { BUILT_IN_BLOCKS, LEGACY_ALIASES } from "../builtins";
|
|
17
|
-
import { CliError, type DecoPaths, packageVersion } from "../root";
|
|
15
|
+
import { SCHEMA_FORMAT } from "../../../protocol/types.ts";
|
|
16
|
+
import { BUILT_IN_BLOCKS, LEGACY_ALIASES } from "../builtins.ts";
|
|
17
|
+
import { CliError, type DecoPaths, packageVersion } from "../root.ts";
|
|
18
18
|
import {
|
|
19
19
|
BUILT_IN_GROUPS,
|
|
20
20
|
builtInDefinition,
|
|
21
21
|
flatDefinition,
|
|
22
22
|
legacyMultivariateValue,
|
|
23
23
|
type ManifestGroup,
|
|
24
|
-
} from "./builtinSchemas";
|
|
25
|
-
import { createTsProject, type TsNode as Node, type TsType as Type } from "./tsProgram";
|
|
24
|
+
} from "./builtinSchemas.ts";
|
|
25
|
+
import { createTsProject, type TsNode as Node, type TsType as Type } from "./tsProgram.ts";
|
|
26
26
|
import {
|
|
27
27
|
awaitedOf,
|
|
28
28
|
getJsDocTags,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
stableFileId,
|
|
36
36
|
toBase64,
|
|
37
37
|
typeToJsonSchema,
|
|
38
|
-
} from "./typeToSchema";
|
|
38
|
+
} from "./typeToSchema.ts";
|
|
39
39
|
|
|
40
40
|
const MANIFEST_GROUPS: ManifestGroup[] = [
|
|
41
41
|
"sections",
|