@scalar/oas-utils
Advanced tools
Comparing version 0.2.41 to 0.2.42
# @scalar/oas-utils | ||
## 0.2.42 | ||
### Patch Changes | ||
- 5483fc3: fix: File is not defined | ||
- Updated dependencies [a07cfc8] | ||
- Updated dependencies [023ca15] | ||
- Updated dependencies [85872b6] | ||
- @scalar/types@0.0.7 | ||
## 0.2.41 | ||
@@ -4,0 +14,0 @@ |
export { createRequest } from './requests.js'; | ||
export { createRequestExample, createRequestExampleParameter } from './request-examples.js'; | ||
export { blobSchema, createRequestExample, createRequestExampleParameter } from './request-examples.js'; |
@@ -5,2 +5,21 @@ import { deepMerge } from '@scalar/object-utils/merge'; | ||
// Define the Blob schema | ||
const blobSchema = z.object({ | ||
size: z.number().nonnegative('Blob size must be a non-negative number').int(), // Size of the Blob | ||
type: z.string(), // MIME type of the Blob | ||
arrayBuffer: z.function().returns(z.promise(z.instanceof(ArrayBuffer))), // Returns a Promise of ArrayBuffer | ||
slice: z | ||
.function() | ||
.args(z.number().optional(), z.number().optional(), z.string().optional()) | ||
.returns(z.any()), // Returns a Blob (any type for now) | ||
stream: z.function().returns(z.instanceof((ReadableStream))), // Returns a ReadableStream of Uint8Array | ||
text: z.function().returns(z.promise(z.string())), // Returns a Promise of string | ||
}); | ||
const fileSchema = z | ||
.object({ | ||
name: z.string(), | ||
lastModified: z.number(), | ||
webkitRelativePath: z.string(), | ||
}) | ||
.extend(blobSchema.shape); | ||
const requestExampleParametersSchema = z.object({ | ||
@@ -10,3 +29,3 @@ key: z.string().default(''), | ||
enabled: z.boolean().default(true), | ||
file: z.any().optional(), | ||
file: fileSchema.optional(), | ||
description: z.string().optional(), | ||
@@ -58,3 +77,3 @@ /** Params are linked to parents such as path params and global headers/cookies */ | ||
.default({}), | ||
binary: z.instanceof(File).optional(), | ||
binary: fileSchema.optional(), | ||
activeBody: z | ||
@@ -80,2 +99,2 @@ .union([z.literal('raw'), z.literal('formData'), z.literal('binary')]) | ||
export { createRequestExample, createRequestExampleParameter }; | ||
export { blobSchema, createRequestExample, createRequestExampleParameter }; |
@@ -19,3 +19,3 @@ { | ||
], | ||
"version": "0.2.41", | ||
"version": "0.2.42", | ||
"engines": { | ||
@@ -93,5 +93,5 @@ "node": ">=18" | ||
"zod": "^3.22.4", | ||
"@scalar/object-utils": "1.1.7", | ||
"@scalar/themes": "0.9.28", | ||
"@scalar/types": "0.0.6" | ||
"@scalar/types": "0.0.7", | ||
"@scalar/object-utils": "1.1.7" | ||
}, | ||
@@ -103,5 +103,5 @@ "devDependencies": { | ||
"vitest": "^1.6.0", | ||
"@scalar/openapi-types": "0.1.0", | ||
"@scalar/build-tooling": "0.1.10", | ||
"@scalar/openapi-parser": "0.8.1", | ||
"@scalar/openapi-types": "0.1.0" | ||
"@scalar/openapi-parser": "0.8.1" | ||
}, | ||
@@ -108,0 +108,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
285416
5933
+ Added@scalar/types@0.0.7(transitive)
- Removed@scalar/types@0.0.6(transitive)
Updated@scalar/types@0.0.7