@shipfox/api-integration-github 12.3.0 → 12.6.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +19 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +15 -9
- package/dist/api/client.js.map +1 -1
- package/dist/api/github-octokit.d.ts +7 -0
- package/dist/api/github-octokit.d.ts.map +1 -0
- package/dist/api/github-octokit.js +32 -0
- package/dist/api/github-octokit.js.map +1 -0
- package/dist/api/installation-token-envelope.d.ts +5 -1
- package/dist/api/installation-token-envelope.d.ts.map +1 -1
- package/dist/api/installation-token-envelope.js +16 -5
- package/dist/api/installation-token-envelope.js.map +1 -1
- package/dist/api/installation-token-provider.d.ts.map +1 -1
- package/dist/api/installation-token-provider.js +4 -2
- package/dist/api/installation-token-provider.js.map +1 -1
- package/dist/api/shared-installation-token-cache.d.ts.map +1 -1
- package/dist/api/shared-installation-token-cache.js +10 -4
- package/dist/api/shared-installation-token-cache.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-tools.d.ts +11 -4
- package/dist/core/agent-tools.d.ts.map +1 -1
- package/dist/core/agent-tools.js +235 -24
- package/dist/core/agent-tools.js.map +1 -1
- package/dist/core/github-agent-tool-catalog.js +1 -1
- package/dist/core/github-agent-tool-catalog.js.map +1 -1
- package/dist/metrics/instance.d.ts +1 -0
- package/dist/metrics/instance.d.ts.map +1 -1
- package/dist/metrics/instance.js +19 -0
- package/dist/metrics/instance.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/api/client.test.ts +66 -10
- package/src/api/client.ts +44 -7
- package/src/api/github-octokit.test.ts +115 -0
- package/src/api/github-octokit.ts +49 -0
- package/src/api/installation-token-envelope.ts +24 -2
- package/src/api/installation-token-provider.test.ts +44 -5
- package/src/api/installation-token-provider.ts +5 -2
- package/src/api/shared-installation-token-cache.test.ts +28 -0
- package/src/api/shared-installation-token-cache.ts +7 -0
- package/src/config.ts +5 -0
- package/src/core/agent-tools.test.ts +1049 -8
- package/src/core/agent-tools.ts +388 -25
- package/src/core/github-agent-tool-catalog.ts +1 -1
- package/src/metrics/instance.ts +25 -0
- package/test/env.ts +1 -0
- package/test/fixtures/github-installation-token.ts +8 -0
- package/test/index.ts +4 -0
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -113,6 +113,7 @@ export class SharedInstallationTokenCache implements InstallationTokenCache {
|
|
|
113
113
|
throw providerErrorFromBackoff(
|
|
114
114
|
envelope?.backoffReason ?? 'provider-unavailable',
|
|
115
115
|
(envelope?.backoffUntil?.getTime() ?? now.getTime()) - now.getTime(),
|
|
116
|
+
envelope?.backoffError,
|
|
116
117
|
);
|
|
117
118
|
}
|
|
118
119
|
|
|
@@ -131,6 +132,10 @@ export class SharedInstallationTokenCache implements InstallationTokenCache {
|
|
|
131
132
|
permissions: envelope?.permissions,
|
|
132
133
|
backoffUntil: until,
|
|
133
134
|
backoffReason: classified.reason,
|
|
135
|
+
backoffError: {
|
|
136
|
+
message: providerError.message,
|
|
137
|
+
...(providerError.status === undefined ? {} : {status: providerError.status}),
|
|
138
|
+
},
|
|
134
139
|
}).catch((writeError) => {
|
|
135
140
|
logger().warn(
|
|
136
141
|
{installationId: params.installationId, reason: classified.reason, error: writeError},
|
|
@@ -215,6 +220,7 @@ export class SharedInstallationTokenCache implements InstallationTokenCache {
|
|
|
215
220
|
throw providerErrorFromBackoff(
|
|
216
221
|
params.envelope.backoffReason,
|
|
217
222
|
params.envelope.backoffUntil.getTime() - initialNow.getTime(),
|
|
223
|
+
params.envelope.backoffError,
|
|
218
224
|
);
|
|
219
225
|
}
|
|
220
226
|
|
|
@@ -231,6 +237,7 @@ export class SharedInstallationTokenCache implements InstallationTokenCache {
|
|
|
231
237
|
throw providerErrorFromBackoff(
|
|
232
238
|
envelope?.backoffReason ?? 'provider-unavailable',
|
|
233
239
|
(envelope?.backoffUntil?.getTime() ?? now.getTime()) - now.getTime(),
|
|
240
|
+
envelope?.backoffError,
|
|
234
241
|
);
|
|
235
242
|
}
|
|
236
243
|
}
|
package/src/config.ts
CHANGED
|
@@ -29,6 +29,11 @@ export const config = createConfig({
|
|
|
29
29
|
desc: 'Base URL used for GitHub REST API requests. Set this only for GitHub Enterprise Server or a compatible test server.',
|
|
30
30
|
default: 'https://api.github.com',
|
|
31
31
|
}),
|
|
32
|
+
GITHUB_INSTALLATION_TOKEN_FORMAT_OVERRIDE: str({
|
|
33
|
+
desc: 'Temporary GitHub installation token format override. Set this to enabled to request stateless tokens, disabled to request stateful tokens, or leave it unset to follow the GitHub rollout.',
|
|
34
|
+
choices: ['enabled', 'disabled'] as const,
|
|
35
|
+
default: undefined,
|
|
36
|
+
}),
|
|
32
37
|
GITHUB_INSTALL_STATE_SECRET: str({
|
|
33
38
|
desc: 'Secret used to sign the state token that protects the GitHub App install flow. Required.',
|
|
34
39
|
}),
|