@uploadista/kv-store-cloudflare-do 0.1.4-beta.1 → 1.0.0-beta.2
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/dist/index.cjs +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=require(`@uploadista/core/errors`),t=require(`@uploadista/core/types`),n=require(`effect`);function r({durableObject:t}){function r(e){let n=t.idFromName(e);return t.get(n)}return{get:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.getFlowJob(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.flatMap(t=>t===void 0?n.Effect.fail(e.UploadistaError.fromCode(`FILE_NOT_FOUND`)):n.Effect.succeed(t)))},set:(t,i)=>{let a=r(t);return n.Effect.tryPromise({try:()=>a.setFlowJob(i),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)},delete:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.deleteFlowJob(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)}}}const i=r,a=e=>n.Layer.succeed(t.FlowJobKVStore,r(e));function o({durableObject:t}){function r(e){let n=t.idFromName(e);return t.get(n)}return{get:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.getUploadFile(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.flatMap(t=>t===void 0?n.Effect.fail(e.UploadistaError.fromCode(`FILE_NOT_FOUND`)):n.Effect.succeed(t)))},set:(t,i)=>{let a=r(t);return n.Effect.tryPromise({try:()=>a.setUploadFile(i),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)},delete:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.deleteUploadFile(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)}}}const s=e=>n.Layer.succeed(t.UploadFileKVStore,o(e));exports.cloudflareDoFlowJobKvStore=a,exports.cloudflareDoFlowStore=i,exports.cloudflareDoUploadStore=s,exports.makeCloudflareDoFlowStore=r,exports.makeCloudflareDoUploadStore=o;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@uploadista/core/errors`),t=require(`@uploadista/core/types`),n=require(`effect`);function r({durableObject:t}){function r(e){let n=t.idFromName(e);return t.get(n)}return{get:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.getFlowJob(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.flatMap(t=>t===void 0?n.Effect.fail(e.UploadistaError.fromCode(`FILE_NOT_FOUND`)):n.Effect.succeed(t)))},set:(t,i)=>{let a=r(t);return n.Effect.tryPromise({try:()=>a.setFlowJob(i),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)},delete:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.deleteFlowJob(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)}}}const i=r,a=e=>n.Layer.succeed(t.FlowJobKVStore,r(e));function o({durableObject:t}){function r(e){let n=t.idFromName(e);return t.get(n)}return{get:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.getUploadFile(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.flatMap(t=>t===void 0?n.Effect.fail(e.UploadistaError.fromCode(`FILE_NOT_FOUND`)):n.Effect.succeed(t)))},set:(t,i)=>{let a=r(t);return n.Effect.tryPromise({try:()=>a.setUploadFile(i),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)},delete:t=>{let i=r(t);return n.Effect.tryPromise({try:()=>i.deleteUploadFile(),catch:t=>e.UploadistaError.fromCode(`UNKNOWN_ERROR`,{cause:t})}).pipe(n.Effect.asVoid)}}}const s=e=>n.Layer.succeed(t.UploadFileKVStore,o(e));exports.cloudflareDoFlowJobKvStore=a,exports.cloudflareDoFlowStore=i,exports.cloudflareDoUploadStore=s,exports.makeCloudflareDoFlowStore=r,exports.makeCloudflareDoUploadStore=o;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/kv-store-cloudflare-do",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0-beta.2",
|
|
5
5
|
"description": "Cloudflare Durable Object KV store for Uploadista",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Uploadista",
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@cloudflare/workers-types": "4.
|
|
18
|
-
"@uploadista/core": "0.
|
|
17
|
+
"@cloudflare/workers-types": "4.20260227.0",
|
|
18
|
+
"@uploadista/core": "1.0.0-beta.2"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"effect": "^3.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@effect/vitest": "0.27.0",
|
|
25
|
-
"effect": "3.19.
|
|
26
|
-
"tsdown": "0.20.
|
|
25
|
+
"effect": "3.19.19",
|
|
26
|
+
"tsdown": "0.20.3",
|
|
27
27
|
"vitest": "4.0.18",
|
|
28
|
-
"@uploadista/typescript-config": "0.
|
|
28
|
+
"@uploadista/typescript-config": "1.0.0-beta.2"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "tsc --noEmit && tsdown",
|