@orq-ai/node 4.17.13 → 4.17.15

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 (131) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/lib/config.js.map +1 -1
  5. package/models/components/reasoningpart.js +1 -1
  6. package/models/operations/createtool.js +4 -4
  7. package/models/operations/getalltools.js +4 -4
  8. package/models/operations/getv2humanevalsets.js +2 -2
  9. package/models/operations/getv2humanevalsetsid.js +2 -2
  10. package/models/operations/listdeploymentversions.js +1 -1
  11. package/models/operations/patchv2humanevalsetsid.js +2 -2
  12. package/models/operations/postv2humanevalsets.js +2 -2
  13. package/models/operations/retrievetool.js +4 -4
  14. package/models/operations/runagent.js +1 -1
  15. package/models/operations/streamrunagent.js +1 -1
  16. package/models/operations/updatetool.js +4 -4
  17. package/package.json +5 -5
  18. package/packages/orq-rc/src/lib/config.ts +3 -3
  19. package/packages/orq-rc/src/models/components/budgetscope.ts +2 -2
  20. package/packages/orq-rc/src/models/components/budgetscoperestresponse.ts +2 -2
  21. package/packages/orq-rc/src/models/components/budgetusage.ts +1 -4
  22. package/packages/orq-rc/src/models/components/classifypromptcacheoptions.ts +76 -0
  23. package/packages/orq-rc/src/models/components/createmcpgatewayrequest.ts +11 -0
  24. package/packages/orq-rc/src/models/components/index.ts +2 -27
  25. package/packages/orq-rc/src/models/components/mcpauthconfig.ts +67 -10
  26. package/packages/orq-rc/src/models/components/mcpauthconfigoutput.ts +57 -8
  27. package/packages/orq-rc/src/models/components/mcpgateway.ts +15 -0
  28. package/packages/orq-rc/src/models/components/mcpoauthconfig.ts +19 -1
  29. package/packages/orq-rc/src/models/components/mcpoauthconfigoutput.ts +17 -1
  30. package/packages/orq-rc/src/models/components/modelmetadata.ts +6 -0
  31. package/packages/orq-rc/src/models/components/openaipromptcacheoptions.ts +13 -8
  32. package/packages/orq-rc/src/models/components/providerbudgetscope.ts +2 -2
  33. package/packages/orq-rc/src/models/components/querylogsresponse.ts +1 -1
  34. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  35. package/packages/orq-rc/src/models/components/spansummary.ts +29 -5
  36. package/packages/orq-rc/src/models/components/thinkingconfigadaptiveschema.ts +32 -0
  37. package/packages/orq-rc/src/models/components/thinkingconfigbetweentoolsschema.ts +104 -0
  38. package/packages/orq-rc/src/models/components/thinkingconfigenabledschema.ts +27 -0
  39. package/packages/orq-rc/src/models/components/thinkingparam.ts +7 -6
  40. package/packages/orq-rc/src/models/components/updatemcpgatewayrequest.ts +11 -0
  41. package/packages/orq-rc/src/models/components/updateworkspacerequest.ts +4 -0
  42. package/packages/orq-rc/src/models/operations/createagentrequest.ts +26 -6
  43. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +8 -2
  44. package/packages/orq-rc/src/models/operations/createclassify.ts +25 -11
  45. package/packages/orq-rc/src/models/operations/createcompletion.ts +8 -2
  46. package/packages/orq-rc/src/models/operations/createdecisions.ts +25 -11
  47. package/packages/orq-rc/src/models/operations/createprompt.ts +13 -3
  48. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  49. package/packages/orq-rc/src/models/operations/getallprompts.ts +5 -1
  50. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  51. package/packages/orq-rc/src/models/operations/getoneprompt.ts +5 -1
  52. package/packages/orq-rc/src/models/operations/getpromptversion.ts +5 -1
  53. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  54. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  55. package/packages/orq-rc/src/models/operations/index.ts +0 -10
  56. package/packages/orq-rc/src/models/operations/listagents.ts +10 -2
  57. package/packages/orq-rc/src/models/operations/listdeploymentversions.ts +1 -1
  58. package/packages/orq-rc/src/models/operations/listpromptversions.ts +5 -1
  59. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  60. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  61. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +10 -2
  62. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  63. package/packages/orq-rc/src/models/operations/runagent.ts +17 -5
  64. package/packages/orq-rc/src/models/operations/streamrunagent.ts +17 -5
  65. package/packages/orq-rc/src/models/operations/updateagent.ts +26 -6
  66. package/packages/orq-rc/src/models/operations/updateprompt.ts +13 -3
  67. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  68. package/packages/orq-rc/src/sdk/sdk.ts +0 -6
  69. package/src/lib/config.ts +3 -3
  70. package/src/models/components/reasoningpart.ts +1 -1
  71. package/src/models/operations/createtool.ts +4 -4
  72. package/src/models/operations/getalltools.ts +4 -4
  73. package/src/models/operations/getv2humanevalsets.ts +2 -2
  74. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  75. package/src/models/operations/listdeploymentversions.ts +1 -1
  76. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  77. package/src/models/operations/postv2humanevalsets.ts +2 -2
  78. package/src/models/operations/retrievetool.ts +4 -4
  79. package/src/models/operations/runagent.ts +1 -1
  80. package/src/models/operations/streamrunagent.ts +1 -1
  81. package/src/models/operations/updatetool.ts +4 -4
  82. package/packages/orq-rc/src/funcs/wikisCreate.ts +0 -165
  83. package/packages/orq-rc/src/funcs/wikisDelete.ts +0 -171
  84. package/packages/orq-rc/src/funcs/wikisGet.ts +0 -171
  85. package/packages/orq-rc/src/funcs/wikisGetPage.ts +0 -177
  86. package/packages/orq-rc/src/funcs/wikisGetTree.ts +0 -171
  87. package/packages/orq-rc/src/funcs/wikisInspectRepository.ts +0 -166
  88. package/packages/orq-rc/src/funcs/wikisList.ts +0 -176
  89. package/packages/orq-rc/src/funcs/wikisListRuns.ts +0 -176
  90. package/packages/orq-rc/src/funcs/wikisRefresh.ts +0 -174
  91. package/packages/orq-rc/src/funcs/wikisSearch.ts +0 -177
  92. package/packages/orq-rc/src/funcs/wikisUpdate.ts +0 -172
  93. package/packages/orq-rc/src/funcs/wikisUpdatePage.ts +0 -174
  94. package/packages/orq-rc/src/models/components/createwikirequest.ts +0 -67
  95. package/packages/orq-rc/src/models/components/createwikiresponse.ts +0 -32
  96. package/packages/orq-rc/src/models/components/deletewikiresponse.ts +0 -27
  97. package/packages/orq-rc/src/models/components/getwikipageresponse.ts +0 -32
  98. package/packages/orq-rc/src/models/components/getwikiresponse.ts +0 -32
  99. package/packages/orq-rc/src/models/components/getwikitreeresponse.ts +0 -32
  100. package/packages/orq-rc/src/models/components/inspectrepositorywikirequest.ts +0 -45
  101. package/packages/orq-rc/src/models/components/inspectrepositorywikiresponse.ts +0 -38
  102. package/packages/orq-rc/src/models/components/listwikirunsresponse.ts +0 -32
  103. package/packages/orq-rc/src/models/components/listwikisresponse.ts +0 -39
  104. package/packages/orq-rc/src/models/components/mcpenterpriseauthconfig.ts +0 -72
  105. package/packages/orq-rc/src/models/components/mcpenterpriseauthconfigoutput.ts +0 -62
  106. package/packages/orq-rc/src/models/components/refreshwikirequest.ts +0 -31
  107. package/packages/orq-rc/src/models/components/refreshwikiresponse.ts +0 -32
  108. package/packages/orq-rc/src/models/components/searchwikiresponse.ts +0 -32
  109. package/packages/orq-rc/src/models/components/updatewikipagerequest.ts +0 -42
  110. package/packages/orq-rc/src/models/components/updatewikipageresponse.ts +0 -32
  111. package/packages/orq-rc/src/models/components/updatewikirequest.ts +0 -48
  112. package/packages/orq-rc/src/models/components/updatewikiresponse.ts +0 -32
  113. package/packages/orq-rc/src/models/components/wiki.ts +0 -91
  114. package/packages/orq-rc/src/models/components/wikipage.ts +0 -58
  115. package/packages/orq-rc/src/models/components/wikirepository.ts +0 -72
  116. package/packages/orq-rc/src/models/components/wikirun.ts +0 -71
  117. package/packages/orq-rc/src/models/components/wikirunstats.ts +0 -44
  118. package/packages/orq-rc/src/models/components/wikisearchhit.ts +0 -45
  119. package/packages/orq-rc/src/models/components/wikisettings.ts +0 -76
  120. package/packages/orq-rc/src/models/components/wikitreepage.ts +0 -47
  121. package/packages/orq-rc/src/models/operations/deletewiki.ts +0 -36
  122. package/packages/orq-rc/src/models/operations/getwiki.ts +0 -32
  123. package/packages/orq-rc/src/models/operations/getwikipage.ts +0 -43
  124. package/packages/orq-rc/src/models/operations/getwikitree.ts +0 -36
  125. package/packages/orq-rc/src/models/operations/listwikiruns.ts +0 -39
  126. package/packages/orq-rc/src/models/operations/listwikis.ts +0 -54
  127. package/packages/orq-rc/src/models/operations/refreshwiki.ts +0 -41
  128. package/packages/orq-rc/src/models/operations/searchwiki.ts +0 -42
  129. package/packages/orq-rc/src/models/operations/updatewiki.ts +0 -41
  130. package/packages/orq-rc/src/models/operations/updatewikipage.ts +0 -41
  131. package/packages/orq-rc/src/sdk/wikis.ts +0 -154
