@termix-ssh/plugin-sdk 1.0.5 → 1.0.7

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- <img src="https://raw.githubusercontent.com/Termix-SSH/Termix/main/public/icon.svg" width="120" height="120" alt="Termix Logo" />
3
+ <img src="https://termix.site/img/logo.svg" width="120" alt="Termix Logo" />
4
4
 
5
5
  <h1>Termix Plugin SDK</h1>
6
6
 
@@ -50,7 +50,7 @@ in place of the flags. Reload the page to pick up frontend changes.
50
50
 
51
51
  ## Support
52
52
 
53
- Bugs and ideas for the SDK or the `termix-plugin` CLI go in the [Termix repo](https://github.com/Termix-SSH/Termix/issues/new/choose). You need to be logged in to GitHub. Please be as detailed as possible, preferably in English.
53
+ Bugs and ideas for the SDK or the `termix-plugin` CLI go in the [Termix repo](https://github.com/Termix-SSH/Termix/issues/new/choose). Add as much detail as you can, in English if possible.
54
54
 
55
55
  For discussions and questions, join the [Discord](https://discord.gg/jVQGdvHDrf) server.
56
56
 
@@ -58,4 +58,4 @@ For discussions and questions, join the [Discord](https://discord.gg/jVQGdvHDrf)
58
58
 
59
59
  ## License
60
60
 
61
- Distributed under the Apache License Version 2.0. See [LICENSE](https://github.com/Termix-SSH/Termix/blob/main/LICENSE) for more information.
61
+ Apache License 2.0. See [LICENSE](https://github.com/Termix-SSH/Termix/blob/main/LICENSE).
package/dist/ddl.js CHANGED
@@ -264,17 +264,24 @@ export function splitStatements(source) {
264
264
  continue;
265
265
  }
266
266
  if (char === ";") {
267
- if (current.trim())
267
+ if (hasSql(current))
268
268
  statements.push(current.trim());
269
269
  current = "";
270
270
  continue;
271
271
  }
272
272
  current += char;
273
273
  }
274
- if (current.trim())
274
+ if (hasSql(current))
275
275
  statements.push(current.trim());
276
276
  return statements;
277
277
  }
278
+ /** False for a chunk that is only comments, which a driver refuses to run. */
279
+ function hasSql(chunk) {
280
+ return (chunk
281
+ .replace(/--[^\n]*/g, "")
282
+ .replace(/\/\*[\s\S]*?\*\//g, "")
283
+ .trim() !== "");
284
+ }
278
285
  /** DROP statement for a definition, for removePluginData. */
279
286
  export function dropTableSql(dialect, pluginId, definition) {
280
287
  const physical = prefixedTableName(pluginId, definition.name);
@@ -21,7 +21,7 @@ var inFlight = null;
21
21
  function load() {
22
22
  if (cache) return Promise.resolve(cache);
23
23
  if (inFlight) return inFlight;
24
- inFlight = import("./rbac-api-UJGGTQVA.js").then(({ getMyPermissions }) => getMyPermissions()).then((result) => {
24
+ inFlight = import("./rbac-api-5267EMX7.js").then(({ getMyPermissions }) => getMyPermissions()).then((result) => {
25
25
  cache = {
26
26
  permissions: result.permissions ?? [],
27
27
  isAdmin: !!result.isAdmin