@treeseed/sdk 0.10.12 → 0.10.13
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/api/auth/d1-store.js +20 -1
- package/dist/db/market-schema.d.ts +7515 -6263
- package/dist/db/market-schema.js +71 -15
- package/dist/index.d.ts +3 -1
- package/dist/index.js +18 -0
- package/dist/market-client.d.ts +107 -0
- package/dist/market-client.js +91 -1
- package/dist/operations/services/deploy.js +3 -0
- package/dist/operations/services/github-api.d.ts +83 -0
- package/dist/operations/services/github-api.js +167 -0
- package/dist/operations/services/mailpit-runtime.d.ts +13 -2
- package/dist/operations/services/mailpit-runtime.js +19 -14
- package/dist/operations/services/project-web-monitor.d.ts +15 -0
- package/dist/operations/services/project-web-monitor.js +260 -0
- package/dist/operations/services/railway-api.js +2 -2
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +11 -1
- package/dist/platform-operation-store.d.ts +4 -0
- package/dist/platform-operation-store.js +29 -3
- package/dist/platform-operations.d.ts +8 -0
- package/dist/platform-operations.js +19 -0
- package/dist/remote.js +6 -6
- package/dist/scripts/test-cloudflare-local.js +1 -1
- package/dist/scripts/workspace-command-e2e.js +3 -1
- package/dist/sdk-types.d.ts +109 -1
- package/dist/sdk-types.js +5 -1
- package/drizzle/market/0000_market_control_plane.sql +80 -14
- package/drizzle/market/0002_user_email_addresses.sql +26 -0
- package/package.json +1 -1
package/dist/db/market-schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { index, integer, pgTable, primaryKey, real, serial, text, uniqueIndex } from "drizzle-orm/pg-core";
|
|
1
|
+
import { bigint, index, integer, pgTable, primaryKey, real, serial, text, uniqueIndex } from "drizzle-orm/pg-core";
|
|
2
2
|
const subscribers = pgTable("subscribers", {
|
|
3
3
|
email: text("email").primaryKey(),
|
|
4
4
|
createdAt: text("created_at").notNull()
|
|
@@ -130,6 +130,21 @@ const userIdentities = pgTable("user_identities", {
|
|
|
130
130
|
}, (table) => [
|
|
131
131
|
uniqueIndex("idx_user_identities_provider_subject").on(table.provider, table.providerSubject)
|
|
132
132
|
]);
|
|
133
|
+
const userEmailAddresses = pgTable("user_email_addresses", {
|
|
134
|
+
id: text("id").primaryKey(),
|
|
135
|
+
userId: text("user_id").notNull(),
|
|
136
|
+
email: text("email").notNull(),
|
|
137
|
+
normalizedEmail: text("normalized_email").notNull().unique(),
|
|
138
|
+
status: text("status").notNull().default("pending"),
|
|
139
|
+
isPrimary: integer("is_primary").notNull().default(0),
|
|
140
|
+
verificationRequestedAt: text("verification_requested_at"),
|
|
141
|
+
verifiedAt: text("verified_at"),
|
|
142
|
+
createdAt: text("created_at").notNull(),
|
|
143
|
+
updatedAt: text("updated_at").notNull()
|
|
144
|
+
}, (table) => [
|
|
145
|
+
index("idx_user_email_addresses_user").on(table.userId, table.status, table.isPrimary),
|
|
146
|
+
uniqueIndex("idx_user_email_addresses_normalized").on(table.normalizedEmail)
|
|
147
|
+
]);
|
|
133
148
|
const roles = pgTable("roles", {
|
|
134
149
|
id: text("id").primaryKey(),
|
|
135
150
|
keyColumn: text("key").notNull().unique(),
|
|
@@ -511,22 +526,59 @@ const projectInfrastructureResources = pgTable("project_infrastructure_resources
|
|
|
511
526
|
]);
|
|
512
527
|
const projectDeployments = pgTable("project_deployments", {
|
|
513
528
|
id: text("id").primaryKey(),
|
|
529
|
+
teamId: text("team_id").notNull(),
|
|
514
530
|
projectId: text("project_id").notNull(),
|
|
515
531
|
environment: text("environment").notNull(),
|
|
516
532
|
deploymentKind: text("deployment_kind").notNull(),
|
|
533
|
+
action: text("action").notNull().default("deploy_web"),
|
|
517
534
|
status: text("status").notNull(),
|
|
535
|
+
platformOperationId: text("platform_operation_id"),
|
|
536
|
+
retryOfDeploymentId: text("retry_of_deployment_id"),
|
|
537
|
+
resumedFromDeploymentId: text("resumed_from_deployment_id"),
|
|
538
|
+
idempotencyKey: text("idempotency_key"),
|
|
539
|
+
requestedByUserId: text("requested_by_user_id"),
|
|
518
540
|
sourceRef: text("source_ref"),
|
|
519
541
|
releaseTag: text("release_tag"),
|
|
520
542
|
commitSha: text("commit_sha"),
|
|
521
543
|
triggeredByType: text("triggered_by_type"),
|
|
522
544
|
triggeredById: text("triggered_by_id"),
|
|
545
|
+
repositoryJson: text("repository_json").notNull().default("{}"),
|
|
546
|
+
externalWorkflowJson: text("external_workflow_json").notNull().default("{}"),
|
|
547
|
+
targetJson: text("target_json").notNull().default("{}"),
|
|
548
|
+
monitorJson: text("monitor_json").notNull().default("{}"),
|
|
549
|
+
summary: text("summary"),
|
|
550
|
+
errorJson: text("error_json").notNull().default("{}"),
|
|
523
551
|
metadataJson: text("metadata_json"),
|
|
524
552
|
startedAt: text("started_at"),
|
|
525
553
|
finishedAt: text("finished_at"),
|
|
526
554
|
createdAt: text("created_at").notNull(),
|
|
527
|
-
updatedAt: text("updated_at").notNull()
|
|
555
|
+
updatedAt: text("updated_at").notNull(),
|
|
556
|
+
completedAt: text("completed_at")
|
|
557
|
+
}, (table) => [
|
|
558
|
+
index("idx_project_deployments_project_created").on(table.projectId, table.createdAt),
|
|
559
|
+
index("idx_project_deployments_project_environment").on(table.projectId, table.environment, table.createdAt),
|
|
560
|
+
index("idx_project_deployments_project_status").on(table.projectId, table.status, table.updatedAt),
|
|
561
|
+
index("idx_project_deployments_operation").on(table.platformOperationId),
|
|
562
|
+
index("idx_project_deployments_team_created").on(table.teamId, table.createdAt),
|
|
563
|
+
uniqueIndex("idx_project_deployments_idempotency").on(table.projectId, table.idempotencyKey)
|
|
564
|
+
]);
|
|
565
|
+
const projectDeploymentEvents = pgTable("project_deployment_events", {
|
|
566
|
+
id: text("id").primaryKey(),
|
|
567
|
+
deploymentId: text("deployment_id").notNull(),
|
|
568
|
+
projectId: text("project_id").notNull(),
|
|
569
|
+
teamId: text("team_id").notNull(),
|
|
570
|
+
operationId: text("operation_id"),
|
|
571
|
+
kind: text("kind").notNull(),
|
|
572
|
+
message: text("message").notNull(),
|
|
573
|
+
status: text("status"),
|
|
574
|
+
severity: text("severity").notNull().default("info"),
|
|
575
|
+
sequence: integer("sequence").notNull(),
|
|
576
|
+
payloadJson: text("payload_json").notNull().default("{}"),
|
|
577
|
+
createdAt: text("created_at").notNull()
|
|
528
578
|
}, (table) => [
|
|
529
|
-
index("
|
|
579
|
+
index("idx_project_deployment_events_deployment_sequence").on(table.deploymentId, table.sequence),
|
|
580
|
+
index("idx_project_deployment_events_project_created").on(table.projectId, table.createdAt),
|
|
581
|
+
index("idx_project_deployment_events_operation").on(table.operationId)
|
|
530
582
|
]);
|
|
531
583
|
const agentPools = pgTable("agent_pools", {
|
|
532
584
|
id: text("id").primaryKey(),
|
|
@@ -702,8 +754,8 @@ const betterAuthUser = pgTable("better_auth_user", {
|
|
|
702
754
|
email: text("email").notNull().unique(),
|
|
703
755
|
emailVerified: integer("emailVerified").notNull().default(0),
|
|
704
756
|
image: text("image"),
|
|
705
|
-
createdAt:
|
|
706
|
-
updatedAt:
|
|
757
|
+
createdAt: bigint("createdAt", { mode: "number" }).notNull(),
|
|
758
|
+
updatedAt: bigint("updatedAt", { mode: "number" }).notNull(),
|
|
707
759
|
username: text("username"),
|
|
708
760
|
firstName: text("firstName"),
|
|
709
761
|
lastName: text("lastName")
|
|
@@ -712,10 +764,10 @@ const betterAuthUser = pgTable("better_auth_user", {
|
|
|
712
764
|
]);
|
|
713
765
|
const betterAuthSession = pgTable("better_auth_session", {
|
|
714
766
|
id: text("id").primaryKey(),
|
|
715
|
-
expiresAt:
|
|
767
|
+
expiresAt: bigint("expiresAt", { mode: "number" }).notNull(),
|
|
716
768
|
token: text("token").notNull().unique(),
|
|
717
|
-
createdAt:
|
|
718
|
-
updatedAt:
|
|
769
|
+
createdAt: bigint("createdAt", { mode: "number" }).notNull(),
|
|
770
|
+
updatedAt: bigint("updatedAt", { mode: "number" }).notNull(),
|
|
719
771
|
ipAddress: text("ipAddress"),
|
|
720
772
|
userAgent: text("userAgent"),
|
|
721
773
|
userId: text("userId").notNull()
|
|
@@ -731,12 +783,12 @@ const betterAuthAccount = pgTable("better_auth_account", {
|
|
|
731
783
|
accessToken: text("accessToken"),
|
|
732
784
|
refreshToken: text("refreshToken"),
|
|
733
785
|
idToken: text("idToken"),
|
|
734
|
-
accessTokenExpiresAt:
|
|
735
|
-
refreshTokenExpiresAt:
|
|
786
|
+
accessTokenExpiresAt: bigint("accessTokenExpiresAt", { mode: "number" }),
|
|
787
|
+
refreshTokenExpiresAt: bigint("refreshTokenExpiresAt", { mode: "number" }),
|
|
736
788
|
scope: text("scope"),
|
|
737
789
|
password: text("password"),
|
|
738
|
-
createdAt:
|
|
739
|
-
updatedAt:
|
|
790
|
+
createdAt: bigint("createdAt", { mode: "number" }).notNull(),
|
|
791
|
+
updatedAt: bigint("updatedAt", { mode: "number" }).notNull()
|
|
740
792
|
}, (table) => [
|
|
741
793
|
index("idx_better_auth_account_userId").on(table.userId),
|
|
742
794
|
uniqueIndex("idx_better_auth_account_provider_account").on(table.providerId, table.accountId)
|
|
@@ -745,9 +797,9 @@ const betterAuthVerification = pgTable("better_auth_verification", {
|
|
|
745
797
|
id: text("id").primaryKey(),
|
|
746
798
|
identifier: text("identifier").notNull(),
|
|
747
799
|
value: text("value").notNull(),
|
|
748
|
-
expiresAt:
|
|
749
|
-
createdAt:
|
|
750
|
-
updatedAt:
|
|
800
|
+
expiresAt: bigint("expiresAt", { mode: "number" }).notNull(),
|
|
801
|
+
createdAt: bigint("createdAt", { mode: "number" }).notNull(),
|
|
802
|
+
updatedAt: bigint("updatedAt", { mode: "number" }).notNull()
|
|
751
803
|
}, (table) => [
|
|
752
804
|
index("idx_better_auth_verification_identifier").on(table.identifier)
|
|
753
805
|
]);
|
|
@@ -1623,6 +1675,7 @@ const treeseedMarketSchema = {
|
|
|
1623
1675
|
reports,
|
|
1624
1676
|
users,
|
|
1625
1677
|
userIdentities,
|
|
1678
|
+
userEmailAddresses,
|
|
1626
1679
|
roles,
|
|
1627
1680
|
permissions,
|
|
1628
1681
|
rolePermissions,
|
|
@@ -1652,6 +1705,7 @@ const treeseedMarketSchema = {
|
|
|
1652
1705
|
projectEnvironments,
|
|
1653
1706
|
projectInfrastructureResources,
|
|
1654
1707
|
projectDeployments,
|
|
1708
|
+
projectDeploymentEvents,
|
|
1655
1709
|
agentPools,
|
|
1656
1710
|
agentPoolRegistrations,
|
|
1657
1711
|
agentPoolScaleDecisions,
|
|
@@ -1770,6 +1824,7 @@ export {
|
|
|
1770
1824
|
prioritySnapshots,
|
|
1771
1825
|
projectCapabilityGrants,
|
|
1772
1826
|
projectConnections,
|
|
1827
|
+
projectDeploymentEvents,
|
|
1773
1828
|
projectDeployments,
|
|
1774
1829
|
projectEnvironments,
|
|
1775
1830
|
projectHosting,
|
|
@@ -1809,6 +1864,7 @@ export {
|
|
|
1809
1864
|
teamWebHosts,
|
|
1810
1865
|
teams,
|
|
1811
1866
|
treeseedMarketSchema,
|
|
1867
|
+
userEmailAddresses,
|
|
1812
1868
|
userIdentities,
|
|
1813
1869
|
userPreferences,
|
|
1814
1870
|
userRoleBindings,
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from './seeds/index.ts';
|
|
|
7
7
|
export { CAPACITY_PROVIDER_ENDPOINTS, CAPACITY_PROVIDER_DEPLOYMENT_SERVICE_ROLES, CAPACITY_PROVIDER_ENV_KEYS, CAPACITY_PROVIDER_SCOPES, CapacityProviderApiError, MarketProviderClient, assertCapacityProviderOkEnvelope, assertCapacityProviderPortfolioManifest, assertCapacityProviderRegistrationResponse, buildCapacityProviderAuthHeaders, deployCapacityProviderToManagedMarketHost, deployCapacityProviderToRailway, isCapacityProviderSecretEnvKey, redactCapacityProviderEnv, redactCapacityProviderSecret, renderCapacityProviderSelfHostInstructions, persistCapacityProviderConnectionToTreeseedConfig, resolveCapacityProviderEnvironment, resolveCapacityProviderLaunchEnvironment, } from './capacity-provider.ts';
|
|
8
8
|
export { PLATFORM_OPERATION_ENDPOINTS, PLATFORM_OPERATION_NAMESPACES, PLATFORM_OPERATION_SCOPES, PLATFORM_OPERATION_STATUSES, PLATFORM_OPERATION_TARGETS, PlatformOperationApiError, PlatformRunnerClient, assertPlatformOperation, assertPlatformOperationEvent, assertPlatformOperationOkEnvelope, buildPlatformRunnerAuthHeaders, createPlatformOperationExecutorRegistry, derivePlatformOperationNavigation, isPlatformOperationSuccessful, isPlatformOperationTerminal, pollPlatformOperation, runPlatformOperationOnce, type PlatformOperation, type PlatformOperationEvent, type PlatformOperationNavigationResult, type PlatformOperationPollOptions, type PlatformOperationPollResult, } from './platform-operations.ts';
|
|
9
9
|
export { PLATFORM_CONTENT_COLLECTIONS, PLATFORM_WORK_CONTENT_COLLECTIONS, createPlatformRepositoryClaim, derivePlatformRepositoryKey, executePlatformRepositoryOperation, normalizePlatformContentInput, normalizePlatformRelationArray, platformContentRelationPolicy, resolvePlatformRepositoryWorkspacePath, slugifyPlatformContent, type PlatformContentCollection, type PlatformRepositoryClaim, type PlatformRepositoryClaimInput, type PlatformRepositoryDescriptor, type PlatformRepositoryOperationInput, type PlatformRepositoryOperationOptions, type PlatformRepositoryOperationResult, type PlatformRepositoryPathPolicy, type PlatformRepositoryVerificationCommand, type PlatformRepositoryVerificationResult, type NormalizedPlatformContentInput, } from './operations/repository-operations.ts';
|
|
10
|
+
export { cancelGitHubWorkflowRun, dispatchGitHubWorkflowRun, formatGitHubWorkflowFailure, getGitHubWorkflowFileStatus, getLatestGitHubWorkflowRun, waitForGitHubWorkflowRunCompletion, type GitHubWorkflowCancellationResult, type GitHubWorkflowDispatchResult, type GitHubWorkflowFailureSummary, type GitHubWorkflowFailureSummaryInput, type GitHubWorkflowFileStatus, type GitHubWorkflowProgressEvent, } from './operations/services/github-api.ts';
|
|
11
|
+
export { buildProjectWebMonitorResult, } from './operations/services/project-web-monitor.ts';
|
|
10
12
|
export { DEFAULT_EXECUTION_PROFILE_ID, DEFAULT_EXECUTION_PROFILES, DEFAULT_TASK_ADMISSION_POLICY, buildTaskEstimateProfileFromActuals, computeWorkdayBudgetEnvelope, decideTaskAdmission, estimateAttentionForTask, estimateConfidenceFromProfile, estimateLearningPercentile, estimateLearningVariance, estimateForClassification, estimateProfileConfidenceScore, estimateUtilityForTask, isInterruptedUsageActual, normalizeHybridExecutionPlan, mutationRequiresRepositoryClaim, normalizePlanningPolicy, normalizePredictiveReservePolicy, normalizeTaskPlanProposal, normalizeExecutionProfile, normalizeAttentionPolicy, normalizeTaskAdmissionPolicy, normalizeUtilityPolicy, predictReserveForCapacityPlan, progressivelyAdmitPlanProposal, rankPlannedTaskNodes, reservationHasCapacity, reserveCreditsForEstimate, routeAndReserveCapacity, scoreCapacityLane, selectBestCapacityLane, selectTaskEstimateProfile, ACTUAL_CREDIT_FORMULA_VERSION, buildCreditConversionProfileFromActuals, calculateActualCredits, deriveAvailableCredits, nativeUsageAmount, nativeUsageUnit, selectCreditConversionProfile, settleCapacityActuals, shouldInterruptForCapacity, synthesizePlanEstimate, createReservationReleaseEntry, summarizeCapacityPlan, summarizeProjectCapacityPlan, summarizeTeamCapacityPlan, validateTaskPlanProposal, } from './capacity.ts';
|
|
11
13
|
export { executeKnowledgeHubProviderLaunch, validateKnowledgeHubProviderLaunchPrerequisites, } from './operations/services/hub-provider-launch.ts';
|
|
12
14
|
export { createKnowledgeHubRepositories, defaultHubContentResolutionPolicy, executeKnowledgeHubLaunch, normalizeKnowledgeHubLaunchIntent, planKnowledgeHubLaunch, planKnowledgeHubRepositories, validateRepositoryHost, type HubContentResolutionPolicy, type KnowledgeHubLaunchIntent, type KnowledgeHubLaunchPhase, type KnowledgeHubLaunchPlan, type KnowledgeHubLaunchResult, type KnowledgeHubRepositoryPlan, type RepositoryHost, } from './operations/services/hub-launch.ts';
|
|
@@ -38,7 +40,7 @@ export { TreeseedWorkflowSdk } from './workflow.ts';
|
|
|
38
40
|
export * from './db/index.ts';
|
|
39
41
|
export { collectTreeseedReconcileStatus, createTreeseedReconcileRegistry, deriveTreeseedDesiredUnits, destroyTreeseedTargetUnits, observeTreeseedUnits, planTreeseedReconciliation, reconcileTreeseedTarget, } from './reconcile/index.ts';
|
|
40
42
|
export { getTreeseedVerifyDriverStatus, runTreeseedVerifyDriver } from './verification.ts';
|
|
41
|
-
export type { KnowledgeHubProviderLaunchPreflightReport, KnowledgeHubProviderLaunchFailurePhase, KnowledgeHubProviderLaunchInput, KnowledgeHubProviderLaunchResult, AgentMessageKind, AgentMessageRecord, AgentStatusRecord, DirectBoardItemSummary, InboxItem, ProjectJobStatus, LaunchProjectRequest, LaunchProjectResult, LinkedProjectRecordRef, ProjectConnectionStatus, ProjectOverviewSummary, ReleaseDetail, ReleaseState, ReleaseSummary, SharePackageState, SharePackageStatus, TeamCapability, TeamHomeSummary, TeamMemberSummary, WorkstreamDetail, WorkstreamEvent, WorkstreamState, WorkstreamSummary, SdkContentEntry, SdkDispatchCapability, SdkDispatchConfig, SdkDispatchCredentialSource, SdkDispatchExecutionClass, SdkDispatchNamespace, SdkDispatchPolicy, SdkDispatchRequest, SdkDispatchResult, SdkDispatchTarget, SdkCursorEntity, SdkFilterCondition, SdkFollowRequest, SdkGraphEdge, SdkGraphEdgeType, SdkGraphDslRelation, SdkGraphDslParseResult, SdkGraphModelConfig, SdkGraphNode, SdkGraphNodeType, SdkGraphPathExplanation, SdkGraphQueryStage, SdkGraphQueryView, SdkGraphQueryOptions, SdkGraphQueryRequest, SdkGraphQueryResult, SdkGraphRankingBuildInput, SdkGraphRankingDiagnostics, SdkGraphRankingIndex, SdkGraphRankingNodeResult, SdkGraphRankingProvider, SdkGraphRankingQueryRequest, SdkGraphRankingQueryResult, SdkGraphRankingSearchRequest, SdkGraphRefreshPayload, SdkGraphRefreshRequest, SdkGraphSearchOptions, SdkGraphSearchResult, SdkGraphSeed, SdkGraphSeedResolution, SdkGraphTraversalResult, SdkGraphWhereFilter, SdkContextPack, SdkContextPackRequest, SdkGetRequest, SdkJsonEnvelope, SdkLeaseEntity, SdkManagerContextPayload, SdkMessageEntity, SdkModelFieldBinding, SdkModelDefinition, SdkModelRegistry, SdkModelName, SdkMutationRequest, SdkOperation, SdkPickRequest, SdkPickResult, SdkQueueMessageEnvelope, SdkRunEntity, SdkSearchRequest, SdkTaskEntity, SdkTaskEventEntity, SdkTaskOutputEntity, SdkWorkDayEntity, SdkGraphRunEntity, SdkReportEntity, SdkSubscriptionEntity, SdkTemplateCatalogEntry, SdkTemplateCatalogPublisher, SdkTemplateCatalogResponse, SdkTemplateCatalogSource, SdkUpdateRequest, ProjectCapabilityGrant, ProjectConnection, ProjectConnectionMode, ProjectDeployment, ProjectDeploymentKind, ProjectDeploymentStatus, ProjectEnvironment, ProjectExecutionOwner, ProjectHosting, ProjectInfrastructureResource, ProjectInfrastructureResourceKind, ProjectInfrastructureResourceProvider, ProjectRunnerRegistrationState, RemoteJob, RemoteJobEvent, RemoteJobStatus, AgentPool, AgentPoolAutoscalePolicy, AgentPoolRegistration, AgentPoolScaleDecision, AgentPoolStatus, CatalogArtifactVersion, CatalogItem, CatalogItemFilters, CatalogItemOfferMode, ProjectEnvironmentName, ProjectWorkdaySummary, TreeseedHostingKind, TreeseedHostingRegistration, PriorityOverride, WorkdayWindow, WorkdaySchedule, WorkdayRequest, WorkdayManagerLease, WorkerRunner, WorkerRunnerState, RepositoryClaim, TaskCreditWeight, TaskCreditBudget, WorkdayPolicy, PrioritySnapshotItem, PrioritySnapshot, TaskCreditLedgerEntry, ApprovalRequest, DecideApprovalRequestRequest, ListApprovalRequestsRequest, CapacityBusinessModel, CapacityGrant, CapacityGrantScope, CapacityLedgerEntry, CapacityLaneUnit, CapacityPlan, CapacityProvider, CapacityProviderHost, CapacityProviderKind, CapacityProviderLane, CapacityReservation, CapacityRoutingDecision, CapacityTaskExecutionEnvelope, CanonicalTaskState, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, CreateTaskEstimateRequest, CreateTaskUsageActualRequest, CreditConversionProfile, DerivedCapacityAvailability, DerivedCapacityInput, DerivedCapacitySummary, NativeUsageObservation, UpsertTeamInboxItemRequest, ExecutionProfile, HybridExecutionPhase, HybridExecutionPlan, PlannedTaskNode, PlanningAdmissionResult, PlanningPolicy, PredictiveReservePolicy, RecordCapacityUsageRequest, RepositoryWorkState, ReservePrediction, TaskAdmissionDecision, TaskAdmissionOutcome, TaskAdmissionPolicy, TaskClassification, TaskEstimate, TaskEstimateProfile, TaskCheckpointArtifact, TaskConcurrencyClass, TaskPlanProposal, TaskMutationScope, TaskRiskClass, TaskUsageActual, UtilityEstimate, UtilityPolicy, UpsertCapacityGrantRequest, UpsertCapacityProviderHostRequest, UpsertCapacityProviderLaneRequest, UpsertCapacityProviderRequest, ScaleDecision, RunnerScaleDecision, TeamStorageLocator, TeamWebHost, TeamWebHostOwnership, TeamWebHostProvider, EncryptedWebHostPayload, UpsertAgentPoolRequest, UpsertCatalogArtifactVersionRequest, UpsertCatalogItemRequest, UpsertProjectEnvironmentRequest, UpsertProjectHostingRequest, UpsertProjectInfrastructureResourceRequest, UpsertTeamStorageLocatorRequest, UpsertTeamWebHostRequest, CreateProjectDeploymentRequest, RecordAgentPoolRegistrationRequest, SdkAppendTaskEventRequest, SdkClaimTaskRequest, SdkCreateWorkdayRequest, SdkCloseWorkDayRequest, SdkCompleteTaskRequest, SdkCreateTaskRequest, SdkFailTaskRequest, SdkManagerContextPayload, SdkClaimWorkdayManagerLeaseRequest, SdkReleaseWorkdayManagerLeaseRequest, SdkRecordWorkerRunnerRequest, SdkRecordRepositoryClaimRequest, SdkRecordRunnerScaleDecisionRequest, SdkStartWorkDayRequest, SdkTaskEntity, SdkTaskEventEntity, SdkTaskOutputEntity, SdkTaskProgressRequest, SdkTaskSearchRequest, SdkUpdateWorkDayGraphRequest, SdkWorkDayEntity, WorkerPoolScaleResult, WorkerPoolScaler, } from './sdk-types.ts';
|
|
43
|
+
export type { KnowledgeHubProviderLaunchPreflightReport, KnowledgeHubProviderLaunchFailurePhase, KnowledgeHubProviderLaunchInput, KnowledgeHubProviderLaunchResult, AgentMessageKind, AgentMessageRecord, AgentStatusRecord, DirectBoardItemSummary, InboxItem, ProjectJobStatus, LaunchProjectRequest, LaunchProjectResult, LinkedProjectRecordRef, ProjectConnectionStatus, ProjectOverviewSummary, ReleaseDetail, ReleaseState, ReleaseSummary, SharePackageState, SharePackageStatus, TeamCapability, TeamHomeSummary, TeamMemberSummary, WorkstreamDetail, WorkstreamEvent, WorkstreamState, WorkstreamSummary, SdkContentEntry, SdkDispatchCapability, SdkDispatchConfig, SdkDispatchCredentialSource, SdkDispatchExecutionClass, SdkDispatchNamespace, SdkDispatchPolicy, SdkDispatchRequest, SdkDispatchResult, SdkDispatchTarget, SdkCursorEntity, SdkFilterCondition, SdkFollowRequest, SdkGraphEdge, SdkGraphEdgeType, SdkGraphDslRelation, SdkGraphDslParseResult, SdkGraphModelConfig, SdkGraphNode, SdkGraphNodeType, SdkGraphPathExplanation, SdkGraphQueryStage, SdkGraphQueryView, SdkGraphQueryOptions, SdkGraphQueryRequest, SdkGraphQueryResult, SdkGraphRankingBuildInput, SdkGraphRankingDiagnostics, SdkGraphRankingIndex, SdkGraphRankingNodeResult, SdkGraphRankingProvider, SdkGraphRankingQueryRequest, SdkGraphRankingQueryResult, SdkGraphRankingSearchRequest, SdkGraphRefreshPayload, SdkGraphRefreshRequest, SdkGraphSearchOptions, SdkGraphSearchResult, SdkGraphSeed, SdkGraphSeedResolution, SdkGraphTraversalResult, SdkGraphWhereFilter, SdkContextPack, SdkContextPackRequest, SdkGetRequest, SdkJsonEnvelope, SdkLeaseEntity, SdkManagerContextPayload, SdkMessageEntity, SdkModelFieldBinding, SdkModelDefinition, SdkModelRegistry, SdkModelName, SdkMutationRequest, SdkOperation, SdkPickRequest, SdkPickResult, SdkQueueMessageEnvelope, SdkRunEntity, SdkSearchRequest, SdkTaskEntity, SdkTaskEventEntity, SdkTaskOutputEntity, SdkWorkDayEntity, SdkGraphRunEntity, SdkReportEntity, SdkSubscriptionEntity, SdkTemplateCatalogEntry, SdkTemplateCatalogPublisher, SdkTemplateCatalogResponse, SdkTemplateCatalogSource, SdkUpdateRequest, ProjectCapabilityGrant, ProjectConnection, ProjectConnectionMode, ProjectDeployment, ProjectDeploymentActionAvailability, ProjectDeploymentEnvironment, ProjectDeploymentEvent, ProjectDeploymentKind, ProjectDeploymentReadiness, ProjectDeploymentStatus, ProjectEnvironment, ProjectExecutionOwner, ProjectWebDeploymentAction, ProjectWebMonitorCheck, ProjectWebMonitorCheckSource, ProjectWebMonitorCheckStatus, ProjectWebMonitorResult, ProjectWebMonitorStatus, ProjectHosting, ProjectInfrastructureResource, ProjectInfrastructureResourceKind, ProjectInfrastructureResourceProvider, ProjectRunnerRegistrationState, RemoteJob, RemoteJobEvent, RemoteJobStatus, AgentPool, AgentPoolAutoscalePolicy, AgentPoolRegistration, AgentPoolScaleDecision, AgentPoolStatus, CatalogArtifactVersion, CatalogItem, CatalogItemFilters, CatalogItemOfferMode, ProjectEnvironmentName, ProjectWorkdaySummary, TreeseedHostingKind, TreeseedHostingRegistration, PriorityOverride, WorkdayWindow, WorkdaySchedule, WorkdayRequest, WorkdayManagerLease, WorkerRunner, WorkerRunnerState, RepositoryClaim, TaskCreditWeight, TaskCreditBudget, WorkdayPolicy, PrioritySnapshotItem, PrioritySnapshot, TaskCreditLedgerEntry, ApprovalRequest, DecideApprovalRequestRequest, ListApprovalRequestsRequest, CapacityBusinessModel, CapacityGrant, CapacityGrantScope, CapacityLedgerEntry, CapacityLaneUnit, CapacityPlan, CapacityProvider, CapacityProviderHost, CapacityProviderKind, CapacityProviderLane, CapacityReservation, CapacityRoutingDecision, CapacityTaskExecutionEnvelope, CanonicalTaskState, CreateApprovalRequestRequest, CreateCapacityReservationRequest, CreateCapacityRoutingDecisionRequest, CreateTaskEstimateRequest, CreateTaskUsageActualRequest, CreditConversionProfile, DerivedCapacityAvailability, DerivedCapacityInput, DerivedCapacitySummary, NativeUsageObservation, UpsertTeamInboxItemRequest, ExecutionProfile, HybridExecutionPhase, HybridExecutionPlan, PlannedTaskNode, PlanningAdmissionResult, PlanningPolicy, PredictiveReservePolicy, RecordCapacityUsageRequest, RepositoryWorkState, ReservePrediction, TaskAdmissionDecision, TaskAdmissionOutcome, TaskAdmissionPolicy, TaskClassification, TaskEstimate, TaskEstimateProfile, TaskCheckpointArtifact, TaskConcurrencyClass, TaskPlanProposal, TaskMutationScope, TaskRiskClass, TaskUsageActual, UtilityEstimate, UtilityPolicy, UpsertCapacityGrantRequest, UpsertCapacityProviderHostRequest, UpsertCapacityProviderLaneRequest, UpsertCapacityProviderRequest, ScaleDecision, RunnerScaleDecision, TeamStorageLocator, TeamWebHost, TeamWebHostOwnership, TeamWebHostProvider, EncryptedWebHostPayload, UpsertAgentPoolRequest, UpsertCatalogArtifactVersionRequest, UpsertCatalogItemRequest, UpsertProjectEnvironmentRequest, UpsertProjectHostingRequest, UpsertProjectInfrastructureResourceRequest, UpsertTeamStorageLocatorRequest, UpsertTeamWebHostRequest, CreateProjectDeploymentRequest, CreateProjectWebDeploymentRequest, CreateProjectWebDeploymentResponse, RecordAgentPoolRegistrationRequest, SdkAppendTaskEventRequest, SdkClaimTaskRequest, SdkCreateWorkdayRequest, SdkCloseWorkDayRequest, SdkCompleteTaskRequest, SdkCreateTaskRequest, SdkFailTaskRequest, SdkManagerContextPayload, SdkClaimWorkdayManagerLeaseRequest, SdkReleaseWorkdayManagerLeaseRequest, SdkRecordWorkerRunnerRequest, SdkRecordRepositoryClaimRequest, SdkRecordRunnerScaleDecisionRequest, SdkStartWorkDayRequest, SdkTaskEntity, SdkTaskEventEntity, SdkTaskOutputEntity, SdkTaskProgressRequest, SdkTaskSearchRequest, SdkUpdateWorkDayGraphRequest, SdkWorkDayEntity, WorkerPoolScaleResult, WorkerPoolScaler, } from './sdk-types.ts';
|
|
42
44
|
export type * from './project-workflow.ts';
|
|
43
45
|
export type { ControlPlaneAgentPoolHeartbeat, ControlPlaneDeploymentReport, ControlPlaneEnvironmentReport, ControlPlaneReporter, ControlPlaneReporterKind, ControlPlaneResourceReport, ControlPlaneScaleDecisionReport, ControlPlaneWorkdaySummaryReport, } from './control-plane.ts';
|
|
44
46
|
export type { ControlPlaneClientOptions } from './control-plane-client.ts';
|
package/dist/index.js
CHANGED
|
@@ -56,6 +56,17 @@ import {
|
|
|
56
56
|
resolvePlatformRepositoryWorkspacePath,
|
|
57
57
|
slugifyPlatformContent
|
|
58
58
|
} from "./operations/repository-operations.js";
|
|
59
|
+
import {
|
|
60
|
+
cancelGitHubWorkflowRun,
|
|
61
|
+
dispatchGitHubWorkflowRun,
|
|
62
|
+
formatGitHubWorkflowFailure,
|
|
63
|
+
getGitHubWorkflowFileStatus,
|
|
64
|
+
getLatestGitHubWorkflowRun,
|
|
65
|
+
waitForGitHubWorkflowRunCompletion
|
|
66
|
+
} from "./operations/services/github-api.js";
|
|
67
|
+
import {
|
|
68
|
+
buildProjectWebMonitorResult
|
|
69
|
+
} from "./operations/services/project-web-monitor.js";
|
|
59
70
|
import {
|
|
60
71
|
DEFAULT_EXECUTION_PROFILE_ID,
|
|
61
72
|
DEFAULT_EXECUTION_PROFILES,
|
|
@@ -377,10 +388,12 @@ export {
|
|
|
377
388
|
buildKnowledgePackMarketPackage,
|
|
378
389
|
buildModelRegistry,
|
|
379
390
|
buildPlatformRunnerAuthHeaders,
|
|
391
|
+
buildProjectWebMonitorResult,
|
|
380
392
|
buildScopedModelRegistry,
|
|
381
393
|
buildTaskEstimateProfileFromActuals,
|
|
382
394
|
buildTemplateMarketPackage,
|
|
383
395
|
calculateActualCredits,
|
|
396
|
+
cancelGitHubWorkflowRun,
|
|
384
397
|
canonicalizeFrontmatter,
|
|
385
398
|
clearMarketSession,
|
|
386
399
|
collectTreeseedDependencyStatus,
|
|
@@ -414,6 +427,7 @@ export {
|
|
|
414
427
|
derivePlatformRepositoryKey,
|
|
415
428
|
deriveTreeseedDesiredUnits,
|
|
416
429
|
destroyTreeseedTargetUnits,
|
|
430
|
+
dispatchGitHubWorkflowRun,
|
|
417
431
|
ensureRailwayEnvironment,
|
|
418
432
|
ensureRailwayProject,
|
|
419
433
|
ensureRailwayService,
|
|
@@ -431,7 +445,10 @@ export {
|
|
|
431
445
|
findDispatchCapability,
|
|
432
446
|
findSdkOperation,
|
|
433
447
|
findTreeseedOperation,
|
|
448
|
+
formatGitHubWorkflowFailure,
|
|
434
449
|
formatTreeseedDependencyReport,
|
|
450
|
+
getGitHubWorkflowFileStatus,
|
|
451
|
+
getLatestGitHubWorkflowRun,
|
|
435
452
|
getRailwayAuthProfile,
|
|
436
453
|
getTenantContentRoot,
|
|
437
454
|
getTreeseedVerifyDriverStatus,
|
|
@@ -559,5 +576,6 @@ export {
|
|
|
559
576
|
validateTaskPlanProposal,
|
|
560
577
|
verifyArtifactBytes,
|
|
561
578
|
verifyEditorialPreviewToken,
|
|
579
|
+
waitForGitHubWorkflowRunCompletion,
|
|
562
580
|
writeMarketRegistryState
|
|
563
581
|
};
|
package/dist/market-client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ApiPrincipal, DeviceCodePollRequest, DeviceCodePollResponse, DeviceCodeStartRequest, DeviceCodeStartResponse, TokenRefreshRequest, TokenRefreshResponse } from './remote.ts';
|
|
2
|
+
import type { CreateProjectWebDeploymentRequest, CreateProjectWebDeploymentResponse, ProjectDeployment, ProjectDeploymentActionAvailability, ProjectDeploymentEnvironment, ProjectDeploymentEvent, ProjectDeploymentReadiness, ProjectWebDeploymentAction } from './sdk-types.ts';
|
|
2
3
|
export declare const DEFAULT_TREESEED_MARKET_BASE_URL = "https://api.treeseed.ai";
|
|
3
4
|
export declare const TREESEED_CENTRAL_MARKET_API_BASE_URL_ENV = "TREESEED_CENTRAL_MARKET_API_BASE_URL";
|
|
4
5
|
export declare const TREESEED_MARKET_API_BASE_URL_ENV = "TREESEED_MARKET_API_BASE_URL";
|
|
@@ -26,6 +27,18 @@ export interface MarketWebAuthSession {
|
|
|
26
27
|
principal: ApiPrincipal;
|
|
27
28
|
session?: Record<string, unknown> | null;
|
|
28
29
|
}
|
|
30
|
+
export interface MarketUserEmailAddress {
|
|
31
|
+
id: string;
|
|
32
|
+
userId: string;
|
|
33
|
+
email: string;
|
|
34
|
+
status: string;
|
|
35
|
+
verified: boolean;
|
|
36
|
+
isPrimary: boolean;
|
|
37
|
+
verificationRequestedAt?: string | null;
|
|
38
|
+
verifiedAt?: string | null;
|
|
39
|
+
createdAt?: string | null;
|
|
40
|
+
updatedAt?: string | null;
|
|
41
|
+
}
|
|
29
42
|
export interface MarketRegistryState {
|
|
30
43
|
version: 1;
|
|
31
44
|
activeMarketId: string;
|
|
@@ -82,6 +95,34 @@ export interface IntegratedMarketCatalogResult<T extends Record<string, unknown>
|
|
|
82
95
|
error: string;
|
|
83
96
|
}>;
|
|
84
97
|
}
|
|
98
|
+
export interface MarketProjectDeploymentState {
|
|
99
|
+
ok: true;
|
|
100
|
+
project: Record<string, unknown>;
|
|
101
|
+
launch: Record<string, unknown> | null;
|
|
102
|
+
environments: unknown[];
|
|
103
|
+
repositories: unknown[];
|
|
104
|
+
hosts: unknown[];
|
|
105
|
+
runner: Record<string, unknown>;
|
|
106
|
+
latestDeployments: {
|
|
107
|
+
staging: ProjectDeployment | null;
|
|
108
|
+
prod: ProjectDeployment | null;
|
|
109
|
+
};
|
|
110
|
+
latestMonitors: {
|
|
111
|
+
staging: Record<string, unknown> | null;
|
|
112
|
+
prod: Record<string, unknown> | null;
|
|
113
|
+
};
|
|
114
|
+
activeOperations: ProjectDeployment[];
|
|
115
|
+
recentDeployments: ProjectDeployment[];
|
|
116
|
+
readiness: ProjectDeploymentReadiness;
|
|
117
|
+
actions: ProjectDeploymentActionAvailability[];
|
|
118
|
+
target: Record<string, unknown> | null;
|
|
119
|
+
}
|
|
120
|
+
export interface ProjectDeploymentListFilters {
|
|
121
|
+
environment?: ProjectDeploymentEnvironment | string | null;
|
|
122
|
+
action?: ProjectWebDeploymentAction | string | null;
|
|
123
|
+
status?: string | null;
|
|
124
|
+
limit?: number | string | null;
|
|
125
|
+
}
|
|
85
126
|
export interface MarketClientOptions {
|
|
86
127
|
profile: MarketProfile;
|
|
87
128
|
accessToken?: string | null;
|
|
@@ -155,6 +196,12 @@ export declare class MarketClient {
|
|
|
155
196
|
ok: true;
|
|
156
197
|
payload: MarketWebAuthSession;
|
|
157
198
|
}>;
|
|
199
|
+
confirmWebEmail(body: {
|
|
200
|
+
token: string;
|
|
201
|
+
}): Promise<{
|
|
202
|
+
ok: true;
|
|
203
|
+
payload: MarketWebAuthSession;
|
|
204
|
+
}>;
|
|
158
205
|
checkWebUsername(username: string): Promise<{
|
|
159
206
|
ok: true;
|
|
160
207
|
payload: {
|
|
@@ -163,6 +210,38 @@ export declare class MarketClient {
|
|
|
163
210
|
status: string;
|
|
164
211
|
};
|
|
165
212
|
}>;
|
|
213
|
+
webEmails(): Promise<{
|
|
214
|
+
ok: true;
|
|
215
|
+
payload: MarketUserEmailAddress[];
|
|
216
|
+
}>;
|
|
217
|
+
addWebEmail(body: {
|
|
218
|
+
email: string;
|
|
219
|
+
}): Promise<{
|
|
220
|
+
ok: true;
|
|
221
|
+
payload: {
|
|
222
|
+
emailAddress: MarketUserEmailAddress;
|
|
223
|
+
verificationSent: boolean;
|
|
224
|
+
confirmationToken?: string;
|
|
225
|
+
};
|
|
226
|
+
}>;
|
|
227
|
+
verifyWebEmail(emailId: string): Promise<{
|
|
228
|
+
ok: true;
|
|
229
|
+
payload: {
|
|
230
|
+
emailAddress: MarketUserEmailAddress;
|
|
231
|
+
verificationSent: boolean;
|
|
232
|
+
confirmationToken?: string;
|
|
233
|
+
};
|
|
234
|
+
}>;
|
|
235
|
+
setPrimaryWebEmail(emailId: string): Promise<{
|
|
236
|
+
ok: true;
|
|
237
|
+
payload: MarketWebAuthSession & {
|
|
238
|
+
emailAddress: MarketUserEmailAddress;
|
|
239
|
+
};
|
|
240
|
+
}>;
|
|
241
|
+
deleteWebEmail(emailId: string): Promise<{
|
|
242
|
+
ok: true;
|
|
243
|
+
payload: MarketUserEmailAddress[];
|
|
244
|
+
}>;
|
|
166
245
|
webSessions(): Promise<{
|
|
167
246
|
ok: true;
|
|
168
247
|
payload: unknown[];
|
|
@@ -286,6 +365,34 @@ export declare class MarketClient {
|
|
|
286
365
|
environments: ProjectEnvironmentAccess[];
|
|
287
366
|
};
|
|
288
367
|
}>;
|
|
368
|
+
projectDeploymentState(projectId: string): Promise<MarketProjectDeploymentState>;
|
|
369
|
+
projectDeployments(projectId: string, filters?: ProjectDeploymentListFilters): Promise<{
|
|
370
|
+
ok: true;
|
|
371
|
+
payload: ProjectDeployment[];
|
|
372
|
+
}>;
|
|
373
|
+
projectDeployment(projectId: string, deploymentId: string): Promise<{
|
|
374
|
+
ok: true;
|
|
375
|
+
payload: ProjectDeployment;
|
|
376
|
+
}>;
|
|
377
|
+
projectDeploymentEvents(projectId: string, deploymentId: string, options?: {
|
|
378
|
+
limit?: number | string | null;
|
|
379
|
+
}): Promise<{
|
|
380
|
+
ok: true;
|
|
381
|
+
payload: ProjectDeploymentEvent[];
|
|
382
|
+
}>;
|
|
383
|
+
createProjectWebDeployment(projectId: string, body: CreateProjectWebDeploymentRequest): Promise<CreateProjectWebDeploymentResponse>;
|
|
384
|
+
retryProjectDeployment(projectId: string, deploymentId: string, body?: Record<string, unknown>): Promise<{
|
|
385
|
+
ok: true;
|
|
386
|
+
originalDeployment: ProjectDeployment;
|
|
387
|
+
retryDeployment: ProjectDeployment;
|
|
388
|
+
operation: Record<string, unknown>;
|
|
389
|
+
}>;
|
|
390
|
+
resumeProjectDeployment(projectId: string, deploymentId: string, body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
391
|
+
cancelProjectDeployment(projectId: string, deploymentId: string, body?: Record<string, unknown>): Promise<{
|
|
392
|
+
ok: true;
|
|
393
|
+
deployment: ProjectDeployment;
|
|
394
|
+
cancellation: "completed" | "requested" | string;
|
|
395
|
+
}>;
|
|
289
396
|
teamCapacity(teamId: string): Promise<{
|
|
290
397
|
ok: true;
|
|
291
398
|
payload: Record<string, unknown>;
|
package/dist/market-client.js
CHANGED
|
@@ -272,7 +272,8 @@ class MarketClient {
|
|
|
272
272
|
});
|
|
273
273
|
const payload = await response.json().catch(() => ({}));
|
|
274
274
|
if (!response.ok) {
|
|
275
|
-
const
|
|
275
|
+
const payloadError = payload.error;
|
|
276
|
+
const error = typeof payloadError === "string" ? String(payloadError) : payloadError && typeof payloadError === "object" && typeof payloadError.message === "string" ? String(payloadError.message) : `Market request failed with ${response.status}.`;
|
|
276
277
|
throw new MarketApiError(error, response.status, payload);
|
|
277
278
|
}
|
|
278
279
|
return payload;
|
|
@@ -331,11 +332,45 @@ class MarketClient {
|
|
|
331
332
|
body
|
|
332
333
|
});
|
|
333
334
|
}
|
|
335
|
+
confirmWebEmail(body) {
|
|
336
|
+
return this.request("/v1/auth/web/confirm-email", {
|
|
337
|
+
method: "POST",
|
|
338
|
+
body
|
|
339
|
+
});
|
|
340
|
+
}
|
|
334
341
|
checkWebUsername(username) {
|
|
335
342
|
return this.request(
|
|
336
343
|
`/v1/auth/web/username/check?username=${encodeURIComponent(username)}`
|
|
337
344
|
);
|
|
338
345
|
}
|
|
346
|
+
webEmails() {
|
|
347
|
+
return this.request("/v1/auth/web/emails", { requireAuth: true });
|
|
348
|
+
}
|
|
349
|
+
addWebEmail(body) {
|
|
350
|
+
return this.request("/v1/auth/web/emails", {
|
|
351
|
+
method: "POST",
|
|
352
|
+
body,
|
|
353
|
+
requireAuth: true
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
verifyWebEmail(emailId) {
|
|
357
|
+
return this.request(
|
|
358
|
+
`/v1/auth/web/emails/${encodeURIComponent(emailId)}/verify`,
|
|
359
|
+
{ method: "POST", requireAuth: true }
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
setPrimaryWebEmail(emailId) {
|
|
363
|
+
return this.request(
|
|
364
|
+
`/v1/auth/web/emails/${encodeURIComponent(emailId)}/primary`,
|
|
365
|
+
{ method: "POST", requireAuth: true }
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
deleteWebEmail(emailId) {
|
|
369
|
+
return this.request(
|
|
370
|
+
`/v1/auth/web/emails/${encodeURIComponent(emailId)}`,
|
|
371
|
+
{ method: "DELETE", requireAuth: true }
|
|
372
|
+
);
|
|
373
|
+
}
|
|
339
374
|
webSessions() {
|
|
340
375
|
return this.request("/v1/auth/web/sessions", { requireAuth: true });
|
|
341
376
|
}
|
|
@@ -426,6 +461,61 @@ class MarketClient {
|
|
|
426
461
|
{ requireAuth: true }
|
|
427
462
|
);
|
|
428
463
|
}
|
|
464
|
+
projectDeploymentState(projectId) {
|
|
465
|
+
return this.request(
|
|
466
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployment-state`,
|
|
467
|
+
{ requireAuth: true }
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
projectDeployments(projectId, filters = {}) {
|
|
471
|
+
const query = new URLSearchParams();
|
|
472
|
+
if (filters.environment) query.set("environment", String(filters.environment));
|
|
473
|
+
if (filters.action) query.set("action", String(filters.action));
|
|
474
|
+
if (filters.status) query.set("status", String(filters.status));
|
|
475
|
+
if (filters.limit) query.set("limit", String(filters.limit));
|
|
476
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
477
|
+
return this.request(
|
|
478
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployments${suffix}`,
|
|
479
|
+
{ requireAuth: true }
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
projectDeployment(projectId, deploymentId) {
|
|
483
|
+
return this.request(
|
|
484
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}`,
|
|
485
|
+
{ requireAuth: true }
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
projectDeploymentEvents(projectId, deploymentId, options = {}) {
|
|
489
|
+
const query = options.limit ? `?limit=${encodeURIComponent(String(options.limit))}` : "";
|
|
490
|
+
return this.request(
|
|
491
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/events${query}`,
|
|
492
|
+
{ requireAuth: true }
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
createProjectWebDeployment(projectId, body) {
|
|
496
|
+
return this.request(
|
|
497
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployments/web`,
|
|
498
|
+
{ method: "POST", body, requireAuth: true }
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
retryProjectDeployment(projectId, deploymentId, body = {}) {
|
|
502
|
+
return this.request(
|
|
503
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/retry`,
|
|
504
|
+
{ method: "POST", body, requireAuth: true }
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
resumeProjectDeployment(projectId, deploymentId, body = {}) {
|
|
508
|
+
return this.request(
|
|
509
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/resume`,
|
|
510
|
+
{ method: "POST", body, requireAuth: true }
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
cancelProjectDeployment(projectId, deploymentId, body = {}) {
|
|
514
|
+
return this.request(
|
|
515
|
+
`/v1/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/cancel`,
|
|
516
|
+
{ method: "POST", body, requireAuth: true }
|
|
517
|
+
);
|
|
518
|
+
}
|
|
429
519
|
teamCapacity(teamId) {
|
|
430
520
|
return this.request(
|
|
431
521
|
`/v1/teams/${encodeURIComponent(teamId)}/capacity`,
|
|
@@ -340,7 +340,10 @@ const LOCAL_RUNTIME_AUTH_ENV_KEYS = [
|
|
|
340
340
|
"TREESEED_API_DEVICE_CODE_TTL",
|
|
341
341
|
"TREESEED_API_DEVICE_ACCESS_TOKEN_TTL",
|
|
342
342
|
"TREESEED_API_DEVICE_POLL_INTERVAL",
|
|
343
|
+
"TREESEED_API_WEB_SERVICE_ID",
|
|
344
|
+
"TREESEED_API_WEB_SERVICE_SECRET",
|
|
343
345
|
"TREESEED_API_WEB_EXCHANGE_TTL",
|
|
346
|
+
"TREESEED_PLATFORM_RUNNER_SECRET",
|
|
344
347
|
"TREESEED_AUTH_GITHUB_CLIENT_ID",
|
|
345
348
|
"TREESEED_AUTH_GITHUB_CLIENT_SECRET",
|
|
346
349
|
"TREESEED_AUTH_GOOGLE_CLIENT_ID",
|
|
@@ -58,6 +58,59 @@ export type GitHubWorkflowProgressEvent = {
|
|
|
58
58
|
completedJobs?: GitHubWorkflowJobSummary[];
|
|
59
59
|
failedJobs?: GitHubWorkflowJobSummary[];
|
|
60
60
|
};
|
|
61
|
+
export interface GitHubWorkflowDispatchResult {
|
|
62
|
+
repository: string;
|
|
63
|
+
workflow: string;
|
|
64
|
+
branch: string;
|
|
65
|
+
inputs: Record<string, string> | undefined;
|
|
66
|
+
status: number | null;
|
|
67
|
+
dispatchedAt: string;
|
|
68
|
+
}
|
|
69
|
+
export interface GitHubWorkflowCancellationResult {
|
|
70
|
+
ok: boolean;
|
|
71
|
+
supported: boolean;
|
|
72
|
+
repository: string | null;
|
|
73
|
+
runId: number | null;
|
|
74
|
+
url?: string | null;
|
|
75
|
+
message: string;
|
|
76
|
+
cancelledAt?: string | null;
|
|
77
|
+
}
|
|
78
|
+
export interface GitHubWorkflowFileStatus {
|
|
79
|
+
ok: boolean;
|
|
80
|
+
exists: boolean | null;
|
|
81
|
+
repository: string;
|
|
82
|
+
workflow: string;
|
|
83
|
+
url: string | null;
|
|
84
|
+
message: string;
|
|
85
|
+
}
|
|
86
|
+
export interface GitHubWorkflowFailureSummaryInput {
|
|
87
|
+
repository?: string | null;
|
|
88
|
+
workflow?: string | null;
|
|
89
|
+
runId?: number | string | null;
|
|
90
|
+
runUrl?: string | null;
|
|
91
|
+
conclusion?: string | null;
|
|
92
|
+
failedJobName?: string | null;
|
|
93
|
+
lastActiveStep?: string | null;
|
|
94
|
+
message?: string | null;
|
|
95
|
+
blockerCode?: string | null;
|
|
96
|
+
retrySafe?: boolean;
|
|
97
|
+
resumeSafe?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface GitHubWorkflowFailureSummary {
|
|
100
|
+
summary: string;
|
|
101
|
+
provider: 'github';
|
|
102
|
+
repository: string | null;
|
|
103
|
+
workflow: string | null;
|
|
104
|
+
runId: number | null;
|
|
105
|
+
runUrl: string | null;
|
|
106
|
+
inspectCommand: string | null;
|
|
107
|
+
failedJobName: string | null;
|
|
108
|
+
lastActiveStep: string | null;
|
|
109
|
+
conclusion: string | null;
|
|
110
|
+
retrySafe: boolean;
|
|
111
|
+
resumeSafe: boolean;
|
|
112
|
+
blockerCode: string;
|
|
113
|
+
}
|
|
61
114
|
export declare function resolveGitHubApiToken(env?: NodeJS.ProcessEnv | Record<string, string | undefined>): string;
|
|
62
115
|
export declare function parseGitHubRepositorySlug(value: string): {
|
|
63
116
|
owner: string;
|
|
@@ -147,6 +200,36 @@ export declare function upsertGitHubRepositoryVariableWithGhCli(repository: stri
|
|
|
147
200
|
}, name: string, value: string, { env, }?: {
|
|
148
201
|
env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
|
|
149
202
|
}): void;
|
|
203
|
+
export declare function formatGitHubWorkflowFailure(input?: GitHubWorkflowFailureSummaryInput): GitHubWorkflowFailureSummary;
|
|
204
|
+
export declare function dispatchGitHubWorkflowRun(repository: string | {
|
|
205
|
+
owner: string;
|
|
206
|
+
name: string;
|
|
207
|
+
}, { client, workflow, branch, inputs, }: {
|
|
208
|
+
client?: GitHubApiClient;
|
|
209
|
+
workflow?: string;
|
|
210
|
+
branch: string;
|
|
211
|
+
inputs?: Record<string, string>;
|
|
212
|
+
}): Promise<GitHubWorkflowDispatchResult>;
|
|
213
|
+
export declare function cancelGitHubWorkflowRun(repository: string | {
|
|
214
|
+
owner: string;
|
|
215
|
+
name: string;
|
|
216
|
+
} | null | undefined, runId: number | string | null | undefined, { client }?: {
|
|
217
|
+
client?: GitHubApiClient;
|
|
218
|
+
}): Promise<GitHubWorkflowCancellationResult>;
|
|
219
|
+
export declare function getGitHubWorkflowFileStatus(repository: string | {
|
|
220
|
+
owner: string;
|
|
221
|
+
name: string;
|
|
222
|
+
}, workflow?: string, { client }?: {
|
|
223
|
+
client?: GitHubApiClient;
|
|
224
|
+
}): Promise<GitHubWorkflowFileStatus>;
|
|
225
|
+
export declare function getLatestGitHubWorkflowRun(repository: string | {
|
|
226
|
+
owner: string;
|
|
227
|
+
name: string;
|
|
228
|
+
}, { client, workflow, branch, }?: {
|
|
229
|
+
client?: GitHubApiClient;
|
|
230
|
+
workflow?: string;
|
|
231
|
+
branch?: string | null;
|
|
232
|
+
}): Promise<GitHubWorkflowRunSummary | null>;
|
|
150
233
|
export declare function waitForGitHubWorkflowRunCompletion(repository: string | {
|
|
151
234
|
owner: string;
|
|
152
235
|
name: string;
|