@junobuild/errors 0.0.2 → 0.0.4

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.
@@ -0,0 +1,2 @@
1
+ var _="juno.error.no_timestamp_provided",o="juno.error.timestamp_outdated_or_future",r="juno.error.no_version_provided",R="juno.error.version_outdated_or_future",t="juno.datastore.error.cannot_write",e="juno.datastore.error.cannot_read",O="juno.storage.error.upload_not_allowed",n="juno.storage.error.set_not_allowed",E="juno.storage.error.cannot_commit_batch",a="juno.storage.error.asset_not_found",A="juno.storage.error.cannot_read_asset",T="juno.auth.error.not_admin_controller",s="juno.auth.error.invalid_origin",N="juno.auth.error.not_controller",u="juno.datastore.error.user.cannot_update",U="juno.datastore.error.user.invalid_data",c="juno.datastore.error.user.caller_key",d="juno.datastore.error.user.key_no_principal",D="juno.datastore.error.user.not_allowed",S="juno.datastore.error.user.usage.change_limit_reached",p="juno.datastore.error.user.usage.invalid_data";export{_ as a,o as b,r as c,R as d,t as e,e as f,O as g,n as h,E as i,a as j,A as k,T as l,s as m,N as n,u as o,U as p,c as q,d as r,D as s,S as t,p as u};
2
+ //# sourceMappingURL=chunk-HBR62ILL.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants.ts"],
4
- "sourcesContent": ["export const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = 'juno.error.no_timestamp_provided';\nexport const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = 'juno.error.timestamp_outdated_or_future';\nexport const JUNO_ERROR_NO_VERSION_PROVIDED = 'juno.error.no_version_provided';\nexport const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = 'juno.error.version_outdated_or_future';\n\nexport const JUNO_DATASTORE_ERROR_CANNOT_WRITE = 'juno.datastore.error.cannot_write';\nexport const JUNO_DATASTORE_ERROR_CANNOT_READ = 'juno.datastore.error.cannot_read';\n\nexport const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = 'juno.storage.error.upload_not_allowed';\nexport const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = 'juno.storage.error.set_not_allowed';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = 'juno.storage.error.cannot_commit_batch';\nexport const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = 'juno.storage.error.asset_not_found';\nexport const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = 'juno.storage.error.cannot_read_asset';\n\nexport const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = 'juno.auth.error.not_admin_controller';\nexport const JUNO_AUTH_ERROR_INVALID_ORIGIN = 'juno.auth.error.invalid_origin';\nexport const JUNO_AUTH_ERROR_NOT_CONTROLLER = 'juno.auth.error.not_controller';\n\nexport const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = 'juno.datastore.error.user.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = 'juno.datastore.error.user.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = 'juno.datastore.error.user.caller_key';\nexport const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL =\n 'juno.datastore.error.user.key_no_principal';\nexport const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = 'juno.datastore.error.user.not_allowed';\n"],
5
- "mappings": "AAAO,IAAMA,EAAmC,mCACnCC,EAA0C,0CAC1CC,EAAiC,iCACjCC,EAAwC,wCAExCC,EAAoC,oCACpCC,EAAmC,mCAEnCC,EAAwC,wCACxCC,EAAqC,qCACrCC,EAAyC,yCACzCC,EAAqC,qCACrCC,EAAuC,uCAEvCC,EAAuC,uCACvCC,EAAiC,iCACjCC,EAAiC,iCAEjCC,EAA0C,0CAC1CC,EAAyC,yCACzCC,EAAuC,uCACvCC,EACX,6CACWC,EAAwC",
6
- "names": ["JUNO_ERROR_NO_TIMESTAMP_PROVIDED", "JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE", "JUNO_ERROR_NO_VERSION_PROVIDED", "JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE", "JUNO_DATASTORE_ERROR_CANNOT_WRITE", "JUNO_DATASTORE_ERROR_CANNOT_READ", "JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED", "JUNO_STORAGE_ERROR_SET_NOT_ALLOWED", "JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH", "JUNO_STORAGE_ERROR_ASSET_NOT_FOUND", "JUNO_STORAGE_ERROR_CANNOT_READ_ASSET", "JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER", "JUNO_AUTH_ERROR_INVALID_ORIGIN", "JUNO_AUTH_ERROR_NOT_CONTROLLER", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "JUNO_DATASTORE_ERROR_USER_INVALID_DATA", "JUNO_DATASTORE_ERROR_USER_CALLER_KEY", "JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL", "JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED"]
4
+ "sourcesContent": ["export const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = 'juno.error.no_timestamp_provided';\nexport const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = 'juno.error.timestamp_outdated_or_future';\nexport const JUNO_ERROR_NO_VERSION_PROVIDED = 'juno.error.no_version_provided';\nexport const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = 'juno.error.version_outdated_or_future';\n\nexport const JUNO_DATASTORE_ERROR_CANNOT_WRITE = 'juno.datastore.error.cannot_write';\nexport const JUNO_DATASTORE_ERROR_CANNOT_READ = 'juno.datastore.error.cannot_read';\n\nexport const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = 'juno.storage.error.upload_not_allowed';\nexport const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = 'juno.storage.error.set_not_allowed';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = 'juno.storage.error.cannot_commit_batch';\nexport const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = 'juno.storage.error.asset_not_found';\nexport const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = 'juno.storage.error.cannot_read_asset';\n\nexport const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = 'juno.auth.error.not_admin_controller';\nexport const JUNO_AUTH_ERROR_INVALID_ORIGIN = 'juno.auth.error.invalid_origin';\nexport const JUNO_AUTH_ERROR_NOT_CONTROLLER = 'juno.auth.error.not_controller';\n\nexport const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = 'juno.datastore.error.user.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = 'juno.datastore.error.user.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = 'juno.datastore.error.user.caller_key';\nexport const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL =\n 'juno.datastore.error.user.key_no_principal';\nexport const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = 'juno.datastore.error.user.not_allowed';\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED =\n 'juno.datastore.error.user.usage.change_limit_reached';\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA =\n 'juno.datastore.error.user.usage.invalid_data';\n"],
5
+ "mappings": "AAAO,IAAMA,EAAmC,mCACnCC,EAA0C,0CAC1CC,EAAiC,iCACjCC,EAAwC,wCAExCC,EAAoC,oCACpCC,EAAmC,mCAEnCC,EAAwC,wCACxCC,EAAqC,qCACrCC,EAAyC,yCACzCC,EAAqC,qCACrCC,EAAuC,uCAEvCC,EAAuC,uCACvCC,EAAiC,iCACjCC,EAAiC,iCAEjCC,EAA0C,0CAC1CC,EAAyC,yCACzCC,EAAuC,uCACvCC,EACX,6CACWC,EAAwC,wCACxCC,EACX,uDACWC,EACX",
6
+ "names": ["JUNO_ERROR_NO_TIMESTAMP_PROVIDED", "JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE", "JUNO_ERROR_NO_VERSION_PROVIDED", "JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE", "JUNO_DATASTORE_ERROR_CANNOT_WRITE", "JUNO_DATASTORE_ERROR_CANNOT_READ", "JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED", "JUNO_STORAGE_ERROR_SET_NOT_ALLOWED", "JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH", "JUNO_STORAGE_ERROR_ASSET_NOT_FOUND", "JUNO_STORAGE_ERROR_CANNOT_READ_ASSET", "JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER", "JUNO_AUTH_ERROR_INVALID_ORIGIN", "JUNO_AUTH_ERROR_NOT_CONTROLLER", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "JUNO_DATASTORE_ERROR_USER_INVALID_DATA", "JUNO_DATASTORE_ERROR_USER_CALLER_KEY", "JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL", "JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED", "JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED", "JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"./chunk-YKABDFBB.js";export{m as JUNO_AUTH_ERROR_INVALID_ORIGIN,l as JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER,n as JUNO_AUTH_ERROR_NOT_CONTROLLER,f as JUNO_DATASTORE_ERROR_CANNOT_READ,e as JUNO_DATASTORE_ERROR_CANNOT_WRITE,q as JUNO_DATASTORE_ERROR_USER_CALLER_KEY,o as JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE,p as JUNO_DATASTORE_ERROR_USER_INVALID_DATA,r as JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL,s as JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED,a as JUNO_ERROR_NO_TIMESTAMP_PROVIDED,c as JUNO_ERROR_NO_VERSION_PROVIDED,b as JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE,d as JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE,j as JUNO_STORAGE_ERROR_ASSET_NOT_FOUND,i as JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH,k as JUNO_STORAGE_ERROR_CANNOT_READ_ASSET,h as JUNO_STORAGE_ERROR_SET_NOT_ALLOWED,g as JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-HBR62ILL.js";export{m as JUNO_AUTH_ERROR_INVALID_ORIGIN,l as JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER,n as JUNO_AUTH_ERROR_NOT_CONTROLLER,f as JUNO_DATASTORE_ERROR_CANNOT_READ,e as JUNO_DATASTORE_ERROR_CANNOT_WRITE,q as JUNO_DATASTORE_ERROR_USER_CALLER_KEY,o as JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE,p as JUNO_DATASTORE_ERROR_USER_INVALID_DATA,r as JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL,s as JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED,t as JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED,u as JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA,a as JUNO_ERROR_NO_TIMESTAMP_PROVIDED,c as JUNO_ERROR_NO_VERSION_PROVIDED,b as JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE,d as JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE,j as JUNO_STORAGE_ERROR_ASSET_NOT_FOUND,i as JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH,k as JUNO_STORAGE_ERROR_CANNOT_READ_ASSET,h as JUNO_STORAGE_ERROR_SET_NOT_ALLOWED,g as JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1,2 +1,2 @@
1
- import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n}from"./chunk-YKABDFBB.js";import{a as q}from"./chunk-VSLSQUON.js";export{g as JUNO_AUTH_ERROR_INVALID_ORIGIN,d as JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER,h as JUNO_AUTH_ERROR_NOT_CONTROLLER,p as JUNO_DATASTORE_ERROR_CANNOT_READ,m as JUNO_DATASTORE_ERROR_CANNOT_WRITE,k as JUNO_DATASTORE_ERROR_USER_CALLER_KEY,i as JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE,j as JUNO_DATASTORE_ERROR_USER_INVALID_DATA,l as JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL,n as JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED,o as JUNO_ERROR_NO_TIMESTAMP_PROVIDED,e as JUNO_ERROR_NO_VERSION_PROVIDED,r as JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE,f as JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE,b as JUNO_STORAGE_ERROR_ASSET_NOT_FOUND,a as JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH,c as JUNO_STORAGE_ERROR_CANNOT_READ_ASSET,x as JUNO_STORAGE_ERROR_SET_NOT_ALLOWED,t as JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED,q as isSatelliteError};
1
+ import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s}from"./chunk-HBR62ILL.js";import{a as u}from"./chunk-VSLSQUON.js";export{g as JUNO_AUTH_ERROR_INVALID_ORIGIN,d as JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER,h as JUNO_AUTH_ERROR_NOT_CONTROLLER,p as JUNO_DATASTORE_ERROR_CANNOT_READ,m as JUNO_DATASTORE_ERROR_CANNOT_WRITE,k as JUNO_DATASTORE_ERROR_USER_CALLER_KEY,i as JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE,j as JUNO_DATASTORE_ERROR_USER_INVALID_DATA,l as JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL,n as JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED,q as JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED,s as JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA,o as JUNO_ERROR_NO_TIMESTAMP_PROVIDED,e as JUNO_ERROR_NO_VERSION_PROVIDED,r as JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE,f as JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE,b as JUNO_STORAGE_ERROR_ASSET_NOT_FOUND,a as JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH,c as JUNO_STORAGE_ERROR_CANNOT_READ_ASSET,x as JUNO_STORAGE_ERROR_SET_NOT_ALLOWED,t as JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED,u as isSatelliteError};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
1
  import { createRequire as topLevelCreateRequire } from 'module';
