@xata.io/client 0.0.0-alpha.vf721f5c → 0.0.0-alpha.vf76843f
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 +80 -0
- package/README.md +7 -7
- package/Usage.md +5 -5
- package/dist/index.cjs +1390 -641
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3579 -1787
- package/dist/index.mjs +1376 -620
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- /package/{rollup.config.js → rollup.config.mjs} +0 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,85 @@
|
|
1
1
|
# @xata.io/client
|
2
2
|
|
3
|
+
## 0.20.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#756](https://github.com/xataio/client-ts/pull/756) [`27b73745`](https://github.com/xataio/client-ts/commit/27b737451227cf12774115ccb70649f6bbf76180) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix update method with id in payload
|
8
|
+
|
9
|
+
- [#726](https://github.com/xataio/client-ts/pull/726) [`47a1f878`](https://github.com/xataio/client-ts/commit/47a1f87850a7178dad656a16d2584eee6ce68f29) Thanks [@SferaDev](https://github.com/SferaDev)! - Use transactions API internally for bulk operations
|
10
|
+
|
11
|
+
- [#726](https://github.com/xataio/client-ts/pull/726) [`adde9b10`](https://github.com/xataio/client-ts/commit/adde9b10708182295dee07c203c7bf737806e49e) Thanks [@SferaDev](https://github.com/SferaDev)! - Allow sending bulk operations of more than the limit
|
12
|
+
|
13
|
+
## 0.20.1
|
14
|
+
|
15
|
+
### Patch Changes
|
16
|
+
|
17
|
+
- [#744](https://github.com/xataio/client-ts/pull/744) [`98298ca`](https://github.com/xataio/client-ts/commit/98298ca1312a2256ee3e9d2700a9f3d3e316abe5) Thanks [@xata-bot](https://github.com/xata-bot)! - Add deno entry point
|
18
|
+
|
19
|
+
## 0.20.0
|
20
|
+
|
21
|
+
### Minor Changes
|
22
|
+
|
23
|
+
- [#737](https://github.com/xataio/client-ts/pull/737) [`6cbeaa0`](https://github.com/xataio/client-ts/commit/6cbeaa00050b5aa99ab7c98052a906487263e026) Thanks [@SferaDev](https://github.com/SferaDev)! - Rename first to start and last to end in pagination
|
24
|
+
|
25
|
+
### Patch Changes
|
26
|
+
|
27
|
+
- [#732](https://github.com/xataio/client-ts/pull/732) [`a5a9aa5`](https://github.com/xataio/client-ts/commit/a5a9aa59987faa1d3d701d7431b8a96031e01ac7) Thanks [@SferaDev](https://github.com/SferaDev)! - [Experimental] Allow passing fetch options in some queries
|
28
|
+
|
29
|
+
- [#735](https://github.com/xataio/client-ts/pull/735) [`c64b2eb`](https://github.com/xataio/client-ts/commit/c64b2eb9add70e75d419d418ab9608caac0dbfa1) Thanks [@SferaDev](https://github.com/SferaDev)! - Add support for default values
|
30
|
+
|
31
|
+
- [#730](https://github.com/xataio/client-ts/pull/730) [`485b217`](https://github.com/xataio/client-ts/commit/485b217079c4b2091d697e68622c48eddd130ceb) Thanks [@SferaDev](https://github.com/SferaDev)! - Add more summarize functions
|
32
|
+
|
33
|
+
- [#730](https://github.com/xataio/client-ts/pull/730) [`4d7499c`](https://github.com/xataio/client-ts/commit/4d7499ccbb135691350334fd8022f7a5da41c5f2) Thanks [@SferaDev](https://github.com/SferaDev)! - Add a check for browser execution
|
34
|
+
|
35
|
+
## 0.19.1
|
36
|
+
|
37
|
+
### Patch Changes
|
38
|
+
|
39
|
+
- [#723](https://github.com/xataio/client-ts/pull/723) [`ad5feeb`](https://github.com/xataio/client-ts/commit/ad5feebad5983f724ea4067b884bfae428447470) Thanks [@SferaDev](https://github.com/SferaDev)! - Fix replace operation not hidden
|
40
|
+
|
41
|
+
## 0.19.0
|
42
|
+
|
43
|
+
### Minor Changes
|
44
|
+
|
45
|
+
- [#692](https://github.com/xataio/client-ts/pull/692) [`c14f431`](https://github.com/xataio/client-ts/commit/c14f431db020036ab2b059bcc52a5d56b321c8e7) Thanks [@SferaDev](https://github.com/SferaDev)! - Add multi region endpoint support
|
46
|
+
|
47
|
+
- [#692](https://github.com/xataio/client-ts/pull/692) [`c8def01`](https://github.com/xataio/client-ts/commit/c8def013e9e2d5b634cdb2850f757a0b3e9e0a6d) Thanks [@SferaDev](https://github.com/SferaDev)! - Update OpenAPI spec methods
|
48
|
+
|
49
|
+
### Patch Changes
|
50
|
+
|
51
|
+
- [#667](https://github.com/xataio/client-ts/pull/667) [`f80f051`](https://github.com/xataio/client-ts/commit/f80f05118dd0588861b8229114a469f016ef77ac) Thanks [@SferaDev](https://github.com/SferaDev)! - Allow sending page size to summarize endpoint
|
52
|
+
|
53
|
+
- [#676](https://github.com/xataio/client-ts/pull/676) [`2e341e5`](https://github.com/xataio/client-ts/commit/2e341e5c6140f9c4ddd74e479049992c26c43ea2) Thanks [@SferaDev](https://github.com/SferaDev)! - Support TS 4.7+
|
54
|
+
|
55
|
+
- [#709](https://github.com/xataio/client-ts/pull/709) [`f2f749f`](https://github.com/xataio/client-ts/commit/f2f749f4c64246a303da8d4a617773fc55c1d021) Thanks [@SferaDev](https://github.com/SferaDev)! - Add ifVersion flag to insert/update/upsert operations
|
56
|
+
|
57
|
+
- [#709](https://github.com/xataio/client-ts/pull/709) [`f2f749f`](https://github.com/xataio/client-ts/commit/f2f749f4c64246a303da8d4a617773fc55c1d021) Thanks [@SferaDev](https://github.com/SferaDev)! - Add createOrReplace operation to repository
|
58
|
+
|
59
|
+
## 0.18.6
|
60
|
+
|
61
|
+
### Patch Changes
|
62
|
+
|
63
|
+
- [#662](https://github.com/xataio/client-ts/pull/662) [`4a41680`](https://github.com/xataio/client-ts/commit/4a416803761a1c944ef9a76b794020ead6c8f477) Thanks [@SferaDev](https://github.com/SferaDev)! - Remove wildcard columns from sorting and filtering
|
64
|
+
|
65
|
+
- [#303](https://github.com/xataio/client-ts/pull/303) [`ad0cccb`](https://github.com/xataio/client-ts/commit/ad0cccb11cd4f9bb4bd7e44672d3375821e700fe) Thanks [@gimenete](https://github.com/gimenete)! - Add profiles for host parsing
|
66
|
+
|
67
|
+
- [#662](https://github.com/xataio/client-ts/pull/662) [`e1d6add`](https://github.com/xataio/client-ts/commit/e1d6addf84c55648bc0d908887b6bd020b429801) Thanks [@SferaDev](https://github.com/SferaDev)! - Add aggregations support to the SDK
|
68
|
+
|
69
|
+
- [#662](https://github.com/xataio/client-ts/pull/662) [`4a41680`](https://github.com/xataio/client-ts/commit/4a416803761a1c944ef9a76b794020ead6c8f477) Thanks [@SferaDev](https://github.com/SferaDev)! - Add summarize endpoints to SDK
|
70
|
+
|
71
|
+
## 0.18.5
|
72
|
+
|
73
|
+
### Patch Changes
|
74
|
+
|
75
|
+
- [#656](https://github.com/xataio/client-ts/pull/656) [`2dc2f5a`](https://github.com/xataio/client-ts/commit/2dc2f5a45529b2ace9127d963fb30214298da2e0) Thanks [@SferaDev](https://github.com/SferaDev)! - Broaden type for AbortSignal
|
76
|
+
|
77
|
+
## 0.18.4
|
78
|
+
|
79
|
+
### Patch Changes
|
80
|
+
|
81
|
+
- [#650](https://github.com/xataio/client-ts/pull/650) [`b8d441f`](https://github.com/xataio/client-ts/commit/b8d441f80867322f41989d52c94bba230632782b) Thanks [@xata-bot](https://github.com/xata-bot)! - API: Rename listMigrationRequests to queryMigrationRequests
|
82
|
+
|
3
83
|
## 0.18.3
|
4
84
|
|
5
85
|
### Patch Changes
|
package/README.md
CHANGED
@@ -112,18 +112,18 @@ const user = await xata.db.users.create({
|
|
112
112
|
});
|
113
113
|
```
|
114
114
|
|
115
|
-
If you want to create a record with a specific ID, you can
|
115
|
+
If you want to create a record with a specific ID, you can provide the id as parameter to the `create()` method.
|
116
116
|
|
117
117
|
```ts
|
118
|
-
const user = await xata.db.users.
|
118
|
+
const user = await xata.db.users.create('user_admin', {
|
119
119
|
fullName: 'John Smith'
|
120
120
|
});
|
121
121
|
```
|
122
122
|
|
123
|
-
And if you want to create or
|
123
|
+
And if you want to create or update a record with a specific ID, you can invoke `createOrUpdate()` with an id parameter.
|
124
124
|
|
125
125
|
```ts
|
126
|
-
const user = await xata.db.users.
|
126
|
+
const user = await xata.db.users.createOrUpdate('user_admin', {
|
127
127
|
fullName: 'John Smith'
|
128
128
|
});
|
129
129
|
```
|
@@ -187,8 +187,8 @@ page.hasNextPage(); // Boolean
|
|
187
187
|
|
188
188
|
const nextPage = await page.nextPage(); // Page object
|
189
189
|
const previousPage = await page.previousPage(); // Page object
|
190
|
-
const
|
191
|
-
const
|
190
|
+
const startPage = await page.startPage(); // Page object
|
191
|
+
const endPage = await page.endPage(); // Page object
|
192
192
|
```
|
193
193
|
|
194
194
|
If you want to use an iterator, both the Repository and the Query classes implement an `AsyncIterable`. Alternatively you can use `getIterator()` and customize the batch size of the iterator:
|
@@ -247,7 +247,7 @@ Once you have initialized the API client, the operations are organized following
|
|
247
247
|
|
248
248
|
```ts
|
249
249
|
const { id: workspace } = await api.workspaces.createWorkspace({ name: 'example' });
|
250
|
-
const { databaseName } = await api.
|
250
|
+
const { databaseName } = await api.database.createDatabase(workspace, 'database', { region: 'eu-west-1' });
|
251
251
|
|
252
252
|
await api.branches.createBranch(workspace, databaseName, 'branch');
|
253
253
|
await api.tables.createTable(workspace, databaseName, 'branch', 'table');
|
package/Usage.md
CHANGED
@@ -329,8 +329,8 @@ It contains:
|
|
329
329
|
- `hasNextPage`: Function that returns a boolean indicating if there is a next page.
|
330
330
|
- `nextPage`: Async function that can be used to get the next page.
|
331
331
|
- `previousPage`: Async function that can be used to get the previous page.
|
332
|
-
- `
|
333
|
-
- `
|
332
|
+
- `startPage`: Async function that can be used to get the start page.
|
333
|
+
- `endPage`: Async function that can be used to get the end page.
|
334
334
|
- `meta`: Information about the current page and its cursor.
|
335
335
|
|
336
336
|
```ts
|
@@ -344,14 +344,14 @@ page2.records; // Array of `XataRecord` objects.
|
|
344
344
|
const page1 = await page2.previousPage();
|
345
345
|
page1.records; // Array of `XataRecord` objects.
|
346
346
|
|
347
|
-
const
|
348
|
-
|
347
|
+
const startPage = await page1.startPage();
|
348
|
+
startPage.records; // Array of `XataRecord` objects.
|
349
349
|
```
|
350
350
|
|
351
351
|
The `Repository` class implements the `Query` interface, so you can use it to paginate the records in the table too.
|
352
352
|
|
353
353
|
```ts
|
354
|
-
const page = await xata.db.users.
|
354
|
+
const page = await xata.db.users.startPage();
|
355
355
|
page.records; // Array of `XataRecord` objects.
|
356
356
|
```
|
357
357
|
|