@zodic/shared 0.0.216 → 0.0.218

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.
@@ -68,7 +68,6 @@ CREATE TABLE `astro_houses` (
68
68
  `house` integer NOT NULL,
69
69
  `sign` text NOT NULL,
70
70
  `degree` real NOT NULL,
71
- `sign_report` text,
72
71
  FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
73
72
  );
74
73
  --> statement-breakpoint
@@ -84,8 +83,6 @@ CREATE TABLE `astro_planets` (
84
83
  `norm_degree` real,
85
84
  `speed` real,
86
85
  `is_retro` integer,
87
- `sign_report` text,
88
- `house_report` text,
89
86
  FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
90
87
  );
91
88
  --> statement-breakpoint
@@ -111,6 +108,27 @@ CREATE TABLE `concepts` (
111
108
  );
112
109
  --> statement-breakpoint
113
110
  CREATE INDEX `concepts_name_idx` ON `concepts` (`name`);--> statement-breakpoint
111
+ CREATE TABLE `concepts_data` (
112
+ `id` text PRIMARY KEY NOT NULL,
113
+ `language` text NOT NULL,
114
+ `concept_slug` text NOT NULL,
115
+ `combination` text NOT NULL,
116
+ `name` text NOT NULL,
117
+ `description` text NOT NULL,
118
+ `content` text DEFAULT '[]',
119
+ `poem` text DEFAULT '[]',
120
+ `leonardo_prompt` text,
121
+ `post_images` text DEFAULT '[]',
122
+ `reel_images` text DEFAULT '[]',
123
+ `status` text DEFAULT 'idle',
124
+ `created_at` integer DEFAULT CURRENT_TIMESTAMP,
125
+ `updated_at` integer DEFAULT CURRENT_TIMESTAMP
126
+ );
127
+ --> statement-breakpoint
128
+ CREATE INDEX `concepts_data_language_idx` ON `concepts_data` (`language`);--> statement-breakpoint
129
+ CREATE INDEX `concepts_data_concept_slug_idx` ON `concepts_data` (`concept_slug`);--> statement-breakpoint
130
+ CREATE INDEX `concepts_data_combination_idx` ON `concepts_data` (`combination`);--> statement-breakpoint
131
+ CREATE INDEX `concepts_data_name_idx` ON `concepts_data` (`name`);--> statement-breakpoint
114
132
  CREATE TABLE `credits_transactions` (
115
133
  `id` text PRIMARY KEY NOT NULL,
116
134
  `user_id` text NOT NULL,
@@ -215,6 +233,7 @@ CREATE TABLE `users` (
215
233
  `latitude` real NOT NULL,
216
234
  `longitude` real NOT NULL,
217
235
  `tzone` real,
236
+ `birth_location` text NOT NULL,
218
237
  `instagram_username` text,
219
238
  `tiktok_username` text,
220
239
  `oauth_provider` text,
@@ -222,6 +241,7 @@ CREATE TABLE `users` (
222
241
  `credits_balance` integer DEFAULT 0 NOT NULL,
223
242
  `total_credits_earned` integer DEFAULT 0 NOT NULL,
224
243
  `last_transaction_at` integer,
244
+ `language` text NOT NULL,
225
245
  `created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
226
246
  `updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL
227
247
  );
@@ -237,6 +257,7 @@ CREATE TABLE `users_temp` (
237
257
  `email` text NOT NULL,
238
258
  `name` text NOT NULL,
239
259
  `profile_image` text,
260
+ `language` text NOT NULL,
240
261
  `oauth_provider` text,
241
262
  `oauth_provider_id` text,
242
263
  `created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "6",
3
3
  "dialect": "sqlite",
4
- "id": "ebe194b0-99ee-4e7e-be35-8440074ae3f6",
4
+ "id": "fe42ec0c-db02-4aad-a22b-3600cad51ac8",
5
5
  "prevId": "00000000-0000-0000-0000-000000000000",
6
6
  "tables": {
7
7
  "artifact_faceswap": {
@@ -480,13 +480,6 @@
480
480
  "primaryKey": false,
481
481
  "notNull": true,
482
482
  "autoincrement": false
483
- },
484
- "sign_report": {
485
- "name": "sign_report",
486
- "type": "text",
487
- "primaryKey": false,
488
- "notNull": false,
489
- "autoincrement": false
490
483
  }
491
484
  },
492
485
  "indexes": {
@@ -589,20 +582,6 @@
589
582
  "primaryKey": false,
590
583
  "notNull": false,
591
584
  "autoincrement": false
592
- },
593
- "sign_report": {
594
- "name": "sign_report",
595
- "type": "text",
596
- "primaryKey": false,
597
- "notNull": false,
598
- "autoincrement": false
599
- },
600
- "house_report": {
601
- "name": "house_report",
602
- "type": "text",
603
- "primaryKey": false,
604
- "notNull": false,
605
- "autoincrement": false
606
585
  }
607
586
  },
608
587
  "indexes": {
@@ -768,6 +747,150 @@
768
747
  "uniqueConstraints": {},
769
748
  "checkConstraints": {}
770
749
  },
750
+ "concepts_data": {
751
+ "name": "concepts_data",
752
+ "columns": {
753
+ "id": {
754
+ "name": "id",
755
+ "type": "text",
756
+ "primaryKey": true,
757
+ "notNull": true,
758
+ "autoincrement": false
759
+ },
760
+ "language": {
761
+ "name": "language",
762
+ "type": "text",
763
+ "primaryKey": false,
764
+ "notNull": true,
765
+ "autoincrement": false
766
+ },
767
+ "concept_slug": {
768
+ "name": "concept_slug",
769
+ "type": "text",
770
+ "primaryKey": false,
771
+ "notNull": true,
772
+ "autoincrement": false
773
+ },
774
+ "combination": {
775
+ "name": "combination",
776
+ "type": "text",
777
+ "primaryKey": false,
778
+ "notNull": true,
779
+ "autoincrement": false
780
+ },
781
+ "name": {
782
+ "name": "name",
783
+ "type": "text",
784
+ "primaryKey": false,
785
+ "notNull": true,
786
+ "autoincrement": false
787
+ },
788
+ "description": {
789
+ "name": "description",
790
+ "type": "text",
791
+ "primaryKey": false,
792
+ "notNull": true,
793
+ "autoincrement": false
794
+ },
795
+ "content": {
796
+ "name": "content",
797
+ "type": "text",
798
+ "primaryKey": false,
799
+ "notNull": false,
800
+ "autoincrement": false,
801
+ "default": "'[]'"
802
+ },
803
+ "poem": {
804
+ "name": "poem",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": false,
808
+ "autoincrement": false,
809
+ "default": "'[]'"
810
+ },
811
+ "leonardo_prompt": {
812
+ "name": "leonardo_prompt",
813
+ "type": "text",
814
+ "primaryKey": false,
815
+ "notNull": false,
816
+ "autoincrement": false
817
+ },
818
+ "post_images": {
819
+ "name": "post_images",
820
+ "type": "text",
821
+ "primaryKey": false,
822
+ "notNull": false,
823
+ "autoincrement": false,
824
+ "default": "'[]'"
825
+ },
826
+ "reel_images": {
827
+ "name": "reel_images",
828
+ "type": "text",
829
+ "primaryKey": false,
830
+ "notNull": false,
831
+ "autoincrement": false,
832
+ "default": "'[]'"
833
+ },
834
+ "status": {
835
+ "name": "status",
836
+ "type": "text",
837
+ "primaryKey": false,
838
+ "notNull": false,
839
+ "autoincrement": false,
840
+ "default": "'idle'"
841
+ },
842
+ "created_at": {
843
+ "name": "created_at",
844
+ "type": "integer",
845
+ "primaryKey": false,
846
+ "notNull": false,
847
+ "autoincrement": false,
848
+ "default": "CURRENT_TIMESTAMP"
849
+ },
850
+ "updated_at": {
851
+ "name": "updated_at",
852
+ "type": "integer",
853
+ "primaryKey": false,
854
+ "notNull": false,
855
+ "autoincrement": false,
856
+ "default": "CURRENT_TIMESTAMP"
857
+ }
858
+ },
859
+ "indexes": {
860
+ "concepts_data_language_idx": {
861
+ "name": "concepts_data_language_idx",
862
+ "columns": [
863
+ "language"
864
+ ],
865
+ "isUnique": false
866
+ },
867
+ "concepts_data_concept_slug_idx": {
868
+ "name": "concepts_data_concept_slug_idx",
869
+ "columns": [
870
+ "concept_slug"
871
+ ],
872
+ "isUnique": false
873
+ },
874
+ "concepts_data_combination_idx": {
875
+ "name": "concepts_data_combination_idx",
876
+ "columns": [
877
+ "combination"
878
+ ],
879
+ "isUnique": false
880
+ },
881
+ "concepts_data_name_idx": {
882
+ "name": "concepts_data_name_idx",
883
+ "columns": [
884
+ "name"
885
+ ],
886
+ "isUnique": false
887
+ }
888
+ },
889
+ "foreignKeys": {},
890
+ "compositePrimaryKeys": {},
891
+ "uniqueConstraints": {},
892
+ "checkConstraints": {}
893
+ },
771
894
  "credits_transactions": {
772
895
  "name": "credits_transactions",
773
896
  "columns": {
@@ -1531,6 +1654,13 @@
1531
1654
  "notNull": false,
1532
1655
  "autoincrement": false
1533
1656
  },
1657
+ "birth_location": {
1658
+ "name": "birth_location",
1659
+ "type": "text",
1660
+ "primaryKey": false,
1661
+ "notNull": true,
1662
+ "autoincrement": false
1663
+ },
1534
1664
  "instagram_username": {
1535
1665
  "name": "instagram_username",
1536
1666
  "type": "text",
@@ -1582,6 +1712,13 @@
1582
1712
  "notNull": false,
1583
1713
  "autoincrement": false
1584
1714
  },
1715
+ "language": {
1716
+ "name": "language",
1717
+ "type": "text",
1718
+ "primaryKey": false,
1719
+ "notNull": true,
1720
+ "autoincrement": false
1721
+ },
1585
1722
  "created_at": {
1586
1723
  "name": "created_at",
1587
1724
  "type": "integer",
@@ -1680,6 +1817,13 @@
1680
1817
  "notNull": false,
1681
1818
  "autoincrement": false
1682
1819
  },
1820
+ "language": {
1821
+ "name": "language",
1822
+ "type": "text",
1823
+ "primaryKey": false,
1824
+ "notNull": true,
1825
+ "autoincrement": false
1826
+ },
1683
1827
  "oauth_provider": {
1684
1828
  "name": "oauth_provider",
1685
1829
  "type": "text",
@@ -5,29 +5,8 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "6",
8
- "when": 1738681330421,
9
- "tag": "0000_material_lionheart",
10
- "breakpoints": true
11
- },
12
- {
13
- "idx": 1,
14
- "version": "6",
15
- "when": 1738686365360,
16
- "tag": "0001_wild_ironclad",
17
- "breakpoints": true
18
- },
19
- {
20
- "idx": 2,
21
- "version": "6",
22
- "when": 1739191361351,
23
- "tag": "0002_sparkling_madame_masque",
24
- "breakpoints": true
25
- },
26
- {
27
- "idx": 3,
28
- "version": "6",
29
- "when": 1739193677404,
30
- "tag": "0003_productive_shriek",
8
+ "when": 1739835511480,
9
+ "tag": "0000_little_sleeper",
31
10
  "breakpoints": true
32
11
  }
33
12
  ]
package/db/schema.ts CHANGED
@@ -52,6 +52,32 @@ export const users = sqliteTable(
52
52
  ]
53
53
  );
54
54
 
55
+ export const conceptsData = sqliteTable(
56
+ 'concepts_data',
57
+ {
58
+ id: text('id').primaryKey(), // Unique identifier (matches KV key)
59
+ language: text('language').notNull(), // 'en-us' or 'pt-br'
60
+ conceptSlug: text('concept_slug').notNull(), // Concept type ('crown', 'amulet', etc.)
61
+ combination: text('combination').notNull(), // Zodiac combination ('aries-taurus-libra')
62
+ name: text('name').notNull(), // Concept name
63
+ description: text('description').notNull(), // Concept description
64
+ content: text('content').default('[]'), // JSON stringified array
65
+ poem: text('poem').default('[]'), // JSON stringified array
66
+ leonardoPrompt: text('leonardo_prompt'), // Leonardo AI prompt
67
+ postImages: text('post_images').default('[]'), // JSON stringified array
68
+ reelImages: text('reel_images').default('[]'), // JSON stringified array
69
+ status: text('status').default('idle'), // Processing status
70
+ createdAt: integer('created_at').default(sql`CURRENT_TIMESTAMP`),
71
+ updatedAt: integer('updated_at').default(sql`CURRENT_TIMESTAMP`),
72
+ },
73
+ (table) => [
74
+ index('concepts_data_language_idx').on(table.language),
75
+ index('concepts_data_concept_slug_idx').on(table.conceptSlug),
76
+ index('concepts_data_combination_idx').on(table.combination),
77
+ index('concepts_data_name_idx').on(table.name),
78
+ ]
79
+ );
80
+
55
81
  export const usersTemp = sqliteTable(
56
82
  'users_temp',
57
83
  {
package/drizzle.config.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { defineConfig } from 'drizzle-kit';
2
2
 
3
3
  export default defineConfig({
4
- schema: './db/schema.ts', // Path to your Drizzle-ORM schema
5
- out: './db/migrations', // Path to store generated migrations
4
+ schema: './db/schema.ts',
5
+ out: './db/migrations',
6
6
  dialect: 'sqlite',
7
- driver: 'd1-http', // Use "sqlite" for D1 Database
7
+ driver: 'd1-http',
8
8
  casing: 'snake_case',
9
9
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.216",
3
+ "version": "0.0.218",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -245,4 +245,40 @@ export const buildLLMMessages = (env: BackendBindings) => ({
245
245
  },
246
246
  ];
247
247
  },
248
+
249
+ translateENConceptName: ({ englishName }: { englishName: string }): ChatMessages => [
250
+ {
251
+ role: 'system',
252
+ content: `
253
+ You are a skilled translator specializing in symbolic and mystical naming. Your task is to accurately translate an English concept name into Brazilian Portuguese while preserving its poetic and symbolic meaning.
254
+
255
+ **Guidelines:**
256
+ - Do not translate word-for-word; maintain the symbolic depth.
257
+ - Ensure the translated name follows correct Portuguese grammar.
258
+ - Preserve any article usage:
259
+ - "The Crown of..." → "A Coroa de..."
260
+ - "The Lantern of..." → "A Candeia de..."
261
+ - "The Ring of..." → "O Anel de..."
262
+ - "The Amulet of..." → "O Amuleto de..."
263
+ - "The Orb of..." → "O Orbe de..."
264
+ - "The Scepter of..." → "O Cetro de..."
265
+ - Do not add extra words or change the intended meaning.
266
+
267
+ **Input:**
268
+ - English Name: "${englishName}"
269
+
270
+ **Output Format:**
271
+ - Return only the translated name without any explanation.
272
+
273
+ **Example Translations:**
274
+ - "The Crown of Radiant Grace" → "A Coroa de Graça Radiante"
275
+ - "The Lantern of Guiding Light" → "A Candeia de Luz Guia"
276
+ - "The Ring of Eternal Vows" → "O Anel de Votos Eternos"
277
+ `,
278
+ },
279
+ {
280
+ role: 'user',
281
+ content: `Translate this concept name into Brazilian Portuguese: "${englishName}"`,
282
+ },
283
+ ],
248
284
  });
@@ -1 +0,0 @@
1
- ALTER TABLE `users` ADD `birth_location` text NOT NULL;
@@ -1,4 +0,0 @@
1
- ALTER TABLE `users` ADD `language` text;--> statement-breakpoint
2
- ALTER TABLE `astro_houses` DROP COLUMN `sign_report`;--> statement-breakpoint
3
- ALTER TABLE `astro_planets` DROP COLUMN `sign_report`;--> statement-breakpoint
4
- ALTER TABLE `astro_planets` DROP COLUMN `house_report`;
@@ -1,42 +0,0 @@
1
- PRAGMA foreign_keys=OFF;--> statement-breakpoint
2
- CREATE TABLE `__new_users` (
3
- `id` text PRIMARY KEY NOT NULL,
4
- `email` text NOT NULL,
5
- `password_hash` text,
6
- `name` text NOT NULL,
7
- `profile_image` text,
8
- `user_photo_id` text,
9
- `user_photo_url` text,
10
- `gender` text,
11
- `day` integer NOT NULL,
12
- `month` integer NOT NULL,
13
- `year` integer NOT NULL,
14
- `hour` integer,
15
- `min` integer,
16
- `latitude` real NOT NULL,
17
- `longitude` real NOT NULL,
18
- `tzone` real,
19
- `birth_location` text NOT NULL,
20
- `instagram_username` text,
21
- `tiktok_username` text,
22
- `oauth_provider` text,
23
- `oauth_provider_id` text,
24
- `credits_balance` integer DEFAULT 0 NOT NULL,
25
- `total_credits_earned` integer DEFAULT 0 NOT NULL,
26
- `last_transaction_at` integer,
27
- `language` text NOT NULL,
28
- `created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
29
- `updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL
30
- );
31
- --> statement-breakpoint
32
- INSERT INTO `__new_users`("id", "email", "password_hash", "name", "profile_image", "user_photo_id", "user_photo_url", "gender", "day", "month", "year", "hour", "min", "latitude", "longitude", "tzone", "birth_location", "instagram_username", "tiktok_username", "oauth_provider", "oauth_provider_id", "credits_balance", "total_credits_earned", "last_transaction_at", "language", "created_at", "updated_at") SELECT "id", "email", "password_hash", "name", "profile_image", "user_photo_id", "user_photo_url", "gender", "day", "month", "year", "hour", "min", "latitude", "longitude", "tzone", "birth_location", "instagram_username", "tiktok_username", "oauth_provider", "oauth_provider_id", "credits_balance", "total_credits_earned", "last_transaction_at", "language", "created_at", "updated_at" FROM `users`;--> statement-breakpoint
33
- DROP TABLE `users`;--> statement-breakpoint
34
- ALTER TABLE `__new_users` RENAME TO `users`;--> statement-breakpoint
35
- PRAGMA foreign_keys=ON;--> statement-breakpoint
36
- CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint
37
- CREATE UNIQUE INDEX `users_instagram_username_unique` ON `users` (`instagram_username`);--> statement-breakpoint
38
- CREATE UNIQUE INDEX `users_tiktok_username_unique` ON `users` (`tiktok_username`);--> statement-breakpoint
39
- CREATE UNIQUE INDEX `users_oauth_provider_id_unique` ON `users` (`oauth_provider_id`);--> statement-breakpoint
40
- CREATE INDEX `users_email_idx` ON `users` (`email`);--> statement-breakpoint
41
- CREATE INDEX `users_oauth_provider_idx` ON `users` (`oauth_provider`,`oauth_provider_id`);--> statement-breakpoint
42
- ALTER TABLE `users_temp` ADD `language` text NOT NULL;