@voyant-travel/distribution 0.112.1 → 0.112.2

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 CHANGED
@@ -31,12 +31,17 @@ const app = createApp({
31
31
  | Entry | Description |
32
32
  | --- | --- |
33
33
  | `.` | Module export |
34
+ | `./channel-push-workflows` | Opt-in workflow registration for channel-push bundles |
34
35
  | `./schema` | Drizzle tables |
35
36
  | `./validation` | Zod schemas |
36
37
  | `./routes` | Hono routes |
37
38
  | `./suppliers` | Supplier identity, services, rates, notes, routes, validation, and schema owner path |
38
39
  | `./external-refs` | External reference routes, service, validation, and schema owner path |
39
40
 
41
+ Set `VOYANT_DISTRIBUTION_CHANNEL_PUSH_ENABLED=true` in workflow build/runtime
42
+ environments that should publish the scheduled availability and content
43
+ channel-push workflows.
44
+
40
45
  ## License
41
46
 
42
47
  Apache-2.0
@@ -11,5 +11,4 @@ export { type ChannelPushPluginOptions, channelPushPlugin, } from "./plugin.js";
11
11
  export { type AvailabilityReconcilerOptions, type BookingLinkReconcilerOptions, type ContentReconcilerOptions, type ReconcilerResult, reconcileAvailability, reconcileBookingLinks, reconcileContent, runAllReconcilers, } from "./reconciler.js";
12
12
  export { type ChannelPushSubscribersOptions, createChannelPushSubscribers, triggerBookingPushForBooking, } from "./subscriber.js";
13
13
  export { type ChannelPushDeps, type ChannelPushLogger, clearChannelPushDeps, defaultLogger, getChannelPushDeps, getChannelPushDepsOrThrow, setChannelPushDeps, } from "./types.js";
14
- export { channelAvailabilityPushWorkflow, channelBookingPushWorkflow, channelContentPushWorkflow, } from "./workflows.js";
15
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel-push/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,qCAAqC,EACrC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,8BAA8B,EAC9B,KAAK,mCAAmC,EACxC,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,gCAAgC,EAChC,aAAa,EACb,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,KAAK,wBAAwB,EAC7B,iBAAiB,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,6BAA6B,EAClC,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,YAAY,CAAA;AAKnB,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel-push/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,qCAAqC,EACrC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,8BAA8B,EAC9B,KAAK,mCAAmC,EACxC,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,gCAAgC,EAChC,aAAa,EACb,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,KAAK,wBAAwB,EAC7B,iBAAiB,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,6BAA6B,EAClC,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,YAAY,CAAA"}
@@ -11,8 +11,3 @@ export { channelPushPlugin, } from "./plugin.js";
11
11
  export { reconcileAvailability, reconcileBookingLinks, reconcileContent, runAllReconcilers, } from "./reconciler.js";
12
12
  export { createChannelPushSubscribers, triggerBookingPushForBooking, } from "./subscriber.js";
13
13
  export { clearChannelPushDeps, defaultLogger, getChannelPushDeps, getChannelPushDepsOrThrow, setChannelPushDeps, } from "./types.js";
14
- // Importing this module registers all three durable workflows in the
15
- // process-local @voyant-travel/workflows registry. Hosts that don't run an
16
- // orchestrator (e.g. the operator starter's inline drain) can still
17
- // import safely — registration is a no-op without a runtime to dispatch.
18
- export { channelAvailabilityPushWorkflow, channelBookingPushWorkflow, channelContentPushWorkflow, } from "./workflows.js";
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Workflow-entry-safe channel-push surface.
3
3
  *
4
- * This subpath is intentionally narrower than `@voyant-travel/distribution`
5
- * and `@voyant-travel/distribution/channel-push`: workflow bundles import it
6
- * at module evaluation time, so it must not pull in routes, Hono extensions, or
7
- * app-server wiring.
4
+ * This subpath is intentionally narrower than `@voyant-travel/distribution`:
5
+ * workflow bundles import it at module evaluation time, so it must not pull in
6
+ * routes, Hono extensions, or app-server wiring. Import this subpath only when
7
+ * a bundle opts into channel-push workflow registration.
8
8
  */
9
9
  export { type ChannelPushDeps, type ChannelPushLogger, clearChannelPushDeps, defaultLogger, getChannelPushDeps, getChannelPushDepsOrThrow, setChannelPushDeps, } from "./types.js";
10
10
  export { channelAvailabilityPushWorkflow, channelBookingPushWorkflow, channelContentPushWorkflow, } from "./workflows.js";
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Workflow-entry-safe channel-push surface.
3
3
  *
4
- * This subpath is intentionally narrower than `@voyant-travel/distribution`
5
- * and `@voyant-travel/distribution/channel-push`: workflow bundles import it
6
- * at module evaluation time, so it must not pull in routes, Hono extensions, or
7
- * app-server wiring.
4
+ * This subpath is intentionally narrower than `@voyant-travel/distribution`:
5
+ * workflow bundles import it at module evaluation time, so it must not pull in
6
+ * routes, Hono extensions, or app-server wiring. Import this subpath only when
7
+ * a bundle opts into channel-push workflow registration.
8
8
  */
9
9
  export { clearChannelPushDeps, defaultLogger, getChannelPushDeps, getChannelPushDepsOrThrow, setChannelPushDeps, } from "./types.js";
10
10
  export { channelAvailabilityPushWorkflow, channelBookingPushWorkflow, channelContentPushWorkflow, } from "./workflows.js";
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/channel-push/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAEnC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE9B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE9B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,0GAiBrC,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,oHAkB1C,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,0GAkBrC,CAAA"}
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/channel-push/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAEnC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE9B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE9B,MAAM,mBAAmB,CAAA;AAgB1B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,0GAiBrC,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,oHAkB1C,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,0GAkBrC,CAAA"}
@@ -24,6 +24,13 @@ import { workflow } from "@voyant-travel/workflows";
24
24
  import { CHANNEL_AVAILABILITY_PUSH_WORKFLOW_ID, processAvailabilityPushIntents, } from "./availability-push.js";
25
25
  import { CHANNEL_BOOKING_PUSH_WORKFLOW_ID, processBookingPush, } from "./booking-push.js";
26
26
  import { CHANNEL_CONTENT_PUSH_WORKFLOW_ID, processContentPushIntents, } from "./content-push.js";
27
+ const CHANNEL_PUSH_SCHEDULES_ENABLED_ENV = "VOYANT_DISTRIBUTION_CHANNEL_PUSH_ENABLED";
28
+ function channelPushSchedulesEnabled() {
29
+ return (globalThis.process?.env?.[CHANNEL_PUSH_SCHEDULES_ENABLED_ENV] === "true");
30
+ }
31
+ function channelPushSchedule(schedule) {
32
+ return channelPushSchedulesEnabled() ? schedule : undefined;
33
+ }
27
34
  /**
28
35
  * Per-booking saga workflow with compensation support.
29
36
  *
@@ -62,7 +69,7 @@ export const channelBookingPushWorkflow = workflow({
62
69
  export const channelAvailabilityPushWorkflow = workflow({
63
70
  id: CHANNEL_AVAILABILITY_PUSH_WORKFLOW_ID,
64
71
  description: "Drain channel_availability_push_intents per channel",
65
- schedule: { every: "30s" },
72
+ schedule: channelPushSchedule({ every: "30s" }),
66
73
  retry: { backoff: "exponential", max: 3, initial: "10s" },
67
74
  timeout: "5m",
68
75
  concurrency: {
@@ -85,7 +92,7 @@ export const channelAvailabilityPushWorkflow = workflow({
85
92
  export const channelContentPushWorkflow = workflow({
86
93
  id: CHANNEL_CONTENT_PUSH_WORKFLOW_ID,
87
94
  description: "Drain channel_content_push_intents per channel",
88
- schedule: { every: "5m" },
95
+ schedule: channelPushSchedule({ every: "5m" }),
89
96
  retry: { backoff: "exponential", max: 3, initial: "30s" },
90
97
  timeout: "5m",
91
98
  concurrency: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/distribution",
3
- "version": "0.112.1",
3
+ "version": "0.112.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -34,11 +34,11 @@
34
34
  "drizzle-orm": "^0.45.2",
35
35
  "hono": "^4.12.10",
36
36
  "zod": "^4.3.6",
37
+ "@voyant-travel/bookings": "^0.122.1",
37
38
  "@voyant-travel/catalog": "^0.120.2",
38
39
  "@voyant-travel/core": "^0.109.0",
39
- "@voyant-travel/db": "^0.108.1",
40
40
  "@voyant-travel/hono": "^0.111.0",
41
- "@voyant-travel/bookings": "^0.122.1",
41
+ "@voyant-travel/db": "^0.108.1",
42
42
  "@voyant-travel/identity": "^0.122.0",
43
43
  "@voyant-travel/workflows": "^0.109.3",
44
44
  "@voyant-travel/suppliers-contracts": "^0.104.3"