import { NonNullablePaths } from '@wix/sdk-types'; interface Secret { /** * Unique secret ID. * @readonly * @format GUID */ _id?: string | null; /** * A unique, human-friendly name for the secret. Use it to retrieve the secret value with Get Secret Value. * * **Note:** You can use alphanumeric characters and the following special characters: `_+=-@#$`. Spaces are not supported. * @maxLength 50 */ name?: string | null; /** * Optional text describing the secret's purpose or any other notes about it. * @maxLength 200 */ description?: string | null; /** * The encrypted confidential value. * @minLength 1 * @maxLength 3500 */ value?: string | null; /** * Date and time when the secret was created. * @readonly */ _createdDate?: Date | null; /** * Date and time when the secret was updated. * @readonly */ _updatedDate?: Date | null; } interface GetSecretValueRequest { /** Secret name. */ name: string; } interface GetSecretValueResponse { /** The confidential value to protect, such as an API key. */ value?: string; } interface ListSecretInfoRequest { } interface ListSecretInfoResponse { /** A list of secrets with encrypted values. */ secrets?: Secret[]; } interface CreateSecretRequest { /** Details of a secret. */ secret: Secret; } interface CreateSecretResponse { /** Unique secret ID. */ _id?: string; } interface DeleteSecretRequest { /** * ID of the secret to delete. * @format GUID */ _id: string; } interface DeleteSecretResponse { } interface UpdateSecretRequest { /** * ID of the secret to update. * @format GUID */ _id: string; /** Details of a secret. */ secret: Secret; } interface UpdateSecretResponse { } 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 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; } interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** 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; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface SecretCreatedEnvelope { entity: Secret; metadata: EventMetadata; } /** * Triggered when a secret is created. * @webhook * @eventType wix.velo.secrets_vault.v1.secret_created * @serviceIdentifier wix.velo.secrets_vault.v1.SecretsVaultService * @slug created */ declare function onSecretCreated(handler: (event: SecretCreatedEnvelope) => void | Promise): void; interface SecretDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when a secret is deleted. * @webhook * @eventType wix.velo.secrets_vault.v1.secret_deleted * @serviceIdentifier wix.velo.secrets_vault.v1.SecretsVaultService * @slug deleted */ declare function onSecretDeleted(handler: (event: SecretDeletedEnvelope) => void | Promise): void; interface SecretUpdatedEnvelope { entity: Secret; metadata: EventMetadata; } /** * Triggered when a secret is updated. * @webhook * @eventType wix.velo.secrets_vault.v1.secret_updated * @serviceIdentifier wix.velo.secrets_vault.v1.SecretsVaultService * @slug updated */ declare function onSecretUpdated(handler: (event: SecretUpdatedEnvelope) => void | Promise): void; /** * Retrieves a secret value by name. * *
* __Caution:__ * Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk. *
* @public * @requiredField name * @param name - The name of the secret to get the value of. * @permissionId SECRETS_VAULT.SECRET_READ * @applicableIdentity APP * @fqn wix.velo.secrets_vault.v1.SecretsVaultService.GetSecretValue */ declare function getSecretValue(name: string): Promise>; /** * Retrieves a list of secrets. * * > **Note:** This method doesn't return the secret's value for security reasons. To retrieve the value, call [Get Secret Value](https://dev.wix.com/docs/rest/business-management/secrets/get-secret-value). * @public * @permissionId SECRETS_VAULT.SECRET_METADATA_READ * @applicableIdentity APP * @fqn wix.velo.secrets_vault.v1.SecretsVaultService.ListSecretInfo */ declare function listSecretInfo(): Promise>; /** * Creates a secret. * @public * @requiredField secret * @requiredField secret.name * @requiredField secret.value * @param secret - Fields of a new secret. * @permissionId SECRETS_VAULT.SECRET_CREATE * @applicableIdentity APP * @returns Unique secret ID. * @fqn wix.velo.secrets_vault.v1.SecretsVaultService.CreateSecret */ declare function createSecret(secret: NonNullablePaths): Promise; /** * Deletes a secret. * *
* Warning: * Deleting a secret is irreversible and will break all code using the secret. *
* @public * @requiredField _id * @param _id - The unique ID of the secret to be deleted. * @permissionId SECRETS_VAULT.SECRET_DELETE * @applicableIdentity APP * @fqn wix.velo.secrets_vault.v1.SecretsVaultService.DeleteSecret */ declare function deleteSecret(_id: string): Promise; /** * Updates 1 or all fields of a secret. * * To get the secret ID, call [List Secret Info](https://dev.wix.com/docs/rest/business-management/secrets/list-secret-info). * @param _id - ID of the secret to update. * @param secret - Details of a secret. * @public * @requiredField _id * @requiredField secret * @permissionId SECRETS_VAULT.SECRET_UPDATE * @applicableIdentity APP * @fqn wix.velo.secrets_vault.v1.SecretsVaultService.PartiallyUpdateSecret */ declare function updateSecret(_id: string, secret: Secret): Promise; export { type AccountInfo, type ActionEvent, type BaseEventMetadata, type CreateSecretRequest, type CreateSecretResponse, type DeleteSecretRequest, type DeleteSecretResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetSecretValueRequest, type GetSecretValueResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListSecretInfoRequest, type ListSecretInfoResponse, type MessageEnvelope, type RestoreInfo, type Secret, type SecretCreatedEnvelope, type SecretDeletedEnvelope, type SecretUpdatedEnvelope, type UpdateSecretRequest, type UpdateSecretResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createSecret, deleteSecret, getSecretValue, listSecretInfo, onSecretCreated, onSecretDeleted, onSecretUpdated, updateSecret };