create-request 1.5.4 → 1.6.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/README.md +82 -1
- package/dist/library/BaseRequest.d.ts +58 -27
- package/dist/library/BodyRequest.d.ts +6 -7
- package/dist/library/RequestError.d.ts +64 -3
- package/dist/library/ResponseWrapper.d.ts +19 -8
- package/dist/library/apiBuilder.d.ts +20 -1
- package/dist/library/enums.d.ts +67 -58
- package/dist/library/index.cjs +537 -589
- package/dist/library/index.cjs.map +1 -1
- package/dist/library/index.d.ts +1 -1
- package/dist/library/index.esm.js +529 -589
- package/dist/library/index.esm.js.map +1 -1
- package/dist/library/index.esm.min.js +1 -1
- package/dist/library/index.esm.min.js.map +1 -1
- package/dist/library/index.min.cjs +1 -1
- package/dist/library/index.min.cjs.map +1 -1
- package/dist/library/requestMethods.d.ts +7 -14
- package/dist/library/types.d.ts +15 -0
- package/dist/library/utils/Config.d.ts +11 -11
- package/package.json +4 -3
package/dist/library/enums.d.ts
CHANGED
|
@@ -1,85 +1,94 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Enum for HTTP methods
|
|
3
3
|
*/
|
|
4
|
-
export declare
|
|
5
|
-
GET
|
|
6
|
-
PUT
|
|
7
|
-
POST
|
|
8
|
-
HEAD
|
|
9
|
-
PATCH
|
|
10
|
-
DELETE
|
|
11
|
-
OPTIONS
|
|
12
|
-
}
|
|
4
|
+
export declare const HttpMethod: {
|
|
5
|
+
readonly GET: "GET";
|
|
6
|
+
readonly PUT: "PUT";
|
|
7
|
+
readonly POST: "POST";
|
|
8
|
+
readonly HEAD: "HEAD";
|
|
9
|
+
readonly PATCH: "PATCH";
|
|
10
|
+
readonly DELETE: "DELETE";
|
|
11
|
+
readonly OPTIONS: "OPTIONS";
|
|
12
|
+
};
|
|
13
|
+
export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
|
|
13
14
|
/**
|
|
14
15
|
* Enum for request priorities
|
|
15
16
|
*/
|
|
16
|
-
export declare
|
|
17
|
-
LOW
|
|
18
|
-
HIGH
|
|
19
|
-
AUTO
|
|
20
|
-
}
|
|
17
|
+
export declare const RequestPriority: {
|
|
18
|
+
readonly LOW: "low";
|
|
19
|
+
readonly HIGH: "high";
|
|
20
|
+
readonly AUTO: "auto";
|
|
21
|
+
};
|
|
22
|
+
export type RequestPriority = (typeof RequestPriority)[keyof typeof RequestPriority];
|
|
21
23
|
/**
|
|
22
24
|
* Enum for credentials policies
|
|
23
25
|
*/
|
|
24
|
-
export declare
|
|
25
|
-
OMIT
|
|
26
|
-
INCLUDE
|
|
27
|
-
SAME_ORIGIN
|
|
28
|
-
}
|
|
26
|
+
export declare const CredentialsPolicy: {
|
|
27
|
+
readonly OMIT: "omit";
|
|
28
|
+
readonly INCLUDE: "include";
|
|
29
|
+
readonly SAME_ORIGIN: "same-origin";
|
|
30
|
+
};
|
|
31
|
+
export type CredentialsPolicy = (typeof CredentialsPolicy)[keyof typeof CredentialsPolicy];
|
|
29
32
|
/**
|
|
30
33
|
* Enum for request modes
|
|
31
34
|
*/
|
|
32
|
-
export declare
|
|
33
|
-
CORS
|
|
34
|
-
NO_CORS
|
|
35
|
-
SAME_ORIGIN
|
|
36
|
-
NAVIGATE
|
|
37
|
-
}
|
|
35
|
+
export declare const RequestMode: {
|
|
36
|
+
readonly CORS: "cors";
|
|
37
|
+
readonly NO_CORS: "no-cors";
|
|
38
|
+
readonly SAME_ORIGIN: "same-origin";
|
|
39
|
+
readonly NAVIGATE: "navigate";
|
|
40
|
+
};
|
|
41
|
+
export type RequestMode = (typeof RequestMode)[keyof typeof RequestMode];
|
|
38
42
|
/**
|
|
39
43
|
* Enum for redirect modes
|
|
40
44
|
*/
|
|
41
|
-
export declare
|
|
42
|
-
ERROR
|
|
43
|
-
FOLLOW
|
|
44
|
-
MANUAL
|
|
45
|
-
}
|
|
45
|
+
export declare const RedirectMode: {
|
|
46
|
+
readonly ERROR: "error";
|
|
47
|
+
readonly FOLLOW: "follow";
|
|
48
|
+
readonly MANUAL: "manual";
|
|
49
|
+
};
|
|
50
|
+
export type RedirectMode = (typeof RedirectMode)[keyof typeof RedirectMode];
|
|
46
51
|
/**
|
|
47
52
|
* Enum for cookie SameSite policies
|
|
48
53
|
*/
|
|
49
|
-
export declare
|
|
50
|
-
LAX
|
|
51
|
-
NONE
|
|
52
|
-
STRICT
|
|
53
|
-
}
|
|
54
|
+
export declare const SameSitePolicy: {
|
|
55
|
+
readonly LAX: "Lax";
|
|
56
|
+
readonly NONE: "None";
|
|
57
|
+
readonly STRICT: "Strict";
|
|
58
|
+
};
|
|
59
|
+
export type SameSitePolicy = (typeof SameSitePolicy)[keyof typeof SameSitePolicy];
|
|
54
60
|
/**
|
|
55
61
|
* Enum for body types
|
|
56
62
|
*/
|
|
57
|
-
export declare
|
|
58
|
-
JSON
|
|
59
|
-
STRING
|
|
60
|
-
BINARY
|
|
61
|
-
}
|
|
63
|
+
export declare const BodyType: {
|
|
64
|
+
readonly JSON: "json";
|
|
65
|
+
readonly STRING: "string";
|
|
66
|
+
readonly BINARY: "binary";
|
|
67
|
+
};
|
|
68
|
+
export type BodyType = (typeof BodyType)[keyof typeof BodyType];
|
|
62
69
|
/**
|
|
63
70
|
* Referrer policies for fetch requests
|
|
64
71
|
*/
|
|
65
|
-
export declare
|
|
66
|
-
ORIGIN
|
|
67
|
-
UNSAFE_URL
|
|
68
|
-
SAME_ORIGIN
|
|
69
|
-
NO_REFERRER
|
|
70
|
-
STRICT_ORIGIN
|
|
71
|
-
ORIGIN_WHEN_CROSS_ORIGIN
|
|
72
|
-
NO_REFERRER_WHEN_DOWNGRADE
|
|
73
|
-
STRICT_ORIGIN_WHEN_CROSS_ORIGIN
|
|
74
|
-
}
|
|
72
|
+
export declare const ReferrerPolicy: {
|
|
73
|
+
readonly ORIGIN: "origin";
|
|
74
|
+
readonly UNSAFE_URL: "unsafe-url";
|
|
75
|
+
readonly SAME_ORIGIN: "same-origin";
|
|
76
|
+
readonly NO_REFERRER: "no-referrer";
|
|
77
|
+
readonly STRICT_ORIGIN: "strict-origin";
|
|
78
|
+
readonly ORIGIN_WHEN_CROSS_ORIGIN: "origin-when-cross-origin";
|
|
79
|
+
readonly NO_REFERRER_WHEN_DOWNGRADE: "no-referrer-when-downgrade";
|
|
80
|
+
readonly STRICT_ORIGIN_WHEN_CROSS_ORIGIN: "strict-origin-when-cross-origin";
|
|
81
|
+
};
|
|
82
|
+
export type ReferrerPolicy = (typeof ReferrerPolicy)[keyof typeof ReferrerPolicy];
|
|
75
83
|
/**
|
|
76
84
|
* Cache modes for fetch requests
|
|
77
85
|
*/
|
|
78
|
-
export declare
|
|
79
|
-
RELOAD
|
|
80
|
-
DEFAULT
|
|
81
|
-
NO_CACHE
|
|
82
|
-
NO_STORE
|
|
83
|
-
FORCE_CACHE
|
|
84
|
-
ONLY_IF_CACHED
|
|
85
|
-
}
|
|
86
|
+
export declare const CacheMode: {
|
|
87
|
+
readonly RELOAD: "reload";
|
|
88
|
+
readonly DEFAULT: "default";
|
|
89
|
+
readonly NO_CACHE: "no-cache";
|
|
90
|
+
readonly NO_STORE: "no-store";
|
|
91
|
+
readonly FORCE_CACHE: "force-cache";
|
|
92
|
+
readonly ONLY_IF_CACHED: "only-if-cached";
|
|
93
|
+
};
|
|
94
|
+
export type CacheMode = (typeof CacheMode)[keyof typeof CacheMode];
|