@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
226 lines • 9.95 kB
TypeScript
import * as z from "zod/v3";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
export declare const SegmentOutcomeDataRulesType: {
readonly Entity: "entity";
};
export type SegmentOutcomeDataRulesType = ClosedEnum<typeof SegmentOutcomeDataRulesType>;
export type SegmentOutcomeBase = {
type: SegmentOutcomeDataRulesType;
kind: string;
attribute: string;
};
export type SegmentOutcome2 = {
type: "split";
base: SegmentOutcomeBase;
passPromille: number;
};
export type SegmentOutcome1 = {
type: "all";
};
export type SegmentOutcome = SegmentOutcome1 | SegmentOutcome2;
export declare const SegmentRhsDataType: {
readonly Regex: "regex";
};
export type SegmentRhsDataType = ClosedEnum<typeof SegmentRhsDataType>;
export type SegmentRhs4 = {
type: SegmentRhsDataType;
pattern: string;
flags: string;
};
export declare const SegmentRhsType: {
readonly List: "list";
readonly ListInline: "list/inline";
};
export type SegmentRhsType = ClosedEnum<typeof SegmentRhsType>;
export type SegmentItems2 = {
label?: string | undefined;
note?: string | undefined;
value: string;
};
export type SegmentItems1 = {
label?: string | undefined;
note?: string | undefined;
value: number;
};
export type SegmentRhsItems = SegmentItems1 | SegmentItems2;
export type SegmentRhs3 = {
type: SegmentRhsType;
items: Array<SegmentItems1 | SegmentItems2>;
};
export type SegmentRhs = SegmentRhs4 | SegmentRhs3 | string | number | boolean;
export type SegmentCmpOptions = {
ignoreCase?: boolean | undefined;
};
export type SegmentLhs2 = {
type: "entity";
kind: string;
attribute: string;
};
export type SegmentLhs1 = {
type: "segment";
};
export type SegmentLhs = SegmentLhs1 | SegmentLhs2;
export declare const SegmentCmp: {
readonly NotContains: "!contains";
readonly NotEndsWith: "!endsWith";
readonly NotEq: "!eq";
readonly NotEx: "!ex";
readonly NotOneOf: "!oneOf";
readonly NotRegex: "!regex";
readonly NotStartsWith: "!startsWith";
readonly After: "after";
readonly Before: "before";
readonly Contains: "contains";
readonly ContainsAllOf: "containsAllOf";
readonly ContainsAnyOf: "containsAnyOf";
readonly ContainsNoneOf: "containsNoneOf";
readonly EndsWith: "endsWith";
readonly Eq: "eq";
readonly Ex: "ex";
readonly Gt: "gt";
readonly Gte: "gte";
readonly Lt: "lt";
readonly Lte: "lte";
readonly OneOf: "oneOf";
readonly Regex: "regex";
readonly StartsWith: "startsWith";
};
export type SegmentCmp = ClosedEnum<typeof SegmentCmp>;
export type SegmentConditions = {
rhs?: SegmentRhs4 | SegmentRhs3 | string | number | boolean | undefined;
cmpOptions?: SegmentCmpOptions | undefined;
lhs: SegmentLhs1 | SegmentLhs2;
cmp: SegmentCmp;
};
export type SegmentRules = {
id: string;
outcome: SegmentOutcome1 | SegmentOutcome2;
conditions: Array<SegmentConditions>;
};
export type Include = {
note?: string | undefined;
value: string;
};
export type ExcludeT = {
note?: string | undefined;
value: string;
};
export type Data = {
rules?: Array<SegmentRules> | undefined;
include?: {
[k: string]: {
[k: string]: Array<Include>;
};
} | undefined;
exclude?: {
[k: string]: {
[k: string]: Array<ExcludeT>;
};
} | undefined;
};
export declare const SegmentTypeName: {
readonly Segment: "segment";
};
export type SegmentTypeName = ClosedEnum<typeof SegmentTypeName>;
export type SegmentCreator = {
id: string;
name: string;
};
export type SegmentMetadata = {
creator?: SegmentCreator | undefined;
};
export type Segment = {
description?: string | undefined;
createdBy?: string | undefined;
usedByFlags?: Array<string> | undefined;
usedBySegments?: Array<string> | undefined;
data: Data;
id: string;
label: string;
slug: string;
createdAt: number;
updatedAt: number;
projectId: string;
typeName: SegmentTypeName;
hint: string;
metadata?: SegmentMetadata | undefined;
};
/** @internal */
export declare const SegmentOutcomeDataRulesType$inboundSchema: z.ZodNativeEnum<typeof SegmentOutcomeDataRulesType>;
/** @internal */
export declare const SegmentOutcomeBase$inboundSchema: z.ZodType<SegmentOutcomeBase, z.ZodTypeDef, unknown>;
export declare function segmentOutcomeBaseFromJSON(jsonString: string): SafeParseResult<SegmentOutcomeBase, SDKValidationError>;
/** @internal */
export declare const SegmentOutcome2$inboundSchema: z.ZodType<SegmentOutcome2, z.ZodTypeDef, unknown>;
export declare function segmentOutcome2FromJSON(jsonString: string): SafeParseResult<SegmentOutcome2, SDKValidationError>;
/** @internal */
export declare const SegmentOutcome1$inboundSchema: z.ZodType<SegmentOutcome1, z.ZodTypeDef, unknown>;
export declare function segmentOutcome1FromJSON(jsonString: string): SafeParseResult<SegmentOutcome1, SDKValidationError>;
/** @internal */
export declare const SegmentOutcome$inboundSchema: z.ZodType<SegmentOutcome, z.ZodTypeDef, unknown>;
export declare function segmentOutcomeFromJSON(jsonString: string): SafeParseResult<SegmentOutcome, SDKValidationError>;
/** @internal */
export declare const SegmentRhsDataType$inboundSchema: z.ZodNativeEnum<typeof SegmentRhsDataType>;
/** @internal */
export declare const SegmentRhs4$inboundSchema: z.ZodType<SegmentRhs4, z.ZodTypeDef, unknown>;
export declare function segmentRhs4FromJSON(jsonString: string): SafeParseResult<SegmentRhs4, SDKValidationError>;
/** @internal */
export declare const SegmentRhsType$inboundSchema: z.ZodNativeEnum<typeof SegmentRhsType>;
/** @internal */
export declare const SegmentItems2$inboundSchema: z.ZodType<SegmentItems2, z.ZodTypeDef, unknown>;
export declare function segmentItems2FromJSON(jsonString: string): SafeParseResult<SegmentItems2, SDKValidationError>;
/** @internal */
export declare const SegmentItems1$inboundSchema: z.ZodType<SegmentItems1, z.ZodTypeDef, unknown>;
export declare function segmentItems1FromJSON(jsonString: string): SafeParseResult<SegmentItems1, SDKValidationError>;
/** @internal */
export declare const SegmentRhsItems$inboundSchema: z.ZodType<SegmentRhsItems, z.ZodTypeDef, unknown>;
export declare function segmentRhsItemsFromJSON(jsonString: string): SafeParseResult<SegmentRhsItems, SDKValidationError>;
/** @internal */
export declare const SegmentRhs3$inboundSchema: z.ZodType<SegmentRhs3, z.ZodTypeDef, unknown>;
export declare function segmentRhs3FromJSON(jsonString: string): SafeParseResult<SegmentRhs3, SDKValidationError>;
/** @internal */
export declare const SegmentRhs$inboundSchema: z.ZodType<SegmentRhs, z.ZodTypeDef, unknown>;
export declare function segmentRhsFromJSON(jsonString: string): SafeParseResult<SegmentRhs, SDKValidationError>;
/** @internal */
export declare const SegmentCmpOptions$inboundSchema: z.ZodType<SegmentCmpOptions, z.ZodTypeDef, unknown>;
export declare function segmentCmpOptionsFromJSON(jsonString: string): SafeParseResult<SegmentCmpOptions, SDKValidationError>;
/** @internal */
export declare const SegmentLhs2$inboundSchema: z.ZodType<SegmentLhs2, z.ZodTypeDef, unknown>;
export declare function segmentLhs2FromJSON(jsonString: string): SafeParseResult<SegmentLhs2, SDKValidationError>;
/** @internal */
export declare const SegmentLhs1$inboundSchema: z.ZodType<SegmentLhs1, z.ZodTypeDef, unknown>;
export declare function segmentLhs1FromJSON(jsonString: string): SafeParseResult<SegmentLhs1, SDKValidationError>;
/** @internal */
export declare const SegmentLhs$inboundSchema: z.ZodType<SegmentLhs, z.ZodTypeDef, unknown>;
export declare function segmentLhsFromJSON(jsonString: string): SafeParseResult<SegmentLhs, SDKValidationError>;
/** @internal */
export declare const SegmentCmp$inboundSchema: z.ZodNativeEnum<typeof SegmentCmp>;
/** @internal */
export declare const SegmentConditions$inboundSchema: z.ZodType<SegmentConditions, z.ZodTypeDef, unknown>;
export declare function segmentConditionsFromJSON(jsonString: string): SafeParseResult<SegmentConditions, SDKValidationError>;
/** @internal */
export declare const SegmentRules$inboundSchema: z.ZodType<SegmentRules, z.ZodTypeDef, unknown>;
export declare function segmentRulesFromJSON(jsonString: string): SafeParseResult<SegmentRules, SDKValidationError>;
/** @internal */
export declare const Include$inboundSchema: z.ZodType<Include, z.ZodTypeDef, unknown>;
export declare function includeFromJSON(jsonString: string): SafeParseResult<Include, SDKValidationError>;
/** @internal */
export declare const ExcludeT$inboundSchema: z.ZodType<ExcludeT, z.ZodTypeDef, unknown>;
export declare function excludeFromJSON(jsonString: string): SafeParseResult<ExcludeT, SDKValidationError>;
/** @internal */
export declare const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown>;
export declare function dataFromJSON(jsonString: string): SafeParseResult<Data, SDKValidationError>;
/** @internal */
export declare const SegmentTypeName$inboundSchema: z.ZodNativeEnum<typeof SegmentTypeName>;
/** @internal */
export declare const SegmentCreator$inboundSchema: z.ZodType<SegmentCreator, z.ZodTypeDef, unknown>;
export declare function segmentCreatorFromJSON(jsonString: string): SafeParseResult<SegmentCreator, SDKValidationError>;
/** @internal */
export declare const SegmentMetadata$inboundSchema: z.ZodType<SegmentMetadata, z.ZodTypeDef, unknown>;
export declare function segmentMetadataFromJSON(jsonString: string): SafeParseResult<SegmentMetadata, SDKValidationError>;
/** @internal */
export declare const Segment$inboundSchema: z.ZodType<Segment, z.ZodTypeDef, unknown>;
export declare function segmentFromJSON(jsonString: string): SafeParseResult<Segment, SDKValidationError>;
//# sourceMappingURL=segment.d.ts.map