@gitkraken/core-gitlens 0.8.0 → 0.9.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/CHANGELOG.md +43 -1
- package/dist/git/cache.d.ts +11 -0
- package/dist/git/cache.js +26 -3
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +3 -2
- package/dist/git/context.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.js +1 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/models/reflog.d.ts +6 -0
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/revision.d.ts +0 -1
- package/dist/git/models/revision.js +1 -2
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/providers/commits.d.ts +20 -1
- package/dist/git/providers/operations.d.ts +13 -0
- package/dist/git/providers/provider.d.ts +14 -4
- package/dist/git/providers/refs.d.ts +10 -0
- package/dist/git/providers/revision.d.ts +2 -0
- package/dist/git/providers/staging.d.ts +2 -1
- package/dist/git/providers/stash.d.ts +3 -2
- package/dist/git/providers/status.d.ts +4 -0
- package/dist/git/run.types.d.ts +16 -0
- package/dist/git-cli/cliGitProvider.d.ts +24 -3
- package/dist/git-cli/cliGitProvider.js +79 -17
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +31 -0
- package/dist/git-cli/exec/commandClassifier.js +391 -0
- package/dist/git-cli/exec/commandClassifier.js.map +1 -0
- package/dist/git-cli/exec/git.d.ts +24 -3
- package/dist/git-cli/exec/git.js +116 -12
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts +7 -0
- package/dist/git-cli/parsers/reflogParser.js +11 -1
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/providers/branches.js +16 -14
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +4 -2
- package/dist/git-cli/providers/commits.js +55 -4
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/diff.js +4 -4
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +12 -0
- package/dist/git-cli/providers/operations.js +26 -3
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.js +2 -5
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +5 -0
- package/dist/git-cli/providers/refs.js +26 -1
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.js +3 -2
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +2 -0
- package/dist/git-cli/providers/revision.js +11 -0
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +2 -1
- package/dist/git-cli/providers/staging.js +12 -7
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +3 -2
- package/dist/git-cli/providers/stash.js +34 -22
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +2 -0
- package/dist/git-cli/providers/status.js +27 -9
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +13 -0
- package/dist/plus/git-github/api/github.js +36 -6
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts +4 -2
- package/dist/plus/git-github/providers/github/commits.js +3 -1
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts +1 -0
- package/dist/plus/git-github/providers/github/revision.js +5 -0
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +6 -0
- package/dist/plus/integrations/collectionMetadata.js +7 -4
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +13 -0
- package/dist/plus/integrations/models/gitHostIntegration.js +19 -0
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +16 -1
- package/dist/plus/integrations/providers/github.js +39 -1
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/reads/resolveRepository.js +26 -5
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
- package/docs/integrations.md +22 -5
- package/docs/kepler-git-write-api-parity.md +140 -14
- package/package.json +1 -1
|
@@ -341,6 +341,7 @@ var GitHubApi = class {
|
|
|
341
341
|
}
|
|
342
342
|
async getCurrentAccount(provider, token, options) {
|
|
343
343
|
const scope = getScopedLogger();
|
|
344
|
+
const { silent, ...variables } = options ?? {};
|
|
344
345
|
try {
|
|
345
346
|
const rsp = await this.graphql(provider, token, `query getCurrentAccount($avatarSize: Int) {
|
|
346
347
|
viewer {
|
|
@@ -350,7 +351,7 @@ var GitHubApi = class {
|
|
|
350
351
|
login
|
|
351
352
|
avatarUrl(size: $avatarSize)
|
|
352
353
|
}
|
|
353
|
-
}`,
|
|
354
|
+
}`, variables, scope);
|
|
354
355
|
if (rsp?.viewer?.login == null) return void 0;
|
|
355
356
|
return {
|
|
356
357
|
provider,
|
|
@@ -362,7 +363,7 @@ var GitHubApi = class {
|
|
|
362
363
|
};
|
|
363
364
|
} catch (ex) {
|
|
364
365
|
if (ex instanceof RequestNotFoundError) return void 0;
|
|
365
|
-
throw this.handleException(ex, provider, scope);
|
|
366
|
+
throw this.handleException(ex, provider, scope, silent);
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
369
|
async getAccountForCommit(provider, token, owner, repo, rev, options) {
|
|
@@ -1354,6 +1355,29 @@ var GitHubApi = class {
|
|
|
1354
1355
|
throw this.handleException(ex, void 0, scope);
|
|
1355
1356
|
}
|
|
1356
1357
|
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Whether this credential can read the repository, asked of REST rather than GraphQL. GraphQL answers a
|
|
1360
|
+
* repository hidden by its organization's OAuth App access restrictions exactly as it answers one that does not
|
|
1361
|
+
* exist (`NOT_FOUND`), while REST answers `403` and says why, so this is how a GraphQL miss is told apart from
|
|
1362
|
+
* one. Resolves `false` on a `404`; a refusal throws `AuthenticationError` carrying GitHub's response.
|
|
1363
|
+
*
|
|
1364
|
+
* Silent: the refusal it exists to surface is one organization's policy, which reauthenticating cannot fix, so it
|
|
1365
|
+
* must not raise the reauthentication prompt a failed read otherwise raises.
|
|
1366
|
+
*/
|
|
1367
|
+
async getRepositoryAccess(provider, token, owner, repo, options) {
|
|
1368
|
+
const scope = getScopedLogger();
|
|
1369
|
+
try {
|
|
1370
|
+
await this.request(provider, token, "GET /repos/{owner}/{repo}", {
|
|
1371
|
+
owner,
|
|
1372
|
+
repo,
|
|
1373
|
+
...options
|
|
1374
|
+
}, scope, void 0, true);
|
|
1375
|
+
return true;
|
|
1376
|
+
} catch (ex) {
|
|
1377
|
+
if (ex instanceof RequestNotFoundError) return false;
|
|
1378
|
+
throw this.handleException(ex, provider, scope, true);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1357
1381
|
async getContributors(token, owner, repo) {
|
|
1358
1382
|
const scope = getScopedLogger();
|
|
1359
1383
|
try {
|
|
@@ -1806,8 +1830,8 @@ var GitHubApi = class {
|
|
|
1806
1830
|
promise.then(cleanup, cleanup);
|
|
1807
1831
|
return promise;
|
|
1808
1832
|
}
|
|
1809
|
-
async request(provider, token, route, options, scope, cancellation) {
|
|
1810
|
-
return await this.requestCore(provider, token, route, options, scope, cancellation);
|
|
1833
|
+
async request(provider, token, route, options, scope, cancellation, deferFailure) {
|
|
1834
|
+
return await this.requestCore(provider, token, route, options, scope, cancellation, deferFailure);
|
|
1811
1835
|
}
|
|
1812
1836
|
/**
|
|
1813
1837
|
* REST call for routes `@octokit/types` doesn't describe yet — currently the stacked-pull-request
|
|
@@ -1817,7 +1841,7 @@ var GitHubApi = class {
|
|
|
1817
1841
|
async requestPreview(provider, token, route, options, scope, cancellation) {
|
|
1818
1842
|
return await this.requestCore(provider, token, route, options, scope, cancellation);
|
|
1819
1843
|
}
|
|
1820
|
-
async requestCore(provider, token, route, options, scope, cancellation) {
|
|
1844
|
+
async requestCore(provider, token, route, options, scope, cancellation, deferFailure) {
|
|
1821
1845
|
const { accessToken } = token;
|
|
1822
1846
|
try {
|
|
1823
1847
|
let signal;
|
|
@@ -1836,7 +1860,7 @@ var GitHubApi = class {
|
|
|
1836
1860
|
const retryable = method === "GET" || method === "HEAD";
|
|
1837
1861
|
return await this.requestWithRetries(() => this.config.wrapForForcedInsecureSSL(provider?.getIgnoreSSLErrors() ?? false, () => this.getDefaults(accessToken, request)(route, options)), retryable, signal, scope);
|
|
1838
1862
|
} catch (ex) {
|
|
1839
|
-
if (ex instanceof RequestError || ex.name === "AbortError") this.handleRequestError(provider, token, ex, scope,
|
|
1863
|
+
if (ex instanceof RequestError || ex.name === "AbortError") this.handleRequestError(provider, token, ex, scope, deferFailure);
|
|
1840
1864
|
else if (_logger.isDebugging) this.config.onDebugError?.(`GitHub request failed: ${ex.message}`);
|
|
1841
1865
|
throw ex;
|
|
1842
1866
|
}
|
|
@@ -3138,6 +3162,12 @@ __decorate([trace({ args: (token, owner, repo, ref, path, sha) => ({
|
|
|
3138
3162
|
path,
|
|
3139
3163
|
sha
|
|
3140
3164
|
}) })], GitHubApi.prototype, "getNextCommitRefs", null);
|
|
3165
|
+
__decorate([trace({ args: (provider, token, owner, repo) => ({
|
|
3166
|
+
provider: provider?.name,
|
|
3167
|
+
token: `<token:${token.microHash}>`,
|
|
3168
|
+
owner,
|
|
3169
|
+
repo
|
|
3170
|
+
}) })], GitHubApi.prototype, "getRepositoryAccess", null);
|
|
3141
3171
|
__decorate([trace({ args: (token, owner, repo) => ({
|
|
3142
3172
|
token: `<token:${token.microHash}>`,
|
|
3143
3173
|
owner,
|