@lotiai/composer 0.2.4 → 0.2.5

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.
@@ -9,7 +9,7 @@ exports.runSyncSchedulesCli = runSyncSchedulesCli;
9
9
  *
10
10
  * Framework helper that implements the complete command-line entrypoint for
11
11
  * a composer-instance's `sync-schedules` script. Each composer instance
12
- * (interchange, josu, etc.) needs exactly one thin wrapper that:
12
+ * needs exactly one thin wrapper that:
13
13
  *
14
14
  * ```typescript
15
15
  * import { isScheduleDefinition, runSyncSchedulesCli } from "@lotiai/composer";
@@ -51,9 +51,9 @@ const sync_schedules_1 = require("./sync-schedules");
51
51
  const sync_schedules_via_lambda_1 = require("./sync-schedules-via-lambda");
52
52
  /**
53
53
  * Builds the default schedule-sync Lambda function name for the current
54
- * environment. Mirrors `createResourceName(taggingConfig,
55
- * "temporal-schedule-sync")` in `infrastructure/shared`: `loti-ic` prefix +
56
- * environment + resource slug with hyphens stripped.
54
+ * environment: an infra resource prefix + environment + resource slug with
55
+ * hyphens stripped. Must match the name the schedule-sync Lambda is deployed
56
+ * under; override with `--lambda` if your deployment uses a different name.
57
57
  */
58
58
  function defaultLambdaFunctionName(environment) {
59
59
  return `loti-ic-${environment}-temporalschedulesync`;
@@ -11,7 +11,7 @@ export interface SyncSchedulesViaLambdaOptions {
11
11
  schedules: ScheduleDefinition[];
12
12
  /**
13
13
  * Name of the schedule-sync Lambda to invoke (e.g.
14
- * `"loti-ic-prod-temporalschedulesync"`).
14
+ * `"my-schedule-sync-function"`).
15
15
  *
16
16
  * Ignored in `"emit"` mode but still required for type-safety.
17
17
  */
@@ -11,7 +11,7 @@ exports.syncSchedulesViaLambda = syncSchedulesViaLambda;
11
11
  *
12
12
  * This is the intended deploy-time path: CI assumes an AWS role with
13
13
  * `lambda:InvokeFunction` permission and runs this helper from a
14
- * composer-instance script (e.g. `@loti/composer-ix` `sync-schedules`).
14
+ * composer-instance's `sync-schedules` script.
15
15
  *
16
16
  * Supports two modes:
17
17
  * - `"invoke"` (default): invokes the Lambda synchronously, logs tail logs
@@ -30,7 +30,7 @@ exports.syncSchedulesViaLambda = syncSchedulesViaLambda;
30
30
  *
31
31
  * await syncSchedulesViaLambda(composer, {
32
32
  * schedules: Object.values(schedules).filter(isScheduleDefinition),
33
- * lambdaFunctionName: "loti-ic-prod-temporalschedulesync",
33
+ * lambdaFunctionName: "my-schedule-sync-function",
34
34
  * });
35
35
  * ```
36
36
  *
@@ -9,7 +9,7 @@
9
9
 
10
10
  services:
11
11
  postgresql:
12
- image: postgres:14
12
+ image: postgres:17
13
13
  container_name: temporal-postgresql
14
14
  environment:
15
15
  POSTGRES_USER: temporal
@@ -20,7 +20,13 @@ services:
20
20
  # talk to postgresql:5432 over the Docker network.
21
21
  - "${TEMPORAL_DB_PORT:-5432}:5432"
22
22
  volumes:
23
- - postgres-data:/var/lib/postgresql/data
23
+ # The volume name is pinned to the Postgres major version. A major bump
24
+ # (e.g. 14 -> 17) therefore renames it, so Compose provisions a fresh
25
+ # volume instead of mounting an older major's data directory into the new
26
+ # server -- Postgres refuses to start on a data dir from a previous major.
27
+ # The old volume is left orphaned (harmless; `docker volume prune` clears
28
+ # it). This is throwaway local Temporal metadata, so a reset is expected.
29
+ - temporal-postgres17-data:/var/lib/postgresql/data
24
30
  networks:
25
31
  - temporal-network
26
32
  healthcheck:
@@ -109,13 +115,18 @@ services:
109
115
  sleep 2
110
116
  done
111
117
 
112
- # Keep local namespaces aligned with the canonical shared constants.
113
- for namespace in interchange outpost josu; do
114
- if temporal operator namespace describe -n "$namespace" --address temporal:7233 >/dev/null 2>&1; then
115
- echo "Temporal namespace '$namespace' already exists."
118
+ # Namespaces to ensure exist. Defaults to a single "default" namespace;
119
+ # override TEMPORAL_NAMESPACES with a space-separated list (Docker
120
+ # Compose interpolates it from the host environment at parse time).
121
+ # The loop variable below is written with a doubled dollar sign so
122
+ # Compose passes it through to the shell literally instead of
123
+ # interpolating it to an empty string.
124
+ for namespace in ${TEMPORAL_NAMESPACES:-default}; do
125
+ if temporal operator namespace describe -n "$$namespace" --address temporal:7233 >/dev/null 2>&1; then
126
+ echo "Temporal namespace '$$namespace' already exists."
116
127
  else
117
- temporal operator namespace create -n "$namespace" --retention 90d --address temporal:7233
118
- echo "Temporal namespace '$namespace' created."
128
+ temporal operator namespace create -n "$$namespace" --retention 90d --address temporal:7233
129
+ echo "Temporal namespace '$$namespace' created."
119
130
  fi
120
131
  done
121
132
  networks:
@@ -136,7 +147,7 @@ services:
136
147
  - temporal-network
137
148
 
138
149
  volumes:
139
- postgres-data:
150
+ temporal-postgres17-data:
140
151
  driver: local
141
152
 
142
153
  networks:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotiai/composer",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "A framework for building type-safe, DAG-based workflows with optional Temporal integration.",
5
5
  "license": "MIT",
6
6
  "keywords": [