UNPKG

@altostra/core

Version:

Core library for shared types and logic

30 lines (29 loc) 1.43 kB
import type { NonEmptyString } from "../../common/CustomTypes/NonEmptyString"; import type { NaturalNumber } from "../../common/CustomTypes/Numerics"; import type { ConnectionBase } from "./Common"; export declare type ApiAuthorizerConnectionType = 'connection.api.authorizer'; export interface ApiAuthorizerConnection extends ConnectionBase { type: ApiAuthorizerConnectionType; cacheBehavior?: CachingBehavior; } export interface CachingBehavior { cacheTimeout: NaturalNumber | 0; identitySpecification?: IdentitySpecification; } export interface IdentitySpecification { headers?: IdentitySpecValue[]; query?: IdentitySpecValue[]; context?: IdentitySpecValue[]; stageParams?: IdentitySpecValue[]; } export declare const MAX_CACHE_TIMEOUT = 3600; export declare function isCacheTimeout(value: unknown): value is (NaturalNumber | 0); export declare const isApiAuthorizerConnection: import("@altostra/type-validations").ObjectOfTypeValidation<ApiAuthorizerConnection>; declare const identitySpecValueSym: unique symbol; export declare type IdentitySpecValue = NonEmptyString & { [identitySpecValueSym]: unknown; }; export declare function isIdentitySpecValue(value: unknown): value is IdentitySpecValue; export declare function validateIdentitySpecValue(value: unknown): asserts value is IdentitySpecValue; export declare function identitySpecValue(value: unknown): IdentitySpecValue; export {};