@corsair-dev/studio 0.1.1 → 0.1.2
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/server/index.js +6 -10
- package/dist/src/server/handlers/operations.d.ts.map +1 -1
- package/dist/web/assets/{index-BdMocr9R.js → index-Ck3_0vOi.js} +14 -12
- package/dist/web/assets/{index-BdMocr9R.js.map → index-Ck3_0vOi.js.map} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +3 -3
package/dist/server/index.js
CHANGED
|
@@ -697,6 +697,10 @@ var listPermissions = async (ctx) => {
|
|
|
697
697
|
};
|
|
698
698
|
|
|
699
699
|
// src/server/handlers/operations.ts
|
|
700
|
+
import {
|
|
701
|
+
getSchema as getCorsairSchema,
|
|
702
|
+
listOperations as listCorsairOperations
|
|
703
|
+
} from "corsair";
|
|
700
704
|
function navigateToEndpoint(client, path) {
|
|
701
705
|
const parts = path.split(".");
|
|
702
706
|
let current = client;
|
|
@@ -711,25 +715,17 @@ var listOperations = async (ctx) => {
|
|
|
711
715
|
const plugin = body.plugin ? String(body.plugin) : void 0;
|
|
712
716
|
const type = body.type ? String(body.type) : void 0;
|
|
713
717
|
const { instance } = await ctx.getCorsair();
|
|
714
|
-
const corsair = instance;
|
|
715
|
-
if (typeof corsair.list_operations !== "function") {
|
|
716
|
-
throw new Error("list_operations not available on this Corsair instance.");
|
|
717
|
-
}
|
|
718
718
|
const opts = {};
|
|
719
719
|
if (plugin) opts.plugin = plugin;
|
|
720
720
|
if (type === "api" || type === "webhooks" || type === "db") opts.type = type;
|
|
721
|
-
return
|
|
721
|
+
return listCorsairOperations(instance, opts);
|
|
722
722
|
};
|
|
723
723
|
var schemaForOperation = async (ctx) => {
|
|
724
724
|
const body = await readJsonBody(ctx.req);
|
|
725
725
|
const path = String(body.path ?? "");
|
|
726
726
|
if (!path) throw new Error("Missing path.");
|
|
727
727
|
const { instance } = await ctx.getCorsair();
|
|
728
|
-
const
|
|
729
|
-
if (typeof corsair.get_schema !== "function") {
|
|
730
|
-
throw new Error("get_schema not available on this Corsair instance.");
|
|
731
|
-
}
|
|
732
|
-
const schema = corsair.get_schema(path);
|
|
728
|
+
const schema = getCorsairSchema(instance, path);
|
|
733
729
|
return { schema };
|
|
734
730
|
};
|
|
735
731
|
var runOperation = async (ctx) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAsB1C,eAAO,MAAM,cAAc,EAAE,SAa5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAQhC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SA6B1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SA+BvB,CAAC"}
|