app-sdk-util 0.0.14 → 0.0.16
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.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"dayjs";import s from"dayjs/plugin/duration.js";import a from"dayjs/plugin/relativeTime.js";n.extend(s);n.extend(a);function g(e){return n(e).subtract(1,"month").toDate()}function b(e){return n(e).add(1,"month").toDate()}function r(e){return e==="1"||e==="true"}function c(){try{return process.env.NEXT_PUBLIC_VERCEL_ENV==="production"&&r(process.env.NEXT_PUBLIC_CI)}catch{return!1}}function l(){try{return import.meta.env.VITE_VERCEL_ENV==="production"&&r(import.meta.env.VITE_CI)}catch{return!1}}function p(){try{return process.env.DOCKER_ENV==="live"&&r(process.env.CI)}catch{return!1}}function u(){try{return!0}catch{return!1}}var o=c()||l()||p()||u();var m=o?"https://api.app-sdk.dev":"http://localhost:42210",f=o?"https://www.app-sdk.dev":"http://localhost:42211",y=o?"https://console.app-sdk.dev":"http://localhost:42212",L="Bearer ",_=[f,m,y];import{BetterFetchError as d}from"@better-fetch/fetch";function i(e){return!!e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(!("code"in e)||typeof e.code=="string")}function V(e){let t="";return typeof e=="string"?t||=e:e instanceof d?i(e.error)?(t||=e.error.message,t||=e.error.code??""):(t||=e.message,t||=e.statusText,t||=`HTTP ${e.status}`):e instanceof Error?t||=e.message:i(e)&&(t||=e.message,t||=e.code??""),t||="An error occurred.",t}function j(e){console.error(e)}var h={free:{label:"Free",monthlyCredits:100,monthlyPrice:0,annualDiscountMonthlyPrice:0},basic:{label:"Basic",monthlyCredits:1e4,monthlyPrice:30,annualDiscountMonthlyPrice:15},elite:{label:"Elite",monthlyCredits:2e4,monthlyPrice:60,annualDiscountMonthlyPrice:30},ultimate:{label:"Ultimate",monthlyCredits:3e4,monthlyPrice:90,annualDiscountMonthlyPrice:45}},I=Object.keys(h);export{m as apiURL,L as bearerPrefix,j as captureError,y as consoleURL,V as getErrorMessage,b as getNextMonthDate,g as getPreviousMonthDate,o as isLive,h as planDefinitions,I as planKeys,_ as trustedOrigins,f as websiteURL};
|
|
1
|
+
import n from"dayjs";import s from"dayjs/plugin/duration.js";import a from"dayjs/plugin/relativeTime.js";n.extend(s);n.extend(a);function g(e){return n(e).subtract(1,"month").toDate()}function b(e){return n(e).add(1,"month").toDate()}function r(e){return e==="1"||e==="true"}function c(){try{return process.env.NEXT_PUBLIC_VERCEL_ENV==="production"&&r(process.env.NEXT_PUBLIC_CI)}catch{return!1}}function l(){try{return import.meta.env.VITE_VERCEL_ENV==="production"&&r(import.meta.env.VITE_CI)}catch{return!1}}function p(){try{return process.env.DOCKER_ENV==="live"&&r(process.env.CI)}catch{return!1}}function u(){try{return!0}catch{return!1}}var o=c()||l()||p()||u();var m=o?"https://api.app-sdk.dev":"http://localhost:42210",f=o?"https://www.app-sdk.dev":"http://localhost:42211",y=o?"https://console.app-sdk.dev":"http://localhost:42212",L="Bearer ",_=[f,m,y];import{BetterFetchError as d}from"@better-fetch/fetch";function i(e){return!!e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(!("code"in e)||typeof e.code=="string")}function V(e){let t="";return typeof e=="string"?t||=e:e instanceof d?i(e.error)?(t||=e.error.message,t||=e.error.code??""):(t||=e.message,t||=e.statusText,t||=`HTTP ${e.status}`):e instanceof Error?t||=e.message:i(e)&&(t||=e.message,t||=e.code??""),t||="An error occurred.",t}function j(e){console.error(e)}var h={free:{label:"Free",monthlyCredits:100,monthlyPrice:0,annualDiscountMonthlyPrice:0},basic:{label:"Basic",monthlyCredits:1e4,monthlyPrice:30,annualDiscountMonthlyPrice:15},elite:{label:"Elite",monthlyCredits:2e4,monthlyPrice:60,annualDiscountMonthlyPrice:30},ultimate:{label:"Ultimate",monthlyCredits:3e4,monthlyPrice:90,annualDiscountMonthlyPrice:45}},I=Object.keys(h);var M=104857600;export{m as apiURL,L as bearerPrefix,j as captureError,y as consoleURL,V as getErrorMessage,b as getNextMonthDate,g as getPreviousMonthDate,o as isLive,M as maxUploadSize,h as planDefinitions,I as planKeys,_ as trustedOrigins,f as websiteURL};
|