@xata.io/client 0.0.0-beta.4e4e7fc → 0.0.0-beta.53c906e

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.
Files changed (48) hide show
  1. package/.eslintrc.cjs +13 -0
  2. package/CHANGELOG.md +71 -0
  3. package/dist/api/client.d.ts +4 -2
  4. package/dist/api/client.js +40 -18
  5. package/dist/api/components.d.ts +58 -37
  6. package/dist/api/components.js +48 -38
  7. package/dist/api/fetcher.d.ts +15 -0
  8. package/dist/api/fetcher.js +23 -22
  9. package/dist/api/parameters.d.ts +1 -0
  10. package/dist/api/providers.js +3 -2
  11. package/dist/api/responses.d.ts +6 -0
  12. package/dist/api/schemas.d.ts +1 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/index.js +1 -0
  15. package/dist/schema/filters.d.ts +93 -17
  16. package/dist/schema/filters.js +0 -22
  17. package/dist/schema/filters.spec.d.ts +1 -0
  18. package/dist/schema/filters.spec.js +175 -0
  19. package/dist/schema/index.d.ts +5 -3
  20. package/dist/schema/index.js +8 -4
  21. package/dist/schema/operators.d.ts +74 -21
  22. package/dist/schema/operators.js +59 -6
  23. package/dist/schema/pagination.d.ts +56 -14
  24. package/dist/schema/pagination.js +37 -2
  25. package/dist/schema/query.d.ts +110 -37
  26. package/dist/schema/query.js +87 -35
  27. package/dist/schema/record.d.ts +60 -4
  28. package/dist/schema/record.js +11 -0
  29. package/dist/schema/repository.d.ts +140 -25
  30. package/dist/schema/repository.js +232 -100
  31. package/dist/schema/selection.d.ts +24 -13
  32. package/dist/schema/selection.spec.d.ts +1 -0
  33. package/dist/schema/selection.spec.js +203 -0
  34. package/dist/schema/sorting.d.ts +17 -0
  35. package/dist/schema/sorting.js +28 -0
  36. package/dist/schema/sorting.spec.d.ts +1 -0
  37. package/dist/schema/sorting.spec.js +9 -0
  38. package/dist/util/config.d.ts +11 -0
  39. package/dist/util/config.js +121 -0
  40. package/dist/util/environment.d.ts +5 -0
  41. package/dist/util/environment.js +68 -0
  42. package/dist/util/fetch.d.ts +2 -0
  43. package/dist/util/fetch.js +13 -0
  44. package/dist/util/lang.d.ts +3 -0
  45. package/dist/util/lang.js +13 -1
  46. package/dist/util/types.d.ts +22 -1
  47. package/package.json +5 -2
  48. package/tsconfig.json +21 -0
