@v-office/website-sdk 1.2.0 → 2.0.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 (46) hide show
  1. package/README.md +91 -232
  2. package/dist/cli.mjs +102 -83
  3. package/dist/client-BSUd3vuc.mjs +5111 -0
  4. package/dist/index.d.mts +2463 -11751
  5. package/dist/index.mjs +16 -4
  6. package/dist/instructions/CHANGELOG.md +9 -0
  7. package/dist/instructions/MIGRATION.md +9 -0
  8. package/dist/instructions/README.md +62 -0
  9. package/dist/instructions/availability.md +157 -0
  10. package/dist/instructions/booking.md +165 -0
  11. package/dist/instructions/contact.md +92 -0
  12. package/dist/instructions/creation.md +223 -0
  13. package/dist/instructions/filter.md +156 -0
  14. package/dist/instructions/quote.md +318 -0
  15. package/dist/instructions/rentals.md +152 -0
  16. package/dist/instructions/search.md +233 -0
  17. package/dist/instructions/versions/2.0.0/CHANGELOG.md +69 -0
  18. package/dist/instructions/versions/2.0.0/MIGRATION.md +223 -0
  19. package/dist/{quote-Bo-gBDkQ.mjs → quote-1uEIO44v.mjs} +15 -16
  20. package/dist/{rentals-Ba6ZO6bX.mjs → rentals-Quwc78o2.mjs} +22 -138
  21. package/dist/{search-BofxXqF0.mjs → search-GRQeXDvo.mjs} +43 -24
  22. package/dist/to-rental-highlights-FNZBR4aD.mjs +5905 -0
  23. package/instructions/CHANGELOG.md +9 -0
  24. package/instructions/MIGRATION.md +9 -0
  25. package/instructions/README.md +62 -0
  26. package/instructions/availability.md +157 -0
  27. package/instructions/booking.md +165 -0
  28. package/instructions/contact.md +92 -0
  29. package/instructions/creation.md +223 -0
  30. package/instructions/filter.md +156 -0
  31. package/instructions/quote.md +318 -0
  32. package/instructions/rentals.md +152 -0
  33. package/instructions/search.md +233 -0
  34. package/instructions/versions/2.0.0/CHANGELOG.md +69 -0
  35. package/instructions/versions/2.0.0/MIGRATION.md +223 -0
  36. package/package.json +41 -56
  37. package/dist/client-DYP0Y59i.mjs +0 -33236
  38. package/dist/custom-attribute-D5Kb1YHA.mjs +0 -54
  39. package/dist/errors-2cuUGSvi.mjs +0 -5
  40. package/dist/operations-B4IgNB3E.mjs +0 -12618
  41. package/dist/operations-Bxhb0jmN.mjs +0 -1085
  42. package/dist/quote-BKcAIFuH.mjs +0 -513
  43. package/dist/quote-CRjV_lf-.mjs +0 -609
  44. package/dist/rentals-DBTPlC6X.mjs +0 -323
  45. package/dist/search-filter-metadata-DZP0-Udc.mjs +0 -4294
  46. package/dist/to-rental-highlights-BShYK50C.mjs +0 -402
package/dist/cli.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { n as defineCMSSDKOptions, t as createCMSSDKFromParsedConfig } from "./client-DYP0Y59i.mjs";
2
+ import { Nt as defineWebsiteSDKOptions, t as createWebsiteSDK } from "./client-BSUd3vuc.mjs";
3
3
  import { Console, Effect, FileSystem, Layer, Option, Path, Stdio, Terminal } from "effect";
4
4
  import { Command, Flag } from "effect/unstable/cli";
5
5
  import { inspect } from "node:util";
6
6
  import { ChildProcessSpawner } from "effect/unstable/process";
7
- import { access } from "node:fs/promises";
7
+ import { access, stat } from "node:fs/promises";
8
8
  //#region src/cli/output.ts
9
9
  const toJson = (value) => JSON.stringify(value, (_key, item) => typeof item === "bigint" ? item.toString() : item, 2);
10
10
  const printOutput = (root, value) => {
@@ -23,10 +23,10 @@ const backendFlag = Flag.choice("backend", ["v9", "v10"]).pipe(Flag.withDescript
23
23
  const localeFlag = Flag.choice("locale", ["de-DE", "en-US"]).pipe(Flag.withDescription("Locale used for localized SDK calls."), Flag.withDefault("de-DE"));
24
24
  const inputFileFlag = Flag.file("input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON input file."));
25
25
  const confirmFlag = Flag.boolean("yes").pipe(Flag.withDescription("Confirm execution of commands that submit or mutate backend state."));
26
- const cmsSdkCommand = Command.make("cms-sdk").pipe(Command.withDescription("Run @v-office/cms-sdk operations from the command line."), Command.withSharedFlags({
26
+ const websiteSdkCommand = Command.make("website-sdk").pipe(Command.withDescription("Run @v-office/website-sdk operations from the command line."), Command.withSharedFlags({
27
27
  backend: backendFlag,
28
- config: Flag.file("config", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON ParsedCMSConfig file. Defaults to environment variables.")),
29
- options: Flag.file("options", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON CMSOptions file passed through defineCMSSDKOptions.")),
28
+ config: Flag.file("config", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON WebsiteSDKConfig file. Defaults to environment variables.")),
29
+ options: Flag.file("options", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON WebsiteSDKOptions file.")),
30
30
  output: Flag.choice("output", ["json", "pretty"]).pipe(Flag.withDescription("Output format."), Flag.withDefault("json"))
31
31
  }));
32
32
  //#endregion
@@ -54,24 +54,14 @@ const readJsonFile = (path, label) => Effect.tryPromise({
54
54
  //#endregion
55
55
  //#region src/cli/config.ts
56
56
  const getRequiredEnv = (name) => Effect.sync(() => process.env[name]).pipe(Effect.flatMap((value) => value === void 0 || value.length === 0 ? Effect.fail(new CLICheckFailed(`Missing required environment variable ${name}.`)) : Effect.succeed(value)));
57
- const readOptions = (root, fallback) => Option.isSome(root.options) ? readJsonFile(root.options.value, "CMS options").pipe(Effect.map(defineCMSSDKOptions)) : Effect.succeed(fallback);
58
- const withOptions = (config, options) => {
59
- if (options === void 0) return config;
60
- switch (config.backend) {
61
- case "v9": return {
62
- ...config,
63
- options
64
- };
65
- case "v10": return {
66
- ...config,
67
- options
68
- };
69
- }
70
- };
71
- const fromConfigFile = (root) => Option.isSome(root.config) ? readJsonFile(root.config.value, "CMS config").pipe(Effect.flatMap((config) => config.backend !== root.backend ? Effect.fail(new CLICheckFailed(`Config file backend "${config.backend}" does not match --backend ${root.backend}.`)) : readOptions(root, config.options).pipe(Effect.map((options) => ({
72
- config: withOptions(config, options),
73
- options
74
- }))))) : fromEnvironment(root);
57
+ const readOptions = (root, fallback) => Option.isSome(root.options) ? readJsonFile(root.options.value, "Website SDK options").pipe(Effect.map(defineWebsiteSDKOptions)) : Effect.succeed(fallback);
58
+ const fromConfigFile = (root) => Option.isSome(root.config) ? readJsonFile(root.config.value, "Website SDK config").pipe(Effect.flatMap((config) => {
59
+ const configBackend = config.backend ?? "v10";
60
+ return configBackend !== root.backend ? Effect.fail(new CLICheckFailed(`Config file backend "${configBackend}" does not match --backend ${root.backend}.`)) : readOptions(root, void 0).pipe(Effect.map((options) => ({
61
+ config,
62
+ options
63
+ })));
64
+ })) : fromEnvironment(root);
75
65
  const fromEnvironment = (root) => Effect.gen(function* () {
76
66
  const options = yield* readOptions(root, void 0);
77
67
  if (root.backend === "v9") {
@@ -79,14 +69,11 @@ const fromEnvironment = (root) => Effect.gen(function* () {
79
69
  return {
80
70
  config: {
81
71
  backend: "v9",
82
- v9: {
83
- graphqlUrl: yield* getRequiredEnv("HUB_GRAPHQL_URL"),
84
- v1ApiBaseUrl: yield* getRequiredEnv("HUB_V1_API_BASE_URL"),
85
- ...v0ApiBaseUrl === void 0 || v0ApiBaseUrl.length === 0 ? {} : { v0ApiBaseUrl },
86
- apiKey: yield* getRequiredEnv("HUB_API_KEY"),
87
- imageProxyBaseUrl: yield* getRequiredEnv("IMAGE_PROXY_BASE_URL")
88
- },
89
- ...options === void 0 ? {} : { options }
72
+ graphqlUrl: yield* getRequiredEnv("HUB_GRAPHQL_URL"),
73
+ apiKey: yield* getRequiredEnv("HUB_API_KEY"),
74
+ imageProxyBaseUrl: yield* getRequiredEnv("IMAGE_PROXY_BASE_URL"),
75
+ v1ApiBaseUrl: yield* getRequiredEnv("HUB_V1_API_BASE_URL"),
76
+ ...v0ApiBaseUrl === void 0 || v0ApiBaseUrl.length === 0 ? {} : { v0ApiBaseUrl }
90
77
  },
91
78
  options
92
79
  };
@@ -94,12 +81,9 @@ const fromEnvironment = (root) => Effect.gen(function* () {
94
81
  return {
95
82
  config: {
96
83
  backend: "v10",
97
- v10: {
98
- apiEndpoint: yield* getRequiredEnv("VOFFICE_API_ENDPOINT"),
99
- accessToken: yield* getRequiredEnv("VOFFICE_LOCAL_DEV_ACCESS_TOKEN"),
100
- imageBaseUrl: yield* getRequiredEnv("VOFFICE_IMAGE_BASE_URL")
101
- },
102
- ...options === void 0 ? {} : { options }
84
+ apiEndpoint: yield* getRequiredEnv("VOFFICE_API_ENDPOINT"),
85
+ accessToken: yield* getRequiredEnv("VOFFICE_LOCAL_DEV_ACCESS_TOKEN"),
86
+ imageBaseUrl: yield* getRequiredEnv("VOFFICE_IMAGE_BASE_URL")
103
87
  },
104
88
  options
105
89
  };
@@ -109,37 +93,25 @@ const redactValue = (value) => {
109
93
  return value.length <= 4 ? "****" : `${value.slice(0, 2)}****${value.slice(-2)}`;
110
94
  };
111
95
  const redactConfig = (config) => {
112
- switch (config.backend) {
113
- case "v9": return {
114
- ...config,
115
- v9: {
116
- ...config.v9,
117
- apiKey: redactValue(config.v9.apiKey) ?? ""
118
- }
119
- };
120
- case "v10": return {
121
- ...config,
122
- v10: {
123
- ...config.v10,
124
- accessToken: redactValue(config.v10.accessToken) ?? ""
125
- }
126
- };
127
- }
96
+ if (config.backend === "v9") return {
97
+ ...config,
98
+ apiKey: redactValue(config.apiKey) ?? ""
99
+ };
100
+ return {
101
+ ...config,
102
+ accessToken: redactValue(config.accessToken) ?? ""
103
+ };
128
104
  };
129
105
  const loadCLIConfig = fromConfigFile;
130
106
  //#endregion
131
107
  //#region src/cli/sdk.ts
132
108
  const withSDK = (root, run) => Effect.gen(function* () {
133
- const { config } = yield* loadCLIConfig(root);
109
+ const { config, options } = yield* loadCLIConfig(root);
134
110
  return yield* Effect.tryPromise({
135
- try: async () => {
136
- const sdk = createCMSSDKFromParsedConfig(config);
137
- try {
138
- return await run(sdk);
139
- } finally {
140
- await sdk.dispose();
141
- }
142
- },
111
+ try: () => run(createWebsiteSDK({
112
+ config,
113
+ ...options === void 0 ? {} : { options }
114
+ })),
143
115
  catch: (cause) => toCLIError("SDK operation failed", cause)
144
116
  });
145
117
  });
@@ -153,8 +125,8 @@ const initial = Command.make("initial", {
153
125
  rentalId: rentalIdFlag,
154
126
  calculateFromDate: calculateFromDateFlag,
155
127
  calculateThroughDate: calculateThroughDateFlag
156
- }, (input) => cmsSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.live.availability.getInitialAvailability(input)).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch initial availability for a rental."), Command.withExamples([{
157
- command: "cms-sdk --backend v10 availability initial --rental-id 123 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01",
128
+ }, (input) => websiteSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.live.availability.getInitialAvailability(input)).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch initial availability for a rental."), Command.withExamples([{
129
+ command: "website-sdk --backend v10 availability initial --rental-id 123 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01",
158
130
  description: "Fetch an initial availability calendar."
159
131
  }]));
160
132
  const startDateSelected = Command.make("start-date-selected", {
@@ -163,15 +135,15 @@ const startDateSelected = Command.make("start-date-selected", {
163
135
  selectedStartDate: Flag.string("selected-start-date").pipe(Flag.withDescription("Selected start date, formatted as YYYY-MM-DD.")),
164
136
  calculateFromDate: calculateFromDateFlag,
165
137
  calculateThroughDate: calculateThroughDateFlag
166
- }, (input) => cmsSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.live.availability.getStartDateSelectedAvailability(input)).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch availability after selecting a start date."), Command.withExamples([{
167
- command: "cms-sdk --backend v9 availability start-date-selected --rental-id 123 --selected-start-date 2026-07-08 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01",
138
+ }, (input) => websiteSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.live.availability.getStartDateSelectedAvailability(input)).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch availability after selecting a start date."), Command.withExamples([{
139
+ command: "website-sdk --backend v9 availability start-date-selected --rental-id 123 --selected-start-date 2026-07-08 --calculate-from-date 2026-07-01 --calculate-through-date 2026-08-01",
168
140
  description: "Fetch available end dates for a selected start date."
169
141
  }]));
170
142
  const availabilityCommand = Command.make("availability").pipe(Command.withDescription("Run live availability operations."), Command.withSubcommands([initial, startDateSelected]));
171
143
  //#endregion
172
144
  //#region src/cli/commands/config.ts
173
145
  const show = Command.make("show", {}, Effect.fn(function* () {
174
- const root = yield* cmsSdkCommand;
146
+ const root = yield* websiteSdkCommand;
175
147
  const resolved = yield* loadCLIConfig(root);
176
148
  yield* printOutput(root, {
177
149
  ...resolved,
@@ -179,7 +151,7 @@ const show = Command.make("show", {}, Effect.fn(function* () {
179
151
  });
180
152
  })).pipe(Command.withDescription("Show the resolved CLI config with secrets redacted."));
181
153
  const env = Command.make("env", {}, Effect.fn(function* () {
182
- const root = yield* cmsSdkCommand;
154
+ const root = yield* websiteSdkCommand;
183
155
  yield* printOutput(root, {
184
156
  backend: root.backend,
185
157
  required: root.backend === "v9" ? [
@@ -201,30 +173,56 @@ const configCommand = Command.make("config").pipe(Command.withDescription("Inspe
201
173
  const requireConfirmation = (root, confirmed, commandName) => confirmed ? Effect.void : Effect.fail(/* @__PURE__ */ new Error(`${commandName} can submit data to the configured backend. Re-run with --yes to confirm.`));
202
174
  //#endregion
203
175
  //#region src/cli/commands/live.ts
204
- const quote = Command.make("quote", { input: inputFileFlag }, ({ input }) => cmsSdkCommand.pipe(Effect.flatMap((root) => readJsonFile(input, "quote input").pipe(Effect.flatMap((quoteInput) => withSDK(root, (sdk) => sdk.live.quote.quote(quoteInput))), Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Create a live guest quote from a JSON GuestQuoteInput file."), Command.withExamples([{
205
- command: "cms-sdk --backend v10 quote --input ./quote-input.json",
176
+ const quoteInputFileFlag = Flag.file("quote-input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON QuoteQuoteInput file."));
177
+ const contactInputFileFlag = Flag.file("contact-input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON BookingContact file."));
178
+ const relativeRedirectUrlFlag = Flag.string("relative-redirect-url").pipe(Flag.withDescription("Redirect URL passed to booking payment initialization."));
179
+ const quote = Command.make("quote", { input: inputFileFlag }, ({ input }) => websiteSdkCommand.pipe(Effect.flatMap((root) => readJsonFile(input, "quote input").pipe(Effect.flatMap((quoteInput) => withSDK(root, (sdk) => sdk.live.quote.quote(quoteInput))), Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Create a live guest quote from a JSON QuoteQuoteInput file."), Command.withExamples([{
180
+ command: "website-sdk --backend v10 quote --input ./quote-input.json",
206
181
  description: "Create a quote using a reusable JSON fixture."
207
182
  }]));
208
183
  const contactSubmit = Command.make("submit", {
209
184
  input: inputFileFlag,
210
185
  yes: confirmFlag
211
- }, ({ input, yes }) => cmsSdkCommand.pipe(Effect.flatMap((root) => Effect.gen(function* () {
186
+ }, ({ input, yes }) => websiteSdkCommand.pipe(Effect.flatMap((root) => Effect.gen(function* () {
212
187
  yield* requireConfirmation(root, yes, "contact submit");
213
188
  const contactInput = yield* readJsonFile(input, "contact input");
214
189
  yield* withSDK(root, (sdk) => sdk.live.contact.submit(contactInput));
215
190
  yield* printSuccess(root);
216
- })))).pipe(Command.withDescription("Submit a contact request from a JSON ContactInput file."), Command.withExamples([{
217
- command: "cms-sdk --backend v9 contact submit --input ./contact-input.json --yes",
191
+ })))).pipe(Command.withDescription("Submit a contact request from a JSON ContactSubmitInput file."), Command.withExamples([{
192
+ command: "website-sdk --backend v9 contact submit --input ./contact-input.json --yes",
218
193
  description: "Submit a contact request after explicit confirmation."
219
194
  }]));
220
- const liveCommands = [quote, Command.make("contact").pipe(Command.withDescription("Run live contact operations."), Command.withSubcommands([contactSubmit]))];
195
+ const bookingBook = Command.make("book", {
196
+ contactInput: contactInputFileFlag,
197
+ quoteInput: quoteInputFileFlag,
198
+ relativeRedirectUrl: relativeRedirectUrlFlag,
199
+ yes: confirmFlag
200
+ }, ({ contactInput, quoteInput, relativeRedirectUrl, yes }) => websiteSdkCommand.pipe(Effect.flatMap((root) => Effect.gen(function* () {
201
+ yield* requireConfirmation(root, yes, "booking book");
202
+ const [quoteRequest, contact] = yield* Effect.all([readJsonFile(quoteInput, "quote input"), readJsonFile(contactInput, "booking contact input")]);
203
+ const quoteResult = yield* withSDK(root, (sdk) => sdk.live.quote.quote(quoteRequest));
204
+ if (quoteResult.status !== "available") return yield* Effect.fail(new CLICheckFailed("Cannot create a booking because the quote is unavailable."));
205
+ yield* printOutput(root, yield* withSDK(root, (sdk) => sdk.live.booking.book({
206
+ quote: quoteResult.quote,
207
+ contact,
208
+ relativeRedirectUrl
209
+ })));
210
+ })))).pipe(Command.withDescription("Create a booking from quote/contact JSON files after confirmation."), Command.withExamples([{
211
+ command: "website-sdk --backend v10 booking book --quote-input ./quote-input.json --contact-input ./booking-contact.json --relative-redirect-url https://example.test/payment --yes",
212
+ description: "Create a booking from a reusable quote input and booking contact fixture."
213
+ }]));
214
+ const liveCommands = [
215
+ quote,
216
+ Command.make("booking").pipe(Command.withDescription("Run live booking operations."), Command.withSubcommands([bookingBook])),
217
+ Command.make("contact").pipe(Command.withDescription("Run live contact operations."), Command.withSubcommands([contactSubmit]))
218
+ ];
221
219
  const staticCommands = [
222
- Command.make("filters", { locale: localeFlag }, ({ locale }) => cmsSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.static.filter.getFilters({ locale })).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch unified filter definitions."), Command.withExamples([{
223
- command: "cms-sdk --backend v10 filters --locale de-DE",
220
+ Command.make("filters", { locale: localeFlag }, ({ locale }) => websiteSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.static.filter.getFilters({ locale })).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch unified filter definitions."), Command.withExamples([{
221
+ command: "website-sdk --backend v10 filters --locale de-DE",
224
222
  description: "Fetch v10 filter definitions as JSON."
225
223
  }])),
226
- Command.make("rentals", { locale: localeFlag }, ({ locale }) => cmsSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.static.rentals.getRentals({ locale })).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch rental summaries."), Command.withExamples([{
227
- command: "cms-sdk --backend v9 rentals --locale en-US",
224
+ Command.make("rentals", { locale: localeFlag }, ({ locale }) => websiteSdkCommand.pipe(Effect.flatMap((root) => withSDK(root, (sdk) => sdk.static.rentals.getRentals({ locale })).pipe(Effect.flatMap((result) => printOutput(root, result)))))).pipe(Command.withDescription("Fetch rental summaries."), Command.withExamples([{
225
+ command: "website-sdk --backend v9 rentals --locale en-US",
228
226
  description: "Fetch v9 rentals in English."
229
227
  }])),
230
228
  Command.make("search", {
@@ -233,7 +231,7 @@ const staticCommands = [
233
231
  limit: Flag.integer("limit").pipe(Flag.optional, Flag.withDescription("Optional positive result limit.")),
234
232
  cursor: Flag.string("cursor").pipe(Flag.optional, Flag.withDescription("Optional pagination cursor.")),
235
233
  rentalIdsIn: Flag.string("rental-ids-in").pipe(Flag.optional, Flag.withDescription("Optional comma-separated rental IDs to restrict v10 search results."))
236
- }, ({ locale, query, limit, cursor, rentalIdsIn }) => cmsSdkCommand.pipe(Effect.flatMap((root) => {
234
+ }, ({ locale, query, limit, cursor, rentalIdsIn }) => websiteSdkCommand.pipe(Effect.flatMap((root) => {
237
235
  const parsedRentalIdsIn = Option.isSome(rentalIdsIn) ? rentalIdsIn.value.split(",").map((rentalId) => rentalId.trim()).filter((rentalId) => rentalId.length > 0) : [];
238
236
  const input = {
239
237
  locale,
@@ -244,19 +242,19 @@ const staticCommands = [
244
242
  };
245
243
  return withSDK(root, (sdk) => sdk.live.search.search(input)).pipe(Effect.flatMap((result) => printOutput(root, result)));
246
244
  }))).pipe(Command.withDescription("Run a live rental search."), Command.withExamples([{
247
- command: "cms-sdk --backend v10 search --locale de-DE --query \"city=munich&adults=2\"",
245
+ command: "website-sdk --backend v10 search --locale de-DE --query \"adults=2\"",
248
246
  description: "Search v10 rentals with a query string."
249
247
  }]))
250
248
  ];
251
249
  //#endregion
252
250
  //#region src/cli/index.ts
253
- const cliCommand = cmsSdkCommand.pipe(Command.withSubcommands([
251
+ const cliCommand = websiteSdkCommand.pipe(Command.withSubcommands([
254
252
  configCommand,
255
253
  ...staticCommands,
256
254
  availabilityCommand,
257
255
  ...liveCommands
258
256
  ]));
259
- const runCLI = Command.run(cliCommand, { version: "1.0.0" });
257
+ const runCLI = Command.run(cliCommand, { version: "2.0.0" });
260
258
  //#endregion
261
259
  //#region src/cli/node-services.ts
262
260
  const unsupported = (operation) => Effect.die(`Unsupported CLI platform operation: ${operation}`);
@@ -300,7 +298,28 @@ const FileSystemLive = Layer.succeed(FileSystem.FileSystem, {
300
298
  remove: () => unsupported("FileSystem.remove"),
301
299
  rename: () => unsupported("FileSystem.rename"),
302
300
  sink: () => unsupported("FileSystem.sink"),
303
- stat: () => unsupported("FileSystem.stat"),
301
+ stat: (path) => Effect.tryPromise({
302
+ try: async () => {
303
+ const stats = await stat(path);
304
+ return {
305
+ type: stats.isFile() ? "File" : stats.isDirectory() ? "Directory" : stats.isSymbolicLink() ? "SymbolicLink" : "Unknown",
306
+ mtime: Option.some(stats.mtime),
307
+ atime: Option.some(stats.atime),
308
+ birthtime: Option.some(stats.birthtime),
309
+ dev: stats.dev,
310
+ ino: Option.some(stats.ino),
311
+ mode: stats.mode,
312
+ nlink: Option.some(stats.nlink),
313
+ uid: Option.some(stats.uid),
314
+ gid: Option.some(stats.gid),
315
+ rdev: Option.some(stats.rdev),
316
+ size: FileSystem.Size(stats.size),
317
+ blksize: Option.some(FileSystem.Size(stats.blksize)),
318
+ blocks: Option.some(stats.blocks)
319
+ };
320
+ },
321
+ catch: (cause) => cause
322
+ }),
304
323
  stream: () => unsupported("FileSystem.stream"),
305
324
  symlink: () => unsupported("FileSystem.symlink"),
306
325
  truncate: () => unsupported("FileSystem.truncate"),