@opengeni/contracts 0.50.0 → 1.0.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/agent-authored-durable-text.d.ts +70 -0
- package/dist/agent-config.d.ts +869 -0
- package/dist/agent-instruction-changes.d.ts +110 -0
- package/dist/agent-learning.d.ts +243 -0
- package/dist/agent-topology.d.ts +292 -0
- package/dist/allowance-refusal.d.ts +9 -0
- package/dist/allowance-refusal.js +50 -0
- package/dist/allowance-refusal.js.map +1 -0
- package/dist/analytics-consent-report.d.ts +19 -0
- package/dist/analytics-consent-report.js +10 -0
- package/dist/analytics-consent-report.js.map +1 -0
- package/dist/api-key-presets.d.ts +19 -0
- package/dist/artifact-catalog.d.ts +161 -0
- package/dist/artifacts.d.ts +135 -11
- package/dist/atlassian-native-retirement.d.ts +16 -0
- package/dist/atlassian-native-retirement.js +30 -0
- package/dist/atlassian-native-retirement.js.map +1 -0
- package/dist/atlassian.d.ts +2 -0
- package/dist/atlassian.js +26 -12
- package/dist/browser-storage.d.ts +5 -0
- package/dist/browser-storage.js +9 -0
- package/dist/browser-storage.js.map +1 -0
- package/dist/bundled-skills.d.ts +40 -0
- package/dist/chunk-2ACYHZFB.js +292 -0
- package/dist/chunk-2ACYHZFB.js.map +1 -0
- package/dist/chunk-2VORLN2R.js +353 -0
- package/dist/chunk-2VORLN2R.js.map +1 -0
- package/dist/{chunk-Y3MLSLB4.js → chunk-3SIZGL3O.js} +42 -30
- package/dist/chunk-3SIZGL3O.js.map +1 -0
- package/dist/chunk-46KLD2UH.js +186 -0
- package/dist/chunk-46KLD2UH.js.map +1 -0
- package/dist/chunk-4JGHSSB7.js +11 -0
- package/dist/chunk-4JGHSSB7.js.map +1 -0
- package/dist/{chunk-M5ZGRVIQ.js → chunk-5IXYF6XN.js} +14 -5
- package/dist/chunk-5IXYF6XN.js.map +1 -0
- package/dist/chunk-BCS7WHCK.js +139 -0
- package/dist/chunk-BCS7WHCK.js.map +1 -0
- package/dist/chunk-EK7NDGFR.js +128 -0
- package/dist/chunk-EK7NDGFR.js.map +1 -0
- package/dist/{chunk-5UDNP7AO.js → chunk-FZ6BXQHL.js} +78 -38
- package/dist/chunk-FZ6BXQHL.js.map +1 -0
- package/dist/{chunk-CM6BMECR.js → chunk-GRG7PHWQ.js} +2 -1
- package/dist/chunk-GRG7PHWQ.js.map +1 -0
- package/dist/chunk-KHHZTBP7.js +11 -0
- package/dist/chunk-KHHZTBP7.js.map +1 -0
- package/dist/chunk-KR2V42UZ.js +187 -0
- package/dist/chunk-KR2V42UZ.js.map +1 -0
- package/dist/chunk-MZLBPKFE.js +168 -0
- package/dist/chunk-MZLBPKFE.js.map +1 -0
- package/dist/{chunk-LW7OH6CS.js → chunk-NRMCVHAU.js} +6 -5
- package/dist/chunk-NRMCVHAU.js.map +1 -0
- package/dist/{chunk-TZ6YEYN4.js → chunk-NVJMJWLL.js} +3 -1
- package/dist/chunk-NVJMJWLL.js.map +1 -0
- package/dist/chunk-O77VSFYZ.js +70 -0
- package/dist/chunk-O77VSFYZ.js.map +1 -0
- package/dist/chunk-PX3VCKAU.js +29 -0
- package/dist/chunk-PX3VCKAU.js.map +1 -0
- package/dist/chunk-QR5D2IQC.js +61 -0
- package/dist/chunk-QR5D2IQC.js.map +1 -0
- package/dist/chunk-RJ76DRPO.js +117 -0
- package/dist/chunk-RJ76DRPO.js.map +1 -0
- package/dist/chunk-RKX3NQYS.js +28 -0
- package/dist/chunk-RKX3NQYS.js.map +1 -0
- package/dist/{chunk-JBCIY7QD.js → chunk-SIOU2K4U.js} +45 -22
- package/dist/chunk-SIOU2K4U.js.map +1 -0
- package/dist/chunk-TSCDAGET.js +75 -0
- package/dist/chunk-TSCDAGET.js.map +1 -0
- package/dist/{chunk-LSB7GRLG.js → chunk-TXTQIYCV.js} +15 -11
- package/dist/chunk-TXTQIYCV.js.map +1 -0
- package/dist/chunk-X7ETVO4P.js +26544 -0
- package/dist/chunk-X7ETVO4P.js.map +1 -0
- package/dist/{chunk-CADSX6UN.js → chunk-Y3KNXVTD.js} +2 -2
- package/dist/chunk-YBW5JSA3.js +251 -0
- package/dist/chunk-YBW5JSA3.js.map +1 -0
- package/dist/chunk-YRXAWWCU.js +45 -0
- package/dist/chunk-YRXAWWCU.js.map +1 -0
- package/dist/claude-provider-account-authority.d.ts +18 -0
- package/dist/claude-subscription-oauth.d.ts +42 -0
- package/dist/claude-subscription-usage.d.ts +159 -0
- package/dist/client-error-report.d.ts +109 -0
- package/dist/client-error-report.js +87 -0
- package/dist/client-error-report.js.map +1 -0
- package/dist/code-search.d.ts +52 -0
- package/dist/code-search.js +40 -0
- package/dist/code-search.js.map +1 -0
- package/dist/company-brain-governed-writes.d.ts +475 -0
- package/dist/company-brain.d.ts +336 -0
- package/dist/company-profile.d.ts +566 -0
- package/dist/connect.d.ts +325 -0
- package/dist/connect.js +191 -0
- package/dist/connect.js.map +1 -0
- package/dist/connection-account-label.d.ts +2 -0
- package/dist/connection-account-label.js +35 -0
- package/dist/connection-account-label.js.map +1 -0
- package/dist/connection-authority.d.ts +193 -0
- package/dist/connection-authority.js +50 -0
- package/dist/connection-authority.js.map +1 -0
- package/dist/connector-attachments.d.ts +95 -0
- package/dist/connector-attachments.js +51 -0
- package/dist/connector-attachments.js.map +1 -0
- package/dist/connector-tool-permissions.d.ts +73 -0
- package/dist/direct-model-provider.d.ts +36 -0
- package/dist/editable-artifact-codec-registry.d.ts +16 -7
- package/dist/editable-artifact-codec-registry.js +18 -8
- package/dist/editable-artifact-committed-transaction.d.ts +2 -2
- package/dist/editable-artifact-committed-transaction.js +2 -2
- package/dist/editable-artifact-live.d.ts +11 -12
- package/dist/editable-artifact-live.js +110 -45
- package/dist/editable-artifact-live.js.map +1 -1
- package/dist/editable-artifact-serialized-commit.d.ts +2 -1
- package/dist/editable-artifact-serialized-commit.js +8 -7
- package/dist/editable-artifact-versions.d.ts +20 -5
- package/dist/editable-artifact-versions.js +23 -5
- package/dist/editable-artifacts.d.ts +2 -0
- package/dist/editable-artifacts.js +47 -35
- package/dist/external-identities.d.ts +784 -0
- package/dist/external-identities.js +44 -0
- package/dist/external-identities.js.map +1 -0
- package/dist/feedback.d.ts +51 -0
- package/dist/github-repository-contracts.d.ts +36 -0
- package/dist/github-repository-contracts.js +59 -0
- package/dist/github-repository-contracts.js.map +1 -0
- package/dist/github-repository.d.ts +14 -0
- package/dist/github-repository.js +36 -0
- package/dist/github-repository.js.map +1 -0
- package/dist/google-drive.d.ts +90 -1
- package/dist/google-drive.js +90 -16
- package/dist/google-drive.js.map +1 -1
- package/dist/governed-learning-activation.d.ts +154 -0
- package/dist/governed-learning-evaluator.d.ts +152 -0
- package/dist/host-mcp-bindings.d.ts +326 -0
- package/dist/host-mcp-bindings.js +252 -0
- package/dist/host-mcp-bindings.js.map +1 -0
- package/dist/image-generation.d.ts +1 -0
- package/dist/index.d.ts +32396 -11386
- package/dist/index.js +2198 -164
- package/dist/insights-usage.d.ts +877 -0
- package/dist/insights-usage.js +509 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/interaction.d.ts +344 -0
- package/dist/knowledge-entries.d.ts +982 -0
- package/dist/knowledge-preparation.d.ts +237 -0
- package/dist/knowledge.d.ts +197 -0
- package/dist/managed-auth-session-sets.d.ts +241 -0
- package/dist/managed-auth-session-sets.js +191 -0
- package/dist/managed-auth-session-sets.js.map +1 -0
- package/dist/managed-sign-in-methods.d.ts +56 -0
- package/dist/managed-sign-in-methods.js +46 -0
- package/dist/managed-sign-in-methods.js.map +1 -0
- package/dist/mcp-catalog-limits.d.ts +2 -0
- package/dist/mcp-endpoint.d.ts +7 -0
- package/dist/mcp-endpoint.js +9 -0
- package/dist/mcp-endpoint.js.map +1 -0
- package/dist/mcp-oauth.d.ts +71 -0
- package/dist/modal-native-proof-v2.d.ts +587 -0
- package/dist/modal-native-proof-v2.js +37 -0
- package/dist/modal-native-proof-v2.js.map +1 -0
- package/dist/model-availability.d.ts +15 -0
- package/dist/model-connection-access.d.ts +24 -0
- package/dist/model-context-inspector.d.ts +329 -0
- package/dist/model-display.d.ts +38 -0
- package/dist/model-display.js +134 -0
- package/dist/model-display.js.map +1 -0
- package/dist/model-picker-order.d.ts +25 -0
- package/dist/model-picker-order.js +42 -0
- package/dist/model-picker-order.js.map +1 -0
- package/dist/organization-access.d.ts +231 -0
- package/dist/organization-access.js +34 -0
- package/dist/organization-access.js.map +1 -0
- package/dist/organization-integration-policy.d.ts +27 -0
- package/dist/organization-membership-lifecycle.d.ts +1022 -0
- package/dist/organization-model-usage.d.ts +146 -0
- package/dist/organization-model-usage.js +67 -0
- package/dist/organization-model-usage.js.map +1 -0
- package/dist/organization-recovery.d.ts +337 -0
- package/dist/organization-recovery.js +37 -0
- package/dist/organization-recovery.js.map +1 -0
- package/dist/organization-usage.d.ts +138 -0
- package/dist/permissions.d.ts +54 -0
- package/dist/personal-github.d.ts +320 -0
- package/dist/personal-github.js +222 -0
- package/dist/personal-github.js.map +1 -0
- package/dist/plugin-discovery.d.ts +35 -0
- package/dist/plugin-discovery.js +7 -0
- package/dist/plugin-discovery.js.map +1 -0
- package/dist/preference-registry.d.ts +44 -1
- package/dist/product-analytics.d.ts +113 -0
- package/dist/product-lifecycle-facts.d.ts +73 -0
- package/dist/remember.d.ts +350 -0
- package/dist/retained-output.d.ts +8 -0
- package/dist/sandbox-file-artifacts.d.ts +57 -0
- package/dist/sandbox-provider-command.d.ts +113 -0
- package/dist/sandbox-recovery.d.ts +146 -0
- package/dist/sandbox-snapshots.d.ts +39 -0
- package/dist/session-final-reply.d.ts +6 -0
- package/dist/session-final-reply.js +9 -0
- package/dist/session-final-reply.js.map +1 -0
- package/dist/session-goal-reports.d.ts +21 -0
- package/dist/session-history-import.d.ts +947 -0
- package/dist/session-list-entries.d.ts +4 -0
- package/dist/session-list-entries.js +51 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-mcp-projections.d.ts +215 -0
- package/dist/session-message-search.d.ts +68 -0
- package/dist/session-titles.d.ts +68 -0
- package/dist/session-titles.js +25 -0
- package/dist/session-titles.js.map +1 -0
- package/dist/session-topology-primitives.d.ts +22 -0
- package/dist/signup-attribution.d.ts +39 -0
- package/dist/site-request-headers.test.d.ts +1 -0
- package/dist/site-session-http.d.ts +11 -0
- package/dist/site-session-http.js +11 -0
- package/dist/site-session-http.js.map +1 -0
- package/dist/skill-catalog-context.d.ts +7 -0
- package/dist/skill-files.d.ts +12 -0
- package/dist/skill-metadata.d.ts +9 -0
- package/dist/skill-use.d.ts +61 -0
- package/dist/skills.d.ts +185 -0
- package/dist/slack-bot-scopes.d.ts +46 -21
- package/dist/slack-bot-scopes.js +14 -3
- package/dist/slack-rest-mcp.d.ts +31 -0
- package/dist/slack-rest-mcp.js +19 -0
- package/dist/slack-rest-mcp.js.map +1 -0
- package/dist/spreadsheet-artifact-commands.d.ts +2 -3
- package/dist/spreadsheet-artifact-commands.js +4 -2
- package/dist/spreadsheet-artifact-query.js +3 -2
- package/dist/subscription-account-pools.d.ts +292 -0
- package/dist/task-notes.d.ts +42 -1
- package/dist/tool-catalog.d.ts +286 -0
- package/dist/tool-result-spill.d.ts +16 -0
- package/dist/usage-allowances.d.ts +285 -0
- package/dist/usage-allowances.js +49 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/video-generation.d.ts +3 -0
- package/dist/video-generation.js +1 -1
- package/dist/work-claims.d.ts +411 -0
- package/dist/workspace-instruction-policies.d.ts +94 -0
- package/dist/workspace-integration-wire.d.ts +36 -0
- package/dist/workspace-integration-wire.js +23 -0
- package/dist/workspace-integration-wire.js.map +1 -0
- package/dist/workspace-integrations.d.ts +948 -0
- package/dist/workspace-learning-administration.d.ts +289 -0
- package/dist/workspace-learning-policy.d.ts +1 -1
- package/dist/workspace-state.d.ts +85 -416
- package/dist/xai-provider-account-authority.d.ts +3 -0
- package/dist/xai-provider-account-authority.js +1 -1
- package/package.json +134 -1
- package/src/agent-authored-durable-text.ts +116 -0
- package/src/agent-config.ts +1527 -0
- package/src/agent-instruction-changes.ts +98 -0
- package/src/agent-learning.ts +161 -0
- package/src/agent-topology.ts +69 -0
- package/src/allowance-refusal.ts +81 -0
- package/src/analytics-consent-report.ts +20 -0
- package/src/api-key-presets.ts +25 -0
- package/src/artifact-catalog.ts +60 -0
- package/src/artifacts.ts +146 -18
- package/src/atlassian-native-retirement.ts +33 -0
- package/src/browser-storage.ts +10 -0
- package/src/bundled-skills.ts +73 -0
- package/src/claude-provider-account-authority.ts +12 -0
- package/src/claude-subscription-oauth.ts +62 -0
- package/src/claude-subscription-usage.ts +59 -0
- package/src/client-error-report.ts +184 -0
- package/src/code-search.ts +105 -0
- package/src/company-brain-governed-writes.ts +356 -0
- package/src/company-brain.ts +201 -0
- package/src/company-profile.ts +167 -1
- package/src/connect.ts +202 -0
- package/src/connection-account-label.ts +46 -0
- package/src/connection-authority.ts +213 -0
- package/src/connector-attachments.ts +327 -0
- package/src/connector-tool-permissions.ts +60 -0
- package/src/direct-model-provider.ts +98 -0
- package/src/editable-artifact-codec-registry.ts +55 -17
- package/src/editable-artifact-committed-transaction.ts +44 -31
- package/src/editable-artifact-live.ts +123 -57
- package/src/editable-artifact-serialized-commit.ts +2 -1
- package/src/editable-artifact-versions.ts +26 -5
- package/src/editable-artifacts.ts +2 -0
- package/src/external-identities.ts +285 -0
- package/src/feedback.ts +39 -0
- package/src/github-repository-contracts.ts +85 -0
- package/src/github-repository.ts +59 -0
- package/src/google-drive.ts +76 -4
- package/src/governed-learning-activation.ts +191 -0
- package/src/governed-learning-evaluator.ts +176 -0
- package/src/host-mcp-bindings.ts +298 -0
- package/src/image-generation.ts +8 -2
- package/src/index.ts +7093 -1466
- package/src/insights-usage.ts +679 -0
- package/src/interaction.ts +220 -5
- package/src/knowledge-entries.ts +375 -0
- package/src/knowledge-preparation.ts +50 -0
- package/src/knowledge.ts +134 -6
- package/src/managed-auth-session-sets.ts +253 -0
- package/src/managed-sign-in-methods.ts +37 -0
- package/src/mcp-catalog-limits.ts +2 -0
- package/src/mcp-endpoint.ts +30 -0
- package/src/mcp-oauth.ts +66 -0
- package/src/modal-native-proof-v2.ts +398 -0
- package/src/model-availability.ts +22 -0
- package/src/model-connection-access.ts +17 -0
- package/src/model-context-inspector.ts +139 -0
- package/src/model-display.ts +195 -0
- package/src/model-picker-order.ts +97 -0
- package/src/organization-access.ts +176 -0
- package/src/organization-integration-policy.ts +54 -0
- package/src/organization-membership-lifecycle.ts +559 -0
- package/src/organization-model-usage.ts +72 -0
- package/src/organization-recovery.ts +186 -0
- package/src/organization-usage.ts +79 -0
- package/src/permissions.ts +58 -0
- package/src/personal-github.ts +267 -0
- package/src/plugin-discovery.ts +33 -0
- package/src/preference-registry.ts +20 -1
- package/src/product-analytics.ts +253 -0
- package/src/product-lifecycle-facts.ts +121 -0
- package/src/remember.ts +243 -0
- package/src/retained-output.ts +20 -3
- package/src/sandbox-file-artifacts.ts +73 -0
- package/src/sandbox-provider-command.ts +82 -0
- package/src/sandbox-recovery.ts +116 -0
- package/src/sandbox-snapshots.ts +142 -0
- package/src/session-final-reply.ts +16 -0
- package/src/session-goal-reports.ts +55 -0
- package/src/session-history-import.ts +159 -0
- package/src/session-list-entries.ts +91 -0
- package/src/session-mcp-projections.ts +273 -0
- package/src/session-message-search.ts +54 -0
- package/src/session-titles.ts +467 -0
- package/src/session-topology-primitives.ts +21 -0
- package/src/signup-attribution.ts +81 -0
- package/src/site-request-headers.test.ts +28 -0
- package/src/site-session-http.ts +63 -0
- package/src/skill-catalog-context.ts +50 -0
- package/src/skill-files.ts +52 -0
- package/src/skill-metadata.ts +40 -0
- package/src/skill-use.ts +77 -0
- package/src/skills.ts +136 -0
- package/src/slack-bot-scopes.ts +106 -42
- package/src/slack-rest-mcp.ts +194 -0
- package/src/spreadsheet-artifact-commands.ts +12 -13
- package/src/subscription-account-pools.ts +44 -0
- package/src/task-notes.ts +14 -1
- package/src/tool-catalog.ts +155 -0
- package/src/tool-result-spill.ts +35 -0
- package/src/usage-allowances.ts +187 -0
- package/src/work-claims.ts +266 -0
- package/src/workspace-instruction-policies.ts +31 -0
- package/src/workspace-integration-wire.ts +99 -0
- package/src/workspace-integrations.ts +640 -0
- package/src/workspace-learning-administration.ts +88 -0
- package/src/workspace-learning-policy.ts +4 -3
- package/src/workspace-state.ts +16 -126
- package/src/xai-provider-account-authority.ts +1 -0
- package/dist/chunk-5UDNP7AO.js.map +0 -1
- package/dist/chunk-BVGIYW7D.js +0 -11
- package/dist/chunk-BVGIYW7D.js.map +0 -1
- package/dist/chunk-CM6BMECR.js.map +0 -1
- package/dist/chunk-JBCIY7QD.js.map +0 -1
- package/dist/chunk-LSB7GRLG.js.map +0 -1
- package/dist/chunk-LW7OH6CS.js.map +0 -1
- package/dist/chunk-M5ZGRVIQ.js.map +0 -1
- package/dist/chunk-Q6A7XT2N.js +0 -16734
- package/dist/chunk-Q6A7XT2N.js.map +0 -1
- package/dist/chunk-TZ6YEYN4.js.map +0 -1
- package/dist/chunk-Y3MLSLB4.js.map +0 -1
- /package/dist/{chunk-CADSX6UN.js.map → chunk-Y3KNXVTD.js.map} +0 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Permission } from "./permissions";
|
|
3
|
+
|
|
4
|
+
export const OrganizationMembershipRole = z.enum(["owner", "admin", "member"]);
|
|
5
|
+
export type OrganizationMembershipRole = z.infer<typeof OrganizationMembershipRole>;
|
|
6
|
+
|
|
7
|
+
export const WorkspaceMemberRole = z.enum(["viewer", "member", "admin", "custom"]);
|
|
8
|
+
export type WorkspaceMemberRole = z.infer<typeof WorkspaceMemberRole>;
|
|
9
|
+
|
|
10
|
+
export const AssignableWorkspaceMemberRole = z.enum(["viewer", "member", "admin"]);
|
|
11
|
+
export type AssignableWorkspaceMemberRole = z.infer<typeof AssignableWorkspaceMemberRole>;
|
|
12
|
+
|
|
13
|
+
export const OrganizationInvitationStatus = z.enum(["pending", "accepted", "revoked", "expired"]);
|
|
14
|
+
export type OrganizationInvitationStatus = z.infer<typeof OrganizationInvitationStatus>;
|
|
15
|
+
|
|
16
|
+
export const OrganizationUserSetupDeliveryState = z.enum([
|
|
17
|
+
"pending",
|
|
18
|
+
"sent",
|
|
19
|
+
"failed",
|
|
20
|
+
"outcome_unknown",
|
|
21
|
+
"revoked",
|
|
22
|
+
]);
|
|
23
|
+
export type OrganizationUserSetupDeliveryState = z.infer<typeof OrganizationUserSetupDeliveryState>;
|
|
24
|
+
|
|
25
|
+
export const OrganizationUserSetupDelivery = z.object({
|
|
26
|
+
id: z.string().uuid(),
|
|
27
|
+
state: OrganizationUserSetupDeliveryState,
|
|
28
|
+
attemptCount: z.number().int().nonnegative(),
|
|
29
|
+
revision: z.number().int().positive(),
|
|
30
|
+
errorClass: z.string().min(1).max(64).nullable(),
|
|
31
|
+
retryState: z.enum(["available", "reconciliation_required", "unavailable"]),
|
|
32
|
+
sentAt: z.string().datetime({ offset: true }).nullable(),
|
|
33
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
34
|
+
});
|
|
35
|
+
export type OrganizationUserSetupDelivery = z.infer<typeof OrganizationUserSetupDelivery>;
|
|
36
|
+
|
|
37
|
+
export const OrganizationInvitation = z.object({
|
|
38
|
+
id: z.string().uuid(),
|
|
39
|
+
organizationId: z.string().uuid(),
|
|
40
|
+
organizationName: z.string().trim().min(1).max(120).nullable().default(null),
|
|
41
|
+
targetEmail: z.string().email(),
|
|
42
|
+
targetName: z.string().trim().min(1).max(120).nullable().default(null),
|
|
43
|
+
initialWorkspaceIds: z.array(z.string().uuid()).max(100).default([]),
|
|
44
|
+
role: OrganizationMembershipRole,
|
|
45
|
+
status: OrganizationInvitationStatus,
|
|
46
|
+
revision: z.number().int().positive(),
|
|
47
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
48
|
+
acceptedMembershipId: z.string().uuid().nullable(),
|
|
49
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
50
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
51
|
+
delivery: OrganizationUserSetupDelivery.nullable().default(null),
|
|
52
|
+
});
|
|
53
|
+
export type OrganizationInvitation = z.infer<typeof OrganizationInvitation>;
|
|
54
|
+
|
|
55
|
+
export const OrganizationMember = z.object({
|
|
56
|
+
id: z.string().uuid(),
|
|
57
|
+
organizationId: z.string().uuid(),
|
|
58
|
+
subjectId: z.string().min(1).max(1024),
|
|
59
|
+
name: z.string().min(1).max(1024).nullable().default(null),
|
|
60
|
+
email: z.string().email().max(320).nullable().default(null),
|
|
61
|
+
role: OrganizationMembershipRole,
|
|
62
|
+
status: z.enum(["provisioning", "active", "suspended", "revoked"]),
|
|
63
|
+
authorizationRevision: z.number().int().positive(),
|
|
64
|
+
personalWorkspaceId: z.string().uuid().nullable(),
|
|
65
|
+
revokedAt: z.string().datetime({ offset: true }).nullable(),
|
|
66
|
+
personalRetentionUntil: z.string().datetime({ offset: true }).nullable(),
|
|
67
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
68
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
69
|
+
});
|
|
70
|
+
export type OrganizationMember = z.infer<typeof OrganizationMember>;
|
|
71
|
+
|
|
72
|
+
export const OrganizationAdministrationMemberWorkspaceAccess = z.object({
|
|
73
|
+
workspaceId: z.string().uuid(),
|
|
74
|
+
workspaceName: z.string().min(1).max(255),
|
|
75
|
+
membershipId: z.string().uuid(),
|
|
76
|
+
role: WorkspaceMemberRole,
|
|
77
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
78
|
+
});
|
|
79
|
+
export type OrganizationAdministrationMemberWorkspaceAccess = z.infer<
|
|
80
|
+
typeof OrganizationAdministrationMemberWorkspaceAccess
|
|
81
|
+
>;
|
|
82
|
+
|
|
83
|
+
/** Safe admin projection. Personal-workspace and personal-resource metadata are absent. */
|
|
84
|
+
export const OrganizationAdministrationMember = z.object({
|
|
85
|
+
id: z.string().uuid(),
|
|
86
|
+
organizationId: z.string().uuid(),
|
|
87
|
+
subjectId: z.string().min(1).max(1024),
|
|
88
|
+
name: z.string().min(1).max(1024).nullable(),
|
|
89
|
+
email: z.string().email().max(320).nullable(),
|
|
90
|
+
role: OrganizationMembershipRole,
|
|
91
|
+
status: z.enum(["provisioning", "active", "suspended", "revoked"]),
|
|
92
|
+
authorizationRevision: z.number().int().positive(),
|
|
93
|
+
sharedWorkspaceAccess: z.array(OrganizationAdministrationMemberWorkspaceAccess).max(500),
|
|
94
|
+
revokedAt: z.string().datetime({ offset: true }).nullable(),
|
|
95
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
96
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
97
|
+
});
|
|
98
|
+
export type OrganizationAdministrationMember = z.infer<typeof OrganizationAdministrationMember>;
|
|
99
|
+
|
|
100
|
+
export const OrganizationSummary = z.object({
|
|
101
|
+
id: z.string().uuid(),
|
|
102
|
+
name: z.string().trim().min(1).max(120),
|
|
103
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
104
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
105
|
+
});
|
|
106
|
+
export type OrganizationSummary = z.infer<typeof OrganizationSummary>;
|
|
107
|
+
|
|
108
|
+
export const OrganizationPrivateSessionSettings = z.object({
|
|
109
|
+
organizationId: z.string().uuid(),
|
|
110
|
+
enabled: z.boolean(),
|
|
111
|
+
available: z.boolean(),
|
|
112
|
+
version: z.number().int().nonnegative(),
|
|
113
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
114
|
+
changed: z.boolean().optional(),
|
|
115
|
+
});
|
|
116
|
+
export type OrganizationPrivateSessionSettings = z.infer<typeof OrganizationPrivateSessionSettings>;
|
|
117
|
+
|
|
118
|
+
export const UpdateOrganizationPrivateSessionSettingsRequest = z
|
|
119
|
+
.object({
|
|
120
|
+
enabled: z.boolean(),
|
|
121
|
+
expectedVersion: z.number().int().nonnegative(),
|
|
122
|
+
operationId: z.string().uuid(),
|
|
123
|
+
})
|
|
124
|
+
.strict();
|
|
125
|
+
export type UpdateOrganizationPrivateSessionSettingsRequest = z.infer<
|
|
126
|
+
typeof UpdateOrganizationPrivateSessionSettingsRequest
|
|
127
|
+
>;
|
|
128
|
+
|
|
129
|
+
export const OrganizationWorkspaceAccessMember = z.object({
|
|
130
|
+
membershipId: z.string().uuid(),
|
|
131
|
+
organizationMembershipId: z.string().uuid().nullable(),
|
|
132
|
+
subjectId: z.string().min(1).max(1024),
|
|
133
|
+
name: z.string().min(1).max(1024).nullable(),
|
|
134
|
+
email: z.string().email().max(320).nullable(),
|
|
135
|
+
subjectLabel: z.string().min(1).max(1024).nullable(),
|
|
136
|
+
principalKind: z.enum(["human", "service"]),
|
|
137
|
+
organizationRole: OrganizationMembershipRole.nullable(),
|
|
138
|
+
role: WorkspaceMemberRole,
|
|
139
|
+
permissions: z.array(z.string().min(1).max(128)),
|
|
140
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
141
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
142
|
+
});
|
|
143
|
+
export type OrganizationWorkspaceAccessMember = z.infer<typeof OrganizationWorkspaceAccessMember>;
|
|
144
|
+
|
|
145
|
+
export const OrganizationWorkspaceAccess = z.object({
|
|
146
|
+
id: z.string().uuid(),
|
|
147
|
+
name: z.string().min(1),
|
|
148
|
+
slug: z.string().nullable(),
|
|
149
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
150
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
151
|
+
members: z.array(OrganizationWorkspaceAccessMember).max(1000),
|
|
152
|
+
});
|
|
153
|
+
export type OrganizationWorkspaceAccess = z.infer<typeof OrganizationWorkspaceAccess>;
|
|
154
|
+
|
|
155
|
+
export const OrganizationWorkspaceRoleDefinition = z.object({
|
|
156
|
+
role: AssignableWorkspaceMemberRole,
|
|
157
|
+
label: z.string().min(1).max(64),
|
|
158
|
+
description: z.string().min(1).max(512),
|
|
159
|
+
permissions: z.array(Permission).min(1),
|
|
160
|
+
});
|
|
161
|
+
export type OrganizationWorkspaceRoleDefinition = z.infer<
|
|
162
|
+
typeof OrganizationWorkspaceRoleDefinition
|
|
163
|
+
>;
|
|
164
|
+
|
|
165
|
+
export const OrganizationAdministrationOverview = z.object({
|
|
166
|
+
organization: OrganizationSummary,
|
|
167
|
+
roles: z.array(OrganizationWorkspaceRoleDefinition).length(3),
|
|
168
|
+
workspaces: z.array(OrganizationWorkspaceAccess).max(500),
|
|
169
|
+
});
|
|
170
|
+
export type OrganizationAdministrationOverview = z.infer<typeof OrganizationAdministrationOverview>;
|
|
171
|
+
|
|
172
|
+
export const CreateOrganizationWorkspaceRequest = z
|
|
173
|
+
.object({
|
|
174
|
+
name: z.string().trim().min(1).max(120),
|
|
175
|
+
operationId: z.string().uuid(),
|
|
176
|
+
})
|
|
177
|
+
.strict();
|
|
178
|
+
export type CreateOrganizationWorkspaceRequest = z.infer<typeof CreateOrganizationWorkspaceRequest>;
|
|
179
|
+
|
|
180
|
+
export const UpdateOrganizationWorkspaceRequest = z
|
|
181
|
+
.object({
|
|
182
|
+
name: z.string().trim().min(1).max(120),
|
|
183
|
+
expectedUpdatedAt: z.string().datetime({ offset: true }),
|
|
184
|
+
operationId: z.string().uuid(),
|
|
185
|
+
})
|
|
186
|
+
.strict();
|
|
187
|
+
export type UpdateOrganizationWorkspaceRequest = z.infer<typeof UpdateOrganizationWorkspaceRequest>;
|
|
188
|
+
|
|
189
|
+
export const PutOrganizationWorkspaceMemberRequest = z.discriminatedUnion("role", [
|
|
190
|
+
z
|
|
191
|
+
.object({
|
|
192
|
+
role: AssignableWorkspaceMemberRole,
|
|
193
|
+
expectedUpdatedAt: z.string().datetime({ offset: true }).nullable(),
|
|
194
|
+
operationId: z.string().uuid(),
|
|
195
|
+
})
|
|
196
|
+
.strict(),
|
|
197
|
+
z
|
|
198
|
+
.object({
|
|
199
|
+
role: z.literal("custom"),
|
|
200
|
+
permissions: z.array(Permission).max(128),
|
|
201
|
+
expectedUpdatedAt: z.string().datetime({ offset: true }).nullable(),
|
|
202
|
+
operationId: z.string().uuid(),
|
|
203
|
+
})
|
|
204
|
+
.strict(),
|
|
205
|
+
]);
|
|
206
|
+
export type PutOrganizationWorkspaceMemberRequest = z.infer<
|
|
207
|
+
typeof PutOrganizationWorkspaceMemberRequest
|
|
208
|
+
>;
|
|
209
|
+
|
|
210
|
+
export const RevokeOrganizationWorkspaceMemberRequest = z
|
|
211
|
+
.object({
|
|
212
|
+
expectedUpdatedAt: z.string().datetime({ offset: true }),
|
|
213
|
+
operationId: z.string().uuid(),
|
|
214
|
+
})
|
|
215
|
+
.strict();
|
|
216
|
+
export type RevokeOrganizationWorkspaceMemberRequest = z.infer<
|
|
217
|
+
typeof RevokeOrganizationWorkspaceMemberRequest
|
|
218
|
+
>;
|
|
219
|
+
|
|
220
|
+
export const RevokeOrganizationWorkspaceMemberResponse = z
|
|
221
|
+
.object({
|
|
222
|
+
removed: z.boolean(),
|
|
223
|
+
replay: z.boolean(),
|
|
224
|
+
})
|
|
225
|
+
.strict();
|
|
226
|
+
export type RevokeOrganizationWorkspaceMemberResponse = z.infer<
|
|
227
|
+
typeof RevokeOrganizationWorkspaceMemberResponse
|
|
228
|
+
>;
|
|
229
|
+
|
|
230
|
+
export const CreateOrganizationRequest = z.object({
|
|
231
|
+
name: z.string().trim().min(1).max(120),
|
|
232
|
+
operationId: z.string().uuid(),
|
|
233
|
+
});
|
|
234
|
+
export type CreateOrganizationRequest = z.infer<typeof CreateOrganizationRequest>;
|
|
235
|
+
|
|
236
|
+
export const CreateOrganizationResponse = z.object({
|
|
237
|
+
organization: OrganizationSummary,
|
|
238
|
+
workspaceId: z.string().uuid(),
|
|
239
|
+
});
|
|
240
|
+
export type CreateOrganizationResponse = z.infer<typeof CreateOrganizationResponse>;
|
|
241
|
+
|
|
242
|
+
export const CreateAdditionalOrganizationRequest = z
|
|
243
|
+
.object({
|
|
244
|
+
name: z.string().trim().min(1).max(120),
|
|
245
|
+
workspaceName: z.string().trim().min(1).max(120),
|
|
246
|
+
operationId: z.string().uuid(),
|
|
247
|
+
})
|
|
248
|
+
.strict();
|
|
249
|
+
export type CreateAdditionalOrganizationRequest = z.infer<
|
|
250
|
+
typeof CreateAdditionalOrganizationRequest
|
|
251
|
+
>;
|
|
252
|
+
|
|
253
|
+
export const CreateAdditionalOrganizationResponse = z.object({
|
|
254
|
+
organization: OrganizationSummary,
|
|
255
|
+
workspaceId: z.string().uuid(),
|
|
256
|
+
personalWorkspaceId: z.string().uuid(),
|
|
257
|
+
});
|
|
258
|
+
export type CreateAdditionalOrganizationResponse = z.infer<
|
|
259
|
+
typeof CreateAdditionalOrganizationResponse
|
|
260
|
+
>;
|
|
261
|
+
|
|
262
|
+
export const UpdateOrganizationNameRequest = z.object({
|
|
263
|
+
name: z.string().trim().min(1).max(120),
|
|
264
|
+
expectedUpdatedAt: z.string().datetime({ offset: true }),
|
|
265
|
+
operationId: z.string().uuid(),
|
|
266
|
+
});
|
|
267
|
+
export type UpdateOrganizationNameRequest = z.infer<typeof UpdateOrganizationNameRequest>;
|
|
268
|
+
|
|
269
|
+
export const OrganizationRetentionPolicy = z
|
|
270
|
+
.object({
|
|
271
|
+
organizationId: z.string().uuid(),
|
|
272
|
+
mode: z.enum(["retain", "delete_after"]),
|
|
273
|
+
retentionDays: z.number().int().min(30).max(90).nullable(),
|
|
274
|
+
version: z.number().int().positive(),
|
|
275
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
276
|
+
})
|
|
277
|
+
.superRefine((value, context) => {
|
|
278
|
+
if ((value.mode === "retain") !== (value.retentionDays === null)) {
|
|
279
|
+
context.addIssue({
|
|
280
|
+
code: "custom",
|
|
281
|
+
path: ["retentionDays"],
|
|
282
|
+
message: "retain requires no duration; delete_after requires a duration",
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
export type OrganizationRetentionPolicy = z.infer<typeof OrganizationRetentionPolicy>;
|
|
287
|
+
|
|
288
|
+
export const OrganizationRetentionDeletionClaim = z.object({
|
|
289
|
+
organizationId: z.string().uuid(),
|
|
290
|
+
membershipId: z.string().uuid(),
|
|
291
|
+
operationId: z.string().uuid(),
|
|
292
|
+
retentionUntil: z.string().datetime({ offset: true }),
|
|
293
|
+
claimExpiresAt: z.string().datetime({ offset: true }),
|
|
294
|
+
personalWorkspaceId: z.string().uuid().nullable(),
|
|
295
|
+
objectCount: z.number().int().nonnegative(),
|
|
296
|
+
deletedObjectCount: z.number().int().nonnegative(),
|
|
297
|
+
});
|
|
298
|
+
export type OrganizationRetentionDeletionClaim = z.infer<typeof OrganizationRetentionDeletionClaim>;
|
|
299
|
+
|
|
300
|
+
export const OrganizationRetentionDeletionObject = z.object({
|
|
301
|
+
objectKind: z.enum([
|
|
302
|
+
"file",
|
|
303
|
+
"session_recording",
|
|
304
|
+
"browser_state_artifact",
|
|
305
|
+
"browser_state_upload",
|
|
306
|
+
"transcription_recording_object",
|
|
307
|
+
"video_staging_reference",
|
|
308
|
+
"workspace_artifact_version",
|
|
309
|
+
"editable_artifact_blob",
|
|
310
|
+
"workspace_capture_manifest",
|
|
311
|
+
"workspace_capture_tree_index",
|
|
312
|
+
"workspace_capture_blob",
|
|
313
|
+
]),
|
|
314
|
+
sourceId: z.string().min(1).max(2048),
|
|
315
|
+
objectBucket: z.string().min(1).max(1024),
|
|
316
|
+
objectKey: z.string().min(1).max(4096),
|
|
317
|
+
});
|
|
318
|
+
export type OrganizationRetentionDeletionObject = z.infer<
|
|
319
|
+
typeof OrganizationRetentionDeletionObject
|
|
320
|
+
>;
|
|
321
|
+
|
|
322
|
+
export const OrganizationRetentionDatabaseFinalization = z.object({
|
|
323
|
+
organizationId: z.string().uuid(),
|
|
324
|
+
membershipId: z.string().uuid(),
|
|
325
|
+
operationId: z.string().uuid(),
|
|
326
|
+
outcome: z.literal("cleanup_pending"),
|
|
327
|
+
objectBucket: z.string().min(1).max(1024),
|
|
328
|
+
objectCount: z.number().int().nonnegative(),
|
|
329
|
+
deletedResources: z.record(z.string(), z.number().int().nonnegative()),
|
|
330
|
+
databaseFinalizedAt: z.string().datetime({ offset: true }),
|
|
331
|
+
});
|
|
332
|
+
export type OrganizationRetentionDatabaseFinalization = z.infer<
|
|
333
|
+
typeof OrganizationRetentionDatabaseFinalization
|
|
334
|
+
>;
|
|
335
|
+
|
|
336
|
+
export const OrganizationRetentionDeletionResult = z.object({
|
|
337
|
+
organizationId: z.string().uuid(),
|
|
338
|
+
membershipId: z.string().uuid(),
|
|
339
|
+
operationId: z.string().uuid(),
|
|
340
|
+
outcome: z.enum(["completed", "already_completed"]),
|
|
341
|
+
deletedResources: z.record(z.string(), z.number().int().nonnegative()),
|
|
342
|
+
completedAt: z.string().datetime({ offset: true }),
|
|
343
|
+
});
|
|
344
|
+
export type OrganizationRetentionDeletionResult = z.infer<
|
|
345
|
+
typeof OrganizationRetentionDeletionResult
|
|
346
|
+
>;
|
|
347
|
+
|
|
348
|
+
export const OrganizationRetentionDeletionPreview = z.object({
|
|
349
|
+
membershipId: z.string().uuid(),
|
|
350
|
+
retentionUntil: z.string().datetime({ offset: true }),
|
|
351
|
+
personalWorkspaceId: z.string().uuid().nullable(),
|
|
352
|
+
resourceCount: z.number().int().nonnegative(),
|
|
353
|
+
objectCount: z.number().int().nonnegative(),
|
|
354
|
+
});
|
|
355
|
+
export type OrganizationRetentionDeletionPreview = z.infer<
|
|
356
|
+
typeof OrganizationRetentionDeletionPreview
|
|
357
|
+
>;
|
|
358
|
+
|
|
359
|
+
export const CreateOrganizationInvitationRequest = z.object({
|
|
360
|
+
email: z.string().email().max(320),
|
|
361
|
+
name: z.string().trim().min(1).max(120).optional(),
|
|
362
|
+
initialWorkspaceIds: z.array(z.string().uuid()).max(100).default([]),
|
|
363
|
+
role: OrganizationMembershipRole.default("member"),
|
|
364
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
365
|
+
operationId: z.string().uuid(),
|
|
366
|
+
});
|
|
367
|
+
export type CreateOrganizationInvitationRequest = z.infer<
|
|
368
|
+
typeof CreateOrganizationInvitationRequest
|
|
369
|
+
>;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Public, signed-out completion contract for an invitation-bound account setup.
|
|
373
|
+
* The bearer is delivered out of band to the invited email address. It is
|
|
374
|
+
* never persisted in plaintext; `operationId` makes an outcome-unknown retry
|
|
375
|
+
* converge on the first committed result.
|
|
376
|
+
*/
|
|
377
|
+
export const CompleteOrganizationUserSetupRequest = z.object({
|
|
378
|
+
token: z.string().min(32).max(2048),
|
|
379
|
+
name: z.string().trim().min(1).max(120),
|
|
380
|
+
password: z.string().min(8).max(128),
|
|
381
|
+
operationId: z.string().uuid(),
|
|
382
|
+
});
|
|
383
|
+
export type CompleteOrganizationUserSetupRequest = z.infer<
|
|
384
|
+
typeof CompleteOrganizationUserSetupRequest
|
|
385
|
+
>;
|
|
386
|
+
|
|
387
|
+
export const CompleteOrganizationUserSetupResponse = z.object({
|
|
388
|
+
status: z.literal("complete"),
|
|
389
|
+
});
|
|
390
|
+
export type CompleteOrganizationUserSetupResponse = z.infer<
|
|
391
|
+
typeof CompleteOrganizationUserSetupResponse
|
|
392
|
+
>;
|
|
393
|
+
|
|
394
|
+
export const PreviewOrganizationUserSetupRequest = z
|
|
395
|
+
.object({ token: z.string().min(32).max(2048) })
|
|
396
|
+
.strict();
|
|
397
|
+
export type PreviewOrganizationUserSetupRequest = z.infer<
|
|
398
|
+
typeof PreviewOrganizationUserSetupRequest
|
|
399
|
+
>;
|
|
400
|
+
|
|
401
|
+
export const OrganizationUserSetupPreviewWorkspace = z.object({
|
|
402
|
+
workspaceId: z.string().uuid(),
|
|
403
|
+
workspaceName: z.string().min(1).max(255),
|
|
404
|
+
role: AssignableWorkspaceMemberRole,
|
|
405
|
+
});
|
|
406
|
+
export type OrganizationUserSetupPreviewWorkspace = z.infer<
|
|
407
|
+
typeof OrganizationUserSetupPreviewWorkspace
|
|
408
|
+
>;
|
|
409
|
+
|
|
410
|
+
const OrganizationUserSetupPreviewUnavailable = z.object({
|
|
411
|
+
state: z.enum(["unavailable", "expired", "revoked", "completed"]),
|
|
412
|
+
});
|
|
413
|
+
const OrganizationUserSetupPreviewPending = z.object({
|
|
414
|
+
state: z.literal("pending"),
|
|
415
|
+
organizationId: z.string().uuid(),
|
|
416
|
+
organizationName: z.string().trim().min(1).max(120),
|
|
417
|
+
targetEmail: z.string().email().max(320),
|
|
418
|
+
targetName: z.string().trim().min(1).max(120).nullable(),
|
|
419
|
+
organizationRole: OrganizationMembershipRole,
|
|
420
|
+
sharedWorkspaceAccess: z.array(OrganizationUserSetupPreviewWorkspace).max(100),
|
|
421
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
422
|
+
});
|
|
423
|
+
export const OrganizationUserSetupPreview = z.discriminatedUnion("state", [
|
|
424
|
+
OrganizationUserSetupPreviewUnavailable,
|
|
425
|
+
OrganizationUserSetupPreviewPending,
|
|
426
|
+
]);
|
|
427
|
+
export type OrganizationUserSetupPreview = z.infer<typeof OrganizationUserSetupPreview>;
|
|
428
|
+
|
|
429
|
+
export const RetryOrganizationUserSetupDeliveryRequest = z
|
|
430
|
+
.object({ operationId: z.string().uuid() })
|
|
431
|
+
.strict();
|
|
432
|
+
export type RetryOrganizationUserSetupDeliveryRequest = z.infer<
|
|
433
|
+
typeof RetryOrganizationUserSetupDeliveryRequest
|
|
434
|
+
>;
|
|
435
|
+
|
|
436
|
+
/** Authenticated organization-name-only setup after ordinary account creation. */
|
|
437
|
+
export const CompleteSelfServiceOrganizationSetupRequest = z.object({
|
|
438
|
+
organizationName: z.string().trim().min(1).max(120),
|
|
439
|
+
operationId: z.string().uuid(),
|
|
440
|
+
/**
|
|
441
|
+
* The signup answer to "How do you want to use Opengeni?": add AI agents to
|
|
442
|
+
* a product (`embed`) or run agents in the cloud (`cloud`). Stored once per
|
|
443
|
+
* person and organization; the first answer wins.
|
|
444
|
+
*/
|
|
445
|
+
useCase: z.enum(["embed", "cloud"]).optional(),
|
|
446
|
+
});
|
|
447
|
+
export type CompleteSelfServiceOrganizationSetupRequest = z.infer<
|
|
448
|
+
typeof CompleteSelfServiceOrganizationSetupRequest
|
|
449
|
+
>;
|
|
450
|
+
|
|
451
|
+
export const CompleteSelfServiceOrganizationSetupResponse = z.object({
|
|
452
|
+
status: z.literal("complete"),
|
|
453
|
+
organizationId: z.string().uuid(),
|
|
454
|
+
personalWorkspaceId: z.string().uuid(),
|
|
455
|
+
});
|
|
456
|
+
export type CompleteSelfServiceOrganizationSetupResponse = z.infer<
|
|
457
|
+
typeof CompleteSelfServiceOrganizationSetupResponse
|
|
458
|
+
>;
|
|
459
|
+
|
|
460
|
+
export const SelfServiceOrganizationOnboardingStatus = z.object({
|
|
461
|
+
state: z.enum(["required", "invitation_pending", "unavailable", "complete"]),
|
|
462
|
+
});
|
|
463
|
+
export type SelfServiceOrganizationOnboardingStatus = z.infer<
|
|
464
|
+
typeof SelfServiceOrganizationOnboardingStatus
|
|
465
|
+
>;
|
|
466
|
+
|
|
467
|
+
export const AcceptOrganizationInvitationRequest = z.object({
|
|
468
|
+
expectedRevision: z.number().int().positive(),
|
|
469
|
+
operationId: z.string().uuid(),
|
|
470
|
+
});
|
|
471
|
+
export type AcceptOrganizationInvitationRequest = z.infer<
|
|
472
|
+
typeof AcceptOrganizationInvitationRequest
|
|
473
|
+
>;
|
|
474
|
+
|
|
475
|
+
export const RevokeOrganizationInvitationRequest = AcceptOrganizationInvitationRequest;
|
|
476
|
+
export type RevokeOrganizationInvitationRequest = z.infer<
|
|
477
|
+
typeof RevokeOrganizationInvitationRequest
|
|
478
|
+
>;
|
|
479
|
+
|
|
480
|
+
export const OrganizationMemberTransitionKind = z.enum([
|
|
481
|
+
"change_role",
|
|
482
|
+
"suspend",
|
|
483
|
+
"reactivate",
|
|
484
|
+
"offboard",
|
|
485
|
+
]);
|
|
486
|
+
export type OrganizationMemberTransitionKind = z.infer<typeof OrganizationMemberTransitionKind>;
|
|
487
|
+
|
|
488
|
+
export const UpdateOrganizationMemberRequest = z
|
|
489
|
+
.object({
|
|
490
|
+
kind: OrganizationMemberTransitionKind,
|
|
491
|
+
role: OrganizationMembershipRole.optional(),
|
|
492
|
+
expectedAuthorizationRevision: z.number().int().positive(),
|
|
493
|
+
operationId: z.string().uuid(),
|
|
494
|
+
reason: z.string().trim().min(1).max(512).optional(),
|
|
495
|
+
})
|
|
496
|
+
.superRefine((value, context) => {
|
|
497
|
+
if ((value.kind === "change_role") !== (value.role !== undefined)) {
|
|
498
|
+
context.addIssue({
|
|
499
|
+
code: "custom",
|
|
500
|
+
path: ["role"],
|
|
501
|
+
message: "role is required only for change_role",
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
export type UpdateOrganizationMemberRequest = z.infer<typeof UpdateOrganizationMemberRequest>;
|
|
506
|
+
|
|
507
|
+
export const UpdateOrganizationRetentionPolicyRequest = z
|
|
508
|
+
.object({
|
|
509
|
+
mode: z.enum(["retain", "delete_after"]),
|
|
510
|
+
retentionDays: z.number().int().min(30).max(90).nullable(),
|
|
511
|
+
expectedVersion: z.number().int().positive(),
|
|
512
|
+
operationId: z.string().uuid(),
|
|
513
|
+
})
|
|
514
|
+
.superRefine((value, context) => {
|
|
515
|
+
if ((value.mode === "retain") !== (value.retentionDays === null)) {
|
|
516
|
+
context.addIssue({
|
|
517
|
+
code: "custom",
|
|
518
|
+
path: ["retentionDays"],
|
|
519
|
+
message: "retain requires no duration; delete_after requires a duration",
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
export type UpdateOrganizationRetentionPolicyRequest = z.infer<
|
|
524
|
+
typeof UpdateOrganizationRetentionPolicyRequest
|
|
525
|
+
>;
|
|
526
|
+
|
|
527
|
+
export const ListOrganizationInvitationsResponse = z.object({
|
|
528
|
+
invitations: z.array(OrganizationInvitation).max(101),
|
|
529
|
+
});
|
|
530
|
+
export const ListOrganizationInvitationsPageQuery = z.object({
|
|
531
|
+
cursor: z.string().uuid().optional(),
|
|
532
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
533
|
+
});
|
|
534
|
+
export type ListOrganizationInvitationsPageQuery = z.infer<
|
|
535
|
+
typeof ListOrganizationInvitationsPageQuery
|
|
536
|
+
>;
|
|
537
|
+
export const ListOrganizationInvitationsPageResponse = z.object({
|
|
538
|
+
invitations: z.array(OrganizationInvitation).max(100),
|
|
539
|
+
nextCursor: z.string().uuid().nullable(),
|
|
540
|
+
});
|
|
541
|
+
export type ListOrganizationInvitationsPageResponse = z.infer<
|
|
542
|
+
typeof ListOrganizationInvitationsPageResponse
|
|
543
|
+
>;
|
|
544
|
+
export const AcceptOrganizationInvitationResponse = z.object({
|
|
545
|
+
invitation: OrganizationInvitation,
|
|
546
|
+
membership: OrganizationMember,
|
|
547
|
+
});
|
|
548
|
+
export type AcceptOrganizationInvitationResponse = z.infer<
|
|
549
|
+
typeof AcceptOrganizationInvitationResponse
|
|
550
|
+
>;
|
|
551
|
+
export const ListOrganizationMembersResponse = z.object({
|
|
552
|
+
members: z.array(OrganizationMember),
|
|
553
|
+
});
|
|
554
|
+
export const ListOrganizationAdministrationMembersResponse = z.object({
|
|
555
|
+
members: z.array(OrganizationAdministrationMember).max(1000),
|
|
556
|
+
});
|
|
557
|
+
export const ListSelfOrganizationMembershipsResponse = z.object({
|
|
558
|
+
memberships: z.array(OrganizationMember),
|
|
559
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Server-parsed only; kept off the root contracts index so browser bundles that
|
|
2
|
+
// import the root never carry these schemas.
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import { OrganizationUsagePeriod, OrganizationUsageQuery } from "./organization-usage";
|
|
6
|
+
|
|
7
|
+
const BigIntString = z.string().regex(/^\d+$/);
|
|
8
|
+
const OrganizationModelUsageBillingPath = z.enum(["opengeni_credits", "external"]);
|
|
9
|
+
|
|
10
|
+
/** Exact per-billing-path sums from per-call model facts; bigint sums stay strings. */
|
|
11
|
+
export const OrganizationModelUsageTotals = z.object({
|
|
12
|
+
billingPath: OrganizationModelUsageBillingPath,
|
|
13
|
+
calls: BigIntString,
|
|
14
|
+
inputTokens: BigIntString,
|
|
15
|
+
outputTokens: BigIntString,
|
|
16
|
+
cachedTokens: BigIntString,
|
|
17
|
+
cacheInputTokens: BigIntString,
|
|
18
|
+
cacheWriteTokens: BigIntString,
|
|
19
|
+
totalTokens: BigIntString,
|
|
20
|
+
tokenKnownCalls: BigIntString,
|
|
21
|
+
cacheKnownCalls: BigIntString,
|
|
22
|
+
creditMicros: BigIntString,
|
|
23
|
+
estimatedProviderMicros: BigIntString,
|
|
24
|
+
estimatedProviderKnownCalls: BigIntString,
|
|
25
|
+
});
|
|
26
|
+
export type OrganizationModelUsageTotals = z.infer<typeof OrganizationModelUsageTotals>;
|
|
27
|
+
|
|
28
|
+
export const OrganizationModelUsageQuery = OrganizationUsageQuery.extend({
|
|
29
|
+
afterWorkspaceId: z.string().uuid().optional(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const OrganizationModelUsage = z.object({
|
|
33
|
+
accountId: z.string().uuid(),
|
|
34
|
+
period: OrganizationUsagePeriod,
|
|
35
|
+
since: z.string().datetime(),
|
|
36
|
+
until: z.string().datetime(),
|
|
37
|
+
billing: z.array(OrganizationModelUsageTotals).max(2),
|
|
38
|
+
/** Exact uncapped per-fact payer split; independent of the top-model list. */
|
|
39
|
+
payers: z
|
|
40
|
+
.array(
|
|
41
|
+
OrganizationModelUsageTotals.omit({ billingPath: true }).extend({
|
|
42
|
+
payer: z.enum(["opengeni_credits", "subscription", "own_key"]),
|
|
43
|
+
}),
|
|
44
|
+
)
|
|
45
|
+
.default([]),
|
|
46
|
+
models: z
|
|
47
|
+
.array(
|
|
48
|
+
z.object({
|
|
49
|
+
provider: z.string(),
|
|
50
|
+
model: z.string(),
|
|
51
|
+
totals: OrganizationModelUsageTotals,
|
|
52
|
+
}),
|
|
53
|
+
)
|
|
54
|
+
.max(50),
|
|
55
|
+
modelsTruncated: z.boolean(),
|
|
56
|
+
workspaces: z
|
|
57
|
+
.array(
|
|
58
|
+
z.object({
|
|
59
|
+
workspaceId: z.string().uuid(),
|
|
60
|
+
name: z.string().nullable(),
|
|
61
|
+
billing: z.array(OrganizationModelUsageTotals).max(2),
|
|
62
|
+
}),
|
|
63
|
+
)
|
|
64
|
+
.max(50),
|
|
65
|
+
/** Every Personal workspace, aggregated; individual Personal workspaces are never named. */
|
|
66
|
+
personal: z.object({
|
|
67
|
+
workspacesWithUsage: BigIntString,
|
|
68
|
+
billing: z.array(OrganizationModelUsageTotals).max(2),
|
|
69
|
+
}),
|
|
70
|
+
nextWorkspaceCursor: z.string().uuid().nullable(),
|
|
71
|
+
});
|
|
72
|
+
export type OrganizationModelUsage = z.infer<typeof OrganizationModelUsage>;
|