@wix/app-management 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es/package.json +3 -0
- package/meta/package.json +1 -5
- package/package.json +38 -21
- package/service-plugins/package.json +1 -5
- package/context/package.json +0 -7
- package/service-plugins/context/package.json +0 -7
- package/type-bundles/context.bundle.d.ts +0 -1834
- package/type-bundles/index.bundle.d.ts +0 -1834
- package/type-bundles/meta.bundle.d.ts +0 -1565
- package/type-bundles/service-plugins-context.bundle.d.ts +0 -424
- package/type-bundles/service-plugins.bundle.d.ts +0 -424
|
@@ -1,1834 +0,0 @@
|
|
|
1
|
-
type HostModule<T, H extends Host> = {
|
|
2
|
-
__type: 'host';
|
|
3
|
-
create(host: H): T;
|
|
4
|
-
};
|
|
5
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
-
type Host<Environment = unknown> = {
|
|
7
|
-
channel: {
|
|
8
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
|
-
disconnect: () => void;
|
|
10
|
-
} | Promise<{
|
|
11
|
-
disconnect: () => void;
|
|
12
|
-
}>;
|
|
13
|
-
};
|
|
14
|
-
environment?: Environment;
|
|
15
|
-
/**
|
|
16
|
-
* Optional name of the environment, use for logging
|
|
17
|
-
*/
|
|
18
|
-
name?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
21
|
-
*/
|
|
22
|
-
apiBaseUrl?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Possible data to be provided by every host, for cross cutting concerns
|
|
25
|
-
* like internationalization, billing, etc.
|
|
26
|
-
*/
|
|
27
|
-
essentials?: {
|
|
28
|
-
/**
|
|
29
|
-
* The language of the currently viewed session
|
|
30
|
-
*/
|
|
31
|
-
language?: string;
|
|
32
|
-
/**
|
|
33
|
-
* The locale of the currently viewed session
|
|
34
|
-
*/
|
|
35
|
-
locale?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Any headers that should be passed through to the API requests
|
|
38
|
-
*/
|
|
39
|
-
passThroughHeaders?: Record<string, string>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
44
|
-
interface HttpClient {
|
|
45
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
46
|
-
fetchWithAuth: typeof fetch;
|
|
47
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
48
|
-
getActiveToken?: () => string | undefined;
|
|
49
|
-
}
|
|
50
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
51
|
-
type HttpResponse<T = any> = {
|
|
52
|
-
data: T;
|
|
53
|
-
status: number;
|
|
54
|
-
statusText: string;
|
|
55
|
-
headers: any;
|
|
56
|
-
request?: any;
|
|
57
|
-
};
|
|
58
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
59
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
60
|
-
url: string;
|
|
61
|
-
data?: Data;
|
|
62
|
-
params?: URLSearchParams;
|
|
63
|
-
} & APIMetadata;
|
|
64
|
-
type APIMetadata = {
|
|
65
|
-
methodFqn?: string;
|
|
66
|
-
entityFqdn?: string;
|
|
67
|
-
packageName?: string;
|
|
68
|
-
};
|
|
69
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
70
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
71
|
-
__type: 'event-definition';
|
|
72
|
-
type: Type;
|
|
73
|
-
isDomainEvent?: boolean;
|
|
74
|
-
transformations?: (envelope: unknown) => Payload;
|
|
75
|
-
__payload: Payload;
|
|
76
|
-
};
|
|
77
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
78
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
79
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
80
|
-
|
|
81
|
-
type ServicePluginMethodInput = {
|
|
82
|
-
request: any;
|
|
83
|
-
metadata: any;
|
|
84
|
-
};
|
|
85
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
86
|
-
type ServicePluginMethodMetadata = {
|
|
87
|
-
name: string;
|
|
88
|
-
primaryHttpMappingPath: string;
|
|
89
|
-
transformations: {
|
|
90
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
91
|
-
toREST: (...args: unknown[]) => unknown;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
95
|
-
__type: 'service-plugin-definition';
|
|
96
|
-
componentType: string;
|
|
97
|
-
methods: ServicePluginMethodMetadata[];
|
|
98
|
-
__contract: Contract;
|
|
99
|
-
};
|
|
100
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
101
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
102
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
103
|
-
|
|
104
|
-
type RequestContext = {
|
|
105
|
-
isSSR: boolean;
|
|
106
|
-
host: string;
|
|
107
|
-
protocol?: string;
|
|
108
|
-
};
|
|
109
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
110
|
-
/**
|
|
111
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
112
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
113
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
114
|
-
*/
|
|
115
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
116
|
-
type AmbassadorRequestOptions<T = any> = {
|
|
117
|
-
_?: T;
|
|
118
|
-
url?: string;
|
|
119
|
-
method?: Method;
|
|
120
|
-
params?: any;
|
|
121
|
-
data?: any;
|
|
122
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
123
|
-
};
|
|
124
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
125
|
-
__isAmbassador: boolean;
|
|
126
|
-
};
|
|
127
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
128
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
129
|
-
|
|
130
|
-
declare global {
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
132
|
-
interface SymbolConstructor {
|
|
133
|
-
readonly observable: symbol;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
141
|
-
|
|
142
|
-
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)).
|
|
143
|
-
|
|
144
|
-
@example
|
|
145
|
-
```
|
|
146
|
-
import type {EmptyObject} from 'type-fest';
|
|
147
|
-
|
|
148
|
-
// The following illustrates the problem with `{}`.
|
|
149
|
-
const foo1: {} = {}; // Pass
|
|
150
|
-
const foo2: {} = []; // Pass
|
|
151
|
-
const foo3: {} = 42; // Pass
|
|
152
|
-
const foo4: {} = {a: 1}; // Pass
|
|
153
|
-
|
|
154
|
-
// With `EmptyObject` only the first case is valid.
|
|
155
|
-
const bar1: EmptyObject = {}; // Pass
|
|
156
|
-
const bar2: EmptyObject = 42; // Fail
|
|
157
|
-
const bar3: EmptyObject = []; // Fail
|
|
158
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
162
|
-
|
|
163
|
-
@category Object
|
|
164
|
-
*/
|
|
165
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
Returns a boolean for whether the two given types are equal.
|
|
169
|
-
|
|
170
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
171
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
172
|
-
|
|
173
|
-
Use-cases:
|
|
174
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
175
|
-
|
|
176
|
-
@example
|
|
177
|
-
```
|
|
178
|
-
import type {IsEqual} from 'type-fest';
|
|
179
|
-
|
|
180
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
181
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
182
|
-
type Includes<Value extends readonly any[], Item> =
|
|
183
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
184
|
-
? IsEqual<Value[0], Item> extends true
|
|
185
|
-
? true
|
|
186
|
-
: Includes<rest, Item>
|
|
187
|
-
: false;
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
@category Type Guard
|
|
191
|
-
@category Utilities
|
|
192
|
-
*/
|
|
193
|
-
type IsEqual<A, B> =
|
|
194
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
195
|
-
(<G>() => G extends B ? 1 : 2)
|
|
196
|
-
? true
|
|
197
|
-
: false;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
Filter out keys from an object.
|
|
201
|
-
|
|
202
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
203
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
204
|
-
Returns `Key` otherwise.
|
|
205
|
-
|
|
206
|
-
@example
|
|
207
|
-
```
|
|
208
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
209
|
-
//=> never
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
@example
|
|
213
|
-
```
|
|
214
|
-
type Filtered = Filter<'bar', string>;
|
|
215
|
-
//=> never
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
@example
|
|
219
|
-
```
|
|
220
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
221
|
-
//=> 'bar'
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
@see {Except}
|
|
225
|
-
*/
|
|
226
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
227
|
-
|
|
228
|
-
type ExceptOptions = {
|
|
229
|
-
/**
|
|
230
|
-
Disallow assigning non-specified properties.
|
|
231
|
-
|
|
232
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
233
|
-
|
|
234
|
-
@default false
|
|
235
|
-
*/
|
|
236
|
-
requireExactProps?: boolean;
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
Create a type from an object type without certain keys.
|
|
241
|
-
|
|
242
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
243
|
-
|
|
244
|
-
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.
|
|
245
|
-
|
|
246
|
-
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)).
|
|
247
|
-
|
|
248
|
-
@example
|
|
249
|
-
```
|
|
250
|
-
import type {Except} from 'type-fest';
|
|
251
|
-
|
|
252
|
-
type Foo = {
|
|
253
|
-
a: number;
|
|
254
|
-
b: string;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
258
|
-
//=> {b: string}
|
|
259
|
-
|
|
260
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
261
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
262
|
-
|
|
263
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
264
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
265
|
-
|
|
266
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
267
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
@category Object
|
|
271
|
-
*/
|
|
272
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
273
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
274
|
-
} & (Options['requireExactProps'] extends true
|
|
275
|
-
? Partial<Record<KeysType, never>>
|
|
276
|
-
: {});
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
Returns a boolean for whether the given type is `never`.
|
|
280
|
-
|
|
281
|
-
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
282
|
-
@link https://stackoverflow.com/a/53984913/10292952
|
|
283
|
-
@link https://www.zhenghao.io/posts/ts-never
|
|
284
|
-
|
|
285
|
-
Useful in type utilities, such as checking if something does not occur.
|
|
286
|
-
|
|
287
|
-
@example
|
|
288
|
-
```
|
|
289
|
-
import type {IsNever, And} from 'type-fest';
|
|
290
|
-
|
|
291
|
-
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
292
|
-
type AreStringsEqual<A extends string, B extends string> =
|
|
293
|
-
And<
|
|
294
|
-
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
295
|
-
IsNever<Exclude<B, A>> extends true ? true : false
|
|
296
|
-
>;
|
|
297
|
-
|
|
298
|
-
type EndIfEqual<I extends string, O extends string> =
|
|
299
|
-
AreStringsEqual<I, O> extends true
|
|
300
|
-
? never
|
|
301
|
-
: void;
|
|
302
|
-
|
|
303
|
-
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
304
|
-
if (input === output) {
|
|
305
|
-
process.exit(0);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
endIfEqual('abc', 'abc');
|
|
310
|
-
//=> never
|
|
311
|
-
|
|
312
|
-
endIfEqual('abc', '123');
|
|
313
|
-
//=> void
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
@category Type Guard
|
|
317
|
-
@category Utilities
|
|
318
|
-
*/
|
|
319
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
323
|
-
|
|
324
|
-
@see {@link IsNever}
|
|
325
|
-
|
|
326
|
-
@example
|
|
327
|
-
```
|
|
328
|
-
import type {IfNever} from 'type-fest';
|
|
329
|
-
|
|
330
|
-
type ShouldBeTrue = IfNever<never>;
|
|
331
|
-
//=> true
|
|
332
|
-
|
|
333
|
-
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
334
|
-
//=> 'bar'
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
@category Type Guard
|
|
338
|
-
@category Utilities
|
|
339
|
-
*/
|
|
340
|
-
type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
341
|
-
IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
342
|
-
);
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
346
|
-
|
|
347
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
348
|
-
|
|
349
|
-
@example
|
|
350
|
-
```
|
|
351
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
352
|
-
|
|
353
|
-
interface Example {
|
|
354
|
-
a: string;
|
|
355
|
-
b: string | number;
|
|
356
|
-
c?: string;
|
|
357
|
-
d: {};
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
361
|
-
//=> 'a'
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
365
|
-
|
|
366
|
-
@example
|
|
367
|
-
```
|
|
368
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
369
|
-
|
|
370
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
371
|
-
//=> 'a' | 'c'
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
@category Object
|
|
375
|
-
*/
|
|
376
|
-
type ConditionalKeys<Base, Condition> =
|
|
377
|
-
{
|
|
378
|
-
// Map through all the keys of the given base type.
|
|
379
|
-
[Key in keyof Base]-?:
|
|
380
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
381
|
-
Base[Key] extends Condition
|
|
382
|
-
// Retain this key
|
|
383
|
-
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
384
|
-
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
|
|
385
|
-
// Discard this key since the condition fails.
|
|
386
|
-
: never;
|
|
387
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
388
|
-
}[keyof Base];
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
392
|
-
|
|
393
|
-
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.
|
|
394
|
-
|
|
395
|
-
@example
|
|
396
|
-
```
|
|
397
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
398
|
-
|
|
399
|
-
class Awesome {
|
|
400
|
-
name: string;
|
|
401
|
-
successes: number;
|
|
402
|
-
failures: bigint;
|
|
403
|
-
|
|
404
|
-
run() {}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
408
|
-
//=> {run: () => void}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
@example
|
|
412
|
-
```
|
|
413
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
414
|
-
|
|
415
|
-
interface Example {
|
|
416
|
-
a: string;
|
|
417
|
-
b: string | number;
|
|
418
|
-
c: () => void;
|
|
419
|
-
d: {};
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
423
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
@category Object
|
|
427
|
-
*/
|
|
428
|
-
type ConditionalExcept<Base, Condition> = Except<
|
|
429
|
-
Base,
|
|
430
|
-
ConditionalKeys<Base, Condition>
|
|
431
|
-
>;
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
435
|
-
* can either be a REST module or a host module.
|
|
436
|
-
* This type is recursive, so it can describe nested modules.
|
|
437
|
-
*/
|
|
438
|
-
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
439
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
443
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
444
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
445
|
-
* do not match the given host (as they will not work with the given host).
|
|
446
|
-
*/
|
|
447
|
-
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
448
|
-
done: T;
|
|
449
|
-
recurse: T extends {
|
|
450
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
451
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
452
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
453
|
-
-1,
|
|
454
|
-
0,
|
|
455
|
-
1,
|
|
456
|
-
2,
|
|
457
|
-
3,
|
|
458
|
-
4,
|
|
459
|
-
5
|
|
460
|
-
][Depth]> : never;
|
|
461
|
-
}, EmptyObject>;
|
|
462
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
463
|
-
type PublicMetadata = {
|
|
464
|
-
PACKAGE_NAME?: string;
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
declare global {
|
|
468
|
-
interface ContextualClient {
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* A type used to create concerete types from SDK descriptors in
|
|
473
|
-
* case a contextual client is available.
|
|
474
|
-
*/
|
|
475
|
-
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
476
|
-
host: Host;
|
|
477
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
478
|
-
|
|
479
|
-
interface AppPlans {
|
|
480
|
-
/** App ID, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */
|
|
481
|
-
_id?: string;
|
|
482
|
-
/**
|
|
483
|
-
* List of the app's pricing plans.
|
|
484
|
-
*
|
|
485
|
-
* Min: `0` plans
|
|
486
|
-
* Max: `50` plans
|
|
487
|
-
*/
|
|
488
|
-
plans?: Plan[];
|
|
489
|
-
}
|
|
490
|
-
declare enum DiscountType {
|
|
491
|
-
DISCOUNT_TYPE_UNSPECIFIED = "DISCOUNT_TYPE_UNSPECIFIED",
|
|
492
|
-
/** Discount is a fixed amount in USD. */
|
|
493
|
-
FIXED_AMOUNT = "FIXED_AMOUNT",
|
|
494
|
-
/** Discount is a percentage of the total price. */
|
|
495
|
-
PERCENTAGE = "PERCENTAGE"
|
|
496
|
-
}
|
|
497
|
-
declare enum SaleType {
|
|
498
|
-
/** Default value, can be used when no specific sale is associated. */
|
|
499
|
-
SALE_TYPE_UNSPECIFIED = "SALE_TYPE_UNSPECIFIED",
|
|
500
|
-
CYBER_MONDAY = "CYBER_MONDAY",
|
|
501
|
-
NOVEMBER_SALE = "NOVEMBER_SALE",
|
|
502
|
-
BLACK_FRIDAY = "BLACK_FRIDAY",
|
|
503
|
-
DEVELOPER_SALE = "DEVELOPER_SALE"
|
|
504
|
-
}
|
|
505
|
-
interface Cycle {
|
|
506
|
-
/**
|
|
507
|
-
* Type of the billing cycle.
|
|
508
|
-
*
|
|
509
|
-
* + `"UNKNOWN_UNIT"`: There is no information about the billing cycle.
|
|
510
|
-
* + `"ONE_TIME"`: The customer pays for unlimited usage of the app with a single payment.
|
|
511
|
-
* + `"RECURRING"`: The customer pays for a subscription to the app on a recurring schedule.
|
|
512
|
-
*/
|
|
513
|
-
cycleType?: CycleType;
|
|
514
|
-
/** Duration of the billing cycle. Available only for `{"cycleType": "RECURRING"}`. */
|
|
515
|
-
cycleDuration?: Duration;
|
|
516
|
-
}
|
|
517
|
-
declare enum DurationUnit {
|
|
518
|
-
/** unknown interval unit */
|
|
519
|
-
UNKNOWN_UNIT = "UNKNOWN_UNIT",
|
|
520
|
-
/** month */
|
|
521
|
-
MONTH = "MONTH",
|
|
522
|
-
/** year */
|
|
523
|
-
YEAR = "YEAR"
|
|
524
|
-
}
|
|
525
|
-
declare enum CycleType {
|
|
526
|
-
UNKNOWN_TYPE = "UNKNOWN_TYPE",
|
|
527
|
-
ONE_TIME = "ONE_TIME",
|
|
528
|
-
RECURRING = "RECURRING"
|
|
529
|
-
}
|
|
530
|
-
interface Duration {
|
|
531
|
-
/** Unit of the billing cycle. */
|
|
532
|
-
unit?: DurationUnit;
|
|
533
|
-
/** Count of units that make up the billing cycle. */
|
|
534
|
-
count?: number;
|
|
535
|
-
}
|
|
536
|
-
interface UsageBasedDetails {
|
|
537
|
-
/**
|
|
538
|
-
* Smallest possible amount that your app charges customers in usage-based
|
|
539
|
-
* pricing. For example, the price of a single SMS message if your
|
|
540
|
-
* app charges customers for sending text messages. Always in
|
|
541
|
-
* [USD](https://en.wikipedia.org/wiki/United_States_dollar).
|
|
542
|
-
*
|
|
543
|
-
* Min: `0.00`
|
|
544
|
-
* Max: 1024 characters
|
|
545
|
-
*/
|
|
546
|
-
minimumChargeIncrement?: string | null;
|
|
547
|
-
/**
|
|
548
|
-
* Recurring, monthly base fee in usaged-based pricing that your app
|
|
549
|
-
* charges customers regardless of how much they use your app.
|
|
550
|
-
*
|
|
551
|
-
* Min: `0.00`
|
|
552
|
-
* Max: 1024 characters
|
|
553
|
-
*/
|
|
554
|
-
monthlyBaseFee?: string | null;
|
|
555
|
-
/**
|
|
556
|
-
* Description of the usaged-based pricing plan, as defined in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).
|
|
557
|
-
*
|
|
558
|
-
* Max: 1024 characters
|
|
559
|
-
*/
|
|
560
|
-
customChargeDescription?: string | null;
|
|
561
|
-
}
|
|
562
|
-
interface Discount {
|
|
563
|
-
type?: DiscountType;
|
|
564
|
-
/** Discount amount */
|
|
565
|
-
amount?: string;
|
|
566
|
-
saleId?: string | null;
|
|
567
|
-
/**
|
|
568
|
-
* Price without taxes. For yearly plans, Wix calculates and returns the
|
|
569
|
-
* average price per month. You can get thefull price by multiplying the
|
|
570
|
-
* returned price with 12.
|
|
571
|
-
* Min: `0.00`
|
|
572
|
-
* Max: 1024 characters
|
|
573
|
-
*/
|
|
574
|
-
priceBeforeTax?: string;
|
|
575
|
-
/**
|
|
576
|
-
* Total price including taxes.
|
|
577
|
-
* Min: `0.00`
|
|
578
|
-
* Max: 1024 characters
|
|
579
|
-
*/
|
|
580
|
-
totalPrice?: string;
|
|
581
|
-
saleType?: SaleType;
|
|
582
|
-
}
|
|
583
|
-
declare enum BillingSource {
|
|
584
|
-
UNKNOWN = "UNKNOWN",
|
|
585
|
-
/** plan billing and charges is managed by Wix */
|
|
586
|
-
WIX = "WIX",
|
|
587
|
-
/** plan billing and charges is managed by the app */
|
|
588
|
-
EXTERNAL = "EXTERNAL"
|
|
589
|
-
}
|
|
590
|
-
interface Price {
|
|
591
|
-
/**
|
|
592
|
-
* Price without taxes. For yearly plans, Wix calculates and returns the
|
|
593
|
-
* average price per month. You can get thefull price by multiplying the
|
|
594
|
-
* returned price with 12.
|
|
595
|
-
*
|
|
596
|
-
* Min: `0.00`
|
|
597
|
-
* Max: 1024 characters
|
|
598
|
-
*/
|
|
599
|
-
priceBeforeTax?: string;
|
|
600
|
-
/**
|
|
601
|
-
* Total price including taxes.
|
|
602
|
-
*
|
|
603
|
-
* Min: `0.00`
|
|
604
|
-
* Max: 1024 characters
|
|
605
|
-
*/
|
|
606
|
-
totalPrice?: string;
|
|
607
|
-
/** Information about the plan's recurring billing cycle or single payment. */
|
|
608
|
-
billingCycle?: Cycle;
|
|
609
|
-
/**
|
|
610
|
-
* Details about the plan's usage-based pricing.
|
|
611
|
-
* Available only for plans with
|
|
612
|
-
* [usage-based pricing](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/usage-based-pricing).
|
|
613
|
-
*/
|
|
614
|
-
usageBaseOptions?: UsageBasedDetails;
|
|
615
|
-
discount?: Discount;
|
|
616
|
-
billingSource?: BillingSource;
|
|
617
|
-
/** Can be shown instead of plan price - used for dynamic plans */
|
|
618
|
-
customPaymentTitle?: string | null;
|
|
619
|
-
}
|
|
620
|
-
interface Plan {
|
|
621
|
-
/**
|
|
622
|
-
* ID of the app plan.
|
|
623
|
-
* @readonly
|
|
624
|
-
*/
|
|
625
|
-
_id?: string;
|
|
626
|
-
/**
|
|
627
|
-
* ID of your app's pricing plan, as displayed in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).
|
|
628
|
-
* Identical to `vendorProductId` in the
|
|
629
|
-
* [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).
|
|
630
|
-
*/
|
|
631
|
-
vendorId?: string;
|
|
632
|
-
/** Name of your app's pricing plan, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view). */
|
|
633
|
-
name?: string;
|
|
634
|
-
/**
|
|
635
|
-
* List of your plan's benefits, as defined by you in the [app dashboard](https://dev.wix.com/apps/my-apps?viewId=active-apps-view).
|
|
636
|
-
* Currently, the benefits are available only in English.
|
|
637
|
-
*
|
|
638
|
-
* Min: `0` benefits
|
|
639
|
-
* Max: `4` benefits
|
|
640
|
-
* Max per benefit: 1024 characters
|
|
641
|
-
*/
|
|
642
|
-
benefits?: string[];
|
|
643
|
-
/**
|
|
644
|
-
* List of the plan's prices. Available only when the plan's prices are managed
|
|
645
|
-
* by Wix and not externally.
|
|
646
|
-
*
|
|
647
|
-
* Min: `0` prices
|
|
648
|
-
* Max: `10` prices
|
|
649
|
-
*/
|
|
650
|
-
prices?: Price[];
|
|
651
|
-
}
|
|
652
|
-
interface ListAppPlansByAppIdRequest {
|
|
653
|
-
/**
|
|
654
|
-
* List of app IDs to retrieve plans for.
|
|
655
|
-
*
|
|
656
|
-
* Min: 1 app ID
|
|
657
|
-
* Max: 100 app IDs
|
|
658
|
-
*/
|
|
659
|
-
appIds: string[];
|
|
660
|
-
}
|
|
661
|
-
interface ListAppPlansByAppIdResponse {
|
|
662
|
-
/**
|
|
663
|
-
* Tax settings. Wix calculates the tax settings based on the country code that
|
|
664
|
-
* you pass in the call's header. If you don't pass a country code in the header,
|
|
665
|
-
* Wix calculates the tax settings based on the caller's IP address. Note that the
|
|
666
|
-
* tax settings may not resolve properly if you call through a VPN.
|
|
667
|
-
*/
|
|
668
|
-
taxSettings?: TaxSettings;
|
|
669
|
-
/**
|
|
670
|
-
* 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
|
|
671
|
-
* format. Wix calculates the currency based on the country code that
|
|
672
|
-
* you pass in the call's header. If you don't pass a country code in the header,
|
|
673
|
-
* Wix calculates the currency based on the caller's IP address. Note that the
|
|
674
|
-
* currency may not resolve properly if you call through a VPN.
|
|
675
|
-
*/
|
|
676
|
-
currency?: string;
|
|
677
|
-
/**
|
|
678
|
-
* Currency symbol in decimal HTML entity format. For example, `$` for $
|
|
679
|
-
* (United States Dollar). Wix calculates the currency symbol based on the
|
|
680
|
-
* country code that you pass in the call's header. If you don't pass a country
|
|
681
|
-
* code in the header, Wix calculates the tax settings based on the caller's IP
|
|
682
|
-
* address. Note that the currency symbol may not resolve properly if you call
|
|
683
|
-
* through a VPN.
|
|
684
|
-
*/
|
|
685
|
-
currencySymbol?: string;
|
|
686
|
-
/**
|
|
687
|
-
* Retrieved app plans.
|
|
688
|
-
*
|
|
689
|
-
* Min: 0 plans
|
|
690
|
-
* Max: 50 plans
|
|
691
|
-
*/
|
|
692
|
-
appPlans?: AppPlans[];
|
|
693
|
-
}
|
|
694
|
-
interface TaxSettings {
|
|
695
|
-
/**
|
|
696
|
-
* Whether you must display the total price including taxes in the given
|
|
697
|
-
* country.
|
|
698
|
-
*/
|
|
699
|
-
showPriceWithTax?: boolean;
|
|
700
|
-
/**
|
|
701
|
-
* Tax rate for the given country as percentage. Returned as `0` when
|
|
702
|
-
* `{"showPriceWithTax": false}`.
|
|
703
|
-
*/
|
|
704
|
-
percentage?: string | null;
|
|
705
|
-
/**
|
|
706
|
-
* Type of tax required in the given country.
|
|
707
|
-
*
|
|
708
|
-
* + `"NOT_APPLICABLE"`: The country doesn't require that you display the total price including taxes, or Wix failed to calculate the country based on the call's IP address.
|
|
709
|
-
* + `"VAT"`: The given country requires that you display the total price including [value-added tax (VAT)](https://en.wikipedia.org/wiki/Value-added_tax).
|
|
710
|
-
* + `"GST"`: The given country requires that you display the total price including [generation-skipping transfer tax (GST)](https://en.wikipedia.org/wiki/Generation-skipping_transfer_tax).
|
|
711
|
-
*/
|
|
712
|
-
taxType?: TaxType;
|
|
713
|
-
}
|
|
714
|
-
declare enum TaxType {
|
|
715
|
-
NOT_APPLICABLE = "NOT_APPLICABLE",
|
|
716
|
-
VAT = "VAT",
|
|
717
|
-
GST = "GST"
|
|
718
|
-
}
|
|
719
|
-
interface TaxSettingsNonNullableFields {
|
|
720
|
-
showPriceWithTax: boolean;
|
|
721
|
-
taxType: TaxType;
|
|
722
|
-
}
|
|
723
|
-
interface DurationNonNullableFields {
|
|
724
|
-
unit: DurationUnit;
|
|
725
|
-
count: number;
|
|
726
|
-
}
|
|
727
|
-
interface CycleNonNullableFields {
|
|
728
|
-
cycleType: CycleType;
|
|
729
|
-
cycleDuration?: DurationNonNullableFields;
|
|
730
|
-
}
|
|
731
|
-
interface DiscountNonNullableFields {
|
|
732
|
-
type: DiscountType;
|
|
733
|
-
amount: string;
|
|
734
|
-
priceBeforeTax: string;
|
|
735
|
-
totalPrice: string;
|
|
736
|
-
saleType: SaleType;
|
|
737
|
-
}
|
|
738
|
-
interface PriceNonNullableFields {
|
|
739
|
-
priceBeforeTax: string;
|
|
740
|
-
totalPrice: string;
|
|
741
|
-
billingCycle?: CycleNonNullableFields;
|
|
742
|
-
discount?: DiscountNonNullableFields;
|
|
743
|
-
billingSource: BillingSource;
|
|
744
|
-
}
|
|
745
|
-
interface PlanNonNullableFields {
|
|
746
|
-
_id: string;
|
|
747
|
-
vendorId: string;
|
|
748
|
-
name: string;
|
|
749
|
-
benefits: string[];
|
|
750
|
-
prices: PriceNonNullableFields[];
|
|
751
|
-
}
|
|
752
|
-
interface AppPlansNonNullableFields {
|
|
753
|
-
_id: string;
|
|
754
|
-
plans: PlanNonNullableFields[];
|
|
755
|
-
}
|
|
756
|
-
interface ListAppPlansByAppIdResponseNonNullableFields {
|
|
757
|
-
taxSettings?: TaxSettingsNonNullableFields;
|
|
758
|
-
currency: string;
|
|
759
|
-
currencySymbol: string;
|
|
760
|
-
appPlans: AppPlansNonNullableFields[];
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
declare function listAppPlansByAppId$1(httpClient: HttpClient): ListAppPlansByAppIdSignature;
|
|
764
|
-
interface ListAppPlansByAppIdSignature {
|
|
765
|
-
/**
|
|
766
|
-
* Retrieves plans for the given apps.
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
* Also returns tax settings and currency details. Wix calculates this information
|
|
770
|
-
* based on the 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
|
|
771
|
-
* format that you pass in the call's header. If you don't pass a country code in
|
|
772
|
-
* the header, Wix calculates the tax settings and currency details based on the
|
|
773
|
-
* call's IP address. Note that the tax settings and currency details may not resolve
|
|
774
|
-
* properly if you call through a VPN.
|
|
775
|
-
*
|
|
776
|
-
* Prices for plans that are managed outside of Wix aren't returned.
|
|
777
|
-
*
|
|
778
|
-
* Consumers must pay for yearly and multi-yearly plans of your app every month.
|
|
779
|
-
* For these plans this endpoint returns the price that the consumer must pay every
|
|
780
|
-
* month and not the total price for the entire year.
|
|
781
|
-
*
|
|
782
|
-
* <blockquote class="important">
|
|
783
|
-
*
|
|
784
|
-
* __Important:__
|
|
785
|
-
* The App Plans API doesn't follow any tenancy model. You don't need any
|
|
786
|
-
* permissions to call `List App Plans by App ID`.
|
|
787
|
-
*
|
|
788
|
-
* </blockquote>
|
|
789
|
-
* @param - List of app IDs to retrieve plans for.
|
|
790
|
-
*
|
|
791
|
-
* Min: 1 app ID
|
|
792
|
-
* Max: 100 app IDs
|
|
793
|
-
*/
|
|
794
|
-
(appIds: string[]): Promise<ListAppPlansByAppIdResponse & ListAppPlansByAppIdResponseNonNullableFields>;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
declare const listAppPlansByAppId: MaybeContext<BuildRESTFunction<typeof listAppPlansByAppId$1> & typeof listAppPlansByAppId$1>;
|
|
798
|
-
|
|
799
|
-
type context$4_AppPlans = AppPlans;
|
|
800
|
-
type context$4_BillingSource = BillingSource;
|
|
801
|
-
declare const context$4_BillingSource: typeof BillingSource;
|
|
802
|
-
type context$4_Cycle = Cycle;
|
|
803
|
-
type context$4_CycleType = CycleType;
|
|
804
|
-
declare const context$4_CycleType: typeof CycleType;
|
|
805
|
-
type context$4_Discount = Discount;
|
|
806
|
-
type context$4_DiscountType = DiscountType;
|
|
807
|
-
declare const context$4_DiscountType: typeof DiscountType;
|
|
808
|
-
type context$4_Duration = Duration;
|
|
809
|
-
type context$4_DurationUnit = DurationUnit;
|
|
810
|
-
declare const context$4_DurationUnit: typeof DurationUnit;
|
|
811
|
-
type context$4_ListAppPlansByAppIdRequest = ListAppPlansByAppIdRequest;
|
|
812
|
-
type context$4_ListAppPlansByAppIdResponse = ListAppPlansByAppIdResponse;
|
|
813
|
-
type context$4_ListAppPlansByAppIdResponseNonNullableFields = ListAppPlansByAppIdResponseNonNullableFields;
|
|
814
|
-
type context$4_Plan = Plan;
|
|
815
|
-
type context$4_Price = Price;
|
|
816
|
-
type context$4_SaleType = SaleType;
|
|
817
|
-
declare const context$4_SaleType: typeof SaleType;
|
|
818
|
-
type context$4_TaxSettings = TaxSettings;
|
|
819
|
-
type context$4_TaxType = TaxType;
|
|
820
|
-
declare const context$4_TaxType: typeof TaxType;
|
|
821
|
-
type context$4_UsageBasedDetails = UsageBasedDetails;
|
|
822
|
-
declare const context$4_listAppPlansByAppId: typeof listAppPlansByAppId;
|
|
823
|
-
declare namespace context$4 {
|
|
824
|
-
export { type context$4_AppPlans as AppPlans, context$4_BillingSource as BillingSource, type context$4_Cycle as Cycle, context$4_CycleType as CycleType, type context$4_Discount as Discount, context$4_DiscountType as DiscountType, type context$4_Duration as Duration, context$4_DurationUnit as DurationUnit, type context$4_ListAppPlansByAppIdRequest as ListAppPlansByAppIdRequest, type context$4_ListAppPlansByAppIdResponse as ListAppPlansByAppIdResponse, type context$4_ListAppPlansByAppIdResponseNonNullableFields as ListAppPlansByAppIdResponseNonNullableFields, type context$4_Plan as Plan, type context$4_Price as Price, context$4_SaleType as SaleType, type context$4_TaxSettings as TaxSettings, context$4_TaxType as TaxType, type context$4_UsageBasedDetails as UsageBasedDetails, context$4_listAppPlansByAppId as listAppPlansByAppId };
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* An app instance is a specific occurrence of your app on a particular Wix site.
|
|
829
|
-
* When a site owner installs your app, a unique instance is generated for that
|
|
830
|
-
* specific site. Use the `instanceId` to keep track of the individual data
|
|
831
|
-
* associated with each app instance.
|
|
832
|
-
*/
|
|
833
|
-
interface AppInstance {
|
|
834
|
-
/**
|
|
835
|
-
* ID of the app instance. You can use it to keep track of the individual
|
|
836
|
-
* data that's associated with the specific occurence of your app that's
|
|
837
|
-
* installed on a Wix site.
|
|
838
|
-
*/
|
|
839
|
-
instanceId?: string;
|
|
840
|
-
/**
|
|
841
|
-
* App name, as set by you in the Customs Apps page during the app creation
|
|
842
|
-
* process.
|
|
843
|
-
*/
|
|
844
|
-
appName?: string;
|
|
845
|
-
/** Version of your app that's installed on the Wix site, as set by you during the app creation process. */
|
|
846
|
-
appVersion?: string | null;
|
|
847
|
-
/**
|
|
848
|
-
* Whether the site owners have installed a free or paid version of your app
|
|
849
|
-
* on their site.
|
|
850
|
-
*/
|
|
851
|
-
isFree?: boolean;
|
|
852
|
-
/**
|
|
853
|
-
* Billing information for the app instance. Available only in case
|
|
854
|
-
* `{"isFree": false}`.
|
|
855
|
-
*/
|
|
856
|
-
billing?: BillingInfo;
|
|
857
|
-
/**
|
|
858
|
-
* List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions)
|
|
859
|
-
* that the site owners have granted your app. You set the list of permissions that
|
|
860
|
-
* your app requires from the site owners in your app's Permissions page during the
|
|
861
|
-
* app creation process.
|
|
862
|
-
*/
|
|
863
|
-
permissions?: string[];
|
|
864
|
-
/** Plans available to this app instance. */
|
|
865
|
-
availablePlans?: AvailablePlan[];
|
|
866
|
-
/**
|
|
867
|
-
* ID of the Wix site from which the instance of your app has been cloned.
|
|
868
|
-
* Available only in case `{"copiedFromTemplate": true}`.
|
|
869
|
-
* All visual settings of the Wix site and app data are duplicated during the
|
|
870
|
-
* cloning process. Wix also notifies you in case there is any additional
|
|
871
|
-
* external functionality for the original site.
|
|
872
|
-
*/
|
|
873
|
-
originInstanceId?: string | null;
|
|
874
|
-
/**
|
|
875
|
-
* __Deprecated__. This parameter will be removed on March 30, 2023. Use
|
|
876
|
-
* `copiedFromTemplate` instead.
|
|
877
|
-
* @deprecated
|
|
878
|
-
*/
|
|
879
|
-
isOriginSiteTemplate?: boolean;
|
|
880
|
-
/** Whether the app instance was created when another Wix site was cloned. */
|
|
881
|
-
copiedFromTemplate?: boolean;
|
|
882
|
-
/** Whether the app instance includes a free trial that hasn't started yet. */
|
|
883
|
-
freeTrialAvailable?: boolean;
|
|
884
|
-
}
|
|
885
|
-
interface BillingInfo {
|
|
886
|
-
/** Name of the package that the site owner has paid for. */
|
|
887
|
-
packageName?: string;
|
|
888
|
-
/**
|
|
889
|
-
* Interval of the billing cycle. `"ONE_TIME"` means that site owners have
|
|
890
|
-
* purchased unlimited access to the app with a single, upfront payment.
|
|
891
|
-
*/
|
|
892
|
-
billingCycle?: PaymentCycle$1;
|
|
893
|
-
/**
|
|
894
|
-
* Date and time the site owners have purchased the app's paid plan in
|
|
895
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
896
|
-
*/
|
|
897
|
-
timeStamp?: string;
|
|
898
|
-
/**
|
|
899
|
-
* Date and time the app's current billing cycle ends in
|
|
900
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and
|
|
901
|
-
* multi-yearly plans.
|
|
902
|
-
*/
|
|
903
|
-
expirationDate?: string | null;
|
|
904
|
-
/**
|
|
905
|
-
* Whether the app's subscription automatically renews at the end of the
|
|
906
|
-
* current billing cycle.
|
|
907
|
-
*/
|
|
908
|
-
autoRenewing?: boolean | null;
|
|
909
|
-
/** ID of the invoice for the current billing cycle. */
|
|
910
|
-
invoiceId?: string | null;
|
|
911
|
-
/**
|
|
912
|
-
* Information about any discounts applied to the app instance's current billing cycle.
|
|
913
|
-
* If the site owners applied a developer coupon or Wix Voucher
|
|
914
|
-
* when installing the paid version of your app, this field holds the coupon's
|
|
915
|
-
* name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when
|
|
916
|
-
* upgrading their Wix subscription. If there is no discount for the
|
|
917
|
-
* current billing cycle, the field is an empty string.
|
|
918
|
-
*/
|
|
919
|
-
source?: string | null;
|
|
920
|
-
/** Information about the free trial applied, if relevant. */
|
|
921
|
-
freeTrialInfo?: FreeTrialInfo;
|
|
922
|
-
}
|
|
923
|
-
declare enum PaymentCycle$1 {
|
|
924
|
-
NO_CYCLE = "NO_CYCLE",
|
|
925
|
-
MONTHLY = "MONTHLY",
|
|
926
|
-
YEARLY = "YEARLY",
|
|
927
|
-
ONE_TIME = "ONE_TIME",
|
|
928
|
-
TWO_YEARS = "TWO_YEARS",
|
|
929
|
-
THREE_YEARS = "THREE_YEARS",
|
|
930
|
-
FOUR_YEARS = "FOUR_YEARS",
|
|
931
|
-
FIVE_YEARS = "FIVE_YEARS"
|
|
932
|
-
}
|
|
933
|
-
interface FreeTrialInfo {
|
|
934
|
-
/**
|
|
935
|
-
* Current free trial status.
|
|
936
|
-
* @readonly
|
|
937
|
-
*/
|
|
938
|
-
status?: FreeTrialStatus;
|
|
939
|
-
/**
|
|
940
|
-
* When the free trial has ended. Populated only once the free trial is over.
|
|
941
|
-
* @readonly
|
|
942
|
-
*/
|
|
943
|
-
endDate?: Date | null;
|
|
944
|
-
}
|
|
945
|
-
declare enum FreeTrialStatus {
|
|
946
|
-
/** Unknown trial status. */
|
|
947
|
-
UNKNOWN_STATUS = "UNKNOWN_STATUS",
|
|
948
|
-
/** The free trial is currently in progress. */
|
|
949
|
-
IN_PROGRESS = "IN_PROGRESS",
|
|
950
|
-
/** The free trial has ended. */
|
|
951
|
-
ENDED = "ENDED",
|
|
952
|
-
/** No free trial was applied, as none was available. */
|
|
953
|
-
NOT_AVAILABLE = "NOT_AVAILABLE"
|
|
954
|
-
}
|
|
955
|
-
interface AvailablePlan {
|
|
956
|
-
/** Package name of the available plan. */
|
|
957
|
-
packageName?: string;
|
|
958
|
-
/** Source of the available plan. Can be a bundle or 3rd-party app. */
|
|
959
|
-
source?: string;
|
|
960
|
-
}
|
|
961
|
-
interface AppInstalled {
|
|
962
|
-
/** Unique identifier of the app within the website. */
|
|
963
|
-
appId?: string;
|
|
964
|
-
/** Instance ID of the app in the original website (relevant only when this site was [duplicated from another site](https://support.wix.com/en/article/duplicating-your-site-1472847)). */
|
|
965
|
-
originInstanceId?: string | null;
|
|
966
|
-
}
|
|
967
|
-
interface AppRemoved {
|
|
968
|
-
/** Unique identifier of the app within the website. */
|
|
969
|
-
appId?: string;
|
|
970
|
-
}
|
|
971
|
-
interface PaidPlanPurchased {
|
|
972
|
-
/** Date and time of purchase. */
|
|
973
|
-
operationTimeStamp?: Date | null;
|
|
974
|
-
/** Purchased app plan. */
|
|
975
|
-
vendorProductId?: string;
|
|
976
|
-
/** Selected payment cycle. */
|
|
977
|
-
cycle?: PaymentCycle$1;
|
|
978
|
-
/** Plan expiration date. */
|
|
979
|
-
expiresOn?: Date | null;
|
|
980
|
-
/** Coupon applied to purchase (if relevant). */
|
|
981
|
-
couponName?: string | null;
|
|
982
|
-
/** Invoice ID. */
|
|
983
|
-
invoiceId?: string | null;
|
|
984
|
-
}
|
|
985
|
-
interface PaidPlanChanged {
|
|
986
|
-
/** Date and time of change. */
|
|
987
|
-
operationTimeStamp?: Date | null;
|
|
988
|
-
/** Newly purchased app plan. */
|
|
989
|
-
vendorProductId?: string;
|
|
990
|
-
/** Newly selected payment cycle. */
|
|
991
|
-
cycle?: PaymentCycle$1;
|
|
992
|
-
/** Previous app plan. */
|
|
993
|
-
previousVendorProductId?: string | null;
|
|
994
|
-
/** Previous payment cycle. */
|
|
995
|
-
previousCycle?: PaymentCycle$1;
|
|
996
|
-
/** Coupon applied to purchase (if relevant). */
|
|
997
|
-
couponName?: string | null;
|
|
998
|
-
/** Invoice ID. */
|
|
999
|
-
invoiceId?: string | null;
|
|
1000
|
-
}
|
|
1001
|
-
interface PaidPlanAutoRenewalCancelled {
|
|
1002
|
-
/** Date and time of auto-renewal cancellation. */
|
|
1003
|
-
operationTimeStamp?: Date | null;
|
|
1004
|
-
/** Current app plan. */
|
|
1005
|
-
vendorProductId?: string;
|
|
1006
|
-
/** Current payment cycle. */
|
|
1007
|
-
cycle?: PaymentCycle$1;
|
|
1008
|
-
/** Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant). */
|
|
1009
|
-
cancelReason?: string | null;
|
|
1010
|
-
/** Reason provided by site owner for cancellation (if relevant). */
|
|
1011
|
-
userReason?: string | null;
|
|
1012
|
-
/** Cancellation type. */
|
|
1013
|
-
subscriptionCancellationType?: string | null;
|
|
1014
|
-
}
|
|
1015
|
-
interface GetAppInstanceRequest {
|
|
1016
|
-
}
|
|
1017
|
-
interface GetAppInstanceResponse {
|
|
1018
|
-
/** Retrieved app instance. */
|
|
1019
|
-
instance?: AppInstance;
|
|
1020
|
-
/** Information about the corresponding Wix site. */
|
|
1021
|
-
site?: SiteInfo;
|
|
1022
|
-
}
|
|
1023
|
-
interface SiteInfo {
|
|
1024
|
-
/** Display name of the site. */
|
|
1025
|
-
siteDisplayName?: string | null;
|
|
1026
|
-
/**
|
|
1027
|
-
* 2-letter language code of the site's locale in
|
|
1028
|
-
* [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
1029
|
-
*/
|
|
1030
|
-
locale?: string;
|
|
1031
|
-
/**
|
|
1032
|
-
* 3-letter currency code for the site's billing in
|
|
1033
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
|
1034
|
-
*/
|
|
1035
|
-
paymentCurrency?: string;
|
|
1036
|
-
/** Information about the site's supported languages. */
|
|
1037
|
-
multilingual?: Multilingual;
|
|
1038
|
-
/** URL of the site. Available only in case the site has been published. */
|
|
1039
|
-
url?: string | null;
|
|
1040
|
-
/** Description of the site. */
|
|
1041
|
-
description?: string | null;
|
|
1042
|
-
/** Wix apps that are installed on the site. */
|
|
1043
|
-
installedWixApps?: string[];
|
|
1044
|
-
/**
|
|
1045
|
-
* > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead.
|
|
1046
|
-
* @deprecated
|
|
1047
|
-
*/
|
|
1048
|
-
ownerEmail?: string | null;
|
|
1049
|
-
/**
|
|
1050
|
-
* Information about the site owner. Available only when calling
|
|
1051
|
-
* _Get App Instance_ with the __Read Site Owner Email__ permission scope.
|
|
1052
|
-
*/
|
|
1053
|
-
ownerInfo?: OwnerInfo;
|
|
1054
|
-
/** Site ID. */
|
|
1055
|
-
siteId?: string;
|
|
1056
|
-
}
|
|
1057
|
-
interface Multilingual {
|
|
1058
|
-
/** Whether the site supports more than a single language. */
|
|
1059
|
-
isMultiLingual?: boolean;
|
|
1060
|
-
/** List of supported languages. Returned only when `{"isMultiLingual": true}`. */
|
|
1061
|
-
supportedLanguages?: SupportedLanguage[];
|
|
1062
|
-
}
|
|
1063
|
-
interface SupportedLanguage {
|
|
1064
|
-
/** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */
|
|
1065
|
-
languageCode?: string;
|
|
1066
|
-
/** Locale. */
|
|
1067
|
-
locale?: Locale;
|
|
1068
|
-
/** Whether the supported language is the primary language for the site. */
|
|
1069
|
-
isPrimary?: boolean;
|
|
1070
|
-
/** Language icon. */
|
|
1071
|
-
countryCode?: string;
|
|
1072
|
-
/** How the language will be resolved. For internal use. */
|
|
1073
|
-
resolutionMethod?: ResolutionMethod;
|
|
1074
|
-
}
|
|
1075
|
-
interface Locale {
|
|
1076
|
-
/** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */
|
|
1077
|
-
languageCode?: string;
|
|
1078
|
-
/** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */
|
|
1079
|
-
country?: string;
|
|
1080
|
-
}
|
|
1081
|
-
declare enum ResolutionMethod {
|
|
1082
|
-
QUERY_PARAM = "QUERY_PARAM",
|
|
1083
|
-
SUBDOMAIN = "SUBDOMAIN",
|
|
1084
|
-
SUBDIRECTORY = "SUBDIRECTORY"
|
|
1085
|
-
}
|
|
1086
|
-
interface OwnerInfo {
|
|
1087
|
-
/** Site owner's email address. Identical to the site owner's login email. */
|
|
1088
|
-
email?: string;
|
|
1089
|
-
/**
|
|
1090
|
-
* Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`,
|
|
1091
|
-
* `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`.
|
|
1092
|
-
*
|
|
1093
|
-
* Whether the site owner has verified their email and whether they have chosen
|
|
1094
|
-
* to receive email notifications from Wix.
|
|
1095
|
-
*/
|
|
1096
|
-
emailStatus?: string;
|
|
1097
|
-
}
|
|
1098
|
-
interface GetAppInstanceByInstanceIdRequest {
|
|
1099
|
-
/** ID of the app instance to retrieve. */
|
|
1100
|
-
instanceId?: string;
|
|
1101
|
-
}
|
|
1102
|
-
interface MessageEnvelope$1 {
|
|
1103
|
-
/** App instance ID. */
|
|
1104
|
-
instanceId?: string | null;
|
|
1105
|
-
/** Event type. */
|
|
1106
|
-
eventType?: string;
|
|
1107
|
-
/** The identification type and identity data. */
|
|
1108
|
-
identity?: IdentificationData$1;
|
|
1109
|
-
/** Stringify payload. */
|
|
1110
|
-
data?: string;
|
|
1111
|
-
}
|
|
1112
|
-
interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
|
|
1113
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
1114
|
-
anonymousVisitorId?: string;
|
|
1115
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
1116
|
-
memberId?: string;
|
|
1117
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1118
|
-
wixUserId?: string;
|
|
1119
|
-
/** ID of an app. */
|
|
1120
|
-
appId?: string;
|
|
1121
|
-
/** @readonly */
|
|
1122
|
-
identityType?: WebhookIdentityType$1;
|
|
1123
|
-
}
|
|
1124
|
-
/** @oneof */
|
|
1125
|
-
interface IdentificationDataIdOneOf$1 {
|
|
1126
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
1127
|
-
anonymousVisitorId?: string;
|
|
1128
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
1129
|
-
memberId?: string;
|
|
1130
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1131
|
-
wixUserId?: string;
|
|
1132
|
-
/** ID of an app. */
|
|
1133
|
-
appId?: string;
|
|
1134
|
-
}
|
|
1135
|
-
declare enum WebhookIdentityType$1 {
|
|
1136
|
-
UNKNOWN = "UNKNOWN",
|
|
1137
|
-
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1138
|
-
MEMBER = "MEMBER",
|
|
1139
|
-
WIX_USER = "WIX_USER",
|
|
1140
|
-
APP = "APP"
|
|
1141
|
-
}
|
|
1142
|
-
interface FreeTrialInfoNonNullableFields {
|
|
1143
|
-
status: FreeTrialStatus;
|
|
1144
|
-
}
|
|
1145
|
-
interface BillingInfoNonNullableFields {
|
|
1146
|
-
packageName: string;
|
|
1147
|
-
billingCycle: PaymentCycle$1;
|
|
1148
|
-
timeStamp: string;
|
|
1149
|
-
freeTrialInfo?: FreeTrialInfoNonNullableFields;
|
|
1150
|
-
}
|
|
1151
|
-
interface AvailablePlanNonNullableFields {
|
|
1152
|
-
packageName: string;
|
|
1153
|
-
source: string;
|
|
1154
|
-
}
|
|
1155
|
-
interface AppInstanceNonNullableFields {
|
|
1156
|
-
instanceId: string;
|
|
1157
|
-
appName: string;
|
|
1158
|
-
isFree: boolean;
|
|
1159
|
-
billing?: BillingInfoNonNullableFields;
|
|
1160
|
-
permissions: string[];
|
|
1161
|
-
availablePlans: AvailablePlanNonNullableFields[];
|
|
1162
|
-
isOriginSiteTemplate: boolean;
|
|
1163
|
-
copiedFromTemplate: boolean;
|
|
1164
|
-
freeTrialAvailable: boolean;
|
|
1165
|
-
}
|
|
1166
|
-
interface LocaleNonNullableFields {
|
|
1167
|
-
languageCode: string;
|
|
1168
|
-
country: string;
|
|
1169
|
-
}
|
|
1170
|
-
interface SupportedLanguageNonNullableFields {
|
|
1171
|
-
languageCode: string;
|
|
1172
|
-
locale?: LocaleNonNullableFields;
|
|
1173
|
-
isPrimary: boolean;
|
|
1174
|
-
countryCode: string;
|
|
1175
|
-
resolutionMethod: ResolutionMethod;
|
|
1176
|
-
}
|
|
1177
|
-
interface MultilingualNonNullableFields {
|
|
1178
|
-
isMultiLingual: boolean;
|
|
1179
|
-
supportedLanguages: SupportedLanguageNonNullableFields[];
|
|
1180
|
-
}
|
|
1181
|
-
interface OwnerInfoNonNullableFields {
|
|
1182
|
-
email: string;
|
|
1183
|
-
emailStatus: string;
|
|
1184
|
-
}
|
|
1185
|
-
interface SiteInfoNonNullableFields {
|
|
1186
|
-
locale: string;
|
|
1187
|
-
paymentCurrency: string;
|
|
1188
|
-
multilingual?: MultilingualNonNullableFields;
|
|
1189
|
-
installedWixApps: string[];
|
|
1190
|
-
ownerInfo?: OwnerInfoNonNullableFields;
|
|
1191
|
-
siteId: string;
|
|
1192
|
-
}
|
|
1193
|
-
interface GetAppInstanceResponseNonNullableFields {
|
|
1194
|
-
instance?: AppInstanceNonNullableFields;
|
|
1195
|
-
site?: SiteInfoNonNullableFields;
|
|
1196
|
-
}
|
|
1197
|
-
interface BaseEventMetadata {
|
|
1198
|
-
/** App instance ID. */
|
|
1199
|
-
instanceId?: string | null;
|
|
1200
|
-
/** Event type. */
|
|
1201
|
-
eventType?: string;
|
|
1202
|
-
/** The identification type and identity data. */
|
|
1203
|
-
identity?: IdentificationData$1;
|
|
1204
|
-
}
|
|
1205
|
-
interface AppInstanceInstalledEnvelope {
|
|
1206
|
-
data: AppInstalled;
|
|
1207
|
-
metadata: BaseEventMetadata;
|
|
1208
|
-
}
|
|
1209
|
-
interface AppInstanceRemovedEnvelope {
|
|
1210
|
-
data: AppRemoved;
|
|
1211
|
-
metadata: BaseEventMetadata;
|
|
1212
|
-
}
|
|
1213
|
-
interface AppInstancePaidPlanAutoRenewalCancelledEnvelope {
|
|
1214
|
-
data: PaidPlanAutoRenewalCancelled;
|
|
1215
|
-
metadata: BaseEventMetadata;
|
|
1216
|
-
}
|
|
1217
|
-
interface AppInstancePaidPlanChangedEnvelope {
|
|
1218
|
-
data: PaidPlanChanged;
|
|
1219
|
-
metadata: BaseEventMetadata;
|
|
1220
|
-
}
|
|
1221
|
-
interface AppInstancePaidPlanPurchasedEnvelope {
|
|
1222
|
-
data: PaidPlanPurchased;
|
|
1223
|
-
metadata: BaseEventMetadata;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
declare function getAppInstance$1(httpClient: HttpClient): GetAppInstanceSignature;
|
|
1227
|
-
interface GetAppInstanceSignature {
|
|
1228
|
-
/**
|
|
1229
|
-
* Retrieves data about the instance of your app that's installed on a Wix site and data about the site itself.
|
|
1230
|
-
*
|
|
1231
|
-
* Call this function when you need information about a specific instance of your app and the site it’s installed on. For example, you may need to know whether the user has installed a free or paid version of your app, or to check what other Wix apps are installed on the site.
|
|
1232
|
-
*
|
|
1233
|
-
* You must authenticate as a [Wix App](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities#wix-apps). If you are calling this function from a [dashboard extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/about-dashboard-extensions) in the [CLI](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/about-the-wix-cli-for-apps), Wix App authentication is passed automatically. Otherwise, you need to call the function with [elevated permissions](https://dev.wix.com/docs/sdk/articles/working-with-the-sdk/about-elevated-permissions).
|
|
1234
|
-
*
|
|
1235
|
-
* If you want `site.ownerInfo` to be included in the response, you must have the __Read Site Owner Email__ permission scope in addition to __WIX_DEVELOPERS.MANAGE_APP_INSTANCE__.
|
|
1236
|
-
*/
|
|
1237
|
-
(): Promise<GetAppInstanceResponse & GetAppInstanceResponseNonNullableFields>;
|
|
1238
|
-
}
|
|
1239
|
-
declare const onAppInstanceInstalled$1: EventDefinition<AppInstanceInstalledEnvelope, "AppInstalled">;
|
|
1240
|
-
declare const onAppInstanceRemoved$1: EventDefinition<AppInstanceRemovedEnvelope, "AppRemoved">;
|
|
1241
|
-
declare const onAppInstancePaidPlanAutoRenewalCancelled$1: EventDefinition<AppInstancePaidPlanAutoRenewalCancelledEnvelope, "PaidPlanAutoRenewalCancelled">;
|
|
1242
|
-
declare const onAppInstancePaidPlanChanged$1: EventDefinition<AppInstancePaidPlanChangedEnvelope, "PaidPlanChanged">;
|
|
1243
|
-
declare const onAppInstancePaidPlanPurchased$1: EventDefinition<AppInstancePaidPlanPurchasedEnvelope, "PaidPlanPurchased">;
|
|
1244
|
-
|
|
1245
|
-
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
1246
|
-
|
|
1247
|
-
declare const getAppInstance: MaybeContext<BuildRESTFunction<typeof getAppInstance$1> & typeof getAppInstance$1>;
|
|
1248
|
-
|
|
1249
|
-
type _publicOnAppInstanceInstalledType = typeof onAppInstanceInstalled$1;
|
|
1250
|
-
/**
|
|
1251
|
-
* Triggered when an instance of your app is installed on a Wix site.
|
|
1252
|
-
*/
|
|
1253
|
-
declare const onAppInstanceInstalled: ReturnType<typeof createEventModule<_publicOnAppInstanceInstalledType>>;
|
|
1254
|
-
|
|
1255
|
-
type _publicOnAppInstanceRemovedType = typeof onAppInstanceRemoved$1;
|
|
1256
|
-
/**
|
|
1257
|
-
* Triggered when an instance of your app is uninstalled from a Wix site.
|
|
1258
|
-
*/
|
|
1259
|
-
declare const onAppInstanceRemoved: ReturnType<typeof createEventModule<_publicOnAppInstanceRemovedType>>;
|
|
1260
|
-
|
|
1261
|
-
type _publicOnAppInstancePaidPlanAutoRenewalCancelledType = typeof onAppInstancePaidPlanAutoRenewalCancelled$1;
|
|
1262
|
-
/**
|
|
1263
|
-
* Triggered when a site owner cancels a paid plan for your app. The
|
|
1264
|
-
* site owner can continue to use your app until the end of the current billing
|
|
1265
|
-
* cycle.
|
|
1266
|
-
*/
|
|
1267
|
-
declare const onAppInstancePaidPlanAutoRenewalCancelled: ReturnType<typeof createEventModule<_publicOnAppInstancePaidPlanAutoRenewalCancelledType>>;
|
|
1268
|
-
|
|
1269
|
-
type _publicOnAppInstancePaidPlanChangedType = typeof onAppInstancePaidPlanChanged$1;
|
|
1270
|
-
/**
|
|
1271
|
-
* Triggered when a site owner upgrades or downgrades their plan for your app.
|
|
1272
|
-
*/
|
|
1273
|
-
declare const onAppInstancePaidPlanChanged: ReturnType<typeof createEventModule<_publicOnAppInstancePaidPlanChangedType>>;
|
|
1274
|
-
|
|
1275
|
-
type _publicOnAppInstancePaidPlanPurchasedType = typeof onAppInstancePaidPlanPurchased$1;
|
|
1276
|
-
/**
|
|
1277
|
-
* Triggered when a site owner purchases a paid plan for your app.
|
|
1278
|
-
*/
|
|
1279
|
-
declare const onAppInstancePaidPlanPurchased: ReturnType<typeof createEventModule<_publicOnAppInstancePaidPlanPurchasedType>>;
|
|
1280
|
-
|
|
1281
|
-
type context$3_AppInstalled = AppInstalled;
|
|
1282
|
-
type context$3_AppInstance = AppInstance;
|
|
1283
|
-
type context$3_AppInstanceInstalledEnvelope = AppInstanceInstalledEnvelope;
|
|
1284
|
-
type context$3_AppInstancePaidPlanAutoRenewalCancelledEnvelope = AppInstancePaidPlanAutoRenewalCancelledEnvelope;
|
|
1285
|
-
type context$3_AppInstancePaidPlanChangedEnvelope = AppInstancePaidPlanChangedEnvelope;
|
|
1286
|
-
type context$3_AppInstancePaidPlanPurchasedEnvelope = AppInstancePaidPlanPurchasedEnvelope;
|
|
1287
|
-
type context$3_AppInstanceRemovedEnvelope = AppInstanceRemovedEnvelope;
|
|
1288
|
-
type context$3_AppRemoved = AppRemoved;
|
|
1289
|
-
type context$3_AvailablePlan = AvailablePlan;
|
|
1290
|
-
type context$3_BaseEventMetadata = BaseEventMetadata;
|
|
1291
|
-
type context$3_BillingInfo = BillingInfo;
|
|
1292
|
-
type context$3_FreeTrialInfo = FreeTrialInfo;
|
|
1293
|
-
type context$3_FreeTrialStatus = FreeTrialStatus;
|
|
1294
|
-
declare const context$3_FreeTrialStatus: typeof FreeTrialStatus;
|
|
1295
|
-
type context$3_GetAppInstanceByInstanceIdRequest = GetAppInstanceByInstanceIdRequest;
|
|
1296
|
-
type context$3_GetAppInstanceRequest = GetAppInstanceRequest;
|
|
1297
|
-
type context$3_GetAppInstanceResponse = GetAppInstanceResponse;
|
|
1298
|
-
type context$3_GetAppInstanceResponseNonNullableFields = GetAppInstanceResponseNonNullableFields;
|
|
1299
|
-
type context$3_Locale = Locale;
|
|
1300
|
-
type context$3_Multilingual = Multilingual;
|
|
1301
|
-
type context$3_OwnerInfo = OwnerInfo;
|
|
1302
|
-
type context$3_PaidPlanAutoRenewalCancelled = PaidPlanAutoRenewalCancelled;
|
|
1303
|
-
type context$3_PaidPlanChanged = PaidPlanChanged;
|
|
1304
|
-
type context$3_PaidPlanPurchased = PaidPlanPurchased;
|
|
1305
|
-
type context$3_ResolutionMethod = ResolutionMethod;
|
|
1306
|
-
declare const context$3_ResolutionMethod: typeof ResolutionMethod;
|
|
1307
|
-
type context$3_SiteInfo = SiteInfo;
|
|
1308
|
-
type context$3_SupportedLanguage = SupportedLanguage;
|
|
1309
|
-
type context$3__publicOnAppInstanceInstalledType = _publicOnAppInstanceInstalledType;
|
|
1310
|
-
type context$3__publicOnAppInstancePaidPlanAutoRenewalCancelledType = _publicOnAppInstancePaidPlanAutoRenewalCancelledType;
|
|
1311
|
-
type context$3__publicOnAppInstancePaidPlanChangedType = _publicOnAppInstancePaidPlanChangedType;
|
|
1312
|
-
type context$3__publicOnAppInstancePaidPlanPurchasedType = _publicOnAppInstancePaidPlanPurchasedType;
|
|
1313
|
-
type context$3__publicOnAppInstanceRemovedType = _publicOnAppInstanceRemovedType;
|
|
1314
|
-
declare const context$3_getAppInstance: typeof getAppInstance;
|
|
1315
|
-
declare const context$3_onAppInstanceInstalled: typeof onAppInstanceInstalled;
|
|
1316
|
-
declare const context$3_onAppInstancePaidPlanAutoRenewalCancelled: typeof onAppInstancePaidPlanAutoRenewalCancelled;
|
|
1317
|
-
declare const context$3_onAppInstancePaidPlanChanged: typeof onAppInstancePaidPlanChanged;
|
|
1318
|
-
declare const context$3_onAppInstancePaidPlanPurchased: typeof onAppInstancePaidPlanPurchased;
|
|
1319
|
-
declare const context$3_onAppInstanceRemoved: typeof onAppInstanceRemoved;
|
|
1320
|
-
declare namespace context$3 {
|
|
1321
|
-
export { type context$3_AppInstalled as AppInstalled, type context$3_AppInstance as AppInstance, type context$3_AppInstanceInstalledEnvelope as AppInstanceInstalledEnvelope, type context$3_AppInstancePaidPlanAutoRenewalCancelledEnvelope as AppInstancePaidPlanAutoRenewalCancelledEnvelope, type context$3_AppInstancePaidPlanChangedEnvelope as AppInstancePaidPlanChangedEnvelope, type context$3_AppInstancePaidPlanPurchasedEnvelope as AppInstancePaidPlanPurchasedEnvelope, type context$3_AppInstanceRemovedEnvelope as AppInstanceRemovedEnvelope, type context$3_AppRemoved as AppRemoved, type context$3_AvailablePlan as AvailablePlan, type context$3_BaseEventMetadata as BaseEventMetadata, type context$3_BillingInfo as BillingInfo, type context$3_FreeTrialInfo as FreeTrialInfo, context$3_FreeTrialStatus as FreeTrialStatus, type context$3_GetAppInstanceByInstanceIdRequest as GetAppInstanceByInstanceIdRequest, type context$3_GetAppInstanceRequest as GetAppInstanceRequest, type context$3_GetAppInstanceResponse as GetAppInstanceResponse, type context$3_GetAppInstanceResponseNonNullableFields as GetAppInstanceResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type context$3_Locale as Locale, type MessageEnvelope$1 as MessageEnvelope, type context$3_Multilingual as Multilingual, type context$3_OwnerInfo as OwnerInfo, type context$3_PaidPlanAutoRenewalCancelled as PaidPlanAutoRenewalCancelled, type context$3_PaidPlanChanged as PaidPlanChanged, type context$3_PaidPlanPurchased as PaidPlanPurchased, PaymentCycle$1 as PaymentCycle, context$3_ResolutionMethod as ResolutionMethod, type context$3_SiteInfo as SiteInfo, type context$3_SupportedLanguage as SupportedLanguage, WebhookIdentityType$1 as WebhookIdentityType, type context$3__publicOnAppInstanceInstalledType as _publicOnAppInstanceInstalledType, type context$3__publicOnAppInstancePaidPlanAutoRenewalCancelledType as _publicOnAppInstancePaidPlanAutoRenewalCancelledType, type context$3__publicOnAppInstancePaidPlanChangedType as _publicOnAppInstancePaidPlanChangedType, type context$3__publicOnAppInstancePaidPlanPurchasedType as _publicOnAppInstancePaidPlanPurchasedType, type context$3__publicOnAppInstanceRemovedType as _publicOnAppInstanceRemovedType, context$3_getAppInstance as getAppInstance, context$3_onAppInstanceInstalled as onAppInstanceInstalled, context$3_onAppInstancePaidPlanAutoRenewalCancelled as onAppInstancePaidPlanAutoRenewalCancelled, context$3_onAppInstancePaidPlanChanged as onAppInstancePaidPlanChanged, context$3_onAppInstancePaidPlanPurchased as onAppInstancePaidPlanPurchased, context$3_onAppInstanceRemoved as onAppInstanceRemoved, onAppInstanceInstalled$1 as publicOnAppInstanceInstalled, onAppInstancePaidPlanAutoRenewalCancelled$1 as publicOnAppInstancePaidPlanAutoRenewalCancelled, onAppInstancePaidPlanChanged$1 as publicOnAppInstancePaidPlanChanged, onAppInstancePaidPlanPurchased$1 as publicOnAppInstancePaidPlanPurchased, onAppInstanceRemoved$1 as publicOnAppInstanceRemoved };
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
interface SendBIEventResponse {
|
|
1325
|
-
}
|
|
1326
|
-
interface SendBIEventRequest {
|
|
1327
|
-
/** Name of the event that's triggered in your app. */
|
|
1328
|
-
eventName?: EventName;
|
|
1329
|
-
/**
|
|
1330
|
-
* Name of your app's custom event that was triggered. Required when `{"eventName": "CUSTOM"}`.
|
|
1331
|
-
*
|
|
1332
|
-
* Min: 2 characters
|
|
1333
|
-
*/
|
|
1334
|
-
customEventName?: string | null;
|
|
1335
|
-
/**
|
|
1336
|
-
* Supported values include: `"cycle_name"`, `"currency"`, `"sum"`, `"reason"`, `"app_plan_id"`.
|
|
1337
|
-
* You may also submit data with keys that aren't listed here.
|
|
1338
|
-
*
|
|
1339
|
-
* Additional data about your app's event.
|
|
1340
|
-
*
|
|
1341
|
-
* + `"cycle_name"`: Supported values: `"monthly"`, `"yearly"`, `"2 years"`, `"one time"`.
|
|
1342
|
-
* + `"currency"`: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
|
1343
|
-
* + `"sum"`: Amount of money. Required for `{"eventName": "CHARGE"}` and `{"eventName": "FUNDS_RETURNED"}`.
|
|
1344
|
-
* + `"reason"`: Information about why the event was triggered in your app.
|
|
1345
|
-
* + `"app_plan_id"`: ID of the your app's plan as displayed in your app's dashboard. Note that it's the same value as `vendorProductId` in the [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).
|
|
1346
|
-
*/
|
|
1347
|
-
eventData?: Record<string, string>;
|
|
1348
|
-
}
|
|
1349
|
-
declare enum EventName {
|
|
1350
|
-
/** Unknown event name. */
|
|
1351
|
-
UNKNOWN = "UNKNOWN",
|
|
1352
|
-
/** A site owner or contributor loads your app's dashboard. */
|
|
1353
|
-
APP_DASHBOARD_LOADED = "APP_DASHBOARD_LOADED",
|
|
1354
|
-
/** The site owner completes all required configurations for your app in your app's dashboard. */
|
|
1355
|
-
APP_FINISHED_CONFIGURATION = "APP_FINISHED_CONFIGURATION",
|
|
1356
|
-
/** The site owner upgrades your app's paid plan. An upgrade means that they have finished the checkout flow on the app's side but not necessarily on Wix's side. */
|
|
1357
|
-
APP_UPGRADED = "APP_UPGRADED",
|
|
1358
|
-
/** A site owner, contributor, or visitor triggers your app's primary action. For example, a site visitor writes a product review using your product review app. */
|
|
1359
|
-
PRIMARY_ACTION_PERFORMED = "PRIMARY_ACTION_PERFORMED",
|
|
1360
|
-
/** Any event that's not listed here. Make sure to also send `customEventName`. */
|
|
1361
|
-
CUSTOM = "CUSTOM",
|
|
1362
|
-
/** You charge money from the site owner. For example, when the site owner purchases or renews a subscription for your app. Make sure to also send `eventData` and a key of `sum`. */
|
|
1363
|
-
CHARGE = "CHARGE",
|
|
1364
|
-
/** Trigger this event when you send money back to a site owner (for example, refunds or chargebacks). Make sure to also send the charge amount inside `eventData`. For example, `{"eventData": {"sum": "5.99"}}`. */
|
|
1365
|
-
FUNDS_RETURNED = "FUNDS_RETURNED",
|
|
1366
|
-
/** __Deprecation Notice:__ This enum value will be removed on March 30, 2023. Use `"APP_SETUP_FINISHED"` instead. */
|
|
1367
|
-
APP_FINISH_BUSINESS_SETUP = "APP_FINISH_BUSINESS_SETUP",
|
|
1368
|
-
/** Your app’s internal code implementation is changed and might affect user flows or cause a regression. */
|
|
1369
|
-
APP_DEPLOYED = "APP_DEPLOYED",
|
|
1370
|
-
/** The site owner completes your app's required business setup. */
|
|
1371
|
-
APP_SETUP_FINISHED = "APP_SETUP_FINISHED"
|
|
1372
|
-
}
|
|
1373
|
-
interface SendBiEventOptions {
|
|
1374
|
-
/** Name of the event that's triggered in your app. */
|
|
1375
|
-
eventName?: EventName;
|
|
1376
|
-
/**
|
|
1377
|
-
* Name of your app's custom event that was triggered. Required when `{"eventName": "CUSTOM"}`.
|
|
1378
|
-
*
|
|
1379
|
-
* Min: 2 characters
|
|
1380
|
-
*/
|
|
1381
|
-
customEventName?: string | null;
|
|
1382
|
-
/**
|
|
1383
|
-
* Supported values include: `"cycle_name"`, `"currency"`, `"sum"`, `"reason"`, `"app_plan_id"`.
|
|
1384
|
-
* You may also submit data with keys that aren't listed here.
|
|
1385
|
-
*
|
|
1386
|
-
* Additional data about your app's event.
|
|
1387
|
-
*
|
|
1388
|
-
* + `"cycle_name"`: Supported values: `"monthly"`, `"yearly"`, `"2 years"`, `"one time"`.
|
|
1389
|
-
* + `"currency"`: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
|
1390
|
-
* + `"sum"`: Amount of money. Required for `{"eventName": "CHARGE"}` and `{"eventName": "FUNDS_RETURNED"}`.
|
|
1391
|
-
* + `"reason"`: Information about why the event was triggered in your app.
|
|
1392
|
-
* + `"app_plan_id"`: ID of the your app's plan as displayed in your app's dashboard. Note that it's the same value as `vendorProductId` in the [Paid Plan Purchased webhook](https://dev.wix.com/docs/rest/api-reference/app-management/apps/app-instance/paid-plan-purchased).
|
|
1393
|
-
*/
|
|
1394
|
-
eventData?: Record<string, string>;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
declare function sendBiEvent$1(httpClient: HttpClient): SendBiEventSignature;
|
|
1398
|
-
interface SendBiEventSignature {
|
|
1399
|
-
/**
|
|
1400
|
-
* Submit a BI event to Wix.
|
|
1401
|
-
*/
|
|
1402
|
-
(options?: SendBiEventOptions | undefined): Promise<void>;
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
|
-
declare const sendBiEvent: MaybeContext<BuildRESTFunction<typeof sendBiEvent$1> & typeof sendBiEvent$1>;
|
|
1406
|
-
|
|
1407
|
-
type context$2_EventName = EventName;
|
|
1408
|
-
declare const context$2_EventName: typeof EventName;
|
|
1409
|
-
type context$2_SendBIEventRequest = SendBIEventRequest;
|
|
1410
|
-
type context$2_SendBIEventResponse = SendBIEventResponse;
|
|
1411
|
-
type context$2_SendBiEventOptions = SendBiEventOptions;
|
|
1412
|
-
declare const context$2_sendBiEvent: typeof sendBiEvent;
|
|
1413
|
-
declare namespace context$2 {
|
|
1414
|
-
export { context$2_EventName as EventName, type context$2_SendBIEventRequest as SendBIEventRequest, type context$2_SendBIEventResponse as SendBIEventResponse, type context$2_SendBiEventOptions as SendBiEventOptions, context$2_sendBiEvent as sendBiEvent };
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
interface PurchasedItem {
|
|
1418
|
-
/** ID of your app's paid plan. */
|
|
1419
|
-
productId?: string;
|
|
1420
|
-
/** Price of your app's paid plan. For example, `9.95`. */
|
|
1421
|
-
price?: string;
|
|
1422
|
-
/**
|
|
1423
|
-
* 3-letter currency code in
|
|
1424
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
|
1425
|
-
*/
|
|
1426
|
-
currency?: string;
|
|
1427
|
-
/** Information about the billing cycle for your app's paid plan. */
|
|
1428
|
-
billingCycle?: PaymentCycle;
|
|
1429
|
-
/**
|
|
1430
|
-
* Date and time the site onwers have purchased your app's paid plan in
|
|
1431
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1432
|
-
*/
|
|
1433
|
-
dateCreated?: Date | null;
|
|
1434
|
-
}
|
|
1435
|
-
declare enum PaymentCycle {
|
|
1436
|
-
NO_CYCLE = "NO_CYCLE",
|
|
1437
|
-
MONTHLY = "MONTHLY",
|
|
1438
|
-
YEARLY = "YEARLY",
|
|
1439
|
-
ONE_TIME = "ONE_TIME",
|
|
1440
|
-
TWO_YEARS = "TWO_YEARS",
|
|
1441
|
-
THREE_YEARS = "THREE_YEARS",
|
|
1442
|
-
FOUR_YEARS = "FOUR_YEARS",
|
|
1443
|
-
FIVE_YEARS = "FIVE_YEARS"
|
|
1444
|
-
}
|
|
1445
|
-
interface InvoiceStatusUpdate {
|
|
1446
|
-
/** Invoice payment status. */
|
|
1447
|
-
status?: InvoiceStatus;
|
|
1448
|
-
/** Wix Premium invoice ID. */
|
|
1449
|
-
invoiceId?: string;
|
|
1450
|
-
/** App instance ID - a unique ID assigned to each app in each site. */
|
|
1451
|
-
instanceId?: string | null;
|
|
1452
|
-
/** Whether the invoice is for a single payment or for multiple, recurring payments. */
|
|
1453
|
-
recurring?: boolean;
|
|
1454
|
-
}
|
|
1455
|
-
declare enum InvoiceStatus {
|
|
1456
|
-
UNKNOWN_INVOICE_STATUS = "UNKNOWN_INVOICE_STATUS",
|
|
1457
|
-
PAYMENT_FAILED = "PAYMENT_FAILED",
|
|
1458
|
-
PAID = "PAID",
|
|
1459
|
-
REFUNDED = "REFUNDED",
|
|
1460
|
-
VOIDED = "VOIDED",
|
|
1461
|
-
CHARGEDBACK = "CHARGEDBACK"
|
|
1462
|
-
}
|
|
1463
|
-
interface GetUrlRequest {
|
|
1464
|
-
/**
|
|
1465
|
-
* ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard
|
|
1466
|
-
* for a list of your app's supported product IDs.
|
|
1467
|
-
*/
|
|
1468
|
-
productId: string;
|
|
1469
|
-
/**
|
|
1470
|
-
* URL for the Wix checkout page. Redirect site owners to this URL after
|
|
1471
|
-
* they've successfully purchased a paid plan for your app.
|
|
1472
|
-
*/
|
|
1473
|
-
successUrl?: string | null;
|
|
1474
|
-
/**
|
|
1475
|
-
* Whether the checkout is for testing purposes only. Testing is mainly
|
|
1476
|
-
* relevant for in-app purchase flows. When `true`, Wix charges the site
|
|
1477
|
-
* owners an amount of `0.00`.
|
|
1478
|
-
*/
|
|
1479
|
-
testCheckout?: boolean;
|
|
1480
|
-
/** Information about the paid plan's billing cycle. */
|
|
1481
|
-
billingCycle?: PaymentCycle;
|
|
1482
|
-
/**
|
|
1483
|
-
* 2-letter country code in
|
|
1484
|
-
* [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
|
|
1485
|
-
* format.
|
|
1486
|
-
*
|
|
1487
|
-
* Default: `"US"`
|
|
1488
|
-
*/
|
|
1489
|
-
countryCode?: string | null;
|
|
1490
|
-
/**
|
|
1491
|
-
* 2-letter language code in
|
|
1492
|
-
* [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
1493
|
-
*
|
|
1494
|
-
* Default: `"EN"`
|
|
1495
|
-
*/
|
|
1496
|
-
languageCode?: string | null;
|
|
1497
|
-
/** Coupon code for the paid plan. Available only in case there is a discount. */
|
|
1498
|
-
couponCode?: string | null;
|
|
1499
|
-
}
|
|
1500
|
-
interface ChargeOverride {
|
|
1501
|
-
/**
|
|
1502
|
-
* Override price. In case you omit the override price, Wix charges site
|
|
1503
|
-
* owners the app's default price that's configured in the Pricing page of your app's dashboard.
|
|
1504
|
-
*/
|
|
1505
|
-
price?: number;
|
|
1506
|
-
/**
|
|
1507
|
-
* Override 3-letter currency code in
|
|
1508
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
|
1509
|
-
*/
|
|
1510
|
-
currency?: string;
|
|
1511
|
-
}
|
|
1512
|
-
interface GetUrlResponse {
|
|
1513
|
-
/** URL for the Wix checkout page. */
|
|
1514
|
-
checkoutUrl?: string;
|
|
1515
|
-
/**
|
|
1516
|
-
* Token for the Wix checkout page. The token holds all data about the order
|
|
1517
|
-
* you're creating a checkout for. It is [signed](),
|
|
1518
|
-
* so you can verify that it comes from Wix.
|
|
1519
|
-
*/
|
|
1520
|
-
token?: string | null;
|
|
1521
|
-
}
|
|
1522
|
-
interface GetPurchaseHistoryRequest {
|
|
1523
|
-
}
|
|
1524
|
-
interface GetPurchaseHistoryResponse {
|
|
1525
|
-
/** Retrieved purchases the site owners have completed for you app. */
|
|
1526
|
-
purchases?: PurchasedItem[];
|
|
1527
|
-
}
|
|
1528
|
-
interface GetSitePaymentMethodsStatusRequest {
|
|
1529
|
-
}
|
|
1530
|
-
interface GetSitePaymentMethodsStatusResponse {
|
|
1531
|
-
/**
|
|
1532
|
-
* Whether the site owners have enabled at least a single online payment method.
|
|
1533
|
-
* Online payment methods include Wix Payments, Stripe, PayPal, and credit
|
|
1534
|
-
* cards.
|
|
1535
|
-
*/
|
|
1536
|
-
onlineProviderEnabled?: boolean;
|
|
1537
|
-
/** Whether the site owners accept offline payments. */
|
|
1538
|
-
offlineProviderEnabled?: boolean;
|
|
1539
|
-
/**
|
|
1540
|
-
* Whether the site owners have enabled the
|
|
1541
|
-
* [Wix Point of Sale](https://www.wix.com/pos).
|
|
1542
|
-
* This allows their customers to make electronic payments in person.
|
|
1543
|
-
*/
|
|
1544
|
-
wixPosProviderEnabled?: boolean;
|
|
1545
|
-
/**
|
|
1546
|
-
* Whether the site owners have enabled at least one 3rd-party point-of-sale
|
|
1547
|
-
* provider. This allows their customers to make electronic payments in person.
|
|
1548
|
-
*/
|
|
1549
|
-
thirdPartyPosProviderEnabled?: boolean;
|
|
1550
|
-
}
|
|
1551
|
-
interface GetMeteredBillingChargesRequest {
|
|
1552
|
-
/**
|
|
1553
|
-
* 3-letter currency code in
|
|
1554
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
|
1555
|
-
*/
|
|
1556
|
-
currency?: string | null;
|
|
1557
|
-
/**
|
|
1558
|
-
* Start of the period you want to retrieve the custom charges for in
|
|
1559
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1560
|
-
*/
|
|
1561
|
-
startDate?: Date | null;
|
|
1562
|
-
/**
|
|
1563
|
-
* End of the period you want to retrieve the custom charges for in
|
|
1564
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1565
|
-
*/
|
|
1566
|
-
endDate?: Date | null;
|
|
1567
|
-
}
|
|
1568
|
-
interface GetMeteredBillingChargesResponse {
|
|
1569
|
-
/** List of retrieved custom charges. */
|
|
1570
|
-
charges?: Charge[];
|
|
1571
|
-
}
|
|
1572
|
-
interface Charge {
|
|
1573
|
-
/** ID of the custom charge. The ID consists of 64 characters. */
|
|
1574
|
-
_id?: string | null;
|
|
1575
|
-
/** Description of the custom charge. */
|
|
1576
|
-
description?: string;
|
|
1577
|
-
/**
|
|
1578
|
-
* Charge amount.
|
|
1579
|
-
*
|
|
1580
|
-
* Min: `0.50`
|
|
1581
|
-
*/
|
|
1582
|
-
amount?: string;
|
|
1583
|
-
}
|
|
1584
|
-
interface MessageEnvelope {
|
|
1585
|
-
/** App instance ID. */
|
|
1586
|
-
instanceId?: string | null;
|
|
1587
|
-
/** Event type. */
|
|
1588
|
-
eventType?: string;
|
|
1589
|
-
/** The identification type and identity data. */
|
|
1590
|
-
identity?: IdentificationData;
|
|
1591
|
-
/** Stringify payload. */
|
|
1592
|
-
data?: string;
|
|
1593
|
-
}
|
|
1594
|
-
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
1595
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
1596
|
-
anonymousVisitorId?: string;
|
|
1597
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
1598
|
-
memberId?: string;
|
|
1599
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1600
|
-
wixUserId?: string;
|
|
1601
|
-
/** ID of an app. */
|
|
1602
|
-
appId?: string;
|
|
1603
|
-
/** @readonly */
|
|
1604
|
-
identityType?: WebhookIdentityType;
|
|
1605
|
-
}
|
|
1606
|
-
/** @oneof */
|
|
1607
|
-
interface IdentificationDataIdOneOf {
|
|
1608
|
-
/** ID of a site visitor that has not logged in to the site. */
|
|
1609
|
-
anonymousVisitorId?: string;
|
|
1610
|
-
/** ID of a site visitor that has logged in to the site. */
|
|
1611
|
-
memberId?: string;
|
|
1612
|
-
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1613
|
-
wixUserId?: string;
|
|
1614
|
-
/** ID of an app. */
|
|
1615
|
-
appId?: string;
|
|
1616
|
-
}
|
|
1617
|
-
declare enum WebhookIdentityType {
|
|
1618
|
-
UNKNOWN = "UNKNOWN",
|
|
1619
|
-
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1620
|
-
MEMBER = "MEMBER",
|
|
1621
|
-
WIX_USER = "WIX_USER",
|
|
1622
|
-
APP = "APP"
|
|
1623
|
-
}
|
|
1624
|
-
interface GetUrlResponseNonNullableFields {
|
|
1625
|
-
checkoutUrl: string;
|
|
1626
|
-
}
|
|
1627
|
-
interface PurchasedItemNonNullableFields {
|
|
1628
|
-
productId: string;
|
|
1629
|
-
price: string;
|
|
1630
|
-
currency: string;
|
|
1631
|
-
billingCycle: PaymentCycle;
|
|
1632
|
-
}
|
|
1633
|
-
interface GetPurchaseHistoryResponseNonNullableFields {
|
|
1634
|
-
purchases: PurchasedItemNonNullableFields[];
|
|
1635
|
-
}
|
|
1636
|
-
interface GetUrlOptions {
|
|
1637
|
-
/**
|
|
1638
|
-
* URL for the Wix checkout page. Redirect site owners to this URL after
|
|
1639
|
-
* they've successfully purchased a paid plan for your app.
|
|
1640
|
-
*/
|
|
1641
|
-
successUrl?: string | null;
|
|
1642
|
-
/**
|
|
1643
|
-
* Whether the checkout is for testing purposes only. Testing is mainly
|
|
1644
|
-
* relevant for in-app purchase flows. When `true`, Wix charges the site
|
|
1645
|
-
* owners an amount of `0.00`.
|
|
1646
|
-
*/
|
|
1647
|
-
testCheckout?: boolean;
|
|
1648
|
-
/** Information about the paid plan's billing cycle. */
|
|
1649
|
-
billingCycle?: PaymentCycle;
|
|
1650
|
-
/**
|
|
1651
|
-
* 2-letter country code in
|
|
1652
|
-
* [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
|
|
1653
|
-
* format.
|
|
1654
|
-
*
|
|
1655
|
-
* Default: `"US"`
|
|
1656
|
-
*/
|
|
1657
|
-
countryCode?: string | null;
|
|
1658
|
-
/**
|
|
1659
|
-
* 2-letter language code in
|
|
1660
|
-
* [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
1661
|
-
*
|
|
1662
|
-
* Default: `"EN"`
|
|
1663
|
-
*/
|
|
1664
|
-
languageCode?: string | null;
|
|
1665
|
-
/** Coupon code for the paid plan. Available only in case there is a discount. */
|
|
1666
|
-
couponCode?: string | null;
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
declare function getUrl$1(httpClient: HttpClient): GetUrlSignature;
|
|
1670
|
-
interface GetUrlSignature {
|
|
1671
|
-
/**
|
|
1672
|
-
* Retrieves the URL for a Wix checkout page for the specified paid plan of your app.
|
|
1673
|
-
*
|
|
1674
|
-
*
|
|
1675
|
-
* This call succeeds only in case you have previously
|
|
1676
|
-
* [set up an external pricing page in your app's dashboard](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-an-external-pricing-page).
|
|
1677
|
-
*
|
|
1678
|
-
* The returned checkout URL is valid for 48 hours.
|
|
1679
|
-
*
|
|
1680
|
-
* This API allows your app to manage your pricing page outside of Wix while
|
|
1681
|
-
* still using the standard Wix checkout flow.
|
|
1682
|
-
* @param - ID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard
|
|
1683
|
-
* for a list of your app's supported product IDs.
|
|
1684
|
-
*/
|
|
1685
|
-
(productId: string, options?: GetUrlOptions | undefined): Promise<GetUrlResponse & GetUrlResponseNonNullableFields>;
|
|
1686
|
-
}
|
|
1687
|
-
declare function getPurchaseHistory$1(httpClient: HttpClient): GetPurchaseHistorySignature;
|
|
1688
|
-
interface GetPurchaseHistorySignature {
|
|
1689
|
-
/**
|
|
1690
|
-
* Retrieves a list of the site owner's past purchases for your app.
|
|
1691
|
-
*
|
|
1692
|
-
*
|
|
1693
|
-
* You don't have to explicitly pass an identifier for the Wix site as part of
|
|
1694
|
-
* the request, since this information is taken automatically from the context.
|
|
1695
|
-
*
|
|
1696
|
-
* The response doesn't include any details about cancellations.
|
|
1697
|
-
*/
|
|
1698
|
-
(): Promise<GetPurchaseHistoryResponse & GetPurchaseHistoryResponseNonNullableFields>;
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
declare const getUrl: MaybeContext<BuildRESTFunction<typeof getUrl$1> & typeof getUrl$1>;
|
|
1702
|
-
declare const getPurchaseHistory: MaybeContext<BuildRESTFunction<typeof getPurchaseHistory$1> & typeof getPurchaseHistory$1>;
|
|
1703
|
-
|
|
1704
|
-
type context$1_Charge = Charge;
|
|
1705
|
-
type context$1_ChargeOverride = ChargeOverride;
|
|
1706
|
-
type context$1_GetMeteredBillingChargesRequest = GetMeteredBillingChargesRequest;
|
|
1707
|
-
type context$1_GetMeteredBillingChargesResponse = GetMeteredBillingChargesResponse;
|
|
1708
|
-
type context$1_GetPurchaseHistoryRequest = GetPurchaseHistoryRequest;
|
|
1709
|
-
type context$1_GetPurchaseHistoryResponse = GetPurchaseHistoryResponse;
|
|
1710
|
-
type context$1_GetPurchaseHistoryResponseNonNullableFields = GetPurchaseHistoryResponseNonNullableFields;
|
|
1711
|
-
type context$1_GetSitePaymentMethodsStatusRequest = GetSitePaymentMethodsStatusRequest;
|
|
1712
|
-
type context$1_GetSitePaymentMethodsStatusResponse = GetSitePaymentMethodsStatusResponse;
|
|
1713
|
-
type context$1_GetUrlOptions = GetUrlOptions;
|
|
1714
|
-
type context$1_GetUrlRequest = GetUrlRequest;
|
|
1715
|
-
type context$1_GetUrlResponse = GetUrlResponse;
|
|
1716
|
-
type context$1_GetUrlResponseNonNullableFields = GetUrlResponseNonNullableFields;
|
|
1717
|
-
type context$1_IdentificationData = IdentificationData;
|
|
1718
|
-
type context$1_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
|
1719
|
-
type context$1_InvoiceStatus = InvoiceStatus;
|
|
1720
|
-
declare const context$1_InvoiceStatus: typeof InvoiceStatus;
|
|
1721
|
-
type context$1_InvoiceStatusUpdate = InvoiceStatusUpdate;
|
|
1722
|
-
type context$1_MessageEnvelope = MessageEnvelope;
|
|
1723
|
-
type context$1_PaymentCycle = PaymentCycle;
|
|
1724
|
-
declare const context$1_PaymentCycle: typeof PaymentCycle;
|
|
1725
|
-
type context$1_PurchasedItem = PurchasedItem;
|
|
1726
|
-
type context$1_WebhookIdentityType = WebhookIdentityType;
|
|
1727
|
-
declare const context$1_WebhookIdentityType: typeof WebhookIdentityType;
|
|
1728
|
-
declare const context$1_getPurchaseHistory: typeof getPurchaseHistory;
|
|
1729
|
-
declare const context$1_getUrl: typeof getUrl;
|
|
1730
|
-
declare namespace context$1 {
|
|
1731
|
-
export { type context$1_Charge as Charge, type context$1_ChargeOverride as ChargeOverride, type context$1_GetMeteredBillingChargesRequest as GetMeteredBillingChargesRequest, type context$1_GetMeteredBillingChargesResponse as GetMeteredBillingChargesResponse, type context$1_GetPurchaseHistoryRequest as GetPurchaseHistoryRequest, type context$1_GetPurchaseHistoryResponse as GetPurchaseHistoryResponse, type context$1_GetPurchaseHistoryResponseNonNullableFields as GetPurchaseHistoryResponseNonNullableFields, type context$1_GetSitePaymentMethodsStatusRequest as GetSitePaymentMethodsStatusRequest, type context$1_GetSitePaymentMethodsStatusResponse as GetSitePaymentMethodsStatusResponse, type context$1_GetUrlOptions as GetUrlOptions, type context$1_GetUrlRequest as GetUrlRequest, type context$1_GetUrlResponse as GetUrlResponse, type context$1_GetUrlResponseNonNullableFields as GetUrlResponseNonNullableFields, type context$1_IdentificationData as IdentificationData, type context$1_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context$1_InvoiceStatus as InvoiceStatus, type context$1_InvoiceStatusUpdate as InvoiceStatusUpdate, type context$1_MessageEnvelope as MessageEnvelope, context$1_PaymentCycle as PaymentCycle, type context$1_PurchasedItem as PurchasedItem, context$1_WebhookIdentityType as WebhookIdentityType, context$1_getPurchaseHistory as getPurchaseHistory, context$1_getUrl as getUrl };
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
/** Embedded script data */
|
|
1735
|
-
interface ScriptProperties {
|
|
1736
|
-
/** Script parameters */
|
|
1737
|
-
parameters?: Record<string, string>;
|
|
1738
|
-
/** Whether script is disabled or not, defaults to false (not disabled) */
|
|
1739
|
-
disabled?: boolean;
|
|
1740
|
-
}
|
|
1741
|
-
interface EmbedScriptRequest {
|
|
1742
|
-
/** Details of the script to embed. */
|
|
1743
|
-
properties: ScriptProperties;
|
|
1744
|
-
/** ID of the corresponding embedded script component. */
|
|
1745
|
-
componentId?: string | null;
|
|
1746
|
-
}
|
|
1747
|
-
interface EmbedScriptResponse {
|
|
1748
|
-
/** Details of the embedded script. */
|
|
1749
|
-
properties?: ScriptProperties;
|
|
1750
|
-
}
|
|
1751
|
-
interface GetEmbeddedScriptRequest {
|
|
1752
|
-
/** Component ID of the embedded script to retrieve. */
|
|
1753
|
-
componentId?: string | null;
|
|
1754
|
-
}
|
|
1755
|
-
interface GetEmbeddedScriptResponse {
|
|
1756
|
-
/** Details of the retrieved embedded script. */
|
|
1757
|
-
properties?: ScriptProperties;
|
|
1758
|
-
}
|
|
1759
|
-
interface EmbedScriptByInstanceIdRequest {
|
|
1760
|
-
instanceId?: string;
|
|
1761
|
-
/** Parameters to embed */
|
|
1762
|
-
properties?: ScriptProperties;
|
|
1763
|
-
componentId?: string | null;
|
|
1764
|
-
}
|
|
1765
|
-
interface GetEmbeddedScriptByInstanceIdRequest {
|
|
1766
|
-
instanceId?: string;
|
|
1767
|
-
componentId?: string | null;
|
|
1768
|
-
}
|
|
1769
|
-
interface ScriptPropertiesNonNullableFields {
|
|
1770
|
-
disabled: boolean;
|
|
1771
|
-
}
|
|
1772
|
-
interface EmbedScriptResponseNonNullableFields {
|
|
1773
|
-
properties?: ScriptPropertiesNonNullableFields;
|
|
1774
|
-
}
|
|
1775
|
-
interface GetEmbeddedScriptResponseNonNullableFields {
|
|
1776
|
-
properties?: ScriptPropertiesNonNullableFields;
|
|
1777
|
-
}
|
|
1778
|
-
interface EmbedScriptOptions {
|
|
1779
|
-
/** ID of the corresponding embedded script component. */
|
|
1780
|
-
componentId?: string | null;
|
|
1781
|
-
}
|
|
1782
|
-
interface GetEmbeddedScriptOptions {
|
|
1783
|
-
/** Component ID of the embedded script to retrieve. */
|
|
1784
|
-
componentId?: string | null;
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
declare function embedScript$1(httpClient: HttpClient): EmbedScriptSignature;
|
|
1788
|
-
interface EmbedScriptSignature {
|
|
1789
|
-
/**
|
|
1790
|
-
* Inserts custom script tags into a site.
|
|
1791
|
-
*
|
|
1792
|
-
*
|
|
1793
|
-
* Your app must have an existing
|
|
1794
|
-
* [embedded script component](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/embedded-scripts/about-embedded-scripts),
|
|
1795
|
-
* with exactly matching parameter names.
|
|
1796
|
-
* @param - Details of the script to embed.
|
|
1797
|
-
*/
|
|
1798
|
-
(properties: ScriptProperties, options?: EmbedScriptOptions | undefined): Promise<EmbedScriptResponse & EmbedScriptResponseNonNullableFields>;
|
|
1799
|
-
}
|
|
1800
|
-
declare function getEmbeddedScript$1(httpClient: HttpClient): GetEmbeddedScriptSignature;
|
|
1801
|
-
interface GetEmbeddedScriptSignature {
|
|
1802
|
-
/**
|
|
1803
|
-
* Retrieves information about your app's existing embedded script.
|
|
1804
|
-
*
|
|
1805
|
-
*
|
|
1806
|
-
* The call fails with `404` error in case your app doesn't include an
|
|
1807
|
-
* embedded script on the site.
|
|
1808
|
-
* @returns Details of the retrieved embedded script.
|
|
1809
|
-
*/
|
|
1810
|
-
(options?: GetEmbeddedScriptOptions | undefined): Promise<ScriptProperties & ScriptPropertiesNonNullableFields>;
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
declare const embedScript: MaybeContext<BuildRESTFunction<typeof embedScript$1> & typeof embedScript$1>;
|
|
1814
|
-
declare const getEmbeddedScript: MaybeContext<BuildRESTFunction<typeof getEmbeddedScript$1> & typeof getEmbeddedScript$1>;
|
|
1815
|
-
|
|
1816
|
-
type context_EmbedScriptByInstanceIdRequest = EmbedScriptByInstanceIdRequest;
|
|
1817
|
-
type context_EmbedScriptOptions = EmbedScriptOptions;
|
|
1818
|
-
type context_EmbedScriptRequest = EmbedScriptRequest;
|
|
1819
|
-
type context_EmbedScriptResponse = EmbedScriptResponse;
|
|
1820
|
-
type context_EmbedScriptResponseNonNullableFields = EmbedScriptResponseNonNullableFields;
|
|
1821
|
-
type context_GetEmbeddedScriptByInstanceIdRequest = GetEmbeddedScriptByInstanceIdRequest;
|
|
1822
|
-
type context_GetEmbeddedScriptOptions = GetEmbeddedScriptOptions;
|
|
1823
|
-
type context_GetEmbeddedScriptRequest = GetEmbeddedScriptRequest;
|
|
1824
|
-
type context_GetEmbeddedScriptResponse = GetEmbeddedScriptResponse;
|
|
1825
|
-
type context_GetEmbeddedScriptResponseNonNullableFields = GetEmbeddedScriptResponseNonNullableFields;
|
|
1826
|
-
type context_ScriptProperties = ScriptProperties;
|
|
1827
|
-
type context_ScriptPropertiesNonNullableFields = ScriptPropertiesNonNullableFields;
|
|
1828
|
-
declare const context_embedScript: typeof embedScript;
|
|
1829
|
-
declare const context_getEmbeddedScript: typeof getEmbeddedScript;
|
|
1830
|
-
declare namespace context {
|
|
1831
|
-
export { type context_EmbedScriptByInstanceIdRequest as EmbedScriptByInstanceIdRequest, type context_EmbedScriptOptions as EmbedScriptOptions, type context_EmbedScriptRequest as EmbedScriptRequest, type context_EmbedScriptResponse as EmbedScriptResponse, type context_EmbedScriptResponseNonNullableFields as EmbedScriptResponseNonNullableFields, type context_GetEmbeddedScriptByInstanceIdRequest as GetEmbeddedScriptByInstanceIdRequest, type context_GetEmbeddedScriptOptions as GetEmbeddedScriptOptions, type context_GetEmbeddedScriptRequest as GetEmbeddedScriptRequest, type context_GetEmbeddedScriptResponse as GetEmbeddedScriptResponse, type context_GetEmbeddedScriptResponseNonNullableFields as GetEmbeddedScriptResponseNonNullableFields, type context_ScriptProperties as ScriptProperties, type context_ScriptPropertiesNonNullableFields as ScriptPropertiesNonNullableFields, context_embedScript as embedScript, context_getEmbeddedScript as getEmbeddedScript };
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
export { context$3 as appInstances, context$4 as appPlans, context$2 as biEvents, context$1 as billing, context as embeddedScripts };
|