@apideck/unify 0.13.1 → 0.13.3
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 +0 -13
- package/docs/sdks/ageddebtors/README.md +2 -0
- package/docs/sdks/pipelines/README.md +0 -542
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/ageddebtors.d.ts +3 -3
- package/models/components/ageddebtors.d.ts.map +1 -1
- package/models/components/ageddebtors.js +5 -3
- package/models/components/ageddebtors.js.map +1 -1
- package/models/components/agedreportfilter.d.ts +5 -0
- package/models/components/agedreportfilter.d.ts.map +1 -1
- package/models/components/agedreportfilter.js +4 -0
- package/models/components/agedreportfilter.js.map +1 -1
- package/models/components/balancebyperiod.d.ts +6 -6
- package/models/components/balancebyperiod.d.ts.map +1 -1
- package/models/components/balancebyperiod.js +6 -4
- package/models/components/balancebyperiod.js.map +1 -1
- package/models/components/balancebytransaction.d.ts +8 -3
- package/models/components/balancebytransaction.d.ts.map +1 -1
- package/models/components/balancebytransaction.js +5 -1
- package/models/components/balancebytransaction.js.map +1 -1
- package/models/components/bill.d.ts +5 -0
- package/models/components/bill.d.ts.map +1 -1
- package/models/components/bill.js +9 -0
- package/models/components/bill.js.map +1 -1
- package/models/components/index.d.ts +1 -8
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -8
- package/models/components/index.js.map +1 -1
- package/models/components/ledgeraccount.d.ts +5 -0
- package/models/components/ledgeraccount.d.ts.map +1 -1
- package/models/components/ledgeraccount.js +9 -0
- package/models/components/ledgeraccount.js.map +1 -1
- package/models/components/outstandingbalancebycurrency.d.ts +5 -0
- package/models/components/outstandingbalancebycurrency.d.ts.map +1 -1
- package/models/components/outstandingbalancebycurrency.js +4 -0
- package/models/components/outstandingbalancebycurrency.js.map +1 -1
- package/models/components/outstandingbalancebycustomer.d.ts +40 -0
- package/models/components/outstandingbalancebycustomer.d.ts.map +1 -0
- package/models/components/{outstandingbalance.js → outstandingbalancebycustomer.js} +17 -17
- package/models/components/outstandingbalancebycustomer.js.map +1 -0
- package/models/components/supplier.d.ts +5 -0
- package/models/components/supplier.d.ts.map +1 -1
- package/models/components/supplier.js +9 -0
- package/models/components/supplier.js.map +1 -1
- package/models/operations/index.d.ts +0 -5
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -5
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/accounting.d.ts +0 -3
- package/sdk/accounting.d.ts.map +1 -1
- package/sdk/accounting.js +0 -4
- package/sdk/accounting.js.map +1 -1
- package/sdk/pipelines.d.ts +0 -28
- package/sdk/pipelines.d.ts.map +1 -1
- package/sdk/pipelines.js +0 -41
- package/sdk/pipelines.js.map +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/ageddebtors.ts +13 -9
- package/src/models/components/agedreportfilter.ts +9 -0
- package/src/models/components/balancebyperiod.ts +12 -10
- package/src/models/components/balancebytransaction.ts +10 -1
- package/src/models/components/bill.ts +18 -0
- package/src/models/components/index.ts +1 -8
- package/src/models/components/ledgeraccount.ts +18 -0
- package/src/models/components/outstandingbalancebycurrency.ts +9 -0
- package/src/models/components/{outstandingbalance.ts → outstandingbalancebycustomer.ts} +25 -23
- package/src/models/components/supplier.ts +18 -0
- package/src/models/operations/index.ts +0 -5
- package/src/sdk/accounting.ts +0 -6
- package/src/sdk/pipelines.ts +0 -73
- package/docs/sdks/agedcreditors/README.md +0 -113
- package/funcs/accountingAgedCreditorsGet.d.ts +0 -16
- package/funcs/accountingAgedCreditorsGet.d.ts.map +0 -1
- package/funcs/accountingAgedCreditorsGet.js +0 -122
- package/funcs/accountingAgedCreditorsGet.js.map +0 -1
- package/funcs/crmPipelinesCreate.d.ts +0 -16
- package/funcs/crmPipelinesCreate.d.ts.map +0 -1
- package/funcs/crmPipelinesCreate.js +0 -121
- package/funcs/crmPipelinesCreate.js.map +0 -1
- package/funcs/crmPipelinesDelete.d.ts +0 -16
- package/funcs/crmPipelinesDelete.d.ts.map +0 -1
- package/funcs/crmPipelinesDelete.js +0 -126
- package/funcs/crmPipelinesDelete.js.map +0 -1
- package/funcs/crmPipelinesGet.d.ts +0 -16
- package/funcs/crmPipelinesGet.d.ts.map +0 -1
- package/funcs/crmPipelinesGet.js +0 -127
- package/funcs/crmPipelinesGet.js.map +0 -1
- package/funcs/crmPipelinesUpdate.d.ts +0 -16
- package/funcs/crmPipelinesUpdate.d.ts.map +0 -1
- package/funcs/crmPipelinesUpdate.js +0 -127
- package/funcs/crmPipelinesUpdate.js.map +0 -1
- package/models/components/agedcreditors.d.ts +0 -51
- package/models/components/agedcreditors.d.ts.map +0 -1
- package/models/components/agedcreditors.js +0 -86
- package/models/components/agedcreditors.js.map +0 -1
- package/models/components/createpipelineresponse.d.ts +0 -58
- package/models/components/createpipelineresponse.d.ts.map +0 -1
- package/models/components/createpipelineresponse.js +0 -79
- package/models/components/createpipelineresponse.js.map +0 -1
- package/models/components/deletepipelineresponse.d.ts +0 -58
- package/models/components/deletepipelineresponse.d.ts.map +0 -1
- package/models/components/deletepipelineresponse.js +0 -79
- package/models/components/deletepipelineresponse.js.map +0 -1
- package/models/components/getagedcreditorsresponse.d.ts +0 -58
- package/models/components/getagedcreditorsresponse.d.ts.map +0 -1
- package/models/components/getagedcreditorsresponse.js +0 -79
- package/models/components/getagedcreditorsresponse.js.map +0 -1
- package/models/components/getpipelineresponse.d.ts +0 -58
- package/models/components/getpipelineresponse.d.ts.map +0 -1
- package/models/components/getpipelineresponse.js +0 -79
- package/models/components/getpipelineresponse.js.map +0 -1
- package/models/components/outstandingbalance.d.ts +0 -40
- package/models/components/outstandingbalance.d.ts.map +0 -1
- package/models/components/outstandingbalance.js.map +0 -1
- package/models/components/pipelineinput.d.ts +0 -117
- package/models/components/pipelineinput.d.ts.map +0 -1
- package/models/components/pipelineinput.js +0 -133
- package/models/components/pipelineinput.js.map +0 -1
- package/models/components/updatepipelineresponse.d.ts +0 -58
- package/models/components/updatepipelineresponse.d.ts.map +0 -1
- package/models/components/updatepipelineresponse.js +0 -79
- package/models/components/updatepipelineresponse.js.map +0 -1
- package/models/operations/accountingagedcreditorsone.d.ts +0 -125
- package/models/operations/accountingagedcreditorsone.d.ts.map +0 -1
- package/models/operations/accountingagedcreditorsone.js +0 -153
- package/models/operations/accountingagedcreditorsone.js.map +0 -1
- package/models/operations/crmpipelinesadd.d.ts +0 -108
- package/models/operations/crmpipelinesadd.d.ts.map +0 -1
- package/models/operations/crmpipelinesadd.js +0 -149
- package/models/operations/crmpipelinesadd.js.map +0 -1
- package/models/operations/crmpipelinesdelete.d.ts +0 -111
- package/models/operations/crmpipelinesdelete.d.ts.map +0 -1
- package/models/operations/crmpipelinesdelete.js +0 -141
- package/models/operations/crmpipelinesdelete.js.map +0 -1
- package/models/operations/crmpipelinesone.d.ts +0 -116
- package/models/operations/crmpipelinesone.d.ts.map +0 -1
- package/models/operations/crmpipelinesone.js +0 -141
- package/models/operations/crmpipelinesone.js.map +0 -1
- package/models/operations/crmpipelinesupdate.d.ts +0 -113
- package/models/operations/crmpipelinesupdate.d.ts.map +0 -1
- package/models/operations/crmpipelinesupdate.js +0 -151
- package/models/operations/crmpipelinesupdate.js.map +0 -1
- package/sdk/agedcreditors.d.ts +0 -12
- package/sdk/agedcreditors.d.ts.map +0 -1
- package/sdk/agedcreditors.js +0 -22
- package/sdk/agedcreditors.js.map +0 -1
- package/src/funcs/accountingAgedCreditorsGet.ts +0 -193
- package/src/funcs/crmPipelinesCreate.ts +0 -179
- package/src/funcs/crmPipelinesDelete.ts +0 -185
- package/src/funcs/crmPipelinesGet.ts +0 -186
- package/src/funcs/crmPipelinesUpdate.ts +0 -186
- package/src/models/components/agedcreditors.ts +0 -116
- package/src/models/components/createpipelineresponse.ts +0 -119
- package/src/models/components/deletepipelineresponse.ts +0 -119
- package/src/models/components/getagedcreditorsresponse.ts +0 -119
- package/src/models/components/getpipelineresponse.ts +0 -119
- package/src/models/components/pipelineinput.ts +0 -233
- package/src/models/components/updatepipelineresponse.ts +0 -119
- package/src/models/operations/accountingagedcreditorsone.ts +0 -277
- package/src/models/operations/crmpipelinesadd.ts +0 -250
- package/src/models/operations/crmpipelinesdelete.ts +0 -245
- package/src/models/operations/crmpipelinesone.ts +0 -248
- package/src/models/operations/crmpipelinesupdate.ts +0 -257
- package/src/sdk/agedcreditors.ts +0 -27
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { ApideckCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { safeParse } 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 { APIError } from "../models/errors/apierror.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import * as errors from "../models/errors/index.js";
|
|
21
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
-
import * as operations from "../models/operations/index.js";
|
|
23
|
-
import { Result } from "../types/fp.js";
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Delete pipeline
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* Delete pipeline
|
|
30
|
-
*/
|
|
31
|
-
export async function crmPipelinesDelete(
|
|
32
|
-
client: ApideckCore,
|
|
33
|
-
request: operations.CrmPipelinesDeleteRequest,
|
|
34
|
-
options?: RequestOptions,
|
|
35
|
-
): Promise<
|
|
36
|
-
Result<
|
|
37
|
-
operations.CrmPipelinesDeleteResponse,
|
|
38
|
-
| errors.BadRequestResponse
|
|
39
|
-
| errors.UnauthorizedResponse
|
|
40
|
-
| errors.PaymentRequiredResponse
|
|
41
|
-
| errors.NotFoundResponse
|
|
42
|
-
| errors.UnprocessableResponse
|
|
43
|
-
| APIError
|
|
44
|
-
| SDKValidationError
|
|
45
|
-
| UnexpectedClientError
|
|
46
|
-
| InvalidRequestError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| ConnectionError
|
|
50
|
-
>
|
|
51
|
-
> {
|
|
52
|
-
const parsed = safeParse(
|
|
53
|
-
request,
|
|
54
|
-
(value) => operations.CrmPipelinesDeleteRequest$outboundSchema.parse(value),
|
|
55
|
-
"Input validation failed",
|
|
56
|
-
);
|
|
57
|
-
if (!parsed.ok) {
|
|
58
|
-
return parsed;
|
|
59
|
-
}
|
|
60
|
-
const payload = parsed.value;
|
|
61
|
-
const body = null;
|
|
62
|
-
|
|
63
|
-
const pathParams = {
|
|
64
|
-
id: encodeSimple("id", payload.id, {
|
|
65
|
-
explode: false,
|
|
66
|
-
charEncoding: "percent",
|
|
67
|
-
}),
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const path = pathToFunc("/crm/pipelines/{id}")(pathParams);
|
|
71
|
-
|
|
72
|
-
const query = encodeFormQuery({
|
|
73
|
-
"raw": payload.raw,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const headers = new Headers({
|
|
77
|
-
Accept: "application/json",
|
|
78
|
-
"x-apideck-service-id": encodeSimple(
|
|
79
|
-
"x-apideck-service-id",
|
|
80
|
-
payload.serviceId,
|
|
81
|
-
{ explode: false, charEncoding: "none" },
|
|
82
|
-
),
|
|
83
|
-
"x-apideck-app-id": encodeSimple(
|
|
84
|
-
"x-apideck-app-id",
|
|
85
|
-
client._options.appId,
|
|
86
|
-
{ explode: false, charEncoding: "none" },
|
|
87
|
-
),
|
|
88
|
-
"x-apideck-consumer-id": encodeSimple(
|
|
89
|
-
"x-apideck-consumer-id",
|
|
90
|
-
client._options.consumerId,
|
|
91
|
-
{ explode: false, charEncoding: "none" },
|
|
92
|
-
),
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
96
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
97
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
-
|
|
99
|
-
const context = {
|
|
100
|
-
operationID: "crm.pipelinesDelete",
|
|
101
|
-
oAuth2Scopes: [],
|
|
102
|
-
|
|
103
|
-
resolvedSecurity: requestSecurity,
|
|
104
|
-
|
|
105
|
-
securitySource: client._options.apiKey,
|
|
106
|
-
retryConfig: options?.retries
|
|
107
|
-
|| client._options.retryConfig
|
|
108
|
-
|| {
|
|
109
|
-
strategy: "backoff",
|
|
110
|
-
backoff: {
|
|
111
|
-
initialInterval: 500,
|
|
112
|
-
maxInterval: 60000,
|
|
113
|
-
exponent: 1.5,
|
|
114
|
-
maxElapsedTime: 3600000,
|
|
115
|
-
},
|
|
116
|
-
retryConnectionErrors: true,
|
|
117
|
-
}
|
|
118
|
-
|| { strategy: "none" },
|
|
119
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const requestRes = client._createRequest(context, {
|
|
123
|
-
security: requestSecurity,
|
|
124
|
-
method: "DELETE",
|
|
125
|
-
baseURL: options?.serverURL,
|
|
126
|
-
path: path,
|
|
127
|
-
headers: headers,
|
|
128
|
-
query: query,
|
|
129
|
-
body: body,
|
|
130
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
131
|
-
}, options);
|
|
132
|
-
if (!requestRes.ok) {
|
|
133
|
-
return requestRes;
|
|
134
|
-
}
|
|
135
|
-
const req = requestRes.value;
|
|
136
|
-
|
|
137
|
-
const doResult = await client._do(req, {
|
|
138
|
-
context,
|
|
139
|
-
errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"],
|
|
140
|
-
retryConfig: context.retryConfig,
|
|
141
|
-
retryCodes: context.retryCodes,
|
|
142
|
-
});
|
|
143
|
-
if (!doResult.ok) {
|
|
144
|
-
return doResult;
|
|
145
|
-
}
|
|
146
|
-
const response = doResult.value;
|
|
147
|
-
|
|
148
|
-
const responseFields = {
|
|
149
|
-
HttpMeta: { Response: response, Request: req },
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
const [result] = await M.match<
|
|
153
|
-
operations.CrmPipelinesDeleteResponse,
|
|
154
|
-
| errors.BadRequestResponse
|
|
155
|
-
| errors.UnauthorizedResponse
|
|
156
|
-
| errors.PaymentRequiredResponse
|
|
157
|
-
| errors.NotFoundResponse
|
|
158
|
-
| errors.UnprocessableResponse
|
|
159
|
-
| APIError
|
|
160
|
-
| SDKValidationError
|
|
161
|
-
| UnexpectedClientError
|
|
162
|
-
| InvalidRequestError
|
|
163
|
-
| RequestAbortedError
|
|
164
|
-
| RequestTimeoutError
|
|
165
|
-
| ConnectionError
|
|
166
|
-
>(
|
|
167
|
-
M.json(200, operations.CrmPipelinesDeleteResponse$inboundSchema, {
|
|
168
|
-
key: "DeletePipelineResponse",
|
|
169
|
-
}),
|
|
170
|
-
M.jsonErr(400, errors.BadRequestResponse$inboundSchema),
|
|
171
|
-
M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema),
|
|
172
|
-
M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema),
|
|
173
|
-
M.jsonErr(404, errors.NotFoundResponse$inboundSchema),
|
|
174
|
-
M.jsonErr(422, errors.UnprocessableResponse$inboundSchema),
|
|
175
|
-
M.fail(["4XX", "5XX"]),
|
|
176
|
-
M.json("default", operations.CrmPipelinesDeleteResponse$inboundSchema, {
|
|
177
|
-
key: "UnexpectedErrorResponse",
|
|
178
|
-
}),
|
|
179
|
-
)(response, req, { extraFields: responseFields });
|
|
180
|
-
if (!result.ok) {
|
|
181
|
-
return result;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return result;
|
|
185
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { ApideckCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { safeParse } 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 { APIError } from "../models/errors/apierror.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import * as errors from "../models/errors/index.js";
|
|
21
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
-
import * as operations from "../models/operations/index.js";
|
|
23
|
-
import { Result } from "../types/fp.js";
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Get pipeline
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* Get pipeline
|
|
30
|
-
*/
|
|
31
|
-
export async function crmPipelinesGet(
|
|
32
|
-
client: ApideckCore,
|
|
33
|
-
request: operations.CrmPipelinesOneRequest,
|
|
34
|
-
options?: RequestOptions,
|
|
35
|
-
): Promise<
|
|
36
|
-
Result<
|
|
37
|
-
operations.CrmPipelinesOneResponse,
|
|
38
|
-
| errors.BadRequestResponse
|
|
39
|
-
| errors.UnauthorizedResponse
|
|
40
|
-
| errors.PaymentRequiredResponse
|
|
41
|
-
| errors.NotFoundResponse
|
|
42
|
-
| errors.UnprocessableResponse
|
|
43
|
-
| APIError
|
|
44
|
-
| SDKValidationError
|
|
45
|
-
| UnexpectedClientError
|
|
46
|
-
| InvalidRequestError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| ConnectionError
|
|
50
|
-
>
|
|
51
|
-
> {
|
|
52
|
-
const parsed = safeParse(
|
|
53
|
-
request,
|
|
54
|
-
(value) => operations.CrmPipelinesOneRequest$outboundSchema.parse(value),
|
|
55
|
-
"Input validation failed",
|
|
56
|
-
);
|
|
57
|
-
if (!parsed.ok) {
|
|
58
|
-
return parsed;
|
|
59
|
-
}
|
|
60
|
-
const payload = parsed.value;
|
|
61
|
-
const body = null;
|
|
62
|
-
|
|
63
|
-
const pathParams = {
|
|
64
|
-
id: encodeSimple("id", payload.id, {
|
|
65
|
-
explode: false,
|
|
66
|
-
charEncoding: "percent",
|
|
67
|
-
}),
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const path = pathToFunc("/crm/pipelines/{id}")(pathParams);
|
|
71
|
-
|
|
72
|
-
const query = encodeFormQuery({
|
|
73
|
-
"fields": payload.fields,
|
|
74
|
-
"raw": payload.raw,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const headers = new Headers({
|
|
78
|
-
Accept: "application/json",
|
|
79
|
-
"x-apideck-service-id": encodeSimple(
|
|
80
|
-
"x-apideck-service-id",
|
|
81
|
-
payload.serviceId,
|
|
82
|
-
{ explode: false, charEncoding: "none" },
|
|
83
|
-
),
|
|
84
|
-
"x-apideck-app-id": encodeSimple(
|
|
85
|
-
"x-apideck-app-id",
|
|
86
|
-
client._options.appId,
|
|
87
|
-
{ explode: false, charEncoding: "none" },
|
|
88
|
-
),
|
|
89
|
-
"x-apideck-consumer-id": encodeSimple(
|
|
90
|
-
"x-apideck-consumer-id",
|
|
91
|
-
client._options.consumerId,
|
|
92
|
-
{ explode: false, charEncoding: "none" },
|
|
93
|
-
),
|
|
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
|
-
operationID: "crm.pipelinesOne",
|
|
102
|
-
oAuth2Scopes: [],
|
|
103
|
-
|
|
104
|
-
resolvedSecurity: requestSecurity,
|
|
105
|
-
|
|
106
|
-
securitySource: client._options.apiKey,
|
|
107
|
-
retryConfig: options?.retries
|
|
108
|
-
|| client._options.retryConfig
|
|
109
|
-
|| {
|
|
110
|
-
strategy: "backoff",
|
|
111
|
-
backoff: {
|
|
112
|
-
initialInterval: 500,
|
|
113
|
-
maxInterval: 60000,
|
|
114
|
-
exponent: 1.5,
|
|
115
|
-
maxElapsedTime: 3600000,
|
|
116
|
-
},
|
|
117
|
-
retryConnectionErrors: true,
|
|
118
|
-
}
|
|
119
|
-
|| { strategy: "none" },
|
|
120
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
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
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
132
|
-
}, options);
|
|
133
|
-
if (!requestRes.ok) {
|
|
134
|
-
return requestRes;
|
|
135
|
-
}
|
|
136
|
-
const req = requestRes.value;
|
|
137
|
-
|
|
138
|
-
const doResult = await client._do(req, {
|
|
139
|
-
context,
|
|
140
|
-
errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"],
|
|
141
|
-
retryConfig: context.retryConfig,
|
|
142
|
-
retryCodes: context.retryCodes,
|
|
143
|
-
});
|
|
144
|
-
if (!doResult.ok) {
|
|
145
|
-
return doResult;
|
|
146
|
-
}
|
|
147
|
-
const response = doResult.value;
|
|
148
|
-
|
|
149
|
-
const responseFields = {
|
|
150
|
-
HttpMeta: { Response: response, Request: req },
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const [result] = await M.match<
|
|
154
|
-
operations.CrmPipelinesOneResponse,
|
|
155
|
-
| errors.BadRequestResponse
|
|
156
|
-
| errors.UnauthorizedResponse
|
|
157
|
-
| errors.PaymentRequiredResponse
|
|
158
|
-
| errors.NotFoundResponse
|
|
159
|
-
| errors.UnprocessableResponse
|
|
160
|
-
| APIError
|
|
161
|
-
| SDKValidationError
|
|
162
|
-
| UnexpectedClientError
|
|
163
|
-
| InvalidRequestError
|
|
164
|
-
| RequestAbortedError
|
|
165
|
-
| RequestTimeoutError
|
|
166
|
-
| ConnectionError
|
|
167
|
-
>(
|
|
168
|
-
M.json(200, operations.CrmPipelinesOneResponse$inboundSchema, {
|
|
169
|
-
key: "GetPipelineResponse",
|
|
170
|
-
}),
|
|
171
|
-
M.jsonErr(400, errors.BadRequestResponse$inboundSchema),
|
|
172
|
-
M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema),
|
|
173
|
-
M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema),
|
|
174
|
-
M.jsonErr(404, errors.NotFoundResponse$inboundSchema),
|
|
175
|
-
M.jsonErr(422, errors.UnprocessableResponse$inboundSchema),
|
|
176
|
-
M.fail(["4XX", "5XX"]),
|
|
177
|
-
M.json("default", operations.CrmPipelinesOneResponse$inboundSchema, {
|
|
178
|
-
key: "UnexpectedErrorResponse",
|
|
179
|
-
}),
|
|
180
|
-
)(response, req, { extraFields: responseFields });
|
|
181
|
-
if (!result.ok) {
|
|
182
|
-
return result;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { ApideckCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { safeParse } 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 { APIError } from "../models/errors/apierror.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import * as errors from "../models/errors/index.js";
|
|
21
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
-
import * as operations from "../models/operations/index.js";
|
|
23
|
-
import { Result } from "../types/fp.js";
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Update pipeline
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
* Update pipeline
|
|
30
|
-
*/
|
|
31
|
-
export async function crmPipelinesUpdate(
|
|
32
|
-
client: ApideckCore,
|
|
33
|
-
request: operations.CrmPipelinesUpdateRequest,
|
|
34
|
-
options?: RequestOptions,
|
|
35
|
-
): Promise<
|
|
36
|
-
Result<
|
|
37
|
-
operations.CrmPipelinesUpdateResponse,
|
|
38
|
-
| errors.BadRequestResponse
|
|
39
|
-
| errors.UnauthorizedResponse
|
|
40
|
-
| errors.PaymentRequiredResponse
|
|
41
|
-
| errors.NotFoundResponse
|
|
42
|
-
| errors.UnprocessableResponse
|
|
43
|
-
| APIError
|
|
44
|
-
| SDKValidationError
|
|
45
|
-
| UnexpectedClientError
|
|
46
|
-
| InvalidRequestError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| ConnectionError
|
|
50
|
-
>
|
|
51
|
-
> {
|
|
52
|
-
const parsed = safeParse(
|
|
53
|
-
request,
|
|
54
|
-
(value) => operations.CrmPipelinesUpdateRequest$outboundSchema.parse(value),
|
|
55
|
-
"Input validation failed",
|
|
56
|
-
);
|
|
57
|
-
if (!parsed.ok) {
|
|
58
|
-
return parsed;
|
|
59
|
-
}
|
|
60
|
-
const payload = parsed.value;
|
|
61
|
-
const body = encodeJSON("body", payload.Pipeline, { explode: true });
|
|
62
|
-
|
|
63
|
-
const pathParams = {
|
|
64
|
-
id: encodeSimple("id", payload.id, {
|
|
65
|
-
explode: false,
|
|
66
|
-
charEncoding: "percent",
|
|
67
|
-
}),
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const path = pathToFunc("/crm/pipelines/{id}")(pathParams);
|
|
71
|
-
|
|
72
|
-
const query = encodeFormQuery({
|
|
73
|
-
"raw": payload.raw,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const headers = new Headers({
|
|
77
|
-
"Content-Type": "application/json",
|
|
78
|
-
Accept: "application/json",
|
|
79
|
-
"x-apideck-service-id": encodeSimple(
|
|
80
|
-
"x-apideck-service-id",
|
|
81
|
-
payload.serviceId,
|
|
82
|
-
{ explode: false, charEncoding: "none" },
|
|
83
|
-
),
|
|
84
|
-
"x-apideck-app-id": encodeSimple(
|
|
85
|
-
"x-apideck-app-id",
|
|
86
|
-
client._options.appId,
|
|
87
|
-
{ explode: false, charEncoding: "none" },
|
|
88
|
-
),
|
|
89
|
-
"x-apideck-consumer-id": encodeSimple(
|
|
90
|
-
"x-apideck-consumer-id",
|
|
91
|
-
client._options.consumerId,
|
|
92
|
-
{ explode: false, charEncoding: "none" },
|
|
93
|
-
),
|
|
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
|
-
operationID: "crm.pipelinesUpdate",
|
|
102
|
-
oAuth2Scopes: [],
|
|
103
|
-
|
|
104
|
-
resolvedSecurity: requestSecurity,
|
|
105
|
-
|
|
106
|
-
securitySource: client._options.apiKey,
|
|
107
|
-
retryConfig: options?.retries
|
|
108
|
-
|| client._options.retryConfig
|
|
109
|
-
|| {
|
|
110
|
-
strategy: "backoff",
|
|
111
|
-
backoff: {
|
|
112
|
-
initialInterval: 500,
|
|
113
|
-
maxInterval: 60000,
|
|
114
|
-
exponent: 1.5,
|
|
115
|
-
maxElapsedTime: 3600000,
|
|
116
|
-
},
|
|
117
|
-
retryConnectionErrors: true,
|
|
118
|
-
}
|
|
119
|
-
|| { strategy: "none" },
|
|
120
|
-
retryCodes: options?.retryCodes || ["5XX"],
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const requestRes = client._createRequest(context, {
|
|
124
|
-
security: requestSecurity,
|
|
125
|
-
method: "PATCH",
|
|
126
|
-
baseURL: options?.serverURL,
|
|
127
|
-
path: path,
|
|
128
|
-
headers: headers,
|
|
129
|
-
query: query,
|
|
130
|
-
body: body,
|
|
131
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
132
|
-
}, options);
|
|
133
|
-
if (!requestRes.ok) {
|
|
134
|
-
return requestRes;
|
|
135
|
-
}
|
|
136
|
-
const req = requestRes.value;
|
|
137
|
-
|
|
138
|
-
const doResult = await client._do(req, {
|
|
139
|
-
context,
|
|
140
|
-
errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"],
|
|
141
|
-
retryConfig: context.retryConfig,
|
|
142
|
-
retryCodes: context.retryCodes,
|
|
143
|
-
});
|
|
144
|
-
if (!doResult.ok) {
|
|
145
|
-
return doResult;
|
|
146
|
-
}
|
|
147
|
-
const response = doResult.value;
|
|
148
|
-
|
|
149
|
-
const responseFields = {
|
|
150
|
-
HttpMeta: { Response: response, Request: req },
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const [result] = await M.match<
|
|
154
|
-
operations.CrmPipelinesUpdateResponse,
|
|
155
|
-
| errors.BadRequestResponse
|
|
156
|
-
| errors.UnauthorizedResponse
|
|
157
|
-
| errors.PaymentRequiredResponse
|
|
158
|
-
| errors.NotFoundResponse
|
|
159
|
-
| errors.UnprocessableResponse
|
|
160
|
-
| APIError
|
|
161
|
-
| SDKValidationError
|
|
162
|
-
| UnexpectedClientError
|
|
163
|
-
| InvalidRequestError
|
|
164
|
-
| RequestAbortedError
|
|
165
|
-
| RequestTimeoutError
|
|
166
|
-
| ConnectionError
|
|
167
|
-
>(
|
|
168
|
-
M.json(200, operations.CrmPipelinesUpdateResponse$inboundSchema, {
|
|
169
|
-
key: "UpdatePipelineResponse",
|
|
170
|
-
}),
|
|
171
|
-
M.jsonErr(400, errors.BadRequestResponse$inboundSchema),
|
|
172
|
-
M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema),
|
|
173
|
-
M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema),
|
|
174
|
-
M.jsonErr(404, errors.NotFoundResponse$inboundSchema),
|
|
175
|
-
M.jsonErr(422, errors.UnprocessableResponse$inboundSchema),
|
|
176
|
-
M.fail(["4XX", "5XX"]),
|
|
177
|
-
M.json("default", operations.CrmPipelinesUpdateResponse$inboundSchema, {
|
|
178
|
-
key: "UnexpectedErrorResponse",
|
|
179
|
-
}),
|
|
180
|
-
)(response, req, { extraFields: responseFields });
|
|
181
|
-
if (!result.ok) {
|
|
182
|
-
return result;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
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 { RFCDate } from "../../types/rfcdate.js";
|
|
10
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
-
import {
|
|
12
|
-
OutstandingBalance,
|
|
13
|
-
OutstandingBalance$inboundSchema,
|
|
14
|
-
OutstandingBalance$Outbound,
|
|
15
|
-
OutstandingBalance$outboundSchema,
|
|
16
|
-
} from "./outstandingbalance.js";
|
|
17
|
-
|
|
18
|
-
export type AgedCreditors = {
|
|
19
|
-
/**
|
|
20
|
-
* The exact date and time the report was generated.
|
|
21
|
-
*/
|
|
22
|
-
reportGeneratedAt?: Date | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* The cutoff date for transactions included in the report.
|
|
25
|
-
*/
|
|
26
|
-
reportAsOfDate?: RFCDate | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Number of aging periods shown in the report.
|
|
29
|
-
*/
|
|
30
|
-
periodCount?: number | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Length of each aging period in days.
|
|
33
|
-
*/
|
|
34
|
-
periodLength?: number | undefined;
|
|
35
|
-
outstandingBalances?: Array<OutstandingBalance> | undefined;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/** @internal */
|
|
39
|
-
export const AgedCreditors$inboundSchema: z.ZodType<
|
|
40
|
-
AgedCreditors,
|
|
41
|
-
z.ZodTypeDef,
|
|
42
|
-
unknown
|
|
43
|
-
> = z.object({
|
|
44
|
-
report_generated_at: z.string().datetime({ offset: true }).transform(v =>
|
|
45
|
-
new Date(v)
|
|
46
|
-
).optional(),
|
|
47
|
-
report_as_of_date: z.string().transform(v => new RFCDate(v)).optional(),
|
|
48
|
-
period_count: z.number().int().default(4),
|
|
49
|
-
period_length: z.number().int().default(30),
|
|
50
|
-
outstanding_balances: z.array(OutstandingBalance$inboundSchema).optional(),
|
|
51
|
-
}).transform((v) => {
|
|
52
|
-
return remap$(v, {
|
|
53
|
-
"report_generated_at": "reportGeneratedAt",
|
|
54
|
-
"report_as_of_date": "reportAsOfDate",
|
|
55
|
-
"period_count": "periodCount",
|
|
56
|
-
"period_length": "periodLength",
|
|
57
|
-
"outstanding_balances": "outstandingBalances",
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
/** @internal */
|
|
62
|
-
export type AgedCreditors$Outbound = {
|
|
63
|
-
report_generated_at?: string | undefined;
|
|
64
|
-
report_as_of_date?: string | undefined;
|
|
65
|
-
period_count: number;
|
|
66
|
-
period_length: number;
|
|
67
|
-
outstanding_balances?: Array<OutstandingBalance$Outbound> | undefined;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/** @internal */
|
|
71
|
-
export const AgedCreditors$outboundSchema: z.ZodType<
|
|
72
|
-
AgedCreditors$Outbound,
|
|
73
|
-
z.ZodTypeDef,
|
|
74
|
-
AgedCreditors
|
|
75
|
-
> = z.object({
|
|
76
|
-
reportGeneratedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
77
|
-
reportAsOfDate: z.instanceof(RFCDate).transform(v => v.toString()).optional(),
|
|
78
|
-
periodCount: z.number().int().default(4),
|
|
79
|
-
periodLength: z.number().int().default(30),
|
|
80
|
-
outstandingBalances: z.array(OutstandingBalance$outboundSchema).optional(),
|
|
81
|
-
}).transform((v) => {
|
|
82
|
-
return remap$(v, {
|
|
83
|
-
reportGeneratedAt: "report_generated_at",
|
|
84
|
-
reportAsOfDate: "report_as_of_date",
|
|
85
|
-
periodCount: "period_count",
|
|
86
|
-
periodLength: "period_length",
|
|
87
|
-
outstandingBalances: "outstanding_balances",
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @internal
|
|
93
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
94
|
-
*/
|
|
95
|
-
export namespace AgedCreditors$ {
|
|
96
|
-
/** @deprecated use `AgedCreditors$inboundSchema` instead. */
|
|
97
|
-
export const inboundSchema = AgedCreditors$inboundSchema;
|
|
98
|
-
/** @deprecated use `AgedCreditors$outboundSchema` instead. */
|
|
99
|
-
export const outboundSchema = AgedCreditors$outboundSchema;
|
|
100
|
-
/** @deprecated use `AgedCreditors$Outbound` instead. */
|
|
101
|
-
export type Outbound = AgedCreditors$Outbound;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function agedCreditorsToJSON(agedCreditors: AgedCreditors): string {
|
|
105
|
-
return JSON.stringify(AgedCreditors$outboundSchema.parse(agedCreditors));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function agedCreditorsFromJSON(
|
|
109
|
-
jsonString: string,
|
|
110
|
-
): SafeParseResult<AgedCreditors, SDKValidationError> {
|
|
111
|
-
return safeParse(
|
|
112
|
-
jsonString,
|
|
113
|
-
(x) => AgedCreditors$inboundSchema.parse(JSON.parse(x)),
|
|
114
|
-
`Failed to parse 'AgedCreditors' from JSON`,
|
|
115
|
-
);
|
|
116
|
-
}
|