Skip to content

Commit bd8c026

Browse files
chore: clean up connectors (#444)
1 parent 6ad09ca commit bd8c026

File tree

12 files changed

+15
-32
lines changed

12 files changed

+15
-32
lines changed

demos/angular-supabase-todolist/src/app/supabase.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ export class SupabaseService implements PowerSyncBackendConnector {
6565
}
6666

6767
return {
68-
client: this.supabase,
6968
endpoint: environment.powersyncUrl,
70-
token: session.access_token ?? '',
71-
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
69+
token: session.access_token ?? ''
7270
};
7371
}
7472

demos/django-react-native-todolist/library/django/DjangoConnector.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ export class DjangoConnector implements PowerSyncBackendConnector {
4545
const session = await this.apiClient.getToken(userId);
4646
return {
4747
endpoint: AppConfig.powersyncUrl,
48-
token: session.token ?? '',
49-
expiresAt: undefined,
50-
userID: userId
48+
token: session.token ?? ''
5149
};
5250
}
5351

demos/react-multi-client/src/library/SupabaseConnector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i
7070

7171
return {
7272
token: token,
73-
endpoint: import.meta.env.VITE_POWERSYNC_URL,
74-
expiresAt: expires_at ? new Date(expires_at) : undefined
73+
endpoint: import.meta.env.VITE_POWERSYNC_URL
7574
};
7675
}
7776

demos/react-native-supabase-group-chat/src/lib/connector.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ export class Connector implements PowerSyncBackendConnector {
3636
console.debug('session expires at', session.expires_at);
3737

3838
return {
39-
client: this.supabaseClient,
4039
endpoint: config.powerSyncUrl,
41-
token: session.access_token ?? '',
42-
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined,
43-
userID: session.user.id
40+
token: session.access_token ?? ''
4441
};
4542
}
4643

demos/react-native-supabase-todolist/library/supabase/SupabaseConnector.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ export class SupabaseConnector implements PowerSyncBackendConnector {
5656

5757
return {
5858
endpoint: AppConfig.powersyncUrl,
59-
token: session.access_token ?? '',
60-
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined,
61-
userID: session.user.id
59+
token: session.access_token ?? ''
6260
};
6361
}
6462

demos/react-native-web-supabase-todolist/library/supabase/SupabaseConnector.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ export class SupabaseConnector implements PowerSyncBackendConnector {
5656

5757
return {
5858
endpoint: AppConfig.powersyncUrl,
59-
token: session.access_token ?? '',
60-
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined,
61-
userID: session.user.id
59+
token: session.access_token ?? ''
6260
};
6361
}
6462

demos/react-supabase-todolist-optional-sync/src/library/powersync/SupabaseConnector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i
112112

113113
return {
114114
endpoint: this.config.powersyncUrl,
115-
token: session.access_token ?? '',
116-
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
115+
token: session.access_token ?? ''
117116
};
118117
}
119118

demos/react-supabase-todolist/src/library/powersync/SupabaseConnector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i
9898

9999
return {
100100
endpoint: this.config.powersyncUrl,
101-
token: session.access_token ?? '',
102-
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
101+
token: session.access_token ?? ''
103102
};
104103
}
105104

demos/vue-supabase-todolist/src/library/powersync/SupabaseConnector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i
9898

9999
return {
100100
endpoint: this.config.powersyncUrl,
101-
token: session.access_token ?? '',
102-
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
101+
token: session.access_token ?? ''
103102
};
104103
}
105104

demos/yjs-react-supabase-text-collab/src/library/powersync/SupabaseConnector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i
6969

7070
return {
7171
endpoint: data.powersync_url,
72-
token: data.token,
73-
expiresAt: undefined
72+
token: data.token
7473
};
7574
}
7675

demos/yjs-react-supabase-text-collab/supabase/functions/merge-document-updates/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ Deno.serve(async (req) => {
7171
}
7272
);
7373
} catch (err) {
74-
return new Response(
75-
JSON.stringify({ error: String(err?.message ?? err) }),
76-
{ status: 500, headers: responseHeaders }
77-
);
74+
return new Response(JSON.stringify({ error: String(err?.message ?? err) }), {
75+
status: 500,
76+
headers: responseHeaders
77+
});
7878
}
7979
});
8080

packages/web/src/db/sync/SharedWebStreamingSyncImplementation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class SharedSyncClientProvider extends AbstractSharedSyncClientProvider {
3838
*/
3939
return {
4040
endpoint: credentials.endpoint,
41-
token: credentials.token,
42-
expiresAt: credentials.expiresAt
41+
token: credentials.token
4342
};
4443
}
4544

0 commit comments

Comments
 (0)