{"version":3,"sources":["../../src/functions-v1-function-form-current-value-function-form-current-values.universal.ts","../../src/functions-v1-function-form-current-value-function-form-current-values.http.ts","../../src/functions-v1-function-form-current-value-function-form-current-values.public.ts","../../src/functions-v1-function-form-current-value-function-form-current-values.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient } from '@wix/sdk-types';\nimport * as ambassadorWixFunctionsV1FunctionFormCurrentValue from './functions-v1-function-form-current-value-function-form-current-values.http.js';\n\nexport interface FunctionFormCurrentValue {\n  /**\n   * Id, matching the id of the function\n   * @format GUID\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * The form value of the function\n   * @readonly\n   */\n  formValue?: Record<string, any> | null;\n}\n\nexport interface GetFunctionFormCurrentValueRequest {\n  /**\n   * Function form current value id, matching the function id\n   * @format GUID\n   */\n  functionId: string;\n}\n\nexport interface GetFunctionFormCurrentValueResponse {\n  /** The returned Function form current value */\n  functionFormCurrentValue?: FunctionFormCurrentValue;\n}\n\n/**\n * Retrieves FunctionFormCurrentValue by the provided function id\n * @param functionId - Function form current value id, matching the function id\n * @internal\n * @documentationMaturity preview\n * @requiredField functionId\n * @permissionId FUNCTIONS.FUNCTION_FORM_CURRENT_VALUE_READ\n * @returns The returned Function form current value\n * @fqn wix.functions.formcurrentvalues.v1.FunctionFormCurrentValues.GetFunctionFormCurrentValue\n */\nexport async function getFunctionFormCurrentValue(\n  functionId: string\n): Promise<FunctionFormCurrentValue> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    functionId: functionId,\n  });\n\n  const reqOpts =\n    ambassadorWixFunctionsV1FunctionFormCurrentValue.getFunctionFormCurrentValue(\n      payload\n    );\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)\n      ?.functionFormCurrentValue!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { functionId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['functionId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixFunctionsFormcurrentvaluesV1FunctionFormCurrentValuesUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {};\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_functions_function-form-current-values';\n\n/** Retrieves FunctionFormCurrentValue by the provided function id */\nexport function getFunctionFormCurrentValue(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __getFunctionFormCurrentValue({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.functions.v1.function_form_current_value',\n      method: 'GET' as any,\n      methodFqn:\n        'wix.functions.formcurrentvalues.v1.FunctionFormCurrentValues.GetFunctionFormCurrentValue',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixFunctionsFormcurrentvaluesV1FunctionFormCurrentValuesUrl({\n        protoPath: '/v1/function-form-current-values/{functionId}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __getFunctionFormCurrentValue;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n  FunctionFormCurrentValue,\n  getFunctionFormCurrentValue as universalGetFunctionFormCurrentValue,\n} from './functions-v1-function-form-current-value-function-form-current-values.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/functions' };\n\n/** @internal */\nexport function getFunctionFormCurrentValue(\n  httpClient: HttpClient\n): GetFunctionFormCurrentValueSignature {\n  return (functionId: string) =>\n    universalGetFunctionFormCurrentValue(\n      functionId,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetFunctionFormCurrentValueSignature {\n  /**\n   * Retrieves FunctionFormCurrentValue by the provided function id\n   * @param - Function form current value id, matching the function id\n   * @returns The returned Function form current value\n   */\n  (functionId: string): Promise<FunctionFormCurrentValue>;\n}\n\nexport {\n  FunctionFormCurrentValue,\n  GetFunctionFormCurrentValueRequest,\n  GetFunctionFormCurrentValueResponse,\n} from './functions-v1-function-form-current-value-function-form-current-values.universal.js';\n","import { getFunctionFormCurrentValue as publicGetFunctionFormCurrentValue } from './functions-v1-function-form-current-value-function-form-current-values.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\n/** @internal */\nexport const getFunctionFormCurrentValue: MaybeContext<\n  BuildRESTFunction<typeof publicGetFunctionFormCurrentValue> &\n    typeof publicGetFunctionFormCurrentValue\n> = /*#__PURE__*/ createRESTModule(publicGetFunctionFormCurrentValue);\n\nexport {\n  FunctionFormCurrentValue,\n  GetFunctionFormCurrentValueRequest,\n  GetFunctionFormCurrentValueResponse,\n} from './functions-v1-function-form-current-value-function-form-current-values.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,mEACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,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