@fairmint/canton-node-sdk
Version:
Canton Node SDK
27 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetAuthenticatedUser = void 0;
const core_1 = require("../../../../../core");
const operations_1 = require("../../../schemas/operations");
/**
* @description Get details for the currently authenticated user
* @example
* ```typescript
* const user = await client.getAuthenticatedUser({ identityProviderId: 'default' });
* console.log(`Authenticated as: ${user.user.id}`);
* ```
*/
exports.GetAuthenticatedUser = (0, core_1.createApiOperation)({
paramsSchema: operations_1.GetAuthenticatedUserParamsSchema,
method: 'GET',
buildUrl: (params, apiUrl) => {
const baseUrl = `${apiUrl}/v2/authenticated-user`;
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.js.map