@unified-api/typescript-sdk 2.4.1 → 2.5.0

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 (155) hide show
  1. package/README.md +41 -3
  2. package/funcs/apicallListUnifiedApicalls.js +1 -1
  3. package/funcs/apicallListUnifiedApicalls.js.map +1 -1
  4. package/funcs/connectionListUnifiedConnections.js +1 -1
  5. package/funcs/connectionListUnifiedConnections.js.map +1 -1
  6. package/funcs/integrationListUnifiedIntegrations.js +1 -1
  7. package/funcs/integrationListUnifiedIntegrations.js.map +1 -1
  8. package/funcs/issueListUnifiedIssues.js +1 -1
  9. package/funcs/issueListUnifiedIssues.js.map +1 -1
  10. package/funcs/passthroughCreatePassthroughJson.d.ts +19 -0
  11. package/funcs/passthroughCreatePassthroughJson.d.ts.map +1 -0
  12. package/funcs/{passthroughCreatePassthrough.js → passthroughCreatePassthroughJson.js} +18 -8
  13. package/funcs/passthroughCreatePassthroughJson.js.map +1 -0
  14. package/funcs/passthroughCreatePassthroughRaw.d.ts +19 -0
  15. package/funcs/passthroughCreatePassthroughRaw.d.ts.map +1 -0
  16. package/funcs/passthroughCreatePassthroughRaw.js +109 -0
  17. package/funcs/passthroughCreatePassthroughRaw.js.map +1 -0
  18. package/funcs/passthroughListPassthroughs.d.ts +8 -3
  19. package/funcs/passthroughListPassthroughs.d.ts.map +1 -1
  20. package/funcs/passthroughListPassthroughs.js +13 -3
  21. package/funcs/passthroughListPassthroughs.js.map +1 -1
  22. package/funcs/passthroughPatchPassthroughJson.d.ts +19 -0
  23. package/funcs/passthroughPatchPassthroughJson.d.ts.map +1 -0
  24. package/funcs/{passthroughPatchPassthrough.js → passthroughPatchPassthroughJson.js} +18 -8
  25. package/funcs/passthroughPatchPassthroughJson.js.map +1 -0
  26. package/funcs/passthroughPatchPassthroughRaw.d.ts +19 -0
  27. package/funcs/passthroughPatchPassthroughRaw.d.ts.map +1 -0
  28. package/funcs/passthroughPatchPassthroughRaw.js +109 -0
  29. package/funcs/passthroughPatchPassthroughRaw.js.map +1 -0
  30. package/funcs/passthroughRemovePassthrough.d.ts +8 -3
  31. package/funcs/passthroughRemovePassthrough.d.ts.map +1 -1
  32. package/funcs/passthroughRemovePassthrough.js +13 -3
  33. package/funcs/passthroughRemovePassthrough.js.map +1 -1
  34. package/funcs/passthroughUpdatePassthroughJson.d.ts +19 -0
  35. package/funcs/passthroughUpdatePassthroughJson.d.ts.map +1 -0
  36. package/funcs/{passthroughUpdatePassthrough.js → passthroughUpdatePassthroughJson.js} +18 -8
  37. package/funcs/passthroughUpdatePassthroughJson.js.map +1 -0
  38. package/funcs/passthroughUpdatePassthroughRaw.d.ts +19 -0
  39. package/funcs/passthroughUpdatePassthroughRaw.d.ts.map +1 -0
  40. package/funcs/passthroughUpdatePassthroughRaw.js +109 -0
  41. package/funcs/passthroughUpdatePassthroughRaw.js.map +1 -0
  42. package/funcs/unifiedCreateUnifiedWebhook.js +1 -1
  43. package/funcs/unifiedCreateUnifiedWebhook.js.map +1 -1
  44. package/funcs/unifiedListUnifiedApicalls.js +1 -1
  45. package/funcs/unifiedListUnifiedApicalls.js.map +1 -1
  46. package/funcs/unifiedListUnifiedConnections.js +1 -1
  47. package/funcs/unifiedListUnifiedConnections.js.map +1 -1
  48. package/funcs/unifiedListUnifiedIntegrations.js +1 -1
  49. package/funcs/unifiedListUnifiedIntegrations.js.map +1 -1
  50. package/funcs/unifiedListUnifiedIssues.js +1 -1
  51. package/funcs/unifiedListUnifiedIssues.js.map +1 -1
  52. package/funcs/unifiedListUnifiedWebhooks.js +1 -1
  53. package/funcs/unifiedListUnifiedWebhooks.js.map +1 -1
  54. package/funcs/webhookCreateUnifiedWebhook.js +1 -1
  55. package/funcs/webhookCreateUnifiedWebhook.js.map +1 -1
  56. package/funcs/webhookListUnifiedWebhooks.js +1 -1
  57. package/funcs/webhookListUnifiedWebhooks.js.map +1 -1
  58. package/lib/config.d.ts +3 -3
  59. package/lib/config.js +3 -3
  60. package/package.json +2 -2
  61. package/sdk/models/operations/createpassthroughjson.d.ts +83 -0
  62. package/sdk/models/operations/createpassthroughjson.d.ts.map +1 -0
  63. package/sdk/models/operations/createpassthroughjson.js +112 -0
  64. package/sdk/models/operations/createpassthroughjson.js.map +1 -0
  65. package/sdk/models/operations/createpassthroughraw.d.ts +83 -0
  66. package/sdk/models/operations/createpassthroughraw.d.ts.map +1 -0
  67. package/sdk/models/operations/createpassthroughraw.js +122 -0
  68. package/sdk/models/operations/createpassthroughraw.js.map +1 -0
  69. package/sdk/models/operations/index.d.ts +6 -3
  70. package/sdk/models/operations/index.d.ts.map +1 -1
  71. package/sdk/models/operations/index.js +6 -3
  72. package/sdk/models/operations/index.js.map +1 -1
  73. package/sdk/models/operations/listpassthroughs.d.ts +48 -0
  74. package/sdk/models/operations/listpassthroughs.d.ts.map +1 -1
  75. package/sdk/models/operations/listpassthroughs.js +48 -1
  76. package/sdk/models/operations/listpassthroughs.js.map +1 -1
  77. package/sdk/models/operations/patchpassthroughjson.d.ts +83 -0
  78. package/sdk/models/operations/patchpassthroughjson.d.ts.map +1 -0
  79. package/sdk/models/operations/patchpassthroughjson.js +112 -0
  80. package/sdk/models/operations/patchpassthroughjson.js.map +1 -0
  81. package/sdk/models/operations/patchpassthroughraw.d.ts +83 -0
  82. package/sdk/models/operations/patchpassthroughraw.d.ts.map +1 -0
  83. package/sdk/models/operations/patchpassthroughraw.js +122 -0
  84. package/sdk/models/operations/patchpassthroughraw.js.map +1 -0
  85. package/sdk/models/operations/removepassthrough.d.ts +48 -0
  86. package/sdk/models/operations/removepassthrough.d.ts.map +1 -1
  87. package/sdk/models/operations/removepassthrough.js +48 -1
  88. package/sdk/models/operations/removepassthrough.js.map +1 -1
  89. package/sdk/models/operations/updatepassthroughjson.d.ts +83 -0
  90. package/sdk/models/operations/updatepassthroughjson.d.ts.map +1 -0
  91. package/sdk/models/operations/updatepassthroughjson.js +112 -0
  92. package/sdk/models/operations/updatepassthroughjson.js.map +1 -0
  93. package/sdk/models/operations/updatepassthroughraw.d.ts +83 -0
  94. package/sdk/models/operations/updatepassthroughraw.d.ts.map +1 -0
  95. package/sdk/models/operations/updatepassthroughraw.js +122 -0
  96. package/sdk/models/operations/updatepassthroughraw.js.map +1 -0
  97. package/sdk/passthrough.d.ts +49 -15
  98. package/sdk/passthrough.d.ts.map +1 -1
  99. package/sdk/passthrough.js +47 -10
  100. package/sdk/passthrough.js.map +1 -1
  101. package/src/funcs/apicallListUnifiedApicalls.ts +1 -1
  102. package/src/funcs/connectionListUnifiedConnections.ts +1 -1
  103. package/src/funcs/integrationListUnifiedIntegrations.ts +1 -1
  104. package/src/funcs/issueListUnifiedIssues.ts +1 -1
  105. package/src/funcs/{passthroughCreatePassthrough.ts → passthroughCreatePassthroughJson.ts} +42 -11
  106. package/src/funcs/passthroughCreatePassthroughRaw.ts +158 -0
  107. package/src/funcs/passthroughListPassthroughs.ts +38 -7
  108. package/src/funcs/{passthroughPatchPassthrough.ts → passthroughPatchPassthroughJson.ts} +43 -11
  109. package/src/funcs/passthroughPatchPassthroughRaw.ts +158 -0
  110. package/src/funcs/passthroughRemovePassthrough.ts +38 -7
  111. package/src/funcs/{passthroughUpdatePassthrough.ts → passthroughUpdatePassthroughJson.ts} +42 -11
  112. package/src/funcs/passthroughUpdatePassthroughRaw.ts +158 -0
  113. package/src/funcs/unifiedCreateUnifiedWebhook.ts +1 -1
  114. package/src/funcs/unifiedListUnifiedApicalls.ts +1 -1
  115. package/src/funcs/unifiedListUnifiedConnections.ts +1 -1
  116. package/src/funcs/unifiedListUnifiedIntegrations.ts +1 -1
  117. package/src/funcs/unifiedListUnifiedIssues.ts +1 -1
  118. package/src/funcs/unifiedListUnifiedWebhooks.ts +1 -1
  119. package/src/funcs/webhookCreateUnifiedWebhook.ts +1 -1
  120. package/src/funcs/webhookListUnifiedWebhooks.ts +1 -1
  121. package/src/lib/config.ts +3 -3
  122. package/src/sdk/models/operations/createpassthroughjson.ts +166 -0
  123. package/src/sdk/models/operations/createpassthroughraw.ts +185 -0
  124. package/src/sdk/models/operations/index.ts +6 -3
  125. package/src/sdk/models/operations/listpassthroughs.ts +87 -0
  126. package/src/sdk/models/operations/patchpassthroughjson.ts +165 -0
  127. package/src/sdk/models/operations/patchpassthroughraw.ts +185 -0
  128. package/src/sdk/models/operations/removepassthrough.ts +94 -0
  129. package/src/sdk/models/operations/updatepassthroughjson.ts +166 -0
  130. package/src/sdk/models/operations/updatepassthroughraw.ts +185 -0
  131. package/src/sdk/passthrough.ts +125 -24
  132. package/funcs/passthroughCreatePassthrough.d.ts +0 -14
  133. package/funcs/passthroughCreatePassthrough.d.ts.map +0 -1
  134. package/funcs/passthroughCreatePassthrough.js.map +0 -1
  135. package/funcs/passthroughPatchPassthrough.d.ts +0 -14
  136. package/funcs/passthroughPatchPassthrough.d.ts.map +0 -1
  137. package/funcs/passthroughPatchPassthrough.js.map +0 -1
  138. package/funcs/passthroughUpdatePassthrough.d.ts +0 -14
  139. package/funcs/passthroughUpdatePassthrough.d.ts.map +0 -1
  140. package/funcs/passthroughUpdatePassthrough.js.map +0 -1
  141. package/sdk/models/operations/createpassthrough.d.ts +0 -39
  142. package/sdk/models/operations/createpassthrough.d.ts.map +0 -1
  143. package/sdk/models/operations/createpassthrough.js +0 -65
  144. package/sdk/models/operations/createpassthrough.js.map +0 -1
  145. package/sdk/models/operations/patchpassthrough.d.ts +0 -39
  146. package/sdk/models/operations/patchpassthrough.d.ts.map +0 -1
  147. package/sdk/models/operations/patchpassthrough.js +0 -65
  148. package/sdk/models/operations/patchpassthrough.js.map +0 -1
  149. package/sdk/models/operations/updatepassthrough.d.ts +0 -39
  150. package/sdk/models/operations/updatepassthrough.d.ts.map +0 -1
  151. package/sdk/models/operations/updatepassthrough.js +0 -65
  152. package/sdk/models/operations/updatepassthrough.js.map +0 -1
  153. package/src/sdk/models/operations/createpassthrough.ts +0 -70
  154. package/src/sdk/models/operations/patchpassthrough.ts +0 -70
  155. package/src/sdk/models/operations/updatepassthrough.ts +0 -70