2
2
  const require = topLevelCreateRequire(import.meta.url);
3
- var _="juno.error.no_timestamp_provided",t="juno.error.timestamp_outdated_or_future",e="juno.error.no_version_provided",R="juno.error.version_outdated_or_future",O="juno.datastore.error.cannot_write",n="juno.datastore.error.cannot_read",E="juno.storage.error.upload_not_allowed",s="juno.storage.error.set_not_allowed",a="juno.storage.error.cannot_commit_batch",T="juno.storage.error.asset_not_found",A="juno.storage.error.cannot_read_asset",N="juno.auth.error.not_admin_controller",u="juno.auth.error.invalid_origin",U="juno.auth.error.not_controller",c="juno.datastore.error.user.cannot_update",p="juno.datastore.error.user.invalid_data",d="juno.datastore.error.user.caller_key",D="juno.datastore.error.user.key_no_principal",S="juno.datastore.error.user.not_allowed";var l=({error:o,type:r})=>typeof o=="string"?o.includes(r):o instanceof Error?o.message.includes(r):!1;export{u as JUNO_AUTH_ERROR_INVALID_ORIGIN,N as JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER,U as JUNO_AUTH_ERROR_NOT_CONTROLLER,n as JUNO_DATASTORE_ERROR_CANNOT_READ,O as JUNO_DATASTORE_ERROR_CANNOT_WRITE,d as JUNO_DATASTORE_ERROR_USER_CALLER_KEY,c as JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE,p as JUNO_DATASTORE_ERROR_USER_INVALID_DATA,D as JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL,S as JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED,_ as JUNO_ERROR_NO_TIMESTAMP_PROVIDED,e as JUNO_ERROR_NO_VERSION_PROVIDED,t as JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE,R as JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE,T as JUNO_STORAGE_ERROR_ASSET_NOT_FOUND,a as JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH,A as JUNO_STORAGE_ERROR_CANNOT_READ_ASSET,s as JUNO_STORAGE_ERROR_SET_NOT_ALLOWED,E as JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED,l as isSatelliteError};
3
+ var r="juno.error.no_timestamp_provided",t="juno.error.timestamp_outdated_or_future",e="juno.error.no_version_provided",R="juno.error.version_outdated_or_future",O="juno.datastore.error.cannot_write",n="juno.datastore.error.cannot_read",E="juno.storage.error.upload_not_allowed",a="juno.storage.error.set_not_allowed",s="juno.storage.error.cannot_commit_batch",A="juno.storage.error.asset_not_found",T="juno.storage.error.cannot_read_asset",N="juno.auth.error.not_admin_controller",u="juno.auth.error.invalid_origin",U="juno.auth.error.not_controller",c="juno.datastore.error.user.cannot_update",d="juno.datastore.error.user.invalid_data",p="juno.datastore.error.user.caller_key",S="juno.datastore.error.user.key_no_principal",D="juno.datastore.error.user.not_allowed",i="juno.datastore.error.user.usage.change_limit_reached",l="juno.datastore.error.user.usage.invalid_data";var j=({error:o,type:_})=>typeof o=="string"?o.includes(_):o instanceof Error?o.message.includes(_):!1;export{u as JUNO_AUTH_ERROR_INVALID_ORIGIN,N as JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER,U as JUNO_AUTH_ERROR_NOT_CONTROLLER,n as JUNO_DATASTORE_ERROR_CANNOT_READ,O as JUNO_DATASTORE_ERROR_CANNOT_WRITE,p as JUNO_DATASTORE_ERROR_USER_CALLER_KEY,c as JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE,d as JUNO_DATASTORE_ERROR_USER_INVALID_DATA,S as JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL,D as JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED,i as JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED,l as JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA,r as JUNO_ERROR_NO_TIMESTAMP_PROVIDED,e as JUNO_ERROR_NO_VERSION_PROVIDED,t as JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE,R as JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE,A as JUNO_STORAGE_ERROR_ASSET_NOT_FOUND,s as JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH,T as JUNO_STORAGE_ERROR_CANNOT_READ_ASSET,a as JUNO_STORAGE_ERROR_SET_NOT_ALLOWED,E as JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED,j as isSatelliteError};
4
4
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants.ts", "../../src/utils.ts"],
4
- "sourcesContent": ["export const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = 'juno.error.no_timestamp_provided';\nexport const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = 'juno.error.timestamp_outdated_or_future';\nexport const JUNO_ERROR_NO_VERSION_PROVIDED = 'juno.error.no_version_provided';\nexport const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = 'juno.error.version_outdated_or_future';\n\nexport const JUNO_DATASTORE_ERROR_CANNOT_WRITE = 'juno.datastore.error.cannot_write';\nexport const JUNO_DATASTORE_ERROR_CANNOT_READ = 'juno.datastore.error.cannot_read';\n\nexport const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = 'juno.storage.error.upload_not_allowed';\nexport const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = 'juno.storage.error.set_not_allowed';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = 'juno.storage.error.cannot_commit_batch';\nexport const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = 'juno.storage.error.asset_not_found';\nexport const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = 'juno.storage.error.cannot_read_asset';\n\nexport const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = 'juno.auth.error.not_admin_controller';\nexport const JUNO_AUTH_ERROR_INVALID_ORIGIN = 'juno.auth.error.invalid_origin';\nexport const JUNO_AUTH_ERROR_NOT_CONTROLLER = 'juno.auth.error.not_controller';\n\nexport const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = 'juno.datastore.error.user.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = 'juno.datastore.error.user.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = 'juno.datastore.error.user.caller_key';\nexport const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL =\n 'juno.datastore.error.user.key_no_principal';\nexport const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = 'juno.datastore.error.user.not_allowed';\n", "export const isSatelliteError = ({error, type}: {error: unknown; type: string}): boolean => {\n if (typeof error === 'string') {\n return error.includes(type);\n }\n\n if (error instanceof Error) {\n return error.message.includes(type);\n }\n\n return false;\n};\n"],
5
- "mappings": ";;AAAO,IAAMA,EAAmC,mCACnCC,EAA0C,0CAC1CC,EAAiC,iCACjCC,EAAwC,wCAExCC,EAAoC,oCACpCC,EAAmC,mCAEnCC,EAAwC,wCACxCC,EAAqC,qCACrCC,EAAyC,yCACzCC,EAAqC,qCACrCC,EAAuC,uCAEvCC,EAAuC,uCACvCC,EAAiC,iCACjCC,EAAiC,iCAEjCC,EAA0C,0CAC1CC,EAAyC,yCACzCC,EAAuC,uCACvCC,EACX,6CACWC,EAAwC,wCCvB9C,IAAMC,EAAmB,CAAC,CAAC,MAAAC,EAAO,KAAAC,CAAI,IACvC,OAAOD,GAAU,SACZA,EAAM,SAASC,CAAI,EAGxBD,aAAiB,MACZA,EAAM,QAAQ,SAASC,CAAI,EAG7B",
6
- "names": ["JUNO_ERROR_NO_TIMESTAMP_PROVIDED", "JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE", "JUNO_ERROR_NO_VERSION_PROVIDED", "JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE", "JUNO_DATASTORE_ERROR_CANNOT_WRITE", "JUNO_DATASTORE_ERROR_CANNOT_READ", "JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED", "JUNO_STORAGE_ERROR_SET_NOT_ALLOWED", "JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH", "JUNO_STORAGE_ERROR_ASSET_NOT_FOUND", "JUNO_STORAGE_ERROR_CANNOT_READ_ASSET", "JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER", "JUNO_AUTH_ERROR_INVALID_ORIGIN", "JUNO_AUTH_ERROR_NOT_CONTROLLER", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "JUNO_DATASTORE_ERROR_USER_INVALID_DATA", "JUNO_DATASTORE_ERROR_USER_CALLER_KEY", "JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL", "JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED", "isSatelliteError", "error", "type"]
4
+ "sourcesContent": ["export const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = 'juno.error.no_timestamp_provided';\nexport const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = 'juno.error.timestamp_outdated_or_future';\nexport const JUNO_ERROR_NO_VERSION_PROVIDED = 'juno.error.no_version_provided';\nexport const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = 'juno.error.version_outdated_or_future';\n\nexport const JUNO_DATASTORE_ERROR_CANNOT_WRITE = 'juno.datastore.error.cannot_write';\nexport const JUNO_DATASTORE_ERROR_CANNOT_READ = 'juno.datastore.error.cannot_read';\n\nexport const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = 'juno.storage.error.upload_not_allowed';\nexport const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = 'juno.storage.error.set_not_allowed';\nexport const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = 'juno.storage.error.cannot_commit_batch';\nexport const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = 'juno.storage.error.asset_not_found';\nexport const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = 'juno.storage.error.cannot_read_asset';\n\nexport const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = 'juno.auth.error.not_admin_controller';\nexport const JUNO_AUTH_ERROR_INVALID_ORIGIN = 'juno.auth.error.invalid_origin';\nexport const JUNO_AUTH_ERROR_NOT_CONTROLLER = 'juno.auth.error.not_controller';\n\nexport const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = 'juno.datastore.error.user.cannot_update';\nexport const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = 'juno.datastore.error.user.invalid_data';\nexport const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = 'juno.datastore.error.user.caller_key';\nexport const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL =\n 'juno.datastore.error.user.key_no_principal';\nexport const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = 'juno.datastore.error.user.not_allowed';\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED =\n 'juno.datastore.error.user.usage.change_limit_reached';\nexport const JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA =\n 'juno.datastore.error.user.usage.invalid_data';\n", "export const isSatelliteError = ({error, type}: {error: unknown; type: string}): boolean => {\n if (typeof error === 'string') {\n return error.includes(type);\n }\n\n if (error instanceof Error) {\n return error.message.includes(type);\n }\n\n return false;\n};\n"],
5
+ "mappings": ";;AAAO,IAAMA,EAAmC,mCACnCC,EAA0C,0CAC1CC,EAAiC,iCACjCC,EAAwC,wCAExCC,EAAoC,oCACpCC,EAAmC,mCAEnCC,EAAwC,wCACxCC,EAAqC,qCACrCC,EAAyC,yCACzCC,EAAqC,qCACrCC,EAAuC,uCAEvCC,EAAuC,uCACvCC,EAAiC,iCACjCC,EAAiC,iCAEjCC,EAA0C,0CAC1CC,EAAyC,yCACzCC,EAAuC,uCACvCC,EACX,6CACWC,EAAwC,wCACxCC,EACX,uDACWC,EACX,+CC3BK,IAAMC,EAAmB,CAAC,CAAC,MAAAC,EAAO,KAAAC,CAAI,IACvC,OAAOD,GAAU,SACZA,EAAM,SAASC,CAAI,EAGxBD,aAAiB,MACZA,EAAM,QAAQ,SAASC,CAAI,EAG7B",
6
+ "names": ["JUNO_ERROR_NO_TIMESTAMP_PROVIDED", "JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE", "JUNO_ERROR_NO_VERSION_PROVIDED", "JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE", "JUNO_DATASTORE_ERROR_CANNOT_WRITE", "JUNO_DATASTORE_ERROR_CANNOT_READ", "JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED", "JUNO_STORAGE_ERROR_SET_NOT_ALLOWED", "JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH", "JUNO_STORAGE_ERROR_ASSET_NOT_FOUND", "JUNO_STORAGE_ERROR_CANNOT_READ_ASSET", "JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER", "JUNO_AUTH_ERROR_INVALID_ORIGIN", "JUNO_AUTH_ERROR_NOT_CONTROLLER", "JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE", "JUNO_DATASTORE_ERROR_USER_INVALID_DATA", "JUNO_DATASTORE_ERROR_USER_CALLER_KEY", "JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL", "JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED", "JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED", "JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA", "isSatelliteError", "error", "type"]
7
7
  }
