@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.
Files changed (205) hide show
  1. package/Client.d.ts +3 -1
  2. package/Client.d.ts.map +1 -1
  3. package/Client.js +43 -1
  4. package/Client.js.map +1 -1
  5. package/ExtendedClient.d.ts +1 -2
  6. package/ExtendedClient.d.ts.map +1 -1
  7. package/ExtendedClient.js +1 -5
  8. package/ExtendedClient.js.map +1 -1
  9. package/api/resources/apiKeys/client/Client.d.ts +3 -1
  10. package/api/resources/apiKeys/client/Client.d.ts.map +1 -1
  11. package/api/resources/apiKeys/client/Client.js +28 -31
  12. package/api/resources/apiKeys/client/Client.js.map +1 -1
  13. package/api/resources/apiKeys/client/index.d.ts +1 -0
  14. package/api/resources/apiKeys/client/index.d.ts.map +1 -1
  15. package/api/resources/apiKeys/client/index.js.map +1 -1
  16. package/api/resources/credentials/client/Client.d.ts +4 -3
  17. package/api/resources/credentials/client/Client.d.ts.map +1 -1
  18. package/api/resources/credentials/client/Client.js +38 -41
  19. package/api/resources/credentials/client/Client.js.map +1 -1
  20. package/api/resources/credentials/client/index.d.ts +1 -0
  21. package/api/resources/credentials/client/index.d.ts.map +1 -1
  22. package/api/resources/credentials/client/index.js.map +1 -1
  23. package/api/resources/desk/client/Client.d.ts +3 -1
  24. package/api/resources/desk/client/Client.d.ts.map +1 -1
  25. package/api/resources/desk/client/Client.js +7 -10
  26. package/api/resources/desk/client/Client.js.map +1 -1
  27. package/api/resources/desk/client/index.d.ts +1 -0
  28. package/api/resources/desk/client/index.d.ts.map +1 -1
  29. package/api/resources/desk/client/index.js.map +1 -1
  30. package/api/resources/didcommMessages/client/Client.d.ts +3 -1
  31. package/api/resources/didcommMessages/client/Client.d.ts.map +1 -1
  32. package/api/resources/didcommMessages/client/Client.js +28 -31
  33. package/api/resources/didcommMessages/client/Client.js.map +1 -1
  34. package/api/resources/didcommMessages/client/index.d.ts +1 -0
  35. package/api/resources/didcommMessages/client/index.d.ts.map +1 -1
  36. package/api/resources/didcommMessages/client/index.js.map +1 -1
  37. package/api/resources/dids/client/Client.d.ts +3 -1
  38. package/api/resources/dids/client/Client.d.ts.map +1 -1
  39. package/api/resources/dids/client/Client.js +4 -7
  40. package/api/resources/dids/client/Client.js.map +1 -1
  41. package/api/resources/dids/client/index.d.ts +1 -0
  42. package/api/resources/dids/client/index.d.ts.map +1 -1
  43. package/api/resources/dids/client/index.js.map +1 -1
  44. package/api/resources/drafts/client/Client.d.ts +4 -3
  45. package/api/resources/drafts/client/Client.d.ts.map +1 -1
  46. package/api/resources/drafts/client/Client.js +38 -41
  47. package/api/resources/drafts/client/Client.js.map +1 -1
  48. package/api/resources/drafts/client/index.d.ts +1 -0
  49. package/api/resources/drafts/client/index.d.ts.map +1 -1
  50. package/api/resources/drafts/client/index.js.map +1 -1
  51. package/api/resources/files/client/Client.d.ts +4 -3
  52. package/api/resources/files/client/Client.d.ts.map +1 -1
  53. package/api/resources/files/client/Client.js +35 -38
  54. package/api/resources/files/client/Client.js.map +1 -1
  55. package/api/resources/files/client/index.d.ts +1 -0
  56. package/api/resources/files/client/index.d.ts.map +1 -1
  57. package/api/resources/files/client/index.js.map +1 -1
  58. package/api/resources/gdpr/client/Client.d.ts +3 -1
  59. package/api/resources/gdpr/client/Client.d.ts.map +1 -1
  60. package/api/resources/gdpr/client/Client.js +4 -7
  61. package/api/resources/gdpr/client/Client.js.map +1 -1
  62. package/api/resources/gdpr/client/index.d.ts +1 -0
  63. package/api/resources/gdpr/client/index.d.ts.map +1 -1
  64. package/api/resources/gdpr/client/index.js.map +1 -1
  65. package/api/resources/keys/client/Client.d.ts +6 -5
  66. package/api/resources/keys/client/Client.d.ts.map +1 -1
  67. package/api/resources/keys/client/Client.js +43 -46
  68. package/api/resources/keys/client/Client.js.map +1 -1
  69. package/api/resources/keys/client/index.d.ts +1 -0
  70. package/api/resources/keys/client/index.d.ts.map +1 -1
  71. package/api/resources/keys/client/index.js.map +1 -1
  72. package/api/resources/presentations/client/Client.d.ts +5 -4
  73. package/api/resources/presentations/client/Client.d.ts.map +1 -1
  74. package/api/resources/presentations/client/Client.js +45 -48
  75. package/api/resources/presentations/client/Client.js.map +1 -1
  76. package/api/resources/presentations/client/index.d.ts +1 -0
  77. package/api/resources/presentations/client/index.d.ts.map +1 -1
  78. package/api/resources/presentations/client/index.js.map +1 -1
  79. package/core/fetcher/BinaryResponse.d.ts +21 -0
  80. package/core/fetcher/BinaryResponse.d.ts.map +1 -0
  81. package/core/fetcher/BinaryResponse.js +18 -0
  82. package/core/fetcher/BinaryResponse.js.map +1 -0
  83. package/core/fetcher/Fetcher.d.ts +3 -2
  84. package/core/fetcher/Fetcher.d.ts.map +1 -1
  85. package/core/fetcher/Fetcher.js +25 -12
  86. package/core/fetcher/Fetcher.js.map +1 -1
  87. package/core/fetcher/ResponseWithBody.d.ts +5 -0
  88. package/core/fetcher/ResponseWithBody.d.ts.map +1 -0
  89. package/core/fetcher/ResponseWithBody.js +7 -0
  90. package/core/fetcher/ResponseWithBody.js.map +1 -0
  91. package/core/fetcher/createRequestUrl.d.ts +1 -1
  92. package/core/fetcher/createRequestUrl.d.ts.map +1 -1
  93. package/core/fetcher/createRequestUrl.js +3 -7
  94. package/core/fetcher/createRequestUrl.js.map +1 -1
  95. package/core/fetcher/getErrorResponseBody.d.ts +2 -0
  96. package/core/fetcher/getErrorResponseBody.d.ts.map +1 -0
  97. package/core/fetcher/getErrorResponseBody.js +45 -0
  98. package/core/fetcher/getErrorResponseBody.js.map +1 -0
  99. package/core/fetcher/getFetchFn.d.ts +1 -4
  100. package/core/fetcher/getFetchFn.d.ts.map +1 -1
  101. package/core/fetcher/getFetchFn.js +1 -52
  102. package/core/fetcher/getFetchFn.js.map +1 -1
  103. package/core/fetcher/getResponseBody.d.ts.map +1 -1
  104. package/core/fetcher/getResponseBody.js +34 -33
  105. package/core/fetcher/getResponseBody.js.map +1 -1
  106. package/core/fetcher/index.d.ts +1 -0
  107. package/core/fetcher/index.d.ts.map +1 -1
  108. package/core/fetcher/index.js.map +1 -1
  109. package/core/headers.d.ts +4 -0
  110. package/core/headers.d.ts.map +1 -0
  111. package/core/headers.js +30 -0
  112. package/core/headers.js.map +1 -0
  113. package/core/index.d.ts +1 -0
  114. package/core/index.d.ts.map +1 -1
  115. package/core/index.js +2 -1
  116. package/core/index.js.map +1 -1
  117. package/core/runtime/runtime.d.ts.map +1 -1
  118. package/core/runtime/runtime.js +0 -1
  119. package/core/runtime/runtime.js.map +1 -1
  120. package/core/url/index.d.ts +3 -0
  121. package/core/url/index.d.ts.map +1 -0
  122. package/core/url/index.js +8 -0
  123. package/core/url/index.js.map +1 -0
  124. package/core/url/join.d.ts +2 -0
  125. package/core/url/join.d.ts.map +1 -0
  126. package/core/url/join.js +50 -0
  127. package/core/url/join.js.map +1 -0
  128. package/core/url/qs.d.ts +7 -0
  129. package/core/url/qs.d.ts.map +1 -0
  130. package/core/url/qs.js +65 -0
  131. package/core/url/qs.js.map +1 -0
  132. package/documents/credential/document/vcdm.d.ts +1 -1
  133. package/documents/credential/document/vcdm.d.ts.map +1 -1
  134. package/documents/credential/document/vcdm.js +12 -1
  135. package/documents/credential/document/vcdm.js.map +1 -1
  136. package/documents/credential/document.d.ts +2 -2
  137. package/documents/credential/document.d.ts.map +1 -1
  138. package/documents/credential/document.js +21 -8
  139. package/documents/credential/document.js.map +1 -1
  140. package/documents/credential/draft/draft.d.ts +2 -2
  141. package/documents/credential/draft/draft.d.ts.map +1 -1
  142. package/documents/credential/draft/draft.js.map +1 -1
  143. package/documents/credential/flavor/vcdm1_1.d.ts +3 -3
  144. package/documents/credential/flavor/vcdm1_1.d.ts.map +1 -1
  145. package/documents/credential/flavor/vcdm1_1.js +27 -25
  146. package/documents/credential/flavor/vcdm1_1.js.map +1 -1
  147. package/documents/credential/flavor/vcdm2_0.d.ts +2 -2
  148. package/documents/credential/flavor/vcdm2_0.d.ts.map +1 -1
  149. package/documents/credential/flavor/vcdm2_0.js +29 -16
  150. package/documents/credential/flavor/vcdm2_0.js.map +1 -1
  151. package/documents/credential/flavor.d.ts +2 -2
  152. package/documents/credential/flavor.d.ts.map +1 -1
  153. package/documents/credential/flavor.js +25 -10
  154. package/documents/credential/flavor.js.map +1 -1
  155. package/documents/credential/flavor.spec.js +3 -3
  156. package/documents/credential/flavor.spec.js.map +1 -1
  157. package/documents/credential/types.d.ts +4 -4
  158. package/documents/credential/types.d.ts.map +1 -1
  159. package/documents/credential/types.js.map +1 -1
  160. package/documents/credential/verifiable/verifiable.d.ts.map +1 -1
  161. package/documents/credential/verifiable/verifiable.js +1 -2
  162. package/documents/credential/verifiable/verifiable.js.map +1 -1
  163. package/documents/credential/verifiable/with-claims.js +1 -1
  164. package/documents/credential/verifiable/with-claims.js.map +1 -1
  165. package/documents/credential.d.ts.map +1 -1
  166. package/documents/credential.js +1 -5
  167. package/documents/credential.js.map +1 -1
  168. package/documents/index.d.ts +0 -1
  169. package/documents/index.d.ts.map +1 -1
  170. package/documents/index.js +0 -1
  171. package/documents/index.js.map +1 -1
  172. package/documents/models.d.ts +1 -2
  173. package/documents/models.d.ts.map +1 -1
  174. package/documents/models.js +5 -3
  175. package/documents/models.js.map +1 -1
  176. package/documents/presentation.d.ts.map +1 -1
  177. package/documents/presentation.js +1 -5
  178. package/documents/presentation.js.map +1 -1
  179. package/documents/types.d.ts +2 -3
  180. package/documents/types.d.ts.map +1 -1
  181. package/documents/types.js.map +1 -1
  182. package/middlewares/csrf/csrf.d.ts.map +1 -1
  183. package/middlewares/csrf/csrf.js +1 -5
  184. package/middlewares/csrf/csrf.js.map +1 -1
  185. package/package.json +9 -14
  186. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -31
  187. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts.map +0 -1
  188. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -248
  189. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js.map +0 -1
  190. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -22
  191. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts.map +0 -1
  192. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -127
  193. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js.map +0 -1
  194. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -32
  195. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts.map +0 -1
  196. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -230
  197. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js.map +0 -1
  198. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -19
  199. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts.map +0 -1
  200. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -60
  201. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js.map +0 -1
  202. package/documents/utils/stream.d.ts +0 -8
  203. package/documents/utils/stream.d.ts.map +0 -1
  204. package/documents/utils/stream.js +0 -50
  205. package/documents/utils/stream.js.map +0 -1
@@ -1,2 +1,3 @@
1
+ export {};
1
2
  export * from './requests';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -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":";;;;;;;;;;;;;;;;AAAA,6CAA2B","sourcesContent":["export * from './requests';\n"]}
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;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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 url_join_1 = __importDefault(require("url-join"));
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: (0, url_join_1.default)((_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`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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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W,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;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;A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C;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,2 +1,3 @@
1
+ export {};
1
2
  export * from './requests';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -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":";;;;;;;;;;;;;;;;AAAA,6CAA2B","sourcesContent":["export * from './requests';\n"]}
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.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C,EAAE,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: (0, url_join_1.default)((_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'),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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'),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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)}`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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)}`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'Idempotency-Key': idempotencyKey != null ? idempotencyKey : undefined, 'If-Match': ifMatch }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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: (0, url_join_1.default)((_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)}`),
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: Object.assign(Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': '@truvity/sdk', 'X-Fern-SDK-Version': '0.37.6', 'User-Agent': '@truvity/sdk/0.37.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version, 'If-None-Match': ifNoneMatch != null ? ifNoneMatch : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.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,