@uploadista/core 0.0.8 → 0.0.9

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.
Files changed (99) hide show
  1. package/dist/checksum-DgutVB-2.cjs +1 -0
  2. package/dist/checksum-Do_Vh-tB.mjs +2 -0
  3. package/dist/checksum-Do_Vh-tB.mjs.map +1 -0
  4. package/dist/errors/index.cjs +1 -1
  5. package/dist/errors/{index.d.ts → index.d.mts} +2 -2
  6. package/dist/errors/index.mjs +1 -0
  7. package/dist/flow/index.cjs +1 -1
  8. package/dist/flow/index.d.cts +2 -2
  9. package/dist/flow/index.d.mts +6 -0
  10. package/dist/flow/index.mjs +1 -0
  11. package/dist/flow-C_doYlGf.cjs +1 -0
  12. package/dist/flow-DEohelFR.mjs +2 -0
  13. package/dist/flow-DEohelFR.mjs.map +1 -0
  14. package/dist/{index-CU5XRZOh.d.ts → index-C2nrn_49.d.mts} +2 -2
  15. package/dist/index-C2nrn_49.d.mts.map +1 -0
  16. package/dist/{index-BQIgMrBX.d.ts → index-CsLVxsad.d.mts} +2 -2
  17. package/dist/index-CsLVxsad.d.mts.map +1 -0
  18. package/dist/{index-xTZ5vAgA.d.cts → index-b891YUgl.d.cts} +174 -289
  19. package/dist/index-b891YUgl.d.cts.map +1 -0
  20. package/dist/{index-Bq0Zkv4L.d.ts → index-od64jviT.d.mts} +76 -11
  21. package/dist/index-od64jviT.d.mts.map +1 -0
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.d.cts +2 -2
  24. package/dist/index.d.mts +6 -0
  25. package/dist/index.mjs +1 -0
  26. package/dist/stream-limiter-Bj_iImMm.cjs +1 -0
  27. package/dist/stream-limiter-CEpDLQVB.mjs +2 -0
  28. package/dist/stream-limiter-CEpDLQVB.mjs.map +1 -0
  29. package/dist/streams/index.cjs +1 -1
  30. package/dist/streams/index.d.mts +3 -0
  31. package/dist/streams/index.mjs +1 -0
  32. package/dist/types/index.cjs +1 -1
  33. package/dist/types/index.d.cts +1 -1
  34. package/dist/types/index.d.mts +6 -0
  35. package/dist/types/index.mjs +1 -0
  36. package/dist/types-BYfvxhhG.mjs +2 -0
  37. package/dist/types-BYfvxhhG.mjs.map +1 -0
  38. package/dist/types-C80hlY_o.cjs +1 -0
  39. package/dist/upload/index.cjs +1 -1
  40. package/dist/upload/index.d.cts +1 -1
  41. package/dist/upload/index.d.mts +6 -0
  42. package/dist/upload/index.mjs +1 -0
  43. package/dist/upload-CcmxSO5u.mjs +2 -0
  44. package/dist/upload-CcmxSO5u.mjs.map +1 -0
  45. package/dist/upload-IZuHoQqL.cjs +1 -0
  46. package/dist/{uploadista-error-BOHJtDRc.cjs → uploadista-error-CQ1ADme7.cjs} +2 -2
  47. package/dist/{uploadista-error-kZCQLC_U.d.ts → uploadista-error-DHajuvP1.d.mts} +1 -1
  48. package/dist/uploadista-error-DHajuvP1.d.mts.map +1 -0
  49. package/dist/{uploadista-error-CDkJ_Vrc.js → uploadista-error-U9YxwNtM.mjs} +1 -1
  50. package/dist/uploadista-error-U9YxwNtM.mjs.map +1 -0
  51. package/dist/utils/index.cjs +1 -1
  52. package/dist/utils/{index.d.ts → index.d.mts} +2 -2
  53. package/dist/utils/index.mjs +1 -0
  54. package/dist/{utils-BbLQplqQ.cjs → utils-C6k-Fs99.mjs} +2 -1
  55. package/dist/utils-C6k-Fs99.mjs.map +1 -0
  56. package/dist/utils-DzDTNMnq.cjs +1 -0
  57. package/package.json +6 -6
  58. package/src/flow/flow-server.ts +122 -25
  59. package/src/flow/flow.ts +2 -0
  60. package/src/types/upload-file.ts +11 -0
  61. package/dist/checksum-CPiON71t.cjs +0 -1
  62. package/dist/checksum-_Vagjoys.js +0 -2
  63. package/dist/checksum-_Vagjoys.js.map +0 -1
  64. package/dist/errors/index.js +0 -1
  65. package/dist/flow/index.d.ts +0 -6
  66. package/dist/flow/index.js +0 -1
  67. package/dist/flow-CSHZVjcf.js +0 -2
  68. package/dist/flow-CSHZVjcf.js.map +0 -1
  69. package/dist/flow-zlCaikPS.cjs +0 -1
  70. package/dist/index-BQIgMrBX.d.ts.map +0 -1
  71. package/dist/index-Bq0Zkv4L.d.ts.map +0 -1
  72. package/dist/index-CU5XRZOh.d.ts.map +0 -1
  73. package/dist/index-xTZ5vAgA.d.cts.map +0 -1
  74. package/dist/index.d.ts +0 -6
  75. package/dist/index.js +0 -1
  76. package/dist/stream-limiter-CTLrikR_.js +0 -2
  77. package/dist/stream-limiter-CTLrikR_.js.map +0 -1
  78. package/dist/stream-limiter-CaCFrKY1.cjs +0 -1
  79. package/dist/streams/index.d.ts +0 -3
  80. package/dist/streams/index.js +0 -1
  81. package/dist/types/index.d.ts +0 -6
  82. package/dist/types/index.js +0 -1
  83. package/dist/types-BVbqP7yA.cjs +0 -1
  84. package/dist/types-DqllXpuL.js +0 -2
  85. package/dist/types-DqllXpuL.js.map +0 -1
  86. package/dist/upload/index.d.ts +0 -6
  87. package/dist/upload/index.js +0 -1
  88. package/dist/upload-C_n7Smfl.js +0 -2
  89. package/dist/upload-C_n7Smfl.js.map +0 -1
  90. package/dist/upload-kFnf82ds.cjs +0 -1
  91. package/dist/uploadista-error-CDkJ_Vrc.js.map +0 -1
  92. package/dist/uploadista-error-kZCQLC_U.d.ts.map +0 -1
  93. package/dist/utils/index.js +0 -1
  94. package/dist/utils-B5sYo1z9.js +0 -2
  95. package/dist/utils-B5sYo1z9.js.map +0 -1
  96. /package/dist/{errors-8i_aMxOE.js → errors-C0zLx77t.mjs} +0 -0
  97. /package/dist/{errors-D-K-vxsP.cjs → errors-CRm1FHHT.cjs} +0 -0
  98. /package/dist/{index-BoGG5KAY.d.ts → index-DEHBdV_z.d.mts} +0 -0
  99. /package/dist/{streams-Bs3GDNKJ.js → streams-CJKKIAwy.mjs} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadista-error-U9YxwNtM.mjs","names":["ERROR_CATALOG: Readonly<\n Record<UploadistaErrorCode, { status: number; body: string }>\n>"],"sources":["../src/errors/uploadista-error.ts"],"sourcesContent":["import { Data, Effect } from \"effect\";\n\n/**\n * Union type of all possible error codes in the Uploadista system.\n *\n * Each error code corresponds to a specific error condition with predefined\n * HTTP status codes and messages in the ERROR_CATALOG.\n */\nexport type UploadistaErrorCode =\n | \"MISSING_OFFSET\"\n | \"ABORTED\"\n | \"INVALID_TERMINATION\"\n | \"ERR_LOCK_TIMEOUT\"\n | \"INVALID_CONTENT_TYPE\"\n | \"FLOW_STRUCTURE_ERROR\"\n | \"FLOW_CYCLE_ERROR\"\n | \"FLOW_NODE_NOT_FOUND\"\n | \"FLOW_NODE_ERROR\"\n | \"FLOW_NOT_AUTHORIZED\"\n | \"FLOW_NOT_FOUND\"\n | \"FLOW_PAUSED\"\n | \"FLOW_CANCELLED\"\n | \"FILE_READ_ERROR\"\n | \"FLOW_JOB_NOT_FOUND\"\n | \"FLOW_JOB_ERROR\"\n | \"DATASTORE_NOT_FOUND\"\n | \"FILE_NOT_FOUND\"\n | \"INVALID_OFFSET\"\n | \"FILE_NO_LONGER_EXISTS\"\n | \"ERR_SIZE_EXCEEDED\"\n | \"ERR_MAX_SIZE_EXCEEDED\"\n | \"INVALID_LENGTH\"\n | \"INVALID_METADATA\"\n | \"VALIDATION_ERROR\"\n | \"STORAGE_NOT_AUTHORIZED\"\n | \"UNKNOWN_ERROR\"\n | \"FILE_WRITE_ERROR\"\n | \"UPLOAD_ID_NOT_FOUND\"\n | \"FLOW_OUTPUT_VALIDATION_ERROR\"\n | \"FLOW_INPUT_VALIDATION_ERROR\"\n | \"CHECKSUM_MISMATCH\"\n | \"MIMETYPE_MISMATCH\"\n | \"UNSUPPORTED_CHECKSUM_ALGORITHM\";\n\n/**\n * Catalog of all predefined errors in the Uploadista system.\n *\n * Maps error codes to their HTTP status codes and default error messages.\n * This centralized catalog ensures consistent error handling across all\n * Uploadista packages and adapters.\n *\n * Each error entry contains:\n * - `status`: HTTP status code (400-500 range)\n * - `body`: Human-readable error message\n *\n * @example\n * ```typescript\n * // Access a specific error definition\n * const fileNotFound = ERROR_CATALOG.FILE_NOT_FOUND;\n * console.log(fileNotFound.status); // 404\n * console.log(fileNotFound.body); // \"The file for this url was not found\\n\"\n *\n * // Use with UploadistaError\n * const error = UploadistaError.fromCode(\"FILE_NOT_FOUND\");\n * ```\n */\nexport const ERROR_CATALOG: Readonly<\n Record<UploadistaErrorCode, { status: number; body: string }>\n> = {\n MISSING_OFFSET: { status: 403, body: \"Upload-Offset header required\\n\" },\n ABORTED: { status: 400, body: \"Request aborted due to lock acquired\" },\n INVALID_TERMINATION: {\n status: 400,\n body: \"Cannot terminate an already completed upload\",\n },\n ERR_LOCK_TIMEOUT: {\n status: 500,\n body: \"failed to acquire lock before timeout\",\n },\n INVALID_CONTENT_TYPE: {\n status: 403,\n body: \"Content-Type header required\\n\",\n },\n DATASTORE_NOT_FOUND: {\n status: 500,\n body: \"The datastore was not found\\n\",\n },\n UPLOAD_ID_NOT_FOUND: {\n status: 500,\n body: \"The upload id was not found\\n\",\n },\n FILE_NOT_FOUND: {\n status: 404,\n body: \"The file for this url was not found\\n\",\n },\n FLOW_NOT_AUTHORIZED: {\n status: 401,\n body: \"The flow is not authorized\\n\",\n },\n FLOW_NOT_FOUND: {\n status: 404,\n body: \"The flow was not found\\n\",\n },\n FLOW_PAUSED: {\n status: 409,\n body: \"The flow execution was paused by user\\n\",\n },\n FLOW_CANCELLED: {\n status: 409,\n body: \"The flow execution was cancelled by user\\n\",\n },\n FLOW_STRUCTURE_ERROR: {\n status: 500,\n body: \"The flow structure is invalid\\n\",\n },\n FLOW_CYCLE_ERROR: {\n status: 500,\n body: \"The flow contains a cycle\\n\",\n },\n FLOW_NODE_NOT_FOUND: {\n status: 500,\n body: \"The flow node was not found\\n\",\n },\n FLOW_NODE_ERROR: {\n status: 500,\n body: \"The flow node failed\\n\",\n },\n FLOW_JOB_NOT_FOUND: {\n status: 404,\n body: \"The flow job was not found\\n\",\n },\n FLOW_JOB_ERROR: {\n status: 500,\n body: \"The flow job failed\\n\",\n },\n FLOW_INPUT_VALIDATION_ERROR: {\n status: 500,\n body: \"The flow input validation failed\\n\",\n },\n FLOW_OUTPUT_VALIDATION_ERROR: {\n status: 500,\n body: \"The flow output validation failed\\n\",\n },\n INVALID_OFFSET: { status: 409, body: \"Upload-Offset conflict\\n\" },\n FILE_NO_LONGER_EXISTS: {\n status: 410,\n body: \"The file for this url no longer exists\\n\",\n },\n FILE_READ_ERROR: {\n status: 500,\n body: \"Something went wrong reading the file\\n\",\n },\n ERR_SIZE_EXCEEDED: { status: 413, body: \"upload's size exceeded\\n\" },\n ERR_MAX_SIZE_EXCEEDED: { status: 413, body: \"Maximum size exceeded\\n\" },\n INVALID_LENGTH: {\n status: 400,\n body: \"Upload-Length or Upload-Defer-Length header required\\n\",\n },\n INVALID_METADATA: {\n status: 400,\n 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\",\n },\n VALIDATION_ERROR: {\n status: 400,\n body: \"Validation failed\\n\",\n },\n STORAGE_NOT_AUTHORIZED: {\n status: 401,\n body: \"The storage is not authorized\\n\",\n },\n UNKNOWN_ERROR: {\n status: 500,\n body: \"Something went wrong with that request\\n\",\n },\n FILE_WRITE_ERROR: {\n status: 500,\n body: \"Something went wrong receiving the file\\n\",\n },\n CHECKSUM_MISMATCH: {\n status: 400,\n body: \"The file checksum does not match the provided checksum\\n\",\n },\n MIMETYPE_MISMATCH: {\n status: 400,\n body: \"The file MIME type does not match the declared type\\n\",\n },\n UNSUPPORTED_CHECKSUM_ALGORITHM: {\n status: 400,\n body: \"The specified checksum algorithm is not supported\\n\",\n },\n} as const;\n\n/**\n * Standard error class for all Uploadista operations.\n *\n * UploadistaError provides a consistent error handling approach across the entire\n * Uploadista ecosystem. Each error has:\n * - A typed error code from the ERROR_CATALOG\n * - An HTTP-compatible status code\n * - A human-readable error message (body)\n * - Optional additional details and cause information\n *\n * This class integrates with Effect-TS for functional error handling and can be\n * easily converted to an Effect that fails.\n *\n * @example\n * ```typescript\n * // Create from error code\n * const error = UploadistaError.fromCode(\"FILE_NOT_FOUND\");\n *\n * // Create with custom details\n * const customError = UploadistaError.fromCode(\"FLOW_NODE_ERROR\", {\n * body: \"Failed to process image\",\n * cause: originalError,\n * details: { nodeId: \"resize-1\", fileId: \"abc123\" }\n * });\n *\n * // Use with Effect\n * const effect = customError.toEffect<void>();\n *\n * // In an Effect pipeline\n * return Effect.gen(function* () {\n * const file = yield* getFile(id);\n * if (!file) {\n * return yield* UploadistaError.fromCode(\"FILE_NOT_FOUND\").toEffect();\n * }\n * return file;\n * });\n * ```\n */\nexport class UploadistaError extends Data.TaggedError(\"UploadistaError\") {\n readonly code: string;\n readonly status: number;\n // Keep legacy property names for backward compatibility\n readonly status_code: number;\n readonly body: string;\n readonly details?: unknown;\n\n constructor({\n code,\n status,\n body,\n cause,\n details,\n }: {\n code: UploadistaErrorCode | string;\n status: number;\n body: string;\n cause?: unknown;\n details?: unknown;\n }) {\n super();\n this.name = \"UploadistaError\";\n this.code = code;\n this.status = status;\n this.status_code = status; // legacy alias\n this.body = body;\n this.details = details;\n if (cause) (this as unknown as { cause?: unknown }).cause = cause;\n }\n\n /**\n * Creates an UploadistaError from a predefined error code.\n *\n * This is the primary way to create errors in the Uploadista system. Each error code\n * has a default status and message defined in ERROR_CATALOG, but these can be overridden\n * for specific use cases.\n *\n * @param code - One of the predefined error codes from UploadistaErrorCode\n * @param overrides - Optional overrides for the default error properties\n * @param overrides.status - Custom HTTP status code (overrides the default)\n * @param overrides.body - Custom error message (overrides the default)\n * @param overrides.details - Additional structured data about the error\n * @param overrides.cause - The underlying error that caused this error (for error chaining)\n *\n * @returns A new UploadistaError instance\n *\n * @example\n * ```typescript\n * // Use default error\n * const error = UploadistaError.fromCode(\"FILE_NOT_FOUND\");\n *\n * // Override message\n * const customError = UploadistaError.fromCode(\"FILE_NOT_FOUND\", {\n * body: `File with ID ${fileId} was not found in storage`\n * });\n *\n * // Include cause and details\n * const detailedError = UploadistaError.fromCode(\"DATASTORE_NOT_FOUND\", {\n * cause: storageException,\n * details: { storageId: \"s3-prod\", region: \"us-east-1\" }\n * });\n * ```\n */\n static fromCode(\n code: UploadistaErrorCode,\n overrides?: Partial<Pick<UploadistaError, \"status\" | \"body\">> & {\n details?: unknown;\n cause?: unknown;\n }\n ): UploadistaError {\n const base = ERROR_CATALOG[code];\n return new UploadistaError({\n code,\n status: overrides?.status ?? base.status,\n body: overrides?.body ?? base.body,\n details: overrides?.details,\n cause: overrides?.cause,\n });\n }\n\n /**\n * Converts this error to an Effect that immediately fails.\n *\n * This method integrates UploadistaError with Effect-TS's error handling system,\n * allowing errors to be used in Effect pipelines with proper type checking.\n *\n * @template T - The success type of the Effect (defaults to never since it always fails)\n * @returns An Effect that fails with this UploadistaError\n *\n * @example\n * ```typescript\n * const error = UploadistaError.fromCode(\"FILE_NOT_FOUND\");\n *\n * // Use in an Effect pipeline\n * return Effect.gen(function* () {\n * const file = yield* kvStore.get(fileId);\n * if (!file) {\n * return yield* error.toEffect();\n * }\n * return file;\n * });\n * ```\n */\n toEffect<T = never>(): Effect.Effect<T, UploadistaError> {\n return Effect.fail(this);\n }\n}\n\n/**\n * Type guard to check if an unknown value is an UploadistaError.\n *\n * Useful for error handling when catching errors that might be from\n * different sources or libraries.\n *\n * @param error - The value to check\n * @returns True if the value is an UploadistaError instance\n *\n * @example\n * ```typescript\n * try {\n * await someOperation();\n * } catch (error) {\n * if (isUploadistaError(error)) {\n * console.log(`Uploadista error: ${error.code} (${error.status})`);\n * console.log(error.body);\n * } else {\n * console.error(\"Unknown error:\", error);\n * }\n * }\n * ```\n */\nexport function isUploadistaError(error: unknown): error is UploadistaError {\n return error instanceof UploadistaError;\n}\n\n/**\n * Creates an Effect that immediately fails with an UploadistaError.\n *\n * This is a convenience function that combines error creation with Effect conversion.\n * It's equivalent to calling `UploadistaError.fromCode(code, overrides).toEffect()`.\n *\n * @param code - One of the predefined error codes from UploadistaErrorCode\n * @param overrides - Optional overrides for the default error properties\n * @param overrides.status - Custom HTTP status code\n * @param overrides.body - Custom error message\n * @param overrides.details - Additional structured data about the error\n * @param overrides.cause - The underlying error that caused this error\n *\n * @returns An Effect that immediately fails with the created UploadistaError\n *\n * @example\n * ```typescript\n * // In an Effect pipeline\n * return Effect.gen(function* () {\n * const file = yield* kvStore.get(fileId);\n * if (!file) {\n * return yield* httpFailure(\"FILE_NOT_FOUND\", {\n * details: { fileId }\n * });\n * }\n * return file;\n * });\n * ```\n */\nexport function httpFailure(\n code: UploadistaErrorCode,\n overrides?: Partial<Pick<UploadistaError, \"status\" | \"body\">> & {\n details?: unknown;\n cause?: unknown;\n }\n): Effect.Effect<never, UploadistaError> {\n return UploadistaError.fromCode(code, overrides).toEffect();\n}\n"],"mappings":"0CAkEA,MAAaA,EAET,CACF,eAAgB,CAAE,OAAQ,IAAK,KAAM;EAAmC,CACxE,QAAS,CAAE,OAAQ,IAAK,KAAM,uCAAwC,CACtE,oBAAqB,CACnB,OAAQ,IACR,KAAM,+CACP,CACD,iBAAkB,CAChB,OAAQ,IACR,KAAM,wCACP,CACD,qBAAsB,CACpB,OAAQ,IACR,KAAM;EACP,CACD,oBAAqB,CACnB,OAAQ,IACR,KAAM;EACP,CACD,oBAAqB,CACnB,OAAQ,IACR,KAAM;EACP,CACD,eAAgB,CACd,OAAQ,IACR,KAAM;EACP,CACD,oBAAqB,CACnB,OAAQ,IACR,KAAM;EACP,CACD,eAAgB,CACd,OAAQ,IACR,KAAM;EACP,CACD,YAAa,CACX,OAAQ,IACR,KAAM;EACP,CACD,eAAgB,CACd,OAAQ,IACR,KAAM;EACP,CACD,qBAAsB,CACpB,OAAQ,IACR,KAAM;EACP,CACD,iBAAkB,CAChB,OAAQ,IACR,KAAM;EACP,CACD,oBAAqB,CACnB,OAAQ,IACR,KAAM;EACP,CACD,gBAAiB,CACf,OAAQ,IACR,KAAM;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W,MACnB,CAAC,CA0BJ,UAAyD,CACvD,OAAO,EAAO,KAAK,KAAK,GA2B5B,SAAgB,EAAkB,EAA0C,CAC1E,OAAO,aAAiB,EAgC1B,SAAgB,EACd,EACA,EAIuC,CACvC,OAAO,EAAgB,SAAS,EAAM,EAAU,CAAC,UAAU"}
