@tinycloud/cli 0.7.0-beta.15 → 0.7.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -37854,7 +37854,9 @@ var DatabaseHandle = class {
|
|
|
37854
37854
|
var SQLAction = {
|
|
37855
37855
|
READ: "tinycloud.sql/read",
|
|
37856
37856
|
WRITE: "tinycloud.sql/write",
|
|
37857
|
-
|
|
37857
|
+
SCHEMA: "tinycloud.sql/schema",
|
|
37858
|
+
/** @deprecated Use SQLAction.SCHEMA. */
|
|
37859
|
+
DDL: "tinycloud.sql/schema",
|
|
37858
37860
|
ADMIN: "tinycloud.sql/admin",
|
|
37859
37861
|
SELECT: "tinycloud.sql/select",
|
|
37860
37862
|
INSERT: "tinycloud.sql/insert",
|
|
@@ -37972,7 +37974,7 @@ var SQLService = class extends BaseService {
|
|
|
37972
37974
|
const actions = [
|
|
37973
37975
|
this.actionForSql(sql, SQLAction.WRITE),
|
|
37974
37976
|
...(options?.schema ?? []).map(
|
|
37975
|
-
(statement) => this.actionForSql(statement, SQLAction.
|
|
37977
|
+
(statement) => this.actionForSql(statement, SQLAction.SCHEMA)
|
|
37976
37978
|
)
|
|
37977
37979
|
];
|
|
37978
37980
|
const response = await this.invokeSQL(
|
|
@@ -38152,7 +38154,7 @@ var SQLService = class extends BaseService {
|
|
|
38152
38154
|
actionForSql(sql, fallback) {
|
|
38153
38155
|
const token = firstSqlToken(sql);
|
|
38154
38156
|
if (token === "pragma") return SQLAction.ADMIN;
|
|
38155
|
-
if (token !== void 0 && DDL_TOKENS.has(token)) return SQLAction.
|
|
38157
|
+
if (token !== void 0 && DDL_TOKENS.has(token)) return SQLAction.SCHEMA;
|
|
38156
38158
|
return fallback;
|
|
38157
38159
|
}
|
|
38158
38160
|
actionsForSqlBatch(statements) {
|
|
@@ -41761,7 +41763,7 @@ var DEFAULT_ADMIN_ENTRIES = [
|
|
|
41761
41763
|
service: "tinycloud.sql",
|
|
41762
41764
|
space: DEFAULT_MANIFEST_SPACE,
|
|
41763
41765
|
path: "/",
|
|
41764
|
-
actions: ["read", "write", "
|
|
41766
|
+
actions: ["read", "write", "schema"]
|
|
41765
41767
|
}
|
|
41766
41768
|
];
|
|
41767
41769
|
var DEFAULT_ALL_ENTRIES = [
|
|
@@ -41775,7 +41777,7 @@ var DEFAULT_ALL_ENTRIES = [
|
|
|
41775
41777
|
service: "tinycloud.sql",
|
|
41776
41778
|
space: DEFAULT_MANIFEST_SPACE,
|
|
41777
41779
|
path: "/",
|
|
41778
|
-
actions: ["read", "write", "
|
|
41780
|
+
actions: ["read", "write", "schema"]
|
|
41779
41781
|
},
|
|
41780
41782
|
{
|
|
41781
41783
|
service: "tinycloud.duckdb",
|
|
@@ -43532,7 +43534,7 @@ async function confirmPermissionRequest(permissions) {
|
|
|
43532
43534
|
function isDangerousPermission(permission) {
|
|
43533
43535
|
if (permission.path === "" || permission.path === "/") return true;
|
|
43534
43536
|
return permission.actions.some(
|
|
43535
|
-
(action) => action.includes("*") || action.endsWith("/write") || action.endsWith("/admin") || action.endsWith("/ddl") || action.endsWith("/del")
|
|
43537
|
+
(action) => action.includes("*") || action.endsWith("/write") || action.endsWith("/admin") || action.endsWith("/schema") || action.endsWith("/ddl") || action.endsWith("/del")
|
|
43536
43538
|
);
|
|
43537
43539
|
}
|
|
43538
43540
|
function parseExpiryOption(raw) {
|