@basmilius/http-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/dist/adapter/HttpAdapter.d.ts +5 -0
  4. package/dist/adapter/index.d.ts +1 -0
  5. package/dist/basmilius.httpClient.js +1098 -0
  6. package/dist/basmilius.httpClient.js.map +7 -0
  7. package/dist/decorator/adapter.d.ts +2 -0
  8. package/dist/decorator/debounce.d.ts +1 -0
  9. package/dist/decorator/dto/arrayProxy.d.ts +18 -0
  10. package/dist/decorator/dto/classProxy.d.ts +11 -0
  11. package/dist/decorator/dto/clone.d.ts +5 -0
  12. package/dist/decorator/dto/constant.d.ts +6 -0
  13. package/dist/decorator/dto/fill.d.ts +5 -0
  14. package/dist/decorator/dto/helper/areEqual.d.ts +5 -0
  15. package/dist/decorator/dto/helper/assertDto.d.ts +5 -0
  16. package/dist/decorator/dto/helper/circularProtect.d.ts +1 -0
  17. package/dist/decorator/dto/helper/cloneDto.d.ts +4 -0
  18. package/dist/decorator/dto/helper/executeIfDtoDirtyAndMarkClean.d.ts +5 -0
  19. package/dist/decorator/dto/helper/index.d.ts +17 -0
  20. package/dist/decorator/dto/helper/instance.d.ts +2 -0
  21. package/dist/decorator/dto/helper/isDto.d.ts +5 -0
  22. package/dist/decorator/dto/helper/isDtoClean.d.ts +4 -0
  23. package/dist/decorator/dto/helper/isDtoDirty.d.ts +4 -0
  24. package/dist/decorator/dto/helper/markDtoClean.d.ts +5 -0
  25. package/dist/decorator/dto/helper/markDtoDirty.d.ts +5 -0
  26. package/dist/decorator/dto/helper/relateDtoTo.d.ts +5 -0
  27. package/dist/decorator/dto/helper/relateValueTo.d.ts +5 -0
  28. package/dist/decorator/dto/helper/trackDto.d.ts +5 -0
  29. package/dist/decorator/dto/helper/triggerDto.d.ts +6 -0
  30. package/dist/decorator/dto/helper/unrelateDtoFrom.d.ts +5 -0
  31. package/dist/decorator/dto/helper/unrelateValueFrom.d.ts +5 -0
  32. package/dist/decorator/dto/index.d.ts +11 -0
  33. package/dist/decorator/dto/instance.d.ts +31 -0
  34. package/dist/decorator/dto/instanceProxy.d.ts +24 -0
  35. package/dist/decorator/dto/refProxy.d.ts +33 -0
  36. package/dist/decorator/dto/symbols.d.ts +11 -0
  37. package/dist/decorator/dto/toJSON.d.ts +5 -0
  38. package/dist/decorator/index.d.ts +4 -0
  39. package/dist/dto/BlobResponse.d.ts +6 -0
  40. package/dist/dto/Paginated.d.ts +9 -0
  41. package/dist/dto/index.d.ts +2 -0
  42. package/dist/enum/HttpMethod.d.ts +9 -0
  43. package/dist/enum/HttpStatusCode.d.ts +63 -0
  44. package/dist/enum/index.d.ts +2 -0
  45. package/dist/http/BaseResponse.d.ts +12 -0
  46. package/dist/http/BaseService.d.ts +4 -0
  47. package/dist/http/HttpClient.d.ts +15 -0
  48. package/dist/http/IResponseErrors.d.ts +3 -0
  49. package/dist/http/QueryString.d.ts +15 -0
  50. package/dist/http/RequestBuilder.d.ts +28 -0
  51. package/dist/http/RequestError.d.ts +9 -0
  52. package/dist/http/helpers.d.ts +3 -0
  53. package/dist/http/index.d.ts +8 -0
  54. package/dist/index.d.ts +5 -0
  55. package/dist/util/datetime.d.ts +2 -0
  56. package/dist/util/index.d.ts +2 -0
  57. package/dist/util/reflection.d.ts +6 -0
  58. package/package.json +41 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Bas Milius
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Http Client
2
+
3
+ This repository contains the source code for the Http client that I use in personal Vue
4
+ projects. It requires you to create dto's for objects and services for api calls.
5
+
6
+ ## 📦 Registry
7
+
8
+ - The package is available under `@basmilius/http-client`.
9
+
10
+ ## ⚠️ Requirements
11
+
12
+ - Install Node.js ^20
13
+ - Install pnpm using `npm i -g pnpm`.
14
+ - Use `pnpm install` to install the required packages.
15
+ - Use `pnpm dev` to start a build watcher for both targets.
16
+ - Use `pnpm build` to build a production bundle.
17
+
18
+ ## 🪵 Git
19
+
20
+ All commit messages and branches will be in English.
21
+
22
+ ### Branches
23
+
24
+ - **Main** — Contains the latest stable release and is the exact source that is running in production.
25
+ - **Develop** — Contains the latest staging release that is marked for deployment and is the exact source that is running on staging.
26
+ - **Feature branches** — Any feature should have its own feature branch. Once complete, the branch should be merged into the _develop_ branch and the feature branch should be deleted.
27
+ - **Bugfix branches** — When a bug is found, it should be fixed within a bugfix branch. Once complete the branch should be merged into the _develop_ branch and the feature branch should be deleted.
28
+
29
+ ### Commit messages
30
+
31
+ Commit messages are bound to the following templates:
32
+
33
+ - `<type>: <message> `
34
+ - `<type>(<feature>): <message>`
35
+ - `<type>(<feature>): <message> [<issue-number>]`
36
+
37
+ #### Examples
38
+
39
+ - `feat(dto): adds clone function to clone dtos.`
40
+ - `feat(http): implement put requests. [HTTP-123]`
41
+ - `chore: applied default coding style.`
@@ -0,0 +1,5 @@
1
+ import { Paginated } from '../dto';
2
+ export declare class HttpAdapter {
3
+ static parsePaginatedAdapter<T>(response: object, adapterMethod: (item: object) => T): Paginated<T>;
4
+ static parseFileNameFromContentDispositionHeader(header: string): string;
5
+ }
@@ -0,0 +1 @@
1
+ export { HttpAdapter } from './HttpAdapter';