{"_id":"@ema-unlimited/frontier-apps-sdk","_rev":"9-69c49ffb55e02948d24336bcdac3b0ab","name":"@ema-unlimited/frontier-apps-sdk","dist-tags":{"rc":"0.2.0-rc.4","latest":"0.2.2"},"versions":{"0.1.3-rc.1":{"name":"@ema-unlimited/frontier-apps-sdk","version":"0.1.3-rc.1","keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_id":"@ema-unlimited/frontier-apps-sdk@0.1.3-rc.1","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"}],"dist":{"shasum":"7199da9d075c0173be74a72e48f9cf8b47e8eac9","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.1.3-rc.1.tgz","fileCount":16,"integrity":"sha512-cWWnlm1XbRtU/dOtDoEoRCZ3Wulnwai87q68wkMoF9Z2cx6SCd53wLvs0LtmYxFERjSb/Os0SnD3I8OEL3+c+g==","signatures":[{"sig":"MEQCICsk0xg/N0ZEpGIABd3IH+9+RFa7wLyDxhwvRY1TPyTcAiBk/gmte6qWxEL8rUUFsynuobGji7C3aipPE0jeos9aWQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39637},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"gitHead":"7dd3e6a5a06cbbe00b9e8dd475bd09f3a7cd2e27","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"akshat-ema","email":"akshat@ema.co"},"_npmVersion":"10.9.2","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/frontier-apps-sdk_0.1.3-rc.1_1779307257643_0.19810148060201294","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@ema-unlimited/frontier-apps-sdk","version":"0.1.3","keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_id":"@ema-unlimited/frontier-apps-sdk@0.1.3","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"}],"dist":{"shasum":"d802132ea5e71dad788b5631cb55d9fe7f8ee795","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.1.3.tgz","fileCount":16,"integrity":"sha512-FnH+agkrXl3G7J15jpgcGBtMOOVaQL2tQRL+jmTF3wHTaHNAybQxiAFAUgnWbL9ihTkqoZKY1+lFOh9/2zD89A==","signatures":[{"sig":"MEYCIQDDpEn8EviWONGBJPpKtU0uk7YwCP2w6ZfLnS2XdYzO3AIhANhty5c84Pj/q+uOzG3GjBnn8zV2ddun/qs7Ra/vk/Xa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39632},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"gitHead":"f87ff70c7ba4bbc4d7d09603dca96d995209a925","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9d9ee221-d394-4647-96be-9b2029aeacbe"}},"_npmVersion":"11.12.1","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/frontier-apps-sdk_0.1.3_1779309108672_0.1869379325050724","host":"s3://npm-registry-packages-npm-production"}},"0.2.0-rc.2":{"name":"@ema-unlimited/frontier-apps-sdk","version":"0.2.0-rc.2","keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_id":"@ema-unlimited/frontier-apps-sdk@0.2.0-rc.2","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"},{"name":"parth_baghel","email":"parth@ema.co"}],"dist":{"shasum":"5ca0213bb117ab3cff0d60540d9a35f3e5a27de8","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.2.0-rc.2.tgz","fileCount":14,"integrity":"sha512-ctR5mw+tbOFXjDLB9qlHW071t3FlczAtr9LpPwrLCxm9palWoVyL8j5OBrIEBJ6rYSvRh167fO3Kfj2JtuEqew==","signatures":[{"sig":"MEQCIDL52rg4dkgCASQ7dI4OYcsAMDC/GmfIO0dnNta3InZdAiBc7nApurKT07h8V5asuVP2C4cgMvECqPd8lSZcdDE1TQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48329},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"gitHead":"6c736219b143cb54dcf99180e8902e3171e5e2f7","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9d9ee221-d394-4647-96be-9b2029aeacbe"}},"_npmVersion":"11.12.1","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/frontier-apps-sdk_0.2.0-rc.2_1779371845752_0.056073178377865185","host":"s3://npm-registry-packages-npm-production"}},"0.2.0-rc.3":{"name":"@ema-unlimited/frontier-apps-sdk","version":"0.2.0-rc.3","keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_id":"@ema-unlimited/frontier-apps-sdk@0.2.0-rc.3","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"},{"name":"parth_baghel","email":"parth@ema.co"}],"dist":{"shasum":"95eae6a9a22e9b8538026a9ce4aca1d79c1d531b","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.2.0-rc.3.tgz","fileCount":14,"integrity":"sha512-+B5qF6Zhp5h09d6jhrVOEmie1GXQbI6k9Co+2l9knQUeCceGlnwuGdZ8B8132HFzkIWbFSPXqC7PWSs1R9qIPQ==","signatures":[{"sig":"MEUCIAwQKnocdtx7Aak0Lh+nBcNJx7ExkZBg+QitQ+mwPUpaAiEA3qfm2E62HczCipQJzK9u6CGqUXA9GHAG323e1Eubvzo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48329},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"gitHead":"7e83c3d1611a50aa8230068695d88582844b55b8","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9d9ee221-d394-4647-96be-9b2029aeacbe"}},"_npmVersion":"11.12.1","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","readmeFilename":"README.md","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/frontier-apps-sdk_0.2.0-rc.3_1779374419852_0.6239469875262844","host":"s3://npm-registry-packages-npm-production"}},"0.2.0-rc.4":{"name":"@ema-unlimited/frontier-apps-sdk","version":"0.2.0-rc.4","keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_id":"@ema-unlimited/frontier-apps-sdk@0.2.0-rc.4","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"},{"name":"parth_baghel","email":"parth@ema.co"}],"dist":{"shasum":"697ddfb0b92f9c761fc6678d0d58875ac65affc9","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.2.0-rc.4.tgz","fileCount":14,"integrity":"sha512-SUw49zxRyOYoOahSdIaU4ibVG+zw0RyYKWg3qdVYo5sHm6x4iPVtmfreck0epS6OQHHFBJWF1kNCfl7t7YrAAw==","signatures":[{"sig":"MEUCIQDLzPoDkIPSuM/dDlUVX0qlre5nzof7FUMIZDiDPJmCxQIgE02FKGN48j7e7mNF4nElHMyPM++LEA78UdNwF4J9q/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52038},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"gitHead":"b18fd0c7727b14fb7b1c0cbb26fa377050c0d2c4","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9d9ee221-d394-4647-96be-9b2029aeacbe"}},"_npmVersion":"11.12.1","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","readmeFilename":"README.md","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/frontier-apps-sdk_0.2.0-rc.4_1779387065108_0.8351788566041305","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ema-unlimited/frontier-apps-sdk","version":"0.2.0","keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_id":"@ema-unlimited/frontier-apps-sdk@0.2.0","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"},{"name":"parth_baghel","email":"parth@ema.co"}],"dist":{"shasum":"4ef7575e6c5f52786aa4c0528d25cbc4a89bec24","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.2.0.tgz","fileCount":14,"integrity":"sha512-FBtm3PS9tdEZAdQnObsnyvm08avMtwxjkRt8SGVy/OH8jB6koTwlG0t2g+7zgVaiQvoSSGKjb18ssUkdCe6Mgg==","signatures":[{"sig":"MEYCIQDHa4529cgjV1Z7YMsVFTHkeKBgRMD6TjgH20t4p4bK3wIhAIUwyNp5fADhQ0n6m6dX2uXvJZlQLOJUyhlHrd0Smtq3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52082},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"gitHead":"59df2161d8a79a6e790223e2ee0bf136d58a6f68","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9d9ee221-d394-4647-96be-9b2029aeacbe"}},"_npmVersion":"11.12.1","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/frontier-apps-sdk_0.2.0_1779913806682_0.8320979643753235","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@ema-unlimited/frontier-apps-sdk","version":"0.2.1","keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_id":"@ema-unlimited/frontier-apps-sdk@0.2.1","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"},{"name":"parth_baghel","email":"parth@ema.co"}],"dist":{"shasum":"ca4a424f26b693e067b8741cc10c402aa004744c","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.2.1.tgz","fileCount":14,"integrity":"sha512-QZ/yvAwlGQdTXLTGgrOjSa2VTNUKjbOYsXz9kvK8HupE5OICwqcB7fbtDGNsurvVXF21G/Y7gobT/kl+8XRvoA==","signatures":[{"sig":"MEUCIQCE5p2Gx0NMID4e9RyxQ3yv4pVrHvjhKnmnriJ982QY+gIgU6bAYnSz4AIjqqxAwG3kylZB7cpZseFp1qUPKWHrZt8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56271},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"akshat-ema","email":"akshat@ema.co"},"_npmVersion":"10.9.2","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/frontier-apps-sdk_0.2.1_1781673719284_0.8606978961039198","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"_id":"@ema-unlimited/frontier-apps-sdk@0.2.2","dist":{"shasum":"483fb4e10daf4962512f3f0023513b6bfd997986","tarball":"https://registry.npmjs.org/@ema-unlimited/frontier-apps-sdk/-/frontier-apps-sdk-0.2.2.tgz","fileCount":14,"integrity":"sha512-oVZ02QYJaxqaUMbM3B5E8Nr2/nXlEgjNHzDAiA0Qsr7FqIxl7/Yj8Q45uf83++q6u0PbJb8eSMckuZH9sbPUVQ==","signatures":[{"sig":"MEUCIQD1oIaUM+VC/eztMMOyw7ZH3m6hCGYuAfhk/McH8DTsaAIgQAV5Dr1dSVGQ6l3wl3MJTLW6UyPIPXHeX4FX5slzAEU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHk6OjDt9Wd/CT55HrFi59gzIksvui5kMShDc1HZQJ44AiAaNJhyQFImd7Jmci6g30f1PvKcGySHqkxn5nDgttENLw=="}],"unpackedSize":58562},"main":"./dist/index.cjs","name":"@ema-unlimited/frontier-apps-sdk","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./mongodb":{"types":"./dist/mongodb/index.d.ts","import":"./dist/mongodb/index.js","default":"./dist/mongodb/index.js","require":"./dist/mongodb/index.cjs"},"./storage":{"types":"./dist/storage/index.d.ts","import":"./dist/storage/index.js","default":"./dist/storage/index.js","require":"./dist/storage/index.cjs"}},"gitHead":"f25a401817192d87d9fcac7b08be9666168df3e3","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","clean":"rm -rf dist","test:dist":"node tests/dist-integration.mjs","typecheck":"tsc --noEmit","test:watch":"vitest"},"version":"0.2.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9d9ee221-d394-4647-96be-9b2029aeacbe"}},"keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"_npmVersion":"11.19.0","description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","directories":{},"maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"},{"name":"parth_baghel","email":"parth@ema.co"}],"_nodeVersion":"24.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.28.1","devDependencies":{"tsup":"^8.5.0","vitest":"^2.1.0","mongoose":"^8.23.0","typescript":"^5.7.3","@types/node":"^20.11.0"},"peerDependencies":{"mongoose":"^8.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/frontier-apps-sdk_0.2.2_1790154538901_0.5923779021250546"}}},"time":{"created":"2026-05-20T20:00:57.405Z","modified":"2026-09-23T09:08:59.127Z","0.1.3-rc.1":"2026-05-20T20:00:58.043Z","0.1.3":"2026-05-20T20:31:48.924Z","0.2.0-rc.2":"2026-05-21T13:57:25.881Z","0.2.0-rc.3":"2026-05-21T14:40:20.027Z","0.2.0-rc.4":"2026-05-21T18:11:05.326Z","0.2.0":"2026-05-27T20:30:06.855Z","0.2.1":"2026-06-17T05:21:59.437Z","0.2.2":"2026-09-23T09:08:58.980Z"},"keywords":["ema","frontier-apps","mongodb","storage","gateway-sdk"],"description":"SDK for Frontier Apps — database, storage, and Ema API access via frontier-apps-gateway","maintainers":[{"name":"akshat-ema","email":"akshat@ema.co"},{"name":"parth_baghel","email":"parth@ema.co"}],"readme":"# @ema-unlimited/frontier-apps-sdk\n\nSDK for Frontier Apps — provides database, storage, and Ema API access via the\n`frontier-apps-gateway`. Each capability is a separate subpath import so apps\nonly pull in what they use.\n\n> **Status:** v0.x — DB routes (`/v1/db/*`) deployed. Storage routes\n> (`/v1/storage/*`) added in **0.2.0** (currently in `rc` channel; see the\n> `rc` dist-tag). Ema API routes are planned for a future release.\n\n## Why\n\nEvery deployed Frontier App previously talked to MongoDB directly. A single\nrunaway query could saturate the replica set for every app. This SDK forces\nall traffic through the gateway where a safety blocklist, per-app connection\npool, and audit trail live.\n\nApp code only changes its import line — the call surface (Mongoose `Schema`,\n`model()`, query chaining) is preserved.\n\n## Install\n\n```bash\npnpm add @ema-unlimited/frontier-apps-sdk mongoose\n```\n\n`mongoose` is a required peer dependency for the DB subpath. The SDK re-exports\n`mongoose.Schema` and `InferSchemaType` so the migration from a direct\nMongoose connection is a one-line import swap. The SDK never opens a\nMongoDB connection itself — Schema construction is pure JS path-building.\n\nThe package is published to the public npm registry — no auth required:\n\n```bash\nnpm install @ema-unlimited/frontier-apps-sdk\n```\n\n## Subpaths\n\n| Import                                       | Status      | What it does                                                  |\n| -------------------------------------------- | ----------- | ------------------------------------------------------------- |\n| `@ema-unlimited/frontier-apps-sdk`           | Available   | Gateway init (`initGatewayClient`) + base error class         |\n| `@ema-unlimited/frontier-apps-sdk/mongodb`   | Available   | MongoDB-style DB access (full Mongoose surface)               |\n| `@ema-unlimited/frontier-apps-sdk/storage`   | Available   | File storage via V4 signed URLs (`put` / `get` / `list` / …) |\n\n`@ema-unlimited/frontier-apps-sdk/ema` (Ema API proxy) is planned but not yet added.\n\n---\n\n## Root (`@ema-unlimited/frontier-apps-sdk`)\n\nThe root export is gateway infrastructure only — not a capability.\n\n```ts\nimport { initGatewayClient, FrontierError } from '@ema-unlimited/frontier-apps-sdk'\nimport type { GatewayClientConfig } from '@ema-unlimited/frontier-apps-sdk'\n```\n\n### One-time client init\n\n```ts\ninitGatewayClient({\n  gatewayUrl: process.env.FRONTIER_GATEWAY_URL!,  // injected by publisher\n  appId: process.env.APP_ID!,                      // injected by publisher\n})\n```\n\n`APP_ID` is the publisher-provided value: a full UUID for published scope,\n`preview-{shortId}` for preview scope. Call this once at app boot — it wires\nthe shared transport used by all subpaths.\n\n---\n\n## MongoDB (`@ema-unlimited/frontier-apps-sdk/mongodb`)\n\n### Define a schema (mechanical swap from Mongoose)\n\n```ts\n// Before\nimport mongoose, { Schema, type InferSchemaType } from 'mongoose'\n\n// After — only the import line changes\nimport { Schema, model, type InferSchemaType } from '@ema-unlimited/frontier-apps-sdk/mongodb'\n\nconst noteSchema = new Schema(\n  {\n    userId: { type: String, required: true, index: true },\n    title: { type: String, required: true },\n    content: { type: String, default: '' },\n  },\n  { timestamps: true },\n)\n\nexport type NoteDocument = InferSchemaType<typeof noteSchema>\nexport const Note = model<NoteDocument>('Note', noteSchema)\n```\n\n### Query\n\n```ts\nconst notes = await Note.find({ userId }).sort({ createdAt: -1 }).limit(20)\n\nconst note = await Note.findOneAndUpdate(\n  { _id: id, userId },\n  { $set: { title: 'New' } },\n  { new: true },\n)\n\nawait Note.deleteOne({ _id: id, userId })\n```\n\n### Supported operations\n\n| Method                                | Returns                       |\n| ------------------------------------- | ----------------------------- |\n| `find(filter?, options?)`             | `QueryBuilder<T[]>` (thenable) |\n| `findOne(filter)`                     | `QueryBuilder<T \\| null>`     |\n| `findById(id)`                        | `QueryBuilder<T \\| null>`     |\n| `findOneAndUpdate(filter, update, ?)` | `QueryBuilder<T \\| null>`     |\n| `findByIdAndUpdate(id, update, ?)`    | `QueryBuilder<T \\| null>`     |\n| `findOneAndDelete(filter)`            | `QueryBuilder<T \\| null>`     |\n| `findByIdAndDelete(id)`               | `QueryBuilder<T \\| null>`     |\n| `create(doc \\| docs[])`               | `Promise<T \\| T[]>`           |\n| `insertOne(doc)`                      | `Promise<T>`                  |\n| `insertMany(docs[])`                  | `Promise<T[]>`                |\n| `updateOne(filter, update)`           | `Promise<UpdateResult>`       |\n| `updateMany(filter, update)`          | `Promise<UpdateResult>`       |\n| `deleteOne(filter)`                   | `Promise<DeleteResult>`       |\n| `deleteMany(filter)`                  | `Promise<DeleteResult>`       |\n| `countDocuments(filter?)`             | `Promise<number>`             |\n| `distinct(field, filter?)`            | `Promise<unknown[]>`          |\n| `aggregate(pipeline[])`               | `Promise<unknown[]>`          |\n\nThe query chain is lazy — `.sort()`, `.limit()`, `.skip()`, `.lean()` return\nthe same `QueryBuilder` and the HTTP request fires only when `await`ed.\n`.lean()` is a no-op (the gateway always returns plain JSON).\n\n### Blocked at the facade level\n\nThese throw synchronously before any network call:\n\n- `.populate()` → use `aggregate` with `$lookup`\n- `.drop()` / `dropCollection()` → schema management is not exposed\n- `createIndex()` / `dropIndex()` → index management is not exposed\n\nThe gateway additionally blocks `$where`, `$function`, `$accumulator`, `$out`,\n`mapReduce`, and unbounded `find({})` calls. These return HTTP 400, which the\nSDK surfaces as a `FrontierDbError`.\n\n### Error handling\n\n```ts\nimport { FrontierError } from '@ema-unlimited/frontier-apps-sdk'\nimport { FrontierDbError } from '@ema-unlimited/frontier-apps-sdk/mongodb'\n\ntry {\n  await Note.find({})\n} catch (err) {\n  if (err instanceof FrontierDbError) {\n    console.error(err.status, err.code, err.message)\n  }\n  // Or catch any SDK error across subpaths:\n  if (err instanceof FrontierError) { ... }\n}\n```\n\n---\n\n## Storage (`@ema-unlimited/frontier-apps-sdk/storage`)\n\nPer-app file storage backed by GCS. The SDK never touches GCS credentials —\nthe gateway mints short-lived **V4 signed URLs** (5-min PUT, 15-min GET) and\nthe browser/Node client does the actual byte transfer direct to\n`storage.googleapis.com`. The control plane (auth, content-type validation,\nquota, audit) runs at the gateway; the data plane skips it.\n\nStorage is a pure byte store — it never parses your files — so it accepts **any\nwell-formed content type**. There is no upload allow-list to grow. Safety\nagainst active content is enforced at *serve* time: the gateway serves\n`text/html`, `image/svg+xml`, and `*/xml` objects with `Content-Disposition:\nattachment` so they download instead of executing inline on the shared GCS\norigin. (This does not affect `<img>` / `<video>` / `<audio>` embeds — browsers\nignore `Content-Disposition` for subresource loads.)\n\n### Key layout\n\nEvery key the SDK sends is sanitised and prefixed server-side:\n\n```\ntenants/<tenantId>/frontier-apps/<appId>/uploads/<your-key>\n```\n\nTenant + app are resolved from the gateway (per-app K8s secret) — the SDK\ncannot influence them. User-supplied keys must match `[A-Za-z0-9._/-]` and\ncannot start with `/` or contain `..` / NUL.\n\n### High-level upload (handles signing for you)\n\n```ts\nimport { put } from '@ema-unlimited/frontier-apps-sdk/storage'\n\nconst blob = new Blob([fileBytes], { type: 'image/png' })\nconst meta = await put(`users/${userId}/avatar.png`, blob, {\n  contentType: 'image/png',\n})\n// → { key, size, contentType }\n```\n\nUnder the hood `put()` does sign → PUT (direct to GCS) → confirm.\nIf the PUT fails, `confirm-put` is **not** called — no orphan records.\n\n### Browser-direct upload (large files, no Node proxy hop)\n\nWhen the upload comes from a browser, mint the URL server-side and let the\nbrowser do the PUT. The same `Content-Type` + size are pinned into the\nsignature, so the caller can't enlarge or retype the upload after the\ngateway authorizes.\n\n```ts\nimport { signPut, confirmPut } from '@ema-unlimited/frontier-apps-sdk/storage'\n\n// 1. Server side — mint the signed URL.\nconst signed = await signPut(`users/${userId}/big.zip`, {\n  contentType: 'application/zip',\n  size: file.size,\n})\n\n// 2. Browser side — PUT bytes direct to GCS.\nawait fetch(signed.url, {\n  method: 'PUT',\n  headers: signed.requiredHeaders,  // includes Content-Type + X-Goog-Content-Length-Range\n  body: file,\n})\n\n// 3. Server side — record the upload.\nconst meta = await confirmPut(`users/${userId}/big.zip`)\n```\n\n### Read back / list / delete\n\n```ts\nimport { get, getMeta, list, del } from '@ema-unlimited/frontier-apps-sdk/storage'\n\n// Signed GET URL — usable directly in <img src>, <video src>, <a download>.\nconst { url, expiresAt, size, contentType } = await get(`users/${userId}/avatar.png`)\n\n// Metadata only (no signing, no transfer).\nconst meta = await getMeta(`users/${userId}/avatar.png`)\n\n// Paginated list scoped to the app's prefix.\nconst { items, nextCursor } = await list(`users/${userId}/`, { limit: 50 })\n\n// Idempotent delete.\nawait del(`users/${userId}/avatar.png`)\n```\n\n### Constraints (server-enforced)\n\n| Limit            | Default                                                                                |\n| ---------------- | -------------------------------------------------------------------------------------- |\n| Per-object size  | 1 GiB                                                                                  |\n| Signed PUT TTL   | 5 minutes                                                                              |\n| Signed GET TTL   | 15 minutes                                                                             |\n| Content types    | Any well-formed `type/subtype` accepted. Active types (`text/html`, `image/svg+xml`, `*/xml`) are served as downloads. |\n| Key charset      | `[A-Za-z0-9._/-]` — no `..`, no leading `/`, no NUL                                    |\n\n### Error handling\n\n```ts\nimport { FrontierStorageError } from '@ema-unlimited/frontier-apps-sdk/storage'\n\ntry {\n  await put('uploads/x.pdf', blob, { contentType: 'application/pdf' })\n} catch (err) {\n  if (err instanceof FrontierStorageError) {\n    console.error(err.status, err.code, err.message)\n    // err.status: HTTP status (e.g. 422 for a denied/invalid content-type or oversize)\n    // err.code:   the gateway error code (e.g. \"VALIDATION_ERROR\") or a client\n    //             classifier (\"network_error\" | \"gcs_put_failed\" | \"timeout\" | \"aborted\")\n  }\n}\n```\n\n### Where things land in GCS\n\n```\ngs://<project-id>-frontier-apps-uploads/\n  tenants/\n    <tenantId>/\n      frontier-apps/\n        <appId>/\n          uploads/\n            users/<userId>/avatar.png           ← written by the storage SDK\n            users/<userId>/reports/2026-Q1.pdf\n```\n\nThe bucket is dedicated to per-app user uploads — separate from the\nshared `<env>-emu-blobs` bucket where `frontier-apps-builder` keeps its\ngit snapshots. Per-tenant offboarding is a single\n`gsutil -m rm -r gs://<bucket>/tenants/<tenantId>/` against this bucket.\n\n---\n\n## Development\n\n```bash\npnpm install\npnpm typecheck\npnpm test\npnpm build\n```\n\n## Design\n\nSee [`docs/design-frontier-apps-db-proxy.md`](../../../../docs/design-frontier-apps-db-proxy.md).\n","readmeFilename":"README.md"}