@@ -2,7 +2,6 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import * as z from "zod";
6
5
  import { UnifiedToCore } from "../core.js";
7
6
  import {
8
7
  encodeJSON as encodeJSON$,
@@ -25,16 +24,24 @@ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
25
24
  import * as operations from "../sdk/models/operations/index.js";
26
25
  import { Result } from "../sdk/types/fp.js";
27
26
 
27
+ export enum PatchPassthroughJsonAcceptEnum {
28
+ applicationJson = "application/json",
29
+ textPlain = "text/plain",
30
+ wildcardWildcard = "*/*",
31
+ }
32
+
28
33
  /**
29
34
  * Passthrough PUT
30
35
  */
31
- export async function passthroughPatchPassthrough(
36
+ export async function passthroughPatchPassthroughJson(
32
37
  client$: UnifiedToCore,
33
- request: operations.PatchPassthroughRequest,
34
- options?: RequestOptions,
38
+ request: operations.PatchPassthroughJsonRequest,
39
+ options?: RequestOptions & {
40
+ acceptHeaderOverride?: PatchPassthroughJsonAcceptEnum;
41
+ },
35
42
  ): Promise<
36
43
  Result<
37
- { [k: string]: any },
44
+ operations.PatchPassthroughJsonResponse | undefined,
38
45
  | SDKError
39
46
  | SDKValidationError
40
47
  | UnexpectedClientError
@@ -48,7 +55,8 @@ export async function passthroughPatchPassthrough(
48
55
 
49
56
  const parsed$ = schemas$.safeParse(
50
57
  input$,
51
- (value$) => operations.PatchPassthroughRequest$outboundSchema.parse(value$),
58
+ (value$) =>
59
+ operations.PatchPassthroughJsonRequest$outboundSchema.parse(value$),
52
60
  "Input validation failed",
53
61
  );
54
62
  if (!parsed$.ok) {
@@ -72,12 +80,13 @@ export async function passthroughPatchPassthrough(
72
80
 
73
81
  const headers$ = new Headers({
74
82
  "Content-Type": "application/json",
75
- Accept: "application/json",
83
+ Accept: options?.acceptHeaderOverride
84
+ || "application/json;q=1, text/plain;q=0.7, */*;q=0",
76
85
  });
77
86
 
78
87
  const security$ = await extractSecurity(client$.options$.security);
79
88
  const context = {
80
- operationID: "patchPassthrough",
89
+ operationID: "patchPassthrough_json",
81
90
  oAuth2Scopes: [],
82
91
  securitySource: client$.options$.security,
83
92
  };
@@ -108,8 +117,12 @@ export async function passthroughPatchPassthrough(
108
117
  }
109
118
  const response = doResult.value;
110
119
 
120
+ const responseFields$ = {
121
+ HttpMeta: { Response: response, Request: request$ },
122
+ };
123
+
111
124
  const [result$] = await m$.match<
112
- { [k: string]: any },
125
+ operations.PatchPassthroughJsonResponse | undefined,
113
126
  | SDKError
114
127
  | SDKValidationError
115
128
  | UnexpectedClientError
@@ -118,9 +131,28 @@ export async function passthroughPatchPassthrough(
118
131
  | RequestTimeoutError
119
132
  | ConnectionError
120
133
  >(
121
- m$.json("2XX", z.record(z.any())),
134
+ m$.nil(
135
+ [204, 205, 304],
136
+ operations.PatchPassthroughJsonResponse$inboundSchema.optional(),
137
+ { hdrs: true },
138
+ ),
139
+ m$.bytes(
140
+ "2XX",
141
+ operations.PatchPassthroughJsonResponse$inboundSchema.optional(),
142
+ { ctype: "*/*", key: "Result" },
143
+ ),
144
+ m$.json(
145
+ "2XX",
146
+ operations.PatchPassthroughJsonResponse$inboundSchema.optional(),
147
+ { key: "Result" },
148
+ ),
149
+ m$.text(
150
+ "2XX",
151
+ operations.PatchPassthroughJsonResponse$inboundSchema.optional(),
152
+ { key: "Result" },
153
+ ),
122
154
  m$.fail(["4XX", "5XX"]),
123
- )(response);
155
+ )(response, { extraFields: responseFields$ });
124
156
  if (!result$.ok) {
125
157
  return result$;
126
158
  }
@@ -0,0 +1,158 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { UnifiedToCore } from "../core.js";
6
+ import { encodeSimple as encodeSimple$ } from "../lib/encodings.js";
7
+ import * as m$ from "../lib/matchers.js";
8
+ import * as schemas$ from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/errors/httpclienterrors.js";
19
+ import { SDKError } from "../sdk/models/errors/sdkerror.js";
20
+ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../sdk/models/operations/index.js";
22
+ import { Result } from "../sdk/types/fp.js";
23
+
24
+ export enum PatchPassthroughRawAcceptEnum {
25
+ applicationJson = "application/json",
26
+ textPlain = "text/plain",
27
+ wildcardWildcard = "*/*",
28
+ }
29
+
30
+ /**
31
+ * Passthrough PUT
32
+ */
33
+ export async function passthroughPatchPassthroughRaw(
34
+ client$: UnifiedToCore,
35
+ request: operations.PatchPassthroughRawRequest,
36
+ options?: RequestOptions & {
37
+ acceptHeaderOverride?: PatchPassthroughRawAcceptEnum;
38
+ },
39
+ ): Promise<
40
+ Result<
41
+ operations.PatchPassthroughRawResponse | undefined,
42
+ | SDKError
43
+ | SDKValidationError
44
+ | UnexpectedClientError
45
+ | InvalidRequestError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | ConnectionError
49
+ >
50
+ > {
51
+ const input$ = request;
52
+
53
+ const parsed$ = schemas$.safeParse(
54
+ input$,
55
+ (value$) =>
56
+ operations.PatchPassthroughRawRequest$outboundSchema.parse(value$),
57
+ "Input validation failed",
58
+ );
59
+ if (!parsed$.ok) {
60
+ return parsed$;
61
+ }
62
+ const payload$ = parsed$.value;
63
+ const body$ = payload$.RequestBody;
64
+
65
+ const pathParams$ = {
66
+ connection_id: encodeSimple$("connection_id", payload$.connection_id, {
67
+ explode: false,
68
+ charEncoding: "percent",
69
+ }),
70
+ path: encodeSimple$("path", payload$.path, {
71
+ explode: false,
72
+ charEncoding: "percent",
73
+ }),
74
+ };
75
+
76
+ const path$ = pathToFunc("/passthrough/{connection_id}/{path}")(pathParams$);
77
+
78
+ const headers$ = new Headers({
79
+ "Content-Type": "text/plain",
80
+ Accept: options?.acceptHeaderOverride
81
+ || "application/json;q=1, text/plain;q=0.7, */*;q=0",
82
+ });
83
+
84
+ const security$ = await extractSecurity(client$.options$.security);
85
+ const context = {
86
+ operationID: "patchPassthrough_raw",
87
+ oAuth2Scopes: [],
88
+ securitySource: client$.options$.security,
89
+ };
90
+ const securitySettings$ = resolveGlobalSecurity(security$);
91
+
92
+ const requestRes = client$.createRequest$(context, {
93
+ security: securitySettings$,
94
+ method: "PATCH",
95
+ path: path$,
96
+ headers: headers$,
97
+ body: body$,
98
+ timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
99
+ }, options);
100
+ if (!requestRes.ok) {
101
+ return requestRes;
102
+ }
103
+ const request$ = requestRes.value;
104
+
105
+ const doResult = await client$.do$(request$, {
106
+ context,
107
+ errorCodes: ["4XX", "5XX"],
108
+ retryConfig: options?.retries
109
+ || client$.options$.retryConfig,
110
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
111
+ });
112
+ if (!doResult.ok) {
113
+ return doResult;
114
+ }
115
+ const response = doResult.value;
116
+
117
+ const responseFields$ = {
118
+ HttpMeta: { Response: response, Request: request$ },
119
+ };
120
+
121
+ const [result$] = await m$.match<
122
+ operations.PatchPassthroughRawResponse | undefined,
123
+ | SDKError
124
+ | SDKValidationError
125
+ | UnexpectedClientError
126
+ | InvalidRequestError
127
+ | RequestAbortedError
128
+ | RequestTimeoutError
129
+ | ConnectionError
130
+ >(
131
+ m$.nil(
132
+ [204, 205, 304],
133
+ operations.PatchPassthroughRawResponse$inboundSchema.optional(),
134
+ { hdrs: true },
135
+ ),
136
+ m$.bytes(
137
+ "2XX",
138
+ operations.PatchPassthroughRawResponse$inboundSchema.optional(),
139
+ { ctype: "*/*", key: "Result" },
140
+ ),
141
+ m$.json(
142
+ "2XX",
143
+ operations.PatchPassthroughRawResponse$inboundSchema.optional(),
144
+ { key: "Result" },
145
+ ),
146
+ m$.text(
147
+ "2XX",
148
+ operations.PatchPassthroughRawResponse$inboundSchema.optional(),
149
+ { key: "Result" },
150
+ ),
151
+ m$.fail(["4XX", "5XX"]),
152
+ )(response, { extraFields: responseFields$ });
153
+ if (!result$.ok) {
154
+ return result$;
155
+ }
156
+
157
+ return result$;
158
+ }
@@ -2,7 +2,6 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import * as z from "zod";
6
5
  import { UnifiedToCore } from "../core.js";
7
6
  import { encodeSimple as encodeSimple$ } from "../lib/encodings.js";
8
7
  import * as m$ from "../lib/matchers.js";
@@ -22,16 +21,24 @@ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
22
21
  import * as operations from "../sdk/models/operations/index.js";
23
22
  import { Result } from "../sdk/types/fp.js";
24
23
 
24
+ export enum RemovePassthroughAcceptEnum {
25
+ applicationJson = "application/json",
26
+ textPlain = "text/plain",
27
+ wildcardWildcard = "*/*",
28
+ }
29
+
25
30
  /**
26
31
  * Passthrough DELETE
27
32
  */
28
33
  export async function passthroughRemovePassthrough(
29
34
  client$: UnifiedToCore,
30
35
  request: operations.RemovePassthroughRequest,
31
- options?: RequestOptions,
36
+ options?: RequestOptions & {
37
+ acceptHeaderOverride?: RemovePassthroughAcceptEnum;
38
+ },
32
39
  ): Promise<
33
40
  Result<
34
- { [k: string]: any },
41
+ operations.RemovePassthroughResponse | undefined,
35
42
  | SDKError
36
43
  | SDKValidationError
37
44
  | UnexpectedClientError
@@ -69,7 +76,8 @@ export async function passthroughRemovePassthrough(
69
76
  const path$ = pathToFunc("/passthrough/{connection_id}/{path}")(pathParams$);
70
77
 
71
78
  const headers$ = new Headers({
72
- Accept: "application/json",
79
+ Accept: options?.acceptHeaderOverride
80
+ || "application/json;q=1, text/plain;q=0.7, */*;q=0",
73
81
  });
74
82
 
75
83
  const security$ = await extractSecurity(client$.options$.security);
@@ -105,8 +113,12 @@ export async function passthroughRemovePassthrough(
105
113
  }
106
114
  const response = doResult.value;
107
115
 
116
+ const responseFields$ = {
117
+ HttpMeta: { Response: response, Request: request$ },
118
+ };
119
+
108
120
  const [result$] = await m$.match<
109
- { [k: string]: any },
121
+ operations.RemovePassthroughResponse | undefined,
110
122
  | SDKError
111
123
  | SDKValidationError
112
124
  | UnexpectedClientError
@@ -115,9 +127,28 @@ export async function passthroughRemovePassthrough(
115
127
  | RequestTimeoutError
116
128
  | ConnectionError
117
129
  >(
118
- m$.json("2XX", z.record(z.any())),
130
+ m$.nil(
131
+ [204, 205, 304],
132
+ operations.RemovePassthroughResponse$inboundSchema.optional(),
133
+ { hdrs: true },
134
+ ),
135
+ m$.bytes(
136
+ "2XX",
137
+ operations.RemovePassthroughResponse$inboundSchema.optional(),
138
+ { ctype: "*/*", key: "Result" },
139
+ ),
140
+ m$.json(
141
+ "2XX",
142
+ operations.RemovePassthroughResponse$inboundSchema.optional(),
143
+ { key: "Result" },
144
+ ),
145
+ m$.text(
146
+ "2XX",
147
+ operations.RemovePassthroughResponse$inboundSchema.optional(),
148
+ { key: "Result" },
149
+ ),
119
150
  m$.fail(["4XX", "5XX"]),
120
- )(response);
151
+ )(response, { extraFields: responseFields$ });
121
152
  if (!result$.ok) {
122
153
  return result$;
123
154
  }
@@ -2,7 +2,6 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import * as z from "zod";
6
5
  import { UnifiedToCore } from "../core.js";
7
6
  import {
8
7
  encodeJSON as encodeJSON$,
@@ -25,16 +24,24 @@ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
25
24
  import * as operations from "../sdk/models/operations/index.js";
26
25
  import { Result } from "../sdk/types/fp.js";
27
26
 
27
+ export enum UpdatePassthroughJsonAcceptEnum {
28
+ applicationJson = "application/json",
29
+ textPlain = "text/plain",
30
+ wildcardWildcard = "*/*",
31
+ }
32
+
28
33
  /**
29
34
  * Passthrough PUT
30
35
  */
31
- export async function passthroughUpdatePassthrough(
36
+ export async function passthroughUpdatePassthroughJson(
32
37
  client$: UnifiedToCore,
33
- request: operations.UpdatePassthroughRequest,
34
- options?: RequestOptions,
38
+ request: operations.UpdatePassthroughJsonRequest,
39
+ options?: RequestOptions & {
40
+ acceptHeaderOverride?: UpdatePassthroughJsonAcceptEnum;
41
+ },
35
42
  ): Promise<
36
43
  Result<
37
- { [k: string]: any },
44
+ operations.UpdatePassthroughJsonResponse | undefined,
38
45
  | SDKError
39
46
  | SDKValidationError
40
47
  | UnexpectedClientError
@@ -49,7 +56,7 @@ export async function passthroughUpdatePassthrough(
49
56
  const parsed$ = schemas$.safeParse(
50
57
  input$,
51
58
  (value$) =>
52
- operations.UpdatePassthroughRequest$outboundSchema.parse(value$),
59
+ operations.UpdatePassthroughJsonRequest$outboundSchema.parse(value$),
53
60
  "Input validation failed",
54
61
  );
55
62
  if (!parsed$.ok) {
@@ -73,12 +80,13 @@ export async function passthroughUpdatePassthrough(
73
80
 
74
81
  const headers$ = new Headers({
75
82
  "Content-Type": "application/json",
76
- Accept: "application/json",
83
+ Accept: options?.acceptHeaderOverride
84
+ || "application/json;q=1, text/plain;q=0.7, */*;q=0",
77
85
  });
78
86
 
79
87
  const security$ = await extractSecurity(client$.options$.security);
80
88
  const context = {
81
- operationID: "updatePassthrough",
89
+ operationID: "updatePassthrough_json",
82
90
  oAuth2Scopes: [],
83
91
  securitySource: client$.options$.security,
84
92
  };
@@ -109,8 +117,12 @@ export async function passthroughUpdatePassthrough(
109
117
  }
110
118
  const response = doResult.value;
111
119
 
120
+ const responseFields$ = {
121
+ HttpMeta: { Response: response, Request: request$ },
122
+ };
123
+
112
124
  const [result$] = await m$.match<
113
- { [k: string]: any },
125
+ operations.UpdatePassthroughJsonResponse | undefined,
114
126
  | SDKError
115
127
  | SDKValidationError
116
128
  | UnexpectedClientError
@@ -119,9 +131,28 @@ export async function passthroughUpdatePassthrough(
119
131
  | RequestTimeoutError
120
132
  | ConnectionError
121
133
  >(
122
- m$.json("2XX", z.record(z.any())),
134
+ m$.nil(
135
+ [204, 205, 304],
136
+ operations.UpdatePassthroughJsonResponse$inboundSchema.optional(),
137
+ { hdrs: true },
138
+ ),
139
+ m$.bytes(
140
+ "2XX",
141
+ operations.UpdatePassthroughJsonResponse$inboundSchema.optional(),
142
+ { ctype: "*/*", key: "Result" },
143
+ ),
144
+ m$.json(
145
+ "2XX",
146
+ operations.UpdatePassthroughJsonResponse$inboundSchema.optional(),
147
+ { key: "Result" },
148
+ ),
149
+ m$.text(
150
+ "2XX",
151
+ operations.UpdatePassthroughJsonResponse$inboundSchema.optional(),
152
+ { key: "Result" },
153
+ ),
123
154
  m$.fail(["4XX", "5XX"]),
124
- )(response);
155
+ )(response, { extraFields: responseFields$ });
125
156
  if (!result$.ok) {
126
157
  return result$;
127
158
  }
@@ -0,0 +1,158 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { UnifiedToCore } from "../core.js";
6
+ import { encodeSimple as encodeSimple$ } from "../lib/encodings.js";
7
+ import * as m$ from "../lib/matchers.js";
8
+ import * as schemas$ from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/errors/httpclienterrors.js";
19
+ import { SDKError } from "../sdk/models/errors/sdkerror.js";
20
+ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../sdk/models/operations/index.js";
22
+ import { Result } from "../sdk/types/fp.js";
23
+
24
+ export enum UpdatePassthroughRawAcceptEnum {
25
+ applicationJson = "application/json",
26
+ textPlain = "text/plain",
27
+ wildcardWildcard = "*/*",
28
+ }
29
+
30
+ /**
31
+ * Passthrough PUT
32
+ */
33
+ export async function passthroughUpdatePassthroughRaw(
34
+ client$: UnifiedToCore,
35
+ request: operations.UpdatePassthroughRawRequest,
36
+ options?: RequestOptions & {
37
+ acceptHeaderOverride?: UpdatePassthroughRawAcceptEnum;
38
+ },
39
+ ): Promise<
40
+ Result<
41
+ operations.UpdatePassthroughRawResponse | undefined,
42
+ | SDKError
43
+ | SDKValidationError
44
+ | UnexpectedClientError
45
+ | InvalidRequestError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | ConnectionError
49
+ >
50
+ > {
51
+ const input$ = request;
52
+
53
+ const parsed$ = schemas$.safeParse(
54
+ input$,
55
+ (value$) =>
56
+ operations.UpdatePassthroughRawRequest$outboundSchema.parse(value$),
57
+ "Input validation failed",
58
+ );
59
+ if (!parsed$.ok) {
60
+ return parsed$;
61
+ }
62
+ const payload$ = parsed$.value;
63
+ const body$ = payload$.RequestBody;
64
+
65
+ const pathParams$ = {
66
+ connection_id: encodeSimple$("connection_id", payload$.connection_id, {
67
+ explode: false,
68
+ charEncoding: "percent",
69
+ }),
70
+ path: encodeSimple$("path", payload$.path, {
71
+ explode: false,
72
+ charEncoding: "percent",
73
+ }),
74
+ };
75
+
76
+ const path$ = pathToFunc("/passthrough/{connection_id}/{path}")(pathParams$);
77
+
78
+ const headers$ = new Headers({
79
+ "Content-Type": "text/plain",
80
+ Accept: options?.acceptHeaderOverride
81
+ || "application/json;q=1, text/plain;q=0.7, */*;q=0",
82
+ });
83
+
84
+ const security$ = await extractSecurity(client$.options$.security);
85
+ const context = {
86
+ operationID: "updatePassthrough_raw",
87
+ oAuth2Scopes: [],
88
+ securitySource: client$.options$.security,
89
+ };
90
+ const securitySettings$ = resolveGlobalSecurity(security$);
91
+
92
+ const requestRes = client$.createRequest$(context, {
93
+ security: securitySettings$,
94
+ method: "PUT",
95
+ path: path$,
96
+ headers: headers$,
97
+ body: body$,
98
+ timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
99
+ }, options);
100
+ if (!requestRes.ok) {
101
+ return requestRes;
102
+ }
103
+ const request$ = requestRes.value;
104
+
105
+ const doResult = await client$.do$(request$, {
106
+ context,
107
+ errorCodes: ["4XX", "5XX"],
108
+ retryConfig: options?.retries
109
+ || client$.options$.retryConfig,
110
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
111
+ });
112
+ if (!doResult.ok) {
113
+ return doResult;
114
+ }
115
+ const response = doResult.value;
116
+
117
+ const responseFields$ = {
118
+ HttpMeta: { Response: response, Request: request$ },
119
+ };
120
+
121
+ const [result$] = await m$.match<
122
+ operations.UpdatePassthroughRawResponse | undefined,
123
+ | SDKError
124
+ | SDKValidationError
125
+ | UnexpectedClientError
126
+ | InvalidRequestError
127
+ | RequestAbortedError
128
+ | RequestTimeoutError
129
+ | ConnectionError
130
+ >(
131
+ m$.nil(
132
+ [204, 205, 304],
133
+ operations.UpdatePassthroughRawResponse$inboundSchema.optional(),
134
+ { hdrs: true },
135
+ ),
136
+ m$.bytes(
137
+ "2XX",
138
+ operations.UpdatePassthroughRawResponse$inboundSchema.optional(),
139
+ { ctype: "*/*", key: "Result" },
140
+ ),
141
+ m$.json(
142
+ "2XX",
143
+ operations.UpdatePassthroughRawResponse$inboundSchema.optional(),
144
+ { key: "Result" },
145
+ ),
146
+ m$.text(
147
+ "2XX",
148
+ operations.UpdatePassthroughRawResponse$inboundSchema.optional(),
149
+ { key: "Result" },
150
+ ),
151
+ m$.fail(["4XX", "5XX"]),
152
+ )(response, { extraFields: responseFields$ });
153
+ if (!result$.ok) {
154
+ return result$;
155
+ }
156
+
157
+ return result$;
158
+ }
@@ -47,7 +47,7 @@ export async function unifiedCreateUnifiedWebhook(
47
47
  | ConnectionError
48
48
  >
49
49
  > {
50
- const input$ = typeof request === "undefined" ? {} : request;
50
+ const input$ = request;
51
51
 
52
52
  const parsed$ = schemas$.safeParse(
53
53
  input$,
@@ -42,7 +42,7 @@ export async function unifiedListUnifiedApicalls(
42
42
  | ConnectionError
43
43
  >
44
44
  > {
45
- const input$ = typeof request === "undefined" ? {} : request;
45
+ const input$ = request;
46
46
 
47
47
  const parsed$ = schemas$.safeParse(
48
48
  input$,
@@ -42,7 +42,7 @@ export async function unifiedListUnifiedConnections(
42
42
  | ConnectionError
43
43
  >
44
44
  > {
45
- const input$ = typeof request === "undefined" ? {} : request;
45
+ const input$ = request;
46
46
 
47
47
  const parsed$ = schemas$.safeParse(
48
48
  input$,
@@ -42,7 +42,7 @@ export async function unifiedListUnifiedIntegrations(
42
42
  | ConnectionError
43
43
  >
44
44
  > {
45
- const input$ = typeof request === "undefined" ? {} : request;
45
+ const input$ = request;
46
46
 
47
47
  const parsed$ = schemas$.safeParse(
48
48
  input$,
@@ -42,7 +42,7 @@ export async function unifiedListUnifiedIssues(
42
42
  | ConnectionError
43
43
  >
44
44
  > {
45
- const input$ = typeof request === "undefined" ? {} : request;
45
+ const input$ = request;
46
46
 
47
47
  const parsed$ = schemas$.safeParse(
48
48
  input$,
@@ -42,7 +42,7 @@ export async function unifiedListUnifiedWebhooks(
42
42
  | ConnectionError
43
43
  >
44
44
  > {
45
- const input$ = typeof request === "undefined" ? {} : request;
45
+ const input$ = request;
46
46
 
47
47
  const parsed$ = schemas$.safeParse(
48
48
  input$,
@@ -47,7 +47,7 @@ export async function webhookCreateUnifiedWebhook(
47
47
  | ConnectionError
48
48
  >
49
49
  > {
50
- const input$ = typeof request === "undefined" ? {} : request;
50
+ const input$ = request;
51
51
 
52
52
  const parsed$ = schemas$.safeParse(
53
53
  input$,
@@ -42,7 +42,7 @@ export async function webhookListUnifiedWebhooks(
42
42
  | ConnectionError
43
43
  >
44
44
  > {
45
- const input$ = typeof request === "undefined" ? {} : request;
45
+ const input$ = request;
46
46
 
47
47
  const parsed$ = schemas$.safeParse(
48
48
  input$,