@noodleseed/one 0.16.0 → 0.17.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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +49 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/apps-ops.d.ts +17 -0
- package/dist/commands/apps-ops.d.ts.map +1 -0
- package/dist/commands/apps-ops.js +285 -0
- package/dist/commands/apps-ops.js.map +1 -0
- package/dist/commands/archive-ops.js +2 -2
- package/dist/commands/archive-ops.js.map +1 -1
- package/dist/commands/catalog-data-config.d.ts +9 -0
- package/dist/commands/catalog-data-config.d.ts.map +1 -0
- package/dist/commands/catalog-data-config.js +67 -0
- package/dist/commands/catalog-data-config.js.map +1 -0
- package/dist/commands/catalog-data-core.d.ts +13 -0
- package/dist/commands/catalog-data-core.d.ts.map +1 -0
- package/dist/commands/catalog-data-core.js +354 -0
- package/dist/commands/catalog-data-core.js.map +1 -0
- package/dist/commands/catalog-data-resources.d.ts +8 -0
- package/dist/commands/catalog-data-resources.d.ts.map +1 -0
- package/dist/commands/catalog-data-resources.js +506 -0
- package/dist/commands/catalog-data-resources.js.map +1 -0
- package/dist/commands/catalog-dispatch.d.ts +15 -0
- package/dist/commands/catalog-dispatch.d.ts.map +1 -0
- package/dist/commands/catalog-dispatch.js +95 -0
- package/dist/commands/catalog-dispatch.js.map +1 -0
- package/dist/commands/catalog-render.d.ts +28 -0
- package/dist/commands/catalog-render.d.ts.map +1 -0
- package/dist/commands/catalog-render.js +142 -0
- package/dist/commands/catalog-render.js.map +1 -0
- package/dist/commands/catalog-types.d.ts +46 -0
- package/dist/commands/catalog-types.d.ts.map +1 -0
- package/dist/commands/catalog-types.js +7 -0
- package/dist/commands/catalog-types.js.map +1 -0
- package/dist/commands/catalog.d.ts +30 -0
- package/dist/commands/catalog.d.ts.map +1 -0
- package/dist/commands/catalog.js +108 -0
- package/dist/commands/catalog.js.map +1 -0
- package/dist/commands/commands-ops.d.ts +2 -0
- package/dist/commands/commands-ops.d.ts.map +1 -0
- package/dist/commands/commands-ops.js +19 -0
- package/dist/commands/commands-ops.js.map +1 -0
- package/dist/commands/deploy-ops.d.ts +45 -3
- package/dist/commands/deploy-ops.d.ts.map +1 -1
- package/dist/commands/deploy-ops.js +200 -227
- package/dist/commands/deploy-ops.js.map +1 -1
- package/dist/commands/deploy-status-ops.d.ts +13 -0
- package/dist/commands/deploy-status-ops.d.ts.map +1 -0
- package/dist/commands/deploy-status-ops.js +252 -0
- package/dist/commands/deploy-status-ops.js.map +1 -0
- package/dist/commands/deployments-ops.d.ts +30 -0
- package/dist/commands/deployments-ops.d.ts.map +1 -0
- package/dist/commands/deployments-ops.js +248 -0
- package/dist/commands/deployments-ops.js.map +1 -0
- package/dist/commands/envs-ops.d.ts +8 -0
- package/dist/commands/envs-ops.d.ts.map +1 -0
- package/dist/commands/envs-ops.js +240 -0
- package/dist/commands/envs-ops.js.map +1 -0
- package/dist/commands/github-ops.d.ts +15 -0
- package/dist/commands/github-ops.d.ts.map +1 -0
- package/dist/commands/github-ops.js +296 -0
- package/dist/commands/github-ops.js.map +1 -0
- package/dist/commands/github-shared.d.ts +60 -0
- package/dist/commands/github-shared.d.ts.map +1 -0
- package/dist/commands/github-shared.js +175 -0
- package/dist/commands/github-shared.js.map +1 -0
- package/dist/commands/org-admin.d.ts.map +1 -1
- package/dist/commands/org-admin.js +223 -43
- package/dist/commands/org-admin.js.map +1 -1
- package/dist/commands/output.d.ts +35 -0
- package/dist/commands/output.d.ts.map +1 -0
- package/dist/commands/output.js +34 -0
- package/dist/commands/output.js.map +1 -0
- package/dist/commands/resource-shared.d.ts +132 -0
- package/dist/commands/resource-shared.d.ts.map +1 -0
- package/dist/commands/resource-shared.js +159 -0
- package/dist/commands/resource-shared.js.map +1 -0
- package/dist/commands/session.d.ts +6 -9
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +42 -116
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +3 -91
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/target-picker.d.ts +44 -0
- package/dist/commands/target-picker.d.ts.map +1 -0
- package/dist/commands/target-picker.js +88 -0
- package/dist/commands/target-picker.js.map +1 -0
- package/dist/commands/update-ops.js +1 -1
- package/dist/diagnostics.d.ts +5 -0
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +1 -1
- package/dist/diagnostics.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +33 -0
- package/dist/doctor.js.map +1 -1
- package/dist/fire.d.ts +94 -0
- package/dist/fire.d.ts.map +1 -0
- package/dist/fire.js +418 -0
- package/dist/fire.js.map +1 -0
- package/dist/flavor.d.ts +19 -0
- package/dist/flavor.d.ts.map +1 -0
- package/dist/flavor.js +95 -0
- package/dist/flavor.js.map +1 -0
- package/dist/project.js +2 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +30 -17
- package/dist/prompts.js.map +1 -1
- package/dist/relative-time.d.ts +8 -0
- package/dist/relative-time.d.ts.map +1 -0
- package/dist/relative-time.js +29 -0
- package/dist/relative-time.js.map +1 -0
- package/dist/table.d.ts +47 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +152 -0
- package/dist/table.js.map +1 -0
- package/dist/update-binary.js +1 -1
- package/dist/update-check.d.ts +1 -1
- package/dist/update-check.js +1 -1
- package/dist/update.js +1 -1
- package/dist/watch.d.ts +52 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +177 -0
- package/dist/watch.js.map +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +23 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +5 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/connectors.js +14 -0
- package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
- package/node_modules/@noodle-borg/connector-defs/dist/compile.js +9 -0
- package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/openapi-import/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/openapi-import/dist/index.js +3 -1
- package/node_modules/@noodle-borg/openapi-import/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts +49 -0
- package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/app-client.js +23 -0
- package/node_modules/@noodle-borg/service/dist/github/app-client.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.d.ts +23 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.js +57 -0
- package/node_modules/@noodle-borg/service/dist/github/install-nonce.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts +31 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.js +34 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/index.d.ts +7 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +7 -1
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +28 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +28 -7
- package/node_modules/@noodle-borg/service/dist/registry-state.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry-state.js +116 -3
- package/node_modules/@noodle-borg/service/dist/registry-state.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts +14 -1
- package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/registry.js +20 -45
- package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.d.ts +23 -0
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.js +53 -0
- package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.d.ts +24 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.js +72 -0
- package/node_modules/@noodle-borg/service/dist/routes/apps.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts +316 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.js +152 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/deployments.d.ts +12 -1
- package/node_modules/@noodle-borg/service/dist/routes/deployments.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/deployments.js +31 -2
- package/node_modules/@noodle-borg/service/dist/routes/deployments.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.d.ts +17 -0
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.js +15 -0
- package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.d.ts +22 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.js +46 -0
- package/node_modules/@noodle-borg/service/dist/routes/envs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.d.ts +29 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.js +202 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts +29 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js +60 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts +28 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.js +80 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.js +13 -1
- package/node_modules/@noodle-borg/service/dist/routes/org-admin.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +44 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js +116 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.js +69 -0
- package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +60 -45
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/control-plane.js +3 -0
- package/node_modules/@noodle-borg/service/dist/store/control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts +23 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js +137 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts +30 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js +116 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts +32 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.js +169 -0
- package/node_modules/@noodle-borg/service/dist/store/in-memory.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts +14 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.js +54 -1
- package/node_modules/@noodle-borg/service/dist/store/json-file.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts +11 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js +31 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.d.ts +21 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.js +80 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-config.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js +6 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.d.ts +7 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.js +34 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-envs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts +12 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js +125 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +36 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +25 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js +56 -75
- package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/records.d.ts +56 -3
- package/node_modules/@noodle-borg/service/dist/store/records.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/records.js +158 -0
- package/node_modules/@noodle-borg/service/dist/store/records.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/validate.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/store/validate.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/validate.js +7 -0
- package/node_modules/@noodle-borg/service/dist/store/validate.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.d.ts +161 -17
- package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.js +8 -118
- package/node_modules/@noodle-borg/service/dist/store.js.map +1 -1
- package/node_modules/@noodle-borg/service/package.json +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The GitHub App integration seam for GHD-1 (repository connection). This phase ships routes and
|
|
3
|
+
* persistence only — no live GitHub call is made anywhere in this slice. `GitHubAppClient` is the
|
|
4
|
+
* narrow port the connection routes depend on; a later slice implements it against the real GitHub App
|
|
5
|
+
* (JWT-signed app auth → installation access tokens → REST calls) once the private key / webhook secret
|
|
6
|
+
* are wired from the credential broker. Tests and local/dev use {@link InMemoryGitHubAppClient}.
|
|
7
|
+
*/
|
|
8
|
+
/** Non-secret GitHub App identity, threaded through `ServiceOptions.githubApp`. Never a token/key value. */
|
|
9
|
+
export interface GithubAppConfig {
|
|
10
|
+
readonly appId: string;
|
|
11
|
+
readonly appSlug: string;
|
|
12
|
+
/** PEM-encoded App private key. Read from the credential broker/secret manager, never logged or stored. */
|
|
13
|
+
readonly privateKeyPem?: string;
|
|
14
|
+
/** Webhook signing secret. Doubles as the default install-nonce signing secret (see `install-nonce.ts`). */
|
|
15
|
+
readonly webhookSecret?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GithubInstallationSummary {
|
|
18
|
+
readonly id: number;
|
|
19
|
+
readonly accountLogin: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GithubInstallationRepository {
|
|
22
|
+
readonly id: number;
|
|
23
|
+
readonly fullName: string;
|
|
24
|
+
readonly owner: string;
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly defaultBranch: string;
|
|
27
|
+
readonly private: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The exactly-what-phase-1-needs GitHub App port: look up one installation, and list the repositories it
|
|
31
|
+
* covers. Both operations back the connection POST (verify installation/repo match) and the
|
|
32
|
+
* installation-claim route (let the caller pick a repo). No write operations here — connecting/disconnecting
|
|
33
|
+
* only ever writes to the {@link GithubConnectionStore}, never to GitHub.
|
|
34
|
+
*/
|
|
35
|
+
export interface GitHubAppClient {
|
|
36
|
+
getInstallation(installationId: number): Promise<GithubInstallationSummary | undefined>;
|
|
37
|
+
listInstallationRepositories(installationId: number): Promise<readonly GithubInstallationRepository[]>;
|
|
38
|
+
}
|
|
39
|
+
/** Constructor-seeded fake for tests and local/dev — no network, no JWT, no live GitHub App required. */
|
|
40
|
+
export declare class InMemoryGitHubAppClient implements GitHubAppClient {
|
|
41
|
+
#private;
|
|
42
|
+
constructor(seed: {
|
|
43
|
+
readonly installations: readonly GithubInstallationSummary[];
|
|
44
|
+
readonly repositoriesByInstallation: Readonly<Record<number, readonly GithubInstallationRepository[]>>;
|
|
45
|
+
});
|
|
46
|
+
getInstallation(installationId: number): Promise<GithubInstallationSummary | undefined>;
|
|
47
|
+
listInstallationRepositories(installationId: number): Promise<readonly GithubInstallationRepository[]>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=app-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-client.d.ts","sourceRoot":"","sources":["../../src/github/app-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4GAA4G;AAC5G,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAA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
/**
|
|
2
|
+
* The GitHub App integration seam for GHD-1 (repository connection). This phase ships routes and
|
|
3
|
+
* persistence only — no live GitHub call is made anywhere in this slice. `GitHubAppClient` is the
|
|
4
|
+
* narrow port the connection routes depend on; a later slice implements it against the real GitHub App
|
|
5
|
+
* (JWT-signed app auth → installation access tokens → REST calls) once the private key / webhook secret
|
|
6
|
+
* are wired from the credential broker. Tests and local/dev use {@link InMemoryGitHubAppClient}.
|
|
7
|
+
*/
|
|
8
|
+
/** Constructor-seeded fake for tests and local/dev — no network, no JWT, no live GitHub App required. */
|
|
9
|
+
export class InMemoryGitHubAppClient {
|
|
10
|
+
#installations;
|
|
11
|
+
#repositoriesByInstallation;
|
|
12
|
+
constructor(seed) {
|
|
13
|
+
this.#installations = new Map(seed.installations.map((installation) => [installation.id, installation]));
|
|
14
|
+
this.#repositoriesByInstallation = new Map(Object.entries(seed.repositoriesByInstallation).map(([id, repos]) => [Number(id), repos]));
|
|
15
|
+
}
|
|
16
|
+
getInstallation(installationId) {
|
|
17
|
+
return Promise.resolve(this.#installations.get(installationId));
|
|
18
|
+
}
|
|
19
|
+
listInstallationRepositories(installationId) {
|
|
20
|
+
return Promise.resolve(this.#repositoriesByInstallation.get(installationId) ?? []);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=app-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-client.js","sourceRoot":"","sources":["../../src/github/app-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuCH,yGAAyG;AACzG,MAAM,OAAO,uBAAuB;IACzB,cAAc,CAAiD;IAC/D,2BAA2B,CAGlC;IAEF,YAAY,IAKX;QACC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAC1E,CAAC;QACF,IAAI,CAAC,2BAA2B,GAAG,IAAI,GAAG,CACxC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAC1F,CAAC;IACJ,CAAC;IAED,eAAe,CAAC,cAAsB;QACpC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,4BAA4B,CAC1B,cAAsB;QAEtB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function resolveGithubStateSecret(webhookSecret: string | undefined): string;
|
|
2
|
+
export interface InstallNoncePayload {
|
|
3
|
+
/**
|
|
4
|
+
* Random per-nonce id (the JWT `jti` idea). Without it two connect requests for the same
|
|
5
|
+
* subject/org/app in the same millisecond would sign to the SAME state and the first-write-wins
|
|
6
|
+
* pending store would conflate the two flows.
|
|
7
|
+
*/
|
|
8
|
+
readonly nonceId: string;
|
|
9
|
+
readonly subject: string;
|
|
10
|
+
readonly org: string;
|
|
11
|
+
readonly app: string;
|
|
12
|
+
readonly issuedAt: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function signInstallNonce(payload: InstallNoncePayload, secret: string): string;
|
|
15
|
+
export type InstallNonceVerification = {
|
|
16
|
+
readonly ok: true;
|
|
17
|
+
readonly payload: InstallNoncePayload;
|
|
18
|
+
} | {
|
|
19
|
+
readonly ok: false;
|
|
20
|
+
readonly reason: 'malformed' | 'tampered' | 'expired';
|
|
21
|
+
};
|
|
22
|
+
export declare function verifyInstallNonce(nonce: string, secret: string, now?: () => Date): InstallNonceVerification;
|
|
23
|
+
//# sourceMappingURL=install-nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-nonce.d.ts","sourceRoot":"","sources":["../../src/github/install-nonce.ts"],"names":[],"mappings":"AAiBA,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAOlF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAIrF;AAED,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC;AAElF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,GAAG,GAAE,MAAM,IAAuB,GACjC,wBAAwB,CA4B1B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* HMAC-signed `state` nonce for the GitHub App installation hand-off (`GET /v1/github/install-url` →
|
|
4
|
+
* GitHub's installations/new redirect → `POST /v1/github/installations/claim`). Binds the request to the
|
|
5
|
+
* subject who asked for it and the org/app it targets, with a short expiry — an attacker cannot forge or
|
|
6
|
+
* replay a claim without the signing secret.
|
|
7
|
+
*/
|
|
8
|
+
const NONCE_TTL_MS = 10 * 60 * 1000;
|
|
9
|
+
// Dev/self-host fallback signing secret when no `githubApp.webhookSecret` is configured. Per-process, NOT
|
|
10
|
+
// stable across instances — acceptable only because this whole feature is unwired from live GitHub in this
|
|
11
|
+
// slice (no real installation ever reaches `claim` yet). Production must configure `webhookSecret` before
|
|
12
|
+
// GHD-1 is exposed on a multi-instance deployment; see ADR 0111.
|
|
13
|
+
const FALLBACK_SECRET = randomBytes(32).toString('hex');
|
|
14
|
+
export function resolveGithubStateSecret(webhookSecret) {
|
|
15
|
+
if (webhookSecret !== undefined && webhookSecret.trim().length === 0) {
|
|
16
|
+
// A blank configured secret would silently make every state trivially forgeable — fail loudly
|
|
17
|
+
// instead of signing with ''. (Unconfigured is fine: the per-process random fallback applies.)
|
|
18
|
+
throw new Error('githubApp.webhookSecret must not be empty when configured');
|
|
19
|
+
}
|
|
20
|
+
return webhookSecret ?? FALLBACK_SECRET;
|
|
21
|
+
}
|
|
22
|
+
export function signInstallNonce(payload, secret) {
|
|
23
|
+
const encoded = Buffer.from(JSON.stringify(payload), 'utf8').toString('base64url');
|
|
24
|
+
const signature = createHmac('sha256', secret).update(encoded).digest('hex');
|
|
25
|
+
return `${encoded}.${signature}`;
|
|
26
|
+
}
|
|
27
|
+
export function verifyInstallNonce(nonce, secret, now = () => new Date()) {
|
|
28
|
+
const parts = nonce.split('.');
|
|
29
|
+
if (parts.length !== 2)
|
|
30
|
+
return { ok: false, reason: 'malformed' };
|
|
31
|
+
const [encoded, signature] = parts;
|
|
32
|
+
const expected = createHmac('sha256', secret).update(encoded).digest('hex');
|
|
33
|
+
const expectedBuf = Buffer.from(expected, 'hex');
|
|
34
|
+
const signatureBuf = Buffer.from(signature, 'hex');
|
|
35
|
+
if (signatureBuf.length !== expectedBuf.length || !timingSafeEqual(signatureBuf, expectedBuf)) {
|
|
36
|
+
return { ok: false, reason: 'tampered' };
|
|
37
|
+
}
|
|
38
|
+
let payload;
|
|
39
|
+
try {
|
|
40
|
+
payload = JSON.parse(Buffer.from(encoded, 'base64url').toString('utf8'));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return { ok: false, reason: 'malformed' };
|
|
44
|
+
}
|
|
45
|
+
if (typeof payload.nonceId !== 'string' ||
|
|
46
|
+
payload.nonceId.length === 0 ||
|
|
47
|
+
typeof payload.subject !== 'string' ||
|
|
48
|
+
typeof payload.org !== 'string' ||
|
|
49
|
+
typeof payload.app !== 'string' ||
|
|
50
|
+
typeof payload.issuedAt !== 'number') {
|
|
51
|
+
return { ok: false, reason: 'malformed' };
|
|
52
|
+
}
|
|
53
|
+
if (now().getTime() - payload.issuedAt > NONCE_TTL_MS)
|
|
54
|
+
return { ok: false, reason: 'expired' };
|
|
55
|
+
return { ok: true, payload };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=install-nonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-nonce.js","sourceRoot":"","sources":["../../src/github/install-nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE;;;;;GAKG;AAEH,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEpC,0GAA0G;AAC1G,2GAA2G;AAC3G,0GAA0G;AAC1G,iEAAiE;AACjE,MAAM,eAAe,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAExD,MAAM,UAAU,wBAAwB,CAAC,aAAiC;IACxE,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrE,8FAA8F;QAC9F,+FAA+F;QAC/F,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IACD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AE,CAAC;IAC3C,CAAC;IACD,IAAI,OAA4B,CAAC;IACjC,IAAI,CAAC;QACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAwB,CAAC;IAClG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC5C,CAAC;IACD,IACE,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ;QACnC,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;QAC5B,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ;QACnC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC/B,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC/B,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,EACpC,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC5C,CAAC;IACD,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,QAAQ,GAAG,YAAY;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC/F,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal in-memory hand-off for the CLI `noodle github connect` poll (GHD-1.4). GitHub's installation
|
|
3
|
+
* flow redirects the installer's BROWSER to the GitHub App's configured "Setup URL" once the install
|
|
4
|
+
* completes — a request the CLI process cannot receive directly (it has no public callback endpoint of
|
|
5
|
+
* its own). `GET /v1/github/setup` (`../routes/github-setup.ts`) IS that Setup URL: it lands the
|
|
6
|
+
* redirect, verifies the signed install-nonce `state` GitHub echoes back, and stashes the installationId
|
|
7
|
+
* here keyed by the raw state string. The CLI then polls `GET /v1/github/installations/pending?state=...`
|
|
8
|
+
* (same file) until the entry appears, then proceeds to `POST /v1/github/installations/claim`.
|
|
9
|
+
*
|
|
10
|
+
* Entries expire on the same 10-minute TTL as the nonce itself (`install-nonce.ts`) so a stale poll can
|
|
11
|
+
* never resurrect an old install correlation. Deliberately NOT the durable `GithubConnectionStore` — this
|
|
12
|
+
* is single-flight hand-off state, not a persisted record; a multi-instance deployment needs a shared
|
|
13
|
+
* backing (e.g. Postgres/Redis) before this feature is exposed there (see ADR 0111).
|
|
14
|
+
*/
|
|
15
|
+
export interface PendingGithubInstallationStore {
|
|
16
|
+
/**
|
|
17
|
+
* Record that the setup redirect landed for `state`, carrying the installationId GitHub reported.
|
|
18
|
+
* FIRST write wins: a state can land exactly once — replays or a race against the legitimate
|
|
19
|
+
* redirect cannot overwrite the recorded installation (hardening: the repo-confirm step and the
|
|
20
|
+
* repo-in-installation re-verification already blunt a swapped id; this closes the race outright).
|
|
21
|
+
*/
|
|
22
|
+
put(state: string, installationId: number): void;
|
|
23
|
+
/** The installationId stashed for `state`, or `undefined` if it hasn't landed yet (or has expired). */
|
|
24
|
+
get(state: string): number | undefined;
|
|
25
|
+
}
|
|
26
|
+
export declare class InMemoryPendingGithubInstallationStore implements PendingGithubInstallationStore {
|
|
27
|
+
#private;
|
|
28
|
+
put(state: string, installationId: number): void;
|
|
29
|
+
get(state: string): number | undefined;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=pending-installations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-installations.d.ts","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,uGAAuG;IACvG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,qBAAa,sCAAuC,YAAW,8BAA8B;;IAG3F,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;IAKhD,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CASvC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal in-memory hand-off for the CLI `noodle github connect` poll (GHD-1.4). GitHub's installation
|
|
3
|
+
* flow redirects the installer's BROWSER to the GitHub App's configured "Setup URL" once the install
|
|
4
|
+
* completes — a request the CLI process cannot receive directly (it has no public callback endpoint of
|
|
5
|
+
* its own). `GET /v1/github/setup` (`../routes/github-setup.ts`) IS that Setup URL: it lands the
|
|
6
|
+
* redirect, verifies the signed install-nonce `state` GitHub echoes back, and stashes the installationId
|
|
7
|
+
* here keyed by the raw state string. The CLI then polls `GET /v1/github/installations/pending?state=...`
|
|
8
|
+
* (same file) until the entry appears, then proceeds to `POST /v1/github/installations/claim`.
|
|
9
|
+
*
|
|
10
|
+
* Entries expire on the same 10-minute TTL as the nonce itself (`install-nonce.ts`) so a stale poll can
|
|
11
|
+
* never resurrect an old install correlation. Deliberately NOT the durable `GithubConnectionStore` — this
|
|
12
|
+
* is single-flight hand-off state, not a persisted record; a multi-instance deployment needs a shared
|
|
13
|
+
* backing (e.g. Postgres/Redis) before this feature is exposed there (see ADR 0111).
|
|
14
|
+
*/
|
|
15
|
+
const PENDING_TTL_MS = 10 * 60 * 1000;
|
|
16
|
+
export class InMemoryPendingGithubInstallationStore {
|
|
17
|
+
#entries = new Map();
|
|
18
|
+
put(state, installationId) {
|
|
19
|
+
if (this.#entries.has(state))
|
|
20
|
+
return; // first write wins — see the interface doc
|
|
21
|
+
this.#entries.set(state, { installationId, createdAt: Date.now() });
|
|
22
|
+
}
|
|
23
|
+
get(state) {
|
|
24
|
+
const entry = this.#entries.get(state);
|
|
25
|
+
if (entry === undefined)
|
|
26
|
+
return undefined;
|
|
27
|
+
if (Date.now() - entry.createdAt > PENDING_TTL_MS) {
|
|
28
|
+
this.#entries.delete(state);
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
return entry.installationId;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=pending-installations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-installations.js","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAmBtC,MAAM,OAAO,sCAAsC;IACxC,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEpD,GAAG,CAAC,KAAa,EAAE,cAAsB;QACvC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,2CAA2C;QACjF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,GAAG,CAAC,KAAa;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC1C,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,GAAG,cAAc,EAAE,CAAC;YAClD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5B,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -8,23 +8,29 @@ export { COMMERCIAL_PLAN_NAMES, type CommercialPlanCatalog, type CommercialPlanN
|
|
|
8
8
|
export { type CustomerVerifierFactoryOptions, createCustomerVerifierFactory, createFirebaseIdTokenVerifier, } from './customer-verifier.js';
|
|
9
9
|
export { ORG_DOMAIN_TXT_LABEL, type OrgDomainVerificationResult, type TxtResolver, verifyOrgDomainDns, } from './domain-verification.js';
|
|
10
10
|
export { type EnsureFreeTierDefaultOptions, ensureFreeTierDefault, FREE_TIER_PLAN, FREE_TIER_POLICY_ID, } from './free-tier.js';
|
|
11
|
+
export { type GitHubAppClient, type GithubAppConfig, type GithubInstallationRepository, type GithubInstallationSummary, InMemoryGitHubAppClient, } from './github/app-client.js';
|
|
12
|
+
export { type InstallNoncePayload, type InstallNonceVerification, resolveGithubStateSecret, signInstallNonce, verifyInstallNonce, } from './github/install-nonce.js';
|
|
13
|
+
export { InMemoryPendingGithubInstallationStore, type PendingGithubInstallationStore, } from './github/pending-installations.js';
|
|
11
14
|
export type { ServiceOptions } from './options.js';
|
|
12
15
|
export { createLocalPolicyAdmissionGate, type FixedWindowQuota, InMemoryPolicyAssignmentStore, LocalPolicyAdmissionGate, type PolicyAssignment, type PolicyAssignmentInput, type PolicyAssignmentStore, PolicyConflictError, type PolicyCounterStore, type PolicyDeleteInput, type PolicyDocument, type PolicyRate, type PolicyRule, type PolicyScope, type PolicyWindow, resolveEffectivePolicy, } from './policy.js';
|
|
13
16
|
export { CachingPolicyAssignmentStore, type PolicyCacheOptions, } from './policy-cache.js';
|
|
14
17
|
export { InMemoryPolicyCounterStore } from './policy-counters.js';
|
|
15
18
|
export { type DeployError, type DeployResult, type RecoverResult, type RollbackResult, ServerRegistry, } from './registry.js';
|
|
16
19
|
export { aggregateRequestEvents, type ClientMetrics, type MethodMetrics, type RequestMetrics, type SeriesBucket, type ToolMetrics, } from './request-event-metrics.js';
|
|
20
|
+
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
17
21
|
export { type GcpKmsConfig, gcpKmsMasterKeyProvider, type KmsClient, } from './secret/kms-master-key.js';
|
|
18
22
|
export { type RunningService, serveService } from './serve.js';
|
|
19
23
|
export { createServiceHandler } from './service.js';
|
|
20
24
|
export { capabilitiesForConfig, defineNoodleService, expandServiceProfile, type NoodleServiceConfig, type ObservabilityConfig, type ObservabilityLogFormat, type ObservabilityLogLevel, type ObservabilityLogSink, parseNoodleServiceYaml, resolveServiceConfigSource, type ServiceConfigSource, } from './service-config.js';
|
|
21
25
|
export { AUDIT_SCHEMA_VERSION, type AuditDecision, type AuditDetails, type AuditEvent, type AuditEventInput, type AuditFilter, type AuditSink, type AuditStore, InMemoryAuditStore, type InMemoryAuditStoreOptions, MultiSink, redactDetails, StdoutAuditSink, } from './store/audit.js';
|
|
22
26
|
export { InMemoryControlPlaneStore } from './store/control-plane.js';
|
|
27
|
+
export { InMemoryGithubConnectionStore } from './store/github-connections.js';
|
|
28
|
+
export { JsonFileGithubConnectionStore } from './store/github-connections-json-file.js';
|
|
23
29
|
export { PostgresArtifactStore, type PostgresStoreOptions } from './store/postgres.js';
|
|
24
30
|
export { ensureStateHandleSchema, PostgresStateHandleStore, type PostgresStateHandleStoreOptions, } from './store/postgres-state-handles.js';
|
|
25
31
|
export { RequestEventBuffer } from './store/request-event-buffer.js';
|
|
26
32
|
export { InMemoryRequestEventStore } from './store/request-events.js';
|
|
27
33
|
export { ensureRequestEventSchema, PostgresRequestEventStore, } from './store/request-events-postgres.js';
|
|
28
34
|
export { InMemoryUserAppLogStore, type InMemoryUserAppLogStoreOptions, type UserAppLogEvent, type UserAppLogFilter, type UserAppLogInput, type UserAppLogLevel, type UserAppLogSink, type UserAppLogStore, } from './store/user-app-logs.js';
|
|
29
|
-
export { type AppArchiveResult, type AppRestoreResult, type ArtifactStore, CONFIG_NAME_PATTERN, type ConfigScope, type ConfigStore, type ConfigValueMetadata, type ControlPlaneStore, DEPLOYMENT_ID_PATTERN, type DeploymentListFilter, type DeploymentSummary, type DeployRecord, DOMAIN_PATTERN, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, type ManagedConfigKind, type OrgDomainRecord, type OrgInvitationRecord, type OrgMemberRecord, type OrgRecord, type OrgRole, resolveConfigScope, type SecretEnvelope, type SignupAllowlistKind, type SignupAllowlistRecord, SLUG_PATTERN, scopeChain, type TenantAuthConfig, type TenantRef, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
35
|
+
export { type AppArchiveResult, type AppRestoreResult, type AppSummary, type ArtifactStore, CONFIG_NAME_PATTERN, type ConfigScope, type ConfigStore, type ConfigValueMetadata, type ControlPlaneStore, DEPLOYMENT_ID_PATTERN, type DeploymentListFilter, type DeploymentSummary, type DeployRecord, DOMAIN_PATTERN, type EnvSummary, type GithubConnectionStore, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, type ManagedConfigKind, type OrgDomainRecord, type OrgInvitationRecord, type OrgMemberRecord, type OrgRecord, type OrgRole, type RepoConnectionConflict, type RepoConnectionConflictReason, type RepoConnectionRecord, resolveConfigScope, type SecretEnvelope, type SignupAllowlistKind, type SignupAllowlistRecord, SLUG_PATTERN, scopeChain, type TenantAuthConfig, type TenantRef, type UpsertRepoConnectionInput, type UpsertRepoConnectionResult, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validatePositiveInteger, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
30
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EACL,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N_NAMES, commercialPlanPolicyId, DEFAULT_COMMERCIAL_PLAN_
|
|
|
8
8
|
export { createCustomerVerifierFactory, createFirebaseIdTokenVerifier, } from './customer-verifier.js';
|
|
9
9
|
export { ORG_DOMAIN_TXT_LABEL, verifyOrgDomainDns, } from './domain-verification.js';
|
|
10
10
|
export { ensureFreeTierDefault, FREE_TIER_PLAN, FREE_TIER_POLICY_ID, } from './free-tier.js';
|
|
11
|
+
export { InMemoryGitHubAppClient, } from './github/app-client.js';
|
|
12
|
+
export { resolveGithubStateSecret, signInstallNonce, verifyInstallNonce, } from './github/install-nonce.js';
|
|
13
|
+
export { InMemoryPendingGithubInstallationStore, } from './github/pending-installations.js';
|
|
11
14
|
export { createLocalPolicyAdmissionGate, InMemoryPolicyAssignmentStore, LocalPolicyAdmissionGate, PolicyConflictError, resolveEffectivePolicy, } from './policy.js';
|
|
12
15
|
export { CachingPolicyAssignmentStore, } from './policy-cache.js';
|
|
13
16
|
export { InMemoryPolicyCounterStore } from './policy-counters.js';
|
|
14
17
|
export { ServerRegistry, } from './registry.js';
|
|
15
18
|
export { aggregateRequestEvents, } from './request-event-metrics.js';
|
|
19
|
+
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
16
20
|
export { gcpKmsMasterKeyProvider, } from './secret/kms-master-key.js';
|
|
17
21
|
export { serveService } from './serve.js';
|
|
18
22
|
export { createServiceHandler } from './service.js';
|
|
19
23
|
export { capabilitiesForConfig, defineNoodleService, expandServiceProfile, parseNoodleServiceYaml, resolveServiceConfigSource, } from './service-config.js';
|
|
20
24
|
export { AUDIT_SCHEMA_VERSION, InMemoryAuditStore, MultiSink, redactDetails, StdoutAuditSink, } from './store/audit.js';
|
|
21
25
|
export { InMemoryControlPlaneStore } from './store/control-plane.js';
|
|
26
|
+
export { InMemoryGithubConnectionStore } from './store/github-connections.js';
|
|
27
|
+
export { JsonFileGithubConnectionStore } from './store/github-connections-json-file.js';
|
|
22
28
|
export { PostgresArtifactStore } from './store/postgres.js';
|
|
23
29
|
export { ensureStateHandleSchema, PostgresStateHandleStore, } from './store/postgres-state-handles.js';
|
|
24
30
|
export { RequestEventBuffer } from './store/request-event-buffer.js';
|
|
25
31
|
export { InMemoryRequestEventStore } from './store/request-events.js';
|
|
26
32
|
export { ensureRequestEventSchema, PostgresRequestEventStore, } from './store/request-events-postgres.js';
|
|
27
33
|
export { InMemoryUserAppLogStore, } from './store/user-app-logs.js';
|
|
28
|
-
export { CONFIG_NAME_PATTERN, DEPLOYMENT_ID_PATTERN, DOMAIN_PATTERN, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, resolveConfigScope, SLUG_PATTERN, scopeChain, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
34
|
+
export { CONFIG_NAME_PATTERN, DEPLOYMENT_ID_PATTERN, DOMAIN_PATTERN, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, resolveConfigScope, SLUG_PATTERN, scopeChain, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validatePositiveInteger, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
29
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EACL,yBAAyB,EACzB,cAAc,EAEd,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,gBAAgB,EAEhB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,O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,kBAAkB,EAElB,SAAS,EACT,aAAa,EACb,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,qBAAqB,CAAC;AACvF,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GAEzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EACL,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,uBAAuB,GAQxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAKL,mBAAmB,EAKnB,qBAAqB,EAIrB,cAAc,EAGd,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EAUrB,kBAAkB,EAIlB,YAAY,EACZ,UAAU,EAKV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,2BAA2B,EAC3B,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
@@ -6,11 +6,13 @@ import type { AssetStore } from './assets.js';
|
|
|
6
6
|
import type { ControlPlaneSignupMode, DeployAuthGate } from './auth/deploy-gate.js';
|
|
7
7
|
import type { BuildInfo } from './build-info.js';
|
|
8
8
|
import type { CommercialPlanCatalog } from './commercial-plans.js';
|
|
9
|
+
import type { GitHubAppClient, GithubAppConfig } from './github/app-client.js';
|
|
10
|
+
import type { PendingGithubInstallationStore } from './github/pending-installations.js';
|
|
9
11
|
import type { LoadedServiceModule } from './modules/host.js';
|
|
10
12
|
import type { PolicyAssignmentStore, PolicyCounterStore } from './policy.js';
|
|
11
13
|
import type { AuditSink } from './store/audit.js';
|
|
12
14
|
import type { UserAppLogStore } from './store/user-app-logs.js';
|
|
13
|
-
import type { ConfigStore, ControlPlaneStore } from './store.js';
|
|
15
|
+
import type { ConfigStore, ControlPlaneStore, GithubConnectionStore } from './store.js';
|
|
14
16
|
export interface ServiceOptions {
|
|
15
17
|
/** Public base URL used to build returned endpoint URLs. Defaults to the request's Host header. */
|
|
16
18
|
readonly publicBaseUrl?: string;
|
|
@@ -135,5 +137,30 @@ export interface ServiceOptions {
|
|
|
135
137
|
readonly deniedSignupSubjects?: readonly string[];
|
|
136
138
|
/** Boot-initialized service modules. Dynamic loading is owned by serveService, never request handlers. */
|
|
137
139
|
readonly loadedModules?: readonly LoadedServiceModule[];
|
|
140
|
+
/**
|
|
141
|
+
* GHD-1 repository-connection store (ADR 0111). Default: in-memory, useful for localhost tests only —
|
|
142
|
+
* `serveService` defaults to Postgres when persistence is enabled, else a `dataDir`-backed JSON-file
|
|
143
|
+
* store, else in-memory (mirrors `controlPlaneStore`/`configStore`).
|
|
144
|
+
*/
|
|
145
|
+
readonly githubConnectionStore?: GithubConnectionStore;
|
|
146
|
+
/**
|
|
147
|
+
* Non-secret Noodle Seed GitHub App identity (ADR 0111). Everything is optional — the whole GHD-1
|
|
148
|
+
* connection feature is off (install-url 409s) when absent. Long-lived credentials
|
|
149
|
+
* (`privateKeyPem`/`webhookSecret`) are read from the credential broker/secret manager by the caller,
|
|
150
|
+
* never stored in code, config files, or tests.
|
|
151
|
+
*/
|
|
152
|
+
readonly githubApp?: GithubAppConfig;
|
|
153
|
+
/**
|
|
154
|
+
* The GitHub App port (GHD-1): look up an installation and list its repositories. No live
|
|
155
|
+
* implementation ships in this slice — tests and local/dev use `InMemoryGitHubAppClient`; a JWT/
|
|
156
|
+
* installation-token-backed client is wired in a later slice once `githubApp`'s credentials are live.
|
|
157
|
+
*/
|
|
158
|
+
readonly githubAppClient?: GitHubAppClient;
|
|
159
|
+
/**
|
|
160
|
+
* GHD-1.4 CLI hand-off store: the installationId a landed GitHub App Setup URL redirect produced,
|
|
161
|
+
* keyed by the signed install-nonce `state`. In-memory single-flight state, not a durable record — see
|
|
162
|
+
* `github/pending-installations.ts`. Default: fresh in-memory store per `serveService` call.
|
|
163
|
+
*/
|
|
164
|
+
readonly pendingGithubInstallationStore?: PendingGithubInstallationStore;
|
|
138
165
|
}
|
|
139
166
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EACV,aAAa,EACb,MAAM,EACN,kBAAkB,EAClB,UAAU,EACX,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"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BAAqB,CAAC;IACvD;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,8BAA8B,CAAC,EAAE,8BAA8B,CAAC;CAC1E"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registry state operations that work over the {@link ServerRegistry}'s private maps: the no-store
|
|
3
|
-
* in-memory activation fallback and the app archive/restore/sweep cache reconciliation (ADR 0117).
|
|
4
|
-
* The registry passes a {@link RegistryStateView} of its private fields; store-backed calls hit the
|
|
5
|
-
* durable store first, then reconcile the in-process caches so no instance keeps serving stale state.
|
|
6
|
-
*/
|
|
7
1
|
import type { ServedTarget } from '@noodle-borg/transport-http';
|
|
8
|
-
import type { AppArchiveResult, AppRestoreResult, ArtifactStore, DeployRecord, TenantRef } from './store.js';
|
|
2
|
+
import type { AppArchiveResult, AppRestoreResult, AppSummary, ArtifactStore, DeploymentSummary, DeployRecord, EnvSummary, TenantRef } from './store.js';
|
|
9
3
|
export interface RegistryStateView {
|
|
10
4
|
readonly store: ArtifactStore | undefined;
|
|
11
5
|
readonly records: Map<string, DeployRecord>;
|
|
@@ -18,8 +12,35 @@ export declare function activateInMemory(records: Map<string, DeployRecord>, ref
|
|
|
18
12
|
readonly previousActive?: DeployRecord;
|
|
19
13
|
readonly alreadyActive: boolean;
|
|
20
14
|
} | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The active deploy record for a tenant, store-first then over the in-process cache (moved verbatim
|
|
17
|
+
* from `ServerRegistry.#activeRecord`). Store hits reconcile the caches so no instance serves stale
|
|
18
|
+
* state; the no-store path falls back to the newest matching record.
|
|
19
|
+
*/
|
|
20
|
+
export declare function activeRecord(state: RegistryStateView, ref: TenantRef): Promise<DeployRecord | undefined>;
|
|
21
|
+
/** {@link activeRecord} pinned to one server version (moved verbatim from `#activeRecordVersion`). */
|
|
22
|
+
export declare function activeRecordVersion(state: RegistryStateView, ref: TenantRef, serverVersion: string): Promise<DeployRecord | undefined>;
|
|
21
23
|
export declare function registryAppArchivedAt(state: RegistryStateView, org: string, app: string): Promise<string | undefined>;
|
|
22
24
|
export declare function registryArchiveApp(state: RegistryStateView, org: string, app: string, at: string): Promise<AppArchiveResult | undefined>;
|
|
23
25
|
export declare function registryRestoreApp(state: RegistryStateView, org: string, app: string): Promise<AppRestoreResult | undefined>;
|
|
24
26
|
export declare function registrySweepArchived(state: RegistryStateView, before: string): Promise<readonly DeployRecord[]>;
|
|
27
|
+
/** The `apps` resource, store-first with a no-store fallback over the registry's own record cache. */
|
|
28
|
+
export declare function registryListApps(state: RegistryStateView, org: string, opts: {
|
|
29
|
+
readonly includeArchived?: boolean;
|
|
30
|
+
readonly limit?: number;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
readonly apps: readonly AppSummary[];
|
|
33
|
+
readonly truncated: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function registryGetApp(state: RegistryStateView, org: string, app: string): Promise<AppSummary | undefined>;
|
|
36
|
+
/** The `envs` resource, store-first with a no-store fallback over the registry's own record cache. */
|
|
37
|
+
export declare function registryListEnvironments(state: RegistryStateView, org: string, app: string, opts: {
|
|
38
|
+
readonly includeArchived?: boolean;
|
|
39
|
+
}): Promise<readonly EnvSummary[]>;
|
|
40
|
+
export declare function registryGetEnvironment(state: RegistryStateView, org: string, app: string, env: string): Promise<EnvSummary | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* One deployment by id, scoped to `org`, store-first with a no-store fallback over the registry's own
|
|
43
|
+
* record cache. `undefined` both for an unknown id and for an id that belongs to a different org.
|
|
44
|
+
*/
|
|
45
|
+
export declare function registryGetDeployment(state: RegistryStateView, org: string, deploymentId: string): Promise<DeploymentSummary | undefined>;
|
|
25
46
|
//# sourceMappingURL=registry-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-state.d.ts","sourceRoot":"","sources":["../src/registry-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry-state.d.ts","sourceRoot":"","sources":["../src/registry-state.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAchE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,SAAS,EACV,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC5C,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAClC,GAAG,EAAE,SAAS,EACd,YAAY,EAAE,MAAM,GAElB;IACE,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC,GACD,SAAS,CAyBZ;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,SAAS,GACb,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAenC;AAED,sGAAsG;AACtG,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,SAAS,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,YAAY,GAAG,SA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