@riverbankcms/sdk 0.64.0 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/_dts/api/src/aiPlayground.d.ts +18 -11
  2. package/dist/_dts/api/src/apiEndpointTypes.d.ts +12 -0
  3. package/dist/_dts/api/src/bookingOperations.d.ts +1 -1
  4. package/dist/_dts/api/src/endpoints.d.ts +25 -0
  5. package/dist/_dts/api/src/sdkConfig/contracts.d.ts +0 -40
  6. package/dist/_dts/api/src/sdkContracts.d.ts +1 -1
  7. package/dist/_dts/api/src/siteMembers.d.ts +1 -1
  8. package/dist/_dts/api/src/siteOperations.d.ts +1 -1
  9. package/dist/_dts/billing/src/plans/types.d.ts +1 -1
  10. package/dist/_dts/blocks/src/bindings/index.d.ts +1 -1
  11. package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
  12. package/dist/_dts/blocks/src/system/transforms/registry/formatting.d.ts +1 -0
  13. package/dist/_dts/blocks/src/system/transforms/typed.d.ts +2 -1
  14. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +81 -0
  15. package/dist/_dts/preview-next/src/client/blocks/pageDesignRuntimePreview.d.ts +7 -3
  16. package/dist/_dts/preview-next/src/client/blocks/previewProjection/runtimeContentDecoration.d.ts +2 -2
  17. package/dist/_dts/sdk/src/cli/commands/push/execute/footer.d.ts +33 -0
  18. package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +2 -1
  19. package/dist/_dts/sdk/src/cli/env.d.ts +2 -1
  20. package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +2 -1
  21. package/dist/_dts/sdk/src/cli/site-commands/commandKeys.d.ts +13 -0
  22. package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +114 -0
  23. package/dist/_dts/sdk/src/cli/site-commands/entryCommands.d.ts +26 -48
  24. package/dist/_dts/sdk/src/cli/site-commands/footerCommands.d.ts +50 -0
  25. package/dist/_dts/sdk/src/cli/site-commands/formCommands.d.ts +57 -0
  26. package/dist/_dts/sdk/src/cli/site-commands/index.d.ts +5 -0
  27. package/dist/_dts/sdk/src/cli/site-commands/navigationCommands.d.ts +57 -0
  28. package/dist/_dts/sdk/src/cli/site-commands/pageCommands.d.ts +83 -0
  29. package/dist/_dts/sdk/src/cli/site-commands/pushExecution.d.ts +67 -14
  30. package/dist/_dts/sdk/src/cli/sync/executor.d.ts +10 -28
  31. package/dist/_dts/sdk/src/cli/sync/index.d.ts +1 -1
  32. package/dist/_dts/sdk/src/config/dashboard-validation.d.ts +0 -48
  33. package/dist/_dts/sdk/src/config/types.d.ts +1 -1
  34. package/dist/_dts/sdk/src/version.d.ts +1 -1
  35. package/dist/_dts/site-commands/src/adapter.d.ts +2 -2
  36. package/dist/_dts/site-commands/src/commands.d.ts +410 -13
  37. package/dist/_dts/site-commands/src/domain.d.ts +3 -3
  38. package/dist/_dts/site-commands/src/exposure.d.ts +41 -0
  39. package/dist/_dts/site-commands/src/index.d.ts +1 -0
  40. package/dist/_dts/site-commands/src/metadata.d.ts +93 -2
  41. package/dist/_dts/site-commands/src/planner.d.ts +13 -6
  42. package/dist/_dts/site-commands/src/refs.d.ts +13 -1
  43. package/dist/_dts/theme-core/src/palette/utils/index.d.ts +1 -0
  44. package/dist/_dts/theme-core/src/palette/utils/onColor.d.ts +2 -0
  45. package/dist/_dts/theme-core/src/site-styles/accessibleSurfaces.d.ts +83 -0
  46. package/dist/_dts/theme-core/src/site-styles/contentTemplateRuntimeCompiler.d.ts +2 -1
  47. package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +89 -12
  48. package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +8 -2
  49. package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -0
  50. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +3 -2
  51. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +9 -6
  52. package/dist/_dts/ui/src/callout.d.ts +1 -1
  53. package/dist/cli/index.mjs +4290 -2513
  54. package/dist/client/client.mjs +598 -372
  55. package/dist/client/hooks.mjs +311 -123
  56. package/dist/client/rendering/client.mjs +209 -68
  57. package/dist/client/rendering/islands.mjs +281 -150
  58. package/dist/client/rendering.mjs +416 -190
  59. package/dist/preview-next/before-render.mjs +61 -13
  60. package/dist/preview-next/client/runtime.mjs +930 -376
  61. package/dist/preview-next/middleware.mjs +61 -13
  62. package/dist/server/components.mjs +526 -325
  63. package/dist/server/config-validation.mjs +313 -125
  64. package/dist/server/config.mjs +313 -125
  65. package/dist/server/data.mjs +311 -123
  66. package/dist/server/index.mjs +78 -16
  67. package/dist/server/next.mjs +527 -326
  68. package/dist/server/page-converter.mjs +159 -41
  69. package/dist/server/prebuild.mjs +1 -1
  70. package/dist/server/rendering/server.mjs +526 -325
  71. package/dist/server/rendering.mjs +526 -325
  72. package/dist/server/routing.mjs +392 -131
  73. package/dist/server/server.mjs +312 -124
  74. package/dist/server/theme-bridge.mjs +155 -48
  75. package/package.json +1 -1
  76. package/dist/_dts/path-utils/src/index.d.ts +0 -8
  77. package/dist/_dts/path-utils/src/redirectPaths.d.ts +0 -26
  78. package/dist/_dts/path-utils/src/safeAppPath.d.ts +0 -26
