@ankhorage/repository 0.9.0 → 0.10.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/dist/github/index.d.ts +4 -1
  4. package/dist/github/index.d.ts.map +1 -1
  5. package/dist/github/index.js +1 -0
  6. package/dist/github/index.js.map +1 -1
  7. package/dist/github/index.test.js +2 -1
  8. package/dist/github/index.test.js.map +1 -1
  9. package/dist/providers/github/adapters/createGitHubHttpRepositoryAuthenticatedUserInventory.test.d.ts +2 -0
  10. package/dist/providers/github/adapters/createGitHubHttpRepositoryAuthenticatedUserInventory.test.d.ts.map +1 -0
  11. package/dist/providers/github/adapters/createGitHubHttpRepositoryAuthenticatedUserInventory.test.js +112 -0
  12. package/dist/providers/github/adapters/createGitHubHttpRepositoryAuthenticatedUserInventory.test.js.map +1 -0
  13. package/dist/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.d.ts +2 -2
  14. package/dist/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.d.ts.map +1 -1
  15. package/dist/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.js +60 -6
  16. package/dist/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.js.map +1 -1
  17. package/dist/providers/github/adapters/createGitHubHttpRepositoryReadGateway.d.ts +2 -2
  18. package/dist/providers/github/adapters/createGitHubHttpRepositoryReadGateway.d.ts.map +1 -1
  19. package/dist/providers/github/adapters/createGitHubHttpRepositoryReadGateway.js.map +1 -1
  20. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.d.ts +8 -0
  21. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.d.ts.map +1 -0
  22. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.js +2 -0
  23. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.js.map +1 -0
  24. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryResult.d.ts +6 -0
  25. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryResult.d.ts.map +1 -0
  26. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryResult.js +2 -0
  27. package/dist/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryResult.js.map +1 -0
  28. package/dist/providers/github/definitions/GitHubRepositoryDiscoveryOptions.d.ts +5 -3
  29. package/dist/providers/github/definitions/GitHubRepositoryDiscoveryOptions.d.ts.map +1 -1
  30. package/dist/providers/github/definitions/GitHubRepositoryDiscoveryResult.d.ts +2 -1
  31. package/dist/providers/github/definitions/GitHubRepositoryDiscoveryResult.d.ts.map +1 -1
  32. package/dist/providers/github/definitions/GitHubRepositoryVisibility.d.ts +1 -1
  33. package/dist/providers/github/definitions/GitHubRepositoryVisibility.d.ts.map +1 -1
  34. package/dist/providers/github/ports/GitHubRepositoryDiscoveryGateway.d.ts +5 -1
  35. package/dist/providers/github/ports/GitHubRepositoryDiscoveryGateway.d.ts.map +1 -1
  36. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.d.ts +12 -0
  37. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.d.ts.map +1 -0
  38. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.js +33 -0
  39. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.js.map +1 -0
  40. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.test.d.ts +2 -0
  41. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.test.d.ts.map +1 -0
  42. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.test.js +75 -0
  43. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.test.js.map +1 -0
  44. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.d.ts +6 -0
  45. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.d.ts.map +1 -0
  46. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.js +5 -0
  47. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.js.map +1 -0
  48. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.d.ts +2 -0
  49. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.d.ts.map +1 -0
  50. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.js +57 -0
  51. package/dist/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.js.map +1 -0
  52. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ankhorage/repository
2
2
 
3
+ ## 0.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 92349d2: Update dependencies: `@ankhorage/contracts`.
8
+
9
+ ## 0.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 21bd669: Add the authenticated GitHub user repository inventory API with bounded pagination, multi-owner visibility, and request-scoped credentials.
14
+
15
+ ### Patch Changes
16
+
17
+ - 0056529: Validate the authenticated GitHub inventory's fail-closed credential test as security evidence during release documentation generation.
18
+
3
19
  ## 0.9.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/repository
5
5
 
6
- ![license: MIT](./paradox/badges/license.svg) ![npm: v0.9.0](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![paradox: warnings](./paradox/badges/docs.svg)
6
+ ![license: MIT](./paradox/badges/license.svg) ![npm: v0.10.1](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![paradox: warnings](./paradox/badges/docs.svg)
7
7
 
8
8
  Standalone repository capability for connecting and managing an app project's source repository.
9
9
 
@@ -1,6 +1,8 @@
1
+ export type { GitHubAuthenticatedUserRepositoryInventoryOptions } from '../providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.js';
2
+ export type { GitHubAuthenticatedUserRepositoryInventoryResult } from '../providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryResult.js';
1
3
  export type { GitHubRepositoryConnectionOptions } from '../providers/github/definitions/GitHubRepositoryConnectionOptions.js';
2
4
  export type { GitHubRepositoryConnectionFailure, GitHubRepositoryConnectionResult, GitHubRepositoryConnectionStatus, } from '../providers/github/definitions/GitHubRepositoryConnectionResult.js';
3
- export type { GitHubRepositoryAuthentication, GitHubRepositoryDiscoveryOptions, } from '../providers/github/definitions/GitHubRepositoryDiscoveryOptions.js';
5
+ export type { GitHubRepositoryAuthentication, GitHubRepositoryDiscoveryOptions, GitHubRepositoryUserAuthentication, } from '../providers/github/definitions/GitHubRepositoryDiscoveryOptions.js';
4
6
  export { type GitHubOwnerType, GitHubRepositoryDiscoveryError, type GitHubRepositoryDiscoveryErrorCode, type GitHubRepositoryDiscoveryRepository, type GitHubRepositoryDiscoveryResult, } from '../providers/github/definitions/GitHubRepositoryDiscoveryResult.js';
5
7
  export type { GitHubRepositoryMaterializationOptions } from '../providers/github/definitions/GitHubRepositoryMaterializationOptions.js';
6
8
  export type { GitHubRepositoryMaterializationDiagnostic, GitHubRepositoryMaterializationResult, } from '../providers/github/definitions/GitHubRepositoryMaterializationResult.js';
@@ -8,6 +10,7 @@ export type { GitHubRepositoryRevisionResolutionOptions } from '../providers/git
8
10
  export type { GitHubRepositoryRevisionResolutionResult } from '../providers/github/definitions/GitHubRepositoryRevisionResolutionResult.js';
9
11
  export type { GitHubRepositoryVisibility } from '../providers/github/definitions/GitHubRepositoryVisibility.js';
10
12
  export { connectGitHubRepositoryAsync } from '../providers/github/services/connectGitHubRepositoryAsync.js';
13
+ export { discoverGitHubAuthenticatedUserRepositoriesAsync } from '../providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.js';
11
14
  export { discoverGitHubRepositoriesAsync } from '../providers/github/services/discoverGitHubRepositoriesAsync.js';
12
15
  export { materializeGitHubRepositoryAsync } from '../providers/github/services/materializeGitHubRepositoryAsync.js';
13
16
  export { resolveGitHubRepositoryRevisionAsync } from '../providers/github/services/resolveGitHubRepositoryRevisionAsync.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/github/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iCAAiC,EAAE,MAAM,sEAAsE,CAAC;AAC9H,YAAY,EACV,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,qEAAqE,CAAC;AAC7E,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EACL,KAAK,eAAe,EACpB,8BAA8B,EAC9B,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,GACrC,MAAM,oEAAoE,CAAC;AAC5E,YAAY,EAAE,sCAAsC,EAAE,MAAM,2EAA2E,CAAC;AACxI,YAAY,EACV,yCAAyC,EACzC,qCAAqC,GACtC,MAAM,0EAA0E,CAAC;AAClF,YAAY,EAAE,yCAAyC,EAAE,MAAM,8EAA8E,CAAC;AAC9I,YAAY,EAAE,wCAAwC,EAAE,MAAM,6EAA6E,CAAC;AAC5I,YAAY,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAChH,OAAO,E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OAAO,EAAE,oCAAoC,EAAE,MAAM,sEAAsE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export { GitHubRepositoryDiscoveryError, } from '../providers/github/definitions/GitHubRepositoryDiscoveryResult.js';
2
2
  export { connectGitHubRepositoryAsync } from '../providers/github/services/connectGitHubRepositoryAsync.js';
3
+ export { discoverGitHubAuthenticatedUserRepositoriesAsync } from '../providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.js';
3
4
  export { discoverGitHubRepositoriesAsync } from '../providers/github/services/discoverGitHubRepositoriesAsync.js';
4
5
  export { materializeGitHubRepositoryAsync } from '../providers/github/services/materializeGitHubRepositoryAsync.js';
5
6
  export { resolveGitHubRepositoryRevisionAsync } from '../providers/github/services/resolveGitHubRepositoryRevisionAsync.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/github/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,8BAA8B,GAI/B,MAAM,oEAAoE,CAAC;AAS5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,8DAA8D,CAAC;AAC5G,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,EAAE,gCAAgC,EAAE,MAAM,kEAAkE,CAAC;AACpH,OAAO,EAAE,oCAAoC,EAAE,MAAM,sEAAsE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/github/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,8BAA8B,GAI/B,MAAM,oEAAoE,CAAC;AAS5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,8DAA8D,CAAC;AAC5G,OAAO,EAAE,gDAAgD,EAAE,MAAM,kFAAkF,CAAC;AACpJ,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,EAAE,gCAAgC,EAAE,MAAM,kEAAkE,CAAC;AACpH,OAAO,EAAE,oCAAoC,EAAE,MAAM,sEAAsE,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { expect, test } from 'bun:test';
2
2
  import * as github from './index.js';
3
- test('exports public GitHub revision resolution', () => {
3
+ test('exports public GitHub operations', () => {
4
4
  expect(github.resolveGitHubRepositoryRevisionAsync).toBeFunction();
5
5
  expect(github.materializeGitHubRepositoryAsync).toBeFunction();
6
6
  expect(github.discoverGitHubRepositoriesAsync).toBeFunction();
7
+ expect(github.discoverGitHubAuthenticatedUserRepositoriesAsync).toBeFunction();
7
8
  });
8
9
  //# sourceMappingURL=index.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/github/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACrD,MAAM,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,YAAY,EAAE,CAAC;IACnE,MAAM,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,YAAY,EAAE,CAAC;IAC/D,MAAM,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,YAAY,EAAE,CAAC;AAChE,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/github/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC5C,MAAM,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,YAAY,EAAE,CAAC;IACnE,MAAM,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,YAAY,EAAE,CAAC;IAC/D,MAAM,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,YAAY,EAAE,CAAC;IAC9D,MAAM,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAC,YAAY,EAAE,CAAC;AACjF,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createGitHubHttpRepositoryAuthenticatedUserInventory.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGitHubHttpRepositoryAuthenticatedUserInventory.test.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryAuthenticatedUserInventory.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,112 @@
1
+ import { expect, test } from 'bun:test';
2
+ import { createGitHubHttpRepositoryReadGateway } from './createGitHubHttpRepositoryReadGateway.js';
3
+ test('lists the authenticated user inventory across pages with stable ID deduplication and ordering', async () => {
4
+ const requests = [];
5
+ const gateway = createGitHubHttpRepositoryReadGateway(createInventoryFetch(requests), {
6
+ authentication: { kind: 'user', accessToken: 'user-token' },
7
+ });
8
+ expect(await gateway.listAuthenticatedUserRepositoriesAsync()).toEqual(expectedRepositories());
9
+ expect(requests.map((request) => request.authorization)).toEqual([
10
+ 'Bearer user-token',
11
+ 'Bearer user-token',
12
+ ]);
13
+ expect(requests[0]?.url).toBe('https://api.github.com/user/repos?visibility=all&affiliation=owner,collaborator,organization_member&per_page=100');
14
+ });
15
+ test('keeps interleaved authenticated inventories isolated from environment and each other', async () => {
16
+ const originalToken = process.env.GITHUB_TOKEN;
17
+ process.env.GITHUB_TOKEN = 'environment-token-must-not-leak';
18
+ const authorizations = [];
19
+ try {
20
+ await Promise.all([
21
+ createEmptyInventoryGateway('user-a-token', authorizations).listAuthenticatedUserRepositoriesAsync(),
22
+ createEmptyInventoryGateway('user-b-token', authorizations).listAuthenticatedUserRepositoriesAsync(),
23
+ createEmptyInventoryGateway(undefined, authorizations).listAuthenticatedUserRepositoriesAsync(),
24
+ ]);
25
+ expect(authorizations).toEqual(['Bearer user-a-token', 'Bearer user-b-token', 'missing']);
26
+ }
27
+ finally {
28
+ if (originalToken === undefined)
29
+ delete process.env.GITHUB_TOKEN;
30
+ else
31
+ process.env.GITHUB_TOKEN = originalToken;
32
+ }
33
+ });
34
+ test.each([
35
+ 'https://api.github.com/user/repos?visibility=private&affiliation=owner%2Ccollaborator%2Corganization_member&per_page=100&page=2',
36
+ 'https://api.github.com/user/repos?visibility=all&per_page=100&page=2',
37
+ 'https://api.github.com/user/repos?visibility=all&affiliation=owner%2Ccollaborator%2Corganization_member&per_page=100&page=1',
38
+ ])('rejects an incomplete or non-forward authenticated inventory pagination link', async (next) => {
39
+ const gateway = createGitHubHttpRepositoryReadGateway(((_input, _init) => Promise.resolve(Response.json([], {
40
+ headers: { link: `<${next}>; rel="next"` },
41
+ }))), { authentication: { kind: 'user', accessToken: 'user-token' } });
42
+ try {
43
+ await gateway.listAuthenticatedUserRepositoriesAsync();
44
+ throw new Error('Expected invalid pagination to fail.');
45
+ }
46
+ catch (error) {
47
+ expect(error).toMatchObject({ code: 'api-failure' });
48
+ }
49
+ });
50
+ /** Create a request-capturing paginated inventory HTTP adapter fixture. */
51
+ function createInventoryFetch(requests) {
52
+ return ((input, init) => {
53
+ const url = requestUrl(input);
54
+ requests.push({ authorization: new Headers(init?.headers).get('authorization'), url });
55
+ return Promise.resolve(url.includes('page=2') ? secondInventoryPage() : firstInventoryPage());
56
+ });
57
+ }
58
+ /** Create an inventory gateway whose empty response records only its effective authorization header. */
59
+ function createEmptyInventoryGateway(accessToken, authorizations) {
60
+ return createGitHubHttpRepositoryReadGateway(((_input, init) => {
61
+ authorizations.push(new Headers(init?.headers).get('authorization') ?? 'missing');
62
+ return Promise.resolve(Response.json([]));
63
+ }), {
64
+ authentication: accessToken ? { kind: 'user', accessToken } : 'anonymous',
65
+ });
66
+ }
67
+ /** Return the first page including the authenticated-user pagination link. */
68
+ function firstInventoryPage() {
69
+ return Response.json([
70
+ repositoryResponse(1, 'owned', 'an-owner', 'private'),
71
+ repositoryResponse(2, 'old-name', 'a-collaborator', 'public'),
72
+ ], {
73
+ headers: {
74
+ link: '<https://api.github.com/user/repos?visibility=all&affiliation=owner%2Ccollaborator%2Corganization_member&per_page=100&page=2>; rel="next"',
75
+ },
76
+ });
77
+ }
78
+ /** Return the page whose duplicate ID supersedes the first page's stale representation. */
79
+ function secondInventoryPage() {
80
+ return Response.json([
81
+ repositoryResponse(3, 'team', 'an-organization', 'internal'),
82
+ repositoryResponse(2, 'collaboration', 'a-collaborator', 'public'),
83
+ ]);
84
+ }
85
+ /** Return the expected canonical owner/name order after stable ID deduplication. */
86
+ function expectedRepositories() {
87
+ return [
88
+ discoveredRepository('2', 'collaboration', 'a-collaborator', 'public'),
89
+ discoveredRepository('3', 'team', 'an-organization', 'internal'),
90
+ discoveredRepository('1', 'owned', 'an-owner', 'private'),
91
+ ];
92
+ }
93
+ /** Create a GitHub REST repository record. */
94
+ function repositoryResponse(id, name, owner, visibility) {
95
+ return {
96
+ id,
97
+ name,
98
+ owner: { login: owner },
99
+ html_url: `https://github.com/${owner}/${name}`,
100
+ private: visibility === 'private',
101
+ visibility,
102
+ };
103
+ }
104
+ /** Create the public inventory model expected from a REST record. */
105
+ function discoveredRepository(id, name, owner, visibility) {
106
+ return { id, name, owner, url: `https://github.com/${owner}/${name}`, visibility };
107
+ }
108
+ /** Extract the URL without modifying the fetch request under test. */
109
+ function requestUrl(input) {
110
+ return typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
111
+ }
112
+ //# sourceMappingURL=createGitHubHttpRepositoryAuthenticatedUserInventory.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGitHubHttpRepositoryAuthenticatedUserInventory.test.js","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryAuthenticatedUserInventory.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAOnG,IAAI,CAAC,+FAA+F,EAAE,KAAK,IAA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ACpF,SAAS,oBAAoB;IAC3B,OAAO;QACL,oBAAoB,CAAC,GAAG,EAAE,eAAe,EAAE,gBAAgB,EAAE,QAAQ,CAAC;QACtE,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,CAAC;QAChE,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;KAC1D,CAAC;AACJ,CAAC;AAED,8CAA8C;AAC9C,SAAS,kBAAkB,CACzB,EAAU,EACV,IAAY,EACZ,KAAa,EACb,UAA6C;IAE7C,OAAO;QACL,EAAE;QACF,IAAI;QACJ,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QACvB,QAAQ,EAAE,sBAAsB,KAAK,IAAI,IAAI,EAAE;QAC/C,OAAO,EAAE,UAAU,KAAK,SAAS;QACjC,UAAU;KACX,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,SAAS,oBAAoB,CAC3B,EAAU,EACV,IAAY,EACZ,KAAa,EACb,UAA6C;IAE7C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,sBAAsB,KAAK,IAAI,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC;AACrF,CAAC;AAED,sEAAsE;AACtE,SAAS,UAAU,CAAC,KAA6B;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;AAC3F,CAAC"}
@@ -1,9 +1,9 @@
1
- import type { GitHubRepositoryDiscoveryGateway } from '../ports/GitHubRepositoryDiscoveryGateway.js';
1
+ import type { GitHubAuthenticatedUserRepositoryInventoryGateway, GitHubRepositoryDiscoveryGateway } from '../ports/GitHubRepositoryDiscoveryGateway.js';
2
2
  type RequestJsonResponseAsync = (url: string, subject: string, signal: AbortSignal | undefined) => Promise<{
3
3
  readonly value: unknown;
4
4
  readonly link: string | null;
5
5
  }>;
6
6
  /** Create the discovery adapter from the shared GitHub HTTP requester. */
7
- export declare function createGitHubHttpRepositoryDiscoveryGateway(requestJsonResponseAsync: RequestJsonResponseAsync): GitHubRepositoryDiscoveryGateway;
7
+ export declare function createGitHubHttpRepositoryDiscoveryGateway(requestJsonResponseAsync: RequestJsonResponseAsync): GitHubRepositoryDiscoveryGateway & GitHubAuthenticatedUserRepositoryInventoryGateway;
8
8
  export {};
9
9
  //# sourceMappingURL=createGitHubHttpRepositoryDiscoveryGateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createGitHubHttpRepositoryDiscoveryGateway.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,gCAAgC,EAEjC,MAAM,8CAA8C,CAAC;AAEtD,KAAK,wBAAwB,GAAG,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,GAAG,SAAS,KAC5B,OAAO,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC;AAIxE,0EAA0E;AAC1E,wBAAgB,0CAA0C,CACxD,wBAAwB,EAAE,wBAAwB,GACjD,gCAAgC,CAOlC"}
1
+ {"version":3,"file":"createGitHubHttpRepositoryDiscoveryGateway.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iDAAiD,EAEjD,gCAAgC,EAEjC,MAAM,8CAA8C,CAAC;AAEtD,KAAK,wBAAwB,GAAG,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,GAAG,SAAS,KAC5B,OAAO,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC;AAUxE,0EAA0E;AAC1E,wBAAgB,0CAA0C,CACxD,wBAAwB,EAAE,wBAAwB,GACjD,gCAAgC,GAAG,iDAAiD,CAStF"}
@@ -1,10 +1,17 @@
1
1
  import { GitHubRepositoryDiscoveryError } from '../definitions/GitHubRepositoryDiscoveryResult.js';
2
2
  const API_ORIGIN = 'https://api.github.com';
3
+ const MAX_REPOSITORY_PAGES = 1_000;
4
+ const AUTHENTICATED_INVENTORY_FILTERS = {
5
+ affiliation: 'owner,collaborator,organization_member',
6
+ per_page: '100',
7
+ visibility: 'all',
8
+ };
3
9
  /** Create the discovery adapter from the shared GitHub HTTP requester. */
4
10
  export function createGitHubHttpRepositoryDiscoveryGateway(requestJsonResponseAsync) {
5
11
  return {
6
12
  resolveOwnerAsync: (owner, signal) => resolveOwnerAsync(requestJsonResponseAsync, owner, signal),
7
13
  listOwnerRepositoriesAsync: (owner, signal) => listOwnerRepositoriesAsync(requestJsonResponseAsync, owner, signal),
14
+ listAuthenticatedUserRepositoriesAsync: (signal) => listAuthenticatedUserRepositoriesAsync(requestJsonResponseAsync, signal),
8
15
  };
9
16
  }
10
17
  /** Resolve a login through GitHub rather than inferring whether it names a user or organization. */
@@ -24,9 +31,23 @@ async function resolveOwnerAsync(requestJsonResponseAsync, owner, signal) {
24
31
  /** Read every page of repositories visible through GitHub's owner listing endpoints. */
25
32
  async function listOwnerRepositoriesAsync(requestJsonResponseAsync, owner, signal) {
26
33
  const route = owner.type === 'organization' ? 'orgs' : 'users';
27
- let nextUrl = `${API_ORIGIN}/${route}/${encodeURIComponent(owner.login)}/repos?per_page=100&type=all&sort=full_name&direction=asc`;
34
+ return listRepositoriesAsync(requestJsonResponseAsync, `${API_ORIGIN}/${route}/${encodeURIComponent(owner.login)}/repos?per_page=100&type=all&sort=full_name&direction=asc`, { path: `/${route}/${encodeURIComponent(owner.login)}/repos` }, signal);
35
+ }
36
+ /** Read every accessible repository page for the current authenticated GitHub user. */
37
+ async function listAuthenticatedUserRepositoriesAsync(requestJsonResponseAsync, signal) {
38
+ return listRepositoriesAsync(requestJsonResponseAsync, `${API_ORIGIN}/user/repos?visibility=all&affiliation=owner,collaborator,organization_member&per_page=100`, { path: '/user/repos', filters: AUTHENTICATED_INVENTORY_FILTERS }, signal);
39
+ }
40
+ /** Read, validate, deduplicate, and deterministically order one bounded GitHub repository listing. */
41
+ async function listRepositoriesAsync(requestJsonResponseAsync, initialUrl, pagination, signal) {
42
+ let nextUrl = initialUrl;
43
+ let previousPage = 1;
28
44
  const repositories = new Map();
29
- while (nextUrl !== undefined) {
45
+ const visitedUrls = new Set();
46
+ while (nextUrl !== undefined && visitedUrls.size < MAX_REPOSITORY_PAGES) {
47
+ if (visitedUrls.has(nextUrl)) {
48
+ throw new GitHubRepositoryDiscoveryError('api-failure', 'GitHub returned a repeated repository pagination URL.');
49
+ }
50
+ visitedUrls.add(nextUrl);
30
51
  const page = await requestJsonResponseAsync(nextUrl, 'repository list', signal);
31
52
  if (!Array.isArray(page.value)) {
32
53
  throw new GitHubRepositoryDiscoveryError('api-failure', 'GitHub returned an invalid repository list.');
@@ -35,7 +56,12 @@ async function listOwnerRepositoriesAsync(requestJsonResponseAsync, owner, signa
35
56
  const repository = parseDiscoveredRepository(value);
36
57
  repositories.set(repository.id, repository);
37
58
  }
38
- nextUrl = nextPageUrl(page.link);
59
+ nextUrl = nextPageUrl(page.link, pagination, previousPage);
60
+ if (nextUrl !== undefined)
61
+ previousPage = pageNumber(new URL(nextUrl));
62
+ }
63
+ if (nextUrl !== undefined) {
64
+ throw new GitHubRepositoryDiscoveryError('api-failure', 'GitHub repository pagination exceeded the supported limit.');
39
65
  }
40
66
  return [...repositories.values()].sort(compareRepositories);
41
67
  }
@@ -52,22 +78,50 @@ function parseDiscoveredRepository(value) {
52
78
  name: requireString(record.name, 'repository name'),
53
79
  owner: requireString(owner.login, 'repository owner login'),
54
80
  url: requireString(record.html_url, 'repository URL'),
55
- visibility: record.private === true ? 'private' : 'public',
81
+ visibility: parseRepositoryVisibility(record),
56
82
  };
57
83
  }
58
84
  /** Select the next GitHub pagination target while rejecting an unexpected cross-origin link. */
59
- function nextPageUrl(link) {
85
+ function nextPageUrl(link, pagination, previousPage) {
60
86
  if (!link)
61
87
  return undefined;
62
88
  const match = /<([^>]+)>;\s*rel="next"/u.exec(link);
63
89
  if (!match?.[1])
64
90
  return undefined;
65
91
  const url = new URL(match[1]);
66
- if (url.origin !== API_ORIGIN) {
92
+ if (url.origin !== API_ORIGIN ||
93
+ url.pathname !== pagination.path ||
94
+ !hasExpectedPaginationFilters(url, pagination.filters) ||
95
+ pageNumber(url) <= previousPage) {
67
96
  throw new GitHubRepositoryDiscoveryError('api-failure', 'GitHub returned an invalid pagination URL.');
68
97
  }
69
98
  return url.href;
70
99
  }
100
+ /*** Validate all invariant inventory filters before following a provider-controlled next URL. */
101
+ function hasExpectedPaginationFilters(url, filters) {
102
+ if (filters === undefined)
103
+ return pageNumber(url) > 0;
104
+ const expectedKeys = new Set([...Object.keys(filters), 'page']);
105
+ return ([...url.searchParams.keys()].every((key) => expectedKeys.has(key)) &&
106
+ Object.entries(filters).every(([key, value]) => url.searchParams.getAll(key).length === 1 && url.searchParams.get(key) === value) &&
107
+ url.searchParams.getAll('page').length === 1 &&
108
+ pageNumber(url) > 0);
109
+ }
110
+ /*** Read a positive, unambiguous page number from a provider pagination URL. */
111
+ function pageNumber(url) {
112
+ const page = url.searchParams.get('page');
113
+ return page !== null && /^[1-9]\d*$/u.test(page) ? Number(page) : 0;
114
+ }
115
+ /** Map GitHub's documented repository visibility fields without misclassifying internal repositories. */
116
+ function parseRepositoryVisibility(repository) {
117
+ if (repository.visibility === 'internal')
118
+ return 'internal';
119
+ if (repository.private === true)
120
+ return 'private';
121
+ if (repository.private === false)
122
+ return 'public';
123
+ throw new GitHubRepositoryDiscoveryError('api-failure', 'GitHub returned an invalid repository visibility.');
124
+ }
71
125
  /** Sort repository identities independently of the provider's page ordering. */
72
126
  function compareRepositories(left, right) {
73
127
  const leftIdentity = `${left.owner.toLowerCase()}/${left.name.toLowerCase()}`;
@@ -1 +1 @@
1
- {"version":3,"file":"createGitHubHttpRepositoryDiscoveryGateway.js","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AAanG,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAE5C,0EAA0E;AAC1E,MAAM,UAAU,0CAA0C,CACxD,wBAAkD;IAElD,OAAO;QACL,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CACnC,iBAAiB,CAAC,wBAAwB,EAAE,KAAK,EAAE,MAAM,CAAC;QAC5D,0BAA0B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAC5C,0BAA0B,CAAC,wBAAwB,EAAE,KAAK,EAAE,MAAM,CAAC;KACtE,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,KAAK,UAAU,iBAAiB,CAC9B,wBAAkD,EAClD,KAAa,EACb,MAA+B;IAE/B,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,wBAAwB,CAC9C,GAAG,UAAU,UAAU,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAClD,OAAO,EACP,MAAM,CACP,CAAC;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACtD,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;QAC/C,MAAM,IAAI,8BAA8B,CACtC,aAAa,EACb,4CAA4C,CAC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
1
+ {"version":3,"file":"createGitHubHttpRepositoryDiscoveryGateway.js","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryDiscoveryGateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AAcnG,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,MAAM,oBAAoB,GAAG,KAAK,CAAC;AACnC,MAAM,+BAA+B,GAAG;IACtC,WAAW,EAAE,wCAAwC;IACrD,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;CACT,CAAC;AAEX,0EAA0E;AAC1E,MAAM,UAAU,0CAA0C,CACxD,wBAAkD;IAElD,OAAO;QACL,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CACnC,iBAAiB,CAAC,wBAAwB,EAAE,KAAK,EAAE,MAAM,CAAC;QAC5D,0BAA0B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAC5C,0BAA0B,CAAC,wBAAwB,EAAE,KAAK,EAAE,MAAM,CAAC;QACrE,sCAAsC,EAAE,CAAC,MAAM,EAAE,EAAE,CACjD,sCAAsC,CAAC,wBAAwB,EAAE,MAAM,CAAC;KAC3E,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,KAAK,UAAU,iBAAiB,CAC9B,wBAAkD,EAClD,KAAa,EACb,MAA+B;IAE/B,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,wBAAwB,CAC9C,GAAG,UAAU,UAAU,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAClD,OAAO,EACP,MAAM,CACP,CAAC;IACF,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACtD,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;QAC/C,MA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AAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrD,MAAM,IAAI,8BAA8B,CAAC,aAAa,EAAE,2BAA2B,OAAO,GAAG,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { GitHubRepositoryDiscoveryGateway } from '../ports/GitHubRepositoryDiscoveryGateway.js';
1
+ import type { GitHubAuthenticatedUserRepositoryInventoryGateway, GitHubRepositoryDiscoveryGateway } from '../ports/GitHubRepositoryDiscoveryGateway.js';
2
2
  import type { GitHubRepositoryReadGateway } from '../ports/GitHubRepositoryReadGateway.js';
3
3
  import type { GitHubHttpClientOptions } from './createGitHubHttpClient.js';
4
4
  /*** Create the read-only GitHub gateway used to materialize repository snapshots over HTTPS. */
5
- export declare function createGitHubHttpRepositoryReadGateway(fetcher?: typeof fetch, options?: GitHubHttpClientOptions): GitHubRepositoryReadGateway & GitHubRepositoryDiscoveryGateway;
5
+ export declare function createGitHubHttpRepositoryReadGateway(fetcher?: typeof fetch, options?: GitHubHttpClientOptions): GitHubRepositoryReadGateway & GitHubRepositoryDiscoveryGateway & GitHubAuthenticatedUserRepositoryInventoryGateway;
6
6
  //# sourceMappingURL=createGitHubHttpRepositoryReadGateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createGitHubHttpRepositoryReadGateway.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryReadGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,KAAK,EACV,2BAA2B,EAM5B,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAO3E,gGAAgG;AAChG,wBAAgB,qCAAqC,CACnD,OAAO,GAAE,OAAO,KAAa,EAC7B,OAAO,GAAE,uBAA4B,GACpC,2BAA2B,GAAG,gCAAgC,CAchE"}
1
+ {"version":3,"file":"createGitHubHttpRepositoryReadGateway.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryReadGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iDAAiD,EACjD,gCAAgC,EACjC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACV,2BAA2B,EAM5B,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAO3E,gGAAgG;AAChG,wBAAgB,qCAAqC,CACnD,OAAO,GAAE,OAAO,KAAa,EAC7B,OAAO,GAAE,uBAA4B,GACpC,2BAA2B,GAC5B,gCAAgC,GAChC,iDAAiD,CAclD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createGitHubHttpRepositoryReadGateway.js","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryReadGateway.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,0CAA0C,EAAE,MAAM,iDAAiD,CAAC;AAE7G,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,MAAM,UAAU,GAAG,mCAAmC,CAAC;AAEvD,gGAAgG;AAChG,MAAM,UAAU,qCAAqC,CACnD,UAAwB,KAAK,EAC7B,UAAmC,EAAE;IAErC,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,0CAA0C,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAC3F,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CACtD,CAAC;IACF,OAAO;QACL,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,sBAAsB,CAAC,MAAM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AAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"createGitHubHttpRepositoryReadGateway.js","sourceRoot":"","sources":["../../../../src/providers/github/adapters/createGitHubHttpRepositoryReadGateway.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,0CAA0C,EAAE,MAAM,iDAAiD,CAAC;AAE7G,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,MAAM,UAAU,GAAG,mCAAmC,CAAC;AAEvD,gGAAgG;AAChG,MAAM,UAAU,qCAAqC,CACnD,UAAwB,KAAK,EAC7B,UAAmC,EAAE;IAIrC,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,0CAA0C,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAC3F,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CACtD,CAAC;IACF,OAAO;QACL,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAC1F,oBAAoB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAC5C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC;QACnD,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC;QAC1F,aAAa,EAAE,CAA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AC9D,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,4BAA4B,CAAC;QAC9D,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,EAAE,2BAA2B,CAAC;QAC3D,IAAI;QACJ,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;KACxC,CAAC;AACJ,CAAC;AAED,qDAAqD;AACrD,SAAS,aAAa,CAAC,KAAc,EAAE,OAAe;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrE,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;IACzD,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,kDAAkD;AAClD,SAAS,aAAa,CAAC,KAAc,EAAE,OAAe;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;QAClD,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,2FAA2F;AAC3F,SAAS,kBAAkB,CAAC,KAAc,EAAE,OAAe;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,GAAG,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { GitHubRepositoryUserAuthentication } from './GitHubRepositoryDiscoveryOptions.js';
2
+ /** Options for listing repositories accessible to one authenticated GitHub user. */
3
+ export interface GitHubAuthenticatedUserRepositoryInventoryOptions {
4
+ /** The consuming host supplies this credential for only this inventory request. */
5
+ readonly authentication: GitHubRepositoryUserAuthentication;
6
+ readonly signal?: AbortSignal;
7
+ }
8
+ //# sourceMappingURL=GitHubAuthenticatedUserRepositoryInventoryOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitHubAuthenticatedUserRepositoryInventoryOptions.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAEhG,oFAAoF;AACpF,MAAM,WAAW,iDAAiD;IAChE,mFAAmF;IACnF,QAAQ,CAAC,cAAc,EAAE,kCAAkC,CAAC;IAC5D,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GitHubAuthenticatedUserRepositoryInventoryOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitHubAuthenticatedUserRepositoryInventoryOptions.js","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { GitHubRepositoryDiscoveryRepository } from './GitHubRepositoryDiscoveryResult.js';
2
+ /** The repositories GitHub exposes to one authenticated user under its currently granted access. */
3
+ export interface GitHubAuthenticatedUserRepositoryInventoryResult {
4
+ readonly repositories: readonly GitHubRepositoryDiscoveryRepository[];
5
+ }
6
+ //# sourceMappingURL=GitHubAuthenticatedUserRepositoryInventoryResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitHubAuthenticatedUserRepositoryInventoryResult.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;AAEhG,oGAAoG;AACpG,MAAM,WAAW,gDAAgD;IAC/D,QAAQ,CAAC,YAAY,EAAE,SAAS,mCAAmC,EAAE,CAAC;CACvE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GitHubAuthenticatedUserRepositoryInventoryResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitHubAuthenticatedUserRepositoryInventoryResult.js","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubAuthenticatedUserRepositoryInventoryResult.ts"],"names":[],"mappings":""}
@@ -1,8 +1,10 @@
1
- /** Explicit credential policy for GitHub operations that may be exposed through an application endpoint. */
2
- export type GitHubRepositoryAuthentication = 'anonymous' | 'environment' | {
1
+ /** An explicit, request-scoped GitHub user credential supplied by the consuming host. */
2
+ export interface GitHubRepositoryUserAuthentication {
3
3
  readonly kind: 'user';
4
4
  readonly accessToken: string;
5
- };
5
+ }
6
+ /** Explicit credential policy for GitHub operations that may be exposed through an application endpoint. */
7
+ export type GitHubRepositoryAuthentication = 'anonymous' | 'environment' | GitHubRepositoryUserAuthentication;
6
8
  /** Options for discovering the repositories visible under one GitHub owner source. */
7
9
  export interface GitHubRepositoryDiscoveryOptions {
8
10
  readonly source: string;
@@ -1 +1 @@
1
- {"version":3,"file":"GitHubRepositoryDiscoveryOptions.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubRepositoryDiscoveryOptions.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,MAAM,MAAM,8BAA8B,GACxC,WAAW,GAAG,aAAa,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,sFAAsF;AACtF,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qGAAqG;IACrG,QAAQ,CAAC,cAAc,CAAC,EAAE,8BAA8B,CAAC;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B"}
1
+ {"version":3,"file":"GitHubRepositoryDiscoveryOptions.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubRepositoryDiscoveryOptions.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,4GAA4G;AAC5G,MAAM,MAAM,8BAA8B,GACxC,WAAW,GAAG,aAAa,GAAG,kCAAkC,CAAC;AAEnE,sFAAsF;AACtF,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qGAAqG;IACrG,QAAQ,CAAC,cAAc,CAAC,EAAE,8BAA8B,CAAC;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B"}
@@ -4,7 +4,7 @@ export interface GitHubRepositoryDiscoveryRepository {
4
4
  readonly name: string;
5
5
  readonly owner: string;
6
6
  readonly url: string;
7
- readonly visibility: 'private' | 'public';
7
+ readonly visibility: GitHubRepositoryVisibility;
8
8
  }
9
9
  export interface GitHubRepositoryDiscoveryResult {
10
10
  readonly owner: {
@@ -22,4 +22,5 @@ export declare class GitHubRepositoryDiscoveryError extends Error {
22
22
  readonly retryAfterMilliseconds?: number | undefined;
23
23
  constructor(code: GitHubRepositoryDiscoveryErrorCode, message: string, retryAfterMilliseconds?: number | undefined);
24
24
  }
25
+ import type { GitHubRepositoryVisibility } from './GitHubRepositoryVisibility.js';
25
26
  //# sourceMappingURL=GitHubRepositoryDiscoveryResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GitHubRepositoryDiscoveryResult.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubRepositoryDiscoveryResult.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC3C;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;QAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,QAAQ,CAAC,YAAY,EAAE,SAAS,mCAAmC,EAAE,CAAC;IACtE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,mCAAmC,CAAC;CACnE;AAED,MAAM,MAAM,kCAAkC,GAC1C,aAAa,GACb,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,GACnB,cAAc,GACd,SAAS,CAAC;AAEd,+EAA+E;AAC/E,qBAAa,8BAA+B,SAAQ,KAAK;aAErC,IAAI,EAAE,kCAAkC;aAExC,sBAAsB,CAAC,EAAE,MAAM;gBAF/B,IAAI,EAAE,kCAAkC,EACxD,OAAO,EAAE,MAAM,EACC,sBAAsB,CAAC,EAAE,MAAM,YAAA;CAKlD"}
1
+ {"version":3,"file":"GitHubRepositoryDiscoveryResult.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubRepositoryDiscoveryResult.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,0BAA0B,CAAC;CACjD;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;QAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,QAAQ,CAAC,YAAY,EAAE,SAAS,mCAAmC,EAAE,CAAC;IACtE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,mCAAmC,CAAC;CACnE;AAED,MAAM,MAAM,kCAAkC,GAC1C,aAAa,GACb,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,GACnB,cAAc,GACd,SAAS,CAAC;AAEd,+EAA+E;AAC/E,qBAAa,8BAA+B,SAAQ,KAAK;aAErC,IAAI,EAAE,kCAAkC;aAExC,sBAAsB,CAAC,EAAE,MAAM;gBAF/B,IAAI,EAAE,kCAAkC,EACxD,OAAO,EAAE,MAAM,EACC,sBAAsB,CAAC,EAAE,MAAM,YAAA;CAKlD;AACD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1,2 +1,2 @@
1
- export type GitHubRepositoryVisibility = 'private' | 'public';
1
+ export type GitHubRepositoryVisibility = 'internal' | 'private' | 'public';
2
2
  //# sourceMappingURL=GitHubRepositoryVisibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GitHubRepositoryVisibility.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubRepositoryVisibility.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"GitHubRepositoryVisibility.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/definitions/GitHubRepositoryVisibility.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC"}
@@ -8,11 +8,15 @@ export interface GitHubDiscoveredRepository {
8
8
  readonly name: string;
9
9
  readonly owner: string;
10
10
  readonly url: string;
11
- readonly visibility: 'private' | 'public';
11
+ readonly visibility: 'internal' | 'private' | 'public';
12
12
  }
13
13
  /** Read-only provider boundary for GitHub owner resolution and repository discovery. */
14
14
  export interface GitHubRepositoryDiscoveryGateway {
15
15
  resolveOwnerAsync(owner: string, signal?: AbortSignal): Promise<GitHubRepositoryOwner>;
16
16
  listOwnerRepositoriesAsync(owner: GitHubRepositoryOwner, signal?: AbortSignal): Promise<readonly GitHubDiscoveredRepository[]>;
17
17
  }
18
+ /** Read-only provider boundary for the authenticated user's GitHub repository inventory. */
19
+ export interface GitHubAuthenticatedUserRepositoryInventoryGateway {
20
+ listAuthenticatedUserRepositoriesAsync(signal?: AbortSignal): Promise<readonly GitHubDiscoveredRepository[]>;
21
+ }
18
22
  //# sourceMappingURL=GitHubRepositoryDiscoveryGateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GitHubRepositoryDiscoveryGateway.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/ports/GitHubRepositoryDiscoveryGateway.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC3C;AAED,wFAAwF;AACxF,MAAM,WAAW,gCAAgC;IAC/C,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACvF,0BAA0B,CACxB,KAAK,EAAE,qBAAqB,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,SAAS,0BAA0B,EAAE,CAAC,CAAC;CACnD"}
1
+ {"version":3,"file":"GitHubRepositoryDiscoveryGateway.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/ports/GitHubRepositoryDiscoveryGateway.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;CACxD;AAED,wFAAwF;AACxF,MAAM,WAAW,gCAAgC;IAC/C,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACvF,0BAA0B,CACxB,KAAK,EAAE,qBAAqB,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,SAAS,0BAA0B,EAAE,CAAC,CAAC;CACnD;AAED,4FAA4F;AAC5F,MAAM,WAAW,iDAAiD;IAChE,sCAAsC,CACpC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,SAAS,0BAA0B,EAAE,CAAC,CAAC;CACnD"}
@@ -0,0 +1,12 @@
1
+ import type { GitHubAuthenticatedUserRepositoryInventoryOptions } from '../definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.js';
2
+ import type { GitHubAuthenticatedUserRepositoryInventoryResult } from '../definitions/GitHubAuthenticatedUserRepositoryInventoryResult.js';
3
+ /***
4
+ * List repositories GitHub makes available to one request-scoped authenticated user.
5
+ *
6
+ * The result represents the caller's current GitHub access, which can be partial when OAuth scope,
7
+ * organization approval, SSO, or repository permissions restrict visibility.
8
+ *
9
+ * @security discoverGitHubAuthenticatedUserRepositoriesAsync.test.ts#fails closed for malformed public authenticated inventory credentials without network access
10
+ */
11
+ export declare function discoverGitHubAuthenticatedUserRepositoriesAsync(options: GitHubAuthenticatedUserRepositoryInventoryOptions): Promise<GitHubAuthenticatedUserRepositoryInventoryResult>;
12
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesAsync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesAsync.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iDAAiD,EAAE,MAAM,qEAAqE,CAAC;AAC7I,OAAO,KAAK,EAAE,gDAAgD,EAAE,MAAM,oEAAoE,CAAC;AAI3I;;;;;;;GAOG;AACH,wBAAsB,gDAAgD,CACpE,OAAO,EAAE,iDAAiD,GACzD,OAAO,CAAC,gDAAgD,CAAC,CAM3D"}
@@ -0,0 +1,33 @@
1
+ import { createGitHubHttpRepositoryReadGateway } from '../adapters/createGitHubHttpRepositoryReadGateway.js';
2
+ import { GitHubRepositoryDiscoveryError } from '../definitions/GitHubRepositoryDiscoveryResult.js';
3
+ import { discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync } from './discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.js';
4
+ /***
5
+ * List repositories GitHub makes available to one request-scoped authenticated user.
6
+ *
7
+ * The result represents the caller's current GitHub access, which can be partial when OAuth scope,
8
+ * organization approval, SSO, or repository permissions restrict visibility.
9
+ *
10
+ * @security discoverGitHubAuthenticatedUserRepositoriesAsync.test.ts#fails closed for malformed public authenticated inventory credentials without network access
11
+ */
12
+ export async function discoverGitHubAuthenticatedUserRepositoriesAsync(options) {
13
+ const authentication = requireUserAuthentication(options);
14
+ const gateway = createGitHubHttpRepositoryReadGateway(fetch, {
15
+ authentication,
16
+ });
17
+ return discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync(options, gateway);
18
+ }
19
+ /*** Refuse malformed runtime input before it can select the HTTP client's environment credentials. */
20
+ function requireUserAuthentication(options) {
21
+ const authentication = options?.authentication;
22
+ if (typeof authentication !== 'object' ||
23
+ authentication === null ||
24
+ Array.isArray(authentication))
25
+ throw new GitHubRepositoryDiscoveryError('permission-denied', 'Authenticated repository inventory requires a user access token.');
26
+ const candidate = authentication;
27
+ if (candidate.kind !== 'user' ||
28
+ typeof candidate.accessToken !== 'string' ||
29
+ candidate.accessToken.trim() === '')
30
+ throw new GitHubRepositoryDiscoveryError('permission-denied', 'Authenticated repository inventory requires a user access token.');
31
+ return { kind: 'user', accessToken: candidate.accessToken };
32
+ }
33
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesAsync.js","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,sDAAsD,CAAC;AAG7G,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EAAE,2DAA2D,EAAE,MAAM,kEAAkE,CAAC;AAE/I;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gDAAgD,CACpE,OAA0D;IAE1D,MAAM,cAAc,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,qCAAqC,CAAC,KAAK,EAAE;QAC3D,cAAc;KACf,CAAC,CAAC;IACH,OAAO,2DAA2D,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACvF,CAAC;AAED,sGAAsG;AACtG,SAAS,yBAAyB,CAChC,OAA0D;IAE1D,MAAM,cAAc,GAAI,OAAwD,EAAE,cAAc,CAAC;IACjG,IACE,OAAO,cAAc,KAAK,QAAQ;QAClC,cAAc,KAAK,IAAI;QACvB,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;QAE7B,MAAM,IAAI,8BAA8B,CACtC,mBAAmB,EACnB,kEAAkE,CACnE,CAAC;IACJ,MAAM,SAAS,GAAG,cAA6E,CAAC;IAChG,IACE,SAAS,CAAC,IAAI,KAAK,MAAM;QACzB,OAAO,SAAS,CAAC,WAAW,KAAK,QAAQ;QACzC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE;QAEnC,MAAM,IAAI,8BAA8B,CACtC,mBAAmB,EACnB,kEAAkE,CACnE,CAAC;IACJ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesAsync.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesAsync.test.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,75 @@
1
+ import { expect, test } from 'bun:test';
2
+ import { discoverGitHubAuthenticatedUserRepositoriesAsync } from '../../../github/index.js';
3
+ test('fails closed for malformed public authenticated inventory credentials without network access', async () => {
4
+ const originalToken = process.env.GITHUB_TOKEN;
5
+ const originalFetch = globalThis.fetch;
6
+ const requests = [];
7
+ process.env.GITHUB_TOKEN = 'ambient-server-token';
8
+ globalThis.fetch = ((input) => {
9
+ requests.push(input);
10
+ return Promise.resolve(Response.json([]));
11
+ });
12
+ try {
13
+ for (const input of [
14
+ undefined,
15
+ null,
16
+ {},
17
+ { authentication: undefined },
18
+ { authentication: null },
19
+ { authentication: 'anonymous' },
20
+ { authentication: 'environment' },
21
+ { authentication: { kind: 'user', accessToken: '' } },
22
+ { authentication: { kind: 'user', accessToken: ' ' } },
23
+ { authentication: { kind: 'other', accessToken: 'token' } },
24
+ ]) {
25
+ await expectPermissionDeniedAsync(input);
26
+ }
27
+ expect(requests).toHaveLength(0);
28
+ }
29
+ finally {
30
+ globalThis.fetch = originalFetch;
31
+ if (originalToken === undefined)
32
+ delete process.env.GITHUB_TOKEN;
33
+ else
34
+ process.env.GITHUB_TOKEN = originalToken;
35
+ }
36
+ });
37
+ /** Invoke the public export with JavaScript-shaped input and assert its fail-closed error boundary. */
38
+ async function expectPermissionDeniedAsync(input) {
39
+ try {
40
+ await discoverGitHubAuthenticatedUserRepositoriesAsync(input);
41
+ throw new Error('Expected authenticated inventory to reject malformed credentials.');
42
+ }
43
+ catch (error) {
44
+ expect(error).toMatchObject({ code: 'permission-denied' });
45
+ }
46
+ }
47
+ test('keeps concurrent public authenticated inventories isolated from ambient credentials', async () => {
48
+ const originalToken = process.env.GITHUB_TOKEN;
49
+ const originalFetch = globalThis.fetch;
50
+ const authorizations = [];
51
+ process.env.GITHUB_TOKEN = 'ambient-server-token';
52
+ globalThis.fetch = ((_input, init) => {
53
+ authorizations.push(new Headers(init?.headers).get('authorization') ?? 'missing');
54
+ return Promise.resolve(Response.json([]));
55
+ });
56
+ try {
57
+ await Promise.all([
58
+ discoverGitHubAuthenticatedUserRepositoriesAsync({
59
+ authentication: { kind: 'user', accessToken: 'user-a-token' },
60
+ }),
61
+ discoverGitHubAuthenticatedUserRepositoriesAsync({
62
+ authentication: { kind: 'user', accessToken: 'user-b-token' },
63
+ }),
64
+ ]);
65
+ expect(authorizations).toEqual(['Bearer user-a-token', 'Bearer user-b-token']);
66
+ }
67
+ finally {
68
+ globalThis.fetch = originalFetch;
69
+ if (originalToken === undefined)
70
+ delete process.env.GITHUB_TOKEN;
71
+ else
72
+ process.env.GITHUB_TOKEN = originalToken;
73
+ }
74
+ });
75
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesAsync.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesAsync.test.js","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesAsync.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,gDAAgD,EAAE,MAAM,0BAA0B,CAAC;AAE5F,IAAI,CAAC,8FAA8F,EAAE,KAAK,IAAI,EAAE;IAC9G,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAC/C,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC;IACvC,MAAM,QAAQ,GAAc,EAAE,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,sBAAsB,CAAC;IAClD,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,KAA6B,EAAE,EAAE;QACpD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAiB,CAAC;IACnB,IAAI,CAAC;QACH,KAAK,MAAM,KAAK,IAAI;YAClB,SAAS;YACT,IAAI;YACJ,EAAE;YACF,EAAE,cAAc,EAAE,SAAS,EAAE;YAC7B,EAAE,cA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AE,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,sBAAsB,CAAC;IAClD,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,MAA8B,EAAE,IAAkB,EAAE,EAAE;QACzE,cAAc,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,SAAS,CAAC,CAAC;QAClF,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAiB,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,gDAAgD,CAAC;gBAC/C,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE;aAC9D,CAAC;YACF,gDAAgD,CAAC;gBAC/C,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE;aAC9D,CAAC;SACH,CAAC,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC,CAAC;IACjF,CAAC;YAAS,CAAC;QACT,UAAU,CAAC,KAAK,GAAG,aAAa,CAAC;QACjC,IAAI,aAAa,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;;YAC5D,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,aAAa,CAAC;IAChD,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { GitHubAuthenticatedUserRepositoryInventoryOptions } from '../definitions/GitHubAuthenticatedUserRepositoryInventoryOptions.js';
2
+ import type { GitHubAuthenticatedUserRepositoryInventoryResult } from '../definitions/GitHubAuthenticatedUserRepositoryInventoryResult.js';
3
+ import type { GitHubAuthenticatedUserRepositoryInventoryGateway } from '../ports/GitHubRepositoryDiscoveryGateway.js';
4
+ /*** List authenticated-user repositories through an injected read-only GitHub inventory boundary. */
5
+ export declare function discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync(options: GitHubAuthenticatedUserRepositoryInventoryOptions, gateway: GitHubAuthenticatedUserRepositoryInventoryGateway): Promise<GitHubAuthenticatedUserRepositoryInventoryResult>;
6
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iDAAiD,EAAE,MAAM,qEAAqE,CAAC;AAC7I,OAAO,KAAK,EAAE,gDAAgD,EAAE,MAAM,oEAAoE,CAAC;AAC3I,OAAO,KAAK,EAAE,iDAAiD,EAAE,MAAM,8CAA8C,CAAC;AAEtH,qGAAqG;AACrG,wBAAsB,2DAA2D,CAC/E,OAAO,EAAE,iDAAiD,EAC1D,OAAO,EAAE,iDAAiD,GACzD,OAAO,CAAC,gDAAgD,CAAC,CAE3D"}
@@ -0,0 +1,5 @@
1
+ /*** List authenticated-user repositories through an injected read-only GitHub inventory boundary. */
2
+ export async function discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync(options, gateway) {
3
+ return { repositories: await gateway.listAuthenticatedUserRepositoriesAsync(options.signal) };
4
+ }
5
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.js","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.ts"],"names":[],"mappings":"AAIA,qGAAqG;AACrG,MAAM,CAAC,KAAK,UAAU,2DAA2D,CAC/E,OAA0D,EAC1D,OAA0D;IAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC,sCAAsC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AAChG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.d.ts","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,57 @@
1
+ import { expect, test } from 'bun:test';
2
+ import { discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync } from './discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.js';
3
+ test('uses the dedicated authenticated-user inventory boundary without an owner lookup', async () => {
4
+ let calls = 0;
5
+ const result = await discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync({ authentication: { kind: 'user', accessToken: 'user-token' } }, createGateway(() => {
6
+ calls += 1;
7
+ }));
8
+ expect(calls).toBe(1);
9
+ expect(result.repositories.map((repository) => repository.owner)).toEqual([
10
+ 'an-owner',
11
+ 'a-collaborator',
12
+ 'an-organization',
13
+ ]);
14
+ });
15
+ test('passes cancellation to the authenticated-user inventory boundary', async () => {
16
+ const controller = new AbortController();
17
+ let receivedSignal;
18
+ await discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync({ authentication: { kind: 'user', accessToken: 'user-token' }, signal: controller.signal }, {
19
+ listAuthenticatedUserRepositoriesAsync: (signal) => {
20
+ receivedSignal = signal;
21
+ return Promise.resolve([]);
22
+ },
23
+ });
24
+ expect(receivedSignal).toBe(controller.signal);
25
+ });
26
+ /** Create a multi-owner inventory fixture with no owner-resolution capability. */
27
+ function createGateway(onList) {
28
+ return {
29
+ listAuthenticatedUserRepositoriesAsync: () => {
30
+ onList();
31
+ return Promise.resolve([
32
+ {
33
+ id: '1',
34
+ name: 'owned',
35
+ owner: 'an-owner',
36
+ url: 'https://github.com/an-owner/owned',
37
+ visibility: 'private',
38
+ },
39
+ {
40
+ id: '2',
41
+ name: 'collaboration',
42
+ owner: 'a-collaborator',
43
+ url: 'https://github.com/a-collaborator/collaboration',
44
+ visibility: 'public',
45
+ },
46
+ {
47
+ id: '3',
48
+ name: 'team',
49
+ owner: 'an-organization',
50
+ url: 'https://github.com/an-organization/team',
51
+ visibility: 'internal',
52
+ },
53
+ ]);
54
+ },
55
+ };
56
+ }
57
+ //# sourceMappingURL=discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.js","sourceRoot":"","sources":["../../../../src/providers/github/services/discoverGitHubAuthenticatedUserRepositoriesWithGatewayAsync.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAE,2DAA2D,EAAE,MAAM,kEAAkE,CAAC;AAE/I,IAAI,CAAC,kFAAkF,EAAE,KAAK,IAAI,EAAE;IAClG,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,MAAM,GAAG,MAAM,2DAA2D,CAC9E,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAC/D,aAAa,CAAC,GAAG,EAAE;QACjB,KAAK,IAAI,CAAC,CAAC;IACb,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtB,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;QACxE,UAAU;QACV,gBAAgB;QAChB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 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/repository",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "Standalone repository capability for connecting and managing an app project's source repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -118,7 +118,7 @@
118
118
  "dependencies": {
119
119
  "@ankhorage/ankh": "^0.13.3",
120
120
  "@ankhorage/capability": "^0.2.2",
121
- "@ankhorage/contracts": "^26.8.0",
121
+ "@ankhorage/contracts": "^26.9.0",
122
122
  "ignore": "^7.0.14"
123
123
  }
124
124
  }