diff --git a/handlers/admin-get/tables.js b/handlers/admin-get/tables.js index e7a89b93..1c2f6624 100644 --- a/handlers/admin-get/tables.js +++ b/handlers/admin-get/tables.js @@ -1,5 +1,5 @@ +import { getSolidIconClasses } from '@cityssm/font-awesome-v5-iconclasses'; import { getLotOccupantTypes, getLotStatuses, getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js'; -import { getSolidIconClasses } from '../../helpers/functions.icons.js'; export async function handler(_request, response) { const workOrderTypes = await getWorkOrderTypes(); const workOrderMilestoneTypes = await getWorkOrderMilestoneTypes(); diff --git a/handlers/admin-get/tables.ts b/handlers/admin-get/tables.ts index 9898c9c7..4a7c6a87 100644 --- a/handlers/admin-get/tables.ts +++ b/handlers/admin-get/tables.ts @@ -1,3 +1,4 @@ +import { getSolidIconClasses } from '@cityssm/font-awesome-v5-iconclasses' import type { Request, Response } from 'express' import { @@ -6,7 +7,6 @@ import { getWorkOrderMilestoneTypes, getWorkOrderTypes } from '../../helpers/functions.cache.js' -import { getSolidIconClasses } from '../../helpers/functions.icons.js' export async function handler(_request: Request, response: Response): Promise { const workOrderTypes = await getWorkOrderTypes() diff --git a/helpers/functions.icons.d.ts b/helpers/functions.icons.d.ts deleted file mode 100644 index dd42519a..00000000 --- a/helpers/functions.icons.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getSolidIconClasses(): Promise; diff --git a/helpers/functions.icons.js b/helpers/functions.icons.js deleted file mode 100644 index 5cdfa37f..00000000 --- a/helpers/functions.icons.js +++ /dev/null @@ -1,15 +0,0 @@ -import faIcons from 'font-awesome-v5-icons'; -let solidIcons = []; -export async function getSolidIconClasses() { - if (solidIcons.length === 0) { - const allIcons = await faIcons.getListByKeys(['name', 'styles']); - const list = []; - for (const icon of allIcons) { - if ((icon.styles ?? []).includes('solid')) { - list.push(icon.name); - } - } - solidIcons = list; - } - return solidIcons; -} diff --git a/helpers/functions.icons.ts b/helpers/functions.icons.ts deleted file mode 100644 index d336dd97..00000000 --- a/helpers/functions.icons.ts +++ /dev/null @@ -1,21 +0,0 @@ -import faIcons from 'font-awesome-v5-icons' - -let solidIcons: string[] = [] - -export async function getSolidIconClasses(): Promise { - if (solidIcons.length === 0) { - const allIcons = await faIcons.getListByKeys(['name', 'styles']) - - const list: string[] = [] - - for (const icon of allIcons) { - if ((icon.styles ?? []).includes('solid')) { - list.push(icon.name!) - } - } - - solidIcons = list - } - - return solidIcons -} diff --git a/package-lock.json b/package-lock.json index cf303168..9b2255bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@cityssm/date-diff": "^2.2.3", "@cityssm/dynamics-gp": "^1.0.3", "@cityssm/expressjs-server-js": "^2.3.3", + "@cityssm/font-awesome-v5-iconclasses": "^0.1.0", "@cityssm/ntfy-publish": "^1.0.1", "@cityssm/pdf-puppeteer": "^4.2.0", "@cityssm/utils-datetime": "^1.2.0", @@ -34,7 +35,6 @@ "express": "^4.19.2", "express-rate-limit": "^7.3.1", "express-session": "^1.18.0", - "font-awesome-v5-icons": "^1.3.0", "http-errors": "^2.0.0", "ical-generator": "^7.1.0", "leaflet": "^1.9.4", @@ -93,7 +93,7 @@ "sass": "^1.77.6" }, "engines": { - "node": "^14.13.1 || >=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -515,6 +515,17 @@ "integrity": "sha512-lHddtgbHA26+xgKBBgVQl6japGah2M+L+5z+lRuEV/P76DBSI2fifuCukUhX6k7Rvbiw+qkDSPPxwKJGggr+BA==", "dev": true }, + "node_modules/@cityssm/font-awesome-v5-iconclasses": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@cityssm/font-awesome-v5-iconclasses/-/font-awesome-v5-iconclasses-0.1.0.tgz", + "integrity": "sha512-eUv2+hrYv7P2XmPTTg8WPxAr7J1yucOq+SgIklEdSVIjHXCB0RhxRTuzlr1gKJ2y+4NyPJdkQzOLl9g4chkrPA==", + "dependencies": { + "font-awesome-v5-icons": "^1.3.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + } + }, "node_modules/@cityssm/mssql-multi-pool": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/@cityssm/mssql-multi-pool/-/mssql-multi-pool-3.1.5.tgz", @@ -1266,9 +1277,9 @@ } }, "node_modules/@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" }, "node_modules/@types/http-errors": { "version": "2.0.4", @@ -1406,9 +1417,9 @@ "dev": true }, "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", "dependencies": { "@types/node": "*" } @@ -2765,9 +2776,9 @@ } }, "node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dependencies": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", diff --git a/package.json b/package.json index b63e9bd0..46a94f85 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@cityssm/date-diff": "^2.2.3", "@cityssm/dynamics-gp": "^1.0.3", "@cityssm/expressjs-server-js": "^2.3.3", + "@cityssm/font-awesome-v5-iconclasses": "^0.1.0", "@cityssm/ntfy-publish": "^1.0.1", "@cityssm/pdf-puppeteer": "^4.2.0", "@cityssm/utils-datetime": "^1.2.0", @@ -58,7 +59,6 @@ "express": "^4.19.2", "express-rate-limit": "^7.3.1", "express-session": "^1.18.0", - "font-awesome-v5-icons": "^1.3.0", "http-errors": "^2.0.0", "ical-generator": "^7.1.0", "leaflet": "^1.9.4",