From 0916e4c39d346bd2a6932c788664dd1cad0a5bdb Mon Sep 17 00:00:00 2001 From: Peter Phanouvong Date: Tue, 14 Jan 2025 14:14:17 +1100 Subject: [PATCH 1/2] types: kinde binding --- lib/types.ts | 88 +++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/lib/types.ts b/lib/types.ts index d4a95668..63c32660 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -22,56 +22,58 @@ export type WorkflowSettings = { action: "stop" | "continue"; }; - bindings?: { - /** - * Exposes the id token to the workflow - */ - "kinde.idToken"?: { - /** - * {boolean} reset all claims to default value on workflow start, default is false - */ - resetClaims?: boolean; - }; - /** - * Exposes the access token to the workflow - */ - "kinde.accessToken"?: { - /** - * {boolean} reset all claims to default value on workflow start, default is false - */ - resetClaims?: boolean; - }; - "kinde.m2mToken"?: { - /** - * {boolean} reset all claims to default value on workflow start, default is false - */ - resetClaims?: boolean; - }; - /** - * Exposes the console methods to the workflow - */ - console?: {}; - /** - * Exposes the fetch method to call extenal APIs to the workflow - */ - "kinde.fetch"?: {}; - /** - * Exposes access to the kinde environment variables - */ - "kinde.env"?: {}; + bindings?: KindeBindings; +}; + +export interface KindeBindings { + /** + * Exposes the id token to the workflow + */ + "kinde.idToken"?: { /** - * Exposes access to the kinde environment variables + * {boolean} reset all claims to default value on workflow start, default is false */ - "kinde.auth"?: {}; + resetClaims?: boolean; + }; + /** + * Exposes the access token to the workflow + */ + "kinde.accessToken"?: { /** - * Exposes access to the kinde localization + * {boolean} reset all claims to default value on workflow start, default is false */ - "kinde.localization": {}; + resetClaims?: boolean; + }; + "kinde.m2mToken"?: { /** - * Add URL tooling + * {boolean} reset all claims to default value on workflow start, default is false */ - url?: {}; + resetClaims?: boolean; }; + /** + * Exposes the console methods to the workflow + */ + console?: {}; + /** + * Exposes the fetch method to call extenal APIs to the workflow + */ + "kinde.fetch"?: {}; + /** + * Exposes access to the kinde environment variables + */ + "kinde.env"?: {}; + /** + * Exposes access to the kinde environment variables + */ + "kinde.auth"?: {}; + /** + * Exposes access to the kinde localization + */ + "kinde.localization": {}; + /** + * Add URL tooling + */ + url?: {}; }; export enum WorkflowTrigger { From 72d2aaaca51f43e5a02ea0d57f6b97bc6626369e Mon Sep 17 00:00:00 2001 From: Peter Phanouvong Date: Wed, 15 Jan 2025 11:32:20 +1100 Subject: [PATCH 2/2] types: optional localization --- lib/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types.ts b/lib/types.ts index 63c32660..43fdc04a 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -69,7 +69,7 @@ export interface KindeBindings { /** * Exposes access to the kinde localization */ - "kinde.localization": {}; + "kinde.localization"?: {}; /** * Add URL tooling */