@fairmint/canton-node-sdk
Version:
Canton Node SDK
32 lines • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetUser = exports.GetUserParamsSchema = void 0;
const core_1 = require("../../../../../core");
const zod_1 = require("zod");
const endpoint = '/v2/users/{user-id}';
exports.GetUserParamsSchema = zod_1.z.object({
userId: zod_1.z.string(),
identityProviderId: zod_1.z.string().optional(),
});
/**
* @description Get details for a specific user
* @example
* ```typescript
* const user = await client.getUser({ userId: 'alice' });
* console.log(`User ${user.user.id} is ${user.user.isDeactivated ? 'deactivated' : 'active'}`);
* ```
*/
exports.GetUser = (0, core_1.createApiOperation)({
paramsSchema: exports.GetUserParamsSchema,
method: 'GET',
buildUrl: (params, apiUrl) => {
const baseUrl = `${apiUrl}/v2/users/${params.userId}`;
const queryParams = new URLSearchParams();
if (params.identityProviderId) {
queryParams.append('identity-provider-id', params.identityProviderId);
}
const queryString = queryParams.toString();
return queryString ? `${baseUrl}?${queryString}` : baseUrl;
},
});
//# sourceMappingURL=get-user.js.map