@wix/api-client
Advanced tools
Comparing version 1.12.1 to 1.12.2
import { WixClient } from './wixClient.js'; | ||
export declare function elevate<T extends (...arg: any) => any>(func: T): (...param: Parameters<T>) => ReturnType<T>; | ||
export declare function elevate<T extends (...arg: any) => any>(func: T): T; | ||
export declare const fetchWithAuth: WixClient['fetchWithAuth']; | ||
export declare const graphql: WixClient['graphql']; | ||
export { setGlobalWixContext } from './wix-context.js'; |
import { resolveContext } from '@wix/sdk-runtime/context'; | ||
export function elevate(func) { | ||
return (...args) => { | ||
return ((...args) => { | ||
let fullArgs = Array(func.length) | ||
@@ -12,6 +12,9 @@ .fill(undefined) | ||
return func(...fullArgs, { suppressAuth: true }); | ||
}; | ||
}); | ||
} | ||
export const fetchWithAuth = async (...args) => { | ||
const context = resolveContext(); | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.fetchWithAuth(...args); | ||
@@ -21,4 +24,7 @@ }; | ||
const context = resolveContext(); | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.graphql(...args); | ||
}; | ||
export { setGlobalWixContext } from './wix-context.js'; |
@@ -1,3 +0,2 @@ | ||
import { isObject } from './helpers.js'; | ||
export const isEventHandlerModule = (val) => isObject(val) && val.__type === 'event-definition'; | ||
export const isEventHandlerModule = (val) => val.__type === 'event-definition'; | ||
export function buildEventDefinition(eventDefinition, registerHandler) { | ||
@@ -18,3 +17,11 @@ return (handler) => { | ||
if (deletedEvent) { | ||
envelope = { metadata }; | ||
if (deletedEvent?.deletedEntity) { | ||
envelope = { | ||
entity: deletedEvent?.deletedEntity, | ||
metadata, | ||
}; | ||
} | ||
else { | ||
envelope = { metadata }; | ||
} | ||
} | ||
@@ -21,0 +28,0 @@ else if (actionEvent) { |
@@ -1,3 +0,2 @@ | ||
import { isObject } from './helpers.js'; | ||
export const isServicePluginModule = (val) => isObject(val) && val.__type === 'service-plugin-definition'; | ||
export const isServicePluginModule = (val) => val.__type === 'service-plugin-definition'; | ||
export function buildServicePluginDefinition(servicePluginDefinition, registrServicePluginImplementation, decodeJWT) { | ||
@@ -4,0 +3,0 @@ return (implementation) => { |
{ | ||
"name": "@wix/api-client", | ||
"version": "1.12.1", | ||
"version": "1.12.2", | ||
"license": "UNLICENSED", | ||
@@ -25,6 +25,6 @@ "main": "build/index.js", | ||
"@wix/identity": "^1.0.78", | ||
"@wix/image-kit": "^1.71.0", | ||
"@wix/image-kit": "^1.73.0", | ||
"@wix/redirects": "^1.0.41", | ||
"@wix/sdk-context": "^0.0.1", | ||
"@wix/sdk-runtime": "0.3.3", | ||
"@wix/sdk-runtime": "0.3.4", | ||
"@wix/sdk-types": "^1.9.1", | ||
@@ -39,3 +39,3 @@ "crypto-js": "^4.2.0", | ||
"@wix/metro-runtime": "^1.1677.0", | ||
"@wix/sdk": "1.12.1" | ||
"@wix/sdk": "1.12.2" | ||
}, | ||
@@ -53,3 +53,3 @@ "wix": { | ||
}, | ||
"falconPackageHash": "912c6ebcb7acbf759d13a89d2a68397d62c5bf0c8077b7e0bd1db925" | ||
"falconPackageHash": "791bb9900d0cd3694e8173a413976578fafa2d2d98247998e3c70276" | ||
} |
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
82464
2012
+ Added@wix/sdk-runtime@0.3.4(transitive)
- Removed@wix/sdk-runtime@0.3.3(transitive)
Updated@wix/image-kit@^1.73.0
Updated@wix/sdk-runtime@0.3.4