@treeseed/sdk 0.13.0-rc.91 → 0.13.0-rc.92
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/.treeseed-build-complete.json +1 -1
- package/dist/capacity-provider/index.d.ts +1 -0
- package/dist/capacity-provider/index.js +1 -0
- package/dist/capacity-provider/install-configuration.d.ts +39 -0
- package/dist/capacity-provider/install-configuration.js +18 -0
- package/dist/configuration/secrets-capability.d.ts +3 -0
- package/dist/configuration/secrets-capability.js +3 -0
- package/dist/content/validation/agent-operational-content-schemas.d.ts +12 -12
- package/dist/content/validation/content-model-schemas.d.ts +13 -13
- package/dist/content/validation/portable-content-data.d.ts +1 -1
- package/dist/deployment/ai-hosting.d.ts +297 -0
- package/dist/deployment/ai-hosting.js +63 -0
- package/dist/deployment/ai-instance.d.ts +48 -0
- package/dist/deployment/ai-instance.js +23 -0
- package/dist/deployment/index.d.ts +2 -0
- package/dist/deployment/index.js +2 -0
- package/dist/operator-contracts/canonical-command-tree.js +3 -10
- package/dist/operator-contracts/catalog/communication-operations.d.ts +2 -2
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +29 -0
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +18 -0
- package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.d.ts +3 -0
- package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.js +15 -0
- package/dist/operator-contracts/communication/contracts.d.ts +18 -18
- package/dist/operator-contracts/control-plane-operations.d.ts +31 -2
- package/dist/operator-contracts/control-plane-operations.js +3 -17
- package/dist/operator-contracts/operation-builder.d.ts +1 -0
- package/dist/operator-contracts/operation-builder.js +17 -0
- package/dist/secrets-capability/github-actions-encryption.js +1 -1
- package/dist/secrets-capability/provider-operation-contracts.d.ts +14 -0
- package/dist/secrets-capability/service-provider-contracts.d.ts +4 -2
- package/dist/secrets-capability/service-provider-contracts.js +41 -27
- package/dist/secrets-capability/shared-access.d.ts +51 -0
- package/dist/secrets-capability/shared-access.js +36 -0
- package/dist/secrets-capability/shared-resources.d.ts +376 -0
- package/dist/secrets-capability/shared-resources.js +91 -0
- package/dist/secrets-capability/vault-contracts.d.ts +132 -0
- package/dist/secrets-capability/vault-contracts.js +56 -0
- package/package.json +1 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
const SERVICE_PROVIDER_IDS = ["github", "cloudflare", "railway"];
|
|
1
|
+
const SERVICE_PROVIDER_IDS = ["github", "cloudflare", "railway", "hyperstack"];
|
|
2
2
|
const SERVICE_CAPABILITY_TYPES = [
|
|
3
3
|
"repository-hosting",
|
|
4
4
|
"workflow-execution",
|
|
5
|
-
"workflow-configuration",
|
|
6
|
-
"secret-enclave",
|
|
7
5
|
"frontend-hosting",
|
|
8
6
|
"backend-hosting",
|
|
9
7
|
"dns-management",
|
|
@@ -12,7 +10,9 @@ const SERVICE_CAPABILITY_TYPES = [
|
|
|
12
10
|
"database-hosting",
|
|
13
11
|
"capacity-runtime-hosting",
|
|
14
12
|
"private-knowledge-index-hosting",
|
|
15
|
-
"artifact-hosting"
|
|
13
|
+
"artifact-hosting",
|
|
14
|
+
"ai-inference-hosting",
|
|
15
|
+
"ai-training-hosting"
|
|
16
16
|
];
|
|
17
17
|
const SERVICE_CONNECTION_STATUSES = [
|
|
18
18
|
"draft",
|
|
@@ -49,9 +49,7 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
49
49
|
],
|
|
50
50
|
capabilities: [
|
|
51
51
|
{ type: "repository-hosting", label: "Repository hosting", description: "Own source and knowledge repositories.", credentialProfileIds: ["github-repository-app", "github-repository-token"], status: "available" },
|
|
52
|
-
{ type: "workflow-execution", label: "
|
|
53
|
-
{ type: "workflow-configuration", label: "Workflow configuration", description: "Manage the scoped variables required by allowlisted workflows.", credentialProfileIds: ["github-workflow-app", "github-workflow-token"], status: "available" },
|
|
54
|
-
{ type: "secret-enclave", label: "Actions secret enclave", description: "Write GitHub-encrypted values to Actions without making them readable by TreeSeed.", credentialProfileIds: ["github-workflow-app", "github-workflow-token"], status: "available" }
|
|
52
|
+
{ type: "workflow-execution", label: "Run workflows", description: "Run project workflows and supply their declared configuration securely. Vault credentials remain authoritative; provider secrets are delivery destinations.", credentialProfileIds: ["github-workflow-app", "github-workflow-token"], status: "available" }
|
|
55
53
|
],
|
|
56
54
|
credentialProfiles: [
|
|
57
55
|
{
|
|
@@ -81,10 +79,10 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
81
79
|
{
|
|
82
80
|
id: "github-workflow-app",
|
|
83
81
|
label: "Workflow Connector App",
|
|
84
|
-
description: "Installation authority for
|
|
85
|
-
capabilities: ["workflow-execution"
|
|
82
|
+
description: "Installation authority for workflow execution and explicitly declared configuration delivery.",
|
|
83
|
+
capabilities: ["workflow-execution"],
|
|
86
84
|
fields: [],
|
|
87
|
-
permissions: ["Metadata: read", "Contents: read", "Actions: read and write", "
|
|
85
|
+
permissions: ["Metadata: read", "Contents: read", "Actions: read and write", "Only when declared: Secrets write and/or Variables write"],
|
|
88
86
|
sharing: "capability-scoped",
|
|
89
87
|
unattendedCompatible: true,
|
|
90
88
|
authoritySchemes: ["app-installation"],
|
|
@@ -93,10 +91,10 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
93
91
|
{
|
|
94
92
|
id: "github-workflow-token",
|
|
95
93
|
label: "Workflow token authority",
|
|
96
|
-
description: "Fine-grained token authority for
|
|
97
|
-
capabilities: ["workflow-execution"
|
|
94
|
+
description: "Fine-grained token authority for workflow execution and explicitly declared configuration delivery.",
|
|
95
|
+
capabilities: ["workflow-execution"],
|
|
98
96
|
fields: [field("accessToken", "Fine-grained token", "Stored in core OpenBao; used only by authorized operations.", true, true)],
|
|
99
|
-
permissions: ["Metadata: read", "Contents: read", "Actions: read and write", "
|
|
97
|
+
permissions: ["Metadata: read", "Contents: read", "Actions: read and write", "Only when declared: Secrets write and/or Variables write"],
|
|
100
98
|
sharing: "capability-scoped",
|
|
101
99
|
unattendedCompatible: true,
|
|
102
100
|
authoritySchemes: ["openbao"],
|
|
@@ -112,26 +110,18 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
112
110
|
description: "Connect a Cloudflare account with separately scoped capability tokens.",
|
|
113
111
|
knowledgePageIds: ["provider.cloudflare"],
|
|
114
112
|
connectionFields: [
|
|
115
|
-
field("deploymentEnvironment", "Deployment environment", "The exact TreeSeed deployment environment. Use staging or production; one connection must never span both."),
|
|
116
113
|
field("accountId", "Account ID", "The non-secret Cloudflare account identifier."),
|
|
117
|
-
field("
|
|
118
|
-
field("stateBucket", "OpenTofu state bucket", "Optional R2 bucket name used only by a state-backend connection.", false),
|
|
119
|
-
field("stateEndpoint", "OpenTofu state endpoint", "Optional HTTPS S3-compatible R2 endpoint used only by a state-backend connection.", false),
|
|
120
|
-
field("stateRegion", "OpenTofu state region", "Optional S3-compatible region; omit to use auto.", false),
|
|
121
|
-
field("stateEncryptionKeyRef", "State encryption key reference", "Optional non-secret team-vault key name used to encrypt this backend state.", false)
|
|
114
|
+
{ ...field("domain", "Domain", "Enter the domain listed in Cloudflare (for example, example.com), without https:// or a path. TreeSeed verifies its zone when you check the DNS account access.", false), requiredForCapabilities: ["dns-management"], placeholder: "example.com", pattern: "(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z](?:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?" }
|
|
122
115
|
],
|
|
123
116
|
capabilities: [
|
|
124
117
|
{ type: "frontend-hosting", label: "Frontend hosting", description: "Pages and Workers application hosting.", credentialProfileIds: ["cloudflare-runtime"], status: "available" },
|
|
125
118
|
{ type: "dns-management", label: "DNS management", description: "Scoped DNS record management.", credentialProfileIds: ["cloudflare-dns"], status: "available" },
|
|
126
|
-
{ type: "object-storage", label: "Object storage", description: "R2-backed immutable publication
|
|
127
|
-
{ type: "state-encryption", label: "State encryption", description: "Independent encryption authority for OpenTofu state and plan files.", credentialProfileIds: ["opentofu-state-encryption"], status: "available" }
|
|
119
|
+
{ type: "object-storage", label: "Object storage", description: "R2-backed immutable publication and private artifact storage.", credentialProfileIds: ["cloudflare-storage"], status: "available" }
|
|
128
120
|
],
|
|
129
121
|
credentialProfiles: [
|
|
130
122
|
{ id: "cloudflare-runtime", label: "Pages and Workers token", description: "A token limited to application deployment resources.", capabilities: ["frontend-hosting"], fields: [field("apiToken", "API token", "Stored in core OpenBao and used only by authorized operations.", true, true)], permissions: ["Account: Workers Scripts Edit", "Account: Pages Edit"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] },
|
|
131
|
-
{ id: "cloudflare-dns", label: "DNS token", description: "A token restricted to
|
|
132
|
-
{ id: "cloudflare-storage", label: "Storage management authority", description: "Vault-custodied token used only to reconcile authorized R2 resources.", capabilities: ["object-storage"], fields: [field("apiToken", "Storage API token", "Encrypted separately and used only to reconcile authorized R2 resources.", true, true)], permissions: ["Account: Workers R2 Storage Edit"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] }
|
|
133
|
-
{ id: "s3-state-session", label: "OpenTofu state session", description: "S3-compatible credentials limited to the selected team state prefix.", capabilities: ["object-storage"], fields: [field("accessKeyId", "R2 access key ID", "Vault-custodied S3-compatible access key identifier for encrypted OpenTofu state.", true, true), field("secretAccessKey", "R2 secret access key", "Vault-custodied S3-compatible secret key for encrypted OpenTofu state.", true, true), field("sessionToken", "R2 session token", "Optional short-lived S3-compatible session token.", false, true)], permissions: ["Object read and write for only the managed team state prefix"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] },
|
|
134
|
-
{ id: "opentofu-state-encryption", label: "OpenTofu state encryption", description: "Independent encryption material that is never stored with the R2 state object.", capabilities: ["state-encryption"], fields: [field("stateEncryptionKey", "OpenTofu state encryption key", "A 32-byte hexadecimal key stored separately in core OpenBao.", true, true)], permissions: ["Encrypt and decrypt only the selected team OpenTofu state"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] }
|
|
123
|
+
{ id: "cloudflare-dns", label: "DNS token", description: "A token restricted to the domain you entered. Zone Read lets TreeSeed find its zone; DNS Edit lets it manage records.", capabilities: ["dns-management"], fields: [field("apiToken", "DNS API token", "Encrypted separately from deployment authority.", true, true)], permissions: ["Zone: Zone Read for the managed domain", "Zone: DNS Edit for the managed domain"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] },
|
|
124
|
+
{ id: "cloudflare-storage", label: "Storage management authority", description: "Vault-custodied token used only to reconcile authorized R2 resources.", capabilities: ["object-storage"], fields: [field("apiToken", "Storage API token", "Encrypted separately and used only to reconcile authorized R2 resources.", true, true)], permissions: ["Account: Workers R2 Storage Edit"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] }
|
|
135
125
|
]
|
|
136
126
|
},
|
|
137
127
|
{
|
|
@@ -150,14 +140,13 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
150
140
|
capabilities: [
|
|
151
141
|
{ type: "backend-hosting", label: "Backend hosting", description: "API and backend service hosting.", credentialProfileIds: ["railway-workspace"], status: "available" },
|
|
152
142
|
{ type: "database-hosting", label: "Database hosting", description: "Managed database placement.", credentialProfileIds: ["railway-workspace"], status: "available" },
|
|
153
|
-
{ type: "capacity-runtime-hosting", label: "Capacity runtime hosting", description: "Future capacity provider placement.", credentialProfileIds: ["railway-workspace"], status: "planned" },
|
|
154
143
|
{ type: "private-knowledge-index-hosting", label: "Private knowledge hosting", description: "Private TreeDX knowledge-plane placement.", credentialProfileIds: ["railway-workspace"], status: "available" }
|
|
155
144
|
],
|
|
156
145
|
credentialProfiles: [{
|
|
157
146
|
id: "railway-workspace",
|
|
158
147
|
label: "Railway workspace token",
|
|
159
148
|
description: "Railway currently exposes broad workspace authority. Sharing it increases the blast radius across enabled capabilities.",
|
|
160
|
-
capabilities: ["backend-hosting", "database-hosting", "
|
|
149
|
+
capabilities: ["backend-hosting", "database-hosting", "private-knowledge-index-hosting"],
|
|
161
150
|
fields: [field("apiToken", "Workspace token", "Stored in core OpenBao and used only by authorized operations.", true, true)],
|
|
162
151
|
permissions: ["Workspace access required by the selected operations"],
|
|
163
152
|
sharing: "provider-shared",
|
|
@@ -165,6 +154,31 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
165
154
|
authoritySchemes: ["openbao"],
|
|
166
155
|
knowledgePageIds: ["provider.railway", "services.credentials", "vault.rotation"]
|
|
167
156
|
}]
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: "hyperstack",
|
|
160
|
+
label: "Hyperstack",
|
|
161
|
+
logoKey: "hyperstack",
|
|
162
|
+
documentationUrl: "https://docs.hyperstack.cloud/docs/api-reference/quickstart/",
|
|
163
|
+
description: "Host TreeAI inference and training on rented GPUs. This is AI hosting, not capacity-provider hosting.",
|
|
164
|
+
knowledgePageIds: ["provider.hyperstack"],
|
|
165
|
+
connectionFields: [],
|
|
166
|
+
capabilities: [
|
|
167
|
+
{ type: "ai-inference-hosting", label: "Provide AI service", description: "Host the TreeAI vLLM inference engine on a rented GPU.", credentialProfileIds: ["hyperstack-runtime"], status: "available" },
|
|
168
|
+
{ type: "ai-training-hosting", label: "Run training", description: "Host the TreeAI Axolotl training engine, independently or alongside inference with managed GPU admission.", credentialProfileIds: ["hyperstack-runtime"], status: "available" }
|
|
169
|
+
],
|
|
170
|
+
credentialProfiles: [{
|
|
171
|
+
id: "hyperstack-runtime",
|
|
172
|
+
label: "Hyperstack API key",
|
|
173
|
+
description: "Authorize GPU hosting. Saving this key does not rent a machine. Deployments select hardware, schedules and storage separately.",
|
|
174
|
+
capabilities: ["ai-inference-hosting", "ai-training-hosting"],
|
|
175
|
+
fields: [field("apiToken", "API key", "Stored in your team vault and used only for authorized hosting operations.", true, true)],
|
|
176
|
+
permissions: ["Read environments for account verification", "Manage virtual machines and attached resources for deployment"],
|
|
177
|
+
sharing: "provider-shared",
|
|
178
|
+
unattendedCompatible: true,
|
|
179
|
+
authoritySchemes: ["openbao"],
|
|
180
|
+
knowledgePageIds: ["provider.hyperstack", "services.credentials", "vault.rotation"]
|
|
181
|
+
}]
|
|
168
182
|
}
|
|
169
183
|
];
|
|
170
184
|
function getServiceProviderDefinition(providerId) {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type SharedResourceGrant, type ServiceBinding } from './shared-resources.js';
|
|
2
|
+
export interface SharedAccessRequest {
|
|
3
|
+
resourceKind: 'connection' | 'vault';
|
|
4
|
+
resourceId: string;
|
|
5
|
+
ownerTeamId: string | null;
|
|
6
|
+
teamId: string;
|
|
7
|
+
permission: string;
|
|
8
|
+
environment: 'staging' | 'production' | 'shared';
|
|
9
|
+
resourceIdWithinProvider: string;
|
|
10
|
+
projectId?: string;
|
|
11
|
+
assignmentId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CurrentSharingAuthority {
|
|
14
|
+
actorCanUse: boolean;
|
|
15
|
+
ownerOrganizationId: string | null;
|
|
16
|
+
recipientOrganizationId: string | null;
|
|
17
|
+
deploymentAudiencePolicyId: string | null;
|
|
18
|
+
}
|
|
19
|
+
/** Pure policy check only. API supplies fresh trusted authority and atomically reserves quota before execution. */
|
|
20
|
+
export declare function authorizeSharedGrant(input: SharedResourceGrant, request: SharedAccessRequest, authority: CurrentSharingAuthority, now: Date): {
|
|
21
|
+
grantId: string;
|
|
22
|
+
grantVersion: number;
|
|
23
|
+
limits: {
|
|
24
|
+
maxConcurrentOperations: number;
|
|
25
|
+
maxOperationsPerWindow: number;
|
|
26
|
+
windowSeconds: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export interface BindingSelection {
|
|
30
|
+
teamId: string;
|
|
31
|
+
projectId: string;
|
|
32
|
+
capability: string;
|
|
33
|
+
environment: ServiceBinding['environment'];
|
|
34
|
+
}
|
|
35
|
+
/** Once bound, never consult a lower-priority default. Eligibility is evaluated by the API after selection. */
|
|
36
|
+
export declare function selectServiceBinding(request: BindingSelection, pinned: ServiceBinding | null, defaults: {
|
|
37
|
+
explicit: ServiceBinding[];
|
|
38
|
+
team: ServiceBinding[];
|
|
39
|
+
organization: ServiceBinding[];
|
|
40
|
+
deployment: ServiceBinding[];
|
|
41
|
+
}): {
|
|
42
|
+
id: string;
|
|
43
|
+
version: number;
|
|
44
|
+
projectId: string;
|
|
45
|
+
teamId: string;
|
|
46
|
+
environment: "production" | "staging" | "shared";
|
|
47
|
+
capability: string;
|
|
48
|
+
connectionId: string;
|
|
49
|
+
grantId: string | null;
|
|
50
|
+
ownerTeamId: string;
|
|
51
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { sharedResourceGrantSchema, serviceBindingSchema } from "./shared-resources.js";
|
|
2
|
+
function authorizeSharedGrant(input, request, authority, now) {
|
|
3
|
+
const grant = sharedResourceGrantSchema.parse(input);
|
|
4
|
+
const deny = (reason) => {
|
|
5
|
+
throw new Error(reason);
|
|
6
|
+
};
|
|
7
|
+
if (!Number.isFinite(now.getTime())) deny("invalid_authorization_time");
|
|
8
|
+
if (!authority.actorCanUse) deny("actor_not_authorized");
|
|
9
|
+
if (grant.status !== "active" || grant.expiresAt && Date.parse(grant.expiresAt) <= now.getTime()) deny("grant_inactive");
|
|
10
|
+
if (grant.recipientTeamId !== request.teamId || grant.resource.kind !== request.resourceKind || grant.resource.id !== request.resourceId || grant.resource.ownerTeamId !== request.ownerTeamId) deny("grant_resource_mismatch");
|
|
11
|
+
if (grant.authority.kind === "organization") {
|
|
12
|
+
if (authority.ownerOrganizationId !== grant.authority.organizationId || authority.recipientOrganizationId !== grant.authority.organizationId) deny("organization_membership_required");
|
|
13
|
+
} else if (authority.deploymentAudiencePolicyId !== grant.authority.audiencePolicyId) deny("deployment_audience_required");
|
|
14
|
+
if (!grant.permissions.includes(request.permission) || grant.scope.environment !== request.environment || !grant.scope.resourceIds.includes(request.resourceIdWithinProvider)) deny("grant_scope_mismatch");
|
|
15
|
+
if (grant.scope.projectIds.length && (!request.projectId || !grant.scope.projectIds.includes(request.projectId))) deny("project_scope_mismatch");
|
|
16
|
+
if (grant.scope.assignmentIds.length && (!request.assignmentId || !grant.scope.assignmentIds.includes(request.assignmentId))) deny("assignment_scope_mismatch");
|
|
17
|
+
return { grantId: grant.id, grantVersion: grant.version, limits: { ...grant.limits } };
|
|
18
|
+
}
|
|
19
|
+
function selectServiceBinding(request, pinned, defaults) {
|
|
20
|
+
const matches = (value) => value.teamId === request.teamId && value.projectId === request.projectId && value.capability === request.capability && value.environment === request.environment;
|
|
21
|
+
if (pinned) {
|
|
22
|
+
const binding = serviceBindingSchema.parse(pinned);
|
|
23
|
+
if (!matches(binding)) throw new Error("binding_scope_mismatch");
|
|
24
|
+
return binding;
|
|
25
|
+
}
|
|
26
|
+
for (const tier of ["explicit", "team", "organization", "deployment"]) {
|
|
27
|
+
const candidates = defaults[tier].map((value) => serviceBindingSchema.parse(value)).filter(matches);
|
|
28
|
+
if (candidates.length > 1) throw new Error("ambiguous_service_default");
|
|
29
|
+
if (candidates[0]) return candidates[0];
|
|
30
|
+
}
|
|
31
|
+
throw new Error("service_binding_unavailable");
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
authorizeSharedGrant,
|
|
35
|
+
selectServiceBinding
|
|
36
|
+
};
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const organizationSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
version: z.ZodNumber;
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
|
+
id: string;
|
|
8
|
+
version: number;
|
|
9
|
+
name: string;
|
|
10
|
+
}, {
|
|
11
|
+
id: string;
|
|
12
|
+
version: number;
|
|
13
|
+
name: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const organizationMemberSchema: z.ZodObject<{
|
|
16
|
+
organizationId: z.ZodString;
|
|
17
|
+
userId: z.ZodString;
|
|
18
|
+
role: z.ZodEnum<["owner", "admin", "member"]>;
|
|
19
|
+
version: z.ZodNumber;
|
|
20
|
+
}, "strict", z.ZodTypeAny, {
|
|
21
|
+
role: "owner" | "admin" | "member";
|
|
22
|
+
version: number;
|
|
23
|
+
organizationId: string;
|
|
24
|
+
userId: string;
|
|
25
|
+
}, {
|
|
26
|
+
role: "owner" | "admin" | "member";
|
|
27
|
+
version: number;
|
|
28
|
+
organizationId: string;
|
|
29
|
+
userId: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const organizationTeamSchema: z.ZodObject<{
|
|
32
|
+
teamId: z.ZodString;
|
|
33
|
+
organizationId: z.ZodNullable<z.ZodString>;
|
|
34
|
+
version: z.ZodNumber;
|
|
35
|
+
}, "strict", z.ZodTypeAny, {
|
|
36
|
+
version: number;
|
|
37
|
+
teamId: string;
|
|
38
|
+
organizationId: string | null;
|
|
39
|
+
}, {
|
|
40
|
+
version: number;
|
|
41
|
+
teamId: string;
|
|
42
|
+
organizationId: string | null;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const organizationTeamInvitationSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
organizationId: z.ZodString;
|
|
47
|
+
teamId: z.ZodString;
|
|
48
|
+
organizationAuthorizedBy: z.ZodString;
|
|
49
|
+
teamAuthorizedBy: z.ZodNullable<z.ZodString>;
|
|
50
|
+
expiresAt: z.ZodString;
|
|
51
|
+
status: z.ZodEnum<["pending", "accepted", "rejected", "revoked", "expired"]>;
|
|
52
|
+
version: z.ZodNumber;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
status: "rejected" | "revoked" | "expired" | "pending" | "accepted";
|
|
55
|
+
id: string;
|
|
56
|
+
version: number;
|
|
57
|
+
teamId: string;
|
|
58
|
+
expiresAt: string;
|
|
59
|
+
organizationId: string;
|
|
60
|
+
organizationAuthorizedBy: string;
|
|
61
|
+
teamAuthorizedBy: string | null;
|
|
62
|
+
}, {
|
|
63
|
+
status: "rejected" | "revoked" | "expired" | "pending" | "accepted";
|
|
64
|
+
id: string;
|
|
65
|
+
version: number;
|
|
66
|
+
teamId: string;
|
|
67
|
+
expiresAt: string;
|
|
68
|
+
organizationId: string;
|
|
69
|
+
organizationAuthorizedBy: string;
|
|
70
|
+
teamAuthorizedBy: string | null;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const sharedResourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
73
|
+
kind: z.ZodLiteral<"connection">;
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
ownerTeamId: z.ZodString;
|
|
76
|
+
}, "strict", z.ZodTypeAny, {
|
|
77
|
+
kind: "connection";
|
|
78
|
+
id: string;
|
|
79
|
+
ownerTeamId: string;
|
|
80
|
+
}, {
|
|
81
|
+
kind: "connection";
|
|
82
|
+
id: string;
|
|
83
|
+
ownerTeamId: string;
|
|
84
|
+
}>, z.ZodObject<{
|
|
85
|
+
kind: z.ZodLiteral<"vault">;
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
ownerTeamId: z.ZodNullable<z.ZodString>;
|
|
88
|
+
}, "strict", z.ZodTypeAny, {
|
|
89
|
+
kind: "vault";
|
|
90
|
+
id: string;
|
|
91
|
+
ownerTeamId: string | null;
|
|
92
|
+
}, {
|
|
93
|
+
kind: "vault";
|
|
94
|
+
id: string;
|
|
95
|
+
ownerTeamId: string | null;
|
|
96
|
+
}>]>;
|
|
97
|
+
export declare const sharedResourceGrantSchema: z.ZodEffects<z.ZodObject<{
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
resource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
100
|
+
kind: z.ZodLiteral<"connection">;
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
ownerTeamId: z.ZodString;
|
|
103
|
+
}, "strict", z.ZodTypeAny, {
|
|
104
|
+
kind: "connection";
|
|
105
|
+
id: string;
|
|
106
|
+
ownerTeamId: string;
|
|
107
|
+
}, {
|
|
108
|
+
kind: "connection";
|
|
109
|
+
id: string;
|
|
110
|
+
ownerTeamId: string;
|
|
111
|
+
}>, z.ZodObject<{
|
|
112
|
+
kind: z.ZodLiteral<"vault">;
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
ownerTeamId: z.ZodNullable<z.ZodString>;
|
|
115
|
+
}, "strict", z.ZodTypeAny, {
|
|
116
|
+
kind: "vault";
|
|
117
|
+
id: string;
|
|
118
|
+
ownerTeamId: string | null;
|
|
119
|
+
}, {
|
|
120
|
+
kind: "vault";
|
|
121
|
+
id: string;
|
|
122
|
+
ownerTeamId: string | null;
|
|
123
|
+
}>]>;
|
|
124
|
+
recipientTeamId: z.ZodString;
|
|
125
|
+
authority: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
126
|
+
kind: z.ZodLiteral<"organization">;
|
|
127
|
+
organizationId: z.ZodString;
|
|
128
|
+
}, "strict", z.ZodTypeAny, {
|
|
129
|
+
kind: "organization";
|
|
130
|
+
organizationId: string;
|
|
131
|
+
}, {
|
|
132
|
+
kind: "organization";
|
|
133
|
+
organizationId: string;
|
|
134
|
+
}>, z.ZodObject<{
|
|
135
|
+
kind: z.ZodLiteral<"deployment">;
|
|
136
|
+
audiencePolicyId: z.ZodString;
|
|
137
|
+
}, "strict", z.ZodTypeAny, {
|
|
138
|
+
kind: "deployment";
|
|
139
|
+
audiencePolicyId: string;
|
|
140
|
+
}, {
|
|
141
|
+
kind: "deployment";
|
|
142
|
+
audiencePolicyId: string;
|
|
143
|
+
}>]>;
|
|
144
|
+
origin: z.ZodEnum<["explicit", "default-policy"]>;
|
|
145
|
+
defaultPolicyId: z.ZodNullable<z.ZodString>;
|
|
146
|
+
permissions: z.ZodArray<z.ZodString, "many">;
|
|
147
|
+
scope: z.ZodObject<{
|
|
148
|
+
environment: z.ZodEnum<["staging", "production", "shared"]>;
|
|
149
|
+
resourceIds: z.ZodArray<z.ZodString, "many">;
|
|
150
|
+
projectIds: z.ZodArray<z.ZodString, "many">;
|
|
151
|
+
assignmentIds: z.ZodArray<z.ZodString, "many">;
|
|
152
|
+
}, "strict", z.ZodTypeAny, {
|
|
153
|
+
environment: "production" | "staging" | "shared";
|
|
154
|
+
projectIds: string[];
|
|
155
|
+
resourceIds: string[];
|
|
156
|
+
assignmentIds: string[];
|
|
157
|
+
}, {
|
|
158
|
+
environment: "production" | "staging" | "shared";
|
|
159
|
+
projectIds: string[];
|
|
160
|
+
resourceIds: string[];
|
|
161
|
+
assignmentIds: string[];
|
|
162
|
+
}>;
|
|
163
|
+
limits: z.ZodObject<{
|
|
164
|
+
maxConcurrentOperations: z.ZodNumber;
|
|
165
|
+
maxOperationsPerWindow: z.ZodNumber;
|
|
166
|
+
windowSeconds: z.ZodNumber;
|
|
167
|
+
}, "strict", z.ZodTypeAny, {
|
|
168
|
+
maxConcurrentOperations: number;
|
|
169
|
+
maxOperationsPerWindow: number;
|
|
170
|
+
windowSeconds: number;
|
|
171
|
+
}, {
|
|
172
|
+
maxConcurrentOperations: number;
|
|
173
|
+
maxOperationsPerWindow: number;
|
|
174
|
+
windowSeconds: number;
|
|
175
|
+
}>;
|
|
176
|
+
status: z.ZodEnum<["active", "revoked"]>;
|
|
177
|
+
version: z.ZodNumber;
|
|
178
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
179
|
+
}, "strict", z.ZodTypeAny, {
|
|
180
|
+
status: "revoked" | "active";
|
|
181
|
+
id: string;
|
|
182
|
+
version: number;
|
|
183
|
+
scope: {
|
|
184
|
+
environment: "production" | "staging" | "shared";
|
|
185
|
+
projectIds: string[];
|
|
186
|
+
resourceIds: string[];
|
|
187
|
+
assignmentIds: string[];
|
|
188
|
+
};
|
|
189
|
+
expiresAt: string | null;
|
|
190
|
+
origin: "explicit" | "default-policy";
|
|
191
|
+
resource: {
|
|
192
|
+
kind: "connection";
|
|
193
|
+
id: string;
|
|
194
|
+
ownerTeamId: string;
|
|
195
|
+
} | {
|
|
196
|
+
kind: "vault";
|
|
197
|
+
id: string;
|
|
198
|
+
ownerTeamId: string | null;
|
|
199
|
+
};
|
|
200
|
+
authority: {
|
|
201
|
+
kind: "organization";
|
|
202
|
+
organizationId: string;
|
|
203
|
+
} | {
|
|
204
|
+
kind: "deployment";
|
|
205
|
+
audiencePolicyId: string;
|
|
206
|
+
};
|
|
207
|
+
limits: {
|
|
208
|
+
maxConcurrentOperations: number;
|
|
209
|
+
maxOperationsPerWindow: number;
|
|
210
|
+
windowSeconds: number;
|
|
211
|
+
};
|
|
212
|
+
permissions: string[];
|
|
213
|
+
recipientTeamId: string;
|
|
214
|
+
defaultPolicyId: string | null;
|
|
215
|
+
}, {
|
|
216
|
+
status: "revoked" | "active";
|
|
217
|
+
id: string;
|
|
218
|
+
version: number;
|
|
219
|
+
scope: {
|
|
220
|
+
environment: "production" | "staging" | "shared";
|
|
221
|
+
projectIds: string[];
|
|
222
|
+
resourceIds: string[];
|
|
223
|
+
assignmentIds: string[];
|
|
224
|
+
};
|
|
225
|
+
expiresAt: string | null;
|
|
226
|
+
origin: "explicit" | "default-policy";
|
|
227
|
+
resource: {
|
|
228
|
+
kind: "connection";
|
|
229
|
+
id: string;
|
|
230
|
+
ownerTeamId: string;
|
|
231
|
+
} | {
|
|
232
|
+
kind: "vault";
|
|
233
|
+
id: string;
|
|
234
|
+
ownerTeamId: string | null;
|
|
235
|
+
};
|
|
236
|
+
authority: {
|
|
237
|
+
kind: "organization";
|
|
238
|
+
organizationId: string;
|
|
239
|
+
} | {
|
|
240
|
+
kind: "deployment";
|
|
241
|
+
audiencePolicyId: string;
|
|
242
|
+
};
|
|
243
|
+
limits: {
|
|
244
|
+
maxConcurrentOperations: number;
|
|
245
|
+
maxOperationsPerWindow: number;
|
|
246
|
+
windowSeconds: number;
|
|
247
|
+
};
|
|
248
|
+
permissions: string[];
|
|
249
|
+
recipientTeamId: string;
|
|
250
|
+
defaultPolicyId: string | null;
|
|
251
|
+
}>, {
|
|
252
|
+
status: "revoked" | "active";
|
|
253
|
+
id: string;
|
|
254
|
+
version: number;
|
|
255
|
+
scope: {
|
|
256
|
+
environment: "production" | "staging" | "shared";
|
|
257
|
+
projectIds: string[];
|
|
258
|
+
resourceIds: string[];
|
|
259
|
+
assignmentIds: string[];
|
|
260
|
+
};
|
|
261
|
+
expiresAt: string | null;
|
|
262
|
+
origin: "explicit" | "default-policy";
|
|
263
|
+
resource: {
|
|
264
|
+
kind: "connection";
|
|
265
|
+
id: string;
|
|
266
|
+
ownerTeamId: string;
|
|
267
|
+
} | {
|
|
268
|
+
kind: "vault";
|
|
269
|
+
id: string;
|
|
270
|
+
ownerTeamId: string | null;
|
|
271
|
+
};
|
|
272
|
+
authority: {
|
|
273
|
+
kind: "organization";
|
|
274
|
+
organizationId: string;
|
|
275
|
+
} | {
|
|
276
|
+
kind: "deployment";
|
|
277
|
+
audiencePolicyId: string;
|
|
278
|
+
};
|
|
279
|
+
limits: {
|
|
280
|
+
maxConcurrentOperations: number;
|
|
281
|
+
maxOperationsPerWindow: number;
|
|
282
|
+
windowSeconds: number;
|
|
283
|
+
};
|
|
284
|
+
permissions: string[];
|
|
285
|
+
recipientTeamId: string;
|
|
286
|
+
defaultPolicyId: string | null;
|
|
287
|
+
}, {
|
|
288
|
+
status: "revoked" | "active";
|
|
289
|
+
id: string;
|
|
290
|
+
version: number;
|
|
291
|
+
scope: {
|
|
292
|
+
environment: "production" | "staging" | "shared";
|
|
293
|
+
projectIds: string[];
|
|
294
|
+
resourceIds: string[];
|
|
295
|
+
assignmentIds: string[];
|
|
296
|
+
};
|
|
297
|
+
expiresAt: string | null;
|
|
298
|
+
origin: "explicit" | "default-policy";
|
|
299
|
+
resource: {
|
|
300
|
+
kind: "connection";
|
|
301
|
+
id: string;
|
|
302
|
+
ownerTeamId: string;
|
|
303
|
+
} | {
|
|
304
|
+
kind: "vault";
|
|
305
|
+
id: string;
|
|
306
|
+
ownerTeamId: string | null;
|
|
307
|
+
};
|
|
308
|
+
authority: {
|
|
309
|
+
kind: "organization";
|
|
310
|
+
organizationId: string;
|
|
311
|
+
} | {
|
|
312
|
+
kind: "deployment";
|
|
313
|
+
audiencePolicyId: string;
|
|
314
|
+
};
|
|
315
|
+
limits: {
|
|
316
|
+
maxConcurrentOperations: number;
|
|
317
|
+
maxOperationsPerWindow: number;
|
|
318
|
+
windowSeconds: number;
|
|
319
|
+
};
|
|
320
|
+
permissions: string[];
|
|
321
|
+
recipientTeamId: string;
|
|
322
|
+
defaultPolicyId: string | null;
|
|
323
|
+
}>;
|
|
324
|
+
export type SharedResourceGrant = z.infer<typeof sharedResourceGrantSchema>;
|
|
325
|
+
export declare const serviceBindingSchema: z.ZodEffects<z.ZodObject<{
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
teamId: z.ZodString;
|
|
328
|
+
projectId: z.ZodString;
|
|
329
|
+
capability: z.ZodString;
|
|
330
|
+
environment: z.ZodEnum<["staging", "production", "shared"]>;
|
|
331
|
+
connectionId: z.ZodString;
|
|
332
|
+
ownerTeamId: z.ZodString;
|
|
333
|
+
grantId: z.ZodNullable<z.ZodString>;
|
|
334
|
+
version: z.ZodNumber;
|
|
335
|
+
}, "strict", z.ZodTypeAny, {
|
|
336
|
+
id: string;
|
|
337
|
+
version: number;
|
|
338
|
+
projectId: string;
|
|
339
|
+
teamId: string;
|
|
340
|
+
environment: "production" | "staging" | "shared";
|
|
341
|
+
capability: string;
|
|
342
|
+
connectionId: string;
|
|
343
|
+
grantId: string | null;
|
|
344
|
+
ownerTeamId: string;
|
|
345
|
+
}, {
|
|
346
|
+
id: string;
|
|
347
|
+
version: number;
|
|
348
|
+
projectId: string;
|
|
349
|
+
teamId: string;
|
|
350
|
+
environment: "production" | "staging" | "shared";
|
|
351
|
+
capability: string;
|
|
352
|
+
connectionId: string;
|
|
353
|
+
grantId: string | null;
|
|
354
|
+
ownerTeamId: string;
|
|
355
|
+
}>, {
|
|
356
|
+
id: string;
|
|
357
|
+
version: number;
|
|
358
|
+
projectId: string;
|
|
359
|
+
teamId: string;
|
|
360
|
+
environment: "production" | "staging" | "shared";
|
|
361
|
+
capability: string;
|
|
362
|
+
connectionId: string;
|
|
363
|
+
grantId: string | null;
|
|
364
|
+
ownerTeamId: string;
|
|
365
|
+
}, {
|
|
366
|
+
id: string;
|
|
367
|
+
version: number;
|
|
368
|
+
projectId: string;
|
|
369
|
+
teamId: string;
|
|
370
|
+
environment: "production" | "staging" | "shared";
|
|
371
|
+
capability: string;
|
|
372
|
+
connectionId: string;
|
|
373
|
+
grantId: string | null;
|
|
374
|
+
ownerTeamId: string;
|
|
375
|
+
}>;
|
|
376
|
+
export type ServiceBinding = z.infer<typeof serviceBindingSchema>;
|