diff --git a/.circleci/config.yml b/.circleci/config.yml index ba3618cb6..da8ace764 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ jobs: command: | yarn build yarn test:ci - yarn apidoc:ci + yarn typedoc # Upload results - store_test_results: path: ./reports diff --git a/.eslintrc.json b/.eslintrc.json index 97fd51293..8234b37c5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -44,7 +44,7 @@ {"varsIgnorePattern": "^_", "argsIgnorePattern": "^_"} ], "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-empty-interface": "off", - "tsdoc/syntax": "error" + "tsdoc/syntax": "warn", + "@typescript-eslint/no-empty-interface": "off" } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fcde1275..de1b66be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 1.36.0 [unreleased] +### Features: + +1.[1111](https://github.com/influxdata/influxdb-client-js/pull/1111) Change the document library to Typedocc + ## 1.35.0 [2024-08-15] ### Bug Fixes diff --git a/package.json b/package.json index 9cf38f777..6bfcb609d 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,8 @@ ] }, "scripts": { - "apidoc": "yarn clean && yarn build && yarn apidoc:extract && yarn apidoc:generate", - "apidoc:ci": "yarn apidoc:extract && yarn apidoc:generate", - "apidoc:extract": "yarn workspaces run apidoc:extract && node scripts/fix-extracted-api-files.js", - "apidoc:generate": "api-documenter markdown -i docs -o docs/dist && cp scripts/gh-pages_config.yml docs/dist/_config.yml && node scripts/enhance-doc-index-md.js", - "apidoc:gh-pages": "gh-pages -d docs/dist -m 'Updates [skip CI]'", + "typedoc": "typedoc --skipErrorChecking", + "typedoc:gh-pages": "yarn typedoc && gh-pages -d ./docs -m 'docs: updates documentation [skip CI]' --dotfiles", "preinstall": "node ./scripts/require-yarn.js", "clean": "rimraf temp docs && yarn workspaces run clean", "build": "yarn workspaces run build", @@ -39,11 +36,11 @@ }, "license": "MIT", "devDependencies": { - "@microsoft/api-documenter": "^7.19.12", "@types/node": "^22", "gh-pages": "^6.0.0", "lerna": "^8.0.2", "prettier": "^3.0.3", - "rimraf": "^5.0.1" + "rimraf": "^5.0.1", + "typedoc": "^0.27.5" } } diff --git a/packages/apis/api-extractor.json b/packages/apis/api-extractor.json deleted file mode 100644 index 91736076d..000000000 --- a/packages/apis/api-extractor.json +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "../../scripts/api-extractor-base.json", - "mainEntryPointFilePath": "/dist/index.d.ts" -} diff --git a/packages/apis/package.json b/packages/apis/package.json index a34d86bb3..84a56a901 100644 --- a/packages/apis/package.json +++ b/packages/apis/package.json @@ -3,15 +3,14 @@ "version": "1.35.0", "description": "InfluxDB 2.x generated APIs", "scripts": { - "apidoc:extract": "api-extractor run", - "build": "yarn run clean && yarn tsup --config ./tsup.config.browser.ts && yarn tsup && node ../../scripts/repair-doc-code-blocks.js ./dist/index.d.ts", + "build": "yarn run clean && yarn tsup --config ./tsup.config.browser.ts && yarn tsup", "clean": "rimraf build doc dist reports", "clean:apis": "rimraf src/generated/*API.ts", "test": "yarn run lint && yarn run typecheck && yarn run test:unit", "test:unit": "mocha --require esbuild-runner/register 'test/unit/**/*.test.ts' --exit", "test:ci": "yarn run typecheck && yarn run lint:ci && yarn run test:unit --reporter mocha-junit-reporter --reporter-options mochaFile=../../reports/apis_mocha/test-results.xml", "typecheck": "tsc --noEmit --pretty", - "lint": "eslint --max-warnings 0 'src/**/*.ts'", + "lint": "eslint 'src/**/*.ts'", "lint:ci": "yarn run lint --format junit --output-file ../../reports/apis_eslint/eslint.xml", "lint:fix": "eslint --fix 'src/**/*.ts'", "regenerate": "yarn fetchSwaggerFiles && yarn generate && yarn test", @@ -59,7 +58,6 @@ "devDependencies": { "@influxdata/influxdb-client": "^1.35.0", "@influxdata/oats": "^0.7.0", - "@microsoft/api-extractor": "^7.31.0", "@types/mocha": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.1.0", "@typescript-eslint/parser": "^8.0.0", diff --git a/packages/apis/src/APIBase.ts b/packages/apis/src/APIBase.ts index b675e3111..c9c8cacaf 100644 --- a/packages/apis/src/APIBase.ts +++ b/packages/apis/src/APIBase.ts @@ -1,10 +1,5 @@ // this is effectively a clone of -import { - InfluxDB, - Transport, - SendOptions, - Headers, -} from '@influxdata/influxdb-client' +import {InfluxDB, Transport, SendOptions, Headers} from '../../core/src' // used only in browser builds declare function btoa(plain: string): string diff --git a/packages/apis/src/custom/FluxScriptInvocationAPI.ts b/packages/apis/src/custom/FluxScriptInvocationAPI.ts index c6816cbf9..29a42a6cc 100644 --- a/packages/apis/src/custom/FluxScriptInvocationAPI.ts +++ b/packages/apis/src/custom/FluxScriptInvocationAPI.ts @@ -1,8 +1,4 @@ -import { - InfluxDB, - Transport, - AnnotatedCSVResponse, -} from '@influxdata/influxdb-client' +import {InfluxDB, Transport, AnnotatedCSVResponse} from '../../../core/src' /** ExecutionOptions contains execution options for a flux script. */ export interface ExecutionOptions { diff --git a/packages/apis/src/generated/AuthorizationsAPI.ts b/packages/apis/src/generated/AuthorizationsAPI.ts index 3e3e0e984..3b87b080d 100644 --- a/packages/apis/src/generated/AuthorizationsAPI.ts +++ b/packages/apis/src/generated/AuthorizationsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { Authorization, diff --git a/packages/apis/src/generated/BackupAPI.ts b/packages/apis/src/generated/BackupAPI.ts index 747a196f4..b472b5a6f 100644 --- a/packages/apis/src/generated/BackupAPI.ts +++ b/packages/apis/src/generated/BackupAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {MetadataBackup} from './types' diff --git a/packages/apis/src/generated/BucketsAPI.ts b/packages/apis/src/generated/BucketsAPI.ts index 9f2b831d0..b4c9cf9d2 100644 --- a/packages/apis/src/generated/BucketsAPI.ts +++ b/packages/apis/src/generated/BucketsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { AddResourceMemberRequestBody, diff --git a/packages/apis/src/generated/ChecksAPI.ts b/packages/apis/src/generated/ChecksAPI.ts index b27e0dab5..a23f97835 100644 --- a/packages/apis/src/generated/ChecksAPI.ts +++ b/packages/apis/src/generated/ChecksAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { Check, diff --git a/packages/apis/src/generated/ConfigAPI.ts b/packages/apis/src/generated/ConfigAPI.ts index 600f7a7ad..7439fa66e 100644 --- a/packages/apis/src/generated/ConfigAPI.ts +++ b/packages/apis/src/generated/ConfigAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {Config} from './types' diff --git a/packages/apis/src/generated/DashboardsAPI.ts b/packages/apis/src/generated/DashboardsAPI.ts index 2343f2f21..b55478944 100644 --- a/packages/apis/src/generated/DashboardsAPI.ts +++ b/packages/apis/src/generated/DashboardsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { AddResourceMemberRequestBody, diff --git a/packages/apis/src/generated/DbrpsAPI.ts b/packages/apis/src/generated/DbrpsAPI.ts index f14be8f74..d8a644d2a 100644 --- a/packages/apis/src/generated/DbrpsAPI.ts +++ b/packages/apis/src/generated/DbrpsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {DBRP, DBRPCreate, DBRPGet, DBRPUpdate, DBRPs} from './types' diff --git a/packages/apis/src/generated/DebugAPI.ts b/packages/apis/src/generated/DebugAPI.ts index 9feaf836f..c10ae7552 100644 --- a/packages/apis/src/generated/DebugAPI.ts +++ b/packages/apis/src/generated/DebugAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' export interface GetDebugPprofAllProfilesRequest { diff --git a/packages/apis/src/generated/DeleteAPI.ts b/packages/apis/src/generated/DeleteAPI.ts index aa29344ad..f57803305 100644 --- a/packages/apis/src/generated/DeleteAPI.ts +++ b/packages/apis/src/generated/DeleteAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {DeletePredicateRequest} from './types' diff --git a/packages/apis/src/generated/FlagsAPI.ts b/packages/apis/src/generated/FlagsAPI.ts index 34e5a7de3..dd5d6c0b6 100644 --- a/packages/apis/src/generated/FlagsAPI.ts +++ b/packages/apis/src/generated/FlagsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {Flags} from './types' diff --git a/packages/apis/src/generated/HealthAPI.ts b/packages/apis/src/generated/HealthAPI.ts index 0c7bd34ff..b2355f6c1 100644 --- a/packages/apis/src/generated/HealthAPI.ts +++ b/packages/apis/src/generated/HealthAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {HealthCheck} from './types' diff --git a/packages/apis/src/generated/LabelsAPI.ts b/packages/apis/src/generated/LabelsAPI.ts index c94408033..d599e138d 100644 --- a/packages/apis/src/generated/LabelsAPI.ts +++ b/packages/apis/src/generated/LabelsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { LabelCreateRequest, diff --git a/packages/apis/src/generated/MeAPI.ts b/packages/apis/src/generated/MeAPI.ts index d746b9af8..e0be035a1 100644 --- a/packages/apis/src/generated/MeAPI.ts +++ b/packages/apis/src/generated/MeAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {PasswordResetBody, UserResponse} from './types' diff --git a/packages/apis/src/generated/MetricsAPI.ts b/packages/apis/src/generated/MetricsAPI.ts index b6217e8b2..68c3fbf74 100644 --- a/packages/apis/src/generated/MetricsAPI.ts +++ b/packages/apis/src/generated/MetricsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' export interface GetMetricsRequest {} diff --git a/packages/apis/src/generated/NotificationEndpointsAPI.ts b/packages/apis/src/generated/NotificationEndpointsAPI.ts index 5d2c8472e..c1b240050 100644 --- a/packages/apis/src/generated/NotificationEndpointsAPI.ts +++ b/packages/apis/src/generated/NotificationEndpointsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { LabelMapping, diff --git a/packages/apis/src/generated/NotificationRulesAPI.ts b/packages/apis/src/generated/NotificationRulesAPI.ts index e601bdf2f..d73734f61 100644 --- a/packages/apis/src/generated/NotificationRulesAPI.ts +++ b/packages/apis/src/generated/NotificationRulesAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { FluxResponse, diff --git a/packages/apis/src/generated/OrgsAPI.ts b/packages/apis/src/generated/OrgsAPI.ts index e496f2fae..74470ff1b 100644 --- a/packages/apis/src/generated/OrgsAPI.ts +++ b/packages/apis/src/generated/OrgsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { AddResourceMemberRequestBody, diff --git a/packages/apis/src/generated/PingAPI.ts b/packages/apis/src/generated/PingAPI.ts index cc408b1e6..c158401b1 100644 --- a/packages/apis/src/generated/PingAPI.ts +++ b/packages/apis/src/generated/PingAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' export interface GetPingRequest {} diff --git a/packages/apis/src/generated/QueryAPI.ts b/packages/apis/src/generated/QueryAPI.ts index b9d80cca0..49f3fb9bc 100644 --- a/packages/apis/src/generated/QueryAPI.ts +++ b/packages/apis/src/generated/QueryAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { ASTResponse, diff --git a/packages/apis/src/generated/ReadyAPI.ts b/packages/apis/src/generated/ReadyAPI.ts index 7f4658e55..df2875ce8 100644 --- a/packages/apis/src/generated/ReadyAPI.ts +++ b/packages/apis/src/generated/ReadyAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {Ready} from './types' diff --git a/packages/apis/src/generated/RemotesAPI.ts b/packages/apis/src/generated/RemotesAPI.ts index 04abcde20..2bbcaccaf 100644 --- a/packages/apis/src/generated/RemotesAPI.ts +++ b/packages/apis/src/generated/RemotesAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { RemoteConnection, diff --git a/packages/apis/src/generated/ReplicationsAPI.ts b/packages/apis/src/generated/ReplicationsAPI.ts index 2811391ec..0ad186b28 100644 --- a/packages/apis/src/generated/ReplicationsAPI.ts +++ b/packages/apis/src/generated/ReplicationsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { Replication, diff --git a/packages/apis/src/generated/ResourcesAPI.ts b/packages/apis/src/generated/ResourcesAPI.ts index 0d08b4a41..c6e9b8904 100644 --- a/packages/apis/src/generated/ResourcesAPI.ts +++ b/packages/apis/src/generated/ResourcesAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' export interface GetResourcesRequest {} diff --git a/packages/apis/src/generated/RestoreAPI.ts b/packages/apis/src/generated/RestoreAPI.ts index 259b8cf1e..e74bade92 100644 --- a/packages/apis/src/generated/RestoreAPI.ts +++ b/packages/apis/src/generated/RestoreAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {BucketMetadataManifest, RestoredBucketMappings} from './types' diff --git a/packages/apis/src/generated/RootAPI.ts b/packages/apis/src/generated/RootAPI.ts index 042d29a35..f2b72b2ec 100644 --- a/packages/apis/src/generated/RootAPI.ts +++ b/packages/apis/src/generated/RootAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {Routes} from './types' diff --git a/packages/apis/src/generated/ScrapersAPI.ts b/packages/apis/src/generated/ScrapersAPI.ts index 8e098f813..81f0c737d 100644 --- a/packages/apis/src/generated/ScrapersAPI.ts +++ b/packages/apis/src/generated/ScrapersAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { AddResourceMemberRequestBody, diff --git a/packages/apis/src/generated/ScriptsAPI.ts b/packages/apis/src/generated/ScriptsAPI.ts index c4e79a875..3dc29cbc4 100644 --- a/packages/apis/src/generated/ScriptsAPI.ts +++ b/packages/apis/src/generated/ScriptsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { Script, diff --git a/packages/apis/src/generated/SetupAPI.ts b/packages/apis/src/generated/SetupAPI.ts index bb5969513..ee5c0e687 100644 --- a/packages/apis/src/generated/SetupAPI.ts +++ b/packages/apis/src/generated/SetupAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {IsOnboarding, OnboardingRequest, OnboardingResponse} from './types' diff --git a/packages/apis/src/generated/SigninAPI.ts b/packages/apis/src/generated/SigninAPI.ts index b8401ab81..006b0a53a 100644 --- a/packages/apis/src/generated/SigninAPI.ts +++ b/packages/apis/src/generated/SigninAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' export interface PostSigninRequest { diff --git a/packages/apis/src/generated/SignoutAPI.ts b/packages/apis/src/generated/SignoutAPI.ts index 962ac9375..9749645a4 100644 --- a/packages/apis/src/generated/SignoutAPI.ts +++ b/packages/apis/src/generated/SignoutAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' export interface PostSignoutRequest {} diff --git a/packages/apis/src/generated/SourcesAPI.ts b/packages/apis/src/generated/SourcesAPI.ts index 513318e3a..b72b7ec3c 100644 --- a/packages/apis/src/generated/SourcesAPI.ts +++ b/packages/apis/src/generated/SourcesAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {Buckets, HealthCheck, Source, Sources} from './types' diff --git a/packages/apis/src/generated/StacksAPI.ts b/packages/apis/src/generated/StacksAPI.ts index 3a38f21ce..9c13ae142 100644 --- a/packages/apis/src/generated/StacksAPI.ts +++ b/packages/apis/src/generated/StacksAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {Stack} from './types' diff --git a/packages/apis/src/generated/TasksAPI.ts b/packages/apis/src/generated/TasksAPI.ts index d2f5841a3..6887e93f6 100644 --- a/packages/apis/src/generated/TasksAPI.ts +++ b/packages/apis/src/generated/TasksAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { AddResourceMemberRequestBody, diff --git a/packages/apis/src/generated/TelegrafAPI.ts b/packages/apis/src/generated/TelegrafAPI.ts index 1ba214003..f8be73231 100644 --- a/packages/apis/src/generated/TelegrafAPI.ts +++ b/packages/apis/src/generated/TelegrafAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {TelegrafPlugins} from './types' diff --git a/packages/apis/src/generated/TelegrafsAPI.ts b/packages/apis/src/generated/TelegrafsAPI.ts index 353a85bd7..106d3331c 100644 --- a/packages/apis/src/generated/TelegrafsAPI.ts +++ b/packages/apis/src/generated/TelegrafsAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { AddResourceMemberRequestBody, diff --git a/packages/apis/src/generated/TemplatesAPI.ts b/packages/apis/src/generated/TemplatesAPI.ts index 1ef58044d..65370fc36 100644 --- a/packages/apis/src/generated/TemplatesAPI.ts +++ b/packages/apis/src/generated/TemplatesAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { Template, diff --git a/packages/apis/src/generated/UsersAPI.ts b/packages/apis/src/generated/UsersAPI.ts index 5563f5173..cb13429fb 100644 --- a/packages/apis/src/generated/UsersAPI.ts +++ b/packages/apis/src/generated/UsersAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import {PasswordResetBody, User, UserResponse, Users} from './types' diff --git a/packages/apis/src/generated/VariablesAPI.ts b/packages/apis/src/generated/VariablesAPI.ts index 270800111..7aec4d526 100644 --- a/packages/apis/src/generated/VariablesAPI.ts +++ b/packages/apis/src/generated/VariablesAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' import { LabelMapping, diff --git a/packages/apis/src/generated/WriteAPI.ts b/packages/apis/src/generated/WriteAPI.ts index 97834997b..c675ef2be 100644 --- a/packages/apis/src/generated/WriteAPI.ts +++ b/packages/apis/src/generated/WriteAPI.ts @@ -1,4 +1,4 @@ -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {APIBase, RequestOptions} from '../APIBase' export interface PostWriteRequest { diff --git a/packages/apis/src/index.ts b/packages/apis/src/index.ts index 59d146b9a..7c1e4319a 100644 --- a/packages/apis/src/index.ts +++ b/packages/apis/src/index.ts @@ -28,7 +28,7 @@ * ``` * Generated APIs that write or query InfluxDB are also herein, but it is recommended to use - * {@link @influxdata/influxdb-client#WriteApi} and {@link @influxdata/influxdb-client#QueryApi} + * {@link @influxdata/influxdb-client!WriteApi} and {@link @influxdata/influxdb-client!QueryApi} * from `@influxdata/influxdb-client`, they are much easier to use and offer specialized features * (write failover, line protocol serialization, flux results parsing, ...). * diff --git a/packages/core/api-extractor.json b/packages/core/api-extractor.json deleted file mode 100644 index 91736076d..000000000 --- a/packages/core/api-extractor.json +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "../../scripts/api-extractor-base.json", - "mainEntryPointFilePath": "/dist/index.d.ts" -} diff --git a/packages/core/package.json b/packages/core/package.json index 0c4028084..60105b264 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,7 +3,6 @@ "version": "1.35.0", "description": "InfluxDB 2.x client", "scripts": { - "apidoc:extract": "api-extractor run", "build": "yarn run clean && yarn tsup --config ./tsup.config.browser.ts && yarn tsup", "clean": "rimraf dist build coverage .nyc_output doc *.lcov reports", "coverage": "nyc mocha --require ts-node/register 'test/**/*.test.ts' --exit", @@ -54,7 +53,6 @@ }, "license": "MIT", "devDependencies": { - "@microsoft/api-extractor": "^7.31.0", "@types/chai": "^4.2.5", "@types/mocha": "^10.0.0", "@types/sinon": "^17.0.2", diff --git a/packages/core/src/Point.ts b/packages/core/src/Point.ts index ec9d93cd5..fa8f3f749 100644 --- a/packages/core/src/Point.ts +++ b/packages/core/src/Point.ts @@ -60,7 +60,7 @@ export class Point { /** * Adds a boolean field. * - * @param field - field name + * @param name - field name * @param value - field value * @returns this */ diff --git a/packages/core/src/impl/node/NodeHttpTransport.ts b/packages/core/src/impl/node/NodeHttpTransport.ts index 3c7cb7052..620863133 100644 --- a/packages/core/src/impl/node/NodeHttpTransport.ts +++ b/packages/core/src/impl/node/NodeHttpTransport.ts @@ -125,8 +125,7 @@ export class NodeHttpTransport implements Transport { * * @param path - HTTP request path * @param body - message body - * @param headers - HTTP headers - * @param method - HTTP method + * @param options - the send options * @param callbacks - communication callbacks */ send( @@ -155,8 +154,9 @@ export class NodeHttpTransport implements Transport { * response's content-type (deserialized json, text). * @param path - HTTP path - * @param requestBody - request body + * @param body - The request body * @param options - send options + * @param responseStarted - Response started callback * @returns Promise of response body */ request( diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 779e504d5..287d36978 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -2,7 +2,7 @@ * The `@influxdata/influxdb-client` package provides optimized APIs that write or query InfluxDB v2. * * @remarks - * The entry point of this package is the {@link @influxdata/influxdb-client#InfluxDB } class. It is + * The entry point of this package is the {@link @influxdata/influxdb-client!InfluxDB } class. It is * initialized with options that tells how to communicate with InfluxDB. The simple usage pattern is: * * ``` @@ -13,14 +13,14 @@ * }) * ``` * - * The influxDB object let you create two essential API instances, {@link @influxdata/influxdb-client#InfluxDB.getWriteApi } - * and {@link @influxdata/influxdb-client#InfluxDB.getQueryApi }. The {@link @influxdata/influxdb-client#WriteApi} + * The influxDB object let you create two essential API instances, {@link @influxdata/influxdb-client!InfluxDB.getWriteApi } + * and {@link @influxdata/influxdb-client!InfluxDB.getQueryApi }. The {@link @influxdata/influxdb-client!WriteApi} * asynchronously writes measurement points on background, in batches to optimize network traffic, and with retries - * upon failures. The {@link @influxdata/influxdb-client#QueryApi} let you execute a flux query against InfluxDB + * upon failures. The {@link @influxdata/influxdb-client!QueryApi} let you execute a flux query against InfluxDB * and offers several ways to stream query results. * * The influxDB object is also used to create more specialized InfluxDB management API instances in - * {@link @influxdata/influxdb-client-apis# | @influxdata/influxdb-client-apis} . + * {@link @influxdata/influxdb-client-apis! | @influxdata/influxdb-client-apis} . * * See also {@link https://github.com/influxdata/influxdb-client-js/tree/master/examples | examples} to know more. * diff --git a/packages/giraffe/api-extractor.json b/packages/giraffe/api-extractor.json deleted file mode 100644 index 91736076d..000000000 --- a/packages/giraffe/api-extractor.json +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "../../scripts/api-extractor-base.json", - "mainEntryPointFilePath": "/dist/index.d.ts" -} diff --git a/packages/giraffe/package.json b/packages/giraffe/package.json index 78251a649..3cdb0fec5 100644 --- a/packages/giraffe/package.json +++ b/packages/giraffe/package.json @@ -3,7 +3,6 @@ "version": "1.35.0", "description": "InfluxDB 2.x client - giraffe integration", "scripts": { - "apidoc:extract": "api-extractor run", "build": "yarn run clean && yarn tsup", "clean": "rimraf dist build coverage .nyc_output doc *.lcov reports", "coverage": "nyc mocha --require ts-node/register 'test/**/*.test.ts' --exit", @@ -46,7 +45,6 @@ "devDependencies": { "@influxdata/giraffe": "*", "@influxdata/influxdb-client": "^1.35.0", - "@microsoft/api-extractor": "^7.31.0", "@types/chai": "^4.2.5", "@types/mocha": "^10.0.0", "@types/react": "^16.9.55", diff --git a/packages/giraffe/src/csvToTable.ts b/packages/giraffe/src/csvToTable.ts index d3cab9730..985836ab8 100644 --- a/packages/giraffe/src/csvToTable.ts +++ b/packages/giraffe/src/csvToTable.ts @@ -12,7 +12,7 @@ import { FluxTableMetaData, FluxResultObserver, Cancellable, -} from '@influxdata/influxdb-client' +} from '../../core/src' /** A type of a function that creates a new giraffe table of a specified length */ export type GiraffeTableFactory = (length: number) => Table @@ -116,7 +116,7 @@ export const QUERY_MAX_TABLE_LENGTH = 100_000 /** * Creates an accept function that stops processing * if the table reaches the specified max rows. - * @param size - maximum processed rows + * @param max - maximum processed rows * @returns AcceptRowFunction that enforces that most max rows are processed */ export function acceptMaxTableLength(max: number): AcceptRowFunction { diff --git a/packages/giraffe/src/index.ts b/packages/giraffe/src/index.ts index e09e19b2c..b631d6f80 100644 --- a/packages/giraffe/src/index.ts +++ b/packages/giraffe/src/index.ts @@ -3,7 +3,7 @@ * to a format that is used by {@link https://github.com/influxdata/giraffe | Giraffe } to visualize the data. * * @remarks - * The main goal of this package is to provide an efficient {@link @influxdata/influxdb-client-giraffe#queryToTable} + * The main goal of this package is to provide an efficient {@link @influxdata/influxdb-client-giraffe!queryToTable} * function that executes a Flux query against InfluxDB (v2) and returns a Table that is then directly suitable * as a data input of various Giraffe visualizations. * diff --git a/packages/giraffe/src/queryTable.ts b/packages/giraffe/src/queryTable.ts index 56c4bc111..90ec718cd 100644 --- a/packages/giraffe/src/queryTable.ts +++ b/packages/giraffe/src/queryTable.ts @@ -1,4 +1,4 @@ -import {ParameterizedQuery, QueryApi} from '@influxdata/influxdb-client' +import {ParameterizedQuery, QueryApi} from '../../core/src' import {Table, FromFluxResult} from '@influxdata/giraffe' import {createCollector, GiraffeTableFactory, TableOptions} from './csvToTable' diff --git a/packages/giraffe/test/unit/queryTable.test.ts b/packages/giraffe/test/unit/queryTable.test.ts index e411d44ca..6f7134518 100644 --- a/packages/giraffe/test/unit/queryTable.test.ts +++ b/packages/giraffe/test/unit/queryTable.test.ts @@ -3,7 +3,7 @@ import {queryToTable, queryToFromFluxResult} from '../../src' // @influxdata/influxdb-client uses node transport in tests (tests run in node), therefore nock is used to mock HTTP import nock from 'nock' import {Readable} from 'stream' -import {InfluxDB} from '@influxdata/influxdb-client' +import {InfluxDB} from '../../../core/src' import {newTable} from './newTable' const url = 'http://test' const queryApi = new InfluxDB({url}).getQueryApi('whatever') diff --git a/packages/giraffe/tsup.config.ts b/packages/giraffe/tsup.config.ts index c5e9c5ca6..19ef636e2 100644 --- a/packages/giraffe/tsup.config.ts +++ b/packages/giraffe/tsup.config.ts @@ -17,7 +17,7 @@ export default defineConfig({ dts: true, minify, target: ['es2018'], - platform: 'browser', + platform: 'node', splitting: false, esbuildOptions(options, {format}) { options.outdir = undefined diff --git a/scripts/api-extractor-base.json b/scripts/api-extractor-base.json deleted file mode 100644 index df133f233..000000000 --- a/scripts/api-extractor-base.json +++ /dev/null @@ -1,366 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - //"projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - "mainEntryPointFilePath": "/dist/index.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ - "bundledPackages": [], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ - "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - - /** - * Configures how the API report file (*.api.md) will be generated. - */ - "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": false - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - // "reportFolder": "/etc/", - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" - }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ - "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ - "enabled": true, - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - "apiJsonFilePath": "/../../docs/.api.json" - }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ - "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ - "enabled": false - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true - }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ - "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ - "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ - "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ - "logLevel": "warning" - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false - } - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ - "extractorMessageReporting": { - "default": { - "logLevel": "warning" - // "addToApiReportFile": false - }, - "ae-missing-release-tag": { - "logLevel": "none" - } - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "tsdocMessageReporting": { - "default": { - "logLevel": "warning" - // "addToApiReportFile": false - } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - } - } -} diff --git a/scripts/enhance-doc-index-md.js b/scripts/enhance-doc-index-md.js deleted file mode 100644 index 721a0fe1f..000000000 --- a/scripts/enhance-doc-index-md.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable @typescript-eslint/no-var-requires */ -const path = require('path') -const fs = require('fs') -const marker = '' -const version = require('../lerna.json').version - -function enhanceIndexMD(file) { - const data = fs.readFileSync(file, 'utf8') - const lines = data.split('\n') - for (let i = 0; i < lines.length; i++) { - if (lines[i].startsWith('