UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

86 lines 4.98 kB
import * as z from "zod"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { V2Ratelimit, V2Ratelimit$Outbound } from "./v2ratelimit.js"; /** * Attach metadata to this identity that you need to have access to when verifying a key. * * @remarks * * This will be returned as part of the `verifyKey` response. */ export type V2IdentitiesCreateIdentityRequestBodyMeta = {}; export type V2IdentitiesCreateIdentityRequestBody = { /** * The id of this identity in your system. * * @remarks * * This usually comes from your authentication provider and could be a userId, organisationId or even an email. * It does not matter what you use, as long as it uniquely identifies something in your application. * * `externalId`s are unique across your workspace and therefore a `CONFLICT` error is returned when you try to create duplicates. */ externalId: string; /** * Attach metadata to this identity that you need to have access to when verifying a key. * * @remarks * * This will be returned as part of the `verifyKey` response. */ meta?: V2IdentitiesCreateIdentityRequestBodyMeta | undefined; /** * Attach ratelimits to this identity. * * @remarks * * When verifying keys, you can specify which limits you want to use and all keys attached to this identity, will share the limits. */ ratelimits?: Array<V2Ratelimit> | undefined; }; /** @internal */ export declare const V2IdentitiesCreateIdentityRequestBodyMeta$inboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBodyMeta, z.ZodTypeDef, unknown>; /** @internal */ export type V2IdentitiesCreateIdentityRequestBodyMeta$Outbound = {}; /** @internal */ export declare const V2IdentitiesCreateIdentityRequestBodyMeta$outboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBodyMeta$Outbound, z.ZodTypeDef, V2IdentitiesCreateIdentityRequestBodyMeta>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace V2IdentitiesCreateIdentityRequestBodyMeta$ { /** @deprecated use `V2IdentitiesCreateIdentityRequestBodyMeta$inboundSchema` instead. */ const inboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBodyMeta, z.ZodTypeDef, unknown>; /** @deprecated use `V2IdentitiesCreateIdentityRequestBodyMeta$outboundSchema` instead. */ const outboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBodyMeta$Outbound, z.ZodTypeDef, V2IdentitiesCreateIdentityRequestBodyMeta>; /** @deprecated use `V2IdentitiesCreateIdentityRequestBodyMeta$Outbound` instead. */ type Outbound = V2IdentitiesCreateIdentityRequestBodyMeta$Outbound; } export declare function v2IdentitiesCreateIdentityRequestBodyMetaToJSON(v2IdentitiesCreateIdentityRequestBodyMeta: V2IdentitiesCreateIdentityRequestBodyMeta): string; export declare function v2IdentitiesCreateIdentityRequestBodyMetaFromJSON(jsonString: string): SafeParseResult<V2IdentitiesCreateIdentityRequestBodyMeta, SDKValidationError>; /** @internal */ export declare const V2IdentitiesCreateIdentityRequestBody$inboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBody, z.ZodTypeDef, unknown>; /** @internal */ export type V2IdentitiesCreateIdentityRequestBody$Outbound = { externalId: string; meta?: V2IdentitiesCreateIdentityRequestBodyMeta$Outbound | undefined; ratelimits?: Array<V2Ratelimit$Outbound> | undefined; }; /** @internal */ export declare const V2IdentitiesCreateIdentityRequestBody$outboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBody$Outbound, z.ZodTypeDef, V2IdentitiesCreateIdentityRequestBody>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace V2IdentitiesCreateIdentityRequestBody$ { /** @deprecated use `V2IdentitiesCreateIdentityRequestBody$inboundSchema` instead. */ const inboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBody, z.ZodTypeDef, unknown>; /** @deprecated use `V2IdentitiesCreateIdentityRequestBody$outboundSchema` instead. */ const outboundSchema: z.ZodType<V2IdentitiesCreateIdentityRequestBody$Outbound, z.ZodTypeDef, V2IdentitiesCreateIdentityRequestBody>; /** @deprecated use `V2IdentitiesCreateIdentityRequestBody$Outbound` instead. */ type Outbound = V2IdentitiesCreateIdentityRequestBody$Outbound; } export declare function v2IdentitiesCreateIdentityRequestBodyToJSON(v2IdentitiesCreateIdentityRequestBody: V2IdentitiesCreateIdentityRequestBody): string; export declare function v2IdentitiesCreateIdentityRequestBodyFromJSON(jsonString: string): SafeParseResult<V2IdentitiesCreateIdentityRequestBody, SDKValidationError>; //# sourceMappingURL=v2identitiescreateidentityrequestbody.d.ts.map