import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  resolveUrl,
  serializer,
  toURLSearchParams
} from "./chunk-YHFCDWGT.js";
import {
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// ../../node_modules/@wix/ambassador-velo-ide-v1-gridapp-filestructure/build/es/http.impl.js
init_esm_shims();
var _listFilesRequest = {};
var _listFilesResponse = {};
var _updateFilesRequest = {};
var _updateFilesResponse = {};
function resolveWixVeloIdeV1IdeServiceUrl(opts) {
  var domainToMappings = {
    "manage._base_domain_": [
      {
        srcPath: "/_api/wix-code-ide-server-ng",
        destPath: ""
      }
    ],
    "editor._base_domain_": [
      {
        srcPath: "/_api/wix-code-ide-server-ng",
        destPath: ""
      }
    ],
    "blocks._base_domain_": [
      {
        srcPath: "/_api/wix-code-ide-server-ng",
        destPath: ""
      }
    ],
    "create.editorx": [
      {
        srcPath: "/_api/wix-code-ide-server-ng",
        destPath: ""
      }
    ],
    "code._base_domain_": [
      {
        srcPath: "/_api/wix-code-ide-server-ng",
        destPath: ""
      }
    ]
  };
  return resolveUrl(Object.assign(opts, { domainToMappings }));
}
function listFiles(payload) {
  var _a = serializer(_listFilesRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_listFilesResponse, {}).fromJSON;
  function __listFiles(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.velo.ide.v1.gridapp_filestructure",
      method: "GET",
      methodFqn: "wix.velo.ide.v1.IdeService.ListFiles",
      url: resolveWixVeloIdeV1IdeServiceUrl({
        protoPath: "/v1/apps/{gridAppId}/files",
        data: serializedData,
        host
      }),
      params: toURLSearchParams(serializedData),
      transformResponse: fromRes
    };
    return metadata;
  }
  __listFiles.fromReq = fromReq;
  __listFiles.__isAmbassador = true;
  return __listFiles;
}
function updateFiles(payload) {
  var _a = serializer(_updateFilesRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
  var fromRes = serializer(_updateFilesResponse, {}).fromJSON;
  function __updateFiles(_a2) {
    var host = _a2.host;
    var serializedData = toReq(payload);
    var metadata = {
      entityFqdn: "wix.velo.ide.v1.gridapp_filestructure",
      method: "PATCH",
      methodFqn: "wix.velo.ide.v1.IdeService.UpdateFiles",
      url: resolveWixVeloIdeV1IdeServiceUrl({
        protoPath: "/v1/apps/{gridAppId}/files",
        data: serializedData,
        host
      }),
      data: serializedData,
      transformResponse: fromRes
    };
    return metadata;
  }
  __updateFiles.fromReq = fromReq;
  __updateFiles.__isAmbassador = true;
  return __updateFiles;
}

export {
  listFiles,
  updateFiles
};
//# sourceMappingURL=chunk-RFWFU5ZV.js.map