@ps-aux/api-client-angular 0.2.1-rc1 → 0.2.3-rc1

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.
@@ -0,0 +1 @@
1
+ export { createHttpClient, springBootUrlConverter, qsUrlConverter } from './AngularApiHttpClient';
package/dist/index.esm.js CHANGED
@@ -265,7 +265,6 @@ const getFileNameFromContentDispositionHeader = (contentDispositionHeader) => {
265
265
  };
266
266
 
267
267
  const ContentType = {
268
- Json: 'application/json',
269
268
  FormData: 'multipart/form-data',
270
269
  };
271
270
 
package/dist/index.js CHANGED
@@ -267,7 +267,6 @@ const getFileNameFromContentDispositionHeader = (contentDispositionHeader) => {
267
267
  };
268
268
 
269
269
  const ContentType = {
270
- Json: 'application/json',
271
270
  FormData: 'multipart/form-data',
272
271
  };
273
272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ps-aux/api-client-angular",
3
- "version": "0.2.1-rc1",
3
+ "version": "0.2.3-rc1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.esm.js",
@@ -13,10 +13,10 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "qs": "^6.11.2",
17
- "rxjs": "^7.8.1"
16
+ "qs": "^6.11.2"
18
17
  },
19
- "devDependencies": {
18
+ "peerDependencies": {
19
+ "rxjs": "^7.8.1",
20
20
  "@angular/common": "^16.2.12"
21
21
  }
22
22
  }
@@ -1,3 +0,0 @@
1
- import { HttpClient as AngularHttpClient } from '@angular/common/http';
2
- import { HttpClient } from './types';
3
- export declare const createHttpClient: (client: AngularHttpClient) => HttpClient;
@@ -1 +0,0 @@
1
- export { createHttpClient } from './AngularApiHttpClient';
@@ -1,2 +0,0 @@
1
- export declare const serializeQuery: (obj: any) => any;
2
- export declare const flattenObject: (obj: any, prefix?: string) => any;
@@ -1,20 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- export type ContentType = {};
3
- export type RequestParams = {};
4
- export declare const ContentType: {
5
- Json: string;
6
- FormData: string;
7
- };
8
- export type Request = {
9
- path: string;
10
- method: 'GET' | 'POST' | 'PUT' | 'DELETE';
11
- format?: 'json';
12
- query?: any;
13
- body?: any;
14
- type?: string;
15
- secure?: boolean;
16
- responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
17
- };
18
- export type HttpClient<Any = any> = {
19
- request: <Data, A = any>(req: Request) => Observable<Data>;
20
- };
@@ -1 +0,0 @@
1
- export declare const myFun: (f: string) => string;
package/dist/types.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- export type ContentType = {};
3
- export type RequestParams = {};
4
- export declare const ContentType: {
5
- Json: string;
6
- FormData: string;
7
- };
8
- export type Request = {
9
- path: string;
10
- method: 'GET' | 'POST' | 'PUT' | 'DELETE';
11
- format?: 'json';
12
- query?: any;
13
- body?: any;
14
- type?: string;
15
- secure?: boolean;
16
- };
17
- export type HttpClient<Any = any> = {
18
- request: <Data, A = any>(req: Request) => Observable<Data>;
19
- };
@@ -1,45 +0,0 @@
1
- // @ts-nocheck
2
-
3
- // TODO improve typings and check implementation
4
- export const serializeQuery = (obj: any): any => {
5
- let result = {};
6
- if (obj) {
7
- Object.entries(obj).forEach(([key, val]) => {
8
- if (Array.isArray(val)) {
9
- val.map(v => {
10
- if (result[key]) {
11
- result[key] += `&${key}=${v}`;
12
- } else {
13
- result[key] = v;
14
- }
15
- });
16
- } else if (typeof val === 'object') {
17
- result = { ...result, ...flattenObject(val) };
18
- } else {
19
- result[key] = val;
20
- }
21
- });
22
- }
23
- return result;
24
- };
25
-
26
- export const flattenObject = (obj: any, prefix?: string): any => {
27
- let str = {};
28
- const pfix = prefix ? prefix + '.' : '';
29
-
30
- for (const p in obj) {
31
- if (obj.hasOwnProperty(p)) {
32
- if (Array.isArray(obj[p])) {
33
- str[pfix + p] = obj[p];
34
- } else if (obj[p] === null) {
35
- str[pfix + p] = null;
36
- } else if (typeof obj[p] === 'object') {
37
- str = { ...str, ...flattenObject(obj[p], pfix + p) };
38
- } else if (obj[p] !== undefined) {
39
- str[pfix + p] = obj[p];
40
- }
41
- }
42
- }
43
-
44
- return str;
45
- };