Skip to content

Commit

Permalink
Merge branch 'main' into fix/angular-start-async-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriztiaan authored Dec 13, 2024
2 parents 75863c1 + bd8c026 commit e7eb08f
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 48 deletions.
4 changes: 1 addition & 3 deletions demos/angular-supabase-todolist/src/app/supabase.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ export class SupabaseService implements PowerSyncBackendConnector {
}

return {
client: this.supabase,
endpoint: environment.powersyncUrl,
token: session.access_token ?? '',
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
token: session.access_token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ export class DjangoConnector implements PowerSyncBackendConnector {
const session = await this.apiClient.getToken(userId);
return {
endpoint: AppConfig.powersyncUrl,
token: session.token ?? '',
expiresAt: undefined,
userID: userId
token: session.token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { column, Schema, TableV2 } from '@powersync/react-native';
import { column, Schema, Table } from '@powersync/react-native';

export const LIST_TABLE = 'lists';
export const TODO_TABLE = 'todos';

const todos = new TableV2(
const todos = new Table(
{
list_id: column.text,
created_at: column.text,
Expand All @@ -17,7 +17,7 @@ const todos = new TableV2(
{ indexes: { list: ['list_id'] } }
);

const lists = new TableV2({
const lists = new Table({
created_at: column.text,
name: column.text,
owner_id: column.text
Expand Down
4 changes: 2 additions & 2 deletions demos/example-capacitor/src/library/powersync/AppSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { column, Schema, TableV2 } from '@powersync/web';
import { column, Schema, Table } from '@powersync/web';

const customers = new TableV2({
const customers = new Table({
name: column.text,
created_at: column.text
});
Expand Down
4 changes: 2 additions & 2 deletions demos/example-electron/src/library/powersync/AppSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { column, Schema, TableV2 } from '@powersync/web';
import { column, Schema, Table } from '@powersync/web';

const customers = new TableV2({
const customers = new Table({
name: column.text,
created_at: column.text
});
Expand Down
4 changes: 2 additions & 2 deletions demos/example-nextjs/src/library/powersync/AppSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { column, Schema, TableV2 } from '@powersync/web';
import { column, Schema, Table } from '@powersync/web';

const customers = new TableV2({
const customers = new Table({
name: column.text,
created_at: column.text
});
Expand Down
3 changes: 1 addition & 2 deletions demos/react-multi-client/src/library/SupabaseConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i

return {
token: token,
endpoint: import.meta.env.VITE_POWERSYNC_URL,
expiresAt: expires_at ? new Date(expires_at) : undefined
endpoint: import.meta.env.VITE_POWERSYNC_URL
};
}

Expand Down
5 changes: 1 addition & 4 deletions demos/react-native-supabase-group-chat/src/lib/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ export class Connector implements PowerSyncBackendConnector {
console.debug('session expires at', session.expires_at);

return {
client: this.supabaseClient,
endpoint: config.powerSyncUrl,
token: session.access_token ?? '',
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined,
userID: session.user.id
token: session.access_token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export class SupabaseConnector implements PowerSyncBackendConnector {

return {
endpoint: AppConfig.powersyncUrl,
token: session.access_token ?? '',
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined,
userID: session.user.id
token: session.access_token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export class SupabaseConnector implements PowerSyncBackendConnector {

return {
endpoint: AppConfig.powersyncUrl,
token: session.access_token ?? '',
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined,
userID: session.user.id
token: session.access_token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AbstractPowerSyncDatabase, column, ColumnsType, Schema, Table, TableV2Options } from '@powersync/web';
import { AbstractPowerSyncDatabase, column, Schema, Table } from '@powersync/web';
import { setSyncEnabled } from './SyncMode';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i

return {
endpoint: this.config.powersyncUrl,
token: session.access_token ?? '',
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
token: session.access_token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i

return {
endpoint: this.config.powersyncUrl,
token: session.access_token ?? '',
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
token: session.access_token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { column, Schema, TableV2 } from '@powersync/web';
import { column, Schema, Table } from '@powersync/web';

export const LISTS_TABLE = 'lists';
export const TODOS_TABLE = 'todos';

const todos = new TableV2(
const todos = new Table(
{
list_id: column.text,
created_at: column.text,
Expand All @@ -16,7 +16,7 @@ const todos = new TableV2(
{ indexes: { list: ['list_id'] } }
);

const lists = new TableV2({
const lists = new Table({
created_at: column.text,
name: column.text,
owner_id: column.text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i

return {
endpoint: this.config.powersyncUrl,
token: session.access_token ?? '',
expiresAt: session.expires_at ? new Date(session.expires_at * 1000) : undefined
token: session.access_token ?? ''
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { column, Schema, TableV2 } from '@powersync/web';
import { column, Schema, Table } from '@powersync/web';

const documents = new TableV2({
const documents = new Table({
title: column.text,
created_at: column.text
});

const document_updates = new TableV2(
const document_updates = new Table(
{
document_id: column.text,
created_at: column.text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ export class SupabaseConnector extends BaseObserver<SupabaseConnectorListener> i

return {
endpoint: data.powersync_url,
token: data.token,
expiresAt: undefined
token: data.token
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ Deno.serve(async (req) => {
}
);
} catch (err) {
return new Response(
JSON.stringify({ error: String(err?.message ?? err) }),
{ status: 500, headers: responseHeaders }
);
return new Response(JSON.stringify({ error: String(err?.message ?? err) }), {
status: 500,
headers: responseHeaders
});
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class SharedSyncClientProvider extends AbstractSharedSyncClientProvider {
*/
return {
endpoint: credentials.endpoint,
token: credentials.token,
expiresAt: credentials.expiresAt
token: credentials.token
};
}

Expand Down

0 comments on commit e7eb08f

Please sign in to comment.