@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.
@@ -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 corsair.list_operations(opts);
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 corsair = instance;
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;AAiB1C,eAAO,MAAM,cAAc,EAAE,SAc5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAYhC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SA6B1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SA+BvB,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"}