@t4h.framework/fs 0.13.0 → 0.13.1
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/.ai/skills/framework-fs/SKILL.md +23 -23
- package/.ai/skills/framework-fs-split/SKILL.md +17 -25
- package/.ai/skills/framework-fs-write/SKILL.md +13 -15
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/activities/FileJoinActivity.d.ts +3 -3
- package/dist/activities/FileJoinActivity.d.ts.map +1 -1
- package/dist/activities/FileJoinActivity.js.map +1 -1
- package/dist/activities/FileReadActivity.d.ts +1 -0
- package/dist/activities/FileReadActivity.d.ts.map +1 -1
- package/dist/activities/FileReadActivity.js +24 -19
- package/dist/activities/FileReadActivity.js.map +1 -1
- package/dist/activities/FileSplitActivity.d.ts +5 -12
- package/dist/activities/FileSplitActivity.d.ts.map +1 -1
- package/dist/activities/FileSplitActivity.js.map +1 -1
- package/dist/constants/operations.d.ts +1 -1
- package/dist/constants/operations.d.ts.map +1 -1
- package/dist/constants/operations.js.map +1 -1
- package/dist/helpers/CSV.d.ts.map +1 -1
- package/dist/helpers/CSV.js +3 -1
- package/dist/helpers/CSV.js.map +1 -1
- package/dist/helpers/split-records.js +21 -11
- package/dist/helpers/split-records.js.map +1 -1
- package/package.json +4 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: framework-fs
|
|
3
3
|
description: >-
|
|
4
4
|
Guides correct use of @t4h.framework/fs in T4H Framework workflows: the
|
|
5
|
-
FileSystemClaim abstraction that the package activities (http,
|
|
5
|
+
FileSystemClaim abstraction that the package activities (http, pdf) use to
|
|
6
6
|
read/write files, the Binary result workflows consume, and runtime providers.
|
|
7
7
|
A workflow never implements Binary itself — see the framework-fs-write skill.
|
|
8
8
|
Use when a workflow orchestrates file-backed package activities, consuming
|
|
@@ -34,8 +34,6 @@ import {
|
|
|
34
34
|
} from '@t4h.framework/fs'
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Do not import from internal paths such as `src/FileSystemClaim.ts` in application code.
|
|
38
|
-
|
|
39
37
|
---
|
|
40
38
|
|
|
41
39
|
## FileSystemClaim contract
|
|
@@ -80,12 +78,14 @@ export abstract class Binary {
|
|
|
80
78
|
```
|
|
81
79
|
|
|
82
80
|
The package activities return this `Binary` to your workflow — e.g. an `http`
|
|
83
|
-
response `Body` is backed by it.
|
|
84
|
-
|
|
81
|
+
response `Body` is backed by it. The workflow only passes the `Binary` to
|
|
82
|
+
another activity. An activity reads it in `run`:
|
|
85
83
|
|
|
86
84
|
```typescript
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
async run(file: Binary) {
|
|
86
|
+
const stream = await file.stream()
|
|
87
|
+
// consume stream (e.g. stream.toArray() then Buffer.concat)
|
|
88
|
+
}
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
---
|
|
@@ -94,7 +94,7 @@ const stream = await binary.stream()
|
|
|
94
94
|
|
|
95
95
|
Workflows never call `FileSystemClaim` directly. File I/O happens inside the
|
|
96
96
|
**ready-made package activities** that already own the claim — the `http` client
|
|
97
|
-
persists response bodies,
|
|
97
|
+
persists response bodies, the pdf render activity writes its output — and you
|
|
98
98
|
read the resulting `Binary` (e.g. `await res.body.json()` / `text()`). Your only
|
|
99
99
|
responsibility is that the runtime **registers a provider** (below). See
|
|
100
100
|
**Known consumers** for which package primitives to orchestrate.
|
|
@@ -119,7 +119,7 @@ The runtime must register a concrete subclass:
|
|
|
119
119
|
{ provide: FileSystemClaim, value: new MyFileSystemClaimImpl() }
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
`
|
|
122
|
+
`FileSystemClaim` is abstract, so `tsc` rejects a subclass that does not implement `write`, `read` and `slice`. The README uses `LocalFileSystemClaimImpl` as a **placeholder name** for that implementation; there is no class by that name in this monorepo.
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
@@ -130,7 +130,7 @@ These packages depend on `@t4h.framework/fs` and declare `FileSystemClaim`; read
|
|
|
130
130
|
| Package | Usage |
|
|
131
131
|
|---------|--------|
|
|
132
132
|
| `@t4h.framework/http` | The HTTP activity persists response bodies to `fs` and returns them wrapped in a `Body` — you read them with `res.body.json()` / `text()`. |
|
|
133
|
-
| `@t4h.framework/
|
|
133
|
+
| `@t4h.framework/pdf` | The render activity writes the PDF to `fs` and hands back a `Binary` you consume in the workflow. |
|
|
134
134
|
| `@t4h.framework/fs` itself | `FileSplitActivity` streams the source and hands its slices to `startMany` as strings; `FileJoinActivity` streams batch results into a new file; `FileReadActivity` slices (or streams, when the binary is not file-backed) a small window into a string. See the `framework-fs-split` skill. |
|
|
135
135
|
|
|
136
136
|
Orchestrate these package primitives from your workflow; the `fs` write/read happens inside them.
|
|
@@ -144,8 +144,8 @@ Test the **workflow** with `TestWorkflowEnvironment` from
|
|
|
144
144
|
claims the triggered activities need, e.g. `HttpClientRequestClaim` for an HTTP
|
|
145
145
|
call). See the **framework-workflow-testing** skill for the harness API.
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
`@t4h.framework/core/no-binary-subclass` rejects a `Binary` subclass out of a
|
|
148
|
+
test file. A test double for the claim can extend `Binary`:
|
|
149
149
|
|
|
150
150
|
```typescript
|
|
151
151
|
import { Readable } from 'node:stream'
|
|
@@ -190,13 +190,12 @@ Assert `mockWrite` was called with the expected path and body when relevant.
|
|
|
190
190
|
|
|
191
191
|
## Implementing a custom FileSystemClaim
|
|
192
192
|
|
|
193
|
-
1. **Extend** `FileSystemClaim` from `@t4h.framework/fs`.
|
|
194
|
-
2. **Return** a `Binary`
|
|
195
|
-
3. **
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
5. **Keep paths deterministic** when activities replay — unpredictable temp paths are fine if only `Binary` metadata is serialized and replay re-executes `write`; know your serializer/replay story if `path` is persisted.
|
|
193
|
+
1. **Extend** `FileSystemClaim` from `@t4h.framework/fs`. `tsc` checks the method signatures.
|
|
194
|
+
2. **Return** a `Binary` from `write`, `read` and `slice` with correct `contentType`, `contentLength`, and `stream()`.
|
|
195
|
+
3. **Infer** the content type from the path when `write` gets no `contentType`.
|
|
196
|
+
4. **Compose** ranges in `slice`: a slice of a slice is relative to it.
|
|
197
|
+
5. **Register** `{ provide: FileSystemClaim, value: new YourImpl() }` in the runtime (tests use `mockClaim(FileSystemClaim, ...)` instead).
|
|
198
|
+
6. **Keep paths deterministic** when activities replay — unpredictable temp paths are fine if only `Binary` metadata is serialized and replay re-executes `write`; know your serializer/replay story if `path` is persisted.
|
|
200
199
|
|
|
201
200
|
---
|
|
202
201
|
|
|
@@ -205,14 +204,15 @@ Assert `mockWrite` was called with the expected path and body when relevant.
|
|
|
205
204
|
1. Add `"@t4h.framework/fs": "workspace:^"` (or published version) to app `dependencies` when activities use `FileSystemClaim`.
|
|
206
205
|
2. Ensure **`@t4h.framework/core`** is available (peer of `fs`).
|
|
207
206
|
3. Register **`FileSystemClaim`** in the runtime or test `claims` array.
|
|
208
|
-
4. Orchestrate file I/O through the package activities that own `FileSystemClaim` (http,
|
|
207
|
+
4. Orchestrate file I/O through the package activities that own `FileSystemClaim` (http, pdf) — workflow code never declares an activity or accesses `this.claims.fs`.
|
|
209
208
|
|
|
210
209
|
---
|
|
211
210
|
|
|
212
211
|
## Anti-patterns
|
|
213
212
|
|
|
214
|
-
-
|
|
215
|
-
-
|
|
213
|
+
- A deep import. The package exports only its entry, so a deep import fails in `tsc`.
|
|
214
|
+
- Calling `stream()` in a workflow, or in an activity `constructor`, `toInput` or `toOutput`. The `no-binary-stream-outside-activity` rule of `@t4h.framework/core/eslint` reports it.
|
|
215
|
+
- A missing `FileSystemClaim` provider. The activity throws `ClaimProviderNotFoundException` when it reads the claim.
|
|
216
216
|
- Assuming `packages/fs` ships a concrete disk/S3 implementation — it does not; implement and register `FileSystemClaim` in your runtime or test harness.
|
|
217
217
|
|
|
218
218
|
---
|
|
@@ -223,4 +223,4 @@ Assert `mockWrite` was called with the expected path and body when relevant.
|
|
|
223
223
|
- `framework-fs-write` — `write`: turn workflow content into a `Binary`, and why an App must never implement `Binary`.
|
|
224
224
|
- `framework-core` — `Claim`, `Binary`, and the `TestWorkflowEnvironment` testing harness.
|
|
225
225
|
- `framework-http` — HTTP activities that persist bodies via `FileSystemClaim`.
|
|
226
|
-
- `framework-
|
|
226
|
+
- `framework-pdf` — the render activity that writes PDFs via `fs`.
|
|
@@ -35,7 +35,7 @@ const processRecord = new Workflow(
|
|
|
35
35
|
},
|
|
36
36
|
)
|
|
37
37
|
|
|
38
|
-
const main = new Workflow(fileSchema, async (file: Binary) => {
|
|
38
|
+
const main = new Workflow({ id: 'main', schema: fileSchema }, async (file: Binary) => {
|
|
39
39
|
const header = await read(file, { range: { start: 0, end: 240 } })
|
|
40
40
|
// header: string — recorded in history, never re-read on replay
|
|
41
41
|
|
|
@@ -64,8 +64,7 @@ size:
|
|
|
64
64
|
1. `split` reads the source once, worker side: it cuts records, drops the ones
|
|
65
65
|
`where` rejects, groups the rest by `every` and hands each slice to the
|
|
66
66
|
batch as a decoded string as soon as it is complete. Nothing collects the
|
|
67
|
-
slices, no copy of the file is written
|
|
68
|
-
fails the split while it reads.
|
|
67
|
+
slices, and no copy of the file is written.
|
|
69
68
|
2. Each child receives its slice as a plain string — what its
|
|
70
69
|
`Type.String()` schema declares.
|
|
71
70
|
3. The parent resumes with only `WorkflowBatchRef { id, count }`. Per-child
|
|
@@ -133,7 +132,7 @@ multi-byte encodings cannot skew the cuts.
|
|
|
133
132
|
|
|
134
133
|
| Option | Default | Behavior |
|
|
135
134
|
|--------|---------|----------|
|
|
136
|
-
| `every` | `1` | Cut only every N delimiter occurrences — groups N records per child. One million lines with `every: 10_000` start 100 children, each receiving a raw block (inner delimiters untouched) to iterate locally. `keep` arithmetic applies only at actual cut points. A slice
|
|
135
|
+
| `every` | `1` | Cut only every N delimiter occurrences — groups N records per child. One million lines with `every: 10_000` start 100 children, each receiving a raw block (inner delimiters untouched) to iterate locally. `keep` arithmetic applies only at actual cut points. A slice over 3 MiB makes the split throw a `RangeError`; lower `every`. |
|
|
137
136
|
| `trim` | none | `{ start?, end? }` **bytes** cut off each end of the file before scanning — a positional header/trailer. Byte-based on purpose: a record-start delimiter (`'\n10'`) fuses the trailer into the last record's slice, so a record-count skip would drop a valid record along with it. Trimmed content never becomes a slice nor counts toward `every`; fetch it with `read`. Positional layouts make the byte counts constants — getting them right is the caller's business. |
|
|
138
137
|
| `skipEmpty` | `true` | Drops zero-length slices (consecutive delimiters, file starting/ending with one) so they never become child workflows. Turn off when slice index must align 1:1 with record position. "Empty" means zero bytes — a whitespace-only line is a regular slice. |
|
|
139
138
|
| `encoding` | `'utf8'` | Converts the delimiter to bytes and decodes each slice into the string the child receives. |
|
|
@@ -183,16 +182,12 @@ const relevant = await join<InvoiceResult>(batch, {
|
|
|
183
182
|
})
|
|
184
183
|
```
|
|
185
184
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
matches `['a', 'b']`), object values compare deeply, no type coercion. The
|
|
193
|
-
query compiles once and runs inside the existing streaming loop over
|
|
194
|
-
already-hydrated outputs — same memory profile; app-side (decides what enters
|
|
195
|
-
the file, not what leaves the database).
|
|
185
|
+
For an arbitrary predicate, write a custom activity in project code, so the
|
|
186
|
+
function lives in versioned code. MongoDB semantics apply: array fields match
|
|
187
|
+
by containment (`{ tags: 'a' }` matches `['a', 'b']`), object values compare
|
|
188
|
+
deeply, no type coercion. The query compiles once and runs inside the existing
|
|
189
|
+
streaming loop over already-hydrated outputs — same memory profile; app-side
|
|
190
|
+
(decides what enters the file, not what leaves the database).
|
|
196
191
|
|
|
197
192
|
---
|
|
198
193
|
|
|
@@ -206,11 +201,9 @@ async function read(
|
|
|
206
201
|
```
|
|
207
202
|
|
|
208
203
|
Reads a byte window of a `Binary` into the workflow as a decoded string. The
|
|
209
|
-
output is recorded in history (replay never re-reads the file)
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
defaults to the whole binary (same cap applies); `encoding` defaults to
|
|
213
|
-
`'utf8'`.
|
|
204
|
+
output is recorded in history (replay never re-reads the file). Use it for
|
|
205
|
+
headers, trailers and single records; a data file flows through `split`.
|
|
206
|
+
`range` defaults to the whole binary; `encoding` defaults to `'utf8'`.
|
|
214
207
|
|
|
215
208
|
Two paths under the hood:
|
|
216
209
|
|
|
@@ -324,12 +317,11 @@ CSV escaping (quotes doubled, delimiter/newline wrapped); the status filter.
|
|
|
324
317
|
- **Splitting a positional file without `trim`.** The header rides inside the
|
|
325
318
|
first slice (with `every: N` it silently consumes a record slot) and the
|
|
326
319
|
trailer fuses into the last one. Trim both ends; fetch them with `read`.
|
|
327
|
-
- **Reading a data file with `read`.** The output lands in workflow history
|
|
328
|
-
|
|
329
|
-
- **
|
|
330
|
-
|
|
331
|
-
`RegExp`
|
|
332
|
-
sift subset or a custom activity whose predicate lives in versioned code.
|
|
320
|
+
- **Reading a data file with `read`.** The output lands in workflow history.
|
|
321
|
+
Records flow through `split`. `read` throws a `RangeError` past 1 MiB.
|
|
322
|
+
- **A non-serializable `where`.** `tsc` rejects a function through
|
|
323
|
+
`WorkflowBatchWhere`. `toInput` throws a `TypeError` for a function,
|
|
324
|
+
`$where`, a `RegExp`, `undefined` or an operator outside the subset.
|
|
333
325
|
- **Hand-rolling the loop.** A stream-and-`startWorkflow` loop inside an
|
|
334
326
|
activity re-parses on replay, misses the barrier, and pushes N entries into
|
|
335
327
|
history.
|
|
@@ -37,7 +37,7 @@ Package path: `framework/packages/fs`. Import only from the package root.
|
|
|
37
37
|
|
|
38
38
|
## Never implement `Binary` yourself
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
`@t4h.framework/core/no-binary-subclass` rejects a class that extends `Binary`.
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
43
|
// ❌ NEVER — this class cannot be persisted
|
|
@@ -89,8 +89,9 @@ Symptoms of doing it by hand:
|
|
|
89
89
|
- the activity is never persisted, the transaction rolls back, and the message
|
|
90
90
|
ends up in the dead letter queue after the retries — the run stops mid-way
|
|
91
91
|
with no obvious error in the workflow itself;
|
|
92
|
-
-
|
|
93
|
-
|
|
92
|
+
- the dev server also throws `TypeError: Unsupported binary instance` when it
|
|
93
|
+
stores the activity input. It accepts only the `Binary` that its own claims
|
|
94
|
+
return.
|
|
94
95
|
|
|
95
96
|
Current runtimes spool an unknown `Binary` to storage instead of failing, so a
|
|
96
97
|
hand-rolled class may survive — but it pays a hidden copy, loses the content
|
|
@@ -121,13 +122,13 @@ the recorded `Binary` is returned.
|
|
|
121
122
|
|
|
122
123
|
## When to use it
|
|
123
124
|
|
|
124
|
-
| Situation | Use
|
|
125
|
-
| ----------------------------------------------------------------------------- |
|
|
126
|
-
| Send content the workflow built (JSON, CSV, positional file) over SFTP/HTTP | `write`
|
|
127
|
-
| Read a small window of an existing file into the workflow | [`read`](./read) — see **framework-fs-split**
|
|
128
|
-
| Fan a large file out into one workflow per record | `split` — see **framework-fs-split**
|
|
129
|
-
| Fold a finished batch back into a file | `join` — see **framework-fs-split**
|
|
130
|
-
| Content already is a `Binary` (HTTP response body, `sftp.get`, `join` result) | pass it straight through
|
|
125
|
+
| Situation | Use |
|
|
126
|
+
| ----------------------------------------------------------------------------- | --------------------------------------------- |
|
|
127
|
+
| Send content the workflow built (JSON, CSV, positional file) over SFTP/HTTP | `write` |
|
|
128
|
+
| Read a small window of an existing file into the workflow | [`read`](./read) — see **framework-fs-split** |
|
|
129
|
+
| Fan a large file out into one workflow per record | `split` — see **framework-fs-split** |
|
|
130
|
+
| Fold a finished batch back into a file | `join` — see **framework-fs-split** |
|
|
131
|
+
| Content already is a `Binary` (HTTP response body, `sftp.get`, `join` result) | pass it straight through |
|
|
131
132
|
|
|
132
133
|
---
|
|
133
134
|
|
|
@@ -219,14 +220,11 @@ expect(write).toHaveBeenCalledWith('report.csv', expect.any(Buffer), 'text/csv')
|
|
|
219
220
|
|
|
220
221
|
## Anti-patterns
|
|
221
222
|
|
|
222
|
-
- **Declaring a class that extends `Binary`** in an App. There is no valid
|
|
223
|
-
reason to; use `write`.
|
|
224
223
|
- Helper functions like `stringToBinary(value)` that wrap content in a custom
|
|
225
224
|
class — replace the implementation with `write`, keeping the helper name if
|
|
226
225
|
it reads well.
|
|
227
|
-
- `write`-ing a value that already is a `Binary`
|
|
228
|
-
`
|
|
229
|
-
reference you already had.
|
|
226
|
+
- `write`-ing a value that already is a `Binary`. `write` takes only
|
|
227
|
+
`string | Buffer`, so `tsc` rejects it.
|
|
230
228
|
- Building a large file by concatenating records in memory and calling `write`
|
|
231
229
|
once — use `split`/`join` instead.
|
|
232
230
|
- Relying on the filename extension to set the content type when the consumer
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @t4h.framework/fs
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#229](https://github.com/tech4humans-brasil/framework/pull/229) [`d4d7d97`](https://github.com/tech4humans-brasil/framework/commit/d4d7d973233ec1f4d78628a69283701b9a55fbf9) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Fixes the published packages:
|
|
8
|
+
- harness: the published types import `typings/PublicProperties.js`, which was not in `dist`. `uuidv7` is now a dependency.
|
|
9
|
+
- dev: `tar` is now a dependency.
|
|
10
|
+
- fs: the published types of `FileSplitActivity` no longer import `typebox`, which `fs` does not depend on.
|
|
11
|
+
|
|
12
|
+
- [#241](https://github.com/tech4humans-brasil/framework/pull/241) [`f6b8454`](https://github.com/tech4humans-brasil/framework/commit/f6b845484d22e7c8e7240fe2e113f1cdea7c8ce3) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Adds seven rules to `@t4h.framework/core/eslint` and turns them on in `configs.recommended`:
|
|
13
|
+
- `no-io-in-workflow` reports `fetch` and calls to network, file, database and mail modules in a workflow and in the `constructor`, `toInput` and `toOutput` of an activity. It also reports `zlib` and `stream` calls there, because they work on the content in memory on each replay.
|
|
14
|
+
- `no-binary-subclass` reports a class that extends `Binary`.
|
|
15
|
+
- `no-framework-activity-in-app` reports `new` and `extends` on an activity of a framework package other than the core.
|
|
16
|
+
- `no-testing-import-in-source` reports an import of a `@t4h.framework/<package>/testing` entry out of a test file.
|
|
17
|
+
- `require-workflow-id` reports a `Workflow` with no `id`.
|
|
18
|
+
- `no-secret-to-string` reports a `Secret` that becomes a string.
|
|
19
|
+
- `no-literal-secret-in-authorization` reports a string literal in the `secret` or `clientSecret` field of an `Authorization`.
|
|
20
|
+
|
|
21
|
+
The package skills now name these rules in place of the text that the rules enforce. The docs and skills give each `Workflow` an `id`, read the HMAC secret from `EnvDesign`, and do not document a custom HTTP activity.
|
|
22
|
+
|
|
23
|
+
- [#238](https://github.com/tech4humans-brasil/framework/pull/238) [`8567806`](https://github.com/tech4humans-brasil/framework/commit/8567806ec537288076c3a18a4816f26d58a67905) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - The `framework-fs` skill says to call `Binary.stream()` only in a method of an activity, not in the workflow.
|
|
24
|
+
|
|
25
|
+
- [#240](https://github.com/tech4humans-brasil/framework/pull/240) [`0606115`](https://github.com/tech4humans-brasil/framework/commit/0606115e2e0baa994e9f0ed3559ee54ecac88e44) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - The skills do not repeat a rule that a lint rule, `tsc` or a runtime error already enforces. Each such rule is now one line that names the gate. The examples that broke a gate (`process.env`, `as any`, an inline secret, an `EnvDesign` in a workflow file, `ref.output` before `wait()`) are correct now.
|
|
26
|
+
|
|
27
|
+
- [#228](https://github.com/tech4humans-brasil/framework/pull/228) [`d29e1ab`](https://github.com/tech4humans-brasil/framework/commit/d29e1ab29a039b13c3e4b075472bd615566ae75e) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Uses exact types and `unknown` in place of `any`, and checks external data with guards.
|
|
28
|
+
- harness: the fix-issues prompt lists each sensor as `- checkTypes: PASS`. Before, it printed `- 0: [object Object]`.
|
|
29
|
+
- hmac: an algorithm name such as `constructor` throws `Unsupported algorithm`.
|
|
30
|
+
- oidc: a discovery response with no `introspection_endpoint`, or a null introspection body, throws a clear error.
|
|
31
|
+
- `HttpRequestActivity.toOutput` takes `HttpRequestActivityOutput` in place of `any`.
|
|
32
|
+
|
|
3
33
|
## 0.13.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -160,7 +160,7 @@ const processRecord = new Workflow(
|
|
|
160
160
|
},
|
|
161
161
|
)
|
|
162
162
|
|
|
163
|
-
const main = new Workflow(fileSchema, async (file: Binary) => {
|
|
163
|
+
const main = new Workflow({ id: 'main', schema: fileSchema }, async (file: Binary) => {
|
|
164
164
|
const batch = await split(file, processRecord, {
|
|
165
165
|
delimiter: Split.line(),
|
|
166
166
|
})
|
|
@@ -26,15 +26,15 @@ export type FileJoinActivityInput = {
|
|
|
26
26
|
options: FileJoinOptions;
|
|
27
27
|
filter?: WorkflowBatchFilter;
|
|
28
28
|
};
|
|
29
|
-
export declare class FileJoinActivity extends SyncActivity<readonly [batch: WorkflowBatchCollectionRef
|
|
29
|
+
export declare class FileJoinActivity extends SyncActivity<readonly [batch: WorkflowBatchCollectionRef, options: FileJoinOptions], FileJoinActivityInput, Binary, Binary> {
|
|
30
30
|
private readonly claims;
|
|
31
|
-
toInput(batch: WorkflowBatchCollectionRef
|
|
31
|
+
toInput(batch: WorkflowBatchCollectionRef, options: FileJoinOptions): FileJoinActivityInput;
|
|
32
32
|
run({ batch, options, filter, }: FileJoinActivityInput): Promise<Binary>;
|
|
33
33
|
toOutput(output: Binary): Binary;
|
|
34
34
|
private toStatus;
|
|
35
35
|
private writeHeader;
|
|
36
36
|
private toLine;
|
|
37
37
|
}
|
|
38
|
-
export declare function join<TOutput = unknown>(batch: WorkflowBatchCollectionRef
|
|
38
|
+
export declare function join<TOutput = unknown>(batch: WorkflowBatchCollectionRef, options: FileJoinOptions<TOutput>): Promise<Binary>;
|
|
39
39
|
export {};
|
|
40
40
|
//# sourceMappingURL=FileJoinActivity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileJoinActivity.d.ts","sourceRoot":"","sources":["../../src/activities/FileJoinActivity.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,MAAM,EAGX,YAAY,EAEZ,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EAGxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAEvC,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAA;AAEhD,MAAM,MAAM,aAAa,CAAC,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAA;AAE1E,KAAK,mBAAmB,CAAC,OAAO,IAAI;IAClC,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;CAC/B,CAAA;AAED,KAAK,oBAAoB,CAAC,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAClE,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,sBAAsB,CAAC,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,GAAG;IACpE,MAAM,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,KAAK,kBAAkB,CAAC,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,GAAG;IAChE,MAAM,EAAE,KAAK,CAAA;IACb,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,OAAO,GAAG,OAAO,IACzC,oBAAoB,CAAC,OAAO,CAA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OAAO,CAAC,MAAM,KAAK,KAAK;YAC1B,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE;gBAC/C,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAC,CAAA;QAEJ,MAAM,KAAK,GACT,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAC9B,CAAC,CAAC,KAAK,CAAC,MAAM;YACd,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAElC,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,CAAA;IAC5C,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,KAAiC,EACjC,OAAiC;IAEjC,OAAO,MAAM,OAAO,CAAC,UAAU,CAC7B,gBAAgB,EAChB,KAAK,EACL,OAA0B,CAC3B,CAAA;AACH,CAAC"}
|
|
@@ -17,6 +17,7 @@ export declare class FileReadActivity extends SyncActivity<readonly [binary: Bin
|
|
|
17
17
|
toOutput(output: string): string;
|
|
18
18
|
private slice;
|
|
19
19
|
private window;
|
|
20
|
+
private collect;
|
|
20
21
|
}
|
|
21
22
|
export declare function read(binary: Binary, options?: FileReadOptions): Promise<string>;
|
|
22
23
|
//# sourceMappingURL=FileReadActivity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileReadActivity.d.ts","sourceRoot":"","sources":["../../src/activities/FileReadActivity.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAkB,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAI/E,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IACtC,QAAQ,CAAC,EAAE,cAAc,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,qBA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AM,EACN,OAAO,GACR,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IAyBnC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;YAIzB,KAAK;YAYL,MAAM;YAoBN,OAAO;CA8BtB;AAED,wBAAsB,IAAI,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -18,7 +18,7 @@ export class FileReadActivity extends SyncActivity {
|
|
|
18
18
|
if (range.end > binary.contentLength)
|
|
19
19
|
throw new TypeError('Read range must not exceed the binary length');
|
|
20
20
|
if (length > FILE_READ_MAX_BYTES)
|
|
21
|
-
throw new RangeError(`Length ${length} exceeded max ${FILE_READ_MAX_BYTES}`);
|
|
21
|
+
throw new RangeError(`Length ${String(length)} exceeded max ${String(FILE_READ_MAX_BYTES)}`);
|
|
22
22
|
const slice = await this.slice(binary, range, encoding);
|
|
23
23
|
if (slice)
|
|
24
24
|
return (await buffer(await slice.stream())).toString(encoding);
|
|
@@ -36,30 +36,35 @@ export class FileReadActivity extends SyncActivity {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
async window(readable, range) {
|
|
39
|
-
|
|
40
|
-
let position = 0;
|
|
41
|
-
let size = 0;
|
|
39
|
+
let collected;
|
|
42
40
|
try {
|
|
43
|
-
|
|
44
|
-
const chunk = Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
45
|
-
const chunkStart = position;
|
|
46
|
-
position += chunk.length;
|
|
47
|
-
if (position <= range.start)
|
|
48
|
-
continue;
|
|
49
|
-
const from = Math.max(range.start - chunkStart, 0);
|
|
50
|
-
const to = Math.min(range.end - chunkStart, chunk.length);
|
|
51
|
-
chunks.push(chunk.subarray(from, to));
|
|
52
|
-
size += to - from;
|
|
53
|
-
if (position >= range.end)
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
41
|
+
collected = await this.collect(readable, range);
|
|
56
42
|
}
|
|
57
43
|
finally {
|
|
58
44
|
readable.destroy();
|
|
59
45
|
}
|
|
60
|
-
if (size < range.end - range.start)
|
|
46
|
+
if (collected.size < range.end - range.start)
|
|
61
47
|
throw new RangeError('Binary stream ended before the read window was filled');
|
|
62
|
-
return Buffer.concat(chunks);
|
|
48
|
+
return Buffer.concat(collected.chunks);
|
|
49
|
+
}
|
|
50
|
+
async collect(readable, range) {
|
|
51
|
+
const chunks = [];
|
|
52
|
+
let position = 0;
|
|
53
|
+
let size = 0;
|
|
54
|
+
for await (const data of readable) {
|
|
55
|
+
const chunk = Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
56
|
+
const chunkStart = position;
|
|
57
|
+
position += chunk.length;
|
|
58
|
+
if (position <= range.start)
|
|
59
|
+
continue;
|
|
60
|
+
const from = Math.max(range.start - chunkStart, 0);
|
|
61
|
+
const to = Math.min(range.end - chunkStart, chunk.length);
|
|
62
|
+
chunks.push(chunk.subarray(from, to));
|
|
63
|
+
size += to - from;
|
|
64
|
+
if (position >= range.end)
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
return { chunks, size };
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
export async function read(binary, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileReadActivity.js","sourceRoot":"","sources":["../../src/activities/FileReadActivity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C,OAAO,EAAe,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAYvD,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAA;AAEvC,MAAM,OAAO,gBAAiB,SAAQ,YAKrC;IACkB,MAAM,GAAG,IAAI,KAAK,CAAC;QAClC,EAAE,EAAE,eAAe;KACpB,CAAC,CAAA;IAEK,OAAO,CACZ,MAAc,EACd,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CAAC,KAAK;gBAAE,SAAQ;YAErC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,EAAE,CAAC,CAAC,CAAA;YAClD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;YAEzD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAA;YAErC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAA;YAEjB,IAAI,QAAQ,IAAI,KAAK,CAAC,GAAG;gBAAE,MAAK;QAClC,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;IACzB,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,MAAc,EACd,UAA2B,EAAE;IAE7B,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;AACpE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsyncActivity, type Binary, type
|
|
1
|
+
import { AsyncActivity, type AsyncActivityResult, type Binary, type AnyWorkflow, WorkflowBatchCollectionRef, workflowBatchSchema } from '@t4h.framework/core';
|
|
2
2
|
import { type ByteTrim, type FileSplitDelimiter } from '../helpers/split-records.js';
|
|
3
3
|
type FileSplitWhereOperators = {
|
|
4
4
|
$eq?: string;
|
|
@@ -36,23 +36,16 @@ export type FileSplitBatch = {
|
|
|
36
36
|
batch: string;
|
|
37
37
|
count: number;
|
|
38
38
|
};
|
|
39
|
-
export declare class FileSplitActivity extends AsyncActivity<readonly [
|
|
40
|
-
binary: Binary,
|
|
41
|
-
workflow: Workflow<any, any>,
|
|
42
|
-
options: FileSplitOptions
|
|
43
|
-
], FileSplitActivityInput, FileSplitBatch, WorkflowBatchCollectionRef, FileSplitActivityInput, typeof workflowBatchSchema> {
|
|
39
|
+
export declare class FileSplitActivity extends AsyncActivity<readonly [binary: Binary, workflow: AnyWorkflow, options: FileSplitOptions], FileSplitActivityInput, FileSplitBatch, WorkflowBatchCollectionRef, FileSplitActivityInput, typeof workflowBatchSchema> {
|
|
44
40
|
private readonly claims;
|
|
45
|
-
toInput(binary: Binary, workflow:
|
|
46
|
-
bootstrap({ binary, workflow, options, }: FileSplitActivityInput): Promise<
|
|
47
|
-
batch: import("typebox").TString;
|
|
48
|
-
count: import("typebox").TNumber;
|
|
49
|
-
}>> | import("@t4h.framework/core").AsyncActivityResultFulfilled<FileSplitBatch | undefined>>;
|
|
41
|
+
toInput(binary: Binary, workflow: AnyWorkflow, options: FileSplitOptions): FileSplitActivityInput;
|
|
42
|
+
bootstrap({ binary, workflow, options, }: FileSplitActivityInput): Promise<AsyncActivityResult<FileSplitActivityInput, typeof workflowBatchSchema, FileSplitBatch>>;
|
|
50
43
|
private slices;
|
|
51
44
|
private filter;
|
|
52
45
|
advance(payload: FileSplitBatch): import("@t4h.framework/core").AsyncActivityResultFulfilled<FileSplitBatch | undefined>;
|
|
53
46
|
toOutput(output: FileSplitBatch): WorkflowBatchCollectionRef;
|
|
54
47
|
}
|
|
55
|
-
export declare function split(binary: Binary, workflow:
|
|
48
|
+
export declare function split(binary: Binary, workflow: AnyWorkflow, options: FileSplitOptions): Promise<WorkflowBatchCollectionRef>;
|
|
56
49
|
export declare namespace Split {
|
|
57
50
|
const line: (value?: string) => FileSplitDelimiter;
|
|
58
51
|
const char: (value: string, keep?: FileSplitDelimiter["keep"]) => FileSplitDelimiter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSplitActivity.d.ts","sourceRoot":"","sources":["../../src/activities/FileSplitActivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,MAAM,EAGX,KAAK,
|
|
1
|
+
{"version":3,"file":"FileSplitActivity.d.ts","sourceRoot":"","sources":["../../src/activities/F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ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"FileSplitActivity.js","sourceRoot":"","sources":["../../src/activities/FileSplitActivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,KAAK,EACL,OAAO,EAEP,0BAA0B,EAC1B,kBAAkB,EAClB,aAAa,EACb,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAA;AAGvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAIL,YAAY,GACb,MAAM,6BAA6B,CAAA;AAEpC,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAA;AA6ClC,MAAM,OAAO,iBAAkB,SAAQ,aAOtC;IACkB,MAAM,GAAG,IAAI,KAAK,CAAC;QAClC,QAAQ,EAAE,aAAa;KACxB,CAAC,CAAA;IAEK,OAAO,CACZ,MAAc,EACd,QAAqB,EACrB,OAAyB;QAEzB,IAAI,CAAC,QAAQ,CAAC,EAAE;YACd,MAAM,IAAI,SAAS,CACjB,sDAAsD,CACvD,CAAA;QAEH,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAChC,kBAAkB,CAAC,kBAAkB,CACnC,OAAO,CAAC,KAAK,EACb,OAAO,EACP,aAAa,EACb,iBAAiB,CAClB,CAAA;YAED,iBAAiB,CAAC,OAAO,CAAC,KAAsB,EAAE;gBAChD,UAAU,EAAE,iBAAiB;aAC9B,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,CAAA;IACnD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,EACrB,MAAM,EACN,QAAQ,EACR,OAAO,GACgB;QAOvB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC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":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAoBxD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/constants/operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAoBxD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAgBvE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/constants/operations.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AAGvB,MAAM,EACJ,IAAI,EACJ,GAAG,EACH,OAAO,EACP,GAAG,EACH,IAAI,EACJ,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,MAAM,GACP,GAAG,IAAI,CAAA;AAER,MAAM,CAAC,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/constants/operations.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AAGvB,MAAM,EACJ,IAAI,EACJ,GAAG,EACH,OAAO,EACP,GAAG,EACH,IAAI,EACJ,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,MAAM,GACP,GAAG,IAAI,CAAA;AAER,MAAM,CAAC,MAAM,iBAAiB,GAA8C;IAC1E,IAAI;IACJ,GAAG;IACH,OAAO;IACP,GAAG;IACH,IAAI;IACJ,GAAG;IACH,GAAG;IACH,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,GAAG;IACH,MAAM;CACP,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSV.d.ts","sourceRoot":"","sources":["../../src/helpers/CSV.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"CSV.d.ts","sourceRoot":"","sources":["../../src/helpers/CSV.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAUvD,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,yBAAiB,GAAG,CAAC;IACnB,KAAY,MAAM,GAAG,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IA4B9D,SAAgB,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,UAatE;IAED,SAAgB,MAAM,CACpB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,EACrB,OAAO,CAAC,EAAE,aAAa,UAiBxB;CACF"}
|
package/dist/helpers/CSV.js
CHANGED
|
@@ -3,7 +3,9 @@ export var CSV;
|
|
|
3
3
|
function escape(value, delimiter) {
|
|
4
4
|
if (value === null || typeof value === 'undefined')
|
|
5
5
|
return '';
|
|
6
|
-
const text = typeof value === 'object'
|
|
6
|
+
const text = typeof value === 'object'
|
|
7
|
+
? JSON.stringify(value)
|
|
8
|
+
: String(value);
|
|
7
9
|
const includeQuotes = [delimiter, '"', '\n', '\r'];
|
|
8
10
|
if (includeQuotes.some(test => text.includes(test)))
|
|
9
11
|
return `"${text.replaceAll('"', '""')}"`;
|
package/dist/helpers/CSV.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSV.js","sourceRoot":"","sources":["../../src/helpers/CSV.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CSV.js","sourceRoot":"","sources":["../../src/helpers/CSV.ts"],"names":[],"mappings":"AAcA,MAAM,KAAW,GAAG,CAiEnB;AAjED,WAAiB,GAAG;IAGlB,SAAS,MAAM,CAAC,KAAc,EAAE,SAAiB;QAC/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,WAAW;YAAE,OAAO,EAAE,CAAA;QAE7D,MAAM,IAAI,GACR,OAAO,KAAK,KAAK,QAAQ;YACvB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;YACvB,CAAC,CAAC,MAAM,CAAC,KAAkB,CAAC,CAAA;QAEhC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QAElD,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjD,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAA;QAE1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,SAAS,cAAc,CAAC,MAA+B,EAAE,GAAW;QAClE,IAAI,GAAG,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;QAErC,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAU,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;YACtD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,OAAO,SAAS,CAAA;YAE/D,OAAQ,IAAgC,CAAC,OAAO,CAAC,CAAA;QACnD,CAAC,EAAE,MAAM,CAAC,CAAA;IACZ,CAAC;IAED,SAAgB,QAAQ,CAAC,OAAqB,EAAE,OAAuB;QACrE,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,GAAG,CAAA;QAE3C,OAAO,CACL,OAAO;aACJ,GAAG,CAAC,MAAM,CAAC,EAAE;YACZ,MAAM,MAAM,GACV,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAAA;YAErE,OAAO,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAClC,CAAC,CAAC;aACD,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAC1B,CAAA;IACH,CAAC;IAbe,YAAQ,WAavB,CAAA;IAED,SAAgB,MAAM,CACpB,KAAmB,EACnB,OAAqB,EACrB,OAAuB;QAEvB,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,GAAG,CAAA;QAE3C,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE,CAA4B,CAAA;QAEvD,OAAO,CACL,OAAO;aACJ,GAAG,CAAC,MAAM,CAAC,EAAE;YACZ,MAAM,GAAG,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAA;YAE5D,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;YAEzC,OAAO,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;QACjC,CAAC,CAAC;aACD,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAC1B,CAAA;IACH,CAAC;IApBe,UAAM,SAoBrB,CAAA;AACH,CAAC,EAjEgB,GAAG,KAAH,GAAG,QAiEnB"}
|
|
@@ -12,7 +12,7 @@ export function toDelimiter({ value, keep }, encoding) {
|
|
|
12
12
|
return { bytes, keepPrevious, keepNext };
|
|
13
13
|
}
|
|
14
14
|
export function sliceTooLarge(start, sizeInBytes) {
|
|
15
|
-
return new RangeError(`Split slice starting at byte ${start} is larger than ${MAX_SLICE_BYTES} bytes (${sizeInBytes} so far): lower every or check the delimiter`);
|
|
15
|
+
return new RangeError(`Split slice starting at byte ${String(start)} is larger than ${String(MAX_SLICE_BYTES)} bytes (${String(sizeInBytes)} so far): lower every or check the delimiter`);
|
|
16
16
|
}
|
|
17
17
|
export function splitRecords(source, { delimiter, trim, encoding = 'utf8' }) {
|
|
18
18
|
const cut = toDelimiter(delimiter, encoding);
|
|
@@ -36,6 +36,8 @@ async function* records(source, { bytes, keepPrevious, keepNext }, offset) {
|
|
|
36
36
|
let remaining = end - start;
|
|
37
37
|
while (remaining > 0) {
|
|
38
38
|
const piece = pieces[0];
|
|
39
|
+
if (piece === undefined)
|
|
40
|
+
throw new RangeError('Split ran out of buffered bytes to take');
|
|
39
41
|
if (piece.length <= remaining) {
|
|
40
42
|
taken.push(piece);
|
|
41
43
|
pieces.shift();
|
|
@@ -56,14 +58,10 @@ async function* records(source, { bytes, keepPrevious, keepNext }, offset) {
|
|
|
56
58
|
pieces.push(chunk);
|
|
57
59
|
consumed += chunk.length;
|
|
58
60
|
const matches = [];
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (index !== -1 && probeAt + index < chunkAt) {
|
|
64
|
-
matches.push(probeAt + index);
|
|
65
|
-
searchAt = probeAt + index + bytes.length;
|
|
66
|
-
}
|
|
61
|
+
const straddling = straddlingMatch(tail, chunk, chunkAt, bytes, searchAt);
|
|
62
|
+
if (straddling !== -1) {
|
|
63
|
+
matches.push(straddling);
|
|
64
|
+
searchAt = straddling + bytes.length;
|
|
67
65
|
}
|
|
68
66
|
let index;
|
|
69
67
|
while ((index = chunk.indexOf(bytes, Math.max(0, searchAt - chunkAt))) !== -1) {
|
|
@@ -98,8 +96,10 @@ async function* skipFirst(source, count) {
|
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
async function* skipLast(source, count) {
|
|
101
|
-
if (count === 0)
|
|
102
|
-
|
|
99
|
+
if (count === 0) {
|
|
100
|
+
yield* source;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
103
|
let tail = Buffer.alloc(0);
|
|
104
104
|
for await (const chunk of source) {
|
|
105
105
|
const buffer = Buffer.concat([tail, chunk]);
|
|
@@ -109,4 +109,14 @@ async function* skipLast(source, count) {
|
|
|
109
109
|
tail = buffer.subarray(end);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
+
function straddlingMatch(tail, chunk, chunkAt, bytes, searchAt) {
|
|
113
|
+
if (tail.length === 0)
|
|
114
|
+
return -1;
|
|
115
|
+
const probe = Buffer.concat([tail, chunk.subarray(0, bytes.length - 1)]);
|
|
116
|
+
const probeAt = chunkAt - tail.length;
|
|
117
|
+
const index = probe.indexOf(bytes, Math.max(0, searchAt - probeAt));
|
|
118
|
+
if (index === -1 || probeAt + index >= chunkAt)
|
|
119
|
+
return -1;
|
|
120
|
+
return probeAt + index;
|
|
121
|
+
}
|
|
112
122
|
//# sourceMappingURL=split-records.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-records.js","sourceRoot":"","sources":["../../src/helpers/split-records.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AAQ9C,MAAM,UAAU,WAAW,CACzB,EAAE,KAAK,EAAE,IAAI,EAAsB,EACnC,QAAwB;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC1C,MAAM,YAAY,GAAG,IAAI,EAAE,QAAQ,IAAI,CAAC,CAAA;IACxC,MAAM,QAAQ,GAAG,IAAI,EAAE,IAAI,IAAI,CAAC,CAAA;IAEhC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QACpB,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAA;IAE1D,IAAI,YAAY,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC;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CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACxE,MAAM,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,MAAM,CAAA;IACrC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAA;IAEnE,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,OAAO,GAAG,KAAK,IAAI,OAAO;QAAE,OAAO,CAAC,CAAC,CAAA;IAEzD,OAAO,OAAO,GAAG,KAAK,CAAA;AACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t4h.framework/fs",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "File system module for the T4H Framework",
|
|
5
5
|
"homepage": "https://github.com/tech4humans-brasil/framework/tree/main/packages/fs",
|
|
6
6
|
"bugs": "https://github.com/tech4humans-brasil/framework/issues",
|
|
@@ -26,13 +26,14 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc --project tsconfig.build.json",
|
|
28
28
|
"check-types": "tsc --noEmit",
|
|
29
|
-
"
|
|
29
|
+
"check-package": "publint --strict && attw --pack . --profile esm-only",
|
|
30
|
+
"lint": "eslint . --max-warnings 0",
|
|
30
31
|
"prepublishOnly": "yarn build",
|
|
31
32
|
"test": "vitest run",
|
|
32
33
|
"test:watch": "vitest"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@t4h.framework/core": "^0.
|
|
36
|
+
"@t4h.framework/core": "^0.20.0",
|
|
36
37
|
"typescript": "^5.9.3",
|
|
37
38
|
"vitest": "^4.0.18"
|
|
38
39
|
},
|