@nestia/fetcher 1.2.3 → 1.3.1
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.
- package/lib/IConnection.d.ts +20 -4
- package/lib/IRandomGenerator.d.ts +32 -0
- package/lib/IRandomGenerator.js +3 -0
- package/lib/IRandomGenerator.js.map +1 -0
- package/package.json +1 -1
- package/src/IConnection.ts +21 -4
- package/src/IRandomGenerator.ts +38 -0
package/lib/IConnection.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { IEncryptionPassword } from "./IEncryptionPassword";
|
|
2
|
+
import { IRandomGenerator } from "./IRandomGenerator";
|
|
2
3
|
/**
|
|
3
4
|
* Connection information.
|
|
4
5
|
*
|
|
5
|
-
* `IConnection` is
|
|
6
|
-
* HTTP server. You can target the remote HTTP server by wring the
|
|
7
|
-
* variable down. Also, you can configure special header values
|
|
8
|
-
* {@link IConnection.headers} variable.
|
|
6
|
+
* `IConnection` is an interface ttype who represents connection information of the
|
|
7
|
+
* remote HTTP server. You can target the remote HTTP server by wring the
|
|
8
|
+
* {@link IConnection.host} variable down. Also, you can configure special header values
|
|
9
|
+
* by specializing the {@link IConnection.headers} variable.
|
|
9
10
|
*
|
|
10
11
|
* If the remote HTTP server encrypts or decrypts its body data through the AES-128/256
|
|
11
12
|
* algorithm, specify the {@link IConnection.encryption} with {@link IEncryptionPassword}
|
|
@@ -18,6 +19,21 @@ export interface IConnection {
|
|
|
18
19
|
* Host address of the remote HTTP server.
|
|
19
20
|
*/
|
|
20
21
|
host: string;
|
|
22
|
+
/**
|
|
23
|
+
* Use `typia.random<T>()` function instead.
|
|
24
|
+
*
|
|
25
|
+
* If you configure this property to be `true` or an {@link IRandomGenerator}
|
|
26
|
+
* instance, your SDK library does not send any request to remote backend server,
|
|
27
|
+
* but just returns a random data generated by `typia.random<T>()` function.
|
|
28
|
+
*
|
|
29
|
+
* By the way, to utilize this random property, SDK library must be generated with
|
|
30
|
+
* {@link INestiaConfig.random} option, too. Open `nestia.config.ts` file, and
|
|
31
|
+
* configure {@link INestiaConfig.random} property to be true. Then newly generated
|
|
32
|
+
* SDK library would have a built-in random generator.
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
random?: boolean | Partial<IRandomGenerator>;
|
|
21
37
|
/**
|
|
22
38
|
* Header values delivered to the remote HTTP server.
|
|
23
39
|
*/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface IRandomGenerator {
|
|
2
|
+
boolean(): boolean;
|
|
3
|
+
integer(minimum?: number, maximum?: number): number;
|
|
4
|
+
number(minimum?: number, maximum?: number): number;
|
|
5
|
+
bigint(minimum?: bigint, maximum?: bigint): bigint;
|
|
6
|
+
string(length?: number): string;
|
|
7
|
+
array<T>(closure: (index: number) => T, count?: number): T[];
|
|
8
|
+
length(): number;
|
|
9
|
+
uuid(): string;
|
|
10
|
+
email(): string;
|
|
11
|
+
url(): string;
|
|
12
|
+
ipv4(): string;
|
|
13
|
+
ipv6(): string;
|
|
14
|
+
pattern(regex: RegExp): string;
|
|
15
|
+
date(minimum?: number, maximum?: number): string;
|
|
16
|
+
datetime(minimum?: number, maximum?: number): string;
|
|
17
|
+
customs?: IRandomGenerator.CustomMap;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace IRandomGenerator {
|
|
20
|
+
type CustomMap = {
|
|
21
|
+
[Type in keyof Customizable]?: (tags: ICommentTag[]) => Customizable[Type] | undefined;
|
|
22
|
+
};
|
|
23
|
+
type Customizable = {
|
|
24
|
+
number: number;
|
|
25
|
+
string: string;
|
|
26
|
+
bigint: bigint;
|
|
27
|
+
};
|
|
28
|
+
interface ICommentTag {
|
|
29
|
+
name: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRandomGenerator.js","sourceRoot":"","sources":["../src/IRandomGenerator.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
package/src/IConnection.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { IEncryptionPassword } from "./IEncryptionPassword";
|
|
2
|
+
import { IRandomGenerator } from "./IRandomGenerator";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Connection information.
|
|
5
6
|
*
|
|
6
|
-
* `IConnection` is
|
|
7
|
-
* HTTP server. You can target the remote HTTP server by wring the
|
|
8
|
-
* variable down. Also, you can configure special header values
|
|
9
|
-
* {@link IConnection.headers} variable.
|
|
7
|
+
* `IConnection` is an interface ttype who represents connection information of the
|
|
8
|
+
* remote HTTP server. You can target the remote HTTP server by wring the
|
|
9
|
+
* {@link IConnection.host} variable down. Also, you can configure special header values
|
|
10
|
+
* by specializing the {@link IConnection.headers} variable.
|
|
10
11
|
*
|
|
11
12
|
* If the remote HTTP server encrypts or decrypts its body data through the AES-128/256
|
|
12
13
|
* algorithm, specify the {@link IConnection.encryption} with {@link IEncryptionPassword}
|
|
@@ -20,6 +21,22 @@ export interface IConnection {
|
|
|
20
21
|
*/
|
|
21
22
|
host: string;
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Use `typia.random<T>()` function instead.
|
|
26
|
+
*
|
|
27
|
+
* If you configure this property to be `true` or an {@link IRandomGenerator}
|
|
28
|
+
* instance, your SDK library does not send any request to remote backend server,
|
|
29
|
+
* but just returns a random data generated by `typia.random<T>()` function.
|
|
30
|
+
*
|
|
31
|
+
* By the way, to utilize this random property, SDK library must be generated with
|
|
32
|
+
* {@link INestiaConfig.random} option, too. Open `nestia.config.ts` file, and
|
|
33
|
+
* configure {@link INestiaConfig.random} property to be true. Then newly generated
|
|
34
|
+
* SDK library would have a built-in random generator.
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
random?: boolean | Partial<IRandomGenerator>;
|
|
39
|
+
|
|
23
40
|
/**
|
|
24
41
|
* Header values delivered to the remote HTTP server.
|
|
25
42
|
*/
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface IRandomGenerator {
|
|
2
|
+
boolean(): boolean;
|
|
3
|
+
integer(minimum?: number, maximum?: number): number;
|
|
4
|
+
number(minimum?: number, maximum?: number): number;
|
|
5
|
+
bigint(minimum?: bigint, maximum?: bigint): bigint;
|
|
6
|
+
string(length?: number): string;
|
|
7
|
+
array<T>(closure: (index: number) => T, count?: number): T[];
|
|
8
|
+
length(): number;
|
|
9
|
+
|
|
10
|
+
uuid(): string;
|
|
11
|
+
email(): string;
|
|
12
|
+
url(): string;
|
|
13
|
+
ipv4(): string;
|
|
14
|
+
ipv6(): string;
|
|
15
|
+
pattern(regex: RegExp): string;
|
|
16
|
+
date(minimum?: number, maximum?: number): string;
|
|
17
|
+
datetime(minimum?: number, maximum?: number): string;
|
|
18
|
+
|
|
19
|
+
customs?: IRandomGenerator.CustomMap;
|
|
20
|
+
}
|
|
21
|
+
export namespace IRandomGenerator {
|
|
22
|
+
export type CustomMap = {
|
|
23
|
+
[Type in keyof Customizable]?: (
|
|
24
|
+
tags: ICommentTag[],
|
|
25
|
+
) => Customizable[Type] | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type Customizable = {
|
|
29
|
+
number: number;
|
|
30
|
+
string: string;
|
|
31
|
+
bigint: bigint;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ICommentTag {
|
|
35
|
+
name: string;
|
|
36
|
+
value?: string;
|
|
37
|
+
}
|
|
38
|
+
}
|