From 4ef9f9d6a95b425e392d8f85f10e2cc8cd866bf6 Mon Sep 17 00:00:00 2001 From: Dwynr Date: Thu, 1 Feb 2024 06:00:36 +0100 Subject: [PATCH] fix: typedoc --- docs/assets/highlight.css | 84 ++ docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/classes/FilenSDK.html | 26 + docs/classes/_internal_.API.html | 5 + docs/classes/_internal_.APIClient.html | 19 + docs/classes/_internal_.AxiosHeaders.html | 32 + docs/classes/_internal_.Crypto.html | 26 + docs/classes/_internal_.Decrypt.html | 18 + docs/classes/_internal_.DirContent.html | 8 + docs/classes/_internal_.Encrypt.html | 12 + docs/classes/_internal_.Health.html | 8 + docs/classes/default.html | 24 - docs/enums/_internal_.HttpStatusCode.html | 64 ++ docs/functions/_internal_.Error-1.html | 10 + docs/hierarchy.html | 1 + docs/index.html | 4 +- docs/interfaces/_internal_.ArrayLike.html | 2 + docs/interfaces/_internal_.AxiosAdapter.html | 1 + .../_internal_.AxiosBasicCredentials.html | 3 + .../_internal_.AxiosProgressEvent.html | 10 + .../_internal_.AxiosProxyConfig.html | 5 + .../_internal_.AxiosRequestConfig.html | 42 + .../_internal_.AxiosRequestTransformer.html | 1 + docs/interfaces/_internal_.AxiosResponse.html | 7 + .../_internal_.AxiosResponseTransformer.html | 1 + docs/interfaces/_internal_.Buffer.html | 760 ++++++++++++++++++ .../_internal_.BufferConstructor.html | 165 ++++ docs/interfaces/_internal_.CallSite.html | 48 ++ docs/interfaces/_internal_.Cancel.html | 2 + docs/interfaces/_internal_.CancelToken.html | 4 + .../_internal_.CustomParamsSerializer.html | 1 + docs/interfaces/_internal_.Error.html | 4 + .../_internal_.FormDataVisitorHelpers.html | 4 + .../_internal_.FormSerializerOptions.html | 5 + .../_internal_.GenericAbortSignal.html | 5 + .../_internal_.GenericFormData.html | 2 + ..._internal_.InternalAxiosRequestConfig.html | 42 + .../_internal_.IterableIterator.html | 5 + docs/interfaces/_internal_.Iterator.html | 4 + .../_internal_.IteratorReturnResult.html | 3 + .../_internal_.IteratorYieldResult.html | 3 + .../_internal_.LookupAddressEntry.html | 3 + docs/interfaces/_internal_.ParamEncoder.html | 1 + .../_internal_.ParamsSerializerOptions.html | 7 + .../_internal_.RawAxiosHeaders.html | 1 + .../_internal_.SerializerOptions.html | 5 + .../_internal_.SerializerVisitor.html | 1 + .../_internal_.SharedArrayBuffer.html | 7 + ...nternal_.SharedArrayBufferConstructor.html | 3 + .../_internal_.TransitionalOptions.html | 4 + docs/modules.html | 6 +- docs/modules/_internal_.html | 86 ++ docs/types/FilenSDKConfig.html | 2 +- docs/types/_internal_.APIClientConfig.html | 1 + docs/types/_internal_.APIConfig.html | 1 + docs/types/_internal_.AddressFamily.html | 1 + docs/types/_internal_.ArrayBufferLike.html | 1 + docs/types/_internal_.ArrayBufferView.html | 1 + docs/types/_internal_.AuthVersion.html | 1 + docs/types/_internal_.AxiosAdapterConfig.html | 1 + docs/types/_internal_.AxiosAdapterName.html | 1 + docs/types/_internal_.AxiosHeaderMatcher.html | 1 + docs/types/_internal_.AxiosHeaderParser.html | 1 + docs/types/_internal_.AxiosHeaderValue.html | 1 + docs/types/_internal_.AxiosPromise.html | 1 + .../types/_internal_.AxiosRequestHeaders.html | 1 + .../_internal_.AxiosResponseHeaders.html | 1 + .../_internal_.BaseRequestParameters.html | 1 + docs/types/_internal_.BufferEncoding.html | 1 + .../_internal_.CommonRequestHeadersList.html | 1 + .../_internal_.CommonResponseHeadersList.html | 1 + docs/types/_internal_.ContentType.html | 1 + docs/types/_internal_.CryptoConfig.html | 1 + docs/types/_internal_.DirContentFolder.html | 1 + docs/types/_internal_.DirContentResponse.html | 1 + docs/types/_internal_.DirContentUpload.html | 1 + .../_internal_.FileEncryptionVersion.html | 1 + docs/types/_internal_.FileMetadata.html | 1 + docs/types/_internal_.FolderMetadata.html | 1 + .../_internal_.GetRequestParameters.html | 1 + docs/types/_internal_.IteratorResult.html | 1 + docs/types/_internal_.LookupAddress.html | 1 + docs/types/_internal_.Partial.html | 2 + .../_internal_.PostRequestParameters.html | 1 + .../_internal_.RawAxiosRequestHeaders.html | 1 + .../_internal_.RawAxiosResponseHeaders.html | 1 + .../_internal_.RawCommonResponseHeaders.html | 1 + docs/types/_internal_.Record.html | 2 + docs/types/_internal_.RequestParameters.html | 1 + docs/types/_internal_.ResponseType.html | 1 + docs/types/_internal_.TypedArray.html | 1 + .../_internal_.WithImplicitCoercion.html | 1 + docs/variables/_internal_.Buffer-1.html | 1 + .../_internal_.SharedArrayBuffer-1.html | 1 + package-lock.json | 14 +- package.json | 3 +- src/api/client.ts | 40 +- src/api/index.ts | 4 +- src/api/v3/dir/content.ts | 22 +- src/api/v3/health/index.ts | 20 +- src/crypto/decrypt.ts | 4 +- src/crypto/encrypt.ts | 12 +- src/crypto/index.ts | 12 +- src/crypto/utils.ts | 4 +- src/index.ts | 12 +- src/utils.ts | 4 +- 107 files changed, 1750 insertions(+), 44 deletions(-) create mode 100644 docs/classes/FilenSDK.html create mode 100644 docs/classes/_internal_.API.html create mode 100644 docs/classes/_internal_.APIClient.html create mode 100644 docs/classes/_internal_.AxiosHeaders.html create mode 100644 docs/classes/_internal_.Crypto.html create mode 100644 docs/classes/_internal_.Decrypt.html create mode 100644 docs/classes/_internal_.DirContent.html create mode 100644 docs/classes/_internal_.Encrypt.html create mode 100644 docs/classes/_internal_.Health.html delete mode 100644 docs/classes/default.html create mode 100644 docs/enums/_internal_.HttpStatusCode.html create mode 100644 docs/functions/_internal_.Error-1.html create mode 100644 docs/hierarchy.html create mode 100644 docs/interfaces/_internal_.ArrayLike.html create mode 100644 docs/interfaces/_internal_.AxiosAdapter.html create mode 100644 docs/interfaces/_internal_.AxiosBasicCredentials.html create mode 100644 docs/interfaces/_internal_.AxiosProgressEvent.html create mode 100644 docs/interfaces/_internal_.AxiosProxyConfig.html create mode 100644 docs/interfaces/_internal_.AxiosRequestConfig.html create mode 100644 docs/interfaces/_internal_.AxiosRequestTransformer.html create mode 100644 docs/interfaces/_internal_.AxiosResponse.html create mode 100644 docs/interfaces/_internal_.AxiosResponseTransformer.html create mode 100644 docs/interfaces/_internal_.Buffer.html create mode 100644 docs/interfaces/_internal_.BufferConstructor.html create mode 100644 docs/interfaces/_internal_.CallSite.html create mode 100644 docs/interfaces/_internal_.Cancel.html create mode 100644 docs/interfaces/_internal_.CancelToken.html create mode 100644 docs/interfaces/_internal_.CustomParamsSerializer.html create mode 100644 docs/interfaces/_internal_.Error.html create mode 100644 docs/interfaces/_internal_.FormDataVisitorHelpers.html create mode 100644 docs/interfaces/_internal_.FormSerializerOptions.html create mode 100644 docs/interfaces/_internal_.GenericAbortSignal.html create mode 100644 docs/interfaces/_internal_.GenericFormData.html create mode 100644 docs/interfaces/_internal_.InternalAxiosRequestConfig.html create mode 100644 docs/interfaces/_internal_.IterableIterator.html create mode 100644 docs/interfaces/_internal_.Iterator.html create mode 100644 docs/interfaces/_internal_.IteratorReturnResult.html create mode 100644 docs/interfaces/_internal_.IteratorYieldResult.html create mode 100644 docs/interfaces/_internal_.LookupAddressEntry.html create mode 100644 docs/interfaces/_internal_.ParamEncoder.html create mode 100644 docs/interfaces/_internal_.ParamsSerializerOptions.html create mode 100644 docs/interfaces/_internal_.RawAxiosHeaders.html create mode 100644 docs/interfaces/_internal_.SerializerOptions.html create mode 100644 docs/interfaces/_internal_.SerializerVisitor.html create mode 100644 docs/interfaces/_internal_.SharedArrayBuffer.html create mode 100644 docs/interfaces/_internal_.SharedArrayBufferConstructor.html create mode 100644 docs/interfaces/_internal_.TransitionalOptions.html create mode 100644 docs/modules/_internal_.html create mode 100644 docs/types/_internal_.APIClientConfig.html create mode 100644 docs/types/_internal_.APIConfig.html create mode 100644 docs/types/_internal_.AddressFamily.html create mode 100644 docs/types/_internal_.ArrayBufferLike.html create mode 100644 docs/types/_internal_.ArrayBufferView.html create mode 100644 docs/types/_internal_.AuthVersion.html create mode 100644 docs/types/_internal_.AxiosAdapterConfig.html create mode 100644 docs/types/_internal_.AxiosAdapterName.html create mode 100644 docs/types/_internal_.AxiosHeaderMatcher.html create mode 100644 docs/types/_internal_.AxiosHeaderParser.html create mode 100644 docs/types/_internal_.AxiosHeaderValue.html create mode 100644 docs/types/_internal_.AxiosPromise.html create mode 100644 docs/types/_internal_.AxiosRequestHeaders.html create mode 100644 docs/types/_internal_.AxiosResponseHeaders.html create mode 100644 docs/types/_internal_.BaseRequestParameters.html create mode 100644 docs/types/_internal_.BufferEncoding.html create mode 100644 docs/types/_internal_.CommonRequestHeadersList.html create mode 100644 docs/types/_internal_.CommonResponseHeadersList.html create mode 100644 docs/types/_internal_.ContentType.html create mode 100644 docs/types/_internal_.CryptoConfig.html create mode 100644 docs/types/_internal_.DirContentFolder.html create mode 100644 docs/types/_internal_.DirContentResponse.html create mode 100644 docs/types/_internal_.DirContentUpload.html create mode 100644 docs/types/_internal_.FileEncryptionVersion.html create mode 100644 docs/types/_internal_.FileMetadata.html create mode 100644 docs/types/_internal_.FolderMetadata.html create mode 100644 docs/types/_internal_.GetRequestParameters.html create mode 100644 docs/types/_internal_.IteratorResult.html create mode 100644 docs/types/_internal_.LookupAddress.html create mode 100644 docs/types/_internal_.Partial.html create mode 100644 docs/types/_internal_.PostRequestParameters.html create mode 100644 docs/types/_internal_.RawAxiosRequestHeaders.html create mode 100644 docs/types/_internal_.RawAxiosResponseHeaders.html create mode 100644 docs/types/_internal_.RawCommonResponseHeaders.html create mode 100644 docs/types/_internal_.Record.html create mode 100644 docs/types/_internal_.RequestParameters.html create mode 100644 docs/types/_internal_.ResponseType.html create mode 100644 docs/types/_internal_.TypedArray.html create mode 100644 docs/types/_internal_.WithImplicitCoercion.html create mode 100644 docs/variables/_internal_.Buffer-1.html create mode 100644 docs/variables/_internal_.SharedArrayBuffer-1.html diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index 5674cf39..df9f8690 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -1,22 +1,106 @@ :root { + --light-hl-0: #AF00DB; + --dark-hl-0: #C586C0; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #001080; + --dark-hl-2: #9CDCFE; + --light-hl-3: #A31515; + --dark-hl-3: #CE9178; + --light-hl-4: #0000FF; + --dark-hl-4: #569CD6; + --light-hl-5: #0070C1; + --dark-hl-5: #4FC1FF; + --light-hl-6: #795E26; + --dark-hl-6: #DCDCAA; + --light-hl-7: #008000; + --dark-hl-7: #6A9955; + --light-hl-8: #098658; + --dark-hl-8: #B5CEA8; + --light-hl-9: #EE0000; + --dark-hl-9: #D7BA7D; + --light-hl-10: #267F99; + --dark-hl-10: #4EC9B0; + --light-hl-11: #000000FF; + --dark-hl-11: #D4D4D4; --light-code-background: #FFFFFF; --dark-code-background: #1E1E1E; } @media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } } @media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } } :root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } :root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +.hl-9 { color: var(--hl-9); } +.hl-10 { color: var(--hl-10); } +.hl-11 { color: var(--hl-11); } pre, code { background: var(--code-background); } diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 4c72526b..f8f9f74e 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACouuVipJrShRslJKSU1LLM0pUdJRKkgsyQAKJOckFhenFutDJfQySnJzgLLZmXkpSlaGRha1OnC9bpk5qXnBLt7O+XlpmekII0oqC4AGoMqimmNkYGluaGpUGwsAnLyDlYkAAAA=" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACq2a/U/UMBjH/5f5K6ggvhFjAgcIEZVwiDHGmLr1uIaunW2HnMb/3a7b2Lr12q69n0jY9/l+nu7p+nrf/iYC3otkP8ngApRYJFtJAcRS/iOnWYkhf7wUOX7UPb1FJEv293Ze7z17uvdv6yH+DSICMgLw25HFkx/tsx/K7cFldytJlwhnDJJk/9uD1akQxVwAUfIZzWBnB0mZa2a6UPd+Jb0x4FzGCZ5tI74tzVVc0sv64OKs81d6PV35XLfd2X2lh88wgkS4TGqV1eoeUX4KQQYZt7v1hCNDr0bP2KoQ1AqpJbZ8j2BaaawujcZqg9iMygDHK+xkNrNj4s6p0dhs5MvFMtzmUkus9WQMrM7Rba//qvAFSAf1bIWDb+P5C78eXHWHgwwU8pET1dNG0A4BR+mMwUyWAwHMvbDDoAj+BaM3DHJ+fKd1Gwtci4gj369kR1ygG19uq4+gXsJfJeRiAleLiCdfMUD4grLcs4uNw6Jy4AUl3P0d9cUb4E1v9CguLIvDcrFwM2tVDEH2Di5YmQrqCesFhHFnAOM5Es5StrpQCkkhdjMqVQzhit7KdYsXRkkDWSUXNL8ADOR8DpkcOtEfd+8wR4VlcMyYu4coUZj/ifxWjoAA14gj2bVOIS60NZAZaI4Kz6B7S58KgWRP90lgFBTGfweJNEoPflIm5uimeuqAjyOiyO3L9MS28jDmWWM3fW5bHxmYifwX+Imh+usxDA71EVRfWjTlEoqSETk5aZs7O7EfE0f/iiDOpsF7IWHsc0pvy+Igy9SKjwi2cqHHEWFkNd7KDYbcjDqr29dG0PjkcWtNWFgOl+C3eeNqZg/kYczJLd5QWzubZs7x5zYBgdwlkNsmtU30WxqOAjbEnbBgtMWGZaOW1agqH8CedTeEBO4L2gOc4TQlVsWaox7jtPT09cud57sDYx9LP7N6/DoBOcIrm2FfZzT1eyldcfVjjjFQV24EeY3gbz9kpYxAlmJ5LYcq2XlsuE7lrFLvDMZd+5E4oiU9r48gtxZsII2E1qP9ByDSZX/wMmM18UbAcsLjvtxauxHsNcCl8yX3pJHQC0ZzxJ3ARhYJa9beo1nfzNTV0ej6mMWbrcnD4YeAw6YhagUFhZ1u1LsGh3rEUqtCRGwDgy4Mb9WM5jkleoHOERcW9LqQ+CS0SnlmMYqJSUNdMFxJlBX8oIpAqesV5/Dfl7m6TndDckJxZh3vhlJ/6/FZrMV8zVmsxf5zgSnIvMxrqcv6BGHYXPjIqdk9jxv1PpAPUIBMO0Axercyp6Wqi4+pJnTZvoNiyhBmkrsQ3RGCvucfmevC8E9J27tbeJouHCffRHV9ZQE1iggE5ZPKZNS76tTuxL1ncnNAeCs7P9/5fE1EVArGacSegzEkIgmYUmYb82pBDMC/K03vRu2ll33S7MvCW1JF12cKFlQnCgd9QWJ5lhcYpUhu5CFL7bOGSR6x0Byc8dwBhqpDZ8P6b3tHxzzzI1gOlIywkT6QO7hIWpQkVYcyo3ukof+LPYv/98FUTOZH7ztI+9uN9ontJxutxrwu05+aP4zv/wFHQGNRUCUAAA==" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index e231b492..d6dc1535 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACsVZTXOjOBD9L8zVIW7J+CPXmUpVanZPOzMXVyrFGDlRBRsX4GRTKf/3lUACta22IcPsXIyx3+vX9JNaIN6DPHstgpvle/Ast0lww8aLGURsFGzjjQhugluZiu0/X75+zrZr+RiMgn2eqp/Lt50orvGf4VO5SRVilcZFIVTQIDiMbNxpFPFpE/XhQQe4HO1TA3SCjoJdnItteZpdKwdjNmnUxCaWaWex0MK7SIYmQUJ5pyK8ZnnSXdxhDKBfvma38arM8s9Z0r3c4TFtgEw2cVGK/Kt4K7qngTgD5BDvpArWXb/BDzES9j9Tueol71KGyCCXL3Ep+qXgcoZwYF8+/RB5IbNtDxsQaYAsfsaFuM3SROTfv9996Z7ICW+AXPaFyO969IcG/0FtNm+kE7GO92nZaJuI1+b3s+08gnaJWGXbosz3ul+cjfUJA/0XYJMiyrXCyxAlU2NahbJIrmRxZYZzD70H1QPOqxnEEFqr/G1XZhfkGtDHFNl40o4AWfyVPT6K5G57XhThBtBNs0d5QdJCuo4SFP+iaceenY999t6Fiq9XjyswM/AquiQXGgo1OJ5EnJZPfVXDhtZJ/LRfDHHpJgl7DtAzHXsRRGUSeaHteDKqOX+yJioDezLtWw+d/W9Mx36Z2S/zDyRov55f/VSrLnWkYdMN27C/lvb/4D2dvf1hMdRlNGUhumaX5cez+vRY4falTIvzAhby+3pzpRA2yPOlrdMhLqdIhdh1FwstvoPkECPvVNsOKd4rCZM3PYVfRF5+kxtRlPFm9y37u4vFzpj00f9EiXypNItWv4p5r+pwPwpUnuLf4OY9eDEPNDcBC3mo5/haijTRWzH1BSi9bLPRGvfmvx9C3zlrRA25Hgej5XjEIZzN4f5+tLSM6o/qhwqmcl/CCHjIGUMwQDCmzpgvGkMwNXaW3AfjCDZRZxMfbIJg6r5oGflgEYKpJXI59cGmCDZTZzMfbIZgaj1bzn2wOYIpU5YLH2yBy6urDV4f4MiIygnwIrEXoGsOXjcA2wG67OA1BLAjoCsPXk8AmwK6+OC1BbAvoOsPXmcAWwPaAvCaA9gd0C6A1x/ABoE2ArwWAfaIjak5wLBFTPvAvGayo+nCyJDYIaZtYF7XGXaITciQ2CAWkUDsD9MmMP+sxv6wGRkS28O0B8w74Bi2h2kPmHfAMWwPJ+3h2B5e2eMdmRzbw0l7+FE/q+zxDmGO7eGkPby2p+rvuu/rJ+Wqz6tObZeh9+DBNH+wS9R7AOrjMArUIKyPzBwn5hiZ46w+coPjBscr3KFdKvSZTqzelHAkI0czokj25s7hTR3elOAday0czoLmPOtNxZbmKJFC+/LJrpsO09Gj5PTO3braudvvZYKyHTvZjgm63VFyaBOHRrmA9rscLne4nObWjzAtj7GWx6gamTuP0t55lNmmQEGcOnNS/GQgMCdnNc39tGZD0blWJ2dgFE+i+jBngjAqRfOSxmE5JIKz1pujRfJ8aqczCKgxYHdSHEWHxYCgySKtts4kGrJqIWzLMiOoZgvMYc0dFmVC/dLkuXpp0lKd+U9N//bNU0tzXKeMMLt/R7PZyZRKtH69ccRz6kKVxTxFOT44F8cpH8rXbF290lpVr7RatjORqXms99yPuobbwylJ8yjrJOpoMW+rUivITu5EKrcKtLw/HP4DdIhaxaAdAAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACs1dbY/bOA7+L+nXNBtZfi0OB+y119viboGi290vg2KQTjwzRpN4Li/d9or+97NkySYV0rYcz2y/NM2EFB/pISmKsZ1vs33552H24urb7FOxW89eBMssEVEwn+1W23z2Yva62OS73179+2W5uy3uZvPZab+p/nz8+pAffsIfLu6P200lcbNZHQ55Nehs9n1ux42jSMbNqNfXaoD+0Z41gmDQ+exhtc93x3N0rTmxDMLGWr5dFZvBxhZWfIjJhQHIWH6oRviz3K+HGwcaE9g//lm+Xt0cy/3Lcj18uReu2gRItqvDMd//O/96GA4D6UyAYfVQVIMNt9/IT+EJp4+b4sbLPFSZAsG++Lw65n4QoM4UDJyO93/k+0NR7jxoQEoToPi4OuSvy8063//++5tXw4Gc6U2A5XTI92888kMjP9J2kJ6l9sa4GbIx35nQI9FuEjfl7nDcn1TG6B7sGZbsngO3ZDd4K2IN1UKtjeNh/bw4PDc+7WPxusoEPfaMyCTWbvZfH45ln8FGaqTNYBm2vlAc/lPe3eXrN7ses0hwCsub8q7oM2plBvsLstBPnstdz+idtQxrQW0nz4UJyedRr8GF0eHc5D5fbY733nYXjd4w8+c5ZJLpGxj2vRC+gOw8mNVZF32piMBUK/2161JhsG9i7zVRE3hMQPY/if1POgai/W/3zlhl8KMaamLAi3bcC4E/hQfw+O0fsskm0qwMk0cHbUvEruSz952OxebQY8LKPGa+1jYWjWjPAteImCkdNnn+4GFuYRWGGJ3EB8+tW+eSfjAMdD6gP+f74/timx+Oq+3D+/LXQVQD96T0/5plosA0m5nnqpETa6GGIgvlEmxt+e3qtGkT47Zcnzb5oQbZfkhW7W3N/reiCvb9brX5uzvQT9f2o+vOE4DbKvqZPdyBAYEQMThYKoCPPr78/PbNGWHQ0Ns3IwwMPdUQhgadbVqjSs/zhMMYHX7OGWa92ipebgpq66UAQOmLMKC95rMcZPwzn6BYO4Minza2+CybjXqg4YXW8qzh+633VfEUiJFJcDCY/rK1A9WIcn4AsK6C/mmXCBR1/PbQtT4jSntPWPY/Qf/u3wP0sgL/Yti9Jb4X/KfxCX4W9g/hpNMhin24ub6ka30wqVriabZYYMt3lzUTGb3ROqZH7bXdGK7znT40DUUB5KfFsc79cLTyl+JAW7/nclCrMcqu5/Sp2Y9ad/rIy1jtPvt22fRNWmdWPeoeo9t5LL7Ld/m+8pF3q9263P523Be7wYGITk/MQF4gL8/xXvD6ezfdOOk5c992nW5v8/378h+rQx6Ho+ZwNsSPsrgYmFfdQi2rM8+eBf0l/3IR6Fr/R1vKClX/dxQD11HNkCvo82qLUF8sv96X27cr5zIJH+DcSD/KwpL4mr7u2CWmZ93xhXccVn6teRnnHu4QP8ryYmBeZyzSdfE86er4l95jey3xNNUxsOVbHf/Seege1AiC1i/oBZ0hQbXZbX68Gbrez6zwiNkDjl8V+5f9B9RW6mm4duz58g0mdQnnLooLeCcR+XHvohnMP2Pb6Wq/fUNe+4jP9+wVkH0+MOC6SNZS39WRuC/QfY0keW1cn+W+K+QoAN3XJCmxIb3nWujJGvzA3Ig2v5nRJc1+B8DYlv8ZEhRpH0/FZl0lxaq26DyQOngctalRPZQHD294ZsSnRnGX+4CopafGsM//e8q9FqPVGOWnbi6sC6a+dAilHj0jnhnzSIpoOr7XLQ/AMOQCZgbOyKuJh4Dqv6x4JCbu+uJBoPovNB6OCuwn/+xvJhqRp9lLoDHfncTOZfQ+4hoftYv0oDjmX46VSLnuPmciKFhnejyvcn88rc7FeFAO3+bH1Xp1XA0GAxTGeAg80fQ3uI3IE51l8vGxYOcyOhZc46NioQfFwFhAUC6KhQF4BsTCGZ7RsXCOxzsWEBifWOixfVts8l997TtKF2PQ95L4o3DVRuHAlV17FH6XHx6qWOwouc5lH73KY0x61HrEBLnv4x425WrdUe51g1m0+iNA9dRYNfXjsbX6k2CjeiX6DDGkYwIEn6Rv4trz7J7AeV3QQ2FQeHZS4Ci9rLytTsTv6oPg29W++tux04VI8REMuTD+lfugoKQnAOGB4DHMv6Z2nTPLUOrRQ+PMmEdcoOkwQaFfvK0vjJoXhJ7keSj+NwaJUZsSybYYtSZGbUokn7ryFQvk07BM5YGjGur4a7kubovcvRl2CCBHfUpkN/t8dey8pJ1FBVSnRHS/OtyPQGPULkRyltHoGvYcFpJ7/Kx2bs4nr+FJjctsLILhuQ0P0ctFW7L9rmvQIWViLfmEBTwwOKp8N1PjivdT4Tvtpm6vVb2h9OX63tDoROV15PVDtt+OxKQVp0ZztHc/jQQF9afGdnN/2n0adOoigDXKU6Pqrmc6MQ2taTwRfTzdfALfk/lhapQn9/P8rnP/7vZ1qzw1KjPEOFSN8tSoPvfdv9cJ63PPU1rG47pdfS73xbGrOOxEBvUnwMbvvPWePQRlLfmEOy8wOGrnNVO7cOc9RzFi5zWDdPtMd33WiWhoheaJaHjME5jGxPwgVDflpvT12GZzM7pTY/KqBghcI6uBQdi8chGBbWQuGoStOFwfvu5uRiJrtR8Bl3vbujc08tb2sejcDK4u+fdoDpLij57LeaseCZ2eKcNbvls/lEVXzurFtABjjAPX41sK2AXwavVHQXYo7irdS8A1IzwKPpUly9NF5LZDPArC7erLu/y4L/JRsdhehwVGeRSc+2r4r+8vX05nnKmwUt9DmItFqnq996EdpPjwbPdhPqtQ5F9mL741B4wXs2AhF+oGuNsi36wr9StbsN2U260a5IP57I9cXRWiJGqRn5az+dVyHsaLNBAfPsyvrIb+QP9Bi4nqnZiLZLGUARITSCyo3gXUaAESk9U7SYlJJBZW70JKLERiUfUumodikQiJxCIkFlfv4rlMFzJMkViMxJLqXUKNliCxtHqXUmIpEqtIucoosQwvr1ptQfIgHCI0E4KUxFwIteaCZENgOoRadiHnQbYIkwhLYkaEWnkRzmWwEBFeRYFJEWrxRURax7wItf4iJiUxNUJRIBJSErMjFAsiJSUxQUIRIUiKBOYoWHIxEGCKAsVDsKRcLXDCJWCHxAwFioZAUCgDzFAQskNigoKIFcT8BIqEICBtY36ChB0S0xMoDgJJDonpCRQH1d5ASWJ6JEuPxPRITQ/pmRLTI1l6pJPPND2kC0tMj2TpkZgeqUgISF+XmB+p+SF9XWJ+ZMJlI4n5kSkbFBLzIzM2dUjMT7hkU0eICQo1QdlcRotU4jFDTFCoaJBk2gwxQ6Hk1j109pyQDd4QMxSyARRigsKYDd4QExSyARRigsKUFcT8hBkbvCHmJ2LjJ8L0RIIN3gjTEwWsc0SYnkiyzhFhfiJFgiT3v8gpCxQLktz/IkxQpFiQ9IwwQZGiQZLpKMIMRSmbuCJMUZSxC48ZihUPkkxcMaYoZsu1GDMU6wAiE1eMGYrZAIoxQbEmiExcMSYoZgModio3zQ+Z4WLMT8wGUIzpiRUHMiOHxPTELD0xpidZspkjwfQkgo2LBPOTBGwqTDA/iWIhXJKFKyYo0WU1GUEJJiiJeJyYoSTmcTrldcLjxBQlioeQjN8EU5SwFCWYolTxQJ4BUsxQym9BKWYo5XNcihlK+RyXYoZSzRB5QEoxQ6miISTPSClmKFU0hGTySDFDqWaIzAmpcwbSDJGhnmKGUpahFDOUKR7Iw1yGGcoUDeQ5LcMEZYoF8qSWYX4yye4CGeYnC1nOM8xPFrGcZ5ifTPND48T8ZJof+lCJ+ckUCRGZkTLnmJqx+1rmnlSX7OTrz6CsYKdffwZlA3YB6s+grGSXoP4MyobsItSfQVndSiArtfozKKtYicjKqv4MyipeIjKg68+gLFva1R9BUUVNREZ//RmQ1W2EiD6Pn7UYFDURfSJ3mwyCPSMJt8ugewlk9hVum0E3EyL6pO82GnQ7IaLP+m6rQTcUInLbF26zQbcUGGdw2w2CJ83tN+iuQkz7o9NxELqxENMQnKaD0K2FmGn3uJ0hxUxM+6PTeRC6vxDTTub0HoRuMcS0kzntB6G7DDHtZE4HQgQdseb0IATfhBBOF0LoXgNDhdOHELrbENMe6XQiBN+KEE4vQuiOQ0xnPacbIXTTgclk0u3oadZoR3daEkJ3HhKyJBNOV0Lo3kNCtx+dvoTQ3QfGe53OhNANiIT2Xqc5IXQLIqG912lPCN2ESMiNTTgNCqHbEAntvU6LQuhGRBKT4zpNCqFbEQntOk6bQvB9ChG6rdiQdx2nVSF0R4LxdKdbIXRPglkyp18hdFsioXOv07IQujPBuJnTtRC6N8Etr0Obbk8ktKs7rQuhGxQp3Wd3mhdCtyhS2tWd9oWIeNqc/oXQXYqU9vTI7aEralLa050ehtCdipTO004XQ+heRco05x3adLcipfO008kQumGR0p7uNDOEblmktOuYdob+rks9zV/9RJL+zuvqqvle/9vs2nwRJuxXcd9movrn+3xW7Y31a2BeQ/MamdekfpVGTho5aeSqUKtfjXxo5Cs31a+R0avmpF9jYzc2erHRi41ebOQS85qaV1XR1f8Rgf2P/YvFKCxIYVEpl6r+8739dk+9UwtY/3AWWJkILE3EKdmfGQF6MdCLOb3mqa2togxaxYg12DxmFigCEqOQUXRnlwGUZkVlyuvemIchtSMEYITQcJgYJpLYcCX6RrR3vLfjRnD9RNcAZ6ohWMGkYzL6tqFWDRi0uK3bCM5b1G8BNleZtkOBNbGLmjAj1A/4O5YfzYMMAZ9glJibhlKv76Ktr1oE1C7BAi471M1DeR7AZUbtKCnMDFHADWOulW71EsCB4CevJ11N3jzIFUwessGbrdXv1ZNLgW4CdLlA0E+JurdPiQLOI1vllFO219CD+cJ1klzYmssTgVoK1EJumc5dXIRQz2RWm1FNjkvNaxbZTMlFEXrYBTAi4ZyMHxt/jmyI25A3RlLz9yy0RjnXax6KD3IJcJrAxGCY8fpqX2uurDyWW8RIADxIcvHb3hIH8gDM+AHrAmcZPwDLFdhdjl1yrU7kLuC7KRf01K4BHCIy217GLV1z5SIAD+yy7ls/5LVKm7f7ctv+MjBAAdw55jY9/SMYwDKInMAWDR26hN+EYIiEI6xVvTXXxIMwTGA4cemmHWHfPJQCbFgwWpZcKLdjnMw9ccDxIIqAI8/8HDRYQLB+nA5RLQC4kYm1jAuT9pJJsDPADM/WG+DiYrDccG+3RYNgI908QBPwDba2xLhMwq24ekhK3lwsRmzWKczBMZeu1DDtzW+Adpj4lzbVii40u8P6E8qzcCU5Cq3iecoAi8GC1x5Pwoe2l8YPRMDFX/PADjACTJdsoWGfEL/XT4g/mKfiA3cEo7Ac3OEaIwQ6KYe40ukscCLIPlvg1zcrg1CFHhywWua5zCBWAVmBcfzQbJUJN2176SIaCMCW3NzhRerA32FhyG5QzbX3IGzhYSFi0R42+hd5CxRkAuY2Ljjcghxm1IALDHWv/ba51x5owxIp4DKb+SlfABT6A7cB1w9S/KQfpAhcCWRUk1C5RdquvuztFcCAGehVEWucCmPAaWaPv0tbg0lu7eonOIA1Q5mIcw0tAbWgQ9lTpLAlkAi58LB3EAEPg5zZUlOw1QBZgoC44NT0I1lBHgFWUxZspdSdSKCHC24/NA8oczwd+JxZtYyjrH5cpqMPTNvajyPP3kAKlFGZz3ld8+hWsG7AXVMuprvXDGYUtkuiL0JvLuwHqwZXPOKqB3V3OPBVaJE9FtjbHIAt6JkRh7S+jxlYg8WB7agJNl+bX1oFWR6kFMkxqh6Jt7aPxAPswCaEbYQtuRmrQfLd+SDAMzNbHSw536Q4Qu0zzknA7XHAL2FasW1FEXIOevyzvF2pI6yaBJoDaFAxus0z0oBrQsKXnHPpm3XAbGEosc2706E6R+FeDfQTjmfzW0vAOwDEwJ7LueVx20Mx3OdkU4NzK6R+2RIkWUANe1wiSu0EekNIbo4f5rOH4iHfFLtK6urD9+//B4V1jxsTiAAA"; \ No newline at end of file diff --git a/docs/classes/FilenSDK.html b/docs/classes/FilenSDK.html new file mode 100644 index 00000000..ff6d079f --- /dev/null +++ b/docs/classes/FilenSDK.html @@ -0,0 +1,26 @@ +FilenSDK | @filen/filen-sdk

FilenSDK

+

Date

2/1/2024 - 2:45:02 AM

+

Export

Constructors

Properties

Methods

Constructors

Properties

_api: API
_crypto: Crypto
utils: {
    convertTimestampToMs: ((timestamp) => number);
    sleep: ((ms) => Promise<void>);
} = utils

Type declaration

  • convertTimestampToMs: ((timestamp) => number)
      • (timestamp): number
      • Convert a UNIX style timestamp (in seconds) to milliseconds

        +

        Parameters

        • timestamp: number

        Returns number

        Date

        1/31/2024 - 4:10:35 PM

        +

        Export

  • sleep: ((ms) => Promise<void>)
      • (ms): Promise<void>
      • "Sleep" for given milliseconds.

        +

        Parameters

        • ms: number

        Returns Promise<void>

        Date

        1/31/2024 - 4:27:48 PM

        +

        Export

        Async

Methods

  • Returns an instance of the API wrapper based on the given API version.

    +

    Parameters

    • version: number

    Returns {
        dir: (() => {
            content: (() => DirContent);
        });
        health: (() => Health);
    }

    Date

    1/31/2024 - 4:28:59 PM

    +
  • Private

    Check if the SDK user is authenticated.

    +

    Returns boolean

    Date

    1/31/2024 - 4:08:17 PM

    +
  • Authenticate.

    +

    Returns Promise<void>

    Date

    1/31/2024 - 4:08:44 PM

    +

    Async

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.API.html b/docs/classes/_internal_.API.html new file mode 100644 index 00000000..d8d8b15b --- /dev/null +++ b/docs/classes/_internal_.API.html @@ -0,0 +1,5 @@ +API | @filen/filen-sdk

Constructors

Properties

Methods

v3 +

Constructors

Properties

apiClient: APIClient = ...
config: APIConfig = ...

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.APIClient.html b/docs/classes/_internal_.APIClient.html new file mode 100644 index 00000000..1c65addb --- /dev/null +++ b/docs/classes/_internal_.APIClient.html @@ -0,0 +1,19 @@ +APIClient | @filen/filen-sdk

APIClient

+

Date

2/1/2024 - 2:45:15 AM

+

Export

Constructors

Properties

Methods

Constructors

Properties

config: APIClientConfig = ...

Methods

  • Private

    Build API request headers

    +

    Returns Record<string, string>

    Date

    1/31/2024 - 4:09:33 PM

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.AxiosHeaders.html b/docs/classes/_internal_.AxiosHeaders.html new file mode 100644 index 00000000..f40145b7 --- /dev/null +++ b/docs/classes/_internal_.AxiosHeaders.html @@ -0,0 +1,32 @@ +AxiosHeaders | @filen/filen-sdk

Indexable

[key: string]: any

Constructors

Methods

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • headerName: string
    • parser: RegExp

    Returns null | RegExpExecArray

  • Parameters

    Returns AxiosHeaderValue

  • Parameters

    • Optional parser: RegExp

    Returns null | RegExpExecArray

  • Parameters

    Returns AxiosHeaderValue

  • Parameters

    • Optional parser: RegExp

    Returns null | RegExpExecArray

  • Parameters

    Returns AxiosHeaderValue

  • Parameters

    • Optional parser: RegExp

    Returns null | RegExpExecArray

  • Parameters

    Returns AxiosHeaderValue

  • Parameters

    • Optional parser: RegExp

    Returns null | RegExpExecArray

  • Parameters

    Returns AxiosHeaderValue

  • Parameters

    • Optional parser: RegExp

    Returns null | RegExpExecArray

  • Parameters

    Returns AxiosHeaderValue

  • Parameters

    • Optional parser: RegExp

    Returns null | RegExpExecArray

  • Parameters

    Returns AxiosHeaderValue

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • header: string | string[]

    Returns AxiosHeaders

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.Crypto.html b/docs/classes/_internal_.Crypto.html new file mode 100644 index 00000000..1abe05fc --- /dev/null +++ b/docs/classes/_internal_.Crypto.html @@ -0,0 +1,26 @@ +Crypto | @filen/filen-sdk

Crypto

+

Date

2/1/2024 - 2:44:47 AM

+

Export

Constructors

Properties

Methods

Constructors

Properties

_decrypt: Decrypt
_encrypt: Encrypt
config: CryptoConfig
utils: {
    base64ToBuffer: ((base64) => Uint8Array);
    bufferToBase64: ((param0) => string);
    bufferToHex: ((param0) => string);
    deriveKeyFromPassword: ((param0) => Promise<string | Uint8Array>);
    generateRandomString: ((param0) => string);
} = utils

Type declaration

  • base64ToBuffer: ((base64) => Uint8Array)
      • (base64): Uint8Array
      • Convert base64 to a buffer

        +

        Parameters

        • base64: string

        Returns Uint8Array

        Date

        1/31/2024 - 4:04:21 PM

        +

        Export

  • bufferToBase64: ((param0) => string)
      • (param0): string
      • Convert a buffer to base64

        +

        Parameters

        • param0: {
              buffer: Buffer | Uint8Array | ArrayBuffer;
          }
          • buffer: Buffer | Uint8Array | ArrayBuffer

        Returns string

        Date

        1/31/2024 - 4:01:49 PM

        +

        Export

  • bufferToHex: ((param0) => string)
      • (param0): string
      • Convert a buffer to a hex string

        +

        Parameters

        • param0: {
              buffer: Buffer | Uint8Array | ArrayBuffer;
          }
          • buffer: Buffer | Uint8Array | ArrayBuffer

        Returns string

        Date

        1/31/2024 - 4:03:03 PM

        +

        Export

  • deriveKeyFromPassword: ((param0) => Promise<string | Uint8Array>)
      • (param0): Promise<string | Uint8Array>
      • Derive a key from given inputs using PBKDF2

        +

        Parameters

        • param0: {
              bitLength: 256 | 512;
              hash: "sha512";
              iterations: number;
              password: string;
              returnHex: boolean;
              salt: string;
          }
          • bitLength: 256 | 512
          • hash: "sha512"
          • iterations: number
          • password: string
          • returnHex: boolean
          • salt: string

        Returns Promise<string | Uint8Array>

        Date

        1/31/2024 - 4:03:29 PM

        +

        Export

        Async

  • generateRandomString: ((param0) => string)
      • (param0): string
      • Generate a cryptographically secure random string of given length

        +

        Parameters

        • param0: {
              length: number;
          }
          • length: number

        Returns string

        Date

        1/31/2024 - 4:01:20 PM

        +

        Export

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.Decrypt.html b/docs/classes/_internal_.Decrypt.html new file mode 100644 index 00000000..37608d01 --- /dev/null +++ b/docs/classes/_internal_.Decrypt.html @@ -0,0 +1,18 @@ +Decrypt | @filen/filen-sdk

Decrypt

+

Date

1/31/2024 - 6:36:57 PM

+

Export

Constructors

Properties

config: CryptoConfig
textDecoder: TextDecoder = ...
textEncoder: TextEncoder = ...

Methods

  • Decrypt a string with the given key.

    +

    Parameters

    • param0: {
          key: string;
          metadata: string;
      }
      • key: string
      • metadata: string

    Returns Promise<string>

    Date

    1/31/2024 - 3:58:27 PM

    +

    Async

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.DirContent.html b/docs/classes/_internal_.DirContent.html new file mode 100644 index 00000000..b6f857a7 --- /dev/null +++ b/docs/classes/_internal_.DirContent.html @@ -0,0 +1,8 @@ +DirContent | @filen/filen-sdk

DirContent

+

Date

2/1/2024 - 3:22:32 AM

+

Export

Constructors

Properties

Methods

Constructors

Properties

apiClient: APIClient

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.Encrypt.html b/docs/classes/_internal_.Encrypt.html new file mode 100644 index 00000000..31c79b5c --- /dev/null +++ b/docs/classes/_internal_.Encrypt.html @@ -0,0 +1,12 @@ +Encrypt | @filen/filen-sdk

Encrypt

+

Date

2/1/2024 - 2:44:28 AM

+

Export

Constructors

Properties

Methods

Constructors

Properties

config: CryptoConfig
textDecoder: TextDecoder = ...
textEncoder: TextEncoder = ...

Methods

  • Encrypt a string using the user's last master key.

    +

    Parameters

    • param0: {
          data: string;
      }
      • data: string

    Returns Promise<string>

    Date

    1/31/2024 - 3:59:29 PM

    +

    Async

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/_internal_.Health.html b/docs/classes/_internal_.Health.html new file mode 100644 index 00000000..053ef4e3 --- /dev/null +++ b/docs/classes/_internal_.Health.html @@ -0,0 +1,8 @@ +Health | @filen/filen-sdk

Health

+

Date

2/1/2024 - 3:23:04 AM

+

Export

Constructors

Properties

Methods

Constructors

Properties

apiClient: APIClient

Methods

  • Returns "OK" when API is healthy.

    +

    Returns Promise<"OK">

    Date

    2/1/2024 - 3:23:14 AM

    +

    Async

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/default.html b/docs/classes/default.html deleted file mode 100644 index 16a86d1d..00000000 --- a/docs/classes/default.html +++ /dev/null @@ -1,24 +0,0 @@ -default | filen-sdk

Class default

Constructors

Properties

Methods

Constructors

Properties

_api: default
_crypto: default
utils: {
    convertTimestampToMs: ((timestamp) => number);
    sleep: ((ms) => Promise<void>);
} = utils

Type declaration

  • convertTimestampToMs: ((timestamp) => number)
      • (timestamp): number
      • Convert a UNIX style timestamp (in seconds) to milliseconds

        -

        Parameters

        • timestamp: number

        Returns number

        Date

        1/31/2024 - 4:10:35 PM

        -

        Export

  • sleep: ((ms) => Promise<void>)
      • (ms): Promise<void>
      • "Sleep" for given milliseconds.

        -

        Parameters

        • ms: number

        Returns Promise<void>

        Date

        1/31/2024 - 4:27:48 PM

        -

        Export

        Async

Methods

  • Returns an instance of the API wrapper based on the given API version.

    -

    Parameters

    • version: number

    Returns {
        dir: (() => {
            content: (() => default);
        });
        health: (() => default);
    }

    • dir: (() => {
          content: (() => default);
      })
        • (): {
              content: (() => default);
          }
        • Returns {
              content: (() => default);
          }

          • content: (() => default)
              • (): default
              • Returns default

    • health: (() => default)
        • (): default
        • Returns default

    Date

    1/31/2024 - 4:28:59 PM

    -
  • Returns a Filen Crypto instance.

    -

    Returns default

    Date

    1/31/2024 - 4:29:49 PM

    -
  • Private

    Check if the SDK user is authenticated.

    -

    Returns boolean

    Date

    1/31/2024 - 4:08:17 PM

    -
  • Authenticate.

    -

    Returns Promise<void>

    Date

    1/31/2024 - 4:08:44 PM

    -

    Async

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/_internal_.HttpStatusCode.html b/docs/enums/_internal_.HttpStatusCode.html new file mode 100644 index 00000000..bcd5289c --- /dev/null +++ b/docs/enums/_internal_.HttpStatusCode.html @@ -0,0 +1,64 @@ +HttpStatusCode | @filen/filen-sdk

Enumeration Members

Accepted: 202
AlreadyReported: 208
BadGateway: 502
BadRequest: 400
Conflict: 409
Continue: 100
Created: 201
EarlyHints: 103
ExpectationFailed: 417
FailedDependency: 424
Forbidden: 403
Found: 302
GatewayTimeout: 504
Gone: 410
HttpVersionNotSupported: 505
ImATeapot: 418
ImUsed: 226
InsufficientStorage: 507
InternalServerError: 500
LengthRequired: 411
Locked: 423
LoopDetected: 508
MethodNotAllowed: 405
MisdirectedRequest: 421
MovedPermanently: 301
MultiStatus: 207
MultipleChoices: 300
NetworkAuthenticationRequired: 511
NoContent: 204
NonAuthoritativeInformation: 203
NotAcceptable: 406
NotExtended: 510
NotFound: 404
NotImplemented: 501
NotModified: 304
Ok: 200
PartialContent: 206
PayloadTooLarge: 413
PaymentRequired: 402
PermanentRedirect: 308
PreconditionFailed: 412
PreconditionRequired: 428
Processing: 102
ProxyAuthenticationRequired: 407
RangeNotSatisfiable: 416
RequestHeaderFieldsTooLarge: 431
RequestTimeout: 408
ResetContent: 205
SeeOther: 303
ServiceUnavailable: 503
SwitchingProtocols: 101
TemporaryRedirect: 307
TooEarly: 425
TooManyRequests: 429
Unauthorized: 401
UnavailableForLegalReasons: 451
UnprocessableEntity: 422
UnsupportedMediaType: 415
Unused: 306
UpgradeRequired: 426
UriTooLong: 414
UseProxy: 305
VariantAlsoNegotiates: 506

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/_internal_.Error-1.html b/docs/functions/_internal_.Error-1.html new file mode 100644 index 00000000..bd9f8807 --- /dev/null +++ b/docs/functions/_internal_.Error-1.html @@ -0,0 +1,10 @@ +Error | @filen/filen-sdk
  • Parameters

    • Optional message: string

    Returns Error

Properties

prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

+

Type declaration

prototype: Error
stackTraceLimit: number

Methods

  • Create .stack property on a target object

    +

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/hierarchy.html b/docs/hierarchy.html new file mode 100644 index 00000000..8876fe90 --- /dev/null +++ b/docs/hierarchy.html @@ -0,0 +1 @@ +@filen/filen-sdk

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index b16004f3..eb38a483 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -filen-sdk

filen-sdk

Filen SDK for Node.JS, Browsers and React-Native

+@filen/filen-sdk

@filen/filen-sdk

Generated using TypeDoc

\ No newline at end of file +

! Work in progress !

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.ArrayLike.html b/docs/interfaces/_internal_.ArrayLike.html new file mode 100644 index 00000000..7a5c05ea --- /dev/null +++ b/docs/interfaces/_internal_.ArrayLike.html @@ -0,0 +1,2 @@ +ArrayLike | @filen/filen-sdk
interface ArrayLike<T> {
    length: number;
    [n: number]: T;
}

Type Parameters

  • T

Indexable

[n: number]: T

Properties

Properties

length: number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosAdapter.html b/docs/interfaces/_internal_.AxiosAdapter.html new file mode 100644 index 00000000..7c01b30e --- /dev/null +++ b/docs/interfaces/_internal_.AxiosAdapter.html @@ -0,0 +1 @@ +AxiosAdapter | @filen/filen-sdk
interface AxiosAdapter ((config) => AxiosPromise<any>)

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosBasicCredentials.html b/docs/interfaces/_internal_.AxiosBasicCredentials.html new file mode 100644 index 00000000..684f52fb --- /dev/null +++ b/docs/interfaces/_internal_.AxiosBasicCredentials.html @@ -0,0 +1,3 @@ +AxiosBasicCredentials | @filen/filen-sdk
interface AxiosBasicCredentials {
    password: string;
    username: string;
}

Properties

Properties

password: string
username: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosProgressEvent.html b/docs/interfaces/_internal_.AxiosProgressEvent.html new file mode 100644 index 00000000..ea91a4cb --- /dev/null +++ b/docs/interfaces/_internal_.AxiosProgressEvent.html @@ -0,0 +1,10 @@ +AxiosProgressEvent | @filen/filen-sdk
interface AxiosProgressEvent {
    bytes: number;
    download?: boolean;
    estimated?: number;
    event?: any;
    loaded: number;
    progress?: number;
    rate?: number;
    total?: number;
    upload?: boolean;
}

Properties

bytes: number
download?: boolean
estimated?: number
event?: any
loaded: number
progress?: number
rate?: number
total?: number
upload?: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosProxyConfig.html b/docs/interfaces/_internal_.AxiosProxyConfig.html new file mode 100644 index 00000000..f978906a --- /dev/null +++ b/docs/interfaces/_internal_.AxiosProxyConfig.html @@ -0,0 +1,5 @@ +AxiosProxyConfig | @filen/filen-sdk
interface AxiosProxyConfig {
    auth?: AxiosBasicCredentials;
    host: string;
    port: number;
    protocol?: string;
}

Properties

Properties

host: string
port: number
protocol?: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosRequestConfig.html b/docs/interfaces/_internal_.AxiosRequestConfig.html new file mode 100644 index 00000000..852430d8 --- /dev/null +++ b/docs/interfaces/_internal_.AxiosRequestConfig.html @@ -0,0 +1,42 @@ +AxiosRequestConfig | @filen/filen-sdk

Interface AxiosRequestConfig<D>

interface AxiosRequestConfig<D> {
    adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
    auth?: AxiosBasicCredentials;
    baseURL?: string;
    beforeRedirect?: ((options, responseDetails) => void);
    cancelToken?: CancelToken;
    data?: D;
    decompress?: boolean;
    env?: {
        FormData?: (new (...args) => object);
    };
    family?: AddressFamily;
    formSerializer?: FormSerializerOptions;
    headers?: AxiosHeaders | Partial<RawAxiosHeaders & {
        Accept: AxiosHeaderValue;
        Authorization: AxiosHeaderValue;
        Content-Encoding: AxiosHeaderValue;
        Content-Length: AxiosHeaderValue;
        User-Agent: AxiosHeaderValue;
    } & {
        Content-Type: ContentType;
    }> & Partial<{
        delete: AxiosHeaders;
        get: AxiosHeaders;
        head: AxiosHeaders;
        link: AxiosHeaders;
        options: AxiosHeaders;
        patch: AxiosHeaders;
        post: AxiosHeaders;
        purge: AxiosHeaders;
        put: AxiosHeaders;
        unlink: AxiosHeaders;
    } & {
        common: AxiosHeaders;
    }>;
    httpAgent?: any;
    httpsAgent?: any;
    insecureHTTPParser?: boolean;
    lookup?: ((hostname, options, cb) => void) | ((hostname, options) => Promise<LookupAddress | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]>);
    maxBodyLength?: number;
    maxContentLength?: number;
    maxRate?: number | [number, number];
    maxRedirects?: number;
    method?: string;
    onDownloadProgress?: ((progressEvent) => void);
    onUploadProgress?: ((progressEvent) => void);
    params?: any;
    paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
    proxy?: false | AxiosProxyConfig;
    responseEncoding?: string;
    responseType?: ResponseType;
    signal?: GenericAbortSignal;
    socketPath?: null | string;
    timeout?: number;
    timeoutErrorMessage?: string;
    transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
    transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
    transitional?: TransitionalOptions;
    transport?: any;
    url?: string;
    validateStatus?: null | ((status) => boolean);
    withCredentials?: boolean;
    withXSRFToken?: boolean | ((config) => undefined | boolean);
    xsrfCookieName?: string;
    xsrfHeaderName?: string;
}

