@orq-ai/node 4.15.6 → 4.15.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.
Files changed (144) 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/createdataset.js +1 -1
  7. package/models/operations/createdatasetitem.js +5 -5
  8. package/models/operations/createtool.js +4 -4
  9. package/models/operations/getalltools.js +4 -4
  10. package/models/operations/getv2humanevalsets.js +2 -2
  11. package/models/operations/getv2humanevalsetsid.js +2 -2
  12. package/models/operations/listdatasetdatapoints.js +5 -5
  13. package/models/operations/listdatasets.js +1 -1
  14. package/models/operations/patchv2humanevalsetsid.js +2 -2
  15. package/models/operations/postv2feedbackevaluation.js +4 -4
  16. package/models/operations/postv2humanevalsets.js +2 -2
  17. package/models/operations/retrievedatapoint.js +5 -5
  18. package/models/operations/retrievedataset.js +1 -1
  19. package/models/operations/retrievetool.js +4 -4
  20. package/models/operations/runagent.js +1 -1
  21. package/models/operations/streamrunagent.js +1 -1
  22. package/models/operations/updatedatapoint.js +5 -5
  23. package/models/operations/updatedataset.js +1 -1
  24. package/models/operations/updatetool.js +4 -4
  25. package/package.json +6 -6
  26. package/packages/orq-rc/src/funcs/routerClassifyCreate.ts +1 -1
  27. package/packages/orq-rc/src/funcs/{auditLogsQuery.ts → wikisCreate.ts} +10 -16
  28. package/packages/orq-rc/src/funcs/wikisDelete.ts +162 -0
  29. package/packages/orq-rc/src/funcs/wikisGet.ts +162 -0
  30. package/packages/orq-rc/src/funcs/wikisGetPage.ts +168 -0
  31. package/packages/orq-rc/src/funcs/wikisGetTree.ts +162 -0
  32. package/packages/orq-rc/src/funcs/wikisInspectRepository.ts +157 -0
  33. package/packages/orq-rc/src/funcs/wikisList.ts +167 -0
  34. package/packages/orq-rc/src/funcs/wikisListRuns.ts +167 -0
  35. package/packages/orq-rc/src/funcs/wikisRefresh.ts +165 -0
  36. package/packages/orq-rc/src/funcs/wikisSearch.ts +168 -0
  37. package/packages/orq-rc/src/funcs/wikisUpdate.ts +163 -0
  38. package/packages/orq-rc/src/funcs/wikisUpdatePage.ts +165 -0
  39. package/packages/orq-rc/src/lib/config.ts +3 -3
  40. package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +66 -0
  41. package/packages/orq-rc/src/models/components/classifyanswer.ts +1 -1
  42. package/packages/orq-rc/src/models/components/classifyusage.ts +2 -2
  43. package/packages/orq-rc/src/models/components/createapikeyrequest.ts +3 -3
  44. package/packages/orq-rc/src/models/components/createmanagementkeyrequest.ts +3 -3
  45. package/packages/orq-rc/src/models/components/createwikirequest.ts +67 -0
  46. package/packages/orq-rc/src/models/components/createwikiresponse.ts +32 -0
  47. package/packages/orq-rc/src/models/components/deletewikiresponse.ts +27 -0
  48. package/packages/orq-rc/src/models/components/getwikipageresponse.ts +32 -0
  49. package/packages/orq-rc/src/models/components/getwikiresponse.ts +32 -0
  50. package/packages/orq-rc/src/models/components/getwikitreeresponse.ts +32 -0
  51. package/packages/orq-rc/src/models/components/index.ts +25 -8
  52. package/packages/orq-rc/src/models/components/inspectrepositorywikirequest.ts +45 -0
  53. package/packages/orq-rc/src/models/components/inspectrepositorywikiresponse.ts +38 -0
  54. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +126 -0
  55. package/packages/orq-rc/src/models/components/listwikirunsresponse.ts +32 -0
  56. package/packages/orq-rc/src/models/components/listwikisresponse.ts +39 -0
  57. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  58. package/packages/orq-rc/src/models/components/refreshwikirequest.ts +31 -0
  59. package/packages/orq-rc/src/models/components/refreshwikiresponse.ts +32 -0
  60. package/packages/orq-rc/src/models/components/searchwikiresponse.ts +32 -0
  61. package/packages/orq-rc/src/models/components/updatewikipagerequest.ts +42 -0
  62. package/packages/orq-rc/src/models/components/updatewikipageresponse.ts +32 -0
  63. package/packages/orq-rc/src/models/components/updatewikirequest.ts +48 -0
  64. package/packages/orq-rc/src/models/components/updatewikiresponse.ts +32 -0
  65. package/packages/orq-rc/src/models/components/wiki.ts +91 -0
  66. package/packages/orq-rc/src/models/components/wikipage.ts +58 -0
  67. package/packages/orq-rc/src/models/components/wikirepository.ts +72 -0
  68. package/packages/orq-rc/src/models/components/wikirun.ts +71 -0
  69. package/packages/orq-rc/src/models/components/wikirunstats.ts +44 -0
  70. package/packages/orq-rc/src/models/components/wikisearchhit.ts +45 -0
  71. package/packages/orq-rc/src/models/components/wikisettings.ts +76 -0
  72. package/packages/orq-rc/src/models/components/wikitreepage.ts +47 -0
  73. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +222 -0
  74. package/packages/orq-rc/src/models/operations/createclassify.ts +4 -2
  75. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  76. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +159 -5
  77. package/packages/orq-rc/src/models/operations/createprompt.ts +143 -0
  78. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  79. package/packages/orq-rc/src/models/operations/deletewiki.ts +36 -0
  80. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +147 -0
  81. package/packages/orq-rc/src/models/operations/deploymentstream.ts +126 -0
  82. package/packages/orq-rc/src/models/operations/getallprompts.ts +63 -0
  83. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  84. package/packages/orq-rc/src/models/operations/getoneprompt.ts +63 -0
  85. package/packages/orq-rc/src/models/operations/getpromptversion.ts +65 -0
  86. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  87. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  88. package/packages/orq-rc/src/models/operations/getwiki.ts +32 -0
  89. package/packages/orq-rc/src/models/operations/getwikipage.ts +43 -0
  90. package/packages/orq-rc/src/models/operations/getwikitree.ts +36 -0
  91. package/packages/orq-rc/src/models/operations/index.ts +10 -0
  92. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +77 -5
  93. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  94. package/packages/orq-rc/src/models/operations/listpromptversions.ts +66 -0
  95. package/packages/orq-rc/src/models/operations/listwikiruns.ts +39 -0
  96. package/packages/orq-rc/src/models/{components/auditlogpagination.ts → operations/listwikis.ts} +19 -20
  97. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  98. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
  99. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/refreshwiki.ts +41 -0
  101. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +71 -5
  102. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  103. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  104. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  105. package/packages/orq-rc/src/models/operations/searchwiki.ts +42 -0
  106. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  107. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +152 -5
  108. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  109. package/packages/orq-rc/src/models/operations/updateprompt.ts +143 -0
  110. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  111. package/packages/orq-rc/src/models/operations/updatewiki.ts +41 -0
  112. package/packages/orq-rc/src/models/operations/updatewikipage.ts +41 -0
  113. package/packages/orq-rc/src/sdk/classify.ts +1 -1
  114. package/packages/orq-rc/src/sdk/sdk.ts +6 -6
  115. package/packages/orq-rc/src/sdk/wikis.ts +154 -0
  116. package/src/lib/config.ts +3 -3
  117. package/src/models/components/reasoningpart.ts +1 -1
  118. package/src/models/operations/createdataset.ts +1 -1
  119. package/src/models/operations/createdatasetitem.ts +5 -5
  120. package/src/models/operations/createtool.ts +4 -4
  121. package/src/models/operations/getalltools.ts +4 -4
  122. package/src/models/operations/getv2humanevalsets.ts +2 -2
  123. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  124. package/src/models/operations/listdatasetdatapoints.ts +5 -5
  125. package/src/models/operations/listdatasets.ts +1 -1
  126. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  127. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  128. package/src/models/operations/postv2humanevalsets.ts +2 -2
  129. package/src/models/operations/retrievedatapoint.ts +5 -5
  130. package/src/models/operations/retrievedataset.ts +1 -1
  131. package/src/models/operations/retrievetool.ts +4 -4
  132. package/src/models/operations/runagent.ts +1 -1
  133. package/src/models/operations/streamrunagent.ts +1 -1
  134. package/src/models/operations/updatedatapoint.ts +5 -5
  135. package/src/models/operations/updatedataset.ts +1 -1
  136. package/src/models/operations/updatetool.ts +4 -4
  137. package/packages/orq-rc/src/models/components/auditlog.ts +0 -122
  138. package/packages/orq-rc/src/models/components/auditlogfilter.ts +0 -51
  139. package/packages/orq-rc/src/models/components/auditlogfilterquery.ts +0 -54
  140. package/packages/orq-rc/src/models/components/auditlogsort.ts +0 -39
  141. package/packages/orq-rc/src/models/components/queryauditlogsrequest.ts +0 -64
  142. package/packages/orq-rc/src/models/components/queryauditlogsresponse.ts +0 -55
  143. package/packages/orq-rc/src/models/components/value.ts +0 -24
  144. package/packages/orq-rc/src/sdk/auditlogs.ts +0 -27
