@xata.io/client
Advanced tools
Comparing version 0.0.0-alpha.6bbb585 to 0.0.0-alpha.6c18d18
@@ -1251,1 +1251,61 @@ /** | ||
export declare const searchBranch: (variables: SearchBranchVariables) => Promise<Responses.SearchResponse>; | ||
export declare const operationsByTag: { | ||
users: { | ||
getUser: (variables: GetUserVariables) => Promise<Schemas.UserWithID>; | ||
updateUser: (variables: UpdateUserVariables) => Promise<Schemas.UserWithID>; | ||
deleteUser: (variables: DeleteUserVariables) => Promise<undefined>; | ||
getUserAPIKeys: (variables: GetUserAPIKeysVariables) => Promise<GetUserAPIKeysResponse>; | ||
createUserAPIKey: (variables: CreateUserAPIKeyVariables) => Promise<CreateUserAPIKeyResponse>; | ||
deleteUserAPIKey: (variables: DeleteUserAPIKeyVariables) => Promise<undefined>; | ||
}; | ||
workspaces: { | ||
createWorkspace: (variables: CreateWorkspaceVariables) => Promise<Schemas.Workspace>; | ||
getWorkspacesList: (variables: GetWorkspacesListVariables) => Promise<GetWorkspacesListResponse>; | ||
getWorkspace: (variables: GetWorkspaceVariables) => Promise<Schemas.Workspace>; | ||
updateWorkspace: (variables: UpdateWorkspaceVariables) => Promise<Schemas.Workspace>; | ||
deleteWorkspace: (variables: DeleteWorkspaceVariables) => Promise<undefined>; | ||
getWorkspaceMembersList: (variables: GetWorkspaceMembersListVariables) => Promise<Schemas.WorkspaceMembers>; | ||
updateWorkspaceMemberRole: (variables: UpdateWorkspaceMemberRoleVariables) => Promise<undefined>; | ||
removeWorkspaceMember: (variables: RemoveWorkspaceMemberVariables) => Promise<undefined>; | ||
inviteWorkspaceMember: (variables: InviteWorkspaceMemberVariables) => Promise<Schemas.WorkspaceInvite>; | ||
acceptWorkspaceMemberInvite: (variables: AcceptWorkspaceMemberInviteVariables) => Promise<undefined>; | ||
}; | ||
database: { | ||
getDatabaseList: (variables: GetDatabaseListVariables) => Promise<Schemas.ListDatabasesResponse>; | ||
createDatabase: (variables: CreateDatabaseVariables) => Promise<CreateDatabaseResponse>; | ||
deleteDatabase: (variables: DeleteDatabaseVariables) => Promise<undefined>; | ||
}; | ||
branch: { | ||
getBranchList: (variables: GetBranchListVariables) => Promise<Schemas.ListBranchesResponse>; | ||
getBranchDetails: (variables: GetBranchDetailsVariables) => Promise<Schemas.DBBranch>; | ||
createBranch: (variables: CreateBranchVariables) => Promise<undefined>; | ||
deleteBranch: (variables: DeleteBranchVariables) => Promise<undefined>; | ||
updateBranchMetadata: (variables: UpdateBranchMetadataVariables) => Promise<undefined>; | ||
getBranchMetadata: (variables: GetBranchMetadataVariables) => Promise<Schemas.BranchMetadata>; | ||
getBranchMigrationHistory: (variables: GetBranchMigrationHistoryVariables) => Promise<GetBranchMigrationHistoryResponse>; | ||
executeBranchMigrationPlan: (variables: ExecuteBranchMigrationPlanVariables) => Promise<undefined>; | ||
getBranchMigrationPlan: (variables: GetBranchMigrationPlanVariables) => Promise<Responses.BranchMigrationPlan>; | ||
getBranchStats: (variables: GetBranchStatsVariables) => Promise<GetBranchStatsResponse>; | ||
}; | ||
table: { | ||
createTable: (variables: CreateTableVariables) => Promise<undefined>; | ||
deleteTable: (variables: DeleteTableVariables) => Promise<undefined>; | ||
updateTable: (variables: UpdateTableVariables) => Promise<undefined>; | ||
getTableSchema: (variables: GetTableSchemaVariables) => Promise<GetTableSchemaResponse>; | ||
setTableSchema: (variables: SetTableSchemaVariables) => Promise<undefined>; | ||
getTableColumns: (variables: GetTableColumnsVariables) => Promise<GetTableColumnsResponse>; | ||
addTableColumn: (variables: AddTableColumnVariables) => Promise<Responses.MigrationIdResponse>; | ||
getColumn: (variables: GetColumnVariables) => Promise<Schemas.Column>; | ||
deleteColumn: (variables: DeleteColumnVariables) => Promise<Responses.MigrationIdResponse>; | ||
updateColumn: (variables: UpdateColumnVariables) => Promise<Responses.MigrationIdResponse>; | ||
}; | ||
records: { | ||
insertRecord: (variables: InsertRecordVariables) => Promise<InsertRecordResponse>; | ||
insertRecordWithID: (variables: InsertRecordWithIDVariables) => Promise<InsertRecordWithIDResponse>; | ||
deleteRecord: (variables: DeleteRecordVariables) => Promise<undefined>; | ||
getRecord: (variables: GetRecordVariables) => Promise<Schemas.XataRecord>; | ||
bulkInsertTableRecords: (variables: BulkInsertTableRecordsVariables) => Promise<BulkInsertTableRecordsResponse>; | ||
queryTable: (variables: QueryTableVariables) => Promise<Responses.QueryResponse>; | ||
searchBranch: (variables: SearchBranchVariables) => Promise<Responses.SearchResponse>; | ||
}; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.searchBranch = exports.queryTable = exports.bulkInsertTableRecords = exports.getRecord = exports.deleteRecord = 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; | ||
exports.operationsByTag = exports.searchBranch = exports.queryTable = exports.bulkInsertTableRecords = exports.getRecord = exports.deleteRecord = 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; | ||
/** | ||
@@ -855,1 +855,50 @@ * Generated by @openapi-codegen | ||
exports.searchBranch = searchBranch; | ||
exports.operationsByTag = { | ||
users: { getUser: exports.getUser, updateUser: exports.updateUser, deleteUser: exports.deleteUser, getUserAPIKeys: exports.getUserAPIKeys, createUserAPIKey: exports.createUserAPIKey, deleteUserAPIKey: exports.deleteUserAPIKey }, | ||
workspaces: { | ||
createWorkspace: exports.createWorkspace, | ||
getWorkspacesList: exports.getWorkspacesList, | ||
getWorkspace: exports.getWorkspace, | ||
updateWorkspace: exports.updateWorkspace, | ||
deleteWorkspace: exports.deleteWorkspace, | ||
getWorkspaceMembersList: exports.getWorkspaceMembersList, | ||
updateWorkspaceMemberRole: exports.updateWorkspaceMemberRole, | ||
removeWorkspaceMember: exports.removeWorkspaceMember, | ||
inviteWorkspaceMember: exports.inviteWorkspaceMember, | ||
acceptWorkspaceMemberInvite: exports.acceptWorkspaceMemberInvite | ||
}, | ||
database: { getDatabaseList: exports.getDatabaseList, createDatabase: exports.createDatabase, deleteDatabase: exports.deleteDatabase }, | ||
branch: { | ||
getBranchList: exports.getBranchList, | ||
getBranchDetails: exports.getBranchDetails, | ||
createBranch: exports.createBranch, | ||
deleteBranch: exports.deleteBranch, | ||
updateBranchMetadata: exports.updateBranchMetadata, | ||
getBranchMetadata: exports.getBranchMetadata, | ||
getBranchMigrationHistory: exports.getBranchMigrationHistory, | ||
executeBranchMigrationPlan: exports.executeBranchMigrationPlan, | ||
getBranchMigrationPlan: exports.getBranchMigrationPlan, | ||
getBranchStats: exports.getBranchStats | ||
}, | ||
table: { | ||
createTable: exports.createTable, | ||
deleteTable: exports.deleteTable, | ||
updateTable: exports.updateTable, | ||
getTableSchema: exports.getTableSchema, | ||
setTableSchema: exports.setTableSchema, | ||
getTableColumns: exports.getTableColumns, | ||
addTableColumn: exports.addTableColumn, | ||
getColumn: exports.getColumn, | ||
deleteColumn: exports.deleteColumn, | ||
updateColumn: exports.updateColumn | ||
}, | ||
records: { | ||
insertRecord: exports.insertRecord, | ||
insertRecordWithID: exports.insertRecordWithID, | ||
deleteRecord: exports.deleteRecord, | ||
getRecord: exports.getRecord, | ||
bulkInsertTableRecords: exports.bulkInsertTableRecords, | ||
queryTable: exports.queryTable, | ||
searchBranch: exports.searchBranch | ||
} | ||
}; |
@@ -1,2 +0,2 @@ | ||
declare type FetchImpl = (url: string, init?: { | ||
export declare type FetchImpl = (url: string, init?: { | ||
body?: string; | ||
@@ -24,2 +24,1 @@ headers?: Record<string, string>; | ||
export declare function xatabaseFetch<TData, TBody extends Record<string, unknown> | undefined, THeaders extends Record<string, unknown>, TQueryParams extends Record<string, unknown>, TPathParams extends Record<string, string>>({ url, method, body, headers, pathParams, queryParams, workspace, fetchImpl }: XatabaseFetcherOptions<TBody, THeaders, TQueryParams, TPathParams> & XatabaseFetcherExtraProps): Promise<TData>; | ||
export {}; |
@@ -0,1 +1,3 @@ | ||
import { XataApi } from './api'; | ||
import { FetchImpl } from './api/xatabaseFetcher'; | ||
export interface XataRecord { | ||
@@ -166,3 +168,3 @@ id: string; | ||
export declare type XataClientOptions = { | ||
fetch?: unknown; | ||
fetch?: FetchImpl; | ||
databaseURL: string; | ||
@@ -181,2 +183,3 @@ branch: BranchStrategyOption; | ||
getBranch(): Promise<string>; | ||
get api(): XataApi<D>; | ||
} | ||
@@ -183,0 +186,0 @@ export declare class XataError extends Error { |
@@ -32,2 +32,3 @@ "use strict"; | ||
exports.XataError = exports.BaseClient = exports.RestRespositoryFactory = exports.RestRepository = exports.Repository = exports.Query = exports.includesAll = exports.includesPattern = exports.includesSubstring = exports.includes = exports.contains = exports.isNot = exports.is = exports.pattern = exports.endsWith = exports.startsWith = exports.notExists = exports.exists = exports.le = exports.lte = exports.lt = exports.gte = exports.ge = exports.gt = void 0; | ||
const api_1 = require("./api"); | ||
const errors_1 = require("./util/errors"); | ||
@@ -490,2 +491,5 @@ const gt = (value) => ({ $gt: value }); | ||
} | ||
get api() { | ||
return new api_1.XataApi(this); | ||
} | ||
} | ||
@@ -492,0 +496,0 @@ exports.BaseClient = BaseClient; |
export declare const errors: { | ||
noFetchImplementation: string; | ||
falsyFetchImplementation: string; /** @todo add a link after docs exist */ | ||
}; |
@@ -5,2 +5,3 @@ "use strict"; | ||
exports.errors = { | ||
noFetchImplementation: 'No fetch implementation provided', | ||
falsyFetchImplementation: `The \`fetch\` option passed to the Xata client is resolving to a falsy value and may not be correctly imported. | ||
@@ -7,0 +8,0 @@ |
{ | ||
"name": "@xata.io/client", | ||
"version": "0.0.0-alpha.6bbb585", | ||
"version": "0.0.0-alpha.6c18d18", | ||
"description": "Xata.io SDK for TypeScript and JavaScript", | ||
@@ -23,3 +23,3 @@ "main": "./dist/index.js", | ||
"homepage": "https://github.com/xataio/client-ts/blob/main/client/README.md", | ||
"gitHead": "6bbb585f75ba51eba0edf610899ba5d67b8bcb4a" | ||
"gitHead": "6c18d18b727e579fa450ba108543b08339ad99fa" | ||
} |
@@ -1849,1 +1849,51 @@ /** | ||
}); | ||
export const operationsByTag = { | ||
users: { getUser, updateUser, deleteUser, getUserAPIKeys, createUserAPIKey, deleteUserAPIKey }, | ||
workspaces: { | ||
createWorkspace, | ||
getWorkspacesList, | ||
getWorkspace, | ||
updateWorkspace, | ||
deleteWorkspace, | ||
getWorkspaceMembersList, | ||
updateWorkspaceMemberRole, | ||
removeWorkspaceMember, | ||
inviteWorkspaceMember, | ||
acceptWorkspaceMemberInvite | ||
}, | ||
database: { getDatabaseList, createDatabase, deleteDatabase }, | ||
branch: { | ||
getBranchList, | ||
getBranchDetails, | ||
createBranch, | ||
deleteBranch, | ||
updateBranchMetadata, | ||
getBranchMetadata, | ||
getBranchMigrationHistory, | ||
executeBranchMigrationPlan, | ||
getBranchMigrationPlan, | ||
getBranchStats | ||
}, | ||
table: { | ||
createTable, | ||
deleteTable, | ||
updateTable, | ||
getTableSchema, | ||
setTableSchema, | ||
getTableColumns, | ||
addTableColumn, | ||
getColumn, | ||
deleteColumn, | ||
updateColumn | ||
}, | ||
records: { | ||
insertRecord, | ||
insertRecordWithID, | ||
deleteRecord, | ||
getRecord, | ||
bulkInsertTableRecords, | ||
queryTable, | ||
searchBranch | ||
} | ||
}; |
@@ -14,3 +14,3 @@ /* eslint-disable @typescript-eslint/no-throw-literal */ | ||
// Typed only the subset of the spec we actually use (to be able to build a simple mock) | ||
type FetchImpl = ( | ||
export type FetchImpl = ( | ||
url: string, | ||
@@ -17,0 +17,0 @@ init?: { body?: string; headers?: Record<string, string>; method?: string } |
@@ -0,1 +1,3 @@ | ||
import { XataApi } from './api'; | ||
import { FetchImpl } from './api/xatabaseFetcher'; | ||
import { errors } from './util/errors'; | ||
@@ -554,3 +556,3 @@ | ||
export type XataClientOptions = { | ||
fetch?: unknown; | ||
fetch?: FetchImpl; | ||
databaseURL: string; | ||
@@ -642,2 +644,6 @@ branch: BranchStrategyOption; | ||
} | ||
public get api() { | ||
return new XataApi<D>(this); | ||
} | ||
} | ||
@@ -644,0 +650,0 @@ |
export const errors = { | ||
noFetchImplementation: 'No fetch implementation provided', | ||
falsyFetchImplementation: `The \`fetch\` option passed to the Xata client is resolving to a falsy value and may not be correctly imported. | ||
@@ -3,0 +4,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
268767
31
7790
25