{"version":3,"sources":["../../src/cloud-data-usage-v1-site-data-usage-data.universal.ts","../../src/cloud-data-usage-v1-site-data-usage-data.http.ts","../../src/cloud-data-usage-v1-site-data-usage-data.public.ts","../../src/cloud-data-usage-v1-site-data-usage-data.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, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixCloudDataUsageV1SiteDataUsage from './cloud-data-usage-v1-site-data-usage-data.http.js';\n\n/** Site-wide data resource limits and current usage, including storage, data item counts, and data collection counts. */\nexport interface SiteDataUsage {\n  /**\n   * Maximum storage allowed for all native collections combined, in bytes.\n   *\n   * Storage usage is shared between the live and sandbox environments. For example, with a limit of\n   * 1 GB, the live environment could use 700 MB and the sandbox 300 MB before the limit is reached.\n   *\n   * When this limit is reached, writes to collections fail.\n   */\n  storageLimitInBytes?: string | null;\n  /**\n   * Maximum number of data items allowed per environment.\n   *\n   * This limit applies separately to the live and sandbox environments. For example, with a limit\n   * of 1,000, both the live and sandbox environments can each contain 1,000 items independently.\n   *\n   * When this limit is reached in an environment, writes to collections in that environment fail.\n   */\n  itemCountLimit?: string | null;\n  /** Maximum number of native data collections allowed. */\n  collectionCountLimit?: number | null;\n  /** Total number of native data collections. */\n  collectionCount?: number | null;\n  /** Storage and item usage across all native collections in the live environment. */\n  totalUsedLive?: Usage;\n  /** Storage and item usage across all native collections in the sandbox environment. */\n  totalUsedSandbox?: Usage;\n  /**\n   * Storage and item usage per native data collection.\n   * @maxSize 1000\n   */\n  dataCollectionUsages?: DataCollectionUsage[];\n}\n\n/** Storage and item usage. */\nexport interface Usage {\n  /** Storage used, in bytes. */\n  bytes?: string;\n  /** Number of data items. */\n  items?: string;\n  /**\n   * Last time the content changed in this environment, meaning a data item was\n   * inserted, updated, or deleted.\n   *\n   * Not returned when no content change has been recorded yet.\n   */\n  contentUpdatedDate?: Date | null;\n}\n\n/** Storage and item usage for a single data collection. */\nexport interface DataCollectionUsage {\n  /**\n   * Data collection ID.\n   * @maxLength 256\n   */\n  dataCollectionId?: string;\n  /**\n   * Data collection display name.\n   * @maxLength 1024\n   */\n  displayName?: string | null;\n  /** Data collection type. Currently, only native collections are returned. */\n  dataCollectionType?: CollectionTypeWithLiterals;\n  /** Storage and item usage in the live environment. */\n  totalUsedLive?: Usage;\n  /** Storage and item usage in the sandbox environment. */\n  totalUsedSandbox?: Usage;\n}\n\nexport enum CollectionType {\n  /** User-created collection. */\n  NATIVE = 'NATIVE',\n  /** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */\n  WIX_APP = 'WIX_APP',\n  /** Collection created by a Wix Blocks app. */\n  BLOCKS_APP = 'BLOCKS_APP',\n  /** Collection located in externally connected storage. */\n  EXTERNAL = 'EXTERNAL',\n}\n\n/** @enumType */\nexport type CollectionTypeWithLiterals =\n  | CollectionType\n  | 'NATIVE'\n  | 'WIX_APP'\n  | 'BLOCKS_APP'\n  | 'EXTERNAL';\n\nexport interface GetSiteDataUsageRequest {\n  /**\n   * Fields to return in the response. If not provided, all fields are returned.\n   *\n   * Supported properties:\n   * `storageLimitInBytes`, `itemCountLimit`, `collectionCountLimit`, `collectionCount`,\n   * `totalUsedLive`, `totalUsedSandbox`, `dataCollectionUsages`\n   * @maxLength 1000\n   * @maxSize 1000\n   */\n  fields?: string[];\n  /**\n   * Whether to return real-time values instead of cached values.\n   *\n   * Setting this to `true` results in a slower response. Use only when near real-time accuracy\n   * is critical, such as just before enforcing a resource limit.\n   *\n   * Default: `false`\n   */\n  consistentRead?: boolean;\n}\n\nexport interface GetSiteDataUsageResponse {\n  /** Retrieved site data usage. */\n  siteDataUsage?: SiteDataUsage;\n}\n\nexport interface ListSiteDataUsagesRequest {\n  /**\n   * Accepted for LIST-shape compatibility but ignored — the response always\n   * contains the single entity for the call-scoped instance.\n   */\n  paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n  /**\n   * Maximum number of items to return in the results.\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * Pointer to the next or previous page in the list of results.\n   *\n   * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n   * Not relevant for the first request.\n   * @maxLength 16000\n   */\n  cursor?: string | null;\n}\n\nexport interface ListSiteDataUsagesResponse {\n  /** Retrieved site data usage entities. */\n  siteDataUsages?: SiteDataUsage[];\n  /** Paging information. */\n  pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n  /** Number of items returned in current page. */\n  count?: number | null;\n  /** Cursor strings that point to the next page, previous page, or both. */\n  cursors?: Cursors;\n  /**\n   * Whether there are more pages to retrieve following the current page.\n   *\n   * + `true`: Another page of results can be retrieved.\n   * + `false`: This is the last page.\n   */\n  hasNext?: boolean | null;\n  /**\n   * Total number of items matching the filter.\n   * Available only on the first page of *Search* results, not included in *Query* or *List* results.\n   * If the Search results span multiple pages, the value of `total` will exceed the number of items returned on the first page.\n   * @internal\n   */\n  total?: number | null;\n}\n\nexport interface Cursors {\n  /**\n   * Cursor string pointing to the next page in the list of results.\n   * @maxLength 16000\n   */\n  next?: string | null;\n  /**\n   * Cursor pointing to the previous page in the list of results.\n   * @maxLength 16000\n   */\n  prev?: string | null;\n}\n\nexport interface BulkUpdateUsagesRequest {\n  /**\n   * Instance usage updates.\n   * @maxSize 10000\n   */\n  updates?: InstanceUsageUpdate[];\n}\n\nexport interface DataCollectionUsageUpdate {\n  /**\n   * Data collection ID.\n   * @maxLength 256\n   */\n  dataCollectionId?: string;\n  /** Whether to add the values to the existing usage (`true`) or replace the existing usage (`false`). */\n  relative?: boolean;\n  /** Number of data items in the live environment. */\n  liveItemCount?: string | null;\n  /** Number of data items in the sandbox environment. */\n  sandboxItemCount?: string | null;\n  /** Storage used in the live environment, in bytes. */\n  liveUsedStorageInBytes?: string | null;\n  /** Storage used in the sandbox environment, in bytes. */\n  sandboxUsedStorageInBytes?: string | null;\n  /**\n   * Last time content changed in the live environment. Applied only if it is later than the\n   * currently stored value; never moves the stored timestamp backwards.\n   */\n  liveContentUpdatedDate?: Date | null;\n  /**\n   * Last time content changed in the sandbox environment. Applied only if it is later than the\n   * currently stored value; never moves the stored timestamp backwards.\n   */\n  sandboxContentUpdatedDate?: Date | null;\n}\n\nexport enum Segment {\n  /** Both live and sandbox environments. */\n  BOTH = 'BOTH',\n  /** Live environment. */\n  LIVE = 'LIVE',\n  /** Sandbox environment. */\n  SANDBOX = 'SANDBOX',\n}\n\n/** @enumType */\nexport type SegmentWithLiterals = Segment | 'BOTH' | 'LIVE' | 'SANDBOX';\n\n/** Usage update for a single site instance. */\nexport interface InstanceUsageUpdate {\n  /**\n   * Data instance ID.\n   * @format GUID\n   */\n  instanceId?: string;\n  /**\n   * Usage updates per data collection.\n   * @maxSize 10000\n   */\n  collections?: DataCollectionUsageUpdate[];\n  /**\n   * Whether all active collections for this instance are included in `collections`.\n   * When `true`, collections not in `collections` are assumed to have zero usage in the specified segment.\n   */\n  allCollectionsPresent?: boolean;\n  /** Environment to update. */\n  segment?: SegmentWithLiterals;\n}\n\nexport interface BulkUpdateUsagesResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entity?: string;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface Empty {}\n\nexport interface DataChangeEvent extends DataChangeEventEventOneOf {\n  dataChanged?: DataChanged;\n  /** resume point is lost so some changes may be lost */\n  changesLost?: ChangesLost;\n  referenceChanged?: ReferenceChanged;\n  /** segment access or mapping changed */\n  segmentChanged?: SegmentChanged;\n  /** segment migration started to new physical location */\n  segmentMigrationStarted?: SegmentMigrationStarted;\n  /** source should be added or removed from ignore list */\n  ignoredSource?: IgnoredSourceEvent;\n  /** @maxLength 1024 */\n  idempotenceKey?: string;\n}\n\n/** @oneof */\nexport interface DataChangeEventEventOneOf {\n  dataChanged?: DataChanged;\n  /** resume point is lost so some changes may be lost */\n  changesLost?: ChangesLost;\n  referenceChanged?: ReferenceChanged;\n  /** segment access or mapping changed */\n  segmentChanged?: SegmentChanged;\n  /** segment migration started to new physical location */\n  segmentMigrationStarted?: SegmentMigrationStarted;\n  /** source should be added or removed from ignore list */\n  ignoredSource?: IgnoredSourceEvent;\n}\n\nexport interface DataChanged extends DataChangedChangeOneOf {\n  /** inserted document */\n  inserted?: Record<string, any> | null;\n  /** full replaced document */\n  replaced?: Record<string, any> | null;\n  /** partial update, removed fields are set to Empty */\n  partial?: Record<string, any> | null;\n  /**\n   * deleted document ID\n   * @maxLength 256\n   */\n  removedId?: string;\n  /**\n   * physical cluster ID\n   * @maxLength 1024\n   */\n  clusterId?: string;\n  /**\n   * physical source\n   * db.collection for MongoDB\n   * @maxLength 1024\n   */\n  source?: string;\n  /**\n   * instance ID\n   * @format GUID\n   */\n  tenantId?: string;\n  /**\n   * logical collection name\n   * @maxLength 256\n   */\n  collectionName?: string;\n  dataStore?: DataStoreWithLiterals;\n  /** @maxLength 256 */\n  documentId?: string;\n  clusterTime?: Date | null;\n  /** Initiator of the request */\n  initiator?: Initiator;\n  /** Identity of the user who initiated the request */\n  writer?: Identity;\n  /**\n   * Contains changes that, when applied to raw item, will result in the item as it would look like\n   * when returned from the data-items API.\n   * This includes\n   * * fully prefixed page link paths\n   * * calculated draft-published status\n   * * decrypted PII fields\n   * * deleted schema fields (removed_fields)\n   */\n  enrichment?: Enrichment;\n  /**\n   * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster.\n   * Two or more events can have same sequence number if they happened in the same transaction.\n   * Events in different clusters have independent sequence numbers and should not be compared.\n   */\n  seqNumber?: string;\n  /**\n   * Raw item contents archived in the trashbin before deletion.\n   * Populated for delete events when a matching trashbin entry is available.\n   */\n  previousData?: Record<string, any> | null;\n}\n\n/** @oneof */\nexport interface DataChangedChangeOneOf {\n  /** inserted document */\n  inserted?: Record<string, any> | null;\n  /** full replaced document */\n  replaced?: Record<string, any> | null;\n  /** partial update, removed fields are set to Empty */\n  partial?: Record<string, any> | null;\n  /**\n   * deleted document ID\n   * @maxLength 256\n   */\n  removedId?: string;\n}\n\nexport enum Type {\n  /** Initiator is unknown */\n  Unknown = 'Unknown',\n  /** Indicated that write has been initiated by SSR indexer */\n  SsrIndexer = 'SsrIndexer',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'Unknown' | 'SsrIndexer';\n\nexport enum DataStore {\n  Dev = 'Dev',\n  Public = 'Public',\n}\n\n/** @enumType */\nexport type DataStoreWithLiterals = DataStore | 'Dev' | 'Public';\n\nexport interface Initiator {\n  type?: TypeWithLiterals;\n}\n\nexport interface Identity {\n  /**\n   * User ID, when the request is initiated by a user\n   * @maxLength 36\n   */\n  userId?: string | null;\n  /**\n   * Member ID, when the request is initiated by a member\n   * @maxLength 36\n   */\n  memberId?: string | null;\n  /**\n   * Visitor ID, when the request is initiated by a visitor\n   * @maxLength 36\n   */\n  visitorId?: string | null;\n  /**\n   * External App ID, when the request is initiated by an external app\n   * @maxLength 36\n   */\n  externalAppId?: string | null;\n  /**\n   * Service ID, when the request is initiated by a service\n   * @maxLength 36\n   */\n  serviceId?: string | null;\n}\n\nexport interface Enrichment {\n  /** Struct that should be merged into the raw item. */\n  replace?: Record<string, any> | null;\n  /**\n   * Fields that should be removed from the raw item.\n   * @maxSize 1000\n   * @maxLength 1000\n   */\n  removeFields?: string[];\n}\n\nexport interface ChangesLost {\n  /** @maxLength 1024 */\n  clusterId?: string;\n}\n\nexport interface ReferenceChanged {\n  /**\n   * physical cluster ID\n   * @maxLength 1024\n   */\n  clusterId?: string;\n  /**\n   * physical source\n   * db.collection for MongoDB\n   * @maxLength 1024\n   */\n  source?: string;\n  /**\n   * instance ID\n   * @format GUID\n   */\n  tenantId?: string;\n  dataStore?: DataStoreWithLiterals;\n  /** @maxLength 1024 */\n  relationshipName?: string;\n  /** @maxLength 10000 */\n  leftId?: string;\n  /** @maxLength 10000 */\n  rightId?: string;\n  /** if reference is set or unset */\n  isRemoved?: boolean;\n  clusterTime?: Date | null;\n  /** ref created date */\n  createdAt?: Date | null;\n  /**\n   * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster.\n   * Two or more events can have same sequence number if they happened in the same transaction.\n   * Events in different clusters have independent sequence numbers and should not be compared.\n   */\n  seqNumber?: string;\n  /** Identity of the caller who initiated the reference change. */\n  writer?: Identity;\n}\n\nexport interface SegmentChanged {\n  /**\n   * physical cluster ID\n   * @maxLength 1024\n   */\n  clusterId?: string;\n  /**\n   * physical source\n   * db.collection for MongoDB\n   * @maxLength 1024\n   */\n  source?: string;\n  /**\n   * instance ID\n   * @format GUID\n   */\n  tenantId?: string;\n  /** segment */\n  dataStore?: DataStoreWithLiterals;\n  /**\n   * new db name if changed\n   * @maxLength 1024\n   */\n  newDatabase?: string | null;\n  /**\n   * new cluster if changed\n   * @maxLength 1024\n   */\n  newClusterId?: string | null;\n  /** read permissions if changed */\n  readsEnabled?: boolean | null;\n  /** write permissions if changed */\n  writesEnabled?: boolean | null;\n  /** event time */\n  clusterTime?: Date | null;\n  /**\n   * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster.\n   * Two or more events can have same sequence number if they happened in the same transaction.\n   * Events in different clusters have independent sequence numbers and should not be compared.\n   */\n  seqNumber?: string;\n}\n\nexport interface SegmentMigrationStarted {\n  /**\n   * physical cluster ID\n   * @maxLength 1024\n   */\n  clusterId?: string;\n  /**\n   * physical source\n   * db.collection for MongoDB\n   * @maxLength 1024\n   */\n  source?: string;\n  /**\n   * instance ID\n   * @format GUID\n   */\n  tenantId?: string;\n  /** segment */\n  dataStore?: DataStoreWithLiterals;\n  /**\n   * new db name if changed\n   * @maxLength 1024\n   */\n  newDatabase?: string;\n  /**\n   * new cluster if changed\n   * @maxLength 1024\n   */\n  newClusterId?: string;\n  /** event time */\n  clusterTime?: Date | null;\n  /**\n   * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster.\n   * Two or more events can have same sequence number if they happened in the same transaction.\n   * Events in different clusters have independent sequence numbers and should not be compared.\n   */\n  seqNumber?: string;\n}\n\nexport interface IgnoredSourceEvent {\n  /**\n   * physical cluster ID\n   * @maxLength 1024\n   */\n  clusterId?: string;\n  /**\n   * physical database name\n   * @minLength 1\n   * @maxLength 100\n   */\n  database?: string;\n  /**\n   * instance ID\n   * @format GUID\n   */\n  tenantId?: string;\n  /** segment */\n  dataStore?: DataStoreWithLiterals;\n  /** event action if ignored source should be added or removed */\n  action?: ActionWithLiterals;\n}\n\nexport enum Action {\n  Unknown = 'Unknown',\n  AddIgnoredSource = 'AddIgnoredSource',\n  RemoveIgnoredSource = 'RemoveIgnoredSource',\n}\n\n/** @enumType */\nexport type ActionWithLiterals =\n  | Action\n  | 'Unknown'\n  | 'AddIgnoredSource'\n  | 'RemoveIgnoredSource';\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface AccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\n/**\n * Retrieves the current data usage and resource limits for a site.\n *\n * By default, returns cached values. Set `consistentRead` to `true` to retrieve real-time values.\n * > **Note:** that using `consistentRead` results in a slower response and should only be used when near real-time accuracy is needed. For example, just before enforcing a resource limit.\n * @public\n * @permissionId WIX_DATA.SITE_DATA_USAGE_READ\n * @applicableIdentity APP\n * @fqn wix.cloud.data_usage.v1.SiteDataUsageService.GetSiteDataUsage\n */\nexport async function getSiteDataUsage(\n  options?: GetSiteDataUsageOptions\n): Promise<\n  NonNullablePaths<\n    GetSiteDataUsageResponse,\n    | `siteDataUsage.totalUsedLive.bytes`\n    | `siteDataUsage.totalUsedLive.items`\n    | `siteDataUsage.dataCollectionUsages`\n    | `siteDataUsage.dataCollectionUsages.${number}.dataCollectionId`\n    | `siteDataUsage.dataCollectionUsages.${number}.dataCollectionType`,\n    3\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    fields: options?.fields,\n    consistentRead: options?.consistentRead,\n  });\n\n  const reqOpts =\n    ambassadorWixCloudDataUsageV1SiteDataUsage.getSiteDataUsage(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          fields: '$[0].fields',\n          consistentRead: '$[0].consistentRead',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface GetSiteDataUsageOptions {\n  /**\n   * Fields to return in the response. If not provided, all fields are returned.\n   *\n   * Supported properties:\n   * `storageLimitInBytes`, `itemCountLimit`, `collectionCountLimit`, `collectionCount`,\n   * `totalUsedLive`, `totalUsedSandbox`, `dataCollectionUsages`\n   * @maxLength 1000\n   * @maxSize 1000\n   */\n  fields?: string[];\n  /**\n   * Whether to return real-time values instead of cached values.\n   *\n   * Setting this to `true` results in a slower response. Use only when near real-time accuracy\n   * is critical, such as just before enforcing a resource limit.\n   *\n   * Default: `false`\n   */\n  consistentRead?: boolean;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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\nconst TRANSFORM_PATHS_0 = [\n  { path: 'siteDataUsage.totalUsedLive.contentUpdatedDate' },\n  { path: 'siteDataUsage.totalUsedSandbox.contentUpdatedDate' },\n  {\n    path: 'siteDataUsage.dataCollectionUsages.totalUsedLive.contentUpdatedDate',\n  },\n  {\n    path: 'siteDataUsage.dataCollectionUsages.totalUsedSandbox.contentUpdatedDate',\n  },\n];\n\nfunction resolveWixCloudDataUsageV1SiteDataUsageServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/site-data-usage',\n        destPath: '',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/site-data-usage',\n        destPath: '',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/site-data-usage',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/site-data-usage',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/site-data-usage',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/site-data-usage',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/wix-data/v1/site-data-usage',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_data-site-usage-service_data';\n\n/**\n * Retrieves the current data usage and resource limits for a site.\n *\n * By default, returns cached values. Set `consistentRead` to `true` to retrieve real-time values.\n * > **Note:** that using `consistentRead` results in a slower response and should only be used when near real-time accuracy is needed. For example, just before enforcing a resource limit.\n */\nexport function getSiteDataUsage(payload: object): RequestOptionsFactory<any> {\n  function __getSiteDataUsage({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.cloud.data_usage.v1.site_data_usage',\n      method: 'GET' as any,\n      methodFqn:\n        'wix.cloud.data_usage.v1.SiteDataUsageService.GetSiteDataUsage',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixCloudDataUsageV1SiteDataUsageServiceUrl({\n        protoPath: '/v1/site-data-usage',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: TRANSFORM_PATHS_0,\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getSiteDataUsage;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  GetSiteDataUsageOptions,\n  GetSiteDataUsageResponse,\n  getSiteDataUsage as universalGetSiteDataUsage,\n} from './cloud-data-usage-v1-site-data-usage-data.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/data-site-usage-service' };\n\nexport function getSiteDataUsage(\n  httpClient: HttpClient\n): GetSiteDataUsageSignature {\n  return (options?: GetSiteDataUsageOptions) =>\n    universalGetSiteDataUsage(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetSiteDataUsageSignature {\n  /**\n   * Retrieves the current data usage and resource limits for a site.\n   *\n   * By default, returns cached values. Set `consistentRead` to `true` to retrieve real-time values.\n   * > **Note:** that using `consistentRead` results in a slower response and should only be used when near real-time accuracy is needed. For example, just before enforcing a resource limit.\n   */\n  (options?: GetSiteDataUsageOptions): Promise<\n    NonNullablePaths<\n      GetSiteDataUsageResponse,\n      | `siteDataUsage.totalUsedLive.bytes`\n      | `siteDataUsage.totalUsedLive.items`\n      | `siteDataUsage.dataCollectionUsages`\n      | `siteDataUsage.dataCollectionUsages.${number}.dataCollectionId`\n      | `siteDataUsage.dataCollectionUsages.${number}.dataCollectionType`,\n      3\n    >\n  >;\n}\n\nexport {\n  AccountInfo,\n  Action,\n  ActionEvent,\n  BulkUpdateUsagesRequest,\n  BulkUpdateUsagesResponse,\n  ChangesLost,\n  CollectionType,\n  CursorPaging,\n  CursorPagingMetadata,\n  Cursors,\n  DataChangeEvent,\n  DataChangeEventEventOneOf,\n  DataChanged,\n  DataChangedChangeOneOf,\n  DataCollectionUsage,\n  DataCollectionUsageUpdate,\n  DataStore,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  Empty,\n  Enrichment,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  GetSiteDataUsageOptions,\n  GetSiteDataUsageRequest,\n  GetSiteDataUsageResponse,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  Identity,\n  IgnoredSourceEvent,\n  Initiator,\n  InstanceUsageUpdate,\n  ListSiteDataUsagesRequest,\n  ListSiteDataUsagesResponse,\n  MessageEnvelope,\n  ReferenceChanged,\n  RestoreInfo,\n  Segment,\n  SegmentChanged,\n  SegmentMigrationStarted,\n  SiteDataUsage,\n  Type,\n  Usage,\n  WebhookIdentityType,\n} from './cloud-data-usage-v1-site-data-usage-data.universal.js';\n","import { getSiteDataUsage as publicGetSiteDataUsage } from './cloud-data-usage-v1-site-data-usage-data.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getSiteDataUsage: MaybeContext<\n  BuildRESTFunction<typeof publicGetSiteDataUsage> &\n    typeof publicGetSiteDataUsage\n> = /*#__PURE__*/ createRESTModule(publicGetSiteDataUsage);\n\nexport {\n  CollectionType,\n  Segment,\n  Type,\n  DataStore,\n  Action,\n  WebhookIdentityType,\n} from './cloud-data-usage-v1-site-data-usage-data.universal.js';\nexport {\n  SiteDataUsage,\n  Usage,\n  DataCollectionUsage,\n  GetSiteDataUsageRequest,\n  GetSiteDataUsageResponse,\n  ListSiteDataUsagesRequest,\n  CursorPaging,\n  ListSiteDataUsagesResponse,\n  CursorPagingMetadata,\n  Cursors,\n  BulkUpdateUsagesRequest,\n  DataCollectionUsageUpdate,\n  InstanceUsageUpdate,\n  BulkUpdateUsagesResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  Empty,\n  DataChangeEvent,\n  DataChangeEventEventOneOf,\n  DataChanged,\n  DataChangedChangeOneOf,\n  Initiator,\n  Identity,\n  Enrichment,\n  ChangesLost,\n  ReferenceChanged,\n  SegmentChanged,\n  SegmentMigrationStarted,\n  IgnoredSourceEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  GetSiteDataUsageOptions,\n} from './cloud-data-usage-v1-site-data-usage-data.universal.js';\nexport {\n  CollectionTypeWithLiterals,\n  SegmentWithLiterals,\n  TypeWithLiterals,\n  DataStoreWithLiterals,\n  ActionWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n} from './cloud-data-usage-v1-site-data-usage-data.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,iDAAiD;AAAA,EACzD,EAAE,MAAM,oDAAoD;AAAA,EAC5D;AAAA,IACE,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,MAAM;AAAA,EACR;AACF;AAEA,SAAS,kDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,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AAE,WAAW;AAAA,EACf;AACJ;;;ACjBA,SAAS,wBAAwB;AAG1B,IAAMC,oBAGK,iCAAiBA,iBAAsB;","names":["payload","CollectionType","Segment","Type","DataStore","Action","WebhookIdentityType","getSiteDataUsage","getSiteDataUsage","getSiteDataUsage"]}