@zodic/shared 0.0.389 → 0.0.391
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/schema.ts +2 -0
- package/package.json +1 -1
- package/types/scopes/cloudflare.ts +10 -1
- package/utils/index.ts +3 -1
package/db/schema.ts
CHANGED
|
@@ -396,6 +396,8 @@ export const userArtifacts = sqliteTable(
|
|
|
396
396
|
postImages: text('post_images'), // Stringified JSON array of { id: string, url: string } for up to 6 post images
|
|
397
397
|
reelImages: text('reel_images'), // Stringified JSON array of { id: string, url: string } for up to 6 reel images (if used)
|
|
398
398
|
chosenImageUrl: text('chosen_image_url'), // URL of the single image chosen by the user
|
|
399
|
+
upscaledImage: text('upscaled_image'), // { id: string, url: string }
|
|
400
|
+
framedImage: text('framed_image'), // { id: string, url: string }
|
|
399
401
|
status: text('status')
|
|
400
402
|
.default('pending') // Possible statuses: 'pending', 'post_ready', 'reel_ready', 'completed', 'revealed'
|
|
401
403
|
.notNull(),
|
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@ import type { Container } from 'inversify';
|
|
|
12
12
|
|
|
13
13
|
export type Environment = 'dev' | 'stg' | 'prod';
|
|
14
14
|
|
|
15
|
+
export type SECRETS_STORE_SECRET = {
|
|
16
|
+
get: () => Promise<string>;
|
|
17
|
+
};
|
|
18
|
+
|
|
15
19
|
export type CentralBindings = {
|
|
16
20
|
TEST_IMAGES_BUCKET: R2Bucket;
|
|
17
21
|
PHOTOS_BUCKET: R2Bucket;
|
|
@@ -51,7 +55,7 @@ export type CentralBindings = {
|
|
|
51
55
|
AI: Ai;
|
|
52
56
|
DB: D1Database;
|
|
53
57
|
DRIZZLE: DrizzleD1Database;
|
|
54
|
-
JWT_SECRET:
|
|
58
|
+
JWT_SECRET: SECRETS_STORE_SECRET;
|
|
55
59
|
CLOUDFLARE_DATABASE_ID: string;
|
|
56
60
|
CLOUDFLARE_D1_TOKEN: string;
|
|
57
61
|
CLOUDFLARE_ACCOUNT_ID: string;
|
|
@@ -74,6 +78,9 @@ export type CentralBindings = {
|
|
|
74
78
|
TOGETHER_API_KEY: string;
|
|
75
79
|
ENV: Environment;
|
|
76
80
|
|
|
81
|
+
ASAAS_API_URL: string;
|
|
82
|
+
ASAAS_API_KEY: string;
|
|
83
|
+
|
|
77
84
|
API_BASE_URL: string;
|
|
78
85
|
PUBLIC_GOOGLE_CLIENT_ID: string;
|
|
79
86
|
PUBLIC_FACEBOOK_CLIENT_ID: string;
|
|
@@ -145,6 +152,8 @@ export type BackendBindings = Env &
|
|
|
145
152
|
| 'KV_CONCEPT_CACHE'
|
|
146
153
|
| 'ENV'
|
|
147
154
|
| 'FACESWAP_QUEUE'
|
|
155
|
+
| 'ASAAS_API_KEY'
|
|
156
|
+
| 'ASAAS_API_URL'
|
|
148
157
|
>;
|
|
149
158
|
|
|
150
159
|
export type BackendCtx = Context<
|
package/utils/index.ts
CHANGED
|
@@ -12,7 +12,9 @@ export const verifyToken = async (
|
|
|
12
12
|
c: AuthCtx,
|
|
13
13
|
token: string
|
|
14
14
|
): Promise<{ userId: string; email?: string; roles?: string[] }> => {
|
|
15
|
-
const jwtSecret = c.env.JWT_SECRET;
|
|
15
|
+
const jwtSecret = await c.env.JWT_SECRET.get();
|
|
16
|
+
console.log('JWT_SECRET: ', c.env.JWT_SECRET)
|
|
17
|
+
console.log('JWT_SECRET.get(): ', jwtSecret)
|
|
16
18
|
const audience = c.env.GOOGLE_OAUTH_CLIENT_ID;
|
|
17
19
|
const issuer = 'https://accounts.google.com';
|
|
18
20
|
|