@stackbit/types
Advanced tools
Comparing version 0.11.15-staging.1 to 0.11.16-feature-custom-actions-permissions.1
@@ -15,2 +15,3 @@ import type { ConfigDelegate } from './config-delegate'; | ||
run: CustomActionRunFunction; | ||
permissions?: CustomActionPermissionsFunction; | ||
} | ||
@@ -23,2 +24,3 @@ export interface CustomActionBulk extends CustomActionCommonParams { | ||
}>; | ||
permissions?: CustomActionPermissionsFunction; | ||
} | ||
@@ -29,2 +31,3 @@ export interface CustomActionDocument extends CustomActionCommonParams { | ||
run: CustomActionRunFunction<CustomActionDocumentRunOptions>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionDocumentStateOptions>; | ||
} | ||
@@ -42,2 +45,3 @@ export interface CustomActionDocumentStateOptions { | ||
run: CustomActionRunFunction<CustomActionObjectModelRunParams>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionObjectModelStateParams>; | ||
} | ||
@@ -59,2 +63,3 @@ export interface CustomActionObjectModelStateParams { | ||
run: CustomActionRunFunction<CustomActionObjectFieldRunParams>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionObjectFieldStateParams>; | ||
} | ||
@@ -75,2 +80,3 @@ export interface CustomActionObjectFieldStateParams { | ||
run: CustomActionRunFunction<CustomActionFieldRunParams>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionFieldStateParams>; | ||
} | ||
@@ -96,2 +102,6 @@ export interface CustomActionFieldStateParams { | ||
export type CustomActionRunFunction<T = unknown> = (options: CustomActionRunCommonOptions & T) => Promise<CustomActionResult | void>; | ||
export type CustomActionPermissionsFunction<T = unknown> = (options: CustomActionStateCommonOptions & T) => CustomActionPermissions | undefined; | ||
export type CustomActionPermissions = { | ||
canExecute?: boolean; | ||
}; | ||
export type CustomActionState = 'enabled' | 'running' | 'disabled' | 'hidden'; | ||
@@ -98,0 +108,0 @@ export interface CustomActionStateCommonOptions extends ConfigDelegate { |
{ | ||
"name": "@stackbit/types", | ||
"version": "0.11.15-staging.1", | ||
"version": "0.11.16-feature-custom-actions-permissions.1", | ||
"description": "Types for Stackbit config and Content Source Interface", | ||
@@ -30,3 +30,3 @@ "main": "dist/index.js", | ||
"homepage": "https://github.com/stackbit/stackbit#readme", | ||
"gitHead": "0161baa1437c78fe496a98307c8150420cfc3c5e" | ||
"gitHead": "9872a8ed6760aa49f92f00ffd3f87acb8385bfa1" | ||
} |
@@ -33,2 +33,3 @@ import type { ConfigDelegate } from './config-delegate'; | ||
run: CustomActionRunFunction; | ||
permissions?: CustomActionPermissionsFunction; | ||
} | ||
@@ -40,2 +41,3 @@ | ||
run: CustomActionRunFunction<{ documents: DocumentWithSource[] }>; | ||
permissions?: CustomActionPermissionsFunction; | ||
} | ||
@@ -47,2 +49,3 @@ | ||
run: CustomActionRunFunction<CustomActionDocumentRunOptions>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionDocumentStateOptions>; | ||
} | ||
@@ -63,2 +66,3 @@ | ||
run: CustomActionRunFunction<CustomActionObjectModelRunParams>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionObjectModelStateParams>; | ||
} | ||
@@ -83,2 +87,3 @@ | ||
run: CustomActionRunFunction<CustomActionObjectFieldRunParams>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionObjectFieldStateParams>; | ||
} | ||
@@ -102,2 +107,3 @@ | ||
run: CustomActionRunFunction<CustomActionFieldRunParams>; | ||
permissions?: CustomActionPermissionsFunction<CustomActionFieldStateParams>; | ||
} | ||
@@ -131,3 +137,10 @@ | ||
) => Promise<CustomActionResult | void>; | ||
export type CustomActionPermissionsFunction<T = unknown> = ( | ||
options: CustomActionStateCommonOptions & T | ||
) => CustomActionPermissions | undefined; | ||
export type CustomActionPermissions = { | ||
canExecute?: boolean; | ||
}; | ||
export type CustomActionState = 'enabled' | 'running' | 'disabled' | 'hidden'; | ||
@@ -134,0 +147,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
387871
7002