package/.eslintrc.cjs ADDED
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ ignorePatterns: ["dist"],
3
+ parserOptions: {
4
+ ecmaVersion: 2020,
5
+ sourceType: 'module',
6
+ project: 'client/tsconfig.json'
7
+ },
8
+ rules: {
9
+ '@typescript-eslint/no-explicit-any': 'off',
10
+ '@typescript-eslint/ban-types': 'off',
11
+ '@typescript-eslint/no-floating-promises': 'error',
12
+ }
13
+ };
package/CHANGELOG.md ADDED
@@ -0,0 +1,71 @@
1
+ # @xata.io/client
2
+
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 01aef78: Fix bundle for browsers
8
+ - 56be1fd: Allow sending updates with link object
9
+ - fc51771: Add includes operator helper methods
10
+
11
+ ## 0.7.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 6ce5512: Add bulk operations for all methods
16
+ - 2a1fa4f: Introduced automatic branch resolution mechanism
17
+
18
+ ### Patch Changes
19
+
20
+ - d033f3a: Improve column selection output type with non-nullable columns
21
+ - b1e92db: Include stack trace with errors
22
+ - deed570: Improve sorting with multiple properties
23
+ - 80b5417: Improve filtering types
24
+
25
+ ## 0.6.0
26
+
27
+ ### Minor Changes
28
+
29
+ - 084f5df: Add type inference for columns
30
+ - bb73c89: Unify create and insert in a single method overload
31
+
32
+ ### Patch Changes
33
+
34
+ - 716c487: Forward nullable types on links
35
+ - bb66bb2: Fix error handling with createMany
36
+ - 084f5df: Fix circular dependencies on selectable column
37
+
38
+ ## 0.5.1
39
+
40
+ ### Patch Changes
41
+
42
+ - 12729ab: Make API client fetch implementation optional
43
+
44
+ ## 0.5.0
45
+
46
+ ### Patch Changes
47
+
48
+ - 14ec7d1: Fix in Selectable type
49
+
50
+ ## 0.4.0
51
+
52
+ ### Patch Changes
53
+
54
+ - b951331: Add support for new float column
55
+ - d470610: Add new getAll() method
56
+ - eaf92a8: Expose pagination constants (size and offset limits)
57
+ - 57fde77: Reduce subrequests for createMany
58
+ - eaf92a8: Implement schema-less client
59
+ - 97a3caa: Make createBranch from optional with empty branch
60
+
61
+ ## 0.3.0
62
+
63
+ ### Minor Changes
64
+
65
+ - 1c0a454: Add API Client and internally use it
66
+
67
+ ### Patch Changes
68
+
69
+ - 122321c: Fix client in CF workers and Deno
70
+ - a2671b5: Allow cancel or resend workspace invites
71
+ - e73d470: Split insert and create
@@ -4,8 +4,8 @@ import { HostProvider } from './providers';
4
4
  import type * as Responses from './responses';
5
5
  import type * as Schemas from './schemas';
6
6
  export interface XataApiClientOptions {
7
- fetch: FetchImpl;
8
- apiKey: string;
7
+ fetch?: FetchImpl;
8
+ apiKey?: string;
9
9
  host?: HostProvider;
10
10
  }
11
11
  export declare class XataApiClient {
@@ -40,6 +40,8 @@ declare class WorkspaceApi {
40
40
  updateWorkspaceMemberRole(workspaceId: Schemas.WorkspaceID, userId: Schemas.UserID, role: Schemas.Role): Promise<void>;
41
41
  removeWorkspaceMember(workspaceId: Schemas.WorkspaceID, userId: Schemas.UserID): Promise<void>;
42
42
  inviteWorkspaceMember(workspaceId: Schemas.WorkspaceID, email: string, role: Schemas.Role): Promise<Schemas.WorkspaceInvite>;
43
+ cancelWorkspaceMemberInvite(workspaceId: Schemas.WorkspaceID, inviteId: Schemas.InviteID): Promise<void>;
44
+ resendWorkspaceMemberInvite(workspaceId: Schemas.WorkspaceID, inviteId: Schemas.InviteID): Promise<void>;
43
45
  acceptWorkspaceMemberInvite(workspaceId: Schemas.WorkspaceID, inviteKey: Schemas.InviteKey): Promise<void>;
44
46
  }
45
47
  declare class DatabaseApi {
@@ -10,49 +10,63 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var _XataApiClient_extraProps;
13
+ var _XataApiClient_extraProps, _XataApiClient_namespaces;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.XataApiClient = void 0;
16
+ const config_1 = require("../util/config");
17
+ const fetch_1 = require("../util/fetch");
16
18
  const components_1 = require("./components");
17
19
  const providers_1 = require("./providers");
18
20
  class XataApiClient {
19
21
  constructor(options) {
20
- var _a;
22
+ var _a, _b;
21
23
  _XataApiClient_extraProps.set(this, void 0);
22
- const fetchImpl = typeof fetch !== 'undefined' ? fetch : options.fetch;
23
- if (!fetchImpl) {
24
- /** @todo add a link after docs exist */
25
- throw new Error(`The \`fetch\` option passed to the Xata client is resolving to a falsy value and may not be correctly imported.`);
26
- }
24
+ _XataApiClient_namespaces.set(this, {});
27
25
  const provider = (_a = options.host) !== null && _a !== void 0 ? _a : 'production';
26
+ const apiKey = (_b = options === null || options === void 0 ? void 0 : options.apiKey) !== null && _b !== void 0 ? _b : (0, config_1.getAPIKey)();
27
+ if (!apiKey) {
28
+ throw new Error('Could not resolve a valid apiKey');
29
+ }
28
30
  __classPrivateFieldSet(this, _XataApiClient_extraProps, {
29
31
  apiUrl: (0, providers_1.getHostUrl)(provider, 'main'),
30
32
  workspacesApiUrl: (0, providers_1.getHostUrl)(provider, 'workspaces'),
31
- fetchImpl,
32
- apiKey: options.apiKey
33
+ fetchImpl: (0, fetch_1.getFetchImplementation)(options.fetch),
34
+ apiKey
33
35
  }, "f");
34
36
  }
35
37
  get user() {
36
- return new UserApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
38
+ if (!__classPrivateFieldGet(this, _XataApiClient_namespaces, "f").user)
39
+ __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").user = new UserApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
40
+ return __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").user;
37
41
  }
38
42
  get workspaces() {
39
- return new WorkspaceApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
43
+ if (!__classPrivateFieldGet(this, _XataApiClient_namespaces, "f").workspaces)
44
+ __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").workspaces = new WorkspaceApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
45
+ return __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").workspaces;
40
46
  }
41
47
  get databases() {
42
- return new DatabaseApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
48
+ if (!__classPrivateFieldGet(this, _XataApiClient_namespaces, "f").databases)
49
+ __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").databases = new DatabaseApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
50
+ return __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").databases;
43
51
  }
44
52
  get branches() {
45
- return new BranchApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
53
+ if (!__classPrivateFieldGet(this, _XataApiClient_namespaces, "f").branches)
54
+ __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").branches = new BranchApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
55
+ return __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").branches;
46
56
  }
47
57
  get tables() {
48
- return new TableApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
58
+ if (!__classPrivateFieldGet(this, _XataApiClient_namespaces, "f").tables)
59
+ __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").tables = new TableApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
60
+ return __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").tables;
49
61
  }
50
62
  get records() {
51
- return new RecordsApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
63
+ if (!__classPrivateFieldGet(this, _XataApiClient_namespaces, "f").records)
64
+ __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").records = new RecordsApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
65
+ return __classPrivateFieldGet(this, _XataApiClient_namespaces, "f").records;
52
66
  }
53
67
  }
54
68
  exports.XataApiClient = XataApiClient;
55
- _XataApiClient_extraProps = new WeakMap();
69
+ _XataApiClient_extraProps = new WeakMap(), _XataApiClient_namespaces = new WeakMap();
56
70
  class UserApi {
57
71
  constructor(extraProps) {
58
72
  this.extraProps = extraProps;
@@ -107,6 +121,12 @@ class WorkspaceApi {
107
121
  inviteWorkspaceMember(workspaceId, email, role) {
108
122
  return components_1.operationsByTag.workspaces.inviteWorkspaceMember(Object.assign({ pathParams: { workspaceId }, body: { email, role } }, this.extraProps));
109
123
  }
124
+ cancelWorkspaceMemberInvite(workspaceId, inviteId) {
125
+ return components_1.operationsByTag.workspaces.cancelWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteId } }, this.extraProps));
126
+ }
127
+ resendWorkspaceMemberInvite(workspaceId, inviteId) {
128
+ return components_1.operationsByTag.workspaces.resendWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteId } }, this.extraProps));
129
+ }
110
130
  acceptWorkspaceMemberInvite(workspaceId, inviteKey) {
111
131
  return components_1.operationsByTag.workspaces.acceptWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteKey } }, this.extraProps));
112
132
  }
