@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/credentials/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/credentials/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/credentials/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/resources/credentials/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,6CAA2B","sourcesContent":["export {};\nexport * from './requests';\n"]}
|
|
@@ -10,6 +10,8 @@ export declare namespace Desk {
|
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
13
15
|
fetcher?: core.FetchFunction;
|
|
14
16
|
}
|
|
15
17
|
interface RequestOptions {
|
|
@@ -20,7 +22,7 @@ export declare namespace Desk {
|
|
|
20
22
|
/** A hook to abort the request. */
|
|
21
23
|
abortSignal?: AbortSignal;
|
|
22
24
|
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string>;
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/desk/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,IAAI,CAAC;IAC1B,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,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,oDAAoD;QACpD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/desk/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,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AAkB,CACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc,GACrC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;YAInB,oBAAoB;cA4FlB,8BAA8B;;;CAIjD"}
|
|
@@ -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.Desk = 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
|
/**
|
|
@@ -81,12 +78,12 @@ class Desk {
|
|
|
81
78
|
}
|
|
82
79
|
__didDocumentGet(tenantId_1) {
|
|
83
80
|
return __awaiter(this, arguments, void 0, function* (tenantId, request = {}, requestOptions) {
|
|
84
|
-
var _a, _b, _c;
|
|
81
|
+
var _a, _b, _c, _d;
|
|
85
82
|
const { ifNoneMatch } = request;
|
|
86
83
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
87
|
-
url:
|
|
84
|
+
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, `${encodeURIComponent(tenantId)}/did.json`),
|
|
88
85
|
method: 'GET',
|
|
89
|
-
headers:
|
|
86
|
+
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),
|
|
90
87
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
91
88
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
92
89
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -169,11 +166,11 @@ class Desk {
|
|
|
169
166
|
}
|
|
170
167
|
__didCommMessageRecv(tenantId, request, requestOptions) {
|
|
171
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
var _a, _b, _c;
|
|
169
|
+
var _a, _b, _c, _d;
|
|
173
170
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
174
|
-
url:
|
|
171
|
+
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, `${encodeURIComponent(tenantId)}/didcomm-messages/recv`),
|
|
175
172
|
method: 'POST',
|
|
176
|
-
headers:
|
|
173
|
+
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),
|
|
177
174
|
contentType: 'application/didcomm-signed+json',
|
|
178
175
|
requestType: 'json',
|
|
179
176
|
body: serializers.desk.didCommMessageRecv.Request.jsonOrThrow(request, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../../../../src/api/resources/desk/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;;;;;;;;;;;;;OAaG;IACI,cAAc,CACjB,QAAgB,EAChB,UAAyC,EAAE,EAC3C,cAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IAC1G,CAAC;IAEa,gBAAgB;6DAC1B,QAAgB,EAChB,UAAyC,EAAE,EAC3C,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,IAAA,kBAAO,EACR,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,GAAG,kBAAkB,CAAC,QAAQ,CAAC,WAAW,CAC7C;gBACD,MAAM,EAAE,KAAK;gBACb,OAAO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,KAAK,SAAS;oBACV,MAAM,IAAI,MAAM,CAAC,mBAAmB,CAChC,wEAAwE,CAC3E,CAAC;gBACN,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;AAvPD,oBAuPC","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 Desk {\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 and to receive DIDComm messages.\n */\nexport class Desk {\n constructor(protected readonly _options: Desk.Options = {}) {}\n\n /**\n * Get DID-Document for [did:web Method Specification](https://w3c-ccg.github.io/did-method-web/).\n *\n * @param {string} tenantId - The ID of the tenant.\n * @param {Truvity.DidDocumentGetRequest} request\n * @param {Desk.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link Truvity.BadRequestError}\n * @throws {@link Truvity.TooManyRequestsError}\n * @throws {@link Truvity.InternalServerError}\n *\n * @example\n * await client.desk.didDocumentGet(\"tenant_id\")\n */\n public didDocumentGet(\n tenantId: string,\n request: Truvity.DidDocumentGetRequest = {},\n requestOptions?: Desk.RequestOptions,\n ): core.HttpResponsePromise<Truvity.DidDocument> {\n return core.HttpResponsePromise.fromPromise(this.__didDocumentGet(tenantId, request, requestOptions));\n }\n\n private async __didDocumentGet(\n tenantId: string,\n request: Truvity.DidDocumentGetRequest = {},\n requestOptions?: Desk.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 `${encodeURIComponent(tenantId)}/did.json`,\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 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 /{tenant_id}/did.json.');\n case 'unknown':\n throw new errors.TruvityError({\n message: _response.error.errorMessage,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n /**\n * Receive DIDComm Message.\n *\n * @param {string} tenantId - The ID of the tenant.\n * @param {string} request\n * @param {Desk.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link Truvity.BadRequestError}\n * @throws {@link Truvity.UnsupportedMediaTypeError}\n * @throws {@link Truvity.InternalServerError}\n *\n * @example\n * await client.desk.didCommMessageRecv(\"tenant_id\", \"string\")\n */\n public didCommMessageRecv(\n tenantId: string,\n request: string,\n requestOptions?: Desk.RequestOptions,\n ): core.HttpResponsePromise<void> {\n return core.HttpResponsePromise.fromPromise(this.__didCommMessageRecv(tenantId, request, requestOptions));\n }\n\n private async __didCommMessageRecv(\n tenantId: string,\n request: string,\n requestOptions?: Desk.RequestOptions,\n ): Promise<core.WithRawResponse<void>> {\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 `${encodeURIComponent(tenantId)}/didcomm-messages/recv`,\n ),\n method: 'POST',\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 ...(await this._getCustomAuthorizationHeaders()),\n ...requestOptions?.headers,\n },\n contentType: 'application/didcomm-signed+json',\n requestType: 'json',\n body: serializers.desk.didCommMessageRecv.Request.jsonOrThrow(request, {\n unrecognizedObjectKeys: 'strip',\n omitUndefined: true,\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 { data: undefined, rawResponse: _response.rawResponse };\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 415:\n throw new Truvity.UnsupportedMediaTypeError(\n serializers.UnsupportedMediaTypeProblems.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(\n 'Timeout exceeded when calling POST /{tenant_id}/didcomm-messages/recv.',\n );\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/desk/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;;;;;;;;;;;;;OAaG;IACI,cAAc,CACjB,QAAgB,EAChB,UAAyC,EAAE,EAC3C,cAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,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AAC,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,CAChC,wEAAwE,CAC3E,CAAC;gBACN,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;AAnPD,oBAmPC","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 Desk {\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 and to receive DIDComm messages.\n */\nexport class Desk {\n protected readonly _options: Desk.Options;\n\n constructor(_options: Desk.Options = {}) {\n this._options = _options;\n }\n\n /**\n * Get DID-Document for [did:web Method Specification](https://w3c-ccg.github.io/did-method-web/).\n *\n * @param {string} tenantId - The ID of the tenant.\n * @param {Truvity.DidDocumentGetRequest} request\n * @param {Desk.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link Truvity.BadRequestError}\n * @throws {@link Truvity.TooManyRequestsError}\n * @throws {@link Truvity.InternalServerError}\n *\n * @example\n * await client.desk.didDocumentGet(\"tenant_id\")\n */\n public didDocumentGet(\n tenantId: string,\n request: Truvity.DidDocumentGetRequest = {},\n requestOptions?: Desk.RequestOptions,\n ): core.HttpResponsePromise<Truvity.DidDocument> {\n return core.HttpResponsePromise.fromPromise(this.__didDocumentGet(tenantId, request, requestOptions));\n }\n\n private async __didDocumentGet(\n tenantId: string,\n request: Truvity.DidDocumentGetRequest = {},\n requestOptions?: Desk.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 `${encodeURIComponent(tenantId)}/did.json`,\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 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 /{tenant_id}/did.json.');\n case 'unknown':\n throw new errors.TruvityError({\n message: _response.error.errorMessage,\n rawResponse: _response.rawResponse,\n });\n }\n }\n\n /**\n * Receive DIDComm Message.\n *\n * @param {string} tenantId - The ID of the tenant.\n * @param {string} request\n * @param {Desk.RequestOptions} requestOptions - Request-specific configuration.\n *\n * @throws {@link Truvity.BadRequestError}\n * @throws {@link Truvity.UnsupportedMediaTypeError}\n * @throws {@link Truvity.InternalServerError}\n *\n * @example\n * await client.desk.didCommMessageRecv(\"tenant_id\", \"string\")\n */\n public didCommMessageRecv(\n tenantId: string,\n request: string,\n requestOptions?: Desk.RequestOptions,\n ): core.HttpResponsePromise<void> {\n return core.HttpResponsePromise.fromPromise(this.__didCommMessageRecv(tenantId, request, requestOptions));\n }\n\n private async __didCommMessageRecv(\n tenantId: string,\n request: string,\n requestOptions?: Desk.RequestOptions,\n ): Promise<core.WithRawResponse<void>> {\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 `${encodeURIComponent(tenantId)}/didcomm-messages/recv`,\n ),\n method: 'POST',\n headers: mergeHeaders(\n this._options?.headers,\n mergeOnlyDefinedHeaders({ ...(await this._getCustomAuthorizationHeaders()) }),\n requestOptions?.headers,\n ),\n contentType: 'application/didcomm-signed+json',\n requestType: 'json',\n body: serializers.desk.didCommMessageRecv.Request.jsonOrThrow(request, {\n unrecognizedObjectKeys: 'strip',\n omitUndefined: true,\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 { data: undefined, rawResponse: _response.rawResponse };\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 415:\n throw new Truvity.UnsupportedMediaTypeError(\n serializers.UnsupportedMediaTypeProblems.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(\n 'Timeout exceeded when calling POST /{tenant_id}/didcomm-messages/recv.',\n );\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/desk/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/desk/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/desk/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/resources/desk/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,6CAA2B","sourcesContent":["export {};\nexport * from './requests';\n"]}
|
|
@@ -10,6 +10,8 @@ export declare namespace DidcommMessages {
|
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
13
15
|
fetcher?: core.FetchFunction;
|
|
14
16
|
}
|
|
15
17
|
interface RequestOptions {
|
|
@@ -20,7 +22,7 @@ export declare namespace DidcommMessages {
|
|
|
20
22
|
/** A hook to abort the request. */
|
|
21
23
|
abortSignal?: AbortSignal;
|
|
22
24
|
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string>;
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../../../src/api/resources/didcommMessages/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,eAAe,CAAC;IACrC,UAAiB,OAAO;QACpB,WAAW,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,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AE,eAAe,CAAC,cAAc,GAChD,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,sBAAsB,CAAC;YAM7C,wBAAwB;cAiItB,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.DidcommMessages = 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 DIDComm messages.
|
|
@@ -94,11 +91,11 @@ class DidcommMessages {
|
|
|
94
91
|
}
|
|
95
92
|
__didcommMessageSearch() {
|
|
96
93
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
97
|
-
var _a, _b, _c;
|
|
94
|
+
var _a, _b, _c, _d;
|
|
98
95
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
99
|
-
url:
|
|
96
|
+
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, 'didcomm-messages/search'),
|
|
100
97
|
method: 'POST',
|
|
101
|
-
headers:
|
|
98
|
+
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),
|
|
102
99
|
contentType: 'application/json',
|
|
103
100
|
requestType: 'json',
|
|
104
101
|
body: serializers.DidcommMessageSearchRequest.jsonOrThrow(request, {
|
|
@@ -216,12 +213,12 @@ class DidcommMessages {
|
|
|
216
213
|
}
|
|
217
214
|
__didCommMessageSend(request, requestOptions) {
|
|
218
215
|
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
-
var _a, _b, _c;
|
|
216
|
+
var _a, _b, _c, _d;
|
|
220
217
|
const { idempotencyKey } = request, _body = __rest(request, ["idempotencyKey"]);
|
|
221
218
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
222
|
-
url:
|
|
219
|
+
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, 'didcomm-messages/send'),
|
|
223
220
|
method: 'POST',
|
|
224
|
-
headers:
|
|
221
|
+
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),
|
|
225
222
|
contentType: 'application/json',
|
|
226
223
|
requestType: 'json',
|
|
227
224
|
body: serializers.DidCommMessageSendRequest.jsonOrThrow(_body, {
|
|
@@ -341,12 +338,12 @@ class DidcommMessages {
|
|
|
341
338
|
}
|
|
342
339
|
__didcommMessageLatest(id_1) {
|
|
343
340
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
344
|
-
var _a, _b, _c;
|
|
341
|
+
var _a, _b, _c, _d;
|
|
345
342
|
const { ifNoneMatch } = request;
|
|
346
343
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
347
|
-
url:
|
|
344
|
+
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, `didcomm-messages/${encodeURIComponent(id)}`),
|
|
348
345
|
method: 'GET',
|
|
349
|
-
headers:
|
|
346
|
+
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),
|
|
350
347
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
351
348
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
352
349
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -458,12 +455,12 @@ class DidcommMessages {
|
|
|
458
455
|
}
|
|
459
456
|
__didcommMessageDelete(id, request, requestOptions) {
|
|
460
457
|
return __awaiter(this, void 0, void 0, function* () {
|
|
461
|
-
var _a, _b, _c;
|
|
458
|
+
var _a, _b, _c, _d;
|
|
462
459
|
const { idempotencyKey, ifMatch } = request;
|
|
463
460
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
464
|
-
url:
|
|
461
|
+
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, `didcomm-messages/${encodeURIComponent(id)}`),
|
|
465
462
|
method: 'DELETE',
|
|
466
|
-
headers:
|
|
463
|
+
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),
|
|
467
464
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
468
465
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
469
466
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -585,12 +582,12 @@ class DidcommMessages {
|
|
|
585
582
|
}
|
|
586
583
|
__didcommMessageUpdateAnnotations(id, request, requestOptions) {
|
|
587
584
|
return __awaiter(this, void 0, void 0, function* () {
|
|
588
|
-
var _a, _b, _c;
|
|
585
|
+
var _a, _b, _c, _d;
|
|
589
586
|
const { idempotencyKey, ifMatch } = request, _body = __rest(request, ["idempotencyKey", "ifMatch"]);
|
|
590
587
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
591
|
-
url:
|
|
588
|
+
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, `didcomm-messages/${encodeURIComponent(id)}/annotations`),
|
|
592
589
|
method: 'PATCH',
|
|
593
|
-
headers:
|
|
590
|
+
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),
|
|
594
591
|
contentType: 'application/json',
|
|
595
592
|
requestType: 'json',
|
|
596
593
|
body: serializers.DidcommMessageUpdateAnnotationsRequest.jsonOrThrow(_body, {
|
|
@@ -733,12 +730,12 @@ class DidcommMessages {
|
|
|
733
730
|
}
|
|
734
731
|
__didcommMessageUpdateLabels(id, request, requestOptions) {
|
|
735
732
|
return __awaiter(this, void 0, void 0, function* () {
|
|
736
|
-
var _a, _b, _c;
|
|
733
|
+
var _a, _b, _c, _d;
|
|
737
734
|
const { idempotencyKey, ifMatch } = request, _body = __rest(request, ["idempotencyKey", "ifMatch"]);
|
|
738
735
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
739
|
-
url:
|
|
736
|
+
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, `didcomm-messages/${encodeURIComponent(id)}/labels`),
|
|
740
737
|
method: 'PATCH',
|
|
741
|
-
headers:
|
|
738
|
+
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),
|
|
742
739
|
contentType: 'application/json',
|
|
743
740
|
requestType: 'json',
|
|
744
741
|
body: serializers.DidcommMessageUpdateLabelsRequest.jsonOrThrow(_body, {
|
|
@@ -877,12 +874,12 @@ class DidcommMessages {
|
|
|
877
874
|
}
|
|
878
875
|
__didcommMessageRestore(id, request, requestOptions) {
|
|
879
876
|
return __awaiter(this, void 0, void 0, function* () {
|
|
880
|
-
var _a, _b, _c;
|
|
877
|
+
var _a, _b, _c, _d;
|
|
881
878
|
const { idempotencyKey, ifMatch } = request;
|
|
882
879
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
883
|
-
url:
|
|
880
|
+
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, `didcomm-messages/${encodeURIComponent(id)}/restore`),
|
|
884
881
|
method: 'POST',
|
|
885
|
-
headers:
|
|
882
|
+
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),
|
|
886
883
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
887
884
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
888
885
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1003,12 +1000,12 @@ class DidcommMessages {
|
|
|
1003
1000
|
}
|
|
1004
1001
|
__didcommMessageHistory(id_1) {
|
|
1005
1002
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
1006
|
-
var _a, _b, _c;
|
|
1003
|
+
var _a, _b, _c, _d;
|
|
1007
1004
|
const { ifNoneMatch } = request;
|
|
1008
1005
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1009
|
-
url:
|
|
1006
|
+
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, `didcomm-messages/${encodeURIComponent(id)}/revisions`),
|
|
1010
1007
|
method: 'GET',
|
|
1011
|
-
headers:
|
|
1008
|
+
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),
|
|
1012
1009
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1013
1010
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1014
1011
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -1116,12 +1113,12 @@ class DidcommMessages {
|
|
|
1116
1113
|
}
|
|
1117
1114
|
__didcommMessageRevision(id_1, revision_1) {
|
|
1118
1115
|
return __awaiter(this, arguments, void 0, function* (id, revision, request = {}, requestOptions) {
|
|
1119
|
-
var _a, _b, _c;
|
|
1116
|
+
var _a, _b, _c, _d;
|
|
1120
1117
|
const { ifNoneMatch } = request;
|
|
1121
1118
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1122
|
-
url:
|
|
1119
|
+
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, `didcomm-messages/${encodeURIComponent(id)}/revisions/${encodeURIComponent(revision)}`),
|
|
1123
1120
|
method: 'GET',
|
|
1124
|
-
headers:
|
|
1121
|
+
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),
|
|
1125
1122
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1126
1123
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1127
1124
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|