@temporary-name/json-schema 1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a → 1.9.3-alpha.47c8371db8c45c361b1db0b785980cc77971e6e6

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/dist/index.d.mts CHANGED
@@ -1,9 +1,6 @@
1
1
  import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
2
2
  import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
3
3
  import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
4
- import { Context } from '@temporary-name/server';
5
- import { ConditionalSchemaConverter } from '@temporary-name/server/openapi';
6
- import { StandardHandlerPlugin, StandardHandlerOptions } from '@temporary-name/server/standard';
7
4
 
8
5
  type JsonSchema = Draft2020.JSONSchema | Draft2019.JSONSchema | Draft07.JSONSchema;
9
6
  declare enum JsonSchemaXNativeType {
@@ -23,17 +20,5 @@ declare class experimental_JsonSchemaCoercer {
23
20
  coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
24
21
  }
25
22
 
26
- interface experimental_SmartCoercionPluginOptions {
27
- schemaConverters?: readonly ConditionalSchemaConverter[];
28
- }
29
- declare class experimental_SmartCoercionPlugin<T extends Context> implements StandardHandlerPlugin<T> {
30
- #private;
31
- private readonly converter;
32
- private readonly coercer;
33
- private readonly cache;
34
- constructor(options?: experimental_SmartCoercionPluginOptions);
35
- init(options: StandardHandlerOptions<T>): void;
36
- }
37
-
38
- export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer, experimental_SmartCoercionPlugin };
39
- export type { JsonSchema, experimental_JsonSchemaCoerceOptions, experimental_SmartCoercionPluginOptions };
23
+ export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer };
24
+ export type { JsonSchema, experimental_JsonSchemaCoerceOptions };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  import * as Draft07 from '@temporary-name/interop/json-schema-typed/draft-07';
2
2
  import * as Draft2019 from '@temporary-name/interop/json-schema-typed/draft-2019-09';
3
3
  import * as Draft2020 from '@temporary-name/interop/json-schema-typed/draft-2020-12';
4
- import { Context } from '@temporary-name/server';
5
- import { ConditionalSchemaConverter } from '@temporary-name/server/openapi';
6
- import { StandardHandlerPlugin, StandardHandlerOptions } from '@temporary-name/server/standard';
7
4
 
8
5
  type JsonSchema = Draft2020.JSONSchema | Draft2019.JSONSchema | Draft07.JSONSchema;
9
6
  declare enum JsonSchemaXNativeType {
@@ -23,17 +20,5 @@ declare class experimental_JsonSchemaCoercer {
23
20
  coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
24
21
  }
25
22
 
26
- interface experimental_SmartCoercionPluginOptions {
27
- schemaConverters?: readonly ConditionalSchemaConverter[];
28
- }
29
- declare class experimental_SmartCoercionPlugin<T extends Context> implements StandardHandlerPlugin<T> {
30
- #private;
31
- private readonly converter;
32
- private readonly coercer;
33
- private readonly cache;
34
- constructor(options?: experimental_SmartCoercionPluginOptions);
35
- init(options: StandardHandlerOptions<T>): void;
36
- }
37
-
38
- export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer, experimental_SmartCoercionPlugin };
39
- export type { JsonSchema, experimental_JsonSchemaCoerceOptions, experimental_SmartCoercionPluginOptions };
23
+ export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer };
24
+ export type { JsonSchema, experimental_JsonSchemaCoerceOptions };
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import { isObject, toArray, guard } from '@temporary-name/shared';
2
- import { CompositeSchemaConverter } from '@temporary-name/server/openapi';
3
2
 
4
3
  var JsonSchemaXNativeType = /* @__PURE__ */ ((JsonSchemaXNativeType2) => {
5
4
  JsonSchemaXNativeType2["BigInt"] = "bigint";
@@ -337,33 +336,4 @@ class experimental_JsonSchemaCoercer {
337
336
  }
338
337
  }
339
338
 
340
- class experimental_SmartCoercionPlugin {
341
- converter;
342
- coercer;
343
- cache = /* @__PURE__ */ new WeakMap();
344
- constructor(options = {}) {
345
- this.converter = new CompositeSchemaConverter(toArray(options.schemaConverters));
346
- this.coercer = new experimental_JsonSchemaCoercer();
347
- }
348
- init(options) {
349
- options.clientInterceptors ??= [];
350
- options.clientInterceptors.unshift(async (options2) => {
351
- const inputSchema = options2.procedure["~orpc"].inputSchema;
352
- if (!inputSchema) {
353
- return options2.next();
354
- }
355
- const coercedInput = await this.#coerce(inputSchema, options2.input);
356
- return options2.next({ ...options2, input: coercedInput });
357
- });
358
- }
359
- async #coerce(schema, value) {
360
- let jsonSchema = this.cache.get(schema);
361
- if (!jsonSchema) {
362
- jsonSchema = (await this.converter.convert(schema, { strategy: "input" }))[1];
363
- this.cache.set(schema, jsonSchema);
364
- }
365
- return this.coercer.coerce(jsonSchema, value);
366
- }
367
- }
368
-
369
- export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer, experimental_SmartCoercionPlugin };
339
+ export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@temporary-name/json-schema",
3
3
  "type": "module",
4
- "version": "1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a",
4
+ "version": "1.9.3-alpha.47c8371db8c45c361b1db0b785980cc77971e6e6",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.stainless.com/",
7
7
  "repository": {
@@ -29,10 +29,10 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "zod": "^4.1.11",
32
- "@temporary-name/server": "1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a",
33
- "@temporary-name/interop": "1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a",
34
- "@temporary-name/zod": "1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a",
35
- "@temporary-name/shared": "1.9.3-alpha.4225889dbc4c4adc76cdbabb804a30cd075c9d7a"
32
+ "@temporary-name/interop": "1.9.3-alpha.47c8371db8c45c361b1db0b785980cc77971e6e6",
33
+ "@temporary-name/server": "1.9.3-alpha.47c8371db8c45c361b1db0b785980cc77971e6e6",
34
+ "@temporary-name/shared": "1.9.3-alpha.47c8371db8c45c361b1db0b785980cc77971e6e6",
35
+ "@temporary-name/zod": "1.9.3-alpha.47c8371db8c45c361b1db0b785980cc77971e6e6"
36
36
  },
37
37
  "devDependencies": {},
38
38
  "scripts": {