Skip to content

Commit

Permalink
upgrade effect
Browse files Browse the repository at this point in the history
  • Loading branch information
BBB committed Sep 20, 2023
1 parent 977704f commit 3ed260b
Show file tree
Hide file tree
Showing 26 changed files with 68 additions and 67 deletions.
8 changes: 4 additions & 4 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"@ollierelph/openapi-visitor": "workspace:*"
},
"devDependencies": {
"@effect/data": "^0.14.0",
"@effect/schema": "^0.19.3",
"@effect/data": "^0.18.5",
"@effect/schema": "^0.36.3",
"@types/node": "^18.16.1",
"ts-pattern": "^5.0.1"
},
"peerDependencies": {
"@effect/data": "^0.14.0",
"@effect/schema": "^0.19.3"
"@effect/data": "^0.18.5",
"@effect/schema": "^0.36.3"
}
}
8 changes: 4 additions & 4 deletions packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"dependencies": {
},
"devDependencies": {
"@effect/data": "^0.14.0",
"@effect/schema": "^0.19.3",
"@effect/data": "^0.18.5",
"@effect/schema": "^0.36.3",
"@types/node": "^18.16.1"
},
"peerDependencies": {
"@effect/data": "^0.14.0",
"@effect/schema": "^0.19.3"
"@effect/data": "^0.18.5",
"@effect/schema": "^0.36.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import { PathItemObjectCodec } from "./PathItemObject";
export const CallbackObjectCodec = S.lazy(() =>
S.record(S.string, referenceOr(PathItemObjectCodec)),
);
export type CallbackObject = S.To<typeof CallbackObjectCodec>;
export type CallbackObject = S.Schema.To<typeof CallbackObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ export const ComponentsObjectCodec = S.struct({
pathItems: S.optional(S.record(restrictedStringKey, S.any)),
});

export type ComponentsObject = S.To<typeof ComponentsObjectCodec>;
export type ComponentsObject = S.Schema.To<typeof ComponentsObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export const ContactObjectCodec = S.optional(
email: S.optional(email),
}),
);
export type ContactObject = S.To<typeof ContactObjectCodec>;
export type ContactObject = S.Schema.To<typeof ContactObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import * as S from "@effect/schema/Schema";
import { MediaTypeObjectCodec } from "./MediaTypeObject";