@@ -135,7 +155,7 @@ class BranchApi {
135
155
  getBranchDetails(workspace, database, branch) {
136
156
  return components_1.operationsByTag.branch.getBranchDetails(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
137
157
  }
138
- createBranch(workspace, database, branch, from, options = {}) {
158
+ createBranch(workspace, database, branch, from = '', options = {}) {
139
159
  return components_1.operationsByTag.branch.createBranch(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, queryParams: { from }, body: options }, this.extraProps));
140
160
  }
141
161
  deleteBranch(workspace, database, branch) {
@@ -214,7 +234,9 @@ class RecordsApi {
214
234
  deleteRecord(workspace, database, branch, tableName, recordId) {
215
235
  return components_1.operationsByTag.records.deleteRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId } }, this.extraProps));
216
236
  }
217
- getRecord(workspace, database, branch, tableName, recordId, options = {}) {
237
+ getRecord(workspace, database, branch, tableName, recordId,
238
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
239
+ options = {}) {
218
240
  return components_1.operationsByTag.records.getRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId } }, this.extraProps));
219
241
  }
220
242
  bulkInsertTableRecords(workspace, database, branch, tableName, records) {
@@ -161,6 +161,28 @@ export declare type InviteWorkspaceMemberVariables = {
161
161
  * Invite some user to join the workspace with the given role
162
162
  */
163
163
  export declare const inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<Schemas.WorkspaceInvite>;
164
+ export declare type CancelWorkspaceMemberInvitePathParams = {
165
+ workspaceId: Schemas.WorkspaceID;
166
+ inviteId: Schemas.InviteID;
167
+ };
168
+ export declare type CancelWorkspaceMemberInviteVariables = {
169
+ pathParams: CancelWorkspaceMemberInvitePathParams;
170
+ } & FetcherExtraProps;
171
+ /**
172
+ * This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
173
+ */
174
+ export declare const cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
175
+ export declare type ResendWorkspaceMemberInvitePathParams = {
176
+ workspaceId: Schemas.WorkspaceID;
177
+ inviteId: Schemas.InviteID;
178
+ };
179
+ export declare type ResendWorkspaceMemberInviteVariables = {
180
+ pathParams: ResendWorkspaceMemberInvitePathParams;
181
+ } & FetcherExtraProps;
182
+ /**
183
+ * This operation provides a way to resend an Invite notification. Invite notifications can only be sent for Invites not yet accepted.
184
+ */
185
+ export declare const resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
164
186
  export declare type AcceptWorkspaceMemberInvitePathParams = {
165
187
  workspaceId: Schemas.WorkspaceID;
166
188
  inviteKey: Schemas.InviteKey;
@@ -853,7 +875,7 @@ export declare type QueryTableVariables = {
853
875
  * `$none`, etc.
854
876
  *
855
877
  * All operators start with an `$` to differentiate them from column names
856
- * (which are not allowed to start with an underscore).
878
+ * (which are not allowed to start with an dollar sign).
857
879
  *
858
880
  * #### Exact matching and control operators
859
881
  *
@@ -921,27 +943,17 @@ export declare type QueryTableVariables = {
921
943
  * }
922
944
  * ```
923
945
  *
924
- * If you want to OR together multiple values, you can use an array of values:
925
- *
926
- * ```json
927
- * {
928
- * "filter": {
929
- * "settings.plan": ["free", "paid"]
930
- * },
931
- * }
932
- * ```
933
- *
934
- * Same query with `$is` operator:
946
+ * If you want to OR together multiple values, you can use the `$any` operator with an array of values:
935
947
  *
936
948
  * ```json
937
949
  * {
938
950
  * "filter": {
939
- * "settings.plan": { "$is": ["free", "paid"]}
951
+ * "settings.plan": {"$any": ["free", "paid"]}
940
952
  * },
941
953
  * }
942
954
  * ```
943
955
  *
944
- * Specifying multiple columns, ANDs them together:
956
+ * If you specify multiple columns in the same filter, they are logically AND'ed together:
945
957
  *
946
958
  * ```json
947
959
  * {
@@ -952,6 +964,8 @@ export declare type QueryTableVariables = {
952
964
  * }
953
965
  * ```
954
966
  *
967
+ * The above matches if both conditions are met.
968
+ *
955
969
  * To be more explicit about it, you can use `$all` or `$any`:
956
970
  *
957
971
  * ```json
@@ -959,13 +973,13 @@ export declare type QueryTableVariables = {
959
973
  * "filter": {
960
974
  * "$any": {
961
975
  * "settings.dark": true,
962
- * "settings.plan": "free",
976
+ * "settings.plan": "free"
963
977
  * }
964
978
  * },
965
979
  * }
966
980
  * ```
967
981
  *
968
- * `$all` and `$any` can also receive an array of objects, which allows for repeating columns:
982
+ * The `$all` and `$any` operators can also receive an array of objects, which allows for repeating column names:
969
983
  *
970
984
  * ```json
971
985
  * {
@@ -976,8 +990,9 @@ export declare type QueryTableVariables = {
976
990
  * },
977
991
  * {
978
992
  * "name": "r2",
979
- * },
980
- * ],
993
+ * }
994
+ * ]
995
+ * }
981
996
  * }
982
997
  * ```
983
998
  *
@@ -987,7 +1002,7 @@ export declare type QueryTableVariables = {
987
1002
  * {
988
1003
  * "filter": {
989
1004
  * "$exists": "settings",
990
- * },
1005
+ * }
991
1006
  * }
992
1007
  * ```
993
1008
  *
@@ -1002,19 +1017,19 @@ export declare type QueryTableVariables = {
1002
1017
  * },
1003
1018
  * {
1004
1019
  * "$exists": "name",
1005
- * },
1006
- * ],
1020
+ * }
1021
+ * ]
1007
1022
  * }
