isomorphic-git 1.41.8 → 1.42.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.
- package/http/node/index.cjs +3 -1
- package/http/node/index.d.cts +3 -3
- package/http/node/index.d.ts +3 -3
- package/http/node/index.js +3 -1
- package/http/web/index.cjs +9 -2
- package/http/web/index.d.cts +3 -3
- package/http/web/index.d.ts +3 -3
- package/http/web/index.js +9 -2
- package/http/web/index.umd.js +9 -2
- package/index.cjs +52 -23
- package/index.d.cts +6 -15
- package/index.d.ts +6 -15
- package/index.js +52 -23
- package/index.umd.min.d.ts +6 -15
- package/index.umd.min.js +1 -1
- package/index.umd.min.js.map +1 -1
- package/managers/index.cjs +7 -1
- package/managers/index.d.cts +8 -4
- package/managers/index.d.ts +8 -4
- package/managers/index.js +7 -1
- package/managers/index.umd.min.js +1 -1
- package/managers/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/managers/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ var crypto$1 = require('crypto');
|
|
|
32
32
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
33
33
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
34
34
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
35
|
-
* @property {
|
|
35
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
36
36
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
37
37
|
*/
|
|
38
38
|
|
|
@@ -3029,6 +3029,7 @@ class GitRemoteHTTP {
|
|
|
3029
3029
|
* @param {string} args.service - The Git service (e.g., "git-upload-pack").
|
|
3030
3030
|
* @param {string} args.url - The URL of the remote repository.
|
|
3031
3031
|
* @param {Object<string, string>} args.headers - HTTP headers to include in the request.
|
|
3032
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
3032
3033
|
* @param {1 | 2} args.protocolVersion - The Git protocol version to use.
|
|
3033
3034
|
* @returns {Promise<Object>} - The parsed response from the remote repository.
|
|
3034
3035
|
* @throws {HttpError} - If the HTTP request fails.
|
|
@@ -3045,6 +3046,7 @@ class GitRemoteHTTP {
|
|
|
3045
3046
|
service,
|
|
3046
3047
|
url: _origUrl,
|
|
3047
3048
|
headers,
|
|
3049
|
+
signal,
|
|
3048
3050
|
protocolVersion,
|
|
3049
3051
|
}) {
|
|
3050
3052
|
let { url, auth } = extractAuthFromUrl(_origUrl);
|
|
@@ -3065,6 +3067,7 @@ class GitRemoteHTTP {
|
|
|
3065
3067
|
method: 'GET',
|
|
3066
3068
|
url: `${proxifiedURL}/info/refs?service=${service}`,
|
|
3067
3069
|
headers,
|
|
3070
|
+
signal,
|
|
3068
3071
|
});
|
|
3069
3072
|
|
|
3070
3073
|
// the default loop behavior
|
|
@@ -3140,6 +3143,7 @@ class GitRemoteHTTP {
|
|
|
3140
3143
|
* @param {Object<string, string>} [args.headers] - HTTP headers to include in the request.
|
|
3141
3144
|
* @param {any} args.body - The request body to send.
|
|
3142
3145
|
* @param {any} args.auth - Authentication credentials.
|
|
3146
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
3143
3147
|
* @returns {Promise<GitHttpResponse>} - The HTTP response from the remote repository.
|
|
3144
3148
|
* @throws {HttpError} - If the HTTP request fails.
|
|
3145
3149
|
*/
|
|
@@ -3152,6 +3156,7 @@ class GitRemoteHTTP {
|
|
|
3152
3156
|
auth,
|
|
3153
3157
|
body,
|
|
3154
3158
|
headers,
|
|
3159
|
+
signal,
|
|
3155
3160
|
}) {
|
|
3156
3161
|
// We already have the "correct" auth value at this point, but
|
|
3157
3162
|
// we need to strip out the username/password from the URL yet again.
|
|
@@ -3170,6 +3175,7 @@ class GitRemoteHTTP {
|
|
|
3170
3175
|
url: `${url}/${service}`,
|
|
3171
3176
|
body,
|
|
3172
3177
|
headers,
|
|
3178
|
+
signal,
|
|
3173
3179
|
});
|
|
3174
3180
|
if (res.statusCode !== 200) {
|
|
3175
3181
|
const { response } = stringifyBody(res);
|
package/managers/index.d.cts
CHANGED
|
@@ -51,9 +51,9 @@ export type GitHttpRequest = {
|
|
|
51
51
|
*/
|
|
52
52
|
onProgress?: ProgressCallback | undefined;
|
|
53
53
|
/**
|
|
54
|
-
* -
|
|
54
|
+
* - Signal to abort the HTTP request
|
|
55
55
|
*/
|
|
56
|
-
signal?:
|
|
56
|
+
signal?: AbortSignal | undefined;
|
|
57
57
|
/**
|
|
58
58
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
59
59
|
*/
|
|
@@ -731,13 +731,14 @@ export class GitRemoteHTTP {
|
|
|
731
731
|
* @param {string} args.service - The Git service (e.g., "git-upload-pack").
|
|
732
732
|
* @param {string} args.url - The URL of the remote repository.
|
|
733
733
|
* @param {Object<string, string>} args.headers - HTTP headers to include in the request.
|
|
734
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
734
735
|
* @param {1 | 2} args.protocolVersion - The Git protocol version to use.
|
|
735
736
|
* @returns {Promise<Object>} - The parsed response from the remote repository.
|
|
736
737
|
* @throws {HttpError} - If the HTTP request fails.
|
|
737
738
|
* @throws {SmartHttpError} - If the response cannot be parsed.
|
|
738
739
|
* @throws {UserCanceledError} - If the user cancels the operation.
|
|
739
740
|
*/
|
|
740
|
-
static discover({ http, onProgress, onAuth, onAuthSuccess, onAuthFailure, corsProxy, service, url: _origUrl, headers, protocolVersion, }: {
|
|
741
|
+
static discover({ http, onProgress, onAuth, onAuthSuccess, onAuthFailure, corsProxy, service, url: _origUrl, headers, signal, protocolVersion, }: {
|
|
741
742
|
http: HttpClient;
|
|
742
743
|
onProgress?: ProgressCallback | undefined;
|
|
743
744
|
onAuth?: AuthCallback | undefined;
|
|
@@ -749,6 +750,7 @@ export class GitRemoteHTTP {
|
|
|
749
750
|
headers: {
|
|
750
751
|
[x: string]: string;
|
|
751
752
|
};
|
|
753
|
+
signal?: AbortSignal | undefined;
|
|
752
754
|
protocolVersion: 1 | 2;
|
|
753
755
|
}): Promise<any>;
|
|
754
756
|
/**
|
|
@@ -763,10 +765,11 @@ export class GitRemoteHTTP {
|
|
|
763
765
|
* @param {Object<string, string>} [args.headers] - HTTP headers to include in the request.
|
|
764
766
|
* @param {any} args.body - The request body to send.
|
|
765
767
|
* @param {any} args.auth - Authentication credentials.
|
|
768
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
766
769
|
* @returns {Promise<GitHttpResponse>} - The HTTP response from the remote repository.
|
|
767
770
|
* @throws {HttpError} - If the HTTP request fails.
|
|
768
771
|
*/
|
|
769
|
-
static connect({ http, onProgress, corsProxy, service, url, auth, body, headers, }: {
|
|
772
|
+
static connect({ http, onProgress, corsProxy, service, url, auth, body, headers, signal, }: {
|
|
770
773
|
http: HttpClient;
|
|
771
774
|
onProgress?: ProgressCallback | undefined;
|
|
772
775
|
corsProxy?: string | undefined;
|
|
@@ -777,6 +780,7 @@ export class GitRemoteHTTP {
|
|
|
777
780
|
} | undefined;
|
|
778
781
|
body: any;
|
|
779
782
|
auth: any;
|
|
783
|
+
signal?: AbortSignal | undefined;
|
|
780
784
|
}): Promise<GitHttpResponse>;
|
|
781
785
|
}
|
|
782
786
|
/**
|
package/managers/index.d.ts
CHANGED
|
@@ -50,9 +50,9 @@ export type GitHttpRequest = {
|
|
|
50
50
|
*/
|
|
51
51
|
onProgress?: ProgressCallback | undefined;
|
|
52
52
|
/**
|
|
53
|
-
* -
|
|
53
|
+
* - Signal to abort the HTTP request
|
|
54
54
|
*/
|
|
55
|
-
signal?:
|
|
55
|
+
signal?: AbortSignal | undefined;
|
|
56
56
|
/**
|
|
57
57
|
* - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
58
58
|
*/
|
|
@@ -730,13 +730,14 @@ export class GitRemoteHTTP {
|
|
|
730
730
|
* @param {string} args.service - The Git service (e.g., "git-upload-pack").
|
|
731
731
|
* @param {string} args.url - The URL of the remote repository.
|
|
732
732
|
* @param {Object<string, string>} args.headers - HTTP headers to include in the request.
|
|
733
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
733
734
|
* @param {1 | 2} args.protocolVersion - The Git protocol version to use.
|
|
734
735
|
* @returns {Promise<Object>} - The parsed response from the remote repository.
|
|
735
736
|
* @throws {HttpError} - If the HTTP request fails.
|
|
736
737
|
* @throws {SmartHttpError} - If the response cannot be parsed.
|
|
737
738
|
* @throws {UserCanceledError} - If the user cancels the operation.
|
|
738
739
|
*/
|
|
739
|
-
static discover({ http, onProgress, onAuth, onAuthSuccess, onAuthFailure, corsProxy, service, url: _origUrl, headers, protocolVersion, }: {
|
|
740
|
+
static discover({ http, onProgress, onAuth, onAuthSuccess, onAuthFailure, corsProxy, service, url: _origUrl, headers, signal, protocolVersion, }: {
|
|
740
741
|
http: HttpClient;
|
|
741
742
|
onProgress?: ProgressCallback | undefined;
|
|
742
743
|
onAuth?: AuthCallback | undefined;
|
|
@@ -748,6 +749,7 @@ export class GitRemoteHTTP {
|
|
|
748
749
|
headers: {
|
|
749
750
|
[x: string]: string;
|
|
750
751
|
};
|
|
752
|
+
signal?: AbortSignal | undefined;
|
|
751
753
|
protocolVersion: 1 | 2;
|
|
752
754
|
}): Promise<any>;
|
|
753
755
|
/**
|
|
@@ -762,10 +764,11 @@ export class GitRemoteHTTP {
|
|
|
762
764
|
* @param {Object<string, string>} [args.headers] - HTTP headers to include in the request.
|
|
763
765
|
* @param {any} args.body - The request body to send.
|
|
764
766
|
* @param {any} args.auth - Authentication credentials.
|
|
767
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
765
768
|
* @returns {Promise<GitHttpResponse>} - The HTTP response from the remote repository.
|
|
766
769
|
* @throws {HttpError} - If the HTTP request fails.
|
|
767
770
|
*/
|
|
768
|
-
static connect({ http, onProgress, corsProxy, service, url, auth, body, headers, }: {
|
|
771
|
+
static connect({ http, onProgress, corsProxy, service, url, auth, body, headers, signal, }: {
|
|
769
772
|
http: HttpClient;
|
|
770
773
|
onProgress?: ProgressCallback | undefined;
|
|
771
774
|
corsProxy?: string | undefined;
|
|
@@ -776,6 +779,7 @@ export class GitRemoteHTTP {
|
|
|
776
779
|
} | undefined;
|
|
777
780
|
body: any;
|
|
778
781
|
auth: any;
|
|
782
|
+
signal?: AbortSignal | undefined;
|
|
779
783
|
}): Promise<GitHttpResponse>;
|
|
780
784
|
}
|
|
781
785
|
/**
|
package/managers/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import pako from 'pako';
|
|
|
25
25
|
* @property {Object} [agent] - An HTTP or HTTPS agent that manages connections for the HTTP client (Node.js only)
|
|
26
26
|
* @property {AsyncIterableIterator<Uint8Array>} [body] - An async iterator of Uint8Arrays that make up the body of POST requests
|
|
27
27
|
* @property {ProgressCallback} [onProgress] - Reserved for future use (emitting `GitProgressEvent`s)
|
|
28
|
-
* @property {
|
|
28
|
+
* @property {AbortSignal} [signal] - Signal to abort the HTTP request
|
|
29
29
|
* @property {Object} [fetchOptions={}] - Additional options to pass to fetch (Web) or simple-get (Node)
|
|
30
30
|
*/
|
|
31
31
|
|
|
@@ -3022,6 +3022,7 @@ class GitRemoteHTTP {
|
|
|
3022
3022
|
* @param {string} args.service - The Git service (e.g., "git-upload-pack").
|
|
3023
3023
|
* @param {string} args.url - The URL of the remote repository.
|
|
3024
3024
|
* @param {Object<string, string>} args.headers - HTTP headers to include in the request.
|
|
3025
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
3025
3026
|
* @param {1 | 2} args.protocolVersion - The Git protocol version to use.
|
|
3026
3027
|
* @returns {Promise<Object>} - The parsed response from the remote repository.
|
|
3027
3028
|
* @throws {HttpError} - If the HTTP request fails.
|
|
@@ -3038,6 +3039,7 @@ class GitRemoteHTTP {
|
|
|
3038
3039
|
service,
|
|
3039
3040
|
url: _origUrl,
|
|
3040
3041
|
headers,
|
|
3042
|
+
signal,
|
|
3041
3043
|
protocolVersion,
|
|
3042
3044
|
}) {
|
|
3043
3045
|
let { url, auth } = extractAuthFromUrl(_origUrl);
|
|
@@ -3058,6 +3060,7 @@ class GitRemoteHTTP {
|
|
|
3058
3060
|
method: 'GET',
|
|
3059
3061
|
url: `${proxifiedURL}/info/refs?service=${service}`,
|
|
3060
3062
|
headers,
|
|
3063
|
+
signal,
|
|
3061
3064
|
});
|
|
3062
3065
|
|
|
3063
3066
|
// the default loop behavior
|
|
@@ -3133,6 +3136,7 @@ class GitRemoteHTTP {
|
|
|
3133
3136
|
* @param {Object<string, string>} [args.headers] - HTTP headers to include in the request.
|
|
3134
3137
|
* @param {any} args.body - The request body to send.
|
|
3135
3138
|
* @param {any} args.auth - Authentication credentials.
|
|
3139
|
+
* @param {AbortSignal} [args.signal] - Signal to abort the operation.
|
|
3136
3140
|
* @returns {Promise<GitHttpResponse>} - The HTTP response from the remote repository.
|
|
3137
3141
|
* @throws {HttpError} - If the HTTP request fails.
|
|
3138
3142
|
*/
|
|
@@ -3145,6 +3149,7 @@ class GitRemoteHTTP {
|
|
|
3145
3149
|
auth,
|
|
3146
3150
|
body,
|
|
3147
3151
|
headers,
|
|
3152
|
+
signal,
|
|
3148
3153
|
}) {
|
|
3149
3154
|
// We already have the "correct" auth value at this point, but
|
|
3150
3155
|
// we need to strip out the username/password from the URL yet again.
|
|
@@ -3163,6 +3168,7 @@ class GitRemoteHTTP {
|
|
|
3163
3168
|
url: `${url}/${service}`,
|
|
3164
3169
|
body,
|
|
3165
3170
|
headers,
|
|
3171
|
+
signal,
|
|
3166
3172
|
});
|
|
3167
3173
|
if (res.statusCode !== 200) {
|
|
3168
3174
|
const { response } = stringifyBody(res);
|