export const ContentObjectCodec = S.record(S.string, MediaTypeObjectCodec);
export type ContentObject = S.To<typeof ContentObjectCodec>;
export type ContentObject = S.Schema.To<typeof ContentObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export const EncodingObjectCodec = S.struct({
explode: S.optional(S.boolean),
allowReserved: S.optional(S.boolean),
});
export type EncodingObject = S.To<typeof EncodingObjectCodec>;
export type EncodingObject = S.Schema.To<typeof EncodingObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const ExampleObjectCodec = S.struct({
value: S.any,
externalValue: S.string,
});
export type ExampleObject = S.To<typeof ExampleObjectCodec>;
export type ExampleObject = S.Schema.To<typeof ExampleObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export const ExternalDocumentationObjectCodec = S.struct({
description: S.optional(S.string),
url: url,
});
export type ExternalDocumentationObject = S.To<
export type ExternalDocumentationObject = S.Schema.To<
typeof ExternalDocumentationObjectCodec
>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export const HeaderObjectCodec = S.struct({
deprecated: S.optional(S.boolean),
allowEmptyValue: S.optional(S.boolean),
});
export type HeaderObject = S.To<typeof HeaderObjectCodec>;
export type HeaderObject = S.Schema.To<typeof HeaderObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export const InfoObjectCodec = S.struct({
license: LicenseObjectCodec,
version: S.optional(S.string),
});
export type InfoObject = S.To<typeof InfoObjectCodec>;
export type InfoObject = S.Schema.To<typeof InfoObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export const LicenseObjectCodec = S.optional(
url: S.optional(url),
}),
);
export type LicenseObject = S.To<typeof LicenseObjectCodec>;
export type LicenseObject = S.Schema.To<typeof LicenseObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export const LinkObjectCodec = S.struct({
description: S.optional(S.string),
server: S.optional(ServerObject),
});
export type LinkObject = S.To<typeof LinkObjectCodec>;
export type LinkObject = S.Schema.To<typeof LinkObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const MediaTypeCommon = S.struct({
schema: S.optional(referenceOr(SchemaObjectCodec)),
encoding: S.optional(S.record(S.string, referenceOr(EncodingObjectCodec))),
});
type MediaTypeCommon = S.To<typeof MediaTypeCommon>;
type MediaTypeCommon = S.Schema.To<typeof MediaTypeCommon>;
export const MediaTypeObjectCodec = S.union(
S.extend(MediaTypeCommon)(
S.struct({
Expand All @@ -21,4 +21,4 @@ export const MediaTypeObjectCodec = S.union(
}),
),
);
export type MediaTypeObject = S.To<typeof MediaTypeObjectCodec>;
export type MediaTypeObject = S.Schema.To<typeof MediaTypeObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const OpenApiObjectCodec = S.struct({
components: S.optional(ComponentsObjectCodec),
paths: S.optional(PathsObjectCodec),
});
export type OpenApiObject = S.To<typeof OpenApiObjectCodec>;
export type OpenApiObject = S.Schema.To<typeof OpenApiObjectCodec>;

export function buildOpenApi(): OpenApiObject {
return {
Expand Down Expand Up @@ -81,13 +81,13 @@ export function buildOpenApi(): OpenApiObject {
type: "object",
properties: {
foo: {
"type": "string"
type: "string",
},
bingo: {
"type": "number"
}
type: "number",
},
},
required: ["foo"]
required: ["foo"],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const ParameterObjectCodec = S.struct({
deprecated: S.optional(S.boolean),
allowEmptyValue: S.optional(S.boolean),
});
export type ParameterObject = S.To<typeof ParameterObjectCodec>;
export type ParameterObject = S.Schema.To<typeof ParameterObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const PathsObjectCodec = S.record(
S.string,
referenceOr(PathItemObjectCodec),
);
export type PathsObject = S.To<typeof PathsObjectCodec>;
export type PathsObject = S.Schema.To<typeof PathsObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const localRef = S.templateLiteral(
* https://spec.openapis.org/oas/latest.html#reference-object
*/
export const ReferenceObjectCodec = S.struct({ $ref: localRef });
export type ReferenceObject = S.To<typeof ReferenceObjectCodec>;
export type ReferenceObject = S.Schema.To<typeof ReferenceObjectCodec>;
export const isReferenceObject = S.is(ReferenceObjectCodec);
export const referenceOr = <Members extends readonly S.Schema<any, any>[]>(
...members: Members
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const RequestBodyObjectCodec = S.struct({
content: S.record(S.string, MediaTypeObjectCodec),
required: S.optional(S.boolean),
});
export type RequestBodyObject = S.To<typeof RequestBodyObjectCodec>;
export type RequestBodyObject = S.Schema.To<typeof RequestBodyObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const ResponseObjectCodec = S.struct({
content: S.optional(ContentObjectCodec),
links: S.optional(S.record(S.string, LinkObjectCodec)),
});
export type ResponseObject = S.To<typeof ResponseObjectCodec>;
export type ResponseObject = S.Schema.To<typeof ResponseObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export const ResponsesObjectCodec = S.record(
restrictedStringKey,
referenceOr(ResponseObjectCodec),
);
export type ResponsesObject = S.To<typeof ResponsesObjectCodec>;
export type ResponsesObject = S.Schema.To<typeof ResponsesObjectCodec>;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type SchemaCommon = {
readonly description?: string;
readonly default?: any;
readonly nullable?: boolean;
readonly format?: S.To<typeof format>;
readonly format?: S.Schema.To<typeof format>;
};
export type SchemaObject =
| (SchemaCommon &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const SecurityRequirementObjectCodec = S.record(
S.string,
S.array(S.string),
);
export type SecurityRequirementObject = S.To<
export type SecurityRequirementObject = S.Schema.To<
typeof SecurityRequirementObjectCodec
>;
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ export const ServerObject = S.struct({
description: S.optional(S.string),
variables: ServerVariablesObjectCodec,
});
export type ServerObject = S.To<typeof ServerObject>;
export type ServerObject = S.Schema.To<typeof ServerObject>;
8 changes: 4 additions & 4 deletions packages/visitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"@ollierelph/openapi-parser": "workspace:*"
},
"devDependencies": {
"@effect/data": "^0.14.0",
"@effect/schema": "^0.19.3",
"@effect/data": "^0.18.5",
"@effect/schema": "^0.36.3",
"@types/node": "^18.16.1"
},
"peerDependencies": {
"@effect/data": "^0.14.0",
"@effect/schema": "^0.19.3"
"@effect/data": "^0.18.5",
"@effect/schema": "^0.36.3"
}
}
57 changes: 29 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ed260b

Please sign in to comment.