@novu/api 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -20
- package/docs/sdks/novu/README.md +0 -227
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/index.d.ts +0 -3
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -3
- package/models/components/index.js.map +1 -1
- package/models/errors/index.d.ts +0 -1
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +0 -1
- package/models/errors/index.js.map +1 -1
- package/models/operations/index.d.ts +0 -3
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -3
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/sdk.d.ts +0 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +0 -12
- package/sdk/sdk.js.map +1 -1
- package/sources/json-development.json +0 -1161
- package/src/lib/config.ts +2 -2
- package/src/models/components/index.ts +0 -3
- package/src/models/errors/index.ts +0 -1
- package/src/models/operations/index.ts +0 -3
- package/src/sdk/sdk.ts +0 -38
- package/funcs/generateRandomNumber.d.ts +0 -10
- package/funcs/generateRandomNumber.d.ts.map +0 -1
- package/funcs/generateRandomNumber.js +0 -126
- package/funcs/generateRandomNumber.js.map +0 -1
- package/funcs/healthControllerHealthCheck.d.ts +0 -10
- package/funcs/healthControllerHealthCheck.d.ts.map +0 -1
- package/funcs/healthControllerHealthCheck.js +0 -109
- package/funcs/healthControllerHealthCheck.js.map +0 -1
- package/funcs/testIdempotency.d.ts +0 -11
- package/funcs/testIdempotency.d.ts.map +0 -1
- package/funcs/testIdempotency.js +0 -129
- package/funcs/testIdempotency.js.map +0 -1
- package/models/components/idempotencetestingresponse.d.ts +0 -32
- package/models/components/idempotencetestingresponse.d.ts.map +0 -1
- package/models/components/idempotencetestingresponse.js +0 -59
- package/models/components/idempotencetestingresponse.js.map +0 -1
- package/models/components/idempotencybehaviorenum.d.ts +0 -37
- package/models/components/idempotencybehaviorenum.d.ts.map +0 -1
- package/models/components/idempotencybehaviorenum.js +0 -54
- package/models/components/idempotencybehaviorenum.js.map +0 -1
- package/models/components/idempotencytestingdto.d.ts +0 -33
- package/models/components/idempotencytestingdto.d.ts.map +0 -1
- package/models/components/idempotencytestingdto.js +0 -60
- package/models/components/idempotencytestingdto.js.map +0 -1
- package/models/errors/healthcontrollerhealthcheck.d.ts +0 -153
- package/models/errors/healthcontrollerhealthcheck.d.ts.map +0 -1
- package/models/errors/healthcontrollerhealthcheck.js +0 -190
- package/models/errors/healthcontrollerhealthcheck.js.map +0 -1
- package/models/operations/healthcontrollergeneraterandomnumber.d.ts +0 -64
- package/models/operations/healthcontrollergeneraterandomnumber.d.ts.map +0 -1
- package/models/operations/healthcontrollergeneraterandomnumber.js +0 -108
- package/models/operations/healthcontrollergeneraterandomnumber.js.map +0 -1
- package/models/operations/healthcontrollerhealthcheck.d.ts +0 -165
- package/models/operations/healthcontrollerhealthcheck.d.ts.map +0 -1
- package/models/operations/healthcontrollerhealthcheck.js +0 -206
- package/models/operations/healthcontrollerhealthcheck.js.map +0 -1
- package/models/operations/healthcontrollertestidempotency.d.ts +0 -66
- package/models/operations/healthcontrollertestidempotency.d.ts.map +0 -1
- package/models/operations/healthcontrollertestidempotency.js +0 -112
- package/models/operations/healthcontrollertestidempotency.js.map +0 -1
- package/src/funcs/generateRandomNumber.ts +0 -183
- package/src/funcs/healthControllerHealthCheck.ts +0 -153
- package/src/funcs/testIdempotency.ts +0 -190
- package/src/models/components/idempotencetestingresponse.ts +0 -69
- package/src/models/components/idempotencybehaviorenum.ts +0 -42
- package/src/models/components/idempotencytestingdto.ts +0 -74
- package/src/models/errors/healthcontrollerhealthcheck.ts +0 -291
- package/src/models/operations/healthcontrollergeneraterandomnumber.ts +0 -177
- package/src/models/operations/healthcontrollerhealthcheck.ts +0 -358
- package/src/models/operations/healthcontrollertestidempotency.ts +0 -174
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.healthControllerTestIdempotencyResponseFromJSON = exports.healthControllerTestIdempotencyResponseToJSON = exports.HealthControllerTestIdempotencyResponse$ = exports.HealthControllerTestIdempotencyResponse$outboundSchema = exports.HealthControllerTestIdempotencyResponse$inboundSchema = exports.healthControllerTestIdempotencyRequestFromJSON = exports.healthControllerTestIdempotencyRequestToJSON = exports.HealthControllerTestIdempotencyRequest$ = exports.HealthControllerTestIdempotencyRequest$outboundSchema = exports.HealthControllerTestIdempotencyRequest$inboundSchema = void 0;
|
|
30
|
-
const z = __importStar(require("zod"));
|
|
31
|
-
const primitives_js_1 = require("../../lib/primitives.js");
|
|
32
|
-
const schemas_js_1 = require("../../lib/schemas.js");
|
|
33
|
-
const components = __importStar(require("../components/index.js"));
|
|
34
|
-
/** @internal */
|
|
35
|
-
exports.HealthControllerTestIdempotencyRequest$inboundSchema = z.object({
|
|
36
|
-
"idempotency-key": z.string().optional(),
|
|
37
|
-
IdempotencyTestingDto: components.IdempotencyTestingDto$inboundSchema,
|
|
38
|
-
}).transform((v) => {
|
|
39
|
-
return (0, primitives_js_1.remap)(v, {
|
|
40
|
-
"idempotency-key": "idempotencyKey",
|
|
41
|
-
"IdempotencyTestingDto": "idempotencyTestingDto",
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
/** @internal */
|
|
45
|
-
exports.HealthControllerTestIdempotencyRequest$outboundSchema = z.object({
|
|
46
|
-
idempotencyKey: z.string().optional(),
|
|
47
|
-
idempotencyTestingDto: components.IdempotencyTestingDto$outboundSchema,
|
|
48
|
-
}).transform((v) => {
|
|
49
|
-
return (0, primitives_js_1.remap)(v, {
|
|
50
|
-
idempotencyKey: "idempotency-key",
|
|
51
|
-
idempotencyTestingDto: "IdempotencyTestingDto",
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
-
*/
|
|
58
|
-
var HealthControllerTestIdempotencyRequest$;
|
|
59
|
-
(function (HealthControllerTestIdempotencyRequest$) {
|
|
60
|
-
/** @deprecated use `HealthControllerTestIdempotencyRequest$inboundSchema` instead. */
|
|
61
|
-
HealthControllerTestIdempotencyRequest$.inboundSchema = exports.HealthControllerTestIdempotencyRequest$inboundSchema;
|
|
62
|
-
/** @deprecated use `HealthControllerTestIdempotencyRequest$outboundSchema` instead. */
|
|
63
|
-
HealthControllerTestIdempotencyRequest$.outboundSchema = exports.HealthControllerTestIdempotencyRequest$outboundSchema;
|
|
64
|
-
})(HealthControllerTestIdempotencyRequest$ || (exports.HealthControllerTestIdempotencyRequest$ = HealthControllerTestIdempotencyRequest$ = {}));
|
|
65
|
-
function healthControllerTestIdempotencyRequestToJSON(healthControllerTestIdempotencyRequest) {
|
|
66
|
-
return JSON.stringify(exports.HealthControllerTestIdempotencyRequest$outboundSchema.parse(healthControllerTestIdempotencyRequest));
|
|
67
|
-
}
|
|
68
|
-
exports.healthControllerTestIdempotencyRequestToJSON = healthControllerTestIdempotencyRequestToJSON;
|
|
69
|
-
function healthControllerTestIdempotencyRequestFromJSON(jsonString) {
|
|
70
|
-
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.HealthControllerTestIdempotencyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HealthControllerTestIdempotencyRequest' from JSON`);
|
|
71
|
-
}
|
|
72
|
-
exports.healthControllerTestIdempotencyRequestFromJSON = healthControllerTestIdempotencyRequestFromJSON;
|
|
73
|
-
/** @internal */
|
|
74
|
-
exports.HealthControllerTestIdempotencyResponse$inboundSchema = z.object({
|
|
75
|
-
Headers: z.record(z.array(z.string())),
|
|
76
|
-
Result: components.IdempotenceTestingResponse$inboundSchema,
|
|
77
|
-
}).transform((v) => {
|
|
78
|
-
return (0, primitives_js_1.remap)(v, {
|
|
79
|
-
"Headers": "headers",
|
|
80
|
-
"Result": "result",
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
/** @internal */
|
|
84
|
-
exports.HealthControllerTestIdempotencyResponse$outboundSchema = z.object({
|
|
85
|
-
headers: z.record(z.array(z.string())),
|
|
86
|
-
result: components.IdempotenceTestingResponse$outboundSchema,
|
|
87
|
-
}).transform((v) => {
|
|
88
|
-
return (0, primitives_js_1.remap)(v, {
|
|
89
|
-
headers: "Headers",
|
|
90
|
-
result: "Result",
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* @internal
|
|
95
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
96
|
-
*/
|
|
97
|
-
var HealthControllerTestIdempotencyResponse$;
|
|
98
|
-
(function (HealthControllerTestIdempotencyResponse$) {
|
|
99
|
-
/** @deprecated use `HealthControllerTestIdempotencyResponse$inboundSchema` instead. */
|
|
100
|
-
HealthControllerTestIdempotencyResponse$.inboundSchema = exports.HealthControllerTestIdempotencyResponse$inboundSchema;
|
|
101
|
-
/** @deprecated use `HealthControllerTestIdempotencyResponse$outboundSchema` instead. */
|
|
102
|
-
HealthControllerTestIdempotencyResponse$.outboundSchema = exports.HealthControllerTestIdempotencyResponse$outboundSchema;
|
|
103
|
-
})(HealthControllerTestIdempotencyResponse$ || (exports.HealthControllerTestIdempotencyResponse$ = HealthControllerTestIdempotencyResponse$ = {}));
|
|
104
|
-
function healthControllerTestIdempotencyResponseToJSON(healthControllerTestIdempotencyResponse) {
|
|
105
|
-
return JSON.stringify(exports.HealthControllerTestIdempotencyResponse$outboundSchema.parse(healthControllerTestIdempotencyResponse));
|
|
106
|
-
}
|
|
107
|
-
exports.healthControllerTestIdempotencyResponseToJSON = healthControllerTestIdempotencyResponseToJSON;
|
|
108
|
-
function healthControllerTestIdempotencyResponseFromJSON(jsonString) {
|
|
109
|
-
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.HealthControllerTestIdempotencyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HealthControllerTestIdempotencyResponse' from JSON`);
|
|
110
|
-
}
|
|
111
|
-
exports.healthControllerTestIdempotencyResponseFromJSON = healthControllerTestIdempotencyResponseFromJSON;
|
|
112
|
-
//# sourceMappingURL=healthcontrollertestidempotency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"healthcontrollertestidempotency.js","sourceRoot":"","sources":["../../src/models/operations/healthcontrollertestidempotency.ts"],"names":[],"mappings":";AAAA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,CACnB,8DAAsD,CAAC,KAAK,CAC1D,uCAAuC,CACxC,CACF,CAAC;AACJ,CAAC;AATD,sGASC;AAED,SAAgB,+CAA+C,CAC7D,UAAkB;IAKlB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,6DAAqD,CAAC,KAAK,CACzD,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACd,EACH,qEAAqE,CACtE,CAAC;AACJ,CAAC;AAdD,0GAcC"}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { NovuCore } from "../core.js";
|
|
6
|
-
import { encodeSimple } 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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.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 { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
-
import * as operations from "../models/operations/index.js";
|
|
24
|
-
import { Result } from "../types/fp.js";
|
|
25
|
-
|
|
26
|
-
export async function generateRandomNumber(
|
|
27
|
-
client: NovuCore,
|
|
28
|
-
idempotencyKey?: string | undefined,
|
|
29
|
-
options?: RequestOptions,
|
|
30
|
-
): Promise<
|
|
31
|
-
Result<
|
|
32
|
-
operations.HealthControllerGenerateRandomNumberResponse,
|
|
33
|
-
| errors.ErrorDto
|
|
34
|
-
| errors.ErrorDto
|
|
35
|
-
| errors.ValidationErrorDto
|
|
36
|
-
| errors.ErrorDto
|
|
37
|
-
| SDKError
|
|
38
|
-
| SDKValidationError
|
|
39
|
-
| UnexpectedClientError
|
|
40
|
-
| InvalidRequestError
|
|
41
|
-
| RequestAbortedError
|
|
42
|
-
| RequestTimeoutError
|
|
43
|
-
| ConnectionError
|
|
44
|
-
>
|
|
45
|
-
> {
|
|
46
|
-
const input: operations.HealthControllerGenerateRandomNumberRequest = {
|
|
47
|
-
idempotencyKey: idempotencyKey,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const parsed = safeParse(
|
|
51
|
-
input,
|
|
52
|
-
(value) =>
|
|
53
|
-
operations.HealthControllerGenerateRandomNumberRequest$outboundSchema
|
|
54
|
-
.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 path = pathToFunc("/v1/health-check/test-idempotency")();
|
|
64
|
-
|
|
65
|
-
const headers = new Headers(compactMap({
|
|
66
|
-
Accept: "application/json",
|
|
67
|
-
"idempotency-key": encodeSimple(
|
|
68
|
-
"idempotency-key",
|
|
69
|
-
payload["idempotency-key"],
|
|
70
|
-
{ explode: false, charEncoding: "none" },
|
|
71
|
-
),
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
75
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
76
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
77
|
-
|
|
78
|
-
const context = {
|
|
79
|
-
operationID: "HealthController_generateRandomNumber",
|
|
80
|
-
oAuth2Scopes: [],
|
|
81
|
-
|
|
82
|
-
resolvedSecurity: requestSecurity,
|
|
83
|
-
|
|
84
|
-
securitySource: client._options.apiKey,
|
|
85
|
-
retryConfig: options?.retries
|
|
86
|
-
|| client._options.retryConfig
|
|
87
|
-
|| {
|
|
88
|
-
strategy: "backoff",
|
|
89
|
-
backoff: {
|
|
90
|
-
initialInterval: 1000,
|
|
91
|
-
maxInterval: 30000,
|
|
92
|
-
exponent: 1.5,
|
|
93
|
-
maxElapsedTime: 3600000,
|
|
94
|
-
},
|
|
95
|
-
retryConnectionErrors: true,
|
|
96
|
-
}
|
|
97
|
-
|| { strategy: "none" },
|
|
98
|
-
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const requestRes = client._createRequest(context, {
|
|
102
|
-
security: requestSecurity,
|
|
103
|
-
method: "GET",
|
|
104
|
-
baseURL: options?.serverURL,
|
|
105
|
-
path: path,
|
|
106
|
-
headers: headers,
|
|
107
|
-
body: body,
|
|
108
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
109
|
-
}, options);
|
|
110
|
-
if (!requestRes.ok) {
|
|
111
|
-
return requestRes;
|
|
112
|
-
}
|
|
113
|
-
const req = requestRes.value;
|
|
114
|
-
|
|
115
|
-
const doResult = await client._do(req, {
|
|
116
|
-
context,
|
|
117
|
-
errorCodes: [
|
|
118
|
-
"400",
|
|
119
|
-
"401",
|
|
120
|
-
"403",
|
|
121
|
-
"404",
|
|
122
|
-
"405",
|
|
123
|
-
"409",
|
|
124
|
-
"413",
|
|
125
|
-
"414",
|
|
126
|
-
"415",
|
|
127
|
-
"422",
|
|
128
|
-
"429",
|
|
129
|
-
"4XX",
|
|
130
|
-
"500",
|
|
131
|
-
"503",
|
|
132
|
-
"5XX",
|
|
133
|
-
],
|
|
134
|
-
retryConfig: context.retryConfig,
|
|
135
|
-
retryCodes: context.retryCodes,
|
|
136
|
-
});
|
|
137
|
-
if (!doResult.ok) {
|
|
138
|
-
return doResult;
|
|
139
|
-
}
|
|
140
|
-
const response = doResult.value;
|
|
141
|
-
|
|
142
|
-
const responseFields = {
|
|
143
|
-
HttpMeta: { Response: response, Request: req },
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const [result] = await M.match<
|
|
147
|
-
operations.HealthControllerGenerateRandomNumberResponse,
|
|
148
|
-
| errors.ErrorDto
|
|
149
|
-
| errors.ErrorDto
|
|
150
|
-
| errors.ValidationErrorDto
|
|
151
|
-
| errors.ErrorDto
|
|
152
|
-
| SDKError
|
|
153
|
-
| SDKValidationError
|
|
154
|
-
| UnexpectedClientError
|
|
155
|
-
| InvalidRequestError
|
|
156
|
-
| RequestAbortedError
|
|
157
|
-
| RequestTimeoutError
|
|
158
|
-
| ConnectionError
|
|
159
|
-
>(
|
|
160
|
-
M.json(
|
|
161
|
-
201,
|
|
162
|
-
operations.HealthControllerGenerateRandomNumberResponse$inboundSchema,
|
|
163
|
-
{ hdrs: true, key: "Result" },
|
|
164
|
-
),
|
|
165
|
-
M.jsonErr(
|
|
166
|
-
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
167
|
-
errors.ErrorDto$inboundSchema,
|
|
168
|
-
{ hdrs: true },
|
|
169
|
-
),
|
|
170
|
-
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
171
|
-
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
172
|
-
M.fail(429),
|
|
173
|
-
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
174
|
-
M.fail(503),
|
|
175
|
-
M.fail("4XX"),
|
|
176
|
-
M.fail("5XX"),
|
|
177
|
-
)(response, { extraFields: responseFields });
|
|
178
|
-
if (!result.ok) {
|
|
179
|
-
return result;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return result;
|
|
183
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { NovuCore } from "../core.js";
|
|
6
|
-
import { encodeSimple } 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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.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 { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
-
import * as operations from "../models/operations/index.js";
|
|
24
|
-
import { Result } from "../types/fp.js";
|
|
25
|
-
|
|
26
|
-
export async function healthControllerHealthCheck(
|
|
27
|
-
client: NovuCore,
|
|
28
|
-
idempotencyKey?: string | undefined,
|
|
29
|
-
options?: RequestOptions,
|
|
30
|
-
): Promise<
|
|
31
|
-
Result<
|
|
32
|
-
operations.HealthControllerHealthCheckResponseBody,
|
|
33
|
-
| errors.HealthControllerHealthCheckResponseBody
|
|
34
|
-
| SDKError
|
|
35
|
-
| SDKValidationError
|
|
36
|
-
| UnexpectedClientError
|
|
37
|
-
| InvalidRequestError
|
|
38
|
-
| RequestAbortedError
|
|
39
|
-
| RequestTimeoutError
|
|
40
|
-
| ConnectionError
|
|
41
|
-
>
|
|
42
|
-
> {
|
|
43
|
-
const input: operations.HealthControllerHealthCheckRequest = {
|
|
44
|
-
idempotencyKey: idempotencyKey,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const parsed = safeParse(
|
|
48
|
-
input,
|
|
49
|
-
(value) =>
|
|
50
|
-
operations.HealthControllerHealthCheckRequest$outboundSchema.parse(value),
|
|
51
|
-
"Input validation failed",
|
|
52
|
-
);
|
|
53
|
-
if (!parsed.ok) {
|
|
54
|
-
return parsed;
|
|
55
|
-
}
|
|
56
|
-
const payload = parsed.value;
|
|
57
|
-
const body = null;
|
|
58
|
-
|
|
59
|
-
const path = pathToFunc("/v1/health-check")();
|
|
60
|
-
|
|
61
|
-
const headers = new Headers(compactMap({
|
|
62
|
-
Accept: "application/json",
|
|
63
|
-
"idempotency-key": encodeSimple(
|
|
64
|
-
"idempotency-key",
|
|
65
|
-
payload["idempotency-key"],
|
|
66
|
-
{ explode: false, charEncoding: "none" },
|
|
67
|
-
),
|
|
68
|
-
}));
|
|
69
|
-
|
|
70
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
71
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
72
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
73
|
-
|
|
74
|
-
const context = {
|
|
75
|
-
operationID: "HealthController_healthCheck",
|
|
76
|
-
oAuth2Scopes: [],
|
|
77
|
-
|
|
78
|
-
resolvedSecurity: requestSecurity,
|
|
79
|
-
|
|
80
|
-
securitySource: client._options.apiKey,
|
|
81
|
-
retryConfig: options?.retries
|
|
82
|
-
|| client._options.retryConfig
|
|
83
|
-
|| {
|
|
84
|
-
strategy: "backoff",
|
|
85
|
-
backoff: {
|
|
86
|
-
initialInterval: 1000,
|
|
87
|
-
maxInterval: 30000,
|
|
88
|
-
exponent: 1.5,
|
|
89
|
-
maxElapsedTime: 3600000,
|
|
90
|
-
},
|
|
91
|
-
retryConnectionErrors: true,
|
|
92
|
-
}
|
|
93
|
-
|| { strategy: "none" },
|
|
94
|
-
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const requestRes = client._createRequest(context, {
|
|
98
|
-
security: requestSecurity,
|
|
99
|
-
method: "GET",
|
|
100
|
-
baseURL: options?.serverURL,
|
|
101
|
-
path: path,
|
|
102
|
-
headers: headers,
|
|
103
|
-
body: body,
|
|
104
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
105
|
-
}, options);
|
|
106
|
-
if (!requestRes.ok) {
|
|
107
|
-
return requestRes;
|
|
108
|
-
}
|
|
109
|
-
const req = requestRes.value;
|
|
110
|
-
|
|
111
|
-
const doResult = await client._do(req, {
|
|
112
|
-
context,
|
|
113
|
-
errorCodes: ["4XX", "503", "5XX"],
|
|
114
|
-
retryConfig: context.retryConfig,
|
|
115
|
-
retryCodes: context.retryCodes,
|
|
116
|
-
});
|
|
117
|
-
if (!doResult.ok) {
|
|
118
|
-
return doResult;
|
|
119
|
-
}
|
|
120
|
-
const response = doResult.value;
|
|
121
|
-
|
|
122
|
-
const responseFields = {
|
|
123
|
-
HttpMeta: { Response: response, Request: req },
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const [result] = await M.match<
|
|
127
|
-
operations.HealthControllerHealthCheckResponseBody,
|
|
128
|
-
| errors.HealthControllerHealthCheckResponseBody
|
|
129
|
-
| SDKError
|
|
130
|
-
| SDKValidationError
|
|
131
|
-
| UnexpectedClientError
|
|
132
|
-
| InvalidRequestError
|
|
133
|
-
| RequestAbortedError
|
|
134
|
-
| RequestTimeoutError
|
|
135
|
-
| ConnectionError
|
|
136
|
-
>(
|
|
137
|
-
M.json(
|
|
138
|
-
200,
|
|
139
|
-
operations.HealthControllerHealthCheckResponseBody$inboundSchema,
|
|
140
|
-
),
|
|
141
|
-
M.jsonErr(
|
|
142
|
-
503,
|
|
143
|
-
errors.HealthControllerHealthCheckResponseBody$inboundSchema,
|
|
144
|
-
),
|
|
145
|
-
M.fail("4XX"),
|
|
146
|
-
M.fail("5XX"),
|
|
147
|
-
)(response, { extraFields: responseFields });
|
|
148
|
-
if (!result.ok) {
|
|
149
|
-
return result;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return result;
|
|
153
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { NovuCore } from "../core.js";
|
|
6
|
-
import { encodeJSON, encodeSimple } 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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
|
-
import {
|
|
15
|
-
ConnectionError,
|
|
16
|
-
InvalidRequestError,
|
|
17
|
-
RequestAbortedError,
|
|
18
|
-
RequestTimeoutError,
|
|
19
|
-
UnexpectedClientError,
|
|
20
|
-
} from "../models/errors/httpclienterrors.js";
|
|
21
|
-
import * as errors from "../models/errors/index.js";
|
|
22
|
-
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
-
import * as operations from "../models/operations/index.js";
|
|
25
|
-
import { Result } from "../types/fp.js";
|
|
26
|
-
|
|
27
|
-
export async function testIdempotency(
|
|
28
|
-
client: NovuCore,
|
|
29
|
-
idempotencyTestingDto: components.IdempotencyTestingDto,
|
|
30
|
-
idempotencyKey?: string | undefined,
|
|
31
|
-
options?: RequestOptions,
|
|
32
|
-
): Promise<
|
|
33
|
-
Result<
|
|
34
|
-
operations.HealthControllerTestIdempotencyResponse,
|
|
35
|
-
| errors.ErrorDto
|
|
36
|
-
| errors.ErrorDto
|
|
37
|
-
| errors.ValidationErrorDto
|
|
38
|
-
| errors.ErrorDto
|
|
39
|
-
| SDKError
|
|
40
|
-
| SDKValidationError
|
|
41
|
-
| UnexpectedClientError
|
|
42
|
-
| InvalidRequestError
|
|
43
|
-
| RequestAbortedError
|
|
44
|
-
| RequestTimeoutError
|
|
45
|
-
| ConnectionError
|
|
46
|
-
>
|
|
47
|
-
> {
|
|
48
|
-
const input: operations.HealthControllerTestIdempotencyRequest = {
|
|
49
|
-
idempotencyTestingDto: idempotencyTestingDto,
|
|
50
|
-
idempotencyKey: idempotencyKey,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const parsed = safeParse(
|
|
54
|
-
input,
|
|
55
|
-
(value) =>
|
|
56
|
-
operations.HealthControllerTestIdempotencyRequest$outboundSchema.parse(
|
|
57
|
-
value,
|
|
58
|
-
),
|
|
59
|
-
"Input validation failed",
|
|
60
|
-
);
|
|
61
|
-
if (!parsed.ok) {
|
|
62
|
-
return parsed;
|
|
63
|
-
}
|
|
64
|
-
const payload = parsed.value;
|
|
65
|
-
const body = encodeJSON("body", payload.IdempotencyTestingDto, {
|
|
66
|
-
explode: true,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const path = pathToFunc("/v1/health-check/test-idempotency")();
|
|
70
|
-
|
|
71
|
-
const headers = new Headers(compactMap({
|
|
72
|
-
"Content-Type": "application/json",
|
|
73
|
-
Accept: "application/json",
|
|
74
|
-
"idempotency-key": encodeSimple(
|
|
75
|
-
"idempotency-key",
|
|
76
|
-
payload["idempotency-key"],
|
|
77
|
-
{ explode: false, charEncoding: "none" },
|
|
78
|
-
),
|
|
79
|
-
}));
|
|
80
|
-
|
|
81
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
82
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
83
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
84
|
-
|
|
85
|
-
const context = {
|
|
86
|
-
operationID: "HealthController_testIdempotency",
|
|
87
|
-
oAuth2Scopes: [],
|
|
88
|
-
|
|
89
|
-
resolvedSecurity: requestSecurity,
|
|
90
|
-
|
|
91
|
-
securitySource: client._options.apiKey,
|
|
92
|
-
retryConfig: options?.retries
|
|
93
|
-
|| client._options.retryConfig
|
|
94
|
-
|| {
|
|
95
|
-
strategy: "backoff",
|
|
96
|
-
backoff: {
|
|
97
|
-
initialInterval: 1000,
|
|
98
|
-
maxInterval: 30000,
|
|
99
|
-
exponent: 1.5,
|
|
100
|
-
maxElapsedTime: 3600000,
|
|
101
|
-
},
|
|
102
|
-
retryConnectionErrors: true,
|
|
103
|
-
}
|
|
104
|
-
|| { strategy: "none" },
|
|
105
|
-
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const requestRes = client._createRequest(context, {
|
|
109
|
-
security: requestSecurity,
|
|
110
|
-
method: "POST",
|
|
111
|
-
baseURL: options?.serverURL,
|
|
112
|
-
path: path,
|
|
113
|
-
headers: headers,
|
|
114
|
-
body: body,
|
|
115
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
116
|
-
}, options);
|
|
117
|
-
if (!requestRes.ok) {
|
|
118
|
-
return requestRes;
|
|
119
|
-
}
|
|
120
|
-
const req = requestRes.value;
|
|
121
|
-
|
|
122
|
-
const doResult = await client._do(req, {
|
|
123
|
-
context,
|
|
124
|
-
errorCodes: [
|
|
125
|
-
"400",
|
|
126
|
-
"401",
|
|
127
|
-
"403",
|
|
128
|
-
"404",
|
|
129
|
-
"405",
|
|
130
|
-
"409",
|
|
131
|
-
"413",
|
|
132
|
-
"414",
|
|
133
|
-
"415",
|
|
134
|
-
"422",
|
|
135
|
-
"429",
|
|
136
|
-
"4XX",
|
|
137
|
-
"500",
|
|
138
|
-
"503",
|
|
139
|
-
"5XX",
|
|
140
|
-
],
|
|
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.HealthControllerTestIdempotencyResponse,
|
|
155
|
-
| errors.ErrorDto
|
|
156
|
-
| errors.ErrorDto
|
|
157
|
-
| errors.ValidationErrorDto
|
|
158
|
-
| errors.ErrorDto
|
|
159
|
-
| SDKError
|
|
160
|
-
| SDKValidationError
|
|
161
|
-
| UnexpectedClientError
|
|
162
|
-
| InvalidRequestError
|
|
163
|
-
| RequestAbortedError
|
|
164
|
-
| RequestTimeoutError
|
|
165
|
-
| ConnectionError
|
|
166
|
-
>(
|
|
167
|
-
M.json(
|
|
168
|
-
201,
|
|
169
|
-
operations.HealthControllerTestIdempotencyResponse$inboundSchema,
|
|
170
|
-
{ hdrs: true, key: "Result" },
|
|
171
|
-
),
|
|
172
|
-
M.jsonErr(
|
|
173
|
-
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
174
|
-
errors.ErrorDto$inboundSchema,
|
|
175
|
-
{ hdrs: true },
|
|
176
|
-
),
|
|
177
|
-
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
178
|
-
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
179
|
-
M.fail(429),
|
|
180
|
-
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
181
|
-
M.fail(503),
|
|
182
|
-
M.fail("4XX"),
|
|
183
|
-
M.fail("5XX"),
|
|
184
|
-
)(response, { extraFields: responseFields });
|
|
185
|
-
if (!result.ok) {
|
|
186
|
-
return result;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return result;
|
|
190
|
-
}
|