@cybearl/cypack 1.8.13 → 1.8.14

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/frontend.js CHANGED
@@ -1,2 +1,2 @@
1
- async function a(n=false,r="/api/cgas"){return await(await fetch(`${r}/status?markerOnly=${n}`)).json()}var o={status:"disabled",marker:"fallback-marker",timestamp:new Date().toISOString(),version:{raw:"unavailable",formatted:"unavailable"},message:"The CGAS API is not available, please try again later."};function i(n,r){let e=n;for(let[s,t]of Object.entries(r))t==null||t===""||t==="null"||t==="undefined"||(e+=`${e.includes("?")?"&":"?"}${encodeURIComponent(s)}=${encodeURIComponent(t.toString())}`);return e}var u=typeof window<"u"&&window.location.origin?window.location.origin:null;export{i as addParamsToUrl,u as currentUrlOrigin,o as fallbackCGASStatus,a as getCGASStatus};//# sourceMappingURL=frontend.js.map
1
+ async function a(n=false,s="/api/cgas"){return await(await fetch(`${s}/status?markerOnly=${n}`)).json()}var o={status:"disabled",marker:"fallback-marker",timestamp:new Date().toISOString(),version:{raw:"unavailable",formatted:"unavailable"},message:"This API is not available, please try again later."};function i(n,s){let e=n;for(let[r,t]of Object.entries(s))t==null||t===""||t==="null"||t==="undefined"||(e+=`${e.includes("?")?"&":"?"}${encodeURIComponent(r)}=${encodeURIComponent(t.toString())}`);return e}var u=typeof window<"u"&&window.location.origin?window.location.origin:null;export{i as addParamsToUrl,u as currentUrlOrigin,o as fallbackCGASStatus,a as getCGASStatus};//# sourceMappingURL=frontend.js.map
2
2
  //# sourceMappingURL=frontend.js.map
