@flashbacktech/tsclient 0.4.61 → 0.4.63
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/index.cjs +17 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -1
- package/dist/index.d.ts +64 -1
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -326,6 +326,15 @@ interface OrgSearchResult {
|
|
|
326
326
|
/** Total number of orgs matching the query (≥ orgs.length). */
|
|
327
327
|
total: number;
|
|
328
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Body for the self-service org-create endpoint (POST /organization). Creates
|
|
331
|
+
* an org for the current orgless user and makes them its Owner.
|
|
332
|
+
*/
|
|
333
|
+
interface CreateOrganizationRequest {
|
|
334
|
+
name: string;
|
|
335
|
+
website?: string;
|
|
336
|
+
isBusiness?: boolean;
|
|
337
|
+
}
|
|
329
338
|
interface UpdateOrganizationRequest {
|
|
330
339
|
name?: string;
|
|
331
340
|
domain?: string;
|
|
@@ -471,6 +480,12 @@ declare class OrganizationClient {
|
|
|
471
480
|
constructor(http: BaseClient);
|
|
472
481
|
get(orgId: string): Promise<Organization>;
|
|
473
482
|
update(orgId: string, body: UpdateOrganizationRequest): Promise<Organization>;
|
|
483
|
+
/**
|
|
484
|
+
* Self-service: create an org for the current (orgless) user and assign them
|
|
485
|
+
* as Owner. Used by the onboarding wizard so the org exists before the limits
|
|
486
|
+
* and project/sandbox steps. Fails if the user already belongs to an org.
|
|
487
|
+
*/
|
|
488
|
+
create(body: CreateOrganizationRequest): Promise<Organization>;
|
|
474
489
|
/**
|
|
475
490
|
* Fetch the org's default-notification-channel config: the per-event
|
|
476
491
|
* subscriptions, the notify channels available to route to, and whether the
|
|
@@ -1868,6 +1883,15 @@ interface Subscription {
|
|
|
1868
1883
|
capabilities: SubscriptionCapability[];
|
|
1869
1884
|
}
|
|
1870
1885
|
/** The org's currently active subscription (GET /subscriptions/my). */
|
|
1886
|
+
/**
|
|
1887
|
+
* A pending plan change deferred to the period boundary (a downgrade).
|
|
1888
|
+
* effectiveAt is when the lower plan takes over (= current period end).
|
|
1889
|
+
*/
|
|
1890
|
+
interface ScheduledChange {
|
|
1891
|
+
toSubscriptionId: string;
|
|
1892
|
+
toSubscriptionName: string;
|
|
1893
|
+
effectiveAt: string;
|
|
1894
|
+
}
|
|
1871
1895
|
interface OrgSubscription {
|
|
1872
1896
|
id: string;
|
|
1873
1897
|
name: string;
|
|
@@ -1879,7 +1903,10 @@ interface OrgSubscription {
|
|
|
1879
1903
|
dateFrom: string;
|
|
1880
1904
|
dateTo: string | null;
|
|
1881
1905
|
status: string;
|
|
1906
|
+
/** false once a cancel-at-period-end is pending (active until dateTo). */
|
|
1882
1907
|
autoRenew: boolean;
|
|
1908
|
+
/** Set when a downgrade is scheduled for the period boundary. */
|
|
1909
|
+
scheduledChange?: ScheduledChange | null;
|
|
1883
1910
|
}
|
|
1884
1911
|
interface BuySubscriptionRequest {
|
|
1885
1912
|
subscriptionPeriodId: string;
|
|
@@ -1894,6 +1921,29 @@ interface BuySubscriptionResponse {
|
|
|
1894
1921
|
name: string;
|
|
1895
1922
|
} | null;
|
|
1896
1923
|
isFreeSubscription?: boolean;
|
|
1924
|
+
/** Set when the change was a deferred downgrade (no charge now). */
|
|
1925
|
+
scheduledChange?: ScheduledChange | null;
|
|
1926
|
+
message?: string;
|
|
1927
|
+
}
|
|
1928
|
+
/** Request body for POST /subscriptions/preview-change. */
|
|
1929
|
+
interface PreviewChangeRequest {
|
|
1930
|
+
subscriptionPeriodId: string;
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Estimate of a plan change's impact, for the confirmation modal.
|
|
1934
|
+
* kind: "new" (first purchase via Checkout) | "upgrade" | "downgrade".
|
|
1935
|
+
* proratedChargeMicros is an estimate when estimated=true.
|
|
1936
|
+
*/
|
|
1937
|
+
interface PreviewChangeResponse {
|
|
1938
|
+
success: boolean;
|
|
1939
|
+
kind: 'new' | 'upgrade' | 'downgrade';
|
|
1940
|
+
proratedChargeMicros: number;
|
|
1941
|
+
creditDeltaMicros: number;
|
|
1942
|
+
newFullPriceMicros: number;
|
|
1943
|
+
effectiveAt?: string;
|
|
1944
|
+
nextRenewalAt?: string;
|
|
1945
|
+
estimated: boolean;
|
|
1946
|
+
error_code?: string;
|
|
1897
1947
|
message?: string;
|
|
1898
1948
|
}
|
|
1899
1949
|
interface CancelSubscriptionResponse {
|
|
@@ -1933,6 +1983,13 @@ interface CreditBalance {
|
|
|
1933
1983
|
subscriptionCreditMicros: number;
|
|
1934
1984
|
subscriptionCreditExpiresAt: string | null;
|
|
1935
1985
|
totalActiveMicros: number;
|
|
1986
|
+
/**
|
|
1987
|
+
* Subscription bucket AFTER expiry is applied (0 once expired). Display
|
|
1988
|
+
* THIS for the "Subscription" credit card so a lapsed/cancelled plan
|
|
1989
|
+
* never shows stale credits. (subscriptionCreditMicros is the raw stored
|
|
1990
|
+
* value, which can be non-zero past expiry until the next write.)
|
|
1991
|
+
*/
|
|
1992
|
+
activeSubscriptionMicros: number;
|
|
1936
1993
|
}
|
|
1937
1994
|
/** Source of a credit ledger row. Matches the kind enum from migration 0017. */
|
|
1938
1995
|
type CreditTransactionKind = 'grant_initial' | 'grant_renewal' | 'grant_pack' | 'debit_llm' | 'debit_sandbox' | 'debit_llm_platform' | 'meter_llm_byok' | 'admin_adjust';
|
|
@@ -2060,6 +2117,12 @@ declare class SubscriptionsClient {
|
|
|
2060
2117
|
listCatalog(): Promise<Subscription[]>;
|
|
2061
2118
|
getMine(): Promise<OrgSubscription | null>;
|
|
2062
2119
|
buy(body: BuySubscriptionRequest): Promise<BuySubscriptionResponse>;
|
|
2120
|
+
/**
|
|
2121
|
+
* Preview the cost/credit impact of a plan change (pro-rated charge,
|
|
2122
|
+
* credit delta, effective dates) for the confirmation modal — no change
|
|
2123
|
+
* is made. kind="new" means a first purchase that would go via Checkout.
|
|
2124
|
+
*/
|
|
2125
|
+
previewChange(body: PreviewChangeRequest): Promise<PreviewChangeResponse>;
|
|
2063
2126
|
cancel(): Promise<CancelSubscriptionResponse>;
|
|
2064
2127
|
listPayments(): Promise<Payment[]>;
|
|
2065
2128
|
/** Stripe-hosted billing portal URL. */
|
|
@@ -2595,4 +2658,4 @@ declare class NotImplementedError extends Error {
|
|
|
2595
2658
|
constructor(method: string);
|
|
2596
2659
|
}
|
|
2597
2660
|
|
|
2598
|
-
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
|
|
2661
|
+
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationRequest, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type PreviewChangeRequest, type PreviewChangeResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledChange, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
|
package/dist/index.d.ts
CHANGED
|
@@ -326,6 +326,15 @@ interface OrgSearchResult {
|
|
|
326
326
|
/** Total number of orgs matching the query (≥ orgs.length). */
|
|
327
327
|
total: number;
|
|
328
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Body for the self-service org-create endpoint (POST /organization). Creates
|
|
331
|
+
* an org for the current orgless user and makes them its Owner.
|
|
332
|
+
*/
|
|
333
|
+
interface CreateOrganizationRequest {
|
|
334
|
+
name: string;
|
|
335
|
+
website?: string;
|
|
336
|
+
isBusiness?: boolean;
|
|
337
|
+
}
|
|
329
338
|
interface UpdateOrganizationRequest {
|
|
330
339
|
name?: string;
|
|
331
340
|
domain?: string;
|
|
@@ -471,6 +480,12 @@ declare class OrganizationClient {
|
|
|
471
480
|
constructor(http: BaseClient);
|
|
472
481
|
get(orgId: string): Promise<Organization>;
|
|
473
482
|
update(orgId: string, body: UpdateOrganizationRequest): Promise<Organization>;
|
|
483
|
+
/**
|
|
484
|
+
* Self-service: create an org for the current (orgless) user and assign them
|
|
485
|
+
* as Owner. Used by the onboarding wizard so the org exists before the limits
|
|
486
|
+
* and project/sandbox steps. Fails if the user already belongs to an org.
|
|
487
|
+
*/
|
|
488
|
+
create(body: CreateOrganizationRequest): Promise<Organization>;
|
|
474
489
|
/**
|
|
475
490
|
* Fetch the org's default-notification-channel config: the per-event
|
|
476
491
|
* subscriptions, the notify channels available to route to, and whether the
|
|
@@ -1868,6 +1883,15 @@ interface Subscription {
|
|
|
1868
1883
|
capabilities: SubscriptionCapability[];
|
|
1869
1884
|
}
|
|
1870
1885
|
/** The org's currently active subscription (GET /subscriptions/my). */
|
|
1886
|
+
/**
|
|
1887
|
+
* A pending plan change deferred to the period boundary (a downgrade).
|
|
1888
|
+
* effectiveAt is when the lower plan takes over (= current period end).
|
|
1889
|
+
*/
|
|
1890
|
+
interface ScheduledChange {
|
|
1891
|
+
toSubscriptionId: string;
|
|
1892
|
+
toSubscriptionName: string;
|
|
1893
|
+
effectiveAt: string;
|
|
1894
|
+
}
|
|
1871
1895
|
interface OrgSubscription {
|
|
1872
1896
|
id: string;
|
|
1873
1897
|
name: string;
|
|
@@ -1879,7 +1903,10 @@ interface OrgSubscription {
|
|
|
1879
1903
|
dateFrom: string;
|
|
1880
1904
|
dateTo: string | null;
|
|
1881
1905
|
status: string;
|
|
1906
|
+
/** false once a cancel-at-period-end is pending (active until dateTo). */
|
|
1882
1907
|
autoRenew: boolean;
|
|
1908
|
+
/** Set when a downgrade is scheduled for the period boundary. */
|
|
1909
|
+
scheduledChange?: ScheduledChange | null;
|
|
1883
1910
|
}
|
|
1884
1911
|
interface BuySubscriptionRequest {
|
|
1885
1912
|
subscriptionPeriodId: string;
|
|
@@ -1894,6 +1921,29 @@ interface BuySubscriptionResponse {
|
|
|
1894
1921
|
name: string;
|
|
1895
1922
|
} | null;
|
|
1896
1923
|
isFreeSubscription?: boolean;
|
|
1924
|
+
/** Set when the change was a deferred downgrade (no charge now). */
|
|
1925
|
+
scheduledChange?: ScheduledChange | null;
|
|
1926
|
+
message?: string;
|
|
1927
|
+
}
|
|
1928
|
+
/** Request body for POST /subscriptions/preview-change. */
|
|
1929
|
+
interface PreviewChangeRequest {
|
|
1930
|
+
subscriptionPeriodId: string;
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Estimate of a plan change's impact, for the confirmation modal.
|
|
1934
|
+
* kind: "new" (first purchase via Checkout) | "upgrade" | "downgrade".
|
|
1935
|
+
* proratedChargeMicros is an estimate when estimated=true.
|
|
1936
|
+
*/
|
|
1937
|
+
interface PreviewChangeResponse {
|
|
1938
|
+
success: boolean;
|
|
1939
|
+
kind: 'new' | 'upgrade' | 'downgrade';
|
|
1940
|
+
proratedChargeMicros: number;
|
|
1941
|
+
creditDeltaMicros: number;
|
|
1942
|
+
newFullPriceMicros: number;
|
|
1943
|
+
effectiveAt?: string;
|
|
1944
|
+
nextRenewalAt?: string;
|
|
1945
|
+
estimated: boolean;
|
|
1946
|
+
error_code?: string;
|
|
1897
1947
|
message?: string;
|
|
1898
1948
|
}
|
|
1899
1949
|
interface CancelSubscriptionResponse {
|
|
@@ -1933,6 +1983,13 @@ interface CreditBalance {
|
|
|
1933
1983
|
subscriptionCreditMicros: number;
|
|
1934
1984
|
subscriptionCreditExpiresAt: string | null;
|
|
1935
1985
|
totalActiveMicros: number;
|
|
1986
|
+
/**
|
|
1987
|
+
* Subscription bucket AFTER expiry is applied (0 once expired). Display
|
|
1988
|
+
* THIS for the "Subscription" credit card so a lapsed/cancelled plan
|
|
1989
|
+
* never shows stale credits. (subscriptionCreditMicros is the raw stored
|
|
1990
|
+
* value, which can be non-zero past expiry until the next write.)
|
|
1991
|
+
*/
|
|
1992
|
+
activeSubscriptionMicros: number;
|
|
1936
1993
|
}
|
|
1937
1994
|
/** Source of a credit ledger row. Matches the kind enum from migration 0017. */
|
|
1938
1995
|
type CreditTransactionKind = 'grant_initial' | 'grant_renewal' | 'grant_pack' | 'debit_llm' | 'debit_sandbox' | 'debit_llm_platform' | 'meter_llm_byok' | 'admin_adjust';
|
|
@@ -2060,6 +2117,12 @@ declare class SubscriptionsClient {
|
|
|
2060
2117
|
listCatalog(): Promise<Subscription[]>;
|
|
2061
2118
|
getMine(): Promise<OrgSubscription | null>;
|
|
2062
2119
|
buy(body: BuySubscriptionRequest): Promise<BuySubscriptionResponse>;
|
|
2120
|
+
/**
|
|
2121
|
+
* Preview the cost/credit impact of a plan change (pro-rated charge,
|
|
2122
|
+
* credit delta, effective dates) for the confirmation modal — no change
|
|
2123
|
+
* is made. kind="new" means a first purchase that would go via Checkout.
|
|
2124
|
+
*/
|
|
2125
|
+
previewChange(body: PreviewChangeRequest): Promise<PreviewChangeResponse>;
|
|
2063
2126
|
cancel(): Promise<CancelSubscriptionResponse>;
|
|
2064
2127
|
listPayments(): Promise<Payment[]>;
|
|
2065
2128
|
/** Stripe-hosted billing portal URL. */
|
|
@@ -2595,4 +2658,4 @@ declare class NotImplementedError extends Error {
|
|
|
2595
2658
|
constructor(method: string);
|
|
2596
2659
|
}
|
|
2597
2660
|
|
|
2598
|
-
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
|
|
2661
|
+
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, BaseClient, type BaseClientOptions, type BillingProgramConfig, type BudgetScope, BudgetsClient, type BuyCreditPackRequest, type BuyCreditPackResponse, type BuyCustomCreditRequest, type BuyCustomCreditResponse, type BuySubscriptionRequest, type BuySubscriptionResponse, CAP_AI, CAP_COMPUTE, CAP_GENERAL, CAP_NOTIFY, CAP_STORAGE, CAP_VCS, type CancelChatTurnResponse, type CancelSubscriptionResponse, type ChatAssistantMessagePayload, type ChatBillingRefuseCode, type ChatBillingRefuseError, type ChatBudget, type ChatCheckpointedPayload, type ChatCompactionFiredPayload, type ChatDonePayload, type ChatEvent, type ChatEventType, type ChatFeedback, type ChatFeedbackEnvelope, type ChatMessage, type ChatMessageKind, type ChatMessageRole, type ChatNarrationPayload, type ChatPhase, type ChatPhasePayload, type ChatPlanDraftPayload, type ChatQuestionPayload, type ChatSchedule, type ChatScheduleEnvelope, type ChatScheduleNotifyOn, type ChatScheduleRunStatus, type ChatScope, type ChatSession, type ChatSessionSource, type ChatSessionTitlePayload, type ChatStepEventPayload, type ChatStepProgressPayload, type ChatStreamHandle, type ChatToolCallConfirmationRequiredPayload, type ChatToolCallFinishedPayload, type ChatToolCallStartedPayload, type ChatTurnStatus, type ClarificationOption, CloudAgentClient, type CloudAgentClientOptions, type CloudResource, type CloudResourceContainerRef, type CloudResourceEdge, type CloudScanHistory, type CloudScanLease, type ConfirmChatToolCallRequest, type ConfirmChatToolCallResponse, type CreateAgentTemplateRequest, type CreateChatScheduleRequest, type CreateChatSessionRequest, type CreateChatSessionResponse, type CreateCredentialRequest, type CreateGatewayTokenRequest, type CreateGatewayTokenResponse, type CreateOrganizationRequest, type CreateOrganizationUserRequest, type CreateProjectRequest, type CreateSandboxRequest, type CreateScheduledTaskRequest, type Credential, type CreditBalance, type CreditPack, type CreditTransaction, type CreditTransactionKind, type CreditTransactionType, type CustomCreditPurchaseConfig, type DebugPayload, type DebugReceipt, type EffectiveChatBudget, type ExchangeCodeRequest, type FieldSpec, type FieldType, type FineTuneParams, type GatewayToken, type GeneratePayoutsRequest, type GetChatSessionResponse, type GetUsageSummaryQuery, type GetUsageSummaryResponse, HttpError, type ImpersonationProvider, type InviteOrgRequest, type InviteOrgResult, type ListAgentTemplatesQuery, type ListAgentTemplatesResponse, type ListChatFeedbackResponse, type ListChatScheduleRunsResponse, type ListChatSchedulesResponse, type ListChatSessionsQuery, type ListChatSessionsResponse, type ListCredentialsQuery, type ListCreditsTransactionsQuery, type ListCreditsTransactionsResponse, type ListPaymentsResponse, type ListSandboxesQuery, type ListScanHistoryQuery, type ListScanHistoryResponse, type ListScheduledTasksQuery, type ListScheduledTasksResponse, type LoginRequest, type MFASetupResponse, type MFASimpleResponse, type MFAStatus, MFAType, type MFAVerifyLoginRequest, type MFAVerifyLoginResponse, type MFAVerifySetupRequest, type MagicLinkActivateRequest, type MagicLinkSendResponse, type MintReferralCodeRequest, type ModeType, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type Payment, type PeekScanLeaseResponse, type PostChatMessageRequest, type PostChatMessageResponse, type PreviewChangeRequest, type PreviewChangeResponse, type Project, type ProjectMember, type ProviderID, type ProviderSpec, ProviderType, type PublicConfig, type Query, type ReconcileScope, type ReconcileTuple, type RedeemReferralCodeRequest, type ReferralAdminOverview, type ReferralAdminStats, type ReferralCode, type ReferralRedemption, type ReferralRedemptionAdmin, type ReferralStats, ReferralsClient, type RefreshRequest, type RegisterRequest, type RequestOptions, ResellerClient, type ResellerCommission, type ResellerPayout, type ResellerPerformance, type ResetPasswordRequest, type ResourceTreeCategory, type ResourceTreeCredential, type ResourceTreeGrouping, type ResourceTreeResource, type ResourceTreeResponse, ResourcesClient, type Sandbox, type SandboxCredential, type ScanInProgressError, type ScheduledChange, type ScheduledTask, type ScopedBudget, type SessionResponse, type SessionTokens, type SetOrgNotifySubscriptionsRequest, type SetResellerRequest, type SimpleAgentResponse, type SimpleKeysResponse, type SimpleOrgResponse, type SimpleResponse$2 as SimpleResponse, type StorageType, type SubgraphDirection, type SubgraphRequest, type SubgraphResponse, type SubmitChatFeedbackRequest, type Subscription, type SubscriptionCapability, type SubscriptionPeriod, type SystemEvent, type SystemEventQuery, type SystemEventQueryResponse, type SystemEventReadResponse, type Template, type TokenProvider, type UnauthorizedHandler, type UpdateChatBudgetRequest, type UpdateChatScheduleRequest, type UpdateCostLimitRequest, type UpdateCredentialRequest, type UpdateMemberRoleRequest, type UpdateOrgBudgetRequest, type UpdateOrgUserRequest, type UpdateOrganizationRequest, type UpdatePayoutRequest, type UpdateProjectRequest, type UpdateSandboxRequest, type UpdateScopedBudgetRequest, type UpdateUserRequest, type UpdateUserResponse, type UsageBucket, type UsageByModelQuery, type UsageByModelResponse, type UsageByModelRow, type UsageCostSplit, type UsageReportQuery, type UsageReportResponse, type UsageSummary, type UsageSummaryQuery, type UsageSummaryResponse, type UsageTotals, type UsageWindow, type UserProfile, type UserSummary, computeDisplayHint, getProvider, getValueAt, isMetadataPath, isSecretPath, listProviders, metadataKey, setValueAt, usdMicros, validate };
|
package/dist/index.js
CHANGED
|
@@ -249,6 +249,15 @@ var OrganizationClient = class {
|
|
|
249
249
|
const res = await this.http.put(`/organization/${orgId}`, { body });
|
|
250
250
|
return unwrapData(res);
|
|
251
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Self-service: create an org for the current (orgless) user and assign them
|
|
254
|
+
* as Owner. Used by the onboarding wizard so the org exists before the limits
|
|
255
|
+
* and project/sandbox steps. Fails if the user already belongs to an org.
|
|
256
|
+
*/
|
|
257
|
+
async create(body) {
|
|
258
|
+
const res = await this.http.post("/organization", { body });
|
|
259
|
+
return unwrapData(res);
|
|
260
|
+
}
|
|
252
261
|
/**
|
|
253
262
|
* Fetch the org's default-notification-channel config: the per-event
|
|
254
263
|
* subscriptions, the notify channels available to route to, and whether the
|
|
@@ -1082,6 +1091,14 @@ var SubscriptionsClient = class {
|
|
|
1082
1091
|
buy(body) {
|
|
1083
1092
|
return this.http.post("/subscriptions/buy", { body });
|
|
1084
1093
|
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Preview the cost/credit impact of a plan change (pro-rated charge,
|
|
1096
|
+
* credit delta, effective dates) for the confirmation modal — no change
|
|
1097
|
+
* is made. kind="new" means a first purchase that would go via Checkout.
|
|
1098
|
+
*/
|
|
1099
|
+
previewChange(body) {
|
|
1100
|
+
return this.http.post("/subscriptions/preview-change", { body });
|
|
1101
|
+
}
|
|
1085
1102
|
cancel() {
|
|
1086
1103
|
return this.http.post("/subscriptions/cancel", {});
|
|
1087
1104
|
}
|