@wix/blog 1.0.290 → 1.0.292

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.
@@ -1,9 +1,9 @@
1
- type HostModule$5<T, H extends Host$5> = {
1
+ type HostModule<T, H extends Host> = {
2
2
  __type: 'host';
3
3
  create(host: H): T;
4
4
  };
5
- type HostModuleAPI$5<T extends HostModule$5<any, any>> = T extends HostModule$5<infer U, any> ? U : never;
6
- type Host$5<Environment = unknown> = {
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$5<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$5) => T;
40
- interface HttpClient$5 {
41
- request<TResponse, TData = any>(req: RequestOptionsFactory$5<TResponse, TData>): Promise<HttpResponse$5<TResponse>>;
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$5<TResponse = any, TData = any> = (context: any) => RequestOptions$5<TResponse, TData>;
47
- type HttpResponse$5<T = any> = {
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$5<_TResponse = any, Data = any> = {
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$5;
60
- type APIMetadata$5 = {
59
+ } & APIMetadata;
60
+ type APIMetadata = {
61
61
  methodFqn?: string;
62
62
  entityFqdn?: string;
63
63
  packageName?: string;
64
64
  };
65
- type BuildRESTFunction$5<T extends RESTFunctionDescriptor$5> = T extends RESTFunctionDescriptor$5<infer U> ? U : never;
66
- type EventDefinition$9<Payload = unknown, Type extends string = string> = {
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$9<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$9<Payload, Type>;
74
- type EventHandler$9<T extends EventDefinition$9> = (payload: T['__payload']) => void | Promise<void>;
75
- type BuildEventDefinition$9<T extends EventDefinition$9<any, string>> = (handler: EventHandler$9<T>) => void;
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$5 = {
77
+ type ServicePluginMethodInput = {
78
78
  request: any;
79
79
  metadata: any;
80
80
  };
81
- type ServicePluginContract$5 = Record<string, (payload: ServicePluginMethodInput$5) => unknown | Promise<unknown>>;
82
- type ServicePluginMethodMetadata$5 = {
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$5;
86
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
87
87
  toREST: (...args: unknown[]) => unknown;
88
88
  };
89
89
  };
90
- type ServicePluginDefinition$5<Contract extends ServicePluginContract$5> = {
90
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
91
91
  __type: 'service-plugin-definition';
92
92
  componentType: string;
93
- methods: ServicePluginMethodMetadata$5[];
93
+ methods: ServicePluginMethodMetadata[];
94
94
  __contract: Contract;
95
95
  };
96
- declare function ServicePluginDefinition$5<Contract extends ServicePluginContract$5>(componentType: string, methods: ServicePluginMethodMetadata$5[]): ServicePluginDefinition$5<Contract>;
97
- type BuildServicePluginDefinition$5<T extends ServicePluginDefinition$5<any>> = (implementation: T['__contract']) => void;
98
- declare const SERVICE_PLUGIN_ERROR_TYPE$5 = "wix_spi_error";
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$5 = {
100
+ type RequestContext = {
101
101
  isSSR: boolean;
102
102
  host: string;
103
103
  protocol?: string;
104
104
  };
105
- type ResponseTransformer$5 = (data: any, headers?: any) => any;
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$5 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
112
- type AmbassadorRequestOptions$5<T = any> = {
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$5;
115
+ method?: Method;
116
116
  params?: any;
117
117
  data?: any;
118
- transformResponse?: ResponseTransformer$5 | ResponseTransformer$5[];
118
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
119
119
  };
120
- type AmbassadorFactory$5<Request, Response> = (payload: Request) => ((context: RequestContext$5) => AmbassadorRequestOptions$5<Response>) & {
120
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
121
121
  __isAmbassador: boolean;
122
122
  };
123
- type AmbassadorFunctionDescriptor$5<Request = any, Response = any> = AmbassadorFactory$5<Request, Response>;
124
- type BuildAmbassadorFunction$5<T extends AmbassadorFunctionDescriptor$5> = T extends AmbassadorFunctionDescriptor$5<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
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$5: unique symbol;
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$5 = {[emptyObjectSymbol$5]?: never};
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$5<A, B> =
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$5<KeyType, ExcludeType> = IsEqual$5<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
222
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
223
 
224
- type ExceptOptions$5 = {
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$5<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$5 = {requireExactProps: false}> = {
269
- [KeyType in keyof ObjectType as Filter$5<KeyType, KeysType>]: ObjectType[KeyType];
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$5<Base, Condition> = NonNullable<
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$5<Base, Condition> = Except$5<
360
+ type ConditionalExcept<Base, Condition> = Except<
361
361
  Base,
362
- ConditionalKeys$5<Base, Condition>
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$5 = RESTFunctionDescriptor$5 | AmbassadorFunctionDescriptor$5 | HostModule$5<any, any> | EventDefinition$9<any> | ServicePluginDefinition$5<any> | {
371
- [key: string]: Descriptors$5 | PublicMetadata$5 | any;
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$5<T extends Descriptors$5, H extends Host$5<any> | undefined, Depth extends number = 5> = {
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$5;
383
- } ? never : T extends AmbassadorFunctionDescriptor$5 ? BuildAmbassadorFunction$5<T> : T extends RESTFunctionDescriptor$5 ? BuildRESTFunction$5<T> : T extends EventDefinition$9<any> ? BuildEventDefinition$9<T> : T extends ServicePluginDefinition$5<any> ? BuildServicePluginDefinition$5<T> : T extends HostModule$5<any, any> ? HostModuleAPI$5<T> : ConditionalExcept$5<{
384
- [Key in keyof T]: T[Key] extends Descriptors$5 ? BuildDescriptors$5<T[Key], H, [
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$5>;
393
+ }, EmptyObject>;
394
394
  }[Depth extends -1 ? 'done' : 'recurse'];
395
- type PublicMetadata$5 = {
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$5<T extends Descriptors$5> = globalThis.ContextualClient extends {
408
- host: Host$5;
409
- } ? BuildDescriptors$5<T, globalThis.ContextualClient['host']> : T;
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$5): GetBlogCacheSignature;
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$5<BuildRESTFunction$5<typeof getBlogCache$1> & typeof getBlogCache$1>;
1125
+ declare const getBlogCache: MaybeContext<BuildRESTFunction<typeof getBlogCache$1> & typeof getBlogCache$1>;
1126
1126
 
1127
1127
  type context$5_Address = Address;
1128
1128
  type context$5_AddressHint = AddressHint;
@@ -1169,1272 +1169,473 @@ declare namespace context$5 {
1169
1169
  export { type ActionEvent$4 as ActionEvent, type context$5_Address as Address, type context$5_AddressHint as AddressHint, type context$5_BlogCache as BlogCache, type context$5_BusinessSchedule as BusinessSchedule, type context$5_Categories as Categories, type context$5_ChangeContext as ChangeContext, type context$5_ChangeContextPayloadOneOf as ChangeContextPayloadOneOf, type context$5_ConsentPolicy as ConsentPolicy, context$5_DayOfWeek as DayOfWeek, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type context$5_Empty as Empty, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, context$5_Flag as Flag, type context$5_GeoCoordinates as GeoCoordinates, type context$5_GetBlogCacheRequest as GetBlogCacheRequest, type context$5_GetBlogCacheResponse as GetBlogCacheResponse, type context$5_GetBlogCacheResponseNonNullableFields as GetBlogCacheResponseNonNullableFields, type context$5_Locale as Locale, context$5_LocaleStatus as LocaleStatus, type context$5_Multilingual as Multilingual, type context$5_PageInfo as PageInfo, type context$5_PagesData as PagesData, context$5_PlacementType as PlacementType, type context$5_Properties as Properties, type context$5_PropertiesChange as PropertiesChange, context$5_ResolutionMethod as ResolutionMethod, type RestoreInfo$4 as RestoreInfo, type context$5_SiteCloned as SiteCloned, type context$5_SiteCreated as SiteCreated, type context$5_SiteProperties as SiteProperties, type context$5_SitePropertiesEvent as SitePropertiesEvent, type context$5_SitePropertiesNotification as SitePropertiesNotification, type context$5_SiteSupportedLanguage as SiteSupportedLanguage, type context$5_SpecialHourPeriod as SpecialHourPeriod, type context$5_SupportedLanguage as SupportedLanguage, type context$5_TimePeriod as TimePeriod, type context$5_Translation as Translation, type context$5_UrlInvalidationNotification as UrlInvalidationNotification, context$5_getBlogCache as getBlogCache };
1170
1170
  }
1171
1171
 
1172
- type HostModule$4<T, H extends Host$4> = {
1173
- __type: 'host';
1174
- create(host: H): T;
1175
- };
1176
- type HostModuleAPI$4<T extends HostModule$4<any, any>> = T extends HostModule$4<infer U, any> ? U : never;
1177
- type Host$4<Environment = unknown> = {
1178
- channel: {
1179
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
1180
- disconnect: () => void;
1181
- } | Promise<{
1182
- disconnect: () => void;
1183
- }>;
1184
- };
1185
- environment?: Environment;
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 ValidateUrlForImportRequest {
1204
+ /** Url for wordpress site. */
1205
+ url: string | null;
1206
+ }
1207
+ interface ValidateUrlForImportResponse {
1208
+ /** Blog type. */
1209
+ blogType?: string | null;
1210
+ /** Number of posts. */
1211
+ totalPosts?: number | null;
1212
+ /** Blog title. */
1213
+ blogTitle?: string | null;
1214
+ }
1215
+ interface GetImportStatusRequest {
1216
+ }
1217
+ interface GetImportStatusResponse {
1218
+ /** Details of import progress. */
1219
+ importStatus?: ImportStatus;
1220
+ }
1221
+ interface GetNotImportedPostsRequest {
1222
+ }
1223
+ interface GetNotImportedPostsResponse {
1224
+ /** Failed entities. */
1225
+ notImportedPosts?: Post$1[];
1226
+ }
1227
+ interface Post$1 {
1228
+ /** The id of the post. */
1229
+ _id?: string;
1230
+ /** Title of the post. */
1231
+ title?: string;
1232
+ /** Url to posts in wordpress. */
1233
+ url?: string;
1234
+ }
1235
+ interface ImportStatusNonNullableFields {
1236
+ _id: string;
1237
+ fileName: string;
1238
+ status: Status$2;
1239
+ importAmount: number;
1240
+ alreadyImportedAmount: number;
1241
+ processedAmount: number;
1242
+ }
1243
+ interface GetImportStatusResponseNonNullableFields {
1244
+ importStatus?: ImportStatusNonNullableFields;
1245
+ }
1246
+ interface PostNonNullableFields$1 {
1247
+ _id: string;
1248
+ title: string;
1249
+ url: string;
1250
+ }
1251
+ interface GetNotImportedPostsResponseNonNullableFields {
1252
+ notImportedPosts: PostNonNullableFields$1[];
1253
+ }
1254
+
1255
+ declare function startImport$1(httpClient: HttpClient): StartImportSignature;
1256
+ interface StartImportSignature {
1186
1257
  /**
1187
- * Optional bast url to use for API requests, for example `www.wixapis.com`
1258
+ * Starts wordpress import process.
1188
1259
  */
1189
- apiBaseUrl?: string;
1260
+ (): Promise<void>;
1261
+ }
1262
+ declare function submitUrlForImport$1(httpClient: HttpClient): SubmitUrlForImportSignature;
1263
+ interface SubmitUrlForImportSignature {
1190
1264
  /**
1191
- * Possible data to be provided by every host, for cross cutting concerns
1192
- * like internationalization, billing, etc.
1265
+ * Submits wordpress import process from URL.
1266
+ * It will prepare wordpress data for import from the given URL.
1267
+ * Use "GetImportStatus" to get the status of the import process.
1268
+ * Once the import status becomes READY_TO_IMPORT, the import process can be started by invoking "StartImport".
1269
+ * @param - Url to wordpress xml file.
1193
1270
  */
1194
- essentials?: {
1195
- /**
1196
- * The language of the currently viewed session
1197
- */
1198
- language?: string;
1199
- /**
1200
- * The locale of the currently viewed session
1201
- */
1202
- locale?: string;
1203
- /**
1204
- * Any headers that should be passed through to the API requests
1205
- */
1206
- passThroughHeaders?: Record<string, string>;
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;
1271
+ (url: string): Promise<void>;
1272
+ }
1273
+ declare function validateUrlForImport$1(httpClient: HttpClient): ValidateUrlForImportSignature;
1274
+ interface ValidateUrlForImportSignature {
1275
+ /** @param - Url for wordpress site. */
1276
+ (url: string | null): Promise<ValidateUrlForImportResponse>;
1277
+ }
1278
+ declare function getImportStatus$1(httpClient: HttpClient): GetImportStatusSignature;
1279
+ interface GetImportStatusSignature {
1280
+ /**
1281
+ * Gets the status of the import process.
1282
+ */
1283
+ (): Promise<GetImportStatusResponse & GetImportStatusResponseNonNullableFields>;
1284
+ }
1285
+ declare function getNotImportedPosts$1(httpClient: HttpClient): GetNotImportedPostsSignature;
1286
+ interface GetNotImportedPostsSignature {
1287
+ /**
1288
+ * Gets the posts that were not yet imported either because of an error or because import is still in progress.
1289
+ */
1290
+ (): Promise<GetNotImportedPostsResponse & GetNotImportedPostsResponseNonNullableFields>;
1216
1291
  }
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
1292
 
1271
- type RequestContext$4 = {
1272
- isSSR: boolean;
1273
- host: string;
1274
- protocol?: string;
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;
1293
+ declare const startImport: MaybeContext<BuildRESTFunction<typeof startImport$1> & typeof startImport$1>;
1294
+ declare const submitUrlForImport: MaybeContext<BuildRESTFunction<typeof submitUrlForImport$1> & typeof submitUrlForImport$1>;
1295
+ declare const validateUrlForImport: MaybeContext<BuildRESTFunction<typeof validateUrlForImport$1> & typeof validateUrlForImport$1>;
1296
+ declare const getImportStatus: MaybeContext<BuildRESTFunction<typeof getImportStatus$1> & typeof getImportStatus$1>;
1297
+ declare const getNotImportedPosts: MaybeContext<BuildRESTFunction<typeof getNotImportedPosts$1> & typeof getNotImportedPosts$1>;
1296
1298
 
1297
- declare global {
1298
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1299
- interface SymbolConstructor {
1300
- readonly observable: symbol;
1301
- }
1299
+ type context$4_GetImportStatusRequest = GetImportStatusRequest;
1300
+ type context$4_GetImportStatusResponse = GetImportStatusResponse;
1301
+ type context$4_GetImportStatusResponseNonNullableFields = GetImportStatusResponseNonNullableFields;
1302
+ type context$4_GetNotImportedPostsRequest = GetNotImportedPostsRequest;
1303
+ type context$4_GetNotImportedPostsResponse = GetNotImportedPostsResponse;
1304
+ type context$4_GetNotImportedPostsResponseNonNullableFields = GetNotImportedPostsResponseNonNullableFields;
1305
+ type context$4_ImportStatus = ImportStatus;
1306
+ type context$4_StartImportRequest = StartImportRequest;
1307
+ type context$4_StartImportResponse = StartImportResponse;
1308
+ type context$4_SubmitUrlForImportRequest = SubmitUrlForImportRequest;
1309
+ type context$4_SubmitUrlForImportResponse = SubmitUrlForImportResponse;
1310
+ type context$4_ValidateUrlForImportRequest = ValidateUrlForImportRequest;
1311
+ type context$4_ValidateUrlForImportResponse = ValidateUrlForImportResponse;
1312
+ declare const context$4_getImportStatus: typeof getImportStatus;
1313
+ declare const context$4_getNotImportedPosts: typeof getNotImportedPosts;
1314
+ declare const context$4_startImport: typeof startImport;
1315
+ declare const context$4_submitUrlForImport: typeof submitUrlForImport;
1316
+ declare const context$4_validateUrlForImport: typeof validateUrlForImport;
1317
+ declare namespace context$4 {
1318
+ export { type context$4_GetImportStatusRequest as GetImportStatusRequest, type context$4_GetImportStatusResponse as GetImportStatusResponse, type context$4_GetImportStatusResponseNonNullableFields as GetImportStatusResponseNonNullableFields, type context$4_GetNotImportedPostsRequest as GetNotImportedPostsRequest, type context$4_GetNotImportedPostsResponse as GetNotImportedPostsResponse, type context$4_GetNotImportedPostsResponseNonNullableFields as GetNotImportedPostsResponseNonNullableFields, type context$4_ImportStatus as ImportStatus, type Post$1 as Post, type context$4_StartImportRequest as StartImportRequest, type context$4_StartImportResponse as StartImportResponse, Status$2 as Status, type context$4_SubmitUrlForImportRequest as SubmitUrlForImportRequest, type context$4_SubmitUrlForImportResponse as SubmitUrlForImportResponse, type context$4_ValidateUrlForImportRequest as ValidateUrlForImportRequest, type context$4_ValidateUrlForImportResponse as ValidateUrlForImportResponse, context$4_getImportStatus as getImportStatus, context$4_getNotImportedPosts as getNotImportedPosts, context$4_startImport as startImport, context$4_submitUrlForImport as submitUrlForImport, context$4_validateUrlForImport as validateUrlForImport };
1302
1319
  }
1303
1320
 
1304
- declare const emptyObjectSymbol$4: unique symbol;
1305
-
1306
- /**
1307
- Represents a strictly empty plain object, the `{}` value.
1308
-
1309
- 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)).
1310
-
1311
- @example
1312
- ```
1313
- import type {EmptyObject} from 'type-fest';
1314
-
1315
- // The following illustrates the problem with `{}`.
1316
- const foo1: {} = {}; // Pass
1317
- const foo2: {} = []; // Pass
1318
- const foo3: {} = 42; // Pass
1319
- const foo4: {} = {a: 1}; // Pass
1320
-
1321
- // With `EmptyObject` only the first case is valid.
1322
- const bar1: EmptyObject = {}; // Pass
1323
- const bar2: EmptyObject = 42; // Fail
1324
- const bar3: EmptyObject = []; // Fail
1325
- const bar4: EmptyObject = {a: 1}; // Fail
1326
- ```
1327
-
1328
- 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}.
1329
-
1330
- @category Object
1331
- */
1332
- type EmptyObject$4 = {[emptyObjectSymbol$4]?: never};
1333
-
1334
- /**
1335
- Returns a boolean for whether the two given types are equal.
1336
-
1337
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
1338
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
1339
-
1340
- Use-cases:
1341
- - If you want to make a conditional branch based on the result of a comparison of two types.
1342
-
1343
- @example
1344
- ```
1345
- import type {IsEqual} from 'type-fest';
1346
-
1347
- // This type returns a boolean for whether the given array includes the given item.
1348
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
1349
- type Includes<Value extends readonly any[], Item> =
1350
- Value extends readonly [Value[0], ...infer rest]
1351
- ? IsEqual<Value[0], Item> extends true
1352
- ? true
1353
- : Includes<rest, Item>
1354
- : false;
1355
- ```
1356
-
1357
- @category Type Guard
1358
- @category Utilities
1359
- */
1360
- type IsEqual$4<A, B> =
1361
- (<G>() => G extends A ? 1 : 2) extends
1362
- (<G>() => G extends B ? 1 : 2)
1363
- ? true
1364
- : false;
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: {};
1321
+ interface Category$2 {
1322
+ /** Category ID. */
1323
+ _id?: string;
1324
+ /** Category label. Displayed in the Category Menu. */
1325
+ label?: string;
1326
+ /**
1327
+ * Number of posts in the category.
1328
+ * @readonly
1329
+ */
1330
+ postCount?: number;
1331
+ /**
1332
+ * Category URL.
1333
+ *
1334
+ *
1335
+ * The `url` directs you to a page that lists every post with the specified category.
1336
+ *
1337
+ * @readonly
1338
+ */
1339
+ url?: string;
1340
+ /** Category description. */
1341
+ description?: string | null;
1342
+ /** Category title. */
1343
+ title?: string;
1344
+ /**
1345
+ * Reserved for internal use.
1346
+ * @deprecated Category position in sequence.
1347
+ * @replacedBy display_position
1348
+ * @targetRemovalDate 2024-06-30
1349
+ */
1350
+ rank?: number | null;
1351
+ /** 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. */
1352
+ displayPosition?: number | null;
1353
+ /** 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`. */
1354
+ translationId?: string | null;
1355
+ /**
1356
+ * Category Language.
1357
+ *
1358
+ * 2-letter language code in [ISO 639-1 format](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
1359
+ */
1360
+ language?: string | null;
1361
+ /**
1362
+ * Part of a category's URL that refers to a specific category.
1363
+ *
1364
+ *
1365
+ * For example, `'https:/example.com/blog/category/{my-category-slug}'`.
1366
+ */
1367
+ slug?: string;
1368
+ /**
1369
+ * Reserved for internal use.
1370
+ * @readonly
1371
+ */
1372
+ internalId?: string | null;
1373
+ /** SEO data. */
1374
+ seoData?: SeoSchema$3;
1375
+ /** Category cover image. */
1376
+ coverImage?: string;
1377
+ /**
1378
+ * Date and time the Category was last updated.
1379
+ * @readonly
1380
+ */
1381
+ _updatedDate?: Date;
1459
1382
  }
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
1383
  /**
1494
- Exclude keys from a shape that matches the given `Condition`.
1495
-
1496
- 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.
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.
1384
+ * 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.
1385
+ * The search engines use this information for ranking purposes, or to display snippets in the search results.
1386
+ * 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
1387
  */
1578
- type MaybeContext$4<T extends Descriptors$4> = globalThis.ContextualClient extends {
1579
- host: Host$4;
1580
- } ? BuildDescriptors$4<T, globalThis.ContextualClient['host']> : T;
1581
-
1582
- interface ImportStatus {
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 {
1388
+ interface SeoSchema$3 {
1389
+ /** SEO tag information. */
1390
+ tags?: Tag$3[];
1391
+ /** SEO general settings. */
1392
+ settings?: Settings$3;
1614
1393
  }
1615
- interface GetImportStatusResponse {
1616
- /** Details of import progress. */
1617
- importStatus?: ImportStatus;
1394
+ interface Keyword$3 {
1395
+ /** Keyword value. */
1396
+ term?: string;
1397
+ /** Whether the keyword is the main focus keyword. */
1398
+ isMain?: boolean;
1399
+ /** Who added the keyword to the settings */
1400
+ origin?: string | null;
1618
1401
  }
1619
- interface GetNotImportedPostsRequest {
1402
+ interface Tag$3 {
1403
+ /**
1404
+ * SEO tag type.
1405
+ *
1406
+ *
1407
+ * Supported values: `title`, `meta`, `script`, `link`.
1408
+ */
1409
+ type?: string;
1410
+ /**
1411
+ * A `{'key':'value'}` pair object where each SEO tag property (`'name'`, `'content'`, `'rel'`, `'href'`) contains a value.
1412
+ * For example: `{'name': 'description', 'content': 'the description itself'}`.
1413
+ */
1414
+ props?: Record<string, any> | null;
1415
+ /** SEO tag meta data. For example, `{height: 300, width: 240}`. */
1416
+ meta?: Record<string, any> | null;
1417
+ /** SEO tag inner content. For example, `<title> inner content </title>`. */
1418
+ children?: string;
1419
+ /** Whether the tag is a custom tag. */
1420
+ custom?: boolean;
1421
+ /** Whether the tag is disabled. */
1422
+ disabled?: boolean;
1620
1423
  }
1621
- interface GetNotImportedPostsResponse {
1622
- /** Failed entities. */
1623
- notImportedPosts?: Post$1[];
1424
+ interface Settings$3 {
1425
+ /**
1426
+ * Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.
1427
+ *
1428
+ *
1429
+ * Default: `false` (Auto Redirect is enabled.)
1430
+ */
1431
+ preventAutoRedirect?: boolean;
1432
+ /** User-selected keyword terms for a specific page. */
1433
+ keywords?: Keyword$3[];
1624
1434
  }
1625
- interface Post$1 {
1626
- /** The id of the post. */
1435
+ interface CategoryTranslation$2 {
1436
+ /** Category ID */
1627
1437
  _id?: string;
1628
- /** Title of the post. */
1629
- title?: string;
1630
- /** Url to posts in wordpress. */
1438
+ /** Label which is presented in the categories menu on site */
1439
+ label?: string | null;
1440
+ /** Language of the category */
1441
+ language?: string | null;
1442
+ /** Url of this category page */
1631
1443
  url?: string;
1632
1444
  }
1633
- interface ImportStatusNonNullableFields {
1634
- _id: string;
1635
- fileName: string;
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[];
1445
+ interface InitialCategoriesCopied {
1446
+ /** Number of categories copied. */
1447
+ count?: number;
1651
1448
  }
1652
-
1653
- declare function startImport$1(httpClient: HttpClient$4): StartImportSignature;
1654
- interface StartImportSignature {
1449
+ interface CreateCategoryRequest {
1450
+ /** Category info. */
1451
+ category?: Category$2;
1655
1452
  /**
1656
- * Starts wordpress import process.
1453
+ * List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
1454
+ * the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
1455
+ * only the category’s base fields are returned.
1657
1456
  */
1658
- (): Promise<void>;
1457
+ fieldsets?: Field$3[];
1659
1458
  }
1660
- declare function submitUrlForImport$1(httpClient: HttpClient$4): SubmitUrlForImportSignature;
1661
- interface SubmitUrlForImportSignature {
1459
+ declare enum Field$3 {
1460
+ UNKNOWN = "UNKNOWN",
1461
+ /** Includes Category url. */
1462
+ URL = "URL",
1662
1463
  /**
1663
- * Submits wordpress import process from URL.
1664
- * It will prepare wordpress data for import from the given URL.
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.
1464
+ * Includes internal id field.
1465
+ * Reserved for internal use
1668
1466
  */
1669
- (url: string): Promise<void>;
1467
+ INTERNAL_ID = "INTERNAL_ID",
1468
+ /** Includes SEO data. */
1469
+ SEO = "SEO",
1470
+ /** Includes translations. */
1471
+ TRANSLATIONS = "TRANSLATIONS"
1670
1472
  }
1671
- declare function getImportStatus$1(httpClient: HttpClient$4): GetImportStatusSignature;
1672
- interface GetImportStatusSignature {
1673
- /**
1674
- * Gets the status of the import process.
1675
- */
1676
- (): Promise<GetImportStatusResponse & GetImportStatusResponseNonNullableFields>;
1473
+ interface CreateCategoryResponse {
1474
+ /** Category info. */
1475
+ category?: Category$2;
1677
1476
  }
1678
- declare function getNotImportedPosts$1(httpClient: HttpClient$4): GetNotImportedPostsSignature;
1679
- interface GetNotImportedPostsSignature {
1477
+ interface BulkCreateCategoriesRequest {
1478
+ /** Categories to create. */
1479
+ categories?: Category$2[];
1480
+ /** Whether to return the full created category entities in the response. */
1481
+ returnFullEntity?: boolean;
1680
1482
  /**
1681
- * Gets the posts that were not yet imported either because of an error or because import is still in progress.
1483
+ * List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
1484
+ * the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
1485
+ * only the category’s base fields are returned.
1682
1486
  */
1683
- (): Promise<GetNotImportedPostsResponse & GetNotImportedPostsResponseNonNullableFields>;
1487
+ fieldsets?: Field$3[];
1684
1488
  }
1685
-
1686
- declare const startImport: MaybeContext$4<BuildRESTFunction$4<typeof startImport$1> & typeof startImport$1>;
1687
- declare const submitUrlForImport: MaybeContext$4<BuildRESTFunction$4<typeof submitUrlForImport$1> & typeof submitUrlForImport$1>;
1688
- declare const getImportStatus: MaybeContext$4<BuildRESTFunction$4<typeof getImportStatus$1> & typeof getImportStatus$1>;
1689
- declare const getNotImportedPosts: MaybeContext$4<BuildRESTFunction$4<typeof getNotImportedPosts$1> & typeof getNotImportedPosts$1>;
1690
-
1691
- type context$4_GetImportStatusRequest = GetImportStatusRequest;
1692
- type context$4_GetImportStatusResponse = GetImportStatusResponse;
1693
- type context$4_GetImportStatusResponseNonNullableFields = GetImportStatusResponseNonNullableFields;
1694
- type context$4_GetNotImportedPostsRequest = GetNotImportedPostsRequest;
1695
- type context$4_GetNotImportedPostsResponse = GetNotImportedPostsResponse;
1696
- type context$4_GetNotImportedPostsResponseNonNullableFields = GetNotImportedPostsResponseNonNullableFields;
1697
- type context$4_ImportStatus = ImportStatus;
1698
- type context$4_StartImportRequest = StartImportRequest;
1699
- type context$4_StartImportResponse = StartImportResponse;
1700
- type context$4_SubmitUrlForImportRequest = SubmitUrlForImportRequest;
1701
- type context$4_SubmitUrlForImportResponse = SubmitUrlForImportResponse;
1702
- declare const context$4_getImportStatus: typeof getImportStatus;
1703
- declare const context$4_getNotImportedPosts: typeof getNotImportedPosts;
1704
- declare const context$4_startImport: typeof startImport;
1705
- declare const context$4_submitUrlForImport: typeof submitUrlForImport;
1706
- declare namespace context$4 {
1707
- export { type context$4_GetImportStatusRequest as GetImportStatusRequest, type context$4_GetImportStatusResponse as GetImportStatusResponse, type context$4_GetImportStatusResponseNonNullableFields as GetImportStatusResponseNonNullableFields, type context$4_GetNotImportedPostsRequest as GetNotImportedPostsRequest, type context$4_GetNotImportedPostsResponse as GetNotImportedPostsResponse, type context$4_GetNotImportedPostsResponseNonNullableFields as GetNotImportedPostsResponseNonNullableFields, type context$4_ImportStatus as ImportStatus, type Post$1 as Post, type context$4_StartImportRequest as StartImportRequest, type context$4_StartImportResponse as StartImportResponse, Status$2 as Status, type context$4_SubmitUrlForImportRequest as SubmitUrlForImportRequest, type context$4_SubmitUrlForImportResponse as SubmitUrlForImportResponse, context$4_getImportStatus as getImportStatus, context$4_getNotImportedPosts as getNotImportedPosts, context$4_startImport as startImport, context$4_submitUrlForImport as submitUrlForImport };
1489
+ interface BulkCreateCategoriesResponse {
1490
+ /** Categories created by bulk action. */
1491
+ results?: BulkCategoryResult[];
1492
+ /** Bulk action metadata. */
1493
+ bulkActionMetadata?: BulkActionMetadata$2;
1708
1494
  }
1709
-
1710
- type HostModule$3<T, H extends Host$3> = {
1711
- __type: 'host';
1712
- create(host: H): T;
1713
- };
1714
- type HostModuleAPI$3<T extends HostModule$3<any, any>> = T extends HostModule$3<infer U, any> ? U : never;
1715
- type Host$3<Environment = unknown> = {
1716
- channel: {
1717
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
1718
- disconnect: () => void;
1719
- } | Promise<{
1720
- disconnect: () => void;
1721
- }>;
1722
- };
1723
- environment?: Environment;
1495
+ interface BulkCategoryResult {
1496
+ /** Bulk actions metadata for category. */
1497
+ itemMetadata?: ItemMetadata$2;
1498
+ /** Optional created category. */
1499
+ item?: Category$2;
1500
+ }
1501
+ interface ItemMetadata$2 {
1502
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1503
+ _id?: string | null;
1504
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1505
+ originalIndex?: number;
1506
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1507
+ success?: boolean;
1508
+ /** Details about the error in case of failure. */
1509
+ error?: ApplicationError$2;
1510
+ }
1511
+ interface ApplicationError$2 {
1512
+ /** Error code. */
1513
+ code?: string;
1514
+ /** Description of the error. */
1515
+ description?: string;
1516
+ /** Data related to the error. */
1517
+ data?: Record<string, any> | null;
1518
+ }
1519
+ interface BulkActionMetadata$2 {
1520
+ /** Number of items that were successfully processed. */
1521
+ totalSuccesses?: number;
1522
+ /** Number of items that couldn't be processed. */
1523
+ totalFailures?: number;
1524
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1525
+ undetailedFailures?: number;
1526
+ }
1527
+ interface BulkUpdateCategoriesRequest {
1528
+ /** Categories to update. */
1529
+ categories?: MaskedCategory[];
1530
+ /** Whether to return the full created category entities in the response. */
1531
+ returnFullEntity?: boolean;
1724
1532
  /**
1725
- * Optional bast url to use for API requests, for example `www.wixapis.com`
1533
+ * List of category fields to be included in the response if the entities are present.
1534
+ * Base default fieldset returns all core category properties (all properties that are not a supported fieldset value).
1535
+ * For example, when `URL` fieldset is selected, returned category will include the set of base properties and the category's preview url.
1726
1536
  */
1727
- apiBaseUrl?: string;
1537
+ fieldsets?: Field$3[];
1538
+ }
1539
+ interface MaskedCategory {
1540
+ /** Category */
1541
+ category?: Category$2;
1542
+ }
1543
+ interface BulkUpdateCategoriesResponse {
1544
+ /** Categories updated by bulk action. */
1545
+ results?: BulkCategoryResult[];
1546
+ /** Bulk action metadata. */
1547
+ bulkActionMetadata?: BulkActionMetadata$2;
1548
+ }
1549
+ interface UpdateCategoryRequest {
1550
+ /** Category info. */
1551
+ category?: Category$2;
1728
1552
  /**
1729
- * Possible data to be provided by every host, for cross cutting concerns
1730
- * like internationalization, billing, etc.
1553
+ * List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
1554
+ * the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
1555
+ * only the category’s base fields are returned.
1731
1556
  */
1732
- essentials?: {
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;
1557
+ fieldsets?: Field$3[];
1754
1558
  }
1755
- type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
1756
- type HttpResponse$3<T = any> = {
1757
- data: T;
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
- }
1559
+ interface UpdateCategoryResponse {
1560
+ /** Category info. */
1561
+ category?: Category$2;
1840
1562
  }
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() {}
1563
+ interface GetCategoriesCountByLanguageRequest {
2046
1564
  }
2047
-
2048
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
2049
- //=> {run: () => void}
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: {};
1565
+ interface GetCategoriesCountByLanguageResponse {
1566
+ /** The language and it's count. */
1567
+ categoriesLanguageCount?: CategoryLanguageCount[];
2061
1568
  }
2062
-
2063
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
2064
- //=> {b: string | number; c: () => void; d: {}}
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
- }
1569
+ interface CategoryLanguageCount {
1570
+ /** 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. */
1571
+ languageCode?: string | null;
1572
+ /** The count of Categories for the language. */
1573
+ categoryCount?: number | null;
2111
1574
  }
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 {
1575
+ interface GetCategoryRequest {
2121
1576
  /** Category ID. */
2122
- _id?: string;
2123
- /** Category label. Displayed in the Category Menu. */
2124
- label?: string;
1577
+ categoryId: string;
2125
1578
  /**
2126
- * Number of posts in the category.
2127
- * @readonly
1579
+ * List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
1580
+ * the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
1581
+ * only the category’s base fields are returned.
2128
1582
  */
2129
- postCount?: number;
1583
+ fieldsets?: Field$3[];
1584
+ }
1585
+ interface GetCategoryResponse {
1586
+ /** Category info. */
1587
+ category?: Category$2;
1588
+ }
1589
+ interface GetCategoryBySlugRequest {
1590
+ /** Slug of the category to retrieve. */
1591
+ slug: string;
2130
1592
  /**
2131
- * Category URL.
2132
- *
2133
- *
2134
- * The `url` directs you to a page that lists every post with the specified category.
2135
- *
2136
- * @readonly
1593
+ * List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
1594
+ * the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
1595
+ * only the category’s base fields are returned.
2137
1596
  */
2138
- url?: string;
2139
- /** Category description. */
2140
- description?: string | null;
2141
- /** Category title. */
2142
- title?: string;
1597
+ fieldsets?: Field$3[];
2143
1598
  /**
2144
- * Reserved for internal use.
2145
- * @deprecated Category position in sequence.
2146
- * @replacedBy display_position
2147
- * @targetRemovalDate 2024-06-30
1599
+ * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
1600
+ * Language of the category to retrieve.
2148
1601
  */
2149
- rank?: number | null;
2150
- /** 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. */
2151
- displayPosition?: number | null;
2152
- /** 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`. */
2153
- translationId?: string | null;
1602
+ language?: string | null;
1603
+ }
1604
+ interface GetCategoryBySlugResponse {
1605
+ /** Category info. */
1606
+ category?: Category$2;
1607
+ }
1608
+ interface ListCategoriesRequest {
1609
+ /** Pagination options. */
1610
+ paging?: BlogPaging$2;
2154
1611
  /**
2155
- * Category Language.
1612
+ * List of additional category fields to include in the response. For example, use the `URL` fieldset to retrieve the url field in
1613
+ * the response in addition to the category’s base fields. Base fields don’t include any of the supported fieldset values. By default
1614
+ * only the category’s base fields are returned.
1615
+ */
1616
+ fieldsets?: Field$3[];
1617
+ /**
1618
+ * Language filter.
2156
1619
  *
2157
- * 2-letter language code in [ISO 639-1 format](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
1620
+ * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
1621
+ * Pass a language to only receive categories that are in that language.
1622
+ * If omitted, categories in all languages are returned.
2158
1623
  */
2159
1624
  language?: string | null;
1625
+ }
1626
+ interface BlogPaging$2 {
1627
+ /** Number of categories to skip in the list. */
1628
+ offset?: number;
2160
1629
  /**
2161
- * Part of a category's URL that refers to a specific category.
1630
+ * Number of items to return.
2162
1631
  *
1632
+ * Default: `50`
2163
1633
  *
2164
- * For example, `'https:/example.com/blog/category/{my-category-slug}'`.
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
1634
+ * Max: `100`
2179
1635
  */
2180
- _updatedDate?: Date;
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;
1636
+ limit?: number;
1637
+ /** Pointer to the next or previous page in the list of results. */
1638
+ cursor?: string | null;
2438
1639
  }
2439
1640
  interface ListCategoriesResponse {
2440
1641
  /** List of categories. */
@@ -2865,7 +2066,7 @@ interface CategoriesQueryBuilder {
2865
2066
  find: () => Promise<CategoriesQueryResult>;
2866
2067
  }
2867
2068
 
2868
- declare function getCategory$1(httpClient: HttpClient$3): GetCategorySignature;
2069
+ declare function getCategory$1(httpClient: HttpClient): GetCategorySignature;
2869
2070
  interface GetCategorySignature {
2870
2071
  /**
2871
2072
  * Gets a category by the specified ID.
@@ -2878,7 +2079,7 @@ interface GetCategorySignature {
2878
2079
  */
2879
2080
  (categoryId: string, options?: GetCategoryOptions | undefined): Promise<GetCategoryResponse & GetCategoryResponseNonNullableFields>;
2880
2081
  }
2881
- declare function getCategoryBySlug$1(httpClient: HttpClient$3): GetCategoryBySlugSignature;
2082
+ declare function getCategoryBySlug$1(httpClient: HttpClient): GetCategoryBySlugSignature;
2882
2083
  interface GetCategoryBySlugSignature {
2883
2084
  /**
2884
2085
  * Gets a category by the specified slug.
@@ -2895,7 +2096,7 @@ interface GetCategoryBySlugSignature {
2895
2096
  */
2896
2097
  (slug: string, options?: GetCategoryBySlugOptions | undefined): Promise<GetCategoryBySlugResponse & GetCategoryBySlugResponseNonNullableFields>;
2897
2098
  }
2898
- declare function listCategories$1(httpClient: HttpClient$3): ListCategoriesSignature;
2099
+ declare function listCategories$1(httpClient: HttpClient): ListCategoriesSignature;
2899
2100
  interface ListCategoriesSignature {
2900
2101
  /**
2901
2102
  * Retrieves a list of categories.
@@ -2906,7 +2107,7 @@ interface ListCategoriesSignature {
2906
2107
  */
2907
2108
  (options?: ListCategoriesOptions | undefined): Promise<ListCategoriesResponse & ListCategoriesResponseNonNullableFields>;
2908
2109
  }
2909
- declare function queryCategories$1(httpClient: HttpClient$3): QueryCategoriesSignature;
2110
+ declare function queryCategories$1(httpClient: HttpClient): QueryCategoriesSignature;
2910
2111
  interface QueryCategoriesSignature {
2911
2112
  /**
2912
2113
  * Creates a query to retrieve a list of categories.
@@ -2927,20 +2128,20 @@ interface QueryCategoriesSignature {
2927
2128
  */
2928
2129
  (options?: QueryCategoriesOptions | undefined): CategoriesQueryBuilder;
2929
2130
  }
2930
- declare const onCategoryCreated$1: EventDefinition$7<CategoryCreatedEnvelope, "wix.blog.v3.category_created">;
2931
- declare const onCategoryUpdated$1: EventDefinition$7<CategoryUpdatedEnvelope, "wix.blog.v3.category_updated">;
2932
- declare const onCategoryDeleted$1: EventDefinition$7<CategoryDeletedEnvelope, "wix.blog.v3.category_deleted">;
2131
+ declare const onCategoryCreated$1: EventDefinition$4<CategoryCreatedEnvelope, "wix.blog.v3.category_created">;
2132
+ declare const onCategoryUpdated$1: EventDefinition$4<CategoryUpdatedEnvelope, "wix.blog.v3.category_updated">;
2133
+ declare const onCategoryDeleted$1: EventDefinition$4<CategoryDeletedEnvelope, "wix.blog.v3.category_deleted">;
2933
2134
 
2934
- type EventDefinition$6<Payload = unknown, Type extends string = string> = {
2135
+ type EventDefinition$3<Payload = unknown, Type extends string = string> = {
2935
2136
  __type: 'event-definition';
2936
2137
  type: Type;
2937
2138
  isDomainEvent?: boolean;
2938
2139
  transformations?: (envelope: unknown) => Payload;
2939
2140
  __payload: Payload;
2940
2141
  };
2941
- declare function EventDefinition$6<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$6<Payload, Type>;
2942
- type EventHandler$6<T extends EventDefinition$6> = (payload: T['__payload']) => void | Promise<void>;
2943
- type BuildEventDefinition$6<T extends EventDefinition$6<any, string>> = (handler: EventHandler$6<T>) => void;
2142
+ declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
2143
+ type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
2144
+ type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
2944
2145
 
2945
2146
  declare global {
2946
2147
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -2949,12 +2150,12 @@ declare global {
2949
2150
  }
2950
2151
  }
2951
2152
 
2952
- declare function createEventModule$3<T extends EventDefinition$6<any, string>>(eventDefinition: T): BuildEventDefinition$6<T> & T;
2153
+ declare function createEventModule$3<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
2953
2154
 
2954
- declare const getCategory: MaybeContext$3<BuildRESTFunction$3<typeof getCategory$1> & typeof getCategory$1>;
2955
- declare const getCategoryBySlug: MaybeContext$3<BuildRESTFunction$3<typeof getCategoryBySlug$1> & typeof getCategoryBySlug$1>;
2956
- declare const listCategories: MaybeContext$3<BuildRESTFunction$3<typeof listCategories$1> & typeof listCategories$1>;
2957
- declare const queryCategories: MaybeContext$3<BuildRESTFunction$3<typeof queryCategories$1> & typeof queryCategories$1>;
2155
+ declare const getCategory: MaybeContext<BuildRESTFunction<typeof getCategory$1> & typeof getCategory$1>;
2156
+ declare const getCategoryBySlug: MaybeContext<BuildRESTFunction<typeof getCategoryBySlug$1> & typeof getCategoryBySlug$1>;
2157
+ declare const listCategories: MaybeContext<BuildRESTFunction<typeof listCategories$1> & typeof listCategories$1>;
2158
+ declare const queryCategories: MaybeContext<BuildRESTFunction<typeof queryCategories$1> & typeof queryCategories$1>;
2958
2159
 
2959
2160
  type _publicOnCategoryCreatedType = typeof onCategoryCreated$1;
2960
2161
  /**
@@ -3027,561 +2228,151 @@ declare namespace context$3 {
3027
2228
  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 context$3_BulkCategoryResult as BulkCategoryResult, type context$3_BulkCreateCategoriesRequest as BulkCreateCategoriesRequest, type context$3_BulkCreateCategoriesResponse as BulkCreateCategoriesResponse, type context$3_BulkDeleteCategoryRequest as BulkDeleteCategoryRequest, type context$3_BulkDeleteCategoryResponse as BulkDeleteCategoryResponse, type context$3_BulkUpdateCategoriesRequest as BulkUpdateCategoriesRequest, type context$3_BulkUpdateCategoriesResponse as BulkUpdateCategoriesResponse, type context$3_CategoriesQueryBuilder as CategoriesQueryBuilder, type context$3_CategoriesQueryResult as CategoriesQueryResult, type Category$2 as Category, type context$3_CategoryCreatedEnvelope as CategoryCreatedEnvelope, type context$3_CategoryDeletedEnvelope as CategoryDeletedEnvelope, type context$3_CategoryLanguageCount as CategoryLanguageCount, type CategoryTranslation$2 as CategoryTranslation, type context$3_CategoryUpdatedEnvelope as CategoryUpdatedEnvelope, type context$3_CreateCategoryRequest as CreateCategoryRequest, type context$3_CreateCategoryResponse as CreateCategoryResponse, type CursorPaging$3 as CursorPaging, type Cursors$3 as Cursors, type context$3_DeleteCategoryRequest as DeleteCategoryRequest, type context$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 context$3_GetCategoriesCountByLanguageRequest as GetCategoriesCountByLanguageRequest, type context$3_GetCategoriesCountByLanguageResponse as GetCategoriesCountByLanguageResponse, type context$3_GetCategoryBySlugOptions as GetCategoryBySlugOptions, type context$3_GetCategoryBySlugRequest as GetCategoryBySlugRequest, type context$3_GetCategoryBySlugResponse as GetCategoryBySlugResponse, type context$3_GetCategoryBySlugResponseNonNullableFields as GetCategoryBySlugResponseNonNullableFields, type context$3_GetCategoryOptions as GetCategoryOptions, type context$3_GetCategoryRequest as GetCategoryRequest, type context$3_GetCategoryResponse as GetCategoryResponse, type context$3_GetCategoryResponseNonNullableFields as GetCategoryResponseNonNullableFields, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type context$3_InitialCategoriesCopied as InitialCategoriesCopied, type ItemMetadata$2 as ItemMetadata, type Keyword$3 as Keyword, type context$3_ListCategoriesOptions as ListCategoriesOptions, type context$3_ListCategoriesRequest as ListCategoriesRequest, type context$3_ListCategoriesResponse as ListCategoriesResponse, type context$3_ListCategoriesResponseNonNullableFields as ListCategoriesResponseNonNullableFields, type context$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 context$3_QueryCategoriesOptions as QueryCategoriesOptions, type context$3_QueryCategoriesRequest as QueryCategoriesRequest, type context$3_QueryCategoriesResponse as QueryCategoriesResponse, type context$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 context$3_UpdateCategoryRequest as UpdateCategoryRequest, type context$3_UpdateCategoryResponse as UpdateCategoryResponse, WebhookIdentityType$3 as WebhookIdentityType, type context$3__publicOnCategoryCreatedType as _publicOnCategoryCreatedType, type context$3__publicOnCategoryDeletedType as _publicOnCategoryDeletedType, type context$3__publicOnCategoryUpdatedType as _publicOnCategoryUpdatedType, context$3_getCategory as getCategory, context$3_getCategoryBySlug as getCategoryBySlug, context$3_listCategories as listCategories, context$3_onCategoryCreated as onCategoryCreated, context$3_onCategoryDeleted as onCategoryDeleted, context$3_onCategoryUpdated as onCategoryUpdated, onCategoryCreated$1 as publicOnCategoryCreated, onCategoryDeleted$1 as publicOnCategoryDeleted, onCategoryUpdated$1 as publicOnCategoryUpdated, context$3_queryCategories as queryCategories };
3028
2229
  }
3029
2230
 
3030
- type HostModule$2<T, H extends Host$2> = {
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;
2231
+ interface DraftPost$1 {
3044
2232
  /**
3045
- * Optional bast url to use for API requests, for example `www.wixapis.com`
2233
+ * Draft post ID.
2234
+ * @readonly
3046
2235
  */
3047
- apiBaseUrl?: string;
2236
+ _id?: string;
2237
+ /** Draft post title. */
2238
+ title?: string;
3048
2239
  /**
3049
- * Possible data to be provided by every host, for cross cutting concerns
3050
- * like internationalization, billing, etc.
2240
+ * Draft post excerpt.
2241
+ *
2242
+ * If no excerpt has been manually set, an excerpt is automatically generated from the post's text.
2243
+ * This can be retrieved using the `GENERATED_EXCERPT` fieldset.
2244
+ */
2245
+ excerpt?: string | null;
2246
+ /** Whether the draft post is marked as featured. */
2247
+ featured?: boolean | null;
2248
+ /** Category IDs of the draft post. */
2249
+ categoryIds?: string[];
2250
+ /** Draft post owner's member ID. */
2251
+ memberId?: string | null;
2252
+ /** Hashtags in the draft post. */
2253
+ hashtags?: string[];
2254
+ /** Whether commenting on the draft post is enabled. */
2255
+ commentingEnabled?: boolean | null;
2256
+ /**
2257
+ * Estimated reading time of the draft post (calculated automatically).
2258
+ * @readonly
2259
+ */
2260
+ minutesToRead?: number;
2261
+ /** Image placed at the top of the blog page. */
2262
+ heroImage?: string;
2263
+ /** Tag IDs the draft post is tagged with. */
2264
+ tagIds?: string[];
2265
+ /** IDs of posts related to this draft post. */
2266
+ relatedPostIds?: string[];
2267
+ /** Pricing plan IDs. Only relevant if a post is assigned to a specific pricing plan. */
2268
+ pricingPlanIds?: string[];
2269
+ /**
2270
+ * ID of the draft post's translations.
2271
+ *
2272
+ * All translations of a single post share the same `translationId`.
2273
+ * Available only if the [Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) app is installed.
2274
+ */
2275
+ translationId?: string | null;
2276
+ /**
2277
+ * Language the draft post is written in.
2278
+ *
2279
+ * 2-or-4-letter language code in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2280
+ */
2281
+ language?: string | null;
2282
+ /**
2283
+ * Reserved for internal use.
2284
+ * @readonly
2285
+ */
2286
+ changeOrigin?: Origin$1;
2287
+ /**
2288
+ * Reserved for internal use.
2289
+ * @readonly
2290
+ */
2291
+ contentId?: string | null;
2292
+ /** Reserved for internal use. */
2293
+ editingSessionId?: string | null;
2294
+ /** Draft post rich content. */
2295
+ richContent?: RichContent$1;
2296
+ /**
2297
+ * Status of the draft post.
2298
+ * @readonly
2299
+ */
2300
+ status?: Status$1;
2301
+ /** Details of the draft post in review. Only relevant to posts submitted by guest writers. */
2302
+ moderationDetails?: ModerationDetails$1;
2303
+ /**
2304
+ * Reserved for internal use.
2305
+ * @readonly
2306
+ */
2307
+ mostRecentContributorId?: string | null;
2308
+ /**
2309
+ * Indicates if there are changes made to the draft post that have not yet been published.
2310
+ * @readonly
2311
+ */
2312
+ hasUnpublishedChanges?: boolean;
2313
+ /**
2314
+ * Date the draft post was last edited.
2315
+ * @readonly
2316
+ */
2317
+ editedDate?: Date;
2318
+ /**
2319
+ * Date the draft post is scheduled to be published.
2320
+ * @readonly
2321
+ */
2322
+ scheduledPublishDate?: Date;
2323
+ /** Reserved for internal use. */
2324
+ content?: Record<string, any> | null;
2325
+ /** Date the post was first published. */
2326
+ firstPublishedDate?: Date;
2327
+ /** SEO data. */
2328
+ seoData?: SeoSchema$2;
2329
+ /**
2330
+ * @internal Deprecated.
2331
+ * @internal Deprecated.
2332
+ * @deprecated
2333
+ * @replacedBy preview_text_paragraph
2334
+ * @targetRemovalDate 2024-06-30
2335
+ */
2336
+ paidContentParagraph?: number | null;
2337
+ /**
2338
+ * Reserved for internal use.
2339
+ * @readonly
2340
+ */
2341
+ slugs?: string[];
2342
+ /**
2343
+ * Draft post URL preview. What the URL will look like once the post is published.
2344
+ * @readonly
3051
2345
  */
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
2346
  url?: string;
3144
- method?: Method$2;
3145
- params?: any;
3146
- data?: any;
3147
- transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
3148
- };
3149
- type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
3150
- __isAmbassador: boolean;
3151
- };
3152
- type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
3153
- type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
3154
-
3155
- declare global {
3156
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3157
- interface SymbolConstructor {
3158
- readonly observable: symbol;
3159
- }
2347
+ /**
2348
+ * Date the draft post was first created.
2349
+ * @readonly
2350
+ */
2351
+ _createdDate?: Date;
2352
+ /** SEO slug. */
2353
+ seoSlug?: string | null;
2354
+ /** Post cover media. */
2355
+ media?: Media$1;
2356
+ /** Number of paragraphs to display in a paid content preview for non-paying users. */
2357
+ previewTextParagraph?: number | null;
2358
+ /**
2359
+ * Reserved for internal use.
2360
+ * @readonly
2361
+ */
2362
+ internalId?: string | null;
3160
2363
  }
3161
-
3162
- declare const emptyObjectSymbol$2: unique symbol;
3163
-
3164
- /**
3165
- Represents a strictly empty plain object, the `{}` value.
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;
2364
+ interface CoverMedia$1 extends CoverMediaMediaOneOf$1 {
2365
+ /** Image url. */
2366
+ image?: string;
2367
+ /** Video url. */
2368
+ video?: string;
3465
2369
  /**
3466
- * Estimated reading time of the draft post (calculated automatically).
3467
- * @readonly
3468
- */
3469
- minutesToRead?: number;
3470
- /** Image placed at the top of the blog page. */
3471
- heroImage?: string;
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
2370
+ * Is cover media enabled.
2371
+ * Selected by user whether to display cover media on the feed
2372
+ * @deprecated Is cover media enabled.
2373
+ * Selected by user whether to display cover media on the feed
2374
+ * @replacedBy displayed
2375
+ * @targetRemovalDate 2024-06-30
3585
2376
  */
3586
2377
  enabled?: boolean;
3587
2378
  /** Whether cover media is displayed. */
@@ -6754,7 +5545,7 @@ interface DraftPostsQueryBuilder {
6754
5545
  find: () => Promise<DraftPostsQueryResult>;
6755
5546
  }
6756
5547
 
6757
- declare function createDraftPost$1(httpClient: HttpClient$2): CreateDraftPostSignature;
5548
+ declare function createDraftPost$1(httpClient: HttpClient): CreateDraftPostSignature;
6758
5549
  interface CreateDraftPostSignature {
6759
5550
  /**
6760
5551
  * Creates a draft post.
@@ -6765,7 +5556,7 @@ interface CreateDraftPostSignature {
6765
5556
  */
6766
5557
  (draftPost: DraftPost$1, options?: CreateDraftPostOptions | undefined): Promise<CreateDraftPostResponse & CreateDraftPostResponseNonNullableFields>;
6767
5558
  }
6768
- declare function bulkCreateDraftPosts$1(httpClient: HttpClient$2): BulkCreateDraftPostsSignature;
5559
+ declare function bulkCreateDraftPosts$1(httpClient: HttpClient): BulkCreateDraftPostsSignature;
6769
5560
  interface BulkCreateDraftPostsSignature {
6770
5561
  /**
6771
5562
  * Creates multiple draft posts.
@@ -6774,7 +5565,7 @@ interface BulkCreateDraftPostsSignature {
6774
5565
  */
6775
5566
  (draftPosts: DraftPost$1[], options?: BulkCreateDraftPostsOptions | undefined): Promise<BulkCreateDraftPostsResponse & BulkCreateDraftPostsResponseNonNullableFields>;
6776
5567
  }
6777
- declare function bulkUpdateDraftPosts$1(httpClient: HttpClient$2): BulkUpdateDraftPostsSignature;
5568
+ declare function bulkUpdateDraftPosts$1(httpClient: HttpClient): BulkUpdateDraftPostsSignature;
6778
5569
  interface BulkUpdateDraftPostsSignature {
6779
5570
  /**
6780
5571
  * Updates multiple draft posts.
@@ -6782,7 +5573,7 @@ interface BulkUpdateDraftPostsSignature {
6782
5573
  */
6783
5574
  (options?: BulkUpdateDraftPostsOptions | undefined): Promise<BulkUpdateDraftPostsResponse & BulkUpdateDraftPostsResponseNonNullableFields>;
6784
5575
  }
6785
- declare function listDeletedDraftPosts$1(httpClient: HttpClient$2): ListDeletedDraftPostsSignature;
5576
+ declare function listDeletedDraftPosts$1(httpClient: HttpClient): ListDeletedDraftPostsSignature;
6786
5577
  interface ListDeletedDraftPostsSignature {
6787
5578
  /**
6788
5579
  * Retrieves a list of up to 100 deleted draft posts.
@@ -6795,7 +5586,7 @@ interface ListDeletedDraftPostsSignature {
6795
5586
  */
6796
5587
  (options?: ListDeletedDraftPostsOptions | undefined): Promise<ListDeletedDraftPostsResponse & ListDeletedDraftPostsResponseNonNullableFields>;
6797
5588
  }
6798
- declare function getDraftPost$1(httpClient: HttpClient$2): GetDraftPostSignature;
5589
+ declare function getDraftPost$1(httpClient: HttpClient): GetDraftPostSignature;
6799
5590
  interface GetDraftPostSignature {
6800
5591
  /**
6801
5592
  * Gets a draft post by the provided ID.
@@ -6806,7 +5597,7 @@ interface GetDraftPostSignature {
6806
5597
  */
6807
5598
  (draftPostId: string, options?: GetDraftPostOptions | undefined): Promise<GetDraftPostResponse & GetDraftPostResponseNonNullableFields>;
6808
5599
  }
6809
- declare function updateDraftPost$1(httpClient: HttpClient$2): UpdateDraftPostSignature;
5600
+ declare function updateDraftPost$1(httpClient: HttpClient): UpdateDraftPostSignature;
6810
5601
  interface UpdateDraftPostSignature {
6811
5602
  /**
6812
5603
  * Updates a draft post.
@@ -6816,7 +5607,7 @@ interface UpdateDraftPostSignature {
6816
5607
  */
6817
5608
  (_id: string, draftPost: UpdateDraftPost, options?: UpdateDraftPostOptions | undefined): Promise<UpdateDraftPostResponse & UpdateDraftPostResponseNonNullableFields>;
6818
5609
  }
6819
- declare function deleteDraftPost$1(httpClient: HttpClient$2): DeleteDraftPostSignature;
5610
+ declare function deleteDraftPost$1(httpClient: HttpClient): DeleteDraftPostSignature;
6820
5611
  interface DeleteDraftPostSignature {
6821
5612
  /**
6822
5613
  * Moves a draft post with the provided ID to the trash bin.
@@ -6828,7 +5619,7 @@ interface DeleteDraftPostSignature {
6828
5619
  */
6829
5620
  (draftPostId: string, options?: DeleteDraftPostOptions | undefined): Promise<void>;
6830
5621
  }
6831
- declare function removeFromTrashBin$1(httpClient: HttpClient$2): RemoveFromTrashBinSignature;
5622
+ declare function removeFromTrashBin$1(httpClient: HttpClient): RemoveFromTrashBinSignature;
6832
5623
  interface RemoveFromTrashBinSignature {
6833
5624
  /**
6834
5625
  * Permanently deletes a draft post by the provided ID from the trash bin.
@@ -6838,7 +5629,7 @@ interface RemoveFromTrashBinSignature {
6838
5629
  */
6839
5630
  (draftPostId: string): Promise<void>;
6840
5631
  }
6841
- declare function bulkDeleteDraftPosts$1(httpClient: HttpClient$2): BulkDeleteDraftPostsSignature;
5632
+ declare function bulkDeleteDraftPosts$1(httpClient: HttpClient): BulkDeleteDraftPostsSignature;
6842
5633
  interface BulkDeleteDraftPostsSignature {
6843
5634
  /**
6844
5635
  * Deletes multiple draft posts.
@@ -6847,7 +5638,7 @@ interface BulkDeleteDraftPostsSignature {
6847
5638
  */
6848
5639
  (postIds: string[], options?: BulkDeleteDraftPostsOptions | undefined): Promise<BulkDeleteDraftPostsResponse & BulkDeleteDraftPostsResponseNonNullableFields>;
6849
5640
  }
6850
- declare function listDraftPosts$1(httpClient: HttpClient$2): ListDraftPostsSignature;
5641
+ declare function listDraftPosts$1(httpClient: HttpClient): ListDraftPostsSignature;
6851
5642
  interface ListDraftPostsSignature {
6852
5643
  /**
6853
5644
  * Retrieves a list of up to 100 draft posts per request.
@@ -6860,7 +5651,7 @@ interface ListDraftPostsSignature {
6860
5651
  */
6861
5652
  (options?: ListDraftPostsOptions | undefined): Promise<ListDraftPostsResponse & ListDraftPostsResponseNonNullableFields>;
6862
5653
  }
6863
- declare function getDeletedDraftPost$1(httpClient: HttpClient$2): GetDeletedDraftPostSignature;
5654
+ declare function getDeletedDraftPost$1(httpClient: HttpClient): GetDeletedDraftPostSignature;
6864
5655
  interface GetDeletedDraftPostSignature {
6865
5656
  /**
6866
5657
  * Gets a deleted draft post from the trash bin by the provided ID.
@@ -6870,7 +5661,7 @@ interface GetDeletedDraftPostSignature {
6870
5661
  */
6871
5662
  (draftPostId: string): Promise<GetDeletedDraftPostResponse & GetDeletedDraftPostResponseNonNullableFields>;
6872
5663
  }
6873
- declare function restoreFromTrashBin$1(httpClient: HttpClient$2): RestoreFromTrashBinSignature;
5664
+ declare function restoreFromTrashBin$1(httpClient: HttpClient): RestoreFromTrashBinSignature;
6874
5665
  interface RestoreFromTrashBinSignature {
6875
5666
  /**
6876
5667
  * Restores a deleted draft post from the trash bin by the provided ID.
@@ -6880,7 +5671,7 @@ interface RestoreFromTrashBinSignature {
6880
5671
  */
6881
5672
  (draftPostId: string): Promise<RestoreFromTrashBinResponse & RestoreFromTrashBinResponseNonNullableFields>;
6882
5673
  }
6883
- declare function queryDraftPosts$1(httpClient: HttpClient$2): QueryDraftPostsSignature;
5674
+ declare function queryDraftPosts$1(httpClient: HttpClient): QueryDraftPostsSignature;
6884
5675
  interface QueryDraftPostsSignature {
6885
5676
  /**
6886
5677
  * Retrieves a list of up to 100 draft posts, given the provided paging, filtering, and sorting.
@@ -6893,7 +5684,7 @@ interface QueryDraftPostsSignature {
6893
5684
  */
6894
5685
  (options?: QueryDraftPostsOptions | undefined): DraftPostsQueryBuilder;
6895
5686
  }
6896
- declare function publishDraftPost$1(httpClient: HttpClient$2): PublishDraftPostSignature;
5687
+ declare function publishDraftPost$1(httpClient: HttpClient): PublishDraftPostSignature;
6897
5688
  interface PublishDraftPostSignature {
6898
5689
  /**
6899
5690
  * Publishes a specified draft post by ID. This creates a new post entity with the data from the draft post.
@@ -6903,20 +5694,20 @@ interface PublishDraftPostSignature {
6903
5694
  */
6904
5695
  (draftPostId: string): Promise<PublishDraftPostResponse & PublishDraftPostResponseNonNullableFields>;
6905
5696
  }
6906
- declare const onDraftCreated$1: EventDefinition$5<DraftCreatedEnvelope, "wix.blog.v3.draft_created">;
6907
- declare const onDraftUpdated$1: EventDefinition$5<DraftUpdatedEnvelope, "wix.blog.v3.draft_updated">;
6908
- declare const onDraftDeleted$1: EventDefinition$5<DraftDeletedEnvelope, "wix.blog.v3.draft_deleted">;
5697
+ declare const onDraftCreated$1: EventDefinition$4<DraftCreatedEnvelope, "wix.blog.v3.draft_created">;
5698
+ declare const onDraftUpdated$1: EventDefinition$4<DraftUpdatedEnvelope, "wix.blog.v3.draft_updated">;
5699
+ declare const onDraftDeleted$1: EventDefinition$4<DraftDeletedEnvelope, "wix.blog.v3.draft_deleted">;
6909
5700
 
6910
- type EventDefinition$4<Payload = unknown, Type extends string = string> = {
5701
+ type EventDefinition$2<Payload = unknown, Type extends string = string> = {
6911
5702
  __type: 'event-definition';
6912
5703
  type: Type;
6913
5704
  isDomainEvent?: boolean;
6914
5705
  transformations?: (envelope: unknown) => Payload;
6915
5706
  __payload: Payload;
6916
5707
  };
6917
- declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
6918
- type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
6919
- type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
5708
+ declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
5709
+ type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
5710
+ type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
6920
5711
 
6921
5712
  declare global {
6922
5713
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -6925,22 +5716,22 @@ declare global {
6925
5716
  }
6926
5717
  }
6927
5718
 
6928
- declare function createEventModule$2<T extends EventDefinition$4<any, string>>(eventDefinition: T): BuildEventDefinition$4<T> & T;
5719
+ declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
6929
5720
 
6930
- declare const createDraftPost: MaybeContext$2<BuildRESTFunction$2<typeof createDraftPost$1> & typeof createDraftPost$1>;
6931
- declare const bulkCreateDraftPosts: MaybeContext$2<BuildRESTFunction$2<typeof bulkCreateDraftPosts$1> & typeof bulkCreateDraftPosts$1>;
6932
- declare const bulkUpdateDraftPosts: MaybeContext$2<BuildRESTFunction$2<typeof bulkUpdateDraftPosts$1> & typeof bulkUpdateDraftPosts$1>;
6933
- declare const listDeletedDraftPosts: MaybeContext$2<BuildRESTFunction$2<typeof listDeletedDraftPosts$1> & typeof listDeletedDraftPosts$1>;
6934
- declare const getDraftPost: MaybeContext$2<BuildRESTFunction$2<typeof getDraftPost$1> & typeof getDraftPost$1>;
6935
- declare const updateDraftPost: MaybeContext$2<BuildRESTFunction$2<typeof updateDraftPost$1> & typeof updateDraftPost$1>;
6936
- declare const deleteDraftPost: MaybeContext$2<BuildRESTFunction$2<typeof deleteDraftPost$1> & typeof deleteDraftPost$1>;
6937
- declare const removeFromTrashBin: MaybeContext$2<BuildRESTFunction$2<typeof removeFromTrashBin$1> & typeof removeFromTrashBin$1>;
6938
- declare const bulkDeleteDraftPosts: MaybeContext$2<BuildRESTFunction$2<typeof bulkDeleteDraftPosts$1> & typeof bulkDeleteDraftPosts$1>;
6939
- declare const listDraftPosts: MaybeContext$2<BuildRESTFunction$2<typeof listDraftPosts$1> & typeof listDraftPosts$1>;
6940
- declare const getDeletedDraftPost: MaybeContext$2<BuildRESTFunction$2<typeof getDeletedDraftPost$1> & typeof getDeletedDraftPost$1>;
6941
- declare const restoreFromTrashBin: MaybeContext$2<BuildRESTFunction$2<typeof restoreFromTrashBin$1> & typeof restoreFromTrashBin$1>;
6942
- declare const queryDraftPosts: MaybeContext$2<BuildRESTFunction$2<typeof queryDraftPosts$1> & typeof queryDraftPosts$1>;
6943
- declare const publishDraftPost: MaybeContext$2<BuildRESTFunction$2<typeof publishDraftPost$1> & typeof publishDraftPost$1>;
5721
+ declare const createDraftPost: MaybeContext<BuildRESTFunction<typeof createDraftPost$1> & typeof createDraftPost$1>;
5722
+ declare const bulkCreateDraftPosts: MaybeContext<BuildRESTFunction<typeof bulkCreateDraftPosts$1> & typeof bulkCreateDraftPosts$1>;
5723
+ declare const bulkUpdateDraftPosts: MaybeContext<BuildRESTFunction<typeof bulkUpdateDraftPosts$1> & typeof bulkUpdateDraftPosts$1>;
5724
+ declare const listDeletedDraftPosts: MaybeContext<BuildRESTFunction<typeof listDeletedDraftPosts$1> & typeof listDeletedDraftPosts$1>;
5725
+ declare const getDraftPost: MaybeContext<BuildRESTFunction<typeof getDraftPost$1> & typeof getDraftPost$1>;
5726
+ declare const updateDraftPost: MaybeContext<BuildRESTFunction<typeof updateDraftPost$1> & typeof updateDraftPost$1>;
5727
+ declare const deleteDraftPost: MaybeContext<BuildRESTFunction<typeof deleteDraftPost$1> & typeof deleteDraftPost$1>;
5728
+ declare const removeFromTrashBin: MaybeContext<BuildRESTFunction<typeof removeFromTrashBin$1> & typeof removeFromTrashBin$1>;
5729
+ declare const bulkDeleteDraftPosts: MaybeContext<BuildRESTFunction<typeof bulkDeleteDraftPosts$1> & typeof bulkDeleteDraftPosts$1>;
5730
+ declare const listDraftPosts: MaybeContext<BuildRESTFunction<typeof listDraftPosts$1> & typeof listDraftPosts$1>;
5731
+ declare const getDeletedDraftPost: MaybeContext<BuildRESTFunction<typeof getDeletedDraftPost$1> & typeof getDeletedDraftPost$1>;
5732
+ declare const restoreFromTrashBin: MaybeContext<BuildRESTFunction<typeof restoreFromTrashBin$1> & typeof restoreFromTrashBin$1>;
5733
+ declare const queryDraftPosts: MaybeContext<BuildRESTFunction<typeof queryDraftPosts$1> & typeof queryDraftPosts$1>;
5734
+ declare const publishDraftPost: MaybeContext<BuildRESTFunction<typeof publishDraftPost$1> & typeof publishDraftPost$1>;
6944
5735
 
6945
5736
  type _publicOnDraftCreatedType = typeof onDraftCreated$1;
6946
5737
  /**
@@ -7085,451 +5876,41 @@ declare namespace context$2 {
7085
5876
  export { context$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 context$2_ApproveDraftPostRequest as ApproveDraftPostRequest, type context$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 context$2_BulkCreateDraftPostsOptions as BulkCreateDraftPostsOptions, type context$2_BulkCreateDraftPostsRequest as BulkCreateDraftPostsRequest, type context$2_BulkCreateDraftPostsResponse as BulkCreateDraftPostsResponse, type context$2_BulkCreateDraftPostsResponseNonNullableFields as BulkCreateDraftPostsResponseNonNullableFields, type context$2_BulkDeleteDraftPostsOptions as BulkDeleteDraftPostsOptions, type context$2_BulkDeleteDraftPostsRequest as BulkDeleteDraftPostsRequest, type context$2_BulkDeleteDraftPostsResponse as BulkDeleteDraftPostsResponse, type context$2_BulkDeleteDraftPostsResponseNonNullableFields as BulkDeleteDraftPostsResponseNonNullableFields, type context$2_BulkDraftPostResult as BulkDraftPostResult, type context$2_BulkRejectDraftPostRequest as BulkRejectDraftPostRequest, type context$2_BulkRejectDraftPostResponse as BulkRejectDraftPostResponse, type context$2_BulkRevertToUnpublishedRequest as BulkRevertToUnpublishedRequest, type context$2_BulkRevertToUnpublishedResponse as BulkRevertToUnpublishedResponse, type context$2_BulkUpdateDraftPostLanguageRequest as BulkUpdateDraftPostLanguageRequest, type context$2_BulkUpdateDraftPostLanguageResponse as BulkUpdateDraftPostLanguageResponse, type context$2_BulkUpdateDraftPostsOptions as BulkUpdateDraftPostsOptions, type context$2_BulkUpdateDraftPostsRequest as BulkUpdateDraftPostsRequest, type context$2_BulkUpdateDraftPostsResponse as BulkUpdateDraftPostsResponse, type context$2_BulkUpdateDraftPostsResponseNonNullableFields as BulkUpdateDraftPostsResponseNonNullableFields, type BulletedListData$1 as BulletedListData, type ButtonData$1 as ButtonData, context$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 context$2_CreateDraftPostOptions as CreateDraftPostOptions, type context$2_CreateDraftPostRequest as CreateDraftPostRequest, type context$2_CreateDraftPostResponse as CreateDraftPostResponse, type context$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 context$2_DeleteDraftPostOptions as DeleteDraftPostOptions, type context$2_DeleteDraftPostRequest as DeleteDraftPostRequest, type context$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 context$2_DraftCreatedEnvelope as DraftCreatedEnvelope, type context$2_DraftDeletedEnvelope as DraftDeletedEnvelope, type DraftPost$1 as DraftPost, type context$2_DraftPostOwnerChanged as DraftPostOwnerChanged, type DraftPostTranslation$1 as DraftPostTranslation, type context$2_DraftPostsQueryBuilder as DraftPostsQueryBuilder, type context$2_DraftPostsQueryResult as DraftPostsQueryResult, type context$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 context$2_GetDeletedDraftPostRequest as GetDeletedDraftPostRequest, type context$2_GetDeletedDraftPostResponse as GetDeletedDraftPostResponse, type context$2_GetDeletedDraftPostResponseNonNullableFields as GetDeletedDraftPostResponseNonNullableFields, type context$2_GetDraftPostOptions as GetDraftPostOptions, type context$2_GetDraftPostRequest as GetDraftPostRequest, type context$2_GetDraftPostResponse as GetDraftPostResponse, type context$2_GetDraftPostResponseNonNullableFields as GetDraftPostResponseNonNullableFields, type context$2_GetDraftPostTotalsRequest as GetDraftPostTotalsRequest, type context$2_GetDraftPostTotalsResponse as GetDraftPostTotalsResponse, context$2_GetDraftPostsSort as GetDraftPostsSort, type context$2_GetPostAmountsByLanguageRequest as GetPostAmountsByLanguageRequest, type context$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 context$2_InitialDraftPostsCopied as InitialDraftPostsCopied, InitialExpandedItems$1 as InitialExpandedItems, type context$2_IsDraftPostAutoTranslatableRequest as IsDraftPostAutoTranslatableRequest, type context$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 context$2_ListDeletedDraftPostsOptions as ListDeletedDraftPostsOptions, type context$2_ListDeletedDraftPostsRequest as ListDeletedDraftPostsRequest, type context$2_ListDeletedDraftPostsResponse as ListDeletedDraftPostsResponse, type context$2_ListDeletedDraftPostsResponseNonNullableFields as ListDeletedDraftPostsResponseNonNullableFields, type context$2_ListDraftPostsOptions as ListDraftPostsOptions, type context$2_ListDraftPostsRequest as ListDraftPostsRequest, type context$2_ListDraftPostsResponse as ListDraftPostsResponse, type context$2_ListDraftPostsResponseNonNullableFields as ListDraftPostsResponseNonNullableFields, type ListValue$1 as ListValue, type MapData$1 as MapData, type MapSettings$1 as MapSettings, MapType$1 as MapType, type context$2_MarkPostAsInModerationRequest as MarkPostAsInModerationRequest, type context$2_MarkPostAsInModerationResponse as MarkPostAsInModerationResponse, type context$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 context$2_PostAmountByLanguage as PostAmountByLanguage, type context$2_PublishDraftPostRequest as PublishDraftPostRequest, type context$2_PublishDraftPostResponse as PublishDraftPostResponse, type context$2_PublishDraftPostResponseNonNullableFields as PublishDraftPostResponseNonNullableFields, type context$2_QueryDraftPostsOptions as QueryDraftPostsOptions, type context$2_QueryDraftPostsRequest as QueryDraftPostsRequest, type context$2_QueryDraftPostsResponse as QueryDraftPostsResponse, type context$2_QueryDraftPostsResponseNonNullableFields as QueryDraftPostsResponseNonNullableFields, type context$2_RejectDraftPostRequest as RejectDraftPostRequest, type context$2_RejectDraftPostResponse as RejectDraftPostResponse, type Rel$1 as Rel, type context$2_RemoveFromTrashBinRequest as RemoveFromTrashBinRequest, type context$2_RemoveFromTrashBinResponse as RemoveFromTrashBinResponse, type context$2_RestoreFromTrashBinRequest as RestoreFromTrashBinRequest, type context$2_RestoreFromTrashBinResponse as RestoreFromTrashBinResponse, type context$2_RestoreFromTrashBinResponseNonNullableFields as RestoreFromTrashBinResponseNonNullableFields, type RestoreInfo$2 as RestoreInfo, type context$2_RevertToUnpublishedRequest as RevertToUnpublishedRequest, type context$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 context$2_TotalDraftPosts as TotalDraftPosts, context$2_TotalDraftPostsGroupingField as TotalDraftPostsGroupingField, type context$2_TranslateCategoryRequest as TranslateCategoryRequest, type context$2_TranslateCategoryResponse as TranslateCategoryResponse, type context$2_TranslateDraftRequest as TranslateDraftRequest, type context$2_TranslateDraftResponse as TranslateDraftResponse, Type$1 as Type, type context$2_UnpublishPostRequest as UnpublishPostRequest, type context$2_UnpublishPostResponse as UnpublishPostResponse, type context$2_UpdateDraftPost as UpdateDraftPost, type context$2_UpdateDraftPostContentRequest as UpdateDraftPostContentRequest, type context$2_UpdateDraftPostContentRequestDraftContentOneOf as UpdateDraftPostContentRequestDraftContentOneOf, type context$2_UpdateDraftPostContentResponse as UpdateDraftPostContentResponse, type context$2_UpdateDraftPostLanguageRequest as UpdateDraftPostLanguageRequest, type context$2_UpdateDraftPostLanguageResponse as UpdateDraftPostLanguageResponse, type context$2_UpdateDraftPostOptions as UpdateDraftPostOptions, type context$2_UpdateDraftPostRequest as UpdateDraftPostRequest, type context$2_UpdateDraftPostResponse as UpdateDraftPostResponse, type context$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 context$2__publicOnDraftCreatedType as _publicOnDraftCreatedType, type context$2__publicOnDraftDeletedType as _publicOnDraftDeletedType, type context$2__publicOnDraftUpdatedType as _publicOnDraftUpdatedType, context$2_bulkCreateDraftPosts as bulkCreateDraftPosts, context$2_bulkDeleteDraftPosts as bulkDeleteDraftPosts, context$2_bulkUpdateDraftPosts as bulkUpdateDraftPosts, context$2_createDraftPost as createDraftPost, context$2_deleteDraftPost as deleteDraftPost, context$2_getDeletedDraftPost as getDeletedDraftPost, context$2_getDraftPost as getDraftPost, context$2_listDeletedDraftPosts as listDeletedDraftPosts, context$2_listDraftPosts as listDraftPosts, context$2_onDraftCreated as onDraftCreated, context$2_onDraftDeleted as onDraftDeleted, context$2_onDraftUpdated as onDraftUpdated, onDraftCreated$1 as publicOnDraftCreated, onDraftDeleted$1 as publicOnDraftDeleted, onDraftUpdated$1 as publicOnDraftUpdated, context$2_publishDraftPost as publishDraftPost, context$2_queryDraftPosts as queryDraftPosts, context$2_removeFromTrashBin as removeFromTrashBin, context$2_restoreFromTrashBin as restoreFromTrashBin, context$2_updateDraftPost as updateDraftPost };
7086
5877
  }
7087
5878
 
7088
- type HostModule$1<T, H extends Host$1> = {
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;
5879
+ interface Post {
7102
5880
  /**
7103
- * Optional bast url to use for API requests, for example `www.wixapis.com`
5881
+ * Post ID.
5882
+ * @readonly
7104
5883
  */
7105
- apiBaseUrl?: string;
5884
+ _id?: string;
5885
+ /** Post title. */
5886
+ title?: string;
7106
5887
  /**
7107
- * Possible data to be provided by every host, for cross cutting concerns
7108
- * like internationalization, billing, etc.
5888
+ * Post excerpt.
5889
+ * Can be selected by a site contributor. By default, it is extracted from the content text's first characters.
5890
+ *
5891
+ * Max: 500 characters
7109
5892
  */
7110
- essentials?: {
7111
- /**
7112
- * The language of the currently viewed session
7113
- */
7114
- language?: string;
7115
- /**
7116
- * The locale of the currently viewed session
7117
- */
7118
- locale?: string;
7119
- /**
7120
- * Any headers that should be passed through to the API requests
7121
- */
7122
- passThroughHeaders?: Record<string, string>;
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;
5893
+ excerpt?: string;
5894
+ /**
5895
+ * The post's content in plain text.
5896
+ * @readonly
5897
+ */
5898
+ contentText?: string | null;
5899
+ /** Date the post was first published. */
5900
+ firstPublishedDate?: Date;
5901
+ /**
5902
+ * Date the post was last published.
5903
+ * @readonly
5904
+ */
5905
+ lastPublishedDate?: Date;
5906
+ /** Post URL. */
7201
5907
  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
5908
  /**
7500
- * Post ID.
7501
- * @readonly
7502
- */
7503
- _id?: string;
7504
- /** Post title. */
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
- *
5909
+ * Part of a post's URL that refers to a specific post.
5910
+ *
5911
+ *
5912
+ * For example, `'https:/example.com/posts/my-post-slug'`.
5913
+ *
7533
5914
  */
7534
5915
  slug?: string;
7535
5916
  /** Whether the post is marked as featured. */
@@ -10976,7 +9357,7 @@ interface GetTotalPostsOptions {
10976
9357
  language?: string | null;
10977
9358
  }
10978
9359
 
10979
- declare function getPost$1(httpClient: HttpClient$1): GetPostSignature;
9360
+ declare function getPost$1(httpClient: HttpClient): GetPostSignature;
10980
9361
  interface GetPostSignature {
10981
9362
  /**
10982
9363
  * Gets a post by the specified ID.
@@ -10990,7 +9371,7 @@ interface GetPostSignature {
10990
9371
  */
10991
9372
  (postId: string, options?: GetPostOptions | undefined): Promise<GetPostResponse & GetPostResponseNonNullableFields>;
10992
9373
  }
10993
- declare function getPostBySlug$1(httpClient: HttpClient$1): GetPostBySlugSignature;
9374
+ declare function getPostBySlug$1(httpClient: HttpClient): GetPostBySlugSignature;
10994
9375
  interface GetPostBySlugSignature {
10995
9376
  /**
10996
9377
  * Gets a post by the provided slug.
@@ -11007,7 +9388,7 @@ interface GetPostBySlugSignature {
11007
9388
  */
11008
9389
  (slug: string, options?: GetPostBySlugOptions | undefined): Promise<GetPostBySlugResponse & GetPostBySlugResponseNonNullableFields>;
11009
9390
  }
11010
- declare function listPosts$1(httpClient: HttpClient$1): ListPostsSignature;
9391
+ declare function listPosts$1(httpClient: HttpClient): ListPostsSignature;
11011
9392
  interface ListPostsSignature {
11012
9393
  /**
11013
9394
  * Retrieves a list of published posts.
@@ -11023,7 +9404,7 @@ interface ListPostsSignature {
11023
9404
  */
11024
9405
  (options?: ListPostsOptions | undefined): Promise<ListPostsResponse & ListPostsResponseNonNullableFields>;
11025
9406
  }
11026
- declare function queryPosts$1(httpClient: HttpClient$1): QueryPostsSignature;
9407
+ declare function queryPosts$1(httpClient: HttpClient): QueryPostsSignature;
11027
9408
  interface QueryPostsSignature {
11028
9409
  /**
11029
9410
  * Creates a query to retrieve a list of posts.
@@ -11048,7 +9429,7 @@ interface QueryPostsSignature {
11048
9429
  */
11049
9430
  (options?: QueryPostsOptions | undefined): PostsQueryBuilder;
11050
9431
  }
11051
- declare function getPostMetrics$1(httpClient: HttpClient$1): GetPostMetricsSignature;
9432
+ declare function getPostMetrics$1(httpClient: HttpClient): GetPostMetricsSignature;
11052
9433
  interface GetPostMetricsSignature {
11053
9434
  /**
11054
9435
  * Gets a specified post's metrics.
@@ -11062,7 +9443,7 @@ interface GetPostMetricsSignature {
11062
9443
  */
11063
9444
  (postId: string): Promise<GetPostMetricsResponse & GetPostMetricsResponseNonNullableFields>;
11064
9445
  }
11065
- declare function queryPostCountStats$1(httpClient: HttpClient$1): QueryPostCountStatsSignature;
9446
+ declare function queryPostCountStats$1(httpClient: HttpClient): QueryPostCountStatsSignature;
11066
9447
  interface QueryPostCountStatsSignature {
11067
9448
  /**
11068
9449
  * Retrieves the number of published posts per month within a specified time range.
@@ -11078,7 +9459,7 @@ interface QueryPostCountStatsSignature {
11078
9459
  */
11079
9460
  (options?: QueryPostCountStatsOptions | undefined): Promise<QueryPostCountStatsResponse & QueryPostCountStatsResponseNonNullableFields>;
11080
9461
  }
11081
- declare function getTotalPosts$1(httpClient: HttpClient$1): GetTotalPostsSignature;
9462
+ declare function getTotalPosts$1(httpClient: HttpClient): GetTotalPostsSignature;
11082
9463
  interface GetTotalPostsSignature {
11083
9464
  /**
11084
9465
  * Gets the total amount of published posts on the blog.
@@ -11093,22 +9474,22 @@ interface GetTotalPostsSignature {
11093
9474
  */
11094
9475
  (options?: GetTotalPostsOptions | undefined): Promise<GetTotalPostsResponse & GetTotalPostsResponseNonNullableFields>;
11095
9476
  }
11096
- declare const onPostCreated$1: EventDefinition$3<PostCreatedEnvelope, "wix.blog.v3.post_created">;
11097
- declare const onPostUpdated$1: EventDefinition$3<PostUpdatedEnvelope, "wix.blog.v3.post_updated">;
11098
- declare const onPostDeleted$1: EventDefinition$3<PostDeletedEnvelope, "wix.blog.v3.post_deleted">;
11099
- declare const onPostLiked$1: EventDefinition$3<PostLikedEnvelope, "wix.blog.v3.post_liked">;
11100
- declare const onPostUnliked$1: EventDefinition$3<PostUnlikedEnvelope, "wix.blog.v3.post_unliked">;
9477
+ declare const onPostCreated$1: EventDefinition$4<PostCreatedEnvelope, "wix.blog.v3.post_created">;
9478
+ declare const onPostUpdated$1: EventDefinition$4<PostUpdatedEnvelope, "wix.blog.v3.post_updated">;
9479
+ declare const onPostDeleted$1: EventDefinition$4<PostDeletedEnvelope, "wix.blog.v3.post_deleted">;
9480
+ declare const onPostLiked$1: EventDefinition$4<PostLikedEnvelope, "wix.blog.v3.post_liked">;
9481
+ declare const onPostUnliked$1: EventDefinition$4<PostUnlikedEnvelope, "wix.blog.v3.post_unliked">;
11101
9482
 
11102
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
9483
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
11103
9484
  __type: 'event-definition';
11104
9485
  type: Type;
11105
9486
  isDomainEvent?: boolean;
11106
9487
  transformations?: (envelope: unknown) => Payload;
11107
9488
  __payload: Payload;
11108
9489
  };
11109
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
11110
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
11111
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
9490
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
9491
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
9492
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
11112
9493
 
11113
9494
  declare global {
11114
9495
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -11117,15 +9498,15 @@ declare global {
11117
9498
  }
11118
9499
  }
11119
9500
 
11120
- declare function createEventModule$1<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
9501
+ declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
11121
9502
 
11122
- declare const getPost: MaybeContext$1<BuildRESTFunction$1<typeof getPost$1> & typeof getPost$1>;
11123
- declare const getPostBySlug: MaybeContext$1<BuildRESTFunction$1<typeof getPostBySlug$1> & typeof getPostBySlug$1>;
11124
- declare const listPosts: MaybeContext$1<BuildRESTFunction$1<typeof listPosts$1> & typeof listPosts$1>;
11125
- declare const queryPosts: MaybeContext$1<BuildRESTFunction$1<typeof queryPosts$1> & typeof queryPosts$1>;
11126
- declare const getPostMetrics: MaybeContext$1<BuildRESTFunction$1<typeof getPostMetrics$1> & typeof getPostMetrics$1>;
11127
- declare const queryPostCountStats: MaybeContext$1<BuildRESTFunction$1<typeof queryPostCountStats$1> & typeof queryPostCountStats$1>;
11128
- declare const getTotalPosts: MaybeContext$1<BuildRESTFunction$1<typeof getTotalPosts$1> & typeof getTotalPosts$1>;
9503
+ declare const getPost: MaybeContext<BuildRESTFunction<typeof getPost$1> & typeof getPost$1>;
9504
+ declare const getPostBySlug: MaybeContext<BuildRESTFunction<typeof getPostBySlug$1> & typeof getPostBySlug$1>;
9505
+ declare const listPosts: MaybeContext<BuildRESTFunction<typeof listPosts$1> & typeof listPosts$1>;
9506
+ declare const queryPosts: MaybeContext<BuildRESTFunction<typeof queryPosts$1> & typeof queryPosts$1>;
9507
+ declare const getPostMetrics: MaybeContext<BuildRESTFunction<typeof getPostMetrics$1> & typeof getPostMetrics$1>;
9508
+ declare const queryPostCountStats: MaybeContext<BuildRESTFunction<typeof queryPostCountStats$1> & typeof queryPostCountStats$1>;
9509
+ declare const getTotalPosts: MaybeContext<BuildRESTFunction<typeof getTotalPosts$1> & typeof getTotalPosts$1>;
11129
9510
 
11130
9511
  type _publicOnPostCreatedType = typeof onPostCreated$1;
11131
9512
  /**
@@ -11440,416 +9821,6 @@ declare namespace context$1 {
11440
9821
  export { type ActionEvent$1 as ActionEvent, context$1_Alignment as Alignment, type context$1_AnchorData as AnchorData, type context$1_AppEmbedData as AppEmbedData, type context$1_AppEmbedDataAppDataOneOf as AppEmbedDataAppDataOneOf, context$1_AppType as AppType, type context$1_AudioData as AudioData, type context$1_Background as Background, type context$1_BackgroundBackgroundOneOf as BackgroundBackgroundOneOf, context$1_BackgroundType as BackgroundType, type BaseEventMetadata$1 as BaseEventMetadata, type context$1_BlockquoteData as BlockquoteData, type context$1_BlogPaging as BlogPaging, type context$1_BookingData as BookingData, type context$1_Border as Border, type context$1_BorderColors as BorderColors, type context$1_BulkGetPostMetricsRequest as BulkGetPostMetricsRequest, type context$1_BulkGetPostMetricsResponse as BulkGetPostMetricsResponse, type context$1_BulkGetPostReactionsRequest as BulkGetPostReactionsRequest, type context$1_BulkGetPostReactionsResponse as BulkGetPostReactionsResponse, type context$1_BulletedListData as BulletedListData, type context$1_ButtonData as ButtonData, type context$1_Category as Category, type context$1_CategoryTranslation as CategoryTranslation, type context$1_CellStyle as CellStyle, type context$1_CodeBlockData as CodeBlockData, type context$1_CollapsibleListData as CollapsibleListData, type context$1_ColorData as ColorData, type context$1_Colors as Colors, type context$1_ConvertDraftJsToRichContentRequest as ConvertDraftJsToRichContentRequest, type context$1_ConvertDraftJsToRichContentResponse as ConvertDraftJsToRichContentResponse, type context$1_ConvertRichContentToDraftJsRequest as ConvertRichContentToDraftJsRequest, type context$1_ConvertRichContentToDraftJsResponse as ConvertRichContentToDraftJsResponse, type context$1_CoverMedia as CoverMedia, type context$1_CoverMediaMediaOneOf as CoverMediaMediaOneOf, type context$1_CreateDraftPostFromTemplateRequest as CreateDraftPostFromTemplateRequest, type context$1_CreateDraftPostFromTemplateResponse as CreateDraftPostFromTemplateResponse, context$1_Crop as Crop, type CursorPaging$1 as CursorPaging, type Cursors$1 as Cursors, type context$1_Decoration as Decoration, type context$1_DecorationDataOneOf as DecorationDataOneOf, context$1_DecorationType as DecorationType, type context$1_Design as Design, type context$1_Dimensions as Dimensions, context$1_Direction as Direction, type context$1_DividerData as DividerData, type context$1_DocumentStyle as DocumentStyle, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type context$1_DraftPost as DraftPost, type context$1_DraftPostTranslation as DraftPostTranslation, type context$1_EmbedData as EmbedData, type context$1_EmbedMedia as EmbedMedia, type context$1_EmbedThumbnail as EmbedThumbnail, type context$1_EmbedVideo as EmbedVideo, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type context$1_EventData as EventData, type EventMetadata$1 as EventMetadata, Field$1 as Field, type context$1_FileData as FileData, type context$1_FileSource as FileSource, type context$1_FileSourceDataOneOf as FileSourceDataOneOf, type context$1_FontSizeData as FontSizeData, context$1_FontType as FontType, type context$1_GIF as GIF, type context$1_GIFData as GIFData, type context$1_GalleryData as GalleryData, type context$1_GalleryOptions as GalleryOptions, type context$1_GetPostBySlugOptions as GetPostBySlugOptions, type context$1_GetPostBySlugRequest as GetPostBySlugRequest, type context$1_GetPostBySlugResponse as GetPostBySlugResponse, type context$1_GetPostBySlugResponseNonNullableFields as GetPostBySlugResponseNonNullableFields, type context$1_GetPostMetricsRequest as GetPostMetricsRequest, type context$1_GetPostMetricsResponse as GetPostMetricsResponse, type context$1_GetPostMetricsResponseNonNullableFields as GetPostMetricsResponseNonNullableFields, type context$1_GetPostOptions as GetPostOptions, type context$1_GetPostRequest as GetPostRequest, type context$1_GetPostResponse as GetPostResponse, type context$1_GetPostResponseNonNullableFields as GetPostResponseNonNullableFields, context$1_GetPostTemplatesSort as GetPostTemplatesSort, context$1_GetPostsSort as GetPostsSort, type context$1_GetTemplateRequest as GetTemplateRequest, type context$1_GetTemplateResponse as GetTemplateResponse, type context$1_GetTotalLikesPerMemberRequest as GetTotalLikesPerMemberRequest, type context$1_GetTotalLikesPerMemberResponse as GetTotalLikesPerMemberResponse, type context$1_GetTotalPostsOptions as GetTotalPostsOptions, type context$1_GetTotalPostsRequest as GetTotalPostsRequest, type context$1_GetTotalPostsResponse as GetTotalPostsResponse, type context$1_GetTotalPostsResponseNonNullableFields as GetTotalPostsResponseNonNullableFields, type context$1_GetTotalPublicationsRequest as GetTotalPublicationsRequest, type context$1_GetTotalPublicationsResponse as GetTotalPublicationsResponse, type context$1_Gradient as Gradient, type context$1_HTMLData as HTMLData, type context$1_HTMLDataDataOneOf as HTMLDataDataOneOf, type context$1_HeadingData as HeadingData, type context$1_Height as Height, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type context$1_Image as Image, type context$1_ImageData as ImageData, context$1_InitialExpandedItems as InitialExpandedItems, type context$1_InitialPostsCopied as InitialPostsCopied, type context$1_Item as Item, type context$1_ItemDataOneOf as ItemDataOneOf, type context$1_ItemStyle as ItemStyle, type Keyword$1 as Keyword, type context$1_Layout as Layout, context$1_LayoutType as LayoutType, type context$1_LikePostRequest as LikePostRequest, type context$1_LikePostResponse as LikePostResponse, context$1_LineStyle as LineStyle, type context$1_Link as Link, type context$1_LinkData as LinkData, type context$1_LinkDataOneOf as LinkDataOneOf, type context$1_LinkPreviewData as LinkPreviewData, type context$1_ListDemoPostsRequest as ListDemoPostsRequest, type context$1_ListDemoPostsResponse as ListDemoPostsResponse, type context$1_ListPostsArchiveRequest as ListPostsArchiveRequest, type context$1_ListPostsArchiveResponse as ListPostsArchiveResponse, type context$1_ListPostsOptions as ListPostsOptions, type context$1_ListPostsRequest as ListPostsRequest, type context$1_ListPostsResponse as ListPostsResponse, type context$1_ListPostsResponseNonNullableFields as ListPostsResponseNonNullableFields, type context$1_ListTemplatesRequest as ListTemplatesRequest, type context$1_ListTemplatesResponse as ListTemplatesResponse, type context$1_ListValue as ListValue, type context$1_MapData as MapData, type context$1_MapSettings as MapSettings, context$1_MapType as MapType, type context$1_Media as Media, type context$1_MediaMediaOneOf as MediaMediaOneOf, type context$1_MentionData as MentionData, type MessageEnvelope$1 as MessageEnvelope, type MetaData$1 as MetaData, type context$1_Metadata as Metadata, type context$1_Metrics as Metrics, type context$1_ModerationDetails as ModerationDetails, context$1_ModerationStatusStatus as ModerationStatusStatus, type context$1_Node as Node, type context$1_NodeDataOneOf as NodeDataOneOf, type context$1_NodeStyle as NodeStyle, context$1_NodeType as NodeType, context$1_NullValue as NullValue, type context$1_Oembed as Oembed, type context$1_OldBlogMigratedEvent as OldBlogMigratedEvent, type context$1_Option as Option, type context$1_OptionDesign as OptionDesign, type context$1_OptionLayout as OptionLayout, context$1_Order as Order, type context$1_OrderedListData as OrderedListData, context$1_Orientation as Orientation, context$1_Origin as Origin, type context$1_PDFSettings as PDFSettings, type Paging$1 as Paging, type PagingMetadataV2$1 as PagingMetadataV2, type context$1_ParagraphData as ParagraphData, type context$1_PeriodPostCount as PeriodPostCount, type context$1_PeriodPublicationsCount as PeriodPublicationsCount, type context$1_Permissions as Permissions, type context$1_PinPostRequest as PinPostRequest, type context$1_PinPostResponse as PinPostResponse, type PlatformQuery$1 as PlatformQuery, type PlatformQueryPagingMethodOneOf$1 as PlatformQueryPagingMethodOneOf, type context$1_PlaybackOptions as PlaybackOptions, type context$1_PluginContainerData as PluginContainerData, context$1_PluginContainerDataAlignment as PluginContainerDataAlignment, type context$1_PluginContainerDataWidth as PluginContainerDataWidth, type context$1_PluginContainerDataWidthDataOneOf as PluginContainerDataWidthDataOneOf, type context$1_Poll as Poll, type context$1_PollData as PollData, type context$1_PollDataLayout as PollDataLayout, type context$1_PollDesign as PollDesign, type context$1_PollLayout as PollLayout, context$1_PollLayoutDirection as PollLayoutDirection, context$1_PollLayoutType as PollLayoutType, type context$1_PollSettings as PollSettings, type context$1_Post as Post, type context$1_PostCountInfo as PostCountInfo, type context$1_PostCountersUpdated as PostCountersUpdated, type context$1_PostCountersUpdatedInitiatorOneOf as PostCountersUpdatedInitiatorOneOf, type context$1_PostCreatedEnvelope as PostCreatedEnvelope, type context$1_PostDeletedEnvelope as PostDeletedEnvelope, context$1_PostFieldField as PostFieldField, type context$1_PostLiked as PostLiked, type context$1_PostLikedEnvelope as PostLikedEnvelope, type context$1_PostLikedInitiatorOneOf as PostLikedInitiatorOneOf, type context$1_PostOwnerChanged as PostOwnerChanged, type context$1_PostTranslation as PostTranslation, type context$1_PostUnliked as PostUnliked, type context$1_PostUnlikedEnvelope as PostUnlikedEnvelope, type context$1_PostUnlikedInitiatorOneOf as PostUnlikedInitiatorOneOf, type context$1_PostUpdatedEnvelope as PostUpdatedEnvelope, type context$1_PostsQueryBuilder as PostsQueryBuilder, type context$1_PostsQueryResult as PostsQueryResult, type context$1_QueryPostCountStatsOptions as QueryPostCountStatsOptions, type context$1_QueryPostCountStatsRequest as QueryPostCountStatsRequest, type context$1_QueryPostCountStatsResponse as QueryPostCountStatsResponse, type context$1_QueryPostCountStatsResponseNonNullableFields as QueryPostCountStatsResponseNonNullableFields, type context$1_QueryPostsOptions as QueryPostsOptions, type context$1_QueryPostsRequest as QueryPostsRequest, type context$1_QueryPostsResponse as QueryPostsResponse, type context$1_QueryPostsResponseNonNullableFields as QueryPostsResponseNonNullableFields, type context$1_QueryPublicationsCountStatsRequest as QueryPublicationsCountStatsRequest, context$1_QueryPublicationsCountStatsRequestOrder as QueryPublicationsCountStatsRequestOrder, type context$1_QueryPublicationsCountStatsResponse as QueryPublicationsCountStatsResponse, type context$1_Reactions as Reactions, type context$1_Rel as Rel, type RestoreInfo$1 as RestoreInfo, type context$1_RichContent as RichContent, type context$1_SendActionEventRequest as SendActionEventRequest, type context$1_SendActionEventRequestActionOneOf as SendActionEventRequestActionOneOf, type context$1_SendActionEventResponse as SendActionEventResponse, type SeoSchema$1 as SeoSchema, type Settings$1 as Settings, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, context$1_Source as Source, type context$1_Spoiler as Spoiler, type context$1_SpoilerData as SpoilerData, context$1_Status as Status, type context$1_Styles as Styles, type context$1_TableCellData as TableCellData, type context$1_TableData as TableData, type Tag$1 as Tag, context$1_Target as Target, context$1_TextAlignment as TextAlignment, type context$1_TextData as TextData, type context$1_TextNodeStyle as TextNodeStyle, type context$1_TextStyle as TextStyle, type context$1_Thumbnails as Thumbnails, context$1_ThumbnailsAlignment as ThumbnailsAlignment, context$1_Type as Type, type context$1_UnlikePostRequest as UnlikePostRequest, type context$1_UnlikePostResponse as UnlikePostResponse, type context$1_UnpinPostRequest as UnpinPostRequest, type context$1_UnpinPostResponse as UnpinPostResponse, type context$1_V1Media as V1Media, context$1_VerticalAlignment as VerticalAlignment, type context$1_Video as Video, type context$1_VideoData as VideoData, type context$1_VideoResolution as VideoResolution, context$1_ViewMode as ViewMode, type context$1_ViewPostRequest as ViewPostRequest, type context$1_ViewPostResponse as ViewPostResponse, context$1_ViewRole as ViewRole, context$1_VoteRole as VoteRole, WebhookIdentityType$1 as WebhookIdentityType, context$1_Width as Width, context$1_WidthType as WidthType, type context$1_WixMedia as WixMedia, type context$1__publicOnPostCreatedType as _publicOnPostCreatedType, type context$1__publicOnPostDeletedType as _publicOnPostDeletedType, type context$1__publicOnPostLikedType as _publicOnPostLikedType, type context$1__publicOnPostUnlikedType as _publicOnPostUnlikedType, type context$1__publicOnPostUpdatedType as _publicOnPostUpdatedType, context$1_getPost as getPost, context$1_getPostBySlug as getPostBySlug, context$1_getPostMetrics as getPostMetrics, context$1_getTotalPosts as getTotalPosts, context$1_listPosts as listPosts, context$1_onPostCreated as onPostCreated, context$1_onPostDeleted as onPostDeleted, context$1_onPostLiked as onPostLiked, context$1_onPostUnliked as onPostUnliked, context$1_onPostUpdated as onPostUpdated, onPostCreated$1 as publicOnPostCreated, onPostDeleted$1 as publicOnPostDeleted, onPostLiked$1 as publicOnPostLiked, onPostUnliked$1 as publicOnPostUnliked, onPostUpdated$1 as publicOnPostUpdated, context$1_queryPostCountStats as queryPostCountStats, context$1_queryPosts as queryPosts };
11441
9822
  }
11442
9823
 
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
9824
  interface BlogTag {
11854
9825
  /**
11855
9826
  * Tag ID.
@@ -12859,9 +10830,9 @@ interface DeleteTagSignature {
12859
10830
  */
12860
10831
  (tagId: string): Promise<void>;
12861
10832
  }
12862
- declare const onTagCreated$1: EventDefinition$1<TagCreatedEnvelope, "wix.blog.v3.tag_created">;
12863
- declare const onTagUpdated$1: EventDefinition$1<TagUpdatedEnvelope, "wix.blog.v3.tag_updated">;
12864
- declare const onTagDeleted$1: EventDefinition$1<TagDeletedEnvelope, "wix.blog.v3.tag_deleted">;
10833
+ declare const onTagCreated$1: EventDefinition$4<TagCreatedEnvelope, "wix.blog.v3.tag_created">;
10834
+ declare const onTagUpdated$1: EventDefinition$4<TagUpdatedEnvelope, "wix.blog.v3.tag_updated">;
10835
+ declare const onTagDeleted$1: EventDefinition$4<TagDeletedEnvelope, "wix.blog.v3.tag_deleted">;
12865
10836
 
12866
10837
  type EventDefinition<Payload = unknown, Type extends string = string> = {
12867
10838
  __type: 'event-definition';