@zodic/shared 0.0.275 → 0.0.276
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/app/services/ConceptService.ts +18 -2
- package/db/schema.ts +3 -3
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
astroDescriptionTemplates,
|
|
14
14
|
astroFeatureReports,
|
|
15
15
|
astroReports,
|
|
16
|
+
concepts,
|
|
16
17
|
conceptsData,
|
|
17
18
|
houseReports,
|
|
18
19
|
} from '../../db/schema';
|
|
@@ -20,11 +21,11 @@ import {
|
|
|
20
21
|
AstrologicalReport,
|
|
21
22
|
AstroReportParams,
|
|
22
23
|
AstroReportRow,
|
|
24
|
+
BackendCtx,
|
|
23
25
|
ChatMessages,
|
|
24
26
|
Concept,
|
|
25
27
|
ControlNetConfig,
|
|
26
28
|
DescriptionTemplateRow,
|
|
27
|
-
Languages,
|
|
28
29
|
} from '../../types';
|
|
29
30
|
import {
|
|
30
31
|
KVConcept,
|
|
@@ -40,6 +41,21 @@ import { AppContext } from '../base/AppContext';
|
|
|
40
41
|
export class ConceptService {
|
|
41
42
|
constructor(@inject(AppContext) private context: AppContext) {}
|
|
42
43
|
|
|
44
|
+
async getAllConcepts(c: BackendCtx) {
|
|
45
|
+
const drizzle = this.context.drizzle();
|
|
46
|
+
const conceptsList = await drizzle
|
|
47
|
+
.select({
|
|
48
|
+
slug: concepts.slug,
|
|
49
|
+
planet1: concepts.planet1,
|
|
50
|
+
planet2: concepts.planet2,
|
|
51
|
+
planet3: concepts.planet3,
|
|
52
|
+
})
|
|
53
|
+
.from(concepts)
|
|
54
|
+
.execute();
|
|
55
|
+
|
|
56
|
+
return c.json(conceptsList);
|
|
57
|
+
}
|
|
58
|
+
|
|
43
59
|
/**
|
|
44
60
|
* Generate basic info for a concept: name, description, and poem.
|
|
45
61
|
*/
|
|
@@ -870,7 +886,7 @@ export class ConceptService {
|
|
|
870
886
|
and(
|
|
871
887
|
eq(conceptsData.conceptSlug, conceptSlug),
|
|
872
888
|
eq(conceptsData.combination, combinationString),
|
|
873
|
-
eq(conceptsData.language,
|
|
889
|
+
eq(conceptsData.language, 'en-us') // ✅ Fetch both languages
|
|
874
890
|
)
|
|
875
891
|
)
|
|
876
892
|
.limit(1);
|
package/db/schema.ts
CHANGED
|
@@ -61,8 +61,8 @@ export const conceptsData = sqliteTable(
|
|
|
61
61
|
combination: text('combination').notNull(), // Zodiac combination ('aries-taurus-libra')
|
|
62
62
|
name: text('name').notNull(), // Concept name
|
|
63
63
|
description: text('description').notNull(), // Concept description
|
|
64
|
-
content: text('content').default('[]'), // JSON stringified array
|
|
65
|
-
poem: text('poem').default('[]'), // JSON stringified array
|
|
64
|
+
content: text('content').default('[]').notNull(), // JSON stringified array
|
|
65
|
+
poem: text('poem').default('[]').notNull(), // JSON stringified array
|
|
66
66
|
leonardoPrompt: text('leonardo_prompt'), // Leonardo AI prompt
|
|
67
67
|
postImages: text('post_images').default('[]'), // JSON stringified array
|
|
68
68
|
reelImages: text('reel_images').default('[]'), // JSON stringified array
|
|
@@ -298,7 +298,7 @@ export const concepts = sqliteTable(
|
|
|
298
298
|
slug: text('slug').notNull(), // Name of the Concept (e.g., "crown", "amulet")
|
|
299
299
|
planet1: text('planet1').notNull(), // First planet (e.g., "sun")
|
|
300
300
|
planet2: text('planet2').notNull(), // Second planet (e.g., "moon")
|
|
301
|
-
planet3: text('planet3').notNull(), // Third planet (e.g., "
|
|
301
|
+
planet3: text('planet3').notNull(), // Third planet (e.g., "ascendant")
|
|
302
302
|
},
|
|
303
303
|
(t) => [index('concepts_name_idx').on(t.name)]
|
|
304
304
|
);
|