@apideck/unify 0.37.1 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -3
- package/examples/package-lock.json +3 -3
- package/funcs/proxyDelete.d.ts +30 -0
- package/funcs/proxyDelete.d.ts.map +1 -0
- package/funcs/proxyDelete.js +175 -0
- package/funcs/proxyDelete.js.map +1 -0
- package/funcs/proxyGet.d.ts +30 -0
- package/funcs/proxyGet.d.ts.map +1 -0
- package/funcs/proxyGet.js +175 -0
- package/funcs/proxyGet.js.map +1 -0
- package/funcs/proxyOptions.d.ts +30 -0
- package/funcs/proxyOptions.d.ts.map +1 -0
- package/funcs/proxyOptions.js +175 -0
- package/funcs/proxyOptions.js.map +1 -0
- package/funcs/proxyPatch.d.ts +30 -0
- package/funcs/proxyPatch.d.ts.map +1 -0
- package/funcs/proxyPatch.js +176 -0
- package/funcs/proxyPatch.js.map +1 -0
- package/funcs/proxyPost.d.ts +30 -0
- package/funcs/proxyPost.d.ts.map +1 -0
- package/funcs/proxyPost.js +176 -0
- package/funcs/proxyPost.js.map +1 -0
- package/funcs/proxyPut.d.ts +30 -0
- package/funcs/proxyPut.d.ts.map +1 -0
- package/funcs/proxyPut.js +176 -0
- package/funcs/proxyPut.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/ecommercecustomersfilter.d.ts +15 -0
- package/models/components/ecommercecustomersfilter.d.ts.map +1 -1
- package/models/components/ecommercecustomersfilter.js +6 -0
- package/models/components/ecommercecustomersfilter.js.map +1 -1
- package/models/components/project.d.ts +11 -2
- package/models/components/project.d.ts.map +1 -1
- package/models/components/project.js +4 -0
- package/models/components/project.js.map +1 -1
- package/models/components/projectsfilter.d.ts +3 -0
- package/models/components/projectsfilter.d.ts.map +1 -1
- package/models/components/projectsfilter.js +3 -0
- package/models/components/projectsfilter.js.map +1 -1
- package/models/errors/badrequestresponse.d.ts +25 -0
- package/models/errors/badrequestresponse.d.ts.map +1 -1
- package/models/errors/badrequestresponse.js +16 -1
- package/models/errors/badrequestresponse.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/unauthorized.d.ts +142 -0
- package/models/errors/unauthorized.d.ts.map +1 -0
- package/models/errors/unauthorized.js +139 -0
- package/models/errors/unauthorized.js.map +1 -0
- package/models/operations/index.d.ts +6 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +6 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/proxydeleteproxy.d.ts +103 -0
- package/models/operations/proxydeleteproxy.d.ts.map +1 -0
- package/models/operations/proxydeleteproxy.js +80 -0
- package/models/operations/proxydeleteproxy.js.map +1 -0
- package/models/operations/proxygetproxy.d.ts +103 -0
- package/models/operations/proxygetproxy.d.ts.map +1 -0
- package/models/operations/proxygetproxy.js +80 -0
- package/models/operations/proxygetproxy.js.map +1 -0
- package/models/operations/proxyoptionsproxy.d.ts +103 -0
- package/models/operations/proxyoptionsproxy.d.ts.map +1 -0
- package/models/operations/proxyoptionsproxy.js +80 -0
- package/models/operations/proxyoptionsproxy.js.map +1 -0
- package/models/operations/proxypatchproxy.d.ts +120 -0
- package/models/operations/proxypatchproxy.d.ts.map +1 -0
- package/models/operations/proxypatchproxy.js +102 -0
- package/models/operations/proxypatchproxy.js.map +1 -0
- package/models/operations/proxypostproxy.d.ts +120 -0
- package/models/operations/proxypostproxy.d.ts.map +1 -0
- package/models/operations/proxypostproxy.js +103 -0
- package/models/operations/proxypostproxy.js.map +1 -0
- package/models/operations/proxyputproxy.d.ts +120 -0
- package/models/operations/proxyputproxy.d.ts.map +1 -0
- package/models/operations/proxyputproxy.js +102 -0
- package/models/operations/proxyputproxy.js.map +1 -0
- package/package.json +3 -3
- package/sdk/proxy.d.ts +77 -0
- package/sdk/proxy.d.ts.map +1 -0
- package/sdk/proxy.js +90 -0
- package/sdk/proxy.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/__tests__/projects.test.ts +3 -0
- package/src/__tests__/proxy.test.ts +41 -0
- package/src/funcs/proxyDelete.ts +258 -0
- package/src/funcs/proxyGet.ts +258 -0
- package/src/funcs/proxyOptions.ts +258 -0
- package/src/funcs/proxyPatch.ts +259 -0
- package/src/funcs/proxyPost.ts +259 -0
- package/src/funcs/proxyPut.ts +259 -0
- package/src/lib/config.ts +4 -4
- package/src/models/components/ecommercecustomersfilter.ts +21 -0
- package/src/models/components/project.ts +17 -2
- package/src/models/components/projectsfilter.ts +3 -0
- package/src/models/errors/badrequestresponse.ts +51 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/unauthorized.ts +282 -0
- package/src/models/operations/index.ts +6 -0
- package/src/models/operations/proxydeleteproxy.ts +158 -0
- package/src/models/operations/proxygetproxy.ts +158 -0
- package/src/models/operations/proxyoptionsproxy.ts +158 -0
- package/src/models/operations/proxypatchproxy.ts +227 -0
- package/src/models/operations/proxypostproxy.ts +212 -0
- package/src/models/operations/proxyputproxy.ts +215 -0
- package/src/sdk/proxy.ts +135 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/types/smartUnion.ts +8 -0
- package/types/smartUnion.js +7 -0
- package/types/smartUnion.js.map +1 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export type ProxyOptionsProxyGlobals = {
|
|
14
|
+
/**
|
|
15
|
+
* ID of the consumer which you want to get or push data from
|
|
16
|
+
*/
|
|
17
|
+
consumerId?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of your Unify application
|
|
20
|
+
*/
|
|
21
|
+
appId?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type ProxyOptionsProxyRequest = {
|
|
25
|
+
/**
|
|
26
|
+
* ID of the consumer which you want to get or push data from
|
|
27
|
+
*/
|
|
28
|
+
consumerId?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The ID of your Unify application
|
|
31
|
+
*/
|
|
32
|
+
appId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.
|
|
35
|
+
*/
|
|
36
|
+
serviceId: string;
|
|
37
|
+
/**
|
|
38
|
+
* Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used.
|
|
39
|
+
*/
|
|
40
|
+
unifiedApi?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Downstream URL
|
|
43
|
+
*/
|
|
44
|
+
downstreamUrl: string;
|
|
45
|
+
/**
|
|
46
|
+
* Downstream authorization header. This will skip the Vault token injection.
|
|
47
|
+
*/
|
|
48
|
+
downstreamAuthorization?: string | undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type ProxyOptionsProxyResponse = {
|
|
52
|
+
httpMeta: components.HTTPMetadata;
|
|
53
|
+
/**
|
|
54
|
+
* Ok
|
|
55
|
+
*/
|
|
56
|
+
responseJson?: { [k: string]: any } | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Ok
|
|
59
|
+
*/
|
|
60
|
+
responseBinary?: ReadableStream<Uint8Array> | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Ok
|
|
63
|
+
*/
|
|
64
|
+
responsePdf?: ReadableStream<Uint8Array> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Ok
|
|
67
|
+
*/
|
|
68
|
+
responseXml?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Ok
|
|
71
|
+
*/
|
|
72
|
+
responseCsv?: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Ok
|
|
75
|
+
*/
|
|
76
|
+
responseText?: string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Proxy error
|
|
79
|
+
*/
|
|
80
|
+
errorJson?: { [k: string]: any } | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Proxy error
|
|
83
|
+
*/
|
|
84
|
+
errorXml?: string | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Proxy error
|
|
87
|
+
*/
|
|
88
|
+
errorHtml?: string | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Proxy error
|
|
91
|
+
*/
|
|
92
|
+
errorText?: string | undefined;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export type ProxyOptionsProxyRequest$Outbound = {
|
|
97
|
+
consumerId?: string | undefined;
|
|
98
|
+
appId?: string | undefined;
|
|
99
|
+
serviceId: string;
|
|
100
|
+
unifiedApi?: string | undefined;
|
|
101
|
+
downstreamUrl: string;
|
|
102
|
+
downstreamAuthorization?: string | undefined;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const ProxyOptionsProxyRequest$outboundSchema: z.ZodType<
|
|
107
|
+
ProxyOptionsProxyRequest$Outbound,
|
|
108
|
+
z.ZodTypeDef,
|
|
109
|
+
ProxyOptionsProxyRequest
|
|
110
|
+
> = z.object({
|
|
111
|
+
consumerId: z.string().optional(),
|
|
112
|
+
appId: z.string().optional(),
|
|
113
|
+
serviceId: z.string(),
|
|
114
|
+
unifiedApi: z.string().optional(),
|
|
115
|
+
downstreamUrl: z.string(),
|
|
116
|
+
downstreamAuthorization: z.string().optional(),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export function proxyOptionsProxyRequestToJSON(
|
|
120
|
+
proxyOptionsProxyRequest: ProxyOptionsProxyRequest,
|
|
121
|
+
): string {
|
|
122
|
+
return JSON.stringify(
|
|
123
|
+
ProxyOptionsProxyRequest$outboundSchema.parse(proxyOptionsProxyRequest),
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** @internal */
|
|
128
|
+
export const ProxyOptionsProxyResponse$inboundSchema: z.ZodType<
|
|
129
|
+
ProxyOptionsProxyResponse,
|
|
130
|
+
z.ZodTypeDef,
|
|
131
|
+
unknown
|
|
132
|
+
> = z.object({
|
|
133
|
+
HttpMeta: components.HTTPMetadata$inboundSchema,
|
|
134
|
+
responseJson: types.optional(z.record(z.any())),
|
|
135
|
+
responseBinary: types.optional(z.instanceof(ReadableStream<Uint8Array>)),
|
|
136
|
+
responsePdf: types.optional(z.instanceof(ReadableStream<Uint8Array>)),
|
|
137
|
+
responseXml: types.optional(types.string()),
|
|
138
|
+
responseCsv: types.optional(types.string()),
|
|
139
|
+
responseText: types.optional(types.string()),
|
|
140
|
+
errorJson: types.optional(z.record(z.any())),
|
|
141
|
+
errorXml: types.optional(types.string()),
|
|
142
|
+
errorHtml: types.optional(types.string()),
|
|
143
|
+
errorText: types.optional(types.string()),
|
|
144
|
+
}).transform((v) => {
|
|
145
|
+
return remap$(v, {
|
|
146
|
+
"HttpMeta": "httpMeta",
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export function proxyOptionsProxyResponseFromJSON(
|
|
151
|
+
jsonString: string,
|
|
152
|
+
): SafeParseResult<ProxyOptionsProxyResponse, SDKValidationError> {
|
|
153
|
+
return safeParse(
|
|
154
|
+
jsonString,
|
|
155
|
+
(x) => ProxyOptionsProxyResponse$inboundSchema.parse(JSON.parse(x)),
|
|
156
|
+
`Failed to parse 'ProxyOptionsProxyResponse' from JSON`,
|
|
157
|
+
);
|
|
158
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export type ProxyPatchProxyGlobals = {
|
|
14
|
+
/**
|
|
15
|
+
* ID of the consumer which you want to get or push data from
|
|
16
|
+
*/
|
|
17
|
+
consumerId?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of your Unify application
|
|
20
|
+
*/
|
|
21
|
+
appId?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type ProxyPatchProxyRequestBody3 = {};
|
|
25
|
+
|
|
26
|
+
export type ProxyPatchProxyRequestBody1 = {};
|
|
27
|
+
|
|
28
|
+
export type ProxyPatchProxyRequest = {
|
|
29
|
+
/**
|
|
30
|
+
* ID of the consumer which you want to get or push data from
|
|
31
|
+
*/
|
|
32
|
+
consumerId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The ID of your Unify application
|
|
35
|
+
*/
|
|
36
|
+
appId?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.
|
|
39
|
+
*/
|
|
40
|
+
serviceId: string;
|
|
41
|
+
/**
|
|
42
|
+
* Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used.
|
|
43
|
+
*/
|
|
44
|
+
unifiedApi?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Downstream URL
|
|
47
|
+
*/
|
|
48
|
+
downstreamUrl: string;
|
|
49
|
+
/**
|
|
50
|
+
* Downstream authorization header. This will skip the Vault token injection.
|
|
51
|
+
*/
|
|
52
|
+
downstreamAuthorization?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Depending on the verb/method of the request this will contain the request body you want to POST/PATCH/PUT.
|
|
55
|
+
*/
|
|
56
|
+
requestBody?:
|
|
57
|
+
| ReadableStream<Uint8Array>
|
|
58
|
+
| Blob
|
|
59
|
+
| ArrayBuffer
|
|
60
|
+
| Uint8Array
|
|
61
|
+
| undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type ProxyPatchProxyResponse = {
|
|
65
|
+
httpMeta: components.HTTPMetadata;
|
|
66
|
+
/**
|
|
67
|
+
* Ok
|
|
68
|
+
*/
|
|
69
|
+
responseJson?: { [k: string]: any } | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Ok
|
|
72
|
+
*/
|
|
73
|
+
responseBinary?: ReadableStream<Uint8Array> | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Ok
|
|
76
|
+
*/
|
|
77
|
+
responsePdf?: ReadableStream<Uint8Array> | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Ok
|
|
80
|
+
*/
|
|
81
|
+
responseXml?: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Ok
|
|
84
|
+
*/
|
|
85
|
+
responseCsv?: string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Ok
|
|
88
|
+
*/
|
|
89
|
+
responseText?: string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Proxy error
|
|
92
|
+
*/
|
|
93
|
+
errorJson?: { [k: string]: any } | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Proxy error
|
|
96
|
+
*/
|
|
97
|
+
errorXml?: string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Proxy error
|
|
100
|
+
*/
|
|
101
|
+
errorHtml?: string | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Proxy error
|
|
104
|
+
*/
|
|
105
|
+
errorText?: string | undefined;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export type ProxyPatchProxyRequestBody3$Outbound = {};
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const ProxyPatchProxyRequestBody3$outboundSchema: z.ZodType<
|
|
113
|
+
ProxyPatchProxyRequestBody3$Outbound,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
ProxyPatchProxyRequestBody3
|
|
116
|
+
> = z.object({});
|
|
117
|
+
|
|
118
|
+
export function proxyPatchProxyRequestBody3ToJSON(
|
|
119
|
+
proxyPatchProxyRequestBody3: ProxyPatchProxyRequestBody3,
|
|
120
|
+
): string {
|
|
121
|
+
return JSON.stringify(
|
|
122
|
+
ProxyPatchProxyRequestBody3$outboundSchema.parse(
|
|
123
|
+
proxyPatchProxyRequestBody3,
|
|
124
|
+
),
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** @internal */
|
|
129
|
+
export type ProxyPatchProxyRequestBody1$Outbound = {};
|
|
130
|
+
|
|
131
|
+
/** @internal */
|
|
132
|
+
export const ProxyPatchProxyRequestBody1$outboundSchema: z.ZodType<
|
|
133
|
+
ProxyPatchProxyRequestBody1$Outbound,
|
|
134
|
+
z.ZodTypeDef,
|
|
135
|
+
ProxyPatchProxyRequestBody1
|
|
136
|
+
> = z.object({});
|
|
137
|
+
|
|
138
|
+
export function proxyPatchProxyRequestBody1ToJSON(
|
|
139
|
+
proxyPatchProxyRequestBody1: ProxyPatchProxyRequestBody1,
|
|
140
|
+
): string {
|
|
141
|
+
return JSON.stringify(
|
|
142
|
+
ProxyPatchProxyRequestBody1$outboundSchema.parse(
|
|
143
|
+
proxyPatchProxyRequestBody1,
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** @internal */
|
|
149
|
+
export type ProxyPatchProxyRequest$Outbound = {
|
|
150
|
+
consumerId?: string | undefined;
|
|
151
|
+
appId?: string | undefined;
|
|
152
|
+
serviceId: string;
|
|
153
|
+
unifiedApi?: string | undefined;
|
|
154
|
+
downstreamUrl: string;
|
|
155
|
+
downstreamAuthorization?: string | undefined;
|
|
156
|
+
RequestBody?:
|
|
157
|
+
| ReadableStream<Uint8Array>
|
|
158
|
+
| Blob
|
|
159
|
+
| ArrayBuffer
|
|
160
|
+
| Uint8Array
|
|
161
|
+
| undefined;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/** @internal */
|
|
165
|
+
export const ProxyPatchProxyRequest$outboundSchema: z.ZodType<
|
|
166
|
+
ProxyPatchProxyRequest$Outbound,
|
|
167
|
+
z.ZodTypeDef,
|
|
168
|
+
ProxyPatchProxyRequest
|
|
169
|
+
> = z.object({
|
|
170
|
+
consumerId: z.string().optional(),
|
|
171
|
+
appId: z.string().optional(),
|
|
172
|
+
serviceId: z.string(),
|
|
173
|
+
unifiedApi: z.string().optional(),
|
|
174
|
+
downstreamUrl: z.string(),
|
|
175
|
+
downstreamAuthorization: z.string().optional(),
|
|
176
|
+
requestBody: z.union([
|
|
177
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
178
|
+
z.instanceof(Blob),
|
|
179
|
+
z.instanceof(ArrayBuffer),
|
|
180
|
+
z.instanceof(Uint8Array),
|
|
181
|
+
]).optional(),
|
|
182
|
+
}).transform((v) => {
|
|
183
|
+
return remap$(v, {
|
|
184
|
+
requestBody: "RequestBody",
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export function proxyPatchProxyRequestToJSON(
|
|
189
|
+
proxyPatchProxyRequest: ProxyPatchProxyRequest,
|
|
190
|
+
): string {
|
|
191
|
+
return JSON.stringify(
|
|
192
|
+
ProxyPatchProxyRequest$outboundSchema.parse(proxyPatchProxyRequest),
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** @internal */
|
|
197
|
+
export const ProxyPatchProxyResponse$inboundSchema: z.ZodType<
|
|
198
|
+
ProxyPatchProxyResponse,
|
|
199
|
+
z.ZodTypeDef,
|
|
200
|
+
unknown
|
|
201
|
+
> = z.object({
|
|
202
|
+
HttpMeta: components.HTTPMetadata$inboundSchema,
|
|
203
|
+
responseJson: types.optional(z.record(z.any())),
|
|
204
|
+
responseBinary: types.optional(z.instanceof(ReadableStream<Uint8Array>)),
|
|
205
|
+
responsePdf: types.optional(z.instanceof(ReadableStream<Uint8Array>)),
|
|
206
|
+
responseXml: types.optional(types.string()),
|
|
207
|
+
responseCsv: types.optional(types.string()),
|
|
208
|
+
responseText: types.optional(types.string()),
|
|
209
|
+
errorJson: types.optional(z.record(z.any())),
|
|
210
|
+
errorXml: types.optional(types.string()),
|
|
211
|
+
errorHtml: types.optional(types.string()),
|
|
212
|
+
errorText: types.optional(types.string()),
|
|
213
|
+
}).transform((v) => {
|
|
214
|
+
return remap$(v, {
|
|
215
|
+
"HttpMeta": "httpMeta",
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export function proxyPatchProxyResponseFromJSON(
|
|
220
|
+
jsonString: string,
|
|
221
|
+
): SafeParseResult<ProxyPatchProxyResponse, SDKValidationError> {
|
|
222
|
+
return safeParse(
|
|
223
|
+
jsonString,
|
|
224
|
+
(x) => ProxyPatchProxyResponse$inboundSchema.parse(JSON.parse(x)),
|
|
225
|
+
`Failed to parse 'ProxyPatchProxyResponse' from JSON`,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
|
|
13
|
+
export type ProxyPostProxyGlobals = {
|
|
14
|
+
/**
|
|
15
|
+
* ID of the consumer which you want to get or push data from
|
|
16
|
+
*/
|
|
17
|
+
consumerId?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of your Unify application
|
|
20
|
+
*/
|
|
21
|
+
appId?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type Three = {};
|
|
25
|
+
|
|
26
|
+
export type One = {};
|
|
27
|
+
|
|
28
|
+
export type ProxyPostProxyRequest = {
|
|
29
|
+
/**
|
|
30
|
+
* ID of the consumer which you want to get or push data from
|
|
31
|
+
*/
|
|
32
|
+
consumerId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The ID of your Unify application
|
|
35
|
+
*/
|
|
36
|
+
appId?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.
|
|
39
|
+
*/
|
|
40
|
+
serviceId: string;
|
|
41
|
+
/**
|
|
42
|
+
* Specify which unified API to use for the connection lookup. Required for multi-API connectors (e.g., Workday) to ensure the correct credentials are used.
|
|
43
|
+
*/
|
|
44
|
+
unifiedApi?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Downstream URL
|
|
47
|
+
*/
|
|
48
|
+
downstreamUrl: string;
|
|
49
|
+
/**
|
|
50
|
+
* Downstream authorization header. This will skip the Vault token injection.
|
|
51
|
+
*/
|
|
52
|
+
downstreamAuthorization?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Depending on the verb/method of the request this will contain the request body you want to POST/PATCH/PUT.
|
|
55
|
+
*/
|
|
56
|
+
requestBody?:
|
|
57
|
+
| ReadableStream<Uint8Array>
|
|
58
|
+
| Blob
|
|
59
|
+
| ArrayBuffer
|
|
60
|
+
| Uint8Array
|
|
61
|
+
| undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type ProxyPostProxyResponse = {
|
|
65
|
+
httpMeta: components.HTTPMetadata;
|
|
66
|
+
/**
|
|
67
|
+
* Ok
|
|
68
|
+
*/
|
|
69
|
+
responseJson?: { [k: string]: any } | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Ok
|
|
72
|
+
*/
|
|
73
|
+
responseBinary?: ReadableStream<Uint8Array> | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Ok
|
|
76
|
+
*/
|
|
77
|
+
responsePdf?: ReadableStream<Uint8Array> | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Ok
|
|
80
|
+
*/
|
|
81
|
+
responseXml?: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Ok
|
|
84
|
+
*/
|
|
85
|
+
responseCsv?: string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Ok
|
|
88
|
+
*/
|
|
89
|
+
responseText?: string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Proxy error
|
|
92
|
+
*/
|
|
93
|
+
errorJson?: { [k: string]: any } | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Proxy error
|
|
96
|
+
*/
|
|
97
|
+
errorXml?: string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Proxy error
|
|
100
|
+
*/
|
|
101
|
+
errorHtml?: string | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Proxy error
|
|
104
|
+
*/
|
|
105
|
+
errorText?: string | undefined;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export type Three$Outbound = {};
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const Three$outboundSchema: z.ZodType<
|
|
113
|
+
Three$Outbound,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
Three
|
|
116
|
+
> = z.object({});
|
|
117
|
+
|
|
118
|
+
export function threeToJSON(three: Three): string {
|
|
119
|
+
return JSON.stringify(Three$outboundSchema.parse(three));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export type One$Outbound = {};
|
|
124
|
+
|
|
125
|
+
/** @internal */
|
|
126
|
+
export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
|
|
127
|
+
.object({});
|
|
128
|
+
|
|
129
|
+
export function oneToJSON(one: One): string {
|
|
130
|
+
return JSON.stringify(One$outboundSchema.parse(one));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
export type ProxyPostProxyRequest$Outbound = {
|
|
135
|
+
consumerId?: string | undefined;
|
|
136
|
+
appId?: string | undefined;
|
|
137
|
+
serviceId: string;
|
|
138
|
+
unifiedApi?: string | undefined;
|
|
139
|
+
downstreamUrl: string;
|
|
140
|
+
downstreamAuthorization?: string | undefined;
|
|
141
|
+
RequestBody?:
|
|
142
|
+
| ReadableStream<Uint8Array>
|
|
143
|
+
| Blob
|
|
144
|
+
| ArrayBuffer
|
|
145
|
+
| Uint8Array
|
|
146
|
+
| undefined;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/** @internal */
|
|
150
|
+
export const ProxyPostProxyRequest$outboundSchema: z.ZodType<
|
|
151
|
+
ProxyPostProxyRequest$Outbound,
|
|
152
|
+
z.ZodTypeDef,
|
|
153
|
+
ProxyPostProxyRequest
|
|
154
|
+
> = z.object({
|
|
155
|
+
consumerId: z.string().optional(),
|
|
156
|
+
appId: z.string().optional(),
|
|
157
|
+
serviceId: z.string(),
|
|
158
|
+
unifiedApi: z.string().optional(),
|
|
159
|
+
downstreamUrl: z.string(),
|
|
160
|
+
downstreamAuthorization: z.string().optional(),
|
|
161
|
+
requestBody: z.union([
|
|
162
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
163
|
+
z.instanceof(Blob),
|
|
164
|
+
z.instanceof(ArrayBuffer),
|
|
165
|
+
z.instanceof(Uint8Array),
|
|
166
|
+
]).optional(),
|
|
167
|
+
}).transform((v) => {
|
|
168
|
+
return remap$(v, {
|
|
169
|
+
requestBody: "RequestBody",
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
export function proxyPostProxyRequestToJSON(
|
|
174
|
+
proxyPostProxyRequest: ProxyPostProxyRequest,
|
|
175
|
+
): string {
|
|
176
|
+
return JSON.stringify(
|
|
177
|
+
ProxyPostProxyRequest$outboundSchema.parse(proxyPostProxyRequest),
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** @internal */
|
|
182
|
+
export const ProxyPostProxyResponse$inboundSchema: z.ZodType<
|
|
183
|
+
ProxyPostProxyResponse,
|
|
184
|
+
z.ZodTypeDef,
|
|
185
|
+
unknown
|
|
186
|
+
> = z.object({
|
|
187
|
+
HttpMeta: components.HTTPMetadata$inboundSchema,
|
|
188
|
+
responseJson: types.optional(z.record(z.any())),
|
|
189
|
+
responseBinary: types.optional(z.instanceof(ReadableStream<Uint8Array>)),
|
|
190
|
+
responsePdf: types.optional(z.instanceof(ReadableStream<Uint8Array>)),
|
|
191
|
+
responseXml: types.optional(types.string()),
|
|
192
|
+
responseCsv: types.optional(types.string()),
|
|
193
|
+
responseText: types.optional(types.string()),
|
|
194
|
+
errorJson: types.optional(z.record(z.any())),
|
|
195
|
+
errorXml: types.optional(types.string()),
|
|
196
|
+
errorHtml: types.optional(types.string()),
|
|
197
|
+
errorText: types.optional(types.string()),
|
|
198
|
+
}).transform((v) => {
|
|
199
|
+
return remap$(v, {
|
|
200
|
+
"HttpMeta": "httpMeta",
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
export function proxyPostProxyResponseFromJSON(
|
|
205
|
+
jsonString: string,
|
|
206
|
+
): SafeParseResult<ProxyPostProxyResponse, SDKValidationError> {
|
|
207
|
+
return safeParse(
|
|
208
|
+
jsonString,
|
|
209
|
+
(x) => ProxyPostProxyResponse$inboundSchema.parse(JSON.parse(x)),
|
|
210
|
+
`Failed to parse 'ProxyPostProxyResponse' from JSON`,
|
|
211
|
+
);
|
|
212
|
+
}
|