spine-framework 0.3.131 → 0.3.133

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.
@@ -103,14 +103,17 @@ export async function runMigrations(opts: { frameworkOnly?: boolean } = {}): Pro
103
103
  const statements = splitSqlStatements(sql)
104
104
 
105
105
  try {
106
+ await client.query('BEGIN')
106
107
  for (const stmt of statements) await client.query(stmt)
107
108
  await client.query(
108
109
  `INSERT INTO _spine_migrations (filename) VALUES ($1) ON CONFLICT (filename) DO NOTHING`,
109
110
  [name]
110
111
  )
112
+ await client.query('COMMIT')
111
113
  console.log('✓')
112
114
  applied++
113
115
  } catch (err: any) {
116
+ await client.query('ROLLBACK').catch(() => {})
114
117
  console.log('✗')
115
118
  console.error(` ${err.message}`)
116
119
  failed++
@@ -57,9 +57,9 @@ CREATE TABLE IF NOT EXISTS public.roles (
57
57
  is_active boolean DEFAULT true, is_protected boolean DEFAULT false,
58
58
  app_id uuid, account_id uuid,
59
59
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
60
- UNIQUE(slug)
61
60
  type_id uuid,
62
61
  created_by uuid,
62
+ UNIQUE(slug)
63
63
  );
64
64
  CREATE TABLE IF NOT EXISTS public.items (
65
65
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -139,9 +139,9 @@ CREATE TABLE IF NOT EXISTS public.pipelines (
139
139
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
140
140
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
141
141
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
142
- UNIQUE(app_id, slug)
143
142
  type_id uuid,
144
143
  created_by uuid,
144
+ UNIQUE(app_id, slug)
145
145
  );
146
146
  CREATE TABLE IF NOT EXISTS public.pipeline_executions (
147
147
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -151,7 +151,7 @@ CREATE TABLE IF NOT EXISTS public.pipeline_executions (
151
151
  input_data jsonb DEFAULT '{}', output_data jsonb DEFAULT '{}',
152
152
  metadata jsonb DEFAULT '{}', created_by uuid,
153
153
  created_at timestamptz DEFAULT now(),
154
- CONSTRAINT fk_pipeline_executions_pipeline
154
+ CONSTRAINT fk_pipeline_executions_pipeline
155
155
  FOREIGN KEY (pipeline_id) REFERENCES public.pipelines(id) ON DELETE CASCADE
156
156
  );
157
157
  CREATE TABLE IF NOT EXISTS public.triggers (
@@ -161,8 +161,8 @@ CREATE TABLE IF NOT EXISTS public.triggers (
161
161
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
162
162
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
163
163
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
164
- UNIQUE(app_id, slug)
165
164
  created_by uuid,
165
+ UNIQUE(app_id, slug)
166
166
  );
167
167
  CREATE TABLE IF NOT EXISTS public.trigger_executions (
168
168
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -182,8 +182,8 @@ CREATE TABLE IF NOT EXISTS public.timers (
182
182
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
183
183
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
184
184
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
185
- UNIQUE(app_id, slug)
186
185
  created_by uuid,
186
+ UNIQUE(app_id, slug)
187
187
  );
188
188
  CREATE TABLE IF NOT EXISTS public.prompt_configs (
189
189
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -202,8 +202,8 @@ CREATE TABLE IF NOT EXISTS public.integrations (
202
202
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
203
203
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
204
204
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
205
- UNIQUE(app_id, slug)
206
205
  created_by uuid,
206
+ UNIQUE(app_id, slug)
207
207
  );
208
208
  CREATE TABLE IF NOT EXISTS public.integration_routes (
209
209
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -236,8 +236,8 @@ CREATE TABLE IF NOT EXISTS public.test_runs (
236
236
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
237
237
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
238
238
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
239
- UNIQUE(app_id, slug)
240
239
  created_by uuid,
240
+ UNIQUE(app_id, slug)
241
241
  );
242
242
  CREATE TABLE IF NOT EXISTS public.test_cases (
243
243
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -271,8 +271,8 @@ CREATE TABLE IF NOT EXISTS public.ai_agents (
271
271
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
272
272
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
273
273
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
274
- UNIQUE(app_id, slug)
275
274
  created_by uuid,
275
+ UNIQUE(app_id, slug)
276
276
  );
277
277
  CREATE TABLE IF NOT EXISTS public.invites (
278
278
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -291,8 +291,8 @@ CREATE TABLE IF NOT EXISTS public.api_keys (
291
291
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
292
292
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
293
293
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
294
- UNIQUE(app_id, slug)
295
294
  created_by uuid,
295
+ UNIQUE(app_id, slug)
296
296
  );
297
297
  CREATE TABLE IF NOT EXISTS public.alerts (
298
298
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -310,9 +310,9 @@ CREATE TABLE IF NOT EXISTS public.item_progress (
310
310
  config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
311
311
  is_active boolean DEFAULT true, is_system boolean DEFAULT false,
312
312
  created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
313
- UNIQUE(app_id, slug)
314
313
  item_id uuid NOT NULL,
315
314
  created_by uuid,
315
+ UNIQUE(app_id, slug)
316
316
  );
317
317
 
318
318
  CREATE TABLE IF NOT EXISTS public.account_paths (
@@ -530,10 +530,6 @@ CREATE TRIGGER set_updated_at_account_paths
530
530
  BEFORE UPDATE ON public.account_paths
531
531
  FOR EACH ROW EXECUTE FUNCTION public.set_updated_at();
532
532
 
533
- DROP TRIGGER IF EXISTS set_updated_at_people_roles ON public.people_roles;
534
- CREATE TRIGGER set_updated_at_people_roles
535
- BEFORE UPDATE ON public.people_roles
536
- FOR EACH ROW EXECUTE FUNCTION public.set_updated_at();
537
533
 
538
534
  -- RLS policies
539
535
 
@@ -634,10 +630,6 @@ CREATE POLICY api_keys_access ON public.api_keys FOR ALL
634
630
  USING (account_id IN (SELECT public.get_accessible_accounts(auth.uid()))
635
631
  OR id = auth.uid() );
636
632
 
637
- CREATE POLICY akul_access ON public.api_key_usage_logs FOR ALL
638
- USING (account_id IN (SELECT public.get_accessible_accounts(auth.uid()))
639
- );
640
-
641
633
  CREATE POLICY logs_access ON public.logs FOR ALL
642
634
  USING (account_id IN (SELECT public.get_accessible_accounts(auth.uid()))
643
635
  );
@@ -122,6 +122,7 @@ COMMENT ON COLUMN public.integrations.is_configured IS 'True when required crede
122
122
  ALTER TABLE public.integrations DROP CONSTRAINT IF EXISTS integrations_app_id_slug_key;
123
123
  ALTER TABLE public.integrations ADD CONSTRAINT integrations_app_account_slug_key UNIQUE (app_id, account_id, slug);
124
124
 
125
+ ALTER TABLE public.integrations DROP CONSTRAINT IF EXISTS fk_integrations_created_by;
125
126
  ALTER TABLE public.integrations ADD CONSTRAINT fk_integrations_created_by
126
127
  FOREIGN KEY (created_by) REFERENCES public.people(id) ON DELETE SET NULL;
127
128
 
@@ -153,6 +154,7 @@ COMMENT ON COLUMN public.api_keys.rate_limit IS 'Requests per rate_limit_window_
153
154
 
154
155
  ALTER TABLE public.api_keys ADD CONSTRAINT fk_api_keys_integration
155
156
  FOREIGN KEY (integration_id) REFERENCES public.integrations(id) ON DELETE CASCADE;
157
+ ALTER TABLE public.api_keys DROP CONSTRAINT IF EXISTS fk_api_keys_created_by;
156
158
  ALTER TABLE public.api_keys ADD CONSTRAINT fk_api_keys_created_by
157
159
  FOREIGN KEY (created_by) REFERENCES public.people(id) ON DELETE SET NULL;
158
160
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-framework",
3
- "version": "0.3.131",
3
+ "version": "0.3.133",
4
4
  "description": "Multi-tenant, modular application platform for modern SaaS systems",
5
5
  "type": "module",
6
6
  "bin": {