package/frontend.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/frontend/cgas/status.ts","../src/frontend/urls.ts"],"names":["getCGASStatus","markerOnly","baseUrl","fallbackCGASStatus","addParamsToUrl","params","url","key","value","currentUrlOrigin"],"mappings":"AAWA,eAAsBA,CAAAA,CACrBC,EAAa,KAAA,CACbC,CAAAA,CAAU,YACoC,CAG9C,OADe,MADE,MAAM,KAAA,CAAM,GAAGA,CAAO,CAAA,mBAAA,EAAsBD,CAAU,CAAA,CAAE,CAAA,EAC3C,MAE/B,CAKO,IAAME,CAAAA,CAAiC,CAC7C,MAAA,CAAQ,WACR,MAAA,CAAQ,iBAAA,CACR,UAAW,IAAI,IAAA,GAAO,WAAA,EAAY,CAClC,OAAA,CAAS,CACR,GAAA,CAAK,aAAA,CACL,UAAW,aACZ,CAAA,CACA,QAAS,wDACV,EC1BO,SAASC,CAAAA,CACfF,CAAAA,CACAG,CAAAA,CAGC,CACD,IAAIC,CAAAA,CAAMJ,EAEV,IAAA,GAAW,CAACK,EAAKC,CAAK,CAAA,GAAK,OAAO,OAAA,CAAQH,CAAM,CAAA,CACpBG,CAAAA,EAAU,IAAA,EAAQA,CAAAA,GAAU,IAAMA,CAAAA,GAAU,MAAA,EAAUA,IAAU,WAAA,GAI3FF,CAAAA,EAAO,GAAGA,CAAAA,CAAI,QAAA,CAAS,GAAG,CAAA,CAAI,GAAA,CAAM,GAAG,GAAG,kBAAA,CAAmBC,CAAG,CAAC,CAAA,CAAA,EAAI,kBAAA,CAAmBC,EAAM,QAAA,EAAU,CAAC,CAAA,CAAA,CAAA,CAG1G,OAAOF,CACR,CAKO,IAAMG,CAAAA,CAAmB,OAAO,MAAA,CAAW,GAAA,EAAe,OAAO,QAAA,CAAS,MAAA,CAAS,MAAA,CAAO,QAAA,CAAS,MAAA,CAAS","file":"frontend.js","sourcesContent":["import type { CGASStatus } from \"@/main/types/cgas\"\nimport type { RequestResult } from \"@/main/types/requests\"\n\n/**\n * Get the status of the application via the CGAS API endpoint (that itself uses the `getCGASStatus` function).\n * @param markerOnly Whether to only return the marker (optional, defaults to false).\n * @param baseUrl The base URL of the CGAS API (optional, defaults to \"/api/cgas\").\n * @returns The status of the application, or the marker if `markerOnly` is true.\n */\nexport async function getCGASStatus(markerOnly: true, baseUrl?: string): Promise<RequestResult<string>>\nexport async function getCGASStatus(markerOnly?: false, baseUrl?: string): Promise<RequestResult<CGASStatus>>\nexport async function getCGASStatus(\n\tmarkerOnly = false,\n\tbaseUrl = \"/api/cgas\",\n): Promise<RequestResult<CGASStatus | string>> {\n\tconst response = await fetch(`${baseUrl}/status?markerOnly=${markerOnly}`)\n\tconst result = await response.json()\n\treturn result as RequestResult<CGASStatus | string>\n}\n\n/**\n * The fallback CGAS status, used when the CGAS API is not available.\n */\nexport const fallbackCGASStatus: CGASStatus = {\n\tstatus: \"disabled\",\n\tmarker: \"fallback-marker\",\n\ttimestamp: new Date().toISOString(),\n\tversion: {\n\t\traw: \"unavailable\",\n\t\tformatted: \"unavailable\",\n\t},\n\tmessage: \"The CGAS API is not available, please try again later.\",\n}\n","/**\n * Allows to add query parameters to a URL.\n * @param baseUrl The base URL to add parameters to.\n * @param params The parameters to add, note that each parameter will be URL-encoded.\n * @returns The URL with the parameters added.\n */\nexport function addParamsToUrl(\n\tbaseUrl: string,\n\tparams: {\n\t\t[key: string]: string | number | boolean | undefined | null\n\t},\n) {\n\tlet url = baseUrl\n\n\tfor (const [key, value] of Object.entries(params)) {\n\t\tif (value === undefined || value === null || value === \"\" || value === \"null\" || value === \"undefined\") {\n\t\t\tcontinue\n\t\t}\n\n\t\turl += `${url.includes(\"?\") ? \"&\" : \"?\"}${encodeURIComponent(key)}=${encodeURIComponent(value.toString())}`\n\t}\n\n\treturn url\n}\n\n/**\n * Get the current URL origin or null if it's not available.\n */\nexport const currentUrlOrigin = typeof window !== \"undefined\" && window.location.origin ? window.location.origin : null\n"]}
1
+ {"version":3,"sources":["../src/frontend/cgas/status.ts","../src/frontend/urls.ts"],"names":["getCGASStatus","markerOnly","baseUrl","fallbackCGASStatus","addParamsToUrl","params","url","key","value","currentUrlOrigin"],"mappings":"AAWA,eAAsBA,CAAAA,CACrBC,EAAa,KAAA,CACbC,CAAAA,CAAU,YACoC,CAG9C,OADe,MADE,MAAM,KAAA,CAAM,GAAGA,CAAO,CAAA,mBAAA,EAAsBD,CAAU,CAAA,CAAE,CAAA,EAC3C,MAE/B,CAKO,IAAME,CAAAA,CAAiC,CAC7C,MAAA,CAAQ,WACR,MAAA,CAAQ,iBAAA,CACR,UAAW,IAAI,IAAA,GAAO,WAAA,EAAY,CAClC,OAAA,CAAS,CACR,GAAA,CAAK,aAAA,CACL,UAAW,aACZ,CAAA,CACA,QAAS,oDACV,EC1BO,SAASC,CAAAA,CACfF,CAAAA,CACAG,CAAAA,CAGC,CACD,IAAIC,CAAAA,CAAMJ,EAEV,IAAA,GAAW,CAACK,EAAKC,CAAK,CAAA,GAAK,OAAO,OAAA,CAAQH,CAAM,CAAA,CACpBG,CAAAA,EAAU,IAAA,EAAQA,CAAAA,GAAU,IAAMA,CAAAA,GAAU,MAAA,EAAUA,IAAU,WAAA,GAI3FF,CAAAA,EAAO,GAAGA,CAAAA,CAAI,QAAA,CAAS,GAAG,CAAA,CAAI,GAAA,CAAM,GAAG,GAAG,kBAAA,CAAmBC,CAAG,CAAC,CAAA,CAAA,EAAI,kBAAA,CAAmBC,EAAM,QAAA,EAAU,CAAC,CAAA,CAAA,CAAA,CAG1G,OAAOF,CACR,CAKO,IAAMG,CAAAA,CAAmB,OAAO,MAAA,CAAW,GAAA,EAAe,OAAO,QAAA,CAAS,MAAA,CAAS,MAAA,CAAO,QAAA,CAAS,MAAA,CAAS","file":"frontend.js","sourcesContent":["import type { CGASStatus } from \"@/main/types/cgas\"\nimport type { RequestResult } from \"@/main/types/requests\"\n\n/**\n * Get the status of the application via the CGAS API endpoint (that itself uses the `getCGASStatus` function).\n * @param markerOnly Whether to only return the marker (optional, defaults to false).\n * @param baseUrl The base URL of the CGAS API (optional, defaults to \"/api/cgas\").\n * @returns The status of the application, or the marker if `markerOnly` is true.\n */\nexport async function getCGASStatus(markerOnly: true, baseUrl?: string): Promise<RequestResult<string>>\nexport async function getCGASStatus(markerOnly?: false, baseUrl?: string): Promise<RequestResult<CGASStatus>>\nexport async function getCGASStatus(\n\tmarkerOnly = false,\n\tbaseUrl = \"/api/cgas\",\n): Promise<RequestResult<CGASStatus | string>> {\n\tconst response = await fetch(`${baseUrl}/status?markerOnly=${markerOnly}`)\n\tconst result = await response.json()\n\treturn result as RequestResult<CGASStatus | string>\n}\n\n/**\n * The fallback CGAS status, used when the CGAS API is not available.\n */\nexport const fallbackCGASStatus: CGASStatus = {\n\tstatus: \"disabled\",\n\tmarker: \"fallback-marker\",\n\ttimestamp: new Date().toISOString(),\n\tversion: {\n\t\traw: \"unavailable\",\n\t\tformatted: \"unavailable\",\n\t},\n\tmessage: \"This API is not available, please try again later.\",\n}\n","/**\n * Allows to add query parameters to a URL.\n * @param baseUrl The base URL to add parameters to.\n * @param params The parameters to add, note that each parameter will be URL-encoded.\n * @returns The URL with the parameters added.\n */\nexport function addParamsToUrl(\n\tbaseUrl: string,\n\tparams: {\n\t\t[key: string]: string | number | boolean | undefined | null\n\t},\n) {\n\tlet url = baseUrl\n\n\tfor (const [key, value] of Object.entries(params)) {\n\t\tif (value === undefined || value === null || value === \"\" || value === \"null\" || value === \"undefined\") {\n\t\t\tcontinue\n\t\t}\n\n\t\turl += `${url.includes(\"?\") ? \"&\" : \"?\"}${encodeURIComponent(key)}=${encodeURIComponent(value.toString())}`\n\t}\n\n\treturn url\n}\n\n/**\n * Get the current URL origin or null if it's not available.\n */\nexport const currentUrlOrigin = typeof window !== \"undefined\" && window.location.origin ? window.location.origin : null\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cybearl/cypack",
3
3
  "productName": "CyPack",
4
- "version": "1.8.13",
4
+ "version": "1.8.14",
5
5
  "description": "A set of general utilities for Cybearl projects.",
6
6
  "author": "Cybearl <contact@cybearl.com> (https://www.cybearl.com/)",
7
7
  "license": "MIT",