@riverbankcms/sdk 0.95.0 → 0.98.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 +47 -5
- package/dist/{PreviewEditorSidebar-6FQYKOSB.mjs → PreviewEditorSidebar-CG3SSJND.mjs} +3 -3
- package/dist/{PreviewEditorUI-NPO2XMFB.mjs → PreviewEditorUI-RHNGKAAU.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-OV5PNJBB.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +10 -10
- 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/contentRuntime.d.ts +109 -40
- package/dist/_dts/api/src/endpoints.d.ts +80 -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/siteRuntimeEndpoints.d.ts +7 -1
- package/dist/_dts/block-form/src/client/index.d.ts +1 -1
- package/dist/_dts/block-form/src/fields/types.d.ts +9 -1
- package/dist/_dts/block-form/src/registry/schemas.d.ts +4 -0
- package/dist/_dts/block-form/src/registry/widgets.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/InlineTextField.d.ts +4 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/index.d.ts +3 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/inlineTextFieldDefaults.d.ts +2 -0
- package/dist/_dts/block-form/src/widgets/InlineTextField/inlineTextFieldSchema.d.ts +3 -0
- package/dist/_dts/blocks/src/PageRenderer.d.ts +2 -1
- package/dist/_dts/blocks/src/bindings/index.d.ts +1 -0
- package/dist/_dts/blocks/src/bindings/types.d.ts +1 -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/index.d.ts +2 -0
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -0
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +2 -29631
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +2 -29614
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +2 -29634
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +2 -29627
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +2 -29585
- 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/faq.d.ts +2 -29677
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +2 -29655
- package/dist/_dts/blocks/src/system/blocks/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +220 -0
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +2 -29655
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +2 -29685
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -29761
- 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/fragments/library/heroCopy.d.ts +9 -0
- package/dist/_dts/blocks/src/system/inlineText.d.ts +78 -0
- package/dist/_dts/blocks/src/system/manifest/derivedContent.d.ts +3 -1
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +15 -3
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +188 -7
- 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/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/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/basic.d.ts +2 -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/renderInlineText.d.ts +3 -0
- 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/useWaitlistClaim.d.ts +5 -0
- package/dist/_dts/blocks/src/utils/date-formatting.d.ts +1 -1
- package/dist/_dts/content-editor/src/index.d.ts +1 -0
- package/dist/_dts/content-editor/src/primitives/PreviewInlineTextEditor.d.ts +9 -0
- package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +1 -1
- package/dist/_dts/content-model/src/templates/bindingTypeCompatibility.d.ts +1 -1
- package/dist/_dts/content-model/src/templates/defaults.d.ts +30 -0
- package/dist/_dts/content-model/src/templates/types.d.ts +3 -6
- package/dist/_dts/core/src/branded.d.ts +8 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +505 -2
- package/dist/_dts/editor/src/inline/FloatingToolbar.d.ts +18 -0
- package/dist/_dts/editor/src/inline/InlineTextEditor.d.ts +18 -1
- package/dist/_dts/editor/src/inline/InlineTextEditorStyles.d.ts +1 -0
- package/dist/_dts/editor/src/inline/domParse.d.ts +3 -0
- package/dist/_dts/editor/src/inline/presentation.d.ts +48 -0
- package/dist/_dts/editor/src/inline/selection.d.ts +12 -0
- package/dist/_dts/editor-blocks/src/widgets/index.d.ts +1 -0
- package/dist/_dts/editor-blocks/src/widgets/inline-text/InlineTextField.d.ts +3 -0
- package/dist/_dts/editor-blocks/src/widgets/inline-text/index.d.ts +1 -0
- package/dist/_dts/field-primitives/src/bindings/index.d.ts +8 -0
- package/dist/_dts/path-utils/src/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/widgets/widgetOverrides.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/content.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +4 -0
- 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 +4 -7
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +5 -1
- package/dist/_dts/sdk/src/cli/commands/push/stale-resolution.d.ts +9 -3
- package/dist/_dts/sdk/src/cli/commands/push/verification.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/commands/push/workflowPlan.d.ts +34 -0
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +2 -1
- 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/edit/format.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/content/edit/path.d.ts +14 -0
- package/dist/_dts/sdk/src/cli/content/edit/planner.d.ts +46 -0
- package/dist/_dts/sdk/src/cli/content/fs-utils.d.ts +4 -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 +8 -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/mergeFieldChanges.d.ts +22 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageLocal.d.ts +3 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMerge.d.ts +78 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePlan.d.ts +36 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePush.d.ts +23 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergeReport.d.ts +29 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageSnapshots.d.ts +48 -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/cli/sync/diff.d.ts +3 -6
- package/dist/_dts/sdk/src/cli/sync/field-diff.d.ts +39 -0
- package/dist/_dts/sdk/src/cli/sync/index.d.ts +1 -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/field-definitions.d.ts +8 -3
- package/dist/_dts/sdk/src/config/typed-entries.d.ts +5 -3
- 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 +4 -7
- package/dist/_dts/sdk/src/contracts/content.d.ts +18 -0
- package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +16 -2
- package/dist/_dts/sdk/src/next/route-outcome-proxy.d.ts +3 -3
- 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/helpers/bindings.d.ts +4 -3
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +52 -1
- package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +18 -66
- 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/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/cards/types.d.ts +15 -15
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/inputs/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +42 -42
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/schema.d.ts +44 -44
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +16 -16
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +1 -1
- package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +1 -1
- package/dist/{chunk-4A6NWO3X.mjs → chunk-6WDBXCPX.mjs} +73 -12
- package/dist/{chunk-VZBSD4AJ.mjs → chunk-DBRI3PQF.mjs} +2281 -322
- package/dist/{chunk-PJPFTVZG.mjs → chunk-H24OU7WG.mjs} +106 -4
- package/dist/{chunk-K2SJTZMX.mjs → chunk-PKDPQHB5.mjs} +2 -2
- package/dist/{chunk-VTPPVAOL.mjs → chunk-QPXE2OUZ.mjs} +1 -1
- package/dist/{chunk-7ED5UNHL.mjs → chunk-V2BYFSPW.mjs} +109 -0
- package/dist/cli/index.mjs +4182 -1165
- package/dist/cli/init-docs/content/cli-reference.md +72 -5
- package/dist/cli/init-docs/content/content-management.md +22 -0
- 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-LGO4IO5U.mjs → accordion-Q2BDNL53.mjs} +1 -1
- package/dist/client/{bookingForm-MWLS4LGU.mjs → bookingForm-ZMP4P7EK.mjs} +16 -6
- package/dist/client/bookings.mjs +98 -18
- package/dist/client/{carousel-6AHNP5HA.mjs → carousel-LW3UXPWO.mjs} +1 -1
- package/dist/client/{cart-CIXGYAZB.mjs → cart-Z6D3KS6K.mjs} +5 -5
- package/dist/client/{checkout-OTX6O3DN.mjs → checkout-YMT2QJQM.mjs} +5 -5
- package/dist/client/{chunk-Y2PMKCXO.mjs → chunk-26ZBRXFR.mjs} +9 -3
- package/dist/client/{chunk-MYCXAKWP.mjs → chunk-DRRQ7QSL.mjs} +2 -2
- package/dist/client/{chunk-TREIML53.mjs → chunk-ET2MDQQT.mjs} +4 -4
- package/dist/client/{chunk-AVBQSUIS.mjs → chunk-HBQEAOG4.mjs} +1 -1
- package/dist/client/{chunk-INRIT6DP.mjs → chunk-IEOECM7U.mjs} +62 -43
- package/dist/client/{chunk-TNGL2WJF.mjs → chunk-KDP7ZRZV.mjs} +16 -0
- package/dist/client/{chunk-V67AT7ZW.mjs → chunk-R4XK3CKR.mjs} +18 -1
- package/dist/client/{chunk-R3NQTBWE.mjs → chunk-SK2BMD22.mjs} +2 -2
- package/dist/client/{chunk-HOP7MKAZ.mjs → chunk-XNTHVZ25.mjs} +1 -1
- package/dist/client/client.mjs +5172 -4177
- package/dist/client/{courseRegistration-2LU6C3JL.mjs → courseRegistration-DGKCMC77.mjs} +4 -4
- package/dist/client/{eventCalendar-OKUSISBZ.mjs → eventCalendar-74Z2NNFM.mjs} +7 -7
- package/dist/client/{eventCombined-CMF6CD4S.mjs → eventCombined-GK2ODOX2.mjs} +7 -7
- package/dist/client/{eventDetails-XYWH7WXI.mjs → eventDetails-MONAGT3N.mjs} +7 -7
- package/dist/client/{eventListing-EK5DJTAH.mjs → eventListing-SKGAO6PS.mjs} +7 -7
- package/dist/client/{eventRegistration-XDOSICV6.mjs → eventRegistration-6KISGXRD.mjs} +7 -7
- package/dist/client/{form-J6GOHKYG.mjs → form-FXPRTXHI.mjs} +2 -2
- package/dist/client/{headerSection-C5SYJTRW.mjs → headerSection-7NAN5WNB.mjs} +2 -2
- package/dist/client/hooks.mjs +1681 -1337
- package/dist/client/{locationMap-QSQIFVVT.mjs → locationMap-UERN74U4.mjs} +2 -2
- package/dist/client/{newsletterForm-47VXJRWK.mjs → newsletterForm-SGWXMJ7U.mjs} +2 -2
- package/dist/client/{productDetail-5U6ISCC2.mjs → productDetail-HN3HWZQZ.mjs} +5 -5
- package/dist/client/{productList-XDZUMR3P.mjs → productList-YT22Z5UR.mjs} +5 -5
- package/dist/client/rendering/client.mjs +4796 -4288
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +2120 -1106
- package/dist/client/{shop-ZSZKIY3R.mjs → shop-TKEDNWUS.mjs} +5 -5
- package/dist/preview-next/before-render.mjs +109 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +109 -0
- package/dist/{sdk-runtime-PHNM7MRD.mjs → sdk-runtime-LWNYCQF2.mjs} +6 -6
- package/dist/server/components.mjs +3777 -2981
- package/dist/server/config-template-validation.mjs +35 -22
- package/dist/server/config-validation.mjs +1883 -1565
- package/dist/server/config.mjs +1883 -1565
- package/dist/server/data.mjs +1667 -1334
- package/dist/server/index.mjs +208 -9
- package/dist/server/next/middleware.mjs +2 -2
- package/dist/server/next.mjs +4077 -3060
- package/dist/server/page-converter.mjs +1481 -1279
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +3806 -2993
- package/dist/server/rendering.mjs +4000 -3060
- package/dist/server/routing.mjs +1737 -1357
- package/dist/server/server.mjs +2918 -2276
- package/dist/server/theme-bridge.mjs +43 -0
- package/dist/styles/index.css +44 -0
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-PBEFH5AL.mjs +0 -8
|
@@ -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,15 +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
|
+
import type { PageBaseSnapshotTarget } from '../merge-remote/pageSnapshots';
|
|
11
|
+
import { type ContentMetadataTarget } from './metadataStore';
|
|
10
12
|
export interface WriterOptions {
|
|
11
13
|
skipMeta?: boolean;
|
|
12
14
|
cleanupMissing?: boolean;
|
|
15
|
+
metadataTarget?: ContentMetadataTarget;
|
|
13
16
|
entryBaseSnapshot?: EntryBaseSnapshotTarget;
|
|
17
|
+
pageBaseSnapshot?: PageBaseSnapshotTarget;
|
|
14
18
|
}
|
|
15
19
|
type WritablePulledEntries = Omit<PulledEntries, 'entries'> & {
|
|
16
|
-
entries:
|
|
20
|
+
entries: EntryForOutput[];
|
|
17
21
|
};
|
|
18
22
|
/**
|
|
19
23
|
* Write entries to content directory
|
|
@@ -90,7 +94,7 @@ export declare function writeThemesMeta(contentDir: string, meta: {
|
|
|
90
94
|
selectionId: string;
|
|
91
95
|
updatedAt: string;
|
|
92
96
|
}>;
|
|
93
|
-
}): Promise<void>;
|
|
97
|
+
}, options?: Pick<WriterOptions, 'metadataTarget'>): Promise<void>;
|
|
94
98
|
/**
|
|
95
99
|
* Write a pulled theme to content directory with metadata
|
|
96
100
|
*
|
|
@@ -205,7 +209,7 @@ export declare function updateMetadataAfterPush(contentDir: string, remoteConten
|
|
|
205
209
|
updatedAt: string;
|
|
206
210
|
createdAt?: string;
|
|
207
211
|
}>;
|
|
208
|
-
}): Promise<void>;
|
|
212
|
+
}, options?: Pick<WriterOptions, 'metadataTarget'>): Promise<void>;
|
|
209
213
|
export declare function writeAllContent(contentDir: string, content: {
|
|
210
214
|
entries: Record<string, PulledEntries['entries']>;
|
|
211
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[]>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ScalarMergeChangeValue = string | number | boolean | null | undefined;
|
|
2
|
+
export type MergeChange = Readonly<{
|
|
3
|
+
path: string;
|
|
4
|
+
}> & (Readonly<{
|
|
5
|
+
value: ScalarMergeChangeValue;
|
|
6
|
+
containerKind: 'scalar' | 'null';
|
|
7
|
+
}> | Readonly<{
|
|
8
|
+
value: Record<string, unknown>;
|
|
9
|
+
containerKind: 'object';
|
|
10
|
+
}> | Readonly<{
|
|
11
|
+
value: readonly unknown[];
|
|
12
|
+
containerKind: 'array';
|
|
13
|
+
}>);
|
|
14
|
+
export type ScalarMergeChange = Extract<MergeChange, {
|
|
15
|
+
containerKind: 'scalar' | 'null';
|
|
16
|
+
}>;
|
|
17
|
+
export declare function collectMergeChanges(currentPath: string, base: unknown, next: unknown, changes: Map<string, MergeChange>): void;
|
|
18
|
+
export declare function firstNestedContainerChange<TChange extends MergeChange>(localChanges: ReadonlyMap<string, TChange>, remoteChanges: ReadonlyMap<string, TChange>): TChange | null;
|
|
19
|
+
export declare function firstSameFieldConflictPath(localChanges: ReadonlyMap<string, MergeChange>, remoteChanges: ReadonlyMap<string, MergeChange>): string | null;
|
|
20
|
+
export declare function scalarMergeChanges<TChange extends MergeChange>(changes: ReadonlyMap<string, TChange>, label: string): readonly Extract<TChange, {
|
|
21
|
+
containerKind: 'scalar' | 'null';
|
|
22
|
+
}>[];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { LocalPage } from '../content/reader';
|
|
2
|
+
export type PageMergeSubject = Readonly<{
|
|
3
|
+
identifier: string;
|
|
4
|
+
}>;
|
|
5
|
+
export type PageMergeInputs = Readonly<{
|
|
6
|
+
subject: PageMergeSubject;
|
|
7
|
+
base: LocalPage | null;
|
|
8
|
+
local: LocalPage | null;
|
|
9
|
+
remote: LocalPage | null;
|
|
10
|
+
}>;
|
|
11
|
+
export type PageMergeConflict = Readonly<{
|
|
12
|
+
code: 'missing_base';
|
|
13
|
+
subject: PageMergeSubject;
|
|
14
|
+
message: string;
|
|
15
|
+
}> | Readonly<{
|
|
16
|
+
code: 'same_field_changed';
|
|
17
|
+
subject: PageMergeSubject;
|
|
18
|
+
fieldPath: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}> | Readonly<{
|
|
21
|
+
code: 'local_delete_unsupported';
|
|
22
|
+
subject: PageMergeSubject;
|
|
23
|
+
message: string;
|
|
24
|
+
}> | Readonly<{
|
|
25
|
+
code: 'remote_delete_local_edit';
|
|
26
|
+
subject: PageMergeSubject;
|
|
27
|
+
message: string;
|
|
28
|
+
}> | Readonly<{
|
|
29
|
+
code: 'unsupported_nested_merge';
|
|
30
|
+
subject: PageMergeSubject;
|
|
31
|
+
fieldPath: string;
|
|
32
|
+
message: string;
|
|
33
|
+
}>;
|
|
34
|
+
export type PageMergeDecision = Readonly<{
|
|
35
|
+
kind: 'unchanged';
|
|
36
|
+
subject: PageMergeSubject;
|
|
37
|
+
desired: LocalPage | null;
|
|
38
|
+
}> | Readonly<{
|
|
39
|
+
kind: 'bootstrap_base';
|
|
40
|
+
subject: PageMergeSubject;
|
|
41
|
+
desired: LocalPage;
|
|
42
|
+
}> | Readonly<{
|
|
43
|
+
kind: 'preserve_remote';
|
|
44
|
+
subject: PageMergeSubject;
|
|
45
|
+
desired: LocalPage | null;
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
kind: 'apply_local_create' | 'apply_local_update';
|
|
48
|
+
subject: PageMergeSubject;
|
|
49
|
+
desired: LocalPage;
|
|
50
|
+
}> | Readonly<{
|
|
51
|
+
kind: 'auto_merge';
|
|
52
|
+
subject: PageMergeSubject;
|
|
53
|
+
desired: LocalPage;
|
|
54
|
+
localFieldPaths: readonly string[];
|
|
55
|
+
remoteFieldPaths: readonly string[];
|
|
56
|
+
}> | Readonly<{
|
|
57
|
+
kind: 'conflict';
|
|
58
|
+
subject: PageMergeSubject;
|
|
59
|
+
conflict: PageMergeConflict;
|
|
60
|
+
}>;
|
|
61
|
+
export type ComparablePage = Readonly<{
|
|
62
|
+
identifier: string;
|
|
63
|
+
title: string;
|
|
64
|
+
path: string;
|
|
65
|
+
status?: LocalPage['status'];
|
|
66
|
+
hasUnpublishedChanges?: boolean;
|
|
67
|
+
seoTitle?: string;
|
|
68
|
+
seoDescription?: string;
|
|
69
|
+
blocks?: ReadonlyArray<Readonly<{
|
|
70
|
+
identifier: string;
|
|
71
|
+
kind: string;
|
|
72
|
+
position?: number;
|
|
73
|
+
data: Readonly<Record<string, unknown>>;
|
|
74
|
+
}>>;
|
|
75
|
+
}>;
|
|
76
|
+
export declare function planPageMerge(input: PageMergeInputs): PageMergeDecision;
|
|
77
|
+
export declare function comparablePage(page: LocalPage | null): ComparablePage | null;
|
|
78
|
+
export declare function pagesEqual(left: LocalPage | null, right: LocalPage | null): boolean;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PulledPages } from '../../client/management/types';
|
|
2
|
+
import type { LocalPage } from '../content/reader';
|
|
3
|
+
import { type PageMergeDecision } from './pageMerge';
|
|
4
|
+
import { type PageBaseSnapshotTarget } from './pageSnapshots';
|
|
5
|
+
export type PageMergePushScope = Readonly<{
|
|
6
|
+
kind: 'all_pages';
|
|
7
|
+
}> | Readonly<{
|
|
8
|
+
kind: 'single_page';
|
|
9
|
+
identifier: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type RemotePageMergePlan = Readonly<{
|
|
12
|
+
scope: PageMergePushScope;
|
|
13
|
+
decisions: readonly PageMergeDecision[];
|
|
14
|
+
summary: RemotePageMergePlanSummary;
|
|
15
|
+
}>;
|
|
16
|
+
export type RemotePageMergePlanSummary = Readonly<{
|
|
17
|
+
unchanged: number;
|
|
18
|
+
bootstrapBase: number;
|
|
19
|
+
preserveRemote: number;
|
|
20
|
+
applyLocalCreate: number;
|
|
21
|
+
applyLocalUpdate: number;
|
|
22
|
+
autoMerge: number;
|
|
23
|
+
conflicts: number;
|
|
24
|
+
}>;
|
|
25
|
+
export type RemotePageMergePlanInput = Readonly<{
|
|
26
|
+
contentDir: string;
|
|
27
|
+
target: PageBaseSnapshotTarget;
|
|
28
|
+
scope: PageMergePushScope;
|
|
29
|
+
localPages: readonly LocalPage[];
|
|
30
|
+
remotePages: readonly PulledPages['pages'][number][];
|
|
31
|
+
}>;
|
|
32
|
+
export declare function buildRemotePageMergePlan(input: RemotePageMergePlanInput): Promise<RemotePageMergePlan>;
|
|
33
|
+
export declare function summarizePageMergeDecisions(decisions: readonly PageMergeDecision[]): RemotePageMergePlanSummary;
|
|
34
|
+
export declare function pageMergePushScope(input: Readonly<{
|
|
35
|
+
identifier?: string;
|
|
36
|
+
}>): PageMergePushScope;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SiteId } from '../../../../core/src/index';
|
|
2
|
+
import type { ManagementClient } from '../../client/management/types';
|
|
3
|
+
import type { ContentMetadataTarget } from '../content/metadataStore';
|
|
4
|
+
import type { LocalPage } from '../content/reader';
|
|
5
|
+
import type { EnvTarget } from '../helpers';
|
|
6
|
+
import type { OutputContext } from '../output';
|
|
7
|
+
export type RemotePageMergePushResult = Readonly<{
|
|
8
|
+
success: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function planAndReportRemotePageMerge(input: Readonly<{
|
|
11
|
+
output: OutputContext;
|
|
12
|
+
client: Pick<ManagementClient, 'pages' | 'blocks' | 'pull'>;
|
|
13
|
+
contentDir: string;
|
|
14
|
+
target: EnvTarget;
|
|
15
|
+
siteId: SiteId;
|
|
16
|
+
metadataTarget: ContentMetadataTarget;
|
|
17
|
+
identifier?: string;
|
|
18
|
+
localPages: readonly LocalPage[];
|
|
19
|
+
dryRun: boolean;
|
|
20
|
+
jsonOutput: boolean;
|
|
21
|
+
jsonDiff: boolean;
|
|
22
|
+
skipMeta: boolean;
|
|
23
|
+
}>): Promise<RemotePageMergePushResult>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { OutputContext } from '../output';
|
|
2
|
+
import type { PageMergeConflict, PageMergeDecision } from './pageMerge';
|
|
3
|
+
import type { RemotePageMergePlan } from './pageMergePlan';
|
|
4
|
+
export type RemotePageMergeJsonReport = Readonly<{
|
|
5
|
+
kind: 'push';
|
|
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'];
|
|
14
|
+
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
|
+
}>;
|
|
23
|
+
export declare function remotePageMergeJsonReport(input: Readonly<{
|
|
24
|
+
plan: RemotePageMergePlan;
|
|
25
|
+
dryRun: boolean;
|
|
26
|
+
}>): RemotePageMergeJsonReport;
|
|
27
|
+
export declare function writeRemotePageMergeHumanReport(output: Pick<OutputContext, 'info'>, plan: RemotePageMergePlan, options: Readonly<{
|
|
28
|
+
dryRun: boolean;
|
|
29
|
+
}>): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PulledPages } from '../../client/management/types';
|
|
2
|
+
import type { EnvTarget } from '../helpers';
|
|
3
|
+
import type { LocalPage } from '../content/reader';
|
|
4
|
+
export type PageBaseSnapshotTarget = Readonly<{
|
|
5
|
+
env: EnvTarget;
|
|
6
|
+
siteId: string;
|
|
7
|
+
}>;
|
|
8
|
+
export type PageBaseSnapshotSubject = Readonly<{
|
|
9
|
+
identifier: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type PageBaseSnapshot = Readonly<{
|
|
12
|
+
version: 'page-base.v1';
|
|
13
|
+
target: Readonly<{
|
|
14
|
+
env: EnvTarget;
|
|
15
|
+
siteIdHash: string;
|
|
16
|
+
}>;
|
|
17
|
+
subject: PageBaseSnapshotSubject;
|
|
18
|
+
pulledAt: string;
|
|
19
|
+
remoteVersion: Readonly<{
|
|
20
|
+
createdAt?: string;
|
|
21
|
+
updatedAt?: string;
|
|
22
|
+
publishedAt?: string | null;
|
|
23
|
+
}>;
|
|
24
|
+
page: LocalPage;
|
|
25
|
+
}>;
|
|
26
|
+
export type WritePageBaseSnapshotsInput = Readonly<{
|
|
27
|
+
contentDir: string;
|
|
28
|
+
target: PageBaseSnapshotTarget;
|
|
29
|
+
pages: PulledPages['pages'];
|
|
30
|
+
meta: PulledPages['meta'];
|
|
31
|
+
cleanupMissing?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export type WritePageBaseSnapshotsResult = Readonly<{
|
|
34
|
+
rootDir: string;
|
|
35
|
+
count: number;
|
|
36
|
+
}>;
|
|
37
|
+
export declare function pageBaseSnapshotRoot(contentDir: string): string;
|
|
38
|
+
export declare function pageBaseSnapshotPath(input: Readonly<{
|
|
39
|
+
contentDir: string;
|
|
40
|
+
target: PageBaseSnapshotTarget;
|
|
41
|
+
subject: PageBaseSnapshotSubject;
|
|
42
|
+
}>): string;
|
|
43
|
+
export declare function writePageBaseSnapshots(input: WritePageBaseSnapshotsInput): Promise<WritePageBaseSnapshotsResult>;
|
|
44
|
+
export declare function readPageBaseSnapshot(input: Readonly<{
|
|
45
|
+
contentDir: string;
|
|
46
|
+
target: PageBaseSnapshotTarget;
|
|
47
|
+
subject: PageBaseSnapshotSubject;
|
|
48
|
+
}>): Promise<PageBaseSnapshot | null>;
|
|
@@ -11,18 +11,29 @@ interface PushConfigOptions {
|
|
|
11
11
|
apiKey?: string;
|
|
12
12
|
dashboard: string;
|
|
13
13
|
forceContentTypes?: boolean;
|
|
14
|
+
dryRun?: boolean;
|
|
14
15
|
}
|
|
16
|
+
export type PushConfigActionResult = Readonly<{
|
|
17
|
+
success: true;
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
success: false;
|
|
20
|
+
}>;
|
|
15
21
|
type PushConfigResponse = NonNullable<APIEndpoints['pushSdkConfig']['response']>;
|
|
16
22
|
type PushConfigSync = NonNullable<PushConfigResponse['configSync']>;
|
|
17
23
|
type LegacyPushConfigSync = NonNullable<PushConfigResponse['sync']>;
|
|
18
24
|
type PushConfigDisplaySync = PushConfigSync | LegacyPushConfigSync;
|
|
19
25
|
type PushConfigSyncArea = 'contentTypes' | 'customBlocks' | 'templateBlocks' | 'settings' | 'ignoredDocuments' | 'pages' | 'entries' | 'navigationMenus';
|
|
20
|
-
type PushConfigSyncMessage = {
|
|
26
|
+
export type PushConfigSyncMessage = {
|
|
21
27
|
area: PushConfigSyncArea;
|
|
22
28
|
message: string;
|
|
23
29
|
};
|
|
24
30
|
export declare function collectPushConfigSyncErrors(sync: PushConfigDisplaySync): PushConfigSyncMessage[];
|
|
25
31
|
export declare function collectPushConfigSyncWarnings(sync: PushConfigDisplaySync): PushConfigSyncMessage[];
|
|
32
|
+
export declare function groupPushConfigSyncWarningsForHuman(warnings: readonly PushConfigSyncMessage[]): PushConfigSyncMessage[];
|
|
33
|
+
export declare function isPushConfigActionSuccess(result: PushConfigActionResult): result is Extract<PushConfigActionResult, {
|
|
34
|
+
success: true;
|
|
35
|
+
}>;
|
|
36
|
+
export declare function markFailedPushConfigCommandResult(result: PushConfigActionResult): void;
|
|
26
37
|
/**
|
|
27
38
|
* Main push-config action.
|
|
28
39
|
* Exported for reuse by `push --with-config`.
|
|
@@ -30,7 +41,7 @@ export declare function collectPushConfigSyncWarnings(sync: PushConfigDisplaySyn
|
|
|
30
41
|
export declare function pushConfigAction(output: OutputContext, options: PushConfigOptions & {
|
|
31
42
|
isRemote: boolean;
|
|
32
43
|
isJsonOutput?: boolean;
|
|
33
|
-
}): Promise<
|
|
44
|
+
}): Promise<PushConfigActionResult>;
|
|
34
45
|
/**
|
|
35
46
|
* push-config command definition
|
|
36
47
|
*/
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { EnvTarget } from '../helpers';
|
|
2
|
+
export type SetupOperation = 'create_site' | 'create_management_key' | 'grant_user_access' | 'configure_env' | 'verify_access';
|
|
3
|
+
export type SetupAuthority = 'dashboard_admin' | 'cms_repo_script' | 'sdk_management_key';
|
|
4
|
+
export type SetupPlanStep = Readonly<{
|
|
5
|
+
tag: 'admin_action';
|
|
6
|
+
operation: Exclude<SetupOperation, 'configure_env' | 'verify_access'>;
|
|
7
|
+
title: string;
|
|
8
|
+
detail: string;
|
|
9
|
+
allowedAuthorities: readonly Exclude<SetupAuthority, 'sdk_management_key'>[];
|
|
10
|
+
}> | Readonly<{
|
|
11
|
+
tag: 'local_env';
|
|
12
|
+
operation: 'configure_env';
|
|
13
|
+
title: string;
|
|
14
|
+
detail: string;
|
|
15
|
+
missingVariables: readonly string[];
|
|
16
|
+
exampleLines: readonly string[];
|
|
17
|
+
}> | Readonly<{
|
|
18
|
+
tag: 'cli_check';
|
|
19
|
+
operation: 'verify_access';
|
|
20
|
+
title: string;
|
|
21
|
+
detail: string;
|
|
22
|
+
commands: readonly string[];
|
|
23
|
+
}>;
|
|
24
|
+
export type SetupCapability = Readonly<{
|
|
25
|
+
authority: 'dashboard_admin';
|
|
26
|
+
can: readonly ('create_site' | 'create_management_key' | 'grant_user_access')[];
|
|
27
|
+
}> | Readonly<{
|
|
28
|
+
authority: 'cms_repo_script';
|
|
29
|
+
can: readonly ('create_site' | 'create_management_key' | 'grant_user_access')[];
|
|
30
|
+
requirement: string;
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
authority: 'sdk_management_key';
|
|
33
|
+
can: readonly ('verify_access')[];
|
|
34
|
+
cannot: readonly ('create_site' | 'create_management_key' | 'grant_user_access')[];
|
|
35
|
+
}>;
|
|
36
|
+
export interface SetupTargetStatus {
|
|
37
|
+
target: EnvTarget;
|
|
38
|
+
siteId: string | null;
|
|
39
|
+
dashboardUrl: string | null;
|
|
40
|
+
managementApiKeySet: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface SdkSetupPlan {
|
|
43
|
+
target: EnvTarget;
|
|
44
|
+
configured: boolean;
|
|
45
|
+
canMutatePrivilegedResources: false;
|
|
46
|
+
capabilities: readonly SetupCapability[];
|
|
47
|
+
steps: readonly SetupPlanStep[];
|
|
48
|
+
securityNotes: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
export declare function planSdkSetup(status: SetupTargetStatus): SdkSetupPlan;
|
|
51
|
+
export declare function formatSdkSetupPlan(plan: SdkSetupPlan): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Result, type SiteId } from '../../../../core/src/index';
|
|
2
2
|
import { type DryRunReport, type SiteCommandBatch, type SiteCommandExecutionSuccess, type SiteCommandOf, type SiteCommandPlanFor, type SiteCommandRef, type SiteCommandType, type SiteCommandValidationError } from '../../../../site-commands/src/index';
|
|
3
|
+
import { type ManagementApiErrorRequest } from '../../client/management';
|
|
3
4
|
import type { EnvTarget } from '../helpers';
|
|
4
5
|
export type CliCommandBatchRefInput<TSource extends string = string> = Readonly<{
|
|
5
6
|
source: TSource;
|
|
@@ -11,6 +12,22 @@ export type CliCommandExecutionError<TCommandType extends SiteCommandType> = Rea
|
|
|
11
12
|
commandRef: SiteCommandRef;
|
|
12
13
|
commandType: TCommandType;
|
|
13
14
|
message: string;
|
|
15
|
+
detail?: CliCommandFailureDetail;
|
|
16
|
+
}>;
|
|
17
|
+
export type CliCommandFailureFieldError = Readonly<{
|
|
18
|
+
field: string;
|
|
19
|
+
message: string;
|
|
20
|
+
code?: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type CliCommandFailureDetail = Readonly<{
|
|
23
|
+
tag: 'management_api';
|
|
24
|
+
code: string;
|
|
25
|
+
statusCode?: number;
|
|
26
|
+
request?: ManagementApiErrorRequest;
|
|
27
|
+
fieldErrors: readonly CliCommandFailureFieldError[];
|
|
28
|
+
details?: unknown;
|
|
29
|
+
}> | Readonly<{
|
|
30
|
+
tag: 'unknown';
|
|
14
31
|
}>;
|
|
15
32
|
export type CliCommandExecutionResult<TCommandType extends SiteCommandType> = Readonly<{
|
|
16
33
|
status: 'applied';
|
|
@@ -43,6 +60,7 @@ export type CliCommandReportedPlannedCommand<TCommand extends Readonly<{
|
|
|
43
60
|
export type CliCommandExecutionReportFailure<TSubject> = Readonly<{
|
|
44
61
|
identifier: string;
|
|
45
62
|
message: string;
|
|
63
|
+
detail?: CliCommandFailureDetail;
|
|
46
64
|
subject?: TSubject;
|
|
47
65
|
}>;
|
|
48
66
|
export type CliCommandOutcome<TSubject> = Readonly<{
|
|
@@ -56,6 +74,7 @@ export type CliCommandOutcome<TSubject> = Readonly<{
|
|
|
56
74
|
commandType: SiteCommandType;
|
|
57
75
|
identifier: string;
|
|
58
76
|
message: string;
|
|
77
|
+
detail?: CliCommandFailureDetail;
|
|
59
78
|
subject?: TSubject;
|
|
60
79
|
}> | Readonly<{
|
|
61
80
|
status: 'skipped_by_stop_policy';
|
|
@@ -97,6 +116,7 @@ export declare function createCliCommandBatchRef(input: CliCommandBatchRefInput)
|
|
|
97
116
|
export declare function formatSiteCommandValidationErrors(errors: readonly {
|
|
98
117
|
message: string;
|
|
99
118
|
}[]): string;
|
|
119
|
+
export declare function managementErrorDetail(error: unknown): CliCommandFailureDetail;
|
|
100
120
|
export declare function formatManagementError(error: unknown): string;
|
|
101
121
|
export declare function planCliCommandBatchForTypes<TCommandType extends SiteCommandType>(input: CliCommandBatchRefInput & Readonly<{
|
|
102
122
|
commands: readonly SiteCommandOf<TCommandType>[];
|
|
@@ -126,6 +146,7 @@ export declare function commandExecutionToReport<TCommand extends Readonly<{
|
|
|
126
146
|
export declare function commandCompileFailureToReport<TSubject>(input: Readonly<{
|
|
127
147
|
identifier: string;
|
|
128
148
|
message: string;
|
|
149
|
+
detail?: CliCommandFailureDetail;
|
|
129
150
|
subject?: TSubject;
|
|
130
151
|
warnings?: readonly string[];
|
|
131
152
|
}>): CliCommandExecutionReport<TSubject>;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { LocalContent, LocalFooterContent } from '../content/reader';
|
|
8
8
|
import type { PulledContent, ManagementFooterContent } from '../../client/management/types';
|
|
9
|
+
import { type BuildFieldDiffOptions, type FieldChange } from './field-diff';
|
|
10
|
+
export type { FieldChange } from './field-diff';
|
|
9
11
|
export type DiffType = 'create' | 'update' | 'unchanged';
|
|
10
12
|
export interface EntryDiff {
|
|
11
13
|
type: DiffType | 'delete';
|
|
@@ -205,15 +207,10 @@ export declare function formatDiffDetail(diff: ContentDiff): string;
|
|
|
205
207
|
* @returns Content diff showing what would be created/updated locally
|
|
206
208
|
*/
|
|
207
209
|
export declare function calculatePullDiff(remote: PulledContent, local: LocalContent | null): ContentDiff;
|
|
208
|
-
export interface FieldChange {
|
|
209
|
-
path: string;
|
|
210
|
-
before: unknown;
|
|
211
|
-
after: unknown;
|
|
212
|
-
}
|
|
213
210
|
/**
|
|
214
211
|
* Find changed fields between two objects with their before/after values.
|
|
215
212
|
*/
|
|
216
|
-
export declare function findChangedFieldsWithValues(local: Record<string, unknown>, remote: Record<string, unknown>, prefix?: string): FieldChange[];
|
|
213
|
+
export declare function findChangedFieldsWithValues(local: Record<string, unknown>, remote: Record<string, unknown>, prefix?: string, options?: BuildFieldDiffOptions): FieldChange[];
|
|
217
214
|
/**
|
|
218
215
|
* Format a value for human-readable display.
|
|
219
216
|
*/
|