@uploadista/core 0.0.2 → 0.0.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/.turbo/turbo-build.log +88 -1
- package/README.md +6 -20
- package/dist/checksum-C5qE-5eg.js +2 -0
- package/dist/checksum-C5qE-5eg.js.map +1 -0
- package/dist/checksum-wSBuXX84.cjs +1 -0
- package/dist/errors/index.cjs +1 -1
- package/dist/errors/index.d.cts +2 -2
- package/dist/errors/index.d.ts +3 -3
- package/dist/errors/index.js +1 -2
- package/dist/flow/index.cjs +1 -1
- package/dist/flow/index.d.cts +5 -5
- package/dist/flow/index.d.ts +6 -24
- package/dist/flow/index.js +1 -24
- package/dist/flow-B0mMJM5Y.js +2 -0
- package/dist/flow-B0mMJM5Y.js.map +1 -0
- package/dist/flow-s5bgJsdb.cjs +1 -0
- package/dist/index-0xq1cArb.d.cts +4132 -0
- package/dist/index-0xq1cArb.d.cts.map +1 -0
- package/dist/index-B46hb7yB.d.cts +36 -0
- package/dist/index-B46hb7yB.d.cts.map +1 -0
- package/dist/{streams/stream-limiter.d.cts → index-C1mxuUxK.d.ts} +3 -3
- package/dist/index-C1mxuUxK.d.ts.map +1 -0
- package/dist/index-DMJv8Tvo.d.ts +168 -0
- package/dist/index-DMJv8Tvo.d.ts.map +1 -0
- package/dist/index-GLPiXqj4.d.cts +168 -0
- package/dist/index-GLPiXqj4.d.cts.map +1 -0
- package/dist/index-YegzC0p1.d.ts +3952 -0
- package/dist/index-YegzC0p1.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +1 -5
- package/dist/stream-limiter-CTuiXkcq.js +2 -0
- package/dist/{stream-limiter-CoWKv39w.js.map → stream-limiter-CTuiXkcq.js.map} +1 -1
- package/dist/stream-limiter-DYGG4t9f.cjs +1 -0
- package/dist/streams/index.cjs +1 -0
- package/dist/streams/index.d.cts +3 -0
- package/dist/streams/index.d.ts +3 -0
- package/dist/streams/index.js +1 -0
- package/dist/streams-BiD_pOPH.cjs +0 -0
- package/dist/streams-Bs3GDNKJ.js +1 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +6 -10
- package/dist/types/index.js +1 -9
- package/dist/types-Dj9g8ocl.cjs +1 -0
- package/dist/types-m26wrG-Z.js +2 -0
- package/dist/types-m26wrG-Z.js.map +1 -0
- package/dist/upload/index.cjs +1 -1
- package/dist/upload/index.d.cts +5 -5
- package/dist/upload/index.d.ts +6 -4
- package/dist/upload/index.js +1 -3
- package/dist/upload-BzU7ifyH.js +2 -0
- package/dist/upload-BzU7ifyH.js.map +1 -0
- package/dist/upload-DvLp6TXO.cjs +1 -0
- package/dist/uploadista-error-CAtkQiAv.d.cts +221 -0
- package/dist/uploadista-error-CAtkQiAv.d.cts.map +1 -0
- package/dist/{uploadista-error-BVsVxqvz.js → uploadista-error-CjfcFnVa.js} +9 -2
- package/dist/uploadista-error-CjfcFnVa.js.map +1 -0
- package/dist/uploadista-error-D9SONF9K.d.ts +221 -0
- package/dist/uploadista-error-D9SONF9K.d.ts.map +1 -0
- package/dist/{uploadista-error-BB-Wdiz9.cjs → uploadista-error-DdTP-Rjx.cjs} +9 -2
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.cts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils-BILytQlb.js +2 -0
- package/dist/utils-BILytQlb.js.map +1 -0
- package/dist/utils-BLsIUd8c.cjs +1 -0
- package/package.json +12 -16
- package/src/index.ts +2 -0
- package/src/streams/index.ts +1 -0
- package/src/utils/index.ts +5 -0
- package/tsdown.config.ts +2 -10
- package/dist/chunk-CUT6urMc.cjs +0 -1
- package/dist/debounce-C2SeqcxD.js +0 -2
- package/dist/debounce-C2SeqcxD.js.map +0 -1
- package/dist/debounce-LZK7yS7Z.cjs +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/uploadista-error.d.ts +0 -209
- package/dist/errors/uploadista-error.d.ts.map +0 -1
- package/dist/errors/uploadista-error.js +0 -322
- package/dist/flow/edge.d.ts +0 -47
- package/dist/flow/edge.d.ts.map +0 -1
- package/dist/flow/edge.js +0 -40
- package/dist/flow/event.d.ts +0 -206
- package/dist/flow/event.d.ts.map +0 -1
- package/dist/flow/event.js +0 -53
- package/dist/flow/flow-server.d.ts +0 -223
- package/dist/flow/flow-server.d.ts.map +0 -1
- package/dist/flow/flow-server.js +0 -614
- package/dist/flow/flow.d.ts +0 -238
- package/dist/flow/flow.d.ts.map +0 -1
- package/dist/flow/flow.js +0 -629
- package/dist/flow/index.d.ts.map +0 -1
- package/dist/flow/node.d.ts +0 -136
- package/dist/flow/node.d.ts.map +0 -1
- package/dist/flow/node.js +0 -153
- package/dist/flow/nodes/index.d.ts +0 -8
- package/dist/flow/nodes/index.d.ts.map +0 -1
- package/dist/flow/nodes/index.js +0 -7
- package/dist/flow/nodes/input-node.d.ts +0 -78
- package/dist/flow/nodes/input-node.d.ts.map +0 -1
- package/dist/flow/nodes/input-node.js +0 -233
- package/dist/flow/nodes/storage-node.d.ts +0 -67
- package/dist/flow/nodes/storage-node.d.ts.map +0 -1
- package/dist/flow/nodes/storage-node.js +0 -94
- package/dist/flow/nodes/streaming-input-node.d.ts +0 -69
- package/dist/flow/nodes/streaming-input-node.d.ts.map +0 -1
- package/dist/flow/nodes/streaming-input-node.js +0 -156
- package/dist/flow/nodes/transform-node.d.ts +0 -85
- package/dist/flow/nodes/transform-node.d.ts.map +0 -1
- package/dist/flow/nodes/transform-node.js +0 -107
- package/dist/flow/parallel-scheduler.d.ts +0 -175
- package/dist/flow/parallel-scheduler.d.ts.map +0 -1
- package/dist/flow/parallel-scheduler.js +0 -193
- package/dist/flow/plugins/credential-provider.d.ts +0 -47
- package/dist/flow/plugins/credential-provider.d.ts.map +0 -1
- package/dist/flow/plugins/credential-provider.js +0 -24
- package/dist/flow/plugins/image-ai-plugin.d.ts +0 -61
- package/dist/flow/plugins/image-ai-plugin.d.ts.map +0 -1
- package/dist/flow/plugins/image-ai-plugin.js +0 -21
- package/dist/flow/plugins/image-plugin.d.ts +0 -52
- package/dist/flow/plugins/image-plugin.d.ts.map +0 -1
- package/dist/flow/plugins/image-plugin.js +0 -22
- package/dist/flow/plugins/types/describe-image-node.d.ts +0 -16
- package/dist/flow/plugins/types/describe-image-node.d.ts.map +0 -1
- package/dist/flow/plugins/types/describe-image-node.js +0 -9
- package/dist/flow/plugins/types/index.d.ts +0 -9
- package/dist/flow/plugins/types/index.d.ts.map +0 -1
- package/dist/flow/plugins/types/index.js +0 -8
- package/dist/flow/plugins/types/optimize-node.d.ts +0 -20
- package/dist/flow/plugins/types/optimize-node.d.ts.map +0 -1
- package/dist/flow/plugins/types/optimize-node.js +0 -11
- package/dist/flow/plugins/types/remove-background-node.d.ts +0 -16
- package/dist/flow/plugins/types/remove-background-node.d.ts.map +0 -1
- package/dist/flow/plugins/types/remove-background-node.js +0 -9
- package/dist/flow/plugins/types/resize-node.d.ts +0 -21
- package/dist/flow/plugins/types/resize-node.d.ts.map +0 -1
- package/dist/flow/plugins/types/resize-node.js +0 -16
- package/dist/flow/plugins/zip-plugin.d.ts +0 -62
- package/dist/flow/plugins/zip-plugin.d.ts.map +0 -1
- package/dist/flow/plugins/zip-plugin.js +0 -21
- package/dist/flow/typed-flow.d.ts +0 -90
- package/dist/flow/typed-flow.d.ts.map +0 -1
- package/dist/flow/typed-flow.js +0 -59
- package/dist/flow/types/flow-file.d.ts +0 -45
- package/dist/flow/types/flow-file.d.ts.map +0 -1
- package/dist/flow/types/flow-file.js +0 -27
- package/dist/flow/types/flow-job.d.ts +0 -118
- package/dist/flow/types/flow-job.d.ts.map +0 -1
- package/dist/flow/types/flow-job.js +0 -11
- package/dist/flow/types/flow-types.d.ts +0 -321
- package/dist/flow/types/flow-types.d.ts.map +0 -1
- package/dist/flow/types/flow-types.js +0 -52
- package/dist/flow/types/index.d.ts +0 -4
- package/dist/flow/types/index.d.ts.map +0 -1
- package/dist/flow/types/index.js +0 -3
- package/dist/flow/types/run-args.d.ts +0 -38
- package/dist/flow/types/run-args.d.ts.map +0 -1
- package/dist/flow/types/run-args.js +0 -30
- package/dist/flow/types/type-validator.d.ts +0 -26
- package/dist/flow/types/type-validator.d.ts.map +0 -1
- package/dist/flow/types/type-validator.js +0 -134
- package/dist/flow/utils/resolve-upload-metadata.d.ts +0 -11
- package/dist/flow/utils/resolve-upload-metadata.d.ts.map +0 -1
- package/dist/flow/utils/resolve-upload-metadata.js +0 -28
- package/dist/flow-2zXnEiWL.cjs +0 -1
- package/dist/flow-CRaKy7Vj.js +0 -2
- package/dist/flow-CRaKy7Vj.js.map +0 -1
- package/dist/generate-id-Dm-Vboxq.d.ts +0 -34
- package/dist/generate-id-Dm-Vboxq.d.ts.map +0 -1
- package/dist/generate-id-LjJRLD6N.d.cts +0 -34
- package/dist/generate-id-LjJRLD6N.d.cts.map +0 -1
- package/dist/generate-id-xHp_Z7Cl.cjs +0 -1
- package/dist/generate-id-yohS1ZDk.js +0 -2
- package/dist/generate-id-yohS1ZDk.js.map +0 -1
- package/dist/index-BO8GZlbD.d.cts +0 -1040
- package/dist/index-BO8GZlbD.d.cts.map +0 -1
- package/dist/index-D-CoVpkZ.d.ts +0 -1004
- package/dist/index-D-CoVpkZ.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/logger/logger.cjs +0 -1
- package/dist/logger/logger.d.cts +0 -8
- package/dist/logger/logger.d.cts.map +0 -1
- package/dist/logger/logger.d.ts +0 -5
- package/dist/logger/logger.d.ts.map +0 -1
- package/dist/logger/logger.js +0 -10
- package/dist/logger/logger.js.map +0 -1
- package/dist/semaphore-0ZwjVpyF.js +0 -2
- package/dist/semaphore-0ZwjVpyF.js.map +0 -1
- package/dist/semaphore-BHprIjFI.d.cts +0 -37
- package/dist/semaphore-BHprIjFI.d.cts.map +0 -1
- package/dist/semaphore-DThupBkc.d.ts +0 -37
- package/dist/semaphore-DThupBkc.d.ts.map +0 -1
- package/dist/semaphore-DVrONiAV.cjs +0 -1
- package/dist/stream-limiter-CoWKv39w.js +0 -2
- package/dist/stream-limiter-JgOwmkMa.cjs +0 -1
- package/dist/streams/multi-stream.cjs +0 -1
- package/dist/streams/multi-stream.d.cts +0 -91
- package/dist/streams/multi-stream.d.cts.map +0 -1
- package/dist/streams/multi-stream.d.ts +0 -86
- package/dist/streams/multi-stream.d.ts.map +0 -1
- package/dist/streams/multi-stream.js +0 -149
- package/dist/streams/multi-stream.js.map +0 -1
- package/dist/streams/stream-limiter.cjs +0 -1
- package/dist/streams/stream-limiter.d.cts.map +0 -1
- package/dist/streams/stream-limiter.d.ts +0 -27
- package/dist/streams/stream-limiter.d.ts.map +0 -1
- package/dist/streams/stream-limiter.js +0 -49
- package/dist/streams/stream-splitter.cjs +0 -1
- package/dist/streams/stream-splitter.d.cts +0 -68
- package/dist/streams/stream-splitter.d.cts.map +0 -1
- package/dist/streams/stream-splitter.d.ts +0 -51
- package/dist/streams/stream-splitter.d.ts.map +0 -1
- package/dist/streams/stream-splitter.js +0 -175
- package/dist/streams/stream-splitter.js.map +0 -1
- package/dist/types/data-store-registry.d.ts +0 -13
- package/dist/types/data-store-registry.d.ts.map +0 -1
- package/dist/types/data-store-registry.js +0 -4
- package/dist/types/data-store.d.ts +0 -316
- package/dist/types/data-store.d.ts.map +0 -1
- package/dist/types/data-store.js +0 -157
- package/dist/types/event-broadcaster.d.ts +0 -28
- package/dist/types/event-broadcaster.d.ts.map +0 -1
- package/dist/types/event-broadcaster.js +0 -6
- package/dist/types/event-emitter.d.ts +0 -378
- package/dist/types/event-emitter.d.ts.map +0 -1
- package/dist/types/event-emitter.js +0 -223
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/input-file.d.ts +0 -104
- package/dist/types/input-file.d.ts.map +0 -1
- package/dist/types/input-file.js +0 -27
- package/dist/types/kv-store.d.ts +0 -281
- package/dist/types/kv-store.d.ts.map +0 -1
- package/dist/types/kv-store.js +0 -234
- package/dist/types/middleware.d.ts +0 -17
- package/dist/types/middleware.d.ts.map +0 -1
- package/dist/types/middleware.js +0 -21
- package/dist/types/upload-event.d.ts +0 -105
- package/dist/types/upload-event.d.ts.map +0 -1
- package/dist/types/upload-event.js +0 -71
- package/dist/types/upload-file.d.ts +0 -136
- package/dist/types/upload-file.d.ts.map +0 -1
- package/dist/types/upload-file.js +0 -34
- package/dist/types/websocket.d.ts +0 -144
- package/dist/types/websocket.d.ts.map +0 -1
- package/dist/types/websocket.js +0 -40
- package/dist/types-BT-cvi7T.cjs +0 -1
- package/dist/types-DhU2j-XF.js +0 -2
- package/dist/types-DhU2j-XF.js.map +0 -1
- package/dist/upload/convert-to-stream.d.ts +0 -38
- package/dist/upload/convert-to-stream.d.ts.map +0 -1
- package/dist/upload/convert-to-stream.js +0 -43
- package/dist/upload/convert-upload-to-flow-file.d.ts +0 -14
- package/dist/upload/convert-upload-to-flow-file.d.ts.map +0 -1
- package/dist/upload/convert-upload-to-flow-file.js +0 -21
- package/dist/upload/create-upload.d.ts +0 -68
- package/dist/upload/create-upload.d.ts.map +0 -1
- package/dist/upload/create-upload.js +0 -157
- package/dist/upload/index.d.ts.map +0 -1
- package/dist/upload/mime.d.ts +0 -24
- package/dist/upload/mime.d.ts.map +0 -1
- package/dist/upload/mime.js +0 -351
- package/dist/upload/upload-chunk.d.ts +0 -58
- package/dist/upload/upload-chunk.d.ts.map +0 -1
- package/dist/upload/upload-chunk.js +0 -277
- package/dist/upload/upload-server.d.ts +0 -221
- package/dist/upload/upload-server.d.ts.map +0 -1
- package/dist/upload/upload-server.js +0 -181
- package/dist/upload/upload-strategy-negotiator.d.ts +0 -148
- package/dist/upload/upload-strategy-negotiator.d.ts.map +0 -1
- package/dist/upload/upload-strategy-negotiator.js +0 -217
- package/dist/upload/upload-url.d.ts +0 -68
- package/dist/upload/upload-url.d.ts.map +0 -1
- package/dist/upload/upload-url.js +0 -142
- package/dist/upload/write-to-store.d.ts +0 -77
- package/dist/upload/write-to-store.d.ts.map +0 -1
- package/dist/upload/write-to-store.js +0 -147
- package/dist/upload-DLuICjpP.cjs +0 -1
- package/dist/upload-DaXO34dE.js +0 -2
- package/dist/upload-DaXO34dE.js.map +0 -1
- package/dist/uploadista-error-BVsVxqvz.js.map +0 -1
- package/dist/uploadista-error-CwxYs4EB.d.ts +0 -52
- package/dist/uploadista-error-CwxYs4EB.d.ts.map +0 -1
- package/dist/uploadista-error-kKlhLRhY.d.cts +0 -52
- package/dist/uploadista-error-kKlhLRhY.d.cts.map +0 -1
- package/dist/utils/checksum.d.ts +0 -22
- package/dist/utils/checksum.d.ts.map +0 -1
- package/dist/utils/checksum.js +0 -49
- package/dist/utils/debounce.cjs +0 -1
- package/dist/utils/debounce.d.cts +0 -38
- package/dist/utils/debounce.d.cts.map +0 -1
- package/dist/utils/debounce.d.ts +0 -36
- package/dist/utils/debounce.d.ts.map +0 -1
- package/dist/utils/debounce.js +0 -73
- package/dist/utils/generate-id.cjs +0 -1
- package/dist/utils/generate-id.d.cts +0 -2
- package/dist/utils/generate-id.d.ts +0 -32
- package/dist/utils/generate-id.d.ts.map +0 -1
- package/dist/utils/generate-id.js +0 -23
- package/dist/utils/md5.cjs +0 -1
- package/dist/utils/md5.d.cts +0 -73
- package/dist/utils/md5.d.cts.map +0 -1
- package/dist/utils/md5.d.ts +0 -71
- package/dist/utils/md5.d.ts.map +0 -1
- package/dist/utils/md5.js +0 -417
- package/dist/utils/md5.js.map +0 -1
- package/dist/utils/once.cjs +0 -1
- package/dist/utils/once.d.cts +0 -25
- package/dist/utils/once.d.cts.map +0 -1
- package/dist/utils/once.d.ts +0 -21
- package/dist/utils/once.d.ts.map +0 -1
- package/dist/utils/once.js +0 -54
- package/dist/utils/once.js.map +0 -1
- package/dist/utils/semaphore.cjs +0 -1
- package/dist/utils/semaphore.d.cts +0 -3
- package/dist/utils/semaphore.d.ts +0 -78
- package/dist/utils/semaphore.d.ts.map +0 -1
- package/dist/utils/semaphore.js +0 -134
- package/dist/utils/throttle.cjs +0 -1
- package/dist/utils/throttle.d.cts +0 -24
- package/dist/utils/throttle.d.cts.map +0 -1
- package/dist/utils/throttle.d.ts +0 -18
- package/dist/utils/throttle.d.ts.map +0 -1
- package/dist/utils/throttle.js +0 -20
- package/dist/utils/throttle.js.map +0 -1
- package/src/logger/logger.ts +0 -14
- /package/dist/{errors-CRm1FHHT.cjs → errors-D-K-vxsP.cjs} +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import * as effect_Types0 from "effect/Types";
|
|
3
|
+
import * as effect_Cause0 from "effect/Cause";
|
|
4
|
+
|
|
5
|
+
//#region src/errors/uploadista-error.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Union type of all possible error codes in the Uploadista system.
|
|
9
|
+
*
|
|
10
|
+
* Each error code corresponds to a specific error condition with predefined
|
|
11
|
+
* HTTP status codes and messages in the ERROR_CATALOG.
|
|
12
|
+
*/
|
|
13
|
+
type UploadistaErrorCode = "MISSING_OFFSET" | "ABORTED" | "INVALID_TERMINATION" | "ERR_LOCK_TIMEOUT" | "INVALID_CONTENT_TYPE" | "FLOW_STRUCTURE_ERROR" | "FLOW_CYCLE_ERROR" | "FLOW_NODE_NOT_FOUND" | "FLOW_NODE_ERROR" | "FLOW_NOT_AUTHORIZED" | "FLOW_NOT_FOUND" | "FILE_READ_ERROR" | "FLOW_JOB_NOT_FOUND" | "FLOW_JOB_ERROR" | "DATASTORE_NOT_FOUND" | "FILE_NOT_FOUND" | "INVALID_OFFSET" | "FILE_NO_LONGER_EXISTS" | "ERR_SIZE_EXCEEDED" | "ERR_MAX_SIZE_EXCEEDED" | "INVALID_LENGTH" | "INVALID_METADATA" | "VALIDATION_ERROR" | "STORAGE_NOT_AUTHORIZED" | "UNKNOWN_ERROR" | "FILE_WRITE_ERROR" | "UPLOAD_ID_NOT_FOUND" | "FLOW_OUTPUT_VALIDATION_ERROR" | "FLOW_INPUT_VALIDATION_ERROR" | "CHECKSUM_MISMATCH" | "MIMETYPE_MISMATCH" | "UNSUPPORTED_CHECKSUM_ALGORITHM";
|
|
14
|
+
/**
|
|
15
|
+
* Catalog of all predefined errors in the Uploadista system.
|
|
16
|
+
*
|
|
17
|
+
* Maps error codes to their HTTP status codes and default error messages.
|
|
18
|
+
* This centralized catalog ensures consistent error handling across all
|
|
19
|
+
* Uploadista packages and adapters.
|
|
20
|
+
*
|
|
21
|
+
* Each error entry contains:
|
|
22
|
+
* - `status`: HTTP status code (400-500 range)
|
|
23
|
+
* - `body`: Human-readable error message
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Access a specific error definition
|
|
28
|
+
* const fileNotFound = ERROR_CATALOG.FILE_NOT_FOUND;
|
|
29
|
+
* console.log(fileNotFound.status); // 404
|
|
30
|
+
* console.log(fileNotFound.body); // "The file for this url was not found\n"
|
|
31
|
+
*
|
|
32
|
+
* // Use with UploadistaError
|
|
33
|
+
* const error = UploadistaError.fromCode("FILE_NOT_FOUND");
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const ERROR_CATALOG: Readonly<Record<UploadistaErrorCode, {
|
|
37
|
+
status: number;
|
|
38
|
+
body: string;
|
|
39
|
+
}>>;
|
|
40
|
+
declare const UploadistaError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
|
|
41
|
+
readonly _tag: "UploadistaError";
|
|
42
|
+
} & Readonly<A>;
|
|
43
|
+
/**
|
|
44
|
+
* Standard error class for all Uploadista operations.
|
|
45
|
+
*
|
|
46
|
+
* UploadistaError provides a consistent error handling approach across the entire
|
|
47
|
+
* Uploadista ecosystem. Each error has:
|
|
48
|
+
* - A typed error code from the ERROR_CATALOG
|
|
49
|
+
* - An HTTP-compatible status code
|
|
50
|
+
* - A human-readable error message (body)
|
|
51
|
+
* - Optional additional details and cause information
|
|
52
|
+
*
|
|
53
|
+
* This class integrates with Effect-TS for functional error handling and can be
|
|
54
|
+
* easily converted to an Effect that fails.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* // Create from error code
|
|
59
|
+
* const error = UploadistaError.fromCode("FILE_NOT_FOUND");
|
|
60
|
+
*
|
|
61
|
+
* // Create with custom details
|
|
62
|
+
* const customError = UploadistaError.fromCode("FLOW_NODE_ERROR", {
|
|
63
|
+
* body: "Failed to process image",
|
|
64
|
+
* cause: originalError,
|
|
65
|
+
* details: { nodeId: "resize-1", fileId: "abc123" }
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* // Use with Effect
|
|
69
|
+
* const effect = customError.toEffect<void>();
|
|
70
|
+
*
|
|
71
|
+
* // In an Effect pipeline
|
|
72
|
+
* return Effect.gen(function* () {
|
|
73
|
+
* const file = yield* getFile(id);
|
|
74
|
+
* if (!file) {
|
|
75
|
+
* return yield* UploadistaError.fromCode("FILE_NOT_FOUND").toEffect();
|
|
76
|
+
* }
|
|
77
|
+
* return file;
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
declare class UploadistaError extends UploadistaError_base {
|
|
82
|
+
readonly code: string;
|
|
83
|
+
readonly status: number;
|
|
84
|
+
readonly status_code: number;
|
|
85
|
+
readonly body: string;
|
|
86
|
+
readonly details?: unknown;
|
|
87
|
+
constructor({
|
|
88
|
+
code,
|
|
89
|
+
status,
|
|
90
|
+
body,
|
|
91
|
+
cause,
|
|
92
|
+
details
|
|
93
|
+
}: {
|
|
94
|
+
code: UploadistaErrorCode | string;
|
|
95
|
+
status: number;
|
|
96
|
+
body: string;
|
|
97
|
+
cause?: unknown;
|
|
98
|
+
details?: unknown;
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Creates an UploadistaError from a predefined error code.
|
|
102
|
+
*
|
|
103
|
+
* This is the primary way to create errors in the Uploadista system. Each error code
|
|
104
|
+
* has a default status and message defined in ERROR_CATALOG, but these can be overridden
|
|
105
|
+
* for specific use cases.
|
|
106
|
+
*
|
|
107
|
+
* @param code - One of the predefined error codes from UploadistaErrorCode
|
|
108
|
+
* @param overrides - Optional overrides for the default error properties
|
|
109
|
+
* @param overrides.status - Custom HTTP status code (overrides the default)
|
|
110
|
+
* @param overrides.body - Custom error message (overrides the default)
|
|
111
|
+
* @param overrides.details - Additional structured data about the error
|
|
112
|
+
* @param overrides.cause - The underlying error that caused this error (for error chaining)
|
|
113
|
+
*
|
|
114
|
+
* @returns A new UploadistaError instance
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* // Use default error
|
|
119
|
+
* const error = UploadistaError.fromCode("FILE_NOT_FOUND");
|
|
120
|
+
*
|
|
121
|
+
* // Override message
|
|
122
|
+
* const customError = UploadistaError.fromCode("FILE_NOT_FOUND", {
|
|
123
|
+
* body: `File with ID ${fileId} was not found in storage`
|
|
124
|
+
* });
|
|
125
|
+
*
|
|
126
|
+
* // Include cause and details
|
|
127
|
+
* const detailedError = UploadistaError.fromCode("DATASTORE_NOT_FOUND", {
|
|
128
|
+
* cause: storageException,
|
|
129
|
+
* details: { storageId: "s3-prod", region: "us-east-1" }
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
static fromCode(code: UploadistaErrorCode, overrides?: Partial<Pick<UploadistaError, "status" | "body">> & {
|
|
134
|
+
details?: unknown;
|
|
135
|
+
cause?: unknown;
|
|
136
|
+
}): UploadistaError;
|
|
137
|
+
/**
|
|
138
|
+
* Converts this error to an Effect that immediately fails.
|
|
139
|
+
*
|
|
140
|
+
* This method integrates UploadistaError with Effect-TS's error handling system,
|
|
141
|
+
* allowing errors to be used in Effect pipelines with proper type checking.
|
|
142
|
+
*
|
|
143
|
+
* @template T - The success type of the Effect (defaults to never since it always fails)
|
|
144
|
+
* @returns An Effect that fails with this UploadistaError
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const error = UploadistaError.fromCode("FILE_NOT_FOUND");
|
|
149
|
+
*
|
|
150
|
+
* // Use in an Effect pipeline
|
|
151
|
+
* return Effect.gen(function* () {
|
|
152
|
+
* const file = yield* kvStore.get(fileId);
|
|
153
|
+
* if (!file) {
|
|
154
|
+
* return yield* error.toEffect();
|
|
155
|
+
* }
|
|
156
|
+
* return file;
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
toEffect<T = never>(): Effect.Effect<T, UploadistaError>;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Type guard to check if an unknown value is an UploadistaError.
|
|
164
|
+
*
|
|
165
|
+
* Useful for error handling when catching errors that might be from
|
|
166
|
+
* different sources or libraries.
|
|
167
|
+
*
|
|
168
|
+
* @param error - The value to check
|
|
169
|
+
* @returns True if the value is an UploadistaError instance
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* try {
|
|
174
|
+
* await someOperation();
|
|
175
|
+
* } catch (error) {
|
|
176
|
+
* if (isUploadistaError(error)) {
|
|
177
|
+
* console.log(`Uploadista error: ${error.code} (${error.status})`);
|
|
178
|
+
* console.log(error.body);
|
|
179
|
+
* } else {
|
|
180
|
+
* console.error("Unknown error:", error);
|
|
181
|
+
* }
|
|
182
|
+
* }
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
declare function isUploadistaError(error: unknown): error is UploadistaError;
|
|
186
|
+
/**
|
|
187
|
+
* Creates an Effect that immediately fails with an UploadistaError.
|
|
188
|
+
*
|
|
189
|
+
* This is a convenience function that combines error creation with Effect conversion.
|
|
190
|
+
* It's equivalent to calling `UploadistaError.fromCode(code, overrides).toEffect()`.
|
|
191
|
+
*
|
|
192
|
+
* @param code - One of the predefined error codes from UploadistaErrorCode
|
|
193
|
+
* @param overrides - Optional overrides for the default error properties
|
|
194
|
+
* @param overrides.status - Custom HTTP status code
|
|
195
|
+
* @param overrides.body - Custom error message
|
|
196
|
+
* @param overrides.details - Additional structured data about the error
|
|
197
|
+
* @param overrides.cause - The underlying error that caused this error
|
|
198
|
+
*
|
|
199
|
+
* @returns An Effect that immediately fails with the created UploadistaError
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* // In an Effect pipeline
|
|
204
|
+
* return Effect.gen(function* () {
|
|
205
|
+
* const file = yield* kvStore.get(fileId);
|
|
206
|
+
* if (!file) {
|
|
207
|
+
* return yield* httpFailure("FILE_NOT_FOUND", {
|
|
208
|
+
* details: { fileId }
|
|
209
|
+
* });
|
|
210
|
+
* }
|
|
211
|
+
* return file;
|
|
212
|
+
* });
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
declare function httpFailure(code: UploadistaErrorCode, overrides?: Partial<Pick<UploadistaError, "status" | "body">> & {
|
|
216
|
+
details?: unknown;
|
|
217
|
+
cause?: unknown;
|
|
218
|
+
}): Effect.Effect<never, UploadistaError>;
|
|
219
|
+
//#endregion
|
|
220
|
+
export { isUploadistaError as a, httpFailure as i, UploadistaError as n, UploadistaErrorCode as r, ERROR_CATALOG as t };
|
|
221
|
+
//# sourceMappingURL=uploadista-error-D9SONF9K.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadista-error-D9SONF9K.d.ts","names":[],"sources":["../src/errors/uploadista-error.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAQA;AAwDA;AACS,KAzDG,mBAAA,GAyDH,gBAAA,GAAA,SAAA,GAAA,qBAAA,GAAA,kBAAA,GAAA,sBAAA,GAAA,sBAAA,GAAA,kBAAA,GAAA,qBAAA,GAAA,iBAAA,GAAA,qBAAA,GAAA,gBAAA,GAAA,iBAAA,GAAA,oBAAA,GAAA,gBAAA,GAAA,q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riptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`effect`);c=s(c);const l={MISSING_OFFSET:{status:403,body:`Upload-Offset header required
|
|
2
2
|
`},ABORTED:{status:400,body:`Request aborted due to lock acquired`},INVALID_TERMINATION:{status:400,body:`Cannot terminate an already completed upload`},ERR_LOCK_TIMEOUT:{status:500,body:`failed to acquire lock before timeout`},INVALID_CONTENT_TYPE:{status:403,body:`Content-Type header required
|
|
3
3
|
`},DATASTORE_NOT_FOUND:{status:500,body:`The datastore was not found
|
|
4
4
|
`},UPLOAD_ID_NOT_FOUND:{status:500,body:`The upload id was not found
|
|
5
5
|
`},FILE_NOT_FOUND:{status:404,body:`The file for this url was not found
|
|
6
|
+
`},FLOW_NOT_AUTHORIZED:{status:401,body:`The flow is not authorized
|
|
7
|
+
`},FLOW_NOT_FOUND:{status:404,body:`The flow was not found
|
|
6
8
|
`},FLOW_STRUCTURE_ERROR:{status:500,body:`The flow structure is invalid
|
|
7
9
|
`},FLOW_CYCLE_ERROR:{status:500,body:`The flow contains a cycle
|
|
8
10
|
`},FLOW_NODE_NOT_FOUND:{status:500,body:`The flow node was not found
|
|
@@ -13,10 +15,15 @@ const e=require(`./chunk-CUT6urMc.cjs`);let t=require(`effect`);t=e.__toESM(t);c
|
|
|
13
15
|
`},FLOW_OUTPUT_VALIDATION_ERROR:{status:500,body:`The flow output validation failed
|
|
14
16
|
`},INVALID_OFFSET:{status:409,body:`Upload-Offset conflict
|
|
15
17
|
`},FILE_NO_LONGER_EXISTS:{status:410,body:`The file for this url no longer exists
|
|
18
|
+
`},FILE_READ_ERROR:{status:500,body:`Something went wrong reading the file
|
|
16
19
|
`},ERR_SIZE_EXCEEDED:{status:413,body:`upload's size exceeded
|
|
17
20
|
`},ERR_MAX_SIZE_EXCEEDED:{status:413,body:`Maximum size exceeded
|
|
18
21
|
`},INVALID_LENGTH:{status:400,body:`Upload-Length or Upload-Defer-Length header required
|
|
19
22
|
`},INVALID_METADATA:{status:400,body:`Upload-Metadata is invalid. It MUST consist of one or more comma-separated key-value pairs. The key and value MUST be separated by a space. The key MUST NOT contain spaces and commas and MUST NOT be empty. The key SHOULD be ASCII encoded and the value MUST be Base64 encoded. All keys MUST be unique`},VALIDATION_ERROR:{status:400,body:`Validation failed
|
|
23
|
+
`},STORAGE_NOT_AUTHORIZED:{status:401,body:`The storage is not authorized
|
|
20
24
|
`},UNKNOWN_ERROR:{status:500,body:`Something went wrong with that request
|
|
21
25
|
`},FILE_WRITE_ERROR:{status:500,body:`Something went wrong receiving the file
|
|
22
|
-
`}
|
|
26
|
+
`},CHECKSUM_MISMATCH:{status:400,body:`The file checksum does not match the provided checksum
|
|
27
|
+
`},MIMETYPE_MISMATCH:{status:400,body:`The file MIME type does not match the declared type
|
|
28
|
+
`},UNSUPPORTED_CHECKSUM_ALGORITHM:{status:400,body:`The specified checksum algorithm is not supported
|
|
29
|
+
`}};var u=class e extends c.Data.TaggedError(`UploadistaError`){code;status;status_code;body;details;constructor({code:e,status:t,body:n,cause:r,details:i}){super(),this.name=`UploadistaError`,this.code=e,this.status=t,this.status_code=t,this.body=n,this.details=i,r&&(this.cause=r)}static fromCode(t,n){let r=l[t];return new e({code:t,status:n?.status??r.status,body:n?.body??r.body,details:n?.details,cause:n?.cause})}toEffect(){return c.Effect.fail(this)}};function d(e){return e instanceof u}function f(e,t){return u.fromCode(e,t).toEffect()}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../uploadista-error-DdTP-Rjx.cjs`);const e=require(`../checksum-wSBuXX84.cjs`),t=require(`../utils-BLsIUd8c.cjs`);exports.GenerateId=e.r,exports.GenerateIdLive=e.i,exports.GenerateIdRandom=e.a,exports.GenerateIdService=e.o,exports.GenerateIdTimestamp=e.s,exports.Md5=t.a,exports.OnceEffect=t.r,exports.ThrottleEffect=t.t,exports.computeChecksum=e.t,exports.isSupportedAlgorithm=e.n,exports.once=t.i,exports.throttle=t.n;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "../uploadista-error-CAtkQiAv.cjs";
|
|
2
|
+
import { a as Md5, c as isSupportedAlgorithm, d as GenerateIdRandom, f as GenerateIdService, i as once, l as GenerateId, m as GenerateIdTimestamp, n as throttle, o as ChecksumAlgorithm, p as GenerateIdShape, r as OnceEffect, s as computeChecksum, t as ThrottleEffect, u as GenerateIdLive } from "../index-GLPiXqj4.cjs";
|
|
3
|
+
export { ChecksumAlgorithm, GenerateId, GenerateIdLive, GenerateIdRandom, GenerateIdService, GenerateIdShape, GenerateIdTimestamp, Md5, OnceEffect, ThrottleEffect, computeChecksum, isSupportedAlgorithm, once, throttle };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "../uploadista-error-D9SONF9K.js";
|
|
2
|
+
import { a as Md5, c as isSupportedAlgorithm, d as GenerateIdRandom, f as GenerateIdService, i as once, l as GenerateId, m as GenerateIdTimestamp, n as throttle, o as ChecksumAlgorithm, p as GenerateIdShape, r as OnceEffect, s as computeChecksum, t as ThrottleEffect, u as GenerateIdLive } from "../index-DMJv8Tvo.js";
|
|
3
|
+
export { ChecksumAlgorithm, GenerateId, GenerateIdLive, GenerateIdRandom, GenerateIdService, GenerateIdShape, GenerateIdTimestamp, Md5, OnceEffect, ThrottleEffect, computeChecksum, isSupportedAlgorithm, once, throttle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../uploadista-error-CjfcFnVa.js";import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"../checksum-C5qE-5eg.js";import{a as s,i as c,n as l,r as u,t as d}from"../utils-BILytQlb.js";export{i as GenerateId,t as GenerateIdLive,e as GenerateIdRandom,r as GenerateIdService,a as GenerateIdTimestamp,s as Md5,u as OnceEffect,d as ThrottleEffect,o as computeChecksum,n as isSupportedAlgorithm,c as once,l as throttle};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./uploadista-error-CjfcFnVa.js";import{Effect as t}from"effect";var n=class e{static hashStr(t,n=!1){return e.onePassHasher.start().appendStr(t).end(n)}static hashAsciiStr(t,n=!1){return e.onePassHasher.start().appendAsciiStr(t).end(n)}static stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);static buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);static hexChars=`0123456789abcdef`;static hexOut=[];static onePassHasher=new e;static _hex(t){let n=e.hexChars,r=e.hexOut,i,a,o,s;for(s=0;s<4;s+=1)for(a=s*8,i=t[s]??0,o=0;o<8;o+=2)r[a+1+o]=n.charAt(i&15),i>>>=4,r[a+0+o]=n.charAt(i&15),i>>>=4;return r.join(``)}static _md5cycle(e,t){let n=e[0]??0,r=e[1]??0,i=e[2]??0,a=e[3]??0;n+=(r&i|~r&a)+(t[0]??0)-680876936|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[1]??0)-389564586|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[2]??0)+606105819|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[3]??0)-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+(t[4]??0)-176418897|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[5]??0)+1200080426|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[6]??0)-1473231341|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[7]??0)-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+(t[8]??0)+1770035416|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[9]??0)-1958414417|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[10]??0)-42063|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[11]??0)-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+(t[12]??0)+1804603682|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[13]??0)-40341101|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[14]??0)-1502002290|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[15]??0)+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&a|i&~a)+(t[1]??0)-165796510|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[6]??0)-1069501632|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[11]??0)+643717713|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[0]??0)-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+(t[5]??0)-701558691|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[10]??0)+38016083|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[15]??0)-660478335|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[4]??0)-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+(t[9]??0)+568446438|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[14]??0)-1019803690|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[3]??0)-187363961|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[8]??0)+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+(t[13]??0)-1444681467|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[2]??0)-51403784|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[7]??0)+1735328473|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[12]??0)-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^a)+(t[5]??0)-378558|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[8]??0)-2022574463|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[11]??0)+1839030562|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[14]??0)-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+(t[1]??0)-1530992060|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[4]??0)+1272893353|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[7]??0)-155497632|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[10]??0)-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+(t[13]??0)+681279174|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[0]??0)-358537222|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[3]??0)-722521979|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[6]??0)+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+(t[9]??0)-640364487|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[12]??0)-421815835|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[15]??0)+530742520|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[2]??0)-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~a))+(t[0]??0)-198630844|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[7]??0)+1126891415|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[14]??0)-1416354905|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[5]??0)-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+(t[12]??0)+1700485571|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[3]??0)-1894986606|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[10]??0)-1051523|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[1]??0)-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+(t[8]??0)+1873313359|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[15]??0)-30611744|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[6]??0)-1560198380|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[13]??0)+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+(t[4]??0)-145523070|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[11]??0)-1120210379|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[2]??0)+718787259|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[9]??0)-343485551|0,r=(r<<21|r>>>11)+i|0,e[0]=n+(e[0]??0)|0,e[1]=r+(e[1]??0)|0,e[2]=i+(e[2]??0)|0,e[3]=a+(e[3]??0)|0}_dataLength=0;_bufferLength=0;_state=new Int32Array(4);_buffer=new ArrayBuffer(68);_buffer8;_buffer32;constructor(){this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,a,o;for(o=0;o<t.length;o+=1){if(a=t.charCodeAt(o),a<128)n[i++]=a;else if(a<2048)n[i++]=(a>>>6)+192,n[i++]=a&63|128;else if(a<55296||a>56319)n[i++]=(a>>>12)+224,n[i++]=a>>>6&63|128,n[i++]=a&63|128;else{if(a=(a-55296)*1024+(t.charCodeAt(++o)-56320)+65536,a>1114111)throw Error(`Unicode standard supports code points up to U+10FFFF`);n[i++]=(a>>>18)+240,n[i++]=a>>>12&63|128,n[i++]=a>>>6&63|128,n[i++]=a&63|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,r),i-=64,r[0]=r[16]??0)}return this._bufferLength=i,this}appendAsciiStr(t){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,a,o=0;for(;;){for(a=Math.min(t.length-o,64-i);a--;)n[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}appendByteArray(t){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,a,o=0;for(;;){for(a=Math.min(t.length-o,64-i);a--;)n[i++]=t[o++]??0;if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0]??0,e[1]??0,e[2]??0,e[3]??0]}}setState(e){let t=e.buffer,n=e.state,r=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,r[0]=n[0]??0,r[1]=n[1]??0,r[2]=n[2]??0,r[3]=n[3]??0,i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let n=this._bufferLength,r=this._buffer8,i=this._buffer32,a=(n>>2)+1;this._dataLength+=n;let o=this._dataLength*8;if(r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(e.buffer32Identity.subarray(a),a),n>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=4294967295)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(e===null)return;let t=Number.parseInt(e[2]??``,16),n=Number.parseInt(e[1]??``,16)||0;i[14]=t,i[15]=n}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}};if(n.hashStr(`hello`)!==`5d41402abc4b2a76b9719d911017c592`)throw Error(`Md5 self test failed.`);function r(e){let t=!1,n;return function(...r){if(t){if(n)return n;throw Error(`Function called more than once`)}return t=!0,n=e.apply(this,r),n}}const i={make:n=>{let r,i=!1;return t.gen(function*(){if(i){if(r!==void 0)return r;yield*new e({code:`UNKNOWN_ERROR`,status:500,body:`Effect called more than once with undefined result`}).toEffect()}return i=!0,r=yield*n,r})},legacy:r},a={leading:!1,trailing:!0};function o(e,t,n={}){let r={...a,...n},i;return function(...n){r.leading&&!i?(console.log(`leading`),e.apply(this,n),i=setTimeout(()=>{i=void 0},t)):(clearTimeout(i),i=setTimeout(()=>{r.trailing?(e.apply(this,n),r.leading&&setTimeout(()=>{i=void 0},t)):i=void 0},t))}}function s(e,t,{leading:n=!0,trailing:r=!0}={}){return o(e,t,{leading:n,trailing:r})}const c={legacy:s};export{n as a,r as i,s as n,i as r,c as t};
|
|
2
|
+
//# sourceMappingURL=utils-BILytQlb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-BILytQlb.js","names":["n: number","offset: number","j: number","i: number","a: number","b: number","c: number","d: number","code: number","value: Return | undefined","cached: A | undefined","defaultDebounceOptions: DebounceOptions","timer: ReturnType<typeof setTimeout> | undefined"],"sources":["../src/utils/md5.ts","../src/utils/once.ts","../src/utils/debounce.ts","../src/utils/throttle.ts"],"sourcesContent":["/*\n\nTypeScript Md5\n==============\n\nBased on work by\n* Joseph Myers: http://www.myersdaily.org/joseph/javascript/md5-text.html\n* André Cruz: https://github.com/satazor/SparkMD5\n* Raymond Hill: https://github.com/gorhill/yamd5.js\n\nEffectively a TypeScrypt re-write of Raymond Hill JS Library\n\nThe MIT License (MIT)\n\nCopyright (C) 2014 Raymond Hill\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n DO WHAT YOU WANT TO PUBLIC LICENSE\n Version 2, December 2004\n\n Copyright (C) 2015 André Cruz <amdfcruz@gmail.com>\n\n Everyone is permitted to copy and distribute verbatim or modified\n copies of this license document, and changing it is allowed as long\n as the name is changed.\n\n DO WHAT YOU WANT TO PUBLIC LICENSE\n TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n 0. You just DO WHAT YOU WANT TO.\n\n*/\n\ntype HasherState = {\n buffer: string;\n buflen: number;\n length: number;\n state: number[];\n};\n\nexport class Md5 {\n /**\n * Hash a UTF-8 string on the spot\n * @param str String to hash\n * @param raw Whether to return the value as an `Int32Array`\n */\n public static hashStr(str: string, raw?: false): string;\n public static hashStr(str: string, raw: true): Int32Array;\n public static hashStr(str: string, raw = false) {\n return Md5.onePassHasher.start().appendStr(str).end(raw);\n }\n\n /**\n * Hash a ASCII string on the spot\n * @param str String to hash\n * @param raw Whether to return the value as an `Int32Array`\n */\n public static hashAsciiStr(str: string, raw?: false): string;\n public static hashAsciiStr(str: string, raw: true): Int32Array;\n public static hashAsciiStr(str: string, raw = false) {\n return Md5.onePassHasher.start().appendAsciiStr(str).end(raw);\n }\n\n // Private Static Variables\n private static stateIdentity = new Int32Array([\n 1732584193, -271733879, -1732584194, 271733878,\n ]);\n\n private static buffer32Identity = new Int32Array([\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n ]);\n\n private static hexChars = \"0123456789abcdef\";\n private static hexOut: string[] = [];\n\n // Permanent instance is to use for one-call hashing\n private static onePassHasher = new Md5();\n\n private static _hex(x: Int32Array): string {\n const hc = Md5.hexChars;\n const ho = Md5.hexOut;\n let n: number;\n let offset: number;\n let j: number;\n let i: number;\n\n for (i = 0; i < 4; i += 1) {\n offset = i * 8;\n n = x[i] ?? 0;\n for (j = 0; j < 8; j += 2) {\n ho[offset + 1 + j] = hc.charAt(n & 0x0f);\n n >>>= 4;\n ho[offset + 0 + j] = hc.charAt(n & 0x0f);\n n >>>= 4;\n }\n }\n return ho.join(\"\");\n }\n\n private static _md5cycle(\n x: Int32Array | Uint32Array,\n k: Int32Array | Uint32Array,\n ) {\n let a: number = x[0] ?? 0;\n let b: number = x[1] ?? 0;\n let c: number = x[2] ?? 0;\n let d: number = x[3] ?? 0;\n // ff()\n a += (((b & c) | (~b & d)) + (k[0] ?? 0) - 680876936) | 0;\n a = (((a << 7) | (a >>> 25)) + b) | 0;\n d += (((a & b) | (~a & c)) + (k[1] ?? 0) - 389564586) | 0;\n d = (((d << 12) | (d >>> 20)) + a) | 0;\n c += (((d & a) | (~d & b)) + (k[2] ?? 0) + 606105819) | 0;\n c = (((c << 17) | (c >>> 15)) + d) | 0;\n b += (((c & d) | (~c & a)) + (k[3] ?? 0) - 1044525330) | 0;\n b = (((b << 22) | (b >>> 10)) + c) | 0;\n a += (((b & c) | (~b & d)) + (k[4] ?? 0) - 176418897) | 0;\n a = (((a << 7) | (a >>> 25)) + b) | 0;\n d += (((a & b) | (~a & c)) + (k[5] ?? 0) + 1200080426) | 0;\n d = (((d << 12) | (d >>> 20)) + a) | 0;\n c += (((d & a) | (~d & b)) + (k[6] ?? 0) - 1473231341) | 0;\n c = (((c << 17) | (c >>> 15)) + d) | 0;\n b += (((c & d) | (~c & a)) + (k[7] ?? 0) - 45705983) | 0;\n b = (((b << 22) | (b >>> 10)) + c) | 0;\n a += (((b & c) | (~b & d)) + (k[8] ?? 0) + 1770035416) | 0;\n a = (((a << 7) | (a >>> 25)) + b) | 0;\n d += (((a & b) | (~a & c)) + (k[9] ?? 0) - 1958414417) | 0;\n d = (((d << 12) | (d >>> 20)) + a) | 0;\n c += (((d & a) | (~d & b)) + (k[10] ?? 0) - 42063) | 0;\n c = (((c << 17) | (c >>> 15)) + d) | 0;\n b += (((c & d) | (~c & a)) + (k[11] ?? 0) - 1990404162) | 0;\n b = (((b << 22) | (b >>> 10)) + c) | 0;\n a += (((b & c) | (~b & d)) + (k[12] ?? 0) + 1804603682) | 0;\n a = (((a << 7) | (a >>> 25)) + b) | 0;\n d += (((a & b) | (~a & c)) + (k[13] ?? 0) - 40341101) | 0;\n d = (((d << 12) | (d >>> 20)) + a) | 0;\n c += (((d & a) | (~d & b)) + (k[14] ?? 0) - 1502002290) | 0;\n c = (((c << 17) | (c >>> 15)) + d) | 0;\n b += (((c & d) | (~c & a)) + (k[15] ?? 0) + 1236535329) | 0;\n b = (((b << 22) | (b >>> 10)) + c) | 0;\n // gg()\n a += (((b & d) | (c & ~d)) + (k[1] ?? 0) - 165796510) | 0;\n a = (((a << 5) | (a >>> 27)) + b) | 0;\n d += (((a & c) | (b & ~c)) + (k[6] ?? 0) - 1069501632) | 0;\n d = (((d << 9) | (d >>> 23)) + a) | 0;\n c += (((d & b) | (a & ~b)) + (k[11] ?? 0) + 643717713) | 0;\n c = (((c << 14) | (c >>> 18)) + d) | 0;\n b += (((c & a) | (d & ~a)) + (k[0] ?? 0) - 373897302) | 0;\n b = (((b << 20) | (b >>> 12)) + c) | 0;\n a += (((b & d) | (c & ~d)) + (k[5] ?? 0) - 701558691) | 0;\n a = (((a << 5) | (a >>> 27)) + b) | 0;\n d += (((a & c) | (b & ~c)) + (k[10] ?? 0) + 38016083) | 0;\n d = (((d << 9) | (d >>> 23)) + a) | 0;\n c += (((d & b) | (a & ~b)) + (k[15] ?? 0) - 660478335) | 0;\n c = (((c << 14) | (c >>> 18)) + d) | 0;\n b += (((c & a) | (d & ~a)) + (k[4] ?? 0) - 405537848) | 0;\n b = (((b << 20) | (b >>> 12)) + c) | 0;\n a += (((b & d) | (c & ~d)) + (k[9] ?? 0) + 568446438) | 0;\n a = (((a << 5) | (a >>> 27)) + b) | 0;\n d += (((a & c) | (b & ~c)) + (k[14] ?? 0) - 1019803690) | 0;\n d = (((d << 9) | (d >>> 23)) + a) | 0;\n c += (((d & b) | (a & ~b)) + (k[3] ?? 0) - 187363961) | 0;\n c = (((c << 14) | (c >>> 18)) + d) | 0;\n b += (((c & a) | (d & ~a)) + (k[8] ?? 0) + 1163531501) | 0;\n b = (((b << 20) | (b >>> 12)) + c) | 0;\n a += (((b & d) | (c & ~d)) + (k[13] ?? 0) - 1444681467) | 0;\n a = (((a << 5) | (a >>> 27)) + b) | 0;\n d += (((a & c) | (b & ~c)) + (k[2] ?? 0) - 51403784) | 0;\n d = (((d << 9) | (d >>> 23)) + a) | 0;\n c += (((d & b) | (a & ~b)) + (k[7] ?? 0) + 1735328473) | 0;\n c = (((c << 14) | (c >>> 18)) + d) | 0;\n b += (((c & a) | (d & ~a)) + (k[12] ?? 0) - 1926607734) | 0;\n b = (((b << 20) | (b >>> 12)) + c) | 0;\n // hh()\n a += ((b ^ c ^ d) + (k[5] ?? 0) - 378558) | 0;\n a = (((a << 4) | (a >>> 28)) + b) | 0;\n d += ((a ^ b ^ c) + (k[8] ?? 0) - 2022574463) | 0;\n d = (((d << 11) | (d >>> 21)) + a) | 0;\n c += ((d ^ a ^ b) + (k[11] ?? 0) + 1839030562) | 0;\n c = (((c << 16) | (c >>> 16)) + d) | 0;\n b += ((c ^ d ^ a) + (k[14] ?? 0) - 35309556) | 0;\n b = (((b << 23) | (b >>> 9)) + c) | 0;\n a += ((b ^ c ^ d) + (k[1] ?? 0) - 1530992060) | 0;\n a = (((a << 4) | (a >>> 28)) + b) | 0;\n d += ((a ^ b ^ c) + (k[4] ?? 0) + 1272893353) | 0;\n d = (((d << 11) | (d >>> 21)) + a) | 0;\n c += ((d ^ a ^ b) + (k[7] ?? 0) - 155497632) | 0;\n c = (((c << 16) | (c >>> 16)) + d) | 0;\n b += ((c ^ d ^ a) + (k[10] ?? 0) - 1094730640) | 0;\n b = (((b << 23) | (b >>> 9)) + c) | 0;\n a += ((b ^ c ^ d) + (k[13] ?? 0) + 681279174) | 0;\n a = (((a << 4) | (a >>> 28)) + b) | 0;\n d += ((a ^ b ^ c) + (k[0] ?? 0) - 358537222) | 0;\n d = (((d << 11) | (d >>> 21)) + a) | 0;\n c += ((d ^ a ^ b) + (k[3] ?? 0) - 722521979) | 0;\n c = (((c << 16) | (c >>> 16)) + d) | 0;\n b += ((c ^ d ^ a) + (k[6] ?? 0) + 76029189) | 0;\n b = (((b << 23) | (b >>> 9)) + c) | 0;\n a += ((b ^ c ^ d) + (k[9] ?? 0) - 640364487) | 0;\n a = (((a << 4) | (a >>> 28)) + b) | 0;\n d += ((a ^ b ^ c) + (k[12] ?? 0) - 421815835) | 0;\n d = (((d << 11) | (d >>> 21)) + a) | 0;\n c += ((d ^ a ^ b) + (k[15] ?? 0) + 530742520) | 0;\n c = (((c << 16) | (c >>> 16)) + d) | 0;\n b += ((c ^ d ^ a) + (k[2] ?? 0) - 995338651) | 0;\n b = (((b << 23) | (b >>> 9)) + c) | 0;\n // ii()\n a += ((c ^ (b | ~d)) + (k[0] ?? 0) - 198630844) | 0;\n a = (((a << 6) | (a >>> 26)) + b) | 0;\n d += ((b ^ (a | ~c)) + (k[7] ?? 0) + 1126891415) | 0;\n d = (((d << 10) | (d >>> 22)) + a) | 0;\n c += ((a ^ (d | ~b)) + (k[14] ?? 0) - 1416354905) | 0;\n c = (((c << 15) | (c >>> 17)) + d) | 0;\n b += ((d ^ (c | ~a)) + (k[5] ?? 0) - 57434055) | 0;\n b = (((b << 21) | (b >>> 11)) + c) | 0;\n a += ((c ^ (b | ~d)) + (k[12] ?? 0) + 1700485571) | 0;\n a = (((a << 6) | (a >>> 26)) + b) | 0;\n d += ((b ^ (a | ~c)) + (k[3] ?? 0) - 1894986606) | 0;\n d = (((d << 10) | (d >>> 22)) + a) | 0;\n c += ((a ^ (d | ~b)) + (k[10] ?? 0) - 1051523) | 0;\n c = (((c << 15) | (c >>> 17)) + d) | 0;\n b += ((d ^ (c | ~a)) + (k[1] ?? 0) - 2054922799) | 0;\n b = (((b << 21) | (b >>> 11)) + c) | 0;\n a += ((c ^ (b | ~d)) + (k[8] ?? 0) + 1873313359) | 0;\n a = (((a << 6) | (a >>> 26)) + b) | 0;\n d += ((b ^ (a | ~c)) + (k[15] ?? 0) - 30611744) | 0;\n d = (((d << 10) | (d >>> 22)) + a) | 0;\n c += ((a ^ (d | ~b)) + (k[6] ?? 0) - 1560198380) | 0;\n c = (((c << 15) | (c >>> 17)) + d) | 0;\n b += ((d ^ (c | ~a)) + (k[13] ?? 0) + 1309151649) | 0;\n b = (((b << 21) | (b >>> 11)) + c) | 0;\n a += ((c ^ (b | ~d)) + (k[4] ?? 0) - 145523070) | 0;\n a = (((a << 6) | (a >>> 26)) + b) | 0;\n d += ((b ^ (a | ~c)) + (k[11] ?? 0) - 1120210379) | 0;\n d = (((d << 10) | (d >>> 22)) + a) | 0;\n c += ((a ^ (d | ~b)) + (k[2] ?? 0) + 718787259) | 0;\n c = (((c << 15) | (c >>> 17)) + d) | 0;\n b += ((d ^ (c | ~a)) + (k[9] ?? 0) - 343485551) | 0;\n b = (((b << 21) | (b >>> 11)) + c) | 0;\n\n x[0] = (a + (x[0] ?? 0)) | 0;\n x[1] = (b + (x[1] ?? 0)) | 0;\n x[2] = (c + (x[2] ?? 0)) | 0;\n x[3] = (d + (x[3] ?? 0)) | 0;\n }\n\n private _dataLength = 0;\n private _bufferLength = 0;\n\n private _state: Int32Array = new Int32Array(4);\n private _buffer: ArrayBuffer = new ArrayBuffer(68);\n private _buffer8: Uint8Array;\n private _buffer32: Uint32Array;\n\n constructor() {\n this._buffer8 = new Uint8Array(this._buffer, 0, 68);\n this._buffer32 = new Uint32Array(this._buffer, 0, 17);\n this.start();\n }\n\n /**\n * Initialise buffer to be hashed\n */\n public start() {\n this._dataLength = 0;\n this._bufferLength = 0;\n this._state.set(Md5.stateIdentity);\n return this;\n }\n\n // Char to code point to to array conversion:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt\n // #Example.3A_Fixing_charCodeAt_to_handle_non-Basic-Multilingual-Plane_characters_if_their_presence_earlier_in_the_string_is_unknown\n\n /**\n * Append a UTF-8 string to the hash buffer\n * @param str String to append\n */\n public appendStr(str: string) {\n const buf8 = this._buffer8;\n const buf32 = this._buffer32;\n let bufLen = this._bufferLength;\n let code: number;\n let i: number;\n\n for (i = 0; i < str.length; i += 1) {\n code = str.charCodeAt(i);\n if (code < 128) {\n buf8[bufLen++] = code;\n } else if (code < 0x800) {\n buf8[bufLen++] = (code >>> 6) + 0xc0;\n buf8[bufLen++] = (code & 0x3f) | 0x80;\n } else if (code < 0xd800 || code > 0xdbff) {\n buf8[bufLen++] = (code >>> 12) + 0xe0;\n buf8[bufLen++] = ((code >>> 6) & 0x3f) | 0x80;\n buf8[bufLen++] = (code & 0x3f) | 0x80;\n } else {\n code =\n (code - 0xd800) * 0x400 + (str.charCodeAt(++i) - 0xdc00) + 0x10000;\n if (code > 0x10ffff) {\n throw new Error(\n \"Unicode standard supports code points up to U+10FFFF\",\n );\n }\n buf8[bufLen++] = (code >>> 18) + 0xf0;\n buf8[bufLen++] = ((code >>> 12) & 0x3f) | 0x80;\n buf8[bufLen++] = ((code >>> 6) & 0x3f) | 0x80;\n buf8[bufLen++] = (code & 0x3f) | 0x80;\n }\n if (bufLen >= 64) {\n this._dataLength += 64;\n Md5._md5cycle(this._state, buf32);\n bufLen -= 64;\n buf32[0] = buf32[16] ?? 0;\n }\n }\n this._bufferLength = bufLen;\n return this;\n }\n\n /**\n * Append an ASCII string to the hash buffer\n * @param str String to append\n */\n public appendAsciiStr(str: string) {\n const buf8 = this._buffer8;\n const buf32 = this._buffer32;\n let bufLen = this._bufferLength;\n let i: number;\n let j = 0;\n\n for (;;) {\n i = Math.min(str.length - j, 64 - bufLen);\n while (i--) {\n buf8[bufLen++] = str.charCodeAt(j++);\n }\n if (bufLen < 64) {\n break;\n }\n this._dataLength += 64;\n Md5._md5cycle(this._state, buf32);\n bufLen = 0;\n }\n this._bufferLength = bufLen;\n return this;\n }\n\n /**\n * Append a byte array to the hash buffer\n * @param input array to append\n */\n public appendByteArray(input: Uint8Array) {\n const buf8 = this._buffer8;\n const buf32 = this._buffer32;\n let bufLen = this._bufferLength;\n let i: number;\n let j = 0;\n\n for (;;) {\n i = Math.min(input.length - j, 64 - bufLen);\n while (i--) {\n buf8[bufLen++] = input[j++] ?? 0;\n }\n if (bufLen < 64) {\n break;\n }\n this._dataLength += 64;\n Md5._md5cycle(this._state, buf32);\n bufLen = 0;\n }\n this._bufferLength = bufLen;\n return this;\n }\n\n /**\n * Get the state of the hash buffer\n */\n public getState(): HasherState {\n const s = this._state;\n\n return {\n buffer: String.fromCharCode.apply(null, Array.from(this._buffer8)),\n buflen: this._bufferLength,\n length: this._dataLength,\n state: [s[0] ?? 0, s[1] ?? 0, s[2] ?? 0, s[3] ?? 0],\n };\n }\n\n /**\n * Override the current state of the hash buffer\n * @param state New hash buffer state\n */\n public setState(state: HasherState) {\n const buf = state.buffer;\n const x = state.state;\n const s = this._state;\n let i: number;\n\n this._dataLength = state.length;\n this._bufferLength = state.buflen;\n s[0] = x[0] ?? 0;\n s[1] = x[1] ?? 0;\n s[2] = x[2] ?? 0;\n s[3] = x[3] ?? 0;\n\n for (i = 0; i < buf.length; i += 1) {\n this._buffer8[i] = buf.charCodeAt(i);\n }\n }\n\n /**\n * Hash the current state of the hash buffer and return the result\n * @param raw Whether to return the value as an `Int32Array`\n */\n public end(raw = false) {\n const bufLen = this._bufferLength;\n const buf8 = this._buffer8;\n const buf32 = this._buffer32;\n const i = (bufLen >> 2) + 1;\n\n this._dataLength += bufLen;\n const dataBitsLen = this._dataLength * 8;\n\n buf8[bufLen] = 0x80;\n buf8[bufLen + 1] = buf8[bufLen + 2] = buf8[bufLen + 3] = 0;\n buf32.set(Md5.buffer32Identity.subarray(i), i);\n\n if (bufLen > 55) {\n Md5._md5cycle(this._state, buf32);\n buf32.set(Md5.buffer32Identity);\n }\n\n // Do the final computation based on the tail and length\n // Beware that the final length may not fit in 32 bits so we take care of that\n if (dataBitsLen <= 0xffffffff) {\n buf32[14] = dataBitsLen;\n } else {\n const matches = dataBitsLen.toString(16).match(/(.*?)(.{0,8})$/);\n if (matches === null) {\n return;\n }\n\n const lo = Number.parseInt(matches[2] ?? \"\", 16);\n const hi = Number.parseInt(matches[1] ?? \"\", 16) || 0;\n\n buf32[14] = lo;\n buf32[15] = hi;\n }\n\n Md5._md5cycle(this._state, buf32);\n\n return raw ? this._state : Md5._hex(this._state);\n }\n}\n\nif (Md5.hashStr(\"hello\") !== \"5d41402abc4b2a76b9719d911017c592\") {\n throw new Error(\"Md5 self test failed.\");\n}\n","import { Effect } from \"effect\";\nimport { UploadistaError } from \"../errors/uploadista-error\";\n\n// only call a function once\nexport function once<T, A extends unknown[], Return>(\n fn: (this: T, ...args: A) => Return,\n) {\n let called = false;\n let value: Return | undefined;\n const f = function (this: T, ...args: A): Return {\n if (called) {\n if (value) {\n return value;\n }\n throw new Error(\"Function called more than once\");\n }\n called = true;\n value = fn.apply(this, args);\n return value;\n };\n return f;\n}\n\n/**\n * Effect-based once utilities\n */\nexport const OnceEffect = {\n /**\n * Creates an Effect-based once function that only executes once\n * @param effect - The effect to execute only once\n * @returns Effect that caches the result after first execution\n */\n make: <A, E, R>(\n effect: Effect.Effect<A, E, R>,\n ): Effect.Effect<A, E | UploadistaError, R> => {\n let cached: A | undefined;\n let called = false;\n\n return Effect.gen(function* () {\n if (called) {\n if (cached !== undefined) {\n return cached;\n }\n yield* new UploadistaError({\n code: \"UNKNOWN_ERROR\",\n status: 500,\n body: \"Effect called more than once with undefined result\",\n }).toEffect();\n }\n\n called = true;\n cached = yield* effect;\n return cached;\n });\n },\n\n /**\n * Creates a legacy once function wrapper\n * @param fn - Function to wrap\n * @returns Once-wrapped function\n */\n legacy: once,\n};\n","type DebounceOptions = {\n // Whether the first call to the debounced function is run immediately.\n leading?: boolean;\n\n // Whether the last call to the debounced function is run after delay\n // milliseconds have elapsed since the last call.\n trailing?: boolean;\n};\n\nconst defaultDebounceOptions: DebounceOptions = {\n leading: false,\n trailing: true,\n};\n\n/**\n * Returns `fn` wrapped by a function that delays invoking `fn` for `delay`\n * milliseconds since the last call. Set `options.leading` to invoke `fn` on\n * the leading edge of the delay, and/or set `options.trailing` to invoke `fn`\n * on the trailing edge of the delay (true by default).\n *\n * Example for `debounce(fn, 30, {leading: true, trailing: true})`,\n * where `fn` is called twice, with the second call made 20 ms after the first:\n *\n * Time: 0 20 50 (ms)\n * Timeline: |----------------------------------------------------------------|\n * ^ ^ ^\n * | | |\n * | First call. | Second call 20ms after the | End of delay.\n * | (instant leading | first. | (trailing edge\n * | edge call) | | call)\n * |-----------------------------|\n * | 30 ms delay for debounce. |\n *\n *\n * Note that if both `options.leading` and `options.trailing` are true, `fn`\n * will only be invoked on the trailing edge if the debounced function is called\n * more than once during the delay.\n *\n * @param fn - Function to debounce.\n * @param delay - Milliseconds to delay calling `fn` since the last call.\n * @param debounceOptions - See `DebounceOptions` and `defaultDebounceOptions`.\n * @returns A debounced `fn`.\n */\nexport function debounce<T, A extends unknown[]>(\n fn: (this: T, ...args: A) => void,\n delay: number,\n debounceOptions: DebounceOptions = {},\n): (this: T, ...args: A) => void {\n const options = { ...defaultDebounceOptions, ...debounceOptions };\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n return function (this: T, ...args: A): void {\n if (options.leading && !timer) {\n // Leading edge.\n // Call fn on the leading edge, when debouncing hasn't started yet.\n console.log(\"leading\");\n fn.apply(this, args);\n\n // Debounce the next call.\n timer = setTimeout(() => {\n timer = undefined;\n }, delay);\n } else {\n // Trailing edge.\n // Postpone calling fn until the delay has elapsed since the last call.\n // Each call clears any previously delayed call and resets the delay, so\n // the postponed call will always be the last one.\n clearTimeout(timer);\n timer = setTimeout(() => {\n if (options.trailing) {\n // Call fn on the trailing edge.\n fn.apply(this, args);\n\n if (options.leading) {\n // Debounce next leading call since a trailing call was just made.\n setTimeout(() => {\n timer = undefined;\n }, delay);\n }\n } else {\n // No trailing call. Since the delay has elapsed since the last call,\n // immediately reset the debouncing delay.\n timer = undefined;\n }\n }, delay);\n }\n };\n}\n","import { debounce } from \"./debounce.js\";\n\nexport function throttle<T, A extends unknown[], Return>(\n fn: (this: T, ...args: A) => Return,\n wait: number,\n {\n leading = true,\n trailing = true,\n }: { leading?: boolean; trailing?: boolean } = {},\n) {\n return debounce(fn, wait, {\n leading,\n trailing,\n });\n}\n\n/**\n * Effect-based throttle utilities\n */\nexport const ThrottleEffect = {\n /**\n * Creates a legacy throttle function wrapper\n * @param fn - Function to throttle\n * @param wait - Wait time in milliseconds\n * @param options - Throttle options\n * @returns Throttled function\n */\n legacy: throttle,\n};\n"],"mappings":"mFAyDA,IAAa,EAAb,MAAa,CAAI,CAQf,OAAc,QAAQ,EAAa,EAAM,GAAO,CAC9C,OAAO,EAAI,cAAc,OAAO,CAAC,UAAU,EAAI,CAAC,IAAI,EAAI,CAU1D,OAAc,aAAa,EAAa,EAAM,GAAO,CACnD,OAAO,EAAI,cAAc,OAAO,CAAC,eAAe,EAAI,CAAC,IAAI,EAAI,CAI/D,OAAe,cAAgB,IAAI,WAAW,CAC5C,WAAY,WAAY,YAAa,UACtC,CAAC,CAEF,OAAe,iBAAmB,IAAI,WAAW,CAC/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AAA,GACb,OAAO,EAET,MAAO,IAAI,EAAgB,CACzB,KAAM,gBACN,OAAQ,IACR,KAAM,qDACP,CAAC,CAAC,UAAU,CAKf,MAFA,GAAS,GACT,EAAS,MAAO,EACT,GACP,EAQJ,OAAQ,EACT,CCrDKC,EAA0C,CAC9C,QAAS,GACT,SAAU,GACX,CA+BD,SAAgB,EACd,EACA,EACA,EAAmC,EAAE,CACN,CAC/B,IAAM,EAAU,CAAE,GAAG,EAAwB,GAAG,EAAiB,CAE7DC,EAEJ,OAAO,SAAmB,GAAG,EAAe,CACtC,EAAQ,SAAW,CAAC,GAGtB,QAAQ,IAAI,UAAU,CACtB,EAAG,MAAM,KAAM,EAAK,CAGpB,EAAQ,eAAiB,CACvB,EAAQ,IAAA,IACP,EAAM,GAMT,aAAa,EAAM,CACnB,EAAQ,eAAiB,CACnB,EAAQ,UAEV,EAAG,MAAM,KAAM,EAAK,CAEhB,EAAQ,SAEV,eAAiB,CACf,EAAQ,IAAA,IACP,EAAM,EAKX,EAAQ,IAAA,IAET,EAAM,GCnFf,SAAgB,EACd,EACA,EACA,CACE,UAAU,GACV,WAAW,IACkC,EAAE,CACjD,CACA,OAAO,EAAS,EAAI,EAAM,CACxB,UACA,WACD,CAAC,CAMJ,MAAa,EAAiB,CAQ5B,OAAQ,EACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./uploadista-error-DdTP-Rjx.cjs`);let t=require(`effect`);t=e.a(t);var n=class e{static hashStr(t,n=!1){return e.onePassHasher.start().appendStr(t).end(n)}static hashAsciiStr(t,n=!1){return e.onePassHasher.start().appendAsciiStr(t).end(n)}static stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);static buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);static hexChars=`0123456789abcdef`;static hexOut=[];static onePassHasher=new e;static _hex(t){let n=e.hexChars,r=e.hexOut,i,a,o,s;for(s=0;s<4;s+=1)for(a=s*8,i=t[s]??0,o=0;o<8;o+=2)r[a+1+o]=n.charAt(i&15),i>>>=4,r[a+0+o]=n.charAt(i&15),i>>>=4;return r.join(``)}static _md5cycle(e,t){let n=e[0]??0,r=e[1]??0,i=e[2]??0,a=e[3]??0;n+=(r&i|~r&a)+(t[0]??0)-680876936|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[1]??0)-389564586|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[2]??0)+606105819|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[3]??0)-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+(t[4]??0)-176418897|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[5]??0)+1200080426|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[6]??0)-1473231341|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[7]??0)-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+(t[8]??0)+1770035416|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[9]??0)-1958414417|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[10]??0)-42063|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[11]??0)-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+(t[12]??0)+1804603682|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+(t[13]??0)-40341101|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+(t[14]??0)-1502002290|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+(t[15]??0)+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&a|i&~a)+(t[1]??0)-165796510|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[6]??0)-1069501632|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[11]??0)+643717713|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[0]??0)-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+(t[5]??0)-701558691|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[10]??0)+38016083|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[15]??0)-660478335|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[4]??0)-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+(t[9]??0)+568446438|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[14]??0)-1019803690|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[3]??0)-187363961|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[8]??0)+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+(t[13]??0)-1444681467|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+(t[2]??0)-51403784|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+(t[7]??0)+1735328473|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+(t[12]??0)-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^a)+(t[5]??0)-378558|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[8]??0)-2022574463|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[11]??0)+1839030562|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[14]??0)-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+(t[1]??0)-1530992060|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[4]??0)+1272893353|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[7]??0)-155497632|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[10]??0)-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+(t[13]??0)+681279174|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[0]??0)-358537222|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[3]??0)-722521979|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[6]??0)+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+(t[9]??0)-640364487|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+(t[12]??0)-421815835|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+(t[15]??0)+530742520|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+(t[2]??0)-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~a))+(t[0]??0)-198630844|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[7]??0)+1126891415|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[14]??0)-1416354905|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[5]??0)-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+(t[12]??0)+1700485571|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[3]??0)-1894986606|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[10]??0)-1051523|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[1]??0)-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+(t[8]??0)+1873313359|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[15]??0)-30611744|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[6]??0)-1560198380|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[13]??0)+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+(t[4]??0)-145523070|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+(t[11]??0)-1120210379|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+(t[2]??0)+718787259|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+(t[9]??0)-343485551|0,r=(r<<21|r>>>11)+i|0,e[0]=n+(e[0]??0)|0,e[1]=r+(e[1]??0)|0,e[2]=i+(e[2]??0)|0,e[3]=a+(e[3]??0)|0}_dataLength=0;_bufferLength=0;_state=new Int32Array(4);_buffer=new ArrayBuffer(68);_buffer8;_buffer32;constructor(){this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,a,o;for(o=0;o<t.length;o+=1){if(a=t.charCodeAt(o),a<128)n[i++]=a;else if(a<2048)n[i++]=(a>>>6)+192,n[i++]=a&63|128;else if(a<55296||a>56319)n[i++]=(a>>>12)+224,n[i++]=a>>>6&63|128,n[i++]=a&63|128;else{if(a=(a-55296)*1024+(t.charCodeAt(++o)-56320)+65536,a>1114111)throw Error(`Unicode standard supports code points up to U+10FFFF`);n[i++]=(a>>>18)+240,n[i++]=a>>>12&63|128,n[i++]=a>>>6&63|128,n[i++]=a&63|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,r),i-=64,r[0]=r[16]??0)}return this._bufferLength=i,this}appendAsciiStr(t){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,a,o=0;for(;;){for(a=Math.min(t.length-o,64-i);a--;)n[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}appendByteArray(t){let n=this._buffer8,r=this._buffer32,i=this._bufferLength,a,o=0;for(;;){for(a=Math.min(t.length-o,64-i);a--;)n[i++]=t[o++]??0;if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0]??0,e[1]??0,e[2]??0,e[3]??0]}}setState(e){let t=e.buffer,n=e.state,r=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,r[0]=n[0]??0,r[1]=n[1]??0,r[2]=n[2]??0,r[3]=n[3]??0,i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let n=this._bufferLength,r=this._buffer8,i=this._buffer32,a=(n>>2)+1;this._dataLength+=n;let o=this._dataLength*8;if(r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(e.buffer32Identity.subarray(a),a),n>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=4294967295)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(e===null)return;let t=Number.parseInt(e[2]??``,16),n=Number.parseInt(e[1]??``,16)||0;i[14]=t,i[15]=n}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}};if(n.hashStr(`hello`)!==`5d41402abc4b2a76b9719d911017c592`)throw Error(`Md5 self test failed.`);function r(e){let t=!1,n;return function(...r){if(t){if(n)return n;throw Error(`Function called more than once`)}return t=!0,n=e.apply(this,r),n}}const i={make:n=>{let r,i=!1;return t.Effect.gen(function*(){if(i){if(r!==void 0)return r;yield*new e.n({code:`UNKNOWN_ERROR`,status:500,body:`Effect called more than once with undefined result`}).toEffect()}return i=!0,r=yield*n,r})},legacy:r},a={leading:!1,trailing:!0};function o(e,t,n={}){let r={...a,...n},i;return function(...n){r.leading&&!i?(console.log(`leading`),e.apply(this,n),i=setTimeout(()=>{i=void 0},t)):(clearTimeout(i),i=setTimeout(()=>{r.trailing?(e.apply(this,n),r.leading&&setTimeout(()=>{i=void 0},t)):i=void 0},t))}}function s(e,t,{leading:n=!0,trailing:r=!0}={}){return o(e,t,{leading:n,trailing:r})}const c={legacy:s};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Core package of Uploadista",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Uploadista",
|
|
@@ -31,20 +31,15 @@
|
|
|
31
31
|
"import": "./dist/upload/index.js",
|
|
32
32
|
"default": "./dist/upload/index.js"
|
|
33
33
|
},
|
|
34
|
-
"./
|
|
35
|
-
"types": "./dist/
|
|
36
|
-
"import": "./dist/
|
|
37
|
-
"default": "./dist/
|
|
34
|
+
"./streams": {
|
|
35
|
+
"types": "./dist/streams/index.d.ts",
|
|
36
|
+
"import": "./dist/streams/index.js",
|
|
37
|
+
"default": "./dist/streams/index.js"
|
|
38
38
|
},
|
|
39
|
-
"./
|
|
40
|
-
"types": "./dist/
|
|
41
|
-
"import": "./dist/
|
|
42
|
-
"default": "./dist/
|
|
43
|
-
},
|
|
44
|
-
"./utils/*": {
|
|
45
|
-
"types": "./dist/utils/*.d.ts",
|
|
46
|
-
"import": "./dist/utils/*.js",
|
|
47
|
-
"default": "./dist/utils/*.js"
|
|
39
|
+
"./utils": {
|
|
40
|
+
"types": "./dist/utils/index.d.ts",
|
|
41
|
+
"import": "./dist/utils/index.js",
|
|
42
|
+
"default": "./dist/utils/index.js"
|
|
48
43
|
},
|
|
49
44
|
"./websocket": {
|
|
50
45
|
"types": "./dist/websocket/index.d.ts",
|
|
@@ -60,14 +55,15 @@
|
|
|
60
55
|
"@types/node": "24.8.1",
|
|
61
56
|
"tsdown": "0.15.7",
|
|
62
57
|
"vitest": "3.2.4",
|
|
63
|
-
"@uploadista/typescript-config": "0.0.
|
|
58
|
+
"@uploadista/typescript-config": "0.0.3"
|
|
64
59
|
},
|
|
65
60
|
"publishConfig": {
|
|
66
61
|
"access": "public",
|
|
67
62
|
"registry": "https://registry.npmjs.org/"
|
|
68
63
|
},
|
|
69
64
|
"scripts": {
|
|
70
|
-
"build": "
|
|
65
|
+
"build": "tsdown",
|
|
66
|
+
"dev": "tsc -b",
|
|
71
67
|
"release": "tsdown && bumpp && pnpm publish --access restricted --no-git-checks",
|
|
72
68
|
"format": "biome format --write ./src",
|
|
73
69
|
"lint": "biome lint --write ./src",
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./stream-limiter";
|
package/tsdown.config.ts
CHANGED
|
@@ -7,16 +7,8 @@ export default defineConfig({
|
|
|
7
7
|
"types/index": "src/types/index.ts",
|
|
8
8
|
"flow/index": "src/flow/index.ts",
|
|
9
9
|
"upload/index": "src/upload/index.ts",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"streams/stream-limiter": "src/streams/stream-limiter.ts",
|
|
13
|
-
"streams/stream-splitter": "src/streams/stream-splitter.ts",
|
|
14
|
-
"utils/debounce": "src/utils/debounce.ts",
|
|
15
|
-
"utils/generate-id": "src/utils/generate-id.ts",
|
|
16
|
-
"utils/md5": "src/utils/md5.ts",
|
|
17
|
-
"utils/once": "src/utils/once.ts",
|
|
18
|
-
"utils/semaphore": "src/utils/semaphore.ts",
|
|
19
|
-
"utils/throttle": "src/utils/throttle.ts",
|
|
10
|
+
"streams/index": "src/streams/index.ts",
|
|
11
|
+
"utils/index": "src/utils/index.ts",
|
|
20
12
|
},
|
|
21
13
|
minify: true,
|
|
22
14
|
format: ["esm", "cjs"],
|
package/dist/chunk-CUT6urMc.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`__toESM`,{enumerable:!0,get:function(){return s}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e={leading:!1,trailing:!0};function t(t,n,r={}){let i={...e,...r},a;return function(...e){i.leading&&!a?(console.log(`leading`),t.apply(this,e),a=setTimeout(()=>{a=void 0},n)):(clearTimeout(a),a=setTimeout(()=>{i.trailing?(t.apply(this,e),i.leading&&setTimeout(()=>{a=void 0},n)):a=void 0},n))}}export{t as debounce};
|
|
2
|
-
//# sourceMappingURL=debounce-C2SeqcxD.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce-C2SeqcxD.js","names":["defaultDebounceOptions: DebounceOptions","timer: ReturnType<typeof setTimeout> | undefined"],"sources":["../src/utils/debounce.ts"],"sourcesContent":["type DebounceOptions = {\n // Whether the first call to the debounced function is run immediately.\n leading?: boolean;\n\n // Whether the last call to the debounced function is run after delay\n // milliseconds have elapsed since the last call.\n trailing?: boolean;\n};\n\nconst defaultDebounceOptions: DebounceOptions = {\n leading: false,\n trailing: true,\n};\n\n/**\n * Returns `fn` wrapped by a function that delays invoking `fn` for `delay`\n * milliseconds since the last call. Set `options.leading` to invoke `fn` on\n * the leading edge of the delay, and/or set `options.trailing` to invoke `fn`\n * on the trailing edge of the delay (true by default).\n *\n * Example for `debounce(fn, 30, {leading: true, trailing: true})`,\n * where `fn` is called twice, with the second call made 20 ms after the first:\n *\n * Time: 0 20 50 (ms)\n * Timeline: |----------------------------------------------------------------|\n * ^ ^ ^\n * | | |\n * | First call. | Second call 20ms after the | End of delay.\n * | (instant leading | first. | (trailing edge\n * | edge call) | | call)\n * |-----------------------------|\n * | 30 ms delay for debounce. |\n *\n *\n * Note that if both `options.leading` and `options.trailing` are true, `fn`\n * will only be invoked on the trailing edge if the debounced function is called\n * more than once during the delay.\n *\n * @param fn - Function to debounce.\n * @param delay - Milliseconds to delay calling `fn` since the last call.\n * @param debounceOptions - See `DebounceOptions` and `defaultDebounceOptions`.\n * @returns A debounced `fn`.\n */\nexport function debounce<T, A extends unknown[]>(\n fn: (this: T, ...args: A) => void,\n delay: number,\n debounceOptions: DebounceOptions = {},\n): (this: T, ...args: A) => void {\n const options = { ...defaultDebounceOptions, ...debounceOptions };\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n return function (this: T, ...args: A): void {\n if (options.leading && !timer) {\n // Leading edge.\n // Call fn on the leading edge, when debouncing hasn't started yet.\n console.log(\"leading\");\n fn.apply(this, args);\n\n // Debounce the next call.\n timer = setTimeout(() => {\n timer = undefined;\n }, delay);\n } else {\n // Trailing edge.\n // Postpone calling fn until the delay has elapsed since the last call.\n // Each call clears any previously delayed call and resets the delay, so\n // the postponed call will always be the last one.\n clearTimeout(timer);\n timer = setTimeout(() => {\n if (options.trailing) {\n // Call fn on the trailing edge.\n fn.apply(this, args);\n\n if (options.leading) {\n // Debounce next leading call since a trailing call was just made.\n setTimeout(() => {\n timer = undefined;\n }, delay);\n }\n } else {\n // No trailing call. Since the delay has elapsed since the last call,\n // immediately reset the debouncing delay.\n timer = undefined;\n }\n }, delay);\n }\n };\n}\n"],"mappings":"AASA,MAAMA,EAA0C,CAC9C,QAAS,GACT,SAAU,GACX,CA+BD,SAAgB,EACd,EACA,EACA,EAAmC,EAAE,CACN,CAC/B,IAAM,EAAU,CAAE,GAAG,EAAwB,GAAG,EAAiB,CAE7DC,EAEJ,OAAO,SAAmB,GAAG,EAAe,CACtC,EAAQ,SAAW,CAAC,GAGtB,QAAQ,IAAI,UAAU,CACtB,EAAG,MAAM,KAAM,EAAK,CAGpB,EAAQ,eAAiB,CACvB,EAAQ,IAAA,IACP,EAAM,GAMT,aAAa,EAAM,CACnB,EAAQ,eAAiB,CACnB,EAAQ,UAEV,EAAG,MAAM,KAAM,EAAK,CAEhB,EAAQ,SAEV,eAAiB,CACf,EAAQ,IAAA,IACP,EAAM,EAKX,EAAQ,IAAA,IAET,EAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={leading:!1,trailing:!0};function t(t,n,r={}){let i={...e,...r},a;return function(...e){i.leading&&!a?(console.log(`leading`),t.apply(this,e),a=setTimeout(()=>{a=void 0},n)):(clearTimeout(a),a=setTimeout(()=>{i.trailing?(t.apply(this,e),i.leading&&setTimeout(()=>{a=void 0},n)):a=void 0},n))}}Object.defineProperty(exports,`debounce`,{enumerable:!0,get:function(){return t}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAC"}
|