@zodic/shared 0.0.27 → 0.0.29

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.
@@ -15,6 +15,20 @@
15
15
  "when": 1737679840599,
16
16
  "tag": "0001_known_pretty_boy",
17
17
  "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "6",
22
+ "when": 1737680017244,
23
+ "tag": "0002_exotic_maria_hill",
24
+ "breakpoints": true
25
+ },
26
+ {
27
+ "idx": 3,
28
+ "version": "6",
29
+ "when": 1737680440619,
30
+ "tag": "0003_fearless_giant_girl",
31
+ "breakpoints": true
18
32
  }
19
33
  ]
20
34
  }
package/db/schema.ts CHANGED
@@ -21,6 +21,7 @@ export const users = sqliteTable(
21
21
  {
22
22
  id: text('id').primaryKey(),
23
23
  email: text('email').notNull().unique(),
24
+ passwordHash: text('password_hash'), // For password-based login, nullable if using only OAuth
24
25
  name: text('name').notNull(),
25
26
  profileImage: text('profile_image'),
26
27
  userPhotoId: text('user_photo_id'),
@@ -34,14 +35,19 @@ export const users = sqliteTable(
34
35
  latitude: real('latitude').notNull(),
35
36
  longitude: real('longitude').notNull(),
36
37
  tzone: real('tzone'), // Nullable for inferred timezone
37
- instagramUsername: text('instagram_username'), // Nullable for optional social media
38
- tiktokUsername: text('tiktok_username'), // Fix typo
38
+ instagramUsername: text('instagram_username').unique(), // Nullable for optional social media
39
+ tiktokUsername: text('tiktok_username').unique(), // Fix typo
40
+ oauthProvider: text('oauth_provider'), // e.g., "google", "facebook", "apple", nullable for password-based login
41
+ oauthProviderId: text('oauth_provider_id').unique(), // Unique identifier from the provider
39
42
  credits_balance: integer('credits_balance').default(0).notNull(),
40
43
  totalCreditsEarned: integer('total_credits_earned').default(0).notNull(),
41
44
  lastTransactionAt: integer('last_transaction_at', { mode: 'timestamp' }), // Nullable for no transactions
42
45
  ...timestampFields,
43
46
  },
44
- (t) => [index('users_email_idx').on(t.email)]
47
+ (t) => [
48
+ index('users_email_idx').on(t.email),
49
+ index('users_oauth_provider_idx').on(t.oauthProvider, t.oauthProviderId), // Index for efficient OAuth lookups
50
+ ]
45
51
  );
46
52
 
47
53
  export const creditsTransactions = sqliteTable(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {