@wix/sdk 1.9.2 → 1.9.3

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.
@@ -11,19 +11,12 @@ type Headers = Record<string, string>;
11
11
  * Any non-descriptor properties are removed from the returned object, including descriptors that
12
12
  * do not match the given host (as they will not work with the given host).
13
13
  */
14
- export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined> = BuildRESTDescriptors<T> & BuildAmbassadorDescriptors<T> & BuildEventDefinitions<T> & (H extends Host<any> ? BuildHostDescriptors<T> : {});
15
- type BuildRESTDescriptors<T extends Descriptors> = T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : ConditionalExcept<{
16
- [Key in keyof T]: T[Key] extends Descriptors ? BuildRESTDescriptors<T[Key]> : never;
17
- }, EmptyObject>;
18
- type BuildAmbassadorDescriptors<T extends Descriptors> = T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : ConditionalExcept<{
19
- [Key in keyof T]: T[Key] extends Descriptors ? BuildAmbassadorDescriptors<T[Key]> : never;
20
- }, EmptyObject>;
21
- type BuildHostDescriptors<T extends Descriptors> = T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
22
- [Key in keyof T]: T[Key] extends Descriptors ? BuildHostDescriptors<T[Key]> : never;
23
- }, EmptyObject>;
24
- type BuildEventDefinitions<T extends Descriptors> = T extends EventDefinition ? BuildEventDefinition<T> : ConditionalExcept<{
25
- [Key in keyof T]: T[Key] extends Descriptors ? BuildEventDefinitions<T[Key]> : never;
26
- }, EmptyObject>;
14
+ export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
15
+ done: T;
16
+ recurse: T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition ? BuildEventDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
17
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [-1, 0, 1, 2, 3, 4, 5][Depth]> : never;
18
+ }, EmptyObject>;
19
+ }[Depth extends -1 ? 'done' : 'recurse'];
27
20
  /**
28
21
  * Descriptors are objects that describe the API of a module, and the module
29
22
  * can either be a REST module or a host module.
@@ -11,19 +11,12 @@ type Headers = Record<string, string>;
11
11
  * Any non-descriptor properties are removed from the returned object, including descriptors that
12
12
  * do not match the given host (as they will not work with the given host).
13
13
  */
14
- export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined> = BuildRESTDescriptors<T> & BuildAmbassadorDescriptors<T> & BuildEventDefinitions<T> & (H extends Host<any> ? BuildHostDescriptors<T> : {});
15
- type BuildRESTDescriptors<T extends Descriptors> = T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : ConditionalExcept<{
16
- [Key in keyof T]: T[Key] extends Descriptors ? BuildRESTDescriptors<T[Key]> : never;
17
- }, EmptyObject>;
18
- type BuildAmbassadorDescriptors<T extends Descriptors> = T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : ConditionalExcept<{
19
- [Key in keyof T]: T[Key] extends Descriptors ? BuildAmbassadorDescriptors<T[Key]> : never;
20
- }, EmptyObject>;
21
- type BuildHostDescriptors<T extends Descriptors> = T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
22
- [Key in keyof T]: T[Key] extends Descriptors ? BuildHostDescriptors<T[Key]> : never;
23
- }, EmptyObject>;
24
- type BuildEventDefinitions<T extends Descriptors> = T extends EventDefinition ? BuildEventDefinition<T> : ConditionalExcept<{
25
- [Key in keyof T]: T[Key] extends Descriptors ? BuildEventDefinitions<T[Key]> : never;
26
- }, EmptyObject>;
14
+ export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
15
+ done: T;
16
+ recurse: T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition ? BuildEventDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
17
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [-1, 0, 1, 2, 3, 4, 5][Depth]> : never;
18
+ }, EmptyObject>;
19
+ }[Depth extends -1 ? 'done' : 'recurse'];
27
20
  /**
28
21
  * Descriptors are objects that describe the API of a module, and the module
29
22
  * can either be a REST module or a host module.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -120,5 +120,5 @@
120
120
  "wallaby": {
121
121
  "autoDetect": true
122
122
  },
123
- "falconPackageHash": "71774a6a839caae0eb644c899a798b3b14296d9c6321d8fae8dfeca5"
123
+ "falconPackageHash": "b793f7d8e56d121118c1a7a6f27eb8df6d14f23cdc6399d6352dd96f"
124
124
  }