@sanoma-ai/connector-github 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,105 @@
1
+ # Functional Source License, Version 1.1, ALv2 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-ALv2
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Sanoma-AI
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,93 @@
1
- # Temporary Holding Version
1
+ # @sanoma-ai/connector-github
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ GitHub resources for [`@sanoma-ai/workflows`](https://www.npmjs.com/package/@sanoma-ai/workflows): repositories, branch protection rules and team memberships, read through the [`integrations/github`](https://github.com/integrations/terraform-provider-github) OpenTofu provider (6.13.0) on [provider-bridge](https://github.com/Sanoma-AI/provider-bridge). It reads only: there is no create, update or delete yet.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ npm install @sanoma-ai/connector-github
9
+ ```
10
+
11
+ Each resource type has two operations, both effect `read` and idempotent, with the import id as the policy's `target`:
12
+
13
+ | Type | Operations | Import id (identity) |
14
+ | ------------------- | ------------------------------------------------------------------ | ----------------------- |
15
+ | `repository` | `github.repository.read`, `github.repository.import` | `name` |
16
+ | `branch_protection` | `github.branch_protection.read`, `github.branch_protection.import` | `repository_id:pattern` |
17
+ | `team_membership` | `github.team_membership.read`, `github.team_membership.import` | `team_id:username` |
18
+
19
+ `import` takes `{ id }` and returns the object's `state`; `read` takes a state an earlier call returned (`{ id, state, handle }`), or just `{ id }`, and returns its fresh `state`, or `gone: true` when it no longer exists. See [Resources](https://github.com/Sanoma-AI/sanoma/blob/main/packages/workflows/README.md#resources).
20
+
21
+ A data file declares resources with the constructors in `@sanoma-ai/connector-github/resources`:
22
+
23
+ ```ts
24
+ import { github } from "@sanoma-ai/connector-github/resources";
25
+
26
+ export const site = github.repository({ name: "website", delete_branch_on_merge: true, has_wiki: false });
27
+ export const siteMain = github.branch_protection({ repository_id: site, pattern: "main", enforce_admins: true });
28
+ ```
29
+
30
+ A branch protection rule names its repository by the declared repository itself (`repository_id: site`), which stands for its name: the rule is `website:main`. Only `repository_id` takes a resource, and only a repository; see [Data files](https://github.com/Sanoma-AI/sanoma/blob/main/packages/workflows/README.md#data-files).
31
+
32
+ The fields are the provider's attributes, by their names. A list block of at most one item (`pages`, `security_and_analysis`, `template`) is one object. Only declared fields are compared for drift; sets (`topics`, and five lists in a branch protection rule) are compared in any order.
33
+
34
+ The logo is GitHub's mark from [Octicons](https://primer.style/octicons/) (`mark-github`, MIT), there only to identify the service an operation calls.
35
+
36
+ ## Resource types
37
+
38
+ `src/resources.gen.ts` is generated from the provider's schema by `pnpm generate`, which runs [`@sanoma-ai/bridge/tfschema`](https://github.com/Sanoma-AI/sanoma/blob/main/packages/bridge/src/tfschema/AGENTS.md) with `src/resources.config.ts`: the provider (its release, sha256 and recorded schema are `@sanoma-ai/bridge`'s pin and fixture), the types to generate, and the attributes whose change replaces the object (ForceNew in the provider's source, which the schema does not carry). It is checked in and never edited by hand; `pnpm generate` on a clean tree changes nothing. `src/connector.ts` is the rest, one `tfConnector` record from [`@sanoma-ai/bridge/connector`](https://github.com/Sanoma-AI/sanoma/blob/main/packages/bridge/README.md#connectors-for-opentofu-providers): each type's title, identity and `find`, the field that names another resource (`branch_protection.repository_id`), and GitHub's title, logo and package. The connector, the constructors, the driver and the fake all derive from it.
39
+
40
+ Attributes that are computed and not optional (`html_url`, `repo_id`) are vendor-owned: never drift, and a data file may not declare them. Those the provider marks computed and optional (`etag`, `topics`, `visibility`, `default_branch`) are yours to set, and compared only when declared.
41
+
42
+ ## Driver
43
+
44
+ `@sanoma-ai/connector-github/driver` reads through a provider bridge. The `github` connector the package root exports carries it, made once per resolved config, and its fake (`withSetup` from `@sanoma-ai/workflows`), so a config names the connector alone and workflows never import the driver (the lint refuses that):
45
+
46
+ ```ts
47
+ import { github } from "@sanoma-ai/connector-github";
48
+
49
+ export default defineConfig({ workflows, connectors: [github], policy });
50
+ ```
51
+
52
+ `./driver` (`githubDriver`; `githubDriver({ bridge })` reads through a bridge of your own) and `./fake` (`fakeGithub`) are internal entries, for tests.
53
+
54
+ Without `bridge`, it reads through the process's `defaultBridge()` from `@sanoma-ai/bridge`, started on the first call from `SANOMA_BRIDGE_BIN`; `bridge` is any `ProviderClient` (a `Bridge` from `startBridge()`, or `stateBridge` in tests). It configures the provider on the first call with `{ owner, token }` from the environment, and again when either changes (closing it first: the bridge refuses a second config), when the provider has exited, or when the bridge has forgotten it (`ensureConfigured`). `read` without a state (or with one that has no `id`) imports, which reads the object too. States leave the driver in the resource's shape, with sensitive attributes set to `null`; the provider's private data and state version travel in the opaque `handle`.
55
+
56
+ ### Environment
57
+
58
+ Read on every call, never when the config loads:
59
+
60
+ | Variable | What it is |
61
+ | -------------- | ------------------------------------------------------------------------------------------------------------- |
62
+ | `GITHUB_TOKEN` | A GitHub token that can read the repositories, rules and teams named. |
63
+ | `GITHUB_OWNER` | Optional: the organization or user whose repositories the data files describe. Default: the token's own user. |
64
+
65
+ When the token is unset, a call fails, not retryable, naming it; the worker starts regardless, and the app's connector page shows and sets both. The bridge passes the token and the owner to the provider through its config only, never through the provider's environment. The default bridge's binary is the process's to set (`SANOMA_BRIDGE_BIN`, see [the bridge](https://www.npmjs.com/package/@sanoma-ai/bridge#environment)), not a credential of the connector.
66
+
67
+ ### Errors and retries
68
+
69
+ The bridge's errors become `DriverError`s whose `vendorCode` is the bridge's code and whose message carries the provider's diagnostics. `unavailable` (the provider process failed or exited) is retryable, and the next try configures the provider again; anything else is not. GitHub's provider reports an object that does not exist as a failed import (`failed_precondition`, "could not find a branch protection rule with the pattern 'main'"), not as `not_found`; the connector's `missing` says so, so `import` answers `{ gone: true }` for it, as for `not_found`.
70
+
71
+ ## Testing
72
+
73
+ `@sanoma-ai/connector-github/fake` is GitHub as it was when the replies in `@sanoma-ai/bridge`'s `testdata/replies` were recorded (the `Sanoma-AI/sanoma` and `Sanoma-AI/provider-bridge` repositories; `provider-bridge:main` has no branch protection), served through the real driver over a `stateBridge` of them (`tfFake`). It needs no token and reaches nothing.
74
+
75
+ ```ts
76
+ import { withSetup } from "@sanoma-ai/workflows";
77
+ import { github } from "@sanoma-ai/connector-github";
78
+ import { fakeGithub } from "@sanoma-ai/connector-github/fake";
79
+
80
+ const fake = fakeGithub();
81
+ const worker = await startWorker({
82
+ connectors: [withSetup(github, { driver: () => fake.driver, fake: () => fake })],
83
+ /* ... */
84
+ });
85
+
86
+ fake.put("repository", "website", { name: "website", has_wiki: false }, { from: "sanoma" }); // a copy of a recorded one
87
+ fake.override("repository", "sanoma", { delete_branch_on_merge: true }); // drift: the next read returns it
88
+ fake.remove("repository", "sanoma"); // the next read and import say it is gone
89
+ ```
90
+
91
+ `put` and `override` take fields in the resource's shape, as a read returns them (a block of one is an object). `remove` answers an import as the provider does: a branch protection rule with the provider's `failed_precondition` diagnostic, anything else `not_found`. It has the faults every fake has (`failNext`, `loseReply`, `rateLimit`, `hold`, `reset`, `update`); see [Fakes for tests](https://github.com/Sanoma-AI/sanoma/blob/main/packages/workflows/README.md#fakes-for-tests). Import it from `@sanoma-ai/connector-github/fake`.
92
+
93
+ License: FSL-1.1-ALv2.
@@ -0,0 +1,136 @@
1
+ /**
2
+ * GitHub, through the `integrations/github` OpenTofu provider: the generated resource types,
3
+ * what their schema does not say (how each is found), and who GitHub is. The connector, the
4
+ * data-file constructors, the driver and the fake all come from this one record.
5
+ */
6
+ export declare const githubTf: import("@sanoma-ai/bridge/connector").TfConnector<"github", {
7
+ repository: import("zod").ZodObject<{
8
+ allow_auto_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
9
+ allow_forking: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
10
+ allow_merge_commit: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
11
+ allow_rebase_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
12
+ allow_squash_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
13
+ allow_update_branch: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
14
+ archive_on_destroy: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
15
+ archived: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
16
+ auto_init: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
17
+ default_branch: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
18
+ delete_branch_on_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
19
+ description: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
20
+ etag: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
21
+ fork: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
22
+ full_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
23
+ git_clone_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
24
+ gitignore_template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
25
+ has_discussions: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
26
+ has_downloads: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
27
+ has_issues: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
28
+ has_projects: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
29
+ has_wiki: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
30
+ homepage_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
31
+ html_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
32
+ http_clone_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
33
+ id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
34
+ ignore_vulnerability_alerts_during_read: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
35
+ is_template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
36
+ license_template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
37
+ merge_commit_message: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
38
+ merge_commit_title: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
39
+ name: import("zod").ZodString;
40
+ node_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
41
+ primary_language: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
42
+ private: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
43
+ repo_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
44
+ source_owner: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
45
+ source_repo: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
46
+ squash_merge_commit_message: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
47
+ squash_merge_commit_title: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
48
+ ssh_clone_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
49
+ svn_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
50
+ topics: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
51
+ visibility: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
52
+ vulnerability_alerts: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
53
+ web_commit_signoff_required: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
54
+ pages: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
55
+ build_type: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
56
+ cname: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
57
+ custom_404: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
58
+ html_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
59
+ status: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
60
+ url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
61
+ source: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
62
+ branch: import("zod").ZodString;
63
+ path: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
64
+ }, import("zod/v4/core").$strip>>>;
65
+ }, import("zod/v4/core").$strip>>>;
66
+ security_and_analysis: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
67
+ advanced_security: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
68
+ status: import("zod").ZodString;
69
+ }, import("zod/v4/core").$strip>>>;
70
+ code_security: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
71
+ status: import("zod").ZodString;
72
+ }, import("zod/v4/core").$strip>>>;
73
+ secret_scanning: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
74
+ status: import("zod").ZodString;
75
+ }, import("zod/v4/core").$strip>>>;
76
+ secret_scanning_ai_detection: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
77
+ status: import("zod").ZodString;
78
+ }, import("zod/v4/core").$strip>>>;
79
+ secret_scanning_non_provider_patterns: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
80
+ status: import("zod").ZodString;
81
+ }, import("zod/v4/core").$strip>>>;
82
+ secret_scanning_push_protection: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
83
+ status: import("zod").ZodString;
84
+ }, import("zod/v4/core").$strip>>>;
85
+ }, import("zod/v4/core").$strip>>>;
86
+ template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
87
+ include_all_branches: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
88
+ owner: import("zod").ZodString;
89
+ repository: import("zod").ZodString;
90
+ }, import("zod/v4/core").$strip>>>;
91
+ }, import("zod/v4/core").$strip>;
92
+ branch_protection: import("zod").ZodObject<{
93
+ allows_deletions: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
94
+ allows_force_pushes: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
95
+ enforce_admins: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
96
+ force_push_bypassers: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
97
+ id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
98
+ lock_branch: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
99
+ pattern: import("zod").ZodString;
100
+ repository_id: import("zod").ZodString;
101
+ require_conversation_resolution: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
102
+ require_signed_commits: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
103
+ required_linear_history: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
104
+ required_pull_request_reviews: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
105
+ dismiss_stale_reviews: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
106
+ dismissal_restrictions: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
107
+ pull_request_bypassers: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
108
+ require_code_owner_reviews: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
109
+ require_last_push_approval: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
110
+ required_approving_review_count: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
111
+ restrict_dismissals: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
112
+ }, import("zod/v4/core").$strip>>>>;
113
+ required_status_checks: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
114
+ contexts: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
115
+ strict: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
116
+ }, import("zod/v4/core").$strip>>>>;
117
+ restrict_pushes: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
118
+ blocks_creations: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
119
+ push_allowances: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
120
+ }, import("zod/v4/core").$strip>>>>;
121
+ }, import("zod/v4/core").$strip>;
122
+ team_membership: import("zod").ZodObject<{
123
+ etag: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
124
+ id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
125
+ role: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
126
+ team_id: import("zod").ZodString;
127
+ username: import("zod").ZodString;
128
+ }, import("zod/v4/core").$strip>;
129
+ }, {
130
+ readonly branch_protection: {
131
+ readonly repository_id: {
132
+ readonly type: "github.repository";
133
+ readonly by: readonly ["name", "node_id"];
134
+ };
135
+ };
136
+ }>;
@@ -0,0 +1,44 @@
1
+ import { tfConnector } from "@sanoma-ai/bridge/connector";
2
+ import { github_branch_protection, github_repository, github_team_membership, provider } from "./resources.gen.js";
3
+ /**
4
+ * GitHub's mark (the Invertocat), from GitHub's Octicons (`mark-github`, MIT), in GitHub's
5
+ * near-black, and white on dark backgrounds.
6
+ */
7
+ const mark = (fill) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="${fill}" d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"/></svg>`;
8
+ /**
9
+ * GitHub, through the `integrations/github` OpenTofu provider: the generated resource types,
10
+ * what their schema does not say (how each is found), and who GitHub is. The connector, the
11
+ * data-file constructors, the driver and the fake all come from this one record.
12
+ */
13
+ export const githubTf = tfConnector({
14
+ vendor: "github",
15
+ provider,
16
+ types: {
17
+ repository: { tf: github_repository, title: "Repository", identity: "name", find: ({ name }) => name },
18
+ branch_protection: {
19
+ tf: github_branch_protection,
20
+ title: "Branch protection rule",
21
+ identity: "repository_id:pattern",
22
+ find: ({ repository_id, pattern }) => `${repository_id}:${pattern}`,
23
+ },
24
+ team_membership: {
25
+ tf: github_team_membership,
26
+ title: "Team membership",
27
+ identity: "team_id:username",
28
+ find: ({ team_id, username }) => `${team_id}:${username}`,
29
+ },
30
+ },
31
+ // GitHub holds a rule's repository by its node id (`R_…`); a data file names it by its name.
32
+ references: { branch_protection: { repository_id: { type: "github.repository", by: ["name", "node_id"] } } },
33
+ // The provider answers an import of a rule that is not there `failed_precondition`, saying it
34
+ // "could not find" it (recorded: testdata/replies/…/github_branch_protection/provider-bridge_main).
35
+ missing: (e) => e.code === "not_found" ||
36
+ (e.code === "failed_precondition" && e.diagnostics.some((d) => d.summary.startsWith("could not find "))),
37
+ info: {
38
+ title: "GitHub",
39
+ logo: { svg: mark("#1F2328"), dark: mark("#FFFFFF") },
40
+ package: "@sanoma-ai/connector-github",
41
+ homepage: "https://github.com/Sanoma-AI/sanoma/tree/main/connectors/github#readme",
42
+ },
43
+ });
44
+ //# sourceMappingURL=connector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnH;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAC5B,2EAA2E,IAAI,2kBAA2kB,CAAC;AAE7pB;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC;IAClC,MAAM,EAAE,QAAQ;IAChB,QAAQ;IACR,KAAK,EAAE;QACL,UAAU,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE;QACtG,iBAAiB,EAAE;YACjB,EAAE,EAAE,wBAAwB;YAC5B,KAAK,EAAE,wBAAwB;YAC/B,QAAQ,EAAE,uBAAuB;YACjC,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,aAAa,IAAI,OAAO,EAAE;SACpE;QACD,eAAe,EAAE;YACf,EAAE,EAAE,sBAAsB;YAC1B,KAAK,EAAE,iBAAiB;YACxB,QAAQ,EAAE,kBAAkB;YAC5B,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,QAAQ,EAAE;SAC1D;KACF;IACD,6FAA6F;IAC7F,UAAU,EAAE,EAAE,iBAAiB,EAAE,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE;IAC5G,8FAA8F;IAC9F,oGAAoG;IACpG,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,IAAI,KAAK,WAAW;QACtB,CAAC,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC1G,IAAI,EAAE;QACJ,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE;QACrD,OAAO,EAAE,6BAA6B;QACtC,QAAQ,EAAE,wEAAwE;KACnF;CACF,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type ProviderClient } from "@sanoma-ai/bridge";
2
+ import { z } from "zod";
3
+ export interface GithubDriverOptions {
4
+ /**
5
+ * The provider bridge to read through. Default: the process's `defaultBridge()`, started on the
6
+ * first call from `SANOMA_BRIDGE_BIN`. One per tenant: it holds the token once configured.
7
+ */
8
+ bridge?: ProviderClient;
9
+ }
10
+ /**
11
+ * Reads GitHub resources through the `integrations/github` OpenTofu provider on `bridge` (the
12
+ * default bridge when none is given), with the token in `GITHUB_TOKEN` and the owner in
13
+ * `GITHUB_OWNER`, read on every call. The provider is configured on the first call, and again
14
+ * when the token or the owner changes or the provider has exited.
15
+ */
16
+ export declare function githubDriver({ bridge }?: GithubDriverOptions): Readonly<{
17
+ vendor: string;
18
+ ops: Readonly<Record<string, import("@sanoma-ai/workflows").DriverFn>>;
19
+ env: z.ZodObject<{
20
+ GITHUB_TOKEN: z.ZodString;
21
+ GITHUB_OWNER: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ }>;
package/dist/driver.js ADDED
@@ -0,0 +1,32 @@
1
+ import { defaultBridge } from "@sanoma-ai/bridge";
2
+ import { DriverError } from "@sanoma-ai/workflows";
3
+ import { z } from "zod";
4
+ import { githubTf } from "./connector.js";
5
+ /** The environment variables the driver reads, on every call. */
6
+ const env = z.object({
7
+ GITHUB_TOKEN: z
8
+ .string()
9
+ .min(1)
10
+ .describe("a fine-grained token with read-only repository permissions, limited to the repositories the data files declare"),
11
+ GITHUB_OWNER: z
12
+ .string()
13
+ .min(1)
14
+ .optional()
15
+ .describe("the organization or user whose repositories the data files describe; default: the token's own user"),
16
+ });
17
+ /**
18
+ * Reads GitHub resources through the `integrations/github` OpenTofu provider on `bridge` (the
19
+ * default bridge when none is given), with the token in `GITHUB_TOKEN` and the owner in
20
+ * `GITHUB_OWNER`, read on every call. The provider is configured on the first call, and again
21
+ * when the token or the owner changes or the provider has exited.
22
+ */
23
+ export function githubDriver({ bridge = defaultBridge() } = {}) {
24
+ const driver = githubTf.driver(bridge, () => {
25
+ const token = process.env.GITHUB_TOKEN;
26
+ if (!token)
27
+ throw new DriverError("github: GITHUB_TOKEN is not set", { retryable: false });
28
+ return { owner: process.env.GITHUB_OWNER || null, token };
29
+ });
30
+ return Object.freeze({ ...driver, env });
31
+ }
32
+ //# sourceMappingURL=driver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.js","sourceRoot":"","sources":["../src/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAU1C,iEAAiE;AACjE,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,gHAAgH,CACjH;IACH,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,oGAAoG,CAAC;CAClH,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,EAAE,GAAwB,EAAE;IACjF,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QACvC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,WAAW,CAAC,iCAAiC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3F,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC"}
package/dist/fake.d.ts ADDED
@@ -0,0 +1,138 @@
1
+ import { type TfFakeOptions, type TfFakeState } from "@sanoma-ai/bridge/fake";
2
+ export type FakeGithubState = TfFakeState;
3
+ export type FakeGithubOptions = TfFakeOptions;
4
+ /**
5
+ * A GitHub that answers as the provider did when its replies were recorded (`@sanoma-ai/bridge`'s
6
+ * `testdata/replies`), through the real driver over a bridge of those replies: `import` and
7
+ * `read` return the recorded repositories (`Sanoma-AI/sanoma`, `Sanoma-AI/provider-bridge`), and
8
+ * `branch_protection` on `provider-bridge:main` fails as it did (the branch is unprotected).
9
+ * Nothing reaches GitHub, and no token is read.
10
+ *
11
+ * `put` makes an object, `override` changes what the next read returns, as if someone edited
12
+ * the object at GitHub, and `remove` deletes it, so the next read says it is gone and an import
13
+ * answers as the provider does.
14
+ */
15
+ export declare const fakeGithub: (options?: FakeGithubOptions) => import("@sanoma-ai/bridge/fake").TfFake<"github", {
16
+ repository: import("zod").ZodObject<{
17
+ allow_auto_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
18
+ allow_forking: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
19
+ allow_merge_commit: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
20
+ allow_rebase_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
21
+ allow_squash_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
22
+ allow_update_branch: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
23
+ archive_on_destroy: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
24
+ archived: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
25
+ auto_init: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
26
+ default_branch: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
27
+ delete_branch_on_merge: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
28
+ description: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
29
+ etag: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
30
+ fork: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
31
+ full_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
32
+ git_clone_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
33
+ gitignore_template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
34
+ has_discussions: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
35
+ has_downloads: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
36
+ has_issues: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
37
+ has_projects: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
38
+ has_wiki: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
39
+ homepage_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
40
+ html_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
41
+ http_clone_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
42
+ id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
43
+ ignore_vulnerability_alerts_during_read: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
44
+ is_template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
45
+ license_template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
46
+ merge_commit_message: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
47
+ merge_commit_title: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
48
+ name: import("zod").ZodString;
49
+ node_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
50
+ primary_language: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
51
+ private: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
52
+ repo_id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
53
+ source_owner: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
54
+ source_repo: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
55
+ squash_merge_commit_message: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
56
+ squash_merge_commit_title: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
57
+ ssh_clone_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
58
+ svn_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
59
+ topics: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
60
+ visibility: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
61
+ vulnerability_alerts: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
62
+ web_commit_signoff_required: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
63
+ pages: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
64
+ build_type: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
65
+ cname: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
66
+ custom_404: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
67
+ html_url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
68
+ status: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
69
+ url: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
70
+ source: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
71
+ branch: import("zod").ZodString;
72
+ path: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
73
+ }, import("zod/v4/core").$strip>>>;
74
+ }, import("zod/v4/core").$strip>>>;
75
+ security_and_analysis: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
76
+ advanced_security: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
77
+ status: import("zod").ZodString;
78
+ }, import("zod/v4/core").$strip>>>;
79
+ code_security: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
80
+ status: import("zod").ZodString;
81
+ }, import("zod/v4/core").$strip>>>;
82
+ secret_scanning: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
83
+ status: import("zod").ZodString;
84
+ }, import("zod/v4/core").$strip>>>;
85
+ secret_scanning_ai_detection: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
86
+ status: import("zod").ZodString;
87
+ }, import("zod/v4/core").$strip>>>;
88
+ secret_scanning_non_provider_patterns: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
89
+ status: import("zod").ZodString;
90
+ }, import("zod/v4/core").$strip>>>;
91
+ secret_scanning_push_protection: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
92
+ status: import("zod").ZodString;
93
+ }, import("zod/v4/core").$strip>>>;
94
+ }, import("zod/v4/core").$strip>>>;
95
+ template: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
96
+ include_all_branches: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
97
+ owner: import("zod").ZodString;
98
+ repository: import("zod").ZodString;
99
+ }, import("zod/v4/core").$strip>>>;
100
+ }, import("zod/v4/core").$strip>;
101
+ branch_protection: import("zod").ZodObject<{
102
+ allows_deletions: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
103
+ allows_force_pushes: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
104
+ enforce_admins: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
105
+ force_push_bypassers: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
106
+ id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
107
+ lock_branch: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
108
+ pattern: import("zod").ZodString;
109
+ repository_id: import("zod").ZodString;
110
+ require_conversation_resolution: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
111
+ require_signed_commits: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
112
+ required_linear_history: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
113
+ required_pull_request_reviews: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
114
+ dismiss_stale_reviews: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
115
+ dismissal_restrictions: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
116
+ pull_request_bypassers: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
117
+ require_code_owner_reviews: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
118
+ require_last_push_approval: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
119
+ required_approving_review_count: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
120
+ restrict_dismissals: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
121
+ }, import("zod/v4/core").$strip>>>>;
122
+ required_status_checks: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
123
+ contexts: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
124
+ strict: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
125
+ }, import("zod/v4/core").$strip>>>>;
126
+ restrict_pushes: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
127
+ blocks_creations: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
128
+ push_allowances: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodString>>>;
129
+ }, import("zod/v4/core").$strip>>>>;
130
+ }, import("zod/v4/core").$strip>;
131
+ team_membership: import("zod").ZodObject<{
132
+ etag: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
133
+ id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
134
+ role: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
135
+ team_id: import("zod").ZodString;
136
+ username: import("zod").ZodString;
137
+ }, import("zod/v4/core").$strip>;
138
+ }>;