@xata.io/client 0.0.0-beta.fef71a6 → 0.0.0-next.v43b83f3e3d703ba85a9c6790259cc93a43f69e98

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/.turbo/turbo-add-version.log +4 -0
  2. package/.turbo/turbo-build.log +13 -0
  3. package/CHANGELOG.md +828 -0
  4. package/README.md +7 -1
  5. package/dist/index.cjs +3653 -0
  6. package/dist/index.cjs.map +1 -0
  7. package/dist/index.d.ts +9685 -3
  8. package/dist/index.mjs +3466 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/package.json +23 -10
  11. package/dist/api/client.d.ts +0 -95
  12. package/dist/api/client.js +0 -235
  13. package/dist/api/components.d.ts +0 -1440
  14. package/dist/api/components.js +0 -1001
  15. package/dist/api/fetcher.d.ts +0 -25
  16. package/dist/api/fetcher.js +0 -78
  17. package/dist/api/index.d.ts +0 -7
  18. package/dist/api/index.js +0 -21
  19. package/dist/api/parameters.d.ts +0 -16
  20. package/dist/api/parameters.js +0 -2
  21. package/dist/api/providers.d.ts +0 -8
  22. package/dist/api/providers.js +0 -29
  23. package/dist/api/responses.d.ts +0 -44
  24. package/dist/api/responses.js +0 -2
  25. package/dist/api/schemas.d.ts +0 -311
  26. package/dist/api/schemas.js +0 -2
  27. package/dist/index.js +0 -26
  28. package/dist/schema/filters.d.ts +0 -20
  29. package/dist/schema/filters.js +0 -24
  30. package/dist/schema/index.d.ts +0 -5
  31. package/dist/schema/index.js +0 -25
  32. package/dist/schema/operators.d.ts +0 -72
  33. package/dist/schema/operators.js +0 -91
  34. package/dist/schema/pagination.d.ts +0 -79
  35. package/dist/schema/pagination.js +0 -90
  36. package/dist/schema/query.d.ts +0 -128
  37. package/dist/schema/query.js +0 -253
  38. package/dist/schema/record.d.ts +0 -41
  39. package/dist/schema/record.js +0 -2
  40. package/dist/schema/repository.d.ts +0 -109
  41. package/dist/schema/repository.js +0 -272
  42. package/dist/schema/selection.d.ts +0 -14
  43. package/dist/schema/selection.js +0 -2
  44. package/dist/util/lang.d.ts +0 -2
  45. package/dist/util/lang.js +0 -10
  46. package/dist/util/types.d.ts +0 -3
  47. package/dist/util/types.js +0 -2
  48. package/tsconfig.json +0 -21
package/package.json CHANGED
@@ -1,13 +1,22 @@
1
1
  {
2
2
  "name": "@xata.io/client",
3
- "version": "0.0.0-beta.fef71a6",
3
+ "version": "0.0.0-next.v43b83f3e3d703ba85a9c6790259cc93a43f69e98",
4
4
  "description": "Xata.io SDK for TypeScript and JavaScript",
5
- "main": "./dist/index.js",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
6
7
  "types": "./dist/index.d.ts",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "tsc -p tsconfig.build.json",
10
- "prepack": "npm run build"
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.cjs",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "browser": {
16
+ "child_process": false
17
+ },
18
+ "peerDependencies": {
19
+ "typescript": ">=4.5"
11
20
  },
12
21
  "repository": {
13
22
  "type": "git",
@@ -15,10 +24,14 @@
15
24
  },
16
25
  "keywords": [],
17
26
  "author": "",
18
- "license": "MIT",
27
+ "license": "Apache-2.0",
19
28
  "bugs": {
20
29
  "url": "https://github.com/xataio/client-ts/issues"
21
30
  },
22
- "homepage": "https://github.com/xataio/client-ts/blob/main/client/README.md",
23
- "gitHead": "fef71a6d4020e404d82c373e466e9fd4c23d4d90"
24
- }
31
+ "homepage": "https://xata.io/docs/sdk/getting-started",
32
+ "scripts": {
33
+ "build": "rimraf dist && rollup -c",
34
+ "tsc": "tsc --noEmit",
35
+ "add-version": "node ../../scripts/add-version-file.mjs"
36
+ }
37
+ }
@@ -1,95 +0,0 @@
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 {};
@@ -1,235 +0,0 @@
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;
21
- _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
- }
27
- const provider = (_a = options.host) !== null && _a !== void 0 ? _a : 'production';
28
- __classPrivateFieldSet(this, _XataApiClient_extraProps, {
29
- apiUrl: (0, providers_1.getHostUrl)(provider, 'main'),
30
- workspacesApiUrl: (0, providers_1.getHostUrl)(provider, 'workspaces'),
31
- fetchImpl,
32
- apiKey: options.apiKey
33
- }, "f");
34
- }
35
- get user() {
36
- return new UserApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
37
- }
38
- get workspaces() {
39
- return new WorkspaceApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
40
- }
41
- get databases() {
42
- return new DatabaseApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
43
- }
44
- get branches() {
45
- return new BranchApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
46
- }
47
- get tables() {
48
- return new TableApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
49
- }
50
- get records() {
51
- return new RecordsApi(__classPrivateFieldGet(this, _XataApiClient_extraProps, "f"));
52
- }
53
- }
54
- exports.XataApiClient = XataApiClient;
55
- _XataApiClient_extraProps = new WeakMap();
56
- class UserApi {
57
- constructor(extraProps) {
58
- this.extraProps = extraProps;
59
- }
60
- getUser() {
61
- return components_1.operationsByTag.users.getUser(Object.assign({}, this.extraProps));
62
- }
63
- updateUser(user) {
64
- return components_1.operationsByTag.users.updateUser(Object.assign({ body: user }, this.extraProps));
65
- }
66
- deleteUser() {
67
- return components_1.operationsByTag.users.deleteUser(Object.assign({}, this.extraProps));
68
- }
69
- getUserAPIKeys() {
70
- return components_1.operationsByTag.users.getUserAPIKeys(Object.assign({}, this.extraProps));
71
- }
72
- createUserAPIKey(keyName) {
73
- return components_1.operationsByTag.users.createUserAPIKey(Object.assign({ pathParams: { keyName } }, this.extraProps));
74
- }
75
- deleteUserAPIKey(keyName) {
76
- return components_1.operationsByTag.users.deleteUserAPIKey(Object.assign({ pathParams: { keyName } }, this.extraProps));
77
- }
78
- }
79
- class WorkspaceApi {
80
- constructor(extraProps) {
81
- this.extraProps = extraProps;
82
- }
83
- createWorkspace(workspaceMeta) {
84
- return components_1.operationsByTag.workspaces.createWorkspace(Object.assign({ body: workspaceMeta }, this.extraProps));
85
- }
86
- getWorkspacesList() {
87
- return components_1.operationsByTag.workspaces.getWorkspacesList(Object.assign({}, this.extraProps));
88
- }
89
- getWorkspace(workspaceId) {
90
- return components_1.operationsByTag.workspaces.getWorkspace(Object.assign({ pathParams: { workspaceId } }, this.extraProps));
91
- }
92
- updateWorkspace(workspaceId, workspaceMeta) {
93
- return components_1.operationsByTag.workspaces.updateWorkspace(Object.assign({ pathParams: { workspaceId }, body: workspaceMeta }, this.extraProps));
94
- }
95
- deleteWorkspace(workspaceId) {
96
- return components_1.operationsByTag.workspaces.deleteWorkspace(Object.assign({ pathParams: { workspaceId } }, this.extraProps));
97
- }
98
- getWorkspaceMembersList(workspaceId) {
99
- return components_1.operationsByTag.workspaces.getWorkspaceMembersList(Object.assign({ pathParams: { workspaceId } }, this.extraProps));
100
- }
101
- updateWorkspaceMemberRole(workspaceId, userId, role) {
102
- return components_1.operationsByTag.workspaces.updateWorkspaceMemberRole(Object.assign({ pathParams: { workspaceId, userId }, body: { role } }, this.extraProps));
103
- }
104
- removeWorkspaceMember(workspaceId, userId) {
105
- return components_1.operationsByTag.workspaces.removeWorkspaceMember(Object.assign({ pathParams: { workspaceId, userId } }, this.extraProps));
106
- }
107
- inviteWorkspaceMember(workspaceId, email, role) {
108
- return components_1.operationsByTag.workspaces.inviteWorkspaceMember(Object.assign({ pathParams: { workspaceId }, body: { email, role } }, this.extraProps));
109
- }
110
- cancelWorkspaceMemberInvite(workspaceId, inviteId) {
111
- return components_1.operationsByTag.workspaces.cancelWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteId } }, this.extraProps));
112
- }
113
- resendWorkspaceMemberInvite(workspaceId, inviteId) {
114
- return components_1.operationsByTag.workspaces.resendWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteId } }, this.extraProps));
115
- }
116
- acceptWorkspaceMemberInvite(workspaceId, inviteKey) {
117
- return components_1.operationsByTag.workspaces.acceptWorkspaceMemberInvite(Object.assign({ pathParams: { workspaceId, inviteKey } }, this.extraProps));
118
- }
119
- }
120
- class DatabaseApi {
121
- constructor(extraProps) {
122
- this.extraProps = extraProps;
123
- }
124
- getDatabaseList(workspace) {
125
- return components_1.operationsByTag.database.getDatabaseList(Object.assign({ pathParams: { workspace } }, this.extraProps));
126
- }
127
- createDatabase(workspace, dbName, options = {}) {
128
- return components_1.operationsByTag.database.createDatabase(Object.assign({ pathParams: { workspace, dbName }, body: options }, this.extraProps));
129
- }
130
- deleteDatabase(workspace, dbName) {
131
- return components_1.operationsByTag.database.deleteDatabase(Object.assign({ pathParams: { workspace, dbName } }, this.extraProps));
132
- }
133
- }
134
- class BranchApi {
135
- constructor(extraProps) {
136
- this.extraProps = extraProps;
137
- }
138
- getBranchList(workspace, dbName) {
139
- return components_1.operationsByTag.branch.getBranchList(Object.assign({ pathParams: { workspace, dbName } }, this.extraProps));
140
- }
141
- getBranchDetails(workspace, database, branch) {
142
- return components_1.operationsByTag.branch.getBranchDetails(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
143
- }
144
- createBranch(workspace, database, branch, from, options = {}) {
145
- return components_1.operationsByTag.branch.createBranch(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, queryParams: { from }, body: options }, this.extraProps));
146
- }
147
- deleteBranch(workspace, database, branch) {
148
- return components_1.operationsByTag.branch.deleteBranch(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
149
- }
150
- updateBranchMetadata(workspace, database, branch, metadata = {}) {
151
- return components_1.operationsByTag.branch.updateBranchMetadata(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: metadata }, this.extraProps));
152
- }
153
- getBranchMetadata(workspace, database, branch) {
154
- return components_1.operationsByTag.branch.getBranchMetadata(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
155
- }
156
- getBranchMigrationHistory(workspace, database, branch, options = {}) {
157
- return components_1.operationsByTag.branch.getBranchMigrationHistory(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: options }, this.extraProps));
158
- }
159
- executeBranchMigrationPlan(workspace, database, branch, migrationPlan) {
160
- return components_1.operationsByTag.branch.executeBranchMigrationPlan(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: migrationPlan }, this.extraProps));
161
- }
162
- getBranchMigrationPlan(workspace, database, branch, schema) {
163
- return components_1.operationsByTag.branch.getBranchMigrationPlan(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: schema }, this.extraProps));
164
- }
165
- getBranchStats(workspace, database, branch) {
166
- return components_1.operationsByTag.branch.getBranchStats(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` } }, this.extraProps));
167
- }
168
- }
169
- class TableApi {
170
- constructor(extraProps) {
171
- this.extraProps = extraProps;
172
- }
173
- createTable(workspace, database, branch, tableName) {
174
- return components_1.operationsByTag.table.createTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
175
- }
176
- deleteTable(workspace, database, branch, tableName) {
177
- return components_1.operationsByTag.table.deleteTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
178
- }
179
- updateTable(workspace, database, branch, tableName, options) {
180
- return components_1.operationsByTag.table.updateTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: options }, this.extraProps));
181
- }
182
- getTableSchema(workspace, database, branch, tableName) {
183
- return components_1.operationsByTag.table.getTableSchema(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
184
- }
185
- setTableSchema(workspace, database, branch, tableName, options) {
186
- return components_1.operationsByTag.table.setTableSchema(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: options }, this.extraProps));
187
- }
188
- getTableColumns(workspace, database, branch, tableName) {
189
- return components_1.operationsByTag.table.getTableColumns(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName } }, this.extraProps));
190
- }
191
- addTableColumn(workspace, database, branch, tableName, column) {
192
- return components_1.operationsByTag.table.addTableColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: column }, this.extraProps));
193
- }
194
- getColumn(workspace, database, branch, tableName, columnName) {
195
- return components_1.operationsByTag.table.getColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName } }, this.extraProps));
196
- }
197
- deleteColumn(workspace, database, branch, tableName, columnName) {
198
- return components_1.operationsByTag.table.deleteColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName } }, this.extraProps));
199
- }
200
- updateColumn(workspace, database, branch, tableName, columnName, options) {
201
- return components_1.operationsByTag.table.updateColumn(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, columnName }, body: options }, this.extraProps));
202
- }
203
- }
204
- class RecordsApi {
205
- constructor(extraProps) {
206
- this.extraProps = extraProps;
207
- }
208
- insertRecord(workspace, database, branch, tableName, record) {
209
- return components_1.operationsByTag.records.insertRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: record }, this.extraProps));
210
- }
211
- insertRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
212
- return components_1.operationsByTag.records.insertRecordWithID(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId }, queryParams: options, body: record }, this.extraProps));
213
- }
214
- updateRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
215
- return components_1.operationsByTag.records.updateRecordWithID(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId }, queryParams: options, body: record }, this.extraProps));
216
- }
217
- upsertRecordWithID(workspace, database, branch, tableName, recordId, record, options = {}) {
218
- return components_1.operationsByTag.records.upsertRecordWithID(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId }, queryParams: options, body: record }, this.extraProps));
219
- }
220
- deleteRecord(workspace, database, branch, tableName, recordId) {
221
- return components_1.operationsByTag.records.deleteRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId } }, this.extraProps));
222
- }
223
- getRecord(workspace, database, branch, tableName, recordId, options = {}) {
224
- return components_1.operationsByTag.records.getRecord(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName, recordId } }, this.extraProps));
225
- }
226
- bulkInsertTableRecords(workspace, database, branch, tableName, records) {
227
- return components_1.operationsByTag.records.bulkInsertTableRecords(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: { records } }, this.extraProps));
228
- }
229
- queryTable(workspace, database, branch, tableName, query) {
230
- return components_1.operationsByTag.records.queryTable(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}`, tableName }, body: query }, this.extraProps));
231
- }
232
- searchBranch(workspace, database, branch, query) {
233
- return components_1.operationsByTag.records.searchBranch(Object.assign({ pathParams: { workspace, dbBranchName: `${database}:${branch}` }, body: query }, this.extraProps));
234
- }
235
- }