@@ -25,19 +25,13 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
25
  import { APICall, APIPromise } from "../types/async.js";
26
26
  import { Result } from "../types/fp.js";
27
27
 
28
- /**
29
- * Query audit logs
30
- *
31
- * @remarks
32
- * Queries audit logs from your workspace with filters, sorting, and cursor pagination.
33
- */
34
- export function auditLogsQuery(
28
+ export function wikisCreate(
35
29
  client: OrqCore,
36
- request: components.QueryAuditLogsRequest,
30
+ request: components.CreateWikiRequest,
37
31
  options?: RequestOptions,
38
32
  ): APIPromise<
39
33
  Result<
40
- components.QueryAuditLogsResponse,
34
+ components.CreateWikiResponse,
41
35
  | OrqError
42
36
  | ResponseValidationError
43
37
  | ConnectionError
@@ -57,12 +51,12 @@ export function auditLogsQuery(
57
51
 
58
52
  async function $do(
59
53
  client: OrqCore,
60
- request: components.QueryAuditLogsRequest,
54
+ request: components.CreateWikiRequest,
61
55
  options?: RequestOptions,
62
56
  ): Promise<
63
57
  [
64
58
  Result<
65
- components.QueryAuditLogsResponse,
59
+ components.CreateWikiResponse,
66
60
  | OrqError
67
61
  | ResponseValidationError
68
62
  | ConnectionError
@@ -77,7 +71,7 @@ async function $do(
77
71
  > {
78
72
  const parsed = safeParse(
79
73
  request,
80
- (value) => components.QueryAuditLogsRequest$outboundSchema.parse(value),
74
+ (value) => components.CreateWikiRequest$outboundSchema.parse(value),
81
75
  "Input validation failed",
82
76
  );
83
77
  if (!parsed.ok) {
@@ -86,7 +80,7 @@ async function $do(
86
80
  const payload = parsed.value;
87
81
  const body = encodeJSON("body", payload, { explode: true });
88
82
 
89
- const path = pathToFunc("/v2/audit-logs/query")();
83
+ const path = pathToFunc("/v2/wikis")();
90
84
 
91
85
  const headers = new Headers(compactMap({
92
86
  "Content-Type": "application/json",
@@ -100,7 +94,7 @@ async function $do(
100
94
  const context = {
101
95
  options: client._options,
102
96
  baseURL: options?.serverURL ?? client._baseURL ?? "",
103
- operationID: "AuditLogQuery",
97
+ operationID: "CreateWiki",
104
98
  oAuth2Scopes: null,
105
99
 
106
100
  resolvedSecurity: requestSecurity,
@@ -140,7 +134,7 @@ async function $do(
140
134
  const response = doResult.value;
141
135
 
142
136
  const [result] = await M.match<
143
- components.QueryAuditLogsResponse,
137
+ components.CreateWikiResponse,
144
138
  | OrqError
145
139
  | ResponseValidationError
146
140
  | ConnectionError
@@ -150,7 +144,7 @@ async function $do(
150
144
  | UnexpectedClientError
151
145
  | SDKValidationError
152
146
  >(
153
- M.json(200, components.QueryAuditLogsResponse$inboundSchema),
147
+ M.json(200, components.CreateWikiResponse$inboundSchema),
154
148
  M.fail("4XX"),
155
149
  M.fail("5XX"),
156
150
  )(response, req);
@@ -0,0 +1,162 @@
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 { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ export function wikisDelete(
30
+ client: OrqCore,
31
+ request: operations.DeleteWikiRequest,
32
+ options?: RequestOptions,
33
+ ): APIPromise<
34
+ Result<
35
+ components.DeleteWikiResponse,
36
+ | OrqError
37
+ | ResponseValidationError
38
+ | ConnectionError
39
+ | RequestAbortedError
40
+ | RequestTimeoutError
41
+ | InvalidRequestError
42
+ | UnexpectedClientError
43
+ | SDKValidationError
44
+ >
45
+ > {
46
+ return new APIPromise($do(
47
+ client,
48
+ request,
49
+ options,
50
+ ));
51
+ }
52
+
53
+ async function $do(
54
+ client: OrqCore,
55
+ request: operations.DeleteWikiRequest,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ components.DeleteWikiResponse,
61
+ | OrqError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const parsed = safeParse(
74
+ request,
75
+ (value) => operations.DeleteWikiRequest$outboundSchema.parse(value),
76
+ "Input validation failed",
77
+ );
78
+ if (!parsed.ok) {
79
+ return [parsed, { status: "invalid" }];
80
+ }
81
+ const payload = parsed.value;
82
+ const body = null;
83
+
84
+ const pathParams = {
85
+ wiki_id: encodeSimple("wiki_id", payload.wiki_id, {
86
+ explode: false,
87
+ charEncoding: "percent",
88
+ }),
89
+ };
90
+ const path = pathToFunc("/v2/wikis/{wiki_id}")(pathParams);
91
+
92
+ const headers = new Headers(compactMap({
93
+ Accept: "application/json",
94
+ }));
95
+
96
+ const secConfig = await extractSecurity(client._options.apiKey);
97
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
98
+ const requestSecurity = resolveGlobalSecurity(securityInput);
99
+
100
+ const context = {
101
+ options: client._options,
102
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
103
+ operationID: "DeleteWiki",
104
+ oAuth2Scopes: null,
105
+
106
+ resolvedSecurity: requestSecurity,
107
+
108
+ securitySource: client._options.apiKey,
109
+ retryConfig: options?.retries
110
+ || client._options.retryConfig
111
+ || { strategy: "none" },
112
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
113
+ };
114
+
115
+ const requestRes = client._createRequest(context, {
116
+ security: requestSecurity,
117
+ method: "DELETE",
118
+ baseURL: options?.serverURL,
119
+ path: path,
120
+ headers: headers,
121
+ body: body,
122
+ userAgent: client._options.userAgent,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ isErrorStatusCode: (statusCode: number) =>
133
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
134
+ retryConfig: context.retryConfig,
135
+ retryCodes: context.retryCodes,
136
+ });
137
+ if (!doResult.ok) {
138
+ return [doResult, { status: "request-error", request: req }];
139
+ }
140
+ const response = doResult.value;
141
+
142
+ const [result] = await M.match<
143
+ components.DeleteWikiResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.DeleteWikiResponse$inboundSchema),
154
+ M.fail("4XX"),
155
+ M.fail("5XX"),
156
+ )(response, req);
157
+ if (!result.ok) {
158
+ return [result, { status: "complete", request: req, response }];
159
+ }
160
+
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
@@ -0,0 +1,162 @@
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 { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ export function wikisGet(
30
+ client: OrqCore,
31
+ request: operations.GetWikiRequest,
32
+ options?: RequestOptions,
33
+ ): APIPromise<
34
+ Result<
35
+ components.GetWikiResponse,
36
+ | OrqError
37
+ | ResponseValidationError
38
+ | ConnectionError
39
+ | RequestAbortedError
40
+ | RequestTimeoutError
41
+ | InvalidRequestError
42
+ | UnexpectedClientError
43
+ | SDKValidationError
44
+ >
45
+ > {
46
+ return new APIPromise($do(
47
+ client,
48
+ request,
49
+ options,
50
+ ));
51
+ }
52
+
53
+ async function $do(
54
+ client: OrqCore,
55
+ request: operations.GetWikiRequest,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ components.GetWikiResponse,
61
+ | OrqError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const parsed = safeParse(
74
+ request,
75
+ (value) => operations.GetWikiRequest$outboundSchema.parse(value),
76
+ "Input validation failed",
77
+ );
78
+ if (!parsed.ok) {
79
+ return [parsed, { status: "invalid" }];
80
+ }
81
+ const payload = parsed.value;
82
+ const body = null;
83
+
84
+ const pathParams = {
85
+ wiki_id: encodeSimple("wiki_id", payload.wiki_id, {
86
+ explode: false,
87
+ charEncoding: "percent",
88
+ }),
89
+ };
90
+ const path = pathToFunc("/v2/wikis/{wiki_id}")(pathParams);
91
+
92
+ const headers = new Headers(compactMap({
93
+ Accept: "application/json",
94
+ }));
95
+
96
+ const secConfig = await extractSecurity(client._options.apiKey);
97
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
98
+ const requestSecurity = resolveGlobalSecurity(securityInput);
99
+
100
+ const context = {
101
+ options: client._options,
102
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
103
+ operationID: "GetWiki",
104
+ oAuth2Scopes: null,
105
+
106
+ resolvedSecurity: requestSecurity,
107
+
108
+ securitySource: client._options.apiKey,
109
+ retryConfig: options?.retries
110
+ || client._options.retryConfig
111
+ || { strategy: "none" },
112
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
113
+ };
114
+
115
+ const requestRes = client._createRequest(context, {
116
+ security: requestSecurity,
117
+ method: "GET",
118
+ baseURL: options?.serverURL,
119
+ path: path,
120
+ headers: headers,
121
+ body: body,
122
+ userAgent: client._options.userAgent,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ isErrorStatusCode: (statusCode: number) =>
133
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
134
+ retryConfig: context.retryConfig,
135
+ retryCodes: context.retryCodes,
136
+ });
137
+ if (!doResult.ok) {
138
+ return [doResult, { status: "request-error", request: req }];
139
+ }
140
+ const response = doResult.value;
141
+
142
+ const [result] = await M.match<
143
+ components.GetWikiResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.GetWikiResponse$inboundSchema),
154
+ M.fail("4XX"),
155
+ M.fail("5XX"),
156
+ )(response, req);
157
+ if (!result.ok) {
158
+ return [result, { status: "complete", request: req, response }];
159
+ }
160
+
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
@@ -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, 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 { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ export function wikisGetPage(
30
+ client: OrqCore,
31
+ request: operations.GetWikiPageRequest,
32
+ options?: RequestOptions,
33
+ ): APIPromise<
34
+ Result<
35
+ components.GetWikiPageResponse,
36
+ | OrqError
37
+ | ResponseValidationError
38
+ | ConnectionError
39
+ | RequestAbortedError
40
+ | RequestTimeoutError
41
+ | InvalidRequestError
42
+ | UnexpectedClientError
43
+ | SDKValidationError
44
+ >
45
+ > {
46
+ return new APIPromise($do(
47
+ client,
48
+ request,
49
+ options,
50
+ ));
51
+ }
52
+
53
+ async function $do(
54
+ client: OrqCore,
55
+ request: operations.GetWikiPageRequest,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ components.GetWikiPageResponse,
61
+ | OrqError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const parsed = safeParse(
74
+ request,
75
+ (value) => operations.GetWikiPageRequest$outboundSchema.parse(value),
76
+ "Input validation failed",
77
+ );
78
+ if (!parsed.ok) {
79
+ return [parsed, { status: "invalid" }];
80
+ }
81
+ const payload = parsed.value;
82
+ const body = null;
83
+
84
+ const pathParams = {
85
+ wiki_id: encodeSimple("wiki_id", payload.wiki_id, {
86
+ explode: false,
87
+ charEncoding: "percent",
88
+ }),
89
+ };
90
+ const path = pathToFunc("/v2/wikis/{wiki_id}/page")(pathParams);
91
+
92
+ const query = encodeFormQuery({
93
+ "path": payload.path,
94
+ "run_id": payload.run_id,
95
+ });
96
+
97
+ const headers = new Headers(compactMap({
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: "GetWikiPage",
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: "GET",
123
+ baseURL: options?.serverURL,
124
+ path: path,
125
+ headers: headers,
126
+ query: query,
127
+ body: body,
128
+ userAgent: client._options.userAgent,
129
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
130
+ }, options);
131
+ if (!requestRes.ok) {
132
+ return [requestRes, { status: "invalid" }];
133
+ }
134
+ const req = requestRes.value;
135
+
136
+ const doResult = await client._do(req, {
137
+ context,
138
+ isErrorStatusCode: (statusCode: number) =>
139
+ matchStatusCode({ status: statusCode } as Response, ["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
+ components.GetWikiPageResponse,
150
+ | OrqError
151
+ | ResponseValidationError
152
+ | ConnectionError
153
+ | RequestAbortedError
154
+ | RequestTimeoutError
155
+ | InvalidRequestError
156
+ | UnexpectedClientError
157
+ | SDKValidationError
158
+ >(
159
+ M.json(200, components.GetWikiPageResponse$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
+ }