@doclo/core 0.2.3 → 0.2.4
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/README.md +16 -15
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/validation-utils.js +1 -1
- package/dist/internal/validation-utils.js.map +1 -1
- package/dist/validation.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
# @doclo/core
|
|
2
2
|
|
|
3
|
-
Core types, utilities, and
|
|
3
|
+
Core types, utilities, and runtime features for the Doclo SDK.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @doclo/core
|
|
9
|
-
# or
|
|
10
8
|
pnpm add @doclo/core
|
|
11
9
|
```
|
|
12
10
|
|
|
13
11
|
## Features
|
|
14
12
|
|
|
15
|
-
- Core type definitions
|
|
16
|
-
-
|
|
13
|
+
- Core type definitions (DocumentIR, FlowInput, providers)
|
|
14
|
+
- Validation utilities (JSON schema validation, node compatibility)
|
|
15
|
+
- Security utilities (SSRF protection, safe JSON parsing)
|
|
17
16
|
- Runtime utilities (crypto, base64, environment detection)
|
|
18
|
-
-
|
|
19
|
-
-
|
|
17
|
+
- PDF utilities (page counting, splitting)
|
|
18
|
+
- Observability helpers (tracing, metrics)
|
|
20
19
|
|
|
21
20
|
## Exports
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
| Export Path | Description |
|
|
23
|
+
|-------------|-------------|
|
|
24
|
+
| `.` | Core types, validation, file utilities |
|
|
25
|
+
| `./validation` | Input validation utilities |
|
|
26
|
+
| `./security` | SSRF protection, fetchWithTimeout, safeJsonParse |
|
|
27
|
+
| `./observability` | Tracing and metrics hooks |
|
|
28
|
+
| `./runtime/crypto` | Cryptographic utilities |
|
|
29
|
+
| `./runtime/base64` | Base64 encoding/decoding |
|
|
30
|
+
| `./runtime/env` | Environment detection |
|
|
31
|
+
| `./pdf-utils` | PDF manipulation utilities |
|
|
31
32
|
|
|
32
33
|
## License
|
|
33
34
|
|
package/dist/index.js
CHANGED
|
@@ -610,7 +610,7 @@ function validateJson(data, schema) {
|
|
|
610
610
|
const dangerousProps = ["__proto__", "constructor", "prototype"];
|
|
611
611
|
if (schema2.additionalProperties === false && schema2.properties) {
|
|
612
612
|
const allowedProps = Object.keys(schema2.properties);
|
|
613
|
-
const requiredProps = schema2.required
|
|
613
|
+
const requiredProps = Array.isArray(schema2.required) ? schema2.required : [];
|
|
614
614
|
const allAllowedProps = /* @__PURE__ */ new Set([...allowedProps, ...requiredProps]);
|
|
615
615
|
for (const key of [...Object.keys(value), ...Object.getOwnPropertyNames(value)]) {
|
|
616
616
|
if (dangerousProps.includes(key)) {
|