1008
1023
  * }
1009
1024
  * ```
1010
1025
  *
1011
- * We can also make the negation version, `$notExists` :
1026
+ * Or you can use the inverse operator `$notExists`:
1012
1027
  *
1013
1028
  * ```json
1014
1029
  * {
1015
1030
  * "filter": {
1016
1031
  * "$notExists": "settings",
1017
- * },
1032
+ * }
1018
1033
  * }
1019
1034
  * ```
1020
1035
  *
@@ -1061,7 +1076,7 @@ export declare type QueryTableVariables = {
1061
1076
  * }
1062
1077
  * ```
1063
1078
  *
1064
- * #### Numeric/date ranges
1079
+ * #### Numeric ranges
1065
1080
  *
1066
1081
  * ```json
1067
1082
  * {
@@ -1076,18 +1091,6 @@ export declare type QueryTableVariables = {
1076
1091
  *
1077
1092
  * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
1078
1093
  *
1079
- * Date ranges would support the same operators, with the date as string in RFC 3339:
1080
- *
1081
- * ```json
1082
- * {
1083
- * "filter": {
1084
- * "<column_name>": {
1085
- * "$gt": "2019-10-12T07:20:50.52Z",
1086
- * "$lt": "2021-10-12T07:20:50.52Z"
1087
- * }
1088
- * }
1089
- * }
1090
- * ```
1091
1094
  *
1092
1095
  * #### Negations
1093
1096
  *
@@ -1140,7 +1143,7 @@ export declare type QueryTableVariables = {
1140
1143
  * }
1141
1144
  * ```
1142
1145
  *
1143
- * In addition, we can add specific operators like `$isNot` to simplify expressions:
1146
+ * In addition, you can use operators like `$isNot` or `$notExists` to simplify expressions:
1144
1147
  *
1145
1148
  * ```json
1146
1149
  * {
@@ -1191,6 +1194,22 @@ export declare type QueryTableVariables = {
1191
1194
  * predicate. The `$includes` operator is a synonym for the `$includesAny`
1192
1195
  * operator.
1193
1196
  *
1197
+ * Here is an example of using the `$includesAll` operator:
1198
+ *
1199
+ * ```json
1200
+ * {
1201
+ * "filter": {
1202
+ * "settings.labels": {
1203
+ * "$includesAll": [
1204
+ * {"$contains": "label"},
1205
+ * ]
1206
+ * }
1207
+ * }
1208
+ * }
1209
+ * ```
1210
+ *
1211
+ * The above matches if all label values contain the string "labels".
1212
+ *
1194
1213
  * ### Sorting
1195
1214
  *
1196
1215
  * Sorting by one element:
@@ -1371,6 +1390,8 @@ export declare const operationsByTag: {
1371
1390
  updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>;
1372
1391
  removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>;
1373
1392
  inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<Schemas.WorkspaceInvite>;
1393
+ cancelWorkspaceMemberInvite: (variables: CancelWorkspaceMemberInviteVariables) => Promise<undefined>;
1394
+ resendWorkspaceMemberInvite: (variables: ResendWorkspaceMemberInviteVariables) => Promise<undefined>;
1374
1395
  acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>;
1375
1396
  };
1376
1397
  database: {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.operationsByTag = exports.searchBranch = exports.queryTable = exports.bulkInsertTableRecords = exports.getRecord = exports.deleteRecord = exports.upsertRecordWithID = exports.updateRecordWithID = exports.insertRecordWithID = exports.insertRecord = exports.updateColumn = exports.deleteColumn = exports.getColumn = exports.addTableColumn = exports.getTableColumns = exports.setTableSchema = exports.getTableSchema = exports.updateTable = exports.deleteTable = exports.createTable = exports.getBranchStats = exports.getBranchMigrationPlan = exports.executeBranchMigrationPlan = exports.getBranchMigrationHistory = exports.getBranchMetadata = exports.updateBranchMetadata = exports.deleteBranch = exports.createBranch = exports.getBranchDetails = exports.deleteDatabase = exports.createDatabase = exports.getBranchList = exports.getDatabaseList = exports.acceptWorkspaceMemberInvite = exports.inviteWorkspaceMember = exports.removeWorkspaceMember = exports.updateWorkspaceMemberRole = exports.getWorkspaceMembersList = exports.deleteWorkspace = exports.updateWorkspace = exports.getWorkspace = exports.getWorkspacesList = exports.createWorkspace = exports.deleteUserAPIKey = exports.createUserAPIKey = exports.getUserAPIKeys = exports.deleteUser = exports.updateUser = exports.getUser = void 0;
3
+ exports.searchBranch = exports.queryTable = exports.bulkInsertTableRecords = exports.getRecord = exports.deleteRecord = exports.upsertRecordWithID = exports.updateRecordWithID = exports.insertRecordWithID = exports.insertRecord = exports.updateColumn = exports.deleteColumn = exports.getColumn = exports.addTableColumn = exports.getTableColumns = exports.setTableSchema = exports.getTableSchema = exports.updateTable = exports.deleteTable = exports.createTable = exports.getBranchStats = exports.getBranchMigrationPlan = exports.executeBranchMigrationPlan = exports.getBranchMigrationHistory = exports.getBranchMetadata = exports.updateBranchMetadata = exports.deleteBranch = exports.createBranch = exports.getBranchDetails = exports.deleteDatabase = exports.createDatabase = exports.getBranchList = exports.getDatabaseList = exports.acceptWorkspaceMemberInvite = exports.resendWorkspaceMemberInvite = exports.cancelWorkspaceMemberInvite = exports.inviteWorkspaceMember = exports.removeWorkspaceMember = exports.updateWorkspaceMemberRole = exports.getWorkspaceMembersList = exports.deleteWorkspace = exports.updateWorkspace = exports.getWorkspace = exports.getWorkspacesList = exports.createWorkspace = exports.deleteUserAPIKey = exports.createUserAPIKey = exports.getUserAPIKeys = exports.deleteUser = exports.updateUser = exports.getUser = void 0;
4
+ exports.operationsByTag = void 0;
4
5
  /**
5
6
  * Generated by @openapi-codegen
6
7
  *
@@ -82,6 +83,16 @@ exports.removeWorkspaceMember = removeWorkspaceMember;
82
83
  */
83
84
  const inviteWorkspaceMember = (variables) => (0, fetcher_1.fetch)(Object.assign({ url: '/workspaces/{workspaceId}/invites', method: 'post' }, variables));
84
85
  exports.inviteWorkspaceMember = inviteWorkspaceMember;
86
+ /**
87
+ * This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
88
+ */
89
+ const cancelWorkspaceMemberInvite = (variables) => (0, fetcher_1.fetch)(Object.assign({ url: '/workspaces/{workspaceId}/invites/{inviteId}', method: 'delete' }, variables));
90
+ exports.cancelWorkspaceMemberInvite = cancelWorkspaceMemberInvite;
91
+ /**
92
+ * This operation provides a way to resend an Invite notification. Invite notifications can only be sent for Invites not yet accepted.
93
+ */
94
+ const resendWorkspaceMemberInvite = (variables) => (0, fetcher_1.fetch)(Object.assign({ url: '/workspaces/{workspaceId}/invites/{inviteId}/resend', method: 'post' }, variables));
95
+ exports.resendWorkspaceMemberInvite = resendWorkspaceMemberInvite;
85
96
  /**
86
97
  * Accept the invitation to join a workspace. If the operation succeeds the user will be a member of the workspace
87
98
  */
@@ -447,7 +458,7 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
447
458
  * `$none`, etc.
448
459
  *
449
460
  * All operators start with an `$` to differentiate them from column names
450
- * (which are not allowed to start with an underscore).
461
+ * (which are not allowed to start with an dollar sign).
451
462
  *
452
463
  * #### Exact matching and control operators
453
464
  *
@@ -515,27 +526,17 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
515
526
  * }
516
527
  * ```
517
528
  *
518
- * If you want to OR together multiple values, you can use an array of values:
529
+ * If you want to OR together multiple values, you can use the `$any` operator with an array of values:
519
530
  *
520
531
  * ```json
521
532
  * {
522
533
  * "filter": {
523
- * "settings.plan": ["free", "paid"]
534
+ * "settings.plan": {"$any": ["free", "paid"]}
524
535
  * },
525
536
  * }
526
537
  * ```
527
538
  *
528
- * Same query with `$is` operator:
529
- *
530
- * ```json
531
- * {
532
- * "filter": {
533
- * "settings.plan": { "$is": ["free", "paid"]}
534
- * },
535
- * }
536
- * ```
537
- *
538
- * Specifying multiple columns, ANDs them together:
539
+ * If you specify multiple columns in the same filter, they are logically AND'ed together:
539
540
  *
540
541
  * ```json
541
542
  * {
@@ -546,6 +547,8 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
546
547
  * }
547
548
  * ```
548
549
  *
550
+ * The above matches if both conditions are met.
551
+ *
549
552
  * To be more explicit about it, you can use `$all` or `$any`:
550
553
  *
551
554
  * ```json
@@ -553,13 +556,13 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
553
556
  * "filter": {
554
557
  * "$any": {
555
558
  * "settings.dark": true,
556
- * "settings.plan": "free",
559
+ * "settings.plan": "free"
557
560
  * }
558
561
  * },
559
562
  * }
560
563
  * ```
561
564
  *
562
- * `$all` and `$any` can also receive an array of objects, which allows for repeating columns:
565
+ * The `$all` and `$any` operators can also receive an array of objects, which allows for repeating column names:
563
566
  *
564
567
  * ```json
565
568
  * {
@@ -570,8 +573,9 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
570
573
  * },
571
574
  * {
572
575
  * "name": "r2",
573
- * },
574
- * ],
576
+ * }
577
+ * ]
578
+ * }
575
579
  * }
576
580
  * ```
577
581
  *
@@ -581,7 +585,7 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
581
585
  * {
582
586
  * "filter": {
583
587
  * "$exists": "settings",
584
- * },
588
+ * }
585
589
  * }
586
590
  * ```
587
591
  *
@@ -596,19 +600,19 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
596
600
  * },
597
601
  * {
598
602
  * "$exists": "name",
599
- * },
600
- * ],
603
+ * }
604
+ * ]
601
605
  * }
602
606
  * }
603
607
  * ```
604
608
  *
605
- * We can also make the negation version, `$notExists` :
609
+ * Or you can use the inverse operator `$notExists`:
606
610
  *
607
611
  * ```json
608
612
  * {
609
613
  * "filter": {
610
614
  * "$notExists": "settings",
611
- * },
615
+ * }
612
616
  * }
613
617
  * ```
614
618
  *
@@ -655,7 +659,7 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
655
659
  * }
656
660
  * ```
657
661
  *
658
- * #### Numeric/date ranges
662
+ * #### Numeric ranges
659
663
  *
660
664
  * ```json
661
665
  * {
@@ -670,18 +674,6 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
670
674
  *
671
675
  * The supported operators are `$gt`, `$lt`, `$ge`, `$le`.
672
676
  *
673
- * Date ranges would support the same operators, with the date as string in RFC 3339:
674
- *
675
- * ```json
676
- * {
677
- * "filter": {
678
- * "<column_name>": {
679
- * "$gt": "2019-10-12T07:20:50.52Z",
680
- * "$lt": "2021-10-12T07:20:50.52Z"
681
- * }
682
- * }
683
- * }
684
- * ```
685
677
  *
686
678
  * #### Negations
687
679
  *
@@ -734,7 +726,7 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
734
726
  * }
735
727
  * ```
736
728
  *
737
- * In addition, we can add specific operators like `$isNot` to simplify expressions:
729
+ * In addition, you can use operators like `$isNot` or `$notExists` to simplify expressions:
738
730
  *
739
731
  * ```json
740
732
  * {
@@ -785,6 +777,22 @@ exports.bulkInsertTableRecords = bulkInsertTableRecords;
785
777
  * predicate. The `$includes` operator is a synonym for the `$includesAny`
786
778
  * operator.
787
779
  *
780
+ * Here is an example of using the `$includesAll` operator:
781
+ *
782
+ * ```json
783
+ * {
784
+ * "filter": {
785
+ * "settings.labels": {
786
+ * "$includesAll": [
787
+ * {"$contains": "label"},
788
+ * ]
789
+ * }
790
+ * }
791
+ * }
792
+ * ```
793
+ *
794
+ * The above matches if all label values contain the string "labels".
795
+ *
788
796
  * ### Sorting
789
797
  *
790
798
  * Sorting by one element:
@@ -947,6 +955,8 @@ exports.operationsByTag = {
947
955
  updateWorkspaceMemberRole: exports.updateWorkspaceMemberRole,
948
956
  removeWorkspaceMember: exports.removeWorkspaceMember,
949
957
  inviteWorkspaceMember: exports.inviteWorkspaceMember,
958
+ cancelWorkspaceMemberInvite: exports.cancelWorkspaceMemberInvite,
959
+ resendWorkspaceMemberInvite: exports.resendWorkspaceMemberInvite,
950
960
  acceptWorkspaceMemberInvite: exports.acceptWorkspaceMemberInvite
951
961
  },
952
962
  database: { getDatabaseList: exports.getDatabaseList, createDatabase: exports.createDatabase, deleteDatabase: exports.deleteDatabase },
@@ -23,3 +23,18 @@ export declare type FetcherOptions<TBody, THeaders, TQueryParams, TPathParams> =
23
23
  pathParams?: TPathParams;
24
24
  };
25
25
  export declare function fetch<TData, TBody extends Record<string, unknown> | undefined, THeaders extends Record<string, unknown>, TQueryParams extends Record<string, unknown>, TPathParams extends Record<string, string>>({ url: path, method, body, headers, pathParams, queryParams, fetchImpl, apiKey, apiUrl, workspacesApiUrl }: FetcherOptions<TBody, THeaders, TQueryParams, TPathParams> & FetcherExtraProps): Promise<TData>;
26
+ export declare class FetcherError extends Error {
27
+ status: number;
28
+ errors: Array<{
29
+ status: number;
30
+ message?: string;
31
+ }> | undefined;
32
+ constructor(data: {
33
+ message: string;
34
+ status: number;
35
+ errors?: Array<{
36
+ status: number;
37
+ message?: string;
38
+ }>;
39
+ }, parent?: Error);
40
+ }