fets 0.8.2 → 0.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fets",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "TypeScript HTTP Framework focusing on e2e type-safety, easy setup, performance & great developer experience",
5
5
  "sideEffects": false,
6
6
  "dependencies": {
@@ -97,10 +97,17 @@ export type ApiKeySecurityScheme = {
97
97
  in: 'header' | 'query' | 'cookie';
98
98
  };
99
99
  export type SecurityScheme = BasicAuthSecurityScheme | BearerAuthSecurityScheme | ApiKeySecurityScheme;
100
+ export type Circular<TJSONSchema extends JSONSchema> = TJSONSchema extends {
101
+ properties: {
102
+ [key: string]: JSONSchema;
103
+ };
104
+ } ? TJSONSchema extends PropertyValue<TJSONSchema, Property<TJSONSchema>> ? true : Circular<PropertyValue<TJSONSchema, Property<TJSONSchema>>> : false;
105
+ export type Property<TJSONSchema extends JSONSchema> = keyof TJSONSchema['properties'];
106
+ export type PropertyValue<TJSONSchema extends JSONSchema, TProperty extends keyof TJSONSchema['properties']> = TJSONSchema['properties'][TProperty];
100
107
  export type FromSchema<T> = T extends {
101
108
  static: infer U;
102
109
  } ? U : T extends JSONSchema ? FromSchemaOriginal<T, {
103
- deserialize: T extends T['properties'][keyof T['properties']] ? false : [
110
+ deserialize: Circular<T> extends false ? [
104
111
  {
105
112
  pattern: {
106
113
  type: 'string';
@@ -122,7 +129,7 @@ export type FromSchema<T> = T extends {
122
129
  };
123
130
  output: bigint | number;
124
131
  }
125
- ];
132
+ ] : false;
126
133
  }> : never;
127
134
  export type FromRouterComponentSchema<TRouter extends Router<any, any, any>, TName extends string> = TRouter extends Router<any, infer TComponents, any> ? TComponents extends Required<RouterComponentsBase> ? FromSchema<TComponents['schemas'][TName]> : never : never;
128
135
  export type PromiseOrValue<T> = T | Promise<T>;
@@ -97,10 +97,17 @@ export type ApiKeySecurityScheme = {
97
97
  in: 'header' | 'query' | 'cookie';
98
98
  };
99
99
  export type SecurityScheme = BasicAuthSecurityScheme | BearerAuthSecurityScheme | ApiKeySecurityScheme;
100
+ export type Circular<TJSONSchema extends JSONSchema> = TJSONSchema extends {
101
+ properties: {
102
+ [key: string]: JSONSchema;
103
+ };
104
+ } ? TJSONSchema extends PropertyValue<TJSONSchema, Property<TJSONSchema>> ? true : Circular<PropertyValue<TJSONSchema, Property<TJSONSchema>>> : false;
105
+ export type Property<TJSONSchema extends JSONSchema> = keyof TJSONSchema['properties'];
106
+ export type PropertyValue<TJSONSchema extends JSONSchema, TProperty extends keyof TJSONSchema['properties']> = TJSONSchema['properties'][TProperty];
100
107
  export type FromSchema<T> = T extends {
101
108
  static: infer U;
102
109
  } ? U : T extends JSONSchema ? FromSchemaOriginal<T, {
103
- deserialize: T extends T['properties'][keyof T['properties']] ? false : [
110
+ deserialize: Circular<T> extends false ? [
104
111
  {
105
112
  pattern: {
106
113
  type: 'string';
@@ -122,7 +129,7 @@ export type FromSchema<T> = T extends {
122
129
  };
123
130
  output: bigint | number;
124
131
  }
125
- ];
132
+ ] : false;
126
133
  }> : never;
127
134
  export type FromRouterComponentSchema<TRouter extends Router<any, any, any>, TName extends string> = TRouter extends Router<any, infer TComponents, any> ? TComponents extends Required<RouterComponentsBase> ? FromSchema<TComponents['schemas'][TName]> : never : never;
128
135
  export type PromiseOrValue<T> = T | Promise<T>;