2954 lines
94 KiB
JavaScript
2954 lines
94 KiB
JavaScript
'use strict';
|
|
|
|
var client = require('../client');
|
|
|
|
class TablesDB {
|
|
constructor(client) {
|
|
this.client = client;
|
|
}
|
|
list(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
queries: paramsOrFirst,
|
|
search: rest[0],
|
|
total: rest[1]
|
|
};
|
|
}
|
|
const queries = params.queries;
|
|
const search = params.search;
|
|
const total = params.total;
|
|
const apiPath = "/tablesdb";
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof search !== "undefined") {
|
|
payload["search"] = search;
|
|
}
|
|
if (typeof total !== "undefined") {
|
|
payload["total"] = total;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
create(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
name: rest[0],
|
|
enabled: rest[1]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const name = params.name;
|
|
const enabled = params.enabled;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof name === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
}
|
|
const apiPath = "/tablesdb";
|
|
const payload = {};
|
|
if (typeof databaseId !== "undefined") {
|
|
payload["databaseId"] = databaseId;
|
|
}
|
|
if (typeof name !== "undefined") {
|
|
payload["name"] = name;
|
|
}
|
|
if (typeof enabled !== "undefined") {
|
|
payload["enabled"] = enabled;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
listTransactions(paramsOrFirst) {
|
|
let params;
|
|
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
queries: paramsOrFirst
|
|
};
|
|
}
|
|
const queries = params.queries;
|
|
const apiPath = "/tablesdb/transactions";
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createTransaction(paramsOrFirst) {
|
|
let params;
|
|
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
ttl: paramsOrFirst
|
|
};
|
|
}
|
|
const ttl = params.ttl;
|
|
const apiPath = "/tablesdb/transactions";
|
|
const payload = {};
|
|
if (typeof ttl !== "undefined") {
|
|
payload["ttl"] = ttl;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
getTransaction(paramsOrFirst) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
transactionId: paramsOrFirst
|
|
};
|
|
}
|
|
const transactionId = params.transactionId;
|
|
if (typeof transactionId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "transactionId"');
|
|
}
|
|
const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateTransaction(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
transactionId: paramsOrFirst,
|
|
commit: rest[0],
|
|
rollback: rest[1]
|
|
};
|
|
}
|
|
const transactionId = params.transactionId;
|
|
const commit = params.commit;
|
|
const rollback = params.rollback;
|
|
if (typeof transactionId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "transactionId"');
|
|
}
|
|
const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
|
|
const payload = {};
|
|
if (typeof commit !== "undefined") {
|
|
payload["commit"] = commit;
|
|
}
|
|
if (typeof rollback !== "undefined") {
|
|
payload["rollback"] = rollback;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
deleteTransaction(paramsOrFirst) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
transactionId: paramsOrFirst
|
|
};
|
|
}
|
|
const transactionId = params.transactionId;
|
|
if (typeof transactionId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "transactionId"');
|
|
}
|
|
const apiPath = "/tablesdb/transactions/{transactionId}".replace("{transactionId}", transactionId);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"delete",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createOperations(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
transactionId: paramsOrFirst,
|
|
operations: rest[0]
|
|
};
|
|
}
|
|
const transactionId = params.transactionId;
|
|
const operations = params.operations;
|
|
if (typeof transactionId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "transactionId"');
|
|
}
|
|
const apiPath = "/tablesdb/transactions/{transactionId}/operations".replace("{transactionId}", transactionId);
|
|
const payload = {};
|
|
if (typeof operations !== "undefined") {
|
|
payload["operations"] = operations;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
get(paramsOrFirst) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
update(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
name: rest[0],
|
|
enabled: rest[1]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const name = params.name;
|
|
const enabled = params.enabled;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof name === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
|
|
const payload = {};
|
|
if (typeof name !== "undefined") {
|
|
payload["name"] = name;
|
|
}
|
|
if (typeof enabled !== "undefined") {
|
|
payload["enabled"] = enabled;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"put",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
delete(paramsOrFirst) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}".replace("{databaseId}", databaseId);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"delete",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
listTables(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
queries: rest[0],
|
|
search: rest[1],
|
|
total: rest[2]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const queries = params.queries;
|
|
const search = params.search;
|
|
const total = params.total;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables".replace("{databaseId}", databaseId);
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof search !== "undefined") {
|
|
payload["search"] = search;
|
|
}
|
|
if (typeof total !== "undefined") {
|
|
payload["total"] = total;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createTable(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
name: rest[1],
|
|
permissions: rest[2],
|
|
rowSecurity: rest[3],
|
|
enabled: rest[4],
|
|
columns: rest[5],
|
|
indexes: rest[6]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const name = params.name;
|
|
const permissions = params.permissions;
|
|
const rowSecurity = params.rowSecurity;
|
|
const enabled = params.enabled;
|
|
const columns = params.columns;
|
|
const indexes = params.indexes;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof name === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables".replace("{databaseId}", databaseId);
|
|
const payload = {};
|
|
if (typeof tableId !== "undefined") {
|
|
payload["tableId"] = tableId;
|
|
}
|
|
if (typeof name !== "undefined") {
|
|
payload["name"] = name;
|
|
}
|
|
if (typeof permissions !== "undefined") {
|
|
payload["permissions"] = permissions;
|
|
}
|
|
if (typeof rowSecurity !== "undefined") {
|
|
payload["rowSecurity"] = rowSecurity;
|
|
}
|
|
if (typeof enabled !== "undefined") {
|
|
payload["enabled"] = enabled;
|
|
}
|
|
if (typeof columns !== "undefined") {
|
|
payload["columns"] = columns;
|
|
}
|
|
if (typeof indexes !== "undefined") {
|
|
payload["indexes"] = indexes;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
getTable(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateTable(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
name: rest[1],
|
|
permissions: rest[2],
|
|
rowSecurity: rest[3],
|
|
enabled: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const name = params.name;
|
|
const permissions = params.permissions;
|
|
const rowSecurity = params.rowSecurity;
|
|
const enabled = params.enabled;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof name === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "name"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof name !== "undefined") {
|
|
payload["name"] = name;
|
|
}
|
|
if (typeof permissions !== "undefined") {
|
|
payload["permissions"] = permissions;
|
|
}
|
|
if (typeof rowSecurity !== "undefined") {
|
|
payload["rowSecurity"] = rowSecurity;
|
|
}
|
|
if (typeof enabled !== "undefined") {
|
|
payload["enabled"] = enabled;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"put",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
deleteTable(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"delete",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
listColumns(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
queries: rest[1],
|
|
total: rest[2]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const queries = params.queries;
|
|
const total = params.total;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof total !== "undefined") {
|
|
payload["total"] = total;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createBooleanColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
array: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateBooleanColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createDatetimeColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
array: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateDatetimeColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createEmailColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
array: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateEmailColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createEnumColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
elements: rest[2],
|
|
required: rest[3],
|
|
xdefault: rest[4],
|
|
array: rest[5]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const elements = params.elements;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof elements === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "elements"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof elements !== "undefined") {
|
|
payload["elements"] = elements;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateEnumColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
elements: rest[2],
|
|
required: rest[3],
|
|
xdefault: rest[4],
|
|
newKey: rest[5]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const elements = params.elements;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof elements === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "elements"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof elements !== "undefined") {
|
|
payload["elements"] = elements;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createFloatColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
min: rest[3],
|
|
max: rest[4],
|
|
xdefault: rest[5],
|
|
array: rest[6]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const min = params.min;
|
|
const max = params.max;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof min !== "undefined") {
|
|
payload["min"] = min;
|
|
}
|
|
if (typeof max !== "undefined") {
|
|
payload["max"] = max;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateFloatColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
min: rest[4],
|
|
max: rest[5],
|
|
newKey: rest[6]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const min = params.min;
|
|
const max = params.max;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof min !== "undefined") {
|
|
payload["min"] = min;
|
|
}
|
|
if (typeof max !== "undefined") {
|
|
payload["max"] = max;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createIntegerColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
min: rest[3],
|
|
max: rest[4],
|
|
xdefault: rest[5],
|
|
array: rest[6]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const min = params.min;
|
|
const max = params.max;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof min !== "undefined") {
|
|
payload["min"] = min;
|
|
}
|
|
if (typeof max !== "undefined") {
|
|
payload["max"] = max;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateIntegerColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
min: rest[4],
|
|
max: rest[5],
|
|
newKey: rest[6]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const min = params.min;
|
|
const max = params.max;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof min !== "undefined") {
|
|
payload["min"] = min;
|
|
}
|
|
if (typeof max !== "undefined") {
|
|
payload["max"] = max;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createIpColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
array: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateIpColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createLineColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateLineColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createPointColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updatePointColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createPolygonColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updatePolygonColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createRelationshipColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
relatedTableId: rest[1],
|
|
type: rest[2],
|
|
twoWay: rest[3],
|
|
key: rest[4],
|
|
twoWayKey: rest[5],
|
|
onDelete: rest[6]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const relatedTableId = params.relatedTableId;
|
|
const type = params.type;
|
|
const twoWay = params.twoWay;
|
|
const key = params.key;
|
|
const twoWayKey = params.twoWayKey;
|
|
const onDelete = params.onDelete;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof relatedTableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "relatedTableId"');
|
|
}
|
|
if (typeof type === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "type"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/relationship".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof relatedTableId !== "undefined") {
|
|
payload["relatedTableId"] = relatedTableId;
|
|
}
|
|
if (typeof type !== "undefined") {
|
|
payload["type"] = type;
|
|
}
|
|
if (typeof twoWay !== "undefined") {
|
|
payload["twoWay"] = twoWay;
|
|
}
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof twoWayKey !== "undefined") {
|
|
payload["twoWayKey"] = twoWayKey;
|
|
}
|
|
if (typeof onDelete !== "undefined") {
|
|
payload["onDelete"] = onDelete;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createStringColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
size: rest[2],
|
|
required: rest[3],
|
|
xdefault: rest[4],
|
|
array: rest[5],
|
|
encrypt: rest[6]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const size = params.size;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
const encrypt = params.encrypt;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof size === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "size"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof size !== "undefined") {
|
|
payload["size"] = size;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
if (typeof encrypt !== "undefined") {
|
|
payload["encrypt"] = encrypt;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateStringColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
size: rest[4],
|
|
newKey: rest[5]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const size = params.size;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof size !== "undefined") {
|
|
payload["size"] = size;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createUrlColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
array: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const array = params.array;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof array !== "undefined") {
|
|
payload["array"] = array;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateUrlColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
required: rest[2],
|
|
xdefault: rest[3],
|
|
newKey: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const required = params.required;
|
|
const xdefault = params.xdefault;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof required === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "required"');
|
|
}
|
|
if (typeof xdefault === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "xdefault"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof required !== "undefined") {
|
|
payload["required"] = required;
|
|
}
|
|
if (typeof xdefault !== "undefined") {
|
|
payload["default"] = xdefault;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
getColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
deleteColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"delete",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateRelationshipColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
onDelete: rest[2],
|
|
newKey: rest[3]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const onDelete = params.onDelete;
|
|
const newKey = params.newKey;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
if (typeof onDelete !== "undefined") {
|
|
payload["onDelete"] = onDelete;
|
|
}
|
|
if (typeof newKey !== "undefined") {
|
|
payload["newKey"] = newKey;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
listIndexes(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
queries: rest[1],
|
|
total: rest[2]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const queries = params.queries;
|
|
const total = params.total;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof total !== "undefined") {
|
|
payload["total"] = total;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createIndex(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1],
|
|
type: rest[2],
|
|
columns: rest[3],
|
|
orders: rest[4],
|
|
lengths: rest[5]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
const type = params.type;
|
|
const columns = params.columns;
|
|
const orders = params.orders;
|
|
const lengths = params.lengths;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
if (typeof type === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "type"');
|
|
}
|
|
if (typeof columns === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "columns"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof key !== "undefined") {
|
|
payload["key"] = key;
|
|
}
|
|
if (typeof type !== "undefined") {
|
|
payload["type"] = type;
|
|
}
|
|
if (typeof columns !== "undefined") {
|
|
payload["columns"] = columns;
|
|
}
|
|
if (typeof orders !== "undefined") {
|
|
payload["orders"] = orders;
|
|
}
|
|
if (typeof lengths !== "undefined") {
|
|
payload["lengths"] = lengths;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
getIndex(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
deleteIndex(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
key: rest[1]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const key = params.key;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof key === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "key"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{key}", key);
|
|
const payload = {};
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"delete",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
listRows(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
queries: rest[1],
|
|
transactionId: rest[2],
|
|
total: rest[3]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const queries = params.queries;
|
|
const transactionId = params.transactionId;
|
|
const total = params.total;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
if (typeof total !== "undefined") {
|
|
payload["total"] = total;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createRow(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rowId: rest[1],
|
|
data: rest[2],
|
|
permissions: rest[3],
|
|
transactionId: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rowId = params.rowId;
|
|
const data = params.data;
|
|
const permissions = params.permissions;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rowId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
}
|
|
if (typeof data === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "data"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof rowId !== "undefined") {
|
|
payload["rowId"] = rowId;
|
|
}
|
|
if (typeof data !== "undefined") {
|
|
payload["data"] = data;
|
|
}
|
|
if (typeof permissions !== "undefined") {
|
|
payload["permissions"] = permissions;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
createRows(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rows: rest[1],
|
|
transactionId: rest[2]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rows = params.rows;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rows === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rows"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof rows !== "undefined") {
|
|
payload["rows"] = rows;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"post",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
upsertRows(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rows: rest[1],
|
|
transactionId: rest[2]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rows = params.rows;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rows === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rows"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof rows !== "undefined") {
|
|
payload["rows"] = rows;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"put",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateRows(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
data: rest[1],
|
|
queries: rest[2],
|
|
transactionId: rest[3]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const data = params.data;
|
|
const queries = params.queries;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof data !== "undefined") {
|
|
payload["data"] = data;
|
|
}
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
deleteRows(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
queries: rest[1],
|
|
transactionId: rest[2]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const queries = params.queries;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"delete",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
getRow(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rowId: rest[1],
|
|
queries: rest[2],
|
|
transactionId: rest[3]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rowId = params.rowId;
|
|
const queries = params.queries;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rowId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
const payload = {};
|
|
if (typeof queries !== "undefined") {
|
|
payload["queries"] = queries;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {};
|
|
return this.client.call(
|
|
"get",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
upsertRow(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rowId: rest[1],
|
|
data: rest[2],
|
|
permissions: rest[3],
|
|
transactionId: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rowId = params.rowId;
|
|
const data = params.data;
|
|
const permissions = params.permissions;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rowId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
const payload = {};
|
|
if (typeof data !== "undefined") {
|
|
payload["data"] = data;
|
|
}
|
|
if (typeof permissions !== "undefined") {
|
|
payload["permissions"] = permissions;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"put",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
updateRow(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rowId: rest[1],
|
|
data: rest[2],
|
|
permissions: rest[3],
|
|
transactionId: rest[4]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rowId = params.rowId;
|
|
const data = params.data;
|
|
const permissions = params.permissions;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rowId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
const payload = {};
|
|
if (typeof data !== "undefined") {
|
|
payload["data"] = data;
|
|
}
|
|
if (typeof permissions !== "undefined") {
|
|
payload["permissions"] = permissions;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
deleteRow(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rowId: rest[1],
|
|
transactionId: rest[2]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rowId = params.rowId;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rowId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId);
|
|
const payload = {};
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"delete",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
decrementRowColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rowId: rest[1],
|
|
column: rest[2],
|
|
value: rest[3],
|
|
min: rest[4],
|
|
transactionId: rest[5]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rowId = params.rowId;
|
|
const column = params.column;
|
|
const value = params.value;
|
|
const min = params.min;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rowId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
}
|
|
if (typeof column === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "column"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId).replace("{column}", column);
|
|
const payload = {};
|
|
if (typeof value !== "undefined") {
|
|
payload["value"] = value;
|
|
}
|
|
if (typeof min !== "undefined") {
|
|
payload["min"] = min;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
incrementRowColumn(paramsOrFirst, ...rest) {
|
|
let params;
|
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
params = paramsOrFirst || {};
|
|
} else {
|
|
params = {
|
|
databaseId: paramsOrFirst,
|
|
tableId: rest[0],
|
|
rowId: rest[1],
|
|
column: rest[2],
|
|
value: rest[3],
|
|
max: rest[4],
|
|
transactionId: rest[5]
|
|
};
|
|
}
|
|
const databaseId = params.databaseId;
|
|
const tableId = params.tableId;
|
|
const rowId = params.rowId;
|
|
const column = params.column;
|
|
const value = params.value;
|
|
const max = params.max;
|
|
const transactionId = params.transactionId;
|
|
if (typeof databaseId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
}
|
|
if (typeof tableId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "tableId"');
|
|
}
|
|
if (typeof rowId === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "rowId"');
|
|
}
|
|
if (typeof column === "undefined") {
|
|
throw new client.AppwriteException('Missing required parameter: "column"');
|
|
}
|
|
const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment".replace("{databaseId}", databaseId).replace("{tableId}", tableId).replace("{rowId}", rowId).replace("{column}", column);
|
|
const payload = {};
|
|
if (typeof value !== "undefined") {
|
|
payload["value"] = value;
|
|
}
|
|
if (typeof max !== "undefined") {
|
|
payload["max"] = max;
|
|
}
|
|
if (typeof transactionId !== "undefined") {
|
|
payload["transactionId"] = transactionId;
|
|
}
|
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
const apiHeaders = {
|
|
"content-type": "application/json"
|
|
};
|
|
return this.client.call(
|
|
"patch",
|
|
uri,
|
|
apiHeaders,
|
|
payload
|
|
);
|
|
}
|
|
}
|
|
|
|
exports.TablesDB = TablesDB;
|
|
//# sourceMappingURL=out.js.map
|
|
//# sourceMappingURL=tables-db.js.map
|