@wix/redirects 1.0.60 → 1.0.62
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/cjs/context.js +1 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/meta.js +1 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/context.js +1 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.js +1 -0
- package/build/es/index.js.map +1 -0
- package/build/es/meta.js +1 -0
- package/build/es/meta.js.map +1 -0
- package/package.json +3 -3
- package/type-bundles/context.bundle.d.ts +461 -25
- package/type-bundles/index.bundle.d.ts +461 -25
- package/type-bundles/meta.bundle.d.ts +4 -0
package/build/cjs/context.js
CHANGED
|
@@ -25,3 +25,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.redirects = void 0;
|
|
27
27
|
exports.redirects = __importStar(require("@wix/redirects_redirects/context"));
|
|
28
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAA8D"}
|
package/build/cjs/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAsD;AAE7C,8BAAS"}
|
package/build/cjs/meta.js
CHANGED
|
@@ -25,3 +25,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.redirects = void 0;
|
|
27
27
|
exports.redirects = __importStar(require("@wix/redirects_redirects/meta"));
|
|
28
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2EAA2D"}
|
package/build/es/context.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,kCAAkC,CAAC"}
|
package/build/es/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/build/es/meta.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/redirects",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.62",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"type-bundles"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@wix/redirects_redirects": "1.0.
|
|
24
|
+
"@wix/redirects_redirects": "1.0.31"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"glob": "^10.4.1",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"fqdn": ""
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
"falconPackageHash": "
|
|
49
|
+
"falconPackageHash": "a16aa54e32248d9a156144093b0aa8eb718a065c1be16866a7fa578b"
|
|
50
50
|
}
|
|
@@ -1,8 +1,51 @@
|
|
|
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
|
+
|
|
1
43
|
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
44
|
interface HttpClient {
|
|
3
45
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
46
|
fetchWithAuth: typeof fetch;
|
|
5
47
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
48
|
+
getActiveToken?: () => string | undefined;
|
|
6
49
|
}
|
|
7
50
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
51
|
type HttpResponse<T = any> = {
|
|
@@ -35,6 +78,55 @@ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?
|
|
|
35
78
|
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
79
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
37
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
|
+
|
|
38
130
|
declare global {
|
|
39
131
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
40
132
|
interface SymbolConstructor {
|
|
@@ -42,6 +134,348 @@ declare global {
|
|
|
42
134
|
}
|
|
43
135
|
}
|
|
44
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
|
+
|
|
45
479
|
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
|
|
46
480
|
interface RedirectSession {
|
|
47
481
|
/** ID of the redirect session created. */
|
|
@@ -226,6 +660,8 @@ interface Location {
|
|
|
226
660
|
name?: string | null;
|
|
227
661
|
/** The full address of this location. */
|
|
228
662
|
formattedAddress?: string | null;
|
|
663
|
+
/** The full translated address of this location. */
|
|
664
|
+
formattedAddressTranslated?: string | null;
|
|
229
665
|
/**
|
|
230
666
|
* Location type.
|
|
231
667
|
*
|
|
@@ -369,15 +805,15 @@ interface RedirectSessionMembersAccountParams {
|
|
|
369
805
|
section?: MembersAccountSection;
|
|
370
806
|
}
|
|
371
807
|
declare enum MembersAccountSection {
|
|
372
|
-
/**
|
|
808
|
+
/** Account info section in "my account". */
|
|
373
809
|
ACCOUNT_INFO = "ACCOUNT_INFO",
|
|
374
|
-
/** My Bookings section in "my account" */
|
|
810
|
+
/** My Bookings section in "my account". */
|
|
375
811
|
BOOKINGS = "BOOKINGS",
|
|
376
|
-
/** My Orders section in "my account" */
|
|
812
|
+
/** My Orders section in "my account". */
|
|
377
813
|
ORDERS = "ORDERS",
|
|
378
|
-
/** Subscriptions section in "my account" */
|
|
814
|
+
/** Subscriptions section in "my account". */
|
|
379
815
|
SUBSCRIPTIONS = "SUBSCRIPTIONS",
|
|
380
|
-
/** Events section in "my account" */
|
|
816
|
+
/** Events section in "my account". */
|
|
381
817
|
EVENTS = "EVENTS"
|
|
382
818
|
}
|
|
383
819
|
interface RedirectSessionStoresProductParams {
|
|
@@ -506,11 +942,11 @@ interface CreateAnonymousRedirectSessionResponse {
|
|
|
506
942
|
redirectSession?: RedirectSession;
|
|
507
943
|
}
|
|
508
944
|
interface AttachPagesRequest {
|
|
509
|
-
/**
|
|
945
|
+
/** App ID that we want to inherit pages for. */
|
|
510
946
|
appDefId?: string;
|
|
511
947
|
}
|
|
512
948
|
interface AttachPagesResponse {
|
|
513
|
-
/** The status of the operation */
|
|
949
|
+
/** The status of the operation. */
|
|
514
950
|
status?: AttachPagesResponseStatus;
|
|
515
951
|
/** A descriptive message about the operation */
|
|
516
952
|
message?: string;
|
|
@@ -520,35 +956,35 @@ interface AttachPagesResponse {
|
|
|
520
956
|
sitePublished?: boolean;
|
|
521
957
|
}
|
|
522
958
|
declare enum AttachPagesResponseStatus {
|
|
523
|
-
/** Invalid value
|
|
959
|
+
/** Invalid value. */
|
|
524
960
|
UNKNOWN = "UNKNOWN",
|
|
525
|
-
/** Pages were successfully attached */
|
|
961
|
+
/** Pages were successfully attached. */
|
|
526
962
|
SUCCESS = "SUCCESS",
|
|
527
|
-
/** No pages were attached because the site is already published */
|
|
963
|
+
/** No pages were attached because the site is already published. */
|
|
528
964
|
NO_ACTION = "NO_ACTION",
|
|
529
|
-
/** An error occurred, such as site or app not
|
|
965
|
+
/** An error occurred, such as when the site or app is not found. */
|
|
530
966
|
ERROR = "ERROR"
|
|
531
967
|
}
|
|
532
968
|
interface ValidateCallbackURLRequest {
|
|
533
969
|
/** An external URL to validate */
|
|
534
970
|
callbackUrl?: string;
|
|
535
|
-
/**
|
|
971
|
+
/** Type of the callback URL. */
|
|
536
972
|
callbackType?: CallbackType;
|
|
537
973
|
/** The oauth app id used in order to pull the allowed domains from, has to correspond to the same metasite as the site in context */
|
|
538
974
|
clientId?: string;
|
|
539
975
|
}
|
|
540
976
|
declare enum CallbackType {
|
|
541
|
-
/** Invalid value
|
|
977
|
+
/** Invalid value. */
|
|
542
978
|
UNKNOWN = "UNKNOWN",
|
|
543
|
-
/**
|
|
979
|
+
/** Callback URL is used for the logout flow. */
|
|
544
980
|
LOGOUT = "LOGOUT",
|
|
545
|
-
/**
|
|
981
|
+
/** Callback URL is used for a checkout flow. */
|
|
546
982
|
CHECKOUT = "CHECKOUT",
|
|
547
|
-
/**
|
|
983
|
+
/** Callback URL is used for the authorize flow. */
|
|
548
984
|
AUTHORIZE = "AUTHORIZE"
|
|
549
985
|
}
|
|
550
986
|
interface ValidateCallbackURLResponse {
|
|
551
|
-
/**
|
|
987
|
+
/** Indicates if the provided URL is allowed for the given client id */
|
|
552
988
|
isValid?: boolean;
|
|
553
989
|
}
|
|
554
990
|
interface SignInURLRequest {
|
|
@@ -562,15 +998,15 @@ interface SignInURLResponse {
|
|
|
562
998
|
interface AttachAllTemplatesRequest {
|
|
563
999
|
}
|
|
564
1000
|
interface AttachAllTemplatesResponse {
|
|
565
|
-
/** The status of the operation */
|
|
1001
|
+
/** The status of the operation. */
|
|
566
1002
|
status?: Status;
|
|
567
1003
|
}
|
|
568
1004
|
declare enum Status {
|
|
569
|
-
/** Invalid value
|
|
1005
|
+
/** Invalid value. */
|
|
570
1006
|
UNKNOWN = "UNKNOWN",
|
|
571
|
-
/**
|
|
1007
|
+
/** Templates were successfully attached. */
|
|
572
1008
|
SUCCESS = "SUCCESS",
|
|
573
|
-
/** An error occurred */
|
|
1009
|
+
/** An error occurred. */
|
|
574
1010
|
ERROR = "ERROR"
|
|
575
1011
|
}
|
|
576
1012
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
@@ -597,7 +1033,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
597
1033
|
/** ID of the entity associated with the event. */
|
|
598
1034
|
entityId?: string;
|
|
599
1035
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
600
|
-
eventTime?: Date;
|
|
1036
|
+
eventTime?: Date | null;
|
|
601
1037
|
/**
|
|
602
1038
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
603
1039
|
* (for example, GDPR).
|
|
@@ -626,7 +1062,7 @@ interface EntityCreatedEvent {
|
|
|
626
1062
|
entity?: string;
|
|
627
1063
|
}
|
|
628
1064
|
interface RestoreInfo {
|
|
629
|
-
deletedDate?: Date;
|
|
1065
|
+
deletedDate?: Date | null;
|
|
630
1066
|
}
|
|
631
1067
|
interface EntityUpdatedEvent {
|
|
632
1068
|
/**
|
|
@@ -723,7 +1159,7 @@ interface EventMetadata extends BaseEventMetadata {
|
|
|
723
1159
|
/** ID of the entity associated with the event. */
|
|
724
1160
|
entityId?: string;
|
|
725
1161
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
726
|
-
eventTime?: Date;
|
|
1162
|
+
eventTime?: Date | null;
|
|
727
1163
|
/**
|
|
728
1164
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
729
1165
|
* (for example, GDPR).
|
|
@@ -796,7 +1232,7 @@ declare const onRedirectSessionCreated$1: EventDefinition<RedirectSessionCreated
|
|
|
796
1232
|
|
|
797
1233
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
798
1234
|
|
|
799
|
-
declare const createRedirectSession: BuildRESTFunction<typeof createRedirectSession$1> & typeof createRedirectSession$1
|
|
1235
|
+
declare const createRedirectSession: MaybeContext<BuildRESTFunction<typeof createRedirectSession$1> & typeof createRedirectSession$1>;
|
|
800
1236
|
|
|
801
1237
|
type _publicOnRedirectSessionCreatedType = typeof onRedirectSessionCreated$1;
|
|
802
1238
|
/** */
|
|
@@ -1,8 +1,51 @@
|
|
|
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
|
+
|
|
1
43
|
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
44
|
interface HttpClient {
|
|
3
45
|
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
46
|
fetchWithAuth: typeof fetch;
|
|
5
47
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
48
|
+
getActiveToken?: () => string | undefined;
|
|
6
49
|
}
|
|
7
50
|
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
51
|
type HttpResponse<T = any> = {
|
|
@@ -35,6 +78,55 @@ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?
|
|
|
35
78
|
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
79
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
37
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
|
+
|
|
38
130
|
declare global {
|
|
39
131
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
40
132
|
interface SymbolConstructor {
|
|
@@ -42,6 +134,348 @@ declare global {
|
|
|
42
134
|
}
|
|
43
135
|
}
|
|
44
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
|
+
|
|
45
479
|
/** Information for redirecting a visitor from an external Wix Headless client site to a Wix page for Wix-managed functionality. */
|
|
46
480
|
interface RedirectSession {
|
|
47
481
|
/** ID of the redirect session created. */
|
|
@@ -226,6 +660,8 @@ interface Location {
|
|
|
226
660
|
name?: string | null;
|
|
227
661
|
/** The full address of this location. */
|
|
228
662
|
formattedAddress?: string | null;
|
|
663
|
+
/** The full translated address of this location. */
|
|
664
|
+
formattedAddressTranslated?: string | null;
|
|
229
665
|
/**
|
|
230
666
|
* Location type.
|
|
231
667
|
*
|
|
@@ -369,15 +805,15 @@ interface RedirectSessionMembersAccountParams {
|
|
|
369
805
|
section?: MembersAccountSection;
|
|
370
806
|
}
|
|
371
807
|
declare enum MembersAccountSection {
|
|
372
|
-
/**
|
|
808
|
+
/** Account info section in "my account". */
|
|
373
809
|
ACCOUNT_INFO = "ACCOUNT_INFO",
|
|
374
|
-
/** My Bookings section in "my account" */
|
|
810
|
+
/** My Bookings section in "my account". */
|
|
375
811
|
BOOKINGS = "BOOKINGS",
|
|
376
|
-
/** My Orders section in "my account" */
|
|
812
|
+
/** My Orders section in "my account". */
|
|
377
813
|
ORDERS = "ORDERS",
|
|
378
|
-
/** Subscriptions section in "my account" */
|
|
814
|
+
/** Subscriptions section in "my account". */
|
|
379
815
|
SUBSCRIPTIONS = "SUBSCRIPTIONS",
|
|
380
|
-
/** Events section in "my account" */
|
|
816
|
+
/** Events section in "my account". */
|
|
381
817
|
EVENTS = "EVENTS"
|
|
382
818
|
}
|
|
383
819
|
interface RedirectSessionStoresProductParams {
|
|
@@ -506,11 +942,11 @@ interface CreateAnonymousRedirectSessionResponse {
|
|
|
506
942
|
redirectSession?: RedirectSession;
|
|
507
943
|
}
|
|
508
944
|
interface AttachPagesRequest {
|
|
509
|
-
/**
|
|
945
|
+
/** App ID that we want to inherit pages for. */
|
|
510
946
|
appDefId?: string;
|
|
511
947
|
}
|
|
512
948
|
interface AttachPagesResponse {
|
|
513
|
-
/** The status of the operation */
|
|
949
|
+
/** The status of the operation. */
|
|
514
950
|
status?: AttachPagesResponseStatus;
|
|
515
951
|
/** A descriptive message about the operation */
|
|
516
952
|
message?: string;
|
|
@@ -520,35 +956,35 @@ interface AttachPagesResponse {
|
|
|
520
956
|
sitePublished?: boolean;
|
|
521
957
|
}
|
|
522
958
|
declare enum AttachPagesResponseStatus {
|
|
523
|
-
/** Invalid value
|
|
959
|
+
/** Invalid value. */
|
|
524
960
|
UNKNOWN = "UNKNOWN",
|
|
525
|
-
/** Pages were successfully attached */
|
|
961
|
+
/** Pages were successfully attached. */
|
|
526
962
|
SUCCESS = "SUCCESS",
|
|
527
|
-
/** No pages were attached because the site is already published */
|
|
963
|
+
/** No pages were attached because the site is already published. */
|
|
528
964
|
NO_ACTION = "NO_ACTION",
|
|
529
|
-
/** An error occurred, such as site or app not
|
|
965
|
+
/** An error occurred, such as when the site or app is not found. */
|
|
530
966
|
ERROR = "ERROR"
|
|
531
967
|
}
|
|
532
968
|
interface ValidateCallbackURLRequest {
|
|
533
969
|
/** An external URL to validate */
|
|
534
970
|
callbackUrl?: string;
|
|
535
|
-
/**
|
|
971
|
+
/** Type of the callback URL. */
|
|
536
972
|
callbackType?: CallbackType;
|
|
537
973
|
/** The oauth app id used in order to pull the allowed domains from, has to correspond to the same metasite as the site in context */
|
|
538
974
|
clientId?: string;
|
|
539
975
|
}
|
|
540
976
|
declare enum CallbackType {
|
|
541
|
-
/** Invalid value
|
|
977
|
+
/** Invalid value. */
|
|
542
978
|
UNKNOWN = "UNKNOWN",
|
|
543
|
-
/**
|
|
979
|
+
/** Callback URL is used for the logout flow. */
|
|
544
980
|
LOGOUT = "LOGOUT",
|
|
545
|
-
/**
|
|
981
|
+
/** Callback URL is used for a checkout flow. */
|
|
546
982
|
CHECKOUT = "CHECKOUT",
|
|
547
|
-
/**
|
|
983
|
+
/** Callback URL is used for the authorize flow. */
|
|
548
984
|
AUTHORIZE = "AUTHORIZE"
|
|
549
985
|
}
|
|
550
986
|
interface ValidateCallbackURLResponse {
|
|
551
|
-
/**
|
|
987
|
+
/** Indicates if the provided URL is allowed for the given client id */
|
|
552
988
|
isValid?: boolean;
|
|
553
989
|
}
|
|
554
990
|
interface SignInURLRequest {
|
|
@@ -562,15 +998,15 @@ interface SignInURLResponse {
|
|
|
562
998
|
interface AttachAllTemplatesRequest {
|
|
563
999
|
}
|
|
564
1000
|
interface AttachAllTemplatesResponse {
|
|
565
|
-
/** The status of the operation */
|
|
1001
|
+
/** The status of the operation. */
|
|
566
1002
|
status?: Status;
|
|
567
1003
|
}
|
|
568
1004
|
declare enum Status {
|
|
569
|
-
/** Invalid value
|
|
1005
|
+
/** Invalid value. */
|
|
570
1006
|
UNKNOWN = "UNKNOWN",
|
|
571
|
-
/**
|
|
1007
|
+
/** Templates were successfully attached. */
|
|
572
1008
|
SUCCESS = "SUCCESS",
|
|
573
|
-
/** An error occurred */
|
|
1009
|
+
/** An error occurred. */
|
|
574
1010
|
ERROR = "ERROR"
|
|
575
1011
|
}
|
|
576
1012
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
@@ -597,7 +1033,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
597
1033
|
/** ID of the entity associated with the event. */
|
|
598
1034
|
entityId?: string;
|
|
599
1035
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
600
|
-
eventTime?: Date;
|
|
1036
|
+
eventTime?: Date | null;
|
|
601
1037
|
/**
|
|
602
1038
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
603
1039
|
* (for example, GDPR).
|
|
@@ -626,7 +1062,7 @@ interface EntityCreatedEvent {
|
|
|
626
1062
|
entity?: string;
|
|
627
1063
|
}
|
|
628
1064
|
interface RestoreInfo {
|
|
629
|
-
deletedDate?: Date;
|
|
1065
|
+
deletedDate?: Date | null;
|
|
630
1066
|
}
|
|
631
1067
|
interface EntityUpdatedEvent {
|
|
632
1068
|
/**
|
|
@@ -723,7 +1159,7 @@ interface EventMetadata extends BaseEventMetadata {
|
|
|
723
1159
|
/** ID of the entity associated with the event. */
|
|
724
1160
|
entityId?: string;
|
|
725
1161
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
726
|
-
eventTime?: Date;
|
|
1162
|
+
eventTime?: Date | null;
|
|
727
1163
|
/**
|
|
728
1164
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
729
1165
|
* (for example, GDPR).
|
|
@@ -796,7 +1232,7 @@ declare const onRedirectSessionCreated$1: EventDefinition<RedirectSessionCreated
|
|
|
796
1232
|
|
|
797
1233
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
798
1234
|
|
|
799
|
-
declare const createRedirectSession: BuildRESTFunction<typeof createRedirectSession$1> & typeof createRedirectSession$1
|
|
1235
|
+
declare const createRedirectSession: MaybeContext<BuildRESTFunction<typeof createRedirectSession$1> & typeof createRedirectSession$1>;
|
|
800
1236
|
|
|
801
1237
|
type _publicOnRedirectSessionCreatedType = typeof onRedirectSessionCreated$1;
|
|
802
1238
|
/** */
|
|
@@ -184,6 +184,8 @@ interface Location$1 {
|
|
|
184
184
|
name?: string | null;
|
|
185
185
|
/** The full address of this location. */
|
|
186
186
|
formattedAddress?: string | null;
|
|
187
|
+
/** The full translated address of this location. */
|
|
188
|
+
formattedAddressTranslated?: string | null;
|
|
187
189
|
/**
|
|
188
190
|
* Location type.
|
|
189
191
|
*
|
|
@@ -592,6 +594,8 @@ interface Location {
|
|
|
592
594
|
name?: string | null;
|
|
593
595
|
/** The full address of this location. */
|
|
594
596
|
formattedAddress?: string | null;
|
|
597
|
+
/** The full translated address of this location. */
|
|
598
|
+
formattedAddressTranslated?: string | null;
|
|
595
599
|
/**
|
|
596
600
|
* Location type.
|
|
597
601
|
*
|