@privateaim/storage-kit 0.2.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 (49) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +202 -0
  3. package/dist/domains/base.d.ts +8 -0
  4. package/dist/domains/base.d.ts.map +1 -0
  5. package/dist/domains/bucket/api.d.ts +17 -0
  6. package/dist/domains/bucket/api.d.ts.map +1 -0
  7. package/dist/domains/bucket/entity.d.ts +12 -0
  8. package/dist/domains/bucket/entity.d.ts.map +1 -0
  9. package/dist/domains/bucket/index.d.ts +3 -0
  10. package/dist/domains/bucket/index.d.ts.map +1 -0
  11. package/dist/domains/bucket-file/api.d.ts +15 -0
  12. package/dist/domains/bucket-file/api.d.ts.map +1 -0
  13. package/dist/domains/bucket-file/entity.d.ts +18 -0
  14. package/dist/domains/bucket-file/entity.d.ts.map +1 -0
  15. package/dist/domains/bucket-file/index.d.ts +3 -0
  16. package/dist/domains/bucket-file/index.d.ts.map +1 -0
  17. package/dist/domains/index.d.ts +3 -0
  18. package/dist/domains/index.d.ts.map +1 -0
  19. package/dist/domains/types-base.d.ts +5 -0
  20. package/dist/domains/types-base.d.ts.map +1 -0
  21. package/dist/http/api-client/index.d.ts +2 -0
  22. package/dist/http/api-client/index.d.ts.map +1 -0
  23. package/dist/http/api-client/module.d.ts +9 -0
  24. package/dist/http/api-client/module.d.ts.map +1 -0
  25. package/dist/http/index.d.ts +2 -0
  26. package/dist/http/index.d.ts.map +1 -0
  27. package/dist/index.cjs +260 -0
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/index.d.ts +3 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.mjs +256 -0
  32. package/dist/index.mjs.map +1 -0
  33. package/package.json +44 -0
  34. package/rollup.config.mjs +19 -0
  35. package/src/domains/base.ts +30 -0
  36. package/src/domains/bucket/api.ts +67 -0
  37. package/src/domains/bucket/entity.ts +33 -0
  38. package/src/domains/bucket/index.ts +9 -0
  39. package/src/domains/bucket-file/api.ts +56 -0
  40. package/src/domains/bucket-file/entity.ts +45 -0
  41. package/src/domains/bucket-file/index.ts +9 -0
  42. package/src/domains/index.ts +9 -0
  43. package/src/domains/types-base.ts +12 -0
  44. package/src/http/api-client/index.ts +8 -0
  45. package/src/http/api-client/module.ts +39 -0
  46. package/src/http/index.ts +8 -0
  47. package/src/index.ts +9 -0
  48. package/tsconfig.build.json +11 -0
  49. package/tsconfig.json +3 -0
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2022-2024.
3
+ * Author Peter Placzek (tada5hi)
4
+ * For the full copyright and license information,
5
+ * view the LICENSE file that was distributed with this source code.
6
+ */
7
+
8
+ export * from './module';
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) 2022-2024.
3
+ * Author Peter Placzek (tada5hi)
4
+ * For the full copyright and license information,
5
+ * view the LICENSE file that was distributed with this source code.
6
+ */
7
+
8
+ import type { RequestBaseOptions } from 'hapic';
9
+ import { Client, HookName, isClientError } from 'hapic';
10
+ import {
11
+ BucketAPI,
12
+ BucketFileAPI,
13
+ } from '../../domains';
14
+
15
+ export class APIClient extends Client {
16
+ public readonly bucket : BucketAPI;
17
+
18
+ public readonly bucketFile : BucketFileAPI;
19
+
20
+ constructor(config: RequestBaseOptions) {
21
+ super(config);
22
+
23
+ this.bucket = new BucketAPI({ client: this });
24
+ this.bucketFile = new BucketFileAPI({ client: this });
25
+
26
+ this.on(HookName.RESPONSE_ERROR, ((error) => {
27
+ if (
28
+ isClientError(error) &&
29
+ error.response &&
30
+ error.response.data &&
31
+ typeof error.response.data.message === 'string'
32
+ ) {
33
+ error.message = error.response.data.message;
34
+ }
35
+
36
+ throw error;
37
+ }));
38
+ }
39
+ }
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2024.
3
+ * Author Peter Placzek (tada5hi)
4
+ * For the full copyright and license information,
5
+ * view the LICENSE file that was distributed with this source code.
6
+ */
7
+
8
+ export * from './api-client';
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright (c) 2024.
3
+ * Author Peter Placzek (tada5hi)
4
+ * For the full copyright and license information,
5
+ * view the LICENSE file that was distributed with this source code.
6
+ */
7
+
8
+ export * from './http';
9
+ export * from './domains';
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+
4
+ "compilerOptions": {
5
+ "outDir": "./dist"
6
+ },
7
+
8
+ "include": [
9
+ "src/**/*.ts"
10
+ ]
11
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }