@truvity/sdk 0.37.6 → 0.37.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +3 -1
- package/Client.d.ts.map +1 -1
- package/Client.js +43 -1
- package/Client.js.map +1 -1
- package/ExtendedClient.d.ts +1 -2
- package/ExtendedClient.d.ts.map +1 -1
- package/ExtendedClient.js +1 -5
- package/ExtendedClient.js.map +1 -1
- package/api/resources/apiKeys/client/Client.d.ts +3 -1
- package/api/resources/apiKeys/client/Client.d.ts.map +1 -1
- package/api/resources/apiKeys/client/Client.js +28 -31
- package/api/resources/apiKeys/client/Client.js.map +1 -1
- package/api/resources/apiKeys/client/index.d.ts +1 -0
- package/api/resources/apiKeys/client/index.d.ts.map +1 -1
- package/api/resources/apiKeys/client/index.js.map +1 -1
- package/api/resources/credentials/client/Client.d.ts +4 -3
- package/api/resources/credentials/client/Client.d.ts.map +1 -1
- package/api/resources/credentials/client/Client.js +38 -41
- package/api/resources/credentials/client/Client.js.map +1 -1
- package/api/resources/credentials/client/index.d.ts +1 -0
- package/api/resources/credentials/client/index.d.ts.map +1 -1
- package/api/resources/credentials/client/index.js.map +1 -1
- package/api/resources/desk/client/Client.d.ts +3 -1
- package/api/resources/desk/client/Client.d.ts.map +1 -1
- package/api/resources/desk/client/Client.js +7 -10
- package/api/resources/desk/client/Client.js.map +1 -1
- package/api/resources/desk/client/index.d.ts +1 -0
- package/api/resources/desk/client/index.d.ts.map +1 -1
- package/api/resources/desk/client/index.js.map +1 -1
- package/api/resources/didcommMessages/client/Client.d.ts +3 -1
- package/api/resources/didcommMessages/client/Client.d.ts.map +1 -1
- package/api/resources/didcommMessages/client/Client.js +28 -31
- package/api/resources/didcommMessages/client/Client.js.map +1 -1
- package/api/resources/didcommMessages/client/index.d.ts +1 -0
- package/api/resources/didcommMessages/client/index.d.ts.map +1 -1
- package/api/resources/didcommMessages/client/index.js.map +1 -1
- package/api/resources/dids/client/Client.d.ts +3 -1
- package/api/resources/dids/client/Client.d.ts.map +1 -1
- package/api/resources/dids/client/Client.js +4 -7
- package/api/resources/dids/client/Client.js.map +1 -1
- package/api/resources/dids/client/index.d.ts +1 -0
- package/api/resources/dids/client/index.d.ts.map +1 -1
- package/api/resources/dids/client/index.js.map +1 -1
- package/api/resources/drafts/client/Client.d.ts +4 -3
- package/api/resources/drafts/client/Client.d.ts.map +1 -1
- package/api/resources/drafts/client/Client.js +38 -41
- package/api/resources/drafts/client/Client.js.map +1 -1
- package/api/resources/drafts/client/index.d.ts +1 -0
- package/api/resources/drafts/client/index.d.ts.map +1 -1
- package/api/resources/drafts/client/index.js.map +1 -1
- package/api/resources/files/client/Client.d.ts +4 -3
- package/api/resources/files/client/Client.d.ts.map +1 -1
- package/api/resources/files/client/Client.js +35 -38
- package/api/resources/files/client/Client.js.map +1 -1
- package/api/resources/files/client/index.d.ts +1 -0
- package/api/resources/files/client/index.d.ts.map +1 -1
- package/api/resources/files/client/index.js.map +1 -1
- package/api/resources/gdpr/client/Client.d.ts +3 -1
- package/api/resources/gdpr/client/Client.d.ts.map +1 -1
- package/api/resources/gdpr/client/Client.js +4 -7
- package/api/resources/gdpr/client/Client.js.map +1 -1
- package/api/resources/gdpr/client/index.d.ts +1 -0
- package/api/resources/gdpr/client/index.d.ts.map +1 -1
- package/api/resources/gdpr/client/index.js.map +1 -1
- package/api/resources/keys/client/Client.d.ts +6 -5
- package/api/resources/keys/client/Client.d.ts.map +1 -1
- package/api/resources/keys/client/Client.js +43 -46
- package/api/resources/keys/client/Client.js.map +1 -1
- package/api/resources/keys/client/index.d.ts +1 -0
- package/api/resources/keys/client/index.d.ts.map +1 -1
- package/api/resources/keys/client/index.js.map +1 -1
- package/api/resources/presentations/client/Client.d.ts +5 -4
- package/api/resources/presentations/client/Client.d.ts.map +1 -1
- package/api/resources/presentations/client/Client.js +45 -48
- package/api/resources/presentations/client/Client.js.map +1 -1
- package/api/resources/presentations/client/index.d.ts +1 -0
- package/api/resources/presentations/client/index.d.ts.map +1 -1
- package/api/resources/presentations/client/index.js.map +1 -1
- package/core/fetcher/BinaryResponse.d.ts +21 -0
- package/core/fetcher/BinaryResponse.d.ts.map +1 -0
- package/core/fetcher/BinaryResponse.js +18 -0
- package/core/fetcher/BinaryResponse.js.map +1 -0
- package/core/fetcher/Fetcher.d.ts +3 -2
- package/core/fetcher/Fetcher.d.ts.map +1 -1
- package/core/fetcher/Fetcher.js +25 -12
- package/core/fetcher/Fetcher.js.map +1 -1
- package/core/fetcher/ResponseWithBody.d.ts +5 -0
- package/core/fetcher/ResponseWithBody.d.ts.map +1 -0
- package/core/fetcher/ResponseWithBody.js +7 -0
- package/core/fetcher/ResponseWithBody.js.map +1 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts.map +1 -1
- package/core/fetcher/createRequestUrl.js +3 -7
- package/core/fetcher/createRequestUrl.js.map +1 -1
- package/core/fetcher/getErrorResponseBody.d.ts +2 -0
- package/core/fetcher/getErrorResponseBody.d.ts.map +1 -0
- package/core/fetcher/getErrorResponseBody.js +45 -0
- package/core/fetcher/getErrorResponseBody.js.map +1 -0
- package/core/fetcher/getFetchFn.d.ts +1 -4
- package/core/fetcher/getFetchFn.d.ts.map +1 -1
- package/core/fetcher/getFetchFn.js +1 -52
- package/core/fetcher/getFetchFn.js.map +1 -1
- package/core/fetcher/getResponseBody.d.ts.map +1 -1
- package/core/fetcher/getResponseBody.js +34 -33
- package/core/fetcher/getResponseBody.js.map +1 -1
- package/core/fetcher/index.d.ts +1 -0
- package/core/fetcher/index.d.ts.map +1 -1
- package/core/fetcher/index.js.map +1 -1
- package/core/headers.d.ts +4 -0
- package/core/headers.d.ts.map +1 -0
- package/core/headers.js +30 -0
- package/core/headers.js.map +1 -0
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/core/index.js +2 -1
- package/core/index.js.map +1 -1
- package/core/runtime/runtime.d.ts.map +1 -1
- package/core/runtime/runtime.js +0 -1
- package/core/runtime/runtime.js.map +1 -1
- package/core/url/index.d.ts +3 -0
- package/core/url/index.d.ts.map +1 -0
- package/core/url/index.js +8 -0
- package/core/url/index.js.map +1 -0
- package/core/url/join.d.ts +2 -0
- package/core/url/join.d.ts.map +1 -0
- package/core/url/join.js +50 -0
- package/core/url/join.js.map +1 -0
- package/core/url/qs.d.ts +7 -0
- package/core/url/qs.d.ts.map +1 -0
- package/core/url/qs.js +65 -0
- package/core/url/qs.js.map +1 -0
- package/documents/credential/document/vcdm.d.ts +1 -1
- package/documents/credential/document/vcdm.d.ts.map +1 -1
- package/documents/credential/document/vcdm.js +12 -1
- package/documents/credential/document/vcdm.js.map +1 -1
- package/documents/credential/document.d.ts +2 -2
- package/documents/credential/document.d.ts.map +1 -1
- package/documents/credential/document.js +21 -8
- package/documents/credential/document.js.map +1 -1
- package/documents/credential/draft/draft.d.ts +2 -2
- package/documents/credential/draft/draft.d.ts.map +1 -1
- package/documents/credential/draft/draft.js.map +1 -1
- package/documents/credential/flavor/vcdm1_1.d.ts +3 -3
- package/documents/credential/flavor/vcdm1_1.d.ts.map +1 -1
- package/documents/credential/flavor/vcdm1_1.js +27 -25
- package/documents/credential/flavor/vcdm1_1.js.map +1 -1
- package/documents/credential/flavor/vcdm2_0.d.ts +2 -2
- package/documents/credential/flavor/vcdm2_0.d.ts.map +1 -1
- package/documents/credential/flavor/vcdm2_0.js +29 -16
- package/documents/credential/flavor/vcdm2_0.js.map +1 -1
- package/documents/credential/flavor.d.ts +2 -2
- package/documents/credential/flavor.d.ts.map +1 -1
- package/documents/credential/flavor.js +25 -10
- package/documents/credential/flavor.js.map +1 -1
- package/documents/credential/flavor.spec.js +3 -3
- package/documents/credential/flavor.spec.js.map +1 -1
- package/documents/credential/types.d.ts +4 -4
- package/documents/credential/types.d.ts.map +1 -1
- package/documents/credential/types.js.map +1 -1
- package/documents/credential/verifiable/verifiable.d.ts.map +1 -1
- package/documents/credential/verifiable/verifiable.js +1 -2
- package/documents/credential/verifiable/verifiable.js.map +1 -1
- package/documents/credential/verifiable/with-claims.js +1 -1
- package/documents/credential/verifiable/with-claims.js.map +1 -1
- package/documents/credential.d.ts.map +1 -1
- package/documents/credential.js +1 -5
- package/documents/credential.js.map +1 -1
- package/documents/index.d.ts +0 -1
- package/documents/index.d.ts.map +1 -1
- package/documents/index.js +0 -1
- package/documents/index.js.map +1 -1
- package/documents/models.d.ts +1 -2
- package/documents/models.d.ts.map +1 -1
- package/documents/models.js +5 -3
- package/documents/models.js.map +1 -1
- package/documents/presentation.d.ts.map +1 -1
- package/documents/presentation.js +1 -5
- package/documents/presentation.js.map +1 -1
- package/documents/types.d.ts +2 -3
- package/documents/types.d.ts.map +1 -1
- package/documents/types.js.map +1 -1
- package/middlewares/csrf/csrf.d.ts.map +1 -1
- package/middlewares/csrf/csrf.js +1 -5
- package/middlewares/csrf/csrf.js.map +1 -1
- package/package.json +9 -14
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -31
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts.map +0 -1
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -248
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js.map +0 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -22
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts.map +0 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -127
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js.map +0 -1
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -32
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts.map +0 -1
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -230
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js.map +0 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -19
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts.map +0 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -60
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js.map +0 -1
- package/documents/utils/stream.d.ts +0 -8
- package/documents/utils/stream.d.ts.map +0 -1
- package/documents/utils/stream.js +0 -50
- package/documents/utils/stream.js.map +0 -1
|
@@ -44,15 +44,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
48
|
exports.Dids = void 0;
|
|
52
49
|
const environments = __importStar(require("../../../../environments"));
|
|
53
50
|
const core = __importStar(require("../../../../core"));
|
|
54
51
|
const Truvity = __importStar(require("../../../index"));
|
|
55
|
-
const
|
|
52
|
+
const headers_1 = require("../../../../core/headers");
|
|
56
53
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
57
54
|
const errors = __importStar(require("../../../../errors/index"));
|
|
58
55
|
/**
|
|
@@ -83,12 +80,12 @@ class Dids {
|
|
|
83
80
|
}
|
|
84
81
|
__didDocumentSelfGet() {
|
|
85
82
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
86
|
-
var _a, _b, _c;
|
|
83
|
+
var _a, _b, _c, _d;
|
|
87
84
|
const { ifNoneMatch } = request;
|
|
88
85
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
89
|
-
url:
|
|
86
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, 'dids/self'),
|
|
90
87
|
method: 'GET',
|
|
91
|
-
headers:
|
|
88
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
92
89
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
93
90
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
94
91
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../../../../src/api/resources/dids/client/Client.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uEAAyD;AACzD,uDAAyC;AACzC,wDAA0C;AAC1C,wDAA+B;AAC/B,6EAA+D;AAC/D,iEAAmD;AAuBnD;;GAEG;AACH,MAAa,IAAI;IACb,YAA+B,WAAyB,EAAE;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;IAAG,CAAC;IAE9D;;;;;;;;;;;;;;;OAeG;IACI,kBAAkB,CACrB,UAA6C,EAAE,EAC/C,cAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IACpG,CAAC;IAEa,oBAAoB;6DAC9B,UAA6C,EAAE,EAC/C,cAAoC;;YAEpC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;YAChC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAA,IAAI,CAAC,QAAQ,CAA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BACV,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;wBAC1B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,YAAY;wBACrC,WAAW,EAAE,SAAS,CAAC,WAAW;qBACrC,CAAC,CAAC;YACX,CAAC;QACL,CAAC;KAAA;IAEe,8BAA8B;;YAC1C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;QACxC,CAAC;KAAA;CACJ;AApJD,oBAoJC","sourcesContent":["/**\n * This file was auto-generated by Fern from our API Definition.\n */\n\nimport * as environments from '../../../../environments';\nimport * as core from '../../../../core';\nimport * as Truvity from '../../../index';\nimport urlJoin from 'url-join';\nimport * as serializers from '../../../../serialization/index';\nimport * as errors from '../../../../errors/index';\n\nexport declare namespace Dids {\n export interface Options {\n environment?: core.Supplier<environments.TruvityEnvironment | string>;\n /** Specify a custom URL to connect the client to. */\n baseUrl?: core.Supplier<string>;\n apiKey?: core.Supplier<string | undefined>;\n fetcher?: core.FetchFunction;\n }\n\n export interface RequestOptions {\n /** The maximum time to wait for a response in seconds. */\n timeoutInSeconds?: number;\n /** The number of times to retry the request. Defaults to 2. */\n maxRetries?: number;\n /** A hook to abort the request. */\n abortSignal?: AbortSignal;\n /** Additional headers to include in the request. */\n headers?: Record<string, string>;\n }\n}\n\n/**\n * The API to manage DID Documents.\n */\nexport class Dids {\n constructor(protected readonly _options: Dids.Options = {}) {}\n\n /**\n * Return the tenant's DID(did:web) document.\n * Comparing to [DIDDocumentGet](#tag/desk/operation/DIDDocumentGet) endpoint, this one returns the tenant's DID(did:web) document for the authenticated tenant only.\n *\n * @param {Truvity.DidDocumentSelfGetRequest} request\n * @param {Dids.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link Truvity.BadRequestError}\n * @throws {@link Truvity.UnauthorizedError}\n * @throws {@link Truvity.ForbiddenError}\n * @throws {@link Truvity.TooManyRequestsError}\n * @throws {@link Truvity.InternalServerError}\n *\n * @example\n * await client.dids.didDocumentSelfGet()\n */\n public didDocumentSelfGet(\n request: Truvity.DidDocumentSelfGetRequest = {},\n requestOptions?: Dids.RequestOptions,\n ): core.HttpResponsePromise<Truvity.DidDocument> {\n return core.HttpResponsePromise.fromPromise(this.__didDocumentSelfGet(request, requestOptions));\n }\n\n private async __didDocumentSelfGet(\n request: Truvity.DidDocumentSelfGetRequest = {},\n requestOptions?: Dids.RequestOptions,\n ): Promise<core.WithRawResponse<Truvity.DidDocument>> {\n const { ifNoneMatch } = request;\n const _response = await (this._options.fetcher ?? core.fetcher)({\n url: urlJoin(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.TruvityEnvironment.Default,\n 'dids/self',\n ),\n method: 'GET',\n headers: {\n 'X-Fern-Language': 'JavaScript',\n 'X-Fern-SDK-Name': '@truvity/sdk',\n 'X-Fern-SDK-Version': '0.37.6',\n 'User-Agent': '@truvity/sdk/0.37.6',\n 'X-Fern-Runtime': core.RUNTIME.type,\n 'X-Fern-Runtime-Version': core.RUNTIME.version,\n 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined,\n ...(await this._getCustomAuthorizationHeaders()),\n ...requestOptions?.headers,\n },\n timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,\n maxRetries: requestOptions?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n });\n if (_response.ok) {\n return {\n data: serializers.DidDocument.parseOrThrow(_response.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === 'status-code') {\n switch (_response.error.statusCode) {\n case 400:\n throw new Truvity.BadRequestError(\n serializers.BadRequestProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 401:\n throw new Truvity.UnauthorizedError(\n serializers.UnauthorizedProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 403:\n throw new Truvity.ForbiddenError(\n serializers.ForbiddenProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 429:\n throw new Truvity.TooManyRequestsError(\n serializers.TooManyRequestsProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 500:\n throw new Truvity.InternalServerError(\n serializers.ProblemInternalServerError.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n default:\n throw new errors.TruvityError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n switch (_response.error.reason) {\n case 'non-json':\n throw new errors.TruvityError({\n statusCode: _response.error.statusCode,\n body: _response.error.rawBody,\n rawResponse: _response.rawResponse,\n });\n case 'timeout':\n throw new errors.TruvityTimeoutError('Timeout exceeded when calling GET /dids/self.');\n case 'unknown':\n throw new errors.TruvityError({\n message: _response.error.errorMessage,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n protected async _getCustomAuthorizationHeaders() {\n const apiKeyValue = await core.Supplier.get(this._options.apiKey);\n return { 'X-API-KEY': apiKeyValue };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../../../../src/api/resources/dids/client/Client.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uEAAyD;AACzD,uDAAyC;AACzC,wDAA0C;AAC1C,sDAAiF;AACjF,6EAA+D;AAC/D,iEAAmD;AAyBnD;;GAEG;AACH,MAAa,IAAI;IAGb,YAAY,WAAyB,EAAE;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACI,kBAAkB,CACrB,UAA6C,EAAE,EAC/C,cAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IACpG,CAAC;IAEa,oBAAoB;6DAC9B,UAA6C,EAAE,EAC/C,cAAoC;;YAEpC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;YAChC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,mCAAI,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5D,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CACd,MAAA,MAAA,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,mCAC5C,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,mCACpD,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAC3C,WAAW,CACd;gBACD,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,IAAA,sBAAY,EACjB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IAAI;4BACjC,iBAAiB,EAAE,CAAC,UAAU,CAAC;yBAClC,CAAC,EACF,SAAS,CAAC,WAAW,CACxB,CAAC;oBACN;wBACI,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;4BAC1B,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU;4BACtC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI;4BAC1B,WAAW,EAAE,SAAS,CAAC,WAAW;yBACrC,CAAC,CAAC;gBACX,CAAC;YACL,CAAC;YAED,QAAQ,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC7B,KAAK,UAAU;oBACX,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;wBAC1B,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU;wBACtC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;wBAC7B,WAAW,EAAE,SAAS,CAAC,WAAW;qBACrC,CAAC,CAAC;gBACP,KAAK,SAAS;oBACV,MAAM,IAAI,MAAM,CAAC,mBAAmB,CAAC,+CAA+C,CAAC,CAAC;gBAC1F,KAAK,SAAS;oBACV,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;wBAC1B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,YAAY;wBACrC,WAAW,EAAE,SAAS,CAAC,WAAW;qBACrC,CAAC,CAAC;YACX,CAAC;QACL,CAAC;KAAA;IAEe,8BAA8B;;YAC1C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;QACxC,CAAC;KAAA;CACJ;AArJD,oBAqJC","sourcesContent":["/**\n * This file was auto-generated by Fern from our API Definition.\n */\n\nimport * as environments from '../../../../environments';\nimport * as core from '../../../../core';\nimport * as Truvity from '../../../index';\nimport { mergeHeaders, mergeOnlyDefinedHeaders } from '../../../../core/headers';\nimport * as serializers from '../../../../serialization/index';\nimport * as errors from '../../../../errors/index';\n\nexport declare namespace Dids {\n export interface Options {\n environment?: core.Supplier<environments.TruvityEnvironment | string>;\n /** Specify a custom URL to connect the client to. */\n baseUrl?: core.Supplier<string>;\n apiKey?: core.Supplier<string | undefined>;\n /** Additional headers to include in requests. */\n headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;\n fetcher?: core.FetchFunction;\n }\n\n export interface RequestOptions {\n /** The maximum time to wait for a response in seconds. */\n timeoutInSeconds?: number;\n /** The number of times to retry the request. Defaults to 2. */\n maxRetries?: number;\n /** A hook to abort the request. */\n abortSignal?: AbortSignal;\n /** Additional headers to include in the request. */\n headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;\n }\n}\n\n/**\n * The API to manage DID Documents.\n */\nexport class Dids {\n protected readonly _options: Dids.Options;\n\n constructor(_options: Dids.Options = {}) {\n this._options = _options;\n }\n\n /**\n * Return the tenant's DID(did:web) document.\n * Comparing to [DIDDocumentGet](#tag/desk/operation/DIDDocumentGet) endpoint, this one returns the tenant's DID(did:web) document for the authenticated tenant only.\n *\n * @param {Truvity.DidDocumentSelfGetRequest} request\n * @param {Dids.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link Truvity.BadRequestError}\n * @throws {@link Truvity.UnauthorizedError}\n * @throws {@link Truvity.ForbiddenError}\n * @throws {@link Truvity.TooManyRequestsError}\n * @throws {@link Truvity.InternalServerError}\n *\n * @example\n * await client.dids.didDocumentSelfGet()\n */\n public didDocumentSelfGet(\n request: Truvity.DidDocumentSelfGetRequest = {},\n requestOptions?: Dids.RequestOptions,\n ): core.HttpResponsePromise<Truvity.DidDocument> {\n return core.HttpResponsePromise.fromPromise(this.__didDocumentSelfGet(request, requestOptions));\n }\n\n private async __didDocumentSelfGet(\n request: Truvity.DidDocumentSelfGetRequest = {},\n requestOptions?: Dids.RequestOptions,\n ): Promise<core.WithRawResponse<Truvity.DidDocument>> {\n const { ifNoneMatch } = request;\n const _response = await (this._options.fetcher ?? core.fetcher)({\n url: core.url.join(\n (await core.Supplier.get(this._options.baseUrl)) ??\n (await core.Supplier.get(this._options.environment)) ??\n environments.TruvityEnvironment.Default,\n 'dids/self',\n ),\n method: 'GET',\n headers: mergeHeaders(\n this._options?.headers,\n mergeOnlyDefinedHeaders({\n 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined,\n ...(await this._getCustomAuthorizationHeaders()),\n }),\n requestOptions?.headers,\n ),\n timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,\n maxRetries: requestOptions?.maxRetries,\n abortSignal: requestOptions?.abortSignal,\n });\n if (_response.ok) {\n return {\n data: serializers.DidDocument.parseOrThrow(_response.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n rawResponse: _response.rawResponse,\n };\n }\n\n if (_response.error.reason === 'status-code') {\n switch (_response.error.statusCode) {\n case 400:\n throw new Truvity.BadRequestError(\n serializers.BadRequestProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 401:\n throw new Truvity.UnauthorizedError(\n serializers.UnauthorizedProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 403:\n throw new Truvity.ForbiddenError(\n serializers.ForbiddenProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 429:\n throw new Truvity.TooManyRequestsError(\n serializers.TooManyRequestsProblems.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n case 500:\n throw new Truvity.InternalServerError(\n serializers.ProblemInternalServerError.parseOrThrow(_response.error.body, {\n unrecognizedObjectKeys: 'passthrough',\n allowUnrecognizedUnionMembers: true,\n allowUnrecognizedEnumValues: true,\n breadcrumbsPrefix: ['response'],\n }),\n _response.rawResponse,\n );\n default:\n throw new errors.TruvityError({\n statusCode: _response.error.statusCode,\n body: _response.error.body,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n switch (_response.error.reason) {\n case 'non-json':\n throw new errors.TruvityError({\n statusCode: _response.error.statusCode,\n body: _response.error.rawBody,\n rawResponse: _response.rawResponse,\n });\n case 'timeout':\n throw new errors.TruvityTimeoutError('Timeout exceeded when calling GET /dids/self.');\n case 'unknown':\n throw new errors.TruvityError({\n message: _response.error.errorMessage,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n protected async _getCustomAuthorizationHeaders() {\n const apiKeyValue = await core.Supplier.get(this._options.apiKey);\n return { 'X-API-KEY': apiKeyValue };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/dids/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/dids/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AACV,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/resources/dids/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/resources/dids/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,6CAA2B","sourcesContent":["export {};\nexport * from './requests';\n"]}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
import * as environments from '../../../../environments';
|
|
5
5
|
import * as core from '../../../../core';
|
|
6
6
|
import * as Truvity from '../../../index';
|
|
7
|
-
import * as stream from 'stream';
|
|
8
7
|
export declare namespace Drafts {
|
|
9
8
|
interface Options {
|
|
10
9
|
environment?: core.Supplier<environments.TruvityEnvironment | string>;
|
|
11
10
|
/** Specify a custom URL to connect the client to. */
|
|
12
11
|
baseUrl?: core.Supplier<string>;
|
|
13
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
14
15
|
fetcher?: core.FetchFunction;
|
|
15
16
|
}
|
|
16
17
|
interface RequestOptions {
|
|
@@ -21,7 +22,7 @@ export declare namespace Drafts {
|
|
|
21
22
|
/** A hook to abort the request. */
|
|
22
23
|
abortSignal?: AbortSignal;
|
|
23
24
|
/** Additional headers to include in the request. */
|
|
24
|
-
headers?: Record<string, string>;
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
@@ -322,7 +323,7 @@ export declare class Drafts {
|
|
|
322
323
|
* @throws {@link Truvity.TooManyRequestsError}
|
|
323
324
|
* @throws {@link Truvity.InternalServerError}
|
|
324
325
|
*/
|
|
325
|
-
draftExport(id: string, revision: number, request: Truvity.DraftExportRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise<
|
|
326
|
+
draftExport(id: string, revision: number, request: Truvity.DraftExportRequest, requestOptions?: Drafts.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
326
327
|
private __draftExport;
|
|
327
328
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
328
329
|
'X-API-KEY': string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/drafts/client/Client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/drafts/client/Client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAK1C,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC5B,UAAiB,OAAO;QACpB,WAAW,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,kBAAkB,GAAG,MAAM,CAAC,CAAC;QACtE,qDAAqD;QACrD,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;QAC3C,iDAAiD;QACjD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;QACjF,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC;KAChC;IAED,UAAiB,cAAc;QAC3B,0DAA0D;QAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,+DAA+D;QAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,mCAAmC;QACnC,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,oDAA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OAAO,CAAC,SAAS,CAAC;YAIhC,cAAc;IA8H5B;;;;;;;;;;;;;;;;;OAiBG;IACI,aAAa,CAChB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,OAAO,CAAC,oBAAyB,EAC1C,cAAc,CAAC,EAAE,MAAM,CAAC,cAAc,GACvC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,aAAa,CAAC;YAIpC,eAAe;IAiI7B;;;;;;;;OAQG;IACI,WAAW,CACd,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,CAAC,kBAAkB,EACnC,cAAc,CAAC,EAAE,MAAM,CAAC,cAAc,GACvC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC;YAIlC,aAAa;cA4HX,8BAA8B;;;CAIjD"}
|
|
@@ -55,16 +55,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
55
|
}
|
|
56
56
|
return t;
|
|
57
57
|
};
|
|
58
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
|
-
};
|
|
61
58
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
59
|
exports.Drafts = void 0;
|
|
63
60
|
const environments = __importStar(require("../../../../environments"));
|
|
64
61
|
const core = __importStar(require("../../../../core"));
|
|
65
62
|
const Truvity = __importStar(require("../../../index"));
|
|
63
|
+
const headers_1 = require("../../../../core/headers");
|
|
66
64
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
67
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
68
65
|
const errors = __importStar(require("../../../../errors/index"));
|
|
69
66
|
/**
|
|
70
67
|
* The API to manage Drafts.
|
|
@@ -105,12 +102,12 @@ class Drafts {
|
|
|
105
102
|
}
|
|
106
103
|
__draftCreate(request, requestOptions) {
|
|
107
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
var _a, _b, _c;
|
|
105
|
+
var _a, _b, _c, _d;
|
|
109
106
|
const { idempotencyKey } = request, _body = __rest(request, ["idempotencyKey"]);
|
|
110
107
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
111
|
-
url:
|
|
108
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, 'drafts'),
|
|
112
109
|
method: 'POST',
|
|
113
|
-
headers:
|
|
110
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
114
111
|
contentType: 'application/json',
|
|
115
112
|
requestType: 'json',
|
|
116
113
|
body: serializers.DraftCreateRequest.jsonOrThrow(_body, {
|
|
@@ -222,11 +219,11 @@ class Drafts {
|
|
|
222
219
|
}
|
|
223
220
|
__draftSearch() {
|
|
224
221
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
225
|
-
var _a, _b, _c;
|
|
222
|
+
var _a, _b, _c, _d;
|
|
226
223
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
227
|
-
url:
|
|
224
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, 'drafts/search'),
|
|
228
225
|
method: 'POST',
|
|
229
|
-
headers:
|
|
226
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
230
227
|
contentType: 'application/json',
|
|
231
228
|
requestType: 'json',
|
|
232
229
|
body: serializers.DraftSearchRequest.jsonOrThrow(request, {
|
|
@@ -339,12 +336,12 @@ class Drafts {
|
|
|
339
336
|
}
|
|
340
337
|
__draftLatest(id_1) {
|
|
341
338
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
342
|
-
var _a, _b, _c;
|
|
339
|
+
var _a, _b, _c, _d;
|
|
343
340
|
const { ifNoneMatch } = request;
|
|
344
341
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
345
|
-
url:
|
|
342
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}`),
|
|
346
343
|
method: 'GET',
|
|
347
|
-
headers:
|
|
344
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
348
345
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
349
346
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
350
347
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -456,12 +453,12 @@ class Drafts {
|
|
|
456
453
|
}
|
|
457
454
|
__draftDelete(id, request, requestOptions) {
|
|
458
455
|
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
-
var _a, _b, _c;
|
|
456
|
+
var _a, _b, _c, _d;
|
|
460
457
|
const { idempotencyKey, ifMatch } = request;
|
|
461
458
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
462
|
-
url:
|
|
459
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}`),
|
|
463
460
|
method: 'DELETE',
|
|
464
|
-
headers:
|
|
461
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
465
462
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
466
463
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
467
464
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -581,12 +578,12 @@ class Drafts {
|
|
|
581
578
|
}
|
|
582
579
|
__draftUpdate(id, request, requestOptions) {
|
|
583
580
|
return __awaiter(this, void 0, void 0, function* () {
|
|
584
|
-
var _a, _b, _c;
|
|
581
|
+
var _a, _b, _c, _d;
|
|
585
582
|
const { idempotencyKey, ifMatch } = request, _body = __rest(request, ["idempotencyKey", "ifMatch"]);
|
|
586
583
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
587
|
-
url:
|
|
584
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}`),
|
|
588
585
|
method: 'PATCH',
|
|
589
|
-
headers:
|
|
586
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
590
587
|
contentType: 'application/json',
|
|
591
588
|
requestType: 'json',
|
|
592
589
|
body: serializers.DraftUpdateRequest.jsonOrThrow(_body, {
|
|
@@ -729,12 +726,12 @@ class Drafts {
|
|
|
729
726
|
}
|
|
730
727
|
__draftUpdateAnnotations(id, request, requestOptions) {
|
|
731
728
|
return __awaiter(this, void 0, void 0, function* () {
|
|
732
|
-
var _a, _b, _c;
|
|
729
|
+
var _a, _b, _c, _d;
|
|
733
730
|
const { idempotencyKey, ifMatch } = request, _body = __rest(request, ["idempotencyKey", "ifMatch"]);
|
|
734
731
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
735
|
-
url:
|
|
732
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}/annotations`),
|
|
736
733
|
method: 'PATCH',
|
|
737
|
-
headers:
|
|
734
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
738
735
|
contentType: 'application/json',
|
|
739
736
|
requestType: 'json',
|
|
740
737
|
body: serializers.DraftUpdateAnnotationsRequest.jsonOrThrow(_body, {
|
|
@@ -897,12 +894,12 @@ class Drafts {
|
|
|
897
894
|
}
|
|
898
895
|
__draftLatestIssue(id, request, requestOptions) {
|
|
899
896
|
return __awaiter(this, void 0, void 0, function* () {
|
|
900
|
-
var _a, _b, _c;
|
|
897
|
+
var _a, _b, _c, _d;
|
|
901
898
|
const { ifMatch } = request, _body = __rest(request, ["ifMatch"]);
|
|
902
899
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
903
|
-
url:
|
|
900
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}/issue`),
|
|
904
901
|
method: 'PATCH',
|
|
905
|
-
headers:
|
|
902
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'If-Match': ifMatch != null ? ifMatch : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
906
903
|
contentType: 'application/json',
|
|
907
904
|
requestType: 'json',
|
|
908
905
|
body: serializers.DraftLatestIssueRequest.jsonOrThrow(_body, {
|
|
@@ -1045,12 +1042,12 @@ class Drafts {
|
|
|
1045
1042
|
}
|
|
1046
1043
|
__draftUpdateLabels(id, request, requestOptions) {
|
|
1047
1044
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1048
|
-
var _a, _b, _c;
|
|
1045
|
+
var _a, _b, _c, _d;
|
|
1049
1046
|
const { idempotencyKey, ifMatch } = request, _body = __rest(request, ["idempotencyKey", "ifMatch"]);
|
|
1050
1047
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1051
|
-
url:
|
|
1048
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}/labels`),
|
|
1052
1049
|
method: 'PATCH',
|
|
1053
|
-
headers:
|
|
1050
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1054
1051
|
contentType: 'application/json',
|
|
1055
1052
|
requestType: 'json',
|
|
1056
1053
|
body: serializers.DraftUpdateLabelsRequest.jsonOrThrow(_body, {
|
|
@@ -1189,12 +1186,12 @@ class Drafts {
|
|
|
1189
1186
|
}
|
|
1190
1187
|
__draftRestore(id, request, requestOptions) {
|
|
1191
1188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1192
|
-
var _a, _b, _c;
|
|
1189
|
+
var _a, _b, _c, _d;
|
|
1193
1190
|
const { idempotencyKey, ifMatch } = request;
|
|
1194
1191
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1195
|
-
url:
|
|
1192
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}/restore`),
|
|
1196
1193
|
method: 'POST',
|
|
1197
|
-
headers:
|
|
1194
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1198
1195
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1199
1196
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1200
1197
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1315,12 +1312,12 @@ class Drafts {
|
|
|
1315
1312
|
}
|
|
1316
1313
|
__draftHistory(id_1) {
|
|
1317
1314
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
1318
|
-
var _a, _b, _c;
|
|
1315
|
+
var _a, _b, _c, _d;
|
|
1319
1316
|
const { ifNoneMatch } = request;
|
|
1320
1317
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1321
|
-
url:
|
|
1318
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}/revisions`),
|
|
1322
1319
|
method: 'GET',
|
|
1323
|
-
headers:
|
|
1320
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1324
1321
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1325
1322
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1326
1323
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1428,12 +1425,12 @@ class Drafts {
|
|
|
1428
1425
|
}
|
|
1429
1426
|
__draftRevision(id_1, revision_1) {
|
|
1430
1427
|
return __awaiter(this, arguments, void 0, function* (id, revision, request = {}, requestOptions) {
|
|
1431
|
-
var _a, _b, _c;
|
|
1428
|
+
var _a, _b, _c, _d;
|
|
1432
1429
|
const { ifNoneMatch } = request;
|
|
1433
1430
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1434
|
-
url:
|
|
1431
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}/revisions/${encodeURIComponent(revision)}`),
|
|
1435
1432
|
method: 'GET',
|
|
1436
|
-
headers:
|
|
1433
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({ 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1437
1434
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1438
1435
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1439
1436
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1532,18 +1529,18 @@ class Drafts {
|
|
|
1532
1529
|
}
|
|
1533
1530
|
__draftExport(id, revision, request, requestOptions) {
|
|
1534
1531
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1535
|
-
var _a, _b, _c;
|
|
1532
|
+
var _a, _b, _c, _d;
|
|
1536
1533
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1537
|
-
url:
|
|
1534
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.TruvityEnvironment.Default, `drafts/${encodeURIComponent(id)}/revisions/${encodeURIComponent(revision)}/export`),
|
|
1538
1535
|
method: 'POST',
|
|
1539
|
-
headers:
|
|
1536
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1540
1537
|
contentType: 'application/json',
|
|
1541
1538
|
requestType: 'json',
|
|
1542
1539
|
body: serializers.DraftExportRequest.jsonOrThrow(request, {
|
|
1543
1540
|
unrecognizedObjectKeys: 'strip',
|
|
1544
1541
|
omitUndefined: true,
|
|
1545
1542
|
}),
|
|
1546
|
-
responseType: '
|
|
1543
|
+
responseType: 'binary-response',
|
|
1547
1544
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1548
1545
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1549
1546
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|