@xata.io/client 0.0.0-beta.bbcb88d → 0.0.0-beta.c21e40a

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 (49) hide show
  1. package/.eslintrc.cjs +13 -0
  2. package/CHANGELOG.md +49 -0
  3. package/dist/api/client.d.ts +95 -0
  4. package/dist/api/client.js +236 -0
  5. package/dist/api/components.d.ts +1436 -0
  6. package/dist/api/components.js +997 -0
  7. package/dist/api/fetcher.d.ts +25 -0
  8. package/dist/api/fetcher.js +73 -0
  9. package/dist/api/index.d.ts +7 -0
  10. package/dist/api/index.js +21 -0
  11. package/dist/api/parameters.d.ts +16 -0
  12. package/dist/api/parameters.js +2 -0
  13. package/dist/api/providers.d.ts +8 -0
  14. package/dist/api/providers.js +30 -0
  15. package/dist/api/responses.d.ts +50 -0
  16. package/dist/api/responses.js +2 -0
  17. package/dist/api/schemas.d.ts +311 -0
  18. package/dist/api/schemas.js +2 -0
  19. package/dist/index.d.ts +2 -133
  20. package/dist/index.js +16 -360
  21. package/dist/schema/filters.d.ts +22 -0
  22. package/dist/schema/filters.js +25 -0
  23. package/dist/schema/index.d.ts +7 -0
  24. package/dist/schema/index.js +29 -0
  25. package/dist/schema/operators.d.ts +72 -0
  26. package/dist/schema/operators.js +91 -0
  27. package/dist/schema/pagination.d.ts +83 -0
  28. package/dist/schema/pagination.js +93 -0
  29. package/dist/schema/query.d.ts +118 -0
  30. package/dist/schema/query.js +242 -0
  31. package/dist/schema/record.d.ts +66 -0
  32. package/dist/schema/record.js +13 -0
  33. package/dist/schema/repository.d.ts +100 -0
  34. package/dist/schema/repository.js +288 -0
  35. package/dist/schema/selection.d.ts +25 -0
  36. package/dist/schema/selection.js +2 -0
  37. package/dist/{index.test.d.ts → schema/selection.spec.d.ts} +0 -0
  38. package/dist/schema/selection.spec.js +203 -0
  39. package/dist/util/lang.d.ts +5 -0
  40. package/dist/util/lang.js +22 -0
  41. package/dist/util/types.d.ts +13 -0
  42. package/dist/util/types.js +2 -0
  43. package/package.json +3 -3
  44. package/dist/index.test.js +0 -304
  45. package/dist/util/errors.d.ts +0 -3
  46. package/dist/util/errors.js +0 -9
  47. package/src/index.test.ts +0 -392
  48. package/src/index.ts +0 -501
  49. package/src/util/errors.ts +0 -6
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,49 @@
1
+ # @xata.io/client
2
+
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 084f5df: Add type inference for columns
8
+ - bb73c89: Unify create and insert in a single method overload
9
+
10
+ ### Patch Changes
11
+
12
+ - 716c487: Forward nullable types on links
13
+ - bb66bb2: Fix error handling with createMany
14
+ - 084f5df: Fix circular dependencies on selectable column
15
+
16
+ ## 0.5.1
17
+
18
+ ### Patch Changes
19
+
20
+ - 12729ab: Make API client fetch implementation optional
21
+
22
+ ## 0.5.0
23
+
24
+ ### Patch Changes
25
+
26
+ - 14ec7d1: Fix in Selectable type
27
+
28
+ ## 0.4.0
29
+
30
+ ### Patch Changes
31
+
32
+ - b951331: Add support for new float column
33
+ - d470610: Add new getAll() method
34
+ - eaf92a8: Expose pagination constants (size and offset limits)
35
+ - 57fde77: Reduce subrequests for createMany
36
+ - eaf92a8: Implement schema-less client
37
+ - 97a3caa: Make createBranch from optional with empty branch
38
+
39
+ ## 0.3.0
40
+
41
+ ### Minor Changes
42
+
43
+ - 1c0a454: Add API Client and internally use it
44
+
45
+ ### Patch Changes
46
+
47
+ - 122321c: Fix client in CF workers and Deno
48
+ - a2671b5: Allow cancel or resend workspace invites
49
+ - e73d470: Split insert and create
@@ -0,0 +1,95 @@
1
+ import type * as Types from './components';
2
+ import type { FetcherExtraProps, FetchImpl } from './fetcher';
3
+ import { HostProvider } from './providers';
4
+ import type * as Responses from './responses';
5
+ import type * as Schemas from './schemas';
6
+ export interface XataApiClientOptions {
7
+ fetch?: FetchImpl;
8
+ apiKey: string;
9
+ host?: HostProvider;
10
+ }
11
+ export declare class XataApiClient {
12
+ #private;
13
+ constructor(options: XataApiClientOptions);
14
+ get user(): UserApi;
15
+ get workspaces(): WorkspaceApi;
16
+ get databases(): DatabaseApi;
17
+ get branches(): BranchApi;
18
+ get tables(): TableApi;
19
+ get records(): RecordsApi;
20
+ }
21
+ declare class UserApi {
22
+ private extraProps;
23
+ constructor(extraProps: FetcherExtraProps);
24
+ getUser(): Promise<Schemas.UserWithID>;
25
+ updateUser(user: Schemas.User): Promise<Schemas.UserWithID>;
26
+ deleteUser(): Promise<void>;
27
+ getUserAPIKeys(): Promise<Types.GetUserAPIKeysResponse>;
28
+ createUserAPIKey(keyName: Schemas.APIKeyName): Promise<Types.CreateUserAPIKeyResponse>;
29
+ deleteUserAPIKey(keyName: Schemas.APIKeyName): Promise<void>;
30
+ }
31
+ declare class WorkspaceApi {
32
+ private extraProps;
33
+ constructor(extraProps: FetcherExtraProps);
34
+ createWorkspace(workspaceMeta: Schemas.WorkspaceMeta): Promise<Schemas.Workspace>;
35
+ getWorkspacesList(): Promise<Types.GetWorkspacesListResponse>;
36
+ getWorkspace(workspaceId: Schemas.WorkspaceID): Promise<Schemas.Workspace>;
37
+ updateWorkspace(workspaceId: Schemas.WorkspaceID, workspaceMeta: Schemas.WorkspaceMeta): Promise<Schemas.Workspace>;
38
+ deleteWorkspace(workspaceId: Schemas.WorkspaceID): Promise<void>;
39
+ getWorkspaceMembersList(workspaceId: Schemas.WorkspaceID): Promise<Schemas.WorkspaceMembers>;
40
+ updateWorkspaceMemberRole(workspaceId: Schemas.WorkspaceID, userId: Schemas.UserID, role: Schemas.Role): Promise<void>;
41
+ removeWorkspaceMember(workspaceId: Schemas.WorkspaceID, userId: Schemas.UserID): Promise<void>;
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>;
45
+ acceptWorkspaceMemberInvite(workspaceId: Schemas.WorkspaceID, inviteKey: Schemas.InviteKey): Promise<void>;
46
+ }
47
+ declare class DatabaseApi {
48
+ private extraProps;
49
+ constructor(extraProps: FetcherExtraProps);
50
+ getDatabaseList(workspace: Schemas.WorkspaceID): Promise<Schemas.ListDatabasesResponse>;
51
+ createDatabase(workspace: Schemas.WorkspaceID, dbName: Schemas.DBName, options?: Types.CreateDatabaseRequestBody): Promise<Types.CreateDatabaseResponse>;
52
+ deleteDatabase(workspace: Schemas.WorkspaceID, dbName: Schemas.DBName): Promise<void>;
53
+ }
54
+ declare class BranchApi {
55
+ private extraProps;
56
+ constructor(extraProps: FetcherExtraProps);
57
+ getBranchList(workspace: Schemas.WorkspaceID, dbName: Schemas.DBName): Promise<Schemas.ListBranchesResponse>;
58
+ getBranchDetails(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName): Promise<Schemas.DBBranch>;
59
+ createBranch(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, from?: string, options?: Types.CreateBranchRequestBody): Promise<void>;
60
+ deleteBranch(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName): Promise<void>;
61
+ updateBranchMetadata(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, metadata?: Schemas.BranchMetadata): Promise<void>;
62
+ getBranchMetadata(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName): Promise<Schemas.BranchMetadata>;
63
+ getBranchMigrationHistory(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, options?: Types.GetBranchMigrationHistoryRequestBody): Promise<Types.GetBranchMigrationHistoryResponse>;
64
+ executeBranchMigrationPlan(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, migrationPlan: Types.ExecuteBranchMigrationPlanRequestBody): Promise<void>;
65
+ getBranchMigrationPlan(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, schema: Schemas.Schema): Promise<Responses.BranchMigrationPlan>;
66
+ getBranchStats(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName): Promise<Types.GetBranchStatsResponse>;
67
+ }
68
+ declare class TableApi {
69
+ private extraProps;
70
+ constructor(extraProps: FetcherExtraProps);
71
+ createTable(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName): Promise<void>;
72
+ deleteTable(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName): Promise<void>;
73
+ updateTable(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, options: Types.UpdateTableRequestBody): Promise<void>;
74
+ getTableSchema(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName): Promise<Types.GetTableSchemaResponse>;
75
+ setTableSchema(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, options: Types.SetTableSchemaRequestBody): Promise<void>;
76
+ getTableColumns(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName): Promise<Types.GetTableColumnsResponse>;
77
+ addTableColumn(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, column: Schemas.Column): Promise<Responses.MigrationIdResponse>;
78
+ getColumn(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, columnName: Schemas.ColumnName): Promise<Schemas.Column>;
79
+ deleteColumn(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, columnName: Schemas.ColumnName): Promise<Responses.MigrationIdResponse>;
80
+ updateColumn(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, columnName: Schemas.ColumnName, options: Types.UpdateColumnRequestBody): Promise<Responses.MigrationIdResponse>;
81
+ }
82
+ declare class RecordsApi {
83
+ private extraProps;
84
+ constructor(extraProps: FetcherExtraProps);
85
+ insertRecord(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, record: Record<string, any>): Promise<Types.InsertRecordResponse>;
86
+ insertRecordWithID(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, recordId: Schemas.RecordID, record: Record<string, any>, options?: Types.InsertRecordWithIDQueryParams): Promise<Responses.RecordUpdateResponse>;
87
+ updateRecordWithID(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, recordId: Schemas.RecordID, record: Record<string, any>, options?: Types.UpdateRecordWithIDQueryParams): Promise<Responses.RecordUpdateResponse>;
88
+ upsertRecordWithID(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, recordId: Schemas.RecordID, record: Record<string, any>, options?: Types.UpsertRecordWithIDQueryParams): Promise<Responses.RecordUpdateResponse>;
89
+ deleteRecord(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, recordId: Schemas.RecordID): Promise<void>;
90
+ getRecord(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, recordId: Schemas.RecordID, options?: Types.GetRecordRequestBody): Promise<Schemas.XataRecord>;
91
+ bulkInsertTableRecords(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, records: Record<string, any>[]): Promise<Types.BulkInsertTableRecordsResponse>;
92
+ queryTable(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, tableName: Schemas.TableName, query: Types.QueryTableRequestBody): Promise<Responses.QueryResponse>;
93
+ searchBranch(workspace: Schemas.WorkspaceID, database: Schemas.DBName, branch: Schemas.BranchName, query: Types.SearchBranchRequestBody): Promise<Responses.SearchResponse>;
94
+ }
95
+ export {};
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _XataApiClient_extraProps;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.XataApiClient = void 0;
16
+ const components_1 = require("./components");
17
+ const providers_1 = require("./providers");
18
+ class XataApiClient {
19
+ constructor(options) {
20
+ var _a, _b;
21
+ _XataApiClient_extraProps.set(this, void 0);
22
+ const globalFetch = typeof fetch !== 'undefined' ? fetch : undefined;
23
+ const fetchImpl = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalFetch;
24
+ if (!fetchImpl) {
25
+ /** @todo add a link after docs exist */
26
+ throw new Error(`The \`fetch\` option passed to the Xata client is resolving to a falsy value and may not be correctly imported.`);
27
+ }
28
+ const provider = (_b = options.host) !== null && _b !== void 0 ? _b : 'production';
29
+ __classPrivateFieldSet(this, _XataApiClient_extraProps, {
30
+ apiUrl: (0, providers_1.getHostUrl)(provider, 'main'),
31
+ workspacesApiUrl: (0, providers_1.getHostUrl)(provider, 'workspaces'),
32
+ fetchImpl,
33
+ apiKey: options.apiKey
34
+ }, "f");
35
+ }
36
+ get user() {
37
+ return new UserApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
38
+ }
39
+ get workspaces() {
40
+ return new WorkspaceApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
41
+ }
42
+ get databases() {
43
+ return new DatabaseApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
44
+ }
45
+ get branches() {
46
+ return new BranchApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
47
+ }
48
+ get tables() {
49
+ return new TableApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
50
+ }
51
+ get records() {
52
+ return new RecordsApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
53
+ }
54
+ }
55
+ exports.XataApiClient = XataApiClient;
56
+ _XataApiClient_extraProps = new WeakMap();
57
+ class UserApi {
58
+ constructor(extraProps) {
59
+ this.extraProps = extraProps;
60
+ }
61
+ getUser() {
62
+ return components_1.operationsByTag.users.getUser(Object.assign({}, this.extraProps));
63
+ }
64
+ updateUser(user) {
65
+ return components_1.operationsByTag.users.updateUser(Object.assign({ body: user }, this.extraProps));
66
+ }
67
+ deleteUser() {
68
+ return components_1.operationsByTag.users.deleteUser(Object.assign({}, this.extraProps));
69
+ }
70
+ getUserAPIKeys() {
71
+ return components_1.operationsByTag.users.getUserAPIKeys(Object.assign({}, this.extraProps));
72
+ }
73
+ createUserAPIKey(keyName) {
74
+ return components_1.operationsByTag.users.createUserAPIKey(Object.assign({ pathParams: { keyName } }, this.extraProps));
75
+ }
76
+ deleteUserAPIKey(keyName) {
77
+ return components_1.operationsByTag.users.deleteUserAPIKey(Object.assign({ pathParams: { keyName } }, this.extraProps));
78
+ }
79
+ }
80
+ class WorkspaceApi {
81
+ constructor(extraProps) {
82
+ this.extraProps = extraProps;
83
+ }
84
+ createWorkspace(workspaceMeta) {
85
+ return components_1.operationsByTag.workspaces.createWorkspace(Object.assign({ body: workspaceMeta }, this.extraProps));
86
+ }
87
+ getWorkspacesList() {
88
+ return components_1.operationsByTag.workspaces.getWorkspacesList(Object.assign({}, this.extraProps));
89
+ }
90
+ getWorkspace(workspaceId) {
91
+ return components_1.operationsByTag.workspaces.getWorkspace(Object.assign({ pathParams: { workspaceId } }, this.extraProps));
92
+ }
93
+ updateWorkspace(workspaceId, workspaceMeta) {
94
+ return components_1.operationsByTag.workspaces.updateWorkspace(Object.assign({ pathParams: { workspaceId }, body: workspaceMeta }, this.extraProps));
95
+ }
96
+ deleteWorkspace(workspaceId) {
97
+ return components_1.operationsByTag.workspaces.deleteWorkspace(Object.assign({ pathParams: { workspaceId } }, this.extraProps));
98
+ }
99
+ getWorkspaceMembersList(workspaceId) {
100
+ return components_1.operationsByTag.workspaces.getWorkspaceMembersList(Object.assign({ pathParams: { workspaceId } }, this.extraProps));
101
+ }
102
+ updateWorkspaceMemberRole(workspaceId, userId, role) {
103
+ return components_1.operationsByTag.workspaces.updateWorkspaceMemberRole(Object.assign({ pathParams: { workspaceId, userId }, body: { role } }, this.extraProps));
104
+ }
105
+ removeWorkspaceMember(workspaceId, userId) {
106
+ return components_1.operationsByTag.workspaces.removeWorkspaceMember(Object.assign({ pathParams: { workspaceId, userId } }, this.extraProps));
107
+ }
108
+ inviteWorkspaceMember(workspaceId, email, role) {
109
+ return components_1.operationsByTag.workspaces.inviteWorkspaceMember(Object.assign({ pathParams: { workspaceId }, body: { email, role } }, this.extraProps));
110
+ }
111
+ cancelWorkspaceMemberInvite(workspaceId, inviteId) {
112
+ return components_1.operationsByTag.workspaces.cancelWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteId } }, this.extraProps));
113
+ }
114
+ resendWorkspaceMemberInvite(workspaceId, inviteId) {
115
+ return components_1.operationsByTag.workspaces.resendWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteId } }, this.extraProps));
116
+ }
117
+ acceptWorkspaceMemberInvite(workspaceId, inviteKey) {
118
+ return components_1.operationsByTag.workspaces.acceptWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteKey } }, this.extraProps));
119
+ }
120
+ }
121
+ class DatabaseApi {
122
+ constructor(extraProps) {
123
+ this.extraProps = extraProps;
124
+ }
125
+ getDatabaseList(workspace) {
126
+ return components_1.operationsByTag.database.getDatabaseList(Object.assign({ pathParams: { workspace } }, this.extraProps));
127
+ }
128
+ createDatabase(workspace, dbName, options = {}) {
129
+ return components_1.operationsByTag.database.createDatabase(Object.assign({ pathParams: { workspace, dbName }, body: options }, this.extraProps));
130
+ }
131
+ deleteDatabase(workspace, dbName) {
132
+ return components_1.operationsByTag.database.deleteDatabase(Object.assign({ pathParams: { workspace, dbName } }, this.extraProps));
133
+ }
134
+ }
135
+ class BranchApi {
136
+ constructor(extraProps) {
137
+ this.extraProps = extraProps;
138
+ }
139
+ getBranchList(workspace, dbName) {
140
+ return components_1.operationsByTag.branch.getBranchList(Object.assign({ pathParams: { workspace, dbName } }, this.extraProps));
141
+ }
142
+ getBranchDetails(workspace, database, branch) {
143
+ return components_1.operationsByTag.branch.getBranchDetails(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
144
+ }
145
+ createBranch(workspace, database, branch, from = '', options = {}) {
146
+ return components_1.operationsByTag.branch.createBranch(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, queryParams: { from }, body: options }, this.extraProps));
147
+ }
148
+ deleteBranch(workspace, database, branch) {
149
+ return components_1.operationsByTag.branch.deleteBranch(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
150
+ }
151
+ updateBranchMetadata(workspace, database, branch, metadata = {}) {
152
+ return components_1.operationsByTag.branch.updateBranchMetadata(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: metadata }, this.extraProps));
153
+ }
154
+ getBranchMetadata(workspace, database, branch) {
155
+ return components_1.operationsByTag.branch.getBranchMetadata(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
156
+ }
157
+ getBranchMigrationHistory(workspace, database, branch, options = {}) {
158
+ return components_1.operationsByTag.branch.getBranchMigrationHistory(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: options }, this.extraProps));
159
+ }
160
+ executeBranchMigrationPlan(workspace, database, branch, migrationPlan) {
161
+ return components_1.operationsByTag.branch.executeBranchMigrationPlan(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: migrationPlan }, this.extraProps));
162
+ }
163
+ getBranchMigrationPlan(workspace, database, branch, schema) {
164
+ return components_1.operationsByTag.branch.getBranchMigrationPlan(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: schema }, this.extraProps));
165
+ }
166
+ getBranchStats(workspace, database, branch) {
167
+ return components_1.operationsByTag.branch.getBranchStats(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
168
+ }
169
+ }
170
+ class TableApi {
171
+ constructor(extraProps) {
172
+ this.extraProps = extraProps;
173
+ }
174
+ createTable(workspace, database, branch, tableName) {
175
+ return components_1.operationsByTag.table.createTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
176
+ }
177
+ deleteTable(workspace, database, branch, tableName) {
178
+ return components_1.operationsByTag.table.deleteTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
179
+ }
180
+ updateTable(workspace, database, branch, tableName, options) {
181
+ return components_1.operationsByTag.table.updateTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: options }, this.extraProps));
182
+ }
183
+ getTableSchema(workspace, database, branch, tableName) {
184
+ return components_1.operationsByTag.table.getTableSchema(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
185
+ }
186
+ setTableSchema(workspace, database, branch, tableName, options) {
187
+ return components_1.operationsByTag.table.setTableSchema(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: options }, this.extraProps));
188
+ }
189
+ getTableColumns(workspace, database, branch, tableName) {
190
+ return components_1.operationsByTag.table.getTableColumns(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
191
+ }
192
+ addTableColumn(workspace, database, branch, tableName, column) {
193
+ return components_1.operationsByTag.table.addTableColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: column }, this.extraProps));
194
+ }
195
+ getColumn(workspace, database, branch, tableName, columnName) {
196
+ return components_1.operationsByTag.table.getColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName } }, this.extraProps));
197
+ }
198
+ deleteColumn(workspace, database, branch, tableName, columnName) {
199
+ return components_1.operationsByTag.table.deleteColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName } }, this.extraProps));
200
+ }
201
+ updateColumn(workspace, database, branch, tableName, columnName, options) {
202
+ return components_1.operationsByTag.table.updateColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName }, body: options }, this.extraProps));
203
+ }
204
+ }
205
+ class RecordsApi {
206
+ constructor(extraProps) {
207
+ this.extraProps = extraProps;
208
+ }
209
+ insertRecord(workspace, database, branch, tableName, record) {
210
+ return components_1.operationsByTag.records.insertRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: record }, this.extraProps));
211
+ }
212
+ insertRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
213
+ return components_1.operationsByTag.records.insertRecordWithID(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId }, queryParams: options, body: record }, this.extraProps));
214
+ }
215
+ updateRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
216
+ return components_1.operationsByTag.records.updateRecordWithID(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId }, queryParams: options, body: record }, this.extraProps));
217
+ }
218
+ upsertRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
219
+ return components_1.operationsByTag.records.upsertRecordWithID(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId }, queryParams: options, body: record }, this.extraProps));
220
+ }
221
+ deleteRecord(workspace, database, branch, tableName, recordId) {
222
+ return components_1.operationsByTag.records.deleteRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId } }, this.extraProps));
223
+ }
224
+ getRecord(workspace, database, branch, tableName, recordId, options = {}) {
225
+ return components_1.operationsByTag.records.getRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId } }, this.extraProps));
226
+ }
227
+ bulkInsertTableRecords(workspace, database, branch, tableName, records) {
228
+ return components_1.operationsByTag.records.bulkInsertTableRecords(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: { records } }, this.extraProps));
229
+ }
230
+ queryTable(workspace, database, branch, tableName, query) {
231
+ return components_1.operationsByTag.records.queryTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: query }, this.extraProps));
232
+ }
233
+ searchBranch(workspace, database, branch, query) {
234
+ return components_1.operationsByTag.records.searchBranch(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: query }, this.extraProps));
235
+ }
236
+ }