@voyant-travel/distribution 0.112.0 → 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";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Workflow-entry-safe channel-push surface.
3
+ *
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
+ */
9
+ export { type ChannelPushDeps, type ChannelPushLogger, clearChannelPushDeps, defaultLogger, getChannelPushDeps, getChannelPushDepsOrThrow, setChannelPushDeps, } from "./types.js";
10
+ export { channelAvailabilityPushWorkflow, channelBookingPushWorkflow, channelContentPushWorkflow, } from "./workflows.js";
11
+ //# sourceMappingURL=workflow-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-entry.d.ts","sourceRoot":"","sources":["../../src/channel-push/workflow-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Workflow-entry-safe channel-push surface.
3
+ *
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
+ */
9
+ export { clearChannelPushDeps, defaultLogger, getChannelPushDeps, getChannelPushDepsOrThrow, setChannelPushDeps, } from "./types.js";
10
+ export { channelAvailabilityPushWorkflow, channelBookingPushWorkflow, channelContentPushWorkflow, } from "./workflows.js";
@@ -9,9 +9,9 @@
9
9
  * them up automatically.
10
10
  *
11
11
  * The workflow bodies look up `ChannelPushDeps` from the process-local
12
- * holder set via `setChannelPushDeps`. Hosts wire deps at bootstrap;
13
- * the orchestrator's Node container reads from the same global since
14
- * it runs in the same isolate that loaded the user bundle.
12
+ * holder set via `setChannelPushDeps`. Detached bundles wire deps from
13
+ * their `bootstrapWorkflowBundle` export before the runner executes a
14
+ * workflow step.
15
15
  *
16
16
  * Dev / single-process deployments (e.g. the operator starter's
17
17
  * inline drain) don't need to register these — the subscriber calls the
@@ -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"}
@@ -9,9 +9,9 @@
9
9
  * them up automatically.
10
10
  *
11
11
  * The workflow bodies look up `ChannelPushDeps` from the process-local
12
- * holder set via `setChannelPushDeps`. Hosts wire deps at bootstrap;
13
- * the orchestrator's Node container reads from the same global since
14
- * it runs in the same isolate that loaded the user bundle.
12
+ * holder set via `setChannelPushDeps`. Detached bundles wire deps from
13
+ * their `bootstrapWorkflowBundle` export before the runner executes a
14
+ * workflow step.
15
15
  *
16
16
  * Dev / single-process deployments (e.g. the operator starter's
17
17
  * inline drain) don't need to register these — the subscriber calls the
@@ -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.0",
3
+ "version": "0.112.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,6 +9,11 @@
9
9
  "import": "./dist/index.js",
10
10
  "default": "./dist/index.js"
11
11
  },
12
+ "./channel-push-workflows": {
13
+ "types": "./dist/channel-push/workflow-entry.d.ts",
14
+ "import": "./dist/channel-push/workflow-entry.js",
15
+ "default": "./dist/channel-push/workflow-entry.js"
16
+ },
12
17
  "./schema": {
13
18
  "types": "./dist/schema.d.ts",
14
19
  "import": "./dist/schema.js",
@@ -29,13 +34,13 @@
29
34
  "drizzle-orm": "^0.45.2",
30
35
  "hono": "^4.12.10",
31
36
  "zod": "^4.3.6",
32
- "@voyant-travel/bookings": "^0.122.0",
33
- "@voyant-travel/catalog": "^0.120.0",
37
+ "@voyant-travel/bookings": "^0.122.1",
38
+ "@voyant-travel/catalog": "^0.120.2",
34
39
  "@voyant-travel/core": "^0.109.0",
35
- "@voyant-travel/db": "^0.108.1",
36
40
  "@voyant-travel/hono": "^0.111.0",
41
+ "@voyant-travel/db": "^0.108.1",
37
42
  "@voyant-travel/identity": "^0.122.0",
38
- "@voyant-travel/workflows": "^0.109.2",
43
+ "@voyant-travel/workflows": "^0.109.3",
39
44
  "@voyant-travel/suppliers-contracts": "^0.104.3"
40
45
  },
41
46
  "devDependencies": {