Type Parameters

  • D = any

Hierarchy (view full)

Properties

baseURL?: string
beforeRedirect?: ((options, responseDetails) => void)

Type declaration

    • (options, responseDetails): void
    • Parameters

      Returns void

cancelToken?: CancelToken
data?: D
decompress?: boolean
env?: {
    FormData?: (new (...args) => object);
}

Type declaration

  • Optional FormData?: (new (...args) => object)
      • new (...args): object
      • Parameters

        • Rest ...args: any[]

        Returns object

family?: AddressFamily
formSerializer?: FormSerializerOptions
headers?: AxiosHeaders | Partial<RawAxiosHeaders & {
    Accept: AxiosHeaderValue;
    Authorization: AxiosHeaderValue;
    Content-Encoding: AxiosHeaderValue;
    Content-Length: AxiosHeaderValue;
    User-Agent: AxiosHeaderValue;
} & {
    Content-Type: ContentType;
}> & Partial<{
    delete: AxiosHeaders;
    get: AxiosHeaders;
    head: AxiosHeaders;
    link: AxiosHeaders;
    options: AxiosHeaders;
    patch: AxiosHeaders;
    post: AxiosHeaders;
    purge: AxiosHeaders;
    put: AxiosHeaders;
    unlink: AxiosHeaders;
} & {
    common: AxiosHeaders;
}>
httpAgent?: any
httpsAgent?: any
insecureHTTPParser?: boolean
lookup?: ((hostname, options, cb) => void) | ((hostname, options) => Promise<LookupAddress | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]>)

Type declaration

    • (hostname, options, cb): void
    • Parameters

      Returns void

Type declaration

maxBodyLength?: number
maxContentLength?: number
maxRate?: number | [number, number]
maxRedirects?: number
method?: string
onDownloadProgress?: ((progressEvent) => void)

Type declaration

onUploadProgress?: ((progressEvent) => void)

Type declaration

params?: any
proxy?: false | AxiosProxyConfig
responseEncoding?: string
responseType?: ResponseType
socketPath?: null | string
timeout?: number
timeoutErrorMessage?: string
transitional?: TransitionalOptions
transport?: any
url?: string
validateStatus?: null | ((status) => boolean)

Type declaration

    • (status): boolean
    • Parameters

      • status: number

      Returns boolean

withCredentials?: boolean
withXSRFToken?: boolean | ((config) => undefined | boolean)

Type declaration

xsrfCookieName?: string
xsrfHeaderName?: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosRequestTransformer.html b/docs/interfaces/_internal_.AxiosRequestTransformer.html new file mode 100644 index 00000000..c330b472 --- /dev/null +++ b/docs/interfaces/_internal_.AxiosRequestTransformer.html @@ -0,0 +1 @@ +AxiosRequestTransformer | @filen/filen-sdk

Interface AxiosRequestTransformer

interface AxiosRequestTransformer ((this, data, headers) => any)

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosResponse.html b/docs/interfaces/_internal_.AxiosResponse.html new file mode 100644 index 00000000..2e2beba8 --- /dev/null +++ b/docs/interfaces/_internal_.AxiosResponse.html @@ -0,0 +1,7 @@ +AxiosResponse | @filen/filen-sdk

Interface AxiosResponse<T, D>

interface AxiosResponse<T, D> {
    config: InternalAxiosRequestConfig<D>;
    data: T;
    headers: AxiosResponseHeaders | Partial<RawAxiosHeaders & {
        Cache-Control: AxiosHeaderValue;
        Content-Encoding: AxiosHeaderValue;
        Content-Length: AxiosHeaderValue;
        Content-Type: AxiosHeaderValue;
        Server: AxiosHeaderValue;
    } & {
        set-cookie: string[];
    }>;
    request?: any;
    status: number;
    statusText: string;
}

Type Parameters

  • T = any

  • D = any

Properties

data: T
headers: AxiosResponseHeaders | Partial<RawAxiosHeaders & {
    Cache-Control: AxiosHeaderValue;
    Content-Encoding: AxiosHeaderValue;
    Content-Length: AxiosHeaderValue;
    Content-Type: AxiosHeaderValue;
    Server: AxiosHeaderValue;
} & {
    set-cookie: string[];
}>
request?: any
status: number
statusText: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.AxiosResponseTransformer.html b/docs/interfaces/_internal_.AxiosResponseTransformer.html new file mode 100644 index 00000000..c78b6d0a --- /dev/null +++ b/docs/interfaces/_internal_.AxiosResponseTransformer.html @@ -0,0 +1 @@ +AxiosResponseTransformer | @filen/filen-sdk

Interface AxiosResponseTransformer

interface AxiosResponseTransformer ((this, data, headers, status?) => any)

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.Buffer.html b/docs/interfaces/_internal_.Buffer.html new file mode 100644 index 00000000..4653493a --- /dev/null +++ b/docs/interfaces/_internal_.Buffer.html @@ -0,0 +1,760 @@ +Buffer | @filen/filen-sdk
interface Buffer {
    BYTES_PER_ELEMENT: number;
    [toStringTag]: "Uint8Array";
    buffer: ArrayBufferLike;
    byteLength: number;
    byteOffset: number;
    length: number;
    [iterator](): IterableIterator<number>;
    at(index): undefined | number;
    compare(target, targetStart?, targetEnd?, sourceStart?, sourceEnd?): 0 | 1 | -1;
    copy(target, targetStart?, sourceStart?, sourceEnd?): number;
    copyWithin(target, start, end?): this;
    entries(): IterableIterator<[number, number]>;
    equals(otherBuffer): boolean;
    every(predicate, thisArg?): boolean;
    fill(value, offset?, end?, encoding?): this;
    filter(predicate, thisArg?): Uint8Array;
    find(predicate, thisArg?): undefined | number;
    findIndex(predicate, thisArg?): number;
    forEach(callbackfn, thisArg?): void;
    includes(value, byteOffset?, encoding?): boolean;
    indexOf(value, byteOffset?, encoding?): number;
    join(separator?): string;
    keys(): IterableIterator<number>;
    lastIndexOf(value, byteOffset?, encoding?): number;
    map(callbackfn, thisArg?): Uint8Array;
    readBigInt64BE(offset?): bigint;
    readBigInt64LE(offset?): bigint;
    readBigUInt64BE(offset?): bigint;
    readBigUInt64LE(offset?): bigint;
    readBigUint64BE(offset?): bigint;
    readBigUint64LE(offset?): bigint;
    readDoubleBE(offset?): number;
    readDoubleLE(offset?): number;
    readFloatBE(offset?): number;
    readFloatLE(offset?): number;
    readInt16BE(offset?): number;
    readInt16LE(offset?): number;
    readInt32BE(offset?): number;
    readInt32LE(offset?): number;
    readInt8(offset?): number;
    readIntBE(offset, byteLength): number;
    readIntLE(offset, byteLength): number;
    readUInt16BE(offset?): number;
    readUInt16LE(offset?): number;
    readUInt32BE(offset?): number;
    readUInt32LE(offset?): number;
    readUInt8(offset?): number;
    readUIntBE(offset, byteLength): number;
    readUIntLE(offset, byteLength): number;
    readUint16BE(offset?): number;
    readUint16LE(offset?): number;
    readUint32BE(offset?): number;
    readUint32LE(offset?): number;
    readUint8(offset?): number;
    readUintBE(offset, byteLength): number;
    readUintLE(offset, byteLength): number;
    reduce(callbackfn): number;
    reduce(callbackfn, initialValue): number;
    reduce<U>(callbackfn, initialValue): U;
    reduceRight(callbackfn): number;
    reduceRight(callbackfn, initialValue): number;
    reduceRight<U>(callbackfn, initialValue): U;
    reverse(): this;
    set(array, offset?): void;
    slice(start?, end?): Buffer;
    some(predicate, thisArg?): boolean;
    sort(compareFn?): this;
    subarray(start?, end?): Buffer;
    swap16(): Buffer;
    swap32(): Buffer;
    swap64(): Buffer;
    toJSON(): {
        data: number[];
        type: "Buffer";
    };
    toLocaleString(): string;
    toString(encoding?, start?, end?): string;
    valueOf(): Uint8Array;
    values(): IterableIterator<number>;
    write(string, encoding?): number;
    write(string, offset, encoding?): number;
    write(string, offset, length, encoding?): number;
    writeBigInt64BE(value, offset?): number;
    writeBigInt64LE(value, offset?): number;
    writeBigUInt64BE(value, offset?): number;
    writeBigUInt64LE(value, offset?): number;
    writeBigUint64BE(value, offset?): number;
    writeBigUint64LE(value, offset?): number;
    writeDoubleBE(value, offset?): number;
    writeDoubleLE(value, offset?): number;
    writeFloatBE(value, offset?): number;
    writeFloatLE(value, offset?): number;
    writeInt16BE(value, offset?): number;
    writeInt16LE(value, offset?): number;
    writeInt32BE(value, offset?): number;
    writeInt32LE(value, offset?): number;
    writeInt8(value, offset?): number;
    writeIntBE(value, offset, byteLength): number;
    writeIntLE(value, offset, byteLength): number;
    writeUInt16BE(value, offset?): number;
    writeUInt16LE(value, offset?): number;
    writeUInt32BE(value, offset?): number;
    writeUInt32LE(value, offset?): number;
    writeUInt8(value, offset?): number;
    writeUIntBE(value, offset, byteLength): number;
    writeUIntLE(value, offset, byteLength): number;
    writeUint16BE(value, offset?): number;
    writeUint16LE(value, offset?): number;
    writeUint32BE(value, offset?): number;
    writeUint32LE(value, offset?): number;
    writeUint8(value, offset?): number;
    writeUintBE(value, offset, byteLength): number;
    writeUintLE(value, offset, byteLength): number;
}

