@wix/sdk
Advanced tools
Comparing version
@@ -19,6 +19,6 @@ // we follow a simplified version of the axios convention | ||
// publicKey is base64 encoded | ||
return typeof btoa !== 'undefined' | ||
? btoa(publicKey) | ||
return typeof atob !== 'undefined' | ||
? atob(publicKey) | ||
: Buffer.from(publicKey, 'base64').toString('utf-8'); | ||
} | ||
} |
@@ -35,3 +35,3 @@ import { AuthenticationStrategy, BoundAuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, RESTFunctionDescriptor, SPIDefinition, EventDefinition } from '@wix/sdk-types'; | ||
*/ | ||
export type AssertHostMatches<T extends Descriptors, H extends Host<any>> = T extends HostModule<any, infer U> ? H extends undefined ? never : H extends U ? T : HostModule<any, H> : T extends RESTFunctionDescriptor<any> ? T : { | ||
export type AssertHostMatches<T extends Descriptors, H extends Host<any>> = T extends HostModule<any, infer U> ? H extends undefined ? never : H extends U ? T : `The host of this module does not match host provided to createClient.` : T extends RESTFunctionDescriptor<any> ? T : { | ||
[Key in keyof T]: T[Key] extends Descriptors ? AssertHostMatches<T[Key], H> : T[Key]; | ||
@@ -38,0 +38,0 @@ }; |
@@ -24,4 +24,4 @@ "use strict"; | ||
// publicKey is base64 encoded | ||
return typeof btoa !== 'undefined' | ||
? btoa(publicKey) | ||
return typeof atob !== 'undefined' | ||
? atob(publicKey) | ||
: Buffer.from(publicKey, 'base64').toString('utf-8'); | ||
@@ -28,0 +28,0 @@ } |
@@ -35,3 +35,3 @@ import { AuthenticationStrategy, BoundAuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, RESTFunctionDescriptor, SPIDefinition, EventDefinition } from '@wix/sdk-types'; | ||
*/ | ||
export type AssertHostMatches<T extends Descriptors, H extends Host<any>> = T extends HostModule<any, infer U> ? H extends undefined ? never : H extends U ? T : HostModule<any, H> : T extends RESTFunctionDescriptor<any> ? T : { | ||
export type AssertHostMatches<T extends Descriptors, H extends Host<any>> = T extends HostModule<any, infer U> ? H extends undefined ? never : H extends U ? T : `The host of this module does not match host provided to createClient.` : T extends RESTFunctionDescriptor<any> ? T : { | ||
[Key in keyof T]: T[Key] extends Descriptors ? AssertHostMatches<T[Key], H> : T[Key]; | ||
@@ -38,0 +38,0 @@ }; |
{ | ||
"name": "@wix/sdk", | ||
"version": "1.7.6", | ||
"version": "1.7.7", | ||
"license": "UNLICENSED", | ||
@@ -62,4 +62,4 @@ "author": { | ||
"@babel/runtime": "^7.23.2", | ||
"@wix/identity": "^1.0.73", | ||
"@wix/image-kit": "^1.56.0", | ||
"@wix/identity": "^1.0.74", | ||
"@wix/image-kit": "^1.58.0", | ||
"@wix/redirects": "^1.0.32", | ||
@@ -81,6 +81,6 @@ "@wix/sdk-types": "^1.5.9", | ||
"@vitest/ui": "^1.1.3", | ||
"@wix/ecom": "^1.0.477", | ||
"@wix/events": "^1.0.145", | ||
"@wix/ecom": "^1.0.495", | ||
"@wix/events": "^1.0.153", | ||
"@wix/metro": "^1.0.73", | ||
"@wix/metro-runtime": "^1.1635.0", | ||
"@wix/metro-runtime": "^1.1638.0", | ||
"@wix/sdk-runtime": "0.2.8", | ||
@@ -120,3 +120,3 @@ "eslint": "^8.56.0", | ||
}, | ||
"falconPackageHash": "676b313e3902721adc8337cd1542cd05dbe775e43ddee5030eef4706" | ||
"falconPackageHash": "14cbbfe86433a368e361f62c89354e3a6667cc7a256553b4c12a8f7f" | ||
} |
148275
0.07%Updated
Updated