@@ -1,171 +0,0 @@
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 { matchStatusCode } from "../lib/http.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 * as components from "../models/components/index.js";
15
- import {
16
- ConnectionError,
17
- InvalidRequestError,
18
- RequestAbortedError,
19
- RequestTimeoutError,
20
- UnexpectedClientError,
21
- } from "../models/errors/httpclienterrors.js";
22
- import * as errors from "../models/errors/index.js";
23
- import { OrqError } from "../models/errors/orqerror.js";
24
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
- import * as operations from "../models/operations/index.js";
27
- import { APICall, APIPromise } from "../types/async.js";
28
- import { Result } from "../types/fp.js";
29
-
30
- export function wikisGet(
31
- client: OrqCore,
32
- request: operations.GetWikiRequest,
33
- options?: RequestOptions,
34
- ): APIPromise<
35
- Result<
36
- components.GetWikiResponse,
37
- | errors.ErrorResponse
38
- | OrqError
39
- | ResponseValidationError
40
- | ConnectionError
41
- | RequestAbortedError
42
- | RequestTimeoutError
43
- | InvalidRequestError
44
- | UnexpectedClientError
45
- | SDKValidationError
46
- >
47
- > {
48
- return new APIPromise($do(
49
- client,
50
- request,
51
- options,
52
- ));
53
- }
54
-
55
- async function $do(
56
- client: OrqCore,
57
- request: operations.GetWikiRequest,
58
- options?: RequestOptions,
59
- ): Promise<
60
- [
61
- Result<
62
- components.GetWikiResponse,
63
- | errors.ErrorResponse
64
- | OrqError
65
- | ResponseValidationError
66
- | ConnectionError
67
- | RequestAbortedError
68
- | RequestTimeoutError
69
- | InvalidRequestError
70
- | UnexpectedClientError
71
- | SDKValidationError
72
- >,
73
- APICall,
74
- ]
75
- > {
76
- const parsed = safeParse(
77
- request,
78
- (value) => operations.GetWikiRequest$outboundSchema.parse(value),
79
- "Input validation failed",
80
- );
81
- if (!parsed.ok) {
82
- return [parsed, { status: "invalid" }];
83
- }
84
- const payload = parsed.value;
85
- const body = null;
86
-
87
- const pathParams = {
88
- wiki_id: encodeSimple("wiki_id", payload.wiki_id, {
89
- explode: false,
90
- charEncoding: "percent",
91
- }),
92
- };
93
- const path = pathToFunc("/v2/wikis/{wiki_id}")(pathParams);
94
-
95
- const headers = new Headers(compactMap({
96
- Accept: "application/json",
97
- }));
98
-
99
- const secConfig = await extractSecurity(client._options.apiKey);
100
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
101
- const requestSecurity = resolveGlobalSecurity(securityInput);
102
-
103
- const context = {
104
- options: client._options,
105
- baseURL: options?.serverURL ?? client._baseURL ?? "",
106
- operationID: "GetWiki",
107
- oAuth2Scopes: null,
108
-
109
- resolvedSecurity: requestSecurity,
110
-
111
- securitySource: client._options.apiKey,
112
- retryConfig: options?.retries
113
- || client._options.retryConfig
114
- || { strategy: "none" },
115
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
116
- };
117
-
118
- const requestRes = client._createRequest(context, {
119
- security: requestSecurity,
120
- method: "GET",
121
- baseURL: options?.serverURL,
122
- path: path,
123
- headers: headers,
124
- body: body,
125
- userAgent: client._options.userAgent,
126
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
127
- }, options);
128
- if (!requestRes.ok) {
129
- return [requestRes, { status: "invalid" }];
130
- }
131
- const req = requestRes.value;
132
-
133
- const doResult = await client._do(req, {
134
- context,
135
- isErrorStatusCode: (statusCode: number) =>
136
- matchStatusCode({ status: statusCode } as Response, ["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 responseFields = {
146
- HttpMeta: { Response: response, Request: req },
147
- };
148
-
149
- const [result] = await M.match<
150
- components.GetWikiResponse,
151
- | errors.ErrorResponse
152
- | OrqError
153
- | ResponseValidationError
154
- | ConnectionError
155
- | RequestAbortedError
156
- | RequestTimeoutError
157
- | InvalidRequestError
158
- | UnexpectedClientError
159
- | SDKValidationError
160
- >(
161
- M.json(200, components.GetWikiResponse$inboundSchema),
162
- M.jsonErr(401, errors.ErrorResponse$inboundSchema),
163
- M.fail("4XX"),
164
- M.fail("5XX"),
165
- )(response, req, { extraFields: responseFields });
166
- if (!result.ok) {
167
- return [result, { status: "complete", request: req, response }];
168
- }
169
-
170
- return [result, { status: "complete", request: req, response }];
171
- }
@@ -1,177 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { OrqCore } from "../core.js";
6
- import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
- import { matchStatusCode } from "../lib/http.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 * as components from "../models/components/index.js";
15
- import {
16
- ConnectionError,
17
- InvalidRequestError,
18
- RequestAbortedError,
19
- RequestTimeoutError,
20
- UnexpectedClientError,
21
- } from "../models/errors/httpclienterrors.js";
22
- import * as errors from "../models/errors/index.js";
23
- import { OrqError } from "../models/errors/orqerror.js";
24
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
- import * as operations from "../models/operations/index.js";
27
- import { APICall, APIPromise } from "../types/async.js";
28
- import { Result } from "../types/fp.js";
29
-
30
- export function wikisGetPage(
31
- client: OrqCore,
32
- request: operations.GetWikiPageRequest,
33
- options?: RequestOptions,
34
- ): APIPromise<
35
- Result<
36
- components.GetWikiPageResponse,
37
- | errors.ErrorResponse
38
- | OrqError
39
- | ResponseValidationError
40
- | ConnectionError
41
- | RequestAbortedError
42
- | RequestTimeoutError
43
- | InvalidRequestError
44
- | UnexpectedClientError
45
- | SDKValidationError
46
- >
47
- > {
48
- return new APIPromise($do(
49
- client,
50
- request,
51
- options,
52
- ));
53
- }
54
-
55
- async function $do(
56
- client: OrqCore,
57
- request: operations.GetWikiPageRequest,
58
- options?: RequestOptions,
59
- ): Promise<
60
- [
61
- Result<
62
- components.GetWikiPageResponse,
63
- | errors.ErrorResponse
64
- | OrqError
65
- | ResponseValidationError
66
- | ConnectionError
67
- | RequestAbortedError
68
- | RequestTimeoutError
69
- | InvalidRequestError
70
- | UnexpectedClientError
71
- | SDKValidationError
72
- >,
73
- APICall,
74
- ]
75
- > {
76
- const parsed = safeParse(
77
- request,
78
- (value) => operations.GetWikiPageRequest$outboundSchema.parse(value),
79
- "Input validation failed",
80
- );
81
- if (!parsed.ok) {
82
- return [parsed, { status: "invalid" }];
83
- }
84
- const payload = parsed.value;
85
- const body = null;
86
-
87
- const pathParams = {
88
- wiki_id: encodeSimple("wiki_id", payload.wiki_id, {
89
- explode: false,
90
- charEncoding: "percent",
91
- }),
92
- };
93
- const path = pathToFunc("/v2/wikis/{wiki_id}/page")(pathParams);
94
-
95
- const query = encodeFormQuery({
96
- "path": payload.path,
97
- "run_id": payload.run_id,
98
- });
99
-
100
- const headers = new Headers(compactMap({
101
- Accept: "application/json",
102
- }));
103
-
104
- const secConfig = await extractSecurity(client._options.apiKey);
105
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
106
- const requestSecurity = resolveGlobalSecurity(securityInput);
107
-
108
- const context = {
109
- options: client._options,
110
- baseURL: options?.serverURL ?? client._baseURL ?? "",
111
- operationID: "GetWikiPage",
112
- oAuth2Scopes: null,
113
-
114
- resolvedSecurity: requestSecurity,
115
-
116
- securitySource: client._options.apiKey,
117
- retryConfig: options?.retries
118
- || client._options.retryConfig
119
- || { strategy: "none" },
120
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
121
- };
122
-
123
- const requestRes = client._createRequest(context, {
124
- security: requestSecurity,
125
- method: "GET",
126
- baseURL: options?.serverURL,
127
- path: path,
128
- headers: headers,
129
- query: query,
130
- body: body,
131
- userAgent: client._options.userAgent,
132
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
133
- }, options);
134
- if (!requestRes.ok) {
135
- return [requestRes, { status: "invalid" }];
136
- }
137
- const req = requestRes.value;
138
-
139
- const doResult = await client._do(req, {
140
- context,
141
- isErrorStatusCode: (statusCode: number) =>
142
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
143
- retryConfig: context.retryConfig,
144
- retryCodes: context.retryCodes,
145
- });
146
- if (!doResult.ok) {
147
- return [doResult, { status: "request-error", request: req }];
148
- }
149
- const response = doResult.value;
150
-
151
- const responseFields = {
152
- HttpMeta: { Response: response, Request: req },
153
- };
154
-
155
- const [result] = await M.match<
156
- components.GetWikiPageResponse,
157
- | errors.ErrorResponse
158
- | OrqError
159
- | ResponseValidationError
160
- | ConnectionError
161
- | RequestAbortedError
162
- | RequestTimeoutError
163
- | InvalidRequestError
164
- | UnexpectedClientError
165
- | SDKValidationError
166
- >(
167
- M.json(200, components.GetWikiPageResponse$inboundSchema),
168
- M.jsonErr(401, errors.ErrorResponse$inboundSchema),
169
- M.fail("4XX"),
170
- M.fail("5XX"),
171
- )(response, req, { extraFields: responseFields });
172
- if (!result.ok) {
173
- return [result, { status: "complete", request: req, response }];
174
- }
175
-
176
- return [result, { status: "complete", request: req, response }];
177
- }
@@ -1,171 +0,0 @@
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 { matchStatusCode } from "../lib/http.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 * as components from "../models/components/index.js";
15
- import {
16
- ConnectionError,
17
- InvalidRequestError,
18
- RequestAbortedError,
19
- RequestTimeoutError,
20
- UnexpectedClientError,
21
- } from "../models/errors/httpclienterrors.js";
22
- import * as errors from "../models/errors/index.js";
23
- import { OrqError } from "../models/errors/orqerror.js";
24
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
- import * as operations from "../models/operations/index.js";
27
- import { APICall, APIPromise } from "../types/async.js";
28
- import { Result } from "../types/fp.js";
29
-
30
- export function wikisGetTree(
31
- client: OrqCore,
32
- request: operations.GetWikiTreeRequest,
33
- options?: RequestOptions,
34
- ): APIPromise<
35
- Result<
36
- components.GetWikiTreeResponse,
37
- | errors.ErrorResponse
38
- | OrqError
39
- | ResponseValidationError
40
- | ConnectionError
41
- | RequestAbortedError
42
- | RequestTimeoutError
43
- | InvalidRequestError
44
- | UnexpectedClientError
45
- | SDKValidationError
46
- >
47
- > {
48
- return new APIPromise($do(
49
- client,
50
- request,
51
- options,
52
- ));
53
- }
54
-
55
- async function $do(
56
- client: OrqCore,
57
- request: operations.GetWikiTreeRequest,
58
- options?: RequestOptions,
59
- ): Promise<
60
- [
61
- Result<
62
- components.GetWikiTreeResponse,
63
- | errors.ErrorResponse
64
- | OrqError
65
- | ResponseValidationError
66
- | ConnectionError
67
- | RequestAbortedError
68
- | RequestTimeoutError
69
- | InvalidRequestError
70
- | UnexpectedClientError
71
- | SDKValidationError
72
- >,
73
- APICall,
74
- ]
75
- > {
76
- const parsed = safeParse(
77
- request,
78
- (value) => operations.GetWikiTreeRequest$outboundSchema.parse(value),
79
- "Input validation failed",
80
- );
81
- if (!parsed.ok) {
82
- return [parsed, { status: "invalid" }];
83
- }
84
- const payload = parsed.value;
85
- const body = null;
86
-
87
- const pathParams = {
88
- wiki_id: encodeSimple("wiki_id", payload.wiki_id, {
89
- explode: false,
90
- charEncoding: "percent",
91
- }),
92
- };
93
- const path = pathToFunc("/v2/wikis/{wiki_id}/tree")(pathParams);
94
-
95
- const headers = new Headers(compactMap({
96
- Accept: "application/json",
97
- }));
98
-
99
- const secConfig = await extractSecurity(client._options.apiKey);
100
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
101
- const requestSecurity = resolveGlobalSecurity(securityInput);
102
-
103
- const context = {
104
- options: client._options,
105
- baseURL: options?.serverURL ?? client._baseURL ?? "",
106
- operationID: "GetWikiTree",
107
- oAuth2Scopes: null,
108
-
109
- resolvedSecurity: requestSecurity,
110
-
111
- securitySource: client._options.apiKey,
112
- retryConfig: options?.retries
113
- || client._options.retryConfig
114
- || { strategy: "none" },
115
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
116
- };
117
-
118
- const requestRes = client._createRequest(context, {
119
- security: requestSecurity,
120
- method: "GET",
121
- baseURL: options?.serverURL,
122
- path: path,
123
- headers: headers,
124
- body: body,
125
- userAgent: client._options.userAgent,
126
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
127
- }, options);
128
- if (!requestRes.ok) {
129
- return [requestRes, { status: "invalid" }];
130
- }
131
- const req = requestRes.value;
132
-
133
- const doResult = await client._do(req, {
134
- context,
135
- isErrorStatusCode: (statusCode: number) =>
136
- matchStatusCode({ status: statusCode } as Response, ["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 responseFields = {
146
- HttpMeta: { Response: response, Request: req },
147
- };
148
-
149
- const [result] = await M.match<
150
- components.GetWikiTreeResponse,
151
- | errors.ErrorResponse
152
- | OrqError
153
- | ResponseValidationError
154
- | ConnectionError
155
- | RequestAbortedError
156
- | RequestTimeoutError
157
- | InvalidRequestError
158
- | UnexpectedClientError
159
- | SDKValidationError
160
- >(
161
- M.json(200, components.GetWikiTreeResponse$inboundSchema),
162
- M.jsonErr(401, errors.ErrorResponse$inboundSchema),
163
- M.fail("4XX"),
164
- M.fail("5XX"),
165
- )(response, req, { extraFields: responseFields });
166
- if (!result.ok) {
167
- return [result, { status: "complete", request: req, response }];
168
- }
169
-
170
- return [result, { status: "complete", request: req, response }];
171
- }
@@ -1,166 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { OrqCore } from "../core.js";
6
- import { encodeJSON } from "../lib/encodings.js";
7
- import { matchStatusCode } from "../lib/http.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 * as components from "../models/components/index.js";
15
- import {
16
- ConnectionError,
17
- InvalidRequestError,
18
- RequestAbortedError,
19
- RequestTimeoutError,
20
- UnexpectedClientError,
21
- } from "../models/errors/httpclienterrors.js";
22
- import * as errors from "../models/errors/index.js";
23
- import { OrqError } from "../models/errors/orqerror.js";
24
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
- import { APICall, APIPromise } from "../types/async.js";
27
- import { Result } from "../types/fp.js";
28
-
29
- export function wikisInspectRepository(
30
- client: OrqCore,
31
- request: components.InspectRepositoryWikiRequest,
32
- options?: RequestOptions,
33
- ): APIPromise<
34
- Result<
35
- components.InspectRepositoryWikiResponse,
36
- | errors.ErrorResponse
37
- | OrqError
38
- | ResponseValidationError
39
- | ConnectionError
40
- | RequestAbortedError
41
- | RequestTimeoutError
42
- | InvalidRequestError
43
- | UnexpectedClientError
44
- | SDKValidationError
45
- >
46
- > {
47
- return new APIPromise($do(
48
- client,
49
- request,
50
- options,
51
- ));
52
- }
53
-
54
- async function $do(
55
- client: OrqCore,
56
- request: components.InspectRepositoryWikiRequest,
57
- options?: RequestOptions,
58
- ): Promise<
59
- [
60
- Result<
61
- components.InspectRepositoryWikiResponse,
62
- | errors.ErrorResponse
63
- | OrqError
64
- | ResponseValidationError
65
- | ConnectionError
66
- | RequestAbortedError
67
- | RequestTimeoutError
68
- | InvalidRequestError
69
- | UnexpectedClientError
70
- | SDKValidationError
71
- >,
72
- APICall,
73
- ]
74
- > {
75
- const parsed = safeParse(
76
- request,
77
- (value) =>
78
- components.InspectRepositoryWikiRequest$outboundSchema.parse(value),
79
- "Input validation failed",
80
- );
81
- if (!parsed.ok) {
82
- return [parsed, { status: "invalid" }];
83
- }
84
- const payload = parsed.value;
85
- const body = encodeJSON("body", payload, { explode: true });
86
-
87
- const path = pathToFunc("/v2/wikis/inspect-repository")();
88
-
89
- const headers = new Headers(compactMap({
90
- "Content-Type": "application/json",
91
- Accept: "application/json",
92
- }));
93
-
94
- const secConfig = await extractSecurity(client._options.apiKey);
95
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
96
- const requestSecurity = resolveGlobalSecurity(securityInput);
97
-
98
- const context = {
99
- options: client._options,
100
- baseURL: options?.serverURL ?? client._baseURL ?? "",
101
- operationID: "InspectRepositoryWiki",
102
- oAuth2Scopes: null,
103
-
104
- resolvedSecurity: requestSecurity,
105
-
106
- securitySource: client._options.apiKey,
107
- retryConfig: options?.retries
108
- || client._options.retryConfig
109
- || { strategy: "none" },
110
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
111
- };
112
-
113
- const requestRes = client._createRequest(context, {
114
- security: requestSecurity,
115
- method: "POST",
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 || 600000,
122
- }, options);
123
- if (!requestRes.ok) {
124
- return [requestRes, { status: "invalid" }];
125
- }
126
- const req = requestRes.value;
127
-
128
- const doResult = await client._do(req, {
129
- context,
130
- isErrorStatusCode: (statusCode: number) =>
131
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
132
- retryConfig: context.retryConfig,
133
- retryCodes: context.retryCodes,
134
- });
135
- if (!doResult.ok) {
136
- return [doResult, { status: "request-error", request: req }];
137
- }
138
- const response = doResult.value;
139
-
140
- const responseFields = {
141
- HttpMeta: { Response: response, Request: req },
142
- };
143
-
144
- const [result] = await M.match<
145
- components.InspectRepositoryWikiResponse,
146
- | errors.ErrorResponse
147
- | OrqError
148
- | ResponseValidationError
149
- | ConnectionError
150
- | RequestAbortedError
151
- | RequestTimeoutError
152
- | InvalidRequestError
153
- | UnexpectedClientError
154
- | SDKValidationError
155
- >(
156
- M.json(200, components.InspectRepositoryWikiResponse$inboundSchema),
157
- M.jsonErr(401, errors.ErrorResponse$inboundSchema),
158
- M.fail("4XX"),
159
- M.fail("5XX"),
160
- )(response, req, { extraFields: responseFields });
161
- if (!result.ok) {
162
- return [result, { status: "complete", request: req, response }];
163
- }
164
-
165
- return [result, { status: "complete", request: req, response }];
166
- }