/** * This file was auto-generated by Fern from our API Definition. */ import * as core from '../../../../core'; import * as environments from '../../../../environments'; import * as Truvity from '../../../index'; export declare namespace Drafts { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; apiKey?: core.Supplier; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ headers?: Record | undefined>; } } /** * The API to manage Drafts. */ export declare class Drafts { protected readonly _options: Drafts.Options; constructor(_options?: Drafts.Options); /** * Creates Draft's resource. * * @param {Truvity.DraftCreateRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.UnsupportedMediaTypeError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftCreate({ * data: { * metaSchema: { * schema: { * fields: [{ * kind: "BOOLEAN", * name: "name" * }] * } * } * } * }) */ draftCreate(request: Truvity.DraftCreateRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftCreate; /** * Search for Drafts with extended filters capabilities. * * @param {Truvity.DraftSearchRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.UnsupportedMediaTypeError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftSearch() */ draftSearch(request?: Truvity.DraftSearchRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftSearch; /** * Get the latest version of Draft. * * @param {string} id - The ID of the resource. * @param {Truvity.DraftLatestRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftLatest("id") */ draftLatest(id: string, request?: Truvity.DraftLatestRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftLatest; /** * Delete Draft's resource. * * @param {string} id - The primary and unique identifier of the resource (inside tenant) * according to [RFC 4122](https://www.rfc-editor.org/info/rfc4122). * @param {Truvity.DraftDeleteRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.MethodNotAllowedError} * @throws {@link Truvity.PreconditionFailedError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftDelete("id", { * ifMatch: "If-Match" * }) */ draftDelete(id: string, request: Truvity.DraftDeleteRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftDelete; /** * Update Draft's resource. * * @param {string} id - The primary and unique identifier of the resource (inside tenant) * according to [RFC 4122](https://www.rfc-editor.org/info/rfc4122). * @param {Truvity.DraftUpdateRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.MethodNotAllowedError} * @throws {@link Truvity.PreconditionFailedError} * @throws {@link Truvity.UnsupportedMediaTypeError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftUpdate("id", { * ifMatch: "If-Match", * data: {} * }) */ draftUpdate(id: string, request: Truvity.DraftUpdateRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftUpdate; /** * Update annotations of Draft's resource. * * @param {string} id - The primary and unique identifier of the resource (inside tenant) * according to [RFC 4122](https://www.rfc-editor.org/info/rfc4122). * @param {Truvity.DraftUpdateAnnotationsRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.MethodNotAllowedError} * @throws {@link Truvity.PreconditionFailedError} * @throws {@link Truvity.UnsupportedMediaTypeError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftUpdateAnnotations("id", { * ifMatch: "If-Match", * annotations: { * "key": "value" * } * }) */ draftUpdateAnnotations(id: string, request: Truvity.DraftUpdateAnnotationsRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftUpdateAnnotations; /** * This operation issues a Verifiable Credential from a Draft resource. Operational Lifecycle: * 1) [Exporting](#tag/drafts/operation/DraftExport) Draft. * 2) [Signing](#tag/keys/operation/CredentialSign) the exported Draft. * 3) [Importing](#tag/credentials/operation/CredentialImport) the signed Credential. * * Cascade Issuance: If the Draft references other drafts the system automatically builds a dependency graph and issues all required drafts in the correct order. * The correct order is a topological order of the dependency graph, where each draft is issued only after all its prerequisite drafts have been issued. * * Strict Mode: * - The `strict_mode` option allows clients to control how prerequisite drafts are handled during cascade issuance. * - Use `strict_mode` to enforce that only the explicitly specified drafts in `prerequisite_drafts` (with matching ETags) are accepted as prerequisites. * - When disabled (default), the system will automatically discover and include all linked drafts as prerequisites, building the full dependency graph for cascade issuance. * * Performance Considerations: * - The process may take longer than typical API calls due to: * - Building and traversing the dependency graph for cascade issuance, which determines the correct issuance order for all linked drafts. * - Fetching and resolving external resources required for generating cryptographic proofs, which may involve network requests. * - Generating cryptographic proofs for each credential in the dependency graph. * * Concurrency and Consistency: * - If the `If-Match` header is provided, strict version control is enforced. The operation will fail if the ETag does not match the current Draft version. * - The endpoint is idempotent with respect to the Draft resource and ETag. * * Recovery: * - If the issuance process fails at any stage, the operation can be safely retried. The endpoint is idempotent with respect to the Draft resource and ETag, so repeated calls will not result in duplicate credentials or inconsistent state. * * @param {string} id - The ID of the resource. * @param {Truvity.DraftLatestIssueRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.MethodNotAllowedError} * @throws {@link Truvity.PreconditionFailedError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * @throws {@link Truvity.ServiceUnavailableError} * * @example * await client.drafts.draftLatestIssue("id", { * keyId: "key_id" * }) */ draftLatestIssue(id: string, request: Truvity.DraftLatestIssueRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftLatestIssue; /** * Update labels of Draft's resource. * * @param {string} id - The primary and unique identifier of the resource (inside tenant) * according to [RFC 4122](https://www.rfc-editor.org/info/rfc4122). * @param {Truvity.DraftUpdateLabelsRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.MethodNotAllowedError} * @throws {@link Truvity.PreconditionFailedError} * @throws {@link Truvity.UnsupportedMediaTypeError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftUpdateLabels("id", { * ifMatch: "If-Match", * labels: { * "key": "value" * } * }) */ draftUpdateLabels(id: string, request: Truvity.DraftUpdateLabelsRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftUpdateLabels; /** * Restore Draft's resource. * * @param {string} id - The primary and unique identifier of the resource (inside tenant) * according to [RFC 4122](https://www.rfc-editor.org/info/rfc4122). * @param {Truvity.DraftRestoreRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.MethodNotAllowedError} * @throws {@link Truvity.PreconditionFailedError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftRestore("id", { * ifMatch: "If-Match" * }) */ draftRestore(id: string, request: Truvity.DraftRestoreRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftRestore; /** * History of the Draft's resources. * * @param {string} id - The ID of the resource. * @param {Truvity.DraftHistoryRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftHistory("id") */ draftHistory(id: string, request?: Truvity.DraftHistoryRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftHistory; /** * Read the specific version of the Draft's resource. * * @param {string} id - The ID of the resource. * @param {number} revision - The revision of the resource. * @param {Truvity.DraftRevisionRequest} request * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} * * @example * await client.drafts.draftRevision("id", 1) */ draftRevision(id: string, revision: number, request?: Truvity.DraftRevisionRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftRevision; /** * Generate an unsigned Verifiable Credential in JSON-LD format from a Draft. * @throws {@link Truvity.BadRequestError} * @throws {@link Truvity.UnauthorizedError} * @throws {@link Truvity.ForbiddenError} * @throws {@link Truvity.NotFoundError} * @throws {@link Truvity.TooManyRequestsError} * @throws {@link Truvity.InternalServerError} */ draftExport(id: string, revision: number, request: Truvity.DraftExportRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise; private __draftExport; protected _getCustomAuthorizationHeaders(): Promise<{ 'X-API-KEY': string | undefined; }>; } //# sourceMappingURL=Client.d.ts.map