@wix/api-client
Advanced tools
Comparing version 1.10.1 to 1.10.2
@@ -8,2 +8,3 @@ import { AuthenticationStrategy, BoundAuthenticationStrategy, BuildEventDefinition, BuildRESTFunction, EventDefinition, EventIdentity, Host, HostModule, HostModuleAPI, RESTFunctionDescriptor, ServicePluginDefinition, BuildServicePluginDefinition, ServicePluginContract } from '@wix/sdk-types'; | ||
type Headers = Record<string, string>; | ||
declare const SPI_ERROR_TYPE = "wix_spi_error"; | ||
/** | ||
@@ -17,4 +18,14 @@ * This type takes in a descriptors object of a certain Host (including an `unknown` host) | ||
done: T; | ||
recurse: T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [-1, 0, 1, 2, 3, 4, 5][Depth]> : never; | ||
recurse: T extends { | ||
__type: typeof SPI_ERROR_TYPE; | ||
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [ | ||
-1, | ||
0, | ||
1, | ||
2, | ||
3, | ||
4, | ||
5 | ||
][Depth]> : never; | ||
}, EmptyObject>; | ||
@@ -21,0 +32,0 @@ }[Depth extends -1 ? 'done' : 'recurse']; |
@@ -10,2 +10,3 @@ import { EventDefinition, } from '@wix/sdk-types'; | ||
import { buildServicePluginDefinition, isServicePluginModule, } from './service-plugin-modules.js'; | ||
const SPI_ERROR_TYPE = 'wix_spi_error'; | ||
export function createClient(config) { | ||
@@ -56,2 +57,8 @@ const _headers = config.headers || { Authorization: '' }; | ||
else if (typeof modules === 'function') { | ||
// The generated namespaces all have the error classes on them and | ||
// a class is also a function, so we need to explicitly ignore these | ||
// error classes using a static field that exists on them. | ||
if ('__type' in modules && modules.__type === SPI_ERROR_TYPE) { | ||
return modules; | ||
} | ||
const { module, options } = isAmbassadorModule(modules) | ||
@@ -58,0 +65,0 @@ ? { |
{ | ||
"name": "@wix/api-client", | ||
"version": "1.10.1", | ||
"version": "1.10.2", | ||
"license": "UNLICENSED", | ||
@@ -36,3 +36,3 @@ "main": "build/index.js", | ||
"@wix/metro-runtime": "^1.1677.0", | ||
"@wix/sdk": "1.10.1" | ||
"@wix/sdk": "1.10.2" | ||
}, | ||
@@ -50,3 +50,3 @@ "wix": { | ||
}, | ||
"falconPackageHash": "b37d542b7d9a0534e1d18d57f52098247bbaa01d885452bb02f3d867" | ||
"falconPackageHash": "5255eaa26d485f44b79cdb972a5c5beafaf5354ba31fd4fe6f21e011" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80177
1959