@flashbacktech/tsclient 0.4.71 → 0.4.73
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 +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
type TokenProvider = () => string | null | Promise<string | null>;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Called when a request comes back 401. Typically refreshes the access token.
|
|
4
|
+
* Return `true` when the refresh succeeded so the BaseClient transparently
|
|
5
|
+
* retries the original request once with the new token. Return `false` when
|
|
6
|
+
* the session is unrecoverable (e.g. a dead refresh token) so the original
|
|
7
|
+
* 401 is surfaced without a wasted retry. Returning `void` is treated as
|
|
8
|
+
* "retry once" for backwards compatibility.
|
|
9
|
+
*/
|
|
10
|
+
type UnauthorizedHandler = () => void | boolean | Promise<void | boolean>;
|
|
3
11
|
|
|
4
12
|
/**
|
|
5
13
|
* Returns the org id the platform admin is currently impersonating, or
|
|
@@ -45,7 +53,7 @@ declare class BaseClient {
|
|
|
45
53
|
put<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
46
54
|
patch<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
47
55
|
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
48
|
-
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
|
|
56
|
+
request<T>(method: string, path: string, options?: RequestOptions, retrying?: boolean): Promise<T>;
|
|
49
57
|
private buildUrl;
|
|
50
58
|
}
|
|
51
59
|
|
|
@@ -319,10 +327,17 @@ interface OrgRef {
|
|
|
319
327
|
id: string;
|
|
320
328
|
name: string;
|
|
321
329
|
}
|
|
330
|
+
/** A search-result org row: a lightweight ref plus the per-org debug flag,
|
|
331
|
+
* so the impersonation picker can render its debug toggle without a separate
|
|
332
|
+
* full-list fetch. */
|
|
333
|
+
interface OrgSearchRef extends OrgRef {
|
|
334
|
+
/** Whether org admins of this org may see the cross-org Debug tab. */
|
|
335
|
+
allowDebug: boolean;
|
|
336
|
+
}
|
|
322
337
|
/** Result of the platform-admin org typeahead search. */
|
|
323
338
|
interface OrgSearchResult {
|
|
324
339
|
/** Up to `limit` matches, ordered by name. */
|
|
325
|
-
orgs:
|
|
340
|
+
orgs: OrgSearchRef[];
|
|
326
341
|
/** Total number of orgs matching the query (≥ orgs.length). */
|
|
327
342
|
total: number;
|
|
328
343
|
}
|
|
@@ -2886,4 +2901,4 @@ declare class NotImplementedError extends Error {
|
|
|
2886
2901
|
constructor(method: string);
|
|
2887
2902
|
}
|
|
2888
2903
|
|
|
2889
|
-
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AdminOrgSummaryQuery, type AdminOrgSummaryResponse, type AdminOrgSummaryRow, type AdminOrgSummarySort, type AgentToken, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, 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 CreateAgentTokenRequest, type CreateAgentTokenResponse, 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 ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, 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 UpdatePlatformSettingsRequest, 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 };
|
|
2904
|
+
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AdminOrgSummaryQuery, type AdminOrgSummaryResponse, type AdminOrgSummaryRow, type AdminOrgSummarySort, type AgentToken, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, 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 CreateAgentTokenRequest, type CreateAgentTokenResponse, 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 ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchRef, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, 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 UpdatePlatformSettingsRequest, 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
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
type TokenProvider = () => string | null | Promise<string | null>;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Called when a request comes back 401. Typically refreshes the access token.
|
|
4
|
+
* Return `true` when the refresh succeeded so the BaseClient transparently
|
|
5
|
+
* retries the original request once with the new token. Return `false` when
|
|
6
|
+
* the session is unrecoverable (e.g. a dead refresh token) so the original
|
|
7
|
+
* 401 is surfaced without a wasted retry. Returning `void` is treated as
|
|
8
|
+
* "retry once" for backwards compatibility.
|
|
9
|
+
*/
|
|
10
|
+
type UnauthorizedHandler = () => void | boolean | Promise<void | boolean>;
|
|
3
11
|
|
|
4
12
|
/**
|
|
5
13
|
* Returns the org id the platform admin is currently impersonating, or
|
|
@@ -45,7 +53,7 @@ declare class BaseClient {
|
|
|
45
53
|
put<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
46
54
|
patch<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
47
55
|
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
48
|
-
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
|
|
56
|
+
request<T>(method: string, path: string, options?: RequestOptions, retrying?: boolean): Promise<T>;
|
|
49
57
|
private buildUrl;
|
|
50
58
|
}
|
|
51
59
|
|
|
@@ -319,10 +327,17 @@ interface OrgRef {
|
|
|
319
327
|
id: string;
|
|
320
328
|
name: string;
|
|
321
329
|
}
|
|
330
|
+
/** A search-result org row: a lightweight ref plus the per-org debug flag,
|
|
331
|
+
* so the impersonation picker can render its debug toggle without a separate
|
|
332
|
+
* full-list fetch. */
|
|
333
|
+
interface OrgSearchRef extends OrgRef {
|
|
334
|
+
/** Whether org admins of this org may see the cross-org Debug tab. */
|
|
335
|
+
allowDebug: boolean;
|
|
336
|
+
}
|
|
322
337
|
/** Result of the platform-admin org typeahead search. */
|
|
323
338
|
interface OrgSearchResult {
|
|
324
339
|
/** Up to `limit` matches, ordered by name. */
|
|
325
|
-
orgs:
|
|
340
|
+
orgs: OrgSearchRef[];
|
|
326
341
|
/** Total number of orgs matching the query (≥ orgs.length). */
|
|
327
342
|
total: number;
|
|
328
343
|
}
|
|
@@ -2886,4 +2901,4 @@ declare class NotImplementedError extends Error {
|
|
|
2886
2901
|
constructor(method: string);
|
|
2887
2902
|
}
|
|
2888
2903
|
|
|
2889
|
-
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AdminOrgSummaryQuery, type AdminOrgSummaryResponse, type AdminOrgSummaryRow, type AdminOrgSummarySort, type AgentToken, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, 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 CreateAgentTokenRequest, type CreateAgentTokenResponse, 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 ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, 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 UpdatePlatformSettingsRequest, 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 };
|
|
2904
|
+
export { type AcceptInviteRequest, AccessType, type AcquireScanLeaseRequest, type AcquireScanLeaseResponse, type ActionCategory, type ActivateRequest, type AddMemberRequest, type AddUserToOrgRequest, type AddUserToOrgResult, type AdjustOrgCreditsRequest, type AdjustOrgCreditsResult, type AdminOrgSummaryQuery, type AdminOrgSummaryResponse, type AdminOrgSummaryRow, type AdminOrgSummarySort, type AgentToken, type AnswerChatQuestionRequest, type AnswerChatQuestionResponse, type AppendProgramConfigRequest, type AssociatedOrg, type AuthUser, type AvailableModels, 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 CreateAgentTokenRequest, type CreateAgentTokenResponse, 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 ModelPricingRow, type ModelSelection, type MonthlyCreditStats, NotImplementedError, type NotifyChannelOption, type NotifyEventType, type NotifySubscription, type OpenChatStreamOptions, type OrgBudget, type OrgCreditBalance, type OrgInvite, type OrgNotifySubscriptions, type OrgRef, OrgRoles, type OrgSearchRef, type OrgSearchResult, type OrgSubscription, type Organization, type OrganizationUser, PROVIDER_CATALOG, type PatchModelSelectionRequest, type Payment, type PeekScanLeaseResponse, PlatformAdminClient, type PlatformSettings, 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 UpdatePlatformSettingsRequest, 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
|
@@ -59,7 +59,7 @@ var BaseClient = class {
|
|
|
59
59
|
delete(path, options) {
|
|
60
60
|
return this.request("DELETE", path, options);
|
|
61
61
|
}
|
|
62
|
-
async request(method, path, options = {}) {
|
|
62
|
+
async request(method, path, options = {}, retrying = false) {
|
|
63
63
|
const url = this.buildUrl(path, options.query);
|
|
64
64
|
const headers = { ...this.defaultHeaders, ...options.headers ?? {} };
|
|
65
65
|
if (!options.skipAuth && this.getToken) {
|
|
@@ -98,11 +98,15 @@ var BaseClient = class {
|
|
|
98
98
|
console.debug("[flashbacktech/tsclient] \u2190", res.status, url, parsed);
|
|
99
99
|
}
|
|
100
100
|
if (!res.ok) {
|
|
101
|
-
if (res.status === 401 && this.onUnauthorized) {
|
|
101
|
+
if (res.status === 401 && this.onUnauthorized && !options.skipAuth && !retrying) {
|
|
102
|
+
let refreshed = false;
|
|
102
103
|
try {
|
|
103
|
-
await this.onUnauthorized();
|
|
104
|
+
refreshed = await this.onUnauthorized() !== false;
|
|
104
105
|
} catch {
|
|
105
106
|
}
|
|
107
|
+
if (refreshed) {
|
|
108
|
+
return this.request(method, path, options, true);
|
|
109
|
+
}
|
|
106
110
|
}
|
|
107
111
|
throw new HttpError(res.status, res.statusText, parsed);
|
|
108
112
|
}
|