@giteeteam/apps-api
Advanced tools
Comparing version 0.4.1 to 0.4.2
export type ResolverPayload = Record<string, any>; | ||
export type ResolverCallbackParams = { | ||
payload: ResolverPayload; | ||
applicationId?: string; | ||
sessionToken?: string; | ||
env?: Record<string, any>; | ||
}; | ||
export type ResolverCallback = (params: ResolverCallbackParams) => Promise<void>; | ||
export type ResolverCallback = (params: ResolverCallbackParams) => Promise<any>; | ||
export declare class Resolver { | ||
@@ -12,6 +15,9 @@ private functions; | ||
sanitizeObject(object: Record<string, any>): any; | ||
getDefinitions(): ({ _resolverMethod, payload }: { | ||
getDefinitions(): ({ _resolverMethod, payload, applicationId, sessionToken, env, }: { | ||
_resolverMethod: string; | ||
payload: ResolverPayload; | ||
applicationId: string; | ||
sessionToken?: string | undefined; | ||
env?: Record<string, any> | undefined; | ||
}) => Promise<any>; | ||
} |
@@ -25,6 +25,9 @@ export class Resolver { | ||
getDefinitions() { | ||
const resolve = async ({ _resolverMethod, payload }) => { | ||
const resolve = async ({ _resolverMethod, payload, applicationId, sessionToken, env, }) => { | ||
const cb = this.getFunction(_resolverMethod); | ||
const result = await cb({ | ||
payload: payload || {}, | ||
applicationId, | ||
sessionToken, | ||
env, | ||
}); | ||
@@ -31,0 +34,0 @@ if (typeof result === 'object') { |
{ | ||
"name": "@giteeteam/apps-api", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Giteeteam Apps API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
23548
621