@wix/blog 1.0.290 → 1.0.291
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/package.json +2 -2
- package/type-bundles/context.bundle.d.ts +694 -2744
- package/type-bundles/index.bundle.d.ts +694 -2744
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type HostModule
|
|
1
|
+
type HostModule<T, H extends Host> = {
|
|
2
2
|
__type: 'host';
|
|
3
3
|
create(host: H): T;
|
|
4
4
|
};
|
|
5
|
-
type HostModuleAPI
|
|
6
|
-
type Host
|
|
5
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
+
type Host<Environment = unknown> = {
|
|
7
7
|
channel: {
|
|
8
8
|
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
9
|
disconnect: () => void;
|
|
@@ -36,92 +36,92 @@ type Host$5<Environment = unknown> = {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
type RESTFunctionDescriptor
|
|
40
|
-
interface HttpClient
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory
|
|
39
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
40
|
+
interface HttpClient {
|
|
41
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
42
42
|
fetchWithAuth: typeof fetch;
|
|
43
43
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
44
|
getActiveToken?: () => string | undefined;
|
|
45
45
|
}
|
|
46
|
-
type RequestOptionsFactory
|
|
47
|
-
type HttpResponse
|
|
46
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
47
|
+
type HttpResponse<T = any> = {
|
|
48
48
|
data: T;
|
|
49
49
|
status: number;
|
|
50
50
|
statusText: string;
|
|
51
51
|
headers: any;
|
|
52
52
|
request?: any;
|
|
53
53
|
};
|
|
54
|
-
type RequestOptions
|
|
54
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
55
55
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
56
56
|
url: string;
|
|
57
57
|
data?: Data;
|
|
58
58
|
params?: URLSearchParams;
|
|
59
|
-
} & APIMetadata
|
|
60
|
-
type APIMetadata
|
|
59
|
+
} & APIMetadata;
|
|
60
|
+
type APIMetadata = {
|
|
61
61
|
methodFqn?: string;
|
|
62
62
|
entityFqdn?: string;
|
|
63
63
|
packageName?: string;
|
|
64
64
|
};
|
|
65
|
-
type BuildRESTFunction
|
|
66
|
-
type EventDefinition$
|
|
65
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
66
|
+
type EventDefinition$4<Payload = unknown, Type extends string = string> = {
|
|
67
67
|
__type: 'event-definition';
|
|
68
68
|
type: Type;
|
|
69
69
|
isDomainEvent?: boolean;
|
|
70
70
|
transformations?: (envelope: unknown) => Payload;
|
|
71
71
|
__payload: Payload;
|
|
72
72
|
};
|
|
73
|
-
declare function EventDefinition$
|
|
74
|
-
type EventHandler$
|
|
75
|
-
type BuildEventDefinition$
|
|
73
|
+
declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
74
|
+
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
75
|
+
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
76
76
|
|
|
77
|
-
type ServicePluginMethodInput
|
|
77
|
+
type ServicePluginMethodInput = {
|
|
78
78
|
request: any;
|
|
79
79
|
metadata: any;
|
|
80
80
|
};
|
|
81
|
-
type ServicePluginContract
|
|
82
|
-
type ServicePluginMethodMetadata
|
|
81
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
82
|
+
type ServicePluginMethodMetadata = {
|
|
83
83
|
name: string;
|
|
84
84
|
primaryHttpMappingPath: string;
|
|
85
85
|
transformations: {
|
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput
|
|
86
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
87
87
|
toREST: (...args: unknown[]) => unknown;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
type ServicePluginDefinition
|
|
90
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
91
91
|
__type: 'service-plugin-definition';
|
|
92
92
|
componentType: string;
|
|
93
|
-
methods: ServicePluginMethodMetadata
|
|
93
|
+
methods: ServicePluginMethodMetadata[];
|
|
94
94
|
__contract: Contract;
|
|
95
95
|
};
|
|
96
|
-
declare function ServicePluginDefinition
|
|
97
|
-
type BuildServicePluginDefinition
|
|
98
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE
|
|
96
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
97
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
98
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
99
99
|
|
|
100
|
-
type RequestContext
|
|
100
|
+
type RequestContext = {
|
|
101
101
|
isSSR: boolean;
|
|
102
102
|
host: string;
|
|
103
103
|
protocol?: string;
|
|
104
104
|
};
|
|
105
|
-
type ResponseTransformer
|
|
105
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
106
106
|
/**
|
|
107
107
|
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
108
108
|
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
109
109
|
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
110
110
|
*/
|
|
111
|
-
type Method
|
|
112
|
-
type AmbassadorRequestOptions
|
|
111
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
112
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
113
113
|
_?: T;
|
|
114
114
|
url?: string;
|
|
115
|
-
method?: Method
|
|
115
|
+
method?: Method;
|
|
116
116
|
params?: any;
|
|
117
117
|
data?: any;
|
|
118
|
-
transformResponse?: ResponseTransformer
|
|
118
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
119
119
|
};
|
|
120
|
-
type AmbassadorFactory
|
|
120
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
121
121
|
__isAmbassador: boolean;
|
|
122
122
|
};
|
|
123
|
-
type AmbassadorFunctionDescriptor
|
|
124
|
-
type BuildAmbassadorFunction
|
|
123
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
124
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
125
125
|
|
|
126
126
|
declare global {
|
|
127
127
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -130,7 +130,7 @@ declare global {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
declare const emptyObjectSymbol
|
|
133
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
136
|
Represents a strictly empty plain object, the `{}` value.
|
|
@@ -158,7 +158,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
|
|
|
158
158
|
|
|
159
159
|
@category Object
|
|
160
160
|
*/
|
|
161
|
-
type EmptyObject
|
|
161
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
164
|
Returns a boolean for whether the two given types are equal.
|
|
@@ -186,7 +186,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
186
186
|
@category Type Guard
|
|
187
187
|
@category Utilities
|
|
188
188
|
*/
|
|
189
|
-
type IsEqual
|
|
189
|
+
type IsEqual<A, B> =
|
|
190
190
|
(<G>() => G extends A ? 1 : 2) extends
|
|
191
191
|
(<G>() => G extends B ? 1 : 2)
|
|
192
192
|
? true
|
|
@@ -219,9 +219,9 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
219
219
|
|
|
220
220
|
@see {Except}
|
|
221
221
|
*/
|
|
222
|
-
type Filter
|
|
222
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
223
|
|
|
224
|
-
type ExceptOptions
|
|
224
|
+
type ExceptOptions = {
|
|
225
225
|
/**
|
|
226
226
|
Disallow assigning non-specified properties.
|
|
227
227
|
|
|
@@ -265,8 +265,8 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
|
265
265
|
|
|
266
266
|
@category Object
|
|
267
267
|
*/
|
|
268
|
-
type Except
|
|
269
|
-
[KeyType in keyof ObjectType as Filter
|
|
268
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
269
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
270
270
|
} & (Options['requireExactProps'] extends true
|
|
271
271
|
? Partial<Record<KeysType, never>>
|
|
272
272
|
: {});
|
|
@@ -303,7 +303,7 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
|
303
303
|
|
|
304
304
|
@category Object
|
|
305
305
|
*/
|
|
306
|
-
type ConditionalKeys
|
|
306
|
+
type ConditionalKeys<Base, Condition> = NonNullable<
|
|
307
307
|
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
308
308
|
{
|
|
309
309
|
// Map through all the keys of the given base type.
|
|
@@ -357,9 +357,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
|
357
357
|
|
|
358
358
|
@category Object
|
|
359
359
|
*/
|
|
360
|
-
type ConditionalExcept
|
|
360
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
361
361
|
Base,
|
|
362
|
-
ConditionalKeys
|
|
362
|
+
ConditionalKeys<Base, Condition>
|
|
363
363
|
>;
|
|
364
364
|
|
|
365
365
|
/**
|
|
@@ -367,8 +367,8 @@ ConditionalKeys$5<Base, Condition>
|
|
|
367
367
|
* can either be a REST module or a host module.
|
|
368
368
|
* This type is recursive, so it can describe nested modules.
|
|
369
369
|
*/
|
|
370
|
-
type Descriptors
|
|
371
|
-
[key: string]: Descriptors
|
|
370
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$4<any> | ServicePluginDefinition<any> | {
|
|
371
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
372
372
|
};
|
|
373
373
|
/**
|
|
374
374
|
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
@@ -376,12 +376,12 @@ type Descriptors$5 = RESTFunctionDescriptor$5 | AmbassadorFunctionDescriptor$5 |
|
|
|
376
376
|
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
377
377
|
* do not match the given host (as they will not work with the given host).
|
|
378
378
|
*/
|
|
379
|
-
type BuildDescriptors
|
|
379
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
380
380
|
done: T;
|
|
381
381
|
recurse: T extends {
|
|
382
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE
|
|
383
|
-
} ? never : T extends AmbassadorFunctionDescriptor
|
|
384
|
-
[Key in keyof T]: T[Key] extends Descriptors
|
|
382
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
383
|
+
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$4<any> ? BuildEventDefinition$4<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
384
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
385
385
|
-1,
|
|
386
386
|
0,
|
|
387
387
|
1,
|
|
@@ -390,9 +390,9 @@ type BuildDescriptors$5<T extends Descriptors$5, H extends Host$5<any> | undefin
|
|
|
390
390
|
4,
|
|
391
391
|
5
|
|
392
392
|
][Depth]> : never;
|
|
393
|
-
}, EmptyObject
|
|
393
|
+
}, EmptyObject>;
|
|
394
394
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
-
type PublicMetadata
|
|
395
|
+
type PublicMetadata = {
|
|
396
396
|
PACKAGE_NAME?: string;
|
|
397
397
|
};
|
|
398
398
|
|
|
@@ -404,9 +404,9 @@ declare global {
|
|
|
404
404
|
* A type used to create concerete types from SDK descriptors in
|
|
405
405
|
* case a contextual client is available.
|
|
406
406
|
*/
|
|
407
|
-
type MaybeContext
|
|
408
|
-
host: Host
|
|
409
|
-
} ? BuildDescriptors
|
|
407
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
408
|
+
host: Host;
|
|
409
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
410
410
|
|
|
411
411
|
/** BlogCache is the main entity of BlogCacheService */
|
|
412
412
|
interface BlogCache {
|
|
@@ -1114,7 +1114,7 @@ interface GetBlogCacheResponseNonNullableFields {
|
|
|
1114
1114
|
blogCache?: BlogCacheNonNullableFields;
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
|
-
declare function getBlogCache$1(httpClient: HttpClient
|
|
1117
|
+
declare function getBlogCache$1(httpClient: HttpClient): GetBlogCacheSignature;
|
|
1118
1118
|
interface GetBlogCacheSignature {
|
|
1119
1119
|
/**
|
|
1120
1120
|
* Gets blog cache.
|
|
@@ -1122,7 +1122,7 @@ interface GetBlogCacheSignature {
|
|
|
1122
1122
|
(): Promise<GetBlogCacheResponse & GetBlogCacheResponseNonNullableFields>;
|
|
1123
1123
|
}
|
|
1124
1124
|
|
|
1125
|
-
declare const getBlogCache: MaybeContext
|
|
1125
|
+
declare const getBlogCache: MaybeContext<BuildRESTFunction<typeof getBlogCache$1> & typeof getBlogCache$1>;
|
|
1126
1126
|
|
|
1127
1127
|
type index_d$5_Address = Address;
|
|
1128
1128
|
type index_d$5_AddressHint = AddressHint;
|
|
@@ -1169,1272 +1169,452 @@ declare namespace index_d$5 {
|
|
|
1169
1169
|
export { type ActionEvent$4 as ActionEvent, type index_d$5_Address as Address, type index_d$5_AddressHint as AddressHint, type index_d$5_BlogCache as BlogCache, type index_d$5_BusinessSchedule as BusinessSchedule, type index_d$5_Categories as Categories, type index_d$5_ChangeContext as ChangeContext, type index_d$5_ChangeContextPayloadOneOf as ChangeContextPayloadOneOf, type index_d$5_ConsentPolicy as ConsentPolicy, index_d$5_DayOfWeek as DayOfWeek, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type index_d$5_Empty as Empty, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, index_d$5_Flag as Flag, type index_d$5_GeoCoordinates as GeoCoordinates, type index_d$5_GetBlogCacheRequest as GetBlogCacheRequest, type index_d$5_GetBlogCacheResponse as GetBlogCacheResponse, type index_d$5_GetBlogCacheResponseNonNullableFields as GetBlogCacheResponseNonNullableFields, type index_d$5_Locale as Locale, index_d$5_LocaleStatus as LocaleStatus, type index_d$5_Multilingual as Multilingual, type index_d$5_PageInfo as PageInfo, type index_d$5_PagesData as PagesData, index_d$5_PlacementType as PlacementType, type index_d$5_Properties as Properties, type index_d$5_PropertiesChange as PropertiesChange, index_d$5_ResolutionMethod as ResolutionMethod, type RestoreInfo$4 as RestoreInfo, type index_d$5_SiteCloned as SiteCloned, type index_d$5_SiteCreated as SiteCreated, type index_d$5_SiteProperties as SiteProperties, type index_d$5_SitePropertiesEvent as SitePropertiesEvent, type index_d$5_SitePropertiesNotification as SitePropertiesNotification, type index_d$5_SiteSupportedLanguage as SiteSupportedLanguage, type index_d$5_SpecialHourPeriod as SpecialHourPeriod, type index_d$5_SupportedLanguage as SupportedLanguage, type index_d$5_TimePeriod as TimePeriod, type index_d$5_Translation as Translation, type index_d$5_UrlInvalidationNotification as UrlInvalidationNotification, index_d$5_getBlogCache as getBlogCache };
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1172
|
+
interface ImportStatus {
|
|
1173
|
+
/** Import Id. */
|
|
1174
|
+
_id?: string;
|
|
1175
|
+
/** File name of wordpress xml file that is being imported. */
|
|
1176
|
+
fileName?: string;
|
|
1177
|
+
/** Status of the latest import. */
|
|
1178
|
+
status?: Status$2;
|
|
1179
|
+
/** Total amount of entities to be imported. */
|
|
1180
|
+
importAmount?: number;
|
|
1181
|
+
/** Amount of entities imported successfully. */
|
|
1182
|
+
alreadyImportedAmount?: number;
|
|
1183
|
+
/** Amount of entities processed. */
|
|
1184
|
+
processedAmount?: number;
|
|
1185
|
+
}
|
|
1186
|
+
declare enum Status$2 {
|
|
1187
|
+
UNKNOWN = "UNKNOWN",
|
|
1188
|
+
READY_TO_IMPORT = "READY_TO_IMPORT",
|
|
1189
|
+
STARTED = "STARTED",
|
|
1190
|
+
FAILED = "FAILED",
|
|
1191
|
+
DONE = "DONE"
|
|
1192
|
+
}
|
|
1193
|
+
interface StartImportRequest {
|
|
1194
|
+
}
|
|
1195
|
+
interface StartImportResponse {
|
|
1196
|
+
}
|
|
1197
|
+
interface SubmitUrlForImportRequest {
|
|
1198
|
+
/** Url to wordpress xml file. */
|
|
1199
|
+
url: string;
|
|
1200
|
+
}
|
|
1201
|
+
interface SubmitUrlForImportResponse {
|
|
1202
|
+
}
|
|
1203
|
+
interface GetImportStatusRequest {
|
|
1204
|
+
}
|
|
1205
|
+
interface GetImportStatusResponse {
|
|
1206
|
+
/** Details of import progress. */
|
|
1207
|
+
importStatus?: ImportStatus;
|
|
1208
|
+
}
|
|
1209
|
+
interface GetNotImportedPostsRequest {
|
|
1210
|
+
}
|
|
1211
|
+
interface GetNotImportedPostsResponse {
|
|
1212
|
+
/** Failed entities. */
|
|
1213
|
+
notImportedPosts?: Post$1[];
|
|
1214
|
+
}
|
|
1215
|
+
interface Post$1 {
|
|
1216
|
+
/** The id of the post. */
|
|
1217
|
+
_id?: string;
|
|
1218
|
+
/** Title of the post. */
|
|
1219
|
+
title?: string;
|
|
1220
|
+
/** Url to posts in wordpress. */
|
|
1221
|
+
url?: string;
|
|
1222
|
+
}
|
|
1223
|
+
interface ImportStatusNonNullableFields {
|
|
1224
|
+
_id: string;
|
|
1225
|
+
fileName: string;
|
|
1226
|
+
status: Status$2;
|
|
1227
|
+
importAmount: number;
|
|
1228
|
+
alreadyImportedAmount: number;
|
|
1229
|
+
processedAmount: number;
|
|
1230
|
+
}
|
|
1231
|
+
interface GetImportStatusResponseNonNullableFields {
|
|
1232
|
+
importStatus?: ImportStatusNonNullableFields;
|
|
1233
|
+
}
|
|
1234
|
+
interface PostNonNullableFields$1 {
|
|
1235
|
+
_id: string;
|
|
1236
|
+
title: string;
|
|
1237
|
+
url: string;
|
|
1238
|
+
}
|
|
1239
|
+
interface GetNotImportedPostsResponseNonNullableFields {
|
|
1240
|
+
notImportedPosts: PostNonNullableFields$1[];
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
declare function startImport$1(httpClient: HttpClient): StartImportSignature;
|
|
1244
|
+
interface StartImportSignature {
|
|
1186
1245
|
/**
|
|
1187
|
-
*
|
|
1246
|
+
* Starts wordpress import process.
|
|
1188
1247
|
*/
|
|
1189
|
-
|
|
1248
|
+
(): Promise<void>;
|
|
1249
|
+
}
|
|
1250
|
+
declare function submitUrlForImport$1(httpClient: HttpClient): SubmitUrlForImportSignature;
|
|
1251
|
+
interface SubmitUrlForImportSignature {
|
|
1190
1252
|
/**
|
|
1191
|
-
*
|
|
1192
|
-
*
|
|
1253
|
+
* Submits wordpress import process from URL.
|
|
1254
|
+
* It will prepare wordpress data for import from the given URL.
|
|
1255
|
+
* Use "GetImportStatus" to get the status of the import process.
|
|
1256
|
+
* Once the import status becomes READY_TO_IMPORT, the import process can be started by invoking "StartImport".
|
|
1257
|
+
* @param - Url to wordpress xml file.
|
|
1193
1258
|
*/
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
|
|
1211
|
-
interface HttpClient$4 {
|
|
1212
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
|
|
1213
|
-
fetchWithAuth: typeof fetch;
|
|
1214
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1215
|
-
getActiveToken?: () => string | undefined;
|
|
1259
|
+
(url: string): Promise<void>;
|
|
1260
|
+
}
|
|
1261
|
+
declare function getImportStatus$1(httpClient: HttpClient): GetImportStatusSignature;
|
|
1262
|
+
interface GetImportStatusSignature {
|
|
1263
|
+
/**
|
|
1264
|
+
* Gets the status of the import process.
|
|
1265
|
+
*/
|
|
1266
|
+
(): Promise<GetImportStatusResponse & GetImportStatusResponseNonNullableFields>;
|
|
1267
|
+
}
|
|
1268
|
+
declare function getNotImportedPosts$1(httpClient: HttpClient): GetNotImportedPostsSignature;
|
|
1269
|
+
interface GetNotImportedPostsSignature {
|
|
1270
|
+
/**
|
|
1271
|
+
* Gets the posts that were not yet imported either because of an error or because import is still in progress.
|
|
1272
|
+
*/
|
|
1273
|
+
(): Promise<GetNotImportedPostsResponse & GetNotImportedPostsResponseNonNullableFields>;
|
|
1216
1274
|
}
|
|
1217
|
-
type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
|
|
1218
|
-
type HttpResponse$4<T = any> = {
|
|
1219
|
-
data: T;
|
|
1220
|
-
status: number;
|
|
1221
|
-
statusText: string;
|
|
1222
|
-
headers: any;
|
|
1223
|
-
request?: any;
|
|
1224
|
-
};
|
|
1225
|
-
type RequestOptions$4<_TResponse = any, Data = any> = {
|
|
1226
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1227
|
-
url: string;
|
|
1228
|
-
data?: Data;
|
|
1229
|
-
params?: URLSearchParams;
|
|
1230
|
-
} & APIMetadata$4;
|
|
1231
|
-
type APIMetadata$4 = {
|
|
1232
|
-
methodFqn?: string;
|
|
1233
|
-
entityFqdn?: string;
|
|
1234
|
-
packageName?: string;
|
|
1235
|
-
};
|
|
1236
|
-
type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
|
|
1237
|
-
type EventDefinition$8<Payload = unknown, Type extends string = string> = {
|
|
1238
|
-
__type: 'event-definition';
|
|
1239
|
-
type: Type;
|
|
1240
|
-
isDomainEvent?: boolean;
|
|
1241
|
-
transformations?: (envelope: unknown) => Payload;
|
|
1242
|
-
__payload: Payload;
|
|
1243
|
-
};
|
|
1244
|
-
declare function EventDefinition$8<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$8<Payload, Type>;
|
|
1245
|
-
type EventHandler$8<T extends EventDefinition$8> = (payload: T['__payload']) => void | Promise<void>;
|
|
1246
|
-
type BuildEventDefinition$8<T extends EventDefinition$8<any, string>> = (handler: EventHandler$8<T>) => void;
|
|
1247
|
-
|
|
1248
|
-
type ServicePluginMethodInput$4 = {
|
|
1249
|
-
request: any;
|
|
1250
|
-
metadata: any;
|
|
1251
|
-
};
|
|
1252
|
-
type ServicePluginContract$4 = Record<string, (payload: ServicePluginMethodInput$4) => unknown | Promise<unknown>>;
|
|
1253
|
-
type ServicePluginMethodMetadata$4 = {
|
|
1254
|
-
name: string;
|
|
1255
|
-
primaryHttpMappingPath: string;
|
|
1256
|
-
transformations: {
|
|
1257
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$4;
|
|
1258
|
-
toREST: (...args: unknown[]) => unknown;
|
|
1259
|
-
};
|
|
1260
|
-
};
|
|
1261
|
-
type ServicePluginDefinition$4<Contract extends ServicePluginContract$4> = {
|
|
1262
|
-
__type: 'service-plugin-definition';
|
|
1263
|
-
componentType: string;
|
|
1264
|
-
methods: ServicePluginMethodMetadata$4[];
|
|
1265
|
-
__contract: Contract;
|
|
1266
|
-
};
|
|
1267
|
-
declare function ServicePluginDefinition$4<Contract extends ServicePluginContract$4>(componentType: string, methods: ServicePluginMethodMetadata$4[]): ServicePluginDefinition$4<Contract>;
|
|
1268
|
-
type BuildServicePluginDefinition$4<T extends ServicePluginDefinition$4<any>> = (implementation: T['__contract']) => void;
|
|
1269
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$4 = "wix_spi_error";
|
|
1270
1275
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
};
|
|
1276
|
-
type ResponseTransformer$4 = (data: any, headers?: any) => any;
|
|
1277
|
-
/**
|
|
1278
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
1279
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
1280
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
1281
|
-
*/
|
|
1282
|
-
type Method$4 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
1283
|
-
type AmbassadorRequestOptions$4<T = any> = {
|
|
1284
|
-
_?: T;
|
|
1285
|
-
url?: string;
|
|
1286
|
-
method?: Method$4;
|
|
1287
|
-
params?: any;
|
|
1288
|
-
data?: any;
|
|
1289
|
-
transformResponse?: ResponseTransformer$4 | ResponseTransformer$4[];
|
|
1290
|
-
};
|
|
1291
|
-
type AmbassadorFactory$4<Request, Response> = (payload: Request) => ((context: RequestContext$4) => AmbassadorRequestOptions$4<Response>) & {
|
|
1292
|
-
__isAmbassador: boolean;
|
|
1293
|
-
};
|
|
1294
|
-
type AmbassadorFunctionDescriptor$4<Request = any, Response = any> = AmbassadorFactory$4<Request, Response>;
|
|
1295
|
-
type BuildAmbassadorFunction$4<T extends AmbassadorFunctionDescriptor$4> = T extends AmbassadorFunctionDescriptor$4<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
1276
|
+
declare const startImport: MaybeContext<BuildRESTFunction<typeof startImport$1> & typeof startImport$1>;
|
|
1277
|
+
declare const submitUrlForImport: MaybeContext<BuildRESTFunction<typeof submitUrlForImport$1> & typeof submitUrlForImport$1>;
|
|
1278
|
+
declare const getImportStatus: MaybeContext<BuildRESTFunction<typeof getImportStatus$1> & typeof getImportStatus$1>;
|
|
1279
|
+
declare const getNotImportedPosts: MaybeContext<BuildRESTFunction<typeof getNotImportedPosts$1> & typeof getNotImportedPosts$1>;
|
|
1296
1280
|
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1281
|
+
type index_d$4_GetImportStatusRequest = GetImportStatusRequest;
|
|
1282
|
+
type index_d$4_GetImportStatusResponse = GetImportStatusResponse;
|
|
1283
|
+
type index_d$4_GetImportStatusResponseNonNullableFields = GetImportStatusResponseNonNullableFields;
|
|
1284
|
+
type index_d$4_GetNotImportedPostsRequest = GetNotImportedPostsRequest;
|
|
1285
|
+
type index_d$4_GetNotImportedPostsResponse = GetNotImportedPostsResponse;
|
|
1286
|
+
type index_d$4_GetNotImportedPostsResponseNonNullableFields = GetNotImportedPostsResponseNonNullableFields;
|
|
1287
|
+
type index_d$4_ImportStatus = ImportStatus;
|
|
1288
|
+
type index_d$4_StartImportRequest = StartImportRequest;
|
|
1289
|
+
type index_d$4_StartImportResponse = StartImportResponse;
|
|
1290
|
+
type index_d$4_SubmitUrlForImportRequest = SubmitUrlForImportRequest;
|
|
1291
|
+
type index_d$4_SubmitUrlForImportResponse = SubmitUrlForImportResponse;
|
|
1292
|
+
declare const index_d$4_getImportStatus: typeof getImportStatus;
|
|
1293
|
+
declare const index_d$4_getNotImportedPosts: typeof getNotImportedPosts;
|
|
1294
|
+
declare const index_d$4_startImport: typeof startImport;
|
|
1295
|
+
declare const index_d$4_submitUrlForImport: typeof submitUrlForImport;
|
|
1296
|
+
declare namespace index_d$4 {
|
|
1297
|
+
export { type index_d$4_GetImportStatusRequest as GetImportStatusRequest, type index_d$4_GetImportStatusResponse as GetImportStatusResponse, type index_d$4_GetImportStatusResponseNonNullableFields as GetImportStatusResponseNonNullableFields, type index_d$4_GetNotImportedPostsRequest as GetNotImportedPostsRequest, type index_d$4_GetNotImportedPostsResponse as GetNotImportedPostsResponse, type index_d$4_GetNotImportedPostsResponseNonNullableFields as GetNotImportedPostsResponseNonNullableFields, type index_d$4_ImportStatus as ImportStatus, type Post$1 as Post, type index_d$4_StartImportRequest as StartImportRequest, type index_d$4_StartImportResponse as StartImportResponse, Status$2 as Status, type index_d$4_SubmitUrlForImportRequest as SubmitUrlForImportRequest, type index_d$4_SubmitUrlForImportResponse as SubmitUrlForImportResponse, index_d$4_getImportStatus as getImportStatus, index_d$4_getNotImportedPosts as getNotImportedPosts, index_d$4_startImport as startImport, index_d$4_submitUrlForImport as submitUrlForImport };
|
|
1302
1298
|
}
|
|
1303
1299
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
@
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
@
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
/**
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
/**
|
|
1367
|
-
Filter out keys from an object.
|
|
1368
|
-
|
|
1369
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
1370
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
1371
|
-
Returns `Key` otherwise.
|
|
1372
|
-
|
|
1373
|
-
@example
|
|
1374
|
-
```
|
|
1375
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
1376
|
-
//=> never
|
|
1377
|
-
```
|
|
1378
|
-
|
|
1379
|
-
@example
|
|
1380
|
-
```
|
|
1381
|
-
type Filtered = Filter<'bar', string>;
|
|
1382
|
-
//=> never
|
|
1383
|
-
```
|
|
1384
|
-
|
|
1385
|
-
@example
|
|
1386
|
-
```
|
|
1387
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
1388
|
-
//=> 'bar'
|
|
1389
|
-
```
|
|
1390
|
-
|
|
1391
|
-
@see {Except}
|
|
1392
|
-
*/
|
|
1393
|
-
type Filter$4<KeyType, ExcludeType> = IsEqual$4<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
1394
|
-
|
|
1395
|
-
type ExceptOptions$4 = {
|
|
1396
|
-
/**
|
|
1397
|
-
Disallow assigning non-specified properties.
|
|
1398
|
-
|
|
1399
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
1400
|
-
|
|
1401
|
-
@default false
|
|
1402
|
-
*/
|
|
1403
|
-
requireExactProps?: boolean;
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
Create a type from an object type without certain keys.
|
|
1408
|
-
|
|
1409
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
1410
|
-
|
|
1411
|
-
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.
|
|
1412
|
-
|
|
1413
|
-
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)).
|
|
1414
|
-
|
|
1415
|
-
@example
|
|
1416
|
-
```
|
|
1417
|
-
import type {Except} from 'type-fest';
|
|
1418
|
-
|
|
1419
|
-
type Foo = {
|
|
1420
|
-
a: number;
|
|
1421
|
-
b: string;
|
|
1422
|
-
};
|
|
1423
|
-
|
|
1424
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
1425
|
-
//=> {b: string}
|
|
1426
|
-
|
|
1427
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
1428
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
1429
|
-
|
|
1430
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
1431
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
1432
|
-
|
|
1433
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
1434
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
1435
|
-
```
|
|
1436
|
-
|
|
1437
|
-
@category Object
|
|
1438
|
-
*/
|
|
1439
|
-
type Except$4<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$4 = {requireExactProps: false}> = {
|
|
1440
|
-
[KeyType in keyof ObjectType as Filter$4<KeyType, KeysType>]: ObjectType[KeyType];
|
|
1441
|
-
} & (Options['requireExactProps'] extends true
|
|
1442
|
-
? Partial<Record<KeysType, never>>
|
|
1443
|
-
: {});
|
|
1444
|
-
|
|
1445
|
-
/**
|
|
1446
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
1447
|
-
|
|
1448
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
1449
|
-
|
|
1450
|
-
@example
|
|
1451
|
-
```
|
|
1452
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
1453
|
-
|
|
1454
|
-
interface Example {
|
|
1455
|
-
a: string;
|
|
1456
|
-
b: string | number;
|
|
1457
|
-
c?: string;
|
|
1458
|
-
d: {};
|
|
1300
|
+
interface Category$2 {
|
|
1301
|
+
/** Category ID. */
|
|
1302
|
+
_id?: string;
|
|
1303
|
+
/** Category label. Displayed in the Category Menu. */
|
|
1304
|
+
label?: string;
|
|
1305
|
+
/**
|
|
1306
|
+
* Number of posts in the category.
|
|
1307
|
+
* @readonly
|
|
1308
|
+
*/
|
|
1309
|
+
postCount?: number;
|
|
1310
|
+
/**
|
|
1311
|
+
* Category URL.
|
|
1312
|
+
*
|
|
1313
|
+
*
|
|
1314
|
+
* The `url` directs you to a page that lists every post with the specified category.
|
|
1315
|
+
*
|
|
1316
|
+
* @readonly
|
|
1317
|
+
*/
|
|
1318
|
+
url?: string;
|
|
1319
|
+
/** Category description. */
|
|
1320
|
+
description?: string | null;
|
|
1321
|
+
/** Category title. */
|
|
1322
|
+
title?: string;
|
|
1323
|
+
/**
|
|
1324
|
+
* Reserved for internal use.
|
|
1325
|
+
* @deprecated Category position in sequence.
|
|
1326
|
+
* @replacedBy display_position
|
|
1327
|
+
* @targetRemovalDate 2024-06-30
|
|
1328
|
+
*/
|
|
1329
|
+
rank?: number | null;
|
|
1330
|
+
/** Position of the category in the [Category Menu](https://support.wix.com/en/article/wix-blog-adding-and-customizing-a-category-menu). Categories with lower display position are displayed first. */
|
|
1331
|
+
displayPosition?: number | null;
|
|
1332
|
+
/** ID of the category's translations when [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-translating-your-blog) is installed on a site. All translations of a single category will share the same `translationId`. */
|
|
1333
|
+
translationId?: string | null;
|
|
1334
|
+
/**
|
|
1335
|
+
* Category Language.
|
|
1336
|
+
*
|
|
1337
|
+
* 2-letter language code in [ISO 639-1 format](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
1338
|
+
*/
|
|
1339
|
+
language?: string | null;
|
|
1340
|
+
/**
|
|
1341
|
+
* Part of a category's URL that refers to a specific category.
|
|
1342
|
+
*
|
|
1343
|
+
*
|
|
1344
|
+
* For example, `'https:/example.com/blog/category/{my-category-slug}'`.
|
|
1345
|
+
*/
|
|
1346
|
+
slug?: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* Reserved for internal use.
|
|
1349
|
+
* @readonly
|
|
1350
|
+
*/
|
|
1351
|
+
internalId?: string | null;
|
|
1352
|
+
/** SEO data. */
|
|
1353
|
+
seoData?: SeoSchema$3;
|
|
1354
|
+
/** Category cover image. */
|
|
1355
|
+
coverImage?: string;
|
|
1356
|
+
/**
|
|
1357
|
+
* Date and time the Category was last updated.
|
|
1358
|
+
* @readonly
|
|
1359
|
+
*/
|
|
1360
|
+
_updatedDate?: Date;
|
|
1459
1361
|
}
|
|
1460
|
-
|
|
1461
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
1462
|
-
//=> 'a'
|
|
1463
|
-
```
|
|
1464
|
-
|
|
1465
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
1466
|
-
|
|
1467
|
-
@example
|
|
1468
|
-
```
|
|
1469
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
1470
|
-
|
|
1471
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
1472
|
-
//=> 'a' | 'c'
|
|
1473
|
-
```
|
|
1474
|
-
|
|
1475
|
-
@category Object
|
|
1476
|
-
*/
|
|
1477
|
-
type ConditionalKeys$4<Base, Condition> = NonNullable<
|
|
1478
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
1479
|
-
{
|
|
1480
|
-
// Map through all the keys of the given base type.
|
|
1481
|
-
[Key in keyof Base]:
|
|
1482
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
1483
|
-
Base[Key] extends Condition
|
|
1484
|
-
// Retain this key since the condition passes.
|
|
1485
|
-
? Key
|
|
1486
|
-
// Discard this key since the condition fails.
|
|
1487
|
-
: never;
|
|
1488
|
-
|
|
1489
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
1490
|
-
}[keyof Base]
|
|
1491
|
-
>;
|
|
1492
|
-
|
|
1493
1362
|
/**
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
@example
|
|
1499
|
-
```
|
|
1500
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
1501
|
-
|
|
1502
|
-
class Awesome {
|
|
1503
|
-
name: string;
|
|
1504
|
-
successes: number;
|
|
1505
|
-
failures: bigint;
|
|
1506
|
-
|
|
1507
|
-
run() {}
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
1511
|
-
//=> {run: () => void}
|
|
1512
|
-
```
|
|
1513
|
-
|
|
1514
|
-
@example
|
|
1515
|
-
```
|
|
1516
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
1517
|
-
|
|
1518
|
-
interface Example {
|
|
1519
|
-
a: string;
|
|
1520
|
-
b: string | number;
|
|
1521
|
-
c: () => void;
|
|
1522
|
-
d: {};
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
1526
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
1527
|
-
```
|
|
1528
|
-
|
|
1529
|
-
@category Object
|
|
1530
|
-
*/
|
|
1531
|
-
type ConditionalExcept$4<Base, Condition> = Except$4<
|
|
1532
|
-
Base,
|
|
1533
|
-
ConditionalKeys$4<Base, Condition>
|
|
1534
|
-
>;
|
|
1535
|
-
|
|
1536
|
-
/**
|
|
1537
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
1538
|
-
* can either be a REST module or a host module.
|
|
1539
|
-
* This type is recursive, so it can describe nested modules.
|
|
1540
|
-
*/
|
|
1541
|
-
type Descriptors$4 = RESTFunctionDescriptor$4 | AmbassadorFunctionDescriptor$4 | HostModule$4<any, any> | EventDefinition$8<any> | ServicePluginDefinition$4<any> | {
|
|
1542
|
-
[key: string]: Descriptors$4 | PublicMetadata$4 | any;
|
|
1543
|
-
};
|
|
1544
|
-
/**
|
|
1545
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
1546
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
1547
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
1548
|
-
* do not match the given host (as they will not work with the given host).
|
|
1549
|
-
*/
|
|
1550
|
-
type BuildDescriptors$4<T extends Descriptors$4, H extends Host$4<any> | undefined, Depth extends number = 5> = {
|
|
1551
|
-
done: T;
|
|
1552
|
-
recurse: T extends {
|
|
1553
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$4;
|
|
1554
|
-
} ? never : T extends AmbassadorFunctionDescriptor$4 ? BuildAmbassadorFunction$4<T> : T extends RESTFunctionDescriptor$4 ? BuildRESTFunction$4<T> : T extends EventDefinition$8<any> ? BuildEventDefinition$8<T> : T extends ServicePluginDefinition$4<any> ? BuildServicePluginDefinition$4<T> : T extends HostModule$4<any, any> ? HostModuleAPI$4<T> : ConditionalExcept$4<{
|
|
1555
|
-
[Key in keyof T]: T[Key] extends Descriptors$4 ? BuildDescriptors$4<T[Key], H, [
|
|
1556
|
-
-1,
|
|
1557
|
-
0,
|
|
1558
|
-
1,
|
|
1559
|
-
2,
|
|
1560
|
-
3,
|
|
1561
|
-
4,
|
|
1562
|
-
5
|
|
1563
|
-
][Depth]> : never;
|
|
1564
|
-
}, EmptyObject$4>;
|
|
1565
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
1566
|
-
type PublicMetadata$4 = {
|
|
1567
|
-
PACKAGE_NAME?: string;
|
|
1568
|
-
};
|
|
1569
|
-
|
|
1570
|
-
declare global {
|
|
1571
|
-
interface ContextualClient {
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
/**
|
|
1575
|
-
* A type used to create concerete types from SDK descriptors in
|
|
1576
|
-
* case a contextual client is available.
|
|
1363
|
+
* The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.
|
|
1364
|
+
* The search engines use this information for ranking purposes, or to display snippets in the search results.
|
|
1365
|
+
* This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.
|
|
1577
1366
|
*/
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
/** Import Id. */
|
|
1584
|
-
_id?: string;
|
|
1585
|
-
/** File name of wordpress xml file that is being imported. */
|
|
1586
|
-
fileName?: string;
|
|
1587
|
-
/** Status of the latest import. */
|
|
1588
|
-
status?: Status$2;
|
|
1589
|
-
/** Total amount of entities to be imported. */
|
|
1590
|
-
importAmount?: number;
|
|
1591
|
-
/** Amount of entities imported successfully. */
|
|
1592
|
-
alreadyImportedAmount?: number;
|
|
1593
|
-
/** Amount of entities processed. */
|
|
1594
|
-
processedAmount?: number;
|
|
1595
|
-
}
|
|
1596
|
-
declare enum Status$2 {
|
|
1597
|
-
UNKNOWN = "UNKNOWN",
|
|
1598
|
-
READY_TO_IMPORT = "READY_TO_IMPORT",
|
|
1599
|
-
STARTED = "STARTED",
|
|
1600
|
-
FAILED = "FAILED",
|
|
1601
|
-
DONE = "DONE"
|
|
1602
|
-
}
|
|
1603
|
-
interface StartImportRequest {
|
|
1604
|
-
}
|
|
1605
|
-
interface StartImportResponse {
|
|
1606
|
-
}
|
|
1607
|
-
interface SubmitUrlForImportRequest {
|
|
1608
|
-
/** Url to wordpress xml file. */
|
|
1609
|
-
url: string;
|
|
1610
|
-
}
|
|
1611
|
-
interface SubmitUrlForImportResponse {
|
|
1612
|
-
}
|
|
1613
|
-
interface GetImportStatusRequest {
|
|
1367
|
+
interface SeoSchema$3 {
|
|
1368
|
+
/** SEO tag information. */
|
|
1369
|
+
tags?: Tag$3[];
|
|
1370
|
+
/** SEO general settings. */
|
|
1371
|
+
settings?: Settings$3;
|
|
1614
1372
|
}
|
|
1615
|
-
interface
|
|
1616
|
-
/**
|
|
1617
|
-
|
|
1373
|
+
interface Keyword$3 {
|
|
1374
|
+
/** Keyword value. */
|
|
1375
|
+
term?: string;
|
|
1376
|
+
/** Whether the keyword is the main focus keyword. */
|
|
1377
|
+
isMain?: boolean;
|
|
1378
|
+
/** Who added the keyword to the settings */
|
|
1379
|
+
origin?: string | null;
|
|
1618
1380
|
}
|
|
1619
|
-
interface
|
|
1381
|
+
interface Tag$3 {
|
|
1382
|
+
/**
|
|
1383
|
+
* SEO tag type.
|
|
1384
|
+
*
|
|
1385
|
+
*
|
|
1386
|
+
* Supported values: `title`, `meta`, `script`, `link`.
|
|
1387
|
+
*/
|
|
1388
|
+
type?: string;
|
|
1389
|
+
/**
|
|
1390
|
+
* A `{'key':'value'}` pair object where each SEO tag property (`'name'`, `'content'`, `'rel'`, `'href'`) contains a value.
|
|
1391
|
+
* For example: `{'name': 'description', 'content': 'the description itself'}`.
|
|
1392
|
+
*/
|
|
1393
|
+
props?: Record<string, any> | null;
|
|
1394
|
+
/** SEO tag meta data. For example, `{height: 300, width: 240}`. */
|
|
1395
|
+
meta?: Record<string, any> | null;
|
|
1396
|
+
/** SEO tag inner content. For example, `<title> inner content </title>`. */
|
|
1397
|
+
children?: string;
|
|
1398
|
+
/** Whether the tag is a custom tag. */
|
|
1399
|
+
custom?: boolean;
|
|
1400
|
+
/** Whether the tag is disabled. */
|
|
1401
|
+
disabled?: boolean;
|
|
1620
1402
|
}
|
|
1621
|
-
interface
|
|
1622
|
-
/**
|
|
1623
|
-
|
|
1403
|
+
interface Settings$3 {
|
|
1404
|
+
/**
|
|
1405
|
+
* Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.
|
|
1406
|
+
*
|
|
1407
|
+
*
|
|
1408
|
+
* Default: `false` (Auto Redirect is enabled.)
|
|
1409
|
+
*/
|
|
1410
|
+
preventAutoRedirect?: boolean;
|
|
1411
|
+
/** User-selected keyword terms for a specific page. */
|
|
1412
|
+
keywords?: Keyword$3[];
|
|
1624
1413
|
}
|
|
1625
|
-
interface
|
|
1626
|
-
/**
|
|
1414
|
+
interface CategoryTranslation$2 {
|
|
1415
|
+
/** Category ID */
|
|
1627
1416
|
_id?: string;
|
|
1628
|
-
/**
|
|
1629
|
-
|
|
1630
|
-
/**
|
|
1417
|
+
/** Label which is presented in the categories menu on site */
|
|
1418
|
+
label?: string | null;
|
|
1419
|
+
/** Language of the category */
|
|
1420
|
+
language?: string | null;
|
|
1421
|
+
/** Url of this category page */
|
|
1631
1422
|
url?: string;
|
|
1632
1423
|
}
|
|
1633
|
-
interface
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
status: Status$2;
|
|
1637
|
-
importAmount: number;
|
|
1638
|
-
alreadyImportedAmount: number;
|
|
1639
|
-
processedAmount: number;
|
|
1640
|
-
}
|
|
1641
|
-
interface GetImportStatusResponseNonNullableFields {
|
|
1642
|
-
importStatus?: ImportStatusNonNullableFields;
|
|
1643
|
-
}
|
|
1644
|
-
interface PostNonNullableFields$1 {
|
|
1645
|
-
_id: string;
|
|
1646
|
-
title: string;
|
|
1647
|
-
url: string;
|
|
1648
|
-
}
|
|
1649
|
-
interface GetNotImportedPostsResponseNonNullableFields {
|
|
1650
|
-
notImportedPosts: PostNonNullableFields$1[];
|
|
1424
|
+
interface InitialCategoriesCopied {
|
|
1425
|
+
/** Number of categories copied. */
|
|
1426
|
+
count?: number;
|
|
1651
1427
|
}
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1428
|
+
interface CreateCategoryRequest {
|
|
1429
|
+
/** Category info. */
|
|
1430
|
+
category?: Category$2;
|
|
1655
1431
|
/**
|
|
1656
|
-
*
|
|
1432
|
+
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
1433
|
+
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
1434
|
+
* only the category’s base fields are returned.
|
|
1657
1435
|
*/
|
|
1658
|
-
|
|
1436
|
+
fieldsets?: Field$3[];
|
|
1659
1437
|
}
|
|
1660
|
-
declare
|
|
1661
|
-
|
|
1438
|
+
declare enum Field$3 {
|
|
1439
|
+
UNKNOWN = "UNKNOWN",
|
|
1440
|
+
/** Includes Category url. */
|
|
1441
|
+
URL = "URL",
|
|
1662
1442
|
/**
|
|
1663
|
-
*
|
|
1664
|
-
*
|
|
1665
|
-
* Use "GetImportStatus" to get the status of the import process.
|
|
1666
|
-
* Once the import status becomes READY_TO_IMPORT, the import process can be started by invoking "StartImport".
|
|
1667
|
-
* @param - Url to wordpress xml file.
|
|
1443
|
+
* Includes internal id field.
|
|
1444
|
+
* Reserved for internal use
|
|
1668
1445
|
*/
|
|
1669
|
-
|
|
1446
|
+
INTERNAL_ID = "INTERNAL_ID",
|
|
1447
|
+
/** Includes SEO data. */
|
|
1448
|
+
SEO = "SEO",
|
|
1449
|
+
/** Includes translations. */
|
|
1450
|
+
TRANSLATIONS = "TRANSLATIONS"
|
|
1670
1451
|
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
* Gets the status of the import process.
|
|
1675
|
-
*/
|
|
1676
|
-
(): Promise<GetImportStatusResponse & GetImportStatusResponseNonNullableFields>;
|
|
1452
|
+
interface CreateCategoryResponse {
|
|
1453
|
+
/** Category info. */
|
|
1454
|
+
category?: Category$2;
|
|
1677
1455
|
}
|
|
1678
|
-
|
|
1679
|
-
|
|
1456
|
+
interface BulkCreateCategoriesRequest {
|
|
1457
|
+
/** Categories to create. */
|
|
1458
|
+
categories?: Category$2[];
|
|
1459
|
+
/** Whether to return the full created category entities in the response. */
|
|
1460
|
+
returnFullEntity?: boolean;
|
|
1680
1461
|
/**
|
|
1681
|
-
*
|
|
1462
|
+
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
1463
|
+
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
1464
|
+
* only the category’s base fields are returned.
|
|
1682
1465
|
*/
|
|
1683
|
-
|
|
1466
|
+
fieldsets?: Field$3[];
|
|
1684
1467
|
}
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
type index_d$4_GetImportStatusRequest = GetImportStatusRequest;
|
|
1692
|
-
type index_d$4_GetImportStatusResponse = GetImportStatusResponse;
|
|
1693
|
-
type index_d$4_GetImportStatusResponseNonNullableFields = GetImportStatusResponseNonNullableFields;
|
|
1694
|
-
type index_d$4_GetNotImportedPostsRequest = GetNotImportedPostsRequest;
|
|
1695
|
-
type index_d$4_GetNotImportedPostsResponse = GetNotImportedPostsResponse;
|
|
1696
|
-
type index_d$4_GetNotImportedPostsResponseNonNullableFields = GetNotImportedPostsResponseNonNullableFields;
|
|
1697
|
-
type index_d$4_ImportStatus = ImportStatus;
|
|
1698
|
-
type index_d$4_StartImportRequest = StartImportRequest;
|
|
1699
|
-
type index_d$4_StartImportResponse = StartImportResponse;
|
|
1700
|
-
type index_d$4_SubmitUrlForImportRequest = SubmitUrlForImportRequest;
|
|
1701
|
-
type index_d$4_SubmitUrlForImportResponse = SubmitUrlForImportResponse;
|
|
1702
|
-
declare const index_d$4_getImportStatus: typeof getImportStatus;
|
|
1703
|
-
declare const index_d$4_getNotImportedPosts: typeof getNotImportedPosts;
|
|
1704
|
-
declare const index_d$4_startImport: typeof startImport;
|
|
1705
|
-
declare const index_d$4_submitUrlForImport: typeof submitUrlForImport;
|
|
1706
|
-
declare namespace index_d$4 {
|
|
1707
|
-
export { type index_d$4_GetImportStatusRequest as GetImportStatusRequest, type index_d$4_GetImportStatusResponse as GetImportStatusResponse, type index_d$4_GetImportStatusResponseNonNullableFields as GetImportStatusResponseNonNullableFields, type index_d$4_GetNotImportedPostsRequest as GetNotImportedPostsRequest, type index_d$4_GetNotImportedPostsResponse as GetNotImportedPostsResponse, type index_d$4_GetNotImportedPostsResponseNonNullableFields as GetNotImportedPostsResponseNonNullableFields, type index_d$4_ImportStatus as ImportStatus, type Post$1 as Post, type index_d$4_StartImportRequest as StartImportRequest, type index_d$4_StartImportResponse as StartImportResponse, Status$2 as Status, type index_d$4_SubmitUrlForImportRequest as SubmitUrlForImportRequest, type index_d$4_SubmitUrlForImportResponse as SubmitUrlForImportResponse, index_d$4_getImportStatus as getImportStatus, index_d$4_getNotImportedPosts as getNotImportedPosts, index_d$4_startImport as startImport, index_d$4_submitUrlForImport as submitUrlForImport };
|
|
1468
|
+
interface BulkCreateCategoriesResponse {
|
|
1469
|
+
/** Categories created by bulk action. */
|
|
1470
|
+
results?: BulkCategoryResult[];
|
|
1471
|
+
/** Bulk action metadata. */
|
|
1472
|
+
bulkActionMetadata?: BulkActionMetadata$2;
|
|
1708
1473
|
}
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1474
|
+
interface BulkCategoryResult {
|
|
1475
|
+
/** Bulk actions metadata for category. */
|
|
1476
|
+
itemMetadata?: ItemMetadata$2;
|
|
1477
|
+
/** Optional created category. */
|
|
1478
|
+
item?: Category$2;
|
|
1479
|
+
}
|
|
1480
|
+
interface ItemMetadata$2 {
|
|
1481
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
1482
|
+
_id?: string | null;
|
|
1483
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
1484
|
+
originalIndex?: number;
|
|
1485
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
1486
|
+
success?: boolean;
|
|
1487
|
+
/** Details about the error in case of failure. */
|
|
1488
|
+
error?: ApplicationError$2;
|
|
1489
|
+
}
|
|
1490
|
+
interface ApplicationError$2 {
|
|
1491
|
+
/** Error code. */
|
|
1492
|
+
code?: string;
|
|
1493
|
+
/** Description of the error. */
|
|
1494
|
+
description?: string;
|
|
1495
|
+
/** Data related to the error. */
|
|
1496
|
+
data?: Record<string, any> | null;
|
|
1497
|
+
}
|
|
1498
|
+
interface BulkActionMetadata$2 {
|
|
1499
|
+
/** Number of items that were successfully processed. */
|
|
1500
|
+
totalSuccesses?: number;
|
|
1501
|
+
/** Number of items that couldn't be processed. */
|
|
1502
|
+
totalFailures?: number;
|
|
1503
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
1504
|
+
undetailedFailures?: number;
|
|
1505
|
+
}
|
|
1506
|
+
interface BulkUpdateCategoriesRequest {
|
|
1507
|
+
/** Categories to update. */
|
|
1508
|
+
categories?: MaskedCategory[];
|
|
1509
|
+
/** Whether to return the full created category entities in the response. */
|
|
1510
|
+
returnFullEntity?: boolean;
|
|
1724
1511
|
/**
|
|
1725
|
-
*
|
|
1512
|
+
* List of category fields to be included in the response if the entities are present.
|
|
1513
|
+
* Base default fieldset returns all core category properties (all properties that are not a supported fieldset value).
|
|
1514
|
+
* For example, when `URL` fieldset is selected, returned category will include the set of base properties and the category's preview url.
|
|
1726
1515
|
*/
|
|
1727
|
-
|
|
1516
|
+
fieldsets?: Field$3[];
|
|
1517
|
+
}
|
|
1518
|
+
interface MaskedCategory {
|
|
1519
|
+
/** Category */
|
|
1520
|
+
category?: Category$2;
|
|
1521
|
+
}
|
|
1522
|
+
interface BulkUpdateCategoriesResponse {
|
|
1523
|
+
/** Categories updated by bulk action. */
|
|
1524
|
+
results?: BulkCategoryResult[];
|
|
1525
|
+
/** Bulk action metadata. */
|
|
1526
|
+
bulkActionMetadata?: BulkActionMetadata$2;
|
|
1527
|
+
}
|
|
1528
|
+
interface UpdateCategoryRequest {
|
|
1529
|
+
/** Category info. */
|
|
1530
|
+
category?: Category$2;
|
|
1728
1531
|
/**
|
|
1729
|
-
*
|
|
1730
|
-
*
|
|
1532
|
+
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
1533
|
+
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
1534
|
+
* only the category’s base fields are returned.
|
|
1731
1535
|
*/
|
|
1732
|
-
|
|
1733
|
-
/**
|
|
1734
|
-
* The language of the currently viewed session
|
|
1735
|
-
*/
|
|
1736
|
-
language?: string;
|
|
1737
|
-
/**
|
|
1738
|
-
* The locale of the currently viewed session
|
|
1739
|
-
*/
|
|
1740
|
-
locale?: string;
|
|
1741
|
-
/**
|
|
1742
|
-
* Any headers that should be passed through to the API requests
|
|
1743
|
-
*/
|
|
1744
|
-
passThroughHeaders?: Record<string, string>;
|
|
1745
|
-
};
|
|
1746
|
-
};
|
|
1747
|
-
|
|
1748
|
-
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
1749
|
-
interface HttpClient$3 {
|
|
1750
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
1751
|
-
fetchWithAuth: typeof fetch;
|
|
1752
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1753
|
-
getActiveToken?: () => string | undefined;
|
|
1536
|
+
fieldsets?: Field$3[];
|
|
1754
1537
|
}
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
status: number;
|
|
1759
|
-
statusText: string;
|
|
1760
|
-
headers: any;
|
|
1761
|
-
request?: any;
|
|
1762
|
-
};
|
|
1763
|
-
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
1764
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1765
|
-
url: string;
|
|
1766
|
-
data?: Data;
|
|
1767
|
-
params?: URLSearchParams;
|
|
1768
|
-
} & APIMetadata$3;
|
|
1769
|
-
type APIMetadata$3 = {
|
|
1770
|
-
methodFqn?: string;
|
|
1771
|
-
entityFqdn?: string;
|
|
1772
|
-
packageName?: string;
|
|
1773
|
-
};
|
|
1774
|
-
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
1775
|
-
type EventDefinition$7<Payload = unknown, Type extends string = string> = {
|
|
1776
|
-
__type: 'event-definition';
|
|
1777
|
-
type: Type;
|
|
1778
|
-
isDomainEvent?: boolean;
|
|
1779
|
-
transformations?: (envelope: unknown) => Payload;
|
|
1780
|
-
__payload: Payload;
|
|
1781
|
-
};
|
|
1782
|
-
declare function EventDefinition$7<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$7<Payload, Type>;
|
|
1783
|
-
type EventHandler$7<T extends EventDefinition$7> = (payload: T['__payload']) => void | Promise<void>;
|
|
1784
|
-
type BuildEventDefinition$7<T extends EventDefinition$7<any, string>> = (handler: EventHandler$7<T>) => void;
|
|
1785
|
-
|
|
1786
|
-
type ServicePluginMethodInput$3 = {
|
|
1787
|
-
request: any;
|
|
1788
|
-
metadata: any;
|
|
1789
|
-
};
|
|
1790
|
-
type ServicePluginContract$3 = Record<string, (payload: ServicePluginMethodInput$3) => unknown | Promise<unknown>>;
|
|
1791
|
-
type ServicePluginMethodMetadata$3 = {
|
|
1792
|
-
name: string;
|
|
1793
|
-
primaryHttpMappingPath: string;
|
|
1794
|
-
transformations: {
|
|
1795
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$3;
|
|
1796
|
-
toREST: (...args: unknown[]) => unknown;
|
|
1797
|
-
};
|
|
1798
|
-
};
|
|
1799
|
-
type ServicePluginDefinition$3<Contract extends ServicePluginContract$3> = {
|
|
1800
|
-
__type: 'service-plugin-definition';
|
|
1801
|
-
componentType: string;
|
|
1802
|
-
methods: ServicePluginMethodMetadata$3[];
|
|
1803
|
-
__contract: Contract;
|
|
1804
|
-
};
|
|
1805
|
-
declare function ServicePluginDefinition$3<Contract extends ServicePluginContract$3>(componentType: string, methods: ServicePluginMethodMetadata$3[]): ServicePluginDefinition$3<Contract>;
|
|
1806
|
-
type BuildServicePluginDefinition$3<T extends ServicePluginDefinition$3<any>> = (implementation: T['__contract']) => void;
|
|
1807
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$3 = "wix_spi_error";
|
|
1808
|
-
|
|
1809
|
-
type RequestContext$3 = {
|
|
1810
|
-
isSSR: boolean;
|
|
1811
|
-
host: string;
|
|
1812
|
-
protocol?: string;
|
|
1813
|
-
};
|
|
1814
|
-
type ResponseTransformer$3 = (data: any, headers?: any) => any;
|
|
1815
|
-
/**
|
|
1816
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
1817
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
1818
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
1819
|
-
*/
|
|
1820
|
-
type Method$3 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
1821
|
-
type AmbassadorRequestOptions$3<T = any> = {
|
|
1822
|
-
_?: T;
|
|
1823
|
-
url?: string;
|
|
1824
|
-
method?: Method$3;
|
|
1825
|
-
params?: any;
|
|
1826
|
-
data?: any;
|
|
1827
|
-
transformResponse?: ResponseTransformer$3 | ResponseTransformer$3[];
|
|
1828
|
-
};
|
|
1829
|
-
type AmbassadorFactory$3<Request, Response> = (payload: Request) => ((context: RequestContext$3) => AmbassadorRequestOptions$3<Response>) & {
|
|
1830
|
-
__isAmbassador: boolean;
|
|
1831
|
-
};
|
|
1832
|
-
type AmbassadorFunctionDescriptor$3<Request = any, Response = any> = AmbassadorFactory$3<Request, Response>;
|
|
1833
|
-
type BuildAmbassadorFunction$3<T extends AmbassadorFunctionDescriptor$3> = T extends AmbassadorFunctionDescriptor$3<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
1834
|
-
|
|
1835
|
-
declare global {
|
|
1836
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1837
|
-
interface SymbolConstructor {
|
|
1838
|
-
readonly observable: symbol;
|
|
1839
|
-
}
|
|
1538
|
+
interface UpdateCategoryResponse {
|
|
1539
|
+
/** Category info. */
|
|
1540
|
+
category?: Category$2;
|
|
1840
1541
|
}
|
|
1841
|
-
|
|
1842
|
-
declare const emptyObjectSymbol$3: unique symbol;
|
|
1843
|
-
|
|
1844
|
-
/**
|
|
1845
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
1846
|
-
|
|
1847
|
-
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)).
|
|
1848
|
-
|
|
1849
|
-
@example
|
|
1850
|
-
```
|
|
1851
|
-
import type {EmptyObject} from 'type-fest';
|
|
1852
|
-
|
|
1853
|
-
// The following illustrates the problem with `{}`.
|
|
1854
|
-
const foo1: {} = {}; // Pass
|
|
1855
|
-
const foo2: {} = []; // Pass
|
|
1856
|
-
const foo3: {} = 42; // Pass
|
|
1857
|
-
const foo4: {} = {a: 1}; // Pass
|
|
1858
|
-
|
|
1859
|
-
// With `EmptyObject` only the first case is valid.
|
|
1860
|
-
const bar1: EmptyObject = {}; // Pass
|
|
1861
|
-
const bar2: EmptyObject = 42; // Fail
|
|
1862
|
-
const bar3: EmptyObject = []; // Fail
|
|
1863
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
1864
|
-
```
|
|
1865
|
-
|
|
1866
|
-
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}.
|
|
1867
|
-
|
|
1868
|
-
@category Object
|
|
1869
|
-
*/
|
|
1870
|
-
type EmptyObject$3 = {[emptyObjectSymbol$3]?: never};
|
|
1871
|
-
|
|
1872
|
-
/**
|
|
1873
|
-
Returns a boolean for whether the two given types are equal.
|
|
1874
|
-
|
|
1875
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
1876
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
1877
|
-
|
|
1878
|
-
Use-cases:
|
|
1879
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
1880
|
-
|
|
1881
|
-
@example
|
|
1882
|
-
```
|
|
1883
|
-
import type {IsEqual} from 'type-fest';
|
|
1884
|
-
|
|
1885
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
1886
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
1887
|
-
type Includes<Value extends readonly any[], Item> =
|
|
1888
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
1889
|
-
? IsEqual<Value[0], Item> extends true
|
|
1890
|
-
? true
|
|
1891
|
-
: Includes<rest, Item>
|
|
1892
|
-
: false;
|
|
1893
|
-
```
|
|
1894
|
-
|
|
1895
|
-
@category Type Guard
|
|
1896
|
-
@category Utilities
|
|
1897
|
-
*/
|
|
1898
|
-
type IsEqual$3<A, B> =
|
|
1899
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
1900
|
-
(<G>() => G extends B ? 1 : 2)
|
|
1901
|
-
? true
|
|
1902
|
-
: false;
|
|
1903
|
-
|
|
1904
|
-
/**
|
|
1905
|
-
Filter out keys from an object.
|
|
1906
|
-
|
|
1907
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
1908
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
1909
|
-
Returns `Key` otherwise.
|
|
1910
|
-
|
|
1911
|
-
@example
|
|
1912
|
-
```
|
|
1913
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
1914
|
-
//=> never
|
|
1915
|
-
```
|
|
1916
|
-
|
|
1917
|
-
@example
|
|
1918
|
-
```
|
|
1919
|
-
type Filtered = Filter<'bar', string>;
|
|
1920
|
-
//=> never
|
|
1921
|
-
```
|
|
1922
|
-
|
|
1923
|
-
@example
|
|
1924
|
-
```
|
|
1925
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
1926
|
-
//=> 'bar'
|
|
1927
|
-
```
|
|
1928
|
-
|
|
1929
|
-
@see {Except}
|
|
1930
|
-
*/
|
|
1931
|
-
type Filter$3<KeyType, ExcludeType> = IsEqual$3<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
1932
|
-
|
|
1933
|
-
type ExceptOptions$3 = {
|
|
1934
|
-
/**
|
|
1935
|
-
Disallow assigning non-specified properties.
|
|
1936
|
-
|
|
1937
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
1938
|
-
|
|
1939
|
-
@default false
|
|
1940
|
-
*/
|
|
1941
|
-
requireExactProps?: boolean;
|
|
1942
|
-
};
|
|
1943
|
-
|
|
1944
|
-
/**
|
|
1945
|
-
Create a type from an object type without certain keys.
|
|
1946
|
-
|
|
1947
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
1948
|
-
|
|
1949
|
-
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.
|
|
1950
|
-
|
|
1951
|
-
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)).
|
|
1952
|
-
|
|
1953
|
-
@example
|
|
1954
|
-
```
|
|
1955
|
-
import type {Except} from 'type-fest';
|
|
1956
|
-
|
|
1957
|
-
type Foo = {
|
|
1958
|
-
a: number;
|
|
1959
|
-
b: string;
|
|
1960
|
-
};
|
|
1961
|
-
|
|
1962
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
1963
|
-
//=> {b: string}
|
|
1964
|
-
|
|
1965
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
1966
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
1967
|
-
|
|
1968
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
1969
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
1970
|
-
|
|
1971
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
1972
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
1973
|
-
```
|
|
1974
|
-
|
|
1975
|
-
@category Object
|
|
1976
|
-
*/
|
|
1977
|
-
type Except$3<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$3 = {requireExactProps: false}> = {
|
|
1978
|
-
[KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
|
|
1979
|
-
} & (Options['requireExactProps'] extends true
|
|
1980
|
-
? Partial<Record<KeysType, never>>
|
|
1981
|
-
: {});
|
|
1982
|
-
|
|
1983
|
-
/**
|
|
1984
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
1985
|
-
|
|
1986
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
1987
|
-
|
|
1988
|
-
@example
|
|
1989
|
-
```
|
|
1990
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
1991
|
-
|
|
1992
|
-
interface Example {
|
|
1993
|
-
a: string;
|
|
1994
|
-
b: string | number;
|
|
1995
|
-
c?: string;
|
|
1996
|
-
d: {};
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
2000
|
-
//=> 'a'
|
|
2001
|
-
```
|
|
2002
|
-
|
|
2003
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
2004
|
-
|
|
2005
|
-
@example
|
|
2006
|
-
```
|
|
2007
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
2008
|
-
|
|
2009
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
2010
|
-
//=> 'a' | 'c'
|
|
2011
|
-
```
|
|
2012
|
-
|
|
2013
|
-
@category Object
|
|
2014
|
-
*/
|
|
2015
|
-
type ConditionalKeys$3<Base, Condition> = NonNullable<
|
|
2016
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
2017
|
-
{
|
|
2018
|
-
// Map through all the keys of the given base type.
|
|
2019
|
-
[Key in keyof Base]:
|
|
2020
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
2021
|
-
Base[Key] extends Condition
|
|
2022
|
-
// Retain this key since the condition passes.
|
|
2023
|
-
? Key
|
|
2024
|
-
// Discard this key since the condition fails.
|
|
2025
|
-
: never;
|
|
2026
|
-
|
|
2027
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
2028
|
-
}[keyof Base]
|
|
2029
|
-
>;
|
|
2030
|
-
|
|
2031
|
-
/**
|
|
2032
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
2033
|
-
|
|
2034
|
-
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.
|
|
2035
|
-
|
|
2036
|
-
@example
|
|
2037
|
-
```
|
|
2038
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
2039
|
-
|
|
2040
|
-
class Awesome {
|
|
2041
|
-
name: string;
|
|
2042
|
-
successes: number;
|
|
2043
|
-
failures: bigint;
|
|
2044
|
-
|
|
2045
|
-
run() {}
|
|
1542
|
+
interface GetCategoriesCountByLanguageRequest {
|
|
2046
1543
|
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
```
|
|
2051
|
-
|
|
2052
|
-
@example
|
|
2053
|
-
```
|
|
2054
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
2055
|
-
|
|
2056
|
-
interface Example {
|
|
2057
|
-
a: string;
|
|
2058
|
-
b: string | number;
|
|
2059
|
-
c: () => void;
|
|
2060
|
-
d: {};
|
|
1544
|
+
interface GetCategoriesCountByLanguageResponse {
|
|
1545
|
+
/** The language and it's count. */
|
|
1546
|
+
categoriesLanguageCount?: CategoryLanguageCount[];
|
|
2061
1547
|
}
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
@category Object
|
|
2068
|
-
*/
|
|
2069
|
-
type ConditionalExcept$3<Base, Condition> = Except$3<
|
|
2070
|
-
Base,
|
|
2071
|
-
ConditionalKeys$3<Base, Condition>
|
|
2072
|
-
>;
|
|
2073
|
-
|
|
2074
|
-
/**
|
|
2075
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
2076
|
-
* can either be a REST module or a host module.
|
|
2077
|
-
* This type is recursive, so it can describe nested modules.
|
|
2078
|
-
*/
|
|
2079
|
-
type Descriptors$3 = RESTFunctionDescriptor$3 | AmbassadorFunctionDescriptor$3 | HostModule$3<any, any> | EventDefinition$7<any> | ServicePluginDefinition$3<any> | {
|
|
2080
|
-
[key: string]: Descriptors$3 | PublicMetadata$3 | any;
|
|
2081
|
-
};
|
|
2082
|
-
/**
|
|
2083
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
2084
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
2085
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
2086
|
-
* do not match the given host (as they will not work with the given host).
|
|
2087
|
-
*/
|
|
2088
|
-
type BuildDescriptors$3<T extends Descriptors$3, H extends Host$3<any> | undefined, Depth extends number = 5> = {
|
|
2089
|
-
done: T;
|
|
2090
|
-
recurse: T extends {
|
|
2091
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$3;
|
|
2092
|
-
} ? never : T extends AmbassadorFunctionDescriptor$3 ? BuildAmbassadorFunction$3<T> : T extends RESTFunctionDescriptor$3 ? BuildRESTFunction$3<T> : T extends EventDefinition$7<any> ? BuildEventDefinition$7<T> : T extends ServicePluginDefinition$3<any> ? BuildServicePluginDefinition$3<T> : T extends HostModule$3<any, any> ? HostModuleAPI$3<T> : ConditionalExcept$3<{
|
|
2093
|
-
[Key in keyof T]: T[Key] extends Descriptors$3 ? BuildDescriptors$3<T[Key], H, [
|
|
2094
|
-
-1,
|
|
2095
|
-
0,
|
|
2096
|
-
1,
|
|
2097
|
-
2,
|
|
2098
|
-
3,
|
|
2099
|
-
4,
|
|
2100
|
-
5
|
|
2101
|
-
][Depth]> : never;
|
|
2102
|
-
}, EmptyObject$3>;
|
|
2103
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
2104
|
-
type PublicMetadata$3 = {
|
|
2105
|
-
PACKAGE_NAME?: string;
|
|
2106
|
-
};
|
|
2107
|
-
|
|
2108
|
-
declare global {
|
|
2109
|
-
interface ContextualClient {
|
|
2110
|
-
}
|
|
1548
|
+
interface CategoryLanguageCount {
|
|
1549
|
+
/** 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. */
|
|
1550
|
+
languageCode?: string | null;
|
|
1551
|
+
/** The count of Categories for the language. */
|
|
1552
|
+
categoryCount?: number | null;
|
|
2111
1553
|
}
|
|
2112
|
-
|
|
2113
|
-
* A type used to create concerete types from SDK descriptors in
|
|
2114
|
-
* case a contextual client is available.
|
|
2115
|
-
*/
|
|
2116
|
-
type MaybeContext$3<T extends Descriptors$3> = globalThis.ContextualClient extends {
|
|
2117
|
-
host: Host$3;
|
|
2118
|
-
} ? BuildDescriptors$3<T, globalThis.ContextualClient['host']> : T;
|
|
2119
|
-
|
|
2120
|
-
interface Category$2 {
|
|
1554
|
+
interface GetCategoryRequest {
|
|
2121
1555
|
/** Category ID. */
|
|
2122
|
-
|
|
2123
|
-
/** Category label. Displayed in the Category Menu. */
|
|
2124
|
-
label?: string;
|
|
1556
|
+
categoryId: string;
|
|
2125
1557
|
/**
|
|
2126
|
-
*
|
|
2127
|
-
*
|
|
1558
|
+
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
1559
|
+
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
1560
|
+
* only the category’s base fields are returned.
|
|
2128
1561
|
*/
|
|
2129
|
-
|
|
1562
|
+
fieldsets?: Field$3[];
|
|
1563
|
+
}
|
|
1564
|
+
interface GetCategoryResponse {
|
|
1565
|
+
/** Category info. */
|
|
1566
|
+
category?: Category$2;
|
|
1567
|
+
}
|
|
1568
|
+
interface GetCategoryBySlugRequest {
|
|
1569
|
+
/** Slug of the category to retrieve. */
|
|
1570
|
+
slug: string;
|
|
2130
1571
|
/**
|
|
2131
|
-
*
|
|
2132
|
-
*
|
|
2133
|
-
*
|
|
2134
|
-
* The `url` directs you to a page that lists every post with the specified category.
|
|
2135
|
-
*
|
|
2136
|
-
* @readonly
|
|
1572
|
+
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
1573
|
+
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
1574
|
+
* only the category’s base fields are returned.
|
|
2137
1575
|
*/
|
|
2138
|
-
|
|
2139
|
-
/** Category description. */
|
|
2140
|
-
description?: string | null;
|
|
2141
|
-
/** Category title. */
|
|
2142
|
-
title?: string;
|
|
1576
|
+
fieldsets?: Field$3[];
|
|
2143
1577
|
/**
|
|
2144
|
-
*
|
|
2145
|
-
*
|
|
2146
|
-
* @replacedBy display_position
|
|
2147
|
-
* @targetRemovalDate 2024-06-30
|
|
1578
|
+
* 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
1579
|
+
* Language of the category to retrieve.
|
|
2148
1580
|
*/
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
/**
|
|
2153
|
-
|
|
1581
|
+
language?: string | null;
|
|
1582
|
+
}
|
|
1583
|
+
interface GetCategoryBySlugResponse {
|
|
1584
|
+
/** Category info. */
|
|
1585
|
+
category?: Category$2;
|
|
1586
|
+
}
|
|
1587
|
+
interface ListCategoriesRequest {
|
|
1588
|
+
/** Pagination options. */
|
|
1589
|
+
paging?: BlogPaging$2;
|
|
2154
1590
|
/**
|
|
2155
|
-
*
|
|
1591
|
+
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
1592
|
+
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
1593
|
+
* only the category’s base fields are returned.
|
|
1594
|
+
*/
|
|
1595
|
+
fieldsets?: Field$3[];
|
|
1596
|
+
/**
|
|
1597
|
+
* Language filter.
|
|
2156
1598
|
*
|
|
2157
|
-
* 2-letter language code in [
|
|
1599
|
+
* 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
1600
|
+
* Pass a language to only receive categories that are in that language.
|
|
1601
|
+
* If omitted, categories in all languages are returned.
|
|
2158
1602
|
*/
|
|
2159
1603
|
language?: string | null;
|
|
1604
|
+
}
|
|
1605
|
+
interface BlogPaging$2 {
|
|
1606
|
+
/** Number of categories to skip in the list. */
|
|
1607
|
+
offset?: number;
|
|
2160
1608
|
/**
|
|
2161
|
-
*
|
|
1609
|
+
* Number of items to return.
|
|
2162
1610
|
*
|
|
1611
|
+
* Default: `50`
|
|
2163
1612
|
*
|
|
2164
|
-
*
|
|
2165
|
-
*/
|
|
2166
|
-
slug?: string;
|
|
2167
|
-
/**
|
|
2168
|
-
* Reserved for internal use.
|
|
2169
|
-
* @readonly
|
|
2170
|
-
*/
|
|
2171
|
-
internalId?: string | null;
|
|
2172
|
-
/** SEO data. */
|
|
2173
|
-
seoData?: SeoSchema$3;
|
|
2174
|
-
/** Category cover image. */
|
|
2175
|
-
coverImage?: string;
|
|
2176
|
-
/**
|
|
2177
|
-
* Date and time the Category was last updated.
|
|
2178
|
-
* @readonly
|
|
1613
|
+
* Max: `100`
|
|
2179
1614
|
*/
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
* The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.
|
|
2184
|
-
* The search engines use this information for ranking purposes, or to display snippets in the search results.
|
|
2185
|
-
* This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.
|
|
2186
|
-
*/
|
|
2187
|
-
interface SeoSchema$3 {
|
|
2188
|
-
/** SEO tag information. */
|
|
2189
|
-
tags?: Tag$3[];
|
|
2190
|
-
/** SEO general settings. */
|
|
2191
|
-
settings?: Settings$3;
|
|
2192
|
-
}
|
|
2193
|
-
interface Keyword$3 {
|
|
2194
|
-
/** Keyword value. */
|
|
2195
|
-
term?: string;
|
|
2196
|
-
/** Whether the keyword is the main focus keyword. */
|
|
2197
|
-
isMain?: boolean;
|
|
2198
|
-
/** Who added the keyword to the settings */
|
|
2199
|
-
origin?: string | null;
|
|
2200
|
-
}
|
|
2201
|
-
interface Tag$3 {
|
|
2202
|
-
/**
|
|
2203
|
-
* SEO tag type.
|
|
2204
|
-
*
|
|
2205
|
-
*
|
|
2206
|
-
* Supported values: `title`, `meta`, `script`, `link`.
|
|
2207
|
-
*/
|
|
2208
|
-
type?: string;
|
|
2209
|
-
/**
|
|
2210
|
-
* A `{'key':'value'}` pair object where each SEO tag property (`'name'`, `'content'`, `'rel'`, `'href'`) contains a value.
|
|
2211
|
-
* For example: `{'name': 'description', 'content': 'the description itself'}`.
|
|
2212
|
-
*/
|
|
2213
|
-
props?: Record<string, any> | null;
|
|
2214
|
-
/** SEO tag meta data. For example, `{height: 300, width: 240}`. */
|
|
2215
|
-
meta?: Record<string, any> | null;
|
|
2216
|
-
/** SEO tag inner content. For example, `<title> inner content </title>`. */
|
|
2217
|
-
children?: string;
|
|
2218
|
-
/** Whether the tag is a custom tag. */
|
|
2219
|
-
custom?: boolean;
|
|
2220
|
-
/** Whether the tag is disabled. */
|
|
2221
|
-
disabled?: boolean;
|
|
2222
|
-
}
|
|
2223
|
-
interface Settings$3 {
|
|
2224
|
-
/**
|
|
2225
|
-
* Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.
|
|
2226
|
-
*
|
|
2227
|
-
*
|
|
2228
|
-
* Default: `false` (Auto Redirect is enabled.)
|
|
2229
|
-
*/
|
|
2230
|
-
preventAutoRedirect?: boolean;
|
|
2231
|
-
/** User-selected keyword terms for a specific page. */
|
|
2232
|
-
keywords?: Keyword$3[];
|
|
2233
|
-
}
|
|
2234
|
-
interface CategoryTranslation$2 {
|
|
2235
|
-
/** Category ID */
|
|
2236
|
-
_id?: string;
|
|
2237
|
-
/** Label which is presented in the categories menu on site */
|
|
2238
|
-
label?: string | null;
|
|
2239
|
-
/** Language of the category */
|
|
2240
|
-
language?: string | null;
|
|
2241
|
-
/** Url of this category page */
|
|
2242
|
-
url?: string;
|
|
2243
|
-
}
|
|
2244
|
-
interface InitialCategoriesCopied {
|
|
2245
|
-
/** Number of categories copied. */
|
|
2246
|
-
count?: number;
|
|
2247
|
-
}
|
|
2248
|
-
interface CreateCategoryRequest {
|
|
2249
|
-
/** Category info. */
|
|
2250
|
-
category?: Category$2;
|
|
2251
|
-
/**
|
|
2252
|
-
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
2253
|
-
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
2254
|
-
* only the category’s base fields are returned.
|
|
2255
|
-
*/
|
|
2256
|
-
fieldsets?: Field$3[];
|
|
2257
|
-
}
|
|
2258
|
-
declare enum Field$3 {
|
|
2259
|
-
UNKNOWN = "UNKNOWN",
|
|
2260
|
-
/** Includes Category url. */
|
|
2261
|
-
URL = "URL",
|
|
2262
|
-
/**
|
|
2263
|
-
* Includes internal id field.
|
|
2264
|
-
* Reserved for internal use
|
|
2265
|
-
*/
|
|
2266
|
-
INTERNAL_ID = "INTERNAL_ID",
|
|
2267
|
-
/** Includes SEO data. */
|
|
2268
|
-
SEO = "SEO",
|
|
2269
|
-
/** Includes translations. */
|
|
2270
|
-
TRANSLATIONS = "TRANSLATIONS"
|
|
2271
|
-
}
|
|
2272
|
-
interface CreateCategoryResponse {
|
|
2273
|
-
/** Category info. */
|
|
2274
|
-
category?: Category$2;
|
|
2275
|
-
}
|
|
2276
|
-
interface BulkCreateCategoriesRequest {
|
|
2277
|
-
/** Categories to create. */
|
|
2278
|
-
categories?: Category$2[];
|
|
2279
|
-
/** Whether to return the full created category entities in the response. */
|
|
2280
|
-
returnFullEntity?: boolean;
|
|
2281
|
-
/**
|
|
2282
|
-
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
2283
|
-
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
2284
|
-
* only the category’s base fields are returned.
|
|
2285
|
-
*/
|
|
2286
|
-
fieldsets?: Field$3[];
|
|
2287
|
-
}
|
|
2288
|
-
interface BulkCreateCategoriesResponse {
|
|
2289
|
-
/** Categories created by bulk action. */
|
|
2290
|
-
results?: BulkCategoryResult[];
|
|
2291
|
-
/** Bulk action metadata. */
|
|
2292
|
-
bulkActionMetadata?: BulkActionMetadata$2;
|
|
2293
|
-
}
|
|
2294
|
-
interface BulkCategoryResult {
|
|
2295
|
-
/** Bulk actions metadata for category. */
|
|
2296
|
-
itemMetadata?: ItemMetadata$2;
|
|
2297
|
-
/** Optional created category. */
|
|
2298
|
-
item?: Category$2;
|
|
2299
|
-
}
|
|
2300
|
-
interface ItemMetadata$2 {
|
|
2301
|
-
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
2302
|
-
_id?: string | null;
|
|
2303
|
-
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
2304
|
-
originalIndex?: number;
|
|
2305
|
-
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
2306
|
-
success?: boolean;
|
|
2307
|
-
/** Details about the error in case of failure. */
|
|
2308
|
-
error?: ApplicationError$2;
|
|
2309
|
-
}
|
|
2310
|
-
interface ApplicationError$2 {
|
|
2311
|
-
/** Error code. */
|
|
2312
|
-
code?: string;
|
|
2313
|
-
/** Description of the error. */
|
|
2314
|
-
description?: string;
|
|
2315
|
-
/** Data related to the error. */
|
|
2316
|
-
data?: Record<string, any> | null;
|
|
2317
|
-
}
|
|
2318
|
-
interface BulkActionMetadata$2 {
|
|
2319
|
-
/** Number of items that were successfully processed. */
|
|
2320
|
-
totalSuccesses?: number;
|
|
2321
|
-
/** Number of items that couldn't be processed. */
|
|
2322
|
-
totalFailures?: number;
|
|
2323
|
-
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
2324
|
-
undetailedFailures?: number;
|
|
2325
|
-
}
|
|
2326
|
-
interface BulkUpdateCategoriesRequest {
|
|
2327
|
-
/** Categories to update. */
|
|
2328
|
-
categories?: MaskedCategory[];
|
|
2329
|
-
/** Whether to return the full created category entities in the response. */
|
|
2330
|
-
returnFullEntity?: boolean;
|
|
2331
|
-
/**
|
|
2332
|
-
* List of category fields to be included in the response if the entities are present.
|
|
2333
|
-
* Base default fieldset returns all core category properties (all properties that are not a supported fieldset value).
|
|
2334
|
-
* For example, when `URL` fieldset is selected, returned category will include the set of base properties and the category's preview url.
|
|
2335
|
-
*/
|
|
2336
|
-
fieldsets?: Field$3[];
|
|
2337
|
-
}
|
|
2338
|
-
interface MaskedCategory {
|
|
2339
|
-
/** Category */
|
|
2340
|
-
category?: Category$2;
|
|
2341
|
-
}
|
|
2342
|
-
interface BulkUpdateCategoriesResponse {
|
|
2343
|
-
/** Categories updated by bulk action. */
|
|
2344
|
-
results?: BulkCategoryResult[];
|
|
2345
|
-
/** Bulk action metadata. */
|
|
2346
|
-
bulkActionMetadata?: BulkActionMetadata$2;
|
|
2347
|
-
}
|
|
2348
|
-
interface UpdateCategoryRequest {
|
|
2349
|
-
/** Category info. */
|
|
2350
|
-
category?: Category$2;
|
|
2351
|
-
/**
|
|
2352
|
-
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
2353
|
-
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
2354
|
-
* only the category’s base fields are returned.
|
|
2355
|
-
*/
|
|
2356
|
-
fieldsets?: Field$3[];
|
|
2357
|
-
}
|
|
2358
|
-
interface UpdateCategoryResponse {
|
|
2359
|
-
/** Category info. */
|
|
2360
|
-
category?: Category$2;
|
|
2361
|
-
}
|
|
2362
|
-
interface GetCategoriesCountByLanguageRequest {
|
|
2363
|
-
}
|
|
2364
|
-
interface GetCategoriesCountByLanguageResponse {
|
|
2365
|
-
/** The language and it's count. */
|
|
2366
|
-
categoriesLanguageCount?: CategoryLanguageCount[];
|
|
2367
|
-
}
|
|
2368
|
-
interface CategoryLanguageCount {
|
|
2369
|
-
/** 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. */
|
|
2370
|
-
languageCode?: string | null;
|
|
2371
|
-
/** The count of Categories for the language. */
|
|
2372
|
-
categoryCount?: number | null;
|
|
2373
|
-
}
|
|
2374
|
-
interface GetCategoryRequest {
|
|
2375
|
-
/** Category ID. */
|
|
2376
|
-
categoryId: string;
|
|
2377
|
-
/**
|
|
2378
|
-
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
2379
|
-
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
2380
|
-
* only the category’s base fields are returned.
|
|
2381
|
-
*/
|
|
2382
|
-
fieldsets?: Field$3[];
|
|
2383
|
-
}
|
|
2384
|
-
interface GetCategoryResponse {
|
|
2385
|
-
/** Category info. */
|
|
2386
|
-
category?: Category$2;
|
|
2387
|
-
}
|
|
2388
|
-
interface GetCategoryBySlugRequest {
|
|
2389
|
-
/** Slug of the category to retrieve. */
|
|
2390
|
-
slug: string;
|
|
2391
|
-
/**
|
|
2392
|
-
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
2393
|
-
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
2394
|
-
* only the category’s base fields are returned.
|
|
2395
|
-
*/
|
|
2396
|
-
fieldsets?: Field$3[];
|
|
2397
|
-
/**
|
|
2398
|
-
* 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2399
|
-
* Language of the category to retrieve.
|
|
2400
|
-
*/
|
|
2401
|
-
language?: string | null;
|
|
2402
|
-
}
|
|
2403
|
-
interface GetCategoryBySlugResponse {
|
|
2404
|
-
/** Category info. */
|
|
2405
|
-
category?: Category$2;
|
|
2406
|
-
}
|
|
2407
|
-
interface ListCategoriesRequest {
|
|
2408
|
-
/** Pagination options. */
|
|
2409
|
-
paging?: BlogPaging$2;
|
|
2410
|
-
/**
|
|
2411
|
-
* List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
|
|
2412
|
-
* the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
|
|
2413
|
-
* only the category’s base fields are returned.
|
|
2414
|
-
*/
|
|
2415
|
-
fieldsets?: Field$3[];
|
|
2416
|
-
/**
|
|
2417
|
-
* Language filter.
|
|
2418
|
-
*
|
|
2419
|
-
* 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2420
|
-
* Pass a language to only receive categories that are in that language.
|
|
2421
|
-
* If omitted, categories in all languages are returned.
|
|
2422
|
-
*/
|
|
2423
|
-
language?: string | null;
|
|
2424
|
-
}
|
|
2425
|
-
interface BlogPaging$2 {
|
|
2426
|
-
/** Number of categories to skip in the list. */
|
|
2427
|
-
offset?: number;
|
|
2428
|
-
/**
|
|
2429
|
-
* Number of items to return.
|
|
2430
|
-
*
|
|
2431
|
-
* Default: `50`
|
|
2432
|
-
*
|
|
2433
|
-
* Max: `100`
|
|
2434
|
-
*/
|
|
2435
|
-
limit?: number;
|
|
2436
|
-
/** Pointer to the next or previous page in the list of results. */
|
|
2437
|
-
cursor?: string | null;
|
|
1615
|
+
limit?: number;
|
|
1616
|
+
/** Pointer to the next or previous page in the list of results. */
|
|
1617
|
+
cursor?: string | null;
|
|
2438
1618
|
}
|
|
2439
1619
|
interface ListCategoriesResponse {
|
|
2440
1620
|
/** List of categories. */
|
|
@@ -2865,7 +2045,7 @@ interface CategoriesQueryBuilder {
|
|
|
2865
2045
|
find: () => Promise<CategoriesQueryResult>;
|
|
2866
2046
|
}
|
|
2867
2047
|
|
|
2868
|
-
declare function getCategory$1(httpClient: HttpClient
|
|
2048
|
+
declare function getCategory$1(httpClient: HttpClient): GetCategorySignature;
|
|
2869
2049
|
interface GetCategorySignature {
|
|
2870
2050
|
/**
|
|
2871
2051
|
* Gets a category by the specified ID.
|
|
@@ -2878,7 +2058,7 @@ interface GetCategorySignature {
|
|
|
2878
2058
|
*/
|
|
2879
2059
|
(categoryId: string, options?: GetCategoryOptions | undefined): Promise<GetCategoryResponse & GetCategoryResponseNonNullableFields>;
|
|
2880
2060
|
}
|
|
2881
|
-
declare function getCategoryBySlug$1(httpClient: HttpClient
|
|
2061
|
+
declare function getCategoryBySlug$1(httpClient: HttpClient): GetCategoryBySlugSignature;
|
|
2882
2062
|
interface GetCategoryBySlugSignature {
|
|
2883
2063
|
/**
|
|
2884
2064
|
* Gets a category by the specified slug.
|
|
@@ -2895,7 +2075,7 @@ interface GetCategoryBySlugSignature {
|
|
|
2895
2075
|
*/
|
|
2896
2076
|
(slug: string, options?: GetCategoryBySlugOptions | undefined): Promise<GetCategoryBySlugResponse & GetCategoryBySlugResponseNonNullableFields>;
|
|
2897
2077
|
}
|
|
2898
|
-
declare function listCategories$1(httpClient: HttpClient
|
|
2078
|
+
declare function listCategories$1(httpClient: HttpClient): ListCategoriesSignature;
|
|
2899
2079
|
interface ListCategoriesSignature {
|
|
2900
2080
|
/**
|
|
2901
2081
|
* Retrieves a list of categories.
|
|
@@ -2906,7 +2086,7 @@ interface ListCategoriesSignature {
|
|
|
2906
2086
|
*/
|
|
2907
2087
|
(options?: ListCategoriesOptions | undefined): Promise<ListCategoriesResponse & ListCategoriesResponseNonNullableFields>;
|
|
2908
2088
|
}
|
|
2909
|
-
declare function queryCategories$1(httpClient: HttpClient
|
|
2089
|
+
declare function queryCategories$1(httpClient: HttpClient): QueryCategoriesSignature;
|
|
2910
2090
|
interface QueryCategoriesSignature {
|
|
2911
2091
|
/**
|
|
2912
2092
|
* Creates a query to retrieve a list of categories.
|
|
@@ -2927,20 +2107,20 @@ interface QueryCategoriesSignature {
|
|
|
2927
2107
|
*/
|
|
2928
2108
|
(options?: QueryCategoriesOptions | undefined): CategoriesQueryBuilder;
|
|
2929
2109
|
}
|
|
2930
|
-
declare const onCategoryCreated$1: EventDefinition$
|
|
2931
|
-
declare const onCategoryUpdated$1: EventDefinition$
|
|
2932
|
-
declare const onCategoryDeleted$1: EventDefinition$
|
|
2110
|
+
declare const onCategoryCreated$1: EventDefinition$4<CategoryCreatedEnvelope, "wix.blog.v3.category_created">;
|
|
2111
|
+
declare const onCategoryUpdated$1: EventDefinition$4<CategoryUpdatedEnvelope, "wix.blog.v3.category_updated">;
|
|
2112
|
+
declare const onCategoryDeleted$1: EventDefinition$4<CategoryDeletedEnvelope, "wix.blog.v3.category_deleted">;
|
|
2933
2113
|
|
|
2934
|
-
type EventDefinition$
|
|
2114
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
2935
2115
|
__type: 'event-definition';
|
|
2936
2116
|
type: Type;
|
|
2937
2117
|
isDomainEvent?: boolean;
|
|
2938
2118
|
transformations?: (envelope: unknown) => Payload;
|
|
2939
2119
|
__payload: Payload;
|
|
2940
2120
|
};
|
|
2941
|
-
declare function EventDefinition$
|
|
2942
|
-
type EventHandler$
|
|
2943
|
-
type BuildEventDefinition$
|
|
2121
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
2122
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
2123
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
2944
2124
|
|
|
2945
2125
|
declare global {
|
|
2946
2126
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -2949,12 +2129,12 @@ declare global {
|
|
|
2949
2129
|
}
|
|
2950
2130
|
}
|
|
2951
2131
|
|
|
2952
|
-
declare function createEventModule$3<T extends EventDefinition$
|
|
2132
|
+
declare function createEventModule$3<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
|
|
2953
2133
|
|
|
2954
|
-
declare const getCategory: MaybeContext
|
|
2955
|
-
declare const getCategoryBySlug: MaybeContext
|
|
2956
|
-
declare const listCategories: MaybeContext
|
|
2957
|
-
declare const queryCategories: MaybeContext
|
|
2134
|
+
declare const getCategory: MaybeContext<BuildRESTFunction<typeof getCategory$1> & typeof getCategory$1>;
|
|
2135
|
+
declare const getCategoryBySlug: MaybeContext<BuildRESTFunction<typeof getCategoryBySlug$1> & typeof getCategoryBySlug$1>;
|
|
2136
|
+
declare const listCategories: MaybeContext<BuildRESTFunction<typeof listCategories$1> & typeof listCategories$1>;
|
|
2137
|
+
declare const queryCategories: MaybeContext<BuildRESTFunction<typeof queryCategories$1> & typeof queryCategories$1>;
|
|
2958
2138
|
|
|
2959
2139
|
type _publicOnCategoryCreatedType = typeof onCategoryCreated$1;
|
|
2960
2140
|
/**
|
|
@@ -3027,561 +2207,151 @@ declare namespace index_d$3 {
|
|
|
3027
2207
|
export { type ActionEvent$3 as ActionEvent, type ApplicationError$2 as ApplicationError, type BaseEventMetadata$3 as BaseEventMetadata, type BlogPaging$2 as BlogPaging, type BulkActionMetadata$2 as BulkActionMetadata, type index_d$3_BulkCategoryResult as BulkCategoryResult, type index_d$3_BulkCreateCategoriesRequest as BulkCreateCategoriesRequest, type index_d$3_BulkCreateCategoriesResponse as BulkCreateCategoriesResponse, type index_d$3_BulkDeleteCategoryRequest as BulkDeleteCategoryRequest, type index_d$3_BulkDeleteCategoryResponse as BulkDeleteCategoryResponse, type index_d$3_BulkUpdateCategoriesRequest as BulkUpdateCategoriesRequest, type index_d$3_BulkUpdateCategoriesResponse as BulkUpdateCategoriesResponse, type index_d$3_CategoriesQueryBuilder as CategoriesQueryBuilder, type index_d$3_CategoriesQueryResult as CategoriesQueryResult, type Category$2 as Category, type index_d$3_CategoryCreatedEnvelope as CategoryCreatedEnvelope, type index_d$3_CategoryDeletedEnvelope as CategoryDeletedEnvelope, type index_d$3_CategoryLanguageCount as CategoryLanguageCount, type CategoryTranslation$2 as CategoryTranslation, type index_d$3_CategoryUpdatedEnvelope as CategoryUpdatedEnvelope, type index_d$3_CreateCategoryRequest as CreateCategoryRequest, type index_d$3_CreateCategoryResponse as CreateCategoryResponse, type CursorPaging$3 as CursorPaging, type Cursors$3 as Cursors, type index_d$3_DeleteCategoryRequest as DeleteCategoryRequest, type index_d$3_DeleteCategoryResponse as DeleteCategoryResponse, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type EventMetadata$3 as EventMetadata, Field$3 as Field, type index_d$3_GetCategoriesCountByLanguageRequest as GetCategoriesCountByLanguageRequest, type index_d$3_GetCategoriesCountByLanguageResponse as GetCategoriesCountByLanguageResponse, type index_d$3_GetCategoryBySlugOptions as GetCategoryBySlugOptions, type index_d$3_GetCategoryBySlugRequest as GetCategoryBySlugRequest, type index_d$3_GetCategoryBySlugResponse as GetCategoryBySlugResponse, type index_d$3_GetCategoryBySlugResponseNonNullableFields as GetCategoryBySlugResponseNonNullableFields, type index_d$3_GetCategoryOptions as GetCategoryOptions, type index_d$3_GetCategoryRequest as GetCategoryRequest, type index_d$3_GetCategoryResponse as GetCategoryResponse, type index_d$3_GetCategoryResponseNonNullableFields as GetCategoryResponseNonNullableFields, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type index_d$3_InitialCategoriesCopied as InitialCategoriesCopied, type ItemMetadata$2 as ItemMetadata, type Keyword$3 as Keyword, type index_d$3_ListCategoriesOptions as ListCategoriesOptions, type index_d$3_ListCategoriesRequest as ListCategoriesRequest, type index_d$3_ListCategoriesResponse as ListCategoriesResponse, type index_d$3_ListCategoriesResponseNonNullableFields as ListCategoriesResponseNonNullableFields, type index_d$3_MaskedCategory as MaskedCategory, type MessageEnvelope$3 as MessageEnvelope, type MetaData$3 as MetaData, type Paging$3 as Paging, type PagingMetadataV2$3 as PagingMetadataV2, type PlatformQuery$3 as PlatformQuery, type PlatformQueryPagingMethodOneOf$3 as PlatformQueryPagingMethodOneOf, type index_d$3_QueryCategoriesOptions as QueryCategoriesOptions, type index_d$3_QueryCategoriesRequest as QueryCategoriesRequest, type index_d$3_QueryCategoriesResponse as QueryCategoriesResponse, type index_d$3_QueryCategoriesResponseNonNullableFields as QueryCategoriesResponseNonNullableFields, type RestoreInfo$3 as RestoreInfo, type SeoSchema$3 as SeoSchema, type Settings$3 as Settings, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, type Tag$3 as Tag, type index_d$3_UpdateCategoryRequest as UpdateCategoryRequest, type index_d$3_UpdateCategoryResponse as UpdateCategoryResponse, WebhookIdentityType$3 as WebhookIdentityType, type index_d$3__publicOnCategoryCreatedType as _publicOnCategoryCreatedType, type index_d$3__publicOnCategoryDeletedType as _publicOnCategoryDeletedType, type index_d$3__publicOnCategoryUpdatedType as _publicOnCategoryUpdatedType, index_d$3_getCategory as getCategory, index_d$3_getCategoryBySlug as getCategoryBySlug, index_d$3_listCategories as listCategories, index_d$3_onCategoryCreated as onCategoryCreated, index_d$3_onCategoryDeleted as onCategoryDeleted, index_d$3_onCategoryUpdated as onCategoryUpdated, onCategoryCreated$1 as publicOnCategoryCreated, onCategoryDeleted$1 as publicOnCategoryDeleted, onCategoryUpdated$1 as publicOnCategoryUpdated, index_d$3_queryCategories as queryCategories };
|
|
3028
2208
|
}
|
|
3029
2209
|
|
|
3030
|
-
|
|
3031
|
-
__type: 'host';
|
|
3032
|
-
create(host: H): T;
|
|
3033
|
-
};
|
|
3034
|
-
type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
|
|
3035
|
-
type Host$2<Environment = unknown> = {
|
|
3036
|
-
channel: {
|
|
3037
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
3038
|
-
disconnect: () => void;
|
|
3039
|
-
} | Promise<{
|
|
3040
|
-
disconnect: () => void;
|
|
3041
|
-
}>;
|
|
3042
|
-
};
|
|
3043
|
-
environment?: Environment;
|
|
2210
|
+
interface DraftPost$1 {
|
|
3044
2211
|
/**
|
|
3045
|
-
*
|
|
2212
|
+
* Draft post ID.
|
|
2213
|
+
* @readonly
|
|
3046
2214
|
*/
|
|
3047
|
-
|
|
2215
|
+
_id?: string;
|
|
2216
|
+
/** Draft post title. */
|
|
2217
|
+
title?: string;
|
|
3048
2218
|
/**
|
|
3049
|
-
*
|
|
3050
|
-
*
|
|
2219
|
+
* Draft post excerpt.
|
|
2220
|
+
*
|
|
2221
|
+
* If no excerpt has been manually set, an excerpt is automatically generated from the post's text.
|
|
2222
|
+
* This can be retrieved using the `GENERATED_EXCERPT` fieldset.
|
|
2223
|
+
*/
|
|
2224
|
+
excerpt?: string | null;
|
|
2225
|
+
/** Whether the draft post is marked as featured. */
|
|
2226
|
+
featured?: boolean | null;
|
|
2227
|
+
/** Category IDs of the draft post. */
|
|
2228
|
+
categoryIds?: string[];
|
|
2229
|
+
/** Draft post owner's member ID. */
|
|
2230
|
+
memberId?: string | null;
|
|
2231
|
+
/** Hashtags in the draft post. */
|
|
2232
|
+
hashtags?: string[];
|
|
2233
|
+
/** Whether commenting on the draft post is enabled. */
|
|
2234
|
+
commentingEnabled?: boolean | null;
|
|
2235
|
+
/**
|
|
2236
|
+
* Estimated reading time of the draft post (calculated automatically).
|
|
2237
|
+
* @readonly
|
|
2238
|
+
*/
|
|
2239
|
+
minutesToRead?: number;
|
|
2240
|
+
/** Image placed at the top of the blog page. */
|
|
2241
|
+
heroImage?: string;
|
|
2242
|
+
/** Tag IDs the draft post is tagged with. */
|
|
2243
|
+
tagIds?: string[];
|
|
2244
|
+
/** IDs of posts related to this draft post. */
|
|
2245
|
+
relatedPostIds?: string[];
|
|
2246
|
+
/** Pricing plan IDs. Only relevant if a post is assigned to a specific pricing plan. */
|
|
2247
|
+
pricingPlanIds?: string[];
|
|
2248
|
+
/**
|
|
2249
|
+
* ID of the draft post's translations.
|
|
2250
|
+
*
|
|
2251
|
+
* All translations of a single post share the same `translationId`.
|
|
2252
|
+
* Available only if the [Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) app is installed.
|
|
2253
|
+
*/
|
|
2254
|
+
translationId?: string | null;
|
|
2255
|
+
/**
|
|
2256
|
+
* Language the draft post is written in.
|
|
2257
|
+
*
|
|
2258
|
+
* 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2259
|
+
*/
|
|
2260
|
+
language?: string | null;
|
|
2261
|
+
/**
|
|
2262
|
+
* Reserved for internal use.
|
|
2263
|
+
* @readonly
|
|
2264
|
+
*/
|
|
2265
|
+
changeOrigin?: Origin$1;
|
|
2266
|
+
/**
|
|
2267
|
+
* Reserved for internal use.
|
|
2268
|
+
* @readonly
|
|
2269
|
+
*/
|
|
2270
|
+
contentId?: string | null;
|
|
2271
|
+
/** Reserved for internal use. */
|
|
2272
|
+
editingSessionId?: string | null;
|
|
2273
|
+
/** Draft post rich content. */
|
|
2274
|
+
richContent?: RichContent$1;
|
|
2275
|
+
/**
|
|
2276
|
+
* Status of the draft post.
|
|
2277
|
+
* @readonly
|
|
2278
|
+
*/
|
|
2279
|
+
status?: Status$1;
|
|
2280
|
+
/** Details of the draft post in review. Only relevant to posts submitted by guest writers. */
|
|
2281
|
+
moderationDetails?: ModerationDetails$1;
|
|
2282
|
+
/**
|
|
2283
|
+
* Reserved for internal use.
|
|
2284
|
+
* @readonly
|
|
2285
|
+
*/
|
|
2286
|
+
mostRecentContributorId?: string | null;
|
|
2287
|
+
/**
|
|
2288
|
+
* Indicates if there are changes made to the draft post that have not yet been published.
|
|
2289
|
+
* @readonly
|
|
2290
|
+
*/
|
|
2291
|
+
hasUnpublishedChanges?: boolean;
|
|
2292
|
+
/**
|
|
2293
|
+
* Date the draft post was last edited.
|
|
2294
|
+
* @readonly
|
|
2295
|
+
*/
|
|
2296
|
+
editedDate?: Date;
|
|
2297
|
+
/**
|
|
2298
|
+
* Date the draft post is scheduled to be published.
|
|
2299
|
+
* @readonly
|
|
2300
|
+
*/
|
|
2301
|
+
scheduledPublishDate?: Date;
|
|
2302
|
+
/** Reserved for internal use. */
|
|
2303
|
+
content?: Record<string, any> | null;
|
|
2304
|
+
/** Date the post was first published. */
|
|
2305
|
+
firstPublishedDate?: Date;
|
|
2306
|
+
/** SEO data. */
|
|
2307
|
+
seoData?: SeoSchema$2;
|
|
2308
|
+
/**
|
|
2309
|
+
* @internal Deprecated.
|
|
2310
|
+
* @internal Deprecated.
|
|
2311
|
+
* @deprecated
|
|
2312
|
+
* @replacedBy preview_text_paragraph
|
|
2313
|
+
* @targetRemovalDate 2024-06-30
|
|
2314
|
+
*/
|
|
2315
|
+
paidContentParagraph?: number | null;
|
|
2316
|
+
/**
|
|
2317
|
+
* Reserved for internal use.
|
|
2318
|
+
* @readonly
|
|
2319
|
+
*/
|
|
2320
|
+
slugs?: string[];
|
|
2321
|
+
/**
|
|
2322
|
+
* Draft post URL preview. What the URL will look like once the post is published.
|
|
2323
|
+
* @readonly
|
|
3051
2324
|
*/
|
|
3052
|
-
essentials?: {
|
|
3053
|
-
/**
|
|
3054
|
-
* The language of the currently viewed session
|
|
3055
|
-
*/
|
|
3056
|
-
language?: string;
|
|
3057
|
-
/**
|
|
3058
|
-
* The locale of the currently viewed session
|
|
3059
|
-
*/
|
|
3060
|
-
locale?: string;
|
|
3061
|
-
/**
|
|
3062
|
-
* Any headers that should be passed through to the API requests
|
|
3063
|
-
*/
|
|
3064
|
-
passThroughHeaders?: Record<string, string>;
|
|
3065
|
-
};
|
|
3066
|
-
};
|
|
3067
|
-
|
|
3068
|
-
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
3069
|
-
interface HttpClient$2 {
|
|
3070
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
3071
|
-
fetchWithAuth: typeof fetch;
|
|
3072
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
3073
|
-
getActiveToken?: () => string | undefined;
|
|
3074
|
-
}
|
|
3075
|
-
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
3076
|
-
type HttpResponse$2<T = any> = {
|
|
3077
|
-
data: T;
|
|
3078
|
-
status: number;
|
|
3079
|
-
statusText: string;
|
|
3080
|
-
headers: any;
|
|
3081
|
-
request?: any;
|
|
3082
|
-
};
|
|
3083
|
-
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
3084
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3085
|
-
url: string;
|
|
3086
|
-
data?: Data;
|
|
3087
|
-
params?: URLSearchParams;
|
|
3088
|
-
} & APIMetadata$2;
|
|
3089
|
-
type APIMetadata$2 = {
|
|
3090
|
-
methodFqn?: string;
|
|
3091
|
-
entityFqdn?: string;
|
|
3092
|
-
packageName?: string;
|
|
3093
|
-
};
|
|
3094
|
-
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
3095
|
-
type EventDefinition$5<Payload = unknown, Type extends string = string> = {
|
|
3096
|
-
__type: 'event-definition';
|
|
3097
|
-
type: Type;
|
|
3098
|
-
isDomainEvent?: boolean;
|
|
3099
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3100
|
-
__payload: Payload;
|
|
3101
|
-
};
|
|
3102
|
-
declare function EventDefinition$5<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$5<Payload, Type>;
|
|
3103
|
-
type EventHandler$5<T extends EventDefinition$5> = (payload: T['__payload']) => void | Promise<void>;
|
|
3104
|
-
type BuildEventDefinition$5<T extends EventDefinition$5<any, string>> = (handler: EventHandler$5<T>) => void;
|
|
3105
|
-
|
|
3106
|
-
type ServicePluginMethodInput$2 = {
|
|
3107
|
-
request: any;
|
|
3108
|
-
metadata: any;
|
|
3109
|
-
};
|
|
3110
|
-
type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
|
|
3111
|
-
type ServicePluginMethodMetadata$2 = {
|
|
3112
|
-
name: string;
|
|
3113
|
-
primaryHttpMappingPath: string;
|
|
3114
|
-
transformations: {
|
|
3115
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
|
|
3116
|
-
toREST: (...args: unknown[]) => unknown;
|
|
3117
|
-
};
|
|
3118
|
-
};
|
|
3119
|
-
type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
|
|
3120
|
-
__type: 'service-plugin-definition';
|
|
3121
|
-
componentType: string;
|
|
3122
|
-
methods: ServicePluginMethodMetadata$2[];
|
|
3123
|
-
__contract: Contract;
|
|
3124
|
-
};
|
|
3125
|
-
declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
|
|
3126
|
-
type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
|
|
3127
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
|
|
3128
|
-
|
|
3129
|
-
type RequestContext$2 = {
|
|
3130
|
-
isSSR: boolean;
|
|
3131
|
-
host: string;
|
|
3132
|
-
protocol?: string;
|
|
3133
|
-
};
|
|
3134
|
-
type ResponseTransformer$2 = (data: any, headers?: any) => any;
|
|
3135
|
-
/**
|
|
3136
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
3137
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
3138
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
3139
|
-
*/
|
|
3140
|
-
type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
3141
|
-
type AmbassadorRequestOptions$2<T = any> = {
|
|
3142
|
-
_?: T;
|
|
3143
2325
|
url?: string;
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
2326
|
+
/**
|
|
2327
|
+
* Date the draft post was first created.
|
|
2328
|
+
* @readonly
|
|
2329
|
+
*/
|
|
2330
|
+
_createdDate?: Date;
|
|
2331
|
+
/** SEO slug. */
|
|
2332
|
+
seoSlug?: string | null;
|
|
2333
|
+
/** Post cover media. */
|
|
2334
|
+
media?: Media$1;
|
|
2335
|
+
/** Number of paragraphs to display in a paid content preview for non-paying users. */
|
|
2336
|
+
previewTextParagraph?: number | null;
|
|
2337
|
+
/**
|
|
2338
|
+
* Reserved for internal use.
|
|
2339
|
+
* @readonly
|
|
2340
|
+
*/
|
|
2341
|
+
internalId?: string | null;
|
|
3160
2342
|
}
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
/**
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
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)).
|
|
3168
|
-
|
|
3169
|
-
@example
|
|
3170
|
-
```
|
|
3171
|
-
import type {EmptyObject} from 'type-fest';
|
|
3172
|
-
|
|
3173
|
-
// The following illustrates the problem with `{}`.
|
|
3174
|
-
const foo1: {} = {}; // Pass
|
|
3175
|
-
const foo2: {} = []; // Pass
|
|
3176
|
-
const foo3: {} = 42; // Pass
|
|
3177
|
-
const foo4: {} = {a: 1}; // Pass
|
|
3178
|
-
|
|
3179
|
-
// With `EmptyObject` only the first case is valid.
|
|
3180
|
-
const bar1: EmptyObject = {}; // Pass
|
|
3181
|
-
const bar2: EmptyObject = 42; // Fail
|
|
3182
|
-
const bar3: EmptyObject = []; // Fail
|
|
3183
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
3184
|
-
```
|
|
3185
|
-
|
|
3186
|
-
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}.
|
|
3187
|
-
|
|
3188
|
-
@category Object
|
|
3189
|
-
*/
|
|
3190
|
-
type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
|
|
3191
|
-
|
|
3192
|
-
/**
|
|
3193
|
-
Returns a boolean for whether the two given types are equal.
|
|
3194
|
-
|
|
3195
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
3196
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
3197
|
-
|
|
3198
|
-
Use-cases:
|
|
3199
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
3200
|
-
|
|
3201
|
-
@example
|
|
3202
|
-
```
|
|
3203
|
-
import type {IsEqual} from 'type-fest';
|
|
3204
|
-
|
|
3205
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
3206
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
3207
|
-
type Includes<Value extends readonly any[], Item> =
|
|
3208
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
3209
|
-
? IsEqual<Value[0], Item> extends true
|
|
3210
|
-
? true
|
|
3211
|
-
: Includes<rest, Item>
|
|
3212
|
-
: false;
|
|
3213
|
-
```
|
|
3214
|
-
|
|
3215
|
-
@category Type Guard
|
|
3216
|
-
@category Utilities
|
|
3217
|
-
*/
|
|
3218
|
-
type IsEqual$2<A, B> =
|
|
3219
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
3220
|
-
(<G>() => G extends B ? 1 : 2)
|
|
3221
|
-
? true
|
|
3222
|
-
: false;
|
|
3223
|
-
|
|
3224
|
-
/**
|
|
3225
|
-
Filter out keys from an object.
|
|
3226
|
-
|
|
3227
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
3228
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
3229
|
-
Returns `Key` otherwise.
|
|
3230
|
-
|
|
3231
|
-
@example
|
|
3232
|
-
```
|
|
3233
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
3234
|
-
//=> never
|
|
3235
|
-
```
|
|
3236
|
-
|
|
3237
|
-
@example
|
|
3238
|
-
```
|
|
3239
|
-
type Filtered = Filter<'bar', string>;
|
|
3240
|
-
//=> never
|
|
3241
|
-
```
|
|
3242
|
-
|
|
3243
|
-
@example
|
|
3244
|
-
```
|
|
3245
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
3246
|
-
//=> 'bar'
|
|
3247
|
-
```
|
|
3248
|
-
|
|
3249
|
-
@see {Except}
|
|
3250
|
-
*/
|
|
3251
|
-
type Filter$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
3252
|
-
|
|
3253
|
-
type ExceptOptions$2 = {
|
|
3254
|
-
/**
|
|
3255
|
-
Disallow assigning non-specified properties.
|
|
3256
|
-
|
|
3257
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
3258
|
-
|
|
3259
|
-
@default false
|
|
3260
|
-
*/
|
|
3261
|
-
requireExactProps?: boolean;
|
|
3262
|
-
};
|
|
3263
|
-
|
|
3264
|
-
/**
|
|
3265
|
-
Create a type from an object type without certain keys.
|
|
3266
|
-
|
|
3267
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
3268
|
-
|
|
3269
|
-
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.
|
|
3270
|
-
|
|
3271
|
-
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)).
|
|
3272
|
-
|
|
3273
|
-
@example
|
|
3274
|
-
```
|
|
3275
|
-
import type {Except} from 'type-fest';
|
|
3276
|
-
|
|
3277
|
-
type Foo = {
|
|
3278
|
-
a: number;
|
|
3279
|
-
b: string;
|
|
3280
|
-
};
|
|
3281
|
-
|
|
3282
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
3283
|
-
//=> {b: string}
|
|
3284
|
-
|
|
3285
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
3286
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
3287
|
-
|
|
3288
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
3289
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
3290
|
-
|
|
3291
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
3292
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
3293
|
-
```
|
|
3294
|
-
|
|
3295
|
-
@category Object
|
|
3296
|
-
*/
|
|
3297
|
-
type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
|
|
3298
|
-
[KeyType in keyof ObjectType as Filter$2<KeyType, KeysType>]: ObjectType[KeyType];
|
|
3299
|
-
} & (Options['requireExactProps'] extends true
|
|
3300
|
-
? Partial<Record<KeysType, never>>
|
|
3301
|
-
: {});
|
|
3302
|
-
|
|
3303
|
-
/**
|
|
3304
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
3305
|
-
|
|
3306
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
3307
|
-
|
|
3308
|
-
@example
|
|
3309
|
-
```
|
|
3310
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
3311
|
-
|
|
3312
|
-
interface Example {
|
|
3313
|
-
a: string;
|
|
3314
|
-
b: string | number;
|
|
3315
|
-
c?: string;
|
|
3316
|
-
d: {};
|
|
3317
|
-
}
|
|
3318
|
-
|
|
3319
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
3320
|
-
//=> 'a'
|
|
3321
|
-
```
|
|
3322
|
-
|
|
3323
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
3324
|
-
|
|
3325
|
-
@example
|
|
3326
|
-
```
|
|
3327
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
3328
|
-
|
|
3329
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
3330
|
-
//=> 'a' | 'c'
|
|
3331
|
-
```
|
|
3332
|
-
|
|
3333
|
-
@category Object
|
|
3334
|
-
*/
|
|
3335
|
-
type ConditionalKeys$2<Base, Condition> = NonNullable<
|
|
3336
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
3337
|
-
{
|
|
3338
|
-
// Map through all the keys of the given base type.
|
|
3339
|
-
[Key in keyof Base]:
|
|
3340
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
3341
|
-
Base[Key] extends Condition
|
|
3342
|
-
// Retain this key since the condition passes.
|
|
3343
|
-
? Key
|
|
3344
|
-
// Discard this key since the condition fails.
|
|
3345
|
-
: never;
|
|
3346
|
-
|
|
3347
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
3348
|
-
}[keyof Base]
|
|
3349
|
-
>;
|
|
3350
|
-
|
|
3351
|
-
/**
|
|
3352
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
3353
|
-
|
|
3354
|
-
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.
|
|
3355
|
-
|
|
3356
|
-
@example
|
|
3357
|
-
```
|
|
3358
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
3359
|
-
|
|
3360
|
-
class Awesome {
|
|
3361
|
-
name: string;
|
|
3362
|
-
successes: number;
|
|
3363
|
-
failures: bigint;
|
|
3364
|
-
|
|
3365
|
-
run() {}
|
|
3366
|
-
}
|
|
3367
|
-
|
|
3368
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
3369
|
-
//=> {run: () => void}
|
|
3370
|
-
```
|
|
3371
|
-
|
|
3372
|
-
@example
|
|
3373
|
-
```
|
|
3374
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
3375
|
-
|
|
3376
|
-
interface Example {
|
|
3377
|
-
a: string;
|
|
3378
|
-
b: string | number;
|
|
3379
|
-
c: () => void;
|
|
3380
|
-
d: {};
|
|
3381
|
-
}
|
|
3382
|
-
|
|
3383
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
3384
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
3385
|
-
```
|
|
3386
|
-
|
|
3387
|
-
@category Object
|
|
3388
|
-
*/
|
|
3389
|
-
type ConditionalExcept$2<Base, Condition> = Except$2<
|
|
3390
|
-
Base,
|
|
3391
|
-
ConditionalKeys$2<Base, Condition>
|
|
3392
|
-
>;
|
|
3393
|
-
|
|
3394
|
-
/**
|
|
3395
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
3396
|
-
* can either be a REST module or a host module.
|
|
3397
|
-
* This type is recursive, so it can describe nested modules.
|
|
3398
|
-
*/
|
|
3399
|
-
type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$5<any> | ServicePluginDefinition$2<any> | {
|
|
3400
|
-
[key: string]: Descriptors$2 | PublicMetadata$2 | any;
|
|
3401
|
-
};
|
|
3402
|
-
/**
|
|
3403
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
3404
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
3405
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
3406
|
-
* do not match the given host (as they will not work with the given host).
|
|
3407
|
-
*/
|
|
3408
|
-
type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
|
|
3409
|
-
done: T;
|
|
3410
|
-
recurse: T extends {
|
|
3411
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
|
|
3412
|
-
} ? never : T extends AmbassadorFunctionDescriptor$2 ? BuildAmbassadorFunction$2<T> : T extends RESTFunctionDescriptor$2 ? BuildRESTFunction$2<T> : T extends EventDefinition$5<any> ? BuildEventDefinition$5<T> : T extends ServicePluginDefinition$2<any> ? BuildServicePluginDefinition$2<T> : T extends HostModule$2<any, any> ? HostModuleAPI$2<T> : ConditionalExcept$2<{
|
|
3413
|
-
[Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
|
|
3414
|
-
-1,
|
|
3415
|
-
0,
|
|
3416
|
-
1,
|
|
3417
|
-
2,
|
|
3418
|
-
3,
|
|
3419
|
-
4,
|
|
3420
|
-
5
|
|
3421
|
-
][Depth]> : never;
|
|
3422
|
-
}, EmptyObject$2>;
|
|
3423
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
3424
|
-
type PublicMetadata$2 = {
|
|
3425
|
-
PACKAGE_NAME?: string;
|
|
3426
|
-
};
|
|
3427
|
-
|
|
3428
|
-
declare global {
|
|
3429
|
-
interface ContextualClient {
|
|
3430
|
-
}
|
|
3431
|
-
}
|
|
3432
|
-
/**
|
|
3433
|
-
* A type used to create concerete types from SDK descriptors in
|
|
3434
|
-
* case a contextual client is available.
|
|
3435
|
-
*/
|
|
3436
|
-
type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
|
|
3437
|
-
host: Host$2;
|
|
3438
|
-
} ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
|
|
3439
|
-
|
|
3440
|
-
interface DraftPost$1 {
|
|
3441
|
-
/**
|
|
3442
|
-
* Draft post ID.
|
|
3443
|
-
* @readonly
|
|
3444
|
-
*/
|
|
3445
|
-
_id?: string;
|
|
3446
|
-
/** Draft post title. */
|
|
3447
|
-
title?: string;
|
|
3448
|
-
/**
|
|
3449
|
-
* Draft post excerpt.
|
|
3450
|
-
*
|
|
3451
|
-
* If no excerpt has been manually set, an excerpt is automatically generated from the post's text.
|
|
3452
|
-
* This can be retrieved using the `GENERATED_EXCERPT` fieldset.
|
|
3453
|
-
*/
|
|
3454
|
-
excerpt?: string | null;
|
|
3455
|
-
/** Whether the draft post is marked as featured. */
|
|
3456
|
-
featured?: boolean | null;
|
|
3457
|
-
/** Category IDs of the draft post. */
|
|
3458
|
-
categoryIds?: string[];
|
|
3459
|
-
/** Draft post owner's member ID. */
|
|
3460
|
-
memberId?: string | null;
|
|
3461
|
-
/** Hashtags in the draft post. */
|
|
3462
|
-
hashtags?: string[];
|
|
3463
|
-
/** Whether commenting on the draft post is enabled. */
|
|
3464
|
-
commentingEnabled?: boolean | null;
|
|
2343
|
+
interface CoverMedia$1 extends CoverMediaMediaOneOf$1 {
|
|
2344
|
+
/** Image url. */
|
|
2345
|
+
image?: string;
|
|
2346
|
+
/** Video url. */
|
|
2347
|
+
video?: string;
|
|
3465
2348
|
/**
|
|
3466
|
-
*
|
|
3467
|
-
*
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
/** Tag IDs the draft post is tagged with. */
|
|
3473
|
-
tagIds?: string[];
|
|
3474
|
-
/** IDs of posts related to this draft post. */
|
|
3475
|
-
relatedPostIds?: string[];
|
|
3476
|
-
/** Pricing plan IDs. Only relevant if a post is assigned to a specific pricing plan. */
|
|
3477
|
-
pricingPlanIds?: string[];
|
|
3478
|
-
/**
|
|
3479
|
-
* ID of the draft post's translations.
|
|
3480
|
-
*
|
|
3481
|
-
* All translations of a single post share the same `translationId`.
|
|
3482
|
-
* Available only if the [Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) app is installed.
|
|
3483
|
-
*/
|
|
3484
|
-
translationId?: string | null;
|
|
3485
|
-
/**
|
|
3486
|
-
* Language the draft post is written in.
|
|
3487
|
-
*
|
|
3488
|
-
* 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
3489
|
-
*/
|
|
3490
|
-
language?: string | null;
|
|
3491
|
-
/**
|
|
3492
|
-
* Reserved for internal use.
|
|
3493
|
-
* @readonly
|
|
3494
|
-
*/
|
|
3495
|
-
changeOrigin?: Origin$1;
|
|
3496
|
-
/**
|
|
3497
|
-
* Reserved for internal use.
|
|
3498
|
-
* @readonly
|
|
3499
|
-
*/
|
|
3500
|
-
contentId?: string | null;
|
|
3501
|
-
/** Reserved for internal use. */
|
|
3502
|
-
editingSessionId?: string | null;
|
|
3503
|
-
/** Draft post rich content. */
|
|
3504
|
-
richContent?: RichContent$1;
|
|
3505
|
-
/**
|
|
3506
|
-
* Status of the draft post.
|
|
3507
|
-
* @readonly
|
|
3508
|
-
*/
|
|
3509
|
-
status?: Status$1;
|
|
3510
|
-
/** Details of the draft post in review. Only relevant to posts submitted by guest writers. */
|
|
3511
|
-
moderationDetails?: ModerationDetails$1;
|
|
3512
|
-
/**
|
|
3513
|
-
* Reserved for internal use.
|
|
3514
|
-
* @readonly
|
|
3515
|
-
*/
|
|
3516
|
-
mostRecentContributorId?: string | null;
|
|
3517
|
-
/**
|
|
3518
|
-
* Indicates if there are changes made to the draft post that have not yet been published.
|
|
3519
|
-
* @readonly
|
|
3520
|
-
*/
|
|
3521
|
-
hasUnpublishedChanges?: boolean;
|
|
3522
|
-
/**
|
|
3523
|
-
* Date the draft post was last edited.
|
|
3524
|
-
* @readonly
|
|
3525
|
-
*/
|
|
3526
|
-
editedDate?: Date;
|
|
3527
|
-
/**
|
|
3528
|
-
* Date the draft post is scheduled to be published.
|
|
3529
|
-
* @readonly
|
|
3530
|
-
*/
|
|
3531
|
-
scheduledPublishDate?: Date;
|
|
3532
|
-
/** Reserved for internal use. */
|
|
3533
|
-
content?: Record<string, any> | null;
|
|
3534
|
-
/** Date the post was first published. */
|
|
3535
|
-
firstPublishedDate?: Date;
|
|
3536
|
-
/** SEO data. */
|
|
3537
|
-
seoData?: SeoSchema$2;
|
|
3538
|
-
/**
|
|
3539
|
-
* @internal Deprecated.
|
|
3540
|
-
* @internal Deprecated.
|
|
3541
|
-
* @deprecated
|
|
3542
|
-
* @replacedBy preview_text_paragraph
|
|
3543
|
-
* @targetRemovalDate 2024-06-30
|
|
3544
|
-
*/
|
|
3545
|
-
paidContentParagraph?: number | null;
|
|
3546
|
-
/**
|
|
3547
|
-
* Reserved for internal use.
|
|
3548
|
-
* @readonly
|
|
3549
|
-
*/
|
|
3550
|
-
slugs?: string[];
|
|
3551
|
-
/**
|
|
3552
|
-
* Draft post URL preview. What the URL will look like once the post is published.
|
|
3553
|
-
* @readonly
|
|
3554
|
-
*/
|
|
3555
|
-
url?: string;
|
|
3556
|
-
/**
|
|
3557
|
-
* Date the draft post was first created.
|
|
3558
|
-
* @readonly
|
|
3559
|
-
*/
|
|
3560
|
-
_createdDate?: Date;
|
|
3561
|
-
/** SEO slug. */
|
|
3562
|
-
seoSlug?: string | null;
|
|
3563
|
-
/** Post cover media. */
|
|
3564
|
-
media?: Media$1;
|
|
3565
|
-
/** Number of paragraphs to display in a paid content preview for non-paying users. */
|
|
3566
|
-
previewTextParagraph?: number | null;
|
|
3567
|
-
/**
|
|
3568
|
-
* Reserved for internal use.
|
|
3569
|
-
* @readonly
|
|
3570
|
-
*/
|
|
3571
|
-
internalId?: string | null;
|
|
3572
|
-
}
|
|
3573
|
-
interface CoverMedia$1 extends CoverMediaMediaOneOf$1 {
|
|
3574
|
-
/** Image url. */
|
|
3575
|
-
image?: string;
|
|
3576
|
-
/** Video url. */
|
|
3577
|
-
video?: string;
|
|
3578
|
-
/**
|
|
3579
|
-
* Is cover media enabled.
|
|
3580
|
-
* Selected by user whether to display cover media on the feed
|
|
3581
|
-
* @deprecated Is cover media enabled.
|
|
3582
|
-
* Selected by user whether to display cover media on the feed
|
|
3583
|
-
* @replacedBy displayed
|
|
3584
|
-
* @targetRemovalDate 2024-06-30
|
|
2349
|
+
* Is cover media enabled.
|
|
2350
|
+
* Selected by user whether to display cover media on the feed
|
|
2351
|
+
* @deprecated Is cover media enabled.
|
|
2352
|
+
* Selected by user whether to display cover media on the feed
|
|
2353
|
+
* @replacedBy displayed
|
|
2354
|
+
* @targetRemovalDate 2024-06-30
|
|
3585
2355
|
*/
|
|
3586
2356
|
enabled?: boolean;
|
|
3587
2357
|
/** Whether cover media is displayed. */
|
|
@@ -6754,7 +5524,7 @@ interface DraftPostsQueryBuilder {
|
|
|
6754
5524
|
find: () => Promise<DraftPostsQueryResult>;
|
|
6755
5525
|
}
|
|
6756
5526
|
|
|
6757
|
-
declare function createDraftPost$1(httpClient: HttpClient
|
|
5527
|
+
declare function createDraftPost$1(httpClient: HttpClient): CreateDraftPostSignature;
|
|
6758
5528
|
interface CreateDraftPostSignature {
|
|
6759
5529
|
/**
|
|
6760
5530
|
* Creates a draft post.
|
|
@@ -6765,7 +5535,7 @@ interface CreateDraftPostSignature {
|
|
|
6765
5535
|
*/
|
|
6766
5536
|
(draftPost: DraftPost$1, options?: CreateDraftPostOptions | undefined): Promise<CreateDraftPostResponse & CreateDraftPostResponseNonNullableFields>;
|
|
6767
5537
|
}
|
|
6768
|
-
declare function bulkCreateDraftPosts$1(httpClient: HttpClient
|
|
5538
|
+
declare function bulkCreateDraftPosts$1(httpClient: HttpClient): BulkCreateDraftPostsSignature;
|
|
6769
5539
|
interface BulkCreateDraftPostsSignature {
|
|
6770
5540
|
/**
|
|
6771
5541
|
* Creates multiple draft posts.
|
|
@@ -6774,7 +5544,7 @@ interface BulkCreateDraftPostsSignature {
|
|
|
6774
5544
|
*/
|
|
6775
5545
|
(draftPosts: DraftPost$1[], options?: BulkCreateDraftPostsOptions | undefined): Promise<BulkCreateDraftPostsResponse & BulkCreateDraftPostsResponseNonNullableFields>;
|
|
6776
5546
|
}
|
|
6777
|
-
declare function bulkUpdateDraftPosts$1(httpClient: HttpClient
|
|
5547
|
+
declare function bulkUpdateDraftPosts$1(httpClient: HttpClient): BulkUpdateDraftPostsSignature;
|
|
6778
5548
|
interface BulkUpdateDraftPostsSignature {
|
|
6779
5549
|
/**
|
|
6780
5550
|
* Updates multiple draft posts.
|
|
@@ -6782,7 +5552,7 @@ interface BulkUpdateDraftPostsSignature {
|
|
|
6782
5552
|
*/
|
|
6783
5553
|
(options?: BulkUpdateDraftPostsOptions | undefined): Promise<BulkUpdateDraftPostsResponse & BulkUpdateDraftPostsResponseNonNullableFields>;
|
|
6784
5554
|
}
|
|
6785
|
-
declare function listDeletedDraftPosts$1(httpClient: HttpClient
|
|
5555
|
+
declare function listDeletedDraftPosts$1(httpClient: HttpClient): ListDeletedDraftPostsSignature;
|
|
6786
5556
|
interface ListDeletedDraftPostsSignature {
|
|
6787
5557
|
/**
|
|
6788
5558
|
* Retrieves a list of up to 100 deleted draft posts.
|
|
@@ -6795,7 +5565,7 @@ interface ListDeletedDraftPostsSignature {
|
|
|
6795
5565
|
*/
|
|
6796
5566
|
(options?: ListDeletedDraftPostsOptions | undefined): Promise<ListDeletedDraftPostsResponse & ListDeletedDraftPostsResponseNonNullableFields>;
|
|
6797
5567
|
}
|
|
6798
|
-
declare function getDraftPost$1(httpClient: HttpClient
|
|
5568
|
+
declare function getDraftPost$1(httpClient: HttpClient): GetDraftPostSignature;
|
|
6799
5569
|
interface GetDraftPostSignature {
|
|
6800
5570
|
/**
|
|
6801
5571
|
* Gets a draft post by the provided ID.
|
|
@@ -6806,7 +5576,7 @@ interface GetDraftPostSignature {
|
|
|
6806
5576
|
*/
|
|
6807
5577
|
(draftPostId: string, options?: GetDraftPostOptions | undefined): Promise<GetDraftPostResponse & GetDraftPostResponseNonNullableFields>;
|
|
6808
5578
|
}
|
|
6809
|
-
declare function updateDraftPost$1(httpClient: HttpClient
|
|
5579
|
+
declare function updateDraftPost$1(httpClient: HttpClient): UpdateDraftPostSignature;
|
|
6810
5580
|
interface UpdateDraftPostSignature {
|
|
6811
5581
|
/**
|
|
6812
5582
|
* Updates a draft post.
|
|
@@ -6816,7 +5586,7 @@ interface UpdateDraftPostSignature {
|
|
|
6816
5586
|
*/
|
|
6817
5587
|
(_id: string, draftPost: UpdateDraftPost, options?: UpdateDraftPostOptions | undefined): Promise<UpdateDraftPostResponse & UpdateDraftPostResponseNonNullableFields>;
|
|
6818
5588
|
}
|
|
6819
|
-
declare function deleteDraftPost$1(httpClient: HttpClient
|
|
5589
|
+
declare function deleteDraftPost$1(httpClient: HttpClient): DeleteDraftPostSignature;
|
|
6820
5590
|
interface DeleteDraftPostSignature {
|
|
6821
5591
|
/**
|
|
6822
5592
|
* Moves a draft post with the provided ID to the trash bin.
|
|
@@ -6828,7 +5598,7 @@ interface DeleteDraftPostSignature {
|
|
|
6828
5598
|
*/
|
|
6829
5599
|
(draftPostId: string, options?: DeleteDraftPostOptions | undefined): Promise<void>;
|
|
6830
5600
|
}
|
|
6831
|
-
declare function removeFromTrashBin$1(httpClient: HttpClient
|
|
5601
|
+
declare function removeFromTrashBin$1(httpClient: HttpClient): RemoveFromTrashBinSignature;
|
|
6832
5602
|
interface RemoveFromTrashBinSignature {
|
|
6833
5603
|
/**
|
|
6834
5604
|
* Permanently deletes a draft post by the provided ID from the trash bin.
|
|
@@ -6838,7 +5608,7 @@ interface RemoveFromTrashBinSignature {
|
|
|
6838
5608
|
*/
|
|
6839
5609
|
(draftPostId: string): Promise<void>;
|
|
6840
5610
|
}
|
|
6841
|
-
declare function bulkDeleteDraftPosts$1(httpClient: HttpClient
|
|
5611
|
+
declare function bulkDeleteDraftPosts$1(httpClient: HttpClient): BulkDeleteDraftPostsSignature;
|
|
6842
5612
|
interface BulkDeleteDraftPostsSignature {
|
|
6843
5613
|
/**
|
|
6844
5614
|
* Deletes multiple draft posts.
|
|
@@ -6847,7 +5617,7 @@ interface BulkDeleteDraftPostsSignature {
|
|
|
6847
5617
|
*/
|
|
6848
5618
|
(postIds: string[], options?: BulkDeleteDraftPostsOptions | undefined): Promise<BulkDeleteDraftPostsResponse & BulkDeleteDraftPostsResponseNonNullableFields>;
|
|
6849
5619
|
}
|
|
6850
|
-
declare function listDraftPosts$1(httpClient: HttpClient
|
|
5620
|
+
declare function listDraftPosts$1(httpClient: HttpClient): ListDraftPostsSignature;
|
|
6851
5621
|
interface ListDraftPostsSignature {
|
|
6852
5622
|
/**
|
|
6853
5623
|
* Retrieves a list of up to 100 draft posts per request.
|
|
@@ -6860,7 +5630,7 @@ interface ListDraftPostsSignature {
|
|
|
6860
5630
|
*/
|
|
6861
5631
|
(options?: ListDraftPostsOptions | undefined): Promise<ListDraftPostsResponse & ListDraftPostsResponseNonNullableFields>;
|
|
6862
5632
|
}
|
|
6863
|
-
declare function getDeletedDraftPost$1(httpClient: HttpClient
|
|
5633
|
+
declare function getDeletedDraftPost$1(httpClient: HttpClient): GetDeletedDraftPostSignature;
|
|
6864
5634
|
interface GetDeletedDraftPostSignature {
|
|
6865
5635
|
/**
|
|
6866
5636
|
* Gets a deleted draft post from the trash bin by the provided ID.
|
|
@@ -6870,7 +5640,7 @@ interface GetDeletedDraftPostSignature {
|
|
|
6870
5640
|
*/
|
|
6871
5641
|
(draftPostId: string): Promise<GetDeletedDraftPostResponse & GetDeletedDraftPostResponseNonNullableFields>;
|
|
6872
5642
|
}
|
|
6873
|
-
declare function restoreFromTrashBin$1(httpClient: HttpClient
|
|
5643
|
+
declare function restoreFromTrashBin$1(httpClient: HttpClient): RestoreFromTrashBinSignature;
|
|
6874
5644
|
interface RestoreFromTrashBinSignature {
|
|
6875
5645
|
/**
|
|
6876
5646
|
* Restores a deleted draft post from the trash bin by the provided ID.
|
|
@@ -6880,7 +5650,7 @@ interface RestoreFromTrashBinSignature {
|
|
|
6880
5650
|
*/
|
|
6881
5651
|
(draftPostId: string): Promise<RestoreFromTrashBinResponse & RestoreFromTrashBinResponseNonNullableFields>;
|
|
6882
5652
|
}
|
|
6883
|
-
declare function queryDraftPosts$1(httpClient: HttpClient
|
|
5653
|
+
declare function queryDraftPosts$1(httpClient: HttpClient): QueryDraftPostsSignature;
|
|
6884
5654
|
interface QueryDraftPostsSignature {
|
|
6885
5655
|
/**
|
|
6886
5656
|
* Retrieves a list of up to 100 draft posts, given the provided paging, filtering, and sorting.
|
|
@@ -6893,7 +5663,7 @@ interface QueryDraftPostsSignature {
|
|
|
6893
5663
|
*/
|
|
6894
5664
|
(options?: QueryDraftPostsOptions | undefined): DraftPostsQueryBuilder;
|
|
6895
5665
|
}
|
|
6896
|
-
declare function publishDraftPost$1(httpClient: HttpClient
|
|
5666
|
+
declare function publishDraftPost$1(httpClient: HttpClient): PublishDraftPostSignature;
|
|
6897
5667
|
interface PublishDraftPostSignature {
|
|
6898
5668
|
/**
|
|
6899
5669
|
* Publishes a specified draft post by ID. This creates a new post entity with the data from the draft post.
|
|
@@ -6903,20 +5673,20 @@ interface PublishDraftPostSignature {
|
|
|
6903
5673
|
*/
|
|
6904
5674
|
(draftPostId: string): Promise<PublishDraftPostResponse & PublishDraftPostResponseNonNullableFields>;
|
|
6905
5675
|
}
|
|
6906
|
-
declare const onDraftCreated$1: EventDefinition$
|
|
6907
|
-
declare const onDraftUpdated$1: EventDefinition$
|
|
6908
|
-
declare const onDraftDeleted$1: EventDefinition$
|
|
5676
|
+
declare const onDraftCreated$1: EventDefinition$4<DraftCreatedEnvelope, "wix.blog.v3.draft_created">;
|
|
5677
|
+
declare const onDraftUpdated$1: EventDefinition$4<DraftUpdatedEnvelope, "wix.blog.v3.draft_updated">;
|
|
5678
|
+
declare const onDraftDeleted$1: EventDefinition$4<DraftDeletedEnvelope, "wix.blog.v3.draft_deleted">;
|
|
6909
5679
|
|
|
6910
|
-
type EventDefinition$
|
|
5680
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
6911
5681
|
__type: 'event-definition';
|
|
6912
5682
|
type: Type;
|
|
6913
5683
|
isDomainEvent?: boolean;
|
|
6914
5684
|
transformations?: (envelope: unknown) => Payload;
|
|
6915
5685
|
__payload: Payload;
|
|
6916
5686
|
};
|
|
6917
|
-
declare function EventDefinition$
|
|
6918
|
-
type EventHandler$
|
|
6919
|
-
type BuildEventDefinition$
|
|
5687
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
5688
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
5689
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
6920
5690
|
|
|
6921
5691
|
declare global {
|
|
6922
5692
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -6925,22 +5695,22 @@ declare global {
|
|
|
6925
5695
|
}
|
|
6926
5696
|
}
|
|
6927
5697
|
|
|
6928
|
-
declare function createEventModule$2<T extends EventDefinition$
|
|
5698
|
+
declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
|
6929
5699
|
|
|
6930
|
-
declare const createDraftPost: MaybeContext
|
|
6931
|
-
declare const bulkCreateDraftPosts: MaybeContext
|
|
6932
|
-
declare const bulkUpdateDraftPosts: MaybeContext
|
|
6933
|
-
declare const listDeletedDraftPosts: MaybeContext
|
|
6934
|
-
declare const getDraftPost: MaybeContext
|
|
6935
|
-
declare const updateDraftPost: MaybeContext
|
|
6936
|
-
declare const deleteDraftPost: MaybeContext
|
|
6937
|
-
declare const removeFromTrashBin: MaybeContext
|
|
6938
|
-
declare const bulkDeleteDraftPosts: MaybeContext
|
|
6939
|
-
declare const listDraftPosts: MaybeContext
|
|
6940
|
-
declare const getDeletedDraftPost: MaybeContext
|
|
6941
|
-
declare const restoreFromTrashBin: MaybeContext
|
|
6942
|
-
declare const queryDraftPosts: MaybeContext
|
|
6943
|
-
declare const publishDraftPost: MaybeContext
|
|
5700
|
+
declare const createDraftPost: MaybeContext<BuildRESTFunction<typeof createDraftPost$1> & typeof createDraftPost$1>;
|
|
5701
|
+
declare const bulkCreateDraftPosts: MaybeContext<BuildRESTFunction<typeof bulkCreateDraftPosts$1> & typeof bulkCreateDraftPosts$1>;
|
|
5702
|
+
declare const bulkUpdateDraftPosts: MaybeContext<BuildRESTFunction<typeof bulkUpdateDraftPosts$1> & typeof bulkUpdateDraftPosts$1>;
|
|
5703
|
+
declare const listDeletedDraftPosts: MaybeContext<BuildRESTFunction<typeof listDeletedDraftPosts$1> & typeof listDeletedDraftPosts$1>;
|
|
5704
|
+
declare const getDraftPost: MaybeContext<BuildRESTFunction<typeof getDraftPost$1> & typeof getDraftPost$1>;
|
|
5705
|
+
declare const updateDraftPost: MaybeContext<BuildRESTFunction<typeof updateDraftPost$1> & typeof updateDraftPost$1>;
|
|
5706
|
+
declare const deleteDraftPost: MaybeContext<BuildRESTFunction<typeof deleteDraftPost$1> & typeof deleteDraftPost$1>;
|
|
5707
|
+
declare const removeFromTrashBin: MaybeContext<BuildRESTFunction<typeof removeFromTrashBin$1> & typeof removeFromTrashBin$1>;
|
|
5708
|
+
declare const bulkDeleteDraftPosts: MaybeContext<BuildRESTFunction<typeof bulkDeleteDraftPosts$1> & typeof bulkDeleteDraftPosts$1>;
|
|
5709
|
+
declare const listDraftPosts: MaybeContext<BuildRESTFunction<typeof listDraftPosts$1> & typeof listDraftPosts$1>;
|
|
5710
|
+
declare const getDeletedDraftPost: MaybeContext<BuildRESTFunction<typeof getDeletedDraftPost$1> & typeof getDeletedDraftPost$1>;
|
|
5711
|
+
declare const restoreFromTrashBin: MaybeContext<BuildRESTFunction<typeof restoreFromTrashBin$1> & typeof restoreFromTrashBin$1>;
|
|
5712
|
+
declare const queryDraftPosts: MaybeContext<BuildRESTFunction<typeof queryDraftPosts$1> & typeof queryDraftPosts$1>;
|
|
5713
|
+
declare const publishDraftPost: MaybeContext<BuildRESTFunction<typeof publishDraftPost$1> & typeof publishDraftPost$1>;
|
|
6944
5714
|
|
|
6945
5715
|
type _publicOnDraftCreatedType = typeof onDraftCreated$1;
|
|
6946
5716
|
/**
|
|
@@ -7085,451 +5855,41 @@ declare namespace index_d$2 {
|
|
|
7085
5855
|
export { index_d$2_Action as Action, type ActionEvent$2 as ActionEvent, Alignment$1 as Alignment, type AnchorData$1 as AnchorData, type AppEmbedData$1 as AppEmbedData, type AppEmbedDataAppDataOneOf$1 as AppEmbedDataAppDataOneOf, AppType$1 as AppType, type ApplicationError$1 as ApplicationError, type index_d$2_ApproveDraftPostRequest as ApproveDraftPostRequest, type index_d$2_ApproveDraftPostResponse as ApproveDraftPostResponse, type AudioData$1 as AudioData, type Background$1 as Background, type BackgroundBackgroundOneOf$1 as BackgroundBackgroundOneOf, BackgroundType$1 as BackgroundType, type BaseEventMetadata$2 as BaseEventMetadata, type BlockquoteData$1 as BlockquoteData, type BlogPaging$1 as BlogPaging, type BookingData$1 as BookingData, type Border$1 as Border, type BorderColors$1 as BorderColors, type BulkActionMetadata$1 as BulkActionMetadata, type index_d$2_BulkCreateDraftPostsOptions as BulkCreateDraftPostsOptions, type index_d$2_BulkCreateDraftPostsRequest as BulkCreateDraftPostsRequest, type index_d$2_BulkCreateDraftPostsResponse as BulkCreateDraftPostsResponse, type index_d$2_BulkCreateDraftPostsResponseNonNullableFields as BulkCreateDraftPostsResponseNonNullableFields, type index_d$2_BulkDeleteDraftPostsOptions as BulkDeleteDraftPostsOptions, type index_d$2_BulkDeleteDraftPostsRequest as BulkDeleteDraftPostsRequest, type index_d$2_BulkDeleteDraftPostsResponse as BulkDeleteDraftPostsResponse, type index_d$2_BulkDeleteDraftPostsResponseNonNullableFields as BulkDeleteDraftPostsResponseNonNullableFields, type index_d$2_BulkDraftPostResult as BulkDraftPostResult, type index_d$2_BulkRejectDraftPostRequest as BulkRejectDraftPostRequest, type index_d$2_BulkRejectDraftPostResponse as BulkRejectDraftPostResponse, type index_d$2_BulkRevertToUnpublishedRequest as BulkRevertToUnpublishedRequest, type index_d$2_BulkRevertToUnpublishedResponse as BulkRevertToUnpublishedResponse, type index_d$2_BulkUpdateDraftPostLanguageRequest as BulkUpdateDraftPostLanguageRequest, type index_d$2_BulkUpdateDraftPostLanguageResponse as BulkUpdateDraftPostLanguageResponse, type index_d$2_BulkUpdateDraftPostsOptions as BulkUpdateDraftPostsOptions, type index_d$2_BulkUpdateDraftPostsRequest as BulkUpdateDraftPostsRequest, type index_d$2_BulkUpdateDraftPostsResponse as BulkUpdateDraftPostsResponse, type index_d$2_BulkUpdateDraftPostsResponseNonNullableFields as BulkUpdateDraftPostsResponseNonNullableFields, type BulletedListData$1 as BulletedListData, type ButtonData$1 as ButtonData, index_d$2_ButtonDataType as ButtonDataType, type Category$1 as Category, type CategoryTranslation$1 as CategoryTranslation, type CellStyle$1 as CellStyle, type CodeBlockData$1 as CodeBlockData, type CollapsibleListData$1 as CollapsibleListData, type ColorData$1 as ColorData, type Colors$1 as Colors, type CoverMedia$1 as CoverMedia, type CoverMediaMediaOneOf$1 as CoverMediaMediaOneOf, type index_d$2_CreateDraftPostOptions as CreateDraftPostOptions, type index_d$2_CreateDraftPostRequest as CreateDraftPostRequest, type index_d$2_CreateDraftPostResponse as CreateDraftPostResponse, type index_d$2_CreateDraftPostResponseNonNullableFields as CreateDraftPostResponseNonNullableFields, Crop$1 as Crop, type CursorPaging$2 as CursorPaging, type Cursors$2 as Cursors, type Decoration$1 as Decoration, type DecorationDataOneOf$1 as DecorationDataOneOf, DecorationType$1 as DecorationType, type index_d$2_DeleteDraftPostOptions as DeleteDraftPostOptions, type index_d$2_DeleteDraftPostRequest as DeleteDraftPostRequest, type index_d$2_DeleteDraftPostResponse as DeleteDraftPostResponse, type Design$1 as Design, type Dimensions$1 as Dimensions, Direction$1 as Direction, type DividerData$1 as DividerData, type DocumentStyle$1 as DocumentStyle, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type index_d$2_DraftCreatedEnvelope as DraftCreatedEnvelope, type index_d$2_DraftDeletedEnvelope as DraftDeletedEnvelope, type DraftPost$1 as DraftPost, type index_d$2_DraftPostOwnerChanged as DraftPostOwnerChanged, type DraftPostTranslation$1 as DraftPostTranslation, type index_d$2_DraftPostsQueryBuilder as DraftPostsQueryBuilder, type index_d$2_DraftPostsQueryResult as DraftPostsQueryResult, type index_d$2_DraftUpdatedEnvelope as DraftUpdatedEnvelope, type EmbedData$1 as EmbedData, type EmbedMedia$1 as EmbedMedia, type EmbedThumbnail$1 as EmbedThumbnail, type EmbedVideo$1 as EmbedVideo, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventData$1 as EventData, type EventMetadata$2 as EventMetadata, Field$2 as Field, type FileData$1 as FileData, type FileSource$1 as FileSource, type FileSourceDataOneOf$1 as FileSourceDataOneOf, type FontSizeData$1 as FontSizeData, FontType$1 as FontType, type GIF$1 as GIF, type GIFData$1 as GIFData, type GalleryData$1 as GalleryData, type GalleryOptions$1 as GalleryOptions, type index_d$2_GetDeletedDraftPostRequest as GetDeletedDraftPostRequest, type index_d$2_GetDeletedDraftPostResponse as GetDeletedDraftPostResponse, type index_d$2_GetDeletedDraftPostResponseNonNullableFields as GetDeletedDraftPostResponseNonNullableFields, type index_d$2_GetDraftPostOptions as GetDraftPostOptions, type index_d$2_GetDraftPostRequest as GetDraftPostRequest, type index_d$2_GetDraftPostResponse as GetDraftPostResponse, type index_d$2_GetDraftPostResponseNonNullableFields as GetDraftPostResponseNonNullableFields, type index_d$2_GetDraftPostTotalsRequest as GetDraftPostTotalsRequest, type index_d$2_GetDraftPostTotalsResponse as GetDraftPostTotalsResponse, index_d$2_GetDraftPostsSort as GetDraftPostsSort, type index_d$2_GetPostAmountsByLanguageRequest as GetPostAmountsByLanguageRequest, type index_d$2_GetPostAmountsByLanguageResponse as GetPostAmountsByLanguageResponse, type Gradient$1 as Gradient, type HTMLData$1 as HTMLData, type HTMLDataDataOneOf$1 as HTMLDataDataOneOf, type HeadingData$1 as HeadingData, type Height$1 as Height, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type Image$1 as Image, type ImageData$1 as ImageData, type index_d$2_InitialDraftPostsCopied as InitialDraftPostsCopied, InitialExpandedItems$1 as InitialExpandedItems, type index_d$2_IsDraftPostAutoTranslatableRequest as IsDraftPostAutoTranslatableRequest, type index_d$2_IsDraftPostAutoTranslatableResponse as IsDraftPostAutoTranslatableResponse, type Item$1 as Item, type ItemDataOneOf$1 as ItemDataOneOf, type ItemMetadata$1 as ItemMetadata, type ItemStyle$1 as ItemStyle, type Keyword$2 as Keyword, type Layout$1 as Layout, LayoutType$1 as LayoutType, LineStyle$1 as LineStyle, type Link$1 as Link, type LinkData$1 as LinkData, type LinkDataOneOf$1 as LinkDataOneOf, type LinkPreviewData$1 as LinkPreviewData, type index_d$2_ListDeletedDraftPostsOptions as ListDeletedDraftPostsOptions, type index_d$2_ListDeletedDraftPostsRequest as ListDeletedDraftPostsRequest, type index_d$2_ListDeletedDraftPostsResponse as ListDeletedDraftPostsResponse, type index_d$2_ListDeletedDraftPostsResponseNonNullableFields as ListDeletedDraftPostsResponseNonNullableFields, type index_d$2_ListDraftPostsOptions as ListDraftPostsOptions, type index_d$2_ListDraftPostsRequest as ListDraftPostsRequest, type index_d$2_ListDraftPostsResponse as ListDraftPostsResponse, type index_d$2_ListDraftPostsResponseNonNullableFields as ListDraftPostsResponseNonNullableFields, type ListValue$1 as ListValue, type MapData$1 as MapData, type MapSettings$1 as MapSettings, MapType$1 as MapType, type index_d$2_MarkPostAsInModerationRequest as MarkPostAsInModerationRequest, type index_d$2_MarkPostAsInModerationResponse as MarkPostAsInModerationResponse, type index_d$2_MaskedDraftPosts as MaskedDraftPosts, type Media$1 as Media, type MediaMediaOneOf$1 as MediaMediaOneOf, type MentionData$1 as MentionData, type MessageEnvelope$2 as MessageEnvelope, type MetaData$2 as MetaData, type Metadata$1 as Metadata, type ModerationDetails$1 as ModerationDetails, ModerationStatusStatus$1 as ModerationStatusStatus, type Node$1 as Node, type NodeDataOneOf$1 as NodeDataOneOf, type NodeStyle$1 as NodeStyle, NodeType$1 as NodeType, NullValue$1 as NullValue, type Oembed$1 as Oembed, type Option$1 as Option, type OptionDesign$1 as OptionDesign, type OptionLayout$1 as OptionLayout, type OrderedListData$1 as OrderedListData, Orientation$1 as Orientation, Origin$1 as Origin, type PDFSettings$1 as PDFSettings, type Paging$2 as Paging, type PagingMetadataV2$2 as PagingMetadataV2, type ParagraphData$1 as ParagraphData, type Permissions$1 as Permissions, type PlatformQuery$2 as PlatformQuery, type PlatformQueryPagingMethodOneOf$2 as PlatformQueryPagingMethodOneOf, type PlaybackOptions$1 as PlaybackOptions, type PluginContainerData$1 as PluginContainerData, PluginContainerDataAlignment$1 as PluginContainerDataAlignment, type PluginContainerDataWidth$1 as PluginContainerDataWidth, type PluginContainerDataWidthDataOneOf$1 as PluginContainerDataWidthDataOneOf, type Poll$1 as Poll, type PollData$1 as PollData, type PollDataLayout$1 as PollDataLayout, type PollDesign$1 as PollDesign, type PollLayout$1 as PollLayout, PollLayoutDirection$1 as PollLayoutDirection, PollLayoutType$1 as PollLayoutType, type PollSettings$1 as PollSettings, type index_d$2_PostAmountByLanguage as PostAmountByLanguage, type index_d$2_PublishDraftPostRequest as PublishDraftPostRequest, type index_d$2_PublishDraftPostResponse as PublishDraftPostResponse, type index_d$2_PublishDraftPostResponseNonNullableFields as PublishDraftPostResponseNonNullableFields, type index_d$2_QueryDraftPostsOptions as QueryDraftPostsOptions, type index_d$2_QueryDraftPostsRequest as QueryDraftPostsRequest, type index_d$2_QueryDraftPostsResponse as QueryDraftPostsResponse, type index_d$2_QueryDraftPostsResponseNonNullableFields as QueryDraftPostsResponseNonNullableFields, type index_d$2_RejectDraftPostRequest as RejectDraftPostRequest, type index_d$2_RejectDraftPostResponse as RejectDraftPostResponse, type Rel$1 as Rel, type index_d$2_RemoveFromTrashBinRequest as RemoveFromTrashBinRequest, type index_d$2_RemoveFromTrashBinResponse as RemoveFromTrashBinResponse, type index_d$2_RestoreFromTrashBinRequest as RestoreFromTrashBinRequest, type index_d$2_RestoreFromTrashBinResponse as RestoreFromTrashBinResponse, type index_d$2_RestoreFromTrashBinResponseNonNullableFields as RestoreFromTrashBinResponseNonNullableFields, type RestoreInfo$2 as RestoreInfo, type index_d$2_RevertToUnpublishedRequest as RevertToUnpublishedRequest, type index_d$2_RevertToUnpublishedResponse as RevertToUnpublishedResponse, type RichContent$1 as RichContent, type SeoSchema$2 as SeoSchema, type Settings$2 as Settings, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Source$1 as Source, type Spoiler$1 as Spoiler, type SpoilerData$1 as SpoilerData, Status$1 as Status, type Styles$1 as Styles, type TableCellData$1 as TableCellData, type TableData$1 as TableData, type Tag$2 as Tag, Target$1 as Target, TextAlignment$1 as TextAlignment, type TextData$1 as TextData, type TextNodeStyle$1 as TextNodeStyle, type TextStyle$1 as TextStyle, type Thumbnails$1 as Thumbnails, ThumbnailsAlignment$1 as ThumbnailsAlignment, type index_d$2_TotalDraftPosts as TotalDraftPosts, index_d$2_TotalDraftPostsGroupingField as TotalDraftPostsGroupingField, type index_d$2_TranslateCategoryRequest as TranslateCategoryRequest, type index_d$2_TranslateCategoryResponse as TranslateCategoryResponse, type index_d$2_TranslateDraftRequest as TranslateDraftRequest, type index_d$2_TranslateDraftResponse as TranslateDraftResponse, Type$1 as Type, type index_d$2_UnpublishPostRequest as UnpublishPostRequest, type index_d$2_UnpublishPostResponse as UnpublishPostResponse, type index_d$2_UpdateDraftPost as UpdateDraftPost, type index_d$2_UpdateDraftPostContentRequest as UpdateDraftPostContentRequest, type index_d$2_UpdateDraftPostContentRequestDraftContentOneOf as UpdateDraftPostContentRequestDraftContentOneOf, type index_d$2_UpdateDraftPostContentResponse as UpdateDraftPostContentResponse, type index_d$2_UpdateDraftPostLanguageRequest as UpdateDraftPostLanguageRequest, type index_d$2_UpdateDraftPostLanguageResponse as UpdateDraftPostLanguageResponse, type index_d$2_UpdateDraftPostOptions as UpdateDraftPostOptions, type index_d$2_UpdateDraftPostRequest as UpdateDraftPostRequest, type index_d$2_UpdateDraftPostResponse as UpdateDraftPostResponse, type index_d$2_UpdateDraftPostResponseNonNullableFields as UpdateDraftPostResponseNonNullableFields, type V1Media$1 as V1Media, VerticalAlignment$1 as VerticalAlignment, type Video$1 as Video, type VideoData$1 as VideoData, type VideoResolution$1 as VideoResolution, ViewMode$1 as ViewMode, ViewRole$1 as ViewRole, VoteRole$1 as VoteRole, WebhookIdentityType$2 as WebhookIdentityType, Width$1 as Width, WidthType$1 as WidthType, type WixMedia$1 as WixMedia, type index_d$2__publicOnDraftCreatedType as _publicOnDraftCreatedType, type index_d$2__publicOnDraftDeletedType as _publicOnDraftDeletedType, type index_d$2__publicOnDraftUpdatedType as _publicOnDraftUpdatedType, index_d$2_bulkCreateDraftPosts as bulkCreateDraftPosts, index_d$2_bulkDeleteDraftPosts as bulkDeleteDraftPosts, index_d$2_bulkUpdateDraftPosts as bulkUpdateDraftPosts, index_d$2_createDraftPost as createDraftPost, index_d$2_deleteDraftPost as deleteDraftPost, index_d$2_getDeletedDraftPost as getDeletedDraftPost, index_d$2_getDraftPost as getDraftPost, index_d$2_listDeletedDraftPosts as listDeletedDraftPosts, index_d$2_listDraftPosts as listDraftPosts, index_d$2_onDraftCreated as onDraftCreated, index_d$2_onDraftDeleted as onDraftDeleted, index_d$2_onDraftUpdated as onDraftUpdated, onDraftCreated$1 as publicOnDraftCreated, onDraftDeleted$1 as publicOnDraftDeleted, onDraftUpdated$1 as publicOnDraftUpdated, index_d$2_publishDraftPost as publishDraftPost, index_d$2_queryDraftPosts as queryDraftPosts, index_d$2_removeFromTrashBin as removeFromTrashBin, index_d$2_restoreFromTrashBin as restoreFromTrashBin, index_d$2_updateDraftPost as updateDraftPost };
|
|
7086
5856
|
}
|
|
7087
5857
|
|
|
7088
|
-
|
|
7089
|
-
__type: 'host';
|
|
7090
|
-
create(host: H): T;
|
|
7091
|
-
};
|
|
7092
|
-
type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
|
|
7093
|
-
type Host$1<Environment = unknown> = {
|
|
7094
|
-
channel: {
|
|
7095
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
7096
|
-
disconnect: () => void;
|
|
7097
|
-
} | Promise<{
|
|
7098
|
-
disconnect: () => void;
|
|
7099
|
-
}>;
|
|
7100
|
-
};
|
|
7101
|
-
environment?: Environment;
|
|
5858
|
+
interface Post {
|
|
7102
5859
|
/**
|
|
7103
|
-
*
|
|
5860
|
+
* Post ID.
|
|
5861
|
+
* @readonly
|
|
7104
5862
|
*/
|
|
7105
|
-
|
|
5863
|
+
_id?: string;
|
|
5864
|
+
/** Post title. */
|
|
5865
|
+
title?: string;
|
|
7106
5866
|
/**
|
|
7107
|
-
*
|
|
7108
|
-
*
|
|
5867
|
+
* Post excerpt.
|
|
5868
|
+
* Can be selected by a site contributor. By default, it is extracted from the content text's first characters.
|
|
5869
|
+
*
|
|
5870
|
+
* Max: 500 characters
|
|
7109
5871
|
*/
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
};
|
|
7125
|
-
|
|
7126
|
-
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
7127
|
-
interface HttpClient$1 {
|
|
7128
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
7129
|
-
fetchWithAuth: typeof fetch;
|
|
7130
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
7131
|
-
getActiveToken?: () => string | undefined;
|
|
7132
|
-
}
|
|
7133
|
-
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
7134
|
-
type HttpResponse$1<T = any> = {
|
|
7135
|
-
data: T;
|
|
7136
|
-
status: number;
|
|
7137
|
-
statusText: string;
|
|
7138
|
-
headers: any;
|
|
7139
|
-
request?: any;
|
|
7140
|
-
};
|
|
7141
|
-
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
7142
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
7143
|
-
url: string;
|
|
7144
|
-
data?: Data;
|
|
7145
|
-
params?: URLSearchParams;
|
|
7146
|
-
} & APIMetadata$1;
|
|
7147
|
-
type APIMetadata$1 = {
|
|
7148
|
-
methodFqn?: string;
|
|
7149
|
-
entityFqdn?: string;
|
|
7150
|
-
packageName?: string;
|
|
7151
|
-
};
|
|
7152
|
-
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
7153
|
-
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
7154
|
-
__type: 'event-definition';
|
|
7155
|
-
type: Type;
|
|
7156
|
-
isDomainEvent?: boolean;
|
|
7157
|
-
transformations?: (envelope: unknown) => Payload;
|
|
7158
|
-
__payload: Payload;
|
|
7159
|
-
};
|
|
7160
|
-
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
7161
|
-
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
7162
|
-
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
7163
|
-
|
|
7164
|
-
type ServicePluginMethodInput$1 = {
|
|
7165
|
-
request: any;
|
|
7166
|
-
metadata: any;
|
|
7167
|
-
};
|
|
7168
|
-
type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
|
|
7169
|
-
type ServicePluginMethodMetadata$1 = {
|
|
7170
|
-
name: string;
|
|
7171
|
-
primaryHttpMappingPath: string;
|
|
7172
|
-
transformations: {
|
|
7173
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
|
|
7174
|
-
toREST: (...args: unknown[]) => unknown;
|
|
7175
|
-
};
|
|
7176
|
-
};
|
|
7177
|
-
type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
|
|
7178
|
-
__type: 'service-plugin-definition';
|
|
7179
|
-
componentType: string;
|
|
7180
|
-
methods: ServicePluginMethodMetadata$1[];
|
|
7181
|
-
__contract: Contract;
|
|
7182
|
-
};
|
|
7183
|
-
declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
|
|
7184
|
-
type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
|
|
7185
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
|
|
7186
|
-
|
|
7187
|
-
type RequestContext$1 = {
|
|
7188
|
-
isSSR: boolean;
|
|
7189
|
-
host: string;
|
|
7190
|
-
protocol?: string;
|
|
7191
|
-
};
|
|
7192
|
-
type ResponseTransformer$1 = (data: any, headers?: any) => any;
|
|
7193
|
-
/**
|
|
7194
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
7195
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
7196
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
7197
|
-
*/
|
|
7198
|
-
type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
7199
|
-
type AmbassadorRequestOptions$1<T = any> = {
|
|
7200
|
-
_?: T;
|
|
5872
|
+
excerpt?: string;
|
|
5873
|
+
/**
|
|
5874
|
+
* The post's content in plain text.
|
|
5875
|
+
* @readonly
|
|
5876
|
+
*/
|
|
5877
|
+
contentText?: string | null;
|
|
5878
|
+
/** Date the post was first published. */
|
|
5879
|
+
firstPublishedDate?: Date;
|
|
5880
|
+
/**
|
|
5881
|
+
* Date the post was last published.
|
|
5882
|
+
* @readonly
|
|
5883
|
+
*/
|
|
5884
|
+
lastPublishedDate?: Date;
|
|
5885
|
+
/** Post URL. */
|
|
7201
5886
|
url?: string;
|
|
7202
|
-
method?: Method$1;
|
|
7203
|
-
params?: any;
|
|
7204
|
-
data?: any;
|
|
7205
|
-
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
7206
|
-
};
|
|
7207
|
-
type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
|
|
7208
|
-
__isAmbassador: boolean;
|
|
7209
|
-
};
|
|
7210
|
-
type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
|
|
7211
|
-
type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
7212
|
-
|
|
7213
|
-
declare global {
|
|
7214
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
7215
|
-
interface SymbolConstructor {
|
|
7216
|
-
readonly observable: symbol;
|
|
7217
|
-
}
|
|
7218
|
-
}
|
|
7219
|
-
|
|
7220
|
-
declare const emptyObjectSymbol$1: unique symbol;
|
|
7221
|
-
|
|
7222
|
-
/**
|
|
7223
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
7224
|
-
|
|
7225
|
-
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)).
|
|
7226
|
-
|
|
7227
|
-
@example
|
|
7228
|
-
```
|
|
7229
|
-
import type {EmptyObject} from 'type-fest';
|
|
7230
|
-
|
|
7231
|
-
// The following illustrates the problem with `{}`.
|
|
7232
|
-
const foo1: {} = {}; // Pass
|
|
7233
|
-
const foo2: {} = []; // Pass
|
|
7234
|
-
const foo3: {} = 42; // Pass
|
|
7235
|
-
const foo4: {} = {a: 1}; // Pass
|
|
7236
|
-
|
|
7237
|
-
// With `EmptyObject` only the first case is valid.
|
|
7238
|
-
const bar1: EmptyObject = {}; // Pass
|
|
7239
|
-
const bar2: EmptyObject = 42; // Fail
|
|
7240
|
-
const bar3: EmptyObject = []; // Fail
|
|
7241
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
7242
|
-
```
|
|
7243
|
-
|
|
7244
|
-
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}.
|
|
7245
|
-
|
|
7246
|
-
@category Object
|
|
7247
|
-
*/
|
|
7248
|
-
type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
|
|
7249
|
-
|
|
7250
|
-
/**
|
|
7251
|
-
Returns a boolean for whether the two given types are equal.
|
|
7252
|
-
|
|
7253
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
7254
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
7255
|
-
|
|
7256
|
-
Use-cases:
|
|
7257
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
7258
|
-
|
|
7259
|
-
@example
|
|
7260
|
-
```
|
|
7261
|
-
import type {IsEqual} from 'type-fest';
|
|
7262
|
-
|
|
7263
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
7264
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
7265
|
-
type Includes<Value extends readonly any[], Item> =
|
|
7266
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
7267
|
-
? IsEqual<Value[0], Item> extends true
|
|
7268
|
-
? true
|
|
7269
|
-
: Includes<rest, Item>
|
|
7270
|
-
: false;
|
|
7271
|
-
```
|
|
7272
|
-
|
|
7273
|
-
@category Type Guard
|
|
7274
|
-
@category Utilities
|
|
7275
|
-
*/
|
|
7276
|
-
type IsEqual$1<A, B> =
|
|
7277
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
7278
|
-
(<G>() => G extends B ? 1 : 2)
|
|
7279
|
-
? true
|
|
7280
|
-
: false;
|
|
7281
|
-
|
|
7282
|
-
/**
|
|
7283
|
-
Filter out keys from an object.
|
|
7284
|
-
|
|
7285
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
7286
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
7287
|
-
Returns `Key` otherwise.
|
|
7288
|
-
|
|
7289
|
-
@example
|
|
7290
|
-
```
|
|
7291
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
7292
|
-
//=> never
|
|
7293
|
-
```
|
|
7294
|
-
|
|
7295
|
-
@example
|
|
7296
|
-
```
|
|
7297
|
-
type Filtered = Filter<'bar', string>;
|
|
7298
|
-
//=> never
|
|
7299
|
-
```
|
|
7300
|
-
|
|
7301
|
-
@example
|
|
7302
|
-
```
|
|
7303
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
7304
|
-
//=> 'bar'
|
|
7305
|
-
```
|
|
7306
|
-
|
|
7307
|
-
@see {Except}
|
|
7308
|
-
*/
|
|
7309
|
-
type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
7310
|
-
|
|
7311
|
-
type ExceptOptions$1 = {
|
|
7312
|
-
/**
|
|
7313
|
-
Disallow assigning non-specified properties.
|
|
7314
|
-
|
|
7315
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
7316
|
-
|
|
7317
|
-
@default false
|
|
7318
|
-
*/
|
|
7319
|
-
requireExactProps?: boolean;
|
|
7320
|
-
};
|
|
7321
|
-
|
|
7322
|
-
/**
|
|
7323
|
-
Create a type from an object type without certain keys.
|
|
7324
|
-
|
|
7325
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
7326
|
-
|
|
7327
|
-
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.
|
|
7328
|
-
|
|
7329
|
-
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)).
|
|
7330
|
-
|
|
7331
|
-
@example
|
|
7332
|
-
```
|
|
7333
|
-
import type {Except} from 'type-fest';
|
|
7334
|
-
|
|
7335
|
-
type Foo = {
|
|
7336
|
-
a: number;
|
|
7337
|
-
b: string;
|
|
7338
|
-
};
|
|
7339
|
-
|
|
7340
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
7341
|
-
//=> {b: string}
|
|
7342
|
-
|
|
7343
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
7344
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
7345
|
-
|
|
7346
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
7347
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
7348
|
-
|
|
7349
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
7350
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
7351
|
-
```
|
|
7352
|
-
|
|
7353
|
-
@category Object
|
|
7354
|
-
*/
|
|
7355
|
-
type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
|
|
7356
|
-
[KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
|
|
7357
|
-
} & (Options['requireExactProps'] extends true
|
|
7358
|
-
? Partial<Record<KeysType, never>>
|
|
7359
|
-
: {});
|
|
7360
|
-
|
|
7361
|
-
/**
|
|
7362
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
7363
|
-
|
|
7364
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
7365
|
-
|
|
7366
|
-
@example
|
|
7367
|
-
```
|
|
7368
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
7369
|
-
|
|
7370
|
-
interface Example {
|
|
7371
|
-
a: string;
|
|
7372
|
-
b: string | number;
|
|
7373
|
-
c?: string;
|
|
7374
|
-
d: {};
|
|
7375
|
-
}
|
|
7376
|
-
|
|
7377
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
7378
|
-
//=> 'a'
|
|
7379
|
-
```
|
|
7380
|
-
|
|
7381
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
7382
|
-
|
|
7383
|
-
@example
|
|
7384
|
-
```
|
|
7385
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
7386
|
-
|
|
7387
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
7388
|
-
//=> 'a' | 'c'
|
|
7389
|
-
```
|
|
7390
|
-
|
|
7391
|
-
@category Object
|
|
7392
|
-
*/
|
|
7393
|
-
type ConditionalKeys$1<Base, Condition> = NonNullable<
|
|
7394
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
7395
|
-
{
|
|
7396
|
-
// Map through all the keys of the given base type.
|
|
7397
|
-
[Key in keyof Base]:
|
|
7398
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
7399
|
-
Base[Key] extends Condition
|
|
7400
|
-
// Retain this key since the condition passes.
|
|
7401
|
-
? Key
|
|
7402
|
-
// Discard this key since the condition fails.
|
|
7403
|
-
: never;
|
|
7404
|
-
|
|
7405
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
7406
|
-
}[keyof Base]
|
|
7407
|
-
>;
|
|
7408
|
-
|
|
7409
|
-
/**
|
|
7410
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
7411
|
-
|
|
7412
|
-
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.
|
|
7413
|
-
|
|
7414
|
-
@example
|
|
7415
|
-
```
|
|
7416
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
7417
|
-
|
|
7418
|
-
class Awesome {
|
|
7419
|
-
name: string;
|
|
7420
|
-
successes: number;
|
|
7421
|
-
failures: bigint;
|
|
7422
|
-
|
|
7423
|
-
run() {}
|
|
7424
|
-
}
|
|
7425
|
-
|
|
7426
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
7427
|
-
//=> {run: () => void}
|
|
7428
|
-
```
|
|
7429
|
-
|
|
7430
|
-
@example
|
|
7431
|
-
```
|
|
7432
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
7433
|
-
|
|
7434
|
-
interface Example {
|
|
7435
|
-
a: string;
|
|
7436
|
-
b: string | number;
|
|
7437
|
-
c: () => void;
|
|
7438
|
-
d: {};
|
|
7439
|
-
}
|
|
7440
|
-
|
|
7441
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
7442
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
7443
|
-
```
|
|
7444
|
-
|
|
7445
|
-
@category Object
|
|
7446
|
-
*/
|
|
7447
|
-
type ConditionalExcept$1<Base, Condition> = Except$1<
|
|
7448
|
-
Base,
|
|
7449
|
-
ConditionalKeys$1<Base, Condition>
|
|
7450
|
-
>;
|
|
7451
|
-
|
|
7452
|
-
/**
|
|
7453
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
7454
|
-
* can either be a REST module or a host module.
|
|
7455
|
-
* This type is recursive, so it can describe nested modules.
|
|
7456
|
-
*/
|
|
7457
|
-
type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$3<any> | ServicePluginDefinition$1<any> | {
|
|
7458
|
-
[key: string]: Descriptors$1 | PublicMetadata$1 | any;
|
|
7459
|
-
};
|
|
7460
|
-
/**
|
|
7461
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
7462
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
7463
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
7464
|
-
* do not match the given host (as they will not work with the given host).
|
|
7465
|
-
*/
|
|
7466
|
-
type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
|
|
7467
|
-
done: T;
|
|
7468
|
-
recurse: T extends {
|
|
7469
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
|
|
7470
|
-
} ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
|
|
7471
|
-
[Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
|
|
7472
|
-
-1,
|
|
7473
|
-
0,
|
|
7474
|
-
1,
|
|
7475
|
-
2,
|
|
7476
|
-
3,
|
|
7477
|
-
4,
|
|
7478
|
-
5
|
|
7479
|
-
][Depth]> : never;
|
|
7480
|
-
}, EmptyObject$1>;
|
|
7481
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
7482
|
-
type PublicMetadata$1 = {
|
|
7483
|
-
PACKAGE_NAME?: string;
|
|
7484
|
-
};
|
|
7485
|
-
|
|
7486
|
-
declare global {
|
|
7487
|
-
interface ContextualClient {
|
|
7488
|
-
}
|
|
7489
|
-
}
|
|
7490
|
-
/**
|
|
7491
|
-
* A type used to create concerete types from SDK descriptors in
|
|
7492
|
-
* case a contextual client is available.
|
|
7493
|
-
*/
|
|
7494
|
-
type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
|
|
7495
|
-
host: Host$1;
|
|
7496
|
-
} ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
|
|
7497
|
-
|
|
7498
|
-
interface Post {
|
|
7499
5887
|
/**
|
|
7500
|
-
*
|
|
7501
|
-
*
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
title?: string;
|
|
7506
|
-
/**
|
|
7507
|
-
* Post excerpt.
|
|
7508
|
-
* Can be selected by a site contributor. By default, it is extracted from the content text's first characters.
|
|
7509
|
-
*
|
|
7510
|
-
* Max: 500 characters
|
|
7511
|
-
*/
|
|
7512
|
-
excerpt?: string;
|
|
7513
|
-
/**
|
|
7514
|
-
* The post's content in plain text.
|
|
7515
|
-
* @readonly
|
|
7516
|
-
*/
|
|
7517
|
-
contentText?: string | null;
|
|
7518
|
-
/** Date the post was first published. */
|
|
7519
|
-
firstPublishedDate?: Date;
|
|
7520
|
-
/**
|
|
7521
|
-
* Date the post was last published.
|
|
7522
|
-
* @readonly
|
|
7523
|
-
*/
|
|
7524
|
-
lastPublishedDate?: Date;
|
|
7525
|
-
/** Post URL. */
|
|
7526
|
-
url?: string;
|
|
7527
|
-
/**
|
|
7528
|
-
* Part of a post's URL that refers to a specific post.
|
|
7529
|
-
*
|
|
7530
|
-
*
|
|
7531
|
-
* For example, `'https:/example.com/posts/my-post-slug'`.
|
|
7532
|
-
*
|
|
5888
|
+
* Part of a post's URL that refers to a specific post.
|
|
5889
|
+
*
|
|
5890
|
+
*
|
|
5891
|
+
* For example, `'https:/example.com/posts/my-post-slug'`.
|
|
5892
|
+
*
|
|
7533
5893
|
*/
|
|
7534
5894
|
slug?: string;
|
|
7535
5895
|
/** Whether the post is marked as featured. */
|
|
@@ -10976,7 +9336,7 @@ interface GetTotalPostsOptions {
|
|
|
10976
9336
|
language?: string | null;
|
|
10977
9337
|
}
|
|
10978
9338
|
|
|
10979
|
-
declare function getPost$1(httpClient: HttpClient
|
|
9339
|
+
declare function getPost$1(httpClient: HttpClient): GetPostSignature;
|
|
10980
9340
|
interface GetPostSignature {
|
|
10981
9341
|
/**
|
|
10982
9342
|
* Gets a post by the specified ID.
|
|
@@ -10990,7 +9350,7 @@ interface GetPostSignature {
|
|
|
10990
9350
|
*/
|
|
10991
9351
|
(postId: string, options?: GetPostOptions | undefined): Promise<GetPostResponse & GetPostResponseNonNullableFields>;
|
|
10992
9352
|
}
|
|
10993
|
-
declare function getPostBySlug$1(httpClient: HttpClient
|
|
9353
|
+
declare function getPostBySlug$1(httpClient: HttpClient): GetPostBySlugSignature;
|
|
10994
9354
|
interface GetPostBySlugSignature {
|
|
10995
9355
|
/**
|
|
10996
9356
|
* Gets a post by the provided slug.
|
|
@@ -11007,7 +9367,7 @@ interface GetPostBySlugSignature {
|
|
|
11007
9367
|
*/
|
|
11008
9368
|
(slug: string, options?: GetPostBySlugOptions | undefined): Promise<GetPostBySlugResponse & GetPostBySlugResponseNonNullableFields>;
|
|
11009
9369
|
}
|
|
11010
|
-
declare function listPosts$1(httpClient: HttpClient
|
|
9370
|
+
declare function listPosts$1(httpClient: HttpClient): ListPostsSignature;
|
|
11011
9371
|
interface ListPostsSignature {
|
|
11012
9372
|
/**
|
|
11013
9373
|
* Retrieves a list of published posts.
|
|
@@ -11023,7 +9383,7 @@ interface ListPostsSignature {
|
|
|
11023
9383
|
*/
|
|
11024
9384
|
(options?: ListPostsOptions | undefined): Promise<ListPostsResponse & ListPostsResponseNonNullableFields>;
|
|
11025
9385
|
}
|
|
11026
|
-
declare function queryPosts$1(httpClient: HttpClient
|
|
9386
|
+
declare function queryPosts$1(httpClient: HttpClient): QueryPostsSignature;
|
|
11027
9387
|
interface QueryPostsSignature {
|
|
11028
9388
|
/**
|
|
11029
9389
|
* Creates a query to retrieve a list of posts.
|
|
@@ -11048,7 +9408,7 @@ interface QueryPostsSignature {
|
|
|
11048
9408
|
*/
|
|
11049
9409
|
(options?: QueryPostsOptions | undefined): PostsQueryBuilder;
|
|
11050
9410
|
}
|
|
11051
|
-
declare function getPostMetrics$1(httpClient: HttpClient
|
|
9411
|
+
declare function getPostMetrics$1(httpClient: HttpClient): GetPostMetricsSignature;
|
|
11052
9412
|
interface GetPostMetricsSignature {
|
|
11053
9413
|
/**
|
|
11054
9414
|
* Gets a specified post's metrics.
|
|
@@ -11062,7 +9422,7 @@ interface GetPostMetricsSignature {
|
|
|
11062
9422
|
*/
|
|
11063
9423
|
(postId: string): Promise<GetPostMetricsResponse & GetPostMetricsResponseNonNullableFields>;
|
|
11064
9424
|
}
|
|
11065
|
-
declare function queryPostCountStats$1(httpClient: HttpClient
|
|
9425
|
+
declare function queryPostCountStats$1(httpClient: HttpClient): QueryPostCountStatsSignature;
|
|
11066
9426
|
interface QueryPostCountStatsSignature {
|
|
11067
9427
|
/**
|
|
11068
9428
|
* Retrieves the number of published posts per month within a specified time range.
|
|
@@ -11078,7 +9438,7 @@ interface QueryPostCountStatsSignature {
|
|
|
11078
9438
|
*/
|
|
11079
9439
|
(options?: QueryPostCountStatsOptions | undefined): Promise<QueryPostCountStatsResponse & QueryPostCountStatsResponseNonNullableFields>;
|
|
11080
9440
|
}
|
|
11081
|
-
declare function getTotalPosts$1(httpClient: HttpClient
|
|
9441
|
+
declare function getTotalPosts$1(httpClient: HttpClient): GetTotalPostsSignature;
|
|
11082
9442
|
interface GetTotalPostsSignature {
|
|
11083
9443
|
/**
|
|
11084
9444
|
* Gets the total amount of published posts on the blog.
|
|
@@ -11093,22 +9453,22 @@ interface GetTotalPostsSignature {
|
|
|
11093
9453
|
*/
|
|
11094
9454
|
(options?: GetTotalPostsOptions | undefined): Promise<GetTotalPostsResponse & GetTotalPostsResponseNonNullableFields>;
|
|
11095
9455
|
}
|
|
11096
|
-
declare const onPostCreated$1: EventDefinition$
|
|
11097
|
-
declare const onPostUpdated$1: EventDefinition$
|
|
11098
|
-
declare const onPostDeleted$1: EventDefinition$
|
|
11099
|
-
declare const onPostLiked$1: EventDefinition$
|
|
11100
|
-
declare const onPostUnliked$1: EventDefinition$
|
|
9456
|
+
declare const onPostCreated$1: EventDefinition$4<PostCreatedEnvelope, "wix.blog.v3.post_created">;
|
|
9457
|
+
declare const onPostUpdated$1: EventDefinition$4<PostUpdatedEnvelope, "wix.blog.v3.post_updated">;
|
|
9458
|
+
declare const onPostDeleted$1: EventDefinition$4<PostDeletedEnvelope, "wix.blog.v3.post_deleted">;
|
|
9459
|
+
declare const onPostLiked$1: EventDefinition$4<PostLikedEnvelope, "wix.blog.v3.post_liked">;
|
|
9460
|
+
declare const onPostUnliked$1: EventDefinition$4<PostUnlikedEnvelope, "wix.blog.v3.post_unliked">;
|
|
11101
9461
|
|
|
11102
|
-
type EventDefinition$
|
|
9462
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
11103
9463
|
__type: 'event-definition';
|
|
11104
9464
|
type: Type;
|
|
11105
9465
|
isDomainEvent?: boolean;
|
|
11106
9466
|
transformations?: (envelope: unknown) => Payload;
|
|
11107
9467
|
__payload: Payload;
|
|
11108
9468
|
};
|
|
11109
|
-
declare function EventDefinition$
|
|
11110
|
-
type EventHandler$
|
|
11111
|
-
type BuildEventDefinition$
|
|
9469
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
9470
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
9471
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
11112
9472
|
|
|
11113
9473
|
declare global {
|
|
11114
9474
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -11117,15 +9477,15 @@ declare global {
|
|
|
11117
9477
|
}
|
|
11118
9478
|
}
|
|
11119
9479
|
|
|
11120
|
-
declare function createEventModule$1<T extends EventDefinition$
|
|
9480
|
+
declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
11121
9481
|
|
|
11122
|
-
declare const getPost: MaybeContext
|
|
11123
|
-
declare const getPostBySlug: MaybeContext
|
|
11124
|
-
declare const listPosts: MaybeContext
|
|
11125
|
-
declare const queryPosts: MaybeContext
|
|
11126
|
-
declare const getPostMetrics: MaybeContext
|
|
11127
|
-
declare const queryPostCountStats: MaybeContext
|
|
11128
|
-
declare const getTotalPosts: MaybeContext
|
|
9482
|
+
declare const getPost: MaybeContext<BuildRESTFunction<typeof getPost$1> & typeof getPost$1>;
|
|
9483
|
+
declare const getPostBySlug: MaybeContext<BuildRESTFunction<typeof getPostBySlug$1> & typeof getPostBySlug$1>;
|
|
9484
|
+
declare const listPosts: MaybeContext<BuildRESTFunction<typeof listPosts$1> & typeof listPosts$1>;
|
|
9485
|
+
declare const queryPosts: MaybeContext<BuildRESTFunction<typeof queryPosts$1> & typeof queryPosts$1>;
|
|
9486
|
+
declare const getPostMetrics: MaybeContext<BuildRESTFunction<typeof getPostMetrics$1> & typeof getPostMetrics$1>;
|
|
9487
|
+
declare const queryPostCountStats: MaybeContext<BuildRESTFunction<typeof queryPostCountStats$1> & typeof queryPostCountStats$1>;
|
|
9488
|
+
declare const getTotalPosts: MaybeContext<BuildRESTFunction<typeof getTotalPosts$1> & typeof getTotalPosts$1>;
|
|
11129
9489
|
|
|
11130
9490
|
type _publicOnPostCreatedType = typeof onPostCreated$1;
|
|
11131
9491
|
/**
|
|
@@ -11440,416 +9800,6 @@ declare namespace index_d$1 {
|
|
|
11440
9800
|
export { type ActionEvent$1 as ActionEvent, index_d$1_Alignment as Alignment, type index_d$1_AnchorData as AnchorData, type index_d$1_AppEmbedData as AppEmbedData, type index_d$1_AppEmbedDataAppDataOneOf as AppEmbedDataAppDataOneOf, index_d$1_AppType as AppType, type index_d$1_AudioData as AudioData, type index_d$1_Background as Background, type index_d$1_BackgroundBackgroundOneOf as BackgroundBackgroundOneOf, index_d$1_BackgroundType as BackgroundType, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$1_BlockquoteData as BlockquoteData, type index_d$1_BlogPaging as BlogPaging, type index_d$1_BookingData as BookingData, type index_d$1_Border as Border, type index_d$1_BorderColors as BorderColors, type index_d$1_BulkGetPostMetricsRequest as BulkGetPostMetricsRequest, type index_d$1_BulkGetPostMetricsResponse as BulkGetPostMetricsResponse, type index_d$1_BulkGetPostReactionsRequest as BulkGetPostReactionsRequest, type index_d$1_BulkGetPostReactionsResponse as BulkGetPostReactionsResponse, type index_d$1_BulletedListData as BulletedListData, type index_d$1_ButtonData as ButtonData, type index_d$1_Category as Category, type index_d$1_CategoryTranslation as CategoryTranslation, type index_d$1_CellStyle as CellStyle, type index_d$1_CodeBlockData as CodeBlockData, type index_d$1_CollapsibleListData as CollapsibleListData, type index_d$1_ColorData as ColorData, type index_d$1_Colors as Colors, type index_d$1_ConvertDraftJsToRichContentRequest as ConvertDraftJsToRichContentRequest, type index_d$1_ConvertDraftJsToRichContentResponse as ConvertDraftJsToRichContentResponse, type index_d$1_ConvertRichContentToDraftJsRequest as ConvertRichContentToDraftJsRequest, type index_d$1_ConvertRichContentToDraftJsResponse as ConvertRichContentToDraftJsResponse, type index_d$1_CoverMedia as CoverMedia, type index_d$1_CoverMediaMediaOneOf as CoverMediaMediaOneOf, type index_d$1_CreateDraftPostFromTemplateRequest as CreateDraftPostFromTemplateRequest, type index_d$1_CreateDraftPostFromTemplateResponse as CreateDraftPostFromTemplateResponse, index_d$1_Crop as Crop, type CursorPaging$1 as CursorPaging, type Cursors$1 as Cursors, type index_d$1_Decoration as Decoration, type index_d$1_DecorationDataOneOf as DecorationDataOneOf, index_d$1_DecorationType as DecorationType, type index_d$1_Design as Design, type index_d$1_Dimensions as Dimensions, index_d$1_Direction as Direction, type index_d$1_DividerData as DividerData, type index_d$1_DocumentStyle as DocumentStyle, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type index_d$1_DraftPost as DraftPost, type index_d$1_DraftPostTranslation as DraftPostTranslation, type index_d$1_EmbedData as EmbedData, type index_d$1_EmbedMedia as EmbedMedia, type index_d$1_EmbedThumbnail as EmbedThumbnail, type index_d$1_EmbedVideo as EmbedVideo, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type index_d$1_EventData as EventData, type EventMetadata$1 as EventMetadata, Field$1 as Field, type index_d$1_FileData as FileData, type index_d$1_FileSource as FileSource, type index_d$1_FileSourceDataOneOf as FileSourceDataOneOf, type index_d$1_FontSizeData as FontSizeData, index_d$1_FontType as FontType, type index_d$1_GIF as GIF, type index_d$1_GIFData as GIFData, type index_d$1_GalleryData as GalleryData, type index_d$1_GalleryOptions as GalleryOptions, type index_d$1_GetPostBySlugOptions as GetPostBySlugOptions, type index_d$1_GetPostBySlugRequest as GetPostBySlugRequest, type index_d$1_GetPostBySlugResponse as GetPostBySlugResponse, type index_d$1_GetPostBySlugResponseNonNullableFields as GetPostBySlugResponseNonNullableFields, type index_d$1_GetPostMetricsRequest as GetPostMetricsRequest, type index_d$1_GetPostMetricsResponse as GetPostMetricsResponse, type index_d$1_GetPostMetricsResponseNonNullableFields as GetPostMetricsResponseNonNullableFields, type index_d$1_GetPostOptions as GetPostOptions, type index_d$1_GetPostRequest as GetPostRequest, type index_d$1_GetPostResponse as GetPostResponse, type index_d$1_GetPostResponseNonNullableFields as GetPostResponseNonNullableFields, index_d$1_GetPostTemplatesSort as GetPostTemplatesSort, index_d$1_GetPostsSort as GetPostsSort, type index_d$1_GetTemplateRequest as GetTemplateRequest, type index_d$1_GetTemplateResponse as GetTemplateResponse, type index_d$1_GetTotalLikesPerMemberRequest as GetTotalLikesPerMemberRequest, type index_d$1_GetTotalLikesPerMemberResponse as GetTotalLikesPerMemberResponse, type index_d$1_GetTotalPostsOptions as GetTotalPostsOptions, type index_d$1_GetTotalPostsRequest as GetTotalPostsRequest, type index_d$1_GetTotalPostsResponse as GetTotalPostsResponse, type index_d$1_GetTotalPostsResponseNonNullableFields as GetTotalPostsResponseNonNullableFields, type index_d$1_GetTotalPublicationsRequest as GetTotalPublicationsRequest, type index_d$1_GetTotalPublicationsResponse as GetTotalPublicationsResponse, type index_d$1_Gradient as Gradient, type index_d$1_HTMLData as HTMLData, type index_d$1_HTMLDataDataOneOf as HTMLDataDataOneOf, type index_d$1_HeadingData as HeadingData, type index_d$1_Height as Height, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type index_d$1_Image as Image, type index_d$1_ImageData as ImageData, index_d$1_InitialExpandedItems as InitialExpandedItems, type index_d$1_InitialPostsCopied as InitialPostsCopied, type index_d$1_Item as Item, type index_d$1_ItemDataOneOf as ItemDataOneOf, type index_d$1_ItemStyle as ItemStyle, type Keyword$1 as Keyword, type index_d$1_Layout as Layout, index_d$1_LayoutType as LayoutType, type index_d$1_LikePostRequest as LikePostRequest, type index_d$1_LikePostResponse as LikePostResponse, index_d$1_LineStyle as LineStyle, type index_d$1_Link as Link, type index_d$1_LinkData as LinkData, type index_d$1_LinkDataOneOf as LinkDataOneOf, type index_d$1_LinkPreviewData as LinkPreviewData, type index_d$1_ListDemoPostsRequest as ListDemoPostsRequest, type index_d$1_ListDemoPostsResponse as ListDemoPostsResponse, type index_d$1_ListPostsArchiveRequest as ListPostsArchiveRequest, type index_d$1_ListPostsArchiveResponse as ListPostsArchiveResponse, type index_d$1_ListPostsOptions as ListPostsOptions, type index_d$1_ListPostsRequest as ListPostsRequest, type index_d$1_ListPostsResponse as ListPostsResponse, type index_d$1_ListPostsResponseNonNullableFields as ListPostsResponseNonNullableFields, type index_d$1_ListTemplatesRequest as ListTemplatesRequest, type index_d$1_ListTemplatesResponse as ListTemplatesResponse, type index_d$1_ListValue as ListValue, type index_d$1_MapData as MapData, type index_d$1_MapSettings as MapSettings, index_d$1_MapType as MapType, type index_d$1_Media as Media, type index_d$1_MediaMediaOneOf as MediaMediaOneOf, type index_d$1_MentionData as MentionData, type MessageEnvelope$1 as MessageEnvelope, type MetaData$1 as MetaData, type index_d$1_Metadata as Metadata, type index_d$1_Metrics as Metrics, type index_d$1_ModerationDetails as ModerationDetails, index_d$1_ModerationStatusStatus as ModerationStatusStatus, type index_d$1_Node as Node, type index_d$1_NodeDataOneOf as NodeDataOneOf, type index_d$1_NodeStyle as NodeStyle, index_d$1_NodeType as NodeType, index_d$1_NullValue as NullValue, type index_d$1_Oembed as Oembed, type index_d$1_OldBlogMigratedEvent as OldBlogMigratedEvent, type index_d$1_Option as Option, type index_d$1_OptionDesign as OptionDesign, type index_d$1_OptionLayout as OptionLayout, index_d$1_Order as Order, type index_d$1_OrderedListData as OrderedListData, index_d$1_Orientation as Orientation, index_d$1_Origin as Origin, type index_d$1_PDFSettings as PDFSettings, type Paging$1 as Paging, type PagingMetadataV2$1 as PagingMetadataV2, type index_d$1_ParagraphData as ParagraphData, type index_d$1_PeriodPostCount as PeriodPostCount, type index_d$1_PeriodPublicationsCount as PeriodPublicationsCount, type index_d$1_Permissions as Permissions, type index_d$1_PinPostRequest as PinPostRequest, type index_d$1_PinPostResponse as PinPostResponse, type PlatformQuery$1 as PlatformQuery, type PlatformQueryPagingMethodOneOf$1 as PlatformQueryPagingMethodOneOf, type index_d$1_PlaybackOptions as PlaybackOptions, type index_d$1_PluginContainerData as PluginContainerData, index_d$1_PluginContainerDataAlignment as PluginContainerDataAlignment, type index_d$1_PluginContainerDataWidth as PluginContainerDataWidth, type index_d$1_PluginContainerDataWidthDataOneOf as PluginContainerDataWidthDataOneOf, type index_d$1_Poll as Poll, type index_d$1_PollData as PollData, type index_d$1_PollDataLayout as PollDataLayout, type index_d$1_PollDesign as PollDesign, type index_d$1_PollLayout as PollLayout, index_d$1_PollLayoutDirection as PollLayoutDirection, index_d$1_PollLayoutType as PollLayoutType, type index_d$1_PollSettings as PollSettings, type index_d$1_Post as Post, type index_d$1_PostCountInfo as PostCountInfo, type index_d$1_PostCountersUpdated as PostCountersUpdated, type index_d$1_PostCountersUpdatedInitiatorOneOf as PostCountersUpdatedInitiatorOneOf, type index_d$1_PostCreatedEnvelope as PostCreatedEnvelope, type index_d$1_PostDeletedEnvelope as PostDeletedEnvelope, index_d$1_PostFieldField as PostFieldField, type index_d$1_PostLiked as PostLiked, type index_d$1_PostLikedEnvelope as PostLikedEnvelope, type index_d$1_PostLikedInitiatorOneOf as PostLikedInitiatorOneOf, type index_d$1_PostOwnerChanged as PostOwnerChanged, type index_d$1_PostTranslation as PostTranslation, type index_d$1_PostUnliked as PostUnliked, type index_d$1_PostUnlikedEnvelope as PostUnlikedEnvelope, type index_d$1_PostUnlikedInitiatorOneOf as PostUnlikedInitiatorOneOf, type index_d$1_PostUpdatedEnvelope as PostUpdatedEnvelope, type index_d$1_PostsQueryBuilder as PostsQueryBuilder, type index_d$1_PostsQueryResult as PostsQueryResult, type index_d$1_QueryPostCountStatsOptions as QueryPostCountStatsOptions, type index_d$1_QueryPostCountStatsRequest as QueryPostCountStatsRequest, type index_d$1_QueryPostCountStatsResponse as QueryPostCountStatsResponse, type index_d$1_QueryPostCountStatsResponseNonNullableFields as QueryPostCountStatsResponseNonNullableFields, type index_d$1_QueryPostsOptions as QueryPostsOptions, type index_d$1_QueryPostsRequest as QueryPostsRequest, type index_d$1_QueryPostsResponse as QueryPostsResponse, type index_d$1_QueryPostsResponseNonNullableFields as QueryPostsResponseNonNullableFields, type index_d$1_QueryPublicationsCountStatsRequest as QueryPublicationsCountStatsRequest, index_d$1_QueryPublicationsCountStatsRequestOrder as QueryPublicationsCountStatsRequestOrder, type index_d$1_QueryPublicationsCountStatsResponse as QueryPublicationsCountStatsResponse, type index_d$1_Reactions as Reactions, type index_d$1_Rel as Rel, type RestoreInfo$1 as RestoreInfo, type index_d$1_RichContent as RichContent, type index_d$1_SendActionEventRequest as SendActionEventRequest, type index_d$1_SendActionEventRequestActionOneOf as SendActionEventRequestActionOneOf, type index_d$1_SendActionEventResponse as SendActionEventResponse, type SeoSchema$1 as SeoSchema, type Settings$1 as Settings, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, index_d$1_Source as Source, type index_d$1_Spoiler as Spoiler, type index_d$1_SpoilerData as SpoilerData, index_d$1_Status as Status, type index_d$1_Styles as Styles, type index_d$1_TableCellData as TableCellData, type index_d$1_TableData as TableData, type Tag$1 as Tag, index_d$1_Target as Target, index_d$1_TextAlignment as TextAlignment, type index_d$1_TextData as TextData, type index_d$1_TextNodeStyle as TextNodeStyle, type index_d$1_TextStyle as TextStyle, type index_d$1_Thumbnails as Thumbnails, index_d$1_ThumbnailsAlignment as ThumbnailsAlignment, index_d$1_Type as Type, type index_d$1_UnlikePostRequest as UnlikePostRequest, type index_d$1_UnlikePostResponse as UnlikePostResponse, type index_d$1_UnpinPostRequest as UnpinPostRequest, type index_d$1_UnpinPostResponse as UnpinPostResponse, type index_d$1_V1Media as V1Media, index_d$1_VerticalAlignment as VerticalAlignment, type index_d$1_Video as Video, type index_d$1_VideoData as VideoData, type index_d$1_VideoResolution as VideoResolution, index_d$1_ViewMode as ViewMode, type index_d$1_ViewPostRequest as ViewPostRequest, type index_d$1_ViewPostResponse as ViewPostResponse, index_d$1_ViewRole as ViewRole, index_d$1_VoteRole as VoteRole, WebhookIdentityType$1 as WebhookIdentityType, index_d$1_Width as Width, index_d$1_WidthType as WidthType, type index_d$1_WixMedia as WixMedia, type index_d$1__publicOnPostCreatedType as _publicOnPostCreatedType, type index_d$1__publicOnPostDeletedType as _publicOnPostDeletedType, type index_d$1__publicOnPostLikedType as _publicOnPostLikedType, type index_d$1__publicOnPostUnlikedType as _publicOnPostUnlikedType, type index_d$1__publicOnPostUpdatedType as _publicOnPostUpdatedType, index_d$1_getPost as getPost, index_d$1_getPostBySlug as getPostBySlug, index_d$1_getPostMetrics as getPostMetrics, index_d$1_getTotalPosts as getTotalPosts, index_d$1_listPosts as listPosts, index_d$1_onPostCreated as onPostCreated, index_d$1_onPostDeleted as onPostDeleted, index_d$1_onPostLiked as onPostLiked, index_d$1_onPostUnliked as onPostUnliked, index_d$1_onPostUpdated as onPostUpdated, onPostCreated$1 as publicOnPostCreated, onPostDeleted$1 as publicOnPostDeleted, onPostLiked$1 as publicOnPostLiked, onPostUnliked$1 as publicOnPostUnliked, onPostUpdated$1 as publicOnPostUpdated, index_d$1_queryPostCountStats as queryPostCountStats, index_d$1_queryPosts as queryPosts };
|
|
11441
9801
|
}
|
|
11442
9802
|
|
|
11443
|
-
type HostModule<T, H extends Host> = {
|
|
11444
|
-
__type: 'host';
|
|
11445
|
-
create(host: H): T;
|
|
11446
|
-
};
|
|
11447
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
11448
|
-
type Host<Environment = unknown> = {
|
|
11449
|
-
channel: {
|
|
11450
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
11451
|
-
disconnect: () => void;
|
|
11452
|
-
} | Promise<{
|
|
11453
|
-
disconnect: () => void;
|
|
11454
|
-
}>;
|
|
11455
|
-
};
|
|
11456
|
-
environment?: Environment;
|
|
11457
|
-
/**
|
|
11458
|
-
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
11459
|
-
*/
|
|
11460
|
-
apiBaseUrl?: string;
|
|
11461
|
-
/**
|
|
11462
|
-
* Possible data to be provided by every host, for cross cutting concerns
|
|
11463
|
-
* like internationalization, billing, etc.
|
|
11464
|
-
*/
|
|
11465
|
-
essentials?: {
|
|
11466
|
-
/**
|
|
11467
|
-
* The language of the currently viewed session
|
|
11468
|
-
*/
|
|
11469
|
-
language?: string;
|
|
11470
|
-
/**
|
|
11471
|
-
* The locale of the currently viewed session
|
|
11472
|
-
*/
|
|
11473
|
-
locale?: string;
|
|
11474
|
-
/**
|
|
11475
|
-
* Any headers that should be passed through to the API requests
|
|
11476
|
-
*/
|
|
11477
|
-
passThroughHeaders?: Record<string, string>;
|
|
11478
|
-
};
|
|
11479
|
-
};
|
|
11480
|
-
|
|
11481
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
11482
|
-
interface HttpClient {
|
|
11483
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
11484
|
-
fetchWithAuth: typeof fetch;
|
|
11485
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
11486
|
-
getActiveToken?: () => string | undefined;
|
|
11487
|
-
}
|
|
11488
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
11489
|
-
type HttpResponse<T = any> = {
|
|
11490
|
-
data: T;
|
|
11491
|
-
status: number;
|
|
11492
|
-
statusText: string;
|
|
11493
|
-
headers: any;
|
|
11494
|
-
request?: any;
|
|
11495
|
-
};
|
|
11496
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
11497
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
11498
|
-
url: string;
|
|
11499
|
-
data?: Data;
|
|
11500
|
-
params?: URLSearchParams;
|
|
11501
|
-
} & APIMetadata;
|
|
11502
|
-
type APIMetadata = {
|
|
11503
|
-
methodFqn?: string;
|
|
11504
|
-
entityFqdn?: string;
|
|
11505
|
-
packageName?: string;
|
|
11506
|
-
};
|
|
11507
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
11508
|
-
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
11509
|
-
__type: 'event-definition';
|
|
11510
|
-
type: Type;
|
|
11511
|
-
isDomainEvent?: boolean;
|
|
11512
|
-
transformations?: (envelope: unknown) => Payload;
|
|
11513
|
-
__payload: Payload;
|
|
11514
|
-
};
|
|
11515
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
11516
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
11517
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
11518
|
-
|
|
11519
|
-
type ServicePluginMethodInput = {
|
|
11520
|
-
request: any;
|
|
11521
|
-
metadata: any;
|
|
11522
|
-
};
|
|
11523
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
11524
|
-
type ServicePluginMethodMetadata = {
|
|
11525
|
-
name: string;
|
|
11526
|
-
primaryHttpMappingPath: string;
|
|
11527
|
-
transformations: {
|
|
11528
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
11529
|
-
toREST: (...args: unknown[]) => unknown;
|
|
11530
|
-
};
|
|
11531
|
-
};
|
|
11532
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
11533
|
-
__type: 'service-plugin-definition';
|
|
11534
|
-
componentType: string;
|
|
11535
|
-
methods: ServicePluginMethodMetadata[];
|
|
11536
|
-
__contract: Contract;
|
|
11537
|
-
};
|
|
11538
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
11539
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
11540
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
11541
|
-
|
|
11542
|
-
type RequestContext = {
|
|
11543
|
-
isSSR: boolean;
|
|
11544
|
-
host: string;
|
|
11545
|
-
protocol?: string;
|
|
11546
|
-
};
|
|
11547
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
11548
|
-
/**
|
|
11549
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
11550
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
11551
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
11552
|
-
*/
|
|
11553
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
11554
|
-
type AmbassadorRequestOptions<T = any> = {
|
|
11555
|
-
_?: T;
|
|
11556
|
-
url?: string;
|
|
11557
|
-
method?: Method;
|
|
11558
|
-
params?: any;
|
|
11559
|
-
data?: any;
|
|
11560
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
11561
|
-
};
|
|
11562
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
11563
|
-
__isAmbassador: boolean;
|
|
11564
|
-
};
|
|
11565
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
11566
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
11567
|
-
|
|
11568
|
-
declare global {
|
|
11569
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
11570
|
-
interface SymbolConstructor {
|
|
11571
|
-
readonly observable: symbol;
|
|
11572
|
-
}
|
|
11573
|
-
}
|
|
11574
|
-
|
|
11575
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
11576
|
-
|
|
11577
|
-
/**
|
|
11578
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
11579
|
-
|
|
11580
|
-
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)).
|
|
11581
|
-
|
|
11582
|
-
@example
|
|
11583
|
-
```
|
|
11584
|
-
import type {EmptyObject} from 'type-fest';
|
|
11585
|
-
|
|
11586
|
-
// The following illustrates the problem with `{}`.
|
|
11587
|
-
const foo1: {} = {}; // Pass
|
|
11588
|
-
const foo2: {} = []; // Pass
|
|
11589
|
-
const foo3: {} = 42; // Pass
|
|
11590
|
-
const foo4: {} = {a: 1}; // Pass
|
|
11591
|
-
|
|
11592
|
-
// With `EmptyObject` only the first case is valid.
|
|
11593
|
-
const bar1: EmptyObject = {}; // Pass
|
|
11594
|
-
const bar2: EmptyObject = 42; // Fail
|
|
11595
|
-
const bar3: EmptyObject = []; // Fail
|
|
11596
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
11597
|
-
```
|
|
11598
|
-
|
|
11599
|
-
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}.
|
|
11600
|
-
|
|
11601
|
-
@category Object
|
|
11602
|
-
*/
|
|
11603
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
11604
|
-
|
|
11605
|
-
/**
|
|
11606
|
-
Returns a boolean for whether the two given types are equal.
|
|
11607
|
-
|
|
11608
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
11609
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
11610
|
-
|
|
11611
|
-
Use-cases:
|
|
11612
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
11613
|
-
|
|
11614
|
-
@example
|
|
11615
|
-
```
|
|
11616
|
-
import type {IsEqual} from 'type-fest';
|
|
11617
|
-
|
|
11618
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
11619
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
11620
|
-
type Includes<Value extends readonly any[], Item> =
|
|
11621
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
11622
|
-
? IsEqual<Value[0], Item> extends true
|
|
11623
|
-
? true
|
|
11624
|
-
: Includes<rest, Item>
|
|
11625
|
-
: false;
|
|
11626
|
-
```
|
|
11627
|
-
|
|
11628
|
-
@category Type Guard
|
|
11629
|
-
@category Utilities
|
|
11630
|
-
*/
|
|
11631
|
-
type IsEqual<A, B> =
|
|
11632
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
11633
|
-
(<G>() => G extends B ? 1 : 2)
|
|
11634
|
-
? true
|
|
11635
|
-
: false;
|
|
11636
|
-
|
|
11637
|
-
/**
|
|
11638
|
-
Filter out keys from an object.
|
|
11639
|
-
|
|
11640
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
11641
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
11642
|
-
Returns `Key` otherwise.
|
|
11643
|
-
|
|
11644
|
-
@example
|
|
11645
|
-
```
|
|
11646
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
11647
|
-
//=> never
|
|
11648
|
-
```
|
|
11649
|
-
|
|
11650
|
-
@example
|
|
11651
|
-
```
|
|
11652
|
-
type Filtered = Filter<'bar', string>;
|
|
11653
|
-
//=> never
|
|
11654
|
-
```
|
|
11655
|
-
|
|
11656
|
-
@example
|
|
11657
|
-
```
|
|
11658
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
11659
|
-
//=> 'bar'
|
|
11660
|
-
```
|
|
11661
|
-
|
|
11662
|
-
@see {Except}
|
|
11663
|
-
*/
|
|
11664
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
11665
|
-
|
|
11666
|
-
type ExceptOptions = {
|
|
11667
|
-
/**
|
|
11668
|
-
Disallow assigning non-specified properties.
|
|
11669
|
-
|
|
11670
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
11671
|
-
|
|
11672
|
-
@default false
|
|
11673
|
-
*/
|
|
11674
|
-
requireExactProps?: boolean;
|
|
11675
|
-
};
|
|
11676
|
-
|
|
11677
|
-
/**
|
|
11678
|
-
Create a type from an object type without certain keys.
|
|
11679
|
-
|
|
11680
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
11681
|
-
|
|
11682
|
-
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.
|
|
11683
|
-
|
|
11684
|
-
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)).
|
|
11685
|
-
|
|
11686
|
-
@example
|
|
11687
|
-
```
|
|
11688
|
-
import type {Except} from 'type-fest';
|
|
11689
|
-
|
|
11690
|
-
type Foo = {
|
|
11691
|
-
a: number;
|
|
11692
|
-
b: string;
|
|
11693
|
-
};
|
|
11694
|
-
|
|
11695
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
11696
|
-
//=> {b: string}
|
|
11697
|
-
|
|
11698
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
11699
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
11700
|
-
|
|
11701
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
11702
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
11703
|
-
|
|
11704
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
11705
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
11706
|
-
```
|
|
11707
|
-
|
|
11708
|
-
@category Object
|
|
11709
|
-
*/
|
|
11710
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
11711
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
11712
|
-
} & (Options['requireExactProps'] extends true
|
|
11713
|
-
? Partial<Record<KeysType, never>>
|
|
11714
|
-
: {});
|
|
11715
|
-
|
|
11716
|
-
/**
|
|
11717
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
11718
|
-
|
|
11719
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
11720
|
-
|
|
11721
|
-
@example
|
|
11722
|
-
```
|
|
11723
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
11724
|
-
|
|
11725
|
-
interface Example {
|
|
11726
|
-
a: string;
|
|
11727
|
-
b: string | number;
|
|
11728
|
-
c?: string;
|
|
11729
|
-
d: {};
|
|
11730
|
-
}
|
|
11731
|
-
|
|
11732
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
11733
|
-
//=> 'a'
|
|
11734
|
-
```
|
|
11735
|
-
|
|
11736
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
11737
|
-
|
|
11738
|
-
@example
|
|
11739
|
-
```
|
|
11740
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
11741
|
-
|
|
11742
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
11743
|
-
//=> 'a' | 'c'
|
|
11744
|
-
```
|
|
11745
|
-
|
|
11746
|
-
@category Object
|
|
11747
|
-
*/
|
|
11748
|
-
type ConditionalKeys<Base, Condition> = NonNullable<
|
|
11749
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
11750
|
-
{
|
|
11751
|
-
// Map through all the keys of the given base type.
|
|
11752
|
-
[Key in keyof Base]:
|
|
11753
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
11754
|
-
Base[Key] extends Condition
|
|
11755
|
-
// Retain this key since the condition passes.
|
|
11756
|
-
? Key
|
|
11757
|
-
// Discard this key since the condition fails.
|
|
11758
|
-
: never;
|
|
11759
|
-
|
|
11760
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
11761
|
-
}[keyof Base]
|
|
11762
|
-
>;
|
|
11763
|
-
|
|
11764
|
-
/**
|
|
11765
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
11766
|
-
|
|
11767
|
-
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.
|
|
11768
|
-
|
|
11769
|
-
@example
|
|
11770
|
-
```
|
|
11771
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
11772
|
-
|
|
11773
|
-
class Awesome {
|
|
11774
|
-
name: string;
|
|
11775
|
-
successes: number;
|
|
11776
|
-
failures: bigint;
|
|
11777
|
-
|
|
11778
|
-
run() {}
|
|
11779
|
-
}
|
|
11780
|
-
|
|
11781
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
11782
|
-
//=> {run: () => void}
|
|
11783
|
-
```
|
|
11784
|
-
|
|
11785
|
-
@example
|
|
11786
|
-
```
|
|
11787
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
11788
|
-
|
|
11789
|
-
interface Example {
|
|
11790
|
-
a: string;
|
|
11791
|
-
b: string | number;
|
|
11792
|
-
c: () => void;
|
|
11793
|
-
d: {};
|
|
11794
|
-
}
|
|
11795
|
-
|
|
11796
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
11797
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
11798
|
-
```
|
|
11799
|
-
|
|
11800
|
-
@category Object
|
|
11801
|
-
*/
|
|
11802
|
-
type ConditionalExcept<Base, Condition> = Except<
|
|
11803
|
-
Base,
|
|
11804
|
-
ConditionalKeys<Base, Condition>
|
|
11805
|
-
>;
|
|
11806
|
-
|
|
11807
|
-
/**
|
|
11808
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
11809
|
-
* can either be a REST module or a host module.
|
|
11810
|
-
* This type is recursive, so it can describe nested modules.
|
|
11811
|
-
*/
|
|
11812
|
-
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
|
|
11813
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
|
11814
|
-
};
|
|
11815
|
-
/**
|
|
11816
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
11817
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
11818
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
11819
|
-
* do not match the given host (as they will not work with the given host).
|
|
11820
|
-
*/
|
|
11821
|
-
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
11822
|
-
done: T;
|
|
11823
|
-
recurse: T extends {
|
|
11824
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
11825
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
11826
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
11827
|
-
-1,
|
|
11828
|
-
0,
|
|
11829
|
-
1,
|
|
11830
|
-
2,
|
|
11831
|
-
3,
|
|
11832
|
-
4,
|
|
11833
|
-
5
|
|
11834
|
-
][Depth]> : never;
|
|
11835
|
-
}, EmptyObject>;
|
|
11836
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
11837
|
-
type PublicMetadata = {
|
|
11838
|
-
PACKAGE_NAME?: string;
|
|
11839
|
-
};
|
|
11840
|
-
|
|
11841
|
-
declare global {
|
|
11842
|
-
interface ContextualClient {
|
|
11843
|
-
}
|
|
11844
|
-
}
|
|
11845
|
-
/**
|
|
11846
|
-
* A type used to create concerete types from SDK descriptors in
|
|
11847
|
-
* case a contextual client is available.
|
|
11848
|
-
*/
|
|
11849
|
-
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
11850
|
-
host: Host;
|
|
11851
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
11852
|
-
|
|
11853
9803
|
interface BlogTag {
|
|
11854
9804
|
/**
|
|
11855
9805
|
* Tag ID.
|
|
@@ -12859,9 +10809,9 @@ interface DeleteTagSignature {
|
|
|
12859
10809
|
*/
|
|
12860
10810
|
(tagId: string): Promise<void>;
|
|
12861
10811
|
}
|
|
12862
|
-
declare const onTagCreated$1: EventDefinition$
|
|
12863
|
-
declare const onTagUpdated$1: EventDefinition$
|
|
12864
|
-
declare const onTagDeleted$1: EventDefinition$
|
|
10812
|
+
declare const onTagCreated$1: EventDefinition$4<TagCreatedEnvelope, "wix.blog.v3.tag_created">;
|
|
10813
|
+
declare const onTagUpdated$1: EventDefinition$4<TagUpdatedEnvelope, "wix.blog.v3.tag_updated">;
|
|
10814
|
+
declare const onTagDeleted$1: EventDefinition$4<TagDeletedEnvelope, "wix.blog.v3.tag_deleted">;
|
|
12865
10815
|
|
|
12866
10816
|
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
12867
10817
|
__type: 'event-definition';
|