@xata.io/client 0.0.0-alpha.vfaca77b → 0.0.0-alpha.vfb22b4f
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/CHANGELOG.md +48 -0
- package/README.md +65 -52
- package/Usage.md +395 -0
- package/dist/index.cjs +244 -119
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +152 -38
- package/dist/index.mjs +226 -120
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
@@ -6,6 +6,9 @@ declare type FetchImpl = (url: string, init?: {
|
|
6
6
|
ok: boolean;
|
7
7
|
status: number;
|
8
8
|
json(): Promise<any>;
|
9
|
+
headers?: {
|
10
|
+
get(name: string): string | null;
|
11
|
+
};
|
9
12
|
}>;
|
10
13
|
declare type WorkspaceApiUrlBuilder = (path: string, pathParams: Record<string, string>) => string;
|
11
14
|
declare type FetcherExtraProps = {
|
@@ -279,6 +282,10 @@ declare type SortOrder = 'asc' | 'desc';
|
|
279
282
|
* @minimum 0
|
280
283
|
*/
|
281
284
|
declare type FuzzinessExpression = number;
|
285
|
+
/**
|
286
|
+
* If the prefix type is set to "disabled" (the default), the search only matches full words. If the prefix type is set to "phrase", the search will return results that match prefixes of the search phrase.
|
287
|
+
*/
|
288
|
+
declare type PrefixExpression = 'phrase' | 'disabled';
|
282
289
|
/**
|
283
290
|
* @minProperties 1
|
284
291
|
*/
|
@@ -430,6 +437,7 @@ type schemas_ColumnMigration = ColumnMigration;
|
|
430
437
|
type schemas_SortExpression = SortExpression;
|
431
438
|
type schemas_SortOrder = SortOrder;
|
432
439
|
type schemas_FuzzinessExpression = FuzzinessExpression;
|
440
|
+
type schemas_PrefixExpression = PrefixExpression;
|
433
441
|
type schemas_FilterExpression = FilterExpression;
|
434
442
|
type schemas_HighlightExpression = HighlightExpression;
|
435
443
|
type schemas_FilterList = FilterList;
|
@@ -485,6 +493,7 @@ declare namespace schemas {
|
|
485
493
|
schemas_SortExpression as SortExpression,
|
486
494
|
schemas_SortOrder as SortOrder,
|
487
495
|
schemas_FuzzinessExpression as FuzzinessExpression,
|
496
|
+
schemas_PrefixExpression as PrefixExpression,
|
488
497
|
schemas_FilterExpression as FilterExpression,
|
489
498
|
schemas_HighlightExpression as HighlightExpression,
|
490
499
|
schemas_FilterList as FilterList,
|
@@ -1842,6 +1851,9 @@ declare type BulkInsertTableRecordsError = ErrorWrapper<{
|
|
1842
1851
|
} | {
|
1843
1852
|
status: 404;
|
1844
1853
|
payload: SimpleError;
|
1854
|
+
} | {
|
1855
|
+
status: 422;
|
1856
|
+
payload: SimpleError;
|
1845
1857
|
}>;
|
1846
1858
|
declare type BulkInsertTableRecordsResponse = {
|
1847
1859
|
recordIDs: string[];
|
@@ -2622,6 +2634,7 @@ declare type SearchTableError = ErrorWrapper<{
|
|
2622
2634
|
declare type SearchTableRequestBody = {
|
2623
2635
|
query: string;
|
2624
2636
|
fuzziness?: FuzzinessExpression;
|
2637
|
+
prefix?: PrefixExpression;
|
2625
2638
|
filter?: FilterExpression;
|
2626
2639
|
highlight?: HighlightExpression;
|
2627
2640
|
};
|
@@ -2798,7 +2811,7 @@ declare class DatabaseApi {
|
|
2798
2811
|
getGitBranchesMapping(workspace: WorkspaceID, dbName: DBName): Promise<ListGitBranchesResponse>;
|
2799
2812
|
addGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, body: AddGitBranchesEntryRequestBody): Promise<AddGitBranchesEntryResponse>;
|
2800
2813
|
removeGitBranchesEntry(workspace: WorkspaceID, dbName: DBName, gitBranch: string): Promise<void>;
|
2801
|
-
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch
|
2814
|
+
resolveBranch(workspace: WorkspaceID, dbName: DBName, gitBranch?: string, fallbackBranch?: string): Promise<ResolveBranchResponse>;
|
2802
2815
|
}
|
2803
2816
|
declare class BranchApi {
|
2804
2817
|
private extraProps;
|
@@ -2867,25 +2880,24 @@ declare type SelectableColumn<O, RecursivePath extends any[] = []> = '*' | 'id'
|
|
2867
2880
|
declare type SelectedPick<O extends XataRecord, Key extends SelectableColumn<O>[]> = XataRecord & UnionToIntersection<Values<{
|
2868
2881
|
[K in Key[number]]: NestedValueAtColumn<O, K> & XataRecord;
|
2869
2882
|
}>>;
|
2870
|
-
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<
|
2871
|
-
V: ValueAtColumn<
|
2872
|
-
} : never : O[K]> : never : never;
|
2883
|
+
declare type ValueAtColumn<O, P extends SelectableColumn<O>> = P extends '*' ? Values<O> : P extends 'id' ? string : P extends keyof O ? O[P] : P extends `${infer K}.${infer V}` ? K extends keyof O ? Values<NonNullable<O[K]> extends infer Item ? Item extends Record<string, any> ? V extends SelectableColumn<Item> ? {
|
2884
|
+
V: ValueAtColumn<Item, V>;
|
2885
|
+
} : never : O[K] : never> : never : never;
|
2873
2886
|
declare type MAX_RECURSION = 5;
|
2874
2887
|
declare type NestedColumns<O, RecursivePath extends any[]> = RecursivePath['length'] extends MAX_RECURSION ? never : If<IsObject<O>, Values<{
|
2875
|
-
[K in DataProps<O>]:
|
2876
|
-
If<IsObject<
|
2877
|
-
K
|
2888
|
+
[K in DataProps<O>]: NonNullable<O[K]> extends infer Item ? If<IsArray<Item>, K, // If the property is an array, we stop recursion. We don't support object arrays yet
|
2889
|
+
If<IsObject<Item>, Item extends XataRecord ? SelectableColumn<Item, [...RecursivePath, Item]> extends infer Column ? Column extends string ? K | `${K}.${Column}` : never : never : Item extends Date ? K : `${K}.${StringKeys<Item> | '*'}`, // This allows usage of objects that are not links
|
2890
|
+
K>> : never;
|
2878
2891
|
}>, never>;
|
2879
2892
|
declare type DataProps<O> = Exclude<StringKeys<O>, StringKeys<XataRecord>>;
|
2880
2893
|
declare type NestedValueAtColumn<O, Key extends SelectableColumn<O>> = Key extends `${infer N}.${infer M}` ? N extends DataProps<O> ? {
|
2881
|
-
[K in N]: M extends SelectableColumn<
|
2894
|
+
[K in N]: M extends SelectableColumn<NonNullable<O[K]>> ? NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], NestedValueAtColumn<NonNullable<O[K]>, M> & XataRecord> : ForwardNullable<O[K], NestedValueAtColumn<NonNullable<O[K]>, M>> : unknown;
|
2882
2895
|
} : unknown : Key extends DataProps<O> ? {
|
2883
|
-
[K in Key]:
|
2896
|
+
[K in Key]: NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], SelectedPick<NonNullable<O[K]>, ['*']>> : O[K];
|
2884
2897
|
} : Key extends '*' ? {
|
2885
|
-
[K in StringKeys<O>]:
|
2898
|
+
[K in StringKeys<O>]: NonNullable<O[K]> extends XataRecord ? ForwardNullable<O[K], Link<NonNullable<O[K]>>> : O[K];
|
2886
2899
|
} : unknown;
|
2887
|
-
declare type
|
2888
|
-
declare type ForwardNullable<T, R> = T extends RemoveNullable<T> ? R : R | null;
|
2900
|
+
declare type ForwardNullable<T, R> = T extends NonNullable<T> ? R : R | null;
|
2889
2901
|
|
2890
2902
|
/**
|
2891
2903
|
* Represents an identifiable record from the database.
|
@@ -2950,9 +2962,9 @@ declare function isXataRecord(x: any): x is XataRecord & Record<string, unknown>
|
|
2950
2962
|
declare type EditableData<O extends BaseData> = {
|
2951
2963
|
[K in keyof O]: O[K] extends XataRecord ? {
|
2952
2964
|
id: string;
|
2953
|
-
} : NonNullable<O[K]> extends XataRecord ? {
|
2965
|
+
} | string : NonNullable<O[K]> extends XataRecord ? {
|
2954
2966
|
id: string;
|
2955
|
-
} | null | undefined : O[K];
|
2967
|
+
} | string | null | undefined : O[K];
|
2956
2968
|
};
|
2957
2969
|
|
2958
2970
|
/**
|
@@ -3083,7 +3095,7 @@ declare type QueryOptions<T extends XataRecord> = BaseOptions<T> & (CursorQueryO
|
|
3083
3095
|
declare class Query<Record extends XataRecord, Result extends XataRecord = Record> implements Paginable<Record, Result> {
|
3084
3096
|
#private;
|
3085
3097
|
readonly meta: PaginationQueryMeta;
|
3086
|
-
readonly records: Result
|
3098
|
+
readonly records: RecordArray<Result>;
|
3087
3099
|
constructor(repository: Repository<Record> | null, table: string, data: Partial<QueryOptions<Record>>, rawParent?: Partial<QueryOptions<Record>>);
|
3088
3100
|
getQueryOptions(): QueryOptions<Record>;
|
3089
3101
|
key(): string;
|
@@ -3206,19 +3218,19 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3206
3218
|
* Performs the query in the database and returns a set of results.
|
3207
3219
|
* @returns An array of records from the database.
|
3208
3220
|
*/
|
3209
|
-
getMany(): Promise<Result
|
3221
|
+
getMany(): Promise<RecordArray<Result>>;
|
3210
3222
|
/**
|
3211
3223
|
* Performs the query in the database and returns a set of results.
|
3212
3224
|
* @param options Additional options to be used when performing the query.
|
3213
3225
|
* @returns An array of records from the database.
|
3214
3226
|
*/
|
3215
|
-
getMany
|
3227
|
+
getMany<Options extends RequiredBy<QueryOptions<Record>, 'columns'>>(options: Options): Promise<RecordArray<SelectedPick<Record, typeof options['columns']>>>;
|
3216
3228
|
/**
|
3217
3229
|
* Performs the query in the database and returns a set of results.
|
3218
3230
|
* @param options Additional options to be used when performing the query.
|
3219
3231
|
* @returns An array of records from the database.
|
3220
3232
|
*/
|
3221
|
-
getMany
|
3233
|
+
getMany(options: OmitBy<QueryOptions<Record>, 'columns'>): Promise<RecordArray<Result>>;
|
3222
3234
|
/**
|
3223
3235
|
* Performs the query in the database and returns all the results.
|
3224
3236
|
* Warning: If there are a large number of results, this method can have performance implications.
|
@@ -3231,18 +3243,18 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3231
3243
|
* @param options Additional options to be used when performing the query.
|
3232
3244
|
* @returns An array of records from the database.
|
3233
3245
|
*/
|
3234
|
-
getAll
|
3246
|
+
getAll<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'> & {
|
3235
3247
|
batchSize?: number;
|
3236
|
-
}): Promise<
|
3248
|
+
}>(options: Options): Promise<SelectedPick<Record, typeof options['columns']>[]>;
|
3237
3249
|
/**
|
3238
3250
|
* Performs the query in the database and returns all the results.
|
3239
3251
|
* Warning: If there are a large number of results, this method can have performance implications.
|
3240
3252
|
* @param options Additional options to be used when performing the query.
|
3241
3253
|
* @returns An array of records from the database.
|
3242
3254
|
*/
|
3243
|
-
getAll
|
3255
|
+
getAll(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'> & {
|
3244
3256
|
batchSize?: number;
|
3245
|
-
}
|
3257
|
+
}): Promise<Result[]>;
|
3246
3258
|
/**
|
3247
3259
|
* Performs the query in the database and returns the first result.
|
3248
3260
|
* @returns The first record that matches the query, or null if no record matched the query.
|
@@ -3253,13 +3265,13 @@ declare class Query<Record extends XataRecord, Result extends XataRecord = Recor
|
|
3253
3265
|
* @param options Additional options to be used when performing the query.
|
3254
3266
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3255
3267
|
*/
|
3256
|
-
getFirst
|
3268
|
+
getFirst<Options extends RequiredBy<OmitBy<QueryOptions<Record>, 'pagination'>, 'columns'>>(options: Options): Promise<SelectedPick<Record, typeof options['columns']> | null>;
|
3257
3269
|
/**
|
3258
3270
|
* Performs the query in the database and returns the first result.
|
3259
3271
|
* @param options Additional options to be used when performing the query.
|
3260
3272
|
* @returns The first record that matches the query, or null if no record matched the query.
|
3261
3273
|
*/
|
3262
|
-
getFirst
|
3274
|
+
getFirst(options: OmitBy<QueryOptions<Record>, 'columns' | 'pagination'>): Promise<Result | null>;
|
3263
3275
|
/**
|
3264
3276
|
* Builds a new query object adding a cache TTL in milliseconds.
|
3265
3277
|
* @param ttl The cache TTL in milliseconds.
|
@@ -3304,7 +3316,7 @@ declare type PaginationQueryMeta = {
|
|
3304
3316
|
};
|
3305
3317
|
interface Paginable<Record extends XataRecord, Result extends XataRecord = Record> {
|
3306
3318
|
meta: PaginationQueryMeta;
|
3307
|
-
records: Result
|
3319
|
+
records: RecordArray<Result>;
|
3308
3320
|
nextPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3309
3321
|
previousPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
3310
3322
|
firstPage(size?: number, offset?: number): Promise<Page<Record, Result>>;
|
@@ -3324,7 +3336,7 @@ declare class Page<Record extends XataRecord, Result extends XataRecord = Record
|
|
3324
3336
|
/**
|
3325
3337
|
* The set of results for this page.
|
3326
3338
|
*/
|
3327
|
-
readonly records: Result
|
3339
|
+
readonly records: RecordArray<Result>;
|
3328
3340
|
constructor(query: Query<Record, Result>, meta: PaginationQueryMeta, records?: Result[]);
|
3329
3341
|
/**
|
3330
3342
|
* Retrieves the next page of results.
|
@@ -3373,10 +3385,45 @@ declare type OffsetNavigationOptions = {
|
|
3373
3385
|
offset?: number;
|
3374
3386
|
};
|
3375
3387
|
declare const PAGINATION_MAX_SIZE = 200;
|
3376
|
-
declare const PAGINATION_DEFAULT_SIZE =
|
3388
|
+
declare const PAGINATION_DEFAULT_SIZE = 20;
|
3377
3389
|
declare const PAGINATION_MAX_OFFSET = 800;
|
3378
3390
|
declare const PAGINATION_DEFAULT_OFFSET = 0;
|
3379
3391
|
declare function isCursorPaginationOptions(options: Record<string, unknown> | undefined | null): options is CursorNavigationOptions;
|
3392
|
+
declare class RecordArray<Result extends XataRecord> extends Array<Result> {
|
3393
|
+
#private;
|
3394
|
+
constructor(page: Paginable<any, Result>, overrideRecords?: Result[]);
|
3395
|
+
static parseConstructorParams(...args: any[]): any[];
|
3396
|
+
toArray(): Result[];
|
3397
|
+
map<U>(callbackfn: (value: Result, index: number, array: Result[]) => U, thisArg?: any): U[];
|
3398
|
+
/**
|
3399
|
+
* Retrieve next page of records
|
3400
|
+
*
|
3401
|
+
* @returns A new array of objects
|
3402
|
+
*/
|
3403
|
+
nextPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3404
|
+
/**
|
3405
|
+
* Retrieve previous page of records
|
3406
|
+
*
|
3407
|
+
* @returns A new array of objects
|
3408
|
+
*/
|
3409
|
+
previousPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3410
|
+
/**
|
3411
|
+
* Retrieve first page of records
|
3412
|
+
*
|
3413
|
+
* @returns A new array of objects
|
3414
|
+
*/
|
3415
|
+
firstPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3416
|
+
/**
|
3417
|
+
* Retrieve last page of records
|
3418
|
+
*
|
3419
|
+
* @returns A new array of objects
|
3420
|
+
*/
|
3421
|
+
lastPage(size?: number, offset?: number): Promise<RecordArray<Result>>;
|
3422
|
+
/**
|
3423
|
+
* @returns Boolean indicating if there is a next page
|
3424
|
+
*/
|
3425
|
+
hasNextPage(): boolean;
|
3426
|
+
}
|
3380
3427
|
|
3381
3428
|
/**
|
3382
3429
|
* Common interface for performing operations on a table.
|
@@ -3408,6 +3455,18 @@ declare abstract class Repository<Data extends BaseData, Record extends XataReco
|
|
3408
3455
|
* @returns The persisted records for the given ids (if a record could not be found it is not returned).
|
3409
3456
|
*/
|
3410
3457
|
abstract read(ids: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3458
|
+
/**
|
3459
|
+
* Queries a single record from the table by the id in the object.
|
3460
|
+
* @param object Object containing the id of the record.
|
3461
|
+
* @returns The persisted record for the given id or null if the record could not be found.
|
3462
|
+
*/
|
3463
|
+
abstract read(object: Identifiable): Promise<Readonly<SelectedPick<Record, ['*']> | null>>;
|
3464
|
+
/**
|
3465
|
+
* Queries multiple records from the table by the ids in the objects.
|
3466
|
+
* @param objects Array of objects containing the ids of the records.
|
3467
|
+
* @returns The persisted records for the given ids (if a record could not be found it is not returned).
|
3468
|
+
*/
|
3469
|
+
abstract read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3411
3470
|
/**
|
3412
3471
|
* Partially update a single record.
|
3413
3472
|
* @param object An object with its id and the columns to be updated.
|
@@ -3493,12 +3552,15 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
3493
3552
|
table: string;
|
3494
3553
|
db: SchemaPluginResult<any>;
|
3495
3554
|
pluginOptions: XataPluginOptions;
|
3555
|
+
schemaTables?: Table[];
|
3496
3556
|
});
|
3497
|
-
create(object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
3498
|
-
create(recordId: string, object: EditableData<Data>): Promise<SelectedPick<Record, ['*']
|
3499
|
-
create(objects: EditableData<Data>[]): Promise<SelectedPick<Record, ['*']
|
3557
|
+
create(object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3558
|
+
create(recordId: string, object: EditableData<Data>): Promise<Readonly<SelectedPick<Record, ['*']>>>;
|
3559
|
+
create(objects: EditableData<Data>[]): Promise<Readonly<SelectedPick<Record, ['*']>>[]>;
|
3500
3560
|
read(recordId: string): Promise<SelectedPick<Record, ['*']> | null>;
|
3501
3561
|
read(recordIds: string[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3562
|
+
read(object: Identifiable): Promise<SelectedPick<Record, ['*']> | null>;
|
3563
|
+
read(objects: Identifiable[]): Promise<Array<Readonly<SelectedPick<Record, ['*']>>>>;
|
3502
3564
|
update(object: Partial<EditableData<Data>> & Identifiable): Promise<SelectedPick<Record, ['*']>>;
|
3503
3565
|
update(recordId: string, object: Partial<EditableData<Data>>): Promise<SelectedPick<Record, ['*']>>;
|
3504
3566
|
update(objects: Array<Partial<EditableData<Data>> & Identifiable>): Promise<SelectedPick<Record, ['*']>[]>;
|
@@ -3514,6 +3576,59 @@ declare class RestRepository<Data extends BaseData, Record extends XataRecord =
|
|
3514
3576
|
query<Result extends XataRecord>(query: Query<Record, Result>): Promise<Page<Record, Result>>;
|
3515
3577
|
}
|
3516
3578
|
|
3579
|
+
declare type BaseSchema = {
|
3580
|
+
name: string;
|
3581
|
+
columns: readonly ({
|
3582
|
+
name: string;
|
3583
|
+
type: Column['type'];
|
3584
|
+
} | {
|
3585
|
+
name: string;
|
3586
|
+
type: 'link';
|
3587
|
+
link: {
|
3588
|
+
table: string;
|
3589
|
+
};
|
3590
|
+
} | {
|
3591
|
+
name: string;
|
3592
|
+
type: 'object';
|
3593
|
+
columns: {
|
3594
|
+
name: string;
|
3595
|
+
type: string;
|
3596
|
+
}[];
|
3597
|
+
})[];
|
3598
|
+
};
|
3599
|
+
declare type SchemaInference<T extends readonly BaseSchema[]> = T extends never[] ? Record<string, Record<string, any>> : T extends readonly unknown[] ? T[number] extends {
|
3600
|
+
name: string;
|
3601
|
+
columns: readonly unknown[];
|
3602
|
+
} ? {
|
3603
|
+
[K in T[number]['name']]: TableType<T[number], K>;
|
3604
|
+
} : never : never;
|
3605
|
+
declare type TableType<Tables, TableName> = Tables & {
|
3606
|
+
name: TableName;
|
3607
|
+
} extends infer Table ? Table extends {
|
3608
|
+
name: string;
|
3609
|
+
columns: infer Columns;
|
3610
|
+
} ? Columns extends readonly unknown[] ? Columns[number] extends {
|
3611
|
+
name: string;
|
3612
|
+
type: string;
|
3613
|
+
} ? Identifiable & {
|
3614
|
+
[K in Columns[number]['name']]?: PropertyType<Tables, Columns[number], K>;
|
3615
|
+
} : never : never : never : never;
|
3616
|
+
declare type PropertyType<Tables, Properties, PropertyName> = Properties & {
|
3617
|
+
name: PropertyName;
|
3618
|
+
} extends infer Property ? Property extends {
|
3619
|
+
name: string;
|
3620
|
+
type: infer Type;
|
3621
|
+
link?: {
|
3622
|
+
table: infer LinkedTable;
|
3623
|
+
};
|
3624
|
+
columns?: infer ObjectColumns;
|
3625
|
+
} ? (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 'object' ? ObjectColumns extends readonly unknown[] ? ObjectColumns[number] extends {
|
3626
|
+
name: string;
|
3627
|
+
type: string;
|
3628
|
+
} ? {
|
3629
|
+
[K in ObjectColumns[number]['name']]?: PropertyType<Tables, ObjectColumns[number], K>;
|
3630
|
+
} : never : never : Type extends 'link' ? TableType<Tables, LinkedTable> & XataRecord : never) | null : never : never;
|
3631
|
+
|
3517
3632
|
/**
|
3518
3633
|
* Operator to restrict results to only values that are greater than the given value.
|
3519
3634
|
*/
|
@@ -3597,8 +3712,7 @@ declare type SchemaPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3597
3712
|
};
|
3598
3713
|
declare class SchemaPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3599
3714
|
#private;
|
3600
|
-
|
3601
|
-
constructor(tableNames?: string[] | undefined);
|
3715
|
+
constructor(schemaTables?: Schemas.Table[]);
|
3602
3716
|
build(pluginOptions: XataPluginOptions): SchemaPluginResult<Schemas>;
|
3603
3717
|
}
|
3604
3718
|
|
@@ -3626,7 +3740,7 @@ declare type SearchPluginResult<Schemas extends Record<string, BaseData>> = {
|
|
3626
3740
|
declare class SearchPlugin<Schemas extends Record<string, BaseData>> extends XataPlugin {
|
3627
3741
|
#private;
|
3628
3742
|
private db;
|
3629
|
-
constructor(db: SchemaPluginResult<Schemas
|
3743
|
+
constructor(db: SchemaPluginResult<Schemas>, schemaTables?: Schemas.Table[]);
|
3630
3744
|
build({ getFetchProps }: XataPluginOptions): SearchPluginResult<Schemas>;
|
3631
3745
|
}
|
3632
3746
|
declare type SearchXataRecord = XataRecord<SearchExtraProperties>;
|
@@ -3657,15 +3771,15 @@ declare type BaseClientOptions = {
|
|
3657
3771
|
};
|
3658
3772
|
declare const buildClient: <Plugins extends Record<string, XataPlugin> = {}>(plugins?: Plugins | undefined) => ClientConstructor<Plugins>;
|
3659
3773
|
interface ClientConstructor<Plugins extends Record<string, XataPlugin>> {
|
3660
|
-
new <
|
3661
|
-
db: Awaited<ReturnType<SchemaPlugin<
|
3662
|
-
search: Awaited<ReturnType<SearchPlugin<
|
3774
|
+
new <T extends readonly BaseSchema[]>(options?: Partial<BaseClientOptions>, schemaTables?: T): Omit<{
|
3775
|
+
db: Awaited<ReturnType<SchemaPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
3776
|
+
search: Awaited<ReturnType<SearchPlugin<SchemaInference<NonNullable<typeof schemaTables>>>['build']>>;
|
3663
3777
|
}, keyof Plugins> & {
|
3664
3778
|
[Key in StringKeys<NonNullable<Plugins>>]: Awaited<ReturnType<NonNullable<Plugins>[Key]['build']>>;
|
3665
3779
|
};
|
3666
3780
|
}
|
3667
3781
|
declare const BaseClient_base: ClientConstructor<{}>;
|
3668
|
-
declare class BaseClient extends BaseClient_base<
|
3782
|
+
declare class BaseClient extends BaseClient_base<[]> {
|
3669
3783
|
}
|
3670
3784
|
|
3671
3785
|
declare type BranchResolutionOptions = {
|
@@ -3684,4 +3798,4 @@ declare class XataError extends Error {
|
|
3684
3798
|
constructor(message: string, status: number);
|
3685
3799
|
}
|
3686
3800
|
|
3687
|
-
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|
3801
|
+
export { AcceptWorkspaceMemberInviteError, AcceptWorkspaceMemberInvitePathParams, AcceptWorkspaceMemberInviteVariables, AddGitBranchesEntryError, AddGitBranchesEntryPathParams, AddGitBranchesEntryRequestBody, AddGitBranchesEntryResponse, AddGitBranchesEntryVariables, AddTableColumnError, AddTableColumnPathParams, AddTableColumnVariables, BaseClient, BaseClientOptions, BaseData, BaseSchema, BulkInsertTableRecordsError, BulkInsertTableRecordsPathParams, BulkInsertTableRecordsRequestBody, BulkInsertTableRecordsResponse, BulkInsertTableRecordsVariables, CacheImpl, CancelWorkspaceMemberInviteError, CancelWorkspaceMemberInvitePathParams, CancelWorkspaceMemberInviteVariables, ClientConstructor, CreateBranchError, CreateBranchPathParams, CreateBranchQueryParams, CreateBranchRequestBody, CreateBranchVariables, CreateDatabaseError, CreateDatabasePathParams, CreateDatabaseRequestBody, CreateDatabaseResponse, CreateDatabaseVariables, CreateTableError, CreateTablePathParams, CreateTableVariables, CreateUserAPIKeyError, CreateUserAPIKeyPathParams, CreateUserAPIKeyResponse, CreateUserAPIKeyVariables, CreateWorkspaceError, CreateWorkspaceVariables, CursorNavigationOptions, DeleteBranchError, DeleteBranchPathParams, DeleteBranchVariables, DeleteColumnError, DeleteColumnPathParams, DeleteColumnVariables, DeleteDatabaseError, DeleteDatabasePathParams, DeleteDatabaseVariables, DeleteRecordError, DeleteRecordPathParams, DeleteRecordVariables, DeleteTableError, DeleteTablePathParams, DeleteTableVariables, DeleteUserAPIKeyError, DeleteUserAPIKeyPathParams, DeleteUserAPIKeyVariables, DeleteUserError, DeleteUserVariables, DeleteWorkspaceError, DeleteWorkspacePathParams, DeleteWorkspaceVariables, EditableData, ExecuteBranchMigrationPlanError, ExecuteBranchMigrationPlanPathParams, ExecuteBranchMigrationPlanRequestBody, ExecuteBranchMigrationPlanVariables, FetchImpl, FetcherExtraProps, GetBranchDetailsError, GetBranchDetailsPathParams, GetBranchDetailsVariables, GetBranchListError, GetBranchListPathParams, GetBranchListVariables, GetBranchMetadataError, GetBranchMetadataPathParams, GetBranchMetadataVariables, GetBranchMigrationHistoryError, GetBranchMigrationHistoryPathParams, GetBranchMigrationHistoryRequestBody, GetBranchMigrationHistoryResponse, GetBranchMigrationHistoryVariables, GetBranchMigrationPlanError, GetBranchMigrationPlanPathParams, GetBranchMigrationPlanVariables, GetBranchStatsError, GetBranchStatsPathParams, GetBranchStatsResponse, GetBranchStatsVariables, GetColumnError, GetColumnPathParams, GetColumnVariables, GetDatabaseListError, GetDatabaseListPathParams, GetDatabaseListVariables, GetGitBranchesMappingError, GetGitBranchesMappingPathParams, GetGitBranchesMappingVariables, GetRecordError, GetRecordPathParams, GetRecordRequestBody, GetRecordVariables, GetTableColumnsError, GetTableColumnsPathParams, GetTableColumnsResponse, GetTableColumnsVariables, GetTableSchemaError, GetTableSchemaPathParams, GetTableSchemaResponse, GetTableSchemaVariables, GetUserAPIKeysError, GetUserAPIKeysResponse, GetUserAPIKeysVariables, GetUserError, GetUserVariables, GetWorkspaceError, GetWorkspaceMembersListError, GetWorkspaceMembersListPathParams, GetWorkspaceMembersListVariables, GetWorkspacePathParams, GetWorkspaceVariables, GetWorkspacesListError, GetWorkspacesListResponse, GetWorkspacesListVariables, Identifiable, InsertRecordError, InsertRecordPathParams, InsertRecordResponse, InsertRecordVariables, InsertRecordWithIDError, InsertRecordWithIDPathParams, InsertRecordWithIDQueryParams, InsertRecordWithIDVariables, InviteWorkspaceMemberError, InviteWorkspaceMemberPathParams, InviteWorkspaceMemberRequestBody, InviteWorkspaceMemberVariables, Link, OffsetNavigationOptions, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Paginable, PaginationQueryMeta, Query, QueryTableError, QueryTablePathParams, QueryTableRequestBody, QueryTableVariables, RecordArray, RemoveGitBranchesEntryError, RemoveGitBranchesEntryPathParams, RemoveGitBranchesEntryQueryParams, RemoveGitBranchesEntryVariables, RemoveWorkspaceMemberError, RemoveWorkspaceMemberPathParams, RemoveWorkspaceMemberVariables, Repository, ResendWorkspaceMemberInviteError, ResendWorkspaceMemberInvitePathParams, ResendWorkspaceMemberInviteVariables, ResolveBranchError, ResolveBranchPathParams, ResolveBranchQueryParams, ResolveBranchResponse, ResolveBranchVariables, responses as Responses, RestRepository, SchemaDefinition, SchemaInference, SchemaPlugin, SchemaPluginResult, schemas as Schemas, SearchBranchError, SearchBranchPathParams, SearchBranchRequestBody, SearchBranchVariables, SearchOptions, SearchPlugin, SearchPluginResult, SearchTableError, SearchTablePathParams, SearchTableRequestBody, SearchTableVariables, SelectableColumn, SelectedPick, SetTableSchemaError, SetTableSchemaPathParams, SetTableSchemaRequestBody, SetTableSchemaVariables, SimpleCache, SimpleCacheOptions, UpdateBranchMetadataError, UpdateBranchMetadataPathParams, UpdateBranchMetadataVariables, UpdateColumnError, UpdateColumnPathParams, UpdateColumnRequestBody, UpdateColumnVariables, UpdateRecordWithIDError, UpdateRecordWithIDPathParams, UpdateRecordWithIDQueryParams, UpdateRecordWithIDVariables, UpdateTableError, UpdateTablePathParams, UpdateTableRequestBody, UpdateTableVariables, UpdateUserError, UpdateUserVariables, UpdateWorkspaceError, UpdateWorkspaceMemberRoleError, UpdateWorkspaceMemberRolePathParams, UpdateWorkspaceMemberRoleRequestBody, UpdateWorkspaceMemberRoleVariables, UpdateWorkspacePathParams, UpdateWorkspaceVariables, UpsertRecordWithIDError, UpsertRecordWithIDPathParams, UpsertRecordWithIDQueryParams, UpsertRecordWithIDVariables, ValueAtColumn, XataApiClient, XataApiClientOptions, XataApiPlugin, XataError, XataPlugin, XataPluginOptions, XataRecord, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, buildClient, bulkInsertTableRecords, cancelWorkspaceMemberInvite, contains, createBranch, createDatabase, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, endsWith, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchStats, getColumn, getCurrentBranchDetails, getCurrentBranchName, getDatabaseList, getDatabaseURL, getGitBranchesMapping, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isIdentifiable, isNot, isXataRecord, le, lt, lte, notExists, operationsByTag, pattern, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, setTableSchema, startsWith, updateBranchMetadata, updateColumn, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberRole, upsertRecordWithID };
|