Hierarchy

  • Uint8Array
    • Buffer

Properties

BYTES_PER_ELEMENT: number

The size in bytes of each element in the array.

+
[toStringTag]: "Uint8Array"

The ArrayBuffer instance referenced by the array.

+
byteLength: number

The length in bytes of the array.

+
byteOffset: number

The offset in bytes of the array.

+
length: number

The length of the array.

+

Methods

  • Returns IterableIterator<number>

  • Takes an integer value and returns the item at that index, +allowing for positive and negative integers. +Negative integers count back from the last item in the array.

    +

    Parameters

    • index: number

    Returns undefined | number

  • Compares buf with target and returns a number indicating whether bufcomes before, after, or is the same as target in sort order. +Comparison is based on the actual sequence of bytes in each Buffer.

    +
      +
    • 0 is returned if target is the same as buf
    • +
    • 1 is returned if target should come beforebuf when sorted.
    • +
    • -1 is returned if target should come afterbuf when sorted.
    • +
    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.from('ABC');
    const buf2 = Buffer.from('BCD');
    const buf3 = Buffer.from('ABCD');

    console.log(buf1.compare(buf1));
    // Prints: 0
    console.log(buf1.compare(buf2));
    // Prints: -1
    console.log(buf1.compare(buf3));
    // Prints: -1
    console.log(buf2.compare(buf1));
    // Prints: 1
    console.log(buf2.compare(buf3));
    // Prints: 1
    console.log([buf1, buf2, buf3].sort(Buffer.compare));
    // Prints: [ <Buffer 41 42 43>, <Buffer 41 42 43 44>, <Buffer 42 43 44> ]
    // (This result is equal to: [buf1, buf3, buf2].) +
    +

    The optional targetStart, targetEnd, sourceStart, and sourceEndarguments can be used to limit the comparison to specific ranges within targetand buf respectively.

    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
    const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);

    console.log(buf1.compare(buf2, 5, 9, 0, 4));
    // Prints: 0
    console.log(buf1.compare(buf2, 0, 6, 4));
    // Prints: -1
    console.log(buf1.compare(buf2, 5, 6, 5));
    // Prints: 1 +
    +

    ERR_OUT_OF_RANGE is thrown if targetStart < 0, sourceStart < 0,targetEnd > target.byteLength, or sourceEnd > source.byteLength.

    +

    Parameters

    • target: Uint8Array

      A Buffer or Uint8Array with which to compare buf.

      +
    • Optional targetStart: number

      The offset within target at which to begin comparison.

      +
    • Optional targetEnd: number

      The offset within target at which to end comparison (not inclusive).

      +
    • Optional sourceStart: number

      The offset within buf at which to begin comparison.

      +
    • Optional sourceEnd: number

      The offset within buf at which to end comparison (not inclusive).

      +

    Returns 0 | 1 | -1

    Since

    v0.11.13

    +
  • Copies data from a region of buf to a region in target, even if the targetmemory region overlaps with buf.

    +

    TypedArray.prototype.set() performs the same operation, and is available +for all TypedArrays, including Node.js Buffers, although it takes +different function arguments.

    +
    import { Buffer } from 'node:buffer';

    // Create two `Buffer` instances.
    const buf1 = Buffer.allocUnsafe(26);
    const buf2 = Buffer.allocUnsafe(26).fill('!');

    for (let i = 0; i < 26; i++) {
    // 97 is the decimal ASCII value for 'a'.
    buf1[i] = i + 97;
    }

    // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
    buf1.copy(buf2, 8, 16, 20);
    // This is equivalent to:
    // buf2.set(buf1.subarray(16, 20), 8);

    console.log(buf2.toString('ascii', 0, 25));
    // Prints: !!!!!!!!qrst!!!!!!!!!!!!! +
    +
    import { Buffer } from 'node:buffer';

    // Create a `Buffer` and copy data from one region to an overlapping region
    // within the same `Buffer`.

    const buf = Buffer.allocUnsafe(26);

    for (let i = 0; i < 26; i++) {
    // 97 is the decimal ASCII value for 'a'.
    buf[i] = i + 97;
    }

    buf.copy(buf, 0, 4, 10);

    console.log(buf.toString());
    // Prints: efghijghijklmnopqrstuvwxyz +
    +

    Parameters

    • target: Uint8Array

      A Buffer or Uint8Array to copy into.

      +
    • Optional targetStart: number

      The offset within target at which to begin writing.

      +
    • Optional sourceStart: number

      The offset within buf from which to begin copying.

      +
    • Optional sourceEnd: number

      The offset within buf at which to stop copying (not inclusive).

      +

    Returns number

    The number of bytes copied.

    +

    Since

    v0.1.90

    +
  • Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target

    +

    Parameters

    • target: number

      If target is negative, it is treated as length+target where length is the +length of the array.

      +
    • start: number

      If start is negative, it is treated as length+start. If end is negative, it +is treated as length+end.

      +
    • Optional end: number

      If not specified, length of the this object is used as its default value.

      +

    Returns this

  • Creates and returns an iterator of [index, byte] pairs from the contents +of buf.

    +
    import { Buffer } from 'node:buffer';

    // Log the entire contents of a `Buffer`.

    const buf = Buffer.from('buffer');

    for (const pair of buf.entries()) {
    console.log(pair);
    }
    // Prints:
    // [0, 98]
    // [1, 117]
    // [2, 102]
    // [3, 102]
    // [4, 101]
    // [5, 114] +
    +

    Returns IterableIterator<[number, number]>

    Since

    v1.1.0

    +
  • Returns true if both buf and otherBuffer have exactly the same bytes,false otherwise. Equivalent to buf.compare(otherBuffer) === 0.

    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.from('ABC');
    const buf2 = Buffer.from('414243', 'hex');
    const buf3 = Buffer.from('ABCD');

    console.log(buf1.equals(buf2));
    // Prints: true
    console.log(buf1.equals(buf3));
    // Prints: false +
    +

    Parameters

    • otherBuffer: Uint8Array

      A Buffer or Uint8Array with which to compare buf.

      +

    Returns boolean

    Since

    v0.11.13

    +
  • Determines whether all the members of an array satisfy the specified test.

    +

    Parameters

    • predicate: ((value, index, array) => unknown)

      A function that accepts up to three arguments. The every method calls +the predicate function for each element in the array until the predicate returns a value +which is coercible to the Boolean value false, or until the end of the array.

      +
        • (value, index, array): unknown
        • Parameters

          • value: number
          • index: number
          • array: Uint8Array

          Returns unknown

    • Optional thisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns boolean

  • Fills buf with the specified value. If the offset and end are not given, +the entire buf will be filled:

    +
    import { Buffer } from 'node:buffer';

    // Fill a `Buffer` with the ASCII character 'h'.

    const b = Buffer.allocUnsafe(50).fill('h');

    console.log(b.toString());
    // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

    // Fill a buffer with empty string
    const c = Buffer.allocUnsafe(5).fill('');

    console.log(c.fill(''));
    // Prints: <Buffer 00 00 00 00 00> +
    +

    value is coerced to a uint32 value if it is not a string, Buffer, or +integer. If the resulting integer is greater than 255 (decimal), buf will be +filled with value &#x26; 255.

    +

    If the final write of a fill() operation falls on a multi-byte character, +then only the bytes of that character that fit into buf are written:

    +
    import { Buffer } from 'node:buffer';

    // Fill a `Buffer` with character that takes up two bytes in UTF-8.

    console.log(Buffer.allocUnsafe(5).fill('\u0222'));
    // Prints: <Buffer c8 a2 c8 a2 c8> +
    +

    If value contains invalid characters, it is truncated; if no valid +fill data remains, an exception is thrown:

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(5);

    console.log(buf.fill('a'));
    // Prints: <Buffer 61 61 61 61 61>
    console.log(buf.fill('aazz', 'hex'));
    // Prints: <Buffer aa aa aa aa aa>
    console.log(buf.fill('zz', 'hex'));
    // Throws an exception. +
    +

    Parameters

    • value: string | number | Uint8Array

      The value with which to fill buf. Empty value (string, Uint8Array, Buffer) is coerced to 0.

      +
    • Optional offset: number

      Number of bytes to skip before starting to fill buf.

      +
    • Optional end: number

      Where to stop filling buf (not inclusive).

      +
    • Optional encoding: BufferEncoding

      The encoding for value if value is a string.

      +

    Returns this

    A reference to buf.

    +

    Since

    v0.5.0

    +
  • Returns the elements of an array that meet the condition specified in a callback function.

    +

    Parameters

    • predicate: ((value, index, array) => any)

      A function that accepts up to three arguments. The filter method calls +the predicate function one time for each element in the array.

      +
        • (value, index, array): any
        • Parameters

          • value: number
          • index: number
          • array: Uint8Array

          Returns any

    • Optional thisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns Uint8Array

  • Returns the value of the first element in the array where predicate is true, and undefined +otherwise.

    +

    Parameters

    • predicate: ((value, index, obj) => boolean)

      find calls predicate once for each element of the array, in ascending +order, until it finds one where predicate returns true. If such an element is found, find +immediately returns that element value. Otherwise, find returns undefined.

      +
        • (value, index, obj): boolean
        • Parameters

          • value: number
          • index: number
          • obj: Uint8Array

          Returns boolean

    • Optional thisArg: any

      If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

      +

    Returns undefined | number

  • Returns the index of the first element in the array where predicate is true, and -1 +otherwise.

    +

    Parameters

    • predicate: ((value, index, obj) => boolean)

      find calls predicate once for each element of the array, in ascending +order, until it finds one where predicate returns true. If such an element is found, +findIndex immediately returns that element index. Otherwise, findIndex returns -1.

      +
        • (value, index, obj): boolean
        • Parameters

          • value: number
          • index: number
          • obj: Uint8Array

          Returns boolean

    • Optional thisArg: any

      If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

      +

    Returns number

  • Performs the specified action for each element in an array.

    +

    Parameters

    • callbackfn: ((value, index, array) => void)

      A function that accepts up to three arguments. forEach calls the +callbackfn function one time for each element in the array.

      +
        • (value, index, array): void
        • Parameters

          • value: number
          • index: number
          • array: Uint8Array

          Returns void

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns void

  • Equivalent to buf.indexOf() !== -1.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('this is a buffer');

    console.log(buf.includes('this'));
    // Prints: true
    console.log(buf.includes('is'));
    // Prints: true
    console.log(buf.includes(Buffer.from('a buffer')));
    // Prints: true
    console.log(buf.includes(97));
    // Prints: true (97 is the decimal ASCII value for 'a')
    console.log(buf.includes(Buffer.from('a buffer example')));
    // Prints: false
    console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
    // Prints: true
    console.log(buf.includes('this', 4));
    // Prints: false +
    +

    Parameters

    • value: string | number | Buffer

      What to search for.

      +
    • Optional byteOffset: number

      Where to begin searching in buf. If negative, then offset is calculated from the end of buf.

      +
    • Optional encoding: BufferEncoding

      If value is a string, this is its encoding.

      +

    Returns boolean

    true if value was found in buf, false otherwise.

    +

    Since

    v5.3.0

    +
  • If value is:

    +
      +
    • a string, value is interpreted according to the character encoding inencoding.
    • +
    • a Buffer or Uint8Array, value will be used in its entirety. +To compare a partial Buffer, use buf.subarray.
    • +
    • a number, value will be interpreted as an unsigned 8-bit integer +value between 0 and 255.
    • +
    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('this is a buffer');

    console.log(buf.indexOf('this'));
    // Prints: 0
    console.log(buf.indexOf('is'));
    // Prints: 2
    console.log(buf.indexOf(Buffer.from('a buffer')));
    // Prints: 8
    console.log(buf.indexOf(97));
    // Prints: 8 (97 is the decimal ASCII value for 'a')
    console.log(buf.indexOf(Buffer.from('a buffer example')));
    // Prints: -1
    console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
    // Prints: 8

    const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');

    console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
    // Prints: 4
    console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
    // Prints: 6 +
    +

    If value is not a string, number, or Buffer, this method will throw aTypeError. If value is a number, it will be coerced to a valid byte value, +an integer between 0 and 255.

    +

    If byteOffset is not a number, it will be coerced to a number. If the result +of coercion is NaN or 0, then the entire buffer will be searched. This +behavior matches String.prototype.indexOf().

    +
    import { Buffer } from 'node:buffer';

    const b = Buffer.from('abcdef');

    // Passing a value that's a number, but not a valid byte.
    // Prints: 2, equivalent to searching for 99 or 'c'.
    console.log(b.indexOf(99.9));
    console.log(b.indexOf(256 + 99));

    // Passing a byteOffset that coerces to NaN or 0.
    // Prints: 1, searching the whole buffer.
    console.log(b.indexOf('b', undefined));
    console.log(b.indexOf('b', {}));
    console.log(b.indexOf('b', null));
    console.log(b.indexOf('b', [])); +
    +

    If value is an empty string or empty Buffer and byteOffset is less +than buf.length, byteOffset will be returned. If value is empty andbyteOffset is at least buf.length, buf.length will be returned.

    +

    Parameters

    • value: string | number | Uint8Array

      What to search for.

      +
    • Optional byteOffset: number

      Where to begin searching in buf. If negative, then offset is calculated from the end of buf.

      +
    • Optional encoding: BufferEncoding

      If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf.

      +

    Returns number

    The index of the first occurrence of value in buf, or -1 if buf does not contain value.

    +

    Since

    v1.5.0

    +
  • Adds all the elements of an array separated by the specified separator string.

    +

    Parameters

    • Optional separator: string

      A string used to separate one element of an array from the next in the +resulting String. If omitted, the array elements are separated with a comma.

      +

    Returns string

  • Creates and returns an iterator of buf keys (indices).

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('buffer');

    for (const key of buf.keys()) {
    console.log(key);
    }
    // Prints:
    // 0
    // 1
    // 2
    // 3
    // 4
    // 5 +
    +

    Returns IterableIterator<number>

    Since

    v1.1.0

    +
  • Identical to buf.indexOf(), except the last occurrence of value is found +rather than the first occurrence.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('this buffer is a buffer');

    console.log(buf.lastIndexOf('this'));
    // Prints: 0
    console.log(buf.lastIndexOf('buffer'));
    // Prints: 17
    console.log(buf.lastIndexOf(Buffer.from('buffer')));
    // Prints: 17
    console.log(buf.lastIndexOf(97));
    // Prints: 15 (97 is the decimal ASCII value for 'a')
    console.log(buf.lastIndexOf(Buffer.from('yolo')));
    // Prints: -1
    console.log(buf.lastIndexOf('buffer', 5));
    // Prints: 5
    console.log(buf.lastIndexOf('buffer', 4));
    // Prints: -1

    const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');

    console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
    // Prints: 6
    console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
    // Prints: 4 +
    +

    If value is not a string, number, or Buffer, this method will throw aTypeError. If value is a number, it will be coerced to a valid byte value, +an integer between 0 and 255.

    +

    If byteOffset is not a number, it will be coerced to a number. Any arguments +that coerce to NaN, like {} or undefined, will search the whole buffer. +This behavior matches String.prototype.lastIndexOf().

    +
    import { Buffer } from 'node:buffer';

    const b = Buffer.from('abcdef');

    // Passing a value that's a number, but not a valid byte.
    // Prints: 2, equivalent to searching for 99 or 'c'.
    console.log(b.lastIndexOf(99.9));
    console.log(b.lastIndexOf(256 + 99));

    // Passing a byteOffset that coerces to NaN.
    // Prints: 1, searching the whole buffer.
    console.log(b.lastIndexOf('b', undefined));
    console.log(b.lastIndexOf('b', {}));

    // Passing a byteOffset that coerces to 0.
    // Prints: -1, equivalent to passing 0.
    console.log(b.lastIndexOf('b', null));
    console.log(b.lastIndexOf('b', [])); +
    +

    If value is an empty string or empty Buffer, byteOffset will be returned.

    +

    Parameters

    • value: string | number | Uint8Array

      What to search for.

      +
    • Optional byteOffset: number

      Where to begin searching in buf. If negative, then offset is calculated from the end of buf.

      +
    • Optional encoding: BufferEncoding

      If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf.

      +

    Returns number

    The index of the last occurrence of value in buf, or -1 if buf does not contain value.

    +

    Since

    v6.0.0

    +
  • Calls a defined callback function on each element of an array, and returns an array that +contains the results.

    +

    Parameters

    • callbackfn: ((value, index, array) => number)

      A function that accepts up to three arguments. The map method calls the +callbackfn function one time for each element in the array.

      +
        • (value, index, array): number
        • Parameters

          • value: number
          • index: number
          • array: Uint8Array

          Returns number

    • Optional thisArg: any

      An object to which the this keyword can refer in the callbackfn function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns Uint8Array

  • Reads a signed, big-endian 64-bit integer from buf at the specified offset.

    +

    Integers read from a Buffer are interpreted as two's complement signed +values.

    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns bigint

    Since

    v12.0.0, v10.20.0

    +
  • Reads a signed, little-endian 64-bit integer from buf at the specifiedoffset.

    +

    Integers read from a Buffer are interpreted as two's complement signed +values.

    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns bigint

    Since

    v12.0.0, v10.20.0

    +
  • Reads an unsigned, big-endian 64-bit integer from buf at the specifiedoffset.

    +

    This function is also available under the readBigUint64BE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);

    console.log(buf.readBigUInt64BE(0));
    // Prints: 4294967295n +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns bigint

    Since

    v12.0.0, v10.20.0

    +
  • Reads an unsigned, little-endian 64-bit integer from buf at the specifiedoffset.

    +

    This function is also available under the readBigUint64LE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);

    console.log(buf.readBigUInt64LE(0));
    // Prints: 18446744069414584320n +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns bigint

    Since

    v12.0.0, v10.20.0

    +
  • Parameters

    • Optional offset: number

    Returns bigint

    Alias

    Buffer.readBigUInt64BE

    +

    Since

    v14.10.0, v12.19.0

    +
  • Parameters

    • Optional offset: number

    Returns bigint

    Alias

    Buffer.readBigUInt64LE

    +

    Since

    v14.10.0, v12.19.0

    +
  • Reads a 64-bit, big-endian double from buf at the specified offset.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);

    console.log(buf.readDoubleBE(0));
    // Prints: 8.20788039913184e-304 +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 8.

      +

    Returns number

    Since

    v0.11.15

    +
  • Reads a 64-bit, little-endian double from buf at the specified offset.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);

    console.log(buf.readDoubleLE(0));
    // Prints: 5.447603722011605e-270
    console.log(buf.readDoubleLE(1));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 8.

      +

    Returns number

    Since

    v0.11.15

    +
  • Reads a 32-bit, big-endian float from buf at the specified offset.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([1, 2, 3, 4]);

    console.log(buf.readFloatBE(0));
    // Prints: 2.387939260590663e-38 +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    Since

    v0.11.15

    +
  • Reads a 32-bit, little-endian float from buf at the specified offset.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([1, 2, 3, 4]);

    console.log(buf.readFloatLE(0));
    // Prints: 1.539989614439558e-36
    console.log(buf.readFloatLE(1));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    Since

    v0.11.15

    +
  • Reads a signed, big-endian 16-bit integer from buf at the specified offset.

    +

    Integers read from a Buffer are interpreted as two's complement signed values.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0, 5]);

    console.log(buf.readInt16BE(0));
    // Prints: 5 +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads a signed, little-endian 16-bit integer from buf at the specifiedoffset.

    +

    Integers read from a Buffer are interpreted as two's complement signed values.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0, 5]);

    console.log(buf.readInt16LE(0));
    // Prints: 1280
    console.log(buf.readInt16LE(1));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads a signed, big-endian 32-bit integer from buf at the specified offset.

    +

    Integers read from a Buffer are interpreted as two's complement signed values.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0, 0, 0, 5]);

    console.log(buf.readInt32BE(0));
    // Prints: 5 +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads a signed, little-endian 32-bit integer from buf at the specifiedoffset.

    +

    Integers read from a Buffer are interpreted as two's complement signed values.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0, 0, 0, 5]);

    console.log(buf.readInt32LE(0));
    // Prints: 83886080
    console.log(buf.readInt32LE(1));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads a signed 8-bit integer from buf at the specified offset.

    +

    Integers read from a Buffer are interpreted as two's complement signed values.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([-1, 5]);

    console.log(buf.readInt8(0));
    // Prints: -1
    console.log(buf.readInt8(1));
    // Prints: 5
    console.log(buf.readInt8(2));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1.

      +

    Returns number

    Since

    v0.5.0

    +
  • Reads byteLength number of bytes from buf at the specified offsetand interprets the result as a big-endian, two's complement signed value +supporting up to 48 bits of accuracy.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);

    console.log(buf.readIntBE(0, 6).toString(16));
    // Prints: 1234567890ab
    console.log(buf.readIntBE(1, 6).toString(16));
    // Throws ERR_OUT_OF_RANGE.
    console.log(buf.readIntBE(1, 0).toString(16));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to read. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    Since

    v0.11.15

    +
  • Reads byteLength number of bytes from buf at the specified offsetand interprets the result as a little-endian, two's complement signed value +supporting up to 48 bits of accuracy.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);

    console.log(buf.readIntLE(0, 6).toString(16));
    // Prints: -546f87a9cbee +
    +

    Parameters

    • offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to read. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    Since

    v0.11.15

    +
  • Reads an unsigned, big-endian 16-bit integer from buf at the specifiedoffset.

    +

    This function is also available under the readUint16BE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56]);

    console.log(buf.readUInt16BE(0).toString(16));
    // Prints: 1234
    console.log(buf.readUInt16BE(1).toString(16));
    // Prints: 3456 +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads an unsigned, little-endian 16-bit integer from buf at the specifiedoffset.

    +

    This function is also available under the readUint16LE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56]);

    console.log(buf.readUInt16LE(0).toString(16));
    // Prints: 3412
    console.log(buf.readUInt16LE(1).toString(16));
    // Prints: 5634
    console.log(buf.readUInt16LE(2).toString(16));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads an unsigned, big-endian 32-bit integer from buf at the specifiedoffset.

    +

    This function is also available under the readUint32BE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);

    console.log(buf.readUInt32BE(0).toString(16));
    // Prints: 12345678 +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads an unsigned, little-endian 32-bit integer from buf at the specifiedoffset.

    +

    This function is also available under the readUint32LE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);

    console.log(buf.readUInt32LE(0).toString(16));
    // Prints: 78563412
    console.log(buf.readUInt32LE(1).toString(16));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    Since

    v0.5.5

    +
  • Reads an unsigned 8-bit integer from buf at the specified offset.

    +

    This function is also available under the readUint8 alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([1, -2]);

    console.log(buf.readUInt8(0));
    // Prints: 1
    console.log(buf.readUInt8(1));
    // Prints: 254
    console.log(buf.readUInt8(2));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • Optional offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1.

      +

    Returns number

    Since

    v0.5.0

    +
  • Reads byteLength number of bytes from buf at the specified offsetand interprets the result as an unsigned big-endian integer supporting +up to 48 bits of accuracy.

    +

    This function is also available under the readUintBE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);

    console.log(buf.readUIntBE(0, 6).toString(16));
    // Prints: 1234567890ab
    console.log(buf.readUIntBE(1, 6).toString(16));
    // Throws ERR_OUT_OF_RANGE. +
    +

    Parameters

    • offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to read. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    Since

    v0.11.15

    +
  • Reads byteLength number of bytes from buf at the specified offsetand interprets the result as an unsigned, little-endian integer supporting +up to 48 bits of accuracy.

    +

    This function is also available under the readUintLE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);

    console.log(buf.readUIntLE(0, 6).toString(16));
    // Prints: ab9078563412 +
    +

    Parameters

    • offset: number

      Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to read. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    Since

    v0.11.15

    +
  • Parameters

    • Optional offset: number

    Returns number

    Alias

    Buffer.readUInt16BE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • Optional offset: number

    Returns number

    Alias

    Buffer.readUInt16LE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • Optional offset: number

    Returns number

    Alias

    Buffer.readUInt32BE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • Optional offset: number

    Returns number

    Alias

    Buffer.readUInt32LE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • Optional offset: number

    Returns number

    Alias

    Buffer.readUInt8

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • offset: number
    • byteLength: number

    Returns number

    Alias

    Buffer.readUIntBE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • offset: number
    • byteLength: number

    Returns number

    Alias

    Buffer.readUIntLE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function.

    +

    Parameters

    • callbackfn: ((previousValue, currentValue, currentIndex, array) => number)

      A function that accepts up to four arguments. The reduce method calls the +callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint8Array

          Returns number

    Returns number

  • Parameters

    • callbackfn: ((previousValue, currentValue, currentIndex, array) => number)
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint8Array

          Returns number

    • initialValue: number

    Returns number

  • Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function.

    +

    Type Parameters

    • U

    Parameters

    • callbackfn: ((previousValue, currentValue, currentIndex, array) => U)

      A function that accepts up to four arguments. The reduce method calls the +callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Uint8Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start +the accumulation. The first call to the callbackfn function provides this value as an argument +instead of an array value.

      +

    Returns U

  • Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function.

    +

    Parameters

    • callbackfn: ((previousValue, currentValue, currentIndex, array) => number)

      A function that accepts up to four arguments. The reduceRight method calls +the callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint8Array

          Returns number

    Returns number

  • Parameters

    • callbackfn: ((previousValue, currentValue, currentIndex, array) => number)
        • (previousValue, currentValue, currentIndex, array): number
        • Parameters

          • previousValue: number
          • currentValue: number
          • currentIndex: number
          • array: Uint8Array

          Returns number

    • initialValue: number

    Returns number

  • Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function.

    +

    Type Parameters

    • U

    Parameters

    • callbackfn: ((previousValue, currentValue, currentIndex, array) => U)

      A function that accepts up to four arguments. The reduceRight method calls +the callbackfn function one time for each element in the array.

      +
        • (previousValue, currentValue, currentIndex, array): U
        • Parameters

          • previousValue: U
          • currentValue: number
          • currentIndex: number
          • array: Uint8Array

          Returns U

    • initialValue: U

      If initialValue is specified, it is used as the initial value to start +the accumulation. The first call to the callbackfn function provides this value as an argument +instead of an array value.

      +

    Returns U

  • Returns this

  • Sets a value or an array of values.

    +

    Parameters

    • array: ArrayLike<number>

      A typed or untyped array of values to set.

      +
    • Optional offset: number

      The index in the current array at which the values are to be written.

      +

    Returns void

  • Returns a new Buffer that references the same memory as the original, but +offset and cropped by the start and end indices.

    +

    This method is not compatible with the Uint8Array.prototype.slice(), +which is a superclass of Buffer. To copy the slice, useUint8Array.prototype.slice().

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('buffer');

    const copiedBuf = Uint8Array.prototype.slice.call(buf);
    copiedBuf[0]++;
    console.log(copiedBuf.toString());
    // Prints: cuffer

    console.log(buf.toString());
    // Prints: buffer

    // With buf.slice(), the original buffer is modified.
    const notReallyCopiedBuf = buf.slice();
    notReallyCopiedBuf[0]++;
    console.log(notReallyCopiedBuf.toString());
    // Prints: cuffer
    console.log(buf.toString());
    // Also prints: cuffer (!) +
    +

    Parameters

    • Optional start: number

      Where the new Buffer will start.

      +
    • Optional end: number

      Where the new Buffer will end (not inclusive).

      +

    Returns Buffer

    Since

    v0.3.0

    +

    Deprecated

    Use subarray instead.

    +
  • Determines whether the specified callback function returns true for any element of an array.

    +

    Parameters

    • predicate: ((value, index, array) => unknown)

      A function that accepts up to three arguments. The some method calls +the predicate function for each element in the array until the predicate returns a value +which is coercible to the Boolean value true, or until the end of the array.

      +
        • (value, index, array): unknown
        • Parameters

          • value: number
          • index: number
          • array: Uint8Array

          Returns unknown

    • Optional thisArg: any

      An object to which the this keyword can refer in the predicate function. +If thisArg is omitted, undefined is used as the this value.

      +

    Returns boolean

  • Sorts an array.

    +

    Parameters

    • Optional compareFn: ((a, b) => number)

      Function used to determine the order of the elements. It is expected to return +a negative value if first argument is less than second argument, zero if they're equal and a positive +value otherwise. If omitted, the elements are sorted in ascending order.

      +
      [11,2,22,1].sort((a, b) => a - b)
      +
      +
        • (a, b): number
        • Parameters

          • a: number
          • b: number

          Returns number

    Returns this

  • Returns a new Buffer that references the same memory as the original, but +offset and cropped by the start and end indices.

    +

    Specifying end greater than buf.length will return the same result as +that of end equal to buf.length.

    +

    This method is inherited from TypedArray.prototype.subarray().

    +

    Modifying the new Buffer slice will modify the memory in the original Bufferbecause the allocated memory of the two objects overlap.

    +
    import { Buffer } from 'node:buffer';

    // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
    // from the original `Buffer`.

    const buf1 = Buffer.allocUnsafe(26);

    for (let i = 0; i < 26; i++) {
    // 97 is the decimal ASCII value for 'a'.
    buf1[i] = i + 97;
    }

    const buf2 = buf1.subarray(0, 3);

    console.log(buf2.toString('ascii', 0, buf2.length));
    // Prints: abc

    buf1[0] = 33;

    console.log(buf2.toString('ascii', 0, buf2.length));
    // Prints: !bc +
    +

    Specifying negative indexes causes the slice to be generated relative to the +end of buf rather than the beginning.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('buffer');

    console.log(buf.subarray(-6, -1).toString());
    // Prints: buffe
    // (Equivalent to buf.subarray(0, 5).)

    console.log(buf.subarray(-6, -2).toString());
    // Prints: buff
    // (Equivalent to buf.subarray(0, 4).)

    console.log(buf.subarray(-5, -2).toString());
    // Prints: uff
    // (Equivalent to buf.subarray(1, 4).) +
    +

    Parameters

    • Optional start: number

      Where the new Buffer will start.

      +
    • Optional end: number

      Where the new Buffer will end (not inclusive).

      +

    Returns Buffer

    Since

    v3.0.0

    +
  • Interprets buf as an array of unsigned 16-bit integers and swaps the +byte order in-place. Throws ERR_INVALID_BUFFER_SIZE if buf.length is not a multiple of 2.

    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);

    console.log(buf1);
    // Prints: <Buffer 01 02 03 04 05 06 07 08>

    buf1.swap16();

    console.log(buf1);
    // Prints: <Buffer 02 01 04 03 06 05 08 07>

    const buf2 = Buffer.from([0x1, 0x2, 0x3]);

    buf2.swap16();
    // Throws ERR_INVALID_BUFFER_SIZE. +
    +

    One convenient use of buf.swap16() is to perform a fast in-place conversion +between UTF-16 little-endian and UTF-16 big-endian:

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
    buf.swap16(); // Convert to big-endian UTF-16 text. +
    +

    Returns Buffer

    A reference to buf.

    +

    Since

    v5.10.0

    +
  • Interprets buf as an array of unsigned 32-bit integers and swaps the +byte order in-place. Throws ERR_INVALID_BUFFER_SIZE if buf.length is not a multiple of 4.

    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);

    console.log(buf1);
    // Prints: <Buffer 01 02 03 04 05 06 07 08>

    buf1.swap32();

    console.log(buf1);
    // Prints: <Buffer 04 03 02 01 08 07 06 05>

    const buf2 = Buffer.from([0x1, 0x2, 0x3]);

    buf2.swap32();
    // Throws ERR_INVALID_BUFFER_SIZE. +
    +

    Returns Buffer

    A reference to buf.

    +

    Since

    v5.10.0

    +
  • Interprets buf as an array of 64-bit numbers and swaps byte order in-place. +Throws ERR_INVALID_BUFFER_SIZE if buf.length is not a multiple of 8.

    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);

    console.log(buf1);
    // Prints: <Buffer 01 02 03 04 05 06 07 08>

    buf1.swap64();

    console.log(buf1);
    // Prints: <Buffer 08 07 06 05 04 03 02 01>

    const buf2 = Buffer.from([0x1, 0x2, 0x3]);

    buf2.swap64();
    // Throws ERR_INVALID_BUFFER_SIZE. +
    +

    Returns Buffer

    A reference to buf.

    +

    Since

    v6.3.0

    +
  • Returns a JSON representation of buf. JSON.stringify() implicitly calls +this function when stringifying a Buffer instance.

    +

    Buffer.from() accepts objects in the format returned from this method. +In particular, Buffer.from(buf.toJSON()) works like Buffer.from(buf).

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
    const json = JSON.stringify(buf);

    console.log(json);
    // Prints: {"type":"Buffer","data":[1,2,3,4,5]}

    const copy = JSON.parse(json, (key, value) => {
    return value &#x26;&#x26; value.type === 'Buffer' ?
    Buffer.from(value) :
    value;
    });

    console.log(copy);
    // Prints: <Buffer 01 02 03 04 05> +
    +

    Returns {
        data: number[];
        type: "Buffer";
    }

    • data: number[]
    • type: "Buffer"

    Since

    v0.9.2

    +
  • Converts a number to a string by using the current locale.

    +

    Returns string

  • Decodes buf to a string according to the specified character encoding inencoding. start and end may be passed to decode only a subset of buf.

    +

    If encoding is 'utf8' and a byte sequence in the input is not valid UTF-8, +then each invalid byte is replaced with the replacement character U+FFFD.

    +

    The maximum length of a string instance (in UTF-16 code units) is available +as constants.MAX_STRING_LENGTH.

    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.allocUnsafe(26);

    for (let i = 0; i < 26; i++) {
    // 97 is the decimal ASCII value for 'a'.
    buf1[i] = i + 97;
    }

    console.log(buf1.toString('utf8'));
    // Prints: abcdefghijklmnopqrstuvwxyz
    console.log(buf1.toString('utf8', 0, 5));
    // Prints: abcde

    const buf2 = Buffer.from('tést');

    console.log(buf2.toString('hex'));
    // Prints: 74c3a97374
    console.log(buf2.toString('utf8', 0, 3));
    // Prints: té
    console.log(buf2.toString(undefined, 0, 3));
    // Prints: té +
    +

    Parameters

    • Optional encoding: BufferEncoding

      The character encoding to use.

      +
    • Optional start: number

      The byte offset to start decoding at.

      +
    • Optional end: number

      The byte offset to stop decoding at (not inclusive).

      +

    Returns string

    Since

    v0.1.90

    +
  • Returns the primitive value of the specified object.

    +

    Returns Uint8Array

  • Creates and returns an iterator for buf values (bytes). This function is +called automatically when a Buffer is used in a for..of statement.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.from('buffer');

    for (const value of buf.values()) {
    console.log(value);
    }
    // Prints:
    // 98
    // 117
    // 102
    // 102
    // 101
    // 114

    for (const value of buf) {
    console.log(value);
    }
    // Prints:
    // 98
    // 117
    // 102
    // 102
    // 101
    // 114 +
    +

    Returns IterableIterator<number>

    Since

    v1.1.0

    +
  • Writes string to buf at offset according to the character encoding inencoding. The length parameter is the number of bytes to write. If buf did +not contain enough space to fit the entire string, only part of string will be +written. However, partially encoded characters will not be written.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.alloc(256);

    const len = buf.write('\u00bd + \u00bc = \u00be', 0);

    console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
    // Prints: 12 bytes: ½ + ¼ = ¾

    const buffer = Buffer.alloc(10);

    const length = buffer.write('abcd', 8);

    console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
    // Prints: 2 bytes : ab +
    +

    Parameters

    • string: string

      String to write to buf.

      +
    • Optional encoding: BufferEncoding

      The character encoding of string.

      +

    Returns number

    Number of bytes written.

    +

    Since

    v0.1.90

    +
  • Parameters

    Returns number

  • Parameters

    • string: string
    • offset: number
    • length: number
    • Optional encoding: BufferEncoding

    Returns number

  • Writes value to buf at the specified offset as big-endian.

    +

    value is interpreted and written as a two's complement signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(8);

    buf.writeBigInt64BE(0x0102030405060708n, 0);

    console.log(buf);
    // Prints: <Buffer 01 02 03 04 05 06 07 08> +
    +

    Parameters

    • value: bigint

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v12.0.0, v10.20.0

    +
  • Writes value to buf at the specified offset as little-endian.

    +

    value is interpreted and written as a two's complement signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(8);

    buf.writeBigInt64LE(0x0102030405060708n, 0);

    console.log(buf);
    // Prints: <Buffer 08 07 06 05 04 03 02 01> +
    +

    Parameters

    • value: bigint

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v12.0.0, v10.20.0

    +
  • Writes value to buf at the specified offset as big-endian.

    +

    This function is also available under the writeBigUint64BE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(8);

    buf.writeBigUInt64BE(0xdecafafecacefaden, 0);

    console.log(buf);
    // Prints: <Buffer de ca fa fe ca ce fa de> +
    +

    Parameters

    • value: bigint

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v12.0.0, v10.20.0

    +
  • Writes value to buf at the specified offset as little-endian

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(8);

    buf.writeBigUInt64LE(0xdecafafecacefaden, 0);

    console.log(buf);
    // Prints: <Buffer de fa ce ca fe fa ca de> +
    +

    This function is also available under the writeBigUint64LE alias.

    +

    Parameters

    • value: bigint

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v12.0.0, v10.20.0

    +
  • Parameters

    • value: bigint
    • Optional offset: number

    Returns number

    Alias

    Buffer.writeBigUInt64BE

    +

    Since

    v14.10.0, v12.19.0

    +
  • Parameters

    • value: bigint
    • Optional offset: number

    Returns number

    Alias

    Buffer.writeBigUInt64LE

    +

    Since

    v14.10.0, v12.19.0

    +
  • Writes value to buf at the specified offset as big-endian. The valuemust be a JavaScript number. Behavior is undefined when value is anything +other than a JavaScript number.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(8);

    buf.writeDoubleBE(123.456, 0);

    console.log(buf);
    // Prints: <Buffer 40 5e dd 2f 1a 9f be 77> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 8.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.11.15

    +
  • Writes value to buf at the specified offset as little-endian. The valuemust be a JavaScript number. Behavior is undefined when value is anything +other than a JavaScript number.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(8);

    buf.writeDoubleLE(123.456, 0);

    console.log(buf);
    // Prints: <Buffer 77 be 9f 1a 2f dd 5e 40> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 8.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.11.15

    +
  • Writes value to buf at the specified offset as big-endian. Behavior is +undefined when value is anything other than a JavaScript number.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeFloatBE(0xcafebabe, 0);

    console.log(buf);
    // Prints: <Buffer 4f 4a fe bb> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.11.15

    +
  • Writes value to buf at the specified offset as little-endian. Behavior is +undefined when value is anything other than a JavaScript number.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeFloatLE(0xcafebabe, 0);

    console.log(buf);
    // Prints: <Buffer bb fe 4a 4f> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.11.15

    +
  • Writes value to buf at the specified offset as big-endian. The valuemust be a valid signed 16-bit integer. Behavior is undefined when value is +anything other than a signed 16-bit integer.

    +

    The value is interpreted and written as a two's complement signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(2);

    buf.writeInt16BE(0x0102, 0);

    console.log(buf);
    // Prints: <Buffer 01 02> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset as little-endian. The valuemust be a valid signed 16-bit integer. Behavior is undefined when value is +anything other than a signed 16-bit integer.

    +

    The value is interpreted and written as a two's complement signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(2);

    buf.writeInt16LE(0x0304, 0);

    console.log(buf);
    // Prints: <Buffer 04 03> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset as big-endian. The valuemust be a valid signed 32-bit integer. Behavior is undefined when value is +anything other than a signed 32-bit integer.

    +

    The value is interpreted and written as a two's complement signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeInt32BE(0x01020304, 0);

    console.log(buf);
    // Prints: <Buffer 01 02 03 04> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset as little-endian. The valuemust be a valid signed 32-bit integer. Behavior is undefined when value is +anything other than a signed 32-bit integer.

    +

    The value is interpreted and written as a two's complement signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeInt32LE(0x05060708, 0);

    console.log(buf);
    // Prints: <Buffer 08 07 06 05> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset. value must be a valid +signed 8-bit integer. Behavior is undefined when value is anything other than +a signed 8-bit integer.

    +

    value is interpreted and written as a two's complement signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(2);

    buf.writeInt8(2, 0);
    buf.writeInt8(-2, 1);

    console.log(buf);
    // Prints: <Buffer 02 fe> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 1.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.0

    +
  • Writes byteLength bytes of value to buf at the specified offsetas big-endian. Supports up to 48 bits of accuracy. Behavior is undefined whenvalue is anything other than a +signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(6);

    buf.writeIntBE(0x1234567890ab, 0, 6);

    console.log(buf);
    // Prints: <Buffer 12 34 56 78 90 ab> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to write. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.11.15

    +
  • Writes byteLength bytes of value to buf at the specified offsetas little-endian. Supports up to 48 bits of accuracy. Behavior is undefined +when value is anything other than a signed integer.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(6);

    buf.writeIntLE(0x1234567890ab, 0, 6);

    console.log(buf);
    // Prints: <Buffer ab 90 78 56 34 12> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to write. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.11.15

    +
  • Writes value to buf at the specified offset as big-endian. The valuemust be a valid unsigned 16-bit integer. Behavior is undefined when valueis anything other than an +unsigned 16-bit integer.

    +

    This function is also available under the writeUint16BE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeUInt16BE(0xdead, 0);
    buf.writeUInt16BE(0xbeef, 2);

    console.log(buf);
    // Prints: <Buffer de ad be ef> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset as little-endian. The valuemust be a valid unsigned 16-bit integer. Behavior is undefined when value is +anything other than an unsigned 16-bit integer.

    +

    This function is also available under the writeUint16LE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeUInt16LE(0xdead, 0);
    buf.writeUInt16LE(0xbeef, 2);

    console.log(buf);
    // Prints: <Buffer ad de ef be> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset as big-endian. The valuemust be a valid unsigned 32-bit integer. Behavior is undefined when valueis anything other than an +unsigned 32-bit integer.

    +

    This function is also available under the writeUint32BE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeUInt32BE(0xfeedface, 0);

    console.log(buf);
    // Prints: <Buffer fe ed fa ce> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset as little-endian. The valuemust be a valid unsigned 32-bit integer. Behavior is undefined when value is +anything other than an unsigned 32-bit integer.

    +

    This function is also available under the writeUint32LE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeUInt32LE(0xfeedface, 0);

    console.log(buf);
    // Prints: <Buffer ce fa ed fe> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes value to buf at the specified offset. value must be a +valid unsigned 8-bit integer. Behavior is undefined when value is anything +other than an unsigned 8-bit integer.

    +

    This function is also available under the writeUint8 alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(4);

    buf.writeUInt8(0x3, 0);
    buf.writeUInt8(0x4, 1);
    buf.writeUInt8(0x23, 2);
    buf.writeUInt8(0x42, 3);

    console.log(buf);
    // Prints: <Buffer 03 04 23 42> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • Optional offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 1.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.0

    +
  • Writes byteLength bytes of value to buf at the specified offsetas big-endian. Supports up to 48 bits of accuracy. Behavior is undefined +when value is anything other than an unsigned integer.

    +

    This function is also available under the writeUintBE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(6);

    buf.writeUIntBE(0x1234567890ab, 0, 6);

    console.log(buf);
    // Prints: <Buffer 12 34 56 78 90 ab> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to write. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Writes byteLength bytes of value to buf at the specified offsetas little-endian. Supports up to 48 bits of accuracy. Behavior is undefined +when value is anything other than an unsigned integer.

    +

    This function is also available under the writeUintLE alias.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(6);

    buf.writeUIntLE(0x1234567890ab, 0, 6);

    console.log(buf);
    // Prints: <Buffer ab 90 78 56 34 12> +
    +

    Parameters

    • value: number

      Number to be written to buf.

      +
    • offset: number

      Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength.

      +
    • byteLength: number

      Number of bytes to write. Must satisfy 0 < byteLength <= 6.

      +

    Returns number

    offset plus the number of bytes written.

    +

    Since

    v0.5.5

    +
  • Parameters

    • value: number
    • Optional offset: number

    Returns number

    Alias

    Buffer.writeUInt16BE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • value: number
    • Optional offset: number

    Returns number

    Alias

    Buffer.writeUInt16LE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • value: number
    • Optional offset: number

    Returns number

    Alias

    Buffer.writeUInt32BE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • value: number
    • Optional offset: number

    Returns number

    Alias

    Buffer.writeUInt32LE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • value: number
    • Optional offset: number

    Returns number

    Alias

    Buffer.writeUInt8

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • value: number
    • offset: number
    • byteLength: number

    Returns number

    Alias

    Buffer.writeUIntBE

    +

    Since

    v14.9.0, v12.19.0

    +
  • Parameters

    • value: number
    • offset: number
    • byteLength: number

    Returns number

    Alias

    Buffer.writeUIntLE

    +

    Since

    v14.9.0, v12.19.0

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.BufferConstructor.html b/docs/interfaces/_internal_.BufferConstructor.html new file mode 100644 index 00000000..b5233ca3 --- /dev/null +++ b/docs/interfaces/_internal_.BufferConstructor.html @@ -0,0 +1,165 @@ +BufferConstructor | @filen/filen-sdk

