spine-framework 0.3.12 → 0.3.14

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.
@@ -346,6 +346,36 @@ async function upsertRoles(appId: string, records: any[], dryRun: boolean): Prom
346
346
  return result
347
347
  }
348
348
 
349
+ async function upsertIntegrations(appId: string, records: any[], dryRun: boolean): Promise<SeedResult> {
350
+ const result: SeedResult = { table: 'integrations', inserted: 0, skipped: 0, errors: [] }
351
+
352
+ for (const record of records) {
353
+ if (dryRun) {
354
+ console.log(` [dry-run] Would upsert integration: ${record.name}`)
355
+ result.inserted++
356
+ continue
357
+ }
358
+
359
+ const { error } = await adminDb
360
+ .from('integrations')
361
+ .upsert({
362
+ ...record,
363
+ app_id: appId,
364
+ }, {
365
+ onConflict: 'app_id,name',
366
+ ignoreDuplicates: false
367
+ })
368
+
369
+ if (error) {
370
+ result.errors.push(`${record.name}: ${error.message}`)
371
+ } else {
372
+ result.inserted++
373
+ }
374
+ }
375
+
376
+ return result
377
+ }
378
+
349
379
  const SEED_HANDLERS: Record<string, (appId: string, records: any[], dryRun: boolean) => Promise<SeedResult>> = {
350
380
  'types.json': upsertTypes,
351
381
  'link-types.json': upsertLinkTypes,
@@ -353,6 +383,7 @@ const SEED_HANDLERS: Record<string, (appId: string, records: any[], dryRun: bool
353
383
  'accounts.json': upsertAccounts,
354
384
  'pipelines.json': upsertPipelines,
355
385
  'roles.json': upsertRoles,
386
+ 'integrations.json': upsertIntegrations,
356
387
  }
357
388
 
358
389
  async function recordInstallation(
package/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ---
6
6
 
7
+ ## [0.3.14] — 2026-06-09
8
+ - Fixed `integrations.json` handler config format — changed `"handler": "funnel-signal"` to `"handler": { "path": "funnel-signal" }` to match `integration-routes.ts` step 8 lookup at `config.handler?.path`
9
+ - Removed orphaned `on_funnel_signal_created` trigger from `triggers.json` — the trigger engine routes exclusively through `runPipeline(trigger.pipeline_id, ...)` and has no path to directly invoke a custom function; scoring now happens inline in `custom_funnel-signal.ts`
10
+ - Removed orphaned `funnel-scoring-trigger` handler registration from `webhook-handlers.ts`
11
+ - Deleted orphaned `custom_funnel-scoring-trigger.ts` file
12
+ - Restored `custom_funnel-signal.ts` as complete inline handler — validates, resolves IDs, fetches prior signals, scores, inserts signal item, updates account/anonymous session, creates links, and evaluates queue entries
13
+
14
+ ## [0.3.13] — 2026-06-09
15
+ - Fixed `assemble-functions.sh`: now also copies functions from `custom/apps/*/functions/` so installed app handlers (e.g. `custom_funnel-signal.ts`) are included in the assembled output — previously only `custom/functions/` was swept, causing "Signal handler not available" at runtime
16
+
7
17
  ## [0.3.12] — 2026-06-09
8
18
  - Fixed `pipelines` seed upsert: replaced partial unique index (`WHERE slug IS NOT NULL`) on `(app_id, slug)` with a full unique constraint — PostgREST requires a non-partial unique index for `ON CONFLICT` resolution; `pipelines.json` seed now upserts correctly during `install-app`
9
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"install-app.d.ts","sourceRoot":"","sources":["../../../.framework/cli/commands/install-app.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAwlBxC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,QAgB1D"}
1
+ {"version":3,"file":"install-app.d.ts","sourceRoot":"","sources":["../../../.framework/cli/commands/install-app.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAunBxC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,QAgB1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-framework",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "private": false,
5
5
  "description": "Spine — enterprise application framework built on Supabase + Netlify + React",
6
6
  "type": "module",
@@ -42,12 +42,23 @@ fi
42
42
 
43
43
  # 3. Overlay custom functions (overrides + additions), excluding test files
44
44
  CUSTOM_COUNT=0
45
+
46
+ # 3a. Top-level custom/functions/ (project-level overrides)
45
47
  if [ -d "$CUSTOM_DIR/functions" ]; then
46
- # Copy all files except test files (*-test.ts, *.test.ts)
47
48
  find "$CUSTOM_DIR/functions" -maxdepth 1 -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' -exec cp {} "$TMP_DIR"/ \; 2>/dev/null || true
48
- # Copy subdirectories if any
49
49
  find "$CUSTOM_DIR/functions" -mindepth 1 -type d -exec sh -c 'dir="$1"; base=$(basename "$dir"); mkdir -p "'"$TMP_DIR"'/$base" && cp -r "$dir"/* "'"$TMP_DIR"'/$base/"' _ {} \; 2>/dev/null || true
50
- CUSTOM_COUNT=$(find "$CUSTOM_DIR/functions" -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' 2>/dev/null | wc -l | tr -d ' ')
50
+ fi
51
+
52
+ # 3b. App functions from custom/apps/*/functions/ (installed app handlers)
53
+ for APP_FUNCTIONS_DIR in "$CUSTOM_DIR"/apps/*/functions; do
54
+ if [ -d "$APP_FUNCTIONS_DIR" ]; then
55
+ find "$APP_FUNCTIONS_DIR" -maxdepth 1 -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' -exec cp {} "$TMP_DIR"/ \; 2>/dev/null || true
56
+ find "$APP_FUNCTIONS_DIR" -mindepth 1 -type d -exec sh -c 'dir="$1"; base=$(basename "$dir"); mkdir -p "'"$TMP_DIR"'/$base" && cp -r "$dir"/* "'"$TMP_DIR"'/$base/"' _ {} \; 2>/dev/null || true
57
+ fi
58
+ done
59
+
60
+ CUSTOM_COUNT=$(find "$CUSTOM_DIR" -path '*/functions/*.ts' ! -name '*-test.ts' ! -name '*.test.ts' 2>/dev/null | wc -l | tr -d ' ')
61
+ if [ "$CUSTOM_COUNT" -gt 0 ]; then
51
62
  echo " ✓ Custom: $CUSTOM_COUNT files"
52
63
  else
53
64
  echo " ○ Custom: (empty)"