From 2d6a615f188f8550b87a81878fbd645466b3d2b7 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Thu, 14 Dec 2023 13:01:17 -0500 Subject: [PATCH] adding jsdocs --- index.js | 7 +- index.ts | 55 ++++++------ package-lock.json | 215 +++++++++++++++++++++++++++++++--------------- package.json | 6 +- utilities.ts | 5 ++ 5 files changed, 184 insertions(+), 104 deletions(-) diff --git a/index.js b/index.js index d9b48a4..c703645 100644 --- a/index.js +++ b/index.js @@ -33,9 +33,7 @@ export class AvantiApi { } let requestUrl = this.#apiConfiguration.base_api_url + apiEndpoint; if (apiOptions.method === 'get') { - requestUrl += - '?' + - objectToUrlSearchParameters(apiOptions.getParameters ?? {}).toString(); + requestUrl += `?${objectToUrlSearchParameters(apiOptions.getParameters ?? {}).toString()}`; } const fetchOptions = { method: apiOptions.method, @@ -53,7 +51,8 @@ export class AvantiApi { try { const json = (await response.json()) ?? {}; if (typeof json === 'object' && - (Object.hasOwn(json, 'status') || Object.hasOwn(json, 'instance'))) { + (Object.hasOwn(json, 'status') || + Object.hasOwn(json, 'instance'))) { return { success: false, error: json diff --git a/index.ts b/index.ts index 0b4f793..e805169 100644 --- a/index.ts +++ b/index.ts @@ -57,9 +57,9 @@ export class AvantiApi { /** * Requests an API endpoint excluded from the included functions. - * @param apiEndpoint ex. '/v1/Employees' - * @param apiOptions - * @returns + * @param {string} apiEndpoint - ex. '/v1/Employees' + * @param {AvantiApiOptions} apiOptions - API Options + * @returns {Promise>} API Response */ async callApi( apiEndpoint: `/v1/${string}`, @@ -80,9 +80,9 @@ export class AvantiApi { let requestUrl = this.#apiConfiguration.base_api_url + apiEndpoint if (apiOptions.method === 'get') { - requestUrl += - '?' + - objectToUrlSearchParameters(apiOptions.getParameters ?? {}).toString() + requestUrl += `?${objectToUrlSearchParameters( + apiOptions.getParameters ?? {} + ).toString()}` } const fetchOptions: RequestInit = { @@ -106,7 +106,8 @@ export class AvantiApi { if ( typeof json === 'object' && - (Object.hasOwn(json, 'status') || Object.hasOwn(json, 'instance')) + (Object.hasOwn(json as object, 'status') || + Object.hasOwn(json as object, 'instance')) ) { return { success: false, @@ -135,9 +136,9 @@ export class AvantiApi { } /** - * Endpoint: /v1/Employees - * @param parameters - * @returns + * List Employees: /v1/Employees + * @param {GetEmployeesRequest} parameters - Request parameters + * @returns {Promise>} See https://avanti.stoplight.io/docs/avanti-api/62932b8f232fb-list-employees */ async getEmployees( parameters: GetEmployeesRequest @@ -149,9 +150,9 @@ export class AvantiApi { } /** - * Endpoint: /v1/EmployeeJobData - * @param employeeNumber - * @returns + * Get Employee Job Data: /v1/EmployeeJobData + * @param {string} employeeNumber - Employee number + * @returns {Promise>} See https://avanti.stoplight.io/docs/avanti-api/a44b4af6f1abd-get-employee-job-data */ async getEmployeeJobData( employeeNumber: string @@ -165,9 +166,9 @@ export class AvantiApi { } /** - * Endpoint: /v1/PersonalInfo - * @param employeeNumber - * @returns + * Get Employee Personal Info: /v1/PersonalInfo + * @param {string} employeeNumber - Employee number + * @returns {Promise>} See https://avanti.stoplight.io/docs/avanti-api/f851b988b5cf6-get-employee-personal-info */ async getEmployeePersonalInfo( employeeNumber: string @@ -181,11 +182,11 @@ export class AvantiApi { } /** - * Endpoint: /v1/TimeManagement/{viewId}/{templateId} - * @param viewId - * @param templateId - * @param parameters - * @returns + * List Time Entries: /v1/TimeManagement/{viewId}/{templateId} + * @param {string} viewId - View Id + * @param {string} templateId - Template Id + * @param {GetTimeEntriesRequest} parameters - Request parameters + * @returns {Promise>} See https://avanti.stoplight.io/docs/avanti-api/4952dd2917595-list-time-entries */ async getTimeEntries( viewId: string, @@ -199,9 +200,9 @@ export class AvantiApi { } /** - * Endpoint: /v1/TimeManagement/Templates - * @param parameters - * @returns + * List Time Entry Templates: /v1/TimeManagement/Templates + * @param {GetTimeEntryTemplatesRequest} parameters - Request parameters + * @returns {Promise>} See https://avanti.stoplight.io/docs/avanti-api/faa0ddb0eb18d-list-time-entry-templates */ async getTimeEntryTemplates( parameters: GetTimeEntryTemplatesRequest @@ -213,9 +214,9 @@ export class AvantiApi { } /** - * Endpoint: /v1/Reporter/{reportId} - * @param reportId The ID of the report you would like to get the data for. - * @returns + * Get Report Data: /v1/Reporter/{reportId} + * @param {string} reportId - The ID of the report you would like to get the data for. + * @returns {Promise>} See https://avanti.stoplight.io/docs/avanti-api/ed0485a9c98bb-get-report-data */ async getReport(reportId: string): Promise> { return (await this.callApi(`/v1/Reporter/${reportId}`, { diff --git a/package-lock.json b/package-lock.json index dc3fdc4..b50cb35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "@cityssm/avanti-api", - "version": "0.6.0", + "version": "0.6.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cityssm/avanti-api", - "version": "0.6.0", + "version": "0.6.1", "license": "MIT", "devDependencies": { "@types/mocha": "^10.0.6", - "@types/node": "^20.10.3", - "eslint-config-cityssm": "^1.1.3" + "@types/node": "^20.10.4", + "eslint-config-cityssm": "^1.3.0" }, "engines": { "node": ">=18.0.0" @@ -205,6 +205,20 @@ "node": ">=4" } }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.41.0.tgz", + "integrity": "sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==", + "dev": true, + "dependencies": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -353,9 +367,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", - "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", + "version": "20.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", + "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -374,16 +388,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.2.tgz", - "integrity": "sha512-3+9OGAWHhk4O1LlcwLBONbdXsAhLjyCFogJY/cWy2lxdVJ2JrcTF2pTGMaLl2AE7U1l31n8Py4a8bx5DLf/0dQ==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.14.0.tgz", + "integrity": "sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.13.2", - "@typescript-eslint/type-utils": "6.13.2", - "@typescript-eslint/utils": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/type-utils": "6.14.0", + "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -409,15 +423,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.2.tgz", - "integrity": "sha512-MUkcC+7Wt/QOGeVlM8aGGJZy1XV5YKjTpq9jK6r6/iLsGXhBVaGP5N0UYvFsu9BFlSpwY9kMretzdBH01rkRXg==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.14.0.tgz", + "integrity": "sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.13.2", - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/typescript-estree": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4" }, "engines": { @@ -437,13 +451,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.2.tgz", - "integrity": "sha512-CXQA0xo7z6x13FeDYCgBkjWzNqzBn8RXaE3QVQVIUm74fWJLkJkaHmHdKStrxQllGh6Q4eUGyNpMe0b1hMkXFA==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", + "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2" + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -454,13 +468,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.13.2.tgz", - "integrity": "sha512-Qr6ssS1GFongzH2qfnWKkAQmMUyZSyOr0W54nZNU1MDfo+U4Mv3XveeLZzadc/yq8iYhQZHYT+eoXJqnACM1tw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.14.0.tgz", + "integrity": "sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.13.2", - "@typescript-eslint/utils": "6.13.2", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -481,9 +495,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.2.tgz", - "integrity": "sha512-7sxbQ+EMRubQc3wTfTsycgYpSujyVbI1xw+3UMRUcrhSy+pN09y/lWzeKDbvhoqcRbHdc+APLs/PWYi/cisLPg==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", + "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -494,13 +508,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.2.tgz", - "integrity": "sha512-SuD8YLQv6WHnOEtKv8D6HZUzOub855cfPnPMKvdM/Bh1plv1f7Q/0iFUDLKKlxHcEstQnaUU4QZskgQq74t+3w==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", + "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -521,17 +535,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.2.tgz", - "integrity": "sha512-b9Ptq4eAZUym4idijCRzl61oPCwwREcfDI8xGk751Vhzig5fFZR9CyzDz4Sp/nxSLBYxUPyh4QdIDqWykFhNmQ==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz", + "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.13.2", - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/typescript-estree": "6.13.2", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/typescript-estree": "6.14.0", "semver": "^7.5.4" }, "engines": { @@ -546,12 +560,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.2.tgz", - "integrity": "sha512-OGznFs0eAQXJsp+xSd6k/O1UbFi/K/L7WjqeRoFE7vadjAF9y0uppXhYNQNEqygjou782maGClOoZwPqF0Drlw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", + "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", + "@typescript-eslint/types": "6.14.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -635,6 +649,15 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1134,7 +1157,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -1211,19 +1233,21 @@ } }, "node_modules/eslint-config-cityssm": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-1.1.3.tgz", - "integrity": "sha512-mcKhQ/XHfU+47wj/hCToUsdzK9501hxBs3fuTtHCfo39EK652QBVwTiI6B2dhCup0bqplih0FEAQX4QDxnvpmQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-cityssm/-/eslint-config-cityssm-1.3.0.tgz", + "integrity": "sha512-Nw0+niDDqTgIIlglWSjqZyOuqYIA5IeY5YlnGvaSyfEdP+MUVSlqBO3mNiF0oSYByBxsuN3or9r+IF6uxxwROw==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "^6.13.1", - "@typescript-eslint/parser": "^6.13.1", - "eslint-config-standard-with-typescript": "^40.0.0", + "@typescript-eslint/eslint-plugin": "^6.14.0", + "@typescript-eslint/parser": "^6.14.0", + "eslint-config-standard-with-typescript": "^42.0.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.29.0", - "eslint-plugin-n": "^16.3.1", + "eslint-plugin-jsdoc": "^46.9.1", + "eslint-plugin-n": "^16.4.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-regexp": "^2.1.2", + "eslint-plugin-security": "^1.7.1", "eslint-plugin-sonarjs": "^0.23.0", "eslint-plugin-unicorn": "^49.0.0" } @@ -1258,9 +1282,9 @@ } }, "node_modules/eslint-config-standard-with-typescript": { - "version": "40.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-40.0.0.tgz", - "integrity": "sha512-GXUJcwIXiTQaS3H4etv8a1lejVVdZYaxZNz3g7vt6GoJosQqMTurbmSC4FVGyHiGT/d1TjFr3+47A3xsHhsG+Q==", + "version": "42.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-42.0.0.tgz", + "integrity": "sha512-m1/2g/Sicun1uFZOFigJVeOqo9fE7OkMsNtilcpHwdCdcGr21qsGqYiyxYSvvHfJwY7w5OTQH0hxk8sM2N5Ohg==", "dev": true, "dependencies": { "@typescript-eslint/parser": "^6.4.0", @@ -1430,15 +1454,48 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "46.9.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.9.1.tgz", + "integrity": "sha512-11Ox5LCl2wY7gGkp9UOyew70o9qvii1daAH+h/MFobRVRNcy7sVlH+jm0HQdgcvcru6285GvpjpUyoa051j03Q==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.41.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/eslint-plugin-n": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.3.1.tgz", - "integrity": "sha512-w46eDIkxQ2FaTHcey7G40eD+FhTXOdKudDXPUO2n9WNcslze/i/HT2qJ3GXjHngYSGDISIgPNhwGtgoix4zeOw==", + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.4.0.tgz", + "integrity": "sha512-IkqJjGoWYGskVaJA7WQuN8PINIxc0N/Pk/jLeYT4ees6Fo5lAhpwGsYek6gS9tCUxgDC4zJ+OwY2bY/6/9OMKQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "builtins": "^5.0.1", - "eslint-plugin-es-x": "^7.1.0", + "eslint-plugin-es-x": "^7.5.0", "get-tsconfig": "^4.7.0", "ignore": "^5.2.4", "is-builtin-module": "^3.2.1", @@ -1490,6 +1547,15 @@ "eslint": ">=8.44.0" } }, + "node_modules/eslint-plugin-security": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.7.1.tgz", + "integrity": "sha512-sMStceig8AFglhhT2LqlU5r+/fn9OwsA72O5bBuQVTssPCdQAOQzL+oMn/ZcpeUY6KcNfLJArgcrsSULNjYYdQ==", + "dev": true, + "dependencies": { + "safe-regex": "^2.1.1" + } + }, "node_modules/eslint-plugin-sonarjs": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.23.0.tgz", @@ -3150,6 +3216,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", + "dev": true, + "dependencies": { + "regexp-tree": "~0.1.1" + } + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -3449,9 +3524,9 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", @@ -3552,9 +3627,9 @@ } }, "node_modules/typescript": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", - "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "peer": true, "bin": { diff --git a/package.json b/package.json index cb77c87..3a5deb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cityssm/avanti-api", - "version": "0.6.0", + "version": "0.6.1", "type": "module", "engines": { "node": ">=18.0.0" @@ -27,7 +27,7 @@ "homepage": "https://github.com/cityssm/node-avanti-api#readme", "devDependencies": { "@types/mocha": "^10.0.6", - "@types/node": "^20.10.3", - "eslint-config-cityssm": "^1.1.3" + "@types/node": "^20.10.4", + "eslint-config-cityssm": "^1.3.0" } } diff --git a/utilities.ts b/utilities.ts index e2af556..be8a96f 100644 --- a/utilities.ts +++ b/utilities.ts @@ -1,3 +1,8 @@ +/** + * Reformats parameters as an object into a URLSearchParams object. + * @param {Record} object - Parameters as an object. + * @returns {URLSearchParams} Parameters formatted into a URLSearchParams object. + */ export function objectToUrlSearchParameters( object: Record ): URLSearchParams {