Raw data is stored in instances of the Buffer class. +A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. +Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'

+
interface BufferConstructor {
    new BufferConstructornew (str, encoding?): Buffer;
    new BufferConstructornew (size): Buffer;
    new BufferConstructornew (array): Buffer;
    new BufferConstructornew (arrayBuffer): Buffer;
    new BufferConstructornew (array): Buffer;
    new BufferConstructornew (buffer): Buffer;
    poolSize: number;
    alloc(size, fill?, encoding?): Buffer;
    allocUnsafe(size): Buffer;
    allocUnsafeSlow(size): Buffer;
    byteLength(string, encoding?): number;
    compare(buf1, buf2): 0 | 1 | -1;
    concat(list, totalLength?): Buffer;
    copyBytesFrom(view, offset?, length?): Buffer;
    from(arrayBuffer, byteOffset?, length?): Buffer;
    from(data): Buffer;
    from(data): Buffer;
    from(str, encoding?): Buffer;
    isBuffer(obj): obj is Buffer;
    isEncoding(encoding): encoding is BufferEncoding;
    of(...items): Buffer;
}

Constructors

  • Allocates a new buffer containing the given {str}.

    +

    Parameters

    • str: string

      String to store in buffer.

      +
    • Optional encoding: BufferEncoding

      encoding to use, optional. Default is 'utf8'

      +

    Returns Buffer

    Deprecated

    since v10.0.0 - Use Buffer.from(string[, encoding]) instead.

    +
  • Allocates a new buffer of {size} octets.

    +

    Parameters

    • size: number

      count of octets to allocate.

      +

    Returns Buffer

    Deprecated

    since v10.0.0 - Use Buffer.alloc() instead (also see Buffer.allocUnsafe()).

    +
  • Allocates a new buffer containing the given {array} of octets.

    +

    Parameters

    • array: Uint8Array

      The octets to store.

      +

    Returns Buffer

    Deprecated

    since v10.0.0 - Use Buffer.from(array) instead.

    +
  • Produces a Buffer backed by the same allocated memory as +the given {ArrayBuffer}/{SharedArrayBuffer}.

    +

    Parameters

    • arrayBuffer: ArrayBuffer | SharedArrayBuffer

      The ArrayBuffer with which to share memory.

      +

    Returns Buffer

    Deprecated

    since v10.0.0 - Use Buffer.from(arrayBuffer[, byteOffset[, length]]) instead.

    +
  • Allocates a new buffer containing the given {array} of octets.

    +

    Parameters

    • array: readonly any[]

      The octets to store.

      +

    Returns Buffer

    Deprecated

    since v10.0.0 - Use Buffer.from(array) instead.

    +
  • Copies the passed {buffer} data onto a new {Buffer} instance.

    +

    Parameters

    • buffer: Buffer

      The buffer to copy.

      +

    Returns Buffer

    Deprecated

    since v10.0.0 - Use Buffer.from(buffer) instead.

    +