@@ -0,0 +1,21 @@
1
+ export declare const JUNO_ERROR_NO_TIMESTAMP_PROVIDED = "juno.error.no_timestamp_provided";
2
+ export declare const JUNO_ERROR_TIMESTAMP_OUTDATED_OR_FUTURE = "juno.error.timestamp_outdated_or_future";
3
+ export declare const JUNO_ERROR_NO_VERSION_PROVIDED = "juno.error.no_version_provided";
4
+ export declare const JUNO_ERROR_VERSION_OUTDATED_OR_FUTURE = "juno.error.version_outdated_or_future";
5
+ export declare const JUNO_DATASTORE_ERROR_CANNOT_WRITE = "juno.datastore.error.cannot_write";
6
+ export declare const JUNO_DATASTORE_ERROR_CANNOT_READ = "juno.datastore.error.cannot_read";
7
+ export declare const JUNO_STORAGE_ERROR_UPLOAD_NOT_ALLOWED = "juno.storage.error.upload_not_allowed";
8
+ export declare const JUNO_STORAGE_ERROR_SET_NOT_ALLOWED = "juno.storage.error.set_not_allowed";
9
+ export declare const JUNO_STORAGE_ERROR_CANNOT_COMMIT_BATCH = "juno.storage.error.cannot_commit_batch";
10
+ export declare const JUNO_STORAGE_ERROR_ASSET_NOT_FOUND = "juno.storage.error.asset_not_found";
11
+ export declare const JUNO_STORAGE_ERROR_CANNOT_READ_ASSET = "juno.storage.error.cannot_read_asset";
12
+ export declare const JUNO_AUTH_ERROR_NOT_ADMIN_CONTROLLER = "juno.auth.error.not_admin_controller";
13
+ export declare const JUNO_AUTH_ERROR_INVALID_ORIGIN = "juno.auth.error.invalid_origin";
14
+ export declare const JUNO_AUTH_ERROR_NOT_CONTROLLER = "juno.auth.error.not_controller";
15
+ export declare const JUNO_DATASTORE_ERROR_USER_CANNOT_UPDATE = "juno.datastore.error.user.cannot_update";
16
+ export declare const JUNO_DATASTORE_ERROR_USER_INVALID_DATA = "juno.datastore.error.user.invalid_data";
17
+ export declare const JUNO_DATASTORE_ERROR_USER_CALLER_KEY = "juno.datastore.error.user.caller_key";
18
+ export declare const JUNO_DATASTORE_ERROR_USER_KEY_NO_PRINCIPAL = "juno.datastore.error.user.key_no_principal";
19
+ export declare const JUNO_DATASTORE_ERROR_USER_NOT_ALLOWED = "juno.datastore.error.user.not_allowed";
20
+ export declare const JUNO_DATASTORE_ERROR_USER_USAGE_CHANGE_LIMIT_REACHED = "juno.datastore.error.user.usage.change_limit_reached";
21
+ export declare const JUNO_DATASTORE_ERROR_USER_USAGE_INVALID_DATA = "juno.datastore.error.user.usage.invalid_data";
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './utils';
@@ -0,0 +1,4 @@
1
+ export declare const isSatelliteError: ({ error, type }: {
2
+ error: unknown;
3
+ type: string;
4
+ }) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/errors",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "A collection of predefined error constants and utilities for Juno applications.",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -27,7 +27,8 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "rmdir": "node ../../scripts/rmdir.mjs",
30
- "build": "npm run rmdir && mkdir -p dist && node esbuild.mjs",
30
+ "ts-declaration": "tsc --emitDeclarationOnly --outDir dist/types",
31
+ "build": "npm run rmdir && mkdir -p dist && node esbuild.mjs && npm run ts-declaration",
31
32
  "prepack": "npm run build"
32
33
  },
33
34
  "repository": {
@@ -1,2 +0,0 @@
1
- var _="juno.error.no_timestamp_provided",o="juno.error.timestamp_outdated_or_future",r="juno.error.no_version_provided",R="juno.error.version_outdated_or_future",t="juno.datastore.error.cannot_write",O="juno.datastore.error.cannot_read",e="juno.storage.error.upload_not_allowed",n="juno.storage.error.set_not_allowed",E="juno.storage.error.cannot_commit_batch",T="juno.storage.error.asset_not_found",a="juno.storage.error.cannot_read_asset",A="juno.auth.error.not_admin_controller",N="juno.auth.error.invalid_origin",s="juno.auth.error.not_controller",u="juno.datastore.error.user.cannot_update",U="juno.datastore.error.user.invalid_data",c="juno.datastore.error.user.caller_key",d="juno.datastore.error.user.key_no_principal",p="juno.datastore.error.user.not_allowed";export{_ as a,o as b,r as c,R as d,t as e,O as f,e as g,n as h,E as i,T as j,a as k,A as l,N as m,s as n,u as o,U as p,c as q,d as r,p as s};
2
- //# sourceMappingURL=chunk-YKABDFBB.js.map