Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc v2.0.0-rc.32, Speakeasy CLI 1.300.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot authored and Shiroy committed Jun 6, 2024
1 parent 53fa2c2 commit 1fa23a7
Show file tree
Hide file tree
Showing 502 changed files with 7,009 additions and 14,800 deletions.
15 changes: 8 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 2bb10af9-e48a-4bd7-ae46-a35fa809dc29
management:
docChecksum: 6ebecf0b42138e0a08e8036c91c67c99
docVersion: v2.0.0-rc.31
speakeasyVersion: 1.299.3
generationVersion: 2.338.7
releaseVersion: 2.4.2
configChecksum: 7f0b655a2ec9ec67bdad106b4b61d2fb
docChecksum: 648a1c76291df8598c3b2a9ac657e10b
docVersion: v2.0.0-rc.32
speakeasyVersion: 1.300.0
generationVersion: 2.338.14
releaseVersion: 2.4.3
configChecksum: 1d25e5e5a4465726f7965fcb8876f065
repoURL: https://github.com/formancehq/formance-sdk-typescript.git
repoSubDirectory: .
installationURL: https://github.com/formancehq/formance-sdk-typescript
Expand All @@ -15,7 +15,7 @@ features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.5
core: 3.9.10
core: 3.9.12
deprecations: 2.81.1
errors: 2.81.10
globalSecurity: 2.82.9
Expand Down Expand Up @@ -49,6 +49,7 @@ generatedFiles:
- src/lib/encodings.ts
- src/lib/http.ts
- src/lib/is-plain-object.ts
- src/lib/primitives.ts
- src/lib/retries.ts
- src/lib/schemas.ts
- src/lib/sdks.ts
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@ Based on:
### Generated
- [typescript v2.4.2] .
### Releases
- [NPM v2.4.2] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.2 - .
- [NPM v2.4.2] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.2 - .

## 2024-06-06 00:19:10
### Changes
Based on:
- OpenAPI Doc v2.0.0-rc.32
- Speakeasy CLI 1.300.0 (2.338.14) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v2.4.3] .
### Releases
- [NPM v2.4.3] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.3 - .
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
comments: {}
telemetryEnabled: false
typescript:
version: 2.4.2
version: 2.4.3
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@formance/formance-sdk",
"version": "2.4.2",
"version": "2.4.3",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@formance/formance-sdk",
"version": "2.4.2",
"version": "2.4.3",
"author": "Formance",
"main": "./index.js",
"sideEffects": false,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {

export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "v2.0.0-rc.31",
sdkVersion: "2.4.2",
genVersion: "2.338.7",
userAgent: "speakeasy-sdk/typescript 2.4.2 2.338.7 v2.0.0-rc.31 @formance/formance-sdk",
openapiDocVersion: "v2.0.0-rc.32",
sdkVersion: "2.4.3",
genVersion: "2.338.14",
userAgent: "speakeasy-sdk/typescript 2.4.3 2.338.14 v2.0.0-rc.32 @formance/formance-sdk",
} as const;
40 changes: 40 additions & 0 deletions src/lib/primitives.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
*/

export type Remap<Inp, Mapping extends { [k in keyof Inp]?: string | null }> = {
[k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */
? Mapping[k]
: Mapping[k] extends null /* if the mapping is to `null` then drop the key */
? never
: k /* otherwise keep the key as-is */]: Inp[k];
};

/**
* Converts or omits an object's keys according to a mapping.
*
* @param inp An object whose keys will be remapped
* @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object.
* @returns A new object with keys remapped or omitted according to the mappings
*/
export function remap<
Inp extends Record<string, unknown>,
const Mapping extends { [k in keyof Inp]?: string | null },
>(inp: Inp, mappings: Mapping): Remap<Inp, Mapping> {
let out: any = {};

if (!Object.keys(mappings).length) {
out = inp;
return out;
}

for (const [k, v] of Object.entries(inp)) {
const j = mappings[k];
if (j === null) {
continue;
}
out[j ?? k] = v;
}

return out;
}
40 changes: 37 additions & 3 deletions src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
*/

import { ZodError } from "zod";
import * as errors from "../sdk/models/errors";
import { output, ZodEffects, ZodError, ZodObject, ZodRawShape, ZodTypeAny } from "zod";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror";

/**
* Utility function that executes some code which may throw a ZodError. It
Expand All @@ -15,8 +15,42 @@ export function parse<Inp, Out>(rawValue: Inp, fn: (value: Inp) => Out, errorMes
return fn(rawValue);
} catch (err) {
if (err instanceof ZodError) {
throw new errors.SDKValidationError(errorMessage, err, rawValue);
throw new SDKValidationError(errorMessage, err, rawValue);
}
throw err;
}
}

export function collectExtraKeys<
Shape extends ZodRawShape,
Catchall extends ZodTypeAny,
K extends string
>(
obj: ZodObject<Shape, "strip", Catchall>,
extrasKey: K
): ZodEffects<
typeof obj,
output<ZodObject<Shape, "strict">> & {
[k in K]: Record<string, output<Catchall>>;
}
> {
return obj.transform((val) => {
const extras: Record<string, output<Catchall>> = {};
const { shape } = obj;
for (const [key] of Object.entries(val)) {
if (key in shape) {
continue;
}

const v = val[key];
if (typeof v === "undefined") {
continue;
}

extras[key] = v;
delete val[key];
}

return { ...val, [extrasKey]: extras };
});
}
20 changes: 5 additions & 15 deletions src/sdk/models/errors/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ export namespace ErrorT$ {
errorMessage: z.string(),
})
.transform((v) => {
return new ErrorT({
errorCode: v.errorCode,
errorMessage: v.errorMessage,
});
return new ErrorT(v);
});

export type Outbound = {
Expand All @@ -73,16 +70,9 @@ export namespace ErrorT$ {
.instanceof(ErrorT)
.transform((v) => v.data$)
.pipe(
z
.object({
errorCode: ErrorCode$.outboundSchema,
errorMessage: z.string(),
})
.transform((v) => {
return {
errorCode: v.errorCode,
errorMessage: v.errorMessage,
};
})
z.object({
errorCode: ErrorCode$.outboundSchema,
errorMessage: z.string(),
})
);
}
24 changes: 6 additions & 18 deletions src/sdk/models/errors/errorresponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ export namespace ErrorResponse$ {
errorMessage: z.string(),
})
.transform((v) => {
return new ErrorResponse({
...(v.details === undefined ? null : { details: v.details }),
errorCode: v.errorCode,
errorMessage: v.errorMessage,
});
return new ErrorResponse(v);
});

export type Outbound = {
Expand All @@ -70,18 +66,10 @@ export namespace ErrorResponse$ {
.instanceof(ErrorResponse)
.transform((v) => v.data$)
.pipe(
z
.object({
details: z.string().optional(),
errorCode: shared.ErrorsEnum$.outboundSchema,
errorMessage: z.string(),
})
.transform((v) => {
return {
...(v.details === undefined ? null : { details: v.details }),
errorCode: v.errorCode,
errorMessage: v.errorMessage,
};
})
z.object({
details: z.string().optional(),
errorCode: shared.ErrorsEnum$.outboundSchema,
errorMessage: z.string(),
})
);
}
20 changes: 5 additions & 15 deletions src/sdk/models/errors/paymentserrorresponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ export namespace PaymentsErrorResponse$ {
errorMessage: z.string(),
})
.transform((v) => {
return new PaymentsErrorResponse({
errorCode: v.errorCode,
errorMessage: v.errorMessage,
});
return new PaymentsErrorResponse(v);
});

export type Outbound = {
Expand All @@ -62,16 +59,9 @@ export namespace PaymentsErrorResponse$ {
.instanceof(PaymentsErrorResponse)
.transform((v) => v.data$)
.pipe(
z
.object({
errorCode: shared.PaymentsErrorsEnum$.outboundSchema,
errorMessage: z.string(),
})
.transform((v) => {
return {
errorCode: v.errorCode,
errorMessage: v.errorMessage,
};
})
z.object({
errorCode: shared.PaymentsErrorsEnum$.outboundSchema,
errorMessage: z.string(),
})
);
}
24 changes: 6 additions & 18 deletions src/sdk/models/errors/reconciliationerrorresponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ export namespace ReconciliationErrorResponse$ {
errorMessage: z.string(),
})
.transform((v) => {
return new ReconciliationErrorResponse({
...(v.details === undefined ? null : { details: v.details }),
errorCode: v.errorCode,
errorMessage: v.errorMessage,
});
return new ReconciliationErrorResponse(v);
});

export type Outbound = {
Expand All @@ -69,18 +65,10 @@ export namespace ReconciliationErrorResponse$ {
.instanceof(ReconciliationErrorResponse)
.transform((v) => v.data$)
.pipe(
z
.object({
details: z.string().optional(),
errorCode: z.string(),
errorMessage: z.string(),
})
.transform((v) => {
return {
...(v.details === undefined ? null : { details: v.details }),
errorCode: v.errorCode,
errorMessage: v.errorMessage,
};
})
z.object({
details: z.string().optional(),
errorCode: z.string(),
errorMessage: z.string(),
})
);
}
20 changes: 5 additions & 15 deletions src/sdk/models/errors/v2error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ export namespace V2Error$ {
errorMessage: z.string(),
})
.transform((v) => {
return new V2Error({
errorCode: v.errorCode,
errorMessage: v.errorMessage,
});
return new V2Error(v);
});

export type Outbound = {
Expand All @@ -73,16 +70,9 @@ export namespace V2Error$ {
.instanceof(V2Error)
.transform((v) => v.data$)
.pipe(
z
.object({
errorCode: SchemasErrorCode$.outboundSchema,
errorMessage: z.string(),
})
.transform((v) => {
return {
errorCode: v.errorCode,
errorMessage: v.errorMessage,
};
})
z.object({
errorCode: SchemasErrorCode$.outboundSchema,
errorMessage: z.string(),
})
);
}
24 changes: 6 additions & 18 deletions src/sdk/models/errors/v2errorresponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ export namespace V2ErrorResponse$ {
errorMessage: z.string(),
})
.transform((v) => {
return new V2ErrorResponse({
...(v.details === undefined ? null : { details: v.details }),
errorCode: v.errorCode,
errorMessage: v.errorMessage,
});
return new V2ErrorResponse(v);
});

export type Outbound = {
Expand All @@ -70,18 +66,10 @@ export namespace V2ErrorResponse$ {
.instanceof(V2ErrorResponse)
.transform((v) => v.data$)
.pipe(
z
.object({
details: z.string().optional(),
errorCode: shared.V2ErrorsEnum$.outboundSchema,
errorMessage: z.string(),
})
.transform((v) => {
return {
...(v.details === undefined ? null : { details: v.details }),
errorCode: v.errorCode,
errorMessage: v.errorMessage,
};
})
z.object({
details: z.string().optional(),
errorCode: shared.V2ErrorsEnum$.outboundSchema,
errorMessage: z.string(),
})
);
}
Loading

0 comments on commit 1fa23a7

Please sign in to comment.