Properties

poolSize: number

This is the size (in bytes) of pre-allocated internal Buffer instances used +for pooling. This value may be modified.

+

Since

v0.11.3

+

Methods

  • Allocates a new Buffer of size bytes. If fill is undefined, theBuffer will be zero-filled.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.alloc(5);

    console.log(buf);
    // Prints: <Buffer 00 00 00 00 00> +
    +

    If size is larger than constants.MAX_LENGTH or smaller than 0, ERR_OUT_OF_RANGE is thrown.

    +

    If fill is specified, the allocated Buffer will be initialized by calling buf.fill(fill).

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.alloc(5, 'a');

    console.log(buf);
    // Prints: <Buffer 61 61 61 61 61> +
    +

    If both fill and encoding are specified, the allocated Buffer will be +initialized by calling buf.fill(fill, encoding).

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');

    console.log(buf);
    // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64> +
    +

    Calling Buffer.alloc() can be measurably slower than the alternative Buffer.allocUnsafe() but ensures that the newly created Buffer instance +contents will never contain sensitive data from previous allocations, including +data that might not have been allocated for Buffers.

    +

    A TypeError will be thrown if size is not a number.

    +

    Parameters

    • size: number

      The desired length of the new Buffer.

      +
    • Optional fill: string | number | Uint8Array

      A value to pre-fill the new Buffer with.

      +
    • Optional encoding: BufferEncoding

      If fill is a string, this is its encoding.

      +

    Returns Buffer

    Since

    v5.10.0

    +
  • Allocates a new Buffer of size bytes. If size is larger than constants.MAX_LENGTH or smaller than 0, ERR_OUT_OF_RANGE is thrown.

    +

    The underlying memory for Buffer instances created in this way is not +initialized. The contents of the newly created Buffer are unknown and may contain sensitive data. Use Buffer.alloc() instead to initializeBuffer instances with zeroes.

    +
    import { Buffer } from 'node:buffer';

    const buf = Buffer.allocUnsafe(10);

    console.log(buf);
    // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>

    buf.fill(0);

    console.log(buf);
    // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00> +
    +

    A TypeError will be thrown if size is not a number.

    +

    The Buffer module pre-allocates an internal Buffer instance of +size Buffer.poolSize that is used as a pool for the fast allocation of newBuffer instances created using Buffer.allocUnsafe(), Buffer.from(array), +and Buffer.concat() only when size is less thanBuffer.poolSize >>> 1 (floor of Buffer.poolSize divided by two).

    +

    Use of this pre-allocated internal memory pool is a key difference between +calling Buffer.alloc(size, fill) vs. Buffer.allocUnsafe(size).fill(fill). +Specifically, Buffer.alloc(size, fill) will never use the internal Bufferpool, while Buffer.allocUnsafe(size).fill(fill)will use the internalBuffer pool if size is less +than or equal to half Buffer.poolSize. The +difference is subtle but can be important when an application requires the +additional performance that Buffer.allocUnsafe() provides.

    +

    Parameters

    • size: number

      The desired length of the new Buffer.

      +

    Returns Buffer

    Since

    v5.10.0

    +
  • Allocates a new Buffer of size bytes. If size is larger than constants.MAX_LENGTH or smaller than 0, ERR_OUT_OF_RANGE is thrown. A zero-length Buffer is created if +size is 0.

    +

    The underlying memory for Buffer instances created in this way is not +initialized. The contents of the newly created Buffer are unknown and may contain sensitive data. Use buf.fill(0) to initialize +such Buffer instances with zeroes.

    +

    When using Buffer.allocUnsafe() to allocate new Buffer instances, +allocations under 4 KiB are sliced from a single pre-allocated Buffer. This +allows applications to avoid the garbage collection overhead of creating many +individually allocated Buffer instances. This approach improves both +performance and memory usage by eliminating the need to track and clean up as +many individual ArrayBuffer objects.

    +

    However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using Buffer.allocUnsafeSlow() and +then copying out the relevant bits.

    +
    import { Buffer } from 'node:buffer';

    // Need to keep around a few small chunks of memory.
    const store = [];

    socket.on('readable', () => {
    let data;
    while (null !== (data = readable.read())) {
    // Allocate for retained data.
    const sb = Buffer.allocUnsafeSlow(10);

    // Copy the data into the new allocation.
    data.copy(sb, 0, 0, 10);

    store.push(sb);
    }
    }); +
    +

    A TypeError will be thrown if size is not a number.

    +

    Parameters

    • size: number

      The desired length of the new Buffer.

      +

    Returns Buffer

    Since

    v5.12.0

    +
  • Returns the byte length of a string when encoded using encoding. +This is not the same as String.prototype.length, which does not account +for the encoding that is used to convert the string into bytes.

    +

    For 'base64', 'base64url', and 'hex', this function assumes valid input. +For strings that contain non-base64/hex-encoded data (e.g. whitespace), the +return value might be greater than the length of a Buffer created from the +string.

    +
    import { Buffer } from 'node:buffer';

    const str = '\u00bd + \u00bc = \u00be';

    console.log(`${str}: ${str.length} characters, ` +
    `${Buffer.byteLength(str, 'utf8')} bytes`);
    // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes +
    +

    When string is a +Buffer/DataView/[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- +Reference/Global_Objects/TypedArray)/ArrayBuffer/[SharedArrayBuffer](https://develop- +er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by .byteLengthis returned.

    +

    Parameters

    Returns number

    The number of bytes contained within string.

    +

    Since

    v0.1.90

    +
  • Compares buf1 to buf2, typically for the purpose of sorting arrays ofBuffer instances. This is equivalent to calling buf1.compare(buf2).

    +
    import { Buffer } from 'node:buffer';

    const buf1 = Buffer.from('1234');
    const buf2 = Buffer.from('0123');
    const arr = [buf1, buf2];

    console.log(arr.sort(Buffer.compare));
    // Prints: [ <Buffer 30 31 32 33>, <Buffer 31 32 33 34> ]
    // (This result is equal to: [buf2, buf1].) +
    +

    Parameters

    • buf1: Uint8Array
    • buf2: Uint8Array

    Returns 0 | 1 | -1

    Either -1, 0, or 1, depending on the result of the comparison. See compare for details.

    +

    Since

    v0.11.13

    +
  • Returns a new Buffer which is the result of concatenating all the Bufferinstances in the list together.

    +

    If the list has no items, or if the totalLength is 0, then a new zero-lengthBuffer is returned.

    +

    If totalLength is not provided, it is calculated from the Buffer instances +in list by adding their lengths.

    +

    If totalLength is provided, it is coerced to an unsigned integer. If the +combined length of the Buffers in list exceeds totalLength, the result is +truncated to totalLength.

    +
    import { Buffer } from 'node:buffer';

    // Create a single `Buffer` from a list of three `Buffer` instances.

    const buf1 = Buffer.alloc(10);
    const buf2 = Buffer.alloc(14);
    const buf3 = Buffer.alloc(18);
    const totalLength = buf1.length + buf2.length + buf3.length;

    console.log(totalLength);
    // Prints: 42

    const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);

    console.log(bufA);
    // Prints: <Buffer 00 00 00 00 ...>
    console.log(bufA.length);
    // Prints: 42 +
    +

    Buffer.concat() may also use the internal Buffer pool like Buffer.allocUnsafe() does.

    +

    Parameters

    • list: readonly Uint8Array[]

      List of Buffer or Uint8Array instances to concatenate.

      +
    • Optional totalLength: number

      Total length of the Buffer instances in list when concatenated.

      +

    Returns Buffer

    Since

    v0.7.11

    +
  • Copies the underlying memory of view into a new Buffer.

    +
    const u16 = new Uint16Array([0, 0xffff]);
    const buf = Buffer.copyBytesFrom(u16, 1, 1);
    u16[1] = 0;
    console.log(buf.length); // 2
    console.log(buf[0]); // 255
    console.log(buf[1]); // 255 +
    +

    Parameters

    • view: TypedArray

      The {TypedArray} to copy.

      +
    • Optional offset: number

      The starting offset within view.

      +
    • Optional length: number

      The number of elements from view to copy.

      +

    Returns Buffer

    Since

    v19.8.0

    +
  • Allocates a new Buffer using an array of bytes in the range 0255. +Array entries outside that range will be truncated to fit into it.

    +
    import { Buffer } from 'node:buffer';

    // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
    const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); +
    +

    If array is an Array-like object (that is, one with a length property of +type number), it is treated as if it is an array, unless it is a Buffer or +a Uint8Array. This means all other TypedArray variants get treated as anArray. To create a Buffer from the bytes backing a TypedArray, use Buffer.copyBytesFrom().

    +

    A TypeError will be thrown if array is not an Array or another type +appropriate for Buffer.from() variants.

    +

    Buffer.from(array) and Buffer.from(string) may also use the internalBuffer pool like Buffer.allocUnsafe() does.

    +

    Parameters

    Returns Buffer

    Since

    v5.10.0

    +
  • Creates a new Buffer using the passed {data}

    +

    Parameters

    • data: Uint8Array | readonly number[]

      data to create a new Buffer

      +

    Returns Buffer

  • Parameters

    Returns Buffer

  • Creates a new Buffer containing the given JavaScript string {str}. +If provided, the {encoding} parameter identifies the character encoding. +If not provided, {encoding} defaults to 'utf8'.

    +

    Parameters

    Returns Buffer

  • Returns true if obj is a Buffer, false otherwise.

    +
    import { Buffer } from 'node:buffer';

    Buffer.isBuffer(Buffer.alloc(10)); // true
    Buffer.isBuffer(Buffer.from('foo')); // true
    Buffer.isBuffer('a string'); // false
    Buffer.isBuffer([]); // false
    Buffer.isBuffer(new Uint8Array(1024)); // false +
    +

    Parameters

    • obj: any

    Returns obj is Buffer

    Since

    v0.1.101

    +
  • Returns true if encoding is the name of a supported character encoding, +or false otherwise.

    +
    import { Buffer } from 'node:buffer';

    console.log(Buffer.isEncoding('utf8'));
    // Prints: true

    console.log(Buffer.isEncoding('hex'));
    // Prints: true

    console.log(Buffer.isEncoding('utf/8'));
    // Prints: false

    console.log(Buffer.isEncoding(''));
    // Prints: false +
    +

    Parameters

    • encoding: string

      A character encoding name to check.

      +

    Returns encoding is BufferEncoding

    Since

    v0.9.1

    +
  • Creates a new Buffer using the passed {data}

    +

    Parameters

    • Rest ...items: number[]

    Returns Buffer

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.CallSite.html b/docs/interfaces/_internal_.CallSite.html new file mode 100644 index 00000000..95f3db72 --- /dev/null +++ b/docs/interfaces/_internal_.CallSite.html @@ -0,0 +1,48 @@ +CallSite | @filen/filen-sdk
interface CallSite {
    getColumnNumber(): null | number;
    getEnclosingColumnNumber(): number;
    getEnclosingLineNumber(): number;
    getEvalOrigin(): undefined | string;
    getFileName(): undefined | string;
    getFunction(): undefined | Function;
    getFunctionName(): null | string;
    getLineNumber(): null | number;
    getMethodName(): null | string;
    getPosition(): number;
    getPromiseIndex(): null | number;
    getScriptHash(): string;
    getScriptNameOrSourceURL(): string;
    getThis(): unknown;
    getTypeName(): null | string;
    isAsync(): boolean;
    isConstructor(): boolean;
    isEval(): boolean;
    isNative(): boolean;
    isPromiseAll(): boolean;
    isToplevel(): boolean;
    toString(): string;
}

Methods

  • Current column number [if this function was defined in a script]

    +

    Returns null | number

  • Returns number

  • Returns number

  • A call site object representing the location where eval was called +[if this function was created using a call to eval]

    +

    Returns undefined | string

  • Name of the script [if this function was defined in a script]

    +

    Returns undefined | string

  • Current function

    +

    Returns undefined | Function

  • Name of the current function, typically its name property. +If a name property is not available an attempt will be made to try +to infer a name from the function's context.

    +

    Returns null | string

  • Current line number [if this function was defined in a script]

    +

    Returns null | number

  • Name of the property [of "this" or one of its prototypes] that holds +the current function

    +

    Returns null | string

  • Returns number

  • returns the index of the promise element that was followed in +Promise.all() or Promise.any() for async stack traces, or null +if the CallSite is not an async

    +

    Returns null | number

  • Returns string

  • Returns string

  • Value of "this"

    +

    Returns unknown

  • Type of "this" as a string. +This is the name of the function stored in the constructor field of +"this", if available. Otherwise the object's [[Class]] internal +property.

    +

    Returns null | string

  • is this an async call (i.e. await, Promise.all(), or Promise.any())?

    +

    Returns boolean

  • Is this a constructor call?

    +

    Returns boolean

  • Does this call take place in code defined by a call to eval?

    +

    Returns boolean

  • Is this call in native V8 code?

    +

    Returns boolean

  • is this an async call to Promise.all()?

    +

    Returns boolean

  • Is this a toplevel invocation, that is, is "this" the global object?

    +

    Returns boolean

  • Returns string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.Cancel.html b/docs/interfaces/_internal_.Cancel.html new file mode 100644 index 00000000..775465f7 --- /dev/null +++ b/docs/interfaces/_internal_.Cancel.html @@ -0,0 +1,2 @@ +Cancel | @filen/filen-sdk
interface Cancel {
    message: undefined | string;
}

Properties

Properties

message: undefined | string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.CancelToken.html b/docs/interfaces/_internal_.CancelToken.html new file mode 100644 index 00000000..43b9ffb5 --- /dev/null +++ b/docs/interfaces/_internal_.CancelToken.html @@ -0,0 +1,4 @@ +CancelToken | @filen/filen-sdk
interface CancelToken {
    promise: Promise<Cancel>;
    reason?: Cancel;
    throwIfRequested(): void;
}

Properties

Methods

Properties

promise: Promise<Cancel>
reason?: Cancel

Methods

  • Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.CustomParamsSerializer.html b/docs/interfaces/_internal_.CustomParamsSerializer.html new file mode 100644 index 00000000..48de451a --- /dev/null +++ b/docs/interfaces/_internal_.CustomParamsSerializer.html @@ -0,0 +1 @@ +CustomParamsSerializer | @filen/filen-sdk

Interface CustomParamsSerializer

interface CustomParamsSerializer ((params, options?) => string)
  • Parameters

    Returns string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.Error.html b/docs/interfaces/_internal_.Error.html new file mode 100644 index 00000000..4b640c0e --- /dev/null +++ b/docs/interfaces/_internal_.Error.html @@ -0,0 +1,4 @@ +Error | @filen/filen-sdk
interface Error {
    message: string;
    name: string;
    stack?: string;
}

Properties

Properties

message: string
name: string
stack?: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.FormDataVisitorHelpers.html b/docs/interfaces/_internal_.FormDataVisitorHelpers.html new file mode 100644 index 00000000..e7e31fa0 --- /dev/null +++ b/docs/interfaces/_internal_.FormDataVisitorHelpers.html @@ -0,0 +1,4 @@ +FormDataVisitorHelpers | @filen/filen-sdk

Interface FormDataVisitorHelpers

interface FormDataVisitorHelpers {
    convertValue: ((value) => any);
    defaultVisitor: SerializerVisitor;
    isVisitable: ((value) => boolean);
}

Properties

convertValue: ((value) => any)

Type declaration

    • (value): any
    • Parameters

      • value: any

      Returns any

