flexprice-sdk-test 1.0.49 → 1.0.52
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 +31 -449
- package/examples/node_modules/.package-lock.json +1 -1
- package/examples/package-lock.json +1 -1
- package/funcs/{customerDashboardPostCustomerDashboardCostAnalytics.d.ts → customerPortalGetPortalExternalId.d.ts} +4 -5
- package/funcs/customerPortalGetPortalExternalId.d.ts.map +1 -0
- package/funcs/{customerDashboardGetCustomerDashboardWalletsId.js → customerPortalGetPortalExternalId.js} +18 -22
- package/funcs/customerPortalGetPortalExternalId.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/dtoportalsessionresponse.d.ts +12 -0
- package/models/components/dtoportalsessionresponse.d.ts.map +1 -0
- package/models/components/{dtodashboardsessionresponse.js → dtoportalsessionresponse.js} +6 -6
- package/models/components/dtoportalsessionresponse.js.map +1 -0
- package/models/components/index.d.ts +1 -4
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -4
- package/models/components/index.js.map +1 -1
- package/models/components/security.d.ts +2 -2
- package/models/components/security.d.ts.map +1 -1
- package/models/components/security.js +1 -1
- package/models/components/security.js.map +1 -1
- package/models/operations/getportalexternalid.d.ts +15 -0
- package/models/operations/getportalexternalid.d.ts.map +1 -0
- package/models/operations/{putcustomerdashboardinfo.js → getportalexternalid.js} +8 -8
- package/models/operations/getportalexternalid.js.map +1 -0
- package/models/operations/index.d.ts +1 -11
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -11
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/customerportal.d.ts +12 -0
- package/sdk/customerportal.d.ts.map +1 -0
- package/sdk/customerportal.js +22 -0
- package/sdk/customerportal.js.map +1 -0
- package/sdk/sdk.d.ts +3 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -4
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/{customerDashboardGetCustomerDashboardExternalId.ts → customerPortalGetPortalExternalId.ts} +38 -8
- package/src/lib/config.ts +2 -2
- package/src/models/components/{dtodashboardsessionresponse.ts → dtoportalsessionresponse.ts} +7 -7
- package/src/models/components/index.ts +1 -4
- package/src/models/components/security.ts +3 -3
- package/src/models/operations/getportalexternalid.ts +39 -0
- package/src/models/operations/index.ts +1 -11
- package/src/sdk/customerportal.ts +27 -0
- package/src/sdk/sdk.ts +6 -6
- package/.eslintrc.js +0 -27
- package/funcs/customerDashboardGetCustomerDashboardExternalId.d.ts +0 -18
- package/funcs/customerDashboardGetCustomerDashboardExternalId.d.ts.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardExternalId.js +0 -118
- package/funcs/customerDashboardGetCustomerDashboardExternalId.js.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardInfo.d.ts +0 -19
- package/funcs/customerDashboardGetCustomerDashboardInfo.d.ts.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardInfo.js +0 -122
- package/funcs/customerDashboardGetCustomerDashboardInfo.js.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardInvoicesId.d.ts +0 -19
- package/funcs/customerDashboardGetCustomerDashboardInvoicesId.d.ts.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardInvoicesId.js +0 -141
- package/funcs/customerDashboardGetCustomerDashboardInvoicesId.js.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardSubscriptionsId.d.ts +0 -19
- package/funcs/customerDashboardGetCustomerDashboardSubscriptionsId.d.ts.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardSubscriptionsId.js +0 -142
- package/funcs/customerDashboardGetCustomerDashboardSubscriptionsId.js.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardUsage.d.ts +0 -19
- package/funcs/customerDashboardGetCustomerDashboardUsage.d.ts.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardUsage.js +0 -141
- package/funcs/customerDashboardGetCustomerDashboardUsage.js.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardWalletsId.d.ts +0 -19
- package/funcs/customerDashboardGetCustomerDashboardWalletsId.d.ts.map +0 -1
- package/funcs/customerDashboardGetCustomerDashboardWalletsId.js.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardAnalytics.d.ts +0 -19
- package/funcs/customerDashboardPostCustomerDashboardAnalytics.d.ts.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardAnalytics.js +0 -132
- package/funcs/customerDashboardPostCustomerDashboardAnalytics.js.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardCostAnalytics.d.ts.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardCostAnalytics.js +0 -132
- package/funcs/customerDashboardPostCustomerDashboardCostAnalytics.js.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardInvoices.d.ts +0 -19
- package/funcs/customerDashboardPostCustomerDashboardInvoices.d.ts.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardInvoices.js +0 -132
- package/funcs/customerDashboardPostCustomerDashboardInvoices.js.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardSubscriptions.d.ts +0 -19
- package/funcs/customerDashboardPostCustomerDashboardSubscriptions.d.ts.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardSubscriptions.js +0 -132
- package/funcs/customerDashboardPostCustomerDashboardSubscriptions.js.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardWallets.d.ts +0 -19
- package/funcs/customerDashboardPostCustomerDashboardWallets.d.ts.map +0 -1
- package/funcs/customerDashboardPostCustomerDashboardWallets.js +0 -123
- package/funcs/customerDashboardPostCustomerDashboardWallets.js.map +0 -1
- package/funcs/customerDashboardPutCustomerDashboardInfo.d.ts +0 -19
- package/funcs/customerDashboardPutCustomerDashboardInfo.d.ts.map +0 -1
- package/funcs/customerDashboardPutCustomerDashboardInfo.js +0 -132
- package/funcs/customerDashboardPutCustomerDashboardInfo.js.map +0 -1
- package/jest.config.js +0 -30
- package/models/components/dtodashboardanalyticsrequest.d.ts +0 -31
- package/models/components/dtodashboardanalyticsrequest.d.ts.map +0 -1
- package/models/components/dtodashboardanalyticsrequest.js +0 -67
- package/models/components/dtodashboardanalyticsrequest.js.map +0 -1
- package/models/components/dtodashboardcostanalyticsrequest.d.ts +0 -16
- package/models/components/dtodashboardcostanalyticsrequest.d.ts.map +0 -1
- package/models/components/dtodashboardcostanalyticsrequest.js +0 -58
- package/models/components/dtodashboardcostanalyticsrequest.js.map +0 -1
- package/models/components/dtodashboardpaginatedrequest.d.ts +0 -14
- package/models/components/dtodashboardpaginatedrequest.d.ts.map +0 -1
- package/models/components/dtodashboardpaginatedrequest.js +0 -50
- package/models/components/dtodashboardpaginatedrequest.js.map +0 -1
- package/models/components/dtodashboardsessionresponse.d.ts +0 -12
- package/models/components/dtodashboardsessionresponse.d.ts.map +0 -1
- package/models/components/dtodashboardsessionresponse.js.map +0 -1
- package/models/operations/getcustomerdashboardinfo.d.ts +0 -12
- package/models/operations/getcustomerdashboardinfo.d.ts.map +0 -1
- package/models/operations/getcustomerdashboardinfo.js +0 -54
- package/models/operations/getcustomerdashboardinfo.js.map +0 -1
- package/models/operations/getcustomerdashboardinvoicesid.d.ts +0 -25
- package/models/operations/getcustomerdashboardinvoicesid.d.ts.map +0 -1
- package/models/operations/getcustomerdashboardinvoicesid.js +0 -62
- package/models/operations/getcustomerdashboardinvoicesid.js.map +0 -1
- package/models/operations/getcustomerdashboardsubscriptionsid.d.ts +0 -25
- package/models/operations/getcustomerdashboardsubscriptionsid.d.ts.map +0 -1
- package/models/operations/getcustomerdashboardsubscriptionsid.js +0 -62
- package/models/operations/getcustomerdashboardsubscriptionsid.js.map +0 -1
- package/models/operations/getcustomerdashboardusage.d.ts +0 -30
- package/models/operations/getcustomerdashboardusage.d.ts.map +0 -1
- package/models/operations/getcustomerdashboardusage.js +0 -74
- package/models/operations/getcustomerdashboardusage.js.map +0 -1
- package/models/operations/getcustomerdashboardwalletsid.d.ts +0 -25
- package/models/operations/getcustomerdashboardwalletsid.d.ts.map +0 -1
- package/models/operations/getcustomerdashboardwalletsid.js +0 -62
- package/models/operations/getcustomerdashboardwalletsid.js.map +0 -1
- package/models/operations/postcustomerdashboardanalytics.d.ts +0 -12
- package/models/operations/postcustomerdashboardanalytics.d.ts.map +0 -1
- package/models/operations/postcustomerdashboardanalytics.js +0 -54
- package/models/operations/postcustomerdashboardanalytics.js.map +0 -1
- package/models/operations/postcustomerdashboardcostanalytics.d.ts +0 -12
- package/models/operations/postcustomerdashboardcostanalytics.d.ts.map +0 -1
- package/models/operations/postcustomerdashboardcostanalytics.js +0 -54
- package/models/operations/postcustomerdashboardcostanalytics.js.map +0 -1
- package/models/operations/postcustomerdashboardinvoices.d.ts +0 -12
- package/models/operations/postcustomerdashboardinvoices.d.ts.map +0 -1
- package/models/operations/postcustomerdashboardinvoices.js +0 -54
- package/models/operations/postcustomerdashboardinvoices.js.map +0 -1
- package/models/operations/postcustomerdashboardsubscriptions.d.ts +0 -12
- package/models/operations/postcustomerdashboardsubscriptions.d.ts.map +0 -1
- package/models/operations/postcustomerdashboardsubscriptions.js +0 -54
- package/models/operations/postcustomerdashboardsubscriptions.js.map +0 -1
- package/models/operations/postcustomerdashboardwallets.d.ts +0 -12
- package/models/operations/postcustomerdashboardwallets.d.ts.map +0 -1
- package/models/operations/postcustomerdashboardwallets.js +0 -54
- package/models/operations/postcustomerdashboardwallets.js.map +0 -1
- package/models/operations/putcustomerdashboardinfo.d.ts +0 -12
- package/models/operations/putcustomerdashboardinfo.d.ts.map +0 -1
- package/models/operations/putcustomerdashboardinfo.js.map +0 -1
- package/sdk/customerdashboard.d.ts +0 -90
- package/sdk/customerdashboard.d.ts.map +0 -1
- package/sdk/customerdashboard.js +0 -132
- package/sdk/customerdashboard.js.map +0 -1
- package/src/funcs/customerDashboardGetCustomerDashboardInfo.ts +0 -172
- package/src/funcs/customerDashboardGetCustomerDashboardInvoicesId.ts +0 -203
- package/src/funcs/customerDashboardGetCustomerDashboardSubscriptionsId.ts +0 -202
- package/src/funcs/customerDashboardGetCustomerDashboardUsage.ts +0 -203
- package/src/funcs/customerDashboardGetCustomerDashboardWalletsId.ts +0 -203
- package/src/funcs/customerDashboardPostCustomerDashboardAnalytics.ts +0 -191
- package/src/funcs/customerDashboardPostCustomerDashboardCostAnalytics.ts +0 -191
- package/src/funcs/customerDashboardPostCustomerDashboardInvoices.ts +0 -191
- package/src/funcs/customerDashboardPostCustomerDashboardSubscriptions.ts +0 -191
- package/src/funcs/customerDashboardPostCustomerDashboardWallets.ts +0 -173
- package/src/funcs/customerDashboardPutCustomerDashboardInfo.ts +0 -190
- package/src/models/components/dtodashboardanalyticsrequest.ts +0 -68
- package/src/models/components/dtodashboardcostanalyticsrequest.ts +0 -46
- package/src/models/components/dtodashboardpaginatedrequest.ts +0 -36
- package/src/models/operations/getcustomerdashboardinfo.ts +0 -38
- package/src/models/operations/getcustomerdashboardinvoicesid.ts +0 -70
- package/src/models/operations/getcustomerdashboardsubscriptionsid.ts +0 -73
- package/src/models/operations/getcustomerdashboardusage.ts +0 -86
- package/src/models/operations/getcustomerdashboardwalletsid.ts +0 -69
- package/src/models/operations/postcustomerdashboardanalytics.ts +0 -39
- package/src/models/operations/postcustomerdashboardcostanalytics.ts +0 -40
- package/src/models/operations/postcustomerdashboardinvoices.ts +0 -38
- package/src/models/operations/postcustomerdashboardsubscriptions.ts +0 -40
- package/src/models/operations/postcustomerdashboardwallets.ts +0 -38
- package/src/models/operations/putcustomerdashboardinfo.ts +0 -38
- package/src/sdk/customerdashboard.ts +0 -242
- package/tsconfig.esm.json +0 -7
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { FlexPriceCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { resolveSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
|
-
import { FlexPriceError } from "../models/errors/flexpriceerror.js";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionError,
|
|
17
|
-
InvalidRequestError,
|
|
18
|
-
RequestAbortedError,
|
|
19
|
-
RequestTimeoutError,
|
|
20
|
-
UnexpectedClientError,
|
|
21
|
-
} from "../models/errors/httpclienterrors.js";
|
|
22
|
-
import * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import * as operations from "../models/operations/index.js";
|
|
26
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
-
import { Result } from "../types/fp.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get customer analytics
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Get usage analytics for the authenticated customer
|
|
34
|
-
*/
|
|
35
|
-
export function customerDashboardPostCustomerDashboardAnalytics(
|
|
36
|
-
client: FlexPriceCore,
|
|
37
|
-
security: operations.PostCustomerDashboardAnalyticsSecurity,
|
|
38
|
-
request: components.DtoDashboardAnalyticsRequest,
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<
|
|
41
|
-
Result<
|
|
42
|
-
components.DtoGetUsageAnalyticsResponse,
|
|
43
|
-
| errors.ErrorsErrorResponse
|
|
44
|
-
| FlexPriceError
|
|
45
|
-
| ResponseValidationError
|
|
46
|
-
| ConnectionError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| InvalidRequestError
|
|
50
|
-
| UnexpectedClientError
|
|
51
|
-
| SDKValidationError
|
|
52
|
-
>
|
|
53
|
-
> {
|
|
54
|
-
return new APIPromise($do(
|
|
55
|
-
client,
|
|
56
|
-
security,
|
|
57
|
-
request,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function $do(
|
|
63
|
-
client: FlexPriceCore,
|
|
64
|
-
security: operations.PostCustomerDashboardAnalyticsSecurity,
|
|
65
|
-
request: components.DtoDashboardAnalyticsRequest,
|
|
66
|
-
options?: RequestOptions,
|
|
67
|
-
): Promise<
|
|
68
|
-
[
|
|
69
|
-
Result<
|
|
70
|
-
components.DtoGetUsageAnalyticsResponse,
|
|
71
|
-
| errors.ErrorsErrorResponse
|
|
72
|
-
| FlexPriceError
|
|
73
|
-
| ResponseValidationError
|
|
74
|
-
| ConnectionError
|
|
75
|
-
| RequestAbortedError
|
|
76
|
-
| RequestTimeoutError
|
|
77
|
-
| InvalidRequestError
|
|
78
|
-
| UnexpectedClientError
|
|
79
|
-
| SDKValidationError
|
|
80
|
-
>,
|
|
81
|
-
APICall,
|
|
82
|
-
]
|
|
83
|
-
> {
|
|
84
|
-
const parsed = safeParse(
|
|
85
|
-
request,
|
|
86
|
-
(value) =>
|
|
87
|
-
components.DtoDashboardAnalyticsRequest$outboundSchema.parse(value),
|
|
88
|
-
"Input validation failed",
|
|
89
|
-
);
|
|
90
|
-
if (!parsed.ok) {
|
|
91
|
-
return [parsed, { status: "invalid" }];
|
|
92
|
-
}
|
|
93
|
-
const payload = parsed.value;
|
|
94
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
95
|
-
|
|
96
|
-
const path = pathToFunc("/customer-dashboard/analytics")();
|
|
97
|
-
|
|
98
|
-
const headers = new Headers(compactMap({
|
|
99
|
-
"Content-Type": "application/json",
|
|
100
|
-
Accept: "application/json",
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
const requestSecurity = resolveSecurity(
|
|
104
|
-
[
|
|
105
|
-
{
|
|
106
|
-
fieldName: "Authorization",
|
|
107
|
-
type: "apiKey:header",
|
|
108
|
-
value: security?.bearerAuth,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
const context = {
|
|
114
|
-
options: client._options,
|
|
115
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
-
operationID: "post_/customer-dashboard/analytics",
|
|
117
|
-
oAuth2Scopes: null,
|
|
118
|
-
|
|
119
|
-
resolvedSecurity: requestSecurity,
|
|
120
|
-
|
|
121
|
-
securitySource: security,
|
|
122
|
-
retryConfig: options?.retries
|
|
123
|
-
|| client._options.retryConfig
|
|
124
|
-
|| {
|
|
125
|
-
strategy: "backoff",
|
|
126
|
-
backoff: {
|
|
127
|
-
initialInterval: 500,
|
|
128
|
-
maxInterval: 60000,
|
|
129
|
-
exponent: 1.5,
|
|
130
|
-
maxElapsedTime: 3600000,
|
|
131
|
-
},
|
|
132
|
-
retryConnectionErrors: true,
|
|
133
|
-
}
|
|
134
|
-
|| { strategy: "none" },
|
|
135
|
-
retryCodes: options?.retryCodes || ["5XX", "429"],
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const requestRes = client._createRequest(context, {
|
|
139
|
-
security: requestSecurity,
|
|
140
|
-
method: "POST",
|
|
141
|
-
baseURL: options?.serverURL,
|
|
142
|
-
path: path,
|
|
143
|
-
headers: headers,
|
|
144
|
-
body: body,
|
|
145
|
-
userAgent: client._options.userAgent,
|
|
146
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
147
|
-
}, options);
|
|
148
|
-
if (!requestRes.ok) {
|
|
149
|
-
return [requestRes, { status: "invalid" }];
|
|
150
|
-
}
|
|
151
|
-
const req = requestRes.value;
|
|
152
|
-
|
|
153
|
-
const doResult = await client._do(req, {
|
|
154
|
-
context,
|
|
155
|
-
errorCodes: ["401", "4XX", "500", "5XX"],
|
|
156
|
-
retryConfig: context.retryConfig,
|
|
157
|
-
retryCodes: context.retryCodes,
|
|
158
|
-
});
|
|
159
|
-
if (!doResult.ok) {
|
|
160
|
-
return [doResult, { status: "request-error", request: req }];
|
|
161
|
-
}
|
|
162
|
-
const response = doResult.value;
|
|
163
|
-
|
|
164
|
-
const responseFields = {
|
|
165
|
-
HttpMeta: { Response: response, Request: req },
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const [result] = await M.match<
|
|
169
|
-
components.DtoGetUsageAnalyticsResponse,
|
|
170
|
-
| errors.ErrorsErrorResponse
|
|
171
|
-
| FlexPriceError
|
|
172
|
-
| ResponseValidationError
|
|
173
|
-
| ConnectionError
|
|
174
|
-
| RequestAbortedError
|
|
175
|
-
| RequestTimeoutError
|
|
176
|
-
| InvalidRequestError
|
|
177
|
-
| UnexpectedClientError
|
|
178
|
-
| SDKValidationError
|
|
179
|
-
>(
|
|
180
|
-
M.json(200, components.DtoGetUsageAnalyticsResponse$inboundSchema),
|
|
181
|
-
M.jsonErr(401, errors.ErrorsErrorResponse$inboundSchema),
|
|
182
|
-
M.jsonErr(500, errors.ErrorsErrorResponse$inboundSchema),
|
|
183
|
-
M.fail("4XX"),
|
|
184
|
-
M.fail("5XX"),
|
|
185
|
-
)(response, req, { extraFields: responseFields });
|
|
186
|
-
if (!result.ok) {
|
|
187
|
-
return [result, { status: "complete", request: req, response }];
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return [result, { status: "complete", request: req, response }];
|
|
191
|
-
}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { FlexPriceCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { resolveSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
|
-
import { FlexPriceError } from "../models/errors/flexpriceerror.js";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionError,
|
|
17
|
-
InvalidRequestError,
|
|
18
|
-
RequestAbortedError,
|
|
19
|
-
RequestTimeoutError,
|
|
20
|
-
UnexpectedClientError,
|
|
21
|
-
} from "../models/errors/httpclienterrors.js";
|
|
22
|
-
import * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import * as operations from "../models/operations/index.js";
|
|
26
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
-
import { Result } from "../types/fp.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get customer cost analytics
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Get cost analytics for the authenticated customer
|
|
34
|
-
*/
|
|
35
|
-
export function customerDashboardPostCustomerDashboardCostAnalytics(
|
|
36
|
-
client: FlexPriceCore,
|
|
37
|
-
security: operations.PostCustomerDashboardCostAnalyticsSecurity,
|
|
38
|
-
request: components.DtoDashboardCostAnalyticsRequest,
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<
|
|
41
|
-
Result<
|
|
42
|
-
components.DtoGetDetailedCostAnalyticsResponse,
|
|
43
|
-
| errors.ErrorsErrorResponse
|
|
44
|
-
| FlexPriceError
|
|
45
|
-
| ResponseValidationError
|
|
46
|
-
| ConnectionError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| InvalidRequestError
|
|
50
|
-
| UnexpectedClientError
|
|
51
|
-
| SDKValidationError
|
|
52
|
-
>
|
|
53
|
-
> {
|
|
54
|
-
return new APIPromise($do(
|
|
55
|
-
client,
|
|
56
|
-
security,
|
|
57
|
-
request,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function $do(
|
|
63
|
-
client: FlexPriceCore,
|
|
64
|
-
security: operations.PostCustomerDashboardCostAnalyticsSecurity,
|
|
65
|
-
request: components.DtoDashboardCostAnalyticsRequest,
|
|
66
|
-
options?: RequestOptions,
|
|
67
|
-
): Promise<
|
|
68
|
-
[
|
|
69
|
-
Result<
|
|
70
|
-
components.DtoGetDetailedCostAnalyticsResponse,
|
|
71
|
-
| errors.ErrorsErrorResponse
|
|
72
|
-
| FlexPriceError
|
|
73
|
-
| ResponseValidationError
|
|
74
|
-
| ConnectionError
|
|
75
|
-
| RequestAbortedError
|
|
76
|
-
| RequestTimeoutError
|
|
77
|
-
| InvalidRequestError
|
|
78
|
-
| UnexpectedClientError
|
|
79
|
-
| SDKValidationError
|
|
80
|
-
>,
|
|
81
|
-
APICall,
|
|
82
|
-
]
|
|
83
|
-
> {
|
|
84
|
-
const parsed = safeParse(
|
|
85
|
-
request,
|
|
86
|
-
(value) =>
|
|
87
|
-
components.DtoDashboardCostAnalyticsRequest$outboundSchema.parse(value),
|
|
88
|
-
"Input validation failed",
|
|
89
|
-
);
|
|
90
|
-
if (!parsed.ok) {
|
|
91
|
-
return [parsed, { status: "invalid" }];
|
|
92
|
-
}
|
|
93
|
-
const payload = parsed.value;
|
|
94
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
95
|
-
|
|
96
|
-
const path = pathToFunc("/customer-dashboard/cost-analytics")();
|
|
97
|
-
|
|
98
|
-
const headers = new Headers(compactMap({
|
|
99
|
-
"Content-Type": "application/json",
|
|
100
|
-
Accept: "application/json",
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
const requestSecurity = resolveSecurity(
|
|
104
|
-
[
|
|
105
|
-
{
|
|
106
|
-
fieldName: "Authorization",
|
|
107
|
-
type: "apiKey:header",
|
|
108
|
-
value: security?.bearerAuth,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
const context = {
|
|
114
|
-
options: client._options,
|
|
115
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
-
operationID: "post_/customer-dashboard/cost-analytics",
|
|
117
|
-
oAuth2Scopes: null,
|
|
118
|
-
|
|
119
|
-
resolvedSecurity: requestSecurity,
|
|
120
|
-
|
|
121
|
-
securitySource: security,
|
|
122
|
-
retryConfig: options?.retries
|
|
123
|
-
|| client._options.retryConfig
|
|
124
|
-
|| {
|
|
125
|
-
strategy: "backoff",
|
|
126
|
-
backoff: {
|
|
127
|
-
initialInterval: 500,
|
|
128
|
-
maxInterval: 60000,
|
|
129
|
-
exponent: 1.5,
|
|
130
|
-
maxElapsedTime: 3600000,
|
|
131
|
-
},
|
|
132
|
-
retryConnectionErrors: true,
|
|
133
|
-
}
|
|
134
|
-
|| { strategy: "none" },
|
|
135
|
-
retryCodes: options?.retryCodes || ["5XX", "429"],
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const requestRes = client._createRequest(context, {
|
|
139
|
-
security: requestSecurity,
|
|
140
|
-
method: "POST",
|
|
141
|
-
baseURL: options?.serverURL,
|
|
142
|
-
path: path,
|
|
143
|
-
headers: headers,
|
|
144
|
-
body: body,
|
|
145
|
-
userAgent: client._options.userAgent,
|
|
146
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
147
|
-
}, options);
|
|
148
|
-
if (!requestRes.ok) {
|
|
149
|
-
return [requestRes, { status: "invalid" }];
|
|
150
|
-
}
|
|
151
|
-
const req = requestRes.value;
|
|
152
|
-
|
|
153
|
-
const doResult = await client._do(req, {
|
|
154
|
-
context,
|
|
155
|
-
errorCodes: ["401", "4XX", "500", "5XX"],
|
|
156
|
-
retryConfig: context.retryConfig,
|
|
157
|
-
retryCodes: context.retryCodes,
|
|
158
|
-
});
|
|
159
|
-
if (!doResult.ok) {
|
|
160
|
-
return [doResult, { status: "request-error", request: req }];
|
|
161
|
-
}
|
|
162
|
-
const response = doResult.value;
|
|
163
|
-
|
|
164
|
-
const responseFields = {
|
|
165
|
-
HttpMeta: { Response: response, Request: req },
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const [result] = await M.match<
|
|
169
|
-
components.DtoGetDetailedCostAnalyticsResponse,
|
|
170
|
-
| errors.ErrorsErrorResponse
|
|
171
|
-
| FlexPriceError
|
|
172
|
-
| ResponseValidationError
|
|
173
|
-
| ConnectionError
|
|
174
|
-
| RequestAbortedError
|
|
175
|
-
| RequestTimeoutError
|
|
176
|
-
| InvalidRequestError
|
|
177
|
-
| UnexpectedClientError
|
|
178
|
-
| SDKValidationError
|
|
179
|
-
>(
|
|
180
|
-
M.json(200, components.DtoGetDetailedCostAnalyticsResponse$inboundSchema),
|
|
181
|
-
M.jsonErr(401, errors.ErrorsErrorResponse$inboundSchema),
|
|
182
|
-
M.jsonErr(500, errors.ErrorsErrorResponse$inboundSchema),
|
|
183
|
-
M.fail("4XX"),
|
|
184
|
-
M.fail("5XX"),
|
|
185
|
-
)(response, req, { extraFields: responseFields });
|
|
186
|
-
if (!result.ok) {
|
|
187
|
-
return [result, { status: "complete", request: req, response }];
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return [result, { status: "complete", request: req, response }];
|
|
191
|
-
}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { FlexPriceCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { resolveSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
|
-
import { FlexPriceError } from "../models/errors/flexpriceerror.js";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionError,
|
|
17
|
-
InvalidRequestError,
|
|
18
|
-
RequestAbortedError,
|
|
19
|
-
RequestTimeoutError,
|
|
20
|
-
UnexpectedClientError,
|
|
21
|
-
} from "../models/errors/httpclienterrors.js";
|
|
22
|
-
import * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import * as operations from "../models/operations/index.js";
|
|
26
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
-
import { Result } from "../types/fp.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get customer invoices
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Get all invoices for the authenticated customer with pagination
|
|
34
|
-
*/
|
|
35
|
-
export function customerDashboardPostCustomerDashboardInvoices(
|
|
36
|
-
client: FlexPriceCore,
|
|
37
|
-
security: operations.PostCustomerDashboardInvoicesSecurity,
|
|
38
|
-
request: components.DtoDashboardPaginatedRequest,
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<
|
|
41
|
-
Result<
|
|
42
|
-
components.DtoListInvoicesResponse,
|
|
43
|
-
| errors.ErrorsErrorResponse
|
|
44
|
-
| FlexPriceError
|
|
45
|
-
| ResponseValidationError
|
|
46
|
-
| ConnectionError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| InvalidRequestError
|
|
50
|
-
| UnexpectedClientError
|
|
51
|
-
| SDKValidationError
|
|
52
|
-
>
|
|
53
|
-
> {
|
|
54
|
-
return new APIPromise($do(
|
|
55
|
-
client,
|
|
56
|
-
security,
|
|
57
|
-
request,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function $do(
|
|
63
|
-
client: FlexPriceCore,
|
|
64
|
-
security: operations.PostCustomerDashboardInvoicesSecurity,
|
|
65
|
-
request: components.DtoDashboardPaginatedRequest,
|
|
66
|
-
options?: RequestOptions,
|
|
67
|
-
): Promise<
|
|
68
|
-
[
|
|
69
|
-
Result<
|
|
70
|
-
components.DtoListInvoicesResponse,
|
|
71
|
-
| errors.ErrorsErrorResponse
|
|
72
|
-
| FlexPriceError
|
|
73
|
-
| ResponseValidationError
|
|
74
|
-
| ConnectionError
|
|
75
|
-
| RequestAbortedError
|
|
76
|
-
| RequestTimeoutError
|
|
77
|
-
| InvalidRequestError
|
|
78
|
-
| UnexpectedClientError
|
|
79
|
-
| SDKValidationError
|
|
80
|
-
>,
|
|
81
|
-
APICall,
|
|
82
|
-
]
|
|
83
|
-
> {
|
|
84
|
-
const parsed = safeParse(
|
|
85
|
-
request,
|
|
86
|
-
(value) =>
|
|
87
|
-
components.DtoDashboardPaginatedRequest$outboundSchema.parse(value),
|
|
88
|
-
"Input validation failed",
|
|
89
|
-
);
|
|
90
|
-
if (!parsed.ok) {
|
|
91
|
-
return [parsed, { status: "invalid" }];
|
|
92
|
-
}
|
|
93
|
-
const payload = parsed.value;
|
|
94
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
95
|
-
|
|
96
|
-
const path = pathToFunc("/customer-dashboard/invoices")();
|
|
97
|
-
|
|
98
|
-
const headers = new Headers(compactMap({
|
|
99
|
-
"Content-Type": "application/json",
|
|
100
|
-
Accept: "application/json",
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
const requestSecurity = resolveSecurity(
|
|
104
|
-
[
|
|
105
|
-
{
|
|
106
|
-
fieldName: "Authorization",
|
|
107
|
-
type: "apiKey:header",
|
|
108
|
-
value: security?.bearerAuth,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
const context = {
|
|
114
|
-
options: client._options,
|
|
115
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
-
operationID: "post_/customer-dashboard/invoices",
|
|
117
|
-
oAuth2Scopes: null,
|
|
118
|
-
|
|
119
|
-
resolvedSecurity: requestSecurity,
|
|
120
|
-
|
|
121
|
-
securitySource: security,
|
|
122
|
-
retryConfig: options?.retries
|
|
123
|
-
|| client._options.retryConfig
|
|
124
|
-
|| {
|
|
125
|
-
strategy: "backoff",
|
|
126
|
-
backoff: {
|
|
127
|
-
initialInterval: 500,
|
|
128
|
-
maxInterval: 60000,
|
|
129
|
-
exponent: 1.5,
|
|
130
|
-
maxElapsedTime: 3600000,
|
|
131
|
-
},
|
|
132
|
-
retryConnectionErrors: true,
|
|
133
|
-
}
|
|
134
|
-
|| { strategy: "none" },
|
|
135
|
-
retryCodes: options?.retryCodes || ["5XX", "429"],
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const requestRes = client._createRequest(context, {
|
|
139
|
-
security: requestSecurity,
|
|
140
|
-
method: "POST",
|
|
141
|
-
baseURL: options?.serverURL,
|
|
142
|
-
path: path,
|
|
143
|
-
headers: headers,
|
|
144
|
-
body: body,
|
|
145
|
-
userAgent: client._options.userAgent,
|
|
146
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
147
|
-
}, options);
|
|
148
|
-
if (!requestRes.ok) {
|
|
149
|
-
return [requestRes, { status: "invalid" }];
|
|
150
|
-
}
|
|
151
|
-
const req = requestRes.value;
|
|
152
|
-
|
|
153
|
-
const doResult = await client._do(req, {
|
|
154
|
-
context,
|
|
155
|
-
errorCodes: ["401", "4XX", "500", "5XX"],
|
|
156
|
-
retryConfig: context.retryConfig,
|
|
157
|
-
retryCodes: context.retryCodes,
|
|
158
|
-
});
|
|
159
|
-
if (!doResult.ok) {
|
|
160
|
-
return [doResult, { status: "request-error", request: req }];
|
|
161
|
-
}
|
|
162
|
-
const response = doResult.value;
|
|
163
|
-
|
|
164
|
-
const responseFields = {
|
|
165
|
-
HttpMeta: { Response: response, Request: req },
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const [result] = await M.match<
|
|
169
|
-
components.DtoListInvoicesResponse,
|
|
170
|
-
| errors.ErrorsErrorResponse
|
|
171
|
-
| FlexPriceError
|
|
172
|
-
| ResponseValidationError
|
|
173
|
-
| ConnectionError
|
|
174
|
-
| RequestAbortedError
|
|
175
|
-
| RequestTimeoutError
|
|
176
|
-
| InvalidRequestError
|
|
177
|
-
| UnexpectedClientError
|
|
178
|
-
| SDKValidationError
|
|
179
|
-
>(
|
|
180
|
-
M.json(200, components.DtoListInvoicesResponse$inboundSchema),
|
|
181
|
-
M.jsonErr(401, errors.ErrorsErrorResponse$inboundSchema),
|
|
182
|
-
M.jsonErr(500, errors.ErrorsErrorResponse$inboundSchema),
|
|
183
|
-
M.fail("4XX"),
|
|
184
|
-
M.fail("5XX"),
|
|
185
|
-
)(response, req, { extraFields: responseFields });
|
|
186
|
-
if (!result.ok) {
|
|
187
|
-
return [result, { status: "complete", request: req, response }];
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return [result, { status: "complete", request: req, response }];
|
|
191
|
-
}
|