@wix/sdk-runtime
Advanced tools
Comparing version 0.3.2 to 0.3.3
import { wixContext } from '@wix/sdk-context'; | ||
export function resolveContext() { | ||
const oldContext = typeof $wixContext !== 'undefined' && $wixContext.initWixModules | ||
? $wixContext.initWixModules | ||
: typeof globalThis.__wix_context__ !== 'undefined' && | ||
globalThis.__wix_context__.initWixModules | ||
? globalThis.__wix_context__.initWixModules | ||
: undefined; | ||
if (oldContext) { | ||
return { | ||
initWixModules: oldContext, | ||
fetchWithAuth() { | ||
throw new Error('fetchWithAuth is not available in this context'); | ||
}, | ||
graphql() { | ||
throw new Error('graphql is not available in this context'); | ||
}, | ||
}; | ||
} | ||
const contextualClient = typeof $wixContext !== 'undefined' | ||
@@ -48,3 +65,3 @@ ? $wixContext.client | ||
return context | ||
.initWixModules(restModule, args[expectedArgsLength]?.supressAuth ? true : false) | ||
.initWixModules(restModule, args[expectedArgsLength]?.suppressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -51,0 +68,0 @@ }); |
@@ -6,2 +6,19 @@ "use strict"; | ||
function resolveContext() { | ||
const oldContext = typeof $wixContext !== 'undefined' && $wixContext.initWixModules | ||
? $wixContext.initWixModules | ||
: typeof globalThis.__wix_context__ !== 'undefined' && | ||
globalThis.__wix_context__.initWixModules | ||
? globalThis.__wix_context__.initWixModules | ||
: undefined; | ||
if (oldContext) { | ||
return { | ||
initWixModules: oldContext, | ||
fetchWithAuth() { | ||
throw new Error('fetchWithAuth is not available in this context'); | ||
}, | ||
graphql() { | ||
throw new Error('graphql is not available in this context'); | ||
}, | ||
}; | ||
} | ||
const contextualClient = typeof $wixContext !== 'undefined' | ||
@@ -54,3 +71,3 @@ ? $wixContext.client | ||
return context | ||
.initWixModules(restModule, args[expectedArgsLength]?.supressAuth ? true : false) | ||
.initWixModules(restModule, args[expectedArgsLength]?.suppressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -57,0 +74,0 @@ }); |
{ | ||
"name": "@wix/sdk-runtime", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"license": "UNLICENSED", | ||
@@ -60,3 +60,3 @@ "sideEffects": false, | ||
"@wix/sdk-context": "^0.0.1", | ||
"@wix/sdk-types": "^1.9.0" | ||
"@wix/sdk-types": "^1.9.1" | ||
}, | ||
@@ -93,3 +93,3 @@ "devDependencies": { | ||
}, | ||
"falconPackageHash": "47532e4a9375fe949430df5c15effbb706bb7c742a9b0c2977f6b976" | ||
"falconPackageHash": "80967b5373f920f6a59c5c9b14fe1566dedf52574cc78d23d4ce430d" | ||
} |
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
153373
3994
Updated@wix/sdk-types@^1.9.1