@orq-ai/node 4.8.0-rc.7 → 4.8.0-rc.9
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 +78 -39
- package/funcs/guardrailRulesCreate.d.ts +17 -0
- package/funcs/guardrailRulesCreate.d.ts.map +1 -0
- package/funcs/guardrailRulesCreate.js +114 -0
- package/funcs/guardrailRulesCreate.js.map +1 -0
- package/funcs/guardrailRulesDelete.d.ts +17 -0
- package/funcs/guardrailRulesDelete.d.ts.map +1 -0
- package/funcs/guardrailRulesDelete.js +117 -0
- package/funcs/guardrailRulesDelete.js.map +1 -0
- package/funcs/guardrailRulesGet.d.ts +17 -0
- package/funcs/guardrailRulesGet.d.ts.map +1 -0
- package/funcs/guardrailRulesGet.js +116 -0
- package/funcs/guardrailRulesGet.js.map +1 -0
- package/funcs/guardrailRulesList.d.ts +17 -0
- package/funcs/guardrailRulesList.d.ts.map +1 -0
- package/funcs/guardrailRulesList.js +120 -0
- package/funcs/guardrailRulesList.js.map +1 -0
- package/funcs/guardrailRulesUpdate.d.ts +17 -0
- package/funcs/guardrailRulesUpdate.d.ts.map +1 -0
- package/funcs/guardrailRulesUpdate.js +117 -0
- package/funcs/guardrailRulesUpdate.js.map +1 -0
- package/funcs/policiesCreate.d.ts +17 -0
- package/funcs/policiesCreate.d.ts.map +1 -0
- package/funcs/policiesCreate.js +114 -0
- package/funcs/policiesCreate.js.map +1 -0
- package/funcs/policiesDelete.d.ts +17 -0
- package/funcs/policiesDelete.d.ts.map +1 -0
- package/funcs/policiesDelete.js +120 -0
- package/funcs/policiesDelete.js.map +1 -0
- package/funcs/policiesGet.d.ts +17 -0
- package/funcs/policiesGet.d.ts.map +1 -0
- package/funcs/policiesGet.js +119 -0
- package/funcs/policiesGet.js.map +1 -0
- package/funcs/policiesList.d.ts +17 -0
- package/funcs/policiesList.d.ts.map +1 -0
- package/funcs/policiesList.js +120 -0
- package/funcs/policiesList.js.map +1 -0
- package/funcs/policiesUpdate.d.ts +17 -0
- package/funcs/policiesUpdate.d.ts.map +1 -0
- package/funcs/policiesUpdate.js +120 -0
- package/funcs/policiesUpdate.js.map +1 -0
- package/funcs/routingRulesCreate.d.ts +17 -0
- package/funcs/routingRulesCreate.d.ts.map +1 -0
- package/funcs/routingRulesCreate.js +114 -0
- package/funcs/routingRulesCreate.js.map +1 -0
- package/funcs/routingRulesDelete.d.ts +17 -0
- package/funcs/routingRulesDelete.d.ts.map +1 -0
- package/funcs/routingRulesDelete.js +120 -0
- package/funcs/routingRulesDelete.js.map +1 -0
- package/funcs/routingRulesGet.d.ts +17 -0
- package/funcs/routingRulesGet.d.ts.map +1 -0
- package/funcs/routingRulesGet.js +119 -0
- package/funcs/routingRulesGet.js.map +1 -0
- package/funcs/routingRulesList.d.ts +17 -0
- package/funcs/routingRulesList.d.ts.map +1 -0
- package/funcs/routingRulesList.js +120 -0
- package/funcs/routingRulesList.js.map +1 -0
- package/funcs/routingRulesUpdate.d.ts +17 -0
- package/funcs/routingRulesUpdate.d.ts.map +1 -0
- package/funcs/routingRulesUpdate.js +120 -0
- package/funcs/routingRulesUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/agentstartedstreamingevent.d.ts +4 -4
- package/models/components/agentstartedstreamingevent.d.ts.map +1 -1
- package/models/components/agentstartedstreamingevent.js +5 -5
- package/models/components/agentstartedstreamingevent.js.map +1 -1
- package/models/components/budgetlimit.d.ts +41 -0
- package/models/components/budgetlimit.d.ts.map +1 -0
- package/models/components/budgetlimit.js +81 -0
- package/models/components/budgetlimit.js.map +1 -0
- package/models/components/evaluatorref.d.ts +34 -0
- package/models/components/evaluatorref.d.ts.map +1 -0
- package/models/components/evaluatorref.js +86 -0
- package/models/components/evaluatorref.js.map +1 -0
- package/models/components/expression.d.ts +23 -0
- package/models/components/expression.d.ts.map +1 -0
- package/models/components/expression.js +60 -0
- package/models/components/expression.js.map +1 -0
- package/models/components/guardrailref.d.ts +30 -0
- package/models/components/guardrailref.d.ts.map +1 -0
- package/models/components/guardrailref.js +79 -0
- package/models/components/guardrailref.js.map +1 -0
- package/models/components/guardrailruledocument.d.ts +23 -0
- package/models/components/guardrailruledocument.d.ts.map +1 -0
- package/models/components/guardrailruledocument.js +74 -0
- package/models/components/guardrailruledocument.js.map +1 -0
- package/models/components/index.d.ts +13 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +13 -0
- package/models/components/index.js.map +1 -1
- package/models/components/limits.d.ts +24 -0
- package/models/components/limits.d.ts.map +1 -0
- package/models/components/limits.js +66 -0
- package/models/components/limits.js.map +1 -0
- package/models/components/modelref.d.ts +21 -0
- package/models/components/modelref.d.ts.map +1 -0
- package/models/components/modelref.js +71 -0
- package/models/components/modelref.js.map +1 -0
- package/models/components/modelsconfig.d.ts +31 -0
- package/models/components/modelsconfig.d.ts.map +1 -0
- package/models/components/modelsconfig.js +70 -0
- package/models/components/modelsconfig.js.map +1 -0
- package/models/components/policydocument.d.ts +28 -0
- package/models/components/policydocument.d.ts.map +1 -0
- package/models/components/policydocument.js +81 -0
- package/models/components/policydocument.js.map +1 -0
- package/models/components/reasoningpart.js +1 -1
- package/models/components/requestlimit.d.ts +31 -0
- package/models/components/requestlimit.d.ts.map +1 -0
- package/models/components/requestlimit.js +70 -0
- package/models/components/requestlimit.js.map +1 -0
- package/models/components/retryconfig.d.ts +19 -0
- package/models/components/retryconfig.d.ts.map +1 -0
- package/models/components/retryconfig.js +69 -0
- package/models/components/retryconfig.js.map +1 -0
- package/models/components/routingruledocument.d.ts +23 -0
- package/models/components/routingruledocument.d.ts.map +1 -0
- package/models/components/routingruledocument.js +75 -0
- package/models/components/routingruledocument.js.map +1 -0
- package/models/components/tokenlimit.d.ts +31 -0
- package/models/components/tokenlimit.d.ts.map +1 -0
- package/models/components/tokenlimit.js +70 -0
- package/models/components/tokenlimit.js.map +1 -0
- package/models/operations/createcontact.js +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.d.ts +42 -42
- package/models/operations/createeval.d.ts.map +1 -1
- package/models/operations/createeval.js +64 -63
- package/models/operations/createeval.js.map +1 -1
- package/models/operations/createidentity.js +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/getv2humanevals.js +6 -6
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/getv2humanevalsid.js +6 -6
- package/models/operations/guardrailrulecreate.d.ts +50 -0
- package/models/operations/guardrailrulecreate.d.ts.map +1 -0
- package/models/operations/guardrailrulecreate.js +94 -0
- package/models/operations/guardrailrulecreate.js.map +1 -0
- package/models/operations/guardrailruledelete.d.ts +15 -0
- package/models/operations/guardrailruledelete.d.ts.map +1 -0
- package/models/operations/guardrailruledelete.js +54 -0
- package/models/operations/guardrailruledelete.js.map +1 -0
- package/models/operations/guardrailruleget.d.ts +38 -0
- package/models/operations/guardrailruleget.d.ts.map +1 -0
- package/models/operations/guardrailruleget.js +86 -0
- package/models/operations/guardrailruleget.js.map +1 -0
- package/models/operations/guardrailrulelist.d.ts +41 -0
- package/models/operations/guardrailrulelist.d.ts.map +1 -0
- package/models/operations/guardrailrulelist.js +75 -0
- package/models/operations/guardrailrulelist.js.map +1 -0
- package/models/operations/guardrailruleupdate.d.ts +60 -0
- package/models/operations/guardrailruleupdate.d.ts.map +1 -0
- package/models/operations/guardrailruleupdate.js +105 -0
- package/models/operations/guardrailruleupdate.js.map +1 -0
- package/models/operations/index.d.ts +15 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +15 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listidentities.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/patchv2humanevalsid.js +12 -12
- package/models/operations/policycreate.d.ts +57 -0
- package/models/operations/policycreate.d.ts.map +1 -0
- package/models/operations/policycreate.js +103 -0
- package/models/operations/policycreate.js.map +1 -0
- package/models/operations/policydelete.d.ts +15 -0
- package/models/operations/policydelete.d.ts.map +1 -0
- package/models/operations/policydelete.js +54 -0
- package/models/operations/policydelete.js.map +1 -0
- package/models/operations/policyget.d.ts +41 -0
- package/models/operations/policyget.d.ts.map +1 -0
- package/models/operations/policyget.js +91 -0
- package/models/operations/policyget.js.map +1 -0
- package/models/operations/policylist.d.ts +41 -0
- package/models/operations/policylist.d.ts.map +1 -0
- package/models/operations/policylist.js +75 -0
- package/models/operations/policylist.js.map +1 -0
- package/models/operations/policyupdate.d.ts +67 -0
- package/models/operations/policyupdate.d.ts.map +1 -0
- package/models/operations/policyupdate.js +114 -0
- package/models/operations/policyupdate.js.map +1 -0
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevals.js +12 -12
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrieveidentity.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/routingrulecreate.d.ts +50 -0
- package/models/operations/routingrulecreate.d.ts.map +1 -0
- package/models/operations/routingrulecreate.js +94 -0
- package/models/operations/routingrulecreate.js.map +1 -0
- package/models/operations/routingruledelete.d.ts +15 -0
- package/models/operations/routingruledelete.d.ts.map +1 -0
- package/models/operations/routingruledelete.js +54 -0
- package/models/operations/routingruledelete.js.map +1 -0
- package/models/operations/routingruleget.d.ts +38 -0
- package/models/operations/routingruleget.d.ts.map +1 -0
- package/models/operations/routingruleget.js +86 -0
- package/models/operations/routingruleget.js.map +1 -0
- package/models/operations/routingrulelist.d.ts +41 -0
- package/models/operations/routingrulelist.d.ts.map +1 -0
- package/models/operations/routingrulelist.js +75 -0
- package/models/operations/routingrulelist.js.map +1 -0
- package/models/operations/routingruleupdate.d.ts +60 -0
- package/models/operations/routingruleupdate.d.ts.map +1 -0
- package/models/operations/routingruleupdate.js +106 -0
- package/models/operations/routingruleupdate.js.map +1 -0
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.d.ts +69 -0
- package/models/operations/updateeval.d.ts.map +1 -1
- package/models/operations/updateeval.js +92 -19
- package/models/operations/updateeval.js.map +1 -1
- package/models/operations/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +1 -1
- package/sdk/guardrailrules.d.ts +40 -0
- package/sdk/guardrailrules.d.ts.map +1 -0
- package/sdk/guardrailrules.js +62 -0
- package/sdk/guardrailrules.js.map +1 -0
- package/sdk/policies.d.ts +40 -0
- package/sdk/policies.d.ts.map +1 -0
- package/sdk/policies.js +62 -0
- package/sdk/policies.js.map +1 -0
- package/sdk/routingrules.d.ts +40 -0
- package/sdk/routingrules.d.ts.map +1 -0
- package/sdk/routingrules.js +62 -0
- package/sdk/routingrules.js.map +1 -0
- package/sdk/sdk.d.ts +9 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +12 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/guardrailRulesCreate.ts +161 -0
- package/src/funcs/guardrailRulesDelete.ts +170 -0
- package/src/funcs/guardrailRulesGet.ts +168 -0
- package/src/funcs/guardrailRulesList.ts +170 -0
- package/src/funcs/guardrailRulesUpdate.ts +170 -0
- package/src/funcs/policiesCreate.ts +160 -0
- package/src/funcs/policiesDelete.ts +166 -0
- package/src/funcs/policiesGet.ts +165 -0
- package/src/funcs/policiesList.ts +168 -0
- package/src/funcs/policiesUpdate.ts +166 -0
- package/src/funcs/routingRulesCreate.ts +161 -0
- package/src/funcs/routingRulesDelete.ts +166 -0
- package/src/funcs/routingRulesGet.ts +165 -0
- package/src/funcs/routingRulesList.ts +168 -0
- package/src/funcs/routingRulesUpdate.ts +166 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentstartedstreamingevent.ts +9 -6
- package/src/models/components/budgetlimit.ts +83 -0
- package/src/models/components/evaluatorref.ts +89 -0
- package/src/models/components/expression.ts +51 -0
- package/src/models/components/guardrailref.ts +75 -0
- package/src/models/components/guardrailruledocument.ts +66 -0
- package/src/models/components/index.ts +13 -0
- package/src/models/components/limits.ts +70 -0
- package/src/models/components/modelref.ts +64 -0
- package/src/models/components/modelsconfig.ts +73 -0
- package/src/models/components/policydocument.ts +76 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/components/requestlimit.ts +69 -0
- package/src/models/components/retryconfig.ts +60 -0
- package/src/models/components/routingruledocument.ts +67 -0
- package/src/models/components/tokenlimit.ts +69 -0
- package/src/models/operations/createcontact.ts +1 -1
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +213 -160
- package/src/models/operations/createidentity.ts +1 -1
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- package/src/models/operations/getv2humanevals.ts +6 -6
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/getv2humanevalsid.ts +6 -6
- package/src/models/operations/guardrailrulecreate.ts +124 -0
- package/src/models/operations/guardrailruledelete.ts +39 -0
- package/src/models/operations/guardrailruleget.ts +102 -0
- package/src/models/operations/guardrailrulelist.ts +94 -0
- package/src/models/operations/guardrailruleupdate.ts +153 -0
- package/src/models/operations/index.ts +15 -0
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/listidentities.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/patchv2humanevalsid.ts +12 -12
- package/src/models/operations/policycreate.ts +138 -0
- package/src/models/operations/policydelete.ts +39 -0
- package/src/models/operations/policyget.ts +110 -0
- package/src/models/operations/policylist.ts +94 -0
- package/src/models/operations/policyupdate.ts +167 -0
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevals.ts +12 -12
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrieveidentity.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/routingrulecreate.ts +124 -0
- package/src/models/operations/routingruledelete.ts +39 -0
- package/src/models/operations/routingruleget.ts +102 -0
- package/src/models/operations/routingrulelist.ts +94 -0
- package/src/models/operations/routingruleupdate.ts +154 -0
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +178 -16
- package/src/models/operations/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/guardrailrules.ts +99 -0
- package/src/sdk/policies.ts +99 -0
- package/src/sdk/routingrules.ts +99 -0
- package/src/sdk/sdk.ts +18 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { OrqCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Delete routing rule
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Deletes an existing routing rule by ID.
|
|
33
|
+
*/
|
|
34
|
+
export function routingRulesDelete(
|
|
35
|
+
client: OrqCore,
|
|
36
|
+
request: operations.RoutingRuleDeleteRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
void,
|
|
41
|
+
| OrqError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: OrqCore,
|
|
60
|
+
request: operations.RoutingRuleDeleteRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
void,
|
|
66
|
+
| OrqError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) => operations.RoutingRuleDeleteRequest$outboundSchema.parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = null;
|
|
88
|
+
|
|
89
|
+
const pathParams = {
|
|
90
|
+
routing_rule_id: encodeSimple("routing_rule_id", payload.routing_rule_id, {
|
|
91
|
+
explode: false,
|
|
92
|
+
charEncoding: "percent",
|
|
93
|
+
}),
|
|
94
|
+
};
|
|
95
|
+
const path = pathToFunc("/v2/routing-rules/{routing_rule_id}")(pathParams);
|
|
96
|
+
|
|
97
|
+
const headers = new Headers(compactMap({
|
|
98
|
+
Accept: "*/*",
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
102
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
103
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
|
+
|
|
105
|
+
const context = {
|
|
106
|
+
options: client._options,
|
|
107
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
108
|
+
operationID: "RoutingRuleDelete",
|
|
109
|
+
oAuth2Scopes: null,
|
|
110
|
+
|
|
111
|
+
resolvedSecurity: requestSecurity,
|
|
112
|
+
|
|
113
|
+
securitySource: client._options.apiKey,
|
|
114
|
+
retryConfig: options?.retries
|
|
115
|
+
|| client._options.retryConfig
|
|
116
|
+
|| { strategy: "none" },
|
|
117
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const requestRes = client._createRequest(context, {
|
|
121
|
+
security: requestSecurity,
|
|
122
|
+
method: "DELETE",
|
|
123
|
+
baseURL: options?.serverURL,
|
|
124
|
+
path: path,
|
|
125
|
+
headers: headers,
|
|
126
|
+
body: body,
|
|
127
|
+
userAgent: client._options.userAgent,
|
|
128
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
129
|
+
}, options);
|
|
130
|
+
if (!requestRes.ok) {
|
|
131
|
+
return [requestRes, { status: "invalid" }];
|
|
132
|
+
}
|
|
133
|
+
const req = requestRes.value;
|
|
134
|
+
|
|
135
|
+
const doResult = await client._do(req, {
|
|
136
|
+
context,
|
|
137
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
138
|
+
retryConfig: context.retryConfig,
|
|
139
|
+
retryCodes: context.retryCodes,
|
|
140
|
+
});
|
|
141
|
+
if (!doResult.ok) {
|
|
142
|
+
return [doResult, { status: "request-error", request: req }];
|
|
143
|
+
}
|
|
144
|
+
const response = doResult.value;
|
|
145
|
+
|
|
146
|
+
const [result] = await M.match<
|
|
147
|
+
void,
|
|
148
|
+
| OrqError
|
|
149
|
+
| ResponseValidationError
|
|
150
|
+
| ConnectionError
|
|
151
|
+
| RequestAbortedError
|
|
152
|
+
| RequestTimeoutError
|
|
153
|
+
| InvalidRequestError
|
|
154
|
+
| UnexpectedClientError
|
|
155
|
+
| SDKValidationError
|
|
156
|
+
>(
|
|
157
|
+
M.nil(204, z.void()),
|
|
158
|
+
M.fail([404, "4XX"]),
|
|
159
|
+
M.fail("5XX"),
|
|
160
|
+
)(response, req);
|
|
161
|
+
if (!result.ok) {
|
|
162
|
+
return [result, { status: "complete", request: req, response }];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return [result, { status: "complete", request: req, response }];
|
|
166
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get routing rule
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Retrieves the details of an existing routing rule by ID.
|
|
32
|
+
*/
|
|
33
|
+
export function routingRulesGet(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request: operations.RoutingRuleGetRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.RoutingRuleGetResponseBody,
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request: operations.RoutingRuleGetRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.RoutingRuleGetResponseBody,
|
|
65
|
+
| OrqError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.RoutingRuleGetRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = null;
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
routing_rule_id: encodeSimple("routing_rule_id", payload.routing_rule_id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
const path = pathToFunc("/v2/routing-rules/{routing_rule_id}")(pathParams);
|
|
95
|
+
|
|
96
|
+
const headers = new Headers(compactMap({
|
|
97
|
+
Accept: "application/json",
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
101
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
102
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
103
|
+
|
|
104
|
+
const context = {
|
|
105
|
+
options: client._options,
|
|
106
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
107
|
+
operationID: "RoutingRuleGet",
|
|
108
|
+
oAuth2Scopes: null,
|
|
109
|
+
|
|
110
|
+
resolvedSecurity: requestSecurity,
|
|
111
|
+
|
|
112
|
+
securitySource: client._options.apiKey,
|
|
113
|
+
retryConfig: options?.retries
|
|
114
|
+
|| client._options.retryConfig
|
|
115
|
+
|| { strategy: "none" },
|
|
116
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const requestRes = client._createRequest(context, {
|
|
120
|
+
security: requestSecurity,
|
|
121
|
+
method: "GET",
|
|
122
|
+
baseURL: options?.serverURL,
|
|
123
|
+
path: path,
|
|
124
|
+
headers: headers,
|
|
125
|
+
body: body,
|
|
126
|
+
userAgent: client._options.userAgent,
|
|
127
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
128
|
+
}, options);
|
|
129
|
+
if (!requestRes.ok) {
|
|
130
|
+
return [requestRes, { status: "invalid" }];
|
|
131
|
+
}
|
|
132
|
+
const req = requestRes.value;
|
|
133
|
+
|
|
134
|
+
const doResult = await client._do(req, {
|
|
135
|
+
context,
|
|
136
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
137
|
+
retryConfig: context.retryConfig,
|
|
138
|
+
retryCodes: context.retryCodes,
|
|
139
|
+
});
|
|
140
|
+
if (!doResult.ok) {
|
|
141
|
+
return [doResult, { status: "request-error", request: req }];
|
|
142
|
+
}
|
|
143
|
+
const response = doResult.value;
|
|
144
|
+
|
|
145
|
+
const [result] = await M.match<
|
|
146
|
+
operations.RoutingRuleGetResponseBody,
|
|
147
|
+
| OrqError
|
|
148
|
+
| ResponseValidationError
|
|
149
|
+
| ConnectionError
|
|
150
|
+
| RequestAbortedError
|
|
151
|
+
| RequestTimeoutError
|
|
152
|
+
| InvalidRequestError
|
|
153
|
+
| UnexpectedClientError
|
|
154
|
+
| SDKValidationError
|
|
155
|
+
>(
|
|
156
|
+
M.json(200, operations.RoutingRuleGetResponseBody$inboundSchema),
|
|
157
|
+
M.fail([404, "4XX"]),
|
|
158
|
+
M.fail("5XX"),
|
|
159
|
+
)(response, req);
|
|
160
|
+
if (!result.ok) {
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* List routing rules
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Returns a paginated list of routing rules for the current project, ordered by priority ascending.
|
|
32
|
+
*/
|
|
33
|
+
export function routingRulesList(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request?: operations.RoutingRuleListRequest | undefined,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.RoutingRuleListResponseBody,
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request?: operations.RoutingRuleListRequest | undefined,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.RoutingRuleListResponseBody,
|
|
65
|
+
| OrqError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) =>
|
|
80
|
+
operations.RoutingRuleListRequest$outboundSchema.optional().parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = null;
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v2/routing-rules")();
|
|
90
|
+
|
|
91
|
+
const query = encodeFormQuery({
|
|
92
|
+
"ending_before": payload?.ending_before,
|
|
93
|
+
"limit": payload?.limit,
|
|
94
|
+
"project_id": payload?.project_id,
|
|
95
|
+
"starting_after": payload?.starting_after,
|
|
96
|
+
}, { explode: false });
|
|
97
|
+
|
|
98
|
+
const headers = new Headers(compactMap({
|
|
99
|
+
Accept: "application/json",
|
|
100
|
+
}));
|
|
101
|
+
|
|
102
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
103
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
104
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
105
|
+
|
|
106
|
+
const context = {
|
|
107
|
+
options: client._options,
|
|
108
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
109
|
+
operationID: "RoutingRuleList",
|
|
110
|
+
oAuth2Scopes: null,
|
|
111
|
+
|
|
112
|
+
resolvedSecurity: requestSecurity,
|
|
113
|
+
|
|
114
|
+
securitySource: client._options.apiKey,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client._options.retryConfig
|
|
117
|
+
|| { strategy: "none" },
|
|
118
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const requestRes = client._createRequest(context, {
|
|
122
|
+
security: requestSecurity,
|
|
123
|
+
method: "GET",
|
|
124
|
+
baseURL: options?.serverURL,
|
|
125
|
+
path: path,
|
|
126
|
+
headers: headers,
|
|
127
|
+
query: query,
|
|
128
|
+
body: body,
|
|
129
|
+
userAgent: client._options.userAgent,
|
|
130
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
131
|
+
}, options);
|
|
132
|
+
if (!requestRes.ok) {
|
|
133
|
+
return [requestRes, { status: "invalid" }];
|
|
134
|
+
}
|
|
135
|
+
const req = requestRes.value;
|
|
136
|
+
|
|
137
|
+
const doResult = await client._do(req, {
|
|
138
|
+
context,
|
|
139
|
+
errorCodes: ["4XX", "5XX"],
|
|
140
|
+
retryConfig: context.retryConfig,
|
|
141
|
+
retryCodes: context.retryCodes,
|
|
142
|
+
});
|
|
143
|
+
if (!doResult.ok) {
|
|
144
|
+
return [doResult, { status: "request-error", request: req }];
|
|
145
|
+
}
|
|
146
|
+
const response = doResult.value;
|
|
147
|
+
|
|
148
|
+
const [result] = await M.match<
|
|
149
|
+
operations.RoutingRuleListResponseBody,
|
|
150
|
+
| OrqError
|
|
151
|
+
| ResponseValidationError
|
|
152
|
+
| ConnectionError
|
|
153
|
+
| RequestAbortedError
|
|
154
|
+
| RequestTimeoutError
|
|
155
|
+
| InvalidRequestError
|
|
156
|
+
| UnexpectedClientError
|
|
157
|
+
| SDKValidationError
|
|
158
|
+
>(
|
|
159
|
+
M.json(200, operations.RoutingRuleListResponseBody$inboundSchema),
|
|
160
|
+
M.fail("4XX"),
|
|
161
|
+
M.fail("5XX"),
|
|
162
|
+
)(response, req);
|
|
163
|
+
if (!result.ok) {
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Update routing rule
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Partially updates an existing routing rule. Only provided fields are updated.
|
|
32
|
+
*/
|
|
33
|
+
export function routingRulesUpdate(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request: operations.RoutingRuleUpdateRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.RoutingRuleUpdateResponseBody,
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request: operations.RoutingRuleUpdateRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.RoutingRuleUpdateResponseBody,
|
|
65
|
+
| OrqError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.RoutingRuleUpdateRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
routing_rule_id: encodeSimple("routing_rule_id", payload.routing_rule_id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
const path = pathToFunc("/v2/routing-rules/{routing_rule_id}")(pathParams);
|
|
95
|
+
|
|
96
|
+
const headers = new Headers(compactMap({
|
|
97
|
+
"Content-Type": "application/json",
|
|
98
|
+
Accept: "application/json",
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
102
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
103
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
|
+
|
|
105
|
+
const context = {
|
|
106
|
+
options: client._options,
|
|
107
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
108
|
+
operationID: "RoutingRuleUpdate",
|
|
109
|
+
oAuth2Scopes: null,
|
|
110
|
+
|
|
111
|
+
resolvedSecurity: requestSecurity,
|
|
112
|
+
|
|
113
|
+
securitySource: client._options.apiKey,
|
|
114
|
+
retryConfig: options?.retries
|
|
115
|
+
|| client._options.retryConfig
|
|
116
|
+
|| { strategy: "none" },
|
|
117
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const requestRes = client._createRequest(context, {
|
|
121
|
+
security: requestSecurity,
|
|
122
|
+
method: "PATCH",
|
|
123
|
+
baseURL: options?.serverURL,
|
|
124
|
+
path: path,
|
|
125
|
+
headers: headers,
|
|
126
|
+
body: body,
|
|
127
|
+
userAgent: client._options.userAgent,
|
|
128
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
129
|
+
}, options);
|
|
130
|
+
if (!requestRes.ok) {
|
|
131
|
+
return [requestRes, { status: "invalid" }];
|
|
132
|
+
}
|
|
133
|
+
const req = requestRes.value;
|
|
134
|
+
|
|
135
|
+
const doResult = await client._do(req, {
|
|
136
|
+
context,
|
|
137
|
+
errorCodes: ["400", "404", "4XX", "5XX"],
|
|
138
|
+
retryConfig: context.retryConfig,
|
|
139
|
+
retryCodes: context.retryCodes,
|
|
140
|
+
});
|
|
141
|
+
if (!doResult.ok) {
|
|
142
|
+
return [doResult, { status: "request-error", request: req }];
|
|
143
|
+
}
|
|
144
|
+
const response = doResult.value;
|
|
145
|
+
|
|
146
|
+
const [result] = await M.match<
|
|
147
|
+
operations.RoutingRuleUpdateResponseBody,
|
|
148
|
+
| OrqError
|
|
149
|
+
| ResponseValidationError
|
|
150
|
+
| ConnectionError
|
|
151
|
+
| RequestAbortedError
|
|
152
|
+
| RequestTimeoutError
|
|
153
|
+
| InvalidRequestError
|
|
154
|
+
| UnexpectedClientError
|
|
155
|
+
| SDKValidationError
|
|
156
|
+
>(
|
|
157
|
+
M.json(200, operations.RoutingRuleUpdateResponseBody$inboundSchema),
|
|
158
|
+
M.fail([400, 404, "4XX"]),
|
|
159
|
+
M.fail("5XX"),
|
|
160
|
+
)(response, req);
|
|
161
|
+
if (!result.ok) {
|
|
162
|
+
return [result, { status: "complete", request: req, response }];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return [result, { status: "complete", request: req, response }];
|
|
166
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
68
68
|
export const SDK_METADATA = {
|
|
69
69
|
language: "typescript",
|
|
70
70
|
openapiDocVersion: "2.0",
|
|
71
|
-
sdkVersion: "4.8.0-rc.
|
|
71
|
+
sdkVersion: "4.8.0-rc.9",
|
|
72
72
|
genVersion: "2.879.11",
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 4.8.0-rc.
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 4.8.0-rc.9 2.879.11 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|