@maesn/typescript-sdk 0.8.29 → 0.8.30
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 +5 -10
- package/esm/funcs/{events-handle-callback.d.ts → accounting-book-payment.d.ts} +3 -2
- package/esm/funcs/accounting-book-payment.d.ts.map +1 -0
- package/esm/funcs/{events-handle-callback.js → accounting-book-payment.js} +14 -8
- package/esm/funcs/accounting-book-payment.js.map +1 -0
- package/esm/funcs/{events-get-code.d.ts → auth-validate-connection.d.ts} +2 -2
- package/esm/funcs/auth-validate-connection.d.ts.map +1 -0
- package/esm/funcs/{events-get-code.js → auth-validate-connection.js} +8 -14
- package/esm/funcs/auth-validate-connection.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/env.d.ts.map +1 -1
- package/esm/lib/env.js +4 -1
- package/esm/lib/env.js.map +1 -1
- package/esm/models/connection-validation-response-dto.d.ts +17 -0
- package/esm/models/connection-validation-response-dto.d.ts.map +1 -0
- package/esm/models/connection-validation-response-dto.js +15 -0
- package/esm/models/connection-validation-response-dto.js.map +1 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +2 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/invoice-response-dto.d.ts +1 -0
- package/esm/models/invoice-response-dto.d.ts.map +1 -1
- package/esm/models/invoice-response-dto.js +1 -0
- package/esm/models/invoice-response-dto.js.map +1 -1
- package/esm/models/operations/book-payment.d.ts +36 -0
- package/esm/models/operations/book-payment.d.ts.map +1 -0
- package/esm/models/operations/book-payment.js +16 -0
- package/esm/models/operations/book-payment.js.map +1 -0
- package/esm/models/operations/index.d.ts +2 -3
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +2 -3
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/validate-connection.d.ts +64 -0
- package/esm/models/operations/validate-connection.d.ts.map +1 -0
- package/esm/models/operations/validate-connection.js +55 -0
- package/esm/models/operations/validate-connection.js.map +1 -0
- package/esm/models/submission-page-input-texts-dto.d.ts +30 -0
- package/esm/models/submission-page-input-texts-dto.d.ts.map +1 -0
- package/esm/models/submission-page-input-texts-dto.js +21 -0
- package/esm/models/submission-page-input-texts-dto.js.map +1 -0
- package/esm/models/submission-page-localization-dto.d.ts +5 -0
- package/esm/models/submission-page-localization-dto.d.ts.map +1 -1
- package/esm/models/submission-page-localization-dto.js +3 -0
- package/esm/models/submission-page-localization-dto.js.map +1 -1
- package/esm/sdk/accounting.d.ts +1 -0
- package/esm/sdk/accounting.d.ts.map +1 -1
- package/esm/sdk/accounting.js +4 -0
- package/esm/sdk/accounting.js.map +1 -1
- package/esm/sdk/auth.d.ts +1 -0
- package/esm/sdk/auth.d.ts.map +1 -1
- package/esm/sdk/auth.js +4 -0
- package/esm/sdk/auth.js.map +1 -1
- package/esm/sdk/sdk.d.ts +0 -3
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +0 -5
- package/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/{events-handle-configuration-callback.ts → accounting-book-payment.ts} +19 -16
- package/src/funcs/{events-get-code.ts → auth-validate-connection.ts} +16 -18
- package/src/lib/config.ts +3 -3
- package/src/lib/env.ts +7 -1
- package/src/models/connection-validation-response-dto.ts +39 -0
- package/src/models/index.ts +2 -0
- package/src/models/invoice-response-dto.ts +2 -0
- package/src/models/operations/book-payment.ts +59 -0
- package/src/models/operations/index.ts +2 -3
- package/src/models/operations/validate-connection.ts +178 -0
- package/src/models/submission-page-input-texts-dto.ts +59 -0
- package/src/models/submission-page-localization-dto.ts +11 -0
- package/src/sdk/accounting.ts +12 -0
- package/src/sdk/auth.ts +12 -0
- package/src/sdk/sdk.ts +0 -6
- package/esm/funcs/events-get-code.d.ts.map +0 -1
- package/esm/funcs/events-get-code.js.map +0 -1
- package/esm/funcs/events-handle-callback.d.ts.map +0 -1
- package/esm/funcs/events-handle-callback.js.map +0 -1
- package/esm/funcs/events-handle-configuration-callback.d.ts +0 -11
- package/esm/funcs/events-handle-configuration-callback.d.ts.map +0 -1
- package/esm/funcs/events-handle-configuration-callback.js +0 -76
- package/esm/funcs/events-handle-configuration-callback.js.map +0 -1
- package/esm/models/operations/get-code.d.ts +0 -35
- package/esm/models/operations/get-code.d.ts.map +0 -1
- package/esm/models/operations/get-code.js +0 -20
- package/esm/models/operations/get-code.js.map +0 -1
- package/esm/models/operations/handle-callback.d.ts +0 -35
- package/esm/models/operations/handle-callback.d.ts.map +0 -1
- package/esm/models/operations/handle-callback.js +0 -20
- package/esm/models/operations/handle-callback.js.map +0 -1
- package/esm/models/operations/handle-configuration-callback.d.ts +0 -35
- package/esm/models/operations/handle-configuration-callback.d.ts.map +0 -1
- package/esm/models/operations/handle-configuration-callback.js +0 -20
- package/esm/models/operations/handle-configuration-callback.js.map +0 -1
- package/esm/sdk/events.d.ts +0 -8
- package/esm/sdk/events.d.ts.map +0 -1
- package/esm/sdk/events.js +0 -20
- package/esm/sdk/events.js.map +0 -1
- package/src/funcs/events-handle-callback.ts +0 -166
- package/src/models/operations/get-code.ts +0 -67
- package/src/models/operations/handle-callback.ts +0 -71
- package/src/models/operations/handle-configuration-callback.ts +0 -74
- package/src/sdk/events.ts +0 -45
package/esm/sdk/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,KAAM,SAAQ,SAAS;IAClC,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,OAAO,CAAC,aAAa,CAAC,CAAe;IACrC,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF"}
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -5,7 +5,6 @@ import { ClientSDK } from "../lib/sdks.js";
|
|
|
5
5
|
import { AccountingV2 } from "./accounting-v2.js";
|
|
6
6
|
import { Accounting } from "./accounting.js";
|
|
7
7
|
import { Auth } from "./auth.js";
|
|
8
|
-
import { Events } from "./events.js";
|
|
9
8
|
import { Health } from "./health.js";
|
|
10
9
|
import { Tenants } from "./tenants.js";
|
|
11
10
|
import { User } from "./user.js";
|
|
@@ -31,10 +30,6 @@ export class Maesn extends ClientSDK {
|
|
|
31
30
|
get tenants() {
|
|
32
31
|
return (this._tenants ?? (this._tenants = new Tenants(this._options)));
|
|
33
32
|
}
|
|
34
|
-
_events;
|
|
35
|
-
get events() {
|
|
36
|
-
return (this._events ?? (this._events = new Events(this._options)));
|
|
37
|
-
}
|
|
38
33
|
_webhooks;
|
|
39
34
|
get webhooks() {
|
|
40
35
|
return (this._webhooks ?? (this._webhooks = new Webhooks(this._options)));
|
package/esm/sdk/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,KAAM,SAAQ,SAAS;IAC1B,WAAW,CAAc;IACjC,IAAI,UAAU,GAAe;QAC3B,OAAO,CAAC,IAAI,CAAC,WAAW,KAAhB,IAAI,CAAC,WAAW,GAAK,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CAC7D;IAEO,aAAa,CAAgB;IACrC,IAAI,YAAY,GAAiB;QAC/B,OAAO,CAAC,IAAI,CAAC,aAAa,KAAlB,IAAI,CAAC,aAAa,GAAK,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACjE;IAEO,KAAK,CAAQ;IACrB,IAAI,IAAI,GAAS;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,KAAV,IAAI,CAAC,KAAK,GAAK,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACjD;IAEO,KAAK,CAAQ;IACrB,IAAI,IAAI,GAAS;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,KAAV,IAAI,CAAC,KAAK,GAAK,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACjD;IAEO,QAAQ,CAAW;IAC3B,IAAI,OAAO,GAAY;QACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACvD;IAEO,SAAS,CAAY;IAC7B,IAAI,QAAQ,GAAa;QACvB,OAAO,CAAC,IAAI,CAAC,SAAS,KAAd,IAAI,CAAC,SAAS,GAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACzD;IAEO,OAAO,CAAU;IACzB,IAAI,MAAM,GAAW;QACnB,OAAO,CAAC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACrD;CACF"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maesn/typescript-sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.30",
|
|
4
4
|
"author": "Speakeasy",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
"typescript": "~5.8.3"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"zod": "^3.25.65 || ^4.
|
|
68
|
+
"zod": "^3.25.65 || ^4.6.6"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { MaesnCore } from "../core.js";
|
|
7
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
9
|
import * as M from "../lib/matchers.js";
|
|
10
10
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -21,17 +21,18 @@ import {
|
|
|
21
21
|
import { MaesnError } from "../models/errors/maesn-error.js";
|
|
22
22
|
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
23
23
|
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
24
25
|
import * as operations from "../models/operations/index.js";
|
|
25
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
27
|
import { Result } from "../types/fp.js";
|
|
27
28
|
|
|
28
|
-
export function
|
|
29
|
+
export function accountingBookPayment(
|
|
29
30
|
client: MaesnCore,
|
|
30
|
-
request: operations.
|
|
31
|
+
request: operations.BookPaymentRequest,
|
|
31
32
|
options?: RequestOptions,
|
|
32
33
|
): APIPromise<
|
|
33
34
|
Result<
|
|
34
|
-
|
|
35
|
+
models.BaseResponseDto,
|
|
35
36
|
| MaesnError
|
|
36
37
|
| ResponseValidationError
|
|
37
38
|
| ConnectionError
|
|
@@ -51,12 +52,12 @@ export function eventsHandleConfigurationCallback(
|
|
|
51
52
|
|
|
52
53
|
async function $do(
|
|
53
54
|
client: MaesnCore,
|
|
54
|
-
request: operations.
|
|
55
|
+
request: operations.BookPaymentRequest,
|
|
55
56
|
options?: RequestOptions,
|
|
56
57
|
): Promise<
|
|
57
58
|
[
|
|
58
59
|
Result<
|
|
59
|
-
|
|
60
|
+
models.BaseResponseDto,
|
|
60
61
|
| MaesnError
|
|
61
62
|
| ResponseValidationError
|
|
62
63
|
| ConnectionError
|
|
@@ -71,11 +72,7 @@ async function $do(
|
|
|
71
72
|
> {
|
|
72
73
|
const parsed = safeParse(
|
|
73
74
|
request,
|
|
74
|
-
(value) =>
|
|
75
|
-
z.parse(
|
|
76
|
-
operations.HandleConfigurationCallbackRequest$outboundSchema,
|
|
77
|
-
value,
|
|
78
|
-
),
|
|
75
|
+
(value) => z.parse(operations.BookPaymentRequest$outboundSchema, value),
|
|
79
76
|
"Input validation failed",
|
|
80
77
|
);
|
|
81
78
|
if (!parsed.ok) {
|
|
@@ -85,12 +82,17 @@ async function $do(
|
|
|
85
82
|
const body = null;
|
|
86
83
|
|
|
87
84
|
const pathParams = {
|
|
88
|
-
|
|
85
|
+
paymentId: encodeSimple("paymentId", payload.paymentId, {
|
|
89
86
|
explode: false,
|
|
90
87
|
charEncoding: "percent",
|
|
91
88
|
}),
|
|
92
89
|
};
|
|
93
|
-
const path = pathToFunc("/
|
|
90
|
+
const path = pathToFunc("/accounting/payments/{paymentId}/book")(pathParams);
|
|
91
|
+
|
|
92
|
+
const query = encodeFormQuery({
|
|
93
|
+
"companyId": payload.companyId,
|
|
94
|
+
"environmentName": payload.environmentName,
|
|
95
|
+
});
|
|
94
96
|
|
|
95
97
|
const headers = new Headers(compactMap({
|
|
96
98
|
Accept: "application/json",
|
|
@@ -109,7 +111,7 @@ async function $do(
|
|
|
109
111
|
const context = {
|
|
110
112
|
options: client._options,
|
|
111
113
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
-
operationID: "
|
|
114
|
+
operationID: "bookPayment",
|
|
113
115
|
oAuth2Scopes: null,
|
|
114
116
|
|
|
115
117
|
resolvedSecurity: null,
|
|
@@ -126,6 +128,7 @@ async function $do(
|
|
|
126
128
|
baseURL: options?.serverURL,
|
|
127
129
|
path: path,
|
|
128
130
|
headers: headers,
|
|
131
|
+
query: query,
|
|
129
132
|
body: body,
|
|
130
133
|
userAgent: client._options.userAgent,
|
|
131
134
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
@@ -148,7 +151,7 @@ async function $do(
|
|
|
148
151
|
const response = doResult.value;
|
|
149
152
|
|
|
150
153
|
const [result] = await M.match<
|
|
151
|
-
|
|
154
|
+
models.BaseResponseDto,
|
|
152
155
|
| MaesnError
|
|
153
156
|
| ResponseValidationError
|
|
154
157
|
| ConnectionError
|
|
@@ -158,7 +161,7 @@ async function $do(
|
|
|
158
161
|
| UnexpectedClientError
|
|
159
162
|
| SDKValidationError
|
|
160
163
|
>(
|
|
161
|
-
M.json(
|
|
164
|
+
M.json(201, models.BaseResponseDto$inboundSchema),
|
|
162
165
|
M.fail("4XX"),
|
|
163
166
|
M.fail("5XX"),
|
|
164
167
|
)(response, req);
|
|
@@ -25,13 +25,13 @@ import * as operations from "../models/operations/index.js";
|
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
|
-
export function
|
|
28
|
+
export function authValidateConnection(
|
|
29
29
|
client: MaesnCore,
|
|
30
|
-
request
|
|
30
|
+
request?: operations.ValidateConnectionRequest | undefined,
|
|
31
31
|
options?: RequestOptions,
|
|
32
32
|
): APIPromise<
|
|
33
33
|
Result<
|
|
34
|
-
operations.
|
|
34
|
+
operations.ValidateConnectionResponse,
|
|
35
35
|
| MaesnError
|
|
36
36
|
| ResponseValidationError
|
|
37
37
|
| ConnectionError
|
|
@@ -51,12 +51,12 @@ export function eventsGetCode(
|
|
|
51
51
|
|
|
52
52
|
async function $do(
|
|
53
53
|
client: MaesnCore,
|
|
54
|
-
request
|
|
54
|
+
request?: operations.ValidateConnectionRequest | undefined,
|
|
55
55
|
options?: RequestOptions,
|
|
56
56
|
): Promise<
|
|
57
57
|
[
|
|
58
58
|
Result<
|
|
59
|
-
operations.
|
|
59
|
+
operations.ValidateConnectionResponse,
|
|
60
60
|
| MaesnError
|
|
61
61
|
| ResponseValidationError
|
|
62
62
|
| ConnectionError
|
|
@@ -71,7 +71,11 @@ async function $do(
|
|
|
71
71
|
> {
|
|
72
72
|
const parsed = safeParse(
|
|
73
73
|
request,
|
|
74
|
-
(value) =>
|
|
74
|
+
(value) =>
|
|
75
|
+
z.parse(
|
|
76
|
+
z.optional(operations.ValidateConnectionRequest$outboundSchema),
|
|
77
|
+
value,
|
|
78
|
+
),
|
|
75
79
|
"Input validation failed",
|
|
76
80
|
);
|
|
77
81
|
if (!parsed.ok) {
|
|
@@ -80,24 +84,18 @@ async function $do(
|
|
|
80
84
|
const payload = parsed.value;
|
|
81
85
|
const body = null;
|
|
82
86
|
|
|
83
|
-
const
|
|
84
|
-
code: encodeSimple("code", payload.code, {
|
|
85
|
-
explode: false,
|
|
86
|
-
charEncoding: "percent",
|
|
87
|
-
}),
|
|
88
|
-
};
|
|
89
|
-
const path = pathToFunc("/events/key/{code}")(pathParams);
|
|
87
|
+
const path = pathToFunc("/auth/connections/validate")();
|
|
90
88
|
|
|
91
89
|
const headers = new Headers(compactMap({
|
|
92
90
|
Accept: "application/json",
|
|
93
91
|
"X-ACCOUNT-KEY": encodeSimple(
|
|
94
92
|
"X-ACCOUNT-KEY",
|
|
95
|
-
payload
|
|
93
|
+
payload?.accountKey ?? client._options.accountKey,
|
|
96
94
|
{ explode: false, charEncoding: "none" },
|
|
97
95
|
),
|
|
98
96
|
"X-API-KEY": encodeSimple(
|
|
99
97
|
"X-API-KEY",
|
|
100
|
-
payload
|
|
98
|
+
payload?.apiKey ?? client._options.apiKey,
|
|
101
99
|
{ explode: false, charEncoding: "none" },
|
|
102
100
|
),
|
|
103
101
|
}));
|
|
@@ -105,7 +103,7 @@ async function $do(
|
|
|
105
103
|
const context = {
|
|
106
104
|
options: client._options,
|
|
107
105
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
108
|
-
operationID: "
|
|
106
|
+
operationID: "validateConnection",
|
|
109
107
|
oAuth2Scopes: null,
|
|
110
108
|
|
|
111
109
|
resolvedSecurity: null,
|
|
@@ -144,7 +142,7 @@ async function $do(
|
|
|
144
142
|
const response = doResult.value;
|
|
145
143
|
|
|
146
144
|
const [result] = await M.match<
|
|
147
|
-
operations.
|
|
145
|
+
operations.ValidateConnectionResponse,
|
|
148
146
|
| MaesnError
|
|
149
147
|
| ResponseValidationError
|
|
150
148
|
| ConnectionError
|
|
@@ -154,7 +152,7 @@ async function $do(
|
|
|
154
152
|
| UnexpectedClientError
|
|
155
153
|
| SDKValidationError
|
|
156
154
|
>(
|
|
157
|
-
M.json(
|
|
155
|
+
M.json(200, operations.ValidateConnectionResponse$inboundSchema),
|
|
158
156
|
M.fail("4XX"),
|
|
159
157
|
M.fail("5XX"),
|
|
160
158
|
)(response, req);
|
package/src/lib/config.ts
CHANGED
|
@@ -51,8 +51,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
51
51
|
export const SDK_METADATA = {
|
|
52
52
|
language: "typescript",
|
|
53
53
|
openapiDocVersion: "1.0",
|
|
54
|
-
sdkVersion: "0.8.
|
|
55
|
-
genVersion: "2.
|
|
54
|
+
sdkVersion: "0.8.30",
|
|
55
|
+
genVersion: "2.961.1",
|
|
56
56
|
userAgent:
|
|
57
|
-
"speakeasy-sdk/typescript 0.8.
|
|
57
|
+
"speakeasy-sdk/typescript 0.8.30 2.961.1 1.0 @maesn/typescript-sdk",
|
|
58
58
|
} as const;
|
package/src/lib/env.ts
CHANGED
|
@@ -23,9 +23,15 @@ export const envSchema: z.ZodMiniType<Env, unknown> = z.object({
|
|
|
23
23
|
MAESN_API_KEY: z.optional(z.string()),
|
|
24
24
|
MAESN_ACCOUNT_KEY: z.optional(z.string()),
|
|
25
25
|
|
|
26
|
-
MAESN_DEBUG: z.optional(z.
|
|
26
|
+
MAESN_DEBUG: z.optional(z.pipe(z.unknown(), z.transform(parseEnvFlag))),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
function parseEnvFlag(value: unknown): boolean {
|
|
30
|
+
return ["true", "1", "yes", "on"].includes(
|
|
31
|
+
String(value).trim().toLowerCase(),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
/**
|
|
30
36
|
* Checks for the existence of the Deno global object to determine the environment.
|
|
31
37
|
* @returns {boolean} True if the runtime is Deno, false otherwise.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import * as types from "../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type ConnectionValidationResponseDto = {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the connection is valid and can be used to make API calls
|
|
14
|
+
*/
|
|
15
|
+
valid: boolean | null;
|
|
16
|
+
/**
|
|
17
|
+
* The target system identifier
|
|
18
|
+
*/
|
|
19
|
+
targetSystem: string | null;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const ConnectionValidationResponseDto$inboundSchema: z.ZodMiniType<
|
|
24
|
+
ConnectionValidationResponseDto,
|
|
25
|
+
unknown
|
|
26
|
+
> = z.object({
|
|
27
|
+
valid: types.nullable(types.boolean()),
|
|
28
|
+
targetSystem: types.nullable(types.string()),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export function connectionValidationResponseDtoFromJSON(
|
|
32
|
+
jsonString: string,
|
|
33
|
+
): SafeParseResult<ConnectionValidationResponseDto, SDKValidationError> {
|
|
34
|
+
return safeParse(
|
|
35
|
+
jsonString,
|
|
36
|
+
(x) => ConnectionValidationResponseDto$inboundSchema.parse(JSON.parse(x)),
|
|
37
|
+
`Failed to parse 'ConnectionValidationResponseDto' from JSON`,
|
|
38
|
+
);
|
|
39
|
+
}
|
package/src/models/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from "./booking-proposal-response-dto-v2.js";
|
|
|
27
27
|
export * from "./booking-proposal-response-dto.js";
|
|
28
28
|
export * from "./callback-url-registration-dto.js";
|
|
29
29
|
export * from "./company-response-dto.js";
|
|
30
|
+
export * from "./connection-validation-response-dto.js";
|
|
30
31
|
export * from "./contact-address-v2.js";
|
|
31
32
|
export * from "./contact-address.js";
|
|
32
33
|
export * from "./contact-by-batch-meta-data-response-dto.js";
|
|
@@ -139,6 +140,7 @@ export * from "./purchase-order-response-dto.js";
|
|
|
139
140
|
export * from "./reason-code-response-dto.js";
|
|
140
141
|
export * from "./sales-order-line-item-response-dto.js";
|
|
141
142
|
export * from "./sales-order-response-dto.js";
|
|
143
|
+
export * from "./submission-page-input-texts-dto.js";
|
|
142
144
|
export * from "./submission-page-localization-dto.js";
|
|
143
145
|
export * from "./submission-page-style-dto.js";
|
|
144
146
|
export * from "./subscription.js";
|
|
@@ -103,6 +103,7 @@ export type InvoiceResponseDto = {
|
|
|
103
103
|
lineItems: Array<LineItemResponseDto> | null;
|
|
104
104
|
name: string | null;
|
|
105
105
|
oneLineAddress: string | null;
|
|
106
|
+
openAmount: number | null;
|
|
106
107
|
paidDate: string | null;
|
|
107
108
|
paymentStatus: InvoiceResponseDtoPaymentStatus | null;
|
|
108
109
|
paymentTermDuration: number | null;
|
|
@@ -167,6 +168,7 @@ export const InvoiceResponseDto$inboundSchema: z.ZodMiniType<
|
|
|
167
168
|
lineItems: types.nullable(z.array(LineItemResponseDto$inboundSchema)),
|
|
168
169
|
name: types.nullable(types.string()),
|
|
169
170
|
oneLineAddress: types.nullable(types.string()),
|
|
171
|
+
openAmount: types.nullable(types.number()),
|
|
170
172
|
paidDate: types.nullable(types.string()),
|
|
171
173
|
paymentStatus: types.nullable(InvoiceResponseDtoPaymentStatus$inboundSchema),
|
|
172
174
|
paymentTermDuration: types.nullable(types.number()),
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type BookPaymentGlobals = {
|
|
8
|
+
apiKey?: string | undefined;
|
|
9
|
+
accountKey?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type BookPaymentRequest = {
|
|
13
|
+
paymentId: string;
|
|
14
|
+
/**
|
|
15
|
+
* ID of the company (required for multi-company target systems)
|
|
16
|
+
*/
|
|
17
|
+
companyId?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Environment name (required for multi-environment systems such as Business Central)
|
|
20
|
+
*/
|
|
21
|
+
environmentName?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* API key
|
|
24
|
+
*/
|
|
25
|
+
apiKey?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Account key
|
|
28
|
+
*/
|
|
29
|
+
accountKey?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type BookPaymentRequest$Outbound = {
|
|
34
|
+
paymentId: string;
|
|
35
|
+
companyId?: string | undefined;
|
|
36
|
+
environmentName?: string | undefined;
|
|
37
|
+
apiKey?: string | undefined;
|
|
38
|
+
accountKey?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const BookPaymentRequest$outboundSchema: z.ZodMiniType<
|
|
43
|
+
BookPaymentRequest$Outbound,
|
|
44
|
+
BookPaymentRequest
|
|
45
|
+
> = z.object({
|
|
46
|
+
paymentId: z.string(),
|
|
47
|
+
companyId: z.optional(z.string()),
|
|
48
|
+
environmentName: z.optional(z.string()),
|
|
49
|
+
apiKey: z.optional(z.string()),
|
|
50
|
+
accountKey: z.optional(z.string()),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export function bookPaymentRequestToJSON(
|
|
54
|
+
bookPaymentRequest: BookPaymentRequest,
|
|
55
|
+
): string {
|
|
56
|
+
return JSON.stringify(
|
|
57
|
+
BookPaymentRequest$outboundSchema.parse(bookPaymentRequest),
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export * from "./add-callback-url.js";
|
|
6
|
+
export * from "./book-payment.js";
|
|
6
7
|
export * from "./check.js";
|
|
7
8
|
export * from "./count-end-users-by-system.js";
|
|
8
9
|
export * from "./create-account.js";
|
|
@@ -68,7 +69,6 @@ export * from "./get-booking-proposal-document.js";
|
|
|
68
69
|
export * from "./get-booking-proposal.js";
|
|
69
70
|
export * from "./get-booking-proposals.js";
|
|
70
71
|
export * from "./get-callback-url.js";
|
|
71
|
-
export * from "./get-code.js";
|
|
72
72
|
export * from "./get-companies.js";
|
|
73
73
|
export * from "./get-contact-async.js";
|
|
74
74
|
export * from "./get-contact-v2.js";
|
|
@@ -151,8 +151,6 @@ export * from "./get-units.js";
|
|
|
151
151
|
export * from "./get-user-info.js";
|
|
152
152
|
export * from "./get-vendor-credits.js";
|
|
153
153
|
export * from "./get-webhooks.js";
|
|
154
|
-
export * from "./handle-callback.js";
|
|
155
|
-
export * from "./handle-configuration-callback.js";
|
|
156
154
|
export * from "./patch-contact-v2.js";
|
|
157
155
|
export * from "./patch-contact.js";
|
|
158
156
|
export * from "./patch-customers.js";
|
|
@@ -179,3 +177,4 @@ export * from "./update-journal-entry.js";
|
|
|
179
177
|
export * from "./update-submission-page-style.js";
|
|
180
178
|
export * from "./update-supplier.js";
|
|
181
179
|
export * from "./update-vendor-credit.js";
|
|
180
|
+
export * from "./validate-connection.js";
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
11
|
+
|
|
12
|
+
export type ValidateConnectionGlobals = {
|
|
13
|
+
apiKey?: string | undefined;
|
|
14
|
+
accountKey?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type ValidateConnectionRequest = {
|
|
18
|
+
/**
|
|
19
|
+
* API key
|
|
20
|
+
*/
|
|
21
|
+
apiKey?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Account key
|
|
24
|
+
*/
|
|
25
|
+
accountKey?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ValidateConnectionPagination = {
|
|
29
|
+
total: number;
|
|
30
|
+
perPage: number;
|
|
31
|
+
currentPage: number;
|
|
32
|
+
totalPages: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type ValidateConnectionMeta = {
|
|
36
|
+
warnings?: Array<string> | null | undefined;
|
|
37
|
+
pagination?: ValidateConnectionPagination | null | undefined;
|
|
38
|
+
partialErrors?: Array<models.PartialError> | null | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type ValidateConnectionErrors = {};
|
|
42
|
+
|
|
43
|
+
export type ValidateConnectionRawData = {};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Validates the connection for the authenticated end user
|
|
47
|
+
*/
|
|
48
|
+
export type ValidateConnectionResponse = {
|
|
49
|
+
meta?: ValidateConnectionMeta | null | undefined;
|
|
50
|
+
data: models.ConnectionValidationResponseDto;
|
|
51
|
+
errors: ValidateConnectionErrors | null;
|
|
52
|
+
rawData: ValidateConnectionRawData | null;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export type ValidateConnectionRequest$Outbound = {
|
|
57
|
+
apiKey?: string | undefined;
|
|
58
|
+
accountKey?: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const ValidateConnectionRequest$outboundSchema: z.ZodMiniType<
|
|
63
|
+
ValidateConnectionRequest$Outbound,
|
|
64
|
+
ValidateConnectionRequest
|
|
65
|
+
> = z.object({
|
|
66
|
+
apiKey: z.optional(z.string()),
|
|
67
|
+
accountKey: z.optional(z.string()),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export function validateConnectionRequestToJSON(
|
|
71
|
+
validateConnectionRequest: ValidateConnectionRequest,
|
|
72
|
+
): string {
|
|
73
|
+
return JSON.stringify(
|
|
74
|
+
ValidateConnectionRequest$outboundSchema.parse(validateConnectionRequest),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** @internal */
|
|
79
|
+
export const ValidateConnectionPagination$inboundSchema: z.ZodMiniType<
|
|
80
|
+
ValidateConnectionPagination,
|
|
81
|
+
unknown
|
|
82
|
+
> = z.object({
|
|
83
|
+
total: types.number(),
|
|
84
|
+
perPage: types.number(),
|
|
85
|
+
currentPage: types.number(),
|
|
86
|
+
totalPages: types.number(),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export function validateConnectionPaginationFromJSON(
|
|
90
|
+
jsonString: string,
|
|
91
|
+
): SafeParseResult<ValidateConnectionPagination, SDKValidationError> {
|
|
92
|
+
return safeParse(
|
|
93
|
+
jsonString,
|
|
94
|
+
(x) => ValidateConnectionPagination$inboundSchema.parse(JSON.parse(x)),
|
|
95
|
+
`Failed to parse 'ValidateConnectionPagination' from JSON`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const ValidateConnectionMeta$inboundSchema: z.ZodMiniType<
|
|
101
|
+
ValidateConnectionMeta,
|
|
102
|
+
unknown
|
|
103
|
+
> = z.object({
|
|
104
|
+
warnings: z.optional(z.nullable(z.array(types.string()))),
|
|
105
|
+
pagination: z.optional(
|
|
106
|
+
z.nullable(z.lazy(() => ValidateConnectionPagination$inboundSchema)),
|
|
107
|
+
),
|
|
108
|
+
partialErrors: z.optional(
|
|
109
|
+
z.nullable(z.array(models.PartialError$inboundSchema)),
|
|
110
|
+
),
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export function validateConnectionMetaFromJSON(
|
|
114
|
+
jsonString: string,
|
|
115
|
+
): SafeParseResult<ValidateConnectionMeta, SDKValidationError> {
|
|
116
|
+
return safeParse(
|
|
117
|
+
jsonString,
|
|
118
|
+
(x) => ValidateConnectionMeta$inboundSchema.parse(JSON.parse(x)),
|
|
119
|
+
`Failed to parse 'ValidateConnectionMeta' from JSON`,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** @internal */
|
|
124
|
+
export const ValidateConnectionErrors$inboundSchema: z.ZodMiniType<
|
|
125
|
+
ValidateConnectionErrors,
|
|
126
|
+
unknown
|
|
127
|
+
> = z.object({});
|
|
128
|
+
|
|
129
|
+
export function validateConnectionErrorsFromJSON(
|
|
130
|
+
jsonString: string,
|
|
131
|
+
): SafeParseResult<ValidateConnectionErrors, SDKValidationError> {
|
|
132
|
+
return safeParse(
|
|
133
|
+
jsonString,
|
|
134
|
+
(x) => ValidateConnectionErrors$inboundSchema.parse(JSON.parse(x)),
|
|
135
|
+
`Failed to parse 'ValidateConnectionErrors' from JSON`,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** @internal */
|
|
140
|
+
export const ValidateConnectionRawData$inboundSchema: z.ZodMiniType<
|
|
141
|
+
ValidateConnectionRawData,
|
|
142
|
+
unknown
|
|
143
|
+
> = z.object({});
|
|
144
|
+
|
|
145
|
+
export function validateConnectionRawDataFromJSON(
|
|
146
|
+
jsonString: string,
|
|
147
|
+
): SafeParseResult<ValidateConnectionRawData, SDKValidationError> {
|
|
148
|
+
return safeParse(
|
|
149
|
+
jsonString,
|
|
150
|
+
(x) => ValidateConnectionRawData$inboundSchema.parse(JSON.parse(x)),
|
|
151
|
+
`Failed to parse 'ValidateConnectionRawData' from JSON`,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** @internal */
|
|
156
|
+
export const ValidateConnectionResponse$inboundSchema: z.ZodMiniType<
|
|
157
|
+
ValidateConnectionResponse,
|
|
158
|
+
unknown
|
|
159
|
+
> = z.object({
|
|
160
|
+
meta: z.optional(
|
|
161
|
+
z.nullable(z.lazy(() => ValidateConnectionMeta$inboundSchema)),
|
|
162
|
+
),
|
|
163
|
+
data: models.ConnectionValidationResponseDto$inboundSchema,
|
|
164
|
+
errors: types.nullable(z.lazy(() => ValidateConnectionErrors$inboundSchema)),
|
|
165
|
+
rawData: types.nullable(
|
|
166
|
+
z.lazy(() => ValidateConnectionRawData$inboundSchema),
|
|
167
|
+
),
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export function validateConnectionResponseFromJSON(
|
|
171
|
+
jsonString: string,
|
|
172
|
+
): SafeParseResult<ValidateConnectionResponse, SDKValidationError> {
|
|
173
|
+
return safeParse(
|
|
174
|
+
jsonString,
|
|
175
|
+
(x) => ValidateConnectionResponse$inboundSchema.parse(JSON.parse(x)),
|
|
176
|
+
`Failed to parse 'ValidateConnectionResponse' from JSON`,
|
|
177
|
+
);
|
|
178
|
+
}
|