@casual-simulation/aux-common
Version:
Common library for AUX projects
1,473 lines • 54.3 kB
TypeScript
import { z } from 'zod';
/**
* The possible types of subjects that can be affected by permissions.
*
* - "user" - The permission is for a user.
* - "inst" - The permission is for an inst.
* - "role" - The permission is for a role.
*
* @dochash types/permissions
* @doctitle Permissions Types
* @docsidebar Permissions
* @docdescription Types that represent permissions that control access to resources.
* @docname SubjectType
*/
export type SubjectType = 'user' | 'inst' | 'role';
export declare const DATA_RESOURCE_KIND = "data";
export declare const FILE_RESOURCE_KIND = "file";
export declare const EVENT_RESOURCE_KIND = "event";
export declare const MARKER_RESOURCE_KIND = "marker";
export declare const ROLE_RESOURCE_KIND = "role";
export declare const INST_RESOURCE_KIND = "inst";
export declare const LOOM_RESOURCE_KIND = "loom";
export declare const SLOYD_RESOURCE_KIND = "ai.sloyd";
export declare const HUME_RESOURCE_KIND = "ai.hume";
export declare const OPENAI_REALTIME_RESOURCE_KIND = "ai.openai.realtime";
export declare const WEBHOOK_RESOURCE_KIND = "webhook";
export declare const NOTIFICATION_RESOURCE_KIND = "notification";
export declare const PACKAGE_RESOURCE_KIND = "package";
export declare const PACKAGE_VERSION_RESOURCE_KIND = "package.version";
export declare const SEARCH_RESOURCE_KIND = "search";
/**
* The possible types of resources that can be affected by permissions.
*
* @dochash types/permissions
* @docname ResourceKinds
*/
export type ResourceKinds = 'data' | 'file' | 'event' | 'marker' | 'role' | 'inst' | 'webhook' | 'notification' | 'package' | 'package.version' | 'search' | 'loom' | 'ai.sloyd' | 'ai.hume' | 'ai.openai.realtime';
export declare const READ_ACTION = "read";
export declare const CREATE_ACTION = "create";
export declare const UPDATE_ACTION = "update";
export declare const DELETE_ACTION = "delete";
export declare const ASSIGN_ACTION = "assign";
export declare const UNASSIGN_ACTION = "unassign";
export declare const INCREMENT_ACTION = "increment";
export declare const COUNT_ACTION = "count";
export declare const LIST_ACTION = "list";
export declare const GRANT_PERMISSION_ACTION = "grantPermission";
export declare const REVOKE_PERMISSION_ACTION = "revokePermission";
export declare const GRANT_ACTION = "grant";
export declare const REVOKE_ACTION = "revoke";
export declare const SEND_ACTION_ACTION = "sendAction";
export declare const UPDATE_DATA_ACTION = "updateData";
export declare const RUN_ACTION = "run";
export declare const SEND_ACTION = "send";
export declare const SUBSCRIBE_ACTION = "subscribe";
export declare const UNSUBSCRIBE_ACTION = "unsubscribe";
export declare const LIST_SUBSCRIPTIONS_ACTION = "listSubscriptions";
/**
* The possible types of actions that can be performed on resources.
*
* @dochash types/permissions
* @docname ActionKinds
*/
export type ActionKinds = 'read' | 'create' | 'update' | 'delete' | 'assign' | 'unassign' | 'increment' | 'count' | 'list' | 'grantPermission' | 'revokePermission' | 'grant' | 'revoke' | 'sendAction' | 'updateData' | 'run' | 'send' | 'subscribe' | 'unsubscribe' | 'listSubscriptions';
/**
* The possible types of actions that can be performed on data resources.
*
* @dochash types/permissions
* @docname DataActionKinds
*/
export type DataActionKinds = 'read' | 'create' | 'update' | 'delete' | 'list';
/**
* The possible types of actions that can be performed on file resources.
*
* @dochash types/permissions
* @docname FileActionKinds
*/
export type FileActionKinds = 'read' | 'create' | 'update' | 'delete' | 'list';
/**
* The possible types of actions that can be performed on event resources.
*
* @dochash types/permissions
* @docname EventActionKinds
*/
export type EventActionKinds = 'increment' | 'count' | 'update' | 'list';
/**
* The possible types of actions that can be performed on marker resources.
*
* @dochash types/permissions
* @docname MarkerActionKinds
*/
export type MarkerActionKinds = 'assign' | 'unassign' | 'grantPermission' | 'revokePermission' | 'read';
/**
* The possible types of actions that can be performed on roles resources.
*
* @dochash types/permissions
* @docname RoleActionKinds
*/
export type RoleActionKinds = 'grant' | 'revoke' | 'read' | 'update' | 'list';
/**
* The possible types of actions that can be performed on inst resources.
*
* @dochash types/permissions
* @docname InstActionKinds
*/
export type InstActionKinds = 'create' | 'read' | 'update' | 'updateData' | 'delete' | 'list' | 'sendAction';
/**
* The possible types of actions that can be performed on loom resources.
*
* @dochash types/permissions
* @docname LoomActionKinds
*/
export type LoomActionKinds = 'create';
/**
* The possible types of actions that can be performed on ai.sloyd resources.
*
* @dochash types/permissions
* @docname SloydActionKinds
*/
export type SloydActionKinds = 'create';
/**
* The possible types of actions that can be performed on ai.hume resources.
*
* @dochash types/permissions
* @docname HumeActionKinds
*/
export type HumeActionKinds = 'create';
/**
* The possible types of actions that can be performed on ai.openai.realtime resources.
*
* @dochash types/permissions
* @docname OpenAIRealtimeActionKinds
*/
export type OpenAIRealtimeActionKinds = 'create';
/**
* The possible types of actions that can be performed on webhook resources.
*
* @dochash types/permissions
* @docname WebhookActionKinds
*/
export type WebhookActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list' | 'run';
/**
* The possible types of actions that can be performed on notification resources.
*
* @dochash types/permissions
* @docname NotificationActionKinds
*/
export type NotificationActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list' | 'send' | 'subscribe' | 'unsubscribe' | 'listSubscriptions';
/**
* The possible types of actions that can be performed on package resources.
*
* @dochash types/permissions
* @docname PackageActionKinds
*/
export type PackageActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list' | 'run';
/**
* The possible types of actions that can be performed on package.version resources.
*
* @dochash types/permissions
* @docname PackageVersionActionKinds
*/
export type PackageVersionActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list' | 'run';
/**
* The possible types of actions that can be performed on search resources.
*
* @dochash types/permissions
* @docname SearchActionKinds
*/
export type SearchActionKinds = 'create' | 'read' | 'update' | 'delete' | 'list';
/**
* The possible types of permissions that can be added to policies.
*
* @dochash types/permissions
* @doctitle Permissions Types
* @docsidebar Permissions
* @docdescription Types that represent permissions that control access to resources.
* @docname AvailablePermissions
*/
export type AvailablePermissions = DataPermission | FilePermission | EventPermission | MarkerPermission | RolePermission | InstPermission | LoomPermission | SloydPermission | HumePermission | OpenAIRealtimePermission | WebhookPermission | NotificationPermission | PackagePermission | PackageVersionPermission | SearchPermission;
export declare const SUBJECT_TYPE_VALIDATION: z.ZodEnum<["user", "inst", "role"]>;
export declare const DATA_ACTION_KINDS_VALIDATION: z.ZodEnum<["read", "create", "update", "delete", "list"]>;
export declare const FILE_ACTION_KINDS_VALIDATION: z.ZodEnum<["read", "create", "update", "delete", "list"]>;
export declare const EVENT_ACTION_KINDS_VALIDATION: z.ZodEnum<["increment", "count", "update", "list"]>;
export declare const MARKER_ACTION_KINDS_VALIDATION: z.ZodEnum<["assign", "unassign", "grantPermission", "revokePermission", "read"]>;
export declare const ROLE_ACTION_KINDS_VALIDATION: z.ZodEnum<["grant", "revoke", "read", "update", "list"]>;
export declare const INST_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction"]>;
export declare const LOOM_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
export declare const SLOYD_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
export declare const HUME_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
export declare const OPENAI_REALTIME_ACTION_KINDS_VALIDATION: z.ZodEnum<["create"]>;
export declare const WEBHOOK_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
export declare const NOTIFICATION_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "send", "subscribe", "unsubscribe", "listSubscriptions"]>;
export declare const PACKAGE_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
export declare const PACKAGE_VERSION_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>;
export declare const SEARCH_ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "delete", "list"]>;
export declare const RESOURCE_KIND_VALIDATION: z.ZodEnum<["data", "file", "event", "marker", "role", "inst", "loom", "ai.sloyd", "ai.hume", "ai.openai.realtime", "webhook", "notification", "package", "package.version", "search"]>;
export declare const ACTION_KINDS_VALIDATION: z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction", "assign", "unassign", "grant", "revoke", "increment", "count", "grantPermission", "revokePermission", "run", "send", "subscribe", "unsubscribe", "listSubscriptions"]>;
/**
* The scopes that can be used for requested entitlements.
* This can be used to limit the entitlement to requesting a category of resources.
* For example, the "personal" scope would limit the entitlement to requesting access to the user's personal resources.
*
* - "personal" - The entitlement is for personal (user-specific) records. This would allow the package to request access to resources in the user's player record. Once granted, the package would have access to the user's personal record.
* - "owned" - The entitlement is for user (user-owned) records. This would allow the package to request access to resources in a record that the user owns. Once granted, the package would have access to the user's owned records.
* - "studio" - The entitlement is for studio records. This would allow the package to request access to resources in studios in which the user is an admin or member of.
* - "shared" - The entitlement is for shared records. This would allow the package to request access to records that are either owned or granted to the user.
* - "designated" - The entitlement is for specific records. This would allow the package to only request access to specific records.
*/
export type EntitlementScope = 'personal' | 'owned' | 'studio' | 'shared' | 'designated';
/**
* The scopes that can be granted for entitlements.
* Compared to the requested entitlement scopes, the granted entitlement scopes are more restrictive.
*
* This ultimately means that while a package can have the ability to request access to a bunch of different records,
* they can only be granted access to a single record at once (for now).
*
* - "designated" - The entitlement is for specific records. This would allow the package to access specific records.
*/
export type GrantedEntitlementScope = 'designated';
/**
* The feature categories that entitlements support.
* Generally, features align with resource kinds, but don't have to.
*/
export type EntitlementFeature = 'data' | 'file' | 'event' | 'inst' | 'notification' | 'package' | 'permissions' | 'webhook' | 'ai' | 'search';
/**
* Defines an interface that represents an entitlement.
* That is, a feature that can be granted to a package but still requires user approval.
*
* In essence, this allows a package to ask the user for permission for a category of permissions.
*/
export interface Entitlement {
/**
* The feature category that the entitlement is for.
* Generally, features align with resource kinds, but don't have to.
*/
feature: EntitlementFeature;
/**
* The scope of the entitlement.
* This can be used to limit the entitlement to a category of resources.
* For example, the "personal" scope would limit the entitlement to requesting access to the user's personal resources.
*
*
* - "personal" - The entitlement is for personal (user-specific) records. This would allow the package to request access to resources in the user's player record.
* - "owned" - The entitlement is for user (user-owned) records. This would allow the package to request access to resources in a record that the user owns.
* - "studio" - The entitlement is for studio records. This would allow the package to request access to resources in studios in which the user is an admin or member of.
* - "shared" - The entitlement is for shared records. This would allow the package to request access to records that are either owned or granted to the user.
* - "designated" - The entitlement is for specific records. This would allow the package to only request access to specific records.
*/
scope: EntitlementScope;
/**
* The list of records that the entitlement is for.
*/
designatedRecords?: string[];
}
export declare const ENTITLEMENT_FEATURE_VALIDATION: z.ZodEnum<["data", "file", "event", "inst", "notification", "package", "permissions", "webhook", "ai", "search"]>;
export declare const ENTITLEMENT_VALIDATION: z.ZodObject<{
feature: z.ZodEnum<["data", "file", "event", "inst", "notification", "package", "permissions", "webhook", "ai", "search"]>;
scope: z.ZodEnum<["personal", "owned", "studio", "shared", "designated"]>;
designatedRecords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
feature?: "search" | "inst" | "data" | "event" | "file" | "webhook" | "notification" | "package" | "permissions" | "ai";
scope?: "shared" | "personal" | "owned" | "studio" | "designated";
designatedRecords?: string[];
}, {
feature?: "search" | "inst" | "data" | "event" | "file" | "webhook" | "notification" | "package" | "permissions" | "ai";
scope?: "shared" | "personal" | "owned" | "studio" | "designated";
designatedRecords?: string[];
}>;
/**
* Defines an interface that describes common options for all permissions.
*/
export interface Permission {
/**
* The marker that the permission is for.
* If null or undefined, then the permission is for a specific resource instead of a marker.
*/
marker?: string;
/**
* The type of the subject that the permission is for.
*
* "user" - The permission is for a user.
* "inst" - The permission is for an inst.
* "role" - The permission is for a role.
*/
subjectType: SubjectType;
/**
* The ID of the subject.
*/
subjectId: string;
/**
* The ID of the resource that is allowed.
* If null, then all resources are allowed.
*/
resourceId?: string | null;
/**
* The options for the permission.
*/
options: {};
/**
* The unix time in miliseconds that the permission will expire at.
* If null, then the permission does not expire.
*/
expireTimeMs: number | null;
}
export declare const PERMISSION_VALIDATION: z.ZodObject<{
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
marker: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
marker?: string;
}, {
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
marker?: string;
}>;
/**
* Defines an interface that describes the common options for all permissions that affect data records.
*
* @dochash types/permissions
* @docname DataPermission
*/
export interface DataPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'data';
/**
* The action th at is allowed.
* If null, then all actions are allowed.
*/
action: DataActionKinds | null;
}
export declare const DATA_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"data">;
action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "data";
action?: "create" | "read" | "update" | "delete" | "list";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "data";
action?: "create" | "read" | "update" | "delete" | "list";
}>;
/**
* Options for file permissions.
*
* @dochash types/permissions
* @docname FilePermissionOptions
*/
export interface FilePermissionOptions {
/**
* The maximum allowed file size in bytes.
* Defaults to Infinity.
*/
maxFileSizeInBytes?: number;
/**
* The list of allowed file MIME types.
* If true, then all file types are allowed.
* If an array of strings, then only MIME types that are specified are allowed.
*/
allowedMimeTypes?: true | string[];
}
export declare const FILE_PERMISSION_OPTIONS_VALIDATION: z.ZodObject<{
maxFileSizeInBytes: z.ZodOptional<z.ZodNumber>;
allowedMimeTypes: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodArray<z.ZodString, "many">]>>;
}, "strip", z.ZodTypeAny, {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
}, {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
}>;
/**
* Defines an interface that describes the common options for all permissions that affect file records.
*
* @dochash types/permissions
* @docname FilePermission
*/
export interface FilePermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'file';
/**
* The action th at is allowed.
* If null, then all actions are allowed.
*/
action: FileActionKinds | null;
/**
* The options for the permission.
*/
options: FilePermissionOptions;
}
export declare const FILE_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"file">;
action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
options: z.ZodObject<{
maxFileSizeInBytes: z.ZodOptional<z.ZodNumber>;
allowedMimeTypes: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodArray<z.ZodString, "many">]>>;
}, "strip", z.ZodTypeAny, {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
}, {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
}>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "file";
action?: "create" | "read" | "update" | "delete" | "list";
options?: {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
};
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "file";
action?: "create" | "read" | "update" | "delete" | "list";
options?: {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
};
}>;
/**
* Defines an interface that describes the common options for all permissions that affect event records.
*
* @dochash types/permissions
* @docname EventPermission
*/
export interface EventPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'event';
/**
* The action th at is allowed.
* If null, then all actions are allowed.
*/
action: EventActionKinds | null;
}
export declare const EVENT_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"event">;
resourceId: z.ZodNullable<z.ZodString>;
action: z.ZodNullable<z.ZodEnum<["increment", "count", "update", "list"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
expireTimeMs?: number;
resourceKind?: "event";
resourceId?: string;
action?: "update" | "increment" | "count" | "list";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
expireTimeMs?: number;
resourceKind?: "event";
resourceId?: string;
action?: "update" | "increment" | "count" | "list";
}>;
/**
* Defines an interface that describes the common options for all permissions that affect markers.
*
* @dochash types/permissions
* @docname MarkerPermission
*/
export interface MarkerPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'marker';
/**
* The action th at is allowed.
* If null, then all actions are allowed.
*/
action: MarkerActionKinds | null;
}
export declare const MARKER_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"marker">;
action: z.ZodNullable<z.ZodEnum<["assign", "unassign", "grantPermission", "revokePermission", "read"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "marker";
action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "marker";
action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
}>;
/**
* Options for role permissions.
*
* @dochash types/permissions
* @docname RolePermissionOptions
*/
export interface RolePermissionOptions {
/**
* The maximum lifetime that the role can be granted for in miliseconds.
* If not specified, then the role can be granted for an infinite amount of time.
*/
maxDurationMs?: number;
}
export declare const ROLE_PERMISSION_OPTIONS_VALIDATION: z.ZodObject<{
maxDurationMs: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
maxDurationMs?: number;
}, {
maxDurationMs?: number;
}>;
/**
* Defines an interface that describes the common options for all permissions that affect roles.
*
* @dochash types/permissions
* @docname RolePermission
*/
export interface RolePermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'role';
/**
* The ID of the resource that is allowed.
* If null, then all resources are allowed.
*/
resourceId: string | null;
/**
* The action th at is allowed.
* If null, then all actions are allowed.
*/
action: RoleActionKinds | null;
/**
* The options for the permission.
*/
options: RolePermissionOptions;
}
export declare const ROLE_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"role">;
action: z.ZodNullable<z.ZodEnum<["grant", "revoke", "read", "update", "list"]>>;
options: z.ZodObject<{
maxDurationMs: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
maxDurationMs?: number;
}, {
maxDurationMs?: number;
}>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "role";
action?: "read" | "update" | "list" | "grant" | "revoke";
options?: {
maxDurationMs?: number;
};
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "role";
action?: "read" | "update" | "list" | "grant" | "revoke";
options?: {
maxDurationMs?: number;
};
}>;
/**
* Defines an interface that describes common options for all permissions that affect insts.
*
* @dochash types/permissions
* @docname InstPermission
*/
export interface InstPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'inst';
/**
* The ID of the resource that is allowed.
* If null, then all resources are allowed.
*/
resourceId: string | null;
/**
* The action th at is allowed.
* If null, then all actions are allowed.
*/
action: InstActionKinds | null;
}
export declare const INST_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"inst">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "inst";
action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "inst";
action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
}>;
/**
* Defines an interface that describes common options for all permissions that affect loom resources.
*
* @dochash types/permissions
* @docname LoomPermission
*/
export interface LoomPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'loom';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: LoomActionKinds | null;
}
export declare const LOOM_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"loom">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "loom";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "loom";
action?: "create";
}>;
/**
* Defines an interface that describes common options for all permissions that affect ai.sloyd resources.
*
* @dochash types/permissions
* @docname SloydPermission
*/
export interface SloydPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'ai.sloyd';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: SloydActionKinds | null;
}
export declare const SLOYD_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"ai.sloyd">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.sloyd";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.sloyd";
action?: "create";
}>;
/**
* Defines an interface that describes common options for all permissions that affect ai.hume resources.
*
* @dochash types/permissions
* @docname HumePermission
*/
export interface HumePermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'ai.hume';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: HumeActionKinds | null;
}
export declare const HUME_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"ai.hume">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.hume";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.hume";
action?: "create";
}>;
/**
* Defines an interface that describes common options for all permissions that affect ai.openai.realtime resources.
*
* @dochash types/permissions
* @docname OpenAIRealtimePermission
*/
export interface OpenAIRealtimePermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'ai.openai.realtime';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: OpenAIRealtimeActionKinds | null;
}
export declare const OPENAI_REALTIME_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"ai.openai.realtime">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.openai.realtime";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.openai.realtime";
action?: "create";
}>;
/**
* Defines an interface that describes common options for all permissions that affect webhook resources.
*
* @dochash types/permissions
* @docname WebhookPermission
*/
export interface WebhookPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'webhook';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: WebhookActionKinds | null;
}
export declare const WEBHOOK_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"webhook">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "webhook";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "webhook";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}>;
/**
* Defines an interface that describes common options for all permissions that affect notification resources.
*
* @dochash types/permissions
* @docname NotificationPermission
*/
export interface NotificationPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'notification';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: NotificationActionKinds | null;
}
export declare const NOTIFICATION_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"notification">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "send", "subscribe", "unsubscribe", "listSubscriptions"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "notification";
action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "notification";
action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
}>;
/**
* Defines an interface that describes common options for all permissions that affect package resources.
*
* @dochash types/permissions
* @docname PackagePermission
*/
export interface PackagePermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'package';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: PackageActionKinds | null;
}
export declare const PACKAGE_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"package">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}>;
/**
* Defines an interface that describes common options for all permissions that affect package.version resources.
*
* @dochash types/permissions
* @docname PackageVersionPermission
*/
export interface PackageVersionPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'package.version';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: PackageVersionActionKinds | null;
}
export declare const PACKAGE_VERSION_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"package.version">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package.version";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package.version";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}>;
/**
* Defines an interface that describes common options for all permissions that affect search resources.
*
* @dochash types/permissions
* @docname SearchPermission
*/
export interface SearchPermission extends Permission {
/**
* The kind of the permission.
*/
resourceKind: 'search';
/**
* The action that is allowed.
* If null, then all actions are allowed.
*/
action: SearchActionKinds | null;
}
export declare const SEARCH_PERMISSION_VALIDATION: z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"search">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "search";
action?: "create" | "read" | "update" | "delete" | "list";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "search";
action?: "create" | "read" | "update" | "delete" | "list";
}>;
export declare const AVAILABLE_PERMISSIONS_VALIDATION: z.ZodDiscriminatedUnion<"resourceKind", [z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"data">;
action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "data";
action?: "create" | "read" | "update" | "delete" | "list";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "data";
action?: "create" | "read" | "update" | "delete" | "list";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"file">;
action: z.ZodNullable<z.ZodEnum<["read", "create", "update", "delete", "list"]>>;
options: z.ZodObject<{
maxFileSizeInBytes: z.ZodOptional<z.ZodNumber>;
allowedMimeTypes: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<true>, z.ZodArray<z.ZodString, "many">]>>;
}, "strip", z.ZodTypeAny, {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
}, {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
}>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "file";
action?: "create" | "read" | "update" | "delete" | "list";
options?: {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
};
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "file";
action?: "create" | "read" | "update" | "delete" | "list";
options?: {
maxFileSizeInBytes?: number;
allowedMimeTypes?: true | string[];
};
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"event">;
resourceId: z.ZodNullable<z.ZodString>;
action: z.ZodNullable<z.ZodEnum<["increment", "count", "update", "list"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
expireTimeMs?: number;
resourceKind?: "event";
resourceId?: string;
action?: "update" | "increment" | "count" | "list";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
expireTimeMs?: number;
resourceKind?: "event";
resourceId?: string;
action?: "update" | "increment" | "count" | "list";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"marker">;
action: z.ZodNullable<z.ZodEnum<["assign", "unassign", "grantPermission", "revokePermission", "read"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "marker";
action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "marker";
action?: "read" | "assign" | "unassign" | "grantPermission" | "revokePermission";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"role">;
action: z.ZodNullable<z.ZodEnum<["grant", "revoke", "read", "update", "list"]>>;
options: z.ZodObject<{
maxDurationMs: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
maxDurationMs?: number;
}, {
maxDurationMs?: number;
}>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "role";
action?: "read" | "update" | "list" | "grant" | "revoke";
options?: {
maxDurationMs?: number;
};
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "role";
action?: "read" | "update" | "list" | "grant" | "revoke";
options?: {
maxDurationMs?: number;
};
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"inst">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "updateData", "delete", "list", "sendAction"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "inst";
action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "inst";
action?: "create" | "read" | "update" | "delete" | "list" | "sendAction" | "updateData";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"loom">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "loom";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "loom";
action?: "create";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"ai.sloyd">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.sloyd";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.sloyd";
action?: "create";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"ai.hume">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.hume";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.hume";
action?: "create";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"ai.openai.realtime">;
action: z.ZodNullable<z.ZodEnum<["create"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.openai.realtime";
action?: "create";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "ai.openai.realtime";
action?: "create";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"webhook">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "webhook";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "webhook";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"notification">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "send", "subscribe", "unsubscribe", "listSubscriptions"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "notification";
action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "notification";
action?: "create" | "read" | "update" | "delete" | "list" | "send" | "subscribe" | "unsubscribe" | "listSubscriptions";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"package">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"package.version">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list", "run"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package.version";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "package.version";
action?: "create" | "read" | "update" | "delete" | "list" | "run";
}>, z.ZodObject<{
marker: z.ZodOptional<z.ZodString>;
subjectType: z.ZodEnum<["user", "inst", "role"]>;
subjectId: z.ZodString;
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
expireTimeMs: z.ZodNullable<z.ZodNumber>;
resourceKind: z.ZodLiteral<"search">;
action: z.ZodNullable<z.ZodEnum<["create", "read", "update", "delete", "list"]>>;
}, "strip", z.ZodTypeAny, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "search";
action?: "create" | "read" | "update" | "delete" | "list";
}, {
marker?: string;
subjectType?: "inst" | "user" | "role";
subjectId?: string;
resourceId?: string;
expireTimeMs?: number;
resourceKind?: "search";
action?: "create" | "read" | "update" | "delete" | "list";
}>]>;
export type PermissionOptions = FilePermissionOptions | RolePermissionOptions;
/**
* The name of the admin role.
*/
export declare const ADMIN_ROLE_NAME = "admin";
/**
* The name of the recordOwner role.
*/
export declare const RECORD_OWNER_ROLE_NAME = "recordOwner";
/**
* The name of the "publicRead" resource marker.
* Used by default for data, file, and event records.
*/
export declare const PUBLIC_READ_MARKER = "publicRead";
/**
* The name of the "publicWrite" resource marker.
* Used by default for public insts.
*/
export declare const PUBLIC_WRITE_MARKER = "publicWrite";
/**
* The name of the "private" resource marker.
* Used by default for private insts.
*/
export declare const PRIVATE_MARKER = "private";
/**
* The name of the "account" resource marker.
* Used by default for policy and role records.
*/
export declare const ACCOUNT_MARKER = "account";
//# sourceMappingURL=PolicyPermissions.d.ts.map