@@ -1,3 +1,4 @@
1
+ import { type SiteId } from '@riverbankcms/core';
1
2
  import type { ManagementClient } from '../../client/management/types';
2
3
  import type { LocalEntry } from '../content/reader';
3
4
  import type { EnvTarget } from '../helpers';
@@ -10,7 +11,7 @@ export declare function planAndReportRemoteEntryMerge(input: Readonly<{
10
11
  client: Pick<ManagementClient, 'entries' | 'pull'>;
11
12
  contentDir: string;
12
13
  target: EnvTarget;
13
- siteId: string;
14
+ siteId: SiteId;
14
15
  contentType?: string;
15
16
  identifier?: string;
16
17
  localEntries: ReadonlyMap<string, readonly LocalEntry[]>;
@@ -0,0 +1,13 @@
1
+ import type { Brand } from '@riverbankcms/core';
2
+ export type CliContentTypeKey = Brand<string, 'SdkCliContentTypeKey'>;
3
+ export type CliEntryIdentifier = Brand<string, 'SdkCliEntryIdentifier'>;
4
+ export type CliPageIdentifier = Brand<string, 'SdkCliPageIdentifier'>;
5
+ export type CliBlockIdentifier = Brand<string, 'SdkCliBlockIdentifier'>;
6
+ export type CliFormSlug = Brand<string, 'SdkCliFormSlug'>;
7
+ export type CliNavigationMenuName = Brand<string, 'SdkCliNavigationMenuName'>;
8
+ export declare const asCliContentTypeKey: (value: string) => CliContentTypeKey;
9
+ export declare const asCliEntryIdentifier: (value: string) => CliEntryIdentifier;
10
+ export declare const asCliPageIdentifier: (value: string) => CliPageIdentifier;
11
+ export declare const asCliBlockIdentifier: (value: string) => CliBlockIdentifier;
12
+ export declare const asCliFormSlug: (value: string) => CliFormSlug;
13
+ export declare const asCliNavigationMenuName: (value: string) => CliNavigationMenuName;
@@ -0,0 +1,114 @@
1
+ import { type Result, type SiteId } from '@riverbankcms/core';
2
+ import { type DryRunReport, type SiteCommandBatch, type SiteCommandExecutionSuccess, type SiteCommandOf, type SiteCommandPlanFor, type SiteCommandRef, type SiteCommandType, type SiteCommandValidationError } from '@riverbankcms/site-commands';
3
+ import type { EnvTarget } from '../helpers';
4
+ import { type SyncResult } from '../sync';
5
+ export type CliCommandBatchRefInput<TSource extends string = string> = Readonly<{
6
+ source: TSource;
7
+ siteId: SiteId;
8
+ targetEnv: EnvTarget;
9
+ }>;
10
+ export type CliCommandExecutionError<TCommandType extends SiteCommandType> = Readonly<{
11
+ code: 'management_api_failed';
12
+ commandRef: SiteCommandRef;
13
+ commandType: TCommandType;
14
+ message: string;
15
+ }>;
16
+ export type CliCommandExecutionResult<TCommandType extends SiteCommandType> = Readonly<{
17
+ status: 'applied';
18
+ applied: readonly SiteCommandExecutionSuccess[];
19
+ }> | Readonly<{
20
+ status: 'failed';
21
+ applied: readonly SiteCommandExecutionSuccess[];
22
+ failed: CliCommandExecutionError<TCommandType>;
23
+ }>;
24
+ export type PlannedCliCommand<TCommand extends Readonly<{
25
+ ref: SiteCommandRef;
26
+ type: SiteCommandType;
27
+ }>> = Readonly<{
28
+ command: TCommand;
29
+ }>;
30
+ export type CliCommandReportBinding<TCommand extends Readonly<{
31
+ ref: SiteCommandRef;
32
+ type: SiteCommandType;
33
+ }>, TSubject> = Readonly<{
34
+ command: TCommand;
35
+ reportSubject: TSubject;
36
+ }>;
37
+ export type CliCommandReportedPlannedCommand<TCommand extends Readonly<{
38
+ ref: SiteCommandRef;
39
+ type: SiteCommandType;
40
+ }>, TSubject> = Readonly<{
41
+ plannedCommand: PlannedCliCommand<TCommand>;
42
+ reportSubject: TSubject;
43
+ }>;
44
+ export type CliCommandExecutionReportFailure<TSubject> = Readonly<{
45
+ identifier: string;
46
+ message: string;
47
+ subject?: TSubject;
48
+ }>;
49
+ export type CliCommandExecutionReport<TSubject> = Readonly<{
50
+ appliedSubjects: readonly TSubject[];
51
+ failure: CliCommandExecutionReportFailure<TSubject> | null;
52
+ warnings: readonly string[];
53
+ }>;
54
+ export type CliCommandValidationCompileError = Readonly<{
55
+ code: 'command_validation_failed';
56
+ errors: readonly SiteCommandValidationError[];
57
+ message: string;
58
+ }>;
59
+ export type CliCommandCompileBatchSuccess<TCommandType extends SiteCommandType> = Readonly<{
60
+ batch: SiteCommandBatch;
61
+ plan: SiteCommandPlanFor<TCommandType>;
62
+ dryRunReport: DryRunReport;
63
+ }>;
64
+ export type CliCommandCompileBatchSuccessWithReports<TCommandType extends SiteCommandType, TSubject> = Readonly<{
65
+ reportedCommands: readonly CliCommandReportedPlannedCommand<SiteCommandOf<TCommandType>, TSubject>[];
66
+ }> & CliCommandCompileBatchSuccess<TCommandType>;
67
+ export declare function createCliCommandBatchRef(input: CliCommandBatchRefInput): string;
68
+ export declare function formatSiteCommandValidationErrors(errors: readonly {
69
+ message: string;
70
+ }[]): string;
71
+ export declare function formatManagementError(error: unknown): string;
72
+ export declare function planCliCommandBatchForTypes<TCommandType extends SiteCommandType>(input: CliCommandBatchRefInput & Readonly<{
73
+ commands: readonly SiteCommandOf<TCommandType>[];
74
+ commandTypes: readonly TCommandType[];
75
+ }>): Result<CliCommandCompileBatchSuccess<TCommandType>, CliCommandValidationCompileError>;
76
+ export declare function planCliCommandBatchForBindings<TCommandType extends SiteCommandType, TSubject>(input: CliCommandBatchRefInput & Readonly<{
77
+ commandBindings: readonly CliCommandReportBinding<SiteCommandOf<TCommandType>, TSubject>[];
78
+ commandTypes: readonly TCommandType[];
79
+ }>): Result<CliCommandCompileBatchSuccessWithReports<TCommandType, TSubject>, CliCommandValidationCompileError>;
80
+ export declare function executeCliCommandPlan<TCommand extends Readonly<{
81
+ ref: SiteCommandRef;
82
+ type: TCommandType;
83
+ }>, TCommandType extends SiteCommandType>(input: Readonly<{
84
+ commands: readonly PlannedCliCommand<TCommand>[];
85
+ applyCommand: (command: TCommand) => Promise<void>;
86
+ }>): Promise<CliCommandExecutionResult<TCommandType>>;
87
+ export declare function commandExecutionToReport<TCommand extends Readonly<{
88
+ ref: SiteCommandRef;
89
+ type: TCommandType;
90
+ }>, TCommandType extends SiteCommandType, TSubject>(input: Readonly<{
91
+ execution: CliCommandExecutionResult<TCommandType>;
92
+ reportedCommands: readonly CliCommandReportedPlannedCommand<TCommand, TSubject>[];
93
+ resourceLabel: string;
94
+ commandDisplayIdentifier: (command: TCommand) => string;
95
+ includeFailureSubject?: boolean;
96
+ }>): CliCommandExecutionReport<TSubject>;
97
+ export declare function commandReportToSyncResult<TSubject>(input: Readonly<{
98
+ report: CliCommandExecutionReport<TSubject>;
99
+ incrementSuccess: (result: SyncResult, subject: TSubject) => void;
100
+ recordFailure: (result: SyncResult, identifier: string, message: string, subject: TSubject | undefined) => void;
101
+ }>): SyncResult;
102
+ export declare function executeCompiledCliCommandPlanAsSyncResult<TCompiledPlan extends Readonly<{
103
+ plan: Readonly<{
104
+ commands: readonly unknown[];
105
+ }>;
106
+ }>, TExecutionResult>(input: Readonly<{
107
+ compiledPlan: TCompiledPlan;
108
+ onBeforeExecute?: (commandCount: number) => void;
109
+ executePlan: (plan: TCompiledPlan['plan']) => Promise<TExecutionResult>;
110
+ executionToSyncResult: (input: Readonly<{
111
+ execution: TExecutionResult;
112
+ compiledPlan: TCompiledPlan;
113
+ }>) => SyncResult;
114
+ }>): Promise<SyncResult>;
@@ -1,76 +1,49 @@
1
- import { type Result } from '@riverbankcms/core';
2
- import { type AllowedRuntime, type DryRunReport, type PlannedSiteCommandFor, type SiteCommandBatch, type SiteCommandExecutionSuccess, type SiteCommandOf, type SiteCommandPlan, type SiteCommandRef, type SiteCommandValidationError } from '@riverbankcms/site-commands';
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
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: string;
12
- identifier: string;
13
+ contentType: CliContentTypeKey;
14
+ identifier: CliEntryIdentifier;
13
15
  message: string;
14
- }> | Readonly<{
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: string;
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 = Readonly<{
27
- batch: SiteCommandBatch;
28
- plan: EntrySiteCommandPlan;
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
- plan: EntrySiteCommandPlan;
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 PlannedEntrySiteCommand = {
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 EntryCommandLegacyCounter = 'created' | 'updated' | 'deleted' | 'published' | 'unpublished';
36
+ export type EntryCommandSyncCounter = 'created' | 'updated' | 'deleted' | 'published' | 'unpublished';
62
37
  export type EntryCommandReportSubject = Readonly<{
63
- commandRef: SiteCommandRef;
64
- contentType: string;
65
- identifier: string;
66
- counter: EntryCommandLegacyCounter;
38
+ contentType: CliContentTypeKey;
39
+ identifier: CliEntryIdentifier;
40
+ counter: EntryCommandSyncCounter;
67
41
  }>;
68
- export type EntryCommandReportSubjectsByRef = ReadonlyMap<SiteCommandRef, EntryCommandReportSubject>;
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'>;
@@ -79,7 +52,12 @@ export declare function executeEntryCommandPlanAsSyncResult(input: CliEntryComma
79
52
  export declare function syncResultForEntryCommandCompileError(error: CliCommandCompileError): SyncResult;
80
53
  export declare function entryCommandExecutionToSyncResult(input: Readonly<{
81
54
  execution: CliEntryCommandExecutionResult;
82
- plan: Pick<EntrySiteCommandPlan, 'commands'>;
83
- reportSubjectsByCommandRef: EntryCommandReportSubjectsByRef;
55
+ compiledPlan: EntryCommandCompiledPlan;
84
56
  }>): SyncResult;
57
+ export declare function entryCommandExecutionToReport(input: Readonly<{
58
+ execution: CliEntryCommandExecutionResult;
59
+ compiledPlan: EntryCommandCompiledPlan;
60
+ }>): EntryCommandExecutionReport;
61
+ export declare function entryCommandReportToSyncResult(report: EntryCommandExecutionReport): SyncResult;
85
62
  export declare function titleFromEntryData(data: Record<string, unknown>): string | undefined;
63
+ export {};
@@ -0,0 +1,50 @@
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 syncResultForFooterCommandCompileError(error: CliFooterCommandCompileError): SyncResult;
41
+ export declare function footerCommandExecutionToSyncResult(input: Readonly<{
42
+ execution: CliFooterCommandExecutionResult;
43
+ compiledPlan: FooterCommandCompiledPlan;
44
+ }>): SyncResult;
45
+ export declare function footerCommandExecutionToReport(input: Readonly<{
46
+ execution: CliFooterCommandExecutionResult;
47
+ compiledPlan: FooterCommandCompiledPlan;
48
+ }>): FooterCommandExecutionReport;
49
+ export declare function footerCommandReportToSyncResult(report: FooterCommandExecutionReport): SyncResult;
50
+ export {};
@@ -0,0 +1,57 @@
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 executeFormCommandPlanAsSyncResult(input: Readonly<{
43
+ client: Pick<ManagementClient, 'forms'>;
44
+ compiledPlan: FormCommandCompiledPlan;
45
+ onBeforeExecute?: (commandCount: number) => void;
46
+ }>): Promise<SyncResult>;
47
+ export declare function syncResultForFormCommandCompileError(error: CliFormCommandCompileError): SyncResult;
48
+ export declare function formCommandExecutionToSyncResult(input: Readonly<{
49
+ execution: CliFormCommandExecutionResult;
50
+ compiledPlan: FormCommandCompiledPlan;
51
+ }>): SyncResult;
52
+ export declare function formCommandExecutionToReport(input: Readonly<{
53
+ execution: CliFormCommandExecutionResult;
54
+ compiledPlan: FormCommandCompiledPlan;
55
+ }>): FormCommandExecutionReport;
56
+ export declare function formCommandReportToSyncResult(report: FormCommandExecutionReport): SyncResult;
57
+ export {};
@@ -1,2 +1,7 @@
1
+ export * from './commandRuntime';
1
2
  export * from './entryCommands';
3
+ export * from './formCommands';
4
+ export * from './footerCommands';
5
+ export * from './navigationCommands';
6
+ export * from './pageCommands';
2
7
  export * from './pushExecution';
@@ -0,0 +1,57 @@
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 executeNavigationCommandPlanAsSyncResult(input: Readonly<{
43
+ client: Pick<ManagementClient, 'navigation'>;
44
+ compiledPlan: NavigationCommandCompiledPlan;
45
+ onBeforeExecute?: (commandCount: number) => void;
46
+ }>): Promise<SyncResult>;
47
+ export declare function syncResultForNavigationCommandCompileError(error: CliNavigationCommandCompileError): SyncResult;
48
+ export declare function navigationCommandExecutionToSyncResult(input: Readonly<{
49
+ execution: CliNavigationCommandExecutionResult;
50
+ compiledPlan: NavigationCommandCompiledPlan;
51
+ }>): SyncResult;
52
+ export declare function navigationCommandExecutionToReport(input: Readonly<{
53
+ execution: CliNavigationCommandExecutionResult;
54
+ compiledPlan: NavigationCommandCompiledPlan;
55
+ }>): NavigationCommandExecutionReport;
56
+ export declare function navigationCommandReportToSyncResult(report: NavigationCommandExecutionReport): SyncResult;
57
+ export {};
@@ -0,0 +1,83 @@
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 executePageCommandPlanAsSyncResult(input: Readonly<{
69
+ client: Pick<ManagementClient, 'pages' | 'blocks'>;
70
+ compiledPlan: PageCommandCompiledPlan;
71
+ onBeforeExecute?: (commandCount: number) => void;
72
+ }>): Promise<SyncResult>;
73
+ export declare function syncResultForPageCommandCompileError(error: CliPageCommandCompileError): SyncResult;
74
+ export declare function pageCommandExecutionToSyncResult(input: Readonly<{
75
+ execution: CliPageCommandExecutionResult;
76
+ compiledPlan: PageCommandCompiledPlan;
77
+ }>): SyncResult;
78
+ export declare function pageCommandExecutionToReport(input: Readonly<{
79
+ execution: CliPageCommandExecutionResult;
80
+ compiledPlan: PageCommandCompiledPlan;
81
+ }>): PageCommandExecutionReport;
82
+ export declare function pageCommandReportToSyncResult(report: PageCommandExecutionReport): SyncResult;
83
+ export {};
@@ -1,30 +1,83 @@
1
+ import { type Result, type SiteId } from '@riverbankcms/core';
1
2
  import { compileEntryPushCommands } from './entryCommands';
3
+ import { compileFormPushCommands } from './formCommands';
4
+ import { compileNavigationPushCommands } from './navigationCommands';
5
+ import { compilePagePushCommands } from './pageCommands';
2
6
  import type { ManagementClient } from '../../client/management/types';
7
+ import type { PushScope } from '../commands/push/consts';
3
8
  import type { LocalContent } from '../content/reader';
4
9
  import type { EnvTarget } from '../helpers';
5
10
  import type { OutputContext } from '../output';
6
- import { executeSyncPlan, type ContentDiff, type SyncResult } from '../sync';
7
- export type PushContentExecutionMode = Readonly<{
8
- kind: 'entry-command';
11
+ import { type ContentDiff, type ResidualSettingsDiff, type ResidualSettingsLocalContent, type SyncResult } from '../sync';
12
+ export type CommandSurface = 'entry' | 'page' | 'form' | 'navigation';
13
+ type ResidualSettingsPushPlan = Readonly<{
14
+ diff: ResidualSettingsDiff;
15
+ local: ResidualSettingsLocalContent;
16
+ }>;
17
+ type CommandSurfaceFailurePolicy = 'continue' | 'stop';
18
+ export type CommandSurfaceCompileResult = Readonly<{
19
+ surface: 'entry';
9
20
  compileResult: ReturnType<typeof compileEntryPushCommands>;
10
21
  }> | Readonly<{
11
- kind: 'legacy-sync';
22
+ surface: 'page';
23
+ compileResult: ReturnType<typeof compilePagePushCommands>;
24
+ }> | Readonly<{
25
+ surface: 'form';
26
+ compileResult: ReturnType<typeof compileFormPushCommands>;
27
+ }> | Readonly<{
28
+ surface: 'navigation';
29
+ compileResult: ReturnType<typeof compileNavigationPushCommands>;
30
+ }>;
31
+ export type CommandSurfaceCompileSuccess = Readonly<{
32
+ surface: 'entry';
33
+ compileValue: OkValue<ReturnType<typeof compileEntryPushCommands>>;
34
+ }> | Readonly<{
35
+ surface: 'page';
36
+ compileValue: OkValue<ReturnType<typeof compilePagePushCommands>>;
37
+ }> | Readonly<{
38
+ surface: 'form';
39
+ compileValue: OkValue<ReturnType<typeof compileFormPushCommands>>;
40
+ }> | Readonly<{
41
+ surface: 'navigation';
42
+ compileValue: OkValue<ReturnType<typeof compileNavigationPushCommands>>;
43
+ }>;
44
+ type OkValue<T> = T extends Readonly<{
45
+ ok: true;
46
+ value: infer TValue;
47
+ }> ? TValue : never;
48
+ export type ContentPushExecutionStep = Readonly<{
49
+ kind: 'residual-settings-sync';
50
+ residual: ResidualSettingsPushPlan;
51
+ onFailure: CommandSurfaceFailurePolicy;
52
+ }> | Readonly<{
53
+ kind: 'command-surface';
54
+ surface: CommandSurfaceCompileSuccess;
55
+ onFailure: CommandSurfaceFailurePolicy;
56
+ }>;
57
+ export type ContentPushExecutionPlan = Readonly<{
58
+ kind: 'sync-steps';
59
+ steps: readonly ContentPushExecutionStep[];
12
60
  }>;
13
- export declare function pushContentExecutionMode(input: Readonly<{
14
- pushScope: string;
15
- siteId: string;
16
- target: EnvTarget;
17
- diff: ContentDiff;
18
- local: LocalContent;
19
- }>): PushContentExecutionMode;
20
61
  export declare function executeContentPushPlan(input: Readonly<{
21
- pushScope: string;
22
- siteId: string;
62
+ pushScope: PushScope;
63
+ siteId: SiteId;
23
64
  target: EnvTarget;
24
65
  diff: ContentDiff;
25
66
  local: LocalContent;
26
67
  client: ManagementClient;
27
- blockFieldExtensions: Parameters<typeof executeSyncPlan>[3]['blockFieldExtensions'];
68
+ blockFieldExtensions: Parameters<typeof compilePagePushCommands>[0]['blockFieldExtensions'];
28
69
  output: OutputContext;
29
70
  onEntryCommandCount?: (commandCount: number) => void;
71
+ onFormCommandCount?: (commandCount: number) => void;
72
+ onNavigationCommandCount?: (commandCount: number) => void;
73
+ onPageCommandCount?: (commandCount: number) => void;
30
74
  }>): Promise<SyncResult>;
75
+ export declare function planContentPushExecution(input: Readonly<{
76
+ pushScope: PushScope;
77
+ siteId: SiteId;
78
+ target: EnvTarget;
79
+ diff: ContentDiff;
80
+ local: LocalContent;
81
+ blockFieldExtensions?: Parameters<typeof compilePagePushCommands>[0]['blockFieldExtensions'];
82
+ }>): Result<ContentPushExecutionPlan, SyncResult>;
83
+ export {};