@@ -1 +1 @@
1
- require(`../uploadista-error-BOHJtDRc.cjs`);const e=require(`../checksum-CPiON71t.cjs`),t=require(`../utils-BbLQplqQ.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;
1
+ require(`../uploadista-error-CQ1ADme7.cjs`);const e=require(`../checksum-DgutVB-2.cjs`),t=require(`../utils-DzDTNMnq.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;
@@ -1,3 +1,3 @@
1
- import "../uploadista-error-kZCQLC_U.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-CU5XRZOh.js";
1
+ import "../uploadista-error-DHajuvP1.mjs";
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-C2nrn_49.mjs";
3
3
  export { ChecksumAlgorithm, GenerateId, GenerateIdLive, GenerateIdRandom, GenerateIdService, GenerateIdShape, GenerateIdTimestamp, Md5, OnceEffect, ThrottleEffect, computeChecksum, isSupportedAlgorithm, once, throttle };
@@ -0,0 +1 @@
1
+ import"../uploadista-error-U9YxwNtM.mjs";import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"../checksum-Do_Vh-tB.mjs";import{a as s,i as c,n as l,r as u,t as d}from"../utils-C6k-Fs99.mjs";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};
@@ -1 +1,2 @@
1
- const e=require(`./uploadista-error-BOHJtDRc.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}});
1
+ import{n as e}from"./uploadista-error-U9YxwNtM.mjs";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-C6k-Fs99.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-C6k-Fs99.mjs","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":"oFAyDA,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/C,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAC9C,CAAC,CAEF,OAAe,SAAW,mBAC1B,OAAe,OAAmB,EAAE,CAGpC,OAAe,cAAgB,IAAI,EAEnC,OAAe,KAAK,EAAuB,CACzC,IAAM,EAAK,EAAI,SACT,EAAK,EAAI,OACXA,EACAC,EACAC,EACAC,EAEJ,IAAK,EAAI,EAAG,EAAI,EAAG,GAAK,EAGtB,IAFA,EAAS,EAAI,EACb,EAAI,EAAE,IAAM,EACP,EAAI,EAAG,EAAI,EAAG,GAAK,EACtB,EAAG,EAAS,EAAI,GAAK,EAAG,OAAO,EAAI,GAAK,CACxC,KAAO,EACP,EAAG,EAAS,EAAI,GAAK,EAAG,OAAO,EAAI,GAAK,CACxC,KAAO,EAGX,OAAO,EAAG,KAAK,GAAG,CAGpB,OAAe,UACb,EACA,EACA,CACA,IAAIC,EAAY,EAAE,IAAM,EACpB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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(`./types-C80hlY_o.cjs`),t=require(`./uploadista-error-CQ1ADme7.cjs`);let n=require(`effect`);var r=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(r.hashStr(`hello`)!==`5d41402abc4b2a76b9719d911017c592`)throw Error(`Md5 self test failed.`);function i(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 a={make:e=>{let r,i=!1;return n.Effect.gen(function*(){if(i){if(r!==void 0)return r;yield*new t.n({code:`UNKNOWN_ERROR`,status:500,body:`Effect called more than once with undefined result`}).toEffect()}return i=!0,r=yield*e,r})},legacy:i},o={leading:!1,trailing:!0};function s(e,t,n={}){let r={...o,...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 c(e,t,{leading:n=!0,trailing:r=!0}={}){return s(e,t,{leading:n,trailing:r})}const l={legacy:c};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadista/core",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Core package of Uploadista",
5
5
  "license": "MIT",
6
6
  "author": "Uploadista",
@@ -48,14 +48,14 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "effect": "3.18.4",
51
+ "effect": "3.19.0",
52
52
  "zod": "4.1.12"
53
53
  },
54
54
  "devDependencies": {
55
- "@types/node": "24.9.1",
56
- "tsdown": "0.15.10",
57
- "vitest": "4.0.3",
58
- "@uploadista/typescript-config": "0.0.8"
55
+ "@types/node": "24.10.0",
56
+ "tsdown": "0.16.0",
57
+ "vitest": "4.0.7",
58
+ "@uploadista/typescript-config": "0.0.9"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public",
@@ -1,4 +1,4 @@
1
- import { Context, Effect, Layer } from "effect";
1
+ import { Context, Effect, Layer, Option, Runtime } from "effect";
2
2
  import type { z } from "zod";
3
3
  import { UploadistaError } from "../errors";
4
4
  import {
@@ -6,6 +6,7 @@ import {
6
6
  EventType,
7
7
  type Flow,
8
8
  type FlowData,
9
+ type FlowExecutionResult,
9
10
  getFlowData,
10
11
  runArgsSchema,
11
12
  } from "../flow";
@@ -15,6 +16,40 @@ import type {
15
16
  UploadFile,
16
17
  WebSocketConnection,
17
18
  } from "../types";
19
+
20
+ /**
21
+ * WaitUntil callback type for keeping background tasks alive.
22
+ * Used in serverless environments like Cloudflare Workers to prevent
23
+ * premature termination of background operations.
24
+ *
25
+ * @param promise - Promise representing the background task to keep alive
26
+ */
27
+ export type WaitUntilCallback = (promise: Promise<unknown>) => void;
28
+
29
+ /**
30
+ * Optional WaitUntil service for background task management.
31
+ * When provided, allows flows to execute beyond the HTTP response lifecycle.
32
+ *
33
+ * In Cloudflare Workers, use `ctx.executionCtx.waitUntil()`.
34
+ * In other environments, this can be undefined (flows execute normally with Effect.fork).
35
+ *
36
+ * This service uses Effect's optional service pattern. Access it via:
37
+ * ```typescript
38
+ * const waitUntil = yield* FlowWaitUntil.optional;
39
+ * if (Option.isSome(waitUntil)) {
40
+ * // Use waitUntil.value
41
+ * }
42
+ * ```
43
+ *
44
+ * @see https://effect.website/docs/requirements-management/services/#optional-services
45
+ */
46
+ export class FlowWaitUntil extends Context.Tag("FlowWaitUntil")<
47
+ FlowWaitUntil,
48
+ WaitUntilCallback
49
+ >() {
50
+ static optional = Effect.serviceOption(FlowWaitUntil);
51
+ }
52
+
18
53
  import { FlowEventEmitter, FlowJobKVStore } from "../types";
19
54
  import { UploadServer } from "../upload";
20
55
  import type { FlowEvent } from "./event";
@@ -555,7 +590,8 @@ function withFlowEvents<
555
590
  const executionJobId = args.jobId || crypto.randomUUID();
556
591
 
557
592
  const onEventCallback = createOnEventCallback(executionJobId);
558
- const checkJobStatusCallback = createCheckJobStatusCallback(executionJobId);
593
+ const checkJobStatusCallback =
594
+ createCheckJobStatusCallback(executionJobId);
559
595
 
560
596
  // Create a new flow with the same configuration but with onEvent callback
561
597
  const flowWithEvents = yield* createFlowWithSchema({
@@ -595,7 +631,8 @@ function withFlowEvents<
595
631
  const executionJobId = args.jobId;
596
632
 
597
633
  const onEventCallback = createOnEventCallback(executionJobId);
598
- const checkJobStatusCallback = createCheckJobStatusCallback(executionJobId);
634
+ const checkJobStatusCallback =
635
+ createCheckJobStatusCallback(executionJobId);
599
636
 
600
637
  // Create a new flow with the same configuration but with onEvent callback
601
638
  const flowWithEvents = yield* createFlowWithSchema({
@@ -697,13 +734,19 @@ export function createFlowServer() {
697
734
  inputs: Record<string, any>;
698
735
  }) =>
699
736
  Effect.gen(function* () {
737
+ console.log(
738
+ `[FlowServer] executeFlowInBackground started for job: ${jobId}`,
739
+ );
740
+
700
741
  // Update job status to running
701
742
  yield* updateJob(jobId, {
702
743
  status: "running",
703
744
  });
704
745
 
746
+ console.log(`[FlowServer] Creating flowWithEvents for job: ${jobId}`);
705
747
  const flowWithEvents = withFlowEvents(flow, eventEmitter, kvStore);
706
748
 
749
+ console.log(`[FlowServer] Running flow for job: ${jobId}`);
707
750
  // Run the flow with the consistent jobId
708
751
  const result = yield* flowWithEvents.run({
709
752
  inputs,
@@ -712,6 +755,10 @@ export function createFlowServer() {
712
755
  clientId,
713
756
  });
714
757
 
758
+ console.log(
759
+ `[FlowServer] Flow completed for job: ${jobId}, result type: ${result.type}`,
760
+ );
761
+
715
762
  // Handle result based on type
716
763
  if (result.type === "paused") {
717
764
  // Update job as paused (node results are in tasks, not executionState)
@@ -801,7 +848,7 @@ export function createFlowServer() {
801
848
  ),
802
849
  );
803
850
 
804
- return Effect.fail(error);
851
+ throw error;
805
852
  }),
806
853
  ),
807
854
  );
@@ -831,6 +878,8 @@ export function createFlowServer() {
831
878
  inputs: unknown;
832
879
  }) =>
833
880
  Effect.gen(function* () {
881
+ const waitUntil = yield* FlowWaitUntil.optional;
882
+
834
883
  const parsedParams = yield* Effect.try({
835
884
  try: () => runArgsSchema.parse({ inputs }),
836
885
  catch: (error) =>
@@ -860,21 +909,47 @@ export function createFlowServer() {
860
909
  // Get the flow and start background execution
861
910
  const flow = yield* flowProvider.getFlow(flowId, clientId);
862
911
 
863
- // Fork the flow execution to run in background as daemon
864
- yield* Effect.forkDaemon(
865
- executeFlowInBackground({
866
- jobId,
867
- flow,
868
- storageId,
869
- clientId,
870
- inputs: parsedParams.inputs,
871
- }).pipe(
872
- Effect.tapErrorCause((cause) =>
873
- Effect.logError("Flow execution failed", cause),
874
- ),
875
- ),
912
+ console.log(
913
+ `[FlowServer] About to fork flow execution for job: ${jobId}`,
876
914
  );
877
915
 
916
+ // Execute flow in background
917
+ // If waitUntil is provided (Cloudflare Workers), use it to keep execution alive
918
+ // Otherwise, use Effect.fork for standard environments
919
+ const flowEffect = executeFlowInBackground({
920
+ jobId,
921
+ flow,
922
+ storageId,
923
+ clientId,
924
+ inputs: parsedParams.inputs,
925
+ }).pipe(
926
+ Effect.tapErrorCause((cause) =>
927
+ Effect.logError("Flow execution failed", cause),
928
+ ),
929
+ ) as Effect.Effect<
930
+ FlowExecutionResult<Record<string, any>>,
931
+ UploadistaError,
932
+ never
933
+ >;
934
+
935
+ if (Option.isSome(waitUntil)) {
936
+ // Cloudflare Workers: Use waitUntil to keep execution alive
937
+ console.log(`[FlowServer] Using waitUntil for job: ${jobId}`);
938
+ // Get the current runtime to run the effect as a promise
939
+ const runtime = yield* Effect.runtime();
940
+ const runnable = Runtime.runPromise(runtime);
941
+ const promise = runnable(flowEffect);
942
+ waitUntil.value(promise);
943
+ } else {
944
+ // Standard environments: Fork normally
945
+ console.log(
946
+ `[FlowServer] Using Effect.forkDaemon for job: ${jobId}`,
947
+ );
948
+ yield* Effect.forkDaemon(flowEffect);
949
+ }
950
+
951
+ console.log(`[FlowServer] Flow execution started for job: ${jobId}`);
952
+
878
953
  // Return immediately with jobId
879
954
  return job;
880
955
  }),
@@ -905,6 +980,8 @@ export function createFlowServer() {
905
980
  clientId: string | null;
906
981
  }) =>
907
982
  Effect.gen(function* () {
983
+ const waitUntil = yield* FlowWaitUntil.optional;
984
+
908
985
  // Get the current job
909
986
  const job = yield* kvStore.get(jobId);
910
987
  if (!job) {
@@ -1092,19 +1169,39 @@ export function createFlowServer() {
1092
1169
  ),
1093
1170
  );
1094
1171
 
1095
- return Effect.fail(error);
1172
+ throw error;
1096
1173
  }),
1097
1174
  ),
1098
1175
  );
1099
1176
 
1100
- // Fork the resume execution to run in background as daemon
1101
- yield* Effect.forkDaemon(
1102
- resumeFlowInBackground.pipe(
1103
- Effect.tapErrorCause((cause) =>
1104
- Effect.logError("Flow resume failed", cause),
1105
- ),
1177
+ // Fork the resume execution to run in background
1178
+ // Use waitUntil if available (Cloudflare Workers), otherwise fork normally
1179
+ const resumeEffect = resumeFlowInBackground.pipe(
1180
+ Effect.tapErrorCause((cause) =>
1181
+ Effect.logError("Flow resume failed", cause),
1106
1182
  ),
1107
- );
1183
+ ) as Effect.Effect<
1184
+ FlowExecutionResult<Record<string, any>>,
1185
+ UploadistaError,
1186
+ never
1187
+ >;
1188
+
1189
+ if (Option.isSome(waitUntil)) {
1190
+ // Cloudflare Workers: Use waitUntil to keep execution alive
1191
+ console.log(
1192
+ `[FlowServer] Using waitUntil for resume job: ${jobId}`,
1193
+ );
1194
+ const runtime = yield* Effect.runtime();
1195
+ const runnable = Runtime.runPromise(runtime);
1196
+ const promise = runnable(resumeEffect);
1197
+ waitUntil.value(promise);
1198
+ } else {
1199
+ // Standard environments: Fork normally as daemon
1200
+ console.log(
1201
+ `[FlowServer] Using Effect.forkDaemon for resume job: ${jobId}`,
1202
+ );
1203
+ yield* Effect.forkDaemon(resumeEffect);
1204
+ }
1108
1205
 
1109
1206
  // Return immediately with updated job
1110
1207
  const updatedJob = yield* kvStore.get(jobId);
package/src/flow/flow.ts CHANGED
@@ -527,6 +527,7 @@ export function createFlowWithSchema<
527
527
  // For input nodes, use the mapped flow input
528
528
  nodeInput = nodeInputs[nodeId];
529
529
  if (nodeInput === undefined) {
530
+ yield* Effect.logError(`Input node ${nodeId} has no input data`);
530
531
  return yield* UploadistaError.fromCode("FLOW_NODE_ERROR", {
531
532
  cause: new Error(`Input node ${nodeId} has no input data`),
532
533
  }).toEffect();
@@ -536,6 +537,7 @@ export function createFlowWithSchema<
536
537
  nodeInputsForExecution = getNodeInputs(nodeId, nodeResults);
537
538
 
538
539
  if (Object.keys(nodeInputsForExecution).length === 0) {
540
+ yield* Effect.logError(`Node ${nodeId} has no input data`);
539
541
  return yield* UploadistaError.fromCode("FLOW_NODE_ERROR", {
540
542
  cause: new Error(`Node ${nodeId} has no input data`),
541
543
  }).toEffect();
@@ -24,6 +24,11 @@ export const uploadFileSchema = z.object({
24
24
  path: z.string().optional(),
25
25
  uploadId: z.string().optional(),
26
26
  bucket: z.string().optional(),
27
+ parts: z.array(z.object({
28
+ partNumber: z.number(),
29
+ etag: z.string(),
30
+ size: z.number(),
31
+ })).optional(),
27
32
  }),
28
33
  flow: z
29
34
  .object({
@@ -49,6 +54,7 @@ export const uploadFileSchema = z.object({
49
54
  * @property storage.path - Optional path prefix within the storage backend
50
55
  * @property storage.uploadId - Optional backend-specific upload ID (e.g., S3 multipart upload ID)
51
56
  * @property storage.bucket - Optional bucket or container name
57
+ * @property storage.parts - Optional array of uploaded parts (used by data stores that need to track parts locally, like R2)
52
58
  * @property flow - Optional flow processing information (when file is part of a flow)
53
59
  * @property flow.flowId - ID of the flow processing this file
54
60
  * @property flow.nodeId - ID of the flow node that created this file
@@ -123,6 +129,11 @@ export type UploadFile = {
123
129
  path?: string | undefined;
124
130
  uploadId?: string | undefined;
125
131
  bucket?: string | undefined;
132
+ parts?: Array<{
133
+ partNumber: number;
134
+ etag: string;
135
+ size: number;
136
+ }> | undefined;
126
137
  };
127
138
  flow?: {
128
139
  flowId: string;
@@ -1 +0,0 @@
1
- const e=require(`./uploadista-error-BOHJtDRc.cjs`);let t=require(`effect`);t=e.a(t);var n=class extends t.Context.Tag(`UploadistaGenerateIdService`)(){};const r=n.Service,i=n.of({generateId:()=>t.Effect.succeed(crypto.randomUUID())}),a=t.Layer.succeed(n,i),o=n.of({generateId:()=>t.Effect.succeed(`${Date.now()}-${Math.random().toString(36).slice(2,11)}`)}),s=[`sha256`];function c(e){return s.includes(e)}function l(n,r){return t.Effect.gen(function*(){if(!c(r))return yield*e.n.fromCode(`UNSUPPORTED_CHECKSUM_ALGORITHM`,{body:`Checksum algorithm '${r}' is not supported. Supported algorithms: ${s.join(`, `)}`,details:{algorithm:r,supportedAlgorithms:s}}).toEffect();let i=r.toUpperCase().replace(/\d+/,`-$&`),a=yield*t.Effect.tryPromise({try:()=>crypto.subtle.digest(i,n),catch:t=>e.n.fromCode(`UNKNOWN_ERROR`,{body:`Failed to compute checksum: ${t instanceof Error?t.message:`Unknown error`}`,cause:t,details:{algorithm:r}})});return Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,`0`)).join(``)})}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -1,2 +0,0 @@
1
- import{n as e}from"./uploadista-error-CDkJ_Vrc.js";import{Context as t,Effect as n,Layer as r}from"effect";var i=class extends t.Tag(`UploadistaGenerateIdService`)(){};const a=i.Service,o=i.of({generateId:()=>n.succeed(crypto.randomUUID())}),s=r.succeed(i,o),c=i.of({generateId:()=>n.succeed(`${Date.now()}-${Math.random().toString(36).slice(2,11)}`)}),l=[`sha256`];function u(e){return l.includes(e)}function d(t,r){return n.gen(function*(){if(!u(r))return yield*e.fromCode(`UNSUPPORTED_CHECKSUM_ALGORITHM`,{body:`Checksum algorithm '${r}' is not supported. Supported algorithms: ${l.join(`, `)}`,details:{algorithm:r,supportedAlgorithms:l}}).toEffect();let i=r.toUpperCase().replace(/\d+/,`-$&`),a=yield*n.tryPromise({try:()=>crypto.subtle.digest(i,t),catch:t=>e.fromCode(`UNKNOWN_ERROR`,{body:`Failed to compute checksum: ${t instanceof Error?t.message:`Unknown error`}`,cause:t,details:{algorithm:r}})});return Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,`0`)).join(``)})}export{o as a,s as i,u as n,a as o,i as r,c as s,d as t};
2
- //# sourceMappingURL=checksum-_Vagjoys.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checksum-_Vagjoys.js","names":[],"sources":["../src/utils/generate-id.ts","../src/utils/checksum.ts"],"sourcesContent":["import { Context, Effect, Layer } from \"effect\";\n\nexport type GenerateIdShape = {\n generateId: () => Effect.Effect<string>;\n};\n\n// Declaring a tag for a service that generates random id\nexport class GenerateId extends Context.Tag(\"UploadistaGenerateIdService\")<\n GenerateId,\n { readonly generateId: () => Effect.Effect<string> }\n>() {}\n\n/**\n * Effect-based ID generation services\n */\nexport const GenerateIdService = GenerateId.Service;\n\n/**\n * Generates a random UUID using Effect\n * @returns Effect that produces a random UUID string\n */\nexport const GenerateIdRandom = GenerateId.of({\n generateId: () => Effect.succeed(crypto.randomUUID()),\n});\n\nexport const GenerateIdLive = Layer.succeed(GenerateId, GenerateIdRandom);\n\n/**\n * Generates a timestamp-based ID using Effect\n * @returns Effect that produces a timestamp-based ID\n */\nexport const GenerateIdTimestamp = GenerateId.of({\n generateId: () =>\n Effect.succeed(`${Date.now()}-${Math.random().toString(36).slice(2, 11)}`),\n});\n","import { Effect } from \"effect\";\nimport { UploadistaError } from \"../errors/uploadista-error\";\n\n/**\n * Supported checksum algorithms\n */\nconst SUPPORTED_ALGORITHMS = [\"sha256\"] as const;\nexport type ChecksumAlgorithm = (typeof SUPPORTED_ALGORITHMS)[number];\n\n/**\n * Check if a checksum algorithm is supported\n */\nexport function isSupportedAlgorithm(algorithm: string): algorithm is ChecksumAlgorithm {\n return SUPPORTED_ALGORITHMS.includes(algorithm as ChecksumAlgorithm);\n}\n\n/**\n * Compute checksum of file bytes using the Web Crypto API.\n * This works across all modern platforms: browsers, Node.js 15+, Deno, Bun, and Cloudflare Workers.\n *\n * @param bytes - File content as Uint8Array\n * @param algorithm - Hashing algorithm to use (currently only 'sha256' is supported)\n * @returns Effect that resolves to hex-encoded checksum string\n */\nexport function computeChecksum(\n bytes: Uint8Array,\n algorithm: string,\n): Effect.Effect<string, UploadistaError> {\n return Effect.gen(function* () {\n // Validate algorithm is supported\n if (!isSupportedAlgorithm(algorithm)) {\n return yield* UploadistaError.fromCode(\"UNSUPPORTED_CHECKSUM_ALGORITHM\", {\n body: `Checksum algorithm '${algorithm}' is not supported. Supported algorithms: ${SUPPORTED_ALGORITHMS.join(\", \")}`,\n details: { algorithm, supportedAlgorithms: SUPPORTED_ALGORITHMS },\n }).toEffect();\n }\n\n // Map algorithm name to Web Crypto API algorithm name\n const webCryptoAlgorithm = algorithm.toUpperCase().replace(/\\d+/, \"-$&\"); // \"sha256\" -> \"SHA-256\"\n\n // Compute hash using Web Crypto API (available in browsers, Node.js 15+, Deno, Bun, Cloudflare Workers)\n // Pass Uint8Array directly - it's a valid BufferSource\n const hashBuffer = yield* Effect.tryPromise({\n try: () => crypto.subtle.digest(webCryptoAlgorithm, bytes as BufferSource),\n catch: (error) =>\n UploadistaError.fromCode(\"UNKNOWN_ERROR\", {\n body: `Failed to compute checksum: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n cause: error,\n details: { algorithm },\n }),\n });\n\n // Convert ArrayBuffer to hex string\n const hashArray = Array.from(new Uint8Array(hashBuffer));\n const hashHex = hashArray\n .map((byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\");\n\n return hashHex;\n });\n}\n"],"mappings":"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as ERROR_CATALOG,t as UploadistaError,n as httpFailure,e as isUploadistaError};
@@ -1,6 +0,0 @@
1
- import "../uploadista-error-kZCQLC_U.js";
2
- import "../index-BoGG5KAY.js";
3
- import { $ as FlowServerShape, A as ImageAiContext, An as FlowEventFlowStart, B as StorageParams, Bn as ConditionOperator, C as describeImageParamsSchema, Cn as waitingNodeExecution, D as resizeParamsSchema, Dn as FlowEventFlowEnd, E as ResizeParams, En as FlowEventFlowCancel, F as ExecutionLevel, Fn as FlowEventNodePause, G as createInputNode, H as storageParamsSchema, Hn as NodeType, I as ParallelScheduler, In as FlowEventNodeResponse, J as FlowProvider, K as inputDataSchema, L as ParallelSchedulerConfig, Ln as FlowEventNodeResume, M as ImageAiPluginShape, Mn as FlowEventJobStart, N as CredentialProvider, Nn as FlowEventNodeEnd, O as OptimizeParams, On as FlowEventFlowError, P as CredentialProviderShape, Pn as FlowEventNodeError, Q as FlowServerOptions, R as TransformNodeConfig, Rn as FlowEventNodeStart, S as DescribeImageParams, Sn as completeNodeExecution, T as ImagePluginShape, Tn as FlowEvent, U as InputData, Un as createFlowNode, V as createStorageNode, Vn as ConditionValue, W as InputNodeParams, Wn as getNodeData, X as FlowServer, Y as FlowProviderShape, Z as FlowServerLayer, _ as ZipParams, _n as FlowNodeData, a as FlowCondition, at as FlowJobTaskStatus, b as RemoveBackgroundParams, bn as NodeTypeMap, c as FlowPluginRequirements, cn as Flow, d as NodeDefinitionsRecord, dn as createFlowWithSchema, et as createFlowServer, f as TypedFlow, fn as getFlowData, g as ZipInput, gn as FlowNode, h as createFlow, hn as FlowConfig, i as runArgsSchema, it as FlowJobTask, j as ImageAiPlugin, jn as FlowEventJobEnd, k as optimizeParamsSchema, kn as FlowEventFlowPause, l as FlowRequirements, ln as FlowData, m as TypedFlowEdge, mn as createFlowEdge, n as resolveUploadMetadata, nt as FlowJob, o as FlowInputMap, p as TypedFlowConfig, pn as FlowEdge, q as inputNodeParamsSchema, r as RunArgs, rt as FlowJobStatus, s as FlowOutputMap, t as ResolvedUploadMetadata, tt as flowServer, u as NodeDefinition, un as FlowExecutionResult, v as ZipPlugin, vn as NodeConnectionValidator, w as ImagePlugin, wn as EventType, x as removeBackgroundParamsSchema, xn as TypeCompatibilityChecker, y as ZipPluginShape, yn as NodeExecutionResult, z as createTransformNode, zn as ConditionField } from "../index-Bq0Zkv4L.js";
4
- import "../index-CU5XRZOh.js";
5
- import "../index-BQIgMrBX.js";
6
- export { ConditionField, ConditionOperator, ConditionValue, CredentialProvider, CredentialProviderShape, DescribeImageParams, EventType, ExecutionLevel, Flow, FlowCondition, FlowConfig, FlowData, FlowEdge, FlowEvent, FlowEventFlowCancel, FlowEventFlowEnd, FlowEventFlowError, FlowEventFlowPause, FlowEventFlowStart, FlowEventJobEnd, FlowEventJobStart, FlowEventNodeEnd, FlowEventNodeError, FlowEventNodePause, FlowEventNodeResponse, FlowEventNodeResume, FlowEventNodeStart, FlowExecutionResult, FlowInputMap, FlowJob, FlowJobStatus, FlowJobTask, FlowJobTaskStatus, FlowNode, FlowNodeData, FlowOutputMap, FlowPluginRequirements, FlowProvider, FlowProviderShape, FlowRequirements, FlowServer, FlowServerLayer, FlowServerOptions, FlowServerShape, ImageAiContext, ImageAiPlugin, ImageAiPluginShape, ImagePlugin, ImagePluginShape, InputData, InputNodeParams, NodeConnectionValidator, NodeDefinition, NodeDefinitionsRecord, NodeExecutionResult, NodeType, NodeTypeMap, OptimizeParams, ParallelScheduler, ParallelSchedulerConfig, RemoveBackgroundParams, ResizeParams, ResolvedUploadMetadata, RunArgs, StorageParams, TransformNodeConfig, TypeCompatibilityChecker, TypedFlow, TypedFlowConfig, TypedFlowEdge, ZipInput, ZipParams, ZipPlugin, ZipPluginShape, completeNodeExecution, createFlow, createFlowEdge, createFlowNode, createFlowServer, createFlowWithSchema, createInputNode, createStorageNode, createTransformNode, describeImageParamsSchema, flowServer, getFlowData, getNodeData, inputDataSchema, inputNodeParamsSchema, optimizeParamsSchema, removeBackgroundParamsSchema, resizeParamsSchema, resolveUploadMetadata, runArgsSchema, storageParamsSchema, waitingNodeExecution };
@@ -1 +0,0 @@
1
- import"../uploadista-error-CDkJ_Vrc.js";import"../errors-8i_aMxOE.js";import{A as e,C as t,D as n,E as r,O as i,S as a,T as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,j as g,k as _,l as v,m as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E,v as D,w as O,x as k,y as A}from"../flow-CSHZVjcf.js";import"../types-DqllXpuL.js";import"../upload-C_n7Smfl.js";import"../checksum-_Vagjoys.js";import"../stream-limiter-CTLrikR_.js";export{E as CredentialProvider,e as EventType,l as FlowProvider,k as FlowServer,v as ImageAiPlugin,u as ImagePlugin,n as NodeType,r as ParallelScheduler,C as ZipPlugin,D as completeNodeExecution,b as createFlow,g as createFlowEdge,i as createFlowNode,a as createFlowServer,O as createFlowWithSchema,y as createInputNode,f as createStorageNode,d as createTransformNode,w as describeImageParamsSchema,t as flowServer,o as getFlowData,_ as getNodeData,m as inputDataSchema,p as inputNodeParamsSchema,x as optimizeParamsSchema,c as removeBackgroundParamsSchema,h as resizeParamsSchema,s as resolveUploadMetadata,T as runArgsSchema,S as storageParamsSchema,A as waitingNodeExecution};