spudmobile-bridge 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/dist/supabase.js +19 -2
  2. package/package.json +1 -1
package/dist/supabase.js CHANGED
@@ -171,12 +171,29 @@ export class SupabaseBridge {
171
171
  * Activate a device pair using the pair code from callback
172
172
  */
173
173
  async activatePair(pairCode) {
174
- const { data: pair, error: findError } = await this.client
174
+ // Try finding by pair_code first (8-char hex codes)
175
+ let pair = null;
176
+ const { data: byCode } = await this.client
175
177
  .from('device_pairs')
176
178
  .select('id')
177
179
  .eq('pair_code', pairCode)
178
180
  .single();
179
- if (findError || !pair) {
181
+ if (byCode) {
182
+ pair = byCode;
183
+ }
184
+ else {
185
+ // Fallback: the token might be ios_device_id (UUID from the connect edge function)
186
+ const { data: byDevice } = await this.client
187
+ .from('device_pairs')
188
+ .select('id')
189
+ .ilike('ios_device_id', pairCode)
190
+ .eq('is_active', true)
191
+ .order('created_at', { ascending: false })
192
+ .limit(1)
193
+ .single();
194
+ pair = byDevice;
195
+ }
196
+ if (!pair) {
180
197
  throw new Error(`Pair not found for code: ${pairCode}`);
181
198
  }
182
199
  const { error: updateError } = await this.client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spudmobile-bridge",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Bridge between OpenAI Codex CLI and SpudMobile iOS app via Supabase",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",