type Primitive = number | string | boolean | bigint | symbol | null | undefined; type Tags = Record; type Context = Record; type Contexts = Record; interface SpanContextData { traceId: string; spanId: string; } interface Span { spanContext(): SpanContextData; end(): void; } interface ManualSpan { end(): void; fail(error: unknown): void; } interface SpanOptions { name: string; tags?: Tags; } interface EndSpanOptions { name: string; } interface Breadcrumb { type?: string; category?: string; message: string; level?: 'info' | 'warning' | 'error'; data?: Record; } interface CaptureContext { level?: 'info' | 'warning' | 'error'; tags?: Tags; contexts?: Contexts; } interface MonitoringClient { /** * Captures an exception event and sends it to Sentry. * @param error The error to capture * @param captureContext Optional additional data to attach to the Sentry e vent. */ captureException(error: unknown, captureContext?: CaptureContext): void; /** * Captures a message event and sends it to Sentry. * @param message The message to capture * @param captureContext Define the level of the message or pass in additional data to attach to the message. */ captureMessage(message: string, captureContext?: CaptureContext): void; /** * Wraps a function with a span and finishes the span after the function is done. The created span is the active span and will be used as parent by other spans created inside the function, as long as the function is executed while the scope is active. * @param spanOptions The options for the span * @param callback The function to wrap with a span * @returns The return value of the callback */ startSpan(spanOptions: SpanOptions, callback: (span: Span | undefined) => T): T; /** * Starts a manual span. The span needs to be finished manually by either calling end() or fail() using the returned span object or by calling endSpanManual(). * @param spanOptions The options for the span * @returns A span object that allows to end the span successfully or fail it. */ startSpanManual(spanOptions: SpanOptions): ManualSpan; /** * Ends a manual span and sends it to Sentry. Spans can be ended using a MonitoringClient instance which wasn't necessarily used to start the span. * Calling this method will end the last span with the same name that was started using startSpanManual() and will ignore the others. * @param spanOptions The options for the span */ endSpanManual(spanOptions: EndSpanOptions): void; /** * Records a new breadcrumb which will be attached to future events. * Breadcrumbs will be added to subsequent events to provide more context on user's actions prior to an error or crash. * @param breadcrumb The breadcrumb to record. */ addBreadcrumb(breadcrumb: Breadcrumb): void; } 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}; /** Extract all optional keys from the given type. This is useful when you want to create a new type that contains different type values for the optional keys only. @example ``` import type {OptionalKeysOf, Except} from 'type-fest'; interface User { name: string; surname: string; luckyNumber?: number; } const REMOVE_FIELD = Symbol('remove field symbol'); type UpdateOperation = Except, OptionalKeysOf> & { [Key in OptionalKeysOf]?: Entity[Key] | typeof REMOVE_FIELD; }; const update1: UpdateOperation = { name: 'Alice' }; const update2: UpdateOperation = { name: 'Bob', luckyNumber: REMOVE_FIELD }; ``` @category Utilities */ type OptionalKeysOf = BaseType extends unknown // For distributing `BaseType` ? (keyof { [Key in keyof BaseType as BaseType extends Record ? never : Key]: never }) & (keyof BaseType) // Intersect with `keyof BaseType` to ensure result of `OptionalKeysOf` is always assignable to `keyof BaseType` : never; // Should never happen /** Extract all required keys from the given type. This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc... @example ``` import type {RequiredKeysOf} from 'type-fest'; declare function createValidation = RequiredKeysOf>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn; interface User { name: string; surname: string; luckyNumber?: number; } const validator1 = createValidation('name', value => value.length < 25); const validator2 = createValidation('surname', value => value.length < 25); ``` @category Utilities */ type RequiredKeysOf = BaseType extends unknown // For distributing `BaseType` ? Exclude> : never; // Should never happen /** 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 ); // Can eventually be replaced with the built-in once this library supports // TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848 type NoInfer = T extends infer U ? U : never; /** Returns a boolean for whether the given type is `any`. @link https://stackoverflow.com/a/49928360/1490091 Useful in type utilities, such as disallowing `any`s to be passed to a function. @example ``` import type {IsAny} from 'type-fest'; const typedObject = {a: 1, b: 2} as const; const anyObject: any = {a: 1, b: 2}; function get extends true ? {} : Record), K extends keyof O = keyof O>(obj: O, key: K) { return obj[key]; } const typedA = get(typedObject, 'a'); //=> 1 const anyA = get(anyObject, 'a'); //=> any ``` @category Type Guard @category Utilities */ type IsAny = 0 extends 1 & NoInfer ? true : false; /** 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 & G | G ? 1 : 2) extends (() => G extends B & G | G ? 1 : 2) ? true : false; /** Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. @example ``` import type {Simplify} from 'type-fest'; type PositionProps = { top: number; left: number; }; type SizeProps = { width: number; height: number; }; // In your editor, hovering over `Props` will show a flattened object with all the properties. type Props = Simplify; ``` Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface. If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify` if you can't re-declare the `value`. @example ``` import type {Simplify} from 'type-fest'; interface SomeInterface { foo: number; bar?: string; baz: number | undefined; } type SomeType = { foo: number; bar?: string; baz: number | undefined; }; const literal = {foo: 123, bar: 'hello', baz: 456}; const someType: SomeType = literal; const someInterface: SomeInterface = literal; function fn(object: Record): void {} fn(literal); // Good: literal object type is sealed fn(someType); // Good: type is sealed fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened fn(someInterface as Simplify); // Good: transform an `interface` into a `type` ``` @link https://github.com/microsoft/TypeScript/issues/15300 @see SimplifyDeep @category Object */ type Simplify = {[KeyType in keyof T]: T[KeyType]} & {}; /** Omit any index signatures from the given object type, leaving only explicitly defined properties. This is the counterpart of `PickIndexSignature`. Use-cases: - Remove overly permissive signatures from third-party types. This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747). It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`. (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.) ``` const indexed: Record = {}; // Allowed const keyed: Record<'foo', unknown> = {}; // Error // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar ``` Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another: ``` type Indexed = {} extends Record ? '✅ `{}` is assignable to `Record`' : '❌ `{}` is NOT assignable to `Record`'; // => '✅ `{}` is assignable to `Record`' type Keyed = {} extends Record<'foo' | 'bar', unknown> ? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`" : "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"; // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`" ``` Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`... ``` import type {OmitIndexSignature} from 'type-fest'; type OmitIndexSignature = { [KeyType in keyof ObjectType // Map each key of `ObjectType`... ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature == Foo`. }; ``` ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record`)... ``` import type {OmitIndexSignature} from 'type-fest'; type OmitIndexSignature = { [KeyType in keyof ObjectType // Is `{}` assignable to `Record`? as {} extends Record ? ... // ✅ `{}` is assignable to `Record` : ... // ❌ `{}` is NOT assignable to `Record` ]: ObjectType[KeyType]; }; ``` If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it. @example ``` import type {OmitIndexSignature} from 'type-fest'; interface Example { // These index signatures will be removed. [x: string]: any [x: number]: any [x: symbol]: any [x: `head-${string}`]: string [x: `${string}-tail`]: string [x: `head-${string}-tail`]: string [x: `${bigint}`]: string [x: `embedded-${number}`]: string // These explicitly defined keys will remain. foo: 'bar'; qux?: 'baz'; } type ExampleWithoutIndexSignatures = OmitIndexSignature; // => { foo: 'bar'; qux?: 'baz' | undefined; } ``` @see PickIndexSignature @category Object */ type OmitIndexSignature = { [KeyType in keyof ObjectType as {} extends Record ? never : KeyType]: ObjectType[KeyType]; }; /** Pick only index signatures from the given object type, leaving out all explicitly defined properties. This is the counterpart of `OmitIndexSignature`. @example ``` import type {PickIndexSignature} from 'type-fest'; declare const symbolKey: unique symbol; type Example = { // These index signatures will remain. [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; [x: `head-${string}`]: string; [x: `${string}-tail`]: string; [x: `head-${string}-tail`]: string; [x: `${bigint}`]: string; [x: `embedded-${number}`]: string; // These explicitly defined keys will be removed. ['kebab-case-key']: string; [symbolKey]: string; foo: 'bar'; qux?: 'baz'; }; type ExampleIndexSignature = PickIndexSignature; // { // [x: string]: unknown; // [x: number]: unknown; // [x: symbol]: unknown; // [x: `head-${string}`]: string; // [x: `${string}-tail`]: string; // [x: `head-${string}-tail`]: string; // [x: `${bigint}`]: string; // [x: `embedded-${number}`]: string; // } ``` @see OmitIndexSignature @category Object */ type PickIndexSignature = { [KeyType in keyof ObjectType as {} extends Record ? KeyType : never]: ObjectType[KeyType]; }; // Merges two objects without worrying about index signatures. type SimpleMerge = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source; /** Merge two types into a new type. Keys of the second type overrides keys of the first type. @example ``` import type {Merge} from 'type-fest'; interface Foo { [x: string]: unknown; [x: number]: unknown; foo: string; bar: symbol; } type Bar = { [x: number]: number; [x: symbol]: unknown; bar: Date; baz: boolean; }; export type FooBar = Merge; // => { // [x: string]: unknown; // [x: number]: number; // [x: symbol]: unknown; // foo: string; // bar: Date; // baz: boolean; // } ``` @category Object */ type Merge = Simplify< SimpleMerge, PickIndexSignature> & SimpleMerge, OmitIndexSignature> >; /** An if-else-like type that resolves depending on whether the given type is `any`. @see {@link IsAny} @example ``` import type {IfAny} from 'type-fest'; type ShouldBeTrue = IfAny; //=> true type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>; //=> 'bar' ``` @category Type Guard @category Utilities */ type IfAny = ( IsAny extends true ? TypeIfAny : TypeIfNotAny ); /** Merges user specified options with default options. @example ``` type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; type SpecifiedOptions = {leavesOnly: true}; type Result = ApplyDefaultOptions; //=> {maxRecursionDepth: 10; leavesOnly: true} ``` @example ``` // Complains if default values are not provided for optional options type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10}; type SpecifiedOptions = {}; type Result = ApplyDefaultOptions; // ~~~~~~~~~~~~~~~~~~~ // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'. ``` @example ``` // Complains if an option's default type does not conform to the expected type type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'}; type SpecifiedOptions = {}; type Result = ApplyDefaultOptions; // ~~~~~~~~~~~~~~~~~~~ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. ``` @example ``` // Complains if an option's specified type does not conform to the expected type type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; type SpecifiedOptions = {leavesOnly: 'yes'}; type Result = ApplyDefaultOptions; // ~~~~~~~~~~~~~~~~ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. ``` */ type ApplyDefaultOptions< Options extends object, Defaults extends Simplify, RequiredKeysOf> & Partial, never>>>, SpecifiedOptions extends Options, > = IfAny ? Extract extends never ? Key : never : Key ]: SpecifiedOptions[Key] }> & Required> // `& Required` ensures that `ApplyDefaultOptions` is always assignable to `Required` >>; /** 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; }; type DefaultExceptOptions = { requireExactProps: false; }; /** 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'. // The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures. // Consider the following example: type UserData = { [metadata: string]: string; email: string; name: string; role: 'admin' | 'user'; }; // `Omit` clearly doesn't behave as expected in this case: type PostPayload = Omit; //=> type PostPayload = { [x: string]: string; [x: number]: string; } // In situations like this, `Except` works better. // It simply removes the `email` key while preserving all the other keys. type PostPayload = Except; //=> type PostPayload = { [x: string]: string; name: string; role: 'admin' | 'user'; } ``` @category Object */ type Except = _Except>; type _Except> = { [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; } & (Options['requireExactProps'] extends true ? Partial> : {}); /** 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 >; 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; /** * Optional function to get a monitoring client */ getMonitoringClient?: () => MonitoringClient; /** * 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 HTTPMethod = 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'; 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: HTTPMethod; 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; /** * 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; declare global { /** * A global interface to set the exposure toggle for the SDK. * @example * ```ts * declare global { * interface SDKExposureToggle { * alpha: true; * } * } */ interface SDKExposureToggle { } } declare global { /** * A global interface to set the type mode for the SDK. * @example * ```ts * declare global { * interface SDKTypeMode { * strict: true; * } * } */ interface SDKTypeMode { } } /** ReviewRequest is the main entity of ReviewRequests */ interface ReviewRequest extends ReviewRequestStatusOptionsOneOf { /** Options for sent status */ sentOptions?: SentOptions; /** Options for failed status */ failedOptions?: FailedOptions; /** * Review request ID. * @readonly */ _id?: string | null; /** * Represents the current state of an item. Each time the item is modified, its `revision` changes by the server. for an update operation to succeed, you MUST pass the latest revision. * @readonly */ revision?: string | null; /** * Represents the time this review request was created. * @readonly */ _createdDate?: Date | null; /** * Represents the time this review request was last updated. * @readonly */ _updatedDate?: Date | null; /** Represents the time this review request to be sent. */ sendDate?: Date | null; /** Namespace of app integrated with reviews. */ namespace?: string; /** Details the order for which the review request is made. */ order?: Order; /** List of items relevant to the review request. */ items?: Item[]; /** Recipient of review request. */ recipient?: Recipient; /** Indicates notification channel of review request */ communicationChannel?: CommunicationChannel; /** * Indicates status of review request. * @readonly */ status?: ReviewRequestStatus; /** * The ID of the automation activation. * It is used to track and update the status of the review request. */ automationActivationId?: string | null; /** * Requester of the review request * @readonly */ requestedBy?: IdentificationData; } /** @oneof */ interface ReviewRequestStatusOptionsOneOf { /** Options for sent status */ sentOptions?: SentOptions; /** Options for failed status */ failedOptions?: FailedOptions; } interface Order { /** Order ID. */ _id?: string; /** * Order number. * @readonly */ number?: string | null; } /** Item to review */ interface Item { /** * ID of the item within its catalog, corresponding to: * + `product.id` for [Stores](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores). */ catalogItemId?: string; /** ID of the review created for this item by the review request recipient. */ reviewId?: string | null; } /** Entity for which review request was created */ interface Recipient { /** Contact id of recipient */ contactId?: string; } declare enum CommunicationChannel { UNKNOWN_COMMUNICATION_CHANNEL = "UNKNOWN_COMMUNICATION_CHANNEL", EMAIL = "EMAIL" } declare enum ReviewRequestStatus { /** Indicates unknown status of review request. */ UNKNOWN_REVIEW_REQUEST_STATUS = "UNKNOWN_REVIEW_REQUEST_STATUS", /** Indicates review request was scheduled. */ SCHEDULED = "SCHEDULED", /** Indicates review request was canceled. */ CANCELED = "CANCELED", /** Indicates review request failed. */ FAILED = "FAILED", /** Indicates review request was sent. */ SENT = "SENT" } interface SentOptions { /** Indicates if the review request was opened by the recipient. */ opened?: boolean; } interface FailedOptions { /** Reason for review request failure. */ reason?: FailureReason; /** Error message for review request failure. */ message?: string | null; } declare enum FailureReason { /** Unknown reason for review request failure. */ UNKNOWN_FAILURE_REASON = "UNKNOWN_FAILURE_REASON", /** Review request failed due to failure in activation flow. */ ACTIVATION_FAILED = "ACTIVATION_FAILED", /** Email bounced when sent to a recipient. */ BOUNCED = "BOUNCED", /** Review request failed due to inactive subscription. */ SUBSCRIPTION_INACTIVE = "SUBSCRIPTION_INACTIVE" } interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app.s */ appId?: string; /** * Identity type * @readonly */ identityType?: IdentityType; } /** @oneof */ interface IdentificationDataIdOneOf { /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app.s */ appId?: string; } declare enum IdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } interface CreateReviewRequestRequest { /** ReviewRequest to be created */ reviewRequest: ReviewRequest; } interface CreateReviewRequestResponse { /** The created ReviewRequest */ reviewRequest?: ReviewRequest; } interface GetReviewRequestRequest { /** Id of the ReviewRequest to retrieve */ reviewRequestId: string; } interface GetReviewRequestResponse { /** The retrieved ReviewRequest */ reviewRequest?: ReviewRequest; } interface DeleteReviewRequestRequest { /** Id of the ReviewRequest to delete */ reviewRequestId: string; } interface DeleteReviewRequestResponse { } interface QueryReviewRequestsRequest { /** WQL expression */ query: CursorQuery; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * 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?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; } /** @oneof */ interface CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } interface CursorPaging { /** Maximum number of items to return in the results. */ 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. */ cursor?: string | null; } interface QueryReviewRequestsResponse { /** The retrieved ReviewRequests */ reviewRequests?: ReviewRequest[]; /** Paging metadata */ pagingMetadata?: CursorPagingMetadata; } /** This is the preferred message for cursor-paging enabled services */ interface CursorPagingMetadata { /** Number of items returned in the response. */ 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. */ next?: string | null; /** Cursor pointing to the previous page in the list of results. */ prev?: string | null; } interface CountReviewRequestsByFilterRequest { /** * 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?: Record | null; } interface CountReviewRequestsByFilterResponse { /** Number of review requests that meet the specified criteria. */ count?: number; } interface BulkCancelReviewRequestsByFilterRequest { /** * 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?: Record | null; } interface BulkCancelReviewRequestsByFilterResponse { /** Bulk job ID. The job's status can be retrieved with Get Bulk Job or List Bulk Jobs. */ jobId?: string; } 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?: WebhooksIdentificationData; /** Stringify payload. */ data?: string; } interface WebhooksIdentificationData extends WebhooksIdentificationDataIdOneOf { /** 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 WebhooksIdentificationDataIdOneOf { /** 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 SentOptionsNonNullableFields { opened: boolean; } interface FailedOptionsNonNullableFields { reason: FailureReason; } interface OrderNonNullableFields { _id: string; } interface ItemNonNullableFields { catalogItemId: string; } interface RecipientNonNullableFields { contactId: string; } interface IdentificationDataNonNullableFields { anonymousVisitorId: string; memberId: string; wixUserId: string; appId: string; identityType: IdentityType; } interface ReviewRequestNonNullableFields { sentOptions?: SentOptionsNonNullableFields; failedOptions?: FailedOptionsNonNullableFields; namespace: string; order?: OrderNonNullableFields; items: ItemNonNullableFields[]; recipient?: RecipientNonNullableFields; communicationChannel: CommunicationChannel; status: ReviewRequestStatus; requestedBy?: IdentificationDataNonNullableFields; } interface CreateReviewRequestResponseNonNullableFields { reviewRequest?: ReviewRequestNonNullableFields; } interface GetReviewRequestResponseNonNullableFields { reviewRequest?: ReviewRequestNonNullableFields; } interface QueryReviewRequestsResponseNonNullableFields { reviewRequests: ReviewRequestNonNullableFields[]; } interface CountReviewRequestsByFilterResponseNonNullableFields { count: number; } interface BulkCancelReviewRequestsByFilterResponseNonNullableFields { jobId: string; } interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: WebhooksIdentificationData; } 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 ReviewRequestCreatedEnvelope { entity: ReviewRequest; metadata: EventMetadata; } interface ReviewRequestDeletedEnvelope { entity: ReviewRequest; metadata: EventMetadata; } interface ReviewRequestUpdatedEnvelope { entity: ReviewRequest; metadata: EventMetadata; } interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface ReviewRequestsQueryResult extends QueryCursorResult { items: ReviewRequest[]; query: ReviewRequestsQueryBuilder; next: () => Promise; prev: () => Promise; } interface ReviewRequestsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | '_createdDate' | 'sendDate' | 'namespace' | 'order.id' | 'items.catalogItemId' | 'items.reviewId' | 'recipient.contactId' | 'communicationChannel' | 'status' | 'automationActivationId' | 'requestedBy.wixUserId' | 'requestedBy.appId' | 'requestedBy.identityType', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | '_createdDate' | 'sendDate' | 'namespace' | 'order.id' | 'items.catalogItemId' | 'items.reviewId' | 'recipient.contactId' | 'communicationChannel' | 'status' | 'automationActivationId' | 'requestedBy.wixUserId' | 'requestedBy.appId' | 'requestedBy.identityType', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ge: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ gt: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ le: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ lt: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | '_createdDate' | 'sendDate' | 'namespace' | 'order.id' | 'items.catalogItemId' | 'items.reviewId' | 'recipient.contactId' | 'communicationChannel' | 'status' | 'automationActivationId' | 'requestedBy.wixUserId' | 'requestedBy.appId' | 'requestedBy.identityType', value: any) => ReviewRequestsQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: 'order.id' | 'items.reviewId' | 'automationActivationId', value: boolean) => ReviewRequestsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_createdDate' | 'sendDate' | 'status'>) => ReviewRequestsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'_createdDate' | 'sendDate' | 'status'>) => ReviewRequestsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => ReviewRequestsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => ReviewRequestsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } interface CountReviewRequestsByFilterOptions { /** * 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?: Record | null; } interface BulkCancelReviewRequestsByFilterOptions { /** * 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?: Record | null; } declare function createReviewRequest$1(httpClient: HttpClient): CreateReviewRequestSignature; interface CreateReviewRequestSignature { /** * Creates a new review request. * * This method allows to create requests for customer reviews. * * Each request must include: * - The recipient's contact ID. * - The preferred communication channel. * - Either the Order ID or item IDs being reviewed. * * Review requests depend on the [Wix eCommerce platform's](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction#about-the-wix-ecommerce-api) * Order and Catalog. The corresponding order or catalog item must exist within Wix eCommerce before a review request can be created. * * When providing an Order ID, you can optionally specify individual items from that order to be included in the review request. * If no items are specified, the 5 most expensive items from the order will be automatically populated in the request. * Alternatively, you can choose to provide only item IDs from the catalog for review. * * The Review Requests functionality is exclusively available within the `stores` reviews namespace. * @param - ReviewRequest to be created * @returns The created ReviewRequest */ (reviewRequest: ReviewRequest): Promise; } declare function getReviewRequest$1(httpClient: HttpClient): GetReviewRequestSignature; interface GetReviewRequestSignature { /** * Retrieves a specific review request by its ID. * @param - Id of the ReviewRequest to retrieve * @returns The retrieved ReviewRequest */ (reviewRequestId: string): Promise; } declare function deleteReviewRequest$1(httpClient: HttpClient): DeleteReviewRequestSignature; interface DeleteReviewRequestSignature { /** * Deletes an existing review request. * * This method allows you to remove a specific review request from the system using its unique ID. * This operation is only permitted for review requests that are in the `CANCELED` state. * @param - Id of the ReviewRequest to delete */ (reviewRequestId: string): Promise; } declare function queryReviewRequests$1(httpClient: HttpClient): QueryReviewRequestsSignature; interface QueryReviewRequestsSignature { /** * Queries Review Requests that meet specified criteria. * * This method enables the search through review requests based on specific criteria, leveraging the [Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */ (): ReviewRequestsQueryBuilder; } declare function countReviewRequestsByFilter$1(httpClient: HttpClient): CountReviewRequestsByFilterSignature; interface CountReviewRequestsByFilterSignature { /** * Counts Review Requests that meet specified criteria. * * This method enables the count review requests based on specific criteria, leveraging the [Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) filter. */ (options?: CountReviewRequestsByFilterOptions | undefined): Promise; } declare function bulkCancelReviewRequestsByFilter$1(httpClient: HttpClient): BulkCancelReviewRequestsByFilterSignature; interface BulkCancelReviewRequestsByFilterSignature { /** * Cancels multiple review requests that meet specified criteria. * * All scheduled review requests with automation activation id that meet the specified `filter` criteria are canceled. * To perform a dry run, use the intended filter options with * [Query Review Requests](https://dev.wix.com/docs/rest/crm/community/reviews/review-request/query-review-requests). * * When this endpoint is used, a bulk job is started and the job ID is returned. * The job might not complete right away, depending on its size. * The job's status can be retrieved with * [Get Async Job](https://dev.wix.com/docs/rest/business-management/async-job/get-async-job) or * [List Async Job Items](https://dev.wix.com/docs/rest/business-management/async-job/list-async-job-items). */ (options?: BulkCancelReviewRequestsByFilterOptions | undefined): Promise; } declare const onReviewRequestCreated$1: EventDefinition; declare const onReviewRequestDeleted$1: EventDefinition; declare const onReviewRequestUpdated$1: EventDefinition; declare function createEventModule>(eventDefinition: T): BuildEventDefinition & T; declare const createReviewRequest: MaybeContext & typeof createReviewRequest$1>; declare const getReviewRequest: MaybeContext & typeof getReviewRequest$1>; declare const deleteReviewRequest: MaybeContext & typeof deleteReviewRequest$1>; declare const queryReviewRequests: MaybeContext & typeof queryReviewRequests$1>; declare const countReviewRequestsByFilter: MaybeContext & typeof countReviewRequestsByFilter$1>; declare const bulkCancelReviewRequestsByFilter: MaybeContext & typeof bulkCancelReviewRequestsByFilter$1>; type _publicOnReviewRequestCreatedType = typeof onReviewRequestCreated$1; /** */ declare const onReviewRequestCreated: ReturnType>; type _publicOnReviewRequestDeletedType = typeof onReviewRequestDeleted$1; /** */ declare const onReviewRequestDeleted: ReturnType>; type _publicOnReviewRequestUpdatedType = typeof onReviewRequestUpdated$1; /** */ declare const onReviewRequestUpdated: ReturnType>; type context_ActionEvent = ActionEvent; type context_BaseEventMetadata = BaseEventMetadata; type context_BulkCancelReviewRequestsByFilterOptions = BulkCancelReviewRequestsByFilterOptions; type context_BulkCancelReviewRequestsByFilterRequest = BulkCancelReviewRequestsByFilterRequest; type context_BulkCancelReviewRequestsByFilterResponse = BulkCancelReviewRequestsByFilterResponse; type context_BulkCancelReviewRequestsByFilterResponseNonNullableFields = BulkCancelReviewRequestsByFilterResponseNonNullableFields; type context_CommunicationChannel = CommunicationChannel; declare const context_CommunicationChannel: typeof CommunicationChannel; type context_CountReviewRequestsByFilterOptions = CountReviewRequestsByFilterOptions; type context_CountReviewRequestsByFilterRequest = CountReviewRequestsByFilterRequest; type context_CountReviewRequestsByFilterResponse = CountReviewRequestsByFilterResponse; type context_CountReviewRequestsByFilterResponseNonNullableFields = CountReviewRequestsByFilterResponseNonNullableFields; type context_CreateReviewRequestRequest = CreateReviewRequestRequest; type context_CreateReviewRequestResponse = CreateReviewRequestResponse; type context_CreateReviewRequestResponseNonNullableFields = CreateReviewRequestResponseNonNullableFields; type context_CursorPaging = CursorPaging; type context_CursorPagingMetadata = CursorPagingMetadata; type context_CursorQuery = CursorQuery; type context_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf; type context_Cursors = Cursors; type context_DeleteReviewRequestRequest = DeleteReviewRequestRequest; type context_DeleteReviewRequestResponse = DeleteReviewRequestResponse; type context_DomainEvent = DomainEvent; type context_DomainEventBodyOneOf = DomainEventBodyOneOf; type context_EntityCreatedEvent = EntityCreatedEvent; type context_EntityDeletedEvent = EntityDeletedEvent; type context_EntityUpdatedEvent = EntityUpdatedEvent; type context_EventMetadata = EventMetadata; type context_ExtendedFields = ExtendedFields; type context_FailedOptions = FailedOptions; type context_FailureReason = FailureReason; declare const context_FailureReason: typeof FailureReason; type context_GetReviewRequestRequest = GetReviewRequestRequest; type context_GetReviewRequestResponse = GetReviewRequestResponse; type context_GetReviewRequestResponseNonNullableFields = GetReviewRequestResponseNonNullableFields; type context_IdentificationData = IdentificationData; type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf; type context_IdentityType = IdentityType; declare const context_IdentityType: typeof IdentityType; type context_Item = Item; type context_MessageEnvelope = MessageEnvelope; type context_Order = Order; type context_QueryReviewRequestsRequest = QueryReviewRequestsRequest; type context_QueryReviewRequestsResponse = QueryReviewRequestsResponse; type context_QueryReviewRequestsResponseNonNullableFields = QueryReviewRequestsResponseNonNullableFields; type context_Recipient = Recipient; type context_RestoreInfo = RestoreInfo; type context_ReviewRequest = ReviewRequest; type context_ReviewRequestCreatedEnvelope = ReviewRequestCreatedEnvelope; type context_ReviewRequestDeletedEnvelope = ReviewRequestDeletedEnvelope; type context_ReviewRequestNonNullableFields = ReviewRequestNonNullableFields; type context_ReviewRequestStatus = ReviewRequestStatus; declare const context_ReviewRequestStatus: typeof ReviewRequestStatus; type context_ReviewRequestStatusOptionsOneOf = ReviewRequestStatusOptionsOneOf; type context_ReviewRequestUpdatedEnvelope = ReviewRequestUpdatedEnvelope; type context_ReviewRequestsQueryBuilder = ReviewRequestsQueryBuilder; type context_ReviewRequestsQueryResult = ReviewRequestsQueryResult; type context_SentOptions = SentOptions; type context_SortOrder = SortOrder; declare const context_SortOrder: typeof SortOrder; type context_Sorting = Sorting; type context_WebhookIdentityType = WebhookIdentityType; declare const context_WebhookIdentityType: typeof WebhookIdentityType; type context_WebhooksIdentificationData = WebhooksIdentificationData; type context_WebhooksIdentificationDataIdOneOf = WebhooksIdentificationDataIdOneOf; type context__publicOnReviewRequestCreatedType = _publicOnReviewRequestCreatedType; type context__publicOnReviewRequestDeletedType = _publicOnReviewRequestDeletedType; type context__publicOnReviewRequestUpdatedType = _publicOnReviewRequestUpdatedType; declare const context_bulkCancelReviewRequestsByFilter: typeof bulkCancelReviewRequestsByFilter; declare const context_countReviewRequestsByFilter: typeof countReviewRequestsByFilter; declare const context_createReviewRequest: typeof createReviewRequest; declare const context_deleteReviewRequest: typeof deleteReviewRequest; declare const context_getReviewRequest: typeof getReviewRequest; declare const context_onReviewRequestCreated: typeof onReviewRequestCreated; declare const context_onReviewRequestDeleted: typeof onReviewRequestDeleted; declare const context_onReviewRequestUpdated: typeof onReviewRequestUpdated; declare const context_queryReviewRequests: typeof queryReviewRequests; declare namespace context { export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_BulkCancelReviewRequestsByFilterOptions as BulkCancelReviewRequestsByFilterOptions, type context_BulkCancelReviewRequestsByFilterRequest as BulkCancelReviewRequestsByFilterRequest, type context_BulkCancelReviewRequestsByFilterResponse as BulkCancelReviewRequestsByFilterResponse, type context_BulkCancelReviewRequestsByFilterResponseNonNullableFields as BulkCancelReviewRequestsByFilterResponseNonNullableFields, context_CommunicationChannel as CommunicationChannel, type context_CountReviewRequestsByFilterOptions as CountReviewRequestsByFilterOptions, type context_CountReviewRequestsByFilterRequest as CountReviewRequestsByFilterRequest, type context_CountReviewRequestsByFilterResponse as CountReviewRequestsByFilterResponse, type context_CountReviewRequestsByFilterResponseNonNullableFields as CountReviewRequestsByFilterResponseNonNullableFields, type context_CreateReviewRequestRequest as CreateReviewRequestRequest, type context_CreateReviewRequestResponse as CreateReviewRequestResponse, type context_CreateReviewRequestResponseNonNullableFields as CreateReviewRequestResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_CursorQuery as CursorQuery, type context_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context_Cursors as Cursors, type context_DeleteReviewRequestRequest as DeleteReviewRequestRequest, type context_DeleteReviewRequestResponse as DeleteReviewRequestResponse, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_ExtendedFields as ExtendedFields, type context_FailedOptions as FailedOptions, context_FailureReason as FailureReason, type context_GetReviewRequestRequest as GetReviewRequestRequest, type context_GetReviewRequestResponse as GetReviewRequestResponse, type context_GetReviewRequestResponseNonNullableFields as GetReviewRequestResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_IdentityType as IdentityType, type context_Item as Item, type context_MessageEnvelope as MessageEnvelope, type context_Order as Order, type context_QueryReviewRequestsRequest as QueryReviewRequestsRequest, type context_QueryReviewRequestsResponse as QueryReviewRequestsResponse, type context_QueryReviewRequestsResponseNonNullableFields as QueryReviewRequestsResponseNonNullableFields, type context_Recipient as Recipient, type context_RestoreInfo as RestoreInfo, type context_ReviewRequest as ReviewRequest, type context_ReviewRequestCreatedEnvelope as ReviewRequestCreatedEnvelope, type context_ReviewRequestDeletedEnvelope as ReviewRequestDeletedEnvelope, type context_ReviewRequestNonNullableFields as ReviewRequestNonNullableFields, context_ReviewRequestStatus as ReviewRequestStatus, type context_ReviewRequestStatusOptionsOneOf as ReviewRequestStatusOptionsOneOf, type context_ReviewRequestUpdatedEnvelope as ReviewRequestUpdatedEnvelope, type context_ReviewRequestsQueryBuilder as ReviewRequestsQueryBuilder, type context_ReviewRequestsQueryResult as ReviewRequestsQueryResult, type context_SentOptions as SentOptions, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_WebhookIdentityType as WebhookIdentityType, type context_WebhooksIdentificationData as WebhooksIdentificationData, type context_WebhooksIdentificationDataIdOneOf as WebhooksIdentificationDataIdOneOf, type context__publicOnReviewRequestCreatedType as _publicOnReviewRequestCreatedType, type context__publicOnReviewRequestDeletedType as _publicOnReviewRequestDeletedType, type context__publicOnReviewRequestUpdatedType as _publicOnReviewRequestUpdatedType, context_bulkCancelReviewRequestsByFilter as bulkCancelReviewRequestsByFilter, context_countReviewRequestsByFilter as countReviewRequestsByFilter, context_createReviewRequest as createReviewRequest, context_deleteReviewRequest as deleteReviewRequest, context_getReviewRequest as getReviewRequest, context_onReviewRequestCreated as onReviewRequestCreated, context_onReviewRequestDeleted as onReviewRequestDeleted, context_onReviewRequestUpdated as onReviewRequestUpdated, onReviewRequestCreated$1 as publicOnReviewRequestCreated, onReviewRequestDeleted$1 as publicOnReviewRequestDeleted, onReviewRequestUpdated$1 as publicOnReviewRequestUpdated, context_queryReviewRequests as queryReviewRequests }; } export { context as reviews };