{"version":3,"sources":["../../src/analytics-model-v3-model-analytics-model.universal.ts","../../src/analytics-model-v3-model-analytics-model.http.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, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAnalyticsModelV3Model from './analytics-model-v3-model-analytics-model.http.js';\n\n/** A semantic model that defines the measures, dimensions, and parameters available for querying site performance data, such as traffic, revenue, and engagement metrics. */\nexport interface SemanticModel {\n  /**\n   * Semantic model ID or slug. Mirrors the `id` in the model definition and is the canonical identifier used in `model_id` parameters for `Get Model` and `Query Model Data`.\n   * @readonly\n   * @maxLength 5120\n   */\n  _id?: string;\n  /** Semantic model definition, including its available measures, dimensions, and parameters. */\n  definition?: Model;\n}\n\n/** A semantic data model that defines the available measures, dimensions, and parameters for querying site analytics data. */\nexport interface Model {\n  /**\n   * Model ID.\n   * @readonly\n   * @maxLength 5120\n   */\n  _id?: string;\n  /**\n   * URL-friendly identifier for the model.\n   * @maxLength 5120\n   */\n  slug?: string;\n  /** Model version number. */\n  version?: number;\n  /**\n   * Quantitative fields available for aggregation, such as revenue, page views, or order count.\n   * @maxSize 1000\n   */\n  measures?: ModelField[];\n  /**\n   * Categorical fields available for grouping data, such as traffic source, country, or product name.\n   * @maxSize 1000\n   */\n  dimensions?: ModelField[];\n  /**\n   * Optional inputs that customize query behavior, such as currency or date granularity.\n   * @maxSize 1000\n   */\n  parameters?: ModelField[];\n  /**\n   * Human-readable description of the model.\n   * @maxLength 5120\n   */\n  description?: string | null;\n  /**\n   * Keywords associated with the model for search and discovery.\n   * @maxSize 100\n   * @maxLength 5120\n   */\n  keywords?: string[] | null;\n}\n\n/** Modifier applied to a filter condition. Combine with `ModelFilterConditionEnum` to create expressions such as \"is equal\" or \"is not equal\". */\nexport enum ModelFilterPrefixEnum {\n  /** Positive match. For example, `IS` + `EQUAL` means \"is equal to\". */\n  IS = 'IS',\n  /** Negated match. For example, `NOT` + `EQUAL` means \"is not equal to\". */\n  NOT = 'NOT',\n}\n\n/** @enumType */\nexport type ModelFilterPrefixEnumWithLiterals =\n  | ModelFilterPrefixEnum\n  | 'IS'\n  | 'NOT';\n\n/** Comparison condition for a filter. Used together with `ModelFilterPrefixEnum` to build filter expressions. */\nexport enum ModelFilterConditionEnum {\n  /** Value equals the filter value. */\n  EQUAL = 'EQUAL',\n  /** Value is greater than the filter value. */\n  GREATER_THAN = 'GREATER_THAN',\n  /** Value is greater than or equal to the filter value. */\n  GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL',\n  /** Value is less than the filter value. */\n  LESS_THAN = 'LESS_THAN',\n  /** Value is less than or equal to the filter value. */\n  LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL',\n  /** Value is null. */\n  NULL = 'NULL',\n  /** Value is an empty string. */\n  EMPTY = 'EMPTY',\n  /** String value starts with the filter value. */\n  START_WITH = 'START_WITH',\n  /** String value ends with the filter value. */\n  END_WITH = 'END_WITH',\n  /** For strings, matches if any of the filter values appear as a substring. For arrays, matches if any of the filter values are present in the array. */\n  CONTAINS_ANY = 'CONTAINS_ANY',\n  /** Inclusive start, inclusive end range. The value must fall within `[a, b]`. */\n  RANGE_II = 'RANGE_II',\n  /** Inclusive start, exclusive end range. The value must fall within `[a, b)`. */\n  RANGE_IE = 'RANGE_IE',\n  /** Exclusive start, inclusive end range. The value must fall within `(a, b]`. */\n  RANGE_EI = 'RANGE_EI',\n  /** Exclusive start, exclusive end range. The value must fall within `(a, b)`. */\n  RANGE_EE = 'RANGE_EE',\n  /** For strings, matches if all filter values appear as substrings. For arrays, matches if all filter values are present in the array. */\n  CONTAINS_ALL = 'CONTAINS_ALL',\n}\n\n/** @enumType */\nexport type ModelFilterConditionEnumWithLiterals =\n  | ModelFilterConditionEnum\n  | 'EQUAL'\n  | 'GREATER_THAN'\n  | 'GREATER_THAN_OR_EQUAL'\n  | 'LESS_THAN'\n  | 'LESS_THAN_OR_EQUAL'\n  | 'NULL'\n  | 'EMPTY'\n  | 'START_WITH'\n  | 'END_WITH'\n  | 'CONTAINS_ANY'\n  | 'RANGE_II'\n  | 'RANGE_IE'\n  | 'RANGE_EI'\n  | 'RANGE_EE'\n  | 'CONTAINS_ALL';\n\n/** Value of a single field in a data row. Contains both the raw typed value and an optional formatted string representation. */\nexport interface ModelFieldValue extends ModelFieldValueValueOneOf {\n  /** Numeric value. */\n  numericValue?: number | null;\n  /** Date and time value. */\n  timestampValue?: Date | null;\n  /** Boolean value. */\n  booleanValue?: boolean | null;\n  /**\n   * String value.\n   * @maxLength 5120\n   */\n  stringValue?: string | null;\n  /** Array value. */\n  arrayValue?: any[] | null;\n  /** Object value with key-value pairs. */\n  objectValue?: Record<string, any> | null;\n  /**\n   * Human-readable string representation of the value. Populated when `formattingEnabled` is `true` in the request.\n   * @maxLength 5120\n   */\n  formattedValue?: string | null;\n}\n\n/** @oneof */\nexport interface ModelFieldValueValueOneOf {\n  /** Numeric value. */\n  numericValue?: number | null;\n  /** Date and time value. */\n  timestampValue?: Date | null;\n  /** Boolean value. */\n  booleanValue?: boolean | null;\n  /**\n   * String value.\n   * @maxLength 5120\n   */\n  stringValue?: string | null;\n  /** Array value. */\n  arrayValue?: any[] | null;\n  /** Object value with key-value pairs. */\n  objectValue?: Record<string, any> | null;\n}\n\n/** Data type of a model field. */\nexport enum ModelFieldTypeEnum {\n  /** Unknown field type. */\n  UNKNOWN = 'UNKNOWN',\n  /** String. */\n  STRING = 'STRING',\n  /** Number. */\n  NUMBER = 'NUMBER',\n  /** Boolean. */\n  BOOLEAN = 'BOOLEAN',\n  /** Date without time. */\n  DATE = 'DATE',\n  /** Date and time. */\n  DATE_TIME = 'DATE_TIME',\n  /** Structured object with key-value pairs. */\n  OBJECT = 'OBJECT',\n  /** Array of values. */\n  ARRAY = 'ARRAY',\n}\n\n/** @enumType */\nexport type ModelFieldTypeEnumWithLiterals =\n  | ModelFieldTypeEnum\n  | 'UNKNOWN'\n  | 'STRING'\n  | 'NUMBER'\n  | 'BOOLEAN'\n  | 'DATE'\n  | 'DATE_TIME'\n  | 'OBJECT'\n  | 'ARRAY';\n\n/** Supported filter operations for a model field. */\nexport interface ModelFieldFilters {\n  /**\n   * Supported prefix modifiers for this field.\n   * @maxSize 100\n   */\n  prefixes?: ModelFilterPrefixEnumWithLiterals[];\n  /**\n   * Supported comparison conditions for this field.\n   * @maxSize 100\n   */\n  conditions?: ModelFilterConditionEnumWithLiterals[];\n}\n\n/** Exposure (or visibility) */\nexport enum FieldVisibilityEnum {\n  /** Visible for all */\n  ALL = 'ALL',\n  /** Visible to API only */\n  API = 'API',\n  /** Users */\n  USERS = 'USERS',\n}\n\n/** @enumType */\nexport type FieldVisibilityEnumWithLiterals =\n  | FieldVisibilityEnum\n  | 'ALL'\n  | 'API'\n  | 'USERS';\n\n/** Definition of a single field within a semantic model, including its type, supported filters, and formatting options. */\nexport interface ModelField {\n  /**\n   * Field name. Use this value in the `fields` array of a query request to retrieve this field's data.\n   * @maxLength 5120\n   */\n  name?: string;\n  /** Data type of the field. */\n  type?: ModelFieldTypeEnumWithLiterals;\n  /** Supported filter operations for this field. */\n  filters?: ModelFieldFilters;\n  /** Formatting configuration for the field's values, compatible with the JavaScript `Intl` API. */\n  format?: Record<string, any> | null;\n  /**\n   * Grouping identifier. Fields with the same `groupSlug` are logically related.\n   * @maxLength 5120\n   */\n  groupSlug?: string | null;\n  /**\n   * Human-readable description of what this field represents.\n   * @maxLength 5120\n   */\n  description?: string | null;\n  /**\n   * Fields that must also be included in the query for this field to return data. If the dependencies aren't met, this field is silently omitted from results.\n   * @maxSize 100\n   * @maxLength 5120\n   */\n  dependsOn?: string[] | null;\n}\n\n/** Request for querying data from a semantic model. */\nexport interface QueryModelDataRequest {\n  /**\n   * ID or slug of the model to query. Call `List Models` to retrieve available model IDs.\n   * @maxLength 5120\n   */\n  modelId: string;\n  /** Time interval for the data query. */\n  interval: DateTimeInterval;\n  /**\n   * List of field names to retrieve from the model. Call `Get Model` to retrieve the model's available fields. Fields with unmet dependencies (see the `depends_on` property in the model schema) are silently omitted from results.\n   * @maxSize 60\n   * @maxLength 5120\n   */\n  fields: string[] | null;\n  /** Sort order for the results. Supports sorting by a single field only. */\n  sort?: Sorting;\n  /**\n   * Filters to apply to the data query. Supported conditions: `EQUAL`, `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL`, `NULL`, `EMPTY`, `START_WITH`, `END_WITH`, `CONTAINS_ANY`, `CONTAINS_ALL`, `RANGE_II` (inclusive start, inclusive end), `RANGE_IE` (inclusive start, exclusive end), `RANGE_EI` (exclusive start, inclusive end), and `RANGE_EE` (exclusive start, exclusive end).\n   * @maxSize 60\n   */\n  filters?: FieldFilter[];\n  /** Pagination options. */\n  paging?: Paging;\n  /**\n   * Whether to format numeric values as human-readable strings. For example, `1500` displays as `$1,500.00` or `1.5K` when enabled.\n   *\n   * Default: `false`\n   */\n  formattingEnabled?: boolean | null;\n  /** Cache control settings. */\n  cacheControl?: Control;\n  /**\n   * Whether to include a totals row in the response. When `true`, the `totals` field contains the sum of all numeric fields across the full (unpaginated) result set.\n   *\n   * Default: `false`\n   */\n  totalsIncluded?: boolean | null;\n}\n\n/** Date time interval */\nexport interface DateTimeInterval {\n  /** Period start date in UTC. */\n  start?: Date | null;\n  /** Period end date in UTC. */\n  end?: Date | null;\n  /**\n   * Timezone\n   * @maxLength 1024\n   */\n  timezone?: string | null;\n}\n\n/** Sorting options. */\nexport interface Sorting {\n  /**\n   * Order by field\n   * @maxLength 5120\n   */\n  fieldName?: string;\n  /** Order direction */\n  order?: SortOrderWithLiterals;\n  /** Place NULL values last in the result set (relevant for DESC order) */\n  nullsLast?: boolean | null;\n}\n\n/** Order direction. */\nexport enum SortOrder {\n  /** Ascending order. */\n  ASC = 'ASC',\n  /** Descending order. */\n  DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\n/** Filter to apply to a specific field when querying model data. */\nexport interface FieldFilter {\n  /**\n   * Name of the field to filter by. Must match a field name from the model's measures or dimensions.\n   * @maxLength 5120\n   */\n  field?: string;\n  /**\n   * Values to compare against. For range conditions, provide exactly 2 values representing the start and end of the range.\n   * @maxLength 5120\n   * @maxSize 100\n   */\n  values?: string[];\n  /**\n   * Whether to match or negate the condition.\n   *\n   * Default: `IS`\n   */\n  prefix?: ModelFilterPrefixEnumWithLiterals;\n  /**\n   * Comparison condition to apply.\n   *\n   * Default: `EQUAL`\n   */\n  condition?: ModelFilterConditionEnumWithLiterals;\n}\n\n/** Paging */\nexport interface Paging {\n  /**\n   * Number of items to load.\n   * @max 5000\n   */\n  limit?: number | null;\n  /** Number of items to skip in the current sort order. */\n  offset?: number | null;\n}\n\n/** Cache control. */\nexport interface Control {\n  /** Cache control. */\n  cacheControl?: CacheControlEnumWithLiterals;\n  /** Max age in seconds. */\n  maxAge?: number | null;\n}\n\n/** Cache control options. */\nexport enum CacheControlEnum {\n  /** Allow stale cache, returns data even if greater than max age. */\n  ALLOW_STALE = 'ALLOW_STALE',\n  /** Like stale, but if result is stale, update in background. */\n  UPDATE_AFTER = 'UPDATE_AFTER',\n  /** Use cache, but refresh data if stale before returning. */\n  NO_STALE = 'NO_STALE',\n  /** No cache. */\n  NO_CACHE = 'NO_CACHE',\n}\n\n/** @enumType */\nexport type CacheControlEnumWithLiterals =\n  | CacheControlEnum\n  | 'ALLOW_STALE'\n  | 'UPDATE_AFTER'\n  | 'NO_STALE'\n  | 'NO_CACHE';\n\n/** Response for querying data from a semantic model. */\nexport interface QueryModelDataResponse {\n  /**\n   * Retrieved data rows.\n   * @readonly\n   * @maxSize 1000\n   */\n  results?: ModelFieldDataRow[];\n  /** Cache status of the response. */\n  cacheStatus?: Status;\n  /**\n   * Pagination metadata.\n   * @readonly\n   */\n  pagingMetadata?: PagingMetadata;\n  /**\n   * Totals row with the sum of all numeric fields across the full result set.\n   *\n   * Returned only when `totalsIncluded` is `true`.\n   * @readonly\n   */\n  totals?: ModelFieldDataRow;\n}\n\n/** Single row of query results. Each entry maps a field name to its value. */\nexport interface ModelFieldDataRow {\n  /**\n   * Map of field name to its value for this row.\n   * @maxSize 100\n   */\n  fields?: Record<string, ModelFieldValue>;\n}\n\n/** Cache status. */\nexport interface Status {\n  /** Cache status. */\n  status?: CacheSatusEnumWithLiterals;\n  /** Updated at. */\n  createdAt?: Date | null;\n  /** Expires at. */\n  expiresAt?: Date | null;\n}\n\n/** Cache status. */\nexport enum CacheSatusEnum {\n  /** Missed cache. */\n  MISS = 'MISS',\n  /** Served from cache. */\n  HIT = 'HIT',\n  /** Found in cache but expired. */\n  STALE = 'STALE',\n}\n\n/** @enumType */\nexport type CacheSatusEnumWithLiterals =\n  | CacheSatusEnum\n  | 'MISS'\n  | 'HIT'\n  | 'STALE';\n\n/** PagingMetadata */\nexport interface PagingMetadata {\n  /** Number of items returned in the response. */\n  count?: number | null;\n  /** Offset that was requested. */\n  offset?: number | null;\n}\n\n/** Request for retrieving a semantic model by ID or slug. */\nexport interface GetModelRequest {\n  /**\n   * ID or slug of the model to retrieve. Call `List Models` to retrieve available model IDs.\n   * @maxLength 5120\n   */\n  modelId: string;\n}\n\n/** Response for retrieving a semantic model. */\nexport interface GetModelResponse {\n  /** Retrieved semantic model. */\n  model?: Model;\n}\n\n/** Request for listing all available semantic models. */\nexport interface ListModelsRequest {}\n\n/** Response for listing all available semantic models. */\nexport interface ListModelsResponse {\n  /**\n   * Available semantic models.\n   * @maxSize 100\n   */\n  models?: Model[];\n}\n\n/** @docsIgnore */\nexport type QueryModelDataApplicationErrors = {\n  code?: 'NO_ACCOUNT_IDENTITY';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type GetModelApplicationErrors =\n  | {\n      code?: 'NO_ACCOUNT_IDENTITY';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'MODEL_NOT_FOUND';\n      description?: string;\n      data?: Record<string, any>;\n    };\n/** @docsIgnore */\nexport type ListModelsApplicationErrors = {\n  code?: 'NO_ACCOUNT_IDENTITY';\n  description?: string;\n  data?: Record<string, any>;\n};\n\n/**\n * Retrieves data from a semantic model, given the provided fields, filters, sorting, and paging.\n *\n *\n * Query Model Data runs with these defaults, which you can override:\n *\n * - `paging.limit` is `50`\n * - `paging.offset` is `0`\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n * @param modelId - ID or slug of the model to query. Call `List Models` to retrieve available model IDs.\n * @public\n * @documentationMaturity preview\n * @requiredField modelId\n * @requiredField options.fields\n * @requiredField options.interval\n * @permissionId analytics:model:v3:model:query_model_data\n * @applicableIdentity APP\n * @returns Response for querying data from a semantic model.\n * @fqn wix.analytics.model.v3.SemanticModelsService.QueryModelData\n */\nexport async function queryModelData(\n  modelId: string,\n  options?: NonNullablePaths<QueryModelDataOptions, `fields` | `interval`, 2>\n): Promise<\n  NonNullablePaths<\n    QueryModelDataResponse,\n    `results` | `cacheStatus.status`,\n    3\n  > & {\n    __applicationErrorsType?: QueryModelDataApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    modelId: modelId,\n    interval: options?.interval,\n    fields: options?.fields,\n    sort: options?.sort,\n    filters: options?.filters,\n    paging: options?.paging,\n    formattingEnabled: options?.formattingEnabled,\n    cacheControl: options?.cacheControl,\n    totalsIncluded: options?.totalsIncluded,\n  });\n\n  const reqOpts = ambassadorWixAnalyticsModelV3Model.queryModelData(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          modelId: '$[0]',\n          interval: '$[1].interval',\n          fields: '$[1].fields',\n          sort: '$[1].sort',\n          filters: '$[1].filters',\n          paging: '$[1].paging',\n          formattingEnabled: '$[1].formattingEnabled',\n          cacheControl: '$[1].cacheControl',\n          totalsIncluded: '$[1].totalsIncluded',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['modelId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface QueryModelDataOptions {\n  /** Time interval for the data query. */\n  interval: DateTimeInterval;\n  /**\n   * List of field names to retrieve from the model. Call `Get Model` to retrieve the model's available fields. Fields with unmet dependencies (see the `depends_on` property in the model schema) are silently omitted from results.\n   * @maxSize 60\n   * @maxLength 5120\n   */\n  fields: string[] | null;\n  /** Sort order for the results. Supports sorting by a single field only. */\n  sort?: Sorting;\n  /**\n   * Filters to apply to the data query. Supported conditions: `EQUAL`, `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL`, `NULL`, `EMPTY`, `START_WITH`, `END_WITH`, `CONTAINS_ANY`, `CONTAINS_ALL`, `RANGE_II` (inclusive start, inclusive end), `RANGE_IE` (inclusive start, exclusive end), `RANGE_EI` (exclusive start, inclusive end), and `RANGE_EE` (exclusive start, exclusive end).\n   * @maxSize 60\n   */\n  filters?: FieldFilter[];\n  /** Pagination options. */\n  paging?: Paging;\n  /**\n   * Whether to format numeric values as human-readable strings. For example, `1500` displays as `$1,500.00` or `1.5K` when enabled.\n   *\n   * Default: `false`\n   */\n  formattingEnabled?: boolean | null;\n  /** Cache control settings. */\n  cacheControl?: Control;\n  /**\n   * Whether to include a totals row in the response. When `true`, the `totals` field contains the sum of all numeric fields across the full (unpaginated) result set.\n   *\n   * Default: `false`\n   */\n  totalsIncluded?: boolean | null;\n}\n\n/**\n * Retrieves a semantic model by ID or slug.\n * @param modelId - ID or slug of the model to retrieve. Call `List Models` to retrieve available model IDs.\n * @public\n * @documentationMaturity preview\n * @requiredField modelId\n * @permissionId analytics:model:v3:model:get_model\n * @applicableIdentity APP\n * @returns Response for retrieving a semantic model.\n * @fqn wix.analytics.model.v3.SemanticModelsService.GetModel\n */\nexport async function getModel(modelId: string): Promise<\n  NonNullablePaths<\n    GetModelResponse,\n    | `model._id`\n    | `model.slug`\n    | `model.version`\n    | `model.measures`\n    | `model.measures.${number}.name`\n    | `model.measures.${number}.type`\n    | `model.dimensions`\n    | `model.parameters`\n    | `model.keywords`,\n    5\n  > & {\n    __applicationErrorsType?: GetModelApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ modelId: modelId });\n\n  const reqOpts = ambassadorWixAnalyticsModelV3Model.getModel(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { modelId: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['modelId']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Retrieves a list of all available semantic models.\n * @public\n * @documentationMaturity preview\n * @permissionId analytics:model:v3:model:list_models\n * @applicableIdentity APP\n * @returns Response for listing all available semantic models.\n * @fqn wix.analytics.model.v3.SemanticModelsService.ListModels\n */\nexport async function listModels(): Promise<\n  NonNullablePaths<\n    ListModelsResponse,\n    | `models`\n    | `models.${number}._id`\n    | `models.${number}.slug`\n    | `models.${number}.version`,\n    4\n  > & {\n    __applicationErrorsType?: ListModelsApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n  const reqOpts = ambassadorWixAnalyticsModelV3Model.listModels(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {},\n        singleArgumentUnchanged: false,\n      },\n      []\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n","import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixAnalyticsModelV3SemanticModelsServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/analytics-ng-model-api',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/analytics/v3/model',\n        destPath: '/v3/model-api',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/analytics-ng-model-api',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/analytics-ng-model-api',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_analytics-model_analytics-model';\n\n/**\n * Retrieves data from a semantic model, given the provided fields, filters, sorting, and paging.\n *\n *\n * Query Model Data runs with these defaults, which you can override:\n *\n * - `paging.limit` is `50`\n * - `paging.offset` is `0`\n *\n * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).\n */\nexport function queryModelData(payload: object): RequestOptionsFactory<any> {\n  function __queryModelData({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [{ path: 'interval.start' }, { path: 'interval.end' }],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.analytics.model.v3.model',\n      method: 'POST' as any,\n      methodFqn: 'wix.analytics.model.v3.SemanticModelsService.QueryModelData',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAnalyticsModelV3SemanticModelsServiceUrl({\n        protoPath: '/v3/model-api/query-data',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTFloatToSDKFloat,\n            paths: [\n              { path: 'results.fields.*.numericValue' },\n              { path: 'totals.fields.*.numericValue' },\n            ],\n          },\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'results.fields.*.timestampValue' },\n              { path: 'cacheStatus.createdAt' },\n              { path: 'cacheStatus.expiresAt' },\n              { path: 'totals.fields.*.timestampValue' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __queryModelData;\n}\n\n/** Retrieves a semantic model by ID or slug. */\nexport function getModel(payload: object): RequestOptionsFactory<any> {\n  function __getModel({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.analytics.model.v3.model',\n      method: 'POST' as any,\n      methodFqn: 'wix.analytics.model.v3.SemanticModelsService.GetModel',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAnalyticsModelV3SemanticModelsServiceUrl({\n        protoPath: '/v3/model-api/get',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __getModel;\n}\n\n/** Retrieves a list of all available semantic models. */\nexport function listModels(payload: object): RequestOptionsFactory<any> {\n  function __listModels({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.analytics.model.v3.model',\n      method: 'POST' as any,\n      methodFqn: 'wix.analytics.model.v3.SemanticModelsService.ListModels',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAnalyticsModelV3SemanticModelsServiceUrl({\n        protoPath: '/v3/model-api/list',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __listModels;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,mDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,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Aa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","ModelFilterPrefixEnum","ModelFilterConditionEnum","ModelFieldTypeEnum","FieldVisibilityEnum","SortOrder","CacheControlEnum","CacheSatusEnum","queryModelData","getModel","listModels"]}