type HostModule = { __type: 'host'; create(host: H): T; }; type HostModuleAPI> = T extends HostModule ? U : never; type Host = { channel: { observeState(callback: (props: unknown, environment: Environment) => unknown): { disconnect: () => void; } | Promise<{ disconnect: () => void; }>; }; environment?: Environment; /** * Optional name of the environment, use for logging */ name?: string; /** * Optional bast url to use for API requests, for example `www.wixapis.com` */ apiBaseUrl?: string; /** * Possible data to be provided by every host, for cross cutting concerns * like internationalization, billing, etc. */ essentials?: { /** * The language of the currently viewed session */ language?: string; /** * The locale of the currently viewed session */ locale?: string; /** * Any headers that should be passed through to the API requests */ passThroughHeaders?: Record; }; }; type RESTFunctionDescriptor any = (...args: any[]) => any> = (httpClient: HttpClient) => T; interface HttpClient { request(req: RequestOptionsFactory): Promise>; fetchWithAuth: typeof fetch; wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise; getActiveToken?: () => string | undefined; } type RequestOptionsFactory = (context: any) => RequestOptions; type HttpResponse = { data: T; status: number; statusText: string; headers: any; request?: any; }; type RequestOptions<_TResponse = any, Data = any> = { method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'; url: string; data?: Data; params?: URLSearchParams; } & APIMetadata; type APIMetadata = { methodFqn?: string; entityFqdn?: string; packageName?: string; }; type BuildRESTFunction = T extends RESTFunctionDescriptor ? U : never; type EventDefinition = { __type: 'event-definition'; type: Type; isDomainEvent?: boolean; transformations?: (envelope: unknown) => Payload; __payload: Payload; }; declare function EventDefinition(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): () => EventDefinition; type EventHandler = (payload: T['__payload']) => void | Promise; type BuildEventDefinition> = (handler: EventHandler) => void; type ServicePluginMethodInput = { request: any; metadata: any; }; type ServicePluginContract = Record unknown | Promise>; type ServicePluginMethodMetadata = { name: string; primaryHttpMappingPath: string; transformations: { fromREST: (...args: unknown[]) => ServicePluginMethodInput; toREST: (...args: unknown[]) => unknown; }; }; type ServicePluginDefinition = { __type: 'service-plugin-definition'; componentType: string; methods: ServicePluginMethodMetadata[]; __contract: Contract; }; declare function ServicePluginDefinition(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition; type BuildServicePluginDefinition> = (implementation: T['__contract']) => void; declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error"; type RequestContext = { isSSR: boolean; host: string; protocol?: string; }; type ResponseTransformer = (data: any, headers?: any) => any; /** * Ambassador request options types are copied mostly from AxiosRequestConfig. * They are copied and not imported to reduce the amount of dependencies (to reduce install time). * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315 */ type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK'; type AmbassadorRequestOptions = { _?: T; url?: string; method?: Method; params?: any; data?: any; transformResponse?: ResponseTransformer | ResponseTransformer[]; }; type AmbassadorFactory = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions) & { __isAmbassador: boolean; }; type AmbassadorFunctionDescriptor = AmbassadorFactory; type BuildAmbassadorFunction = T extends AmbassadorFunctionDescriptor ? (req: Request) => Promise : never; declare global { // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. interface SymbolConstructor { readonly observable: symbol; } } declare const emptyObjectSymbol: unique symbol; /** Represents a strictly empty plain object, the `{}` value. When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)). @example ``` import type {EmptyObject} from 'type-fest'; // The following illustrates the problem with `{}`. const foo1: {} = {}; // Pass const foo2: {} = []; // Pass const foo3: {} = 42; // Pass const foo4: {} = {a: 1}; // Pass // With `EmptyObject` only the first case is valid. const bar1: EmptyObject = {}; // Pass const bar2: EmptyObject = 42; // Fail const bar3: EmptyObject = []; // Fail const bar4: EmptyObject = {a: 1}; // Fail ``` Unfortunately, `Record`, `Record` and `Record` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}. @category Object */ type EmptyObject = {[emptyObjectSymbol]?: never}; /** Returns a boolean for whether the two given types are equal. @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796 Use-cases: - If you want to make a conditional branch based on the result of a comparison of two types. @example ``` import type {IsEqual} from 'type-fest'; // This type returns a boolean for whether the given array includes the given item. // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal. type Includes = Value extends readonly [Value[0], ...infer rest] ? IsEqual extends true ? true : Includes : false; ``` @category Type Guard @category Utilities */ type IsEqual = (() => G extends A ? 1 : 2) extends (() => G extends B ? 1 : 2) ? true : false; /** Filter out keys from an object. Returns `never` if `Exclude` is strictly equal to `Key`. Returns `never` if `Key` extends `Exclude`. Returns `Key` otherwise. @example ``` type Filtered = Filter<'foo', 'foo'>; //=> never ``` @example ``` type Filtered = Filter<'bar', string>; //=> never ``` @example ``` type Filtered = Filter<'bar', 'foo'>; //=> 'bar' ``` @see {Except} */ type Filter = IsEqual extends true ? never : (KeyType extends ExcludeType ? never : KeyType); type ExceptOptions = { /** Disallow assigning non-specified properties. Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`. @default false */ requireExactProps?: boolean; }; /** Create a type from an object type without certain keys. We recommend setting the `requireExactProps` option to `true`. This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). @example ``` import type {Except} from 'type-fest'; type Foo = { a: number; b: string; }; type FooWithoutA = Except; //=> {b: string} const fooWithoutA: FooWithoutA = {a: 1, b: '2'}; //=> errors: 'a' does not exist in type '{ b: string; }' type FooWithoutB = Except; //=> {a: number} & Partial> const fooWithoutB: FooWithoutB = {a: 1, b: '2'}; //=> errors at 'b': Type 'string' is not assignable to type 'undefined'. ``` @category Object */ type Except = { [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; } & (Options['requireExactProps'] extends true ? Partial> : {}); /** Returns a boolean for whether the given type is `never`. @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919 @link https://stackoverflow.com/a/53984913/10292952 @link https://www.zhenghao.io/posts/ts-never Useful in type utilities, such as checking if something does not occur. @example ``` import type {IsNever, And} from 'type-fest'; // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts type AreStringsEqual = And< IsNever> extends true ? true : false, IsNever> extends true ? true : false >; type EndIfEqual = AreStringsEqual extends true ? never : void; function endIfEqual(input: I, output: O): EndIfEqual { if (input === output) { process.exit(0); } } endIfEqual('abc', 'abc'); //=> never endIfEqual('abc', '123'); //=> void ``` @category Type Guard @category Utilities */ type IsNever = [T] extends [never] ? true : false; /** An if-else-like type that resolves depending on whether the given type is `never`. @see {@link IsNever} @example ``` import type {IfNever} from 'type-fest'; type ShouldBeTrue = IfNever; //=> true type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>; //=> 'bar' ``` @category Type Guard @category Utilities */ type IfNever = ( IsNever extends true ? TypeIfNever : TypeIfNotNever ); /** Extract the keys from a type where the value type of the key extends the given `Condition`. Internally this is used for the `ConditionalPick` and `ConditionalExcept` types. @example ``` import type {ConditionalKeys} from 'type-fest'; interface Example { a: string; b: string | number; c?: string; d: {}; } type StringKeysOnly = ConditionalKeys; //=> 'a' ``` To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below. @example ``` import type {ConditionalKeys} from 'type-fest'; type StringKeysAndUndefined = ConditionalKeys; //=> 'a' | 'c' ``` @category Object */ type ConditionalKeys = { // Map through all the keys of the given base type. [Key in keyof Base]-?: // Pick only keys with types extending the given `Condition` type. Base[Key] extends Condition // Retain this key // If the value for the key extends never, only include it if `Condition` also extends never ? IfNever, Key> // Discard this key since the condition fails. : never; // Convert the produced object into a union type of the keys which passed the conditional test. }[keyof Base]; /** Exclude keys from a shape that matches the given `Condition`. This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties. @example ``` import type {Primitive, ConditionalExcept} from 'type-fest'; class Awesome { name: string; successes: number; failures: bigint; run() {} } type ExceptPrimitivesFromAwesome = ConditionalExcept; //=> {run: () => void} ``` @example ``` import type {ConditionalExcept} from 'type-fest'; interface Example { a: string; b: string | number; c: () => void; d: {}; } type NonStringKeysOnly = ConditionalExcept; //=> {b: string | number; c: () => void; d: {}} ``` @category Object */ type ConditionalExcept = Except< Base, ConditionalKeys >; /** * Descriptors are objects that describe the API of a module, and the module * can either be a REST module or a host module. * This type is recursive, so it can describe nested modules. */ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule | EventDefinition | ServicePluginDefinition | { [key: string]: Descriptors | PublicMetadata | any; }; /** * This type takes in a descriptors object of a certain Host (including an `unknown` host) * and returns an object with the same structure, but with all descriptors replaced with their API. * Any non-descriptor properties are removed from the returned object, including descriptors that * do not match the given host (as they will not work with the given host). */ type BuildDescriptors | undefined, Depth extends number = 5> = { done: T; recurse: T extends { __type: typeof SERVICE_PLUGIN_ERROR_TYPE; } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction : T extends RESTFunctionDescriptor ? BuildRESTFunction : T extends EventDefinition ? BuildEventDefinition : T extends ServicePluginDefinition ? BuildServicePluginDefinition : T extends HostModule ? HostModuleAPI : ConditionalExcept<{ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors : never; }, EmptyObject>; }[Depth extends -1 ? 'done' : 'recurse']; type PublicMetadata = { PACKAGE_NAME?: string; }; declare global { interface ContextualClient { } } /** * A type used to create concerete types from SDK descriptors in * case a contextual client is available. */ type MaybeContext = globalThis.ContextualClient extends { host: Host; } ? BuildDescriptors : T; /** * >**Notes:** * > + Site owners may set that members are not permitted to create groups in the Wix Groups application settings. * > + In this situation, site members have to submit a Create Request to create a new group. * > + Create Requests can be approved or rejected by an admin. * > + After a Create Request has been approved, the new group is added to the Group List in the Wix Groups app home page. * > + See [Introduction](https://dev.wix.com/api/rest/wix-groups/groups/introduction#wix-groups_groups_introduction_terminology) for more details. */ interface CreateRequest { /** * Create request ID * @readonly */ _id?: string | null; /** Group requested for creation. */ group?: Group; /** * Status of request. * - `PENDING` - Pending request. * - `APPROVED` - Approved request. * - `REJECTED` - Rejected request. * - `CANCELED` - Canceled request. */ status?: RequestStatus; /** Request details. */ requestDetails?: RequestDetails; } interface Group { /** * Group ID. * @readonly */ _id?: string | null; /** A unique part of a group's URL, for example `https:/example.com/groups/slug`. */ slug?: string | null; /** * __Deprecated.__ Use `privacyStatus` instead. * This property will be removed on June 30, 2022. * @deprecated */ privacyLevel?: PrivacyStatus; /** Group privacy status. */ privacyStatus?: PrivacyStatus; /** * __Deprecated.__ Use `name` instead. * This property will be removed on June 30, 2022. * @deprecated */ title?: string | null; /** Group name. */ name?: string | null; /** Group description in DraftJS format. */ description?: string | null; /** Group teaser. */ teaser?: string | null; /** * __Deprecated.__ * For `details.logo`, use `coverImage` instead. * For `details.membersTitle`, `memberTitle` instead. * This property will be removed on June 30, 2022. * @deprecated */ details?: GroupDetails; /** What group members are called, for example `Coworkers`, `Friends`, or `Students`. */ memberTitle?: string | null; /** Cover image. You cannot upload your own cover image. */ coverImage?: CoverImage; /** Group specific settings. Available to the site owners under `Admin Tools` in the dashboard. */ settings?: GroupSettings; /** * Total count of current group members. * @readonly */ membersCount?: number | null; /** * __Deprecated.__ Use `ownerId` instead. * This property will be removed on June 30, 2022. * @readonly * @deprecated */ createdBy?: Identity; /** * Group owner. * @readonly */ ownerId?: string | null; /** * Group creation date and time. * @readonly */ _createdDate?: Date | null; /** * Date and time of the latest group update. * @readonly */ _updatedDate?: Date | null; /** * __Deprecated.__ Use `lastActivityDate` instead. * This property will be removed on June 30, 2022. * @readonly * @deprecated */ recentActivityDate?: Date | null; /** * Date and time of the most recent group activity, for example a post or comment. * @readonly */ lastActivityDate?: Date | null; } declare enum Type { UNKNOWN = "UNKNOWN", ADMIN_APPROVAL = "ADMIN_APPROVAL", PAID_PLANS = "PAID_PLANS", EVENTS = "EVENTS" } interface Events { eventIds?: string[]; } interface Logo { /** Logo image ID (for internal use). */ mediaId?: string | null; /** Logo image width. */ width?: number | null; /** Logo image height. */ height?: number | null; } interface GroupDetailsPosition { /** horizontal coordinate */ x?: number; /** vertical coordinate */ y?: number; } interface Image { /** Image ID (for internal use). */ mediaId?: string | null; /** Image width. */ width?: number | null; /** Image height. */ height?: number | null; } interface Position { /** horizontal coordinate */ x?: number; /** vertical coordinate */ y?: number; } declare enum AllowPolicy { UNKNOWN = "UNKNOWN", OWNER_AND_ADMINS = "OWNER_AND_ADMINS", OWNER = "OWNER", ALL_MEMBERS = "ALL_MEMBERS" } interface OnboardingStepSettings { stepKey?: StepKey; visible?: boolean; } declare enum StepKey { UNKNOWN = "UNKNOWN", CREATE_POST = "CREATE_POST", REACT_TO_POST = "REACT_TO_POST", INVITE_MEMBERS = "INVITE_MEMBERS" } declare enum PrivacyStatus { /** Undefined group privacy status. */ UNKNOWN = "UNKNOWN", /** Anyone can see the group and its content. Anyone can join the group. */ PUBLIC = "PUBLIC", /** Anyone can see the group, but only members can see its content. New members must submit a `Join Group Request`. */ PRIVATE = "PRIVATE", /** Only admins and members can see the group. New members can only be added by other members. */ SECRET = "SECRET" } interface AccessRestriction extends AccessRestrictionDataOneOf { events?: Events; type?: Type; } /** @oneof */ interface AccessRestrictionDataOneOf { events?: Events; } interface GroupDetails { /** Group logo. You cannot upload your own logo. */ logo?: Logo; /** What group members are called, for example `Coworkers`, `Friends`, or `Students`. */ membersTitle?: string | null; } interface CoverImage { /** Cover image. */ image?: Image; /** Position of the corner of the cover image (or logo). */ position?: Position; /** Position of the corner of the cover image (or logo) for mobile browser. */ mobilePosition?: Position; } interface GroupSettings { /** * __Deprecated.__ Use `allowedToInviteMembers` instead. * Whether regular members are permitted to invite new members. * If `false`, only admins can invite members. Defaults to `true`. * @deprecated */ membersCanInvite?: boolean | null; /** * __Deprecated.__ Use `allowedToApproveJoinRequests` instead. * Whether all group members are permitted to approve join group requests. * If `false`, member approval is limited to the admins. * @deprecated */ membersCanApprove?: boolean | null; /** * __Deprecated.__ Use `welcomeMemberPostEnabled` instead. * This property will be removed on June 30, 2022. * @deprecated */ memberWelcomePostEnabled?: boolean | null; /** Whether a daily post about new members is enabled. */ welcomeMemberPostEnabled?: boolean | null; /** Whether an automatic post about changing the group details is enabled. */ groupDetailsChangedPostEnabled?: boolean | null; /** Whether all members can see the full member list. */ showMemberList?: boolean | null; } interface Identity { /** Member ID of the group creator. See [Members API](https://dev.wix.com/api/rest/members/members/about-wix-members) for more details. */ _id?: string | null; identityType?: IdentityType; } declare enum IdentityType { USER = "USER", MEMBER = "MEMBER" } declare enum RequestStatus { /** Undefined request status. */ UNKNOWN_STATUS = "UNKNOWN_STATUS", /** Pending group request. */ PENDING = "PENDING", /** Approved group request. */ APPROVED = "APPROVED", /** Rejected group request. */ REJECTED = "REJECTED", /** Cancelled group request. */ CANCELLED = "CANCELLED", /** Canceled group request. */ CANCELED = "CANCELED" } interface RequestDetails { /** Reason the request has been rejected. */ rejectionReason?: string | null; } interface SubmitCreateRequestRequest { /** Group submitted for creation. */ group?: Group; } interface SubmitCreateRequestResponse { /** Submitted Create Request. */ createRequest?: CreateRequest; } interface ApproveCreateRequestsRequest { /** Create Request IDs to approve. Limited to `100`. */ createRequestIds?: string[]; } declare enum ItemsToUpdate { /** Take into account only items which are listed in the request. */ BY_ID = "BY_ID", /** Update all items. */ ALL_ITEMS = "ALL_ITEMS" } interface ApproveCreateRequestsResponse { /** Approved Create Requests. */ createRequest?: CreateRequest[]; } interface CreateRequestApproved { /** Approved create request. */ createRequest?: CreateRequest; } interface RejectCreateRequestsRequest { /** Rejection data. */ rejections?: Rejection[]; } interface Rejection { /** ID of the Create Request to reject. */ createRequestId?: string; /** Rejection reason. Free text displayed to the creator of the rejected Create Request. Limited to 1,000 characters. */ reason?: string | null; } interface RejectCreateRequestsResponse { /** Rejected Create Requests. */ createRequest?: CreateRequest[]; } interface CreateRequestRejected { /** Rejected create request. */ createRequest?: CreateRequest; } interface CancelCreateRequestRequest { /** ID of the Create Request to cancel. */ createRequestId?: string; } interface CancelCreateRequestResponse { /** Canceled Create Request. */ createRequest?: CreateRequest; } interface ListCreateRequestsRequest { /** Number of items to load. Maximum `100`. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } declare enum OwnershipFilter { /** All items. */ ALL = "ALL", /** Items for the current site member. */ CURRENT_MEMBER = "CURRENT_MEMBER" } interface ListCreateRequestsResponse { /** Create Requests. */ createRequests?: CreateRequest[]; metadata?: PagingMetadata; } interface PagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; } interface QueryCreateRequestsRequest { query?: Query; } interface Query { /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: any; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */ fields?: string[]; /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */ fieldsets?: string[]; } interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface QueryCreateRequestsResponse { /** Retrieved Create Requests. */ createRequests?: CreateRequest[]; metadata?: PagingMetadata; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ 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. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface EventsNonNullableFields { eventIds: string[]; } interface AccessRestrictionNonNullableFields { events?: EventsNonNullableFields; type: Type; } interface GroupDetailsPositionNonNullableFields { x: number; y: number; } interface GroupDetailsNonNullableFields { logoPosition?: GroupDetailsPositionNonNullableFields; mobileLogoPosition?: GroupDetailsPositionNonNullableFields; } interface PositionNonNullableFields { x: number; y: number; } interface CoverImageNonNullableFields { position?: PositionNonNullableFields; mobilePosition?: PositionNonNullableFields; } interface OnboardingStepSettingsNonNullableFields { stepKey: StepKey; visible: boolean; } interface GroupSettingsNonNullableFields { allowedToInviteMembers: AllowPolicy; allowedToApproveJoinRequests: AllowPolicy; allowedToAddMembers: AllowPolicy; allowedToCreatePosts: AllowPolicy; allowedToCommentPosts: AllowPolicy; onboardingStepsSettings: OnboardingStepSettingsNonNullableFields[]; } interface IdentityNonNullableFields { identityType: IdentityType; } interface GroupNonNullableFields { privacyLevel: PrivacyStatus; privacyStatus: PrivacyStatus; accessRestriction?: AccessRestrictionNonNullableFields; details?: GroupDetailsNonNullableFields; coverImage?: CoverImageNonNullableFields; settings?: GroupSettingsNonNullableFields; createdBy?: IdentityNonNullableFields; } interface CreateRequestNonNullableFields { group?: GroupNonNullableFields; status: RequestStatus; } interface ApproveCreateRequestsResponseNonNullableFields { createRequest: CreateRequestNonNullableFields[]; } interface RejectCreateRequestsResponseNonNullableFields { createRequest: CreateRequestNonNullableFields[]; } interface ListCreateRequestsResponseNonNullableFields { createRequests: CreateRequestNonNullableFields[]; } interface QueryCreateRequestsResponseNonNullableFields { createRequests: CreateRequestNonNullableFields[]; } interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } interface EventMetadata extends BaseEventMetadata { /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } interface CreateRequestApprovedEnvelope { data: CreateRequestApproved; metadata: EventMetadata; } interface CreateRequestRejectedEnvelope { data: CreateRequestRejected; metadata: EventMetadata; } interface ApproveCreateRequestsOptions { /** Create Request IDs to approve. Limited to `100`. */ createRequestIds?: string[]; } interface RejectCreateRequestsOptions { /** Rejection data. */ rejections?: Rejection[]; } interface ListCreateRequestsOptions { /** Number of items to load. Maximum `100`. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface QueryCreateRequestsOptions { query?: Query; } declare function approveCreateRequests$1(httpClient: HttpClient): ApproveCreateRequestsSignature; interface ApproveCreateRequestsSignature { /** * Approves Create Requests. * Only admins can approve Create Requests. */ (options?: ApproveCreateRequestsOptions | undefined): Promise; } declare function rejectCreateRequests$1(httpClient: HttpClient): RejectCreateRequestsSignature; interface RejectCreateRequestsSignature { /** * Rejects Create Requests. * Only admins can reject Create Requests. */ (options?: RejectCreateRequestsOptions | undefined): Promise; } declare function listCreateRequests$1(httpClient: HttpClient): ListCreateRequestsSignature; interface ListCreateRequestsSignature { /** * Lists create requests across the site. */ (options?: ListCreateRequestsOptions | undefined): Promise; } declare function queryCreateRequests$1(httpClient: HttpClient): QueryCreateRequestsSignature; interface QueryCreateRequestsSignature { /** * Retrieves a list of create requests across the site. * * Supported fields for filtering: * - `status` * * Supported fields for sorting: * - `createdDate` */ (options?: QueryCreateRequestsOptions | undefined): Promise; } declare const onCreateRequestApproved$1: EventDefinition; declare const onCreateRequestRejected$1: EventDefinition; declare function createEventModule>(eventDefinition: T): BuildEventDefinition & T; declare const approveCreateRequests: MaybeContext & typeof approveCreateRequests$1>; declare const rejectCreateRequests: MaybeContext & typeof rejectCreateRequests$1>; declare const listCreateRequests: MaybeContext & typeof listCreateRequests$1>; declare const queryCreateRequests: MaybeContext & typeof queryCreateRequests$1>; type _publicOnCreateRequestApprovedType = typeof onCreateRequestApproved$1; /** * Triggered when a Create Request is approved. */ declare const onCreateRequestApproved: ReturnType>; type _publicOnCreateRequestRejectedType = typeof onCreateRequestRejected$1; /** * Triggered when a Create Request is rejected. */ declare const onCreateRequestRejected: ReturnType>; export { type AccessRestriction, type AccessRestrictionDataOneOf, type ActionEvent, AllowPolicy, type ApproveCreateRequestsOptions, type ApproveCreateRequestsRequest, type ApproveCreateRequestsResponse, type ApproveCreateRequestsResponseNonNullableFields, type BaseEventMetadata, type CancelCreateRequestRequest, type CancelCreateRequestResponse, type CoverImage, type CreateRequest, type CreateRequestApproved, type CreateRequestApprovedEnvelope, type CreateRequestRejected, type CreateRequestRejectedEnvelope, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Events, type Group, type GroupDetails, type GroupDetailsPosition, type GroupSettings, type IdentificationData, type IdentificationDataIdOneOf, type Identity, IdentityType, type Image, ItemsToUpdate, type ListCreateRequestsOptions, type ListCreateRequestsRequest, type ListCreateRequestsResponse, type ListCreateRequestsResponseNonNullableFields, type Logo, type MessageEnvelope, type OnboardingStepSettings, OwnershipFilter, type Paging, type PagingMetadata, type Position, PrivacyStatus, type Query, type QueryCreateRequestsOptions, type QueryCreateRequestsRequest, type QueryCreateRequestsResponse, type QueryCreateRequestsResponseNonNullableFields, type RejectCreateRequestsOptions, type RejectCreateRequestsRequest, type RejectCreateRequestsResponse, type RejectCreateRequestsResponseNonNullableFields, type Rejection, type RequestDetails, RequestStatus, type RestoreInfo, SortOrder, type Sorting, StepKey, type SubmitCreateRequestRequest, type SubmitCreateRequestResponse, Type, WebhookIdentityType, type _publicOnCreateRequestApprovedType, type _publicOnCreateRequestRejectedType, approveCreateRequests, listCreateRequests, onCreateRequestApproved, onCreateRequestRejected, onCreateRequestApproved$1 as publicOnCreateRequestApproved, onCreateRequestRejected$1 as publicOnCreateRequestRejected, queryCreateRequests, rejectCreateRequests };