@apideck/unify 0.38.0 → 0.38.2
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/README.md +30 -10
- package/examples/package-lock.json +1 -1
- package/funcs/proxyDelete.d.ts +30 -0
- package/funcs/proxyDelete.d.ts.map +1 -0
- package/funcs/proxyDelete.js +175 -0
- package/funcs/proxyDelete.js.map +1 -0
- package/funcs/proxyGet.d.ts +30 -0
- package/funcs/proxyGet.d.ts.map +1 -0
- package/funcs/proxyGet.js +175 -0
- package/funcs/proxyGet.js.map +1 -0
- package/funcs/proxyOptions.d.ts +30 -0
- package/funcs/proxyOptions.d.ts.map +1 -0
- package/funcs/proxyOptions.js +175 -0
- package/funcs/proxyOptions.js.map +1 -0
- package/funcs/proxyPatch.d.ts +30 -0
- package/funcs/proxyPatch.d.ts.map +1 -0
- package/funcs/proxyPatch.js +176 -0
- package/funcs/proxyPatch.js.map +1 -0
- package/funcs/proxyPost.d.ts +30 -0
- package/funcs/proxyPost.d.ts.map +1 -0
- package/funcs/proxyPost.js +176 -0
- package/funcs/proxyPost.js.map +1 -0
- package/funcs/proxyPut.d.ts +30 -0
- package/funcs/proxyPut.d.ts.map +1 -0
- package/funcs/proxyPut.js +176 -0
- package/funcs/proxyPut.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/companiesfilter.d.ts +4 -0
- package/models/components/companiesfilter.d.ts.map +1 -1
- package/models/components/companiesfilter.js +8 -0
- package/models/components/companiesfilter.js.map +1 -1
- package/models/components/contactsfilter.d.ts +4 -0
- package/models/components/contactsfilter.d.ts.map +1 -1
- package/models/components/contactsfilter.js +4 -0
- package/models/components/contactsfilter.js.map +1 -1
- package/models/components/ecommercecustomersfilter.d.ts +10 -0
- package/models/components/ecommercecustomersfilter.d.ts.map +1 -1
- package/models/components/ecommercecustomersfilter.js +4 -0
- package/models/components/ecommercecustomersfilter.js.map +1 -1
- package/models/components/employee.d.ts +1 -0
- package/models/components/employee.d.ts.map +1 -1
- package/models/components/employee.js +1 -0
- package/models/components/employee.js.map +1 -1
- package/models/components/invoiceitemsfilter.d.ts +2 -0
- package/models/components/invoiceitemsfilter.d.ts.map +1 -1
- package/models/components/invoiceitemsfilter.js +2 -0
- package/models/components/invoiceitemsfilter.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/unauthorized.d.ts +142 -0
- package/models/errors/unauthorized.d.ts.map +1 -0
- package/models/errors/unauthorized.js +139 -0
- package/models/errors/unauthorized.js.map +1 -0
- package/models/operations/index.d.ts +6 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +6 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/proxydeleteproxy.d.ts +103 -0
- package/models/operations/proxydeleteproxy.d.ts.map +1 -0
- package/models/operations/proxydeleteproxy.js +80 -0
- package/models/operations/proxydeleteproxy.js.map +1 -0
- package/models/operations/proxygetproxy.d.ts +103 -0
- package/models/operations/proxygetproxy.d.ts.map +1 -0
- package/models/operations/proxygetproxy.js +80 -0
- package/models/operations/proxygetproxy.js.map +1 -0
- package/models/operations/proxyoptionsproxy.d.ts +103 -0
- package/models/operations/proxyoptionsproxy.d.ts.map +1 -0
- package/models/operations/proxyoptionsproxy.js +80 -0
- package/models/operations/proxyoptionsproxy.js.map +1 -0
- package/models/operations/proxypatchproxy.d.ts +120 -0
- package/models/operations/proxypatchproxy.d.ts.map +1 -0
- package/models/operations/proxypatchproxy.js +102 -0
- package/models/operations/proxypatchproxy.js.map +1 -0
- package/models/operations/proxypostproxy.d.ts +120 -0
- package/models/operations/proxypostproxy.d.ts.map +1 -0
- package/models/operations/proxypostproxy.js +103 -0
- package/models/operations/proxypostproxy.js.map +1 -0
- package/models/operations/proxyputproxy.d.ts +120 -0
- package/models/operations/proxyputproxy.d.ts.map +1 -0
- package/models/operations/proxyputproxy.js +102 -0
- package/models/operations/proxyputproxy.js.map +1 -0
- package/package.json +1 -1
- package/sdk/proxy.d.ts +77 -0
- package/sdk/proxy.d.ts.map +1 -0
- package/sdk/proxy.js +90 -0
- package/sdk/proxy.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/__tests__/proxy.test.ts +41 -0
- package/src/funcs/proxyDelete.ts +258 -0
- package/src/funcs/proxyGet.ts +258 -0
- package/src/funcs/proxyOptions.ts +258 -0
- package/src/funcs/proxyPatch.ts +259 -0
- package/src/funcs/proxyPost.ts +259 -0
- package/src/funcs/proxyPut.ts +259 -0
- package/src/lib/config.ts +4 -4
- package/src/models/components/companiesfilter.ts +12 -0
- package/src/models/components/contactsfilter.ts +8 -0
- package/src/models/components/ecommercecustomersfilter.ts +14 -0
- package/src/models/components/employee.ts +1 -0
- package/src/models/components/invoiceitemsfilter.ts +4 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/unauthorized.ts +282 -0
- package/src/models/operations/index.ts +6 -0
- package/src/models/operations/proxydeleteproxy.ts +158 -0
- package/src/models/operations/proxygetproxy.ts +158 -0
- package/src/models/operations/proxyoptionsproxy.ts +158 -0
- package/src/models/operations/proxypatchproxy.ts +227 -0
- package/src/models/operations/proxypostproxy.ts +212 -0
- package/src/models/operations/proxyputproxy.ts +215 -0
- package/src/sdk/proxy.ts +135 -0
- package/src/sdk/sdk.ts +6 -0
package/README.md
CHANGED
|
@@ -604,6 +604,15 @@ run();
|
|
|
604
604
|
* [list](docs/sdks/collectionusers/README.md#list) - List Users
|
|
605
605
|
* [get](docs/sdks/collectionusers/README.md#get) - Get user
|
|
606
606
|
|
|
607
|
+
### [Proxy](docs/sdks/proxy/README.md)
|
|
608
|
+
|
|
609
|
+
* [get](docs/sdks/proxy/README.md#get) - GET
|
|
610
|
+
* [options](docs/sdks/proxy/README.md#options) - OPTIONS
|
|
611
|
+
* [post](docs/sdks/proxy/README.md#post) - POST
|
|
612
|
+
* [put](docs/sdks/proxy/README.md#put) - PUT
|
|
613
|
+
* [patch](docs/sdks/proxy/README.md#patch) - PATCH
|
|
614
|
+
* [delete](docs/sdks/proxy/README.md#delete) - DELETE
|
|
615
|
+
|
|
607
616
|
### [Sms.Messages](docs/sdks/messages/README.md)
|
|
608
617
|
|
|
609
618
|
* [list](docs/sdks/messages/README.md#list) - List Messages
|
|
@@ -975,6 +984,12 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
975
984
|
- [`issueTrackingCollectionTicketsUpdate`](docs/sdks/collectiontickets/README.md#update) - Update Ticket
|
|
976
985
|
- [`issueTrackingCollectionUsersGet`](docs/sdks/collectionusers/README.md#get) - Get user
|
|
977
986
|
- [`issueTrackingCollectionUsersList`](docs/sdks/collectionusers/README.md#list) - List Users
|
|
987
|
+
- [`proxyDelete`](docs/sdks/proxy/README.md#delete) - DELETE
|
|
988
|
+
- [`proxyGet`](docs/sdks/proxy/README.md#get) - GET
|
|
989
|
+
- [`proxyOptions`](docs/sdks/proxy/README.md#options) - OPTIONS
|
|
990
|
+
- [`proxyPatch`](docs/sdks/proxy/README.md#patch) - PATCH
|
|
991
|
+
- [`proxyPost`](docs/sdks/proxy/README.md#post) - POST
|
|
992
|
+
- [`proxyPut`](docs/sdks/proxy/README.md#put) - PUT
|
|
978
993
|
- [`smsMessagesCreate`](docs/sdks/messages/README.md#create) - Create Message
|
|
979
994
|
- [`smsMessagesDelete`](docs/sdks/messages/README.md#delete) - Delete Message
|
|
980
995
|
- [`smsMessagesGet`](docs/sdks/messages/README.md#get) - Get Message
|
|
@@ -1269,13 +1284,13 @@ run();
|
|
|
1269
1284
|
### Error Classes
|
|
1270
1285
|
**Primary errors:**
|
|
1271
1286
|
* [`ApideckError`](./src/models/errors/apideckerror.ts): The base class for HTTP error responses.
|
|
1272
|
-
* [`UnauthorizedResponse`](./src/models/errors/unauthorizedresponse.ts): Unauthorized. Status code `401`.
|
|
1273
|
-
* [`PaymentRequiredResponse`](./src/models/errors/paymentrequiredresponse.ts): Payment Required. Status code `402`.
|
|
1287
|
+
* [`UnauthorizedResponse`](./src/models/errors/unauthorizedresponse.ts): Unauthorized. Status code `401`. *
|
|
1288
|
+
* [`PaymentRequiredResponse`](./src/models/errors/paymentrequiredresponse.ts): Payment Required. Status code `402`. *
|
|
1274
1289
|
* [`NotFoundResponse`](./src/models/errors/notfoundresponse.ts): The specified resource was not found. Status code `404`. *
|
|
1275
1290
|
* [`BadRequestResponse`](./src/models/errors/badrequestresponse.ts): Bad Request. Status code `400`. *
|
|
1276
1291
|
* [`UnprocessableResponse`](./src/models/errors/unprocessableresponse.ts): Unprocessable. Status code `422`. *
|
|
1277
1292
|
|
|
1278
|
-
<details><summary>Less common errors (
|
|
1293
|
+
<details><summary>Less common errors (7)</summary>
|
|
1279
1294
|
|
|
1280
1295
|
<br />
|
|
1281
1296
|
|
|
@@ -1288,6 +1303,7 @@ run();
|
|
|
1288
1303
|
|
|
1289
1304
|
|
|
1290
1305
|
**Inherit from [`ApideckError`](./src/models/errors/apideckerror.ts)**:
|
|
1306
|
+
* [`Unauthorized`](./src/models/errors/unauthorized.ts): Unauthorized. Status code `401`. Applicable to 6 of 311 methods.*
|
|
1291
1307
|
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
1292
1308
|
|
|
1293
1309
|
</details>
|
|
@@ -1382,19 +1398,23 @@ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
|
1382
1398
|
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
1383
1399
|
the HTTP client and feed in fixtures.
|
|
1384
1400
|
|
|
1385
|
-
The following example shows how to
|
|
1386
|
-
|
|
1387
|
-
to
|
|
1401
|
+
The following example shows how to:
|
|
1402
|
+
- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
|
|
1403
|
+
- use the `"beforeRequest"` hook to add a custom header and a timeout to requests
|
|
1404
|
+
- use the `"requestError"` hook to log errors
|
|
1388
1405
|
|
|
1389
1406
|
```typescript
|
|
1390
1407
|
import { Apideck } from "@apideck/unify";
|
|
1408
|
+
import { ProxyAgent } from "undici";
|
|
1391
1409
|
import { HTTPClient } from "@apideck/unify/lib/http";
|
|
1392
1410
|
|
|
1411
|
+
const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
|
|
1412
|
+
|
|
1393
1413
|
const httpClient = new HTTPClient({
|
|
1394
|
-
// fetcher takes a function that has the same signature as native
|
|
1395
|
-
fetcher: (
|
|
1396
|
-
|
|
1397
|
-
|
|
1414
|
+
// 'fetcher' takes a function that has the same signature as native 'fetch'.
|
|
1415
|
+
fetcher: (input, init) =>
|
|
1416
|
+
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
|
|
1417
|
+
fetch(input, { ...init, dispatcher } as RequestInit),
|
|
1398
1418
|
});
|
|
1399
1419
|
|
|
1400
1420
|
httpClient.addHook("beforeRequest", (request) => {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ApideckCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ApideckError } from "../models/errors/apideckerror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import * as errors from "../models/errors/index.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
export declare enum DeleteAcceptEnum {
|
|
12
|
+
applicationJson = "application/json",
|
|
13
|
+
textCsv = "text/csv",
|
|
14
|
+
textPlain = "text/plain",
|
|
15
|
+
applicationOctetStream = "application/octet-stream",
|
|
16
|
+
applicationPdf = "application/pdf",
|
|
17
|
+
applicationXml = "application/xml",
|
|
18
|
+
textHtml = "text/html"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* DELETE
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Proxies a downstream DELETE request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization.
|
|
25
|
+
* **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers.
|
|
26
|
+
*/
|
|
27
|
+
export declare function proxyDelete(client: ApideckCore, request: operations.ProxyDeleteProxyRequest, options?: RequestOptions & {
|
|
28
|
+
acceptHeaderOverride?: DeleteAcceptEnum;
|
|
29
|
+
}): APIPromise<Result<operations.ProxyDeleteProxyResponse, errors.Unauthorized | ApideckError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
30
|
+
//# sourceMappingURL=proxyDelete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyDelete.d.ts","sourceRoot":"","sources":["../src/funcs/proxyDelete.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,oBAAY,gBAAgB;IAC1B,eAAe,qBAAqB;IACpC,OAAO,aAAa;IACpB,SAAS,eAAe;IACxB,sBAAsB,6BAA6B;IACnD,cAAc,oBAAoB;IAClC,cAAc,oBAAoB;IAClC,QAAQ,cAAc;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,cAAc,GAAG;IAAE,oBAAoB,CAAC,EAAE,gBAAgB,CAAA;CAAE,GACrE,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,wBAAwB,EACjC,MAAM,CAAC,YAAY,GACnB,YAAY,GACZ,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.DeleteAcceptEnum = void 0;
|
|
40
|
+
exports.proxyDelete = proxyDelete;
|
|
41
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
42
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
43
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
44
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
45
|
+
const security_js_1 = require("../lib/security.js");
|
|
46
|
+
const url_js_1 = require("../lib/url.js");
|
|
47
|
+
const errors = __importStar(require("../models/errors/index.js"));
|
|
48
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
49
|
+
const async_js_1 = require("../types/async.js");
|
|
50
|
+
var DeleteAcceptEnum;
|
|
51
|
+
(function (DeleteAcceptEnum) {
|
|
52
|
+
DeleteAcceptEnum["applicationJson"] = "application/json";
|
|
53
|
+
DeleteAcceptEnum["textCsv"] = "text/csv";
|
|
54
|
+
DeleteAcceptEnum["textPlain"] = "text/plain";
|
|
55
|
+
DeleteAcceptEnum["applicationOctetStream"] = "application/octet-stream";
|
|
56
|
+
DeleteAcceptEnum["applicationPdf"] = "application/pdf";
|
|
57
|
+
DeleteAcceptEnum["applicationXml"] = "application/xml";
|
|
58
|
+
DeleteAcceptEnum["textHtml"] = "text/html";
|
|
59
|
+
})(DeleteAcceptEnum || (exports.DeleteAcceptEnum = DeleteAcceptEnum = {}));
|
|
60
|
+
/**
|
|
61
|
+
* DELETE
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* Proxies a downstream DELETE request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization.
|
|
65
|
+
* **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers.
|
|
66
|
+
*/
|
|
67
|
+
function proxyDelete(client, request, options) {
|
|
68
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
69
|
+
}
|
|
70
|
+
async function $do(client, request, options) {
|
|
71
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.ProxyDeleteProxyRequest$outboundSchema.parse(value), "Input validation failed");
|
|
72
|
+
if (!parsed.ok) {
|
|
73
|
+
return [parsed, { status: "invalid" }];
|
|
74
|
+
}
|
|
75
|
+
const payload = parsed.value;
|
|
76
|
+
const body = null;
|
|
77
|
+
const path = (0, url_js_1.pathToFunc)("/proxy")();
|
|
78
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
79
|
+
Accept: options?.acceptHeaderOverride
|
|
80
|
+
|| "application/json;q=1, text/csv;q=0.9, text/plain;q=0.7, application/octet-stream;q=0.6, application/pdf;q=0.4, application/xml;q=0.3, text/html;q=0",
|
|
81
|
+
"x-apideck-app-id": (0, encodings_js_1.encodeSimple)("x-apideck-app-id", payload.appId ?? client._options.appId, { explode: false, charEncoding: "none" }),
|
|
82
|
+
"x-apideck-consumer-id": (0, encodings_js_1.encodeSimple)("x-apideck-consumer-id", payload.consumerId ?? client._options.consumerId, { explode: false, charEncoding: "none" }),
|
|
83
|
+
"x-apideck-downstream-authorization": (0, encodings_js_1.encodeSimple)("x-apideck-downstream-authorization", payload.downstreamAuthorization, { explode: false, charEncoding: "none" }),
|
|
84
|
+
"x-apideck-downstream-url": (0, encodings_js_1.encodeSimple)("x-apideck-downstream-url", payload.downstreamUrl, { explode: false, charEncoding: "none" }),
|
|
85
|
+
"x-apideck-service-id": (0, encodings_js_1.encodeSimple)("x-apideck-service-id", payload.serviceId, { explode: false, charEncoding: "none" }),
|
|
86
|
+
"x-apideck-unified-api": (0, encodings_js_1.encodeSimple)("x-apideck-unified-api", payload.unifiedApi, { explode: false, charEncoding: "none" }),
|
|
87
|
+
}));
|
|
88
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
|
|
89
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
90
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
91
|
+
const context = {
|
|
92
|
+
options: client._options,
|
|
93
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
94
|
+
operationID: "proxy.deleteProxy",
|
|
95
|
+
oAuth2Scopes: null,
|
|
96
|
+
resolvedSecurity: requestSecurity,
|
|
97
|
+
securitySource: client._options.apiKey,
|
|
98
|
+
retryConfig: options?.retries
|
|
99
|
+
|| client._options.retryConfig
|
|
100
|
+
|| {
|
|
101
|
+
strategy: "backoff",
|
|
102
|
+
backoff: {
|
|
103
|
+
initialInterval: 500,
|
|
104
|
+
maxInterval: 60000,
|
|
105
|
+
exponent: 1.5,
|
|
106
|
+
maxElapsedTime: 900000,
|
|
107
|
+
},
|
|
108
|
+
retryConnectionErrors: true,
|
|
109
|
+
}
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["408", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
const requestRes = client._createRequest(context, {
|
|
114
|
+
security: requestSecurity,
|
|
115
|
+
method: "DELETE",
|
|
116
|
+
baseURL: options?.serverURL,
|
|
117
|
+
path: path,
|
|
118
|
+
headers: headers,
|
|
119
|
+
body: body,
|
|
120
|
+
userAgent: client._options.userAgent,
|
|
121
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
122
|
+
}, options);
|
|
123
|
+
if (!requestRes.ok) {
|
|
124
|
+
return [requestRes, { status: "invalid" }];
|
|
125
|
+
}
|
|
126
|
+
const req = requestRes.value;
|
|
127
|
+
const doResult = await client._do(req, {
|
|
128
|
+
context,
|
|
129
|
+
errorCodes: ["401", "4XX", "5XX"],
|
|
130
|
+
retryConfig: context.retryConfig,
|
|
131
|
+
retryCodes: context.retryCodes,
|
|
132
|
+
});
|
|
133
|
+
if (!doResult.ok) {
|
|
134
|
+
return [doResult, { status: "request-error", request: req }];
|
|
135
|
+
}
|
|
136
|
+
const response = doResult.value;
|
|
137
|
+
const responseFields = {
|
|
138
|
+
HttpMeta: { Response: response, Request: req },
|
|
139
|
+
};
|
|
140
|
+
const [result] = await M.match(M.json(200, operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
141
|
+
key: "responseJson",
|
|
142
|
+
}), M.stream(200, operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
143
|
+
key: "responseBinary",
|
|
144
|
+
}), M.stream(200, operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
145
|
+
ctype: "application/pdf",
|
|
146
|
+
key: "responsePdf",
|
|
147
|
+
}), M.text(200, operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
148
|
+
ctype: "application/xml",
|
|
149
|
+
key: "responseXml",
|
|
150
|
+
}), M.text(200, operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
151
|
+
ctype: "text/csv",
|
|
152
|
+
key: "responseCsv",
|
|
153
|
+
}), M.text(200, operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
154
|
+
key: "responseText",
|
|
155
|
+
}), M.jsonErr(401, errors.Unauthorized$inboundSchema), M.fail("4XX"), M.fail("5XX"), M.json("default", operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
156
|
+
hdrs: true,
|
|
157
|
+
key: "errorJson",
|
|
158
|
+
}), M.text("default", operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
159
|
+
ctype: "application/xml",
|
|
160
|
+
hdrs: true,
|
|
161
|
+
key: "errorXml",
|
|
162
|
+
}), M.text("default", operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
163
|
+
ctype: "text/html",
|
|
164
|
+
hdrs: true,
|
|
165
|
+
key: "errorHtml",
|
|
166
|
+
}), M.text("default", operations.ProxyDeleteProxyResponse$inboundSchema, {
|
|
167
|
+
hdrs: true,
|
|
168
|
+
key: "errorText",
|
|
169
|
+
}))(response, req, { extraFields: responseFields });
|
|
170
|
+
if (!result.ok) {
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=proxyDelete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyDelete.js","sourceRoot":"","sources":["../src/funcs/proxyDelete.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CH,kCAuBC;AA9DD,sDAAmD;AACnD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAS3C,kEAAoD;AAGpD,0EAA4D;AAC5D,gDAAwD;AAGxD,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,wDAAoC,CAAA;IACpC,wCAAoB,CAAA;IACpB,4CAAwB,CAAA;IACxB,uEAAmD,CAAA;IACnD,sDAAkC,CAAA;IAClC,sDAAkC,CAAA;IAClC,0CAAsB,CAAA;AACxB,CAAC,EARW,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S,EAAE,UAAU,CAAC,sCAAsC,EAAE;QACnE,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,UAAU;KAChB,CAAC,EACF,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,sCAAsC,EAAE;QACnE,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,WAAW;KACjB,CAAC,EACF,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,sCAAsC,EAAE;QACnE,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,WAAW;KACjB,CAAC,CACH,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ApideckCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ApideckError } from "../models/errors/apideckerror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import * as errors from "../models/errors/index.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
export declare enum GetAcceptEnum {
|
|
12
|
+
applicationJson = "application/json",
|
|
13
|
+
textCsv = "text/csv",
|
|
14
|
+
textPlain = "text/plain",
|
|
15
|
+
applicationOctetStream = "application/octet-stream",
|
|
16
|
+
applicationPdf = "application/pdf",
|
|
17
|
+
applicationXml = "application/xml",
|
|
18
|
+
textHtml = "text/html"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* GET
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Proxies a downstream GET request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization.
|
|
25
|
+
* **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers.
|
|
26
|
+
*/
|
|
27
|
+
export declare function proxyGet(client: ApideckCore, request: operations.ProxyGetProxyRequest, options?: RequestOptions & {
|
|
28
|
+
acceptHeaderOverride?: GetAcceptEnum;
|
|
29
|
+
}): APIPromise<Result<operations.ProxyGetProxyResponse, errors.Unauthorized | ApideckError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
30
|
+
//# sourceMappingURL=proxyGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyGet.d.ts","sourceRoot":"","sources":["../src/funcs/proxyGet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,oBAAY,aAAa;IACvB,eAAe,qBAAqB;IACpC,OAAO,aAAa;IACpB,SAAS,eAAe;IACxB,sBAAsB,6BAA6B;IACnD,cAAc,oBAAoB;IAClC,cAAc,oBAAoB;IAClC,QAAQ,cAAc;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,CAAC,oBAAoB,EACxC,OAAO,CAAC,EAAE,cAAc,GAAG;IAAE,oBAAoB,CAAC,EAAE,aAAa,CAAA;CAAE,GAClE,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,qBAAqB,EAC9B,MAAM,CAAC,YAAY,GACnB,YAAY,GACZ,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.GetAcceptEnum = void 0;
|
|
40
|
+
exports.proxyGet = proxyGet;
|
|
41
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
42
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
43
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
44
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
45
|
+
const security_js_1 = require("../lib/security.js");
|
|
46
|
+
const url_js_1 = require("../lib/url.js");
|
|
47
|
+
const errors = __importStar(require("../models/errors/index.js"));
|
|
48
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
49
|
+
const async_js_1 = require("../types/async.js");
|
|
50
|
+
var GetAcceptEnum;
|
|
51
|
+
(function (GetAcceptEnum) {
|
|
52
|
+
GetAcceptEnum["applicationJson"] = "application/json";
|
|
53
|
+
GetAcceptEnum["textCsv"] = "text/csv";
|
|
54
|
+
GetAcceptEnum["textPlain"] = "text/plain";
|
|
55
|
+
GetAcceptEnum["applicationOctetStream"] = "application/octet-stream";
|
|
56
|
+
GetAcceptEnum["applicationPdf"] = "application/pdf";
|
|
57
|
+
GetAcceptEnum["applicationXml"] = "application/xml";
|
|
58
|
+
GetAcceptEnum["textHtml"] = "text/html";
|
|
59
|
+
})(GetAcceptEnum || (exports.GetAcceptEnum = GetAcceptEnum = {}));
|
|
60
|
+
/**
|
|
61
|
+
* GET
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* Proxies a downstream GET request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization.
|
|
65
|
+
* **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers.
|
|
66
|
+
*/
|
|
67
|
+
function proxyGet(client, request, options) {
|
|
68
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
69
|
+
}
|
|
70
|
+
async function $do(client, request, options) {
|
|
71
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.ProxyGetProxyRequest$outboundSchema.parse(value), "Input validation failed");
|
|
72
|
+
if (!parsed.ok) {
|
|
73
|
+
return [parsed, { status: "invalid" }];
|
|
74
|
+
}
|
|
75
|
+
const payload = parsed.value;
|
|
76
|
+
const body = null;
|
|
77
|
+
const path = (0, url_js_1.pathToFunc)("/proxy")();
|
|
78
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
79
|
+
Accept: options?.acceptHeaderOverride
|
|
80
|
+
|| "application/json;q=1, text/csv;q=0.9, text/plain;q=0.7, application/octet-stream;q=0.6, application/pdf;q=0.4, application/xml;q=0.3, text/html;q=0",
|
|
81
|
+
"x-apideck-app-id": (0, encodings_js_1.encodeSimple)("x-apideck-app-id", payload.appId ?? client._options.appId, { explode: false, charEncoding: "none" }),
|
|
82
|
+
"x-apideck-consumer-id": (0, encodings_js_1.encodeSimple)("x-apideck-consumer-id", payload.consumerId ?? client._options.consumerId, { explode: false, charEncoding: "none" }),
|
|
83
|
+
"x-apideck-downstream-authorization": (0, encodings_js_1.encodeSimple)("x-apideck-downstream-authorization", payload.downstreamAuthorization, { explode: false, charEncoding: "none" }),
|
|
84
|
+
"x-apideck-downstream-url": (0, encodings_js_1.encodeSimple)("x-apideck-downstream-url", payload.downstreamUrl, { explode: false, charEncoding: "none" }),
|
|
85
|
+
"x-apideck-service-id": (0, encodings_js_1.encodeSimple)("x-apideck-service-id", payload.serviceId, { explode: false, charEncoding: "none" }),
|
|
86
|
+
"x-apideck-unified-api": (0, encodings_js_1.encodeSimple)("x-apideck-unified-api", payload.unifiedApi, { explode: false, charEncoding: "none" }),
|
|
87
|
+
}));
|
|
88
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
|
|
89
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
90
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
91
|
+
const context = {
|
|
92
|
+
options: client._options,
|
|
93
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
94
|
+
operationID: "proxy.getProxy",
|
|
95
|
+
oAuth2Scopes: null,
|
|
96
|
+
resolvedSecurity: requestSecurity,
|
|
97
|
+
securitySource: client._options.apiKey,
|
|
98
|
+
retryConfig: options?.retries
|
|
99
|
+
|| client._options.retryConfig
|
|
100
|
+
|| {
|
|
101
|
+
strategy: "backoff",
|
|
102
|
+
backoff: {
|
|
103
|
+
initialInterval: 500,
|
|
104
|
+
maxInterval: 60000,
|
|
105
|
+
exponent: 1.5,
|
|
106
|
+
maxElapsedTime: 900000,
|
|
107
|
+
},
|
|
108
|
+
retryConnectionErrors: true,
|
|
109
|
+
}
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["408", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
const requestRes = client._createRequest(context, {
|
|
114
|
+
security: requestSecurity,
|
|
115
|
+
method: "GET",
|
|
116
|
+
baseURL: options?.serverURL,
|
|
117
|
+
path: path,
|
|
118
|
+
headers: headers,
|
|
119
|
+
body: body,
|
|
120
|
+
userAgent: client._options.userAgent,
|
|
121
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
122
|
+
}, options);
|
|
123
|
+
if (!requestRes.ok) {
|
|
124
|
+
return [requestRes, { status: "invalid" }];
|
|
125
|
+
}
|
|
126
|
+
const req = requestRes.value;
|
|
127
|
+
const doResult = await client._do(req, {
|
|
128
|
+
context,
|
|
129
|
+
errorCodes: ["401", "4XX", "5XX"],
|
|
130
|
+
retryConfig: context.retryConfig,
|
|
131
|
+
retryCodes: context.retryCodes,
|
|
132
|
+
});
|
|
133
|
+
if (!doResult.ok) {
|
|
134
|
+
return [doResult, { status: "request-error", request: req }];
|
|
135
|
+
}
|
|
136
|
+
const response = doResult.value;
|
|
137
|
+
const responseFields = {
|
|
138
|
+
HttpMeta: { Response: response, Request: req },
|
|
139
|
+
};
|
|
140
|
+
const [result] = await M.match(M.json(200, operations.ProxyGetProxyResponse$inboundSchema, {
|
|
141
|
+
key: "responseJson",
|
|
142
|
+
}), M.stream(200, operations.ProxyGetProxyResponse$inboundSchema, {
|
|
143
|
+
key: "responseBinary",
|
|
144
|
+
}), M.stream(200, operations.ProxyGetProxyResponse$inboundSchema, {
|
|
145
|
+
ctype: "application/pdf",
|
|
146
|
+
key: "responsePdf",
|
|
147
|
+
}), M.text(200, operations.ProxyGetProxyResponse$inboundSchema, {
|
|
148
|
+
ctype: "application/xml",
|
|
149
|
+
key: "responseXml",
|
|
150
|
+
}), M.text(200, operations.ProxyGetProxyResponse$inboundSchema, {
|
|
151
|
+
ctype: "text/csv",
|
|
152
|
+
key: "responseCsv",
|
|
153
|
+
}), M.text(200, operations.ProxyGetProxyResponse$inboundSchema, {
|
|
154
|
+
key: "responseText",
|
|
155
|
+
}), M.jsonErr(401, errors.Unauthorized$inboundSchema), M.fail("4XX"), M.fail("5XX"), M.json("default", operations.ProxyGetProxyResponse$inboundSchema, {
|
|
156
|
+
hdrs: true,
|
|
157
|
+
key: "errorJson",
|
|
158
|
+
}), M.text("default", operations.ProxyGetProxyResponse$inboundSchema, {
|
|
159
|
+
ctype: "application/xml",
|
|
160
|
+
hdrs: true,
|
|
161
|
+
key: "errorXml",
|
|
162
|
+
}), M.text("default", operations.ProxyGetProxyResponse$inboundSchema, {
|
|
163
|
+
ctype: "text/html",
|
|
164
|
+
hdrs: true,
|
|
165
|
+
key: "errorHtml",
|
|
166
|
+
}), M.text("default", operations.ProxyGetProxyResponse$inboundSchema, {
|
|
167
|
+
hdrs: true,
|
|
168
|
+
key: "errorText",
|
|
169
|
+
}))(response, req, { extraFields: responseFields });
|
|
170
|
+
if (!result.ok) {
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=proxyGet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyGet.js","sourceRoot":"","sources":["../src/funcs/proxyGet.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CH,4BAuBC;AA9DD,sDAAmD;AACnD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAS3C,kEAAoD;AAGpD,0EAA4D;AAC5D,gDAAwD;AAGxD,IAAY,aAQX;AARD,WAAY,aAAa;IACvB,qDAAoC,CAAA;IACpC,qCAAoB,CAAA;IACpB,yCAAwB,CAAA;IACxB,oEAAmD,CAAA;IACnD,mDAAkC,CAAA;IAClC,mDAAkC,CAAA;IAClC,uCAAsB,CAAA;AACxB,CAAC,EARW,aAAa,6BAAb,aAAa,QAQxB;AAED;;;;;;GAMG;AACH,S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B;QACxB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,UAAU;KAChB,CAAC,EACF,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,mCAAmC,EAAE;QAChE,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,WAAW;KACjB,CAAC,EACF,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,mCAAmC,EAAE;QAChE,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,WAAW;KACjB,CAAC,CACH,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ApideckCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ApideckError } from "../models/errors/apideckerror.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
5
|
+
import * as errors from "../models/errors/index.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
export declare enum OptionsAcceptEnum {
|
|
12
|
+
applicationJson = "application/json",
|
|
13
|
+
textCsv = "text/csv",
|
|
14
|
+
textPlain = "text/plain",
|
|
15
|
+
applicationOctetStream = "application/octet-stream",
|
|
16
|
+
applicationPdf = "application/pdf",
|
|
17
|
+
applicationXml = "application/xml",
|
|
18
|
+
textHtml = "text/html"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* OPTIONS
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Proxies a downstream OPTION request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization.
|
|
25
|
+
* **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers.
|
|
26
|
+
*/
|
|
27
|
+
export declare function proxyOptions(client: ApideckCore, request: operations.ProxyOptionsProxyRequest, options?: RequestOptions & {
|
|
28
|
+
acceptHeaderOverride?: OptionsAcceptEnum;
|
|
29
|
+
}): APIPromise<Result<operations.ProxyOptionsProxyResponse, errors.Unauthorized | ApideckError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
30
|
+
//# sourceMappingURL=proxyOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyOptions.d.ts","sourceRoot":"","sources":["../src/funcs/proxyOptions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAw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