@riverbankcms/sdk 0.96.0 → 0.99.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/README.md +20 -1
- package/dist/{PreviewEditorSidebar-46VT4QVU.mjs → PreviewEditorSidebar-TPOKCCKY.mjs} +3 -3
- package/dist/{PreviewEditorUI-JD75GE5F.mjs → PreviewEditorUI-Y347GLC2.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-OGTXRQ4M.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +36 -36
- package/dist/_dts/api/src/billing.d.ts +2 -0
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +35 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +246 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +5 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +109 -40
- package/dist/_dts/api/src/endpoints.d.ts +88 -0
- package/dist/_dts/api/src/index.d.ts +3 -2
- package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +10 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -1
- package/dist/_dts/api/src/siteOperations.d.ts +65 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +7 -1
- package/dist/_dts/billing/src/site-arrangements.d.ts +151 -0
- package/dist/_dts/billing/src/subscriptions/store.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/utils/resolveThumbnail.d.ts +2 -1
- package/dist/_dts/blocks/src/PageRenderer.d.ts +8 -1
- package/dist/_dts/blocks/src/bindings/types.d.ts +0 -4
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +7 -0
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +12 -12
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/layout.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/weekly-slot-availability.d.ts +34 -0
- package/dist/_dts/blocks/src/system/componentFactory.d.ts +1 -0
- package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/facets.d.ts +2 -2
- package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/prefetchBlockData.d.ts +4 -1
- package/dist/_dts/blocks/src/system/node/builder.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/schema.d.ts +13 -0
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/registry.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/components/booking/DatePicker.d.ts +6 -2
- package/dist/_dts/blocks/src/system/runtime/components/booking/SuccessMessage.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/components/booking/TimeSlotSelector.d.ts +10 -4
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/StepIndicator.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +8 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +133 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.controller.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.state.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.server.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.view.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +31 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/FeedbackMessage.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/{nodes/event-registration → shared/components}/SelectableOptionCard.d.ts +11 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/StepIndicator.d.ts +16 -5
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/shared/index.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +5 -0
- package/dist/_dts/blocks/src/utils/date-formatting.d.ts +18 -2
- package/dist/_dts/content-editor/src/primitives/PreviewInlineTextEditor.d.ts +1 -1
- package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +1 -1
- package/dist/_dts/content-model/src/templates/defaults.d.ts +5 -5
- package/dist/_dts/content-model/src/templates/types.d.ts +2 -6
- package/dist/_dts/core/src/branded.d.ts +8 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +767 -20
- package/dist/_dts/field-primitives/src/bindings/index.d.ts +8 -0
- package/dist/_dts/sdk/src/__mocks__/next-cache.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/push/publishGuidance.d.ts +15 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +3 -1
- package/dist/_dts/sdk/src/cli/commands/push/stale-resolution.d.ts +9 -3
- package/dist/_dts/sdk/src/cli/commands/push/workflowPlan.d.ts +34 -0
- package/dist/_dts/sdk/src/cli/commands/push.d.ts +13 -0
- package/dist/_dts/sdk/src/cli/commands/setup.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/config-loader.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/content/metadataStore.d.ts +29 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +16 -14
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +6 -4
- package/dist/_dts/sdk/src/cli/env-scope.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/helpers.d.ts +6 -7
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergeReport.d.ts +6 -18
- package/dist/_dts/sdk/src/cli/merge-remote/entrySnapshots.d.ts +2 -4
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePush.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +6 -18
- package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +2 -4
- package/dist/_dts/sdk/src/cli/merge-remote/sharedBaseSnapshots.d.ts +32 -0
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergePlan.d.ts +27 -0
- package/dist/_dts/sdk/src/cli/merge-remote/sharedMergeReport.d.ts +63 -0
- package/dist/_dts/sdk/src/cli/push-config.d.ts +13 -2
- package/dist/_dts/sdk/src/cli/setup/setupPlan.d.ts +51 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +21 -0
- package/dist/_dts/sdk/src/client/index.d.ts +6 -0
- package/dist/_dts/sdk/src/client/runtimeCachePolicy.d.ts +1 -1
- package/dist/_dts/sdk/src/client/types.d.ts +18 -2
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -0
- package/dist/_dts/sdk/src/contracts/bindings.d.ts +3 -7
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +13 -0
- package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +6 -1
- package/dist/_dts/sdk/src/next/route-outcome-proxy.d.ts +3 -3
- package/dist/_dts/sdk/src/next/types.d.ts +19 -0
- package/dist/_dts/sdk/src/prebuild/loader.d.ts +8 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +174 -78
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +4 -0
- package/dist/_dts/sdk/src/rendering/helpers/bindings.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +58 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +8 -0
- package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +18 -66
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +2 -0
- package/dist/_dts/sdk/src/routing/resolveRoute.d.ts +18 -0
- package/dist/_dts/sdk/src/test/apiClient.d.ts +17 -0
- package/dist/_dts/sdk/src/test/bunDom.setup.d.ts +1 -0
- package/dist/_dts/sdk/src/test/env.d.ts +4 -0
- package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +3 -3
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/interactive/generateBaseCSS.d.ts +6 -0
- package/dist/_dts/theme-core/src/status/contextualColors.d.ts +6 -0
- package/dist/_dts/theme-core/src/status/index.d.ts +1 -0
- package/dist/{chunk-VHIMXQ7Z.mjs → chunk-4HXF2QLH.mjs} +2 -2
- package/dist/{chunk-VTPPVAOL.mjs → chunk-EMJIT3ZJ.mjs} +1 -1
- package/dist/{chunk-4TLTV7OB.mjs → chunk-PM7HGDHM.mjs} +2 -2
- package/dist/{chunk-XMATDBXO.mjs → chunk-XO34WBBP.mjs} +2139 -1348
- package/dist/{chunk-EL55VV6Q.mjs → chunk-YGTTEVUM.mjs} +31 -10
- package/dist/{chunk-7ED5UNHL.mjs → chunk-YWTCCOSF.mjs} +117 -0
- package/dist/cli/index.mjs +2690 -1503
- package/dist/cli/init-docs/content/cli-reference.md +29 -1
- package/dist/cli/init-docs/content/getting-started.md +8 -0
- package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +3 -1
- package/dist/cli/init-docs/content/workflow-preview-mode.md +6 -0
- package/dist/cli/init-docs/content/workflow-remote-setup.md +51 -0
- package/dist/client/{accordion-GUNXIIZR.mjs → accordion-QSUEYL4L.mjs} +2 -2
- package/dist/client/{bookingForm-AOU4VHP5.mjs → bookingForm-QYGAHPDP.mjs} +376 -302
- package/dist/client/bookings.mjs +795 -429
- package/dist/client/{carousel-4QSX2JPC.mjs → carousel-SM2LEWAU.mjs} +3 -3
- package/dist/client/{cart-JKN6C4ZB.mjs → cart-3N3SFKNQ.mjs} +7 -7
- package/dist/client/{checkout-YY6YMITW.mjs → checkout-YFAYPKPZ.mjs} +7 -7
- package/dist/client/{chunk-SY543WZ3.mjs → chunk-5DLGREUB.mjs} +1 -1
- package/dist/client/{chunk-A3YN7M3G.mjs → chunk-CLZ7NBSP.mjs} +147 -75
- package/dist/client/{chunk-GWCRCJLB.mjs → chunk-CYJ3MUFP.mjs} +18 -6
- package/dist/client/{chunk-JNE6UI6U.mjs → chunk-H3H3ODO7.mjs} +1 -1
- package/dist/client/{chunk-CPKMJVBD.mjs → chunk-HPEQ4YWW.mjs} +83 -109
- package/dist/client/{chunk-PCHACQEB.mjs → chunk-IIUIKJ4K.mjs} +15 -7
- package/dist/client/{chunk-TNGL2WJF.mjs → chunk-IOAHWAQG.mjs} +18 -0
- package/dist/client/{chunk-6H27K6AA.mjs → chunk-JTKBF3W2.mjs} +10 -4
- package/dist/client/{chunk-OLAOAZEO.mjs → chunk-K7KTSACR.mjs} +1 -1
- package/dist/client/{chunk-BFCJZODD.mjs → chunk-R32M5HFS.mjs} +6 -6
- package/dist/client/{chunk-VJROUYOQ.mjs → chunk-WEVT46PX.mjs} +3 -3
- package/dist/client/{chunk-H7A6PUGM.mjs → chunk-ZU65LTI3.mjs} +1 -1
- package/dist/client/client.mjs +5052 -4083
- package/dist/client/{courseRegistration-UU2KMPSQ.mjs → courseRegistration-LYBE7VVK.mjs} +7 -7
- package/dist/client/{eventCalendar-WIVNS2TM.mjs → eventCalendar-FMTB75X6.mjs} +9 -9
- package/dist/client/{eventCombined-P3G5MW4J.mjs → eventCombined-E4LUCJXT.mjs} +9 -9
- package/dist/client/{eventDetails-2VHJ2RDG.mjs → eventDetails-GELSRR4Z.mjs} +9 -9
- package/dist/client/{eventListing-TGO6JI3R.mjs → eventListing-TB623B6R.mjs} +9 -9
- package/dist/client/{eventRegistration-B46HEJES.mjs → eventRegistration-NRIKHXTI.mjs} +9 -9
- package/dist/client/{form-VKRTFUNQ.mjs → form-Y4U4IAXE.mjs} +3 -3
- package/dist/client/{headerSection-XUX4ZJLO.mjs → headerSection-QSOVV5P7.mjs} +3 -3
- package/dist/client/hooks.mjs +1776 -1355
- package/dist/client/{locationMap-NQFI5MJO.mjs → locationMap-QYCAHH7H.mjs} +3 -3
- package/dist/client/{newsletterForm-P2GETCQK.mjs → newsletterForm-NWHY5TBY.mjs} +3 -3
- package/dist/client/{productDetail-7NQ7O5IF.mjs → productDetail-FYDMU2CE.mjs} +7 -7
- package/dist/client/{productList-RX6ZJ7BL.mjs → productList-D76CGACQ.mjs} +7 -7
- package/dist/client/rendering/client.mjs +2990 -2470
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3236 -2236
- package/dist/client/{shop-BHN5AKY6.mjs → shop-SOUACT5N.mjs} +7 -7
- package/dist/preview-next/before-render.mjs +117 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +117 -0
- package/dist/{sdk-runtime-X2LXQ5IC.mjs → sdk-runtime-XPVE3LBA.mjs} +6 -6
- package/dist/server/components.mjs +3115 -2484
- package/dist/server/config-template-validation.mjs +6 -2
- package/dist/server/config-validation.mjs +1961 -1580
- package/dist/server/config.mjs +1961 -1580
- package/dist/server/data.mjs +1762 -1352
- package/dist/server/index.mjs +266 -33
- package/dist/server/next/middleware.mjs +2 -2
- package/dist/server/next.mjs +3399 -2504
- package/dist/server/page-converter.mjs +1553 -1295
- package/dist/server/prebuild-loader.mjs +42 -23
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3151 -2489
- package/dist/server/rendering.mjs +3363 -2555
- package/dist/server/routing.mjs +1877 -1388
- package/dist/server/server.mjs +2057 -1402
- package/dist/server/theme-bridge.mjs +597 -505
- package/dist/server/theme.mjs +5 -4
- package/dist/styles/index.css +499 -490
- package/package.json +6 -4
- package/dist/SdkPreviewModeRuntime-MJUSYUFB.mjs +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const BINDING_TRANSFORMS: {
|
|
2
|
+
readonly RICHTEXT_FIRST_PARAGRAPH: "richtext.firstParagraph";
|
|
3
|
+
readonly DATE_FORMAT_SHORT: "date.formatShort";
|
|
4
|
+
readonly DATE_FORMAT_LONG: "date.formatLong";
|
|
5
|
+
readonly TEXT_INLINE_TEXT: "text.inlineText";
|
|
6
|
+
};
|
|
7
|
+
export type BindingTransformName = (typeof BINDING_TRANSFORMS)[keyof typeof BINDING_TRANSFORMS];
|
|
8
|
+
export declare const BINDING_TRANSFORM_VALUES: [BindingTransformName, ...BindingTransformName[]];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mock implementation of next/cache for testing
|
|
3
3
|
*/
|
|
4
|
-
import { vi } from '
|
|
4
|
+
import { vi } from 'bun:test';
|
|
5
5
|
export declare const revalidateTag: ReturnType<typeof vi.fn<(tag: string, profile?: string) => void>>;
|
|
6
6
|
export declare const revalidatePath: ReturnType<typeof vi.fn<(path: string) => void>>;
|
|
7
7
|
export declare const unstable_cache: <T extends (...args: never[]) => unknown>(fn: T) => T;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LocalContent } from '../../content/reader';
|
|
2
|
+
import type { ContentDiff } from '../../sync';
|
|
3
|
+
import type { EnvTarget } from '../../helpers';
|
|
4
|
+
export type PublishGuidanceEntry = Readonly<{
|
|
5
|
+
contentType: string;
|
|
6
|
+
identifier: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function collectUpdatedPublishedEntriesForGuidance(input: Readonly<{
|
|
9
|
+
diff: Pick<ContentDiff, 'entries'>;
|
|
10
|
+
local: Pick<LocalContent, 'entries'>;
|
|
11
|
+
}>): readonly PublishGuidanceEntry[];
|
|
12
|
+
export declare function buildPublishAllSuggestion(input: Readonly<{
|
|
13
|
+
entries: readonly PublishGuidanceEntry[];
|
|
14
|
+
target: EnvTarget;
|
|
15
|
+
}>): string;
|
|
@@ -2,6 +2,7 @@ import type { SiteId } from '../../../../../../core/src/index';
|
|
|
2
2
|
import { type FieldChange, type JsonDiffMode } from '../../../sync';
|
|
3
3
|
import { type CliDatedOfferingCommandBatchSource, type CliDatedOfferingCommandCompileInput, type DatedOfferingReportSubject, type DatedOfferingUpsertItem } from '../../../site-commands';
|
|
4
4
|
import type { WriterOptions } from '../../../content/writer';
|
|
5
|
+
import type { ContentMetadataTarget } from '../../../content/metadataStore';
|
|
5
6
|
import type { PushScopeResult, ScopePushContext } from './types';
|
|
6
7
|
import type { LocalMediaPushReport } from '../../../media/local-sync';
|
|
7
8
|
type CommandBackedDatedOfferingScopeConfig<TLocal, TRemote> = Readonly<{
|
|
@@ -13,7 +14,7 @@ type CommandBackedDatedOfferingScopeConfig<TLocal, TRemote> = Readonly<{
|
|
|
13
14
|
getDisplayLabel: (item: TLocal) => string;
|
|
14
15
|
shouldPushItem?: (item: TLocal) => boolean;
|
|
15
16
|
readLocal: (contentDir: string) => Promise<TLocal[]>;
|
|
16
|
-
readMeta: (contentDir: string) => Promise<Record<string, {
|
|
17
|
+
readMeta: (contentDir: string, metadataTarget?: ContentMetadataTarget) => Promise<Record<string, {
|
|
17
18
|
updatedAt?: string;
|
|
18
19
|
}> | null>;
|
|
19
20
|
fetchRemote: () => Promise<TRemote[]>;
|
|
@@ -5,12 +5,14 @@ import type { SiteId } from '../../../../../../core/src/index';
|
|
|
5
5
|
import type { EnvTarget } from '../../../helpers';
|
|
6
6
|
import type { JsonDiffMode } from '../../../sync';
|
|
7
7
|
import type { LocalMediaPushReport } from '../../../media/local-sync';
|
|
8
|
+
import type { ContentMetadataTarget } from '../../../content/metadataStore';
|
|
8
9
|
export type PushMediaPolicy = 'require' | 'allow-missing';
|
|
9
10
|
export interface ScopePushContext {
|
|
10
11
|
output: OutputContext;
|
|
11
12
|
contentDir: string;
|
|
12
13
|
siteId: SiteId;
|
|
13
14
|
targetEnv: EnvTarget;
|
|
15
|
+
metadataTarget: ContentMetadataTarget;
|
|
14
16
|
client: ManagementClient;
|
|
15
17
|
dryRun: boolean;
|
|
16
18
|
force: boolean;
|
|
@@ -60,7 +62,7 @@ export interface PushScopeConfig<TLocal, TRemote> {
|
|
|
60
62
|
/** Read local items from content directory */
|
|
61
63
|
readLocal: (contentDir: string) => Promise<TLocal[]>;
|
|
62
64
|
/** Read local metadata for stale detection */
|
|
63
|
-
readMeta: (contentDir: string) => Promise<Record<string, {
|
|
65
|
+
readMeta: (contentDir: string, metadataTarget?: ContentMetadataTarget) => Promise<Record<string, {
|
|
64
66
|
updatedAt?: string;
|
|
65
67
|
}> | null>;
|
|
66
68
|
/** Fetch remote items */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ContentMetadataTarget } from '../../content/metadataStore';
|
|
1
2
|
import type { OutputContext } from '../../output';
|
|
2
3
|
import type { PulledContent } from '../../../client/management/types';
|
|
3
4
|
import type { StaleItem } from './stale';
|
|
@@ -18,7 +19,7 @@ export declare function resolveStaleOrAbort(opts: {
|
|
|
18
19
|
yes: boolean;
|
|
19
20
|
}): Promise<'resolve' | 'abort'>;
|
|
20
21
|
/**
|
|
21
|
-
* Write only the stale entries/pages/navigation/forms from the already-fetched
|
|
22
|
+
* Write only the stale entries/pages/navigation/forms/settings from the already-fetched
|
|
22
23
|
* remoteContent to disk and update their metadata. Non-stale local content is
|
|
23
24
|
* preserved — we only touch the specific items identified as stale.
|
|
24
25
|
*
|
|
@@ -29,14 +30,19 @@ export declare function resolveStaleOrAbort(opts: {
|
|
|
29
30
|
*/
|
|
30
31
|
export declare function writeStaleItems(contentDir: string, remoteContent: PulledContent, staleItems: StaleItem[], output: OutputContext, options?: {
|
|
31
32
|
skipMeta?: boolean;
|
|
33
|
+
metadataTarget?: ContentMetadataTarget;
|
|
32
34
|
}): Promise<void>;
|
|
33
35
|
/**
|
|
34
36
|
* Update only the theme metadata timestamp without touching the theme content file.
|
|
35
37
|
* Used when the local theme IS the content being pushed — we just need to acknowledge
|
|
36
38
|
* the remote is newer so stale detection passes on the next push.
|
|
37
39
|
*/
|
|
38
|
-
export declare function updateStaleThemeMeta(contentDir: string, themeName: string, remoteUpdatedAt: string
|
|
40
|
+
export declare function updateStaleThemeMeta(contentDir: string, themeName: string, remoteUpdatedAt: string, options?: {
|
|
41
|
+
metadataTarget?: ContentMetadataTarget;
|
|
42
|
+
}): Promise<void>;
|
|
39
43
|
/**
|
|
40
44
|
* Update only the footer metadata timestamp without touching the footer content file.
|
|
41
45
|
*/
|
|
42
|
-
export declare function updateStaleFooterMeta(contentDir: string, remoteUpdatedAt: string
|
|
46
|
+
export declare function updateStaleFooterMeta(contentDir: string, remoteUpdatedAt: string, options?: {
|
|
47
|
+
metadataTarget?: ContentMetadataTarget;
|
|
48
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { PushScope } from './consts';
|
|
2
|
+
export type PushWorkflowStep = Readonly<{
|
|
3
|
+
tag: 'config';
|
|
4
|
+
mode: 'apply';
|
|
5
|
+
}> | Readonly<{
|
|
6
|
+
tag: 'content';
|
|
7
|
+
}>;
|
|
8
|
+
export type PushWorkflowPreContentStep = Extract<PushWorkflowStep, {
|
|
9
|
+
tag: 'config';
|
|
10
|
+
}>;
|
|
11
|
+
export type PushWorkflowPlan = Readonly<{
|
|
12
|
+
steps: readonly PushWorkflowStep[];
|
|
13
|
+
warnings: readonly PushWorkflowWarning[];
|
|
14
|
+
}>;
|
|
15
|
+
export type PushWorkflowWarning = Readonly<{
|
|
16
|
+
tag: 'with_config_ignored_for_scope';
|
|
17
|
+
pushScope: PushScope;
|
|
18
|
+
}>;
|
|
19
|
+
export type PlanPushWorkflowInput = Readonly<{
|
|
20
|
+
pushScope: PushScope;
|
|
21
|
+
withConfig: boolean;
|
|
22
|
+
dryRun: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function planPushWorkflow(input: PlanPushWorkflowInput): PushWorkflowPlan;
|
|
25
|
+
export declare function shouldApplyConfigBeforeContent(plan: PushWorkflowPlan): boolean;
|
|
26
|
+
export declare function preContentWorkflowSteps(plan: PushWorkflowPlan): readonly PushWorkflowPreContentStep[];
|
|
27
|
+
export type PushWorkflowPreContentHandlers = Readonly<{
|
|
28
|
+
[TStep in PushWorkflowPreContentStep as TStep['tag']]: (step: TStep) => Promise<boolean>;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function runPushWorkflowPreContentSteps(plan: PushWorkflowPlan, handlers: PushWorkflowPreContentHandlers): Promise<Readonly<{
|
|
31
|
+
success: true;
|
|
32
|
+
}> | Readonly<{
|
|
33
|
+
success: false;
|
|
34
|
+
}>>;
|
|
@@ -19,9 +19,22 @@
|
|
|
19
19
|
* riverbankcms push --dry-run # Show what would be pushed
|
|
20
20
|
*/
|
|
21
21
|
import { Command } from 'commander';
|
|
22
|
+
import { allEnvSucceeded, getOutputContext, runForEnvironments } from '../helpers';
|
|
23
|
+
import { executePushForEnv } from './push-execute';
|
|
24
|
+
import { emitPushVerificationResult, isPushVerificationClean, verifyPushNoopForEnv } from './push/verification';
|
|
22
25
|
export { contentSummaryHasPushableContent, noContentFoundWarningDetails } from './push-execute';
|
|
23
26
|
export { VALID_PUSH_SCOPES, isValidPushScope, type PushScope } from './push/consts';
|
|
24
27
|
export { calculateMetadataUpdates, type MetadataUpdateFlags } from './push/metadata';
|
|
25
28
|
export { filterLocalContent, type FilterResult } from './push/filter';
|
|
26
29
|
export { checkForStaleContent, type StaleItem } from './push/stale';
|
|
30
|
+
export type PushCommandDeps = Readonly<{
|
|
31
|
+
getOutputContext: typeof getOutputContext;
|
|
32
|
+
runForEnvironments: typeof runForEnvironments;
|
|
33
|
+
allEnvSucceeded: typeof allEnvSucceeded;
|
|
34
|
+
executePushForEnv: typeof executePushForEnv;
|
|
35
|
+
verifyPushNoopForEnv: typeof verifyPushNoopForEnv;
|
|
36
|
+
emitPushVerificationResult: typeof emitPushVerificationResult;
|
|
37
|
+
isPushVerificationClean: typeof isPushVerificationClean;
|
|
38
|
+
}>;
|
|
39
|
+
export declare function createPushCommand(deps?: PushCommandDeps): Command;
|
|
27
40
|
export declare const pushCommand: Command;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Loads riverbank.config.ts and extracts CLI-relevant configuration
|
|
5
5
|
* (contentDir and sync settings) with appropriate defaults.
|
|
6
6
|
*/
|
|
7
|
+
import type { EnvTarget } from './helpers';
|
|
7
8
|
import type { SyncConfig, BlockFieldExtensionsMap, SdkCustomBlock } from '../config/types';
|
|
8
9
|
/**
|
|
9
10
|
* Loaded CLI configuration with defaults applied.
|
|
@@ -36,6 +37,7 @@ export interface LoadedCliConfig {
|
|
|
36
37
|
* ```
|
|
37
38
|
*/
|
|
38
39
|
export declare function loadCliConfig(configPath?: string): Promise<LoadedCliConfig>;
|
|
40
|
+
export declare function loadCliConfigForEnv(target: EnvTarget, configPath?: string): Promise<LoadedCliConfig>;
|
|
39
41
|
/**
|
|
40
42
|
* Check if a CLI config file exists.
|
|
41
43
|
*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SdkEnvironment } from '../env';
|
|
2
|
+
export type ContentMetadataEnv = 'local' | 'remote';
|
|
3
|
+
export type ContentMetadataTarget = Readonly<{
|
|
4
|
+
env: ContentMetadataEnv;
|
|
5
|
+
siteId: string;
|
|
6
|
+
dashboardUrl: string;
|
|
7
|
+
}>;
|
|
8
|
+
export type ContentMetadataReadPath = Readonly<{
|
|
9
|
+
path: string;
|
|
10
|
+
source: 'scoped' | 'legacy';
|
|
11
|
+
}>;
|
|
12
|
+
export declare function metadataTargetFromEnvironment(env: ContentMetadataEnv, environment: Pick<SdkEnvironment, 'siteId' | 'dashboardUrl'>): ContentMetadataTarget;
|
|
13
|
+
export declare function legacyMetadataDir(contentDir: string): string;
|
|
14
|
+
export declare function scopedMetadataDir(contentDir: string, target: ContentMetadataTarget): string;
|
|
15
|
+
export declare function metadataFilePath(contentDir: string, fileName: string, target?: ContentMetadataTarget): string;
|
|
16
|
+
export declare function legacyMetadataFilePath(contentDir: string, fileName: string): string;
|
|
17
|
+
export declare function ensureMetadataDir(contentDir: string, target?: ContentMetadataTarget): Promise<string>;
|
|
18
|
+
export declare function writeMetadataFile(contentDir: string, fileName: string, value: unknown, target?: ContentMetadataTarget): Promise<string>;
|
|
19
|
+
export declare function readMetadataFile<T>(contentDir: string, fileName: string, target?: ContentMetadataTarget): Promise<T | null>;
|
|
20
|
+
export declare function listMetadataFiles(contentDir: string, target?: ContentMetadataTarget): Promise<string[]>;
|
|
21
|
+
export declare function writeMetadataRecordMap<TRecord>(contentDir: string, fileName: string, recordKey: string, next: Readonly<{
|
|
22
|
+
pulledAt: string;
|
|
23
|
+
records: Readonly<Record<string, TRecord>>;
|
|
24
|
+
extra?: Readonly<Record<string, unknown>>;
|
|
25
|
+
}>, options?: Readonly<{
|
|
26
|
+
mode?: 'replace' | 'merge';
|
|
27
|
+
target?: ContentMetadataTarget;
|
|
28
|
+
}>): Promise<string>;
|
|
29
|
+
export declare function resolveMetadataReadPath(contentDir: string, fileName: string, target?: ContentMetadataTarget): Promise<ContentMetadataReadPath | null>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Reads content from the file system for push operations.
|
|
5
5
|
* Mirrors the structure created by writer.ts.
|
|
6
6
|
*/
|
|
7
|
+
import { type ContentMetadataTarget } from './metadataStore';
|
|
7
8
|
import type { NavigationAuthoringLinkInput, NavigationLocalItemInput } from '../../../../api/src/navigation';
|
|
8
9
|
import type { SdkEventPricingInput } from '../../../../api/src/sdk-event-pricing';
|
|
9
10
|
import type { EventPaymentTermsInput } from '../../client/management/types';
|
|
@@ -233,7 +234,7 @@ export declare function findLegacyEntryFiles(contentDir: string): Promise<string
|
|
|
233
234
|
* @param contentType - Optional specific content type to read
|
|
234
235
|
* @returns Map of content type to entries
|
|
235
236
|
*/
|
|
236
|
-
export declare function readEntries(contentDir: string, contentType?: string): Promise<Map<string, LocalEntry[]>>;
|
|
237
|
+
export declare function readEntries(contentDir: string, contentType?: string, metadataTarget?: ContentMetadataTarget): Promise<Map<string, LocalEntry[]>>;
|
|
237
238
|
/**
|
|
238
239
|
* Read pages from content directory
|
|
239
240
|
*
|
|
@@ -350,7 +351,7 @@ export interface LocalContent {
|
|
|
350
351
|
events: LocalEvent[];
|
|
351
352
|
courses: LocalCourse[];
|
|
352
353
|
}
|
|
353
|
-
export declare function readAllContent(contentDir: string): Promise<LocalContent>;
|
|
354
|
+
export declare function readAllContent(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<LocalContent>;
|
|
354
355
|
/**
|
|
355
356
|
* Check if content directory exists and has content
|
|
356
357
|
*/
|
|
@@ -387,6 +388,7 @@ export interface EntryMetadata {
|
|
|
387
388
|
createdAt?: string;
|
|
388
389
|
updatedAt?: string;
|
|
389
390
|
publishedAt?: string;
|
|
391
|
+
hasUnpublishedChanges?: boolean;
|
|
390
392
|
}>;
|
|
391
393
|
}
|
|
392
394
|
export interface PagesMetadata {
|
|
@@ -414,35 +416,35 @@ export interface SettingsMetadata {
|
|
|
414
416
|
* @param contentType - Content type to read metadata for
|
|
415
417
|
* @returns Metadata or null if not found
|
|
416
418
|
*/
|
|
417
|
-
export declare function readEntriesMeta(contentDir: string, contentType: string): Promise<EntryMetadata | null>;
|
|
419
|
+
export declare function readEntriesMeta(contentDir: string, contentType: string, metadataTarget?: ContentMetadataTarget): Promise<EntryMetadata | null>;
|
|
418
420
|
/**
|
|
419
421
|
* Read all entry metadata files from .meta/ directory
|
|
420
422
|
*
|
|
421
423
|
* @param contentDir - Base content directory
|
|
422
424
|
* @returns Map of content type to metadata
|
|
423
425
|
*/
|
|
424
|
-
export declare function readAllMeta(contentDir: string): Promise<Map<string, EntryMetadata>>;
|
|
426
|
+
export declare function readAllMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<Map<string, EntryMetadata>>;
|
|
425
427
|
/**
|
|
426
428
|
* Read settings metadata from .meta/settings.json
|
|
427
429
|
*
|
|
428
430
|
* @param contentDir - Base content directory
|
|
429
431
|
* @returns Settings metadata or null if not found
|
|
430
432
|
*/
|
|
431
|
-
export declare function readSettingsMeta(contentDir: string): Promise<SettingsMetadata | null>;
|
|
433
|
+
export declare function readSettingsMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<SettingsMetadata | null>;
|
|
432
434
|
/**
|
|
433
435
|
* Read pages metadata from .meta/pages.json
|
|
434
436
|
*
|
|
435
437
|
* @param contentDir - Base content directory
|
|
436
438
|
* @returns Pages metadata or null if not found
|
|
437
439
|
*/
|
|
438
|
-
export declare function readPagesMeta(contentDir: string): Promise<PagesMetadata | null>;
|
|
440
|
+
export declare function readPagesMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<PagesMetadata | null>;
|
|
439
441
|
/**
|
|
440
442
|
* Read navigation metadata from .meta/navigation.json
|
|
441
443
|
*
|
|
442
444
|
* @param contentDir - Base content directory
|
|
443
445
|
* @returns Navigation metadata or null if not found
|
|
444
446
|
*/
|
|
445
|
-
export declare function readNavigationMeta(contentDir: string): Promise<NavigationMetadata | null>;
|
|
447
|
+
export declare function readNavigationMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<NavigationMetadata | null>;
|
|
446
448
|
export interface FormsMetadata {
|
|
447
449
|
pulledAt: string;
|
|
448
450
|
forms: Record<string, {
|
|
@@ -456,7 +458,7 @@ export interface FormsMetadata {
|
|
|
456
458
|
* @param contentDir - Base content directory
|
|
457
459
|
* @returns Forms metadata or null if not found
|
|
458
460
|
*/
|
|
459
|
-
export declare function readFormsMeta(contentDir: string): Promise<FormsMetadata | null>;
|
|
461
|
+
export declare function readFormsMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<FormsMetadata | null>;
|
|
460
462
|
export interface ThemesMetadata {
|
|
461
463
|
pulledAt: string;
|
|
462
464
|
themes: Record<string, {
|
|
@@ -471,7 +473,7 @@ export interface ThemesMetadata {
|
|
|
471
473
|
* @param contentDir - Base content directory
|
|
472
474
|
* @returns Themes metadata or null if not found
|
|
473
475
|
*/
|
|
474
|
-
export declare function readThemesMeta(contentDir: string): Promise<ThemesMetadata | null>;
|
|
476
|
+
export declare function readThemesMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<ThemesMetadata | null>;
|
|
475
477
|
export interface VenuesMetadata {
|
|
476
478
|
pulledAt: string;
|
|
477
479
|
venues: Record<string, {
|
|
@@ -485,7 +487,7 @@ export interface VenuesMetadata {
|
|
|
485
487
|
* @param contentDir - Base content directory
|
|
486
488
|
* @returns Venues metadata or null if not found
|
|
487
489
|
*/
|
|
488
|
-
export declare function readVenuesMeta(contentDir: string): Promise<VenuesMetadata | null>;
|
|
490
|
+
export declare function readVenuesMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<VenuesMetadata | null>;
|
|
489
491
|
export interface EventCategoriesMetadata {
|
|
490
492
|
pulledAt: string;
|
|
491
493
|
eventCategories: Record<string, {
|
|
@@ -499,7 +501,7 @@ export interface EventCategoriesMetadata {
|
|
|
499
501
|
* @param contentDir - Base content directory
|
|
500
502
|
* @returns Event categories metadata or null if not found
|
|
501
503
|
*/
|
|
502
|
-
export declare function readEventCategoriesMeta(contentDir: string): Promise<EventCategoriesMetadata | null>;
|
|
504
|
+
export declare function readEventCategoriesMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<EventCategoriesMetadata | null>;
|
|
503
505
|
export interface EventsMetadata {
|
|
504
506
|
pulledAt: string;
|
|
505
507
|
events: Record<string, {
|
|
@@ -520,14 +522,14 @@ export interface CoursesMetadata {
|
|
|
520
522
|
* @param contentDir - Base content directory
|
|
521
523
|
* @returns Events metadata or null if not found
|
|
522
524
|
*/
|
|
523
|
-
export declare function readEventsMeta(contentDir: string): Promise<EventsMetadata | null>;
|
|
525
|
+
export declare function readEventsMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<EventsMetadata | null>;
|
|
524
526
|
/**
|
|
525
527
|
* Read courses metadata from .meta/courses.json
|
|
526
528
|
*
|
|
527
529
|
* @param contentDir - Base content directory
|
|
528
530
|
* @returns Courses metadata or null if not found
|
|
529
531
|
*/
|
|
530
|
-
export declare function readCoursesMeta(contentDir: string): Promise<CoursesMetadata | null>;
|
|
532
|
+
export declare function readCoursesMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<CoursesMetadata | null>;
|
|
531
533
|
export interface FooterMetadata {
|
|
532
534
|
pulledAt: string;
|
|
533
535
|
updatedAt?: string;
|
|
@@ -538,4 +540,4 @@ export interface FooterMetadata {
|
|
|
538
540
|
* @param contentDir - Base content directory
|
|
539
541
|
* @returns Footer metadata or null if not found
|
|
540
542
|
*/
|
|
541
|
-
export declare function readFooterMeta(contentDir: string): Promise<FooterMetadata | null>;
|
|
543
|
+
export declare function readFooterMeta(contentDir: string, metadataTarget?: ContentMetadataTarget): Promise<FooterMetadata | null>;
|
|
@@ -5,17 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { PulledEntries, PulledPages, PulledNavigation, PulledSettings, PulledForms, PulledTheme, PulledFooter, PulledVenues, PulledEventCategories, PulledEvents, PulledCourses } from '../../client/management/types';
|
|
7
7
|
import type { Theme } from '../../contracts';
|
|
8
|
-
import { type
|
|
8
|
+
import { type EntryForOutput } from '../helpers';
|
|
9
9
|
import type { EntryBaseSnapshotTarget } from '../merge-remote/entrySnapshots';
|
|
10
10
|
import type { PageBaseSnapshotTarget } from '../merge-remote/pageSnapshots';
|
|
11
|
+
import { type ContentMetadataTarget } from './metadataStore';
|
|
11
12
|
export interface WriterOptions {
|
|
12
13
|
skipMeta?: boolean;
|
|
13
14
|
cleanupMissing?: boolean;
|
|
15
|
+
metadataTarget?: ContentMetadataTarget;
|
|
14
16
|
entryBaseSnapshot?: EntryBaseSnapshotTarget;
|
|
15
17
|
pageBaseSnapshot?: PageBaseSnapshotTarget;
|
|
16
18
|
}
|
|
17
19
|
type WritablePulledEntries = Omit<PulledEntries, 'entries'> & {
|
|
18
|
-
entries:
|
|
20
|
+
entries: EntryForOutput[];
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
23
|
* Write entries to content directory
|
|
@@ -92,7 +94,7 @@ export declare function writeThemesMeta(contentDir: string, meta: {
|
|
|
92
94
|
selectionId: string;
|
|
93
95
|
updatedAt: string;
|
|
94
96
|
}>;
|
|
95
|
-
}): Promise<void>;
|
|
97
|
+
}, options?: Pick<WriterOptions, 'metadataTarget'>): Promise<void>;
|
|
96
98
|
/**
|
|
97
99
|
* Write a pulled theme to content directory with metadata
|
|
98
100
|
*
|
|
@@ -207,7 +209,7 @@ export declare function updateMetadataAfterPush(contentDir: string, remoteConten
|
|
|
207
209
|
updatedAt: string;
|
|
208
210
|
createdAt?: string;
|
|
209
211
|
}>;
|
|
210
|
-
}): Promise<void>;
|
|
212
|
+
}, options?: Pick<WriterOptions, 'metadataTarget'>): Promise<void>;
|
|
211
213
|
export declare function writeAllContent(contentDir: string, content: {
|
|
212
214
|
entries: Record<string, PulledEntries['entries']>;
|
|
213
215
|
pages: PulledPages;
|
|
@@ -85,17 +85,16 @@ export interface ParsedPagination {
|
|
|
85
85
|
*/
|
|
86
86
|
export type RowFormatter<T> = (item: T) => string[];
|
|
87
87
|
/**
|
|
88
|
-
* Entry format
|
|
89
|
-
*
|
|
88
|
+
* Entry format written to content/entries/*.json.
|
|
89
|
+
* Operational fields such as manual ordering and unpublished state live in
|
|
90
|
+
* metadata so entry files remain authoring-focused.
|
|
90
91
|
*/
|
|
91
|
-
export interface
|
|
92
|
+
export interface EntryContentFileOutput {
|
|
92
93
|
identifier: string;
|
|
93
94
|
data: Record<string, unknown>;
|
|
94
95
|
status: 'draft' | 'published';
|
|
95
|
-
hasUnpublishedChanges: boolean;
|
|
96
96
|
/** Slug for URL routing - only present for routable content types */
|
|
97
97
|
slug?: string;
|
|
98
|
-
manualOrder?: number;
|
|
99
98
|
blocks?: Record<string, Array<{
|
|
100
99
|
identifier: string | null;
|
|
101
100
|
kind: string;
|
|
@@ -114,9 +113,9 @@ export interface EntryForOutput {
|
|
|
114
113
|
slug?: string;
|
|
115
114
|
title?: string;
|
|
116
115
|
manualOrder?: number;
|
|
117
|
-
blocks?:
|
|
116
|
+
blocks?: EntryContentFileOutput['blocks'];
|
|
118
117
|
}
|
|
119
|
-
export declare function mapEntryForOutput<T extends EntryForOutput>(entry: T):
|
|
118
|
+
export declare function mapEntryForOutput<T extends EntryForOutput>(entry: T): EntryContentFileOutput;
|
|
120
119
|
/**
|
|
121
120
|
* Parse pagination options from command flags.
|
|
122
121
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SiteId } from '../../../../core/src/index';
|
|
2
2
|
import type { ManagementClient } from '../../client/management/types';
|
|
3
|
+
import type { ContentMetadataTarget } from '../content/metadataStore';
|
|
3
4
|
import type { LocalEntry } from '../content/reader';
|
|
4
5
|
import type { EnvTarget } from '../helpers';
|
|
5
6
|
import type { OutputContext } from '../output';
|
|
@@ -12,6 +13,7 @@ export declare function planAndReportRemoteEntryMerge(input: Readonly<{
|
|
|
12
13
|
contentDir: string;
|
|
13
14
|
target: EnvTarget;
|
|
14
15
|
siteId: SiteId;
|
|
16
|
+
metadataTarget: ContentMetadataTarget;
|
|
15
17
|
contentType?: string;
|
|
16
18
|
identifier?: string;
|
|
17
19
|
localEntries: ReadonlyMap<string, readonly LocalEntry[]>;
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
import type { OutputContext } from '../output';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EntryMergeDecision } from './entryMerge';
|
|
3
3
|
import type { RemoteEntryMergePlan } from './entryMergePlan';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
scope: 'entries';
|
|
7
|
-
mergeRemote: true;
|
|
8
|
-
dryRun: boolean;
|
|
9
|
-
summary: RemoteEntryMergePlan['summary'];
|
|
10
|
-
decisions: readonly RemoteEntryMergeDecisionReport[];
|
|
11
|
-
}>;
|
|
12
|
-
export type RemoteEntryMergeDecisionReport = Readonly<{
|
|
13
|
-
kind: EntryMergeDecision['kind'];
|
|
4
|
+
import { type RemoteMergeDecisionReport, type RemoteMergeJsonReport } from './sharedMergeReport';
|
|
5
|
+
type RemoteEntryMergeSubjectJson = Readonly<{
|
|
14
6
|
contentType: string;
|
|
15
7
|
identifier: string;
|
|
16
|
-
localFieldPaths?: readonly string[];
|
|
17
|
-
remoteFieldPaths?: readonly string[];
|
|
18
|
-
conflict?: Readonly<{
|
|
19
|
-
code: EntryMergeConflict['code'];
|
|
20
|
-
fieldPath?: string;
|
|
21
|
-
message: string;
|
|
22
|
-
}>;
|
|
23
8
|
}>;
|
|
9
|
+
export type RemoteEntryMergeDecisionReport = RemoteMergeDecisionReport<EntryMergeDecision, RemoteEntryMergeSubjectJson>;
|
|
10
|
+
export type RemoteEntryMergeJsonReport = RemoteMergeJsonReport<'entries', RemoteEntryMergePlan['summary'], EntryMergeDecision, RemoteEntryMergeSubjectJson>;
|
|
24
11
|
export declare function remoteEntryMergeJsonReport(input: Readonly<{
|
|
25
12
|
plan: RemoteEntryMergePlan;
|
|
26
13
|
dryRun: boolean;
|
|
@@ -28,3 +15,4 @@ export declare function remoteEntryMergeJsonReport(input: Readonly<{
|
|
|
28
15
|
export declare function writeRemoteEntryMergeHumanReport(output: Pick<OutputContext, 'info'>, plan: RemoteEntryMergePlan, options: Readonly<{
|
|
29
16
|
dryRun: boolean;
|
|
30
17
|
}>): void;
|
|
18
|
+
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { PulledEntries } from '../../client/management/types';
|
|
2
2
|
import type { EntryForOutput, EnvTarget } from '../helpers';
|
|
3
3
|
import type { LocalEntry } from '../content/reader';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
siteId: string;
|
|
7
|
-
}>;
|
|
4
|
+
import { type BaseSnapshotTarget } from './sharedBaseSnapshots';
|
|
5
|
+
export type EntryBaseSnapshotTarget = BaseSnapshotTarget;
|
|
8
6
|
export type EntryBaseSnapshotSubject = Readonly<{
|
|
9
7
|
contentType: string;
|
|
10
8
|
identifier: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SiteId } from '../../../../core/src/index';
|
|
2
2
|
import type { ManagementClient } from '../../client/management/types';
|
|
3
|
+
import type { ContentMetadataTarget } from '../content/metadataStore';
|
|
3
4
|
import type { LocalPage } from '../content/reader';
|
|
4
5
|
import type { EnvTarget } from '../helpers';
|
|
5
6
|
import type { OutputContext } from '../output';
|
|
@@ -12,6 +13,7 @@ export declare function planAndReportRemotePageMerge(input: Readonly<{
|
|
|
12
13
|
contentDir: string;
|
|
13
14
|
target: EnvTarget;
|
|
14
15
|
siteId: SiteId;
|
|
16
|
+
metadataTarget: ContentMetadataTarget;
|
|
15
17
|
identifier?: string;
|
|
16
18
|
localPages: readonly LocalPage[];
|
|
17
19
|
dryRun: boolean;
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
import type { OutputContext } from '../output';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PageMergeDecision } from './pageMerge';
|
|
3
3
|
import type { RemotePageMergePlan } from './pageMergePlan';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
scope: 'pages';
|
|
7
|
-
mergeRemote: true;
|
|
8
|
-
dryRun: boolean;
|
|
9
|
-
summary: RemotePageMergePlan['summary'];
|
|
10
|
-
decisions: readonly RemotePageMergeDecisionReport[];
|
|
11
|
-
}>;
|
|
12
|
-
export type RemotePageMergeDecisionReport = Readonly<{
|
|
13
|
-
kind: PageMergeDecision['kind'];
|
|
4
|
+
import { type RemoteMergeDecisionReport, type RemoteMergeJsonReport } from './sharedMergeReport';
|
|
5
|
+
type RemotePageMergeSubjectJson = Readonly<{
|
|
14
6
|
identifier: string;
|
|
15
|
-
localFieldPaths?: readonly string[];
|
|
16
|
-
remoteFieldPaths?: readonly string[];
|
|
17
|
-
conflict?: Readonly<{
|
|
18
|
-
code: PageMergeConflict['code'];
|
|
19
|
-
fieldPath?: string;
|
|
20
|
-
message: string;
|
|
21
|
-
}>;
|
|
22
7
|
}>;
|
|
8
|
+
export type RemotePageMergeDecisionReport = RemoteMergeDecisionReport<PageMergeDecision, RemotePageMergeSubjectJson>;
|
|
9
|
+
export type RemotePageMergeJsonReport = RemoteMergeJsonReport<'pages', RemotePageMergePlan['summary'], PageMergeDecision, RemotePageMergeSubjectJson>;
|
|
23
10
|
export declare function remotePageMergeJsonReport(input: Readonly<{
|
|
24
11
|
plan: RemotePageMergePlan;
|
|
25
12
|
dryRun: boolean;
|
|
@@ -27,3 +14,4 @@ export declare function remotePageMergeJsonReport(input: Readonly<{
|
|
|
27
14
|
export declare function writeRemotePageMergeHumanReport(output: Pick<OutputContext, 'info'>, plan: RemotePageMergePlan, options: Readonly<{
|
|
28
15
|
dryRun: boolean;
|
|
29
16
|
}>): void;
|
|
17
|
+
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { PulledPages } from '../../client/management/types';
|
|
2
2
|
import type { EnvTarget } from '../helpers';
|
|
3
3
|
import type { LocalPage } from '../content/reader';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
siteId: string;
|
|
7
|
-
}>;
|
|
4
|
+
import { type BaseSnapshotTarget } from './sharedBaseSnapshots';
|
|
5
|
+
export type PageBaseSnapshotTarget = BaseSnapshotTarget;
|
|
8
6
|
export type PageBaseSnapshotSubject = Readonly<{
|
|
9
7
|
identifier: string;
|
|
10
8
|
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { EnvTarget } from '../helpers';
|
|
2
|
+
export type BaseSnapshotTarget = Readonly<{
|
|
3
|
+
env: EnvTarget;
|
|
4
|
+
siteId: string;
|
|
5
|
+
}>;
|
|
6
|
+
export type BaseSnapshotStoredTarget = Readonly<{
|
|
7
|
+
env: EnvTarget;
|
|
8
|
+
siteIdHash: string;
|
|
9
|
+
}>;
|
|
10
|
+
export type WriteBaseSnapshotsInput<TItem, TSnapshot> = Readonly<{
|
|
11
|
+
contentDir: string;
|
|
12
|
+
rootDir: string;
|
|
13
|
+
snapshotDir: string;
|
|
14
|
+
items: readonly TItem[];
|
|
15
|
+
toSnapshot(item: TItem): TSnapshot;
|
|
16
|
+
fileNameForSnapshot(snapshot: TSnapshot): string;
|
|
17
|
+
cleanupMissing?: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export type WriteBaseSnapshotsResult = Readonly<{
|
|
20
|
+
rootDir: string;
|
|
21
|
+
count: number;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function baseSnapshotRoot(contentDir: string, baseKind: string): string;
|
|
24
|
+
export declare function baseSnapshotStoredTarget(target: BaseSnapshotTarget): BaseSnapshotStoredTarget;
|
|
25
|
+
export declare function siteScopedSnapshotDir(input: Readonly<{
|
|
26
|
+
rootDir: string;
|
|
27
|
+
target: BaseSnapshotTarget;
|
|
28
|
+
leafDir: string;
|
|
29
|
+
}>): string;
|
|
30
|
+
export declare function writeBaseSnapshots<TItem, TSnapshot>(input: WriteBaseSnapshotsInput<TItem, TSnapshot>): Promise<WriteBaseSnapshotsResult>;
|
|
31
|
+
export declare function readBaseSnapshot<TSnapshot>(snapshotPath: string): Promise<TSnapshot | null>;
|
|
32
|
+
export declare function encodeSnapshotPathPart(value: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type RemoteMergePlanCore<TDecision, TSummary> = Readonly<{
|
|
2
|
+
decisions: readonly TDecision[];
|
|
3
|
+
summary: TSummary;
|
|
4
|
+
}>;
|
|
5
|
+
export type RemoteMergePlanConfig<TSubject, TBaseSnapshot, TValue, TDecision, TSummary> = Readonly<{
|
|
6
|
+
subjects(): readonly TSubject[];
|
|
7
|
+
readBaseSnapshot(subject: TSubject): Promise<TBaseSnapshot | null>;
|
|
8
|
+
valueFromBaseSnapshot(snapshot: TBaseSnapshot): TValue | null;
|
|
9
|
+
localValue(subject: TSubject): TValue | null;
|
|
10
|
+
remoteValue(subject: TSubject): TValue | null;
|
|
11
|
+
planDecision(input: Readonly<{
|
|
12
|
+
subject: TSubject;
|
|
13
|
+
base: TValue | null;
|
|
14
|
+
local: TValue | null;
|
|
15
|
+
remote: TValue | null;
|
|
16
|
+
}>): TDecision;
|
|
17
|
+
summarize(decisions: readonly TDecision[]): TSummary;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function buildRemoteMergePlanWithConfig<TSubject, TBaseSnapshot, TValue, TDecision, TSummary>(config: RemoteMergePlanConfig<TSubject, TBaseSnapshot, TValue, TDecision, TSummary>): Promise<RemoteMergePlanCore<TDecision, TSummary>>;
|
|
20
|
+
export type DecisionSummaryKeyMap<TDecisionKind extends string, TSummary> = Readonly<Record<TDecisionKind, NumericKeys<TSummary>>>;
|
|
21
|
+
type NumericKeys<TValue> = {
|
|
22
|
+
[TKey in keyof TValue]: TValue[TKey] extends number ? TKey : never;
|
|
23
|
+
}[keyof TValue];
|
|
24
|
+
export declare function summarizeMergeDecisions<TDecisionKind extends string, TDecision extends {
|
|
25
|
+
kind: TDecisionKind;
|
|
26
|
+
}, TSummary>(decisions: readonly TDecision[], initialSummary: TSummary, summaryKeyByDecisionKind: DecisionSummaryKeyMap<TDecisionKind, TSummary>): TSummary;
|
|
27
|
+
export {};
|