diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index d323fe84..c7ee18d7 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -19,6 +19,7 @@ jobs: - slack-samples/deno-message-translator - slack-samples/deno-request-time-off - slack-samples/deno-simple-survey + - slack-samples/deno-github-functions steps: - name: Setup Deno diff --git a/src/providers/oauth2/mod.ts b/src/providers/oauth2/mod.ts index e15b177b..c0dd34bb 100644 --- a/src/providers/oauth2/mod.ts +++ b/src/providers/oauth2/mod.ts @@ -2,9 +2,10 @@ import { OAuth2ProviderDefinitionArgs, OAuth2ProviderOptions, } from "./types.ts"; - import { OAuth2ProviderTypeValues } from "../../schema/providers/oauth2/types.ts"; -import { ManifestOAuth2ProviderSchema } from "../../manifest/manifest_schema.ts"; +import { + ManifestOAuth2ProviderSchema, +} from "../../manifest/manifest_schema.ts"; export const DefineOAuth2Provider = ( definition: OAuth2ProviderDefinitionArgs, diff --git a/src/providers/oauth2/types.ts b/src/providers/oauth2/types.ts index 4fae724c..cc378d52 100644 --- a/src/providers/oauth2/types.ts +++ b/src/providers/oauth2/types.ts @@ -1,35 +1,36 @@ -import { OAuth2ProviderTypeValues } from "../../schema/providers/oauth2/types.ts"; +import { ManifestOAuth2ProviderSchema } from "../../manifest/manifest_schema.ts"; -export type OAuth2ProviderIdentitySchema = { - "url": string; - "account_identifier": string; - "headers"?: { - [key: string]: string; - }; +export type OAuth2ProviderDefinitionArgs = ManifestOAuth2ProviderSchema & { + /** A unique name for the provider */ + provider_key: string; }; +/** + * TODO: The type system here could be improved one more then one provider type (CUSTOM) is available + * provider_name, authorization_url, token_url, identity_config and authorization_url_extras + * are only required for CUSTOM provider types + */ export type OAuth2ProviderOptions = { - /** Client id for your provider */ - "client_id": string; - /** Scopes for your provider */ - "scope": string[]; - /** Display name for your provider. Required for CUSTOM provider types. */ - "provider_name"?: string; - /** Authorization url for your provider. Required for CUSTOM provider types. */ - "authorization_url"?: string; - /** Token url for your provider. Required for CUSTOM provider types. */ - "token_url"?: string; - /** Identity configuration for your provider. Required for CUSTOM provider types. */ - "identity_config"?: OAuth2ProviderIdentitySchema; + /** Client id for the provider */ + client_id: string; + /** Scopes for the provider */ + scope: string[]; + /** Display name for the provider. Required for CUSTOM provider types. */ + provider_name?: string; + /** Authorization url for the provider. Required for CUSTOM provider types. */ + authorization_url?: string; + /** Token url for the provider. Required for CUSTOM provider types. */ + token_url?: string; + /** Identity configuration for the provider. Required for CUSTOM provider types. */ + identity_config?: OAuth2ProviderIdentity; /** Optional extras dict for authorization url for your provider. Required for CUSTOM provider types. */ - "authorization_url_extras"?: { [key: string]: string }; + authorization_url_extras?: { [key: string]: string }; }; -export type OAuth2ProviderDefinitionArgs = { - /** A unique name for your provider */ - provider_key: string; - /** Type of your provider */ - provider_type: OAuth2ProviderTypeValues; - /** OAuth2 Configuration options for your provider */ - options: OAuth2ProviderOptions; +export type OAuth2ProviderIdentity = { + url: string; + account_identifier: string; + headers?: { + [key: string]: string; + }; };