import { NonNullablePaths } from '@wix/sdk-types'; /** Site-wide data resource limits and current usage, including storage, data item counts, and data collection counts. */ interface SiteDataUsage { /** * Maximum storage allowed for all native collections combined, in bytes. * * Storage usage is shared between the live and sandbox environments. For example, with a limit of * 1 GB, the live environment could use 700 MB and the sandbox 300 MB before the limit is reached. * * When this limit is reached, writes to collections fail. */ storageLimitInBytes?: string | null; /** * Maximum number of data items allowed per environment. * * This limit applies separately to the live and sandbox environments. For example, with a limit * of 1,000, both the live and sandbox environments can each contain 1,000 items independently. * * When this limit is reached in an environment, writes to collections in that environment fail. */ itemCountLimit?: string | null; /** Maximum number of native data collections allowed. */ collectionCountLimit?: number | null; /** Total number of native data collections. */ collectionCount?: number | null; /** Storage and item usage across all native collections in the live environment. */ totalUsedLive?: Usage; /** Storage and item usage across all native collections in the sandbox environment. */ totalUsedSandbox?: Usage; /** * Storage and item usage per native data collection. * @maxSize 1000 */ dataCollectionUsages?: DataCollectionUsage[]; } /** Storage and item usage. */ interface Usage { /** Storage used, in bytes. */ bytes?: string; /** Number of data items. */ items?: string; /** * Last time the content changed in this environment, meaning a data item was * inserted, updated, or deleted. * * Not returned when no content change has been recorded yet. */ contentUpdatedDate?: Date | null; } /** Storage and item usage for a single data collection. */ interface DataCollectionUsage { /** * Data collection ID. * @maxLength 256 */ dataCollectionId?: string; /** * Data collection display name. * @maxLength 1024 */ displayName?: string | null; /** Data collection type. Currently, only native collections are returned. */ dataCollectionType?: CollectionTypeWithLiterals; /** Storage and item usage in the live environment. */ totalUsedLive?: Usage; /** Storage and item usage in the sandbox environment. */ totalUsedSandbox?: Usage; } declare enum CollectionType { /** User-created collection. */ NATIVE = "NATIVE", /** [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). */ WIX_APP = "WIX_APP", /** Collection created by a Wix Blocks app. */ BLOCKS_APP = "BLOCKS_APP", /** Collection located in externally connected storage. */ EXTERNAL = "EXTERNAL" } /** @enumType */ type CollectionTypeWithLiterals = CollectionType | 'NATIVE' | 'WIX_APP' | 'BLOCKS_APP' | 'EXTERNAL'; interface GetSiteDataUsageRequest { /** * Fields to return in the response. If not provided, all fields are returned. * * Supported properties: * `storageLimitInBytes`, `itemCountLimit`, `collectionCountLimit`, `collectionCount`, * `totalUsedLive`, `totalUsedSandbox`, `dataCollectionUsages` * @maxLength 1000 * @maxSize 1000 */ fields?: string[]; /** * Whether to return real-time values instead of cached values. * * Setting this to `true` results in a slower response. Use only when near real-time accuracy * is critical, such as just before enforcing a resource limit. * * Default: `false` */ consistentRead?: boolean; } interface GetSiteDataUsageResponse { /** Retrieved site data usage. */ siteDataUsage?: SiteDataUsage; } interface ListSiteDataUsagesRequest { /** * Accepted for LIST-shape compatibility but ignored — the response always * contains the single entity for the call-scoped instance. */ paging?: CursorPaging; } interface CursorPaging { /** * Maximum number of items to return in the results. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface ListSiteDataUsagesResponse { /** Retrieved site data usage entities. */ siteDataUsages?: SiteDataUsage[]; /** Paging information. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in current page. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface BulkUpdateUsagesRequest { /** * Instance usage updates. * @maxSize 10000 */ updates?: InstanceUsageUpdate[]; } interface DataCollectionUsageUpdate { /** * Data collection ID. * @maxLength 256 */ dataCollectionId?: string; /** Whether to add the values to the existing usage (`true`) or replace the existing usage (`false`). */ relative?: boolean; /** Number of data items in the live environment. */ liveItemCount?: string | null; /** Number of data items in the sandbox environment. */ sandboxItemCount?: string | null; /** Storage used in the live environment, in bytes. */ liveUsedStorageInBytes?: string | null; /** Storage used in the sandbox environment, in bytes. */ sandboxUsedStorageInBytes?: string | null; /** * Last time content changed in the live environment. Applied only if it is later than the * currently stored value; never moves the stored timestamp backwards. */ liveContentUpdatedDate?: Date | null; /** * Last time content changed in the sandbox environment. Applied only if it is later than the * currently stored value; never moves the stored timestamp backwards. */ sandboxContentUpdatedDate?: Date | null; } declare enum Segment { /** Both live and sandbox environments. */ BOTH = "BOTH", /** Live environment. */ LIVE = "LIVE", /** Sandbox environment. */ SANDBOX = "SANDBOX" } /** @enumType */ type SegmentWithLiterals = Segment | 'BOTH' | 'LIVE' | 'SANDBOX'; /** Usage update for a single site instance. */ interface InstanceUsageUpdate { /** * Data instance ID. * @format GUID */ instanceId?: string; /** * Usage updates per data collection. * @maxSize 10000 */ collections?: DataCollectionUsageUpdate[]; /** * Whether all active collections for this instance are included in `collections`. * When `true`, collections not in `collections` are assumed to have zero usage in the specified segment. */ allCollectionsPresent?: boolean; /** Environment to update. */ segment?: SegmentWithLiterals; } interface BulkUpdateUsagesResponse { } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface Empty { } interface DataChangeEvent extends DataChangeEventEventOneOf { dataChanged?: DataChanged; /** resume point is lost so some changes may be lost */ changesLost?: ChangesLost; referenceChanged?: ReferenceChanged; /** segment access or mapping changed */ segmentChanged?: SegmentChanged; /** segment migration started to new physical location */ segmentMigrationStarted?: SegmentMigrationStarted; /** source should be added or removed from ignore list */ ignoredSource?: IgnoredSourceEvent; /** @maxLength 1024 */ idempotenceKey?: string; } /** @oneof */ interface DataChangeEventEventOneOf { dataChanged?: DataChanged; /** resume point is lost so some changes may be lost */ changesLost?: ChangesLost; referenceChanged?: ReferenceChanged; /** segment access or mapping changed */ segmentChanged?: SegmentChanged; /** segment migration started to new physical location */ segmentMigrationStarted?: SegmentMigrationStarted; /** source should be added or removed from ignore list */ ignoredSource?: IgnoredSourceEvent; } interface DataChanged extends DataChangedChangeOneOf { /** inserted document */ inserted?: Record | null; /** full replaced document */ replaced?: Record | null; /** partial update, removed fields are set to Empty */ partial?: Record | null; /** * deleted document ID * @maxLength 256 */ removedId?: string; /** * physical cluster ID * @maxLength 1024 */ clusterId?: string; /** * physical source * db.collection for MongoDB * @maxLength 1024 */ source?: string; /** * instance ID * @format GUID */ tenantId?: string; /** * logical collection name * @maxLength 256 */ collectionName?: string; dataStore?: DataStoreWithLiterals; /** @maxLength 256 */ documentId?: string; clusterTime?: Date | null; /** Initiator of the request */ initiator?: Initiator; /** Identity of the user who initiated the request */ writer?: Identity; /** * Contains changes that, when applied to raw item, will result in the item as it would look like * when returned from the data-items API. * This includes * * fully prefixed page link paths * * calculated draft-published status * * decrypted PII fields * * deleted schema fields (removed_fields) */ enrichment?: Enrichment; /** * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster. * Two or more events can have same sequence number if they happened in the same transaction. * Events in different clusters have independent sequence numbers and should not be compared. */ seqNumber?: string; /** * Raw item contents archived in the trashbin before deletion. * Populated for delete events when a matching trashbin entry is available. */ previousData?: Record | null; } /** @oneof */ interface DataChangedChangeOneOf { /** inserted document */ inserted?: Record | null; /** full replaced document */ replaced?: Record | null; /** partial update, removed fields are set to Empty */ partial?: Record | null; /** * deleted document ID * @maxLength 256 */ removedId?: string; } declare enum Type { /** Initiator is unknown */ Unknown = "Unknown", /** Indicated that write has been initiated by SSR indexer */ SsrIndexer = "SsrIndexer" } /** @enumType */ type TypeWithLiterals = Type | 'Unknown' | 'SsrIndexer'; declare enum DataStore { Dev = "Dev", Public = "Public" } /** @enumType */ type DataStoreWithLiterals = DataStore | 'Dev' | 'Public'; interface Initiator { type?: TypeWithLiterals; } interface Identity { /** * User ID, when the request is initiated by a user * @maxLength 36 */ userId?: string | null; /** * Member ID, when the request is initiated by a member * @maxLength 36 */ memberId?: string | null; /** * Visitor ID, when the request is initiated by a visitor * @maxLength 36 */ visitorId?: string | null; /** * External App ID, when the request is initiated by an external app * @maxLength 36 */ externalAppId?: string | null; /** * Service ID, when the request is initiated by a service * @maxLength 36 */ serviceId?: string | null; } interface Enrichment { /** Struct that should be merged into the raw item. */ replace?: Record | null; /** * Fields that should be removed from the raw item. * @maxSize 1000 * @maxLength 1000 */ removeFields?: string[]; } interface ChangesLost { /** @maxLength 1024 */ clusterId?: string; } interface ReferenceChanged { /** * physical cluster ID * @maxLength 1024 */ clusterId?: string; /** * physical source * db.collection for MongoDB * @maxLength 1024 */ source?: string; /** * instance ID * @format GUID */ tenantId?: string; dataStore?: DataStoreWithLiterals; /** @maxLength 1024 */ relationshipName?: string; /** @maxLength 10000 */ leftId?: string; /** @maxLength 10000 */ rightId?: string; /** if reference is set or unset */ isRemoved?: boolean; clusterTime?: Date | null; /** ref created date */ createdAt?: Date | null; /** * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster. * Two or more events can have same sequence number if they happened in the same transaction. * Events in different clusters have independent sequence numbers and should not be compared. */ seqNumber?: string; /** Identity of the caller who initiated the reference change. */ writer?: Identity; } interface SegmentChanged { /** * physical cluster ID * @maxLength 1024 */ clusterId?: string; /** * physical source * db.collection for MongoDB * @maxLength 1024 */ source?: string; /** * instance ID * @format GUID */ tenantId?: string; /** segment */ dataStore?: DataStoreWithLiterals; /** * new db name if changed * @maxLength 1024 */ newDatabase?: string | null; /** * new cluster if changed * @maxLength 1024 */ newClusterId?: string | null; /** read permissions if changed */ readsEnabled?: boolean | null; /** write permissions if changed */ writesEnabled?: boolean | null; /** event time */ clusterTime?: Date | null; /** * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster. * Two or more events can have same sequence number if they happened in the same transaction. * Events in different clusters have independent sequence numbers and should not be compared. */ seqNumber?: string; } interface SegmentMigrationStarted { /** * physical cluster ID * @maxLength 1024 */ clusterId?: string; /** * physical source * db.collection for MongoDB * @maxLength 1024 */ source?: string; /** * instance ID * @format GUID */ tenantId?: string; /** segment */ dataStore?: DataStoreWithLiterals; /** * new db name if changed * @maxLength 1024 */ newDatabase?: string; /** * new cluster if changed * @maxLength 1024 */ newClusterId?: string; /** event time */ clusterTime?: Date | null; /** * Sequence number. Event with higher sequence number happened after the event with lower sequence number in the same cluster. * Two or more events can have same sequence number if they happened in the same transaction. * Events in different clusters have independent sequence numbers and should not be compared. */ seqNumber?: string; } interface IgnoredSourceEvent { /** * physical cluster ID * @maxLength 1024 */ clusterId?: string; /** * physical database name * @minLength 1 * @maxLength 100 */ database?: string; /** * instance ID * @format GUID */ tenantId?: string; /** segment */ dataStore?: DataStoreWithLiterals; /** event action if ignored source should be added or removed */ action?: ActionWithLiterals; } declare enum Action { Unknown = "Unknown", AddIgnoredSource = "AddIgnoredSource", RemoveIgnoredSource = "RemoveIgnoredSource" } /** @enumType */ type ActionWithLiterals = Action | 'Unknown' | 'AddIgnoredSource' | 'RemoveIgnoredSource'; interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } /** * Retrieves the current data usage and resource limits for a site. * * By default, returns cached values. Set `consistentRead` to `true` to retrieve real-time values. * > **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. * @public * @permissionId WIX_DATA.SITE_DATA_USAGE_READ * @applicableIdentity APP * @fqn wix.cloud.data_usage.v1.SiteDataUsageService.GetSiteDataUsage */ declare function getSiteDataUsage(options?: GetSiteDataUsageOptions): Promise>; interface GetSiteDataUsageOptions { /** * Fields to return in the response. If not provided, all fields are returned. * * Supported properties: * `storageLimitInBytes`, `itemCountLimit`, `collectionCountLimit`, `collectionCount`, * `totalUsedLive`, `totalUsedSandbox`, `dataCollectionUsages` * @maxLength 1000 * @maxSize 1000 */ fields?: string[]; /** * Whether to return real-time values instead of cached values. * * Setting this to `true` results in a slower response. Use only when near real-time accuracy * is critical, such as just before enforcing a resource limit. * * Default: `false` */ consistentRead?: boolean; } export { type AccountInfo, Action, type ActionEvent, type ActionWithLiterals, type BulkUpdateUsagesRequest, type BulkUpdateUsagesResponse, type ChangesLost, CollectionType, type CollectionTypeWithLiterals, type CursorPaging, type CursorPagingMetadata, type Cursors, type DataChangeEvent, type DataChangeEventEventOneOf, type DataChanged, type DataChangedChangeOneOf, type DataCollectionUsage, type DataCollectionUsageUpdate, DataStore, type DataStoreWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type Enrichment, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetSiteDataUsageOptions, type GetSiteDataUsageRequest, type GetSiteDataUsageResponse, type IdentificationData, type IdentificationDataIdOneOf, type Identity, type IgnoredSourceEvent, type Initiator, type InstanceUsageUpdate, type ListSiteDataUsagesRequest, type ListSiteDataUsagesResponse, type MessageEnvelope, type ReferenceChanged, type RestoreInfo, Segment, type SegmentChanged, type SegmentMigrationStarted, type SegmentWithLiterals, type SiteDataUsage, Type, type TypeWithLiterals, type Usage, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getSiteDataUsage };