@v-office/website-sdk 2.18.2 → 2.19.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/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Vt as defineV9PropertyHighlightSourcesFromUnknown, t as createWebsiteSDK, zt as defineWebsiteSDKOptions } from "./client-BnA0oXd_.mjs";
3
3
  import { SearchSearchSortSchema, defineCustomAttributesFromUnknown } from "@v-office/sdk-core";
4
- import { Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
4
+ import { ByteSize, Console, Effect, FileSystem, Layer, Option, Path, Schema, Stdio, Terminal } from "effect";
5
5
  import { Command, Flag } from "effect/unstable/cli";
6
6
  import { inspect } from "node:util";
7
7
  import { ChildProcessSpawner } from "effect/unstable/process";
@@ -16,7 +16,7 @@ var CLICheckFailed = class extends Error {
16
16
  const toCLIError = (message, cause) => cause instanceof Error ? new CLICheckFailed(`${message}: ${cause.message}`, { cause }) : new CLICheckFailed(message, { cause });
17
17
  //#endregion
18
18
  //#region package.json
19
- var version = "2.18.2";
19
+ var version = "2.19.0";
20
20
  //#endregion
21
21
  //#region src/cli/output.ts
22
22
  const toJson = (value) => Effect.try({
@@ -35,15 +35,15 @@ const printOutput = (root, value) => {
35
35
  const printSuccess = (root) => printOutput(root, { ok: true });
36
36
  //#endregion
37
37
  //#region src/cli/root.ts
38
- const backendFlag = Flag.choice("backend", ["v9", "v10"]).pipe(Flag.withDescription("Backend to use for this command."));
39
- const localeFlag = Flag.choice("locale", ["de-DE", "en-US"]).pipe(Flag.withDescription("Locale used for localized SDK calls."), Flag.withDefault("de-DE"));
40
- const inputFileFlag = Flag.file("input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON input file."));
41
- const confirmFlag = Flag.boolean("yes").pipe(Flag.withDescription("Confirm execution of commands that submit or mutate backend state."));
38
+ const backendFlag = Flag.Literals("backend", ["v9", "v10"]).pipe(Flag.withDescription("Backend to use for this command."));
39
+ const localeFlag = Flag.Literals("locale", ["de-DE", "en-US"]).pipe(Flag.withDescription("Locale used for localized SDK calls."), Flag.withDefault("de-DE"));
40
+ const inputFileFlag = Flag.File("input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON input file."));
41
+ const confirmFlag = Flag.Boolean("yes").pipe(Flag.withDescription("Confirm execution of commands that submit or mutate backend state."));
42
42
  const websiteSdkCommand = Command.make("website-sdk").pipe(Command.withDescription("Run @v-office/website-sdk operations from the command line."), Command.withSharedFlags({
43
43
  backend: backendFlag,
44
- config: Flag.file("config", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON WebsiteSDKConfig file. Defaults to environment variables.")),
45
- options: Flag.file("options", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON WebsiteSDKOptions file.")),
46
- output: Flag.choice("output", ["json", "pretty"]).pipe(Flag.withDescription("Output format."), Flag.withDefault("json"))
44
+ config: Flag.File("config", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON WebsiteSDKConfig file. Defaults to environment variables.")),
45
+ options: Flag.File("options", { mustExist: true }).pipe(Flag.optional, Flag.withDescription("Path to a JSON WebsiteSDKOptions file.")),
46
+ output: Flag.Literals("output", ["json", "pretty"]).pipe(Flag.withDescription("Output format."), Flag.withDefault("json"))
47
47
  }));
48
48
  //#endregion
49
49
  //#region src/cli/json.ts
@@ -172,9 +172,9 @@ const withSDK = (root, run) => Effect.gen(function* () {
172
172
  });
173
173
  //#endregion
174
174
  //#region src/cli/commands/availability.ts
175
- const rentalIdFlag = Flag.string("rental-id").pipe(Flag.withDescription("Backend rental identifier."));
176
- const calculateFromDateFlag = Flag.string("calculate-from-date").pipe(Flag.withDescription("First local date to calculate, formatted as YYYY-MM-DD."));
177
- const calculateThroughDateFlag = Flag.string("calculate-through-date").pipe(Flag.withDescription("Last local date to calculate, formatted as YYYY-MM-DD."));
175
+ const rentalIdFlag = Flag.String("rental-id").pipe(Flag.withDescription("Backend rental identifier."));
176
+ const calculateFromDateFlag = Flag.String("calculate-from-date").pipe(Flag.withDescription("First local date to calculate, formatted as YYYY-MM-DD."));
177
+ const calculateThroughDateFlag = Flag.String("calculate-through-date").pipe(Flag.withDescription("Last local date to calculate, formatted as YYYY-MM-DD."));
178
178
  const initial = Command.make("initial", {
179
179
  locale: localeFlag,
180
180
  rentalId: rentalIdFlag,
@@ -187,7 +187,7 @@ const initial = Command.make("initial", {
187
187
  const startDateSelected = Command.make("start-date-selected", {
188
188
  locale: localeFlag,
189
189
  rentalId: rentalIdFlag,
190
- selectedStartDate: Flag.string("selected-start-date").pipe(Flag.withDescription("Selected start date, formatted as YYYY-MM-DD.")),
190
+ selectedStartDate: Flag.String("selected-start-date").pipe(Flag.withDescription("Selected start date, formatted as YYYY-MM-DD.")),
191
191
  calculateFromDate: calculateFromDateFlag,
192
192
  calculateThroughDate: calculateThroughDateFlag
193
193
  }, (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([{
@@ -229,9 +229,9 @@ const configCommand = Command.make("config").pipe(Command.withDescription("Inspe
229
229
  const requireConfirmation = (root, confirmed, commandName) => confirmed ? Effect.void : Effect.fail(new CLICheckFailed(`${commandName} can submit data to the configured backend. Re-run with --yes to confirm.`));
230
230
  //#endregion
231
231
  //#region src/cli/commands/live.ts
232
- const quoteInputFileFlag = Flag.file("quote-input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON QuoteQuoteInput file."));
233
- const contactInputFileFlag = Flag.file("contact-input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON BookingContact file."));
234
- const relativeRedirectUrlFlag = Flag.string("relative-redirect-url").pipe(Flag.withDescription("Redirect URL passed to booking payment initialization."));
232
+ const quoteInputFileFlag = Flag.File("quote-input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON QuoteQuoteInput file."));
233
+ const contactInputFileFlag = Flag.File("contact-input", { mustExist: true }).pipe(Flag.withDescription("Path to a JSON BookingContact file."));
234
+ const relativeRedirectUrlFlag = Flag.String("relative-redirect-url").pipe(Flag.withDescription("Redirect URL passed to booking payment initialization."));
235
235
  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([{
236
236
  command: "website-sdk --backend v10 quote --input ./quote-input.json",
237
237
  description: "Create a quote using a reusable JSON fixture."
@@ -289,12 +289,12 @@ const staticCommands = [
289
289
  }])),
290
290
  Command.make("search", {
291
291
  locale: localeFlag,
292
- query: Flag.string("query").pipe(Flag.withDescription("Search query string, for example \"city=munich&adults=2\".")),
293
- limit: Flag.integer("limit").pipe(Flag.optional, Flag.withDescription("Optional positive result limit.")),
294
- cursor: Flag.string("cursor").pipe(Flag.optional, Flag.withDescription("Optional pagination cursor.")),
295
- rentalIdsIn: Flag.string("rental-ids-in").pipe(Flag.optional, Flag.withDescription("Optional comma-separated rental IDs to restrict v10 search results.")),
296
- voucher: Flag.string("voucher").pipe(Flag.optional, Flag.withDescription("Optional voucher code for v10 search pricing.")),
297
- sort: Flag.string("sort").pipe(Flag.optional, Flag.withDescription("Optional SearchSearchSort JSON, for example '{\"by\":\"price\",\"direction\":\"ASC\"}'."))
292
+ query: Flag.String("query").pipe(Flag.withDescription("Search query string, for example \"city=munich&adults=2\".")),
293
+ limit: Flag.Int("limit").pipe(Flag.optional, Flag.withDescription("Optional positive result limit.")),
294
+ cursor: Flag.String("cursor").pipe(Flag.optional, Flag.withDescription("Optional pagination cursor.")),
295
+ rentalIdsIn: Flag.String("rental-ids-in").pipe(Flag.optional, Flag.withDescription("Optional comma-separated rental IDs to restrict v10 search results.")),
296
+ voucher: Flag.String("voucher").pipe(Flag.optional, Flag.withDescription("Optional voucher code for v10 search pricing.")),
297
+ sort: Flag.String("sort").pipe(Flag.optional, Flag.withDescription("Optional SearchSearchSort JSON, for example '{\"by\":\"price\",\"direction\":\"ASC\"}'."))
298
298
  }, ({ locale, query, limit, cursor, rentalIdsIn, voucher, sort }) => websiteSdkCommand.pipe(Effect.flatMap((root) => {
299
299
  return Effect.gen(function* () {
300
300
  const parsedRentalIdsIn = Option.isSome(rentalIdsIn) ? rentalIdsIn.value.split(",").map((rentalId) => rentalId.trim()).filter((rentalId) => rentalId.length > 0) : [];
@@ -390,8 +390,8 @@ const FileSystemLive = Layer.succeed(FileSystem.FileSystem, {
390
390
  uid: Option.some(stats.uid),
391
391
  gid: Option.some(stats.gid),
392
392
  rdev: Option.some(stats.rdev),
393
- size: FileSystem.Size(stats.size),
394
- blksize: Option.some(FileSystem.Size(stats.blksize)),
393
+ size: ByteSize.bytes(stats.size),
394
+ blksize: Option.some(ByteSize.bytes(stats.blksize)),
395
395
  blocks: Option.some(stats.blocks)
396
396
  };
397
397
  },
@@ -4,6 +4,7 @@
4
4
 
5
5
  Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
6
6
 
7
+ - `versions/2.19.0/CHANGELOG.md`: release notes for 2.19.0
7
8
  - `versions/2.18.2/CHANGELOG.md`: release notes for 2.18.2
8
9
  - `versions/2.18.1/CHANGELOG.md`: release notes for 2.18.1
9
10
  - `versions/2.18.0/CHANGELOG.md`: release notes for 2.18.0
@@ -4,6 +4,7 @@
4
4
 
5
5
  Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
6
6
 
7
+ - `versions/2.19.0/MIGRATION.md`: Migration: 2.18.2 to 2.19.0
7
8
  - `versions/2.18.2/MIGRATION.md`: Migration: 2.18.1 to 2.18.2
8
9
  - `versions/2.18.1/MIGRATION.md`: Migration: 2.18.0 to 2.18.1
9
10
  - `versions/2.18.0/MIGRATION.md`: Migration: 2.17.1 to 2.18.0
@@ -0,0 +1,18 @@
1
+ # Changelog: 2.19.0
2
+
3
+ Moves the website SDK and its core to the Effect 4 release candidate. The
4
+ public API is unchanged. Sites that import `effect` directly must move to the
5
+ release candidate as well.
6
+
7
+ ## Changed
8
+
9
+ - `@v-office/sdk-core` is pinned to `1.21.0`, which runs on `effect@4.0.0-rc.115`
10
+ (was `4.0.0-beta.85`). See the core's 1.21.0 notes for the details.
11
+ - `effect` is `4.0.0-rc.115` for the website SDK as well.
12
+ - The `website-sdk` command line uses the release candidate's PascalCase flag
13
+ constructors internally. Every flag keeps its name, type and help text.
14
+
15
+ ## Unchanged
16
+
17
+ - Every exported symbol of 2.18.2; the declaration file exposes the same names.
18
+ - The behavior of every capability, the CLI subcommands and their output.
@@ -0,0 +1,22 @@
1
+ # Migration: 2.18.2 to 2.19.0
2
+
3
+ No code changes in calls to the SDK. Sites that import `effect` themselves
4
+ must move to the same release candidate, because `Effect` values from this
5
+ SDK do not typecheck against `Effect` types from the beta.
6
+
7
+ ## 1. Upgrade
8
+
9
+ ```sh
10
+ pnpm add @v-office/website-sdk@2.19.0 effect@4.0.0-rc.115
11
+ ```
12
+
13
+ Skip the `effect` part if your site does not depend on `effect` directly.
14
+
15
+ ## 2. Follow the release candidate renames in your own Effect code
16
+
17
+ Only needed where the site uses these APIs itself; the SDK's own exports are
18
+ unchanged:
19
+
20
+ - `Schema.TaggedErrorClass` → `Schema.TaggedError`, `Schema.ErrorClass` → `Schema.Error`
21
+ - `SchemaTransformation.transformOrFail` → `SchemaTransformation.transformEffect`
22
+ - `Schedule.both` → `Schedule.max([...])`, `Schedule.either` → `Schedule.min([...])`
@@ -4,6 +4,7 @@
4
4
 
5
5
  Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
6
6
 
7
+ - `versions/2.19.0/CHANGELOG.md`: release notes for 2.19.0
7
8
  - `versions/2.18.2/CHANGELOG.md`: release notes for 2.18.2
8
9
  - `versions/2.18.1/CHANGELOG.md`: release notes for 2.18.1
9
10
  - `versions/2.18.0/CHANGELOG.md`: release notes for 2.18.0
@@ -4,6 +4,7 @@
4
4
 
5
5
  Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
6
6
 
7
+ - `versions/2.19.0/MIGRATION.md`: Migration: 2.18.2 to 2.19.0
7
8
  - `versions/2.18.2/MIGRATION.md`: Migration: 2.18.1 to 2.18.2
8
9
  - `versions/2.18.1/MIGRATION.md`: Migration: 2.18.0 to 2.18.1
9
10
  - `versions/2.18.0/MIGRATION.md`: Migration: 2.17.1 to 2.18.0
@@ -0,0 +1,18 @@
1
+ # Changelog: 2.19.0
2
+
3
+ Moves the website SDK and its core to the Effect 4 release candidate. The
4
+ public API is unchanged. Sites that import `effect` directly must move to the
5
+ release candidate as well.
6
+
7
+ ## Changed
8
+
9
+ - `@v-office/sdk-core` is pinned to `1.21.0`, which runs on `effect@4.0.0-rc.115`
10
+ (was `4.0.0-beta.85`). See the core's 1.21.0 notes for the details.
11
+ - `effect` is `4.0.0-rc.115` for the website SDK as well.
12
+ - The `website-sdk` command line uses the release candidate's PascalCase flag
13
+ constructors internally. Every flag keeps its name, type and help text.
14
+
15
+ ## Unchanged
16
+
17
+ - Every exported symbol of 2.18.2; the declaration file exposes the same names.
18
+ - The behavior of every capability, the CLI subcommands and their output.
@@ -0,0 +1,22 @@
1
+ # Migration: 2.18.2 to 2.19.0
2
+
3
+ No code changes in calls to the SDK. Sites that import `effect` themselves
4
+ must move to the same release candidate, because `Effect` values from this
5
+ SDK do not typecheck against `Effect` types from the beta.
6
+
7
+ ## 1. Upgrade
8
+
9
+ ```sh
10
+ pnpm add @v-office/website-sdk@2.19.0 effect@4.0.0-rc.115
11
+ ```
12
+
13
+ Skip the `effect` part if your site does not depend on `effect` directly.
14
+
15
+ ## 2. Follow the release candidate renames in your own Effect code
16
+
17
+ Only needed where the site uses these APIs itself; the SDK's own exports are
18
+ unchanged:
19
+
20
+ - `Schema.TaggedErrorClass` → `Schema.TaggedError`, `Schema.ErrorClass` → `Schema.Error`
21
+ - `SchemaTransformation.transformOrFail` → `SchemaTransformation.transformEffect`
22
+ - `Schedule.both` → `Schedule.max([...])`, `Schedule.either` → `Schedule.min([...])`
@@ -0,0 +1,3 @@
1
+ {
2
+ "componentsAffectedByHeadlessChange": []
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/website-sdk",
3
- "version": "2.18.2",
3
+ "version": "2.19.0",
4
4
  "description": "Website-facing SDK facade backed by @v-office/sdk-core",
5
5
  "bin": {
6
6
  "website-sdk": "./dist/cli.mjs"
@@ -42,13 +42,13 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@graphql-typed-document-node/core": "3.2.0",
45
- "@v-office/sdk-core": "1.20.0",
46
- "effect": "4.0.0-beta.85",
45
+ "@v-office/sdk-core": "1.21.0",
46
+ "effect": "4.0.0-rc.115",
47
47
  "graphql": "17.0.2",
48
48
  "yaml": "^2.9.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@effect/tsgo": "0.31.0",
51
+ "@effect/tsgo": "0.45.0",
52
52
  "@graphql-codegen/cli": "7.4.1",
53
53
  "@graphql-codegen/client-preset": "6.2.0",
54
54
  "@types/node": "26.5.1",