@fluxbase/sdk 0.0.1-rc.36 → 0.0.1-rc.38

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/dist/index.d.cts CHANGED
@@ -63,7 +63,23 @@ interface SignInCredentials {
63
63
  interface SignUpCredentials {
64
64
  email: string;
65
65
  password: string;
66
- metadata?: Record<string, unknown>;
66
+ options?: {
67
+ /** User metadata to store in raw_user_meta_data (Supabase-compatible) */
68
+ data?: Record<string, unknown>;
69
+ };
70
+ }
71
+ /**
72
+ * User attributes for updateUser (Supabase-compatible)
73
+ */
74
+ interface UpdateUserAttributes {
75
+ /** New email address */
76
+ email?: string;
77
+ /** New password */
78
+ password?: string;
79
+ /** User metadata (Supabase-compatible) */
80
+ data?: Record<string, unknown>;
81
+ /** Nonce for password update reauthentication */
82
+ nonce?: string;
67
83
  }
68
84
  interface AuthResponse {
69
85
  user: User;
@@ -163,7 +179,7 @@ interface PostgrestResponse<T> {
163
179
  status: number;
164
180
  statusText: string;
165
181
  }
166
- type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'cs' | 'cd' | 'ov' | 'sl' | 'sr' | 'nxr' | 'nxl' | 'adj' | 'not' | 'fts' | 'plfts' | 'wfts';
182
+ type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'cs' | 'cd' | 'ov' | 'sl' | 'sr' | 'nxr' | 'nxl' | 'adj' | 'not' | 'fts' | 'plfts' | 'wfts' | 'st_intersects' | 'st_contains' | 'st_within' | 'st_dwithin' | 'st_distance' | 'st_touches' | 'st_crosses' | 'st_overlaps';
167
183
  interface QueryFilter {
168
184
  column: string;
169
185
  operator: FilterOperator;
@@ -1735,9 +1751,10 @@ declare class FluxbaseAuth {
1735
1751
  */
1736
1752
  getCurrentUser(): Promise<UserResponse>;
1737
1753
  /**
1738
- * Update the current user
1754
+ * Update the current user (Supabase-compatible)
1755
+ * @param attributes - User attributes to update (email, password, data for metadata)
1739
1756
  */
1740
- updateUser(data: Partial<Pick<User, "email" | "metadata">>): Promise<UserResponse>;
1757
+ updateUser(attributes: UpdateUserAttributes): Promise<UserResponse>;
1741
1758
  /**
1742
1759
  * Set the session manually (Supabase-compatible)
1743
1760
  * Useful for restoring a session from storage or SSR scenarios
@@ -4514,6 +4531,48 @@ declare class QueryBuilder<T = unknown> implements PromiseLike<PostgrestResponse
4514
4531
  * @example overlaps('tags', '["news","sports"]')
4515
4532
  */
4516
4533
  overlaps(column: string, value: unknown): this;
4534
+ /**
4535
+ * Check if geometries intersect (PostGIS ST_Intersects)
4536
+ * @param column - Column containing geometry/geography data
4537
+ * @param geojson - GeoJSON object to test intersection with
4538
+ * @example intersects('location', { type: 'Point', coordinates: [-122.4, 37.8] })
4539
+ */
4540
+ intersects(column: string, geojson: unknown): this;
4541
+ /**
4542
+ * Check if geometry A contains geometry B (PostGIS ST_Contains)
4543
+ * @param column - Column containing geometry/geography data
4544
+ * @param geojson - GeoJSON object to test containment
4545
+ * @example contains('region', { type: 'Point', coordinates: [-122.4, 37.8] })
4546
+ */
4547
+ stContains(column: string, geojson: unknown): this;
4548
+ /**
4549
+ * Check if geometry A is within geometry B (PostGIS ST_Within)
4550
+ * @param column - Column containing geometry/geography data
4551
+ * @param geojson - GeoJSON object to test containment within
4552
+ * @example within('point', { type: 'Polygon', coordinates: [[...]] })
4553
+ */
4554
+ within(column: string, geojson: unknown): this;
4555
+ /**
4556
+ * Check if geometries touch (PostGIS ST_Touches)
4557
+ * @param column - Column containing geometry/geography data
4558
+ * @param geojson - GeoJSON object to test touching
4559
+ * @example touches('boundary', { type: 'LineString', coordinates: [[...]] })
4560
+ */
4561
+ touches(column: string, geojson: unknown): this;
4562
+ /**
4563
+ * Check if geometries cross (PostGIS ST_Crosses)
4564
+ * @param column - Column containing geometry/geography data
4565
+ * @param geojson - GeoJSON object to test crossing
4566
+ * @example crosses('road', { type: 'LineString', coordinates: [[...]] })
4567
+ */
4568
+ crosses(column: string, geojson: unknown): this;
4569
+ /**
4570
+ * Check if geometries spatially overlap (PostGIS ST_Overlaps)
4571
+ * @param column - Column containing geometry/geography data
4572
+ * @param geojson - GeoJSON object to test overlap
4573
+ * @example stOverlaps('area', { type: 'Polygon', coordinates: [[...]] })
4574
+ */
4575
+ stOverlaps(column: string, geojson: unknown): this;
4517
4576
  /**
4518
4577
  * Order results
4519
4578
  */
@@ -5011,4 +5070,4 @@ declare class FluxbaseClient<Database = any, _SchemaName extends string & keyof
5011
5070
  */
5012
5071
  declare function createClient<Database = any, SchemaName extends string & keyof Database = any>(fluxbaseUrl: string, fluxbaseKey: string, options?: FluxbaseClientOptions): FluxbaseClient<Database, SchemaName>;
5013
5072
 
5014
- export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthResponseData, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type UpsertOptions, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type WeakPassword, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
5073
+ export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthResponseData, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserAttributes, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type UpsertOptions, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type WeakPassword, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
package/dist/index.d.ts CHANGED
@@ -63,7 +63,23 @@ interface SignInCredentials {
63
63
  interface SignUpCredentials {
64
64
  email: string;
65
65
  password: string;
66
- metadata?: Record<string, unknown>;
66
+ options?: {
67
+ /** User metadata to store in raw_user_meta_data (Supabase-compatible) */
68
+ data?: Record<string, unknown>;
69
+ };
70
+ }
71
+ /**
72
+ * User attributes for updateUser (Supabase-compatible)
73
+ */
74
+ interface UpdateUserAttributes {
75
+ /** New email address */
76
+ email?: string;
77
+ /** New password */
78
+ password?: string;
79
+ /** User metadata (Supabase-compatible) */
80
+ data?: Record<string, unknown>;
81
+ /** Nonce for password update reauthentication */
82
+ nonce?: string;
67
83
  }
68
84
  interface AuthResponse {
69
85
  user: User;
@@ -163,7 +179,7 @@ interface PostgrestResponse<T> {
163
179
  status: number;
164
180
  statusText: string;
165
181
  }
166
- type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'cs' | 'cd' | 'ov' | 'sl' | 'sr' | 'nxr' | 'nxl' | 'adj' | 'not' | 'fts' | 'plfts' | 'wfts';
182
+ type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'cs' | 'cd' | 'ov' | 'sl' | 'sr' | 'nxr' | 'nxl' | 'adj' | 'not' | 'fts' | 'plfts' | 'wfts' | 'st_intersects' | 'st_contains' | 'st_within' | 'st_dwithin' | 'st_distance' | 'st_touches' | 'st_crosses' | 'st_overlaps';
167
183
  interface QueryFilter {
168
184
  column: string;
169
185
  operator: FilterOperator;
@@ -1735,9 +1751,10 @@ declare class FluxbaseAuth {
1735
1751
  */
1736
1752
  getCurrentUser(): Promise<UserResponse>;
1737
1753
  /**
1738
- * Update the current user
1754
+ * Update the current user (Supabase-compatible)
1755
+ * @param attributes - User attributes to update (email, password, data for metadata)
1739
1756
  */
1740
- updateUser(data: Partial<Pick<User, "email" | "metadata">>): Promise<UserResponse>;
1757
+ updateUser(attributes: UpdateUserAttributes): Promise<UserResponse>;
1741
1758
  /**
1742
1759
  * Set the session manually (Supabase-compatible)
1743
1760
  * Useful for restoring a session from storage or SSR scenarios
@@ -4514,6 +4531,48 @@ declare class QueryBuilder<T = unknown> implements PromiseLike<PostgrestResponse
4514
4531
  * @example overlaps('tags', '["news","sports"]')
4515
4532
  */
4516
4533
  overlaps(column: string, value: unknown): this;
4534
+ /**
4535
+ * Check if geometries intersect (PostGIS ST_Intersects)
4536
+ * @param column - Column containing geometry/geography data
4537
+ * @param geojson - GeoJSON object to test intersection with
4538
+ * @example intersects('location', { type: 'Point', coordinates: [-122.4, 37.8] })
4539
+ */
4540
+ intersects(column: string, geojson: unknown): this;
4541
+ /**
4542
+ * Check if geometry A contains geometry B (PostGIS ST_Contains)
4543
+ * @param column - Column containing geometry/geography data
4544
+ * @param geojson - GeoJSON object to test containment
4545
+ * @example contains('region', { type: 'Point', coordinates: [-122.4, 37.8] })
4546
+ */
4547
+ stContains(column: string, geojson: unknown): this;
4548
+ /**
4549
+ * Check if geometry A is within geometry B (PostGIS ST_Within)
4550
+ * @param column - Column containing geometry/geography data
4551
+ * @param geojson - GeoJSON object to test containment within
4552
+ * @example within('point', { type: 'Polygon', coordinates: [[...]] })
4553
+ */
4554
+ within(column: string, geojson: unknown): this;
4555
+ /**
4556
+ * Check if geometries touch (PostGIS ST_Touches)
4557
+ * @param column - Column containing geometry/geography data
4558
+ * @param geojson - GeoJSON object to test touching
4559
+ * @example touches('boundary', { type: 'LineString', coordinates: [[...]] })
4560
+ */
4561
+ touches(column: string, geojson: unknown): this;
4562
+ /**
4563
+ * Check if geometries cross (PostGIS ST_Crosses)
4564
+ * @param column - Column containing geometry/geography data
4565
+ * @param geojson - GeoJSON object to test crossing
4566
+ * @example crosses('road', { type: 'LineString', coordinates: [[...]] })
4567
+ */
4568
+ crosses(column: string, geojson: unknown): this;
4569
+ /**
4570
+ * Check if geometries spatially overlap (PostGIS ST_Overlaps)
4571
+ * @param column - Column containing geometry/geography data
4572
+ * @param geojson - GeoJSON object to test overlap
4573
+ * @example stOverlaps('area', { type: 'Polygon', coordinates: [[...]] })
4574
+ */
4575
+ stOverlaps(column: string, geojson: unknown): this;
4517
4576
  /**
4518
4577
  * Order results
4519
4578
  */
@@ -5011,4 +5070,4 @@ declare class FluxbaseClient<Database = any, _SchemaName extends string & keyof
5011
5070
  */
5012
5071
  declare function createClient<Database = any, SchemaName extends string & keyof Database = any>(fluxbaseUrl: string, fluxbaseKey: string, options?: FluxbaseClientOptions): FluxbaseClient<Database, SchemaName>;
5013
5072
 
5014
- export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthResponseData, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type UpsertOptions, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type WeakPassword, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
5073
+ export { type APIKey, APIKeysManager, type AcceptInvitationRequest, type AcceptInvitationResponse, type AdminAuthResponse, type AdminLoginRequest, type AdminMeResponse, type AdminRefreshRequest, type AdminRefreshResponse, type AdminSetupRequest, type AdminSetupStatusResponse, type AdminUser, type AppSettings, AppSettingsManager, type AuthResponse, type AuthResponseData, type AuthSession, type AuthSettings, AuthSettingsManager, type AuthenticationSettings, type BroadcastCallback, type BroadcastMessage, type Column, type CreateAPIKeyRequest, type CreateAPIKeyResponse, type CreateColumnRequest, type CreateFunctionRequest, type CreateInvitationRequest, type CreateInvitationResponse, type CreateOAuthProviderRequest, type CreateOAuthProviderResponse, type CreateSchemaRequest, type CreateSchemaResponse, type CreateTableRequest, type CreateTableResponse, type CreateWebhookRequest, DDLManager, type DataResponse, type DeleteAPIKeyResponse, type DeleteOAuthProviderResponse, type DeleteTableResponse, type DeleteUserResponse, type DeleteWebhookResponse, type EdgeFunction, type EdgeFunctionExecution, type EmailSettings, type EmailTemplate, EmailTemplateManager, type EmailTemplateType, type EnrichedUser, type FeatureSettings, type FileObject, type FilterOperator, FluxbaseAdmin, FluxbaseAuth, type FluxbaseAuthResponse, FluxbaseClient, type FluxbaseClientOptions, type FluxbaseError, FluxbaseFetch, FluxbaseFunctions, FluxbaseManagement, FluxbaseOAuth, FluxbaseRealtime, type FluxbaseResponse, FluxbaseSettings, FluxbaseStorage, type FunctionInvokeOptions, type GetImpersonationResponse, type HttpMethod, type ImpersonateAnonRequest, type ImpersonateServiceRequest, type ImpersonateUserRequest, ImpersonationManager, type ImpersonationSession, type ImpersonationTargetUser, type ImpersonationType, type Invitation, InvitationsManager, type InviteUserRequest, type InviteUserResponse, type ListAPIKeysResponse, type ListEmailTemplatesResponse, type ListImpersonationSessionsOptions, type ListImpersonationSessionsResponse, type ListInvitationsOptions, type ListInvitationsResponse, type ListOAuthProvidersResponse, type ListOptions, type ListSchemasResponse, type ListSystemSettingsResponse, type ListTablesResponse, type ListUsersOptions, type ListUsersResponse, type ListWebhookDeliveriesResponse, type ListWebhooksResponse, type MailgunSettings, type OAuthProvider, OAuthProviderManager, type OrderBy, type OrderDirection, type PostgresChangesConfig, type PostgrestError, type PostgrestResponse, type PresenceCallback, type PresenceState, QueryBuilder, type QueryFilter, type RealtimeBroadcastPayload, type RealtimeCallback, type RealtimeChangePayload, RealtimeChannel, type RealtimeChannelConfig, type RealtimeMessage, type RealtimePostgresChangesPayload, type RealtimePresencePayload, type RequestOptions, type ResetUserPasswordResponse, type RevokeAPIKeyResponse, type RevokeInvitationResponse, type SESSettings, type SMTPSettings, type Schema, type SecuritySettings, type SendGridSettings, type SessionResponse, SettingsClient, type SignInCredentials, type SignInWith2FAResponse, type SignUpCredentials, type SignedUrlOptions, type StartImpersonationResponse, type StopImpersonationResponse, StorageBucket, type StorageObject, type SupabaseAuthResponse, type SupabaseResponse, type SystemSetting, SystemSettingsManager, type Table, type TestEmailTemplateRequest, type TestWebhookResponse, type TwoFactorEnableResponse, type TwoFactorSetupResponse, type TwoFactorStatusResponse, type TwoFactorVerifyRequest, type UpdateAPIKeyRequest, type UpdateAppSettingsRequest, type UpdateAuthSettingsRequest, type UpdateAuthSettingsResponse, type UpdateEmailTemplateRequest, type UpdateFunctionRequest, type UpdateOAuthProviderRequest, type UpdateOAuthProviderResponse, type UpdateSystemSettingRequest, type UpdateUserAttributes, type UpdateUserRoleRequest, type UpdateWebhookRequest, type UploadOptions, type UploadProgress, type UpsertOptions, type User, type UserResponse, type ValidateInvitationResponse, type VoidResponse, type WeakPassword, type Webhook, type WebhookDelivery, WebhooksManager, createClient };
package/dist/index.js CHANGED
@@ -241,9 +241,16 @@ var FluxbaseAuth = class {
241
241
  */
242
242
  async signUp(credentials) {
243
243
  return wrapAsync(async () => {
244
+ const requestBody = {
245
+ email: credentials.email,
246
+ password: credentials.password
247
+ };
248
+ if (credentials.options?.data) {
249
+ requestBody.user_metadata = credentials.options.data;
250
+ }
244
251
  const response = await this.fetch.post(
245
252
  "/api/v1/auth/signup",
246
- credentials
253
+ requestBody
247
254
  );
248
255
  if (response.access_token && response.refresh_token) {
249
256
  const session = {
@@ -312,14 +319,28 @@ var FluxbaseAuth = class {
312
319
  });
313
320
  }
314
321
  /**
315
- * Update the current user
322
+ * Update the current user (Supabase-compatible)
323
+ * @param attributes - User attributes to update (email, password, data for metadata)
316
324
  */
317
- async updateUser(data) {
325
+ async updateUser(attributes) {
318
326
  return wrapAsync(async () => {
319
327
  if (!this.session) {
320
328
  throw new Error("Not authenticated");
321
329
  }
322
- const user = await this.fetch.patch("/api/v1/auth/user", data);
330
+ const requestBody = {};
331
+ if (attributes.email) {
332
+ requestBody.email = attributes.email;
333
+ }
334
+ if (attributes.password) {
335
+ requestBody.password = attributes.password;
336
+ }
337
+ if (attributes.data) {
338
+ requestBody.user_metadata = attributes.data;
339
+ }
340
+ if (attributes.nonce) {
341
+ requestBody.nonce = attributes.nonce;
342
+ }
343
+ const user = await this.fetch.patch("/api/v1/auth/user", requestBody);
323
344
  if (this.session) {
324
345
  this.session.user = user;
325
346
  this.saveSession();
@@ -4296,7 +4317,11 @@ var QueryBuilder = class {
4296
4317
  * @example not('completed_at', 'is', null)
4297
4318
  */
4298
4319
  not(column, operator, value) {
4299
- this.filters.push({ column, operator: "not", value: `${operator}.${this.formatValue(value)}` });
4320
+ this.filters.push({
4321
+ column,
4322
+ operator: "not",
4323
+ value: `${operator}.${this.formatValue(value)}`
4324
+ });
4300
4325
  return this;
4301
4326
  }
4302
4327
  /**
@@ -4355,6 +4380,91 @@ var QueryBuilder = class {
4355
4380
  this.filters.push({ column, operator: "ov", value });
4356
4381
  return this;
4357
4382
  }
4383
+ // PostGIS Spatial Query Methods
4384
+ /**
4385
+ * Check if geometries intersect (PostGIS ST_Intersects)
4386
+ * @param column - Column containing geometry/geography data
4387
+ * @param geojson - GeoJSON object to test intersection with
4388
+ * @example intersects('location', { type: 'Point', coordinates: [-122.4, 37.8] })
4389
+ */
4390
+ intersects(column, geojson) {
4391
+ this.filters.push({
4392
+ column,
4393
+ operator: "st_intersects",
4394
+ value: geojson
4395
+ });
4396
+ return this;
4397
+ }
4398
+ /**
4399
+ * Check if geometry A contains geometry B (PostGIS ST_Contains)
4400
+ * @param column - Column containing geometry/geography data
4401
+ * @param geojson - GeoJSON object to test containment
4402
+ * @example contains('region', { type: 'Point', coordinates: [-122.4, 37.8] })
4403
+ */
4404
+ stContains(column, geojson) {
4405
+ this.filters.push({
4406
+ column,
4407
+ operator: "st_contains",
4408
+ value: geojson
4409
+ });
4410
+ return this;
4411
+ }
4412
+ /**
4413
+ * Check if geometry A is within geometry B (PostGIS ST_Within)
4414
+ * @param column - Column containing geometry/geography data
4415
+ * @param geojson - GeoJSON object to test containment within
4416
+ * @example within('point', { type: 'Polygon', coordinates: [[...]] })
4417
+ */
4418
+ within(column, geojson) {
4419
+ this.filters.push({
4420
+ column,
4421
+ operator: "st_within",
4422
+ value: geojson
4423
+ });
4424
+ return this;
4425
+ }
4426
+ /**
4427
+ * Check if geometries touch (PostGIS ST_Touches)
4428
+ * @param column - Column containing geometry/geography data
4429
+ * @param geojson - GeoJSON object to test touching
4430
+ * @example touches('boundary', { type: 'LineString', coordinates: [[...]] })
4431
+ */
4432
+ touches(column, geojson) {
4433
+ this.filters.push({
4434
+ column,
4435
+ operator: "st_touches",
4436
+ value: geojson
4437
+ });
4438
+ return this;
4439
+ }
4440
+ /**
4441
+ * Check if geometries cross (PostGIS ST_Crosses)
4442
+ * @param column - Column containing geometry/geography data
4443
+ * @param geojson - GeoJSON object to test crossing
4444
+ * @example crosses('road', { type: 'LineString', coordinates: [[...]] })
4445
+ */
4446
+ crosses(column, geojson) {
4447
+ this.filters.push({
4448
+ column,
4449
+ operator: "st_crosses",
4450
+ value: geojson
4451
+ });
4452
+ return this;
4453
+ }
4454
+ /**
4455
+ * Check if geometries spatially overlap (PostGIS ST_Overlaps)
4456
+ * @param column - Column containing geometry/geography data
4457
+ * @param geojson - GeoJSON object to test overlap
4458
+ * @example stOverlaps('area', { type: 'Polygon', coordinates: [[...]] })
4459
+ */
4460
+ stOverlaps(column, geojson) {
4461
+ this.filters.push({
4462
+ column,
4463
+ operator: "st_overlaps",
4464
+ value: geojson
4465
+ });
4466
+ return this;
4467
+ }
4358
4468
  /**
4359
4469
  * Order results
4360
4470
  */
@@ -4654,7 +4764,10 @@ var QueryBuilder = class {
4654
4764
  throw new Error("Insert data is required for insert operation");
4655
4765
  }
4656
4766
  const body = Array.isArray(this.insertData) ? this.insertData : this.insertData;
4657
- const response = await this.fetch.post(`/api/v1/tables/${this.table}`, body);
4767
+ const response = await this.fetch.post(
4768
+ `/api/v1/tables/${this.table}`,
4769
+ body
4770
+ );
4658
4771
  return {
4659
4772
  data: response,
4660
4773
  error: null,
@@ -4808,7 +4921,10 @@ var QueryBuilder = class {
4808
4921
  params.append("select", this.selectQuery);
4809
4922
  }
4810
4923
  for (const filter of this.filters) {
4811
- params.append(filter.column, `${filter.operator}.${this.formatValue(filter.value)}`);
4924
+ params.append(
4925
+ filter.column,
4926
+ `${filter.operator}.${this.formatValue(filter.value)}`
4927
+ );
4812
4928
  }
4813
4929
  for (const orFilter of this.orFilters) {
4814
4930
  params.append("or", `(${orFilter})`);
@@ -4820,7 +4936,9 @@ var QueryBuilder = class {
4820
4936
  params.append("group_by", this.groupByColumns.join(","));
4821
4937
  }
4822
4938
  if (this.orderBys.length > 0) {
4823
- const orderStr = this.orderBys.map((o) => `${o.column}.${o.direction}${o.nulls ? `.nulls${o.nulls}` : ""}`).join(",");
4939
+ const orderStr = this.orderBys.map(
4940
+ (o) => `${o.column}.${o.direction}${o.nulls ? `.nulls${o.nulls}` : ""}`
4941
+ ).join(",");
4824
4942
  params.append("order", orderStr);
4825
4943
  }
4826
4944
  if (this.limitValue !== void 0) {