import { NonNullablePaths } from '@wix/sdk-types'; /** A semantic model defining the measures, dimensions, and parameters available for querying site performance data, such as traffic, revenue, and engagement metrics. */ interface SemanticModel { /** * Semantic model ID. * @format GUID * @readonly */ _id?: string; /** * URL-friendly identifier for the semantic model. * @maxLength 5120 */ slug?: string; /** * Quantitative fields available for aggregation, such as revenue, page views, or order count. * @maxSize 1000 */ measures?: Field[]; /** * Categorical fields available for grouping data, such as traffic source, country, or product name. * @maxSize 1000 */ dimensions?: Field[]; /** * Optional inputs that customize query behavior, such as currency or date granularity. * @maxSize 1000 */ parameters?: Field[]; /** * Human-readable description of the semantic model. * @maxLength 5120 */ description?: string | null; /** * Keywords associated with the semantic model for search and discovery. * @maxSize 100 * @maxLength 5120 */ keywords?: string[] | null; } /** Modifier applied to a filter condition. Combine with `FilterConditionEnum` to create expressions such as "is equal" or "is not equal". */ declare enum FilterPrefixEnum { /** Positive match. For example, `IS` + `EQUAL` means "is equal to". */ IS = "IS", /** Negated match. For example, `NOT` + `EQUAL` means "is not equal to". */ NOT = "NOT" } /** @enumType */ type FilterPrefixEnumWithLiterals = FilterPrefixEnum | 'IS' | 'NOT'; /** Comparison condition for a filter. Used together with `FilterPrefixEnum` to build filter expressions. */ declare enum FilterConditionEnum { /** Value equals the filter value. */ EQUAL = "EQUAL", /** Value is greater than the filter value. */ GREATER_THAN = "GREATER_THAN", /** Value is greater than or equal to the filter value. */ GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL", /** Value is less than the filter value. */ LESS_THAN = "LESS_THAN", /** Value is less than or equal to the filter value. */ LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL", /** Value is null. */ NULL = "NULL", /** Value is an empty string. */ EMPTY = "EMPTY", /** String value starts with the filter value. */ START_WITH = "START_WITH", /** String value ends with the filter value. */ END_WITH = "END_WITH", /** 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. */ CONTAINS_ANY = "CONTAINS_ANY", /** Inclusive start, inclusive end range. The value must fall within `[a, b]`. */ RANGE_II = "RANGE_II", /** Inclusive start, exclusive end range. The value must fall within `[a, b)`. */ RANGE_IE = "RANGE_IE", /** Exclusive start, inclusive end range. The value must fall within `(a, b]`. */ RANGE_EI = "RANGE_EI", /** Exclusive start, exclusive end range. The value must fall within `(a, b)`. */ RANGE_EE = "RANGE_EE", /** For strings, matches if all filter values appear as substrings. For arrays, matches if all filter values are present in the array. */ CONTAINS_ALL = "CONTAINS_ALL" } /** @enumType */ type FilterConditionEnumWithLiterals = FilterConditionEnum | 'EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'NULL' | 'EMPTY' | 'START_WITH' | 'END_WITH' | 'CONTAINS_ANY' | 'RANGE_II' | 'RANGE_IE' | 'RANGE_EI' | 'RANGE_EE' | 'CONTAINS_ALL'; /** Value of a single field in a data row. Contains both the raw typed value and an optional formatted string representation. */ interface FieldValue extends FieldValueValueOneOf { /** Numeric value. */ numericValue?: number | null; /** Date and time value. */ timestampValue?: Date | null; /** Boolean value. */ booleanValue?: boolean | null; /** * String value. * @maxLength 5120 */ stringValue?: string | null; /** Array value. */ arrayValue?: any[] | null; /** Object value with key-value pairs. */ objectValue?: Record | null; /** * Human-readable string representation of the value. Populated when `formattingEnabled` is `true` in the request. * @maxLength 5120 */ formattedValue?: string | null; } /** @oneof */ interface FieldValueValueOneOf { /** Numeric value. */ numericValue?: number | null; /** Date and time value. */ timestampValue?: Date | null; /** Boolean value. */ booleanValue?: boolean | null; /** * String value. * @maxLength 5120 */ stringValue?: string | null; /** Array value. */ arrayValue?: any[] | null; /** Object value with key-value pairs. */ objectValue?: Record | null; } /** Data type of a semantic model field. */ declare enum FieldTypeEnum { /** Unknown field type. */ UNKNOWN = "UNKNOWN", /** String. */ STRING = "STRING", /** Number. */ NUMBER = "NUMBER", /** Boolean. */ BOOLEAN = "BOOLEAN", /** Date without time. */ DATE = "DATE", /** Date and time. */ DATE_TIME = "DATE_TIME", /** Structured object with key-value pairs. */ OBJECT = "OBJECT", /** Array of values. */ ARRAY = "ARRAY" } /** @enumType */ type FieldTypeEnumWithLiterals = FieldTypeEnum | 'UNKNOWN' | 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATE_TIME' | 'OBJECT' | 'ARRAY'; /** Supported filter operations for a semantic model field. */ interface FieldFilters { /** * Supported prefix modifiers for this field. * @maxSize 100 */ prefixes?: FilterPrefixEnumWithLiterals[]; /** * Supported comparison conditions for this field. * @maxSize 100 */ conditions?: FilterConditionEnumWithLiterals[]; } /** Definition of a single field in a semantic model, including its type, supported filters, and formatting options. */ interface Field { /** * Field name. Use this value in the `fields` array of a query request to retrieve this field's data. * @maxLength 5120 */ name?: string; /** Data type of the field. */ type?: FieldTypeEnumWithLiterals; /** Supported filter operations for this field. */ filters?: FieldFilters; /** Whether this field supports sorting. */ sortable?: boolean | null; /** * Allowed values for this field, if the field is an enumerated type. * @maxSize 100 * @maxLength 5120 */ enumerations?: string[] | null; /** * Grouping identifier. Fields with the same `groupSlug` are logically related. * @maxLength 5120 */ groupSlug?: string | null; /** * Human-readable description of what this field represents. * @maxLength 5120 */ description?: string | null; /** * Other fields this field depends on. The field returns data only if at least one of these fields is also included in the query; otherwise it's silently omitted from results. * @maxSize 100 * @maxLength 5120 */ dependencies?: string[] | null; } /** Request for querying data from a semantic model. */ interface QuerySemanticModelDataRequest { /** * ID of the semantic model to query. * @maxLength 5120 */ semanticModelId: string; /** Time interval for the data query. */ interval: DateTimeInterval; /** * List of field names to retrieve from the semantic model. Call `Get Semantic Model` to retrieve the semantic model's available fields. Fields with unmet dependencies (see the `dependencies` property in the semantic model schema) are silently omitted from results. * @maxSize 60 * @maxLength 5120 */ fields: string[] | null; /** Sort order for the results. Supports sorting by a single field only. */ sort?: Sorting; /** * 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). * @maxSize 60 */ filters?: FieldFilter[]; /** Pagination options. */ paging?: Paging; /** * Whether to format numeric values as human-readable strings. For example, `1500` displays as `$1,500.00` or `1.5K` when enabled. * * Default: `false` */ formattingEnabled?: boolean | null; /** * 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. * * Default: `false` */ totalsIncluded?: boolean | null; } /** Date time interval */ interface DateTimeInterval { /** * Period start as an absolute instant. The query timezone determines its * wall-clock representation when querying Snowflake and formatting results. */ start?: Date | null; /** * Period end as an absolute instant. The query timezone determines its * wall-clock representation when querying Snowflake and formatting results. */ end?: Date | null; /** * Timezone used to interpret and format the instant boundaries for the query. * @maxLength 1024 */ timezone?: string | null; } /** Sorting options. */ interface Sorting { /** * Name of the field to sort the results by. * @maxLength 5120 */ fieldName?: string; /** * Sort direction. * * Default: `ASC` */ order?: SortOrderWithLiterals; /** * Whether to place null values last in the result set. Applies to descending order. * * Default: `false` */ nullsLast?: boolean | null; } /** Order direction. */ declare enum SortOrder { /** Ascending order. */ ASC = "ASC", /** Descending order. */ DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; /** Filter to apply to a specific field when querying semantic model data. */ interface FieldFilter { /** * Name of the field to filter by. Must match a field name from the semantic model's measures or dimensions. * @maxLength 5120 */ field?: string; /** * Values to compare against. For range conditions, provide exactly 2 values representing the start and end of the range. * @maxLength 5120 * @maxSize 100 */ values?: string[]; /** * Whether to match or negate the condition. * * Default: `IS` */ prefix?: FilterPrefixEnumWithLiterals; /** * Comparison condition to apply. * * Default: `EQUAL` */ condition?: FilterConditionEnumWithLiterals; } /** Paging */ interface Paging { /** * Number of items to load. * @max 5000 */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } /** Response for querying data from a semantic model. */ interface QuerySemanticModelDataResponse { /** * Retrieved data rows. * @readonly * @maxSize 1000 */ results?: DataRow[]; /** * Pagination metadata. * @readonly */ pagingMetadata?: PagingMetadata; /** * Totals row with the sum of all numeric fields across the full result set. * * Returned only when `totalsIncluded` is `true`. * @readonly */ totals?: DataRow; } /** Single row of query results. Each entry maps a field name to its value. */ interface DataRow { /** * Map of field name to its value for this row. * @maxSize 100 */ fields?: Record; } /** PagingMetadata */ interface PagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; } /** Request for retrieving a semantic model by ID. */ interface GetSemanticModelRequest { /** * ID of the semantic model to retrieve. * @maxLength 5120 */ semanticModelId: string; } /** Response for retrieving a semantic model. */ interface GetSemanticModelResponse { /** Retrieved semantic model. */ semanticModel?: SemanticModel; } /** Request for listing all available semantic models. */ interface ListSemanticModelsRequest { } /** Response for listing all available semantic models. */ interface ListSemanticModelsResponse { /** * Available semantic models. * @maxSize 100 */ semanticModels?: SemanticModel[]; } /** @docsIgnore */ type QuerySemanticModelDataApplicationErrors = { code?: 'NO_ACCOUNT_IDENTITY'; description?: string; data?: Record; }; /** @docsIgnore */ type GetSemanticModelApplicationErrors = { code?: 'NO_ACCOUNT_IDENTITY'; description?: string; data?: Record; } | { code?: 'SEMANTIC_MODEL_NOT_FOUND'; description?: string; data?: Record; }; /** @docsIgnore */ type ListSemanticModelsApplicationErrors = { code?: 'NO_ACCOUNT_IDENTITY'; description?: string; data?: Record; }; /** * Retrieves data from a semantic model for the specified fields, filters, sorting, and paging. * * * Query Semantic Model Data runs with these defaults, which you can override: * * - `paging.limit` is `50` * - `paging.offset` is `0` * * 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). * @param semanticModelId - ID of the semantic model to query. * @public * @requiredField options.fields * @requiredField options.interval * @requiredField semanticModelId * @permissionId analytics:semantic_model:v3:semantic_model:query_semantic_model_data * @applicableIdentity APP * @returns Response for querying data from a semantic model. * @fqn wix.analytics.semantic_model.v3.SemanticModelsService.QuerySemanticModelData */ declare function querySemanticModelData(semanticModelId: string, options?: NonNullablePaths): Promise & { __applicationErrorsType?: QuerySemanticModelDataApplicationErrors; }>; interface QuerySemanticModelDataOptions { /** Time interval for the data query. */ interval: DateTimeInterval; /** * List of field names to retrieve from the semantic model. Call `Get Semantic Model` to retrieve the semantic model's available fields. Fields with unmet dependencies (see the `dependencies` property in the semantic model schema) are silently omitted from results. * @maxSize 60 * @maxLength 5120 */ fields: string[] | null; /** Sort order for the results. Supports sorting by a single field only. */ sort?: Sorting; /** * 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). * @maxSize 60 */ filters?: FieldFilter[]; /** Pagination options. */ paging?: Paging; /** * Whether to format numeric values as human-readable strings. For example, `1500` displays as `$1,500.00` or `1.5K` when enabled. * * Default: `false` */ formattingEnabled?: boolean | null; /** * 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. * * Default: `false` */ totalsIncluded?: boolean | null; } /** * Retrieves a semantic model by ID. * @param semanticModelId - ID of the semantic model to retrieve. * @public * @requiredField semanticModelId * @permissionId analytics:semantic_model:v3:semantic_model:get_semantic_model * @applicableIdentity APP * @returns Retrieved semantic model. * @fqn wix.analytics.semantic_model.v3.SemanticModelsService.GetSemanticModel */ declare function getSemanticModel(semanticModelId: string): Promise & { __applicationErrorsType?: GetSemanticModelApplicationErrors; }>; /** * Retrieves a list of all available semantic models. * @public * @permissionId analytics:semantic_model:v3:semantic_model:list_semantic_models * @applicableIdentity APP * @returns Response for listing all available semantic models. * @fqn wix.analytics.semantic_model.v3.SemanticModelsService.ListSemanticModels */ declare function listSemanticModels(): Promise & { __applicationErrorsType?: ListSemanticModelsApplicationErrors; }>; export { type DataRow, type DateTimeInterval, type Field, type FieldFilter, type FieldFilters, FieldTypeEnum, type FieldTypeEnumWithLiterals, type FieldValue, type FieldValueValueOneOf, FilterConditionEnum, type FilterConditionEnumWithLiterals, FilterPrefixEnum, type FilterPrefixEnumWithLiterals, type GetSemanticModelApplicationErrors, type GetSemanticModelRequest, type GetSemanticModelResponse, type ListSemanticModelsApplicationErrors, type ListSemanticModelsRequest, type ListSemanticModelsResponse, type Paging, type PagingMetadata, type QuerySemanticModelDataApplicationErrors, type QuerySemanticModelDataOptions, type QuerySemanticModelDataRequest, type QuerySemanticModelDataResponse, type SemanticModel, SortOrder, type SortOrderWithLiterals, type Sorting, getSemanticModel, listSemanticModels, querySemanticModelData };