Skip to content
Sarj Workspace Sync

identity-provisioning/identity-budget-contracts

@sarj-ai/workspace-sync/identity-provisioning/identity-budget-contracts ยท Source

import { z } from "zod";
export declare const IdentityBudgetParentKeySchema: z.core.$ZodBranded<z.ZodString, "IdentityBudgetParentKey", "out">;
export type IdentityBudgetParentKey = z.output<typeof IdentityBudgetParentKeySchema>;
export declare const IdentityBudgetServiceIdSchema: z.ZodUnion<readonly [z.ZodEnum<{
ashby: "ashby";
attio: "attio";
github: "github";
"google-workspace": "google-workspace";
linear: "linear";
pagerduty: "pagerduty";
posthog: "posthog";
sentry: "sentry";
slack: "slack";
}>, z.ZodLiteral<"trycomp">]>;
export type IdentityBudgetServiceId = z.output<typeof IdentityBudgetServiceIdSchema>;
declare const ParentInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"scheduled">;
scheduleId: z.ZodLiteral<"organization-sync">;
scheduledAtMs: z.ZodNumber;
}, z.core.$strict>, z.ZodObject<{
kind: z.ZodLiteral<"workflow">;
workflowExecutionId: z.ZodString;
}, z.core.$strict>], "kind">;
export declare function identityBudgetParentKey(input: z.input<typeof ParentInputSchema>): IdentityBudgetParentKey;
export declare const IdentityBudgetReservationSchema: z.ZodReadonly<z.ZodObject<{
parentExecutionKey: z.core.$ZodBranded<z.ZodString, "IdentityBudgetParentKey", "out">;
serviceId: z.ZodUnion<readonly [z.ZodEnum<{
ashby: "ashby";
attio: "attio";
github: "github";
"google-workspace": "google-workspace";
linear: "linear";
pagerduty: "pagerduty";
posthog: "posthog";
sentry: "sentry";
slack: "slack";
}>, z.ZodLiteral<"trycomp">]>;
googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">;
reservedAtMs: z.ZodNumber;
}, z.core.$strict>>;
export type IdentityBudgetReservation = z.output<typeof IdentityBudgetReservationSchema>;
export declare const IdentityBudgetReserveInputSchema: z.ZodObject<{
parentExecutionKey: z.core.$ZodBranded<z.ZodString, "IdentityBudgetParentKey", "out">;
serviceId: z.ZodUnion<readonly [z.ZodEnum<{
ashby: "ashby";
attio: "attio";
github: "github";
"google-workspace": "google-workspace";
linear: "linear";
pagerduty: "pagerduty";
posthog: "posthog";
sentry: "sentry";
slack: "slack";
}>, z.ZodLiteral<"trycomp">]>;
googleUserIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">>;
}, z.core.$strict>;
export type IdentityWriteBudget = {
readonly required: false;
} | {
readonly required: true;
readonly reserve: (googleUserId: string) => Promise<void>;
};
export declare function reserveIdentityWriteBudget(budget: IdentityWriteBudget | undefined, googleUserId: string | undefined): Promise<void>;
export {};