@riverbankcms/sdk 0.64.0 → 0.68.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 +21 -11
- package/dist/_dts/api/src/aiPlayground.d.ts +75 -20
- package/dist/_dts/api/src/apiEndpointTypes.d.ts +12 -0
- package/dist/_dts/api/src/billing.d.ts +7 -40
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +4 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +33 -2
- package/dist/_dts/api/src/endpoints.d.ts +32 -0
- package/dist/_dts/api/src/public/types.d.ts +1 -1
- package/dist/_dts/api/src/sdkConfig/contracts.d.ts +0 -40
- package/dist/_dts/api/src/sdkContracts.d.ts +1 -1
- package/dist/_dts/api/src/siteMembers.d.ts +1 -1
- package/dist/_dts/api/src/siteOperations.d.ts +1 -1
- package/dist/_dts/billing/src/components/index.d.ts +426 -0
- package/dist/_dts/billing/src/plans/types.d.ts +1 -1
- package/dist/_dts/blocks/src/PageRenderer.d.ts +4 -0
- package/dist/_dts/blocks/src/bindings/index.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +6 -0
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableDates.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +140 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.state.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useVisibleTabPolling.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.default-ui.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +484 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +5 -2
- package/dist/_dts/blocks/src/system/transforms/registry/formatting.d.ts +1 -0
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +2 -1
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +81 -0
- package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +7 -3
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +2 -2
- package/dist/_dts/sdk/src/bookings/index.d.ts +5 -2
- package/dist/_dts/sdk/src/bookings/types.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/commands/push/execute/footer.d.ts +33 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +32 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +5 -1
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/env.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/site-commands/commandKeys.d.ts +13 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +144 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntimeCompat.d.ts +21 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandSurfaceDispatch.d.ts +27 -0
- package/dist/_dts/sdk/src/cli/site-commands/datedOfferingCommands.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/site-commands/entryCommands.d.ts +29 -49
- package/dist/_dts/sdk/src/cli/site-commands/footerCommands.d.ts +56 -0
- package/dist/_dts/sdk/src/cli/site-commands/formCommands.d.ts +53 -0
- package/dist/_dts/sdk/src/cli/site-commands/index.d.ts +6 -0
- package/dist/_dts/sdk/src/cli/site-commands/navigationCommands.d.ts +53 -0
- package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +79 -0
- package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +19 -20
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionPlan.d.ts +8 -0
- package/dist/_dts/sdk/src/cli/site-commands/pushExecutionTypes.d.ts +97 -0
- package/dist/_dts/sdk/src/cli/site-commands/residualSettingsTrimming.d.ts +15 -0
- package/dist/_dts/sdk/src/cli/sync/executor.d.ts +10 -28
- package/dist/_dts/sdk/src/cli/sync/index.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/sync/syncResultAggregation.d.ts +4 -0
- package/dist/_dts/sdk/src/config/dashboard-validation.d.ts +0 -48
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/overrides.d.ts +2 -0
- package/dist/_dts/sdk/src/theme-bridge/ThemeBridgeProvider.d.ts +4 -4
- package/dist/_dts/sdk/src/theme-bridge/generateCssVars.d.ts +4 -12
- package/dist/_dts/sdk/src/theme-bridge/index.d.ts +1 -1
- package/dist/_dts/sdk/src/theme-bridge/types.d.ts +17 -9
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/adapter.d.ts +2 -2
- package/dist/_dts/site-commands/src/commands.d.ts +637 -13
- package/dist/_dts/site-commands/src/domain.d.ts +3 -3
- package/dist/_dts/site-commands/src/exposure.d.ts +41 -0
- package/dist/_dts/site-commands/src/index.d.ts +2 -0
- package/dist/_dts/site-commands/src/metadata.d.ts +159 -3
- package/dist/_dts/site-commands/src/planner.d.ts +13 -6
- package/dist/_dts/site-commands/src/refContributions.d.ts +1 -0
- package/dist/_dts/site-commands/src/refs.d.ts +19 -1
- package/dist/_dts/{sdk/src/cli/merge-remote → site-commands/src}/stableJson.d.ts +2 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/index.d.ts +1 -1
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/palette/utils/onColor.d.ts +2 -0
- package/dist/_dts/theme-core/src/runtime/buildThemeRuntimeFromBridge.d.ts +30 -23
- package/dist/_dts/theme-core/src/site-styles/accessibleSurfaces.d.ts +83 -0
- package/dist/_dts/theme-core/src/site-styles/contentTemplateRuntimeCompiler.d.ts +2 -1
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +89 -12
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +8 -2
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +3 -2
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +9 -6
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/cli/index.mjs +4736 -2026
- package/dist/client/bookings.mjs +5107 -3348
- package/dist/client/client.mjs +4579 -3871
- package/dist/client/hooks.mjs +325 -123
- package/dist/client/rendering/client.mjs +4474 -3869
- package/dist/client/rendering/islands.mjs +4234 -3639
- package/dist/client/rendering.mjs +4508 -3798
- package/dist/preview-next/before-render.mjs +75 -13
- package/dist/preview-next/client/runtime.mjs +3700 -2644
- package/dist/preview-next/middleware.mjs +75 -13
- package/dist/server/components.mjs +698 -383
- package/dist/server/config-validation.mjs +327 -125
- package/dist/server/config.mjs +327 -125
- package/dist/server/data.mjs +325 -123
- package/dist/server/index.mjs +92 -16
- package/dist/server/next.mjs +692 -377
- package/dist/server/page-converter.mjs +159 -41
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +700 -383
- package/dist/server/rendering.mjs +700 -383
- package/dist/server/routing.mjs +406 -131
- package/dist/server/server.mjs +326 -124
- package/dist/server/theme-bridge.mjs +1226 -4697
- package/dist/styles/index.css +38 -38
- package/package.json +1 -1
- package/dist/_dts/blocks/src/system/runtime/components/booking/DateTimeSelectionStep.d.ts +0 -18
- package/dist/_dts/blocks/src/system/runtime/components/booking/PaymentOptionSelectionStep.d.ts +0 -9
- package/dist/_dts/blocks/src/system/runtime/components/booking/ServiceResourceSelector.d.ts +0 -44
- package/dist/_dts/blocks/src/system/runtime/components/booking/ServiceResourceSelector.state.d.ts +0 -23
- package/dist/_dts/blocks/src/system/runtime/components/booking/ServiceSelectionStep.d.ts +0 -18
- package/dist/_dts/blocks/src/system/runtime/components/booking/slotDisplay.d.ts +0 -2
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/MultiStepForm.d.ts +0 -21
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/useMultiStep.d.ts +0 -15
- package/dist/_dts/blocks/src/system/runtime/components/multi-step/useMultiStep.state.d.ts +0 -51
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingSteps.d.ts +0 -22
- package/dist/_dts/path-utils/src/index.d.ts +0 -8
- package/dist/_dts/path-utils/src/redirectPaths.d.ts +0 -26
- package/dist/_dts/path-utils/src/safeAppPath.d.ts +0 -26
|
@@ -1,85 +1,65 @@
|
|
|
1
|
-
import { type Result } from '@riverbankcms/core';
|
|
2
|
-
import { type AllowedRuntime, type
|
|
1
|
+
import { type Result, type SiteId } from '@riverbankcms/core';
|
|
2
|
+
import { type AllowedRuntime, type SiteCommandOf } from '@riverbankcms/site-commands';
|
|
3
3
|
import type { ManagementClient } from '../../client/management/types';
|
|
4
4
|
import type { LocalContent } from '../content/reader';
|
|
5
5
|
import type { EnvTarget } from '../helpers';
|
|
6
6
|
import type { ContentDiff } from '../sync/diff';
|
|
7
|
-
import {
|
|
7
|
+
import type { SyncResult } from '../sync';
|
|
8
|
+
import { type CliContentTypeKey, type CliEntryIdentifier } from './commandKeys';
|
|
9
|
+
import { type CliCommandCompileBatchSuccessWithReports, type CliCommandValidationCompileError, type CliCommandExecutionError, type CliCommandExecutionReport, type CliCommandExecutionResult } from './commandRuntime';
|
|
8
10
|
export type CliEntryCommandBatchSource = 'push_entries' | 'merge_remote_entries';
|
|
9
11
|
export type CliCommandCompileError = Readonly<{
|
|
10
12
|
code: 'missing_local_entry';
|
|
11
|
-
contentType:
|
|
12
|
-
identifier:
|
|
13
|
+
contentType: CliContentTypeKey;
|
|
14
|
+
identifier: CliEntryIdentifier;
|
|
13
15
|
message: string;
|
|
14
|
-
}> |
|
|
15
|
-
code: 'command_validation_failed';
|
|
16
|
-
errors: readonly SiteCommandValidationError[];
|
|
17
|
-
message: string;
|
|
18
|
-
}>;
|
|
16
|
+
}> | CliCommandValidationCompileError;
|
|
19
17
|
export type CliEntryCommandCompileInput = Readonly<{
|
|
20
18
|
source: CliEntryCommandBatchSource;
|
|
21
|
-
siteId:
|
|
19
|
+
siteId: SiteId;
|
|
22
20
|
targetEnv: EnvTarget;
|
|
23
21
|
diff: Pick<ContentDiff, 'entries'>;
|
|
24
22
|
local: Pick<LocalContent, 'entries'>;
|
|
25
23
|
}>;
|
|
26
|
-
export type CliEntryCommandCompileSuccess =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
dryRunReport: DryRunReport;
|
|
30
|
-
reportSubjectsByCommandRef: EntryCommandReportSubjectsByRef;
|
|
31
|
-
}>;
|
|
32
|
-
export type CliEntryCommandExecutionError = Readonly<{
|
|
33
|
-
code: 'management_api_failed';
|
|
34
|
-
commandRef: SiteCommandRef;
|
|
35
|
-
commandType: EntrySiteCommandType;
|
|
36
|
-
message: string;
|
|
37
|
-
}>;
|
|
38
|
-
export type CliEntryCommandExecutionResult = Readonly<{
|
|
39
|
-
status: 'applied';
|
|
40
|
-
applied: readonly SiteCommandExecutionSuccess[];
|
|
41
|
-
}> | Readonly<{
|
|
42
|
-
status: 'failed';
|
|
43
|
-
applied: readonly SiteCommandExecutionSuccess[];
|
|
44
|
-
failed: CliEntryCommandExecutionError;
|
|
45
|
-
}>;
|
|
24
|
+
export type CliEntryCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<EntrySiteCommandType, EntryCommandReportSubject>;
|
|
25
|
+
export type CliEntryCommandExecutionError = CliCommandExecutionError<EntrySiteCommandType>;
|
|
26
|
+
export type CliEntryCommandExecutionResult = CliCommandExecutionResult<EntrySiteCommandType>;
|
|
46
27
|
export type CliEntryCommandSyncInput = Readonly<{
|
|
47
28
|
client: Pick<ManagementClient, 'entries'>;
|
|
48
|
-
|
|
49
|
-
reportSubjectsByCommandRef: EntryCommandReportSubjectsByRef;
|
|
29
|
+
compiledPlan: EntryCommandCompiledPlan;
|
|
50
30
|
onBeforeExecute?: (commandCount: number) => void;
|
|
51
31
|
}>;
|
|
52
32
|
export type EntrySiteCommandType = 'upsertContentEntry' | 'publishContentEntry' | 'unpublishContentEntry' | 'deleteContentEntry';
|
|
53
33
|
export type EntrySiteCommand = SiteCommandOf<EntrySiteCommandType>;
|
|
54
|
-
export type
|
|
55
|
-
[TType in EntrySiteCommandType]: PlannedSiteCommandFor<TType>;
|
|
56
|
-
}[EntrySiteCommandType];
|
|
57
|
-
export type EntrySiteCommandPlan = Omit<SiteCommandPlan, 'commands'> & Readonly<{
|
|
58
|
-
commands: readonly PlannedEntrySiteCommand[];
|
|
59
|
-
}>;
|
|
34
|
+
export type EntrySiteCommandPlan = CliEntryCommandCompileSuccess['plan'];
|
|
60
35
|
export declare const entrySiteCommandTypes: readonly ["upsertContentEntry", "publishContentEntry", "unpublishContentEntry", "deleteContentEntry"];
|
|
61
|
-
export type
|
|
36
|
+
export type EntryCommandSyncCounter = 'created' | 'updated' | 'deleted' | 'published' | 'unpublished';
|
|
62
37
|
export type EntryCommandReportSubject = Readonly<{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
counter: EntryCommandLegacyCounter;
|
|
38
|
+
contentType: CliContentTypeKey;
|
|
39
|
+
identifier: CliEntryIdentifier;
|
|
40
|
+
counter: EntryCommandSyncCounter;
|
|
67
41
|
}>;
|
|
68
|
-
export type
|
|
42
|
+
export type EntryCommandExecutionReport = CliCommandExecutionReport<EntryCommandReportSubject>;
|
|
43
|
+
type EntryCommandCompiledPlan = Pick<CliEntryCommandCompileSuccess, 'plan' | 'reportedCommands'>;
|
|
69
44
|
export declare function compileEntryPushCommands(input: CliEntryCommandCompileInput): Result<CliEntryCommandCompileSuccess, CliCommandCompileError>;
|
|
70
45
|
/** SDK push only distinguishes local development and remote production targets today. */
|
|
71
46
|
export declare function runtimeForCliTarget(targetEnv: EnvTarget): AllowedRuntime;
|
|
72
|
-
export declare function createCliCommandBatchRef(input: Pick<CliEntryCommandCompileInput, 'source' | 'siteId' | 'targetEnv'>): string;
|
|
73
|
-
export declare function formatSiteCommandValidationErrors(errors: readonly SiteCommandValidationError[]): string;
|
|
74
47
|
export declare function executeEntryCommandPlan(input: Readonly<{
|
|
75
48
|
client: Pick<ManagementClient, 'entries'>;
|
|
76
49
|
plan: Pick<EntrySiteCommandPlan, 'commands'>;
|
|
77
50
|
}>): Promise<CliEntryCommandExecutionResult>;
|
|
78
51
|
export declare function executeEntryCommandPlanAsSyncResult(input: CliEntryCommandSyncInput): Promise<SyncResult>;
|
|
52
|
+
export declare function executeEntryCommandPlanAsReport(input: CliEntryCommandSyncInput): Promise<EntryCommandExecutionReport>;
|
|
79
53
|
export declare function syncResultForEntryCommandCompileError(error: CliCommandCompileError): SyncResult;
|
|
54
|
+
export declare function entryCommandCompileErrorToReport(error: CliCommandCompileError): EntryCommandExecutionReport;
|
|
80
55
|
export declare function entryCommandExecutionToSyncResult(input: Readonly<{
|
|
81
56
|
execution: CliEntryCommandExecutionResult;
|
|
82
|
-
|
|
83
|
-
reportSubjectsByCommandRef: EntryCommandReportSubjectsByRef;
|
|
57
|
+
compiledPlan: EntryCommandCompiledPlan;
|
|
84
58
|
}>): SyncResult;
|
|
59
|
+
export declare function entryCommandExecutionToReport(input: Readonly<{
|
|
60
|
+
execution: CliEntryCommandExecutionResult;
|
|
61
|
+
compiledPlan: EntryCommandCompiledPlan;
|
|
62
|
+
}>): EntryCommandExecutionReport;
|
|
63
|
+
export declare function entryCommandReportToSyncResult(report: EntryCommandExecutionReport): SyncResult;
|
|
85
64
|
export declare function titleFromEntryData(data: Record<string, unknown>): string | undefined;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Result, type SiteId } from '@riverbankcms/core';
|
|
2
|
+
import { type SiteCommandOf } from '@riverbankcms/site-commands';
|
|
3
|
+
import type { ManagementClient } from '../../client/management/types';
|
|
4
|
+
import type { LocalFooterContent } from '../content/reader';
|
|
5
|
+
import type { EnvTarget } from '../helpers';
|
|
6
|
+
import type { FooterDiff } from '../sync/diff';
|
|
7
|
+
import type { SyncResult } from '../sync';
|
|
8
|
+
import { type CliCommandCompileBatchSuccessWithReports, type CliCommandExecutionError, type CliCommandExecutionReport, type CliCommandExecutionResult, type CliCommandValidationCompileError } from './commandRuntime';
|
|
9
|
+
export type CliFooterCommandBatchSource = 'push_footer';
|
|
10
|
+
export type CliFooterCommandCompileError = CliCommandValidationCompileError;
|
|
11
|
+
export type CliFooterCommandCompileInput = Readonly<{
|
|
12
|
+
source: CliFooterCommandBatchSource;
|
|
13
|
+
siteId: SiteId;
|
|
14
|
+
targetEnv: EnvTarget;
|
|
15
|
+
diff: FooterDiff;
|
|
16
|
+
local: LocalFooterContent;
|
|
17
|
+
}>;
|
|
18
|
+
export type CliFooterCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<FooterSiteCommandType, FooterCommandReportSubject>;
|
|
19
|
+
export type FooterSiteCommandType = 'upsertFooterContent';
|
|
20
|
+
export type FooterSiteCommand = SiteCommandOf<FooterSiteCommandType>;
|
|
21
|
+
export type FooterSiteCommandPlan = CliFooterCommandCompileSuccess['plan'];
|
|
22
|
+
export type CliFooterCommandExecutionError = CliCommandExecutionError<FooterSiteCommandType>;
|
|
23
|
+
export type CliFooterCommandExecutionResult = CliCommandExecutionResult<FooterSiteCommandType>;
|
|
24
|
+
export declare const footerSiteCommandTypes: readonly ["upsertFooterContent"];
|
|
25
|
+
export type FooterCommandReportSubject = Readonly<{
|
|
26
|
+
identifier: 'footer';
|
|
27
|
+
}>;
|
|
28
|
+
export type FooterCommandExecutionReport = CliCommandExecutionReport<FooterCommandReportSubject>;
|
|
29
|
+
type FooterCommandCompiledPlan = Pick<CliFooterCommandCompileSuccess, 'plan' | 'reportedCommands'>;
|
|
30
|
+
export declare function compileFooterPushCommands(input: CliFooterCommandCompileInput): Result<CliFooterCommandCompileSuccess, CliFooterCommandCompileError>;
|
|
31
|
+
export declare function executeFooterCommandPlan(input: Readonly<{
|
|
32
|
+
client: Pick<ManagementClient, 'footer'>;
|
|
33
|
+
plan: Pick<FooterSiteCommandPlan, 'commands'>;
|
|
34
|
+
}>): Promise<CliFooterCommandExecutionResult>;
|
|
35
|
+
export declare function executeFooterCommandPlanAsSyncResult(input: Readonly<{
|
|
36
|
+
client: Pick<ManagementClient, 'footer'>;
|
|
37
|
+
compiledPlan: FooterCommandCompiledPlan;
|
|
38
|
+
onBeforeExecute?: (commandCount: number) => void;
|
|
39
|
+
}>): Promise<SyncResult>;
|
|
40
|
+
export declare function executeFooterCommandPlanAsReport(input: Readonly<{
|
|
41
|
+
client: Pick<ManagementClient, 'footer'>;
|
|
42
|
+
compiledPlan: FooterCommandCompiledPlan;
|
|
43
|
+
onBeforeExecute?: (commandCount: number) => void;
|
|
44
|
+
}>): Promise<FooterCommandExecutionReport>;
|
|
45
|
+
export declare function syncResultForFooterCommandCompileError(error: CliFooterCommandCompileError): SyncResult;
|
|
46
|
+
export declare function footerCommandCompileErrorToReport(error: CliFooterCommandCompileError): FooterCommandExecutionReport;
|
|
47
|
+
export declare function footerCommandExecutionToSyncResult(input: Readonly<{
|
|
48
|
+
execution: CliFooterCommandExecutionResult;
|
|
49
|
+
compiledPlan: FooterCommandCompiledPlan;
|
|
50
|
+
}>): SyncResult;
|
|
51
|
+
export declare function footerCommandExecutionToReport(input: Readonly<{
|
|
52
|
+
execution: CliFooterCommandExecutionResult;
|
|
53
|
+
compiledPlan: FooterCommandCompiledPlan;
|
|
54
|
+
}>): FooterCommandExecutionReport;
|
|
55
|
+
export declare function footerCommandReportToSyncResult(report: FooterCommandExecutionReport): SyncResult;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Result, type SiteId } from '@riverbankcms/core';
|
|
2
|
+
import { type SiteCommandOf } from '@riverbankcms/site-commands';
|
|
3
|
+
import type { ManagementClient } from '../../client/management/types';
|
|
4
|
+
import type { LocalContent } from '../content/reader';
|
|
5
|
+
import type { EnvTarget } from '../helpers';
|
|
6
|
+
import type { ContentDiff } from '../sync/diff';
|
|
7
|
+
import type { SyncResult } from '../sync';
|
|
8
|
+
import { type CliFormSlug } from './commandKeys';
|
|
9
|
+
import { type CliCommandCompileBatchSuccessWithReports, type CliCommandExecutionError, type CliCommandExecutionReport, type CliCommandExecutionResult, type CliCommandValidationCompileError } from './commandRuntime';
|
|
10
|
+
export type CliFormCommandBatchSource = 'push_forms';
|
|
11
|
+
export type CliFormCommandCompileError = Readonly<{
|
|
12
|
+
code: 'missing_local_form';
|
|
13
|
+
slug: CliFormSlug;
|
|
14
|
+
message: string;
|
|
15
|
+
}> | CliCommandValidationCompileError;
|
|
16
|
+
export type CliFormCommandCompileInput = Readonly<{
|
|
17
|
+
source: CliFormCommandBatchSource;
|
|
18
|
+
siteId: SiteId;
|
|
19
|
+
targetEnv: EnvTarget;
|
|
20
|
+
diff: Pick<ContentDiff, 'forms'>;
|
|
21
|
+
local: Pick<LocalContent, 'forms'>;
|
|
22
|
+
}>;
|
|
23
|
+
export type CliFormCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<FormSiteCommandType, FormCommandReportSubject>;
|
|
24
|
+
export type FormSiteCommandType = 'upsertForm';
|
|
25
|
+
export type FormSiteCommand = SiteCommandOf<FormSiteCommandType>;
|
|
26
|
+
export type FormSiteCommandPlan = CliFormCommandCompileSuccess['plan'];
|
|
27
|
+
export type CliFormCommandExecutionError = CliCommandExecutionError<FormSiteCommandType>;
|
|
28
|
+
export type CliFormCommandExecutionResult = CliCommandExecutionResult<FormSiteCommandType>;
|
|
29
|
+
export declare const formSiteCommandTypes: readonly ["upsertForm"];
|
|
30
|
+
export type FormCommandSyncCounter = 'created' | 'updated';
|
|
31
|
+
export type FormCommandReportSubject = Readonly<{
|
|
32
|
+
slug: CliFormSlug;
|
|
33
|
+
counter: FormCommandSyncCounter;
|
|
34
|
+
}>;
|
|
35
|
+
export type FormCommandExecutionReport = CliCommandExecutionReport<FormCommandReportSubject>;
|
|
36
|
+
type FormCommandCompiledPlan = Pick<CliFormCommandCompileSuccess, 'plan' | 'reportedCommands'>;
|
|
37
|
+
export declare function compileFormPushCommands(input: CliFormCommandCompileInput): Result<CliFormCommandCompileSuccess, CliFormCommandCompileError>;
|
|
38
|
+
export declare function executeFormCommandPlan(input: Readonly<{
|
|
39
|
+
client: Pick<ManagementClient, 'forms'>;
|
|
40
|
+
plan: Pick<FormSiteCommandPlan, 'commands'>;
|
|
41
|
+
}>): Promise<CliFormCommandExecutionResult>;
|
|
42
|
+
export declare function executeFormCommandPlanAsReport(input: Readonly<{
|
|
43
|
+
client: Pick<ManagementClient, 'forms'>;
|
|
44
|
+
compiledPlan: FormCommandCompiledPlan;
|
|
45
|
+
onBeforeExecute?: (commandCount: number) => void;
|
|
46
|
+
}>): Promise<FormCommandExecutionReport>;
|
|
47
|
+
export declare function formCommandCompileErrorToReport(error: CliFormCommandCompileError): FormCommandExecutionReport;
|
|
48
|
+
export declare function formCommandExecutionToReport(input: Readonly<{
|
|
49
|
+
execution: CliFormCommandExecutionResult;
|
|
50
|
+
compiledPlan: FormCommandCompiledPlan;
|
|
51
|
+
}>): FormCommandExecutionReport;
|
|
52
|
+
export declare function formCommandReportToSyncResult(report: FormCommandExecutionReport): SyncResult;
|
|
53
|
+
export {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
export * from './commandRuntime';
|
|
2
|
+
export * from './datedOfferingCommands';
|
|
1
3
|
export * from './entryCommands';
|
|
4
|
+
export * from './formCommands';
|
|
5
|
+
export * from './footerCommands';
|
|
6
|
+
export * from './navigationCommands';
|
|
7
|
+
export * from './pageCommands';
|
|
2
8
|
export * from './pushExecution';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Result, type SiteId } from '@riverbankcms/core';
|
|
2
|
+
import { type SiteCommandOf } from '@riverbankcms/site-commands';
|
|
3
|
+
import type { ManagementClient } from '../../client/management/types';
|
|
4
|
+
import type { LocalContent } from '../content/reader';
|
|
5
|
+
import type { EnvTarget } from '../helpers';
|
|
6
|
+
import type { NavigationDiff } from '../sync/diff';
|
|
7
|
+
import type { SyncResult } from '../sync';
|
|
8
|
+
import { type CliNavigationMenuName } from './commandKeys';
|
|
9
|
+
import { type CliCommandCompileBatchSuccessWithReports, type CliCommandExecutionError, type CliCommandExecutionReport, type CliCommandExecutionResult, type CliCommandValidationCompileError } from './commandRuntime';
|
|
10
|
+
export type CliNavigationCommandBatchSource = 'push_navigation';
|
|
11
|
+
export type CliNavigationCommandCompileError = Readonly<{
|
|
12
|
+
code: 'missing_local_navigation_menu';
|
|
13
|
+
name: CliNavigationMenuName;
|
|
14
|
+
message: string;
|
|
15
|
+
}> | CliCommandValidationCompileError;
|
|
16
|
+
export type CliNavigationCommandCompileInput = Readonly<{
|
|
17
|
+
source: CliNavigationCommandBatchSource;
|
|
18
|
+
siteId: SiteId;
|
|
19
|
+
targetEnv: EnvTarget;
|
|
20
|
+
diff: readonly NavigationDiff[];
|
|
21
|
+
local: Pick<LocalContent, 'navigation'>;
|
|
22
|
+
}>;
|
|
23
|
+
export type CliNavigationCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<NavigationSiteCommandType, NavigationCommandReportSubject>;
|
|
24
|
+
export type CliNavigationCommandExecutionError = CliCommandExecutionError<NavigationSiteCommandType>;
|
|
25
|
+
export type CliNavigationCommandExecutionResult = CliCommandExecutionResult<NavigationSiteCommandType>;
|
|
26
|
+
export type NavigationSiteCommandType = 'upsertNavigationMenu';
|
|
27
|
+
export type NavigationSiteCommand = SiteCommandOf<NavigationSiteCommandType>;
|
|
28
|
+
export type NavigationSiteCommandPlan = CliNavigationCommandCompileSuccess['plan'];
|
|
29
|
+
export declare const navigationSiteCommandTypes: readonly ["upsertNavigationMenu"];
|
|
30
|
+
export type NavigationCommandSyncCounter = 'created' | 'updated';
|
|
31
|
+
export type NavigationCommandReportSubject = Readonly<{
|
|
32
|
+
name: CliNavigationMenuName;
|
|
33
|
+
counter: NavigationCommandSyncCounter;
|
|
34
|
+
}>;
|
|
35
|
+
export type NavigationCommandExecutionReport = CliCommandExecutionReport<NavigationCommandReportSubject>;
|
|
36
|
+
type NavigationCommandCompiledPlan = Pick<CliNavigationCommandCompileSuccess, 'plan' | 'reportedCommands'>;
|
|
37
|
+
export declare function compileNavigationPushCommands(input: CliNavigationCommandCompileInput): Result<CliNavigationCommandCompileSuccess, CliNavigationCommandCompileError>;
|
|
38
|
+
export declare function executeNavigationCommandPlan(input: Readonly<{
|
|
39
|
+
client: Pick<ManagementClient, 'navigation'>;
|
|
40
|
+
plan: Pick<NavigationSiteCommandPlan, 'commands'>;
|
|
41
|
+
}>): Promise<CliNavigationCommandExecutionResult>;
|
|
42
|
+
export declare function executeNavigationCommandPlanAsReport(input: Readonly<{
|
|
43
|
+
client: Pick<ManagementClient, 'navigation'>;
|
|
44
|
+
compiledPlan: NavigationCommandCompiledPlan;
|
|
45
|
+
onBeforeExecute?: (commandCount: number) => void;
|
|
46
|
+
}>): Promise<NavigationCommandExecutionReport>;
|
|
47
|
+
export declare function navigationCommandCompileErrorToReport(error: CliNavigationCommandCompileError): NavigationCommandExecutionReport;
|
|
48
|
+
export declare function navigationCommandExecutionToReport(input: Readonly<{
|
|
49
|
+
execution: CliNavigationCommandExecutionResult;
|
|
50
|
+
compiledPlan: NavigationCommandCompiledPlan;
|
|
51
|
+
}>): NavigationCommandExecutionReport;
|
|
52
|
+
export declare function navigationCommandReportToSyncResult(report: NavigationCommandExecutionReport): SyncResult;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type Result, type SiteId } from '@riverbankcms/core';
|
|
2
|
+
import { type SiteCommandOf } from '@riverbankcms/site-commands';
|
|
3
|
+
import type { ManagementClient } from '../../client/management/types';
|
|
4
|
+
import type { LocalContent } from '../content/reader';
|
|
5
|
+
import type { EnvTarget } from '../helpers';
|
|
6
|
+
import type { BlockFieldExtensionsMap } from '../../config/types';
|
|
7
|
+
import type { ContentDiff } from '../sync/diff';
|
|
8
|
+
import type { SyncResult } from '../sync';
|
|
9
|
+
import { type CliBlockIdentifier, type CliPageIdentifier } from './commandKeys';
|
|
10
|
+
import { type CliCommandCompileBatchSuccessWithReports, type CliCommandExecutionError, type CliCommandExecutionReport, type CliCommandExecutionResult, type CliCommandValidationCompileError } from './commandRuntime';
|
|
11
|
+
export type CliPageCommandBatchSource = 'push_pages';
|
|
12
|
+
export type CliPageCommandCompileError = Readonly<{
|
|
13
|
+
code: 'missing_local_page';
|
|
14
|
+
identifier: CliPageIdentifier;
|
|
15
|
+
message: string;
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
code: 'missing_local_block';
|
|
18
|
+
identifier: `${CliPageIdentifier}/${CliBlockIdentifier}`;
|
|
19
|
+
message: string;
|
|
20
|
+
}> | Readonly<{
|
|
21
|
+
code: 'invalid_page_block';
|
|
22
|
+
identifier: `${CliPageIdentifier}/${CliBlockIdentifier}`;
|
|
23
|
+
warnings: readonly string[];
|
|
24
|
+
message: string;
|
|
25
|
+
}> | CliCommandValidationCompileError;
|
|
26
|
+
export type CliPageCommandCompileInput = Readonly<{
|
|
27
|
+
source: CliPageCommandBatchSource;
|
|
28
|
+
siteId: SiteId;
|
|
29
|
+
targetEnv: EnvTarget;
|
|
30
|
+
diff: Pick<ContentDiff, 'pages'>;
|
|
31
|
+
local: Pick<LocalContent, 'pages'>;
|
|
32
|
+
blockFieldExtensions?: BlockFieldExtensionsMap;
|
|
33
|
+
}>;
|
|
34
|
+
export type CliPageCommandCompileSuccess = CliCommandCompileBatchSuccessWithReports<PageSiteCommandType, PageCommandReportSubject> & Readonly<{
|
|
35
|
+
warnings: readonly string[];
|
|
36
|
+
}>;
|
|
37
|
+
export type PageSiteCommandType = 'upsertPage' | 'upsertPageBlock' | 'deletePageBlock' | 'reorderPageBlocks' | 'publishPage' | 'unpublishPage';
|
|
38
|
+
export type PageSiteCommand = SiteCommandOf<PageSiteCommandType>;
|
|
39
|
+
export type PageSiteCommandPlan = CliPageCommandCompileSuccess['plan'];
|
|
40
|
+
export type CliPageCommandExecutionError = CliCommandExecutionError<PageSiteCommandType>;
|
|
41
|
+
export type CliPageCommandExecutionResult = CliCommandExecutionResult<PageSiteCommandType>;
|
|
42
|
+
export declare const pageSiteCommandTypes: readonly ["upsertPage", "upsertPageBlock", "deletePageBlock", "reorderPageBlocks", "publishPage", "unpublishPage"];
|
|
43
|
+
export type PageCommandSyncCounter = 'created' | 'updated' | 'published' | 'unpublished';
|
|
44
|
+
export type BlockCommandSyncCounter = 'created' | 'updated' | 'deleted' | 'reordered';
|
|
45
|
+
export type PageCommandReportSubject = Readonly<{
|
|
46
|
+
resource: 'page';
|
|
47
|
+
identifier: CliPageIdentifier;
|
|
48
|
+
counter: PageCommandSyncCounter;
|
|
49
|
+
}> | Readonly<{
|
|
50
|
+
resource: 'block';
|
|
51
|
+
pageIdentifier: CliPageIdentifier;
|
|
52
|
+
identifier: CliBlockIdentifier | CliPageIdentifier;
|
|
53
|
+
counter: BlockCommandSyncCounter;
|
|
54
|
+
}>;
|
|
55
|
+
export type PageCommandExecutionReport = CliCommandExecutionReport<PageCommandReportSubject>;
|
|
56
|
+
type PageCommandCompiledPlan = Pick<CliPageCommandCompileSuccess, 'plan' | 'reportedCommands' | 'warnings'>;
|
|
57
|
+
export declare function compilePagePushCommands(input: CliPageCommandCompileInput): Result<CliPageCommandCompileSuccess, CliPageCommandCompileError>;
|
|
58
|
+
export type PageCommandRoutingDecision = Readonly<{
|
|
59
|
+
kind: 'no_page_changes';
|
|
60
|
+
}> | Readonly<{
|
|
61
|
+
kind: 'command_backed';
|
|
62
|
+
}>;
|
|
63
|
+
export declare function pageCommandRouting(diff: Pick<ContentDiff, 'pages'>): PageCommandRoutingDecision;
|
|
64
|
+
export declare function executePageCommandPlan(input: Readonly<{
|
|
65
|
+
client: Pick<ManagementClient, 'pages' | 'blocks'>;
|
|
66
|
+
plan: Pick<PageSiteCommandPlan, 'commands'>;
|
|
67
|
+
}>): Promise<CliPageCommandExecutionResult>;
|
|
68
|
+
export declare function executePageCommandPlanAsReport(input: Readonly<{
|
|
69
|
+
client: Pick<ManagementClient, 'pages' | 'blocks'>;
|
|
70
|
+
compiledPlan: PageCommandCompiledPlan;
|
|
71
|
+
onBeforeExecute?: (commandCount: number) => void;
|
|
72
|
+
}>): Promise<PageCommandExecutionReport>;
|
|
73
|
+
export declare function pageCommandCompileErrorToReport(error: CliPageCommandCompileError): PageCommandExecutionReport;
|
|
74
|
+
export declare function pageCommandExecutionToReport(input: Readonly<{
|
|
75
|
+
execution: CliPageCommandExecutionResult;
|
|
76
|
+
compiledPlan: PageCommandCompiledPlan;
|
|
77
|
+
}>): PageCommandExecutionReport;
|
|
78
|
+
export declare function pageCommandReportToSyncResult(report: PageCommandExecutionReport): SyncResult;
|
|
79
|
+
export {};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type SiteId } from '@riverbankcms/core';
|
|
2
2
|
import type { ManagementClient } from '../../client/management/types';
|
|
3
3
|
import type { LocalContent } from '../content/reader';
|
|
4
4
|
import type { EnvTarget } from '../helpers';
|
|
5
5
|
import type { OutputContext } from '../output';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export
|
|
14
|
-
pushScope:
|
|
15
|
-
siteId:
|
|
16
|
-
target: EnvTarget;
|
|
17
|
-
diff: ContentDiff;
|
|
18
|
-
local: LocalContent;
|
|
19
|
-
}>): PushContentExecutionMode;
|
|
20
|
-
export declare function executeContentPushPlan(input: Readonly<{
|
|
21
|
-
pushScope: string;
|
|
22
|
-
siteId: string;
|
|
6
|
+
import { type ContentDiff, type SyncResult } from '../sync';
|
|
7
|
+
import { type CommandSurfaceDispatchDependencies } from './commandSurfaceDispatch';
|
|
8
|
+
import { planContentPushExecution } from './pushExecutionPlan';
|
|
9
|
+
import type { CommandSurface, CommandSurfaceCompileResult, CommandSurfaceCompileSuccess, CommandSurfaceExecutionReport, ContentPushScope, ContentPushExecutionPlan, ContentPushExecutionReport, ContentPushExecutionStep } from './pushExecutionTypes';
|
|
10
|
+
import type { compilePagePushCommands } from './pageCommands';
|
|
11
|
+
export { planContentPushExecution };
|
|
12
|
+
export type { CommandSurface, CommandSurfaceCompileResult, CommandSurfaceCompileSuccess, CommandSurfaceExecutionReport, ContentPushScope, ContentPushExecutionPlan, ContentPushExecutionReport, ContentPushExecutionStep, };
|
|
13
|
+
export type ContentPushExecutionInput = Readonly<{
|
|
14
|
+
pushScope: ContentPushScope;
|
|
15
|
+
siteId: SiteId;
|
|
23
16
|
target: EnvTarget;
|
|
24
17
|
diff: ContentDiff;
|
|
25
18
|
local: LocalContent;
|
|
26
19
|
client: ManagementClient;
|
|
27
|
-
blockFieldExtensions: Parameters<typeof
|
|
20
|
+
blockFieldExtensions: Parameters<typeof compilePagePushCommands>[0]['blockFieldExtensions'];
|
|
28
21
|
output: OutputContext;
|
|
29
22
|
onEntryCommandCount?: (commandCount: number) => void;
|
|
30
|
-
|
|
23
|
+
onFormCommandCount?: (commandCount: number) => void;
|
|
24
|
+
onNavigationCommandCount?: (commandCount: number) => void;
|
|
25
|
+
onPageCommandCount?: (commandCount: number) => void;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function executeContentPushPlan(input: ContentPushExecutionInput): Promise<SyncResult>;
|
|
28
|
+
export declare function executeContentPushPlanAsCommandReport(input: ContentPushExecutionInput, dependencies?: CommandSurfaceDispatchDependencies): Promise<ContentPushExecutionReport>;
|
|
29
|
+
export declare function contentPushExecutionReportToSyncResult(report: ContentPushExecutionReport): SyncResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LocalContent } from '../content/reader';
|
|
2
|
+
import type { ContentDiff } from '../sync';
|
|
3
|
+
import type { ContentPushScope, ContentPushExecutionPlan } from './pushExecutionTypes';
|
|
4
|
+
export declare function planContentPushExecution(input: Readonly<{
|
|
5
|
+
pushScope: ContentPushScope;
|
|
6
|
+
diff: ContentDiff;
|
|
7
|
+
local: LocalContent;
|
|
8
|
+
}>): ContentPushExecutionPlan;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { SiteCommandRef, SiteCommandType } from '@riverbankcms/site-commands';
|
|
2
|
+
import type { SyncResult, ResidualSettingsDiff, ResidualSettingsLocalContent } from '../sync';
|
|
3
|
+
import type { PushScope } from '../commands/push/consts';
|
|
4
|
+
import type { compileEntryPushCommands, EntryCommandExecutionReport } from './entryCommands';
|
|
5
|
+
import type { compileFormPushCommands, FormCommandExecutionReport } from './formCommands';
|
|
6
|
+
import type { compileNavigationPushCommands, NavigationCommandExecutionReport } from './navigationCommands';
|
|
7
|
+
import type { compilePagePushCommands, PageCommandExecutionReport } from './pageCommands';
|
|
8
|
+
export type CommandSurface = 'entry' | 'page' | 'form' | 'navigation';
|
|
9
|
+
export type CommandSurfaceFailurePolicy = 'continue' | 'stop';
|
|
10
|
+
export type ContentPushScope = Extract<PushScope, 'entries' | 'pages' | 'navigation' | 'forms' | 'all'>;
|
|
11
|
+
export type ResidualSettingsPushPlan = Readonly<{
|
|
12
|
+
diff: ResidualSettingsDiff;
|
|
13
|
+
local: ResidualSettingsLocalContent;
|
|
14
|
+
}>;
|
|
15
|
+
export type CommandSurfaceCompileResult = Readonly<{
|
|
16
|
+
surface: 'entry';
|
|
17
|
+
compileResult: ReturnType<typeof compileEntryPushCommands>;
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
surface: 'page';
|
|
20
|
+
compileResult: ReturnType<typeof compilePagePushCommands>;
|
|
21
|
+
}> | Readonly<{
|
|
22
|
+
surface: 'form';
|
|
23
|
+
compileResult: ReturnType<typeof compileFormPushCommands>;
|
|
24
|
+
}> | Readonly<{
|
|
25
|
+
surface: 'navigation';
|
|
26
|
+
compileResult: ReturnType<typeof compileNavigationPushCommands>;
|
|
27
|
+
}>;
|
|
28
|
+
export type CommandSurfaceCompileSuccess = Readonly<{
|
|
29
|
+
surface: 'entry';
|
|
30
|
+
compileValue: OkValue<ReturnType<typeof compileEntryPushCommands>>;
|
|
31
|
+
}> | Readonly<{
|
|
32
|
+
surface: 'page';
|
|
33
|
+
compileValue: OkValue<ReturnType<typeof compilePagePushCommands>>;
|
|
34
|
+
}> | Readonly<{
|
|
35
|
+
surface: 'form';
|
|
36
|
+
compileValue: OkValue<ReturnType<typeof compileFormPushCommands>>;
|
|
37
|
+
}> | Readonly<{
|
|
38
|
+
surface: 'navigation';
|
|
39
|
+
compileValue: OkValue<ReturnType<typeof compileNavigationPushCommands>>;
|
|
40
|
+
}>;
|
|
41
|
+
type OkValue<T> = T extends Readonly<{
|
|
42
|
+
ok: true;
|
|
43
|
+
value: infer TValue;
|
|
44
|
+
}> ? TValue : never;
|
|
45
|
+
export type ContentPushExecutionStep = Readonly<{
|
|
46
|
+
kind: 'residual-settings-sync';
|
|
47
|
+
residual: ResidualSettingsPushPlan;
|
|
48
|
+
onFailure: CommandSurfaceFailurePolicy;
|
|
49
|
+
}> | Readonly<{
|
|
50
|
+
kind: 'command-surface';
|
|
51
|
+
surface: CommandSurface;
|
|
52
|
+
onFailure: CommandSurfaceFailurePolicy;
|
|
53
|
+
}>;
|
|
54
|
+
export type CompiledContentPushExecutionStep = Readonly<{
|
|
55
|
+
kind: 'residual-settings-sync';
|
|
56
|
+
residual: ResidualSettingsPushPlan;
|
|
57
|
+
onFailure: CommandSurfaceFailurePolicy;
|
|
58
|
+
}> | Readonly<{
|
|
59
|
+
kind: 'command-surface';
|
|
60
|
+
surface: CommandSurfaceCompileSuccess;
|
|
61
|
+
onFailure: CommandSurfaceFailurePolicy;
|
|
62
|
+
}>;
|
|
63
|
+
export type ContentPushExecutionPlan = Readonly<{
|
|
64
|
+
kind: 'sync-steps';
|
|
65
|
+
steps: readonly ContentPushExecutionStep[];
|
|
66
|
+
}>;
|
|
67
|
+
export type CompiledContentPushExecutionPlan = Readonly<{
|
|
68
|
+
kind: 'compiled-sync-steps';
|
|
69
|
+
steps: readonly CompiledContentPushExecutionStep[];
|
|
70
|
+
}>;
|
|
71
|
+
export type CommandSurfaceExecutionReport = Readonly<{
|
|
72
|
+
surface: 'entry';
|
|
73
|
+
report: EntryCommandExecutionReport;
|
|
74
|
+
}> | Readonly<{
|
|
75
|
+
surface: 'page';
|
|
76
|
+
report: PageCommandExecutionReport;
|
|
77
|
+
}> | Readonly<{
|
|
78
|
+
surface: 'form';
|
|
79
|
+
report: FormCommandExecutionReport;
|
|
80
|
+
}> | Readonly<{
|
|
81
|
+
surface: 'navigation';
|
|
82
|
+
report: NavigationCommandExecutionReport;
|
|
83
|
+
}>;
|
|
84
|
+
export type ContentPushExecutionReport = Readonly<{
|
|
85
|
+
commandReports: readonly CommandSurfaceExecutionReport[];
|
|
86
|
+
residualSyncResults: readonly SyncResult[];
|
|
87
|
+
}>;
|
|
88
|
+
export type ReportedCommandWithSubject<TSubject> = Readonly<{
|
|
89
|
+
plannedCommand: Readonly<{
|
|
90
|
+
command: Readonly<{
|
|
91
|
+
ref: SiteCommandRef;
|
|
92
|
+
type: SiteCommandType;
|
|
93
|
+
}>;
|
|
94
|
+
}>;
|
|
95
|
+
reportSubject: TSubject;
|
|
96
|
+
}>;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LocalContent } from '../content/reader';
|
|
2
|
+
import type { ContentDiff } from '../sync';
|
|
3
|
+
import type { CommandSurface, ResidualSettingsPushPlan } from './pushExecutionTypes';
|
|
4
|
+
export declare const baselineResidualOmittedCommandSurfaces: readonly ["navigation"];
|
|
5
|
+
export declare const baselineResidualOmittedCommandSurfaceSet: ReadonlySet<CommandSurface>;
|
|
6
|
+
export declare function syncPlanResidual(input: Readonly<{
|
|
7
|
+
diff: ContentDiff;
|
|
8
|
+
local: LocalContent;
|
|
9
|
+
omitSurfaces: ReadonlySet<CommandSurface>;
|
|
10
|
+
}>): ResidualSettingsPushPlan;
|
|
11
|
+
export declare function residualSettingsPlan(input: Readonly<{
|
|
12
|
+
diff: ContentDiff;
|
|
13
|
+
local: LocalContent;
|
|
14
|
+
commandSurfaces: readonly CommandSurface[];
|
|
15
|
+
}>): ResidualSettingsPushPlan | null;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sync Executor
|
|
2
|
+
* Residual Sync Executor
|
|
3
3
|
*
|
|
4
|
-
* Applies
|
|
5
|
-
*
|
|
4
|
+
* Applies the small set of SDK CLI writes that have not yet moved onto the
|
|
5
|
+
* shared site-command IR. Command-backed surfaces fail closed here so direct
|
|
6
|
+
* writes cannot silently come back through this path.
|
|
6
7
|
*/
|
|
7
8
|
import type { ManagementClient } from '../../client/management/types';
|
|
8
|
-
import type { LocalContent
|
|
9
|
+
import type { LocalContent } from '../content/reader';
|
|
9
10
|
import type { OutputContext } from '../output';
|
|
10
|
-
import type { ContentDiff
|
|
11
|
-
import type { BlockFieldExtensionsMap } from '../../config/types';
|
|
11
|
+
import type { ContentDiff } from './diff';
|
|
12
12
|
/**
|
|
13
13
|
* Format API errors with detailed field validation info when available.
|
|
14
14
|
*/
|
|
@@ -16,8 +16,6 @@ export declare function formatApiError(error: unknown): string;
|
|
|
16
16
|
export interface SyncOptions {
|
|
17
17
|
/** If true, don't actually make changes */
|
|
18
18
|
dryRun: boolean;
|
|
19
|
-
/** Custom block field extensions from config (for validation) */
|
|
20
|
-
blockFieldExtensions?: BlockFieldExtensionsMap;
|
|
21
19
|
}
|
|
22
20
|
export interface SyncResult {
|
|
23
21
|
entries: {
|
|
@@ -66,27 +64,11 @@ export interface SyncResult {
|
|
|
66
64
|
}>;
|
|
67
65
|
warnings: string[];
|
|
68
66
|
}
|
|
67
|
+
export type ResidualSettingsDiff = Readonly<Pick<ContentDiff, 'settings' | 'summary'>>;
|
|
68
|
+
export type ResidualSettingsLocalContent = Readonly<Pick<LocalContent, 'settings'>>;
|
|
69
69
|
export declare function createEmptySyncResult(): SyncResult;
|
|
70
|
-
export interface FooterSyncResult {
|
|
71
|
-
diff: FooterDiff | null;
|
|
72
|
-
synced: boolean;
|
|
73
|
-
error?: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Sync footer content from local to CMS.
|
|
77
|
-
*
|
|
78
|
-
* Footer is synced separately from other content because:
|
|
79
|
-
* - It's a single entity (not a collection)
|
|
80
|
-
* - It requires pulling remote state first for comparison
|
|
81
|
-
*
|
|
82
|
-
* @param client - Management client
|
|
83
|
-
* @param localFooter - Local footer content from footer.json
|
|
84
|
-
* @param options - Sync options (dryRun)
|
|
85
|
-
* @returns Footer sync result with diff and status
|
|
86
|
-
*/
|
|
87
|
-
export declare function syncFooter(client: ManagementClient, localFooter: LocalFooterContent, options: SyncOptions): Promise<FooterSyncResult>;
|
|
88
70
|
/**
|
|
89
|
-
* Execute
|
|
71
|
+
* Execute the remaining settings-only sync plan.
|
|
90
72
|
*
|
|
91
73
|
* @param client - Management client
|
|
92
74
|
* @param diff - Calculated content diff
|
|
@@ -95,7 +77,7 @@ export declare function syncFooter(client: ManagementClient, localFooter: LocalF
|
|
|
95
77
|
* @param output - Output context for progress reporting
|
|
96
78
|
* @returns Sync result with counts and errors
|
|
97
79
|
*/
|
|
98
|
-
export declare function
|
|
80
|
+
export declare function executeResidualSettingsSyncPlan(client: ManagementClient, diff: ResidualSettingsDiff, local: ResidualSettingsLocalContent, options: SyncOptions, output: OutputContext): Promise<SyncResult>;
|
|
99
81
|
/**
|
|
100
82
|
* Format sync result for display.
|
|
101
83
|
*/
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
* Provides content synchronization between local files and CMS.
|
|
5
5
|
*/
|
|
6
6
|
export { calculateDiff, calculatePullDiff, hasPendingChanges, formatDiffSummary, formatDiffDetail, buildJsonDiff, type ContentDiff, type EntryDiff, type PageDiff, type BlockDiff, type NavigationDiff, type DiffType, type DiffOptions, type JsonDiff, type JsonDiffMode, type JsonDiffChange, type JsonDiffChangeType, type JsonDiffOperation, type PullJsonDiff, type PullJsonDiffChange, type FieldChange, findChangedFieldsWithValues, formatValue, formatHumanDiff, } from './diff';
|
|
7
|
-
export {
|
|
7
|
+
export { executeResidualSettingsSyncPlan, createEmptySyncResult, formatSyncResult, type SyncOptions, type SyncResult, type ResidualSettingsDiff, type ResidualSettingsLocalContent, } from './executor';
|
|
8
|
+
export { addCounters, mergeManySyncResults, mergeSyncResults, } from './syncResultAggregation';
|
|
8
9
|
export { extractMediaPaths, buildStorageUrl, downloadMedia, syncMedia, type MediaSyncResult, type MediaSyncSummary, type MediaSyncOptions, type MediaUploadClient, } from './media';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SyncResult } from './executor';
|
|
2
|
+
export declare function mergeManySyncResults(results: readonly SyncResult[]): SyncResult;
|
|
3
|
+
export declare function mergeSyncResults(first: SyncResult, second: SyncResult): SyncResult;
|
|
4
|
+
export declare function addCounters<TCounters extends Record<string, number>>(first: TCounters, second: TCounters, keys: readonly (keyof TCounters)[]): TCounters;
|