@zodic/shared 0.0.401 → 0.0.402
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/api/index.ts +0 -99
- package/app/base/AppContext.ts +0 -41
- package/app/services/ConceptService.ts +172 -244
- package/app/services/PaymentService.ts +61 -2
- package/db/migrations/{0000_little_sleeper.sql → 0000_workable_the_hand.sql} +197 -24
- package/db/migrations/meta/0000_snapshot.json +1663 -451
- package/db/migrations/meta/_journal.json +2 -156
- package/db/schema.ts +0 -31
- package/drizzle.config.ts +2 -2
- package/package.json +10 -5
- package/types/scopes/cloudflare.ts +2 -118
- package/types/scopes/generic.ts +0 -1
- package/utils/buildMessages.ts +1 -32
- package/wrangler.toml +24 -3
- package/app/durable/ConceptNameDO.ts +0 -199
- package/app/durable/index.ts +0 -1
- package/app/workflow/old/ArchetypeWorkflow.ts +0 -156
- package/db/migrations/0001_mysterious_mystique.sql +0 -47
- package/db/migrations/0002_reflective_firelord.sql +0 -13
- package/db/migrations/0003_thin_valeria_richards.sql +0 -28
- package/db/migrations/0004_loose_iron_monger.sql +0 -15
- package/db/migrations/0005_famous_cammi.sql +0 -26
- package/db/migrations/0006_fine_manta.sql +0 -1
- package/db/migrations/0007_typical_grim_reaper.sql +0 -1
- package/db/migrations/0008_fine_betty_brant.sql +0 -1
- package/db/migrations/0009_spooky_doctor_spectrum.sql +0 -20
- package/db/migrations/0010_tricky_lord_hawal.sql +0 -23
- package/db/migrations/0011_hard_king_bedlam.sql +0 -1
- package/db/migrations/0012_sudden_doctor_spectrum.sql +0 -27
- package/db/migrations/0013_lean_frightful_four.sql +0 -7
- package/db/migrations/0014_green_marvel_apes.sql +0 -10
- package/db/migrations/0015_zippy_sersi.sql +0 -10
- package/db/migrations/0016_awesome_squadron_sinister.sql +0 -1
- package/db/migrations/0017_vengeful_electro.sql +0 -1
- package/db/migrations/0018_wooden_sersi.sql +0 -16
- package/db/migrations/0019_abandoned_orphan.sql +0 -59
- package/db/migrations/0020_smiling_blob.sql +0 -1
- package/db/migrations/0021_flawless_wallflower.sql +0 -1
- package/db/migrations/0022_pale_marvex.sql +0 -1
- package/db/migrations/meta/0001_snapshot.json +0 -2200
- package/db/migrations/meta/0002_snapshot.json +0 -2284
- package/db/migrations/meta/0003_snapshot.json +0 -2417
- package/db/migrations/meta/0004_snapshot.json +0 -2417
- package/db/migrations/meta/0005_snapshot.json +0 -2417
- package/db/migrations/meta/0006_snapshot.json +0 -2425
- package/db/migrations/meta/0007_snapshot.json +0 -2433
- package/db/migrations/meta/0008_snapshot.json +0 -2425
- package/db/migrations/meta/0009_snapshot.json +0 -2425
- package/db/migrations/meta/0010_snapshot.json +0 -2594
- package/db/migrations/meta/0011_snapshot.json +0 -2602
- package/db/migrations/meta/0012_snapshot.json +0 -2602
- package/db/migrations/meta/0013_snapshot.json +0 -2649
- package/db/migrations/meta/0014_snapshot.json +0 -2723
- package/db/migrations/meta/0015_snapshot.json +0 -2711
- package/db/migrations/meta/0016_snapshot.json +0 -2715
- package/db/migrations/meta/0017_snapshot.json +0 -2723
- package/db/migrations/meta/0018_snapshot.json +0 -2834
- package/db/migrations/meta/0019_snapshot.json +0 -3244
- package/db/migrations/meta/0020_snapshot.json +0 -3252
- package/db/migrations/meta/0021_snapshot.json +0 -3254
- package/db/migrations/meta/0022_snapshot.json +0 -3260
|
@@ -5,162 +5,8 @@
|
|
|
5
5
|
{
|
|
6
6
|
"idx": 0,
|
|
7
7
|
"version": "6",
|
|
8
|
-
"when":
|
|
9
|
-
"tag": "
|
|
10
|
-
"breakpoints": true
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"idx": 1,
|
|
14
|
-
"version": "6",
|
|
15
|
-
"when": 1740077328339,
|
|
16
|
-
"tag": "0001_mysterious_mystique",
|
|
17
|
-
"breakpoints": true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"idx": 2,
|
|
21
|
-
"version": "6",
|
|
22
|
-
"when": 1740175232182,
|
|
23
|
-
"tag": "0002_reflective_firelord",
|
|
24
|
-
"breakpoints": true
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"idx": 3,
|
|
28
|
-
"version": "6",
|
|
29
|
-
"when": 1740256286190,
|
|
30
|
-
"tag": "0003_thin_valeria_richards",
|
|
31
|
-
"breakpoints": true
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"idx": 4,
|
|
35
|
-
"version": "6",
|
|
36
|
-
"when": 1742042357823,
|
|
37
|
-
"tag": "0004_loose_iron_monger",
|
|
38
|
-
"breakpoints": true
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"idx": 5,
|
|
42
|
-
"version": "6",
|
|
43
|
-
"when": 1742419128409,
|
|
44
|
-
"tag": "0005_famous_cammi",
|
|
45
|
-
"breakpoints": true
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"idx": 6,
|
|
49
|
-
"version": "6",
|
|
50
|
-
"when": 1742576766950,
|
|
51
|
-
"tag": "0006_fine_manta",
|
|
52
|
-
"breakpoints": true
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"idx": 7,
|
|
56
|
-
"version": "6",
|
|
57
|
-
"when": 1742661456728,
|
|
58
|
-
"tag": "0007_typical_grim_reaper",
|
|
59
|
-
"breakpoints": true
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"idx": 8,
|
|
63
|
-
"version": "6",
|
|
64
|
-
"when": 1742663641761,
|
|
65
|
-
"tag": "0008_fine_betty_brant",
|
|
66
|
-
"breakpoints": true
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"idx": 9,
|
|
70
|
-
"version": "6",
|
|
71
|
-
"when": 1742960145356,
|
|
72
|
-
"tag": "0009_spooky_doctor_spectrum",
|
|
73
|
-
"breakpoints": true
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"idx": 10,
|
|
77
|
-
"version": "6",
|
|
78
|
-
"when": 1743532594156,
|
|
79
|
-
"tag": "0010_tricky_lord_hawal",
|
|
80
|
-
"breakpoints": true
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"idx": 11,
|
|
84
|
-
"version": "6",
|
|
85
|
-
"when": 1743535219441,
|
|
86
|
-
"tag": "0011_hard_king_bedlam",
|
|
87
|
-
"breakpoints": true
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"idx": 12,
|
|
91
|
-
"version": "6",
|
|
92
|
-
"when": 1743545371795,
|
|
93
|
-
"tag": "0012_sudden_doctor_spectrum",
|
|
94
|
-
"breakpoints": true
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"idx": 13,
|
|
98
|
-
"version": "6",
|
|
99
|
-
"when": 1743645500734,
|
|
100
|
-
"tag": "0013_lean_frightful_four",
|
|
101
|
-
"breakpoints": true
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"idx": 14,
|
|
105
|
-
"version": "6",
|
|
106
|
-
"when": 1744920245024,
|
|
107
|
-
"tag": "0014_green_marvel_apes",
|
|
108
|
-
"breakpoints": true
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"idx": 15,
|
|
112
|
-
"version": "6",
|
|
113
|
-
"when": 1745556069821,
|
|
114
|
-
"tag": "0015_zippy_sersi",
|
|
115
|
-
"breakpoints": true
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"idx": 16,
|
|
119
|
-
"version": "6",
|
|
120
|
-
"when": 1745725919445,
|
|
121
|
-
"tag": "0016_awesome_squadron_sinister",
|
|
122
|
-
"breakpoints": true
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"idx": 17,
|
|
126
|
-
"version": "6",
|
|
127
|
-
"when": 1745948199947,
|
|
128
|
-
"tag": "0017_vengeful_electro",
|
|
129
|
-
"breakpoints": true
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"idx": 18,
|
|
133
|
-
"version": "6",
|
|
134
|
-
"when": 1745953419029,
|
|
135
|
-
"tag": "0018_wooden_sersi",
|
|
136
|
-
"breakpoints": true
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"idx": 19,
|
|
140
|
-
"version": "6",
|
|
141
|
-
"when": 1747277149960,
|
|
142
|
-
"tag": "0019_abandoned_orphan",
|
|
143
|
-
"breakpoints": true
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"idx": 20,
|
|
147
|
-
"version": "6",
|
|
148
|
-
"when": 1747599943965,
|
|
149
|
-
"tag": "0020_smiling_blob",
|
|
150
|
-
"breakpoints": true
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"idx": 21,
|
|
154
|
-
"version": "6",
|
|
155
|
-
"when": 1747600243276,
|
|
156
|
-
"tag": "0021_flawless_wallflower",
|
|
157
|
-
"breakpoints": true
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"idx": 22,
|
|
161
|
-
"version": "6",
|
|
162
|
-
"when": 1747798482763,
|
|
163
|
-
"tag": "0022_pale_marvex",
|
|
8
|
+
"when": 1748314522650,
|
|
9
|
+
"tag": "0000_workable_the_hand",
|
|
164
10
|
"breakpoints": true
|
|
165
11
|
}
|
|
166
12
|
]
|
package/db/schema.ts
CHANGED
|
@@ -177,24 +177,6 @@ export const usersTemp = sqliteTable(
|
|
|
177
177
|
(t) => [index('users_temp_email_idx').on(t.email)]
|
|
178
178
|
);
|
|
179
179
|
|
|
180
|
-
export const creditsTransactions = sqliteTable(
|
|
181
|
-
'credits_transactions',
|
|
182
|
-
{
|
|
183
|
-
id: text('id').primaryKey(), // Transaction ID
|
|
184
|
-
userId: text('user_id')
|
|
185
|
-
.notNull()
|
|
186
|
-
.references(() => users.id, { onDelete: 'cascade' }),
|
|
187
|
-
type: text('type').notNull(), // e.g., "purchase", "spend", "refund"
|
|
188
|
-
amount: integer('amount').notNull(), // Positive for additions, negative for deductions
|
|
189
|
-
description: text('description'), // Optional description (e.g., "Spent on Cosmic Mirror")
|
|
190
|
-
productType: text('product_type'), // e.g., "concept", "artifact", "astrology_report"
|
|
191
|
-
productId: text('product_id'), // Corresponding ID for the product (concept_id, artifact_id, etc.)
|
|
192
|
-
paymentId: text('payment_id').notNull(), // References the payment for purchases
|
|
193
|
-
...timestampFields,
|
|
194
|
-
},
|
|
195
|
-
(t) => [index('credits_transactions_user_id_idx').on(t.userId)]
|
|
196
|
-
);
|
|
197
|
-
|
|
198
180
|
export const astroPlanets = sqliteTable(
|
|
199
181
|
'astro_planets',
|
|
200
182
|
{
|
|
@@ -239,7 +221,6 @@ export const astroFeatures = sqliteTable(
|
|
|
239
221
|
name: text('name').notNull(), // e.g., "Fire", "Mutable", "First Quarter Moon"
|
|
240
222
|
description: text('description'), // Detailed description
|
|
241
223
|
percentage: real('percentage'), // For elements, modes, dominant sign
|
|
242
|
-
order: integer('order'), // For consistent display order
|
|
243
224
|
prominentId: integer('prominent_id'), // NEW: Highlighted option index (1-based)
|
|
244
225
|
},
|
|
245
226
|
(t) => [index('astro_features_user_id_idx').on(t.userId)]
|
|
@@ -525,18 +506,6 @@ export const archetypesData = sqliteTable(
|
|
|
525
506
|
]
|
|
526
507
|
);
|
|
527
508
|
|
|
528
|
-
export const archetypeNameDumps = sqliteTable(
|
|
529
|
-
'archetype_name_dumps',
|
|
530
|
-
{
|
|
531
|
-
id: text('id').primaryKey(), // combination
|
|
532
|
-
combination: text('combination').notNull(),
|
|
533
|
-
rawText: text('raw_text').notNull(),
|
|
534
|
-
parsedSuccessfully: integer('parsed_successfully').default(0),
|
|
535
|
-
createdAt: integer('created_at').default(sql`CURRENT_TIMESTAMP`),
|
|
536
|
-
},
|
|
537
|
-
() => []
|
|
538
|
-
);
|
|
539
|
-
|
|
540
509
|
export const generations = sqliteTable(
|
|
541
510
|
'generations',
|
|
542
511
|
{
|
package/drizzle.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zodic/shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.402",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"migrate-latest-
|
|
11
|
-
"migrate-latest": "wrangler d1 execute DB --file=$(ls -t ./db/migrations/*.sql | head -n 1) --remote --yes",
|
|
10
|
+
"migrate-latest-dev": "wrangler d1 execute DB --file=$(ls -t ./db/migrations/*.sql | head -n 1) --env ${ENV:-development}",
|
|
11
|
+
"migrate-latest-prod": "wrangler d1 execute DB --file=$(ls -t ./db/migrations/*.sql | head -n 1) --remote --yes --env ${ENV:-production}",
|
|
12
|
+
"migrate-latest-stg": "wrangler d1 execute DB --file=$(ls -t ./db/migrations/*.sql | head -n 1) --remote --yes --env ${ENV:-staging}",
|
|
12
13
|
"db:generate": "drizzle-kit generate",
|
|
13
14
|
"db:up": "drizzle-kit up",
|
|
14
15
|
"pub:db": "npm run db:generate && npm run db:up && npm run migrate-latest && npm version patch && npm publish",
|
|
16
|
+
"pub:db:prod": "ENV=production npm run db:generate && npm run db:up && npm run migrate-latest-prod && npm version patch && npm publish",
|
|
17
|
+
"pub:db:stg": "ENV=staging npm run db:generate && npm run db:up && npm run migrate-latest-stg && npm version patch && npm publish",
|
|
18
|
+
"pub:db:dev": "ENV=development npm run db:generate && npm run db:up && npm run migrate-latest-dev && npm version patch && npm publish",
|
|
15
19
|
"pub": "npm version patch && npm publish",
|
|
16
|
-
"reset-db": "wrangler d1 execute DB --command \"DROP TABLE IF EXISTS migrations;\" && npm run db:up && npm run migrate-latest"
|
|
20
|
+
"reset-db": "wrangler d1 execute DB --command \"DROP TABLE IF EXISTS migrations;\" --env ${ENV:-development} && npm run db:up && npm run migrate-latest"
|
|
17
21
|
},
|
|
18
22
|
"devDependencies": {
|
|
19
23
|
"@types/inversify": "^2.0.33",
|
|
@@ -34,6 +38,7 @@
|
|
|
34
38
|
"openai": "^4.81.0",
|
|
35
39
|
"p-map": "^7.0.3",
|
|
36
40
|
"reflect-metadata": "^0.2.2",
|
|
37
|
-
"uuid": "^11.0.5"
|
|
41
|
+
"uuid": "^11.0.5",
|
|
42
|
+
"wrangler": "4"
|
|
38
43
|
}
|
|
39
44
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Ai,
|
|
3
3
|
D1Database,
|
|
4
|
-
DurableObjectNamespace,
|
|
5
4
|
KVNamespace,
|
|
6
5
|
Queue,
|
|
7
6
|
R2Bucket,
|
|
@@ -17,43 +16,20 @@ export type SECRETS_STORE_SECRET = {
|
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
export type CentralBindings = {
|
|
20
|
-
TEST_IMAGES_BUCKET: R2Bucket;
|
|
21
19
|
COSMIC_MIRROR_BUCKET: R2Bucket;
|
|
22
20
|
CONCEPTS_BUCKET: R2Bucket;
|
|
23
21
|
PHOTOS_BUCKET: R2Bucket;
|
|
24
22
|
WHEEL_BUCKET: R2Bucket;
|
|
25
23
|
OPENAI_API_KEY: string;
|
|
26
24
|
LEONARDO_API_KEY: string;
|
|
27
|
-
DESCRIBER_API_KEY: string;
|
|
28
|
-
DESCRIBER_APP_ID: string;
|
|
29
|
-
AKOOL_API_KEY: string;
|
|
30
|
-
KV_COSMIC_MIRROR_ARCHETYPES: KVNamespace;
|
|
31
|
-
KV_COSMIC_MIRROR_MANAGEMENT: KVNamespace;
|
|
32
|
-
KV_CONCEPTS: KVNamespace;
|
|
33
|
-
KV_CONCEPTS_MANAGEMENT: KVNamespace;
|
|
34
25
|
KV_ASTRO: KVNamespace;
|
|
35
26
|
KV_CONCEPT_FAILURES: KVNamespace;
|
|
36
|
-
KV_CONCEPT_NAMES: KVNamespace;
|
|
37
27
|
KV_API_USAGE: KVNamespace;
|
|
38
|
-
KV_CONCEPT_CACHE: KVNamespace;
|
|
39
28
|
KV_OAUTH_STATE: KVNamespace;
|
|
40
29
|
CONCEPT_GENERATION_QUEUE: Queue;
|
|
41
|
-
CONCEPT_NAMES_DO: DurableObjectNamespace;
|
|
42
|
-
CROWN_QUEUE: Queue;
|
|
43
|
-
SCEPTER_QUEUE: Queue;
|
|
44
|
-
RING_QUEUE: Queue;
|
|
45
|
-
AMULET_QUEUE: Queue;
|
|
46
|
-
LANTERN_QUEUE: Queue;
|
|
47
|
-
ORB_QUEUE: Queue;
|
|
48
30
|
ARCHETYPE_POPULATION_QUEUE: Queue;
|
|
49
31
|
FACESWAP_QUEUE: Queue;
|
|
50
32
|
PAYMENT_QUEUE: Queue;
|
|
51
|
-
|
|
52
|
-
PROMPT_IMAGE_DESCRIBER: string;
|
|
53
|
-
PROMPT_GENERATE_ARCHETYPE_BASIC_INFO: string;
|
|
54
|
-
PROMPT_GENERATE_ARCHETYPE_CONTENT: string;
|
|
55
|
-
PROMPT_GENERATE_ARCHETYPE_LEONARDO_PROMPTS: string;
|
|
56
|
-
NEGATIVE_PROMPT_LEONARDO: string;
|
|
57
33
|
PROMPT_PERSONALIZE_COSMIC_MIRROR_LEONARDO_PROMPT: string;
|
|
58
34
|
AI: Ai;
|
|
59
35
|
DB: D1Database;
|
|
@@ -72,6 +48,7 @@ export type CentralBindings = {
|
|
|
72
48
|
FACEBOOK_OAUTH_CLIENT_ID: string;
|
|
73
49
|
FACEBOOK_OAUTH_CLIENT_SECRET: string;
|
|
74
50
|
OAUTH_REDIRECT_URI: string;
|
|
51
|
+
REDIRECT_PREFIX: string;
|
|
75
52
|
ASTROLOGY_WESTERN_USER_ID: string;
|
|
76
53
|
ASTROLOGY_WESTERN_API_KEY: string;
|
|
77
54
|
ASTROLOGY_PDF_USER_ID: string;
|
|
@@ -85,11 +62,6 @@ export type CentralBindings = {
|
|
|
85
62
|
ASAAS_API_KEY: string;
|
|
86
63
|
|
|
87
64
|
API_BASE_URL: string;
|
|
88
|
-
PUBLIC_GOOGLE_CLIENT_ID: string;
|
|
89
|
-
PUBLIC_FACEBOOK_CLIENT_ID: string;
|
|
90
|
-
PUBLIC_APP_NAME: string;
|
|
91
|
-
PUBLIC_APP_VERSION: string;
|
|
92
|
-
PUBLIC_ANALYTICS_ID?: string;
|
|
93
65
|
};
|
|
94
66
|
|
|
95
67
|
export type Variables = {
|
|
@@ -105,27 +77,14 @@ export type Variables = {
|
|
|
105
77
|
export type BackendBindings = Env &
|
|
106
78
|
Pick<
|
|
107
79
|
CentralBindings,
|
|
108
|
-
| 'TEST_IMAGES_BUCKET'
|
|
109
80
|
| 'COSMIC_MIRROR_BUCKET'
|
|
110
81
|
| 'CONCEPTS_BUCKET'
|
|
111
82
|
| 'PHOTOS_BUCKET'
|
|
112
83
|
| 'WHEEL_BUCKET'
|
|
113
84
|
| 'OPENAI_API_KEY'
|
|
114
85
|
| 'LEONARDO_API_KEY'
|
|
115
|
-
| 'DESCRIBER_API_KEY'
|
|
116
|
-
| 'DESCRIBER_APP_ID'
|
|
117
|
-
| 'AKOOL_API_KEY'
|
|
118
|
-
| 'KV_COSMIC_MIRROR_ARCHETYPES'
|
|
119
|
-
| 'KV_COSMIC_MIRROR_MANAGEMENT'
|
|
120
|
-
| 'KV_CONCEPTS'
|
|
121
86
|
| 'KV_ASTRO'
|
|
122
|
-
| 'KV_CONCEPTS_MANAGEMENT'
|
|
123
87
|
| 'KV_CONCEPT_FAILURES'
|
|
124
|
-
| 'KV_CONCEPT_NAMES'
|
|
125
|
-
| 'PROMPT_IMAGE_DESCRIBER'
|
|
126
|
-
| 'PROMPT_GENERATE_ARCHETYPE_CONTENT'
|
|
127
|
-
| 'PROMPT_GENERATE_ARCHETYPE_LEONARDO_PROMPTS'
|
|
128
|
-
| 'NEGATIVE_PROMPT_LEONARDO'
|
|
129
88
|
| 'PROMPT_PERSONALIZE_COSMIC_MIRROR_LEONARDO_PROMPT'
|
|
130
89
|
| 'DB'
|
|
131
90
|
| 'JWT_SECRET'
|
|
@@ -134,6 +93,7 @@ export type BackendBindings = Env &
|
|
|
134
93
|
| 'GOOGLE_SERVER_URL'
|
|
135
94
|
| 'FACEBOOK_SERVER_URL'
|
|
136
95
|
| 'OAUTH_REDIRECT_URI'
|
|
96
|
+
| 'REDIRECT_PREFIX'
|
|
137
97
|
| 'ASTROLOGY_WESTERN_API_KEY'
|
|
138
98
|
| 'ASTROLOGY_WESTERN_USER_ID'
|
|
139
99
|
| 'ASTROLOGY_PDF_API_KEY'
|
|
@@ -142,19 +102,10 @@ export type BackendBindings = Env &
|
|
|
142
102
|
| 'PIAPI_API_KEY'
|
|
143
103
|
| 'CONCEPT_GENERATION_QUEUE'
|
|
144
104
|
| 'DEEPSEEK_API_KEY'
|
|
145
|
-
| 'PROMPT_GENERATE_ARCHETYPE_BASIC_INFO'
|
|
146
105
|
| 'TOGETHER_API_KEY'
|
|
147
|
-
| 'CONCEPT_NAMES_DO'
|
|
148
106
|
| 'API_BASE_URL'
|
|
149
|
-
| 'CROWN_QUEUE'
|
|
150
|
-
| 'AMULET_QUEUE'
|
|
151
|
-
| 'SCEPTER_QUEUE'
|
|
152
|
-
| 'RING_QUEUE'
|
|
153
|
-
| 'LANTERN_QUEUE'
|
|
154
|
-
| 'ORB_QUEUE'
|
|
155
107
|
| 'ARCHETYPE_POPULATION_QUEUE'
|
|
156
108
|
| 'KV_API_USAGE'
|
|
157
|
-
| 'KV_CONCEPT_CACHE'
|
|
158
109
|
| 'ENV'
|
|
159
110
|
| 'FACESWAP_QUEUE'
|
|
160
111
|
| 'ASAAS_API_KEY'
|
|
@@ -171,27 +122,6 @@ export type BackendCtx = Context<
|
|
|
171
122
|
{}
|
|
172
123
|
>;
|
|
173
124
|
|
|
174
|
-
export type FrontendBindings = Pick<
|
|
175
|
-
CentralBindings,
|
|
176
|
-
| 'API_BASE_URL'
|
|
177
|
-
| 'PUBLIC_GOOGLE_CLIENT_ID'
|
|
178
|
-
| 'PUBLIC_FACEBOOK_CLIENT_ID'
|
|
179
|
-
| 'PUBLIC_APP_NAME'
|
|
180
|
-
| 'PUBLIC_APP_VERSION'
|
|
181
|
-
| 'PUBLIC_ANALYTICS_ID'
|
|
182
|
-
| 'KV_API_USAGE'
|
|
183
|
-
| 'ENV'
|
|
184
|
-
>;
|
|
185
|
-
|
|
186
|
-
export type FrontCtx = Context<
|
|
187
|
-
{
|
|
188
|
-
Bindings: FrontendBindings;
|
|
189
|
-
Variables: Variables;
|
|
190
|
-
},
|
|
191
|
-
any,
|
|
192
|
-
{}
|
|
193
|
-
>;
|
|
194
|
-
|
|
195
125
|
export type AuthBindings = Env &
|
|
196
126
|
Pick<
|
|
197
127
|
CentralBindings,
|
|
@@ -220,49 +150,3 @@ export type AuthCtx = Context<
|
|
|
220
150
|
any,
|
|
221
151
|
{}
|
|
222
152
|
>;
|
|
223
|
-
|
|
224
|
-
export type Bindings = Env & {
|
|
225
|
-
TEST_IMAGES_BUCKET: R2Bucket;
|
|
226
|
-
PHOTOS_BUCKET: R2Bucket;
|
|
227
|
-
OPENAI_API_KEY: string;
|
|
228
|
-
LEONARDO_API_KEY: string;
|
|
229
|
-
DESCRIBER_API_KEY: string;
|
|
230
|
-
DESCRIBER_APP_ID: string;
|
|
231
|
-
AKOOL_API_KEY: string;
|
|
232
|
-
KV_GENERATION_MANAGEMENT: KVNamespace;
|
|
233
|
-
KV_USER_GENERATIONS: KVNamespace;
|
|
234
|
-
KV_COSMIC_MIRROR_ARCHETYPES: KVNamespace;
|
|
235
|
-
KV_LEONARDO_PROMPTS: KVNamespace;
|
|
236
|
-
KV_TEST: KVNamespace;
|
|
237
|
-
PROMPT_IMAGE_DESCRIBER: string;
|
|
238
|
-
PROMPT_GENERATE_ARCHETYPE: string;
|
|
239
|
-
PROMPT_GENERATE_LEONARDO: string;
|
|
240
|
-
NEGATIVE_PROMPT_LEONARDO: string;
|
|
241
|
-
PROMPT_GENERATE_USER_LUMINOUS_SELF: string;
|
|
242
|
-
AI: Ai;
|
|
243
|
-
DB: D1Database;
|
|
244
|
-
JWT_SECRET: string;
|
|
245
|
-
CLOUDFLARE_DATABASE_ID: string;
|
|
246
|
-
CLOUDFLARE_D1_TOKEN: string;
|
|
247
|
-
CLOUDFLARE_ACCOUNT_ID: string;
|
|
248
|
-
ISSUER: string;
|
|
249
|
-
GOOGLE_API_KEY: string;
|
|
250
|
-
GOOGLE_SERVER_URL: string;
|
|
251
|
-
GOOGLE_CLIENT_ID: string;
|
|
252
|
-
GOOGLE_CLIENT_SECRET: string;
|
|
253
|
-
FACEBOOK_SERVER_URL: string;
|
|
254
|
-
FACEBOOK_CLIENT_ID: string;
|
|
255
|
-
FACEBOOK_CLIENT_SECRET: string;
|
|
256
|
-
OAUTH_REDIRECT_URI: string;
|
|
257
|
-
ASTROLOGY_API_USER: string;
|
|
258
|
-
ASTROLOGY_API_KEY: string;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export type Ctx = Context<
|
|
262
|
-
{
|
|
263
|
-
Bindings: Bindings;
|
|
264
|
-
Variables: Variables;
|
|
265
|
-
},
|
|
266
|
-
any,
|
|
267
|
-
{}
|
|
268
|
-
>;
|
package/types/scopes/generic.ts
CHANGED
package/utils/buildMessages.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
BackendBindings,
|
|
4
4
|
ChatMessages,
|
|
5
5
|
Concept,
|
|
6
|
-
Crown,
|
|
7
6
|
} from '../types';
|
|
8
7
|
import { astroPrompts } from './astroPrompts';
|
|
9
8
|
import { conceptPrompts } from './conceptPrompts';
|
|
@@ -116,7 +115,7 @@ export const buildLLMMessages = (env: BackendBindings) => ({
|
|
|
116
115
|
combination: string;
|
|
117
116
|
}): ChatMessages => {
|
|
118
117
|
const [sun, ascendant, moon] = combination.split('-');
|
|
119
|
-
|
|
118
|
+
|
|
120
119
|
return [
|
|
121
120
|
{
|
|
122
121
|
role: 'system',
|
|
@@ -458,36 +457,6 @@ export const buildLLMMessages = (env: BackendBindings) => ({
|
|
|
458
457
|
},
|
|
459
458
|
],
|
|
460
459
|
|
|
461
|
-
// generateCosmicMirrorArchetypeContent: ({
|
|
462
|
-
// name,
|
|
463
|
-
// description,
|
|
464
|
-
// sun,
|
|
465
|
-
// ascendant,
|
|
466
|
-
// moon,
|
|
467
|
-
// }: {
|
|
468
|
-
// name: string;
|
|
469
|
-
// description: string;
|
|
470
|
-
// sun: string;
|
|
471
|
-
// ascendant: string;
|
|
472
|
-
// moon: string;
|
|
473
|
-
// }): ChatMessages => [
|
|
474
|
-
// {
|
|
475
|
-
// role: 'system',
|
|
476
|
-
// content: env.PROMPT_GENERATE_ARCHETYPE_CONTENT,
|
|
477
|
-
// },
|
|
478
|
-
// {
|
|
479
|
-
// role: 'user',
|
|
480
|
-
// content: `
|
|
481
|
-
// Generate a detailed archetype description using the following inputs:
|
|
482
|
-
|
|
483
|
-
// Archetype Name: ${name}
|
|
484
|
-
// Archetype Description: ${description}
|
|
485
|
-
// Sun Sign: ${sun}
|
|
486
|
-
// Ascendant Sign: ${ascendant}
|
|
487
|
-
// Moon Sign: ${moon}
|
|
488
|
-
// `,
|
|
489
|
-
// },
|
|
490
|
-
// ],
|
|
491
460
|
personalizeCosmicMirrorLeonardoPrompt: ({
|
|
492
461
|
leonardoPrompt,
|
|
493
462
|
traits,
|
package/wrangler.toml
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
# wrangler.toml in shared folder
|
|
2
1
|
name = "shared-migrations"
|
|
3
2
|
compatibility_date = "2024-12-10"
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
# Default (used for local/dev if no env specified)
|
|
5
|
+
[[d1_databases]]
|
|
6
|
+
binding = "DB"
|
|
7
|
+
database_name = "zodic-db-dev"
|
|
8
|
+
database_id = "23e0ee5c-6a17-40ee-b731-4f52913501db"
|
|
9
|
+
|
|
10
|
+
# Production environment
|
|
11
|
+
[env.production]
|
|
12
|
+
[[env.production.d1_databases]]
|
|
6
13
|
binding = "DB"
|
|
7
14
|
database_name = "zodic-db"
|
|
8
|
-
database_id = "b4b0a981-f921-4258-ad7a-b2d7b50eb381"
|
|
15
|
+
database_id = "b4b0a981-f921-4258-ad7a-b2d7b50eb381"
|
|
16
|
+
|
|
17
|
+
# Staging environment
|
|
18
|
+
[env.staging]
|
|
19
|
+
[[env.staging.d1_databases]]
|
|
20
|
+
binding = "DB"
|
|
21
|
+
database_name = "zodic-db-stg"
|
|
22
|
+
database_id = "3ef831f8-c65e-4e6b-b8b8-934628da14cf"
|
|
23
|
+
|
|
24
|
+
# Development environment
|
|
25
|
+
[env.development]
|
|
26
|
+
[[env.development.d1_databases]]
|
|
27
|
+
binding = "DB"
|
|
28
|
+
database_name = "zodic-db-dev"
|
|
29
|
+
database_id = "23e0ee5c-6a17-40ee-b731-4f52913501db"
|