@xata.io/client 0.26.2 → 0.26.4
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/.turbo/turbo-add-version.log +1 -1
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +100 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +61 -18
- package/dist/index.mjs +99 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -7052,6 +7052,11 @@ interface ImageTransformations {
|
|
7052
7052
|
* ignored.
|
7053
7053
|
*/
|
7054
7054
|
contrast?: number;
|
7055
|
+
/**
|
7056
|
+
* Download file. Forces browser to download the image.
|
7057
|
+
* Value is used for the download file name. Extension is optional.
|
7058
|
+
*/
|
7059
|
+
download?: string;
|
7055
7060
|
/**
|
7056
7061
|
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
7057
7062
|
* easier to specify higher-DPI sizes in <img srcset>.
|
@@ -7173,19 +7178,23 @@ declare function transformImage(url: string | undefined, ...transformations: Ima
|
|
7173
7178
|
type XataFileEditableFields = Partial<Pick<XataArrayFile, keyof InputFileEntry>>;
|
7174
7179
|
declare class XataFile {
|
7175
7180
|
/**
|
7176
|
-
*
|
7181
|
+
* Identifier of the file.
|
7182
|
+
*/
|
7183
|
+
id?: string;
|
7184
|
+
/**
|
7185
|
+
* Name of the file.
|
7177
7186
|
*/
|
7178
7187
|
name: string;
|
7179
7188
|
/**
|
7180
|
-
* Media type of
|
7189
|
+
* Media type of the file.
|
7181
7190
|
*/
|
7182
7191
|
mediaType: string;
|
7183
7192
|
/**
|
7184
|
-
* Base64 encoded content of
|
7193
|
+
* Base64 encoded content of the file.
|
7185
7194
|
*/
|
7186
7195
|
base64Content?: string;
|
7187
7196
|
/**
|
7188
|
-
* Whether to enable public url for
|
7197
|
+
* Whether to enable public url for the file.
|
7189
7198
|
*/
|
7190
7199
|
enablePublicUrl: boolean;
|
7191
7200
|
/**
|
@@ -7193,23 +7202,23 @@ declare class XataFile {
|
|
7193
7202
|
*/
|
7194
7203
|
signedUrlTimeout: number;
|
7195
7204
|
/**
|
7196
|
-
* Size of
|
7205
|
+
* Size of the file.
|
7197
7206
|
*/
|
7198
7207
|
size?: number;
|
7199
7208
|
/**
|
7200
|
-
* Version of
|
7209
|
+
* Version of the file.
|
7201
7210
|
*/
|
7202
7211
|
version: number;
|
7203
7212
|
/**
|
7204
|
-
* Url of
|
7213
|
+
* Url of the file.
|
7205
7214
|
*/
|
7206
7215
|
url: string;
|
7207
7216
|
/**
|
7208
|
-
* Signed url of
|
7217
|
+
* Signed url of the file.
|
7209
7218
|
*/
|
7210
7219
|
signedUrl?: string;
|
7211
7220
|
/**
|
7212
|
-
* Attributes of
|
7221
|
+
* Attributes of the file.
|
7213
7222
|
*/
|
7214
7223
|
attributes: Record<string, any>;
|
7215
7224
|
constructor(file: Partial<XataFile>);
|
@@ -7235,14 +7244,38 @@ declare class XataFile {
|
|
7235
7244
|
type XataArrayFile = Identifiable & XataFile;
|
7236
7245
|
|
7237
7246
|
type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id' | `xata.${'version' | 'createdAt' | 'updatedAt'}` | DataProps<O> | NestedColumns<O, RecursivePath>;
|
7247
|
+
type ExpandedColumnNotation = {
|
7248
|
+
name: string;
|
7249
|
+
columns?: SelectableColumn<any>[];
|
7250
|
+
as?: string;
|
7251
|
+
limit?: number;
|
7252
|
+
offset?: number;
|
7253
|
+
order?: {
|
7254
|
+
column: string;
|
7255
|
+
order: 'asc' | 'desc';
|
7256
|
+
}[];
|
7257
|
+
};
|
7258
|
+
type SelectableColumnWithObjectNotation<O, RecursivePath extends any[] = []> = SelectableColumn<O, RecursivePath> | ExpandedColumnNotation;
|
7259
|
+
declare function isValidExpandedColumn(column: any): column is ExpandedColumnNotation;
|
7260
|
+
declare function isValidSelectableColumns(columns: any): columns is SelectableColumn<any>[];
|
7261
|
+
type StringColumns<T> = T extends string ? T : never;
|
7262
|
+
type ProjectionColumns<T> = T extends string ? never : T extends {
|
7263
|
+
as: infer As;
|
7264
|
+
} ? NonNullable<As> extends string ? NonNullable<As> : never : never;
|
7238
7265
|
type WildcardColumns<O> = Values<{
|
7239
7266
|
[K in SelectableColumn<O>]: K extends `${string}*` ? K : never;
|
7240
7267
|
}>;
|
7241
7268
|
type ColumnsByValue<O, Value> = Values<{
|
7242
7269
|
[K in SelectableColumn<O>]: ValueAtColumn<O, K> extends infer C ? C extends Value ? K extends WildcardColumns<O> ? never : K : never : never;
|
7243
7270
|
}>;
|
7244
|
-
type SelectedPick<O extends XataRecord, Key extends
|
7245
|
-
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
7271
|
+
type SelectedPick<O extends XataRecord, Key extends SelectableColumnWithObjectNotation<O>[]> = XataRecord<O> & UnionToIntersection<Values<{
|
7272
|
+
[K in StringColumns<Key[number]>]: NestedValueAtColumn<O, K> & XataRecord<O>;
|
7273
|
+
}>> & UnionToIntersection<Values<{
|
7274
|
+
[K in ProjectionColumns<Key[number]>]: {
|
7275
|
+
[Key in K]: {
|
7276
|
+
records: (Record<string, any> & XataRecord<O>)[];
|
7277
|
+
};
|
7278
|
+
};
|
7246
7279
|
}>>;
|
7247
7280
|
type ValueAtColumn<Object, Key> = Key extends '*' ? Values<Object> : Key extends 'id' ? string : Key extends 'xata.version' ? number : Key extends 'xata.createdAt' ? Date : Key extends 'xata.updatedAt' ? Date : Key extends keyof Object ? Object[Key] : Key extends `${infer K}.${infer V}` ? K extends keyof Object ? Values<NonNullable<Object[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
|
7248
7281
|
V: ValueAtColumn<Item, V>;
|
@@ -7421,7 +7454,15 @@ type JSONData<O> = JSONDataBase & Partial<Omit<{
|
|
7421
7454
|
[K in keyof O]: JSONDataFields<O[K]>;
|
7422
7455
|
}, keyof XataRecord>>;
|
7423
7456
|
|
7457
|
+
type JSONValue<Value> = Value & {
|
7458
|
+
__json: true;
|
7459
|
+
};
|
7460
|
+
|
7461
|
+
type JSONFilterColumns<Record> = Values<{
|
7462
|
+
[K in keyof Record]: NonNullable<Record[K]> extends JSONValue<any> ? K extends string ? `${K}->${string}` : never : never;
|
7463
|
+
}>;
|
7424
7464
|
type FilterColumns<T> = ColumnsByValue<T, any> | `xata.${keyof XataRecordMetadata}`;
|
7465
|
+
type FilterValueAtColumn<Record, F> = NonNullable<ValueAtColumn<Record, F>> extends JSONValue<any> ? PropertyFilter<any> : Filter<NonNullable<ValueAtColumn<Record, F>>>;
|
7425
7466
|
/**
|
7426
7467
|
* PropertyMatchFilter
|
7427
7468
|
* Example:
|
@@ -7442,6 +7483,8 @@ type FilterColumns<T> = ColumnsByValue<T, any> | `xata.${keyof XataRecordMetadat
|
|
7442
7483
|
*/
|
7443
7484
|
type PropertyAccessFilter<Record> = {
|
7444
7485
|
[key in FilterColumns<Record>]?: NestedApiFilter<ValueAtColumn<Record, key>> | PropertyFilter<ValueAtColumn<Record, key>>;
|
7486
|
+
} & {
|
7487
|
+
[key in JSONFilterColumns<Record>]?: PropertyFilter<Record[keyof Record]>;
|
7445
7488
|
};
|
7446
7489
|
type PropertyFilter<T> = T | {
|
7447
7490
|
$is: T;
|
@@ -7924,7 +7967,7 @@ type SummarizeFilter<Record extends XataRecord, Expression extends Dictionary<Su
|
|
7924
7967
|
type SummarizeResultItem<Record extends XataRecord, Expression extends Dictionary<SummarizeExpression<Record>>, Columns extends SelectableColumn<Record>[]> = SummarizeValuePick<Record, Expression> & SelectedPick<Record, Columns>;
|
7925
7968
|
|
7926
7969
|
type BaseOptions<T extends XataRecord> = {
|
7927
|
-
columns?:
|
7970
|
+
columns?: SelectableColumnWithObjectNotation<T>[];
|
7928
7971
|
consistency?: 'strong' | 'eventual';
|
7929
7972
|
cache?: number;
|
7930
7973
|
fetchOptions?: Record<string, unknown>;
|
@@ -7992,7 +8035,7 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
7992
8035
|
* @param value The value to filter.
|
7993
8036
|
* @returns A new Query object.
|
7994
8037
|
*/
|
7995
|
-
filter<F extends
|
8038
|
+
filter<F extends FilterColumns<Record> | JSONFilterColumns<Record>>(column: F, value: FilterValueAtColumn<Record, F>): Query<Record, Result>;
|
7996
8039
|
/**
|
7997
8040
|
* Builds a new query object adding one or more constraints. Examples:
|
7998
8041
|
*
|
@@ -8013,15 +8056,15 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
8013
8056
|
* @param direction The direction. Either ascending or descending.
|
8014
8057
|
* @returns A new Query object.
|
8015
8058
|
*/
|
8016
|
-
sort<F extends
|
8059
|
+
sort<F extends SortColumns<Record>>(column: F, direction: SortDirection): Query<Record, Result>;
|
8017
8060
|
sort(column: '*', direction: 'random'): Query<Record, Result>;
|
8018
|
-
sort<F extends
|
8061
|
+
sort<F extends SortColumns<Record>>(column: F): Query<Record, Result>;
|
8019
8062
|
/**
|
8020
8063
|
* Builds a new query specifying the set of columns to be returned in the query response.
|
8021
8064
|
* @param columns Array of column names to be returned by the query.
|
8022
8065
|
* @returns A new Query object.
|
8023
8066
|
*/
|
8024
|
-
select<K extends
|
8067
|
+
select<K extends SelectableColumnWithObjectNotation<Record>>(columns: K[]): Query<Record, SelectedPick<Record, K[]>>;
|
8025
8068
|
/**
|
8026
8069
|
* Get paginated results
|
8027
8070
|
*
|
@@ -9035,7 +9078,7 @@ type PropertyType<Tables, Properties, PropertyName extends PropertyKey> = Proper
|
|
9035
9078
|
} : {
|
9036
9079
|
[K in PropertyName]?: InnerType<Type, ObjectColumns, Tables, LinkedTable> | null;
|
9037
9080
|
} : never : never;
|
9038
|
-
type InnerType<Type, ObjectColumns, Tables, LinkedTable> = Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'vector' ? number[] : Type extends 'file' ? XataFile : Type extends 'file[]' ? XataArrayFile[] : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
|
9081
|
+
type InnerType<Type, ObjectColumns, Tables, LinkedTable> = Type extends 'string' | 'text' | 'email' ? string : Type extends 'int' | 'float' ? number : Type extends 'bool' ? boolean : Type extends 'datetime' ? Date : Type extends 'multiple' ? string[] : Type extends 'vector' ? number[] : Type extends 'file' ? XataFile : Type extends 'file[]' ? XataArrayFile[] : Type extends 'json' ? JSONValue<any> : Type extends 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
|
9039
9082
|
name: string;
|
9040
9083
|
type: string;
|
9041
9084
|
} ? UnionToIntersection<Values<{
|
@@ -9428,4 +9471,4 @@ declare class XataError extends Error {
|
|
9428
9471
|
constructor(message: string, status: number);
|
9429
9472
|
}
|
9430
9473
|
|
9431
|
-
export { type AcceptWorkspaceMemberInviteError, type AcceptWorkspaceMemberInvitePathParams, type AcceptWorkspaceMemberInviteVariables, type AddGitBranchesEntryError, type AddGitBranchesEntryPathParams, type AddGitBranchesEntryRequestBody, type AddGitBranchesEntryResponse, type AddGitBranchesEntryVariables, type AddTableColumnError, type AddTableColumnPathParams, type AddTableColumnVariables, type AggregateTableError, type AggregateTablePathParams, type AggregateTableRequestBody, type AggregateTableVariables, type ApiExtraProps, type ApplyBranchSchemaEditError, type ApplyBranchSchemaEditPathParams, type ApplyBranchSchemaEditRequestBody, type ApplyBranchSchemaEditVariables, type AskOptions, type AskResult, type AskTableError, type AskTablePathParams, type AskTableRequestBody, type AskTableResponse, type AskTableSessionError, type AskTableSessionPathParams, type AskTableSessionRequestBody, type AskTableSessionResponse, type AskTableSessionVariables, type AskTableVariables, BaseClient, type BaseClientOptions, type BaseData, type BaseSchema, type BinaryFile, type BranchTransactionError, type BranchTransactionPathParams, type BranchTransactionRequestBody, type BranchTransactionVariables, type BulkInsertTableRecordsError, type BulkInsertTableRecordsPathParams, type BulkInsertTableRecordsQueryParams, type BulkInsertTableRecordsRequestBody, type BulkInsertTableRecordsVariables, type CacheImpl, type CancelWorkspaceMemberInviteError, type CancelWorkspaceMemberInvitePathParams, type CancelWorkspaceMemberInviteVariables, type ClientConstructor, type ColumnsByValue, type CompareBranchSchemasError, type CompareBranchSchemasPathParams, type CompareBranchSchemasRequestBody, type CompareBranchSchemasVariables, type CompareBranchWithUserSchemaError, type CompareBranchWithUserSchemaPathParams, type CompareBranchWithUserSchemaRequestBody, type CompareBranchWithUserSchemaVariables, type CompareMigrationRequestError, type CompareMigrationRequestPathParams, type CompareMigrationRequestVariables, type CopyBranchError, type CopyBranchPathParams, type CopyBranchRequestBody, type CopyBranchVariables, type CreateBranchError, type CreateBranchPathParams, type CreateBranchQueryParams, type CreateBranchRequestBody, type CreateBranchResponse, type CreateBranchVariables, type CreateDatabaseError, type CreateDatabasePathParams, type CreateDatabaseRequestBody, type CreateDatabaseResponse, type CreateDatabaseVariables, type CreateMigrationRequestError, type CreateMigrationRequestPathParams, type CreateMigrationRequestRequestBody, type CreateMigrationRequestResponse, type CreateMigrationRequestVariables, type CreateTableError, type CreateTablePathParams, type CreateTableResponse, type CreateTableVariables, type CreateUserAPIKeyError, type CreateUserAPIKeyPathParams, type CreateUserAPIKeyResponse, type CreateUserAPIKeyVariables, type CreateWorkspaceError, type CreateWorkspaceVariables, type CursorNavigationOptions, type DeleteBranchError, type DeleteBranchPathParams, type DeleteBranchResponse, type DeleteBranchVariables, type DeleteColumnError, type DeleteColumnPathParams, type DeleteColumnVariables, type DeleteDatabaseError, type DeleteDatabaseGithubSettingsError, type DeleteDatabaseGithubSettingsPathParams, type DeleteDatabaseGithubSettingsVariables, type DeleteDatabasePathParams, type DeleteDatabaseResponse, type DeleteDatabaseVariables, type DeleteFileError, type DeleteFileItemError, type DeleteFileItemPathParams, type DeleteFileItemVariables, type DeleteFilePathParams, type DeleteFileVariables, type DeleteOAuthAccessTokenError, type DeleteOAuthAccessTokenPathParams, type DeleteOAuthAccessTokenVariables, type DeleteRecordError, type DeleteRecordPathParams, type DeleteRecordQueryParams, type DeleteRecordVariables, type DeleteTableError, type DeleteTablePathParams, type DeleteTableResponse, type DeleteTableVariables, type DeleteUserAPIKeyError, type DeleteUserAPIKeyPathParams, type DeleteUserAPIKeyVariables, type DeleteUserError, type DeleteUserOAuthClientError, type DeleteUserOAuthClientPathParams, type DeleteUserOAuthClientVariables, type DeleteUserVariables, type DeleteWorkspaceError, type DeleteWorkspacePathParams, type DeleteWorkspaceVariables, type DeserializedType, type DownloadDestination, type EditableData, type ExecuteBranchMigrationPlanError, type ExecuteBranchMigrationPlanPathParams, type ExecuteBranchMigrationPlanRequestBody, type ExecuteBranchMigrationPlanVariables, type FetchImpl, FetcherError, type FetcherExtraProps, type FileAccessError, type FileAccessPathParams, type FileAccessQueryParams, type FileAccessVariables, FilesPlugin, type FilesPluginResult, type GetAuthorizationCodeError, type GetAuthorizationCodeQueryParams, type GetAuthorizationCodeVariables, type GetBranchDetailsError, type GetBranchDetailsPathParams, type GetBranchDetailsVariables, type GetBranchListError, type GetBranchListPathParams, type GetBranchListVariables, type GetBranchMetadataError, type GetBranchMetadataPathParams, type GetBranchMetadataVariables, type GetBranchMigrationHistoryError, type GetBranchMigrationHistoryPathParams, type GetBranchMigrationHistoryRequestBody, type GetBranchMigrationHistoryResponse, type GetBranchMigrationHistoryVariables, type GetBranchMigrationPlanError, type GetBranchMigrationPlanPathParams, type GetBranchMigrationPlanVariables, type GetBranchSchemaHistoryError, type GetBranchSchemaHistoryPathParams, type GetBranchSchemaHistoryRequestBody, type GetBranchSchemaHistoryResponse, type GetBranchSchemaHistoryVariables, type GetBranchStatsError, type GetBranchStatsPathParams, type GetBranchStatsResponse, type GetBranchStatsVariables, type GetColumnError, type GetColumnPathParams, type GetColumnVariables, type GetDatabaseGithubSettingsError, type GetDatabaseGithubSettingsPathParams, type GetDatabaseGithubSettingsVariables, type GetDatabaseListError, type GetDatabaseListPathParams, type GetDatabaseListVariables, type GetDatabaseMetadataError, type GetDatabaseMetadataPathParams, type GetDatabaseMetadataVariables, type GetFileError, type GetFileItemError, type GetFileItemPathParams, type GetFileItemVariables, type GetFilePathParams, type GetFileVariables, type GetGitBranchesMappingError, type GetGitBranchesMappingPathParams, type GetGitBranchesMappingVariables, type GetMigrationRequestError, type GetMigrationRequestIsMergedError, type GetMigrationRequestIsMergedPathParams, type GetMigrationRequestIsMergedResponse, type GetMigrationRequestIsMergedVariables, type GetMigrationRequestPathParams, type GetMigrationRequestVariables, type GetRecordError, type GetRecordPathParams, type GetRecordQueryParams, type GetRecordVariables, type GetTableColumnsError, type GetTableColumnsPathParams, type GetTableColumnsResponse, type GetTableColumnsVariables, type GetTableSchemaError, type GetTableSchemaPathParams, type GetTableSchemaResponse, type GetTableSchemaVariables, type GetUserAPIKeysError, type GetUserAPIKeysResponse, type GetUserAPIKeysVariables, type GetUserError, type GetUserOAuthAccessTokensError, type GetUserOAuthAccessTokensResponse, type GetUserOAuthAccessTokensVariables, type GetUserOAuthClientsError, type GetUserOAuthClientsResponse, type GetUserOAuthClientsVariables, type GetUserVariables, type GetWorkspaceError, type GetWorkspaceMembersListError, type GetWorkspaceMembersListPathParams, type GetWorkspaceMembersListVariables, type GetWorkspacePathParams, type GetWorkspaceVariables, type GetWorkspacesListError, type GetWorkspacesListResponse, type GetWorkspacesListVariables, type GrantAuthorizationCodeError, type GrantAuthorizationCodeVariables, type HostProvider, type Identifiable, type ImageTransformations, type InsertRecordError, type InsertRecordPathParams, type InsertRecordQueryParams, type InsertRecordVariables, type InsertRecordWithIDError, type InsertRecordWithIDPathParams, type InsertRecordWithIDQueryParams, type InsertRecordWithIDVariables, type InviteWorkspaceMemberError, type InviteWorkspaceMemberPathParams, type InviteWorkspaceMemberRequestBody, type InviteWorkspaceMemberVariables, type JSONData, type KeywordAskOptions, type Link, type ListMigrationRequestsCommitsError, type ListMigrationRequestsCommitsPathParams, type ListMigrationRequestsCommitsRequestBody, type ListMigrationRequestsCommitsResponse, type ListMigrationRequestsCommitsVariables, type ListRegionsError, type ListRegionsPathParams, type ListRegionsVariables, type MergeMigrationRequestError, type MergeMigrationRequestPathParams, type MergeMigrationRequestVariables, type OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, type Paginable, type PaginationQueryMeta, type PreviewBranchSchemaEditError, type PreviewBranchSchemaEditPathParams, type PreviewBranchSchemaEditRequestBody, type PreviewBranchSchemaEditResponse, type PreviewBranchSchemaEditVariables, type PushBranchMigrationsError, type PushBranchMigrationsPathParams, type PushBranchMigrationsRequestBody, type PushBranchMigrationsVariables, type PutFileError, type PutFileItemError, type PutFileItemPathParams, type PutFileItemVariables, type PutFilePathParams, type PutFileVariables, Query, type QueryMigrationRequestsError, type QueryMigrationRequestsPathParams, type QueryMigrationRequestsRequestBody, type QueryMigrationRequestsResponse, type QueryMigrationRequestsVariables, type QueryTableError, type QueryTablePathParams, type QueryTableRequestBody, type QueryTableVariables, RecordArray, RecordColumnTypes, type RemoveGitBranchesEntryError, type RemoveGitBranchesEntryPathParams, type RemoveGitBranchesEntryQueryParams, type RemoveGitBranchesEntryVariables, type RemoveWorkspaceMemberError, type RemoveWorkspaceMemberPathParams, type RemoveWorkspaceMemberVariables, type RenameDatabaseError, type RenameDatabasePathParams, type RenameDatabaseRequestBody, type RenameDatabaseVariables, Repository, type ResendWorkspaceMemberInviteError, type ResendWorkspaceMemberInvitePathParams, type ResendWorkspaceMemberInviteVariables, type ResolveBranchError, type ResolveBranchPathParams, type ResolveBranchQueryParams, type ResolveBranchResponse, type ResolveBranchVariables, responses as Responses, RestRepository, SQLPlugin, type SQLPluginResult, type SQLQuery, type SQLQueryParams, type SchemaDefinition, type SchemaInference, SchemaPlugin, type SchemaPluginResult, schemas as Schemas, type SearchBranchError, type SearchBranchPathParams, type SearchBranchRequestBody, type SearchBranchVariables, type SearchOptions, SearchPlugin, type SearchPluginResult, type SearchTableError, type SearchTablePathParams, type SearchTableRequestBody, type SearchTableVariables, type SearchXataRecord, type SelectableColumn, type SelectedPick, type SerializedString, Serializer, type SerializerResult, type SetTableSchemaError, type SetTableSchemaPathParams, type SetTableSchemaRequestBody, type SetTableSchemaVariables, SimpleCache, type SimpleCacheOptions, type SqlQueryError, type SqlQueryPathParams, type SqlQueryRequestBody, type SqlQueryVariables, type SummarizeTableError, type SummarizeTablePathParams, type SummarizeTableRequestBody, type SummarizeTableVariables, type UpdateBranchMetadataError, type UpdateBranchMetadataPathParams, type UpdateBranchMetadataVariables, type UpdateBranchSchemaError, type UpdateBranchSchemaPathParams, type UpdateBranchSchemaVariables, type UpdateColumnError, type UpdateColumnPathParams, type UpdateColumnRequestBody, type UpdateColumnVariables, type UpdateDatabaseGithubSettingsError, type UpdateDatabaseGithubSettingsPathParams, type UpdateDatabaseGithubSettingsVariables, type UpdateDatabaseMetadataError, type UpdateDatabaseMetadataPathParams, type UpdateDatabaseMetadataRequestBody, type UpdateDatabaseMetadataVariables, type UpdateMigrationRequestError, type UpdateMigrationRequestPathParams, type UpdateMigrationRequestRequestBody, type UpdateMigrationRequestVariables, type UpdateOAuthAccessTokenError, type UpdateOAuthAccessTokenPathParams, type UpdateOAuthAccessTokenRequestBody, type UpdateOAuthAccessTokenVariables, type UpdateRecordWithIDError, type UpdateRecordWithIDPathParams, type UpdateRecordWithIDQueryParams, type UpdateRecordWithIDVariables, type UpdateTableError, type UpdateTablePathParams, type UpdateTableRequestBody, type UpdateTableVariables, type UpdateUserError, type UpdateUserVariables, type UpdateWorkspaceError, type UpdateWorkspaceMemberInviteError, type UpdateWorkspaceMemberInvitePathParams, type UpdateWorkspaceMemberInviteRequestBody, type UpdateWorkspaceMemberInviteVariables, type UpdateWorkspaceMemberRoleError, type UpdateWorkspaceMemberRolePathParams, type UpdateWorkspaceMemberRoleRequestBody, type UpdateWorkspaceMemberRoleVariables, type UpdateWorkspacePathParams, type UpdateWorkspaceVariables, type UploadDestination, type UpsertRecordWithIDError, type UpsertRecordWithIDPathParams, type UpsertRecordWithIDQueryParams, type UpsertRecordWithIDVariables, type ValueAtColumn, type VectorAskOptions, type VectorSearchTableError, type VectorSearchTablePathParams, type VectorSearchTableRequestBody, type VectorSearchTableVariables, XataApiClient, type XataApiClientOptions, XataApiPlugin, type XataArrayFile, XataError, XataFile, XataPlugin, type XataPluginOptions, type XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, transformImage, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateOAuthAccessToken, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
|
9474
|
+
export { type AcceptWorkspaceMemberInviteError, type AcceptWorkspaceMemberInvitePathParams, type AcceptWorkspaceMemberInviteVariables, type AddGitBranchesEntryError, type AddGitBranchesEntryPathParams, type AddGitBranchesEntryRequestBody, type AddGitBranchesEntryResponse, type AddGitBranchesEntryVariables, type AddTableColumnError, type AddTableColumnPathParams, type AddTableColumnVariables, type AggregateTableError, type AggregateTablePathParams, type AggregateTableRequestBody, type AggregateTableVariables, type ApiExtraProps, type ApplyBranchSchemaEditError, type ApplyBranchSchemaEditPathParams, type ApplyBranchSchemaEditRequestBody, type ApplyBranchSchemaEditVariables, type AskOptions, type AskResult, type AskTableError, type AskTablePathParams, type AskTableRequestBody, type AskTableResponse, type AskTableSessionError, type AskTableSessionPathParams, type AskTableSessionRequestBody, type AskTableSessionResponse, type AskTableSessionVariables, type AskTableVariables, BaseClient, type BaseClientOptions, type BaseData, type BaseSchema, type BinaryFile, type BranchTransactionError, type BranchTransactionPathParams, type BranchTransactionRequestBody, type BranchTransactionVariables, type BulkInsertTableRecordsError, type BulkInsertTableRecordsPathParams, type BulkInsertTableRecordsQueryParams, type BulkInsertTableRecordsRequestBody, type BulkInsertTableRecordsVariables, type CacheImpl, type CancelWorkspaceMemberInviteError, type CancelWorkspaceMemberInvitePathParams, type CancelWorkspaceMemberInviteVariables, type ClientConstructor, type ColumnsByValue, type CompareBranchSchemasError, type CompareBranchSchemasPathParams, type CompareBranchSchemasRequestBody, type CompareBranchSchemasVariables, type CompareBranchWithUserSchemaError, type CompareBranchWithUserSchemaPathParams, type CompareBranchWithUserSchemaRequestBody, type CompareBranchWithUserSchemaVariables, type CompareMigrationRequestError, type CompareMigrationRequestPathParams, type CompareMigrationRequestVariables, type CopyBranchError, type CopyBranchPathParams, type CopyBranchRequestBody, type CopyBranchVariables, type CreateBranchError, type CreateBranchPathParams, type CreateBranchQueryParams, type CreateBranchRequestBody, type CreateBranchResponse, type CreateBranchVariables, type CreateDatabaseError, type CreateDatabasePathParams, type CreateDatabaseRequestBody, type CreateDatabaseResponse, type CreateDatabaseVariables, type CreateMigrationRequestError, type CreateMigrationRequestPathParams, type CreateMigrationRequestRequestBody, type CreateMigrationRequestResponse, type CreateMigrationRequestVariables, type CreateTableError, type CreateTablePathParams, type CreateTableResponse, type CreateTableVariables, type CreateUserAPIKeyError, type CreateUserAPIKeyPathParams, type CreateUserAPIKeyResponse, type CreateUserAPIKeyVariables, type CreateWorkspaceError, type CreateWorkspaceVariables, type CursorNavigationOptions, type DeleteBranchError, type DeleteBranchPathParams, type DeleteBranchResponse, type DeleteBranchVariables, type DeleteColumnError, type DeleteColumnPathParams, type DeleteColumnVariables, type DeleteDatabaseError, type DeleteDatabaseGithubSettingsError, type DeleteDatabaseGithubSettingsPathParams, type DeleteDatabaseGithubSettingsVariables, type DeleteDatabasePathParams, type DeleteDatabaseResponse, type DeleteDatabaseVariables, type DeleteFileError, type DeleteFileItemError, type DeleteFileItemPathParams, type DeleteFileItemVariables, type DeleteFilePathParams, type DeleteFileVariables, type DeleteOAuthAccessTokenError, type DeleteOAuthAccessTokenPathParams, type DeleteOAuthAccessTokenVariables, type DeleteRecordError, type DeleteRecordPathParams, type DeleteRecordQueryParams, type DeleteRecordVariables, type DeleteTableError, type DeleteTablePathParams, type DeleteTableResponse, type DeleteTableVariables, type DeleteUserAPIKeyError, type DeleteUserAPIKeyPathParams, type DeleteUserAPIKeyVariables, type DeleteUserError, type DeleteUserOAuthClientError, type DeleteUserOAuthClientPathParams, type DeleteUserOAuthClientVariables, type DeleteUserVariables, type DeleteWorkspaceError, type DeleteWorkspacePathParams, type DeleteWorkspaceVariables, type DeserializedType, type DownloadDestination, type EditableData, type ExecuteBranchMigrationPlanError, type ExecuteBranchMigrationPlanPathParams, type ExecuteBranchMigrationPlanRequestBody, type ExecuteBranchMigrationPlanVariables, type FetchImpl, FetcherError, type FetcherExtraProps, type FileAccessError, type FileAccessPathParams, type FileAccessQueryParams, type FileAccessVariables, FilesPlugin, type FilesPluginResult, type GetAuthorizationCodeError, type GetAuthorizationCodeQueryParams, type GetAuthorizationCodeVariables, type GetBranchDetailsError, type GetBranchDetailsPathParams, type GetBranchDetailsVariables, type GetBranchListError, type GetBranchListPathParams, type GetBranchListVariables, type GetBranchMetadataError, type GetBranchMetadataPathParams, type GetBranchMetadataVariables, type GetBranchMigrationHistoryError, type GetBranchMigrationHistoryPathParams, type GetBranchMigrationHistoryRequestBody, type GetBranchMigrationHistoryResponse, type GetBranchMigrationHistoryVariables, type GetBranchMigrationPlanError, type GetBranchMigrationPlanPathParams, type GetBranchMigrationPlanVariables, type GetBranchSchemaHistoryError, type GetBranchSchemaHistoryPathParams, type GetBranchSchemaHistoryRequestBody, type GetBranchSchemaHistoryResponse, type GetBranchSchemaHistoryVariables, type GetBranchStatsError, type GetBranchStatsPathParams, type GetBranchStatsResponse, type GetBranchStatsVariables, type GetColumnError, type GetColumnPathParams, type GetColumnVariables, type GetDatabaseGithubSettingsError, type GetDatabaseGithubSettingsPathParams, type GetDatabaseGithubSettingsVariables, type GetDatabaseListError, type GetDatabaseListPathParams, type GetDatabaseListVariables, type GetDatabaseMetadataError, type GetDatabaseMetadataPathParams, type GetDatabaseMetadataVariables, type GetFileError, type GetFileItemError, type GetFileItemPathParams, type GetFileItemVariables, type GetFilePathParams, type GetFileVariables, type GetGitBranchesMappingError, type GetGitBranchesMappingPathParams, type GetGitBranchesMappingVariables, type GetMigrationRequestError, type GetMigrationRequestIsMergedError, type GetMigrationRequestIsMergedPathParams, type GetMigrationRequestIsMergedResponse, type GetMigrationRequestIsMergedVariables, type GetMigrationRequestPathParams, type GetMigrationRequestVariables, type GetRecordError, type GetRecordPathParams, type GetRecordQueryParams, type GetRecordVariables, type GetTableColumnsError, type GetTableColumnsPathParams, type GetTableColumnsResponse, type GetTableColumnsVariables, type GetTableSchemaError, type GetTableSchemaPathParams, type GetTableSchemaResponse, type GetTableSchemaVariables, type GetUserAPIKeysError, type GetUserAPIKeysResponse, type GetUserAPIKeysVariables, type GetUserError, type GetUserOAuthAccessTokensError, type GetUserOAuthAccessTokensResponse, type GetUserOAuthAccessTokensVariables, type GetUserOAuthClientsError, type GetUserOAuthClientsResponse, type GetUserOAuthClientsVariables, type GetUserVariables, type GetWorkspaceError, type GetWorkspaceMembersListError, type GetWorkspaceMembersListPathParams, type GetWorkspaceMembersListVariables, type GetWorkspacePathParams, type GetWorkspaceVariables, type GetWorkspacesListError, type GetWorkspacesListResponse, type GetWorkspacesListVariables, type GrantAuthorizationCodeError, type GrantAuthorizationCodeVariables, type HostProvider, type Identifiable, type ImageTransformations, type InsertRecordError, type InsertRecordPathParams, type InsertRecordQueryParams, type InsertRecordVariables, type InsertRecordWithIDError, type InsertRecordWithIDPathParams, type InsertRecordWithIDQueryParams, type InsertRecordWithIDVariables, type InviteWorkspaceMemberError, type InviteWorkspaceMemberPathParams, type InviteWorkspaceMemberRequestBody, type InviteWorkspaceMemberVariables, type JSONData, type KeywordAskOptions, type Link, type ListMigrationRequestsCommitsError, type ListMigrationRequestsCommitsPathParams, type ListMigrationRequestsCommitsRequestBody, type ListMigrationRequestsCommitsResponse, type ListMigrationRequestsCommitsVariables, type ListRegionsError, type ListRegionsPathParams, type ListRegionsVariables, type MergeMigrationRequestError, type MergeMigrationRequestPathParams, type MergeMigrationRequestVariables, type OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, type Paginable, type PaginationQueryMeta, type PreviewBranchSchemaEditError, type PreviewBranchSchemaEditPathParams, type PreviewBranchSchemaEditRequestBody, type PreviewBranchSchemaEditResponse, type PreviewBranchSchemaEditVariables, type PushBranchMigrationsError, type PushBranchMigrationsPathParams, type PushBranchMigrationsRequestBody, type PushBranchMigrationsVariables, type PutFileError, type PutFileItemError, type PutFileItemPathParams, type PutFileItemVariables, type PutFilePathParams, type PutFileVariables, Query, type QueryMigrationRequestsError, type QueryMigrationRequestsPathParams, type QueryMigrationRequestsRequestBody, type QueryMigrationRequestsResponse, type QueryMigrationRequestsVariables, type QueryTableError, type QueryTablePathParams, type QueryTableRequestBody, type QueryTableVariables, RecordArray, RecordColumnTypes, type RemoveGitBranchesEntryError, type RemoveGitBranchesEntryPathParams, type RemoveGitBranchesEntryQueryParams, type RemoveGitBranchesEntryVariables, type RemoveWorkspaceMemberError, type RemoveWorkspaceMemberPathParams, type RemoveWorkspaceMemberVariables, type RenameDatabaseError, type RenameDatabasePathParams, type RenameDatabaseRequestBody, type RenameDatabaseVariables, Repository, type ResendWorkspaceMemberInviteError, type ResendWorkspaceMemberInvitePathParams, type ResendWorkspaceMemberInviteVariables, type ResolveBranchError, type ResolveBranchPathParams, type ResolveBranchQueryParams, type ResolveBranchResponse, type ResolveBranchVariables, responses as Responses, RestRepository, SQLPlugin, type SQLPluginResult, type SQLQuery, type SQLQueryParams, type SchemaDefinition, type SchemaInference, SchemaPlugin, type SchemaPluginResult, schemas as Schemas, type SearchBranchError, type SearchBranchPathParams, type SearchBranchRequestBody, type SearchBranchVariables, type SearchOptions, SearchPlugin, type SearchPluginResult, type SearchTableError, type SearchTablePathParams, type SearchTableRequestBody, type SearchTableVariables, type SearchXataRecord, type SelectableColumn, type SelectableColumnWithObjectNotation, type SelectedPick, type SerializedString, Serializer, type SerializerResult, type SetTableSchemaError, type SetTableSchemaPathParams, type SetTableSchemaRequestBody, type SetTableSchemaVariables, SimpleCache, type SimpleCacheOptions, type SqlQueryError, type SqlQueryPathParams, type SqlQueryRequestBody, type SqlQueryVariables, type SummarizeTableError, type SummarizeTablePathParams, type SummarizeTableRequestBody, type SummarizeTableVariables, type UpdateBranchMetadataError, type UpdateBranchMetadataPathParams, type UpdateBranchMetadataVariables, type UpdateBranchSchemaError, type UpdateBranchSchemaPathParams, type UpdateBranchSchemaVariables, type UpdateColumnError, type UpdateColumnPathParams, type UpdateColumnRequestBody, type UpdateColumnVariables, type UpdateDatabaseGithubSettingsError, type UpdateDatabaseGithubSettingsPathParams, type UpdateDatabaseGithubSettingsVariables, type UpdateDatabaseMetadataError, type UpdateDatabaseMetadataPathParams, type UpdateDatabaseMetadataRequestBody, type UpdateDatabaseMetadataVariables, type UpdateMigrationRequestError, type UpdateMigrationRequestPathParams, type UpdateMigrationRequestRequestBody, type UpdateMigrationRequestVariables, type UpdateOAuthAccessTokenError, type UpdateOAuthAccessTokenPathParams, type UpdateOAuthAccessTokenRequestBody, type UpdateOAuthAccessTokenVariables, type UpdateRecordWithIDError, type UpdateRecordWithIDPathParams, type UpdateRecordWithIDQueryParams, type UpdateRecordWithIDVariables, type UpdateTableError, type UpdateTablePathParams, type UpdateTableRequestBody, type UpdateTableVariables, type UpdateUserError, type UpdateUserVariables, type UpdateWorkspaceError, type UpdateWorkspaceMemberInviteError, type UpdateWorkspaceMemberInvitePathParams, type UpdateWorkspaceMemberInviteRequestBody, type UpdateWorkspaceMemberInviteVariables, type UpdateWorkspaceMemberRoleError, type UpdateWorkspaceMemberRolePathParams, type UpdateWorkspaceMemberRoleRequestBody, type UpdateWorkspaceMemberRoleVariables, type UpdateWorkspacePathParams, type UpdateWorkspaceVariables, type UploadDestination, type UpsertRecordWithIDError, type UpsertRecordWithIDPathParams, type UpsertRecordWithIDQueryParams, type UpsertRecordWithIDVariables, type ValueAtColumn, type VectorAskOptions, type VectorSearchTableError, type VectorSearchTablePathParams, type VectorSearchTableRequestBody, type VectorSearchTableVariables, XataApiClient, type XataApiClientOptions, XataApiPlugin, type XataArrayFile, XataError, XataFile, XataPlugin, type XataPluginOptions, type XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isValidExpandedColumn, isValidSelectableColumns, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, transformImage, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateOAuthAccessToken, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
|
package/dist/index.mjs
CHANGED
@@ -527,7 +527,7 @@ function defaultOnOpen(response) {
|
|
527
527
|
}
|
528
528
|
}
|
529
529
|
|
530
|
-
const VERSION = "0.26.
|
530
|
+
const VERSION = "0.26.4";
|
531
531
|
|
532
532
|
var __defProp$7 = Object.defineProperty;
|
533
533
|
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
@@ -2718,19 +2718,23 @@ var __publicField$6 = (obj, key, value) => {
|
|
2718
2718
|
class XataFile {
|
2719
2719
|
constructor(file) {
|
2720
2720
|
/**
|
2721
|
-
*
|
2721
|
+
* Identifier of the file.
|
2722
|
+
*/
|
2723
|
+
__publicField$6(this, "id");
|
2724
|
+
/**
|
2725
|
+
* Name of the file.
|
2722
2726
|
*/
|
2723
2727
|
__publicField$6(this, "name");
|
2724
2728
|
/**
|
2725
|
-
* Media type of
|
2729
|
+
* Media type of the file.
|
2726
2730
|
*/
|
2727
2731
|
__publicField$6(this, "mediaType");
|
2728
2732
|
/**
|
2729
|
-
* Base64 encoded content of
|
2733
|
+
* Base64 encoded content of the file.
|
2730
2734
|
*/
|
2731
2735
|
__publicField$6(this, "base64Content");
|
2732
2736
|
/**
|
2733
|
-
* Whether to enable public url for
|
2737
|
+
* Whether to enable public url for the file.
|
2734
2738
|
*/
|
2735
2739
|
__publicField$6(this, "enablePublicUrl");
|
2736
2740
|
/**
|
@@ -2738,25 +2742,26 @@ class XataFile {
|
|
2738
2742
|
*/
|
2739
2743
|
__publicField$6(this, "signedUrlTimeout");
|
2740
2744
|
/**
|
2741
|
-
* Size of
|
2745
|
+
* Size of the file.
|
2742
2746
|
*/
|
2743
2747
|
__publicField$6(this, "size");
|
2744
2748
|
/**
|
2745
|
-
* Version of
|
2749
|
+
* Version of the file.
|
2746
2750
|
*/
|
2747
2751
|
__publicField$6(this, "version");
|
2748
2752
|
/**
|
2749
|
-
* Url of
|
2753
|
+
* Url of the file.
|
2750
2754
|
*/
|
2751
2755
|
__publicField$6(this, "url");
|
2752
2756
|
/**
|
2753
|
-
* Signed url of
|
2757
|
+
* Signed url of the file.
|
2754
2758
|
*/
|
2755
2759
|
__publicField$6(this, "signedUrl");
|
2756
2760
|
/**
|
2757
|
-
* Attributes of
|
2761
|
+
* Attributes of the file.
|
2758
2762
|
*/
|
2759
2763
|
__publicField$6(this, "attributes");
|
2764
|
+
this.id = file.id;
|
2760
2765
|
this.name = file.name || "";
|
2761
2766
|
this.mediaType = file.mediaType || "application/octet-stream";
|
2762
2767
|
this.base64Content = file.base64Content;
|
@@ -2887,6 +2892,25 @@ function cleanFilter(filter) {
|
|
2887
2892
|
return Object.keys(values).length > 0 ? values : void 0;
|
2888
2893
|
}
|
2889
2894
|
|
2895
|
+
function stringifyJson(value) {
|
2896
|
+
if (!isDefined(value))
|
2897
|
+
return value;
|
2898
|
+
if (isString(value))
|
2899
|
+
return value;
|
2900
|
+
try {
|
2901
|
+
return JSON.stringify(value);
|
2902
|
+
} catch (e) {
|
2903
|
+
return value;
|
2904
|
+
}
|
2905
|
+
}
|
2906
|
+
function parseJson(value) {
|
2907
|
+
try {
|
2908
|
+
return JSON.parse(value);
|
2909
|
+
} catch (e) {
|
2910
|
+
return value;
|
2911
|
+
}
|
2912
|
+
}
|
2913
|
+
|
2890
2914
|
var __defProp$5 = Object.defineProperty;
|
2891
2915
|
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2892
2916
|
var __publicField$5 = (obj, key, value) => {
|
@@ -3357,6 +3381,24 @@ function isXataRecord(x) {
|
|
3357
3381
|
return isIdentifiable(x) && isObject(metadata) && typeof metadata.version === "number";
|
3358
3382
|
}
|
3359
3383
|
|
3384
|
+
function isValidExpandedColumn(column) {
|
3385
|
+
return isObject(column) && isString(column.name);
|
3386
|
+
}
|
3387
|
+
function isValidSelectableColumns(columns) {
|
3388
|
+
if (!Array.isArray(columns)) {
|
3389
|
+
return false;
|
3390
|
+
}
|
3391
|
+
return columns.every((column) => {
|
3392
|
+
if (typeof column === "string") {
|
3393
|
+
return true;
|
3394
|
+
}
|
3395
|
+
if (typeof column === "object") {
|
3396
|
+
return isValidExpandedColumn(column);
|
3397
|
+
}
|
3398
|
+
return false;
|
3399
|
+
});
|
3400
|
+
}
|
3401
|
+
|
3360
3402
|
function isSortFilterString(value) {
|
3361
3403
|
return isString(value);
|
3362
3404
|
}
|
@@ -3457,24 +3499,24 @@ class RestRepository extends Query {
|
|
3457
3499
|
if (a.length === 0)
|
3458
3500
|
return [];
|
3459
3501
|
const ids = await __privateMethod$2(this, _insertRecords, insertRecords_fn).call(this, a, { ifVersion, createOnly: true });
|
3460
|
-
const columns =
|
3502
|
+
const columns = isValidSelectableColumns(b) ? b : ["*"];
|
3461
3503
|
const result = await this.read(ids, columns);
|
3462
3504
|
return result;
|
3463
3505
|
}
|
3464
3506
|
if (isString(a) && isObject(b)) {
|
3465
3507
|
if (a === "")
|
3466
3508
|
throw new Error("The id can't be empty");
|
3467
|
-
const columns =
|
3509
|
+
const columns = isValidSelectableColumns(c) ? c : void 0;
|
3468
3510
|
return await __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns, { createOnly: true, ifVersion });
|
3469
3511
|
}
|
3470
3512
|
if (isObject(a) && isString(a.id)) {
|
3471
3513
|
if (a.id === "")
|
3472
3514
|
throw new Error("The id can't be empty");
|
3473
|
-
const columns =
|
3515
|
+
const columns = isValidSelectableColumns(b) ? b : void 0;
|
3474
3516
|
return await __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns, { createOnly: true, ifVersion });
|
3475
3517
|
}
|
3476
3518
|
if (isObject(a)) {
|
3477
|
-
const columns =
|
3519
|
+
const columns = isValidSelectableColumns(b) ? b : void 0;
|
3478
3520
|
return __privateMethod$2(this, _insertRecordWithoutId, insertRecordWithoutId_fn).call(this, a, columns);
|
3479
3521
|
}
|
3480
3522
|
throw new Error("Invalid arguments for create method");
|
@@ -3482,7 +3524,7 @@ class RestRepository extends Query {
|
|
3482
3524
|
}
|
3483
3525
|
async read(a, b) {
|
3484
3526
|
return __privateGet$4(this, _trace).call(this, "read", async () => {
|
3485
|
-
const columns =
|
3527
|
+
const columns = isValidSelectableColumns(b) ? b : ["*"];
|
3486
3528
|
if (Array.isArray(a)) {
|
3487
3529
|
if (a.length === 0)
|
3488
3530
|
return [];
|
@@ -3509,7 +3551,13 @@ class RestRepository extends Query {
|
|
3509
3551
|
...__privateGet$4(this, _getFetchProps).call(this)
|
3510
3552
|
});
|
3511
3553
|
const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
|
3512
|
-
return initObject(
|
3554
|
+
return initObject(
|
3555
|
+
__privateGet$4(this, _db),
|
3556
|
+
schemaTables,
|
3557
|
+
__privateGet$4(this, _table),
|
3558
|
+
response,
|
3559
|
+
columns
|
3560
|
+
);
|
3513
3561
|
} catch (e) {
|
3514
3562
|
if (isObject(e) && e.status === 404) {
|
3515
3563
|
return null;
|
@@ -3551,17 +3599,17 @@ class RestRepository extends Query {
|
|
3551
3599
|
ifVersion,
|
3552
3600
|
upsert: false
|
3553
3601
|
});
|
3554
|
-
const columns =
|
3602
|
+
const columns = isValidSelectableColumns(b) ? b : ["*"];
|
3555
3603
|
const result = await this.read(a, columns);
|
3556
3604
|
return result;
|
3557
3605
|
}
|
3558
3606
|
try {
|
3559
3607
|
if (isString(a) && isObject(b)) {
|
3560
|
-
const columns =
|
3608
|
+
const columns = isValidSelectableColumns(c) ? c : void 0;
|
3561
3609
|
return await __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a, b, columns, { ifVersion });
|
3562
3610
|
}
|
3563
3611
|
if (isObject(a) && isString(a.id)) {
|
3564
|
-
const columns =
|
3612
|
+
const columns = isValidSelectableColumns(b) ? b : void 0;
|
3565
3613
|
return await __privateMethod$2(this, _updateRecordWithID, updateRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
|
3566
3614
|
}
|
3567
3615
|
} catch (error) {
|
@@ -3601,20 +3649,20 @@ class RestRepository extends Query {
|
|
3601
3649
|
ifVersion,
|
3602
3650
|
upsert: true
|
3603
3651
|
});
|
3604
|
-
const columns =
|
3652
|
+
const columns = isValidSelectableColumns(b) ? b : ["*"];
|
3605
3653
|
const result = await this.read(a, columns);
|
3606
3654
|
return result;
|
3607
3655
|
}
|
3608
3656
|
if (isString(a) && isObject(b)) {
|
3609
3657
|
if (a === "")
|
3610
3658
|
throw new Error("The id can't be empty");
|
3611
|
-
const columns =
|
3659
|
+
const columns = isValidSelectableColumns(c) ? c : void 0;
|
3612
3660
|
return await __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a, b, columns, { ifVersion });
|
3613
3661
|
}
|
3614
3662
|
if (isObject(a) && isString(a.id)) {
|
3615
3663
|
if (a.id === "")
|
3616
3664
|
throw new Error("The id can't be empty");
|
3617
|
-
const columns =
|
3665
|
+
const columns = isValidSelectableColumns(c) ? c : void 0;
|
3618
3666
|
return await __privateMethod$2(this, _upsertRecordWithID, upsertRecordWithID_fn).call(this, a.id, { ...a, id: void 0 }, columns, { ifVersion });
|
3619
3667
|
}
|
3620
3668
|
if (!isDefined(a) && isObject(b)) {
|
@@ -3633,20 +3681,20 @@ class RestRepository extends Query {
|
|
3633
3681
|
if (a.length === 0)
|
3634
3682
|
return [];
|
3635
3683
|
const ids = await __privateMethod$2(this, _insertRecords, insertRecords_fn).call(this, a, { ifVersion, createOnly: false });
|
3636
|
-
const columns =
|
3684
|
+
const columns = isValidSelectableColumns(b) ? b : ["*"];
|
3637
3685
|
const result = await this.read(ids, columns);
|
3638
3686
|
return result;
|
3639
3687
|
}
|
3640
3688
|
if (isString(a) && isObject(b)) {
|
3641
3689
|
if (a === "")
|
3642
3690
|
throw new Error("The id can't be empty");
|
3643
|
-
const columns =
|
3691
|
+
const columns = isValidSelectableColumns(c) ? c : void 0;
|
3644
3692
|
return await __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a, b, columns, { createOnly: false, ifVersion });
|
3645
3693
|
}
|
3646
3694
|
if (isObject(a) && isString(a.id)) {
|
3647
3695
|
if (a.id === "")
|
3648
3696
|
throw new Error("The id can't be empty");
|
3649
|
-
const columns =
|
3697
|
+
const columns = isValidSelectableColumns(c) ? c : void 0;
|
3650
3698
|
return await __privateMethod$2(this, _insertRecordWithId, insertRecordWithId_fn).call(this, a.id, { ...a, id: void 0 }, columns, { createOnly: false, ifVersion });
|
3651
3699
|
}
|
3652
3700
|
if (!isDefined(a) && isObject(b)) {
|
@@ -3670,7 +3718,7 @@ class RestRepository extends Query {
|
|
3670
3718
|
return o.id;
|
3671
3719
|
throw new Error("Invalid arguments for delete method");
|
3672
3720
|
});
|
3673
|
-
const columns =
|
3721
|
+
const columns = isValidSelectableColumns(b) ? b : ["*"];
|
3674
3722
|
const result = await this.read(a, columns);
|
3675
3723
|
await __privateMethod$2(this, _deleteRecords, deleteRecords_fn).call(this, ids);
|
3676
3724
|
return result;
|
@@ -3789,7 +3837,13 @@ class RestRepository extends Query {
|
|
3789
3837
|
});
|
3790
3838
|
const schemaTables = await __privateMethod$2(this, _getSchemaTables$1, getSchemaTables_fn$1).call(this);
|
3791
3839
|
const records = objects.map(
|
3792
|
-
(record) => initObject(
|
3840
|
+
(record) => initObject(
|
3841
|
+
__privateGet$4(this, _db),
|
3842
|
+
schemaTables,
|
3843
|
+
__privateGet$4(this, _table),
|
3844
|
+
record,
|
3845
|
+
data.columns ?? ["*"]
|
3846
|
+
)
|
3793
3847
|
);
|
3794
3848
|
await __privateMethod$2(this, _setCacheQuery, setCacheQuery_fn).call(this, query, meta, records);
|
3795
3849
|
return new Page(query, meta, records);
|
@@ -4095,6 +4149,9 @@ transformObjectToApi_fn = async function(object) {
|
|
4095
4149
|
case "file[]":
|
4096
4150
|
result[key] = await promiseMap(value, (item) => parseInputFileEntry(item));
|
4097
4151
|
break;
|
4152
|
+
case "json":
|
4153
|
+
result[key] = stringifyJson(value);
|
4154
|
+
break;
|
4098
4155
|
default:
|
4099
4156
|
result[key] = value;
|
4100
4157
|
}
|
@@ -4138,13 +4195,19 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
4138
4195
|
if (item === column.name) {
|
4139
4196
|
return [...acc, "*"];
|
4140
4197
|
}
|
4141
|
-
if (item.startsWith(`${column.name}.`)) {
|
4198
|
+
if (isString(item) && item.startsWith(`${column.name}.`)) {
|
4142
4199
|
const [, ...path] = item.split(".");
|
4143
4200
|
return [...acc, path.join(".")];
|
4144
4201
|
}
|
4145
4202
|
return acc;
|
4146
4203
|
}, []);
|
4147
|
-
data[column.name] = initObject(
|
4204
|
+
data[column.name] = initObject(
|
4205
|
+
db,
|
4206
|
+
schemaTables,
|
4207
|
+
linkTable,
|
4208
|
+
value,
|
4209
|
+
selectedLinkColumns
|
4210
|
+
);
|
4148
4211
|
} else {
|
4149
4212
|
data[column.name] = null;
|
4150
4213
|
}
|
@@ -4156,6 +4219,9 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
4156
4219
|
case "file[]":
|
4157
4220
|
data[column.name] = value?.map((item) => new XataFile(item)) ?? null;
|
4158
4221
|
break;
|
4222
|
+
case "json":
|
4223
|
+
data[column.name] = parseJson(value);
|
4224
|
+
break;
|
4159
4225
|
default:
|
4160
4226
|
data[column.name] = value ?? null;
|
4161
4227
|
if (column.notNull === true && value === null) {
|
@@ -4171,12 +4237,12 @@ const initObject = (db, schemaTables, table, object, selectedColumns) => {
|
|
4171
4237
|
return db[table].read(record["id"], columns2);
|
4172
4238
|
};
|
4173
4239
|
record.update = function(data2, b, c) {
|
4174
|
-
const columns2 =
|
4240
|
+
const columns2 = isValidSelectableColumns(b) ? b : ["*"];
|
4175
4241
|
const ifVersion = parseIfVersion(b, c);
|
4176
4242
|
return db[table].update(record["id"], data2, columns2, { ifVersion });
|
4177
4243
|
};
|
4178
4244
|
record.replace = function(data2, b, c) {
|
4179
|
-
const columns2 =
|
4245
|
+
const columns2 = isValidSelectableColumns(b) ? b : ["*"];
|
4180
4246
|
const ifVersion = parseIfVersion(b, c);
|
4181
4247
|
return db[table].createOrReplace(record["id"], data2, columns2, { ifVersion });
|
4182
4248
|
};
|
@@ -4209,7 +4275,7 @@ function extractId(value) {
|
|
4209
4275
|
function isValidColumn(columns, column) {
|
4210
4276
|
if (columns.includes("*"))
|
4211
4277
|
return true;
|
4212
|
-
return columns.filter((item) => item.startsWith(column.name)).length > 0;
|
4278
|
+
return columns.filter((item) => isString(item) && item.startsWith(column.name)).length > 0;
|
4213
4279
|
}
|
4214
4280
|
function parseIfVersion(...args) {
|
4215
4281
|
for (const arg of args) {
|
@@ -4774,5 +4840,5 @@ class XataError extends Error {
|
|
4774
4840
|
}
|
4775
4841
|
}
|
4776
4842
|
|
4777
|
-
export { BaseClient, FetcherError, FilesPlugin, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, RecordColumnTypes, Repository, RestRepository, SQLPlugin, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataFile, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, transformImage, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateOAuthAccessToken, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
|
4843
|
+
export { BaseClient, FetcherError, FilesPlugin, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, RecordColumnTypes, Repository, RestRepository, SQLPlugin, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataFile, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isValidExpandedColumn, isValidSelectableColumns, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, transformImage, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateOAuthAccessToken, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
|
4778
4844
|
//# sourceMappingURL=index.mjs.map
|