defaultVisitor: SerializerVisitor
isVisitable: ((value) => boolean)

Type declaration

    • (value): boolean
    • Parameters

      • value: any

      Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.FormSerializerOptions.html b/docs/interfaces/_internal_.FormSerializerOptions.html new file mode 100644 index 00000000..550f8015 --- /dev/null +++ b/docs/interfaces/_internal_.FormSerializerOptions.html @@ -0,0 +1,5 @@ +FormSerializerOptions | @filen/filen-sdk
interface FormSerializerOptions {
    dots?: boolean;
    indexes?: null | boolean;
    metaTokens?: boolean;
    visitor?: SerializerVisitor;
}

Hierarchy (view full)

Properties

dots?: boolean
indexes?: null | boolean
metaTokens?: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.GenericAbortSignal.html b/docs/interfaces/_internal_.GenericAbortSignal.html new file mode 100644 index 00000000..e1233e83 --- /dev/null +++ b/docs/interfaces/_internal_.GenericAbortSignal.html @@ -0,0 +1,5 @@ +GenericAbortSignal | @filen/filen-sdk
interface GenericAbortSignal {
    aborted: boolean;
    addEventListener?: ((...args) => any);
    onabort?: null | ((...args) => any);
    removeEventListener?: ((...args) => any);
}

Properties

aborted: boolean
addEventListener?: ((...args) => any)

Type declaration

    • (...args): any
    • Parameters

      • Rest ...args: any

      Returns any

onabort?: null | ((...args) => any)

Type declaration

    • (...args): any
    • Parameters

      • Rest ...args: any

      Returns any

removeEventListener?: ((...args) => any)

Type declaration

    • (...args): any
    • Parameters

      • Rest ...args: any

      Returns any

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.GenericFormData.html b/docs/interfaces/_internal_.GenericFormData.html new file mode 100644 index 00000000..1d3e555a --- /dev/null +++ b/docs/interfaces/_internal_.GenericFormData.html @@ -0,0 +1,2 @@ +GenericFormData | @filen/filen-sdk
interface GenericFormData {
    append(name, value, options?): any;
}

Methods

Methods

  • Parameters

    • name: string
    • value: any
    • Optional options: any

    Returns any

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.InternalAxiosRequestConfig.html b/docs/interfaces/_internal_.InternalAxiosRequestConfig.html new file mode 100644 index 00000000..4c4e7aea --- /dev/null +++ b/docs/interfaces/_internal_.InternalAxiosRequestConfig.html @@ -0,0 +1,42 @@ +InternalAxiosRequestConfig | @filen/filen-sdk

Interface InternalAxiosRequestConfig<D>

interface InternalAxiosRequestConfig<D> {
    adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
    auth?: AxiosBasicCredentials;
    baseURL?: string;
    beforeRedirect?: ((options, responseDetails) => void);
    cancelToken?: CancelToken;
    data?: D;
    decompress?: boolean;
    env?: {
        FormData?: (new (...args) => object);
    };
    family?: AddressFamily;
    formSerializer?: FormSerializerOptions;
    headers: AxiosRequestHeaders;
    httpAgent?: any;
    httpsAgent?: any;
    insecureHTTPParser?: boolean;
    lookup?: ((hostname, options, cb) => void) | ((hostname, options) => Promise<LookupAddress | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]>);
    maxBodyLength?: number;
    maxContentLength?: number;
    maxRate?: number | [number, number];
    maxRedirects?: number;
    method?: string;
    onDownloadProgress?: ((progressEvent) => void);
    onUploadProgress?: ((progressEvent) => void);
    params?: any;
    paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
    proxy?: false | AxiosProxyConfig;
    responseEncoding?: string;
    responseType?: ResponseType;
    signal?: GenericAbortSignal;
    socketPath?: null | string;
    timeout?: number;
    timeoutErrorMessage?: string;
    transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
    transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
    transitional?: TransitionalOptions;
    transport?: any;
    url?: string;
    validateStatus?: null | ((status) => boolean);
    withCredentials?: boolean;
    withXSRFToken?: boolean | ((config) => undefined | boolean);
    xsrfCookieName?: string;
    xsrfHeaderName?: string;
}

Type Parameters

  • D = any

Hierarchy (view full)

Properties

baseURL?: string
beforeRedirect?: ((options, responseDetails) => void)

Type declaration

    • (options, responseDetails): void
    • Parameters

      Returns void

cancelToken?: CancelToken
data?: D
decompress?: boolean
env?: {
    FormData?: (new (...args) => object);
}

Type declaration

  • Optional FormData?: (new (...args) => object)
      • new (...args): object
      • Parameters

        • Rest ...args: any[]

        Returns object

family?: AddressFamily
formSerializer?: FormSerializerOptions
httpAgent?: any
httpsAgent?: any
insecureHTTPParser?: boolean
lookup?: ((hostname, options, cb) => void) | ((hostname, options) => Promise<LookupAddress | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily]>)

Type declaration

    • (hostname, options, cb): void
    • Parameters

      Returns void

Type declaration

maxBodyLength?: number
maxContentLength?: number
maxRate?: number | [number, number]
maxRedirects?: number
method?: string
onDownloadProgress?: ((progressEvent) => void)

Type declaration

onUploadProgress?: ((progressEvent) => void)

Type declaration

params?: any
proxy?: false | AxiosProxyConfig
responseEncoding?: string
responseType?: ResponseType
socketPath?: null | string
timeout?: number
timeoutErrorMessage?: string
transitional?: TransitionalOptions
transport?: any
url?: string
validateStatus?: null | ((status) => boolean)

Type declaration

    • (status): boolean
    • Parameters

      • status: number

      Returns boolean

withCredentials?: boolean
withXSRFToken?: boolean | ((config) => undefined | boolean)

Type declaration

xsrfCookieName?: string
xsrfHeaderName?: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.IterableIterator.html b/docs/interfaces/_internal_.IterableIterator.html new file mode 100644 index 00000000..060bd730 --- /dev/null +++ b/docs/interfaces/_internal_.IterableIterator.html @@ -0,0 +1,5 @@ +IterableIterator | @filen/filen-sdk

Interface IterableIterator<T>

interface IterableIterator<T> {
    [iterator](): IterableIterator<T>;
    next(...args): IteratorResult<T, any>;
    return?(value?): IteratorResult<T, any>;
    throw?(e?): IteratorResult<T, any>;
}

Type Parameters

  • T

Hierarchy (view full)

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.Iterator.html b/docs/interfaces/_internal_.Iterator.html new file mode 100644 index 00000000..f35843e4 --- /dev/null +++ b/docs/interfaces/_internal_.Iterator.html @@ -0,0 +1,4 @@ +Iterator | @filen/filen-sdk

Interface Iterator<T, TReturn, TNext>

interface Iterator<T, TReturn, TNext> {
    next(...args): IteratorResult<T, TReturn>;
    return?(value?): IteratorResult<T, TReturn>;
    throw?(e?): IteratorResult<T, TReturn>;
}

Type Parameters

  • T

  • TReturn = any

  • TNext = undefined

Hierarchy (view full)

Methods

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.IteratorReturnResult.html b/docs/interfaces/_internal_.IteratorReturnResult.html new file mode 100644 index 00000000..5c824028 --- /dev/null +++ b/docs/interfaces/_internal_.IteratorReturnResult.html @@ -0,0 +1,3 @@ +IteratorReturnResult | @filen/filen-sdk

Interface IteratorReturnResult<TReturn>

interface IteratorReturnResult<TReturn> {
    done: true;
    value: TReturn;
}

Type Parameters

  • TReturn

Properties

Properties

done: true
value: TReturn

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.IteratorYieldResult.html b/docs/interfaces/_internal_.IteratorYieldResult.html new file mode 100644 index 00000000..978b2aa6 --- /dev/null +++ b/docs/interfaces/_internal_.IteratorYieldResult.html @@ -0,0 +1,3 @@ +IteratorYieldResult | @filen/filen-sdk

Interface IteratorYieldResult<TYield>

interface IteratorYieldResult<TYield> {
    done?: false;
    value: TYield;
}

Type Parameters

  • TYield

Properties

Properties

done?: false
value: TYield

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.LookupAddressEntry.html b/docs/interfaces/_internal_.LookupAddressEntry.html new file mode 100644 index 00000000..bf214c5e --- /dev/null +++ b/docs/interfaces/_internal_.LookupAddressEntry.html @@ -0,0 +1,3 @@ +LookupAddressEntry | @filen/filen-sdk
interface LookupAddressEntry {
    address: string;
    family?: AddressFamily;
}

Properties

Properties

address: string
family?: AddressFamily

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.ParamEncoder.html b/docs/interfaces/_internal_.ParamEncoder.html new file mode 100644 index 00000000..3c1b4843 --- /dev/null +++ b/docs/interfaces/_internal_.ParamEncoder.html @@ -0,0 +1 @@ +ParamEncoder | @filen/filen-sdk
interface ParamEncoder ((value, defaultEncoder) => any)
  • Parameters

    • value: any
    • defaultEncoder: ((value) => any)
        • (value): any
        • Parameters

          • value: any

          Returns any

    Returns any

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.ParamsSerializerOptions.html b/docs/interfaces/_internal_.ParamsSerializerOptions.html new file mode 100644 index 00000000..8ac98ff2 --- /dev/null +++ b/docs/interfaces/_internal_.ParamsSerializerOptions.html @@ -0,0 +1,7 @@ +ParamsSerializerOptions | @filen/filen-sdk

Interface ParamsSerializerOptions

interface ParamsSerializerOptions {
    dots?: boolean;
    encode?: ParamEncoder;
    indexes?: null | boolean;
    metaTokens?: boolean;
    serialize?: CustomParamsSerializer;
    visitor?: SerializerVisitor;
}

Hierarchy (view full)

Properties

dots?: boolean
encode?: ParamEncoder
indexes?: null | boolean
metaTokens?: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.RawAxiosHeaders.html b/docs/interfaces/_internal_.RawAxiosHeaders.html new file mode 100644 index 00000000..1c4c22cf --- /dev/null +++ b/docs/interfaces/_internal_.RawAxiosHeaders.html @@ -0,0 +1 @@ +RawAxiosHeaders | @filen/filen-sdk
interface RawAxiosHeaders {
    [key: string]: AxiosHeaderValue;
}

Indexable

[key: string]: AxiosHeaderValue

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.SerializerOptions.html b/docs/interfaces/_internal_.SerializerOptions.html new file mode 100644 index 00000000..5723409b --- /dev/null +++ b/docs/interfaces/_internal_.SerializerOptions.html @@ -0,0 +1,5 @@ +SerializerOptions | @filen/filen-sdk
interface SerializerOptions {
    dots?: boolean;
    indexes?: null | boolean;
    metaTokens?: boolean;
    visitor?: SerializerVisitor;
}

Hierarchy (view full)

Properties

dots?: boolean
indexes?: null | boolean
metaTokens?: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.SerializerVisitor.html b/docs/interfaces/_internal_.SerializerVisitor.html new file mode 100644 index 00000000..1d2b3255 --- /dev/null +++ b/docs/interfaces/_internal_.SerializerVisitor.html @@ -0,0 +1 @@ +SerializerVisitor | @filen/filen-sdk
interface SerializerVisitor ((this, value, key, path, helpers) => boolean)
  • Parameters

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.SharedArrayBuffer.html b/docs/interfaces/_internal_.SharedArrayBuffer.html new file mode 100644 index 00000000..e6cacb3a --- /dev/null +++ b/docs/interfaces/_internal_.SharedArrayBuffer.html @@ -0,0 +1,7 @@ +SharedArrayBuffer | @filen/filen-sdk
interface SharedArrayBuffer {
    [species]: SharedArrayBuffer;
    [toStringTag]: "SharedArrayBuffer";
    byteLength: number;
    slice(begin, end?): SharedArrayBuffer;
}

Properties

Methods

Properties

[toStringTag]: "SharedArrayBuffer"
byteLength: number

Read-only. The length of the ArrayBuffer (in bytes).

+

Methods

  • Returns a section of an SharedArrayBuffer.

    +

    Parameters

    • begin: number
    • Optional end: number

    Returns SharedArrayBuffer

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.SharedArrayBufferConstructor.html b/docs/interfaces/_internal_.SharedArrayBufferConstructor.html new file mode 100644 index 00000000..9a54e7a4 --- /dev/null +++ b/docs/interfaces/_internal_.SharedArrayBufferConstructor.html @@ -0,0 +1,3 @@ +SharedArrayBufferConstructor | @filen/filen-sdk

Interface SharedArrayBufferConstructor

interface SharedArrayBufferConstructor {
    new SharedArrayBufferConstructornew (byteLength): SharedArrayBuffer;
    prototype: SharedArrayBuffer;
}

Constructors

Properties

Constructors

  • Parameters

    • byteLength: number

    Returns SharedArrayBuffer

Properties

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/_internal_.TransitionalOptions.html b/docs/interfaces/_internal_.TransitionalOptions.html new file mode 100644 index 00000000..a931cbcd --- /dev/null +++ b/docs/interfaces/_internal_.TransitionalOptions.html @@ -0,0 +1,4 @@ +TransitionalOptions | @filen/filen-sdk
interface TransitionalOptions {
    clarifyTimeoutError?: boolean;
    forcedJSONParsing?: boolean;
    silentJSONParsing?: boolean;
}

Properties

clarifyTimeoutError?: boolean
forcedJSONParsing?: boolean
silentJSONParsing?: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 3623ee2c..f2bfe2ad 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,3 +1,5 @@ -filen-sdk

filen-sdk

Index

Classes

default +@filen/filen-sdk

@filen/filen-sdk

References

Modules

Classes

Type Aliases

Generated using TypeDoc

\ No newline at end of file +

References

Renames and re-exports FilenSDK

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/_internal_.html b/docs/modules/_internal_.html new file mode 100644 index 00000000..7569d7f4 --- /dev/null +++ b/docs/modules/_internal_.html @@ -0,0 +1,86 @@ +<internal> | @filen/filen-sdk

Index

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/FilenSDKConfig.html b/docs/types/FilenSDKConfig.html index 5180fb9e..9ac0447a 100644 --- a/docs/types/FilenSDKConfig.html +++ b/docs/types/FilenSDKConfig.html @@ -1 +1 @@ -FilenSDKConfig | filen-sdk

Type alias FilenSDKConfig

FilenSDKConfig: {
    apiKey?: string;
    authVersion?: AuthVersion;
    baseFolderUUID?: string;
    email?: string;
    masterKeys?: string[];
    password?: string;
    privateKey?: string;
    publicKey?: string;
    twoFactorCode?: string;
    userId?: number;
}

Type declaration

  • Optional apiKey?: string
  • Optional authVersion?: AuthVersion
  • Optional baseFolderUUID?: string
  • Optional email?: string
  • Optional masterKeys?: string[]
  • Optional password?: string
  • Optional privateKey?: string
  • Optional publicKey?: string
  • Optional twoFactorCode?: string
  • Optional userId?: number

Generated using TypeDoc

\ No newline at end of file +FilenSDKConfig | @filen/filen-sdk

Type alias FilenSDKConfig

FilenSDKConfig: {
    apiKey?: string;
    authVersion?: AuthVersion;
    baseFolderUUID?: string;
    email?: string;
    masterKeys?: string[];
    password?: string;
    privateKey?: string;
    publicKey?: string;
    twoFactorCode?: string;
    userId?: number;
}

Type declaration

  • Optional apiKey?: string
  • Optional authVersion?: AuthVersion
  • Optional baseFolderUUID?: string
  • Optional email?: string
  • Optional masterKeys?: string[]
  • Optional password?: string
  • Optional privateKey?: string
  • Optional publicKey?: string
  • Optional twoFactorCode?: string
  • Optional userId?: number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.APIClientConfig.html b/docs/types/_internal_.APIClientConfig.html new file mode 100644 index 00000000..3f90ffa3 --- /dev/null +++ b/docs/types/_internal_.APIClientConfig.html @@ -0,0 +1 @@ +APIClientConfig | @filen/filen-sdk
APIClientConfig: {
    apiKey: string;
}

Type declaration

  • apiKey: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.APIConfig.html b/docs/types/_internal_.APIConfig.html new file mode 100644 index 00000000..482980db --- /dev/null +++ b/docs/types/_internal_.APIConfig.html @@ -0,0 +1 @@ +APIConfig | @filen/filen-sdk
APIConfig: {
    apiKey: string;
}

Type declaration

  • apiKey: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AddressFamily.html b/docs/types/_internal_.AddressFamily.html new file mode 100644 index 00000000..37ac0854 --- /dev/null +++ b/docs/types/_internal_.AddressFamily.html @@ -0,0 +1 @@ +AddressFamily | @filen/filen-sdk
AddressFamily: 4 | 6 | undefined

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.ArrayBufferLike.html b/docs/types/_internal_.ArrayBufferLike.html new file mode 100644 index 00000000..0814c6eb --- /dev/null +++ b/docs/types/_internal_.ArrayBufferLike.html @@ -0,0 +1 @@ +ArrayBufferLike | @filen/filen-sdk
ArrayBufferLike: ArrayBufferTypes[keyof ArrayBufferTypes]

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.ArrayBufferView.html b/docs/types/_internal_.ArrayBufferView.html new file mode 100644 index 00000000..f2707885 --- /dev/null +++ b/docs/types/_internal_.ArrayBufferView.html @@ -0,0 +1 @@ +ArrayBufferView | @filen/filen-sdk
ArrayBufferView: TypedArray | DataView

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AuthVersion.html b/docs/types/_internal_.AuthVersion.html new file mode 100644 index 00000000..257d1ad0 --- /dev/null +++ b/docs/types/_internal_.AuthVersion.html @@ -0,0 +1 @@ +AuthVersion | @filen/filen-sdk
AuthVersion: 1 | 2

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosAdapterConfig.html b/docs/types/_internal_.AxiosAdapterConfig.html new file mode 100644 index 00000000..0c6d5d17 --- /dev/null +++ b/docs/types/_internal_.AxiosAdapterConfig.html @@ -0,0 +1 @@ +AxiosAdapterConfig | @filen/filen-sdk
AxiosAdapterConfig: AxiosAdapter | AxiosAdapterName

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosAdapterName.html b/docs/types/_internal_.AxiosAdapterName.html new file mode 100644 index 00000000..b2d8c8d6 --- /dev/null +++ b/docs/types/_internal_.AxiosAdapterName.html @@ -0,0 +1 @@ +AxiosAdapterName | @filen/filen-sdk
AxiosAdapterName: "xhr" | "http" | string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosHeaderMatcher.html b/docs/types/_internal_.AxiosHeaderMatcher.html new file mode 100644 index 00000000..4a56e185 --- /dev/null +++ b/docs/types/_internal_.AxiosHeaderMatcher.html @@ -0,0 +1 @@ +AxiosHeaderMatcher | @filen/filen-sdk
AxiosHeaderMatcher: string | RegExp | ((this, value, name) => boolean)

Type declaration

    • (this, value, name): boolean
    • Parameters

      Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosHeaderParser.html b/docs/types/_internal_.AxiosHeaderParser.html new file mode 100644 index 00000000..dc933d12 --- /dev/null +++ b/docs/types/_internal_.AxiosHeaderParser.html @@ -0,0 +1 @@ +AxiosHeaderParser | @filen/filen-sdk
AxiosHeaderParser: ((this, value, header) => any)

Type declaration

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosHeaderValue.html b/docs/types/_internal_.AxiosHeaderValue.html new file mode 100644 index 00000000..29a0b7b1 --- /dev/null +++ b/docs/types/_internal_.AxiosHeaderValue.html @@ -0,0 +1 @@ +AxiosHeaderValue | @filen/filen-sdk
AxiosHeaderValue: AxiosHeaders | string | string[] | number | boolean | null

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosPromise.html b/docs/types/_internal_.AxiosPromise.html new file mode 100644 index 00000000..ae94767d --- /dev/null +++ b/docs/types/_internal_.AxiosPromise.html @@ -0,0 +1 @@ +AxiosPromise | @filen/filen-sdk

Type alias AxiosPromise<T>

AxiosPromise<T>: Promise<AxiosResponse<T>>

Type Parameters

  • T = any

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosRequestHeaders.html b/docs/types/_internal_.AxiosRequestHeaders.html new file mode 100644 index 00000000..abe888db --- /dev/null +++ b/docs/types/_internal_.AxiosRequestHeaders.html @@ -0,0 +1 @@ +AxiosRequestHeaders | @filen/filen-sdk

Type alias AxiosRequestHeaders

AxiosRequestHeaders: RawAxiosRequestHeaders & AxiosHeaders

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.AxiosResponseHeaders.html b/docs/types/_internal_.AxiosResponseHeaders.html new file mode 100644 index 00000000..11bdda0e --- /dev/null +++ b/docs/types/_internal_.AxiosResponseHeaders.html @@ -0,0 +1 @@ +AxiosResponseHeaders | @filen/filen-sdk

Type alias AxiosResponseHeaders

AxiosResponseHeaders: RawAxiosResponseHeaders & AxiosHeaders

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.BaseRequestParameters.html b/docs/types/_internal_.BaseRequestParameters.html new file mode 100644 index 00000000..9c81cd33 --- /dev/null +++ b/docs/types/_internal_.BaseRequestParameters.html @@ -0,0 +1 @@ +BaseRequestParameters | @filen/filen-sdk

Type alias BaseRequestParameters

BaseRequestParameters: {
    endpoint: string;
    maxRetries?: number;
    retryTimeout?: number;
    signal?: AbortSignal;
    timeout?: number;
    url?: string;
}

Type declaration

  • endpoint: string
  • Optional maxRetries?: number
  • Optional retryTimeout?: number
  • Optional signal?: AbortSignal
  • Optional timeout?: number
  • Optional url?: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.BufferEncoding.html b/docs/types/_internal_.BufferEncoding.html new file mode 100644 index 00000000..f4b04826 --- /dev/null +++ b/docs/types/_internal_.BufferEncoding.html @@ -0,0 +1 @@ +BufferEncoding | @filen/filen-sdk
BufferEncoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.CommonRequestHeadersList.html b/docs/types/_internal_.CommonRequestHeadersList.html new file mode 100644 index 00000000..41e4c7e3 --- /dev/null +++ b/docs/types/_internal_.CommonRequestHeadersList.html @@ -0,0 +1 @@ +CommonRequestHeadersList | @filen/filen-sdk

Type alias CommonRequestHeadersList

CommonRequestHeadersList: "Accept" | "Content-Length" | "User-Agent" | "Content-Encoding" | "Authorization"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.CommonResponseHeadersList.html b/docs/types/_internal_.CommonResponseHeadersList.html new file mode 100644 index 00000000..c916396a --- /dev/null +++ b/docs/types/_internal_.CommonResponseHeadersList.html @@ -0,0 +1 @@ +CommonResponseHeadersList | @filen/filen-sdk

Type alias CommonResponseHeadersList

CommonResponseHeadersList: "Server" | "Content-Type" | "Content-Length" | "Cache-Control" | "Content-Encoding"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.ContentType.html b/docs/types/_internal_.ContentType.html new file mode 100644 index 00000000..8472245d --- /dev/null +++ b/docs/types/_internal_.ContentType.html @@ -0,0 +1 @@ +ContentType | @filen/filen-sdk
ContentType: AxiosHeaderValue | "text/html" | "text/plain" | "multipart/form-data" | "application/json" | "application/x-www-form-urlencoded" | "application/octet-stream"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.CryptoConfig.html b/docs/types/_internal_.CryptoConfig.html new file mode 100644 index 00000000..7f043037 --- /dev/null +++ b/docs/types/_internal_.CryptoConfig.html @@ -0,0 +1 @@ +CryptoConfig | @filen/filen-sdk
CryptoConfig: {
    masterKeys: string[];
    privateKey: string;
    publicKey: string;
}

Type declaration

  • masterKeys: string[]
  • privateKey: string
  • publicKey: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.DirContentFolder.html b/docs/types/_internal_.DirContentFolder.html new file mode 100644 index 00000000..32a547cd --- /dev/null +++ b/docs/types/_internal_.DirContentFolder.html @@ -0,0 +1 @@ +DirContentFolder | @filen/filen-sdk
DirContentFolder: {
    color: string | null;
    favorited: 0 | 1;
    is_default: 0 | 1;
    is_sync: 0 | 1;
    name: string;
    parent: string;
    timestamp: number;
    uuid: string;
}

Type declaration

  • color: string | null
  • favorited: 0 | 1
  • is_default: 0 | 1
  • is_sync: 0 | 1
  • name: string
  • parent: string
  • timestamp: number
  • uuid: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.DirContentResponse.html b/docs/types/_internal_.DirContentResponse.html new file mode 100644 index 00000000..96107f4f --- /dev/null +++ b/docs/types/_internal_.DirContentResponse.html @@ -0,0 +1 @@ +DirContentResponse | @filen/filen-sdk
DirContentResponse: {
    folders: DirContentFolder[];
    uploads: DirContentUpload[];
}

Type declaration

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.DirContentUpload.html b/docs/types/_internal_.DirContentUpload.html new file mode 100644 index 00000000..cc2da1bd --- /dev/null +++ b/docs/types/_internal_.DirContentUpload.html @@ -0,0 +1 @@ +DirContentUpload | @filen/filen-sdk
DirContentUpload: {
    bucket: string;
    chunks: number;
    favorited: 0 | 1;
    metadata: string;
    parent: string;
    region: string;
    rm: string;
    size: number;
    timestamp: number;
    uuid: string;
    version: FileEncryptionVersion;
}

Type declaration

  • bucket: string
  • chunks: number
  • favorited: 0 | 1
  • metadata: string
  • parent: string
  • region: string
  • rm: string
  • size: number
  • timestamp: number
  • uuid: string
  • version: FileEncryptionVersion

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.FileEncryptionVersion.html b/docs/types/_internal_.FileEncryptionVersion.html new file mode 100644 index 00000000..6b827c98 --- /dev/null +++ b/docs/types/_internal_.FileEncryptionVersion.html @@ -0,0 +1 @@ +FileEncryptionVersion | @filen/filen-sdk

Type alias FileEncryptionVersion

FileEncryptionVersion: 1 | 2

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.FileMetadata.html b/docs/types/_internal_.FileMetadata.html new file mode 100644 index 00000000..277c1552 --- /dev/null +++ b/docs/types/_internal_.FileMetadata.html @@ -0,0 +1 @@ +FileMetadata | @filen/filen-sdk
FileMetadata: {
    creation?: number;
    hash?: number;
    key: string;
    lastModified: number;
    mime: string;
    name: string;
    size: number;
}

Type declaration

  • Optional creation?: number
  • Optional hash?: number
  • key: string
  • lastModified: number
  • mime: string
  • name: string
  • size: number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.FolderMetadata.html b/docs/types/_internal_.FolderMetadata.html new file mode 100644 index 00000000..400369ab --- /dev/null +++ b/docs/types/_internal_.FolderMetadata.html @@ -0,0 +1 @@ +FolderMetadata | @filen/filen-sdk
FolderMetadata: {
    name: string;
}

Type declaration

  • name: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.GetRequestParameters.html b/docs/types/_internal_.GetRequestParameters.html new file mode 100644 index 00000000..6db4cec3 --- /dev/null +++ b/docs/types/_internal_.GetRequestParameters.html @@ -0,0 +1 @@ +GetRequestParameters | @filen/filen-sdk

Type alias GetRequestParameters

GetRequestParameters: BaseRequestParameters & {
    method: "GET";
}

Type declaration

  • method: "GET"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.IteratorResult.html b/docs/types/_internal_.IteratorResult.html new file mode 100644 index 00000000..08ce2a7c --- /dev/null +++ b/docs/types/_internal_.IteratorResult.html @@ -0,0 +1 @@ +IteratorResult | @filen/filen-sdk

Type alias IteratorResult<T, TReturn>

Type Parameters

  • T

  • TReturn = any

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.LookupAddress.html b/docs/types/_internal_.LookupAddress.html new file mode 100644 index 00000000..86043681 --- /dev/null +++ b/docs/types/_internal_.LookupAddress.html @@ -0,0 +1 @@ +LookupAddress | @filen/filen-sdk
LookupAddress: string | LookupAddressEntry

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.Partial.html b/docs/types/_internal_.Partial.html new file mode 100644 index 00000000..303028e4 --- /dev/null +++ b/docs/types/_internal_.Partial.html @@ -0,0 +1,2 @@ +Partial | @filen/filen-sdk
Partial<T>: {
    [P in keyof T]?: T[P]
}

Make all properties in T optional

+

Type Parameters

  • T

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.PostRequestParameters.html b/docs/types/_internal_.PostRequestParameters.html new file mode 100644 index 00000000..6174e53c --- /dev/null +++ b/docs/types/_internal_.PostRequestParameters.html @@ -0,0 +1 @@ +PostRequestParameters | @filen/filen-sdk

Type alias PostRequestParameters

PostRequestParameters: BaseRequestParameters & {
    data: Record<string, unknown>;
    method: "POST";
}

Type declaration

  • data: Record<string, unknown>
  • method: "POST"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.RawAxiosRequestHeaders.html b/docs/types/_internal_.RawAxiosRequestHeaders.html new file mode 100644 index 00000000..527f1b44 --- /dev/null +++ b/docs/types/_internal_.RawAxiosRequestHeaders.html @@ -0,0 +1 @@ +RawAxiosRequestHeaders | @filen/filen-sdk

Type alias RawAxiosRequestHeaders

RawAxiosRequestHeaders: Partial<RawAxiosHeaders & {
    [Key in CommonRequestHeadersList]: AxiosHeaderValue
} & {
    Content-Type: ContentType;
}>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.RawAxiosResponseHeaders.html b/docs/types/_internal_.RawAxiosResponseHeaders.html new file mode 100644 index 00000000..aa05b12b --- /dev/null +++ b/docs/types/_internal_.RawAxiosResponseHeaders.html @@ -0,0 +1 @@ +RawAxiosResponseHeaders | @filen/filen-sdk

Type alias RawAxiosResponseHeaders

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.RawCommonResponseHeaders.html b/docs/types/_internal_.RawCommonResponseHeaders.html new file mode 100644 index 00000000..5748c07a --- /dev/null +++ b/docs/types/_internal_.RawCommonResponseHeaders.html @@ -0,0 +1 @@ +RawCommonResponseHeaders | @filen/filen-sdk

Type alias RawCommonResponseHeaders

RawCommonResponseHeaders: {
    [Key in CommonResponseHeadersList]: AxiosHeaderValue
} & {
    set-cookie: string[];
}

Type declaration

  • set-cookie: string[]

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.Record.html b/docs/types/_internal_.Record.html new file mode 100644 index 00000000..6dcd0d63 --- /dev/null +++ b/docs/types/_internal_.Record.html @@ -0,0 +1,2 @@ +Record | @filen/filen-sdk

Type alias Record<K, T>

Record<K, T>: {
    [P in K]: T
}

Construct a type with a set of properties K of type T

+

Type Parameters

  • K extends keyof any

  • T

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.RequestParameters.html b/docs/types/_internal_.RequestParameters.html new file mode 100644 index 00000000..275b6885 --- /dev/null +++ b/docs/types/_internal_.RequestParameters.html @@ -0,0 +1 @@ +RequestParameters | @filen/filen-sdk

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.ResponseType.html b/docs/types/_internal_.ResponseType.html new file mode 100644 index 00000000..05f7a6fe --- /dev/null +++ b/docs/types/_internal_.ResponseType.html @@ -0,0 +1 @@ +ResponseType | @filen/filen-sdk
ResponseType: "arraybuffer" | "blob" | "document" | "json" | "text" | "stream"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.TypedArray.html b/docs/types/_internal_.TypedArray.html new file mode 100644 index 00000000..35c3fa91 --- /dev/null +++ b/docs/types/_internal_.TypedArray.html @@ -0,0 +1 @@ +TypedArray | @filen/filen-sdk
TypedArray: Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | BigUint64Array | BigInt64Array | Float32Array | Float64Array

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/_internal_.WithImplicitCoercion.html b/docs/types/_internal_.WithImplicitCoercion.html new file mode 100644 index 00000000..2bf4dece --- /dev/null +++ b/docs/types/_internal_.WithImplicitCoercion.html @@ -0,0 +1 @@ +WithImplicitCoercion | @filen/filen-sdk

Type alias WithImplicitCoercion<T>

WithImplicitCoercion<T>: T | {
    valueOf(): T;
}

Type Parameters

  • T

Type declaration

  • valueOf:function
    • Returns T

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/variables/_internal_.Buffer-1.html b/docs/variables/_internal_.Buffer-1.html new file mode 100644 index 00000000..a4c06edd --- /dev/null +++ b/docs/variables/_internal_.Buffer-1.html @@ -0,0 +1 @@ +Buffer | @filen/filen-sdk

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/variables/_internal_.SharedArrayBuffer-1.html b/docs/variables/_internal_.SharedArrayBuffer-1.html new file mode 100644 index 00000000..a8761619 --- /dev/null +++ b/docs/variables/_internal_.SharedArrayBuffer-1.html @@ -0,0 +1 @@ +SharedArrayBuffer | @filen/filen-sdk
SharedArrayBuffer: SharedArrayBufferConstructor

Generated using TypeDoc

\ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ef78146b..3b1a0ea8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "filen-sdk", + "name": "@filen/filen-sdk", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "filen-sdk", + "name": "@filen/filen-sdk", "version": "1.0.0", "license": "AGPLv3", "dependencies": { @@ -34,6 +34,7 @@ "ts-loader": "^9.5.1", "ts-node": "^10.9.2", "typedoc": "^0.25.7", + "typedoc-plugin-missing-exports": "^2.2.0", "typescript": "^5.3.3", "util": "^0.12.5", "webpack": "^5.90.0", @@ -8116,6 +8117,15 @@ "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x" } }, + "node_modules/typedoc-plugin-missing-exports": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-2.2.0.tgz", + "integrity": "sha512-2+XR1IcyQ5UwXZVJe9NE6HrLmNufT9i5OwoIuuj79VxuA3eYq+Y6itS9rnNV1D7UeQnUSH8kISYD73gHE5zw+w==", + "dev": true, + "peerDependencies": { + "typedoc": "0.24.x || 0.25.x" + } + }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", diff --git a/package.json b/package.json index 7085c548..6be52e25 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dev": "ts-node src/test/index.ts", "build": "npm run lint && tsc --emitDeclarationOnly && webpack --config webpack.config.js && npm run typedoc", "lint": "eslint src/**/* --ext .ts", - "typedoc": "typedoc --out docs src/index.ts" + "typedoc": "typedoc --plugin typedoc-plugin-missing-exports --out docs src/index.ts" }, "repository": { "type": "git", @@ -48,6 +48,7 @@ "ts-loader": "^9.5.1", "ts-node": "^10.9.2", "typedoc": "^0.25.7", + "typedoc-plugin-missing-exports": "^2.2.0", "typescript": "^5.3.3", "util": "^0.12.5", "webpack": "^5.90.0", diff --git a/src/api/client.ts b/src/api/client.ts index 03f7a5d6..e769b16e 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -32,7 +32,15 @@ export const APIClientDefaults = { retryTimeout: 1000 } as const -export default class APIClient { +/** + * APIClient + * @date 2/1/2024 - 2:45:15 AM + * + * @export + * @class APIClient + * @typedef {APIClient} + */ +export class APIClient { private readonly config: APIClientConfig = { apiKey: "" } as const @@ -66,6 +74,15 @@ export default class APIClient { } } + /** + * Send a POST request. + * @date 2/1/2024 - 2:48:57 AM + * + * @private + * @async + * @param {PostRequestParameters} params + * @returns {unknown} + */ private async post(params: PostRequestParameters) { const headers = this.buildHeaders() const url = params.url ? params.url : APIClientDefaults.url @@ -77,6 +94,15 @@ export default class APIClient { }) } + /** + * Send a GET request. + * @date 2/1/2024 - 2:49:04 AM + * + * @private + * @async + * @param {GetRequestParameters} params + * @returns {unknown} + */ private async get(params: GetRequestParameters) { const headers = this.buildHeaders() const url = params.url ? params.url : APIClientDefaults.url @@ -88,6 +114,16 @@ export default class APIClient { }) } + /** + * Sends the request to the API. + * @date 2/1/2024 - 2:49:20 AM + * + * @public + * @async + * @template T + * @param {RequestParameters} params + * @returns {Promise} + */ public async request(params: RequestParameters): Promise { const maxRetries = params.maxRetries ? params.maxRetries : APIClientDefaults.maxRetries const retryTimeout = params.retryTimeout ? params.retryTimeout : APIClientDefaults.retryTimeout @@ -129,3 +165,5 @@ export default class APIClient { return await send() } } + +export default APIClient diff --git a/src/api/index.ts b/src/api/index.ts index 2637e070..ca90488d 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -6,7 +6,7 @@ export type APIConfig = { apiKey: string } -export default class API { +export class API { private readonly config: APIConfig = { apiKey: "" } as const @@ -41,3 +41,5 @@ export default class API { } } } + +export default API diff --git a/src/api/v3/dir/content.ts b/src/api/v3/dir/content.ts index e194a38c..a26ca5b2 100644 --- a/src/api/v3/dir/content.ts +++ b/src/api/v3/dir/content.ts @@ -31,13 +31,31 @@ export type DirContentResponse = { folders: DirContentFolder[] } -export default class DirContent { +/** + * DirContent + * @date 2/1/2024 - 3:22:32 AM + * + * @export + * @class DirContent + * @typedef {DirContent} + */ +export class DirContent { private readonly apiClient: APIClient public constructor({ apiClient }: { apiClient: APIClient }) { this.apiClient = apiClient } + /** + * Returns all files and folders inside a folder. + * @date 2/1/2024 - 3:22:42 AM + * + * @public + * @async + * @param {{ uuid: string }} param0 + * @param {string} param0.uuid + * @returns {Promise} + */ public async fetch({ uuid }: { uuid: string }): Promise { const response = await this.apiClient.request({ method: "POST", @@ -50,3 +68,5 @@ export default class DirContent { return response } } + +export default DirContent diff --git a/src/api/v3/health/index.ts b/src/api/v3/health/index.ts index 7222d669..bb11747e 100644 --- a/src/api/v3/health/index.ts +++ b/src/api/v3/health/index.ts @@ -1,12 +1,28 @@ import type APIClient from "../../client" -export default class Health { +/** + * Health + * @date 2/1/2024 - 3:23:04 AM + * + * @export + * @class Health + * @typedef {Health} + */ +export class Health { private readonly apiClient: APIClient public constructor({ apiClient }: { apiClient: APIClient }) { this.apiClient = apiClient } + /** + * Returns "OK" when API is healthy. + * @date 2/1/2024 - 3:23:14 AM + * + * @public + * @async + * @returns {Promise<"OK">} + */ public async fetch(): Promise<"OK"> { const response = await this.apiClient.request<"OK">({ method: "GET", @@ -16,3 +32,5 @@ export default class Health { return response } } + +export default Health diff --git a/src/crypto/decrypt.ts b/src/crypto/decrypt.ts index b53425df..f22e4bf4 100644 --- a/src/crypto/decrypt.ts +++ b/src/crypto/decrypt.ts @@ -14,7 +14,7 @@ import { convertTimestampToMs } from "../utils" * @class Decrypt * @typedef {Decrypt} */ -export default class Decrypt { +export class Decrypt { private readonly config: CryptoConfig private readonly textEncoder = new TextEncoder() private readonly textDecoder = new TextDecoder() @@ -172,3 +172,5 @@ export default class Decrypt { return folderMetadata } } + +export default Decrypt diff --git a/src/crypto/encrypt.ts b/src/crypto/encrypt.ts index 5a08eb70..b3df149b 100644 --- a/src/crypto/encrypt.ts +++ b/src/crypto/encrypt.ts @@ -3,7 +3,15 @@ import type { CryptoConfig } from "." import nodeCrypto from "crypto" import { generateRandomString, deriveKeyFromPassword } from "./utils" -export default class Encrypt { +/** + * Encrypt + * @date 2/1/2024 - 2:44:28 AM + * + * @export + * @class Encrypt + * @typedef {Encrypt} + */ +export class Encrypt { private readonly config: CryptoConfig private readonly textEncoder = new TextEncoder() private readonly textDecoder = new TextDecoder() @@ -66,3 +74,5 @@ export default class Encrypt { throw new Error(`crypto.encrypt.metadata not implemented for ${environment} environment`) } } + +export default Encrypt diff --git a/src/crypto/index.ts b/src/crypto/index.ts index f20787f9..a32e5d0e 100644 --- a/src/crypto/index.ts +++ b/src/crypto/index.ts @@ -8,7 +8,15 @@ export type CryptoConfig = { privateKey: string } -export default class Crypto { +/** + * Crypto + * @date 2/1/2024 - 2:44:47 AM + * + * @export + * @class Crypto + * @typedef {Crypto} + */ +export class Crypto { private readonly config: CryptoConfig private readonly _encrypt: Encrypt private readonly _decrypt: Decrypt @@ -51,3 +59,5 @@ export default class Crypto { public readonly utils = utils } + +export default Crypto diff --git a/src/crypto/utils.ts b/src/crypto/utils.ts index 8b23765a..3476904c 100644 --- a/src/crypto/utils.ts +++ b/src/crypto/utils.ts @@ -201,10 +201,12 @@ export function base64ToBuffer(base64: string): Uint8Array { return bytes } -export default { +export const utils = { generateRandomString, bufferToBase64, bufferToHex, deriveKeyFromPassword, base64ToBuffer } + +export default utils diff --git a/src/index.ts b/src/index.ts index 4c634be3..8cd53a2d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,15 @@ export type FilenSDKConfig = { userId?: number } -export default class FilenSDK { +/** + * FilenSDK + * @date 2/1/2024 - 2:45:02 AM + * + * @export + * @class FilenSDK + * @typedef {FilenSDK} + */ +export class FilenSDK { private readonly config: FilenSDKConfig private readonly _api: API private readonly _crypto: Crypto @@ -115,3 +123,5 @@ export default class FilenSDK { public readonly utils = utils } + +export default FilenSDK diff --git a/src/utils.ts b/src/utils.ts index 71b8dcd5..a58b7622 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -29,7 +29,9 @@ export function convertTimestampToMs(timestamp: number): number { return Math.floor(timestamp * 1000) } -export default { +export const utils = { sleep, convertTimestampToMs } + +export default utils