spine-framework-cortex 0.1.4 → 0.1.6
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/lib/resolveTypeId.ts +16 -0
- package/manifest.json +1 -1
- package/package.json +2 -1
- package/pages/courses/CoursesPage.tsx +1 -1
- package/pages/support/RedactionReview.tsx +1 -1
- package/seed/link-types.json +12 -12
- package/seed/roles.json +0 -1
- package/seed/triggers.json +5 -5
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Frontend type ID resolution — never hardcode UUIDs in custom app code.
|
|
2
|
+
// IDs differ on every fresh install; always resolve by slug at call time.
|
|
3
|
+
|
|
4
|
+
import { apiFetch } from '@core/lib/api'
|
|
5
|
+
|
|
6
|
+
const cache: Record<string, string> = {}
|
|
7
|
+
|
|
8
|
+
export async function resolveTypeId(slug: string): Promise<string> {
|
|
9
|
+
if (cache[slug]) return cache[slug]
|
|
10
|
+
|
|
11
|
+
const data = await apiFetch(`/.netlify/functions/types?action=getBySlug&slug=${encodeURIComponent(slug)}`)
|
|
12
|
+
if (!data?.id) throw new Error(`Type not found: ${slug}`)
|
|
13
|
+
|
|
14
|
+
cache[slug] = data.id
|
|
15
|
+
return data.id
|
|
16
|
+
}
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spine-framework-cortex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Cortex — AI-powered support, CRM, and knowledge base app for Spine Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"pages/",
|
|
20
20
|
"components/",
|
|
21
21
|
"functions/",
|
|
22
|
+
"lib/",
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
24
25
|
"spine": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react'
|
|
2
|
-
import { resolveTypeId } from '
|
|
2
|
+
import { resolveTypeId } from '../../lib/resolveTypeId'
|
|
3
3
|
import { useNavigate } from 'react-router-dom'
|
|
4
4
|
import { apiFetch } from '@core/lib/api'
|
|
5
5
|
import { Button } from '@core/components/ui/button'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import { resolveTypeId } from '
|
|
2
|
+
import { resolveTypeId } from '../../lib/resolveTypeId'
|
|
3
3
|
import { useParams, useNavigate } from 'react-router-dom'
|
|
4
4
|
import { apiFetch } from '@core/lib/api'
|
|
5
5
|
import { Button } from '@core/components/ui/button'
|
package/seed/link-types.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"slug": "account_opportunities",
|
|
4
4
|
"name": "Account Opportunities",
|
|
5
5
|
"description": "Links accounts to their opportunity queue entries",
|
|
6
|
-
"source_type_slug": "account",
|
|
7
|
-
"target_type_slug": "item",
|
|
8
|
-
"relationship_type": "many-to-many",
|
|
9
6
|
"config": {
|
|
7
|
+
"source_type_slug": "account",
|
|
8
|
+
"target_type_slug": "item",
|
|
9
|
+
"relationship_type": "many-to-many",
|
|
10
10
|
"cardinality": "many-to-many"
|
|
11
11
|
},
|
|
12
12
|
"is_active": true
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"slug": "account_signals",
|
|
16
16
|
"name": "Account Signals",
|
|
17
17
|
"description": "Links accounts to their funnel signals",
|
|
18
|
-
"source_type_slug": "account",
|
|
19
|
-
"target_type_slug": "item",
|
|
20
|
-
"relationship_type": "many-to-many",
|
|
21
18
|
"config": {
|
|
19
|
+
"source_type_slug": "account",
|
|
20
|
+
"target_type_slug": "item",
|
|
21
|
+
"relationship_type": "many-to-many",
|
|
22
22
|
"cardinality": "many-to-many"
|
|
23
23
|
},
|
|
24
24
|
"is_active": true
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"slug": "analyzed_by",
|
|
28
28
|
"name": "Analyzed By",
|
|
29
29
|
"description": "Ticket analyzed by case analysis",
|
|
30
|
-
"source_type_slug": "item",
|
|
31
|
-
"target_type_slug": "item",
|
|
32
|
-
"relationship_type": "many-to-many",
|
|
33
30
|
"config": {
|
|
31
|
+
"source_type_slug": "item",
|
|
32
|
+
"target_type_slug": "item",
|
|
33
|
+
"relationship_type": "many-to-many",
|
|
34
34
|
"forward_label": "analyzed by",
|
|
35
35
|
"reverse_label": "analysis of"
|
|
36
36
|
},
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"slug": "tagged_with",
|
|
41
41
|
"name": "Tagged With",
|
|
42
42
|
"description": "Entity tagged with a specific tag",
|
|
43
|
-
"source_type_slug": "item",
|
|
44
|
-
"target_type_slug": "item",
|
|
45
|
-
"relationship_type": "many-to-many",
|
|
46
43
|
"config": {
|
|
44
|
+
"source_type_slug": "item",
|
|
45
|
+
"target_type_slug": "item",
|
|
46
|
+
"relationship_type": "many-to-many",
|
|
47
47
|
"forward_label": "tagged with",
|
|
48
48
|
"reverse_label": "applied to"
|
|
49
49
|
},
|
package/seed/roles.json
CHANGED
package/seed/triggers.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"description": "Automatically triggers case analysis when support tickets are resolved",
|
|
5
5
|
"trigger_type": "event",
|
|
6
6
|
"event_type": "item_updated",
|
|
7
|
-
"scope": "account",
|
|
8
7
|
"config": {
|
|
8
|
+
"scope": "account",
|
|
9
9
|
"filters": [
|
|
10
10
|
{ "field": "status", "value": "resolved", "operator": "$eq" },
|
|
11
11
|
{ "field": "type_id", "type_slug": "support_ticket", "operator": "$eq" }
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"description": "Processes funnel signals to update lead scores and lifecycle stages",
|
|
25
25
|
"trigger_type": "event",
|
|
26
26
|
"event_type": "item_created",
|
|
27
|
-
"scope": "account",
|
|
28
27
|
"config": {
|
|
28
|
+
"scope": "account",
|
|
29
29
|
"filters": {},
|
|
30
30
|
"type_slug": "funnel_signal",
|
|
31
31
|
"entity_type": "item"
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"description": "Hourly dashboard metric aggregation",
|
|
40
40
|
"trigger_type": "cron",
|
|
41
41
|
"event_type": null,
|
|
42
|
-
"scope": "account",
|
|
43
42
|
"config": {
|
|
43
|
+
"scope": "account",
|
|
44
44
|
"function": "funnel-timers.aggregation",
|
|
45
45
|
"schedule": "0 * * * *",
|
|
46
46
|
"timezone": "UTC",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"description": "Daily recalculation of account ratings for score decay",
|
|
56
56
|
"trigger_type": "cron",
|
|
57
57
|
"event_type": null,
|
|
58
|
-
"scope": "account",
|
|
59
58
|
"config": {
|
|
59
|
+
"scope": "account",
|
|
60
60
|
"function": "funnel-timers.scoreDecay",
|
|
61
61
|
"schedule": "59 23 * * *",
|
|
62
62
|
"timezone": "UTC",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"description": "Daily purge of expired anonymous sessions",
|
|
72
72
|
"trigger_type": "cron",
|
|
73
73
|
"event_type": null,
|
|
74
|
-
"scope": "account",
|
|
75
74
|
"config": {
|
|
75
|
+
"scope": "account",
|
|
76
76
|
"function": "funnel-timers.sessionCleanup",
|
|
77
77
|
"schedule": "0 2 * * *",
|
|
78
78
|
"timezone": "UTC",
|