@zodic/shared 0.0.13 → 0.0.15
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/db/migrations/0001_low_tattoo.sql +20 -0
- package/db/migrations/0002_condemned_turbo.sql +2 -0
- package/db/migrations/meta/0001_snapshot.json +1400 -0
- package/db/migrations/meta/0002_snapshot.json +1414 -0
- package/db/migrations/meta/_journal.json +14 -0
- package/db/schema.ts +37 -2
- package/package.json +1 -1
- package/types/scopes/cloudflare.ts +2 -0
- package/types/scopes/db.ts +44 -8
|
@@ -8,6 +8,20 @@
|
|
|
8
8
|
"when": 1737425706127,
|
|
9
9
|
"tag": "0000_dusty_green_goblin",
|
|
10
10
|
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "6",
|
|
15
|
+
"when": 1737478702290,
|
|
16
|
+
"tag": "0001_low_tattoo",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"idx": 2,
|
|
21
|
+
"version": "6",
|
|
22
|
+
"when": 1737480263536,
|
|
23
|
+
"tag": "0002_condemned_turbo",
|
|
24
|
+
"breakpoints": true
|
|
11
25
|
}
|
|
12
26
|
]
|
|
13
27
|
}
|
package/db/schema.ts
CHANGED
|
@@ -130,9 +130,9 @@ export const conceptCombinations = sqliteTable(
|
|
|
130
130
|
conceptId: text('concept_id')
|
|
131
131
|
.notNull()
|
|
132
132
|
.references(() => concepts.id, { onDelete: 'cascade' }),
|
|
133
|
-
planet1Sign: text('planet1_sign').notNull(),
|
|
133
|
+
planet1Sign: text('planet1_sign').notNull(),
|
|
134
134
|
planet2Sign: text('planet2_sign').notNull(),
|
|
135
|
-
planet3Sign: text('planet3_sign').notNull(),
|
|
135
|
+
planet3Sign: text('planet3_sign').notNull(),
|
|
136
136
|
combinationString: text('combination_string').notNull(), // e.g., "aries-cancer-leo"
|
|
137
137
|
},
|
|
138
138
|
(t) => [
|
|
@@ -200,6 +200,8 @@ export const userArtifacts = sqliteTable(
|
|
|
200
200
|
.references(() => artifacts.id, { onDelete: 'cascade' }),
|
|
201
201
|
gender: text('gender').notNull(), // Gender of the user or chosen archetype
|
|
202
202
|
archetypeId: text('archetype_id').notNull(), // Chosen archetype for the artifact
|
|
203
|
+
postImageId: text('post_image_id'), // URL for the Instagram post image
|
|
204
|
+
reelImageId: text('reel_image_id'), // URL for the Instagram reels/TikTok image
|
|
203
205
|
postImageUrl: text('post_image_url'), // URL for the Instagram post image
|
|
204
206
|
reelImageUrl: text('reel_image_url'), // URL for the Instagram reels/TikTok image
|
|
205
207
|
postGenerationId: text('post_generation_id'), // Leonardo's generation ID for the post image
|
|
@@ -255,6 +257,39 @@ export const generations = sqliteTable(
|
|
|
255
257
|
]
|
|
256
258
|
);
|
|
257
259
|
|
|
260
|
+
export const artifactFaceswap = sqliteTable(
|
|
261
|
+
'artifact_faceswap',
|
|
262
|
+
{
|
|
263
|
+
id: text('id').primaryKey(), // Use FaceSwap API task ID as the primary key
|
|
264
|
+
userArtifactId: text('user_artifact_id')
|
|
265
|
+
.notNull()
|
|
266
|
+
.references(() => userArtifacts.id, { onDelete: 'cascade' }),
|
|
267
|
+
faceSwappedImageUrl: text('face_swapped_image_url'), // Final URL of the face-swapped image
|
|
268
|
+
createdAt: integer('created_at', { mode: 'timestamp' }).default(
|
|
269
|
+
sql`CURRENT_TIMESTAMP`
|
|
270
|
+
),
|
|
271
|
+
updatedAt: integer('updated_at', { mode: 'timestamp' }).default(
|
|
272
|
+
sql`CURRENT_TIMESTAMP`
|
|
273
|
+
),
|
|
274
|
+
},
|
|
275
|
+
() => []
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
export const artifactVideoGeneration = sqliteTable(
|
|
279
|
+
'artifact_video_generation',
|
|
280
|
+
{
|
|
281
|
+
id: text('id').primaryKey(),
|
|
282
|
+
userArtifactId: text('user_artifact_id')
|
|
283
|
+
.notNull()
|
|
284
|
+
.references(() => userArtifacts.id, { onDelete: 'cascade' }),
|
|
285
|
+
videoStatus: text('video_status').default('pending'), // Status: "pending", "completed", "failed"
|
|
286
|
+
videoUrl: text('video_url'), // URL of the final video
|
|
287
|
+
description: text('description'), // Optional description for the video
|
|
288
|
+
duration: integer('duration'), // Duration of the video in seconds
|
|
289
|
+
},
|
|
290
|
+
(t) => [index('artifact_video_generation_status_idx').on(t.videoStatus)]
|
|
291
|
+
);
|
|
292
|
+
|
|
258
293
|
export const tokens = sqliteTable(
|
|
259
294
|
'tokens',
|
|
260
295
|
{
|
package/package.json
CHANGED
|
@@ -45,6 +45,7 @@ export type CentralBindings = {
|
|
|
45
45
|
ASTROLOGY_WESTERN_API_KEY: string;
|
|
46
46
|
ASTROLOGY_PDF_USER_ID: string;
|
|
47
47
|
ASTROLOGY_PDF_API_KEY: string;
|
|
48
|
+
PIAPI_API_KEY: string;
|
|
48
49
|
|
|
49
50
|
API_BASE_URL: string;
|
|
50
51
|
PUBLIC_GOOGLE_CLIENT_ID: string;
|
|
@@ -98,6 +99,7 @@ export type BackendBindings = Env &
|
|
|
98
99
|
| 'ASTROLOGY_PDF_USER_ID'
|
|
99
100
|
| 'AI'
|
|
100
101
|
| 'KV_USER_PRODUCT_STATUS'
|
|
102
|
+
| 'PIAPI_API_KEY'
|
|
101
103
|
>;
|
|
102
104
|
|
|
103
105
|
export type BackendCtx = Context<
|
package/types/scopes/db.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { InferInsertModel, InferSelectModel, Table } from 'drizzle-orm';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
artifacts,
|
|
4
|
+
astroFeatures,
|
|
5
|
+
astroHouses,
|
|
6
|
+
astroPlanets,
|
|
7
|
+
conceptCombinations,
|
|
8
|
+
concepts,
|
|
9
|
+
creditsTransactions,
|
|
4
10
|
generations,
|
|
5
|
-
products,
|
|
6
11
|
tokens,
|
|
12
|
+
userArtifacts,
|
|
13
|
+
userConcepts,
|
|
7
14
|
users,
|
|
8
15
|
} from '../../db/schema';
|
|
9
16
|
|
|
@@ -12,14 +19,43 @@ type NullableSelect<T extends Table> = InferSelectModel<T> | undefined | null;
|
|
|
12
19
|
export type SelectUser = NullableSelect<typeof users>;
|
|
13
20
|
export type InsertUser = InferInsertModel<typeof users>;
|
|
14
21
|
|
|
15
|
-
export type SelectAstrologicalData = InferSelectModel<typeof astrologicalData>;
|
|
16
|
-
export type InsertAstrologicalData = InferInsertModel<typeof astrologicalData>;
|
|
17
|
-
|
|
18
22
|
export type SelectGeneration = NullableSelect<typeof generations>;
|
|
19
23
|
export type InsertGeneration = InferInsertModel<typeof generations>;
|
|
20
24
|
|
|
21
|
-
export type SelectProduct = NullableSelect<typeof products>;
|
|
22
|
-
export type InsertProduct = InferInsertModel<typeof products>;
|
|
23
|
-
|
|
24
25
|
export type SelectToken = NullableSelect<typeof tokens>;
|
|
25
26
|
export type InsertToken = InferInsertModel<typeof tokens>;
|
|
27
|
+
|
|
28
|
+
export type SelectArtifact = NullableSelect<typeof artifacts>;
|
|
29
|
+
export type InsertArtifact = InferInsertModel<typeof artifacts>;
|
|
30
|
+
|
|
31
|
+
export type SelectAstroFeature = NullableSelect<typeof astroFeatures>;
|
|
32
|
+
export type InsertAstroFeature = InferInsertModel<typeof astroFeatures>;
|
|
33
|
+
|
|
34
|
+
export type SelectAstroHouse = NullableSelect<typeof astroHouses>;
|
|
35
|
+
export type InsertAstroHouse = InferInsertModel<typeof astroHouses>;
|
|
36
|
+
|
|
37
|
+
export type SelectAstroPlanet = NullableSelect<typeof astroPlanets>;
|
|
38
|
+
export type InsertAstroPlanet = InferInsertModel<typeof astroPlanets>;
|
|
39
|
+
|
|
40
|
+
export type SelectConceptCombination = NullableSelect<
|
|
41
|
+
typeof conceptCombinations
|
|
42
|
+
>;
|
|
43
|
+
export type InsertConceptCombination = InferInsertModel<
|
|
44
|
+
typeof conceptCombinations
|
|
45
|
+
>;
|
|
46
|
+
|
|
47
|
+
export type SelectConcept = NullableSelect<typeof concepts>;
|
|
48
|
+
export type InsertConcept = InferInsertModel<typeof concepts>;
|
|
49
|
+
|
|
50
|
+
export type SelectCreditsTransaction = NullableSelect<
|
|
51
|
+
typeof creditsTransactions
|
|
52
|
+
>;
|
|
53
|
+
export type InsertCreditsTransaction = InferInsertModel<
|
|
54
|
+
typeof creditsTransactions
|
|
55
|
+
>;
|
|
56
|
+
|
|
57
|
+
export type SelectUserArtifact = NullableSelect<typeof userArtifacts>;
|
|
58
|
+
export type InsertUserArtifact = InferInsertModel<typeof userArtifacts>;
|
|
59
|
+
|
|
60
|
+
export type SelectUserConcept = NullableSelect<typeof userConcepts>;
|
|
61
|
+
export type InsertUserConcept = InferInsertModel<typeof userConcepts>;
|