@fairmint/canton-node-sdk
Version:
Canton Node SDK
163 lines • 6.55 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetAuthenticatedUserParamsSchema = exports.UpdateUserIdentityProviderParamsSchema = exports.RevokeUserRightsParamsSchema = exports.GrantUserRightsParamsSchema = exports.ListUserRightsParamsSchema = exports.UpdateUserParamsSchema = exports.DeleteUserParamsSchema = exports.GetUserParamsSchema = exports.CreateUserParamsSchema = exports.ListUsersParamsSchema = void 0;
const zod_1 = require("zod");
const base_1 = require("./base");
/**
* Schema for list users parameters.
*/
exports.ListUsersParamsSchema = zod_1.z.object({
/** Maximum number of elements in a returned page. */
pageSize: zod_1.z.number().int().positive().optional(),
/** Token to continue results from a given page. */
pageToken: zod_1.z.string().optional(),
});
/**
* Schema for create user parameters.
*/
exports.CreateUserParamsSchema = zod_1.z.object({
/** The user to create. */
user: zod_1.z.object({
/** User identifier. */
id: zod_1.z.string(),
/** Primary party for the user (optional). */
primaryParty: zod_1.z.string().optional(),
/** Whether the user is deactivated. */
isDeactivated: zod_1.z.boolean(),
/** User metadata (optional). */
metadata: zod_1.z.object({
/** Resource version for concurrent change detection. */
resourceVersion: zod_1.z.string(),
/** Annotations for the resource. */
annotations: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
}).optional(),
/** Identity provider ID (optional). */
identityProviderId: zod_1.z.string().optional(),
}),
/** Rights to assign to the user (optional). */
rights: zod_1.z.array(zod_1.z.object({
/** The kind of right. */
kind: zod_1.z.union([
zod_1.z.object({ CanActAs: zod_1.z.object({ party: zod_1.z.string() }) }),
zod_1.z.object({ CanReadAs: zod_1.z.object({ party: zod_1.z.string() }) }),
zod_1.z.object({ CanReadAsAnyParty: zod_1.z.object({}) }),
zod_1.z.object({ Empty: zod_1.z.object({}) }),
zod_1.z.object({ IdentityProviderAdmin: zod_1.z.object({}) }),
zod_1.z.object({ ParticipantAdmin: zod_1.z.object({}) }),
]),
})).optional(),
});
/**
* Schema for get user parameters.
*/
exports.GetUserParamsSchema = zod_1.z.object({
/** User ID to get details for. */
userId: base_1.NonEmptyStringSchema,
/** Identity provider ID (optional). */
identityProviderId: zod_1.z.string().optional(),
});
/**
* Schema for delete user parameters.
*/
exports.DeleteUserParamsSchema = zod_1.z.object({
/** User ID to delete. */
userId: base_1.NonEmptyStringSchema,
});
/**
* Schema for update user parameters.
*/
exports.UpdateUserParamsSchema = zod_1.z.object({
/** User ID to update. */
userId: base_1.NonEmptyStringSchema,
/** The user to update. */
user: zod_1.z.object({
/** User identifier. */
id: zod_1.z.string(),
/** Primary party for the user (optional). */
primaryParty: zod_1.z.string().optional(),
/** Whether the user is deactivated. */
isDeactivated: zod_1.z.boolean(),
/** User metadata (optional). */
metadata: zod_1.z.object({
/** Resource version for concurrent change detection. */
resourceVersion: zod_1.z.string(),
/** Annotations for the resource. */
annotations: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
}).optional(),
/** Identity provider ID (optional). */
identityProviderId: zod_1.z.string().optional(),
}),
/** Update mask for partial updates. */
updateMask: zod_1.z.object({
/** Update paths. */
paths: zod_1.z.array(zod_1.z.string()),
}),
});
/**
* Schema for list user rights parameters.
*/
exports.ListUserRightsParamsSchema = zod_1.z.object({
/** User ID to list rights for. */
userId: base_1.NonEmptyStringSchema,
});
/**
* Schema for grant user rights parameters.
*/
exports.GrantUserRightsParamsSchema = zod_1.z.object({
/** User ID to grant rights to. */
userId: base_1.NonEmptyStringSchema,
/** Rights to grant (optional). */
rights: zod_1.z.array(zod_1.z.object({
/** The kind of right. */
kind: zod_1.z.union([
zod_1.z.object({ CanActAs: zod_1.z.object({ party: zod_1.z.string() }) }),
zod_1.z.object({ CanReadAs: zod_1.z.object({ party: zod_1.z.string() }) }),
zod_1.z.object({ CanReadAsAnyParty: zod_1.z.object({}) }),
zod_1.z.object({ Empty: zod_1.z.object({}) }),
zod_1.z.object({ IdentityProviderAdmin: zod_1.z.object({}) }),
zod_1.z.object({ ParticipantAdmin: zod_1.z.object({}) }),
]),
})).optional(),
/** Identity provider ID (optional). */
identityProviderId: zod_1.z.string().optional(),
});
/**
* Schema for revoke user rights parameters.
*/
exports.RevokeUserRightsParamsSchema = zod_1.z.object({
/** User ID to revoke rights from. */
userId: base_1.NonEmptyStringSchema,
/** Rights to revoke (optional). */
rights: zod_1.z.array(zod_1.z.object({
/** The kind of right. */
kind: zod_1.z.union([
zod_1.z.object({ CanActAs: zod_1.z.object({ party: zod_1.z.string() }) }),
zod_1.z.object({ CanReadAs: zod_1.z.object({ party: zod_1.z.string() }) }),
zod_1.z.object({ CanReadAsAnyParty: zod_1.z.object({}) }),
zod_1.z.object({ Empty: zod_1.z.object({}) }),
zod_1.z.object({ IdentityProviderAdmin: zod_1.z.object({}) }),
zod_1.z.object({ ParticipantAdmin: zod_1.z.object({}) }),
]),
})).optional(),
/** Identity provider ID (optional). */
identityProviderId: zod_1.z.string().optional(),
});
/**
* Schema for update user identity provider parameters.
*/
exports.UpdateUserIdentityProviderParamsSchema = zod_1.z.object({
/** User ID to update. */
userId: base_1.NonEmptyStringSchema,
/** Current identity provider ID. */
sourceIdentityProviderId: zod_1.z.string(),
/** Target identity provider ID. */
targetIdentityProviderId: zod_1.z.string(),
});
/**
* Schema for get authenticated user parameters.
*/
exports.GetAuthenticatedUserParamsSchema = zod_1.z.object({
/** Identity provider ID (optional). */
identityProviderId: zod_1.z.string().optional(),
});
//# sourceMappingURL=users.js.map