@opengeni/github 0.4.0 → 0.4.11

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 (2) hide show
  1. package/dist/index.d.ts +31 -34
  2. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -1,57 +1,56 @@
1
- import { Settings } from '@opengeni/config';
2
- import { GitHubUserInstallationAccess, GitHubInstallationBindingProof, GitHubInstallationBindingCandidate, GitHubRepository } from '@opengeni/contracts';
3
-
4
- declare const stateMaxAgeSeconds: number;
5
- declare class GitHubAppConfigurationError extends Error {
1
+ import type { Settings } from "@opengeni/config";
2
+ import type { GitHubInstallationBindingCandidate, GitHubInstallationBindingProof, GitHubRepository, GitHubUserInstallationAccess } from "@opengeni/contracts";
3
+ export declare const stateMaxAgeSeconds: number;
4
+ export declare class GitHubAppConfigurationError extends Error {
6
5
  readonly missing: string[];
7
6
  constructor(missing: string[]);
8
7
  }
9
- declare class GitHubAppApiError extends Error {
8
+ export declare class GitHubAppApiError extends Error {
10
9
  readonly status: number | null;
11
10
  constructor(message: string, status?: number | null);
12
11
  }
13
- type GitHubInstallationAuthorityFailure = "authority_denied" | "authority_unavailable" | "installation_missing" | "installation_suspended" | "repository_access_empty";
14
- declare class GitHubInstallationAuthorityError extends GitHubAppApiError {
12
+ export type GitHubInstallationAuthorityFailure = "authority_denied" | "authority_unavailable" | "installation_missing" | "installation_suspended" | "repository_access_empty";
13
+ export declare class GitHubInstallationAuthorityError extends GitHubAppApiError {
15
14
  readonly reason: GitHubInstallationAuthorityFailure;
16
15
  constructor(reason: GitHubInstallationAuthorityFailure, message: string, status?: number | null);
17
16
  }
18
- type GitHubAppInstallationSummary = {
17
+ export type GitHubAppInstallationSummary = {
19
18
  installationId: number;
20
19
  accountId: number;
21
20
  accountLogin: string | null;
22
21
  accountType: string | null;
23
22
  suspended: boolean;
24
23
  };
25
- type GitHubSignedStatePayload = {
24
+ export type GitHubSignedStatePayload = {
26
25
  nonce: string;
27
26
  iat: number;
28
27
  accountId?: string;
29
28
  workspaceId?: string;
30
29
  [key: string]: unknown;
31
30
  };
32
- declare function githubAppMissingSettings(settings: Settings): string[];
33
- declare function buildGitHubAppManifest(input: {
31
+ export declare function githubAppMissingSettings(settings: Settings): string[];
32
+ export declare function buildGitHubAppManifest(input: {
34
33
  appName: string;
35
34
  baseUrl: string;
36
35
  public: boolean;
37
36
  includeCiPermissions: boolean;
38
37
  setupUrl?: string;
39
38
  }): Record<string, unknown>;
40
- declare function personalAppManifestUrl(state: string): string;
41
- declare function organizationAppManifestUrl(organization: string, state: string): string;
42
- declare function githubOAuthAuthorizeUrl(input: {
39
+ export declare function personalAppManifestUrl(state: string): string;
40
+ export declare function organizationAppManifestUrl(organization: string, state: string): string;
41
+ export declare function githubOAuthAuthorizeUrl(input: {
43
42
  clientId: string;
44
43
  state: string;
45
44
  redirectUri?: string;
46
45
  }): string;
47
- declare function createSignedState(secret: string, payloadOrNow?: Record<string, unknown> | number, nowArg?: number): string;
48
- declare function readSignedState(state: string, secret: string, now?: number): GitHubSignedStatePayload | null;
49
- declare function verifySignedState(state: string, secret: string, now?: number): boolean;
50
- declare function envLinesFromGitHubManifestConversion(payload: Record<string, unknown>): string[];
51
- declare function convertGitHubAppManifest(code: string): Promise<Record<string, unknown>>;
52
- declare function listGitHubAppInstallationSummaries(settings: Settings): Promise<GitHubAppInstallationSummary[]>;
53
- declare function getGitHubAppInstallationSummary(settings: Settings, installationId: number): Promise<GitHubAppInstallationSummary | null>;
54
- declare function verifyGitHubInstallationAccessForUser(settings: Settings, input: {
46
+ export declare function createSignedState(secret: string, payloadOrNow?: Record<string, unknown> | number, nowArg?: number): string;
47
+ export declare function readSignedState(state: string, secret: string, now?: number): GitHubSignedStatePayload | null;
48
+ export declare function verifySignedState(state: string, secret: string, now?: number): boolean;
49
+ export declare function envLinesFromGitHubManifestConversion(payload: Record<string, unknown>): string[];
50
+ export declare function convertGitHubAppManifest(code: string): Promise<Record<string, unknown>>;
51
+ export declare function listGitHubAppInstallationSummaries(settings: Settings): Promise<GitHubAppInstallationSummary[]>;
52
+ export declare function getGitHubAppInstallationSummary(settings: Settings, installationId: number): Promise<GitHubAppInstallationSummary | null>;
53
+ export declare function verifyGitHubInstallationAccessForUser(settings: Settings, input: {
55
54
  code: string;
56
55
  installationId: number;
57
56
  }): Promise<GitHubAppInstallationSummary>;
@@ -62,7 +61,7 @@ declare function verifyGitHubInstallationAccessForUser(settings: Settings, input
62
61
  * prove that the human may install, configure, or bind the App installation.
63
62
  * No production binding path may treat this result as authority.
64
63
  */
65
- declare function authorizeGitHubAppUser(settings: Settings, input: {
64
+ export declare function authorizeGitHubAppUser(settings: Settings, input: {
66
65
  code: string;
67
66
  }): Promise<GitHubUserInstallationAccess[]>;
68
67
  /**
@@ -75,7 +74,7 @@ declare function authorizeGitHubAppUser(settings: Settings, input: {
75
74
  * equivalent current-authority receipt for App Managers, so that case remains
76
75
  * unsupported and fails closed.
77
76
  */
78
- declare function authorizeGitHubInstallationBinding(settings: Settings, input: {
77
+ export declare function authorizeGitHubInstallationBinding(settings: Settings, input: {
79
78
  code: string;
80
79
  installationId: number;
81
80
  }): Promise<GitHubInstallationBindingProof>;
@@ -89,28 +88,26 @@ declare function authorizeGitHubInstallationBinding(settings: Settings, input: {
89
88
  * membership proof. The later exact authorization still re-runs the complete
90
89
  * proof immediately before the durable bind.
91
90
  */
92
- declare function discoverGitHubInstallationBindingCandidates(settings: Settings, input: {
91
+ export declare function discoverGitHubInstallationBindingCandidates(settings: Settings, input: {
93
92
  code: string;
94
93
  }): Promise<GitHubInstallationBindingCandidate[]>;
95
- declare function listGitHubAppRepositories(settings: Settings, input?: {
94
+ export declare function listGitHubAppRepositories(settings: Settings, input?: {
96
95
  installationIds?: number[];
97
96
  }): Promise<GitHubRepository[]>;
98
- declare function createGitHubAppInstallationToken(settings: Settings, input: {
97
+ export declare function createGitHubAppInstallationToken(settings: Settings, input: {
99
98
  installationId: number;
100
99
  repositoryIds: number[];
101
100
  }): Promise<string>;
102
- type GitHubAppInstallationToken = {
101
+ export type GitHubAppInstallationToken = {
103
102
  token: string;
104
103
  expiresAt: string | null;
105
104
  };
106
- declare function createGitHubAppInstallationTokenWithExpiry(settings: Settings, input: {
105
+ export declare function createGitHubAppInstallationTokenWithExpiry(settings: Settings, input: {
107
106
  installationId: number;
108
107
  repositoryIds: number[];
109
108
  }): Promise<GitHubAppInstallationToken>;
110
- declare function githubAppBotIdentity(settings: Settings): {
109
+ export declare function githubAppBotIdentity(settings: Settings): {
111
110
  name: string;
112
111
  email: string;
113
112
  } | null;
114
- declare function normalizeGitHubAppPrivateKey(value: string): string;
115
-
116
- export { GitHubAppApiError, GitHubAppConfigurationError, type GitHubAppInstallationSummary, type GitHubAppInstallationToken, GitHubInstallationAuthorityError, type GitHubInstallationAuthorityFailure, type GitHubSignedStatePayload, authorizeGitHubAppUser, authorizeGitHubInstallationBinding, buildGitHubAppManifest, convertGitHubAppManifest, createGitHubAppInstallationToken, createGitHubAppInstallationTokenWithExpiry, createSignedState, discoverGitHubInstallationBindingCandidates, envLinesFromGitHubManifestConversion, getGitHubAppInstallationSummary, githubAppBotIdentity, githubAppMissingSettings, githubOAuthAuthorizeUrl, listGitHubAppInstallationSummaries, listGitHubAppRepositories, normalizeGitHubAppPrivateKey, organizationAppManifestUrl, personalAppManifestUrl, readSignedState, stateMaxAgeSeconds, verifyGitHubInstallationAccessForUser, verifySignedState };
113
+ export declare function normalizeGitHubAppPrivateKey(value: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/github",
3
- "version": "0.4.0",
3
+ "version": "0.4.11",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,13 +26,13 @@
26
26
  "provenance": true
27
27
  },
28
28
  "scripts": {
29
- "build": "tsup",
30
- "typecheck": "tsgo --noEmit",
29
+ "build": "bun ../../scripts/build-typescript-package.ts",
30
+ "typecheck": "tsc --noEmit",
31
31
  "prepublishOnly": "bash ../../scripts/prepublish-guard"
32
32
  },
33
33
  "dependencies": {
34
- "@opengeni/config": "^0.7.13",
35
- "@opengeni/contracts": "^0.23.0",
34
+ "@opengeni/config": "^0.8.1",
35
+ "@opengeni/contracts": "^0.27.0",
36
36
  "jose": "^6.1.3"
37
37
  }
38
38
  }