@flashbacktech/flashbackclient 0.2.6 → 0.2.8
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/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { NodeInfoResponse, RegisterRequest } from './types/bridge';
|
|
|
6
6
|
import { GetOrganizationKeysResponse } from './types/noderegistration';
|
|
7
7
|
import { QuotaResponse } from './types/quota';
|
|
8
8
|
import { DeviceListResponse, DeviceDetailsResponse, SessionListResponse, TrustDeviceRequest, TrustDeviceResponse, UntrustDeviceResponse, RemoveDeviceResponse, RevokeSessionResponse, RevokeAllSessionsResponse, SessionHeartbeatResponse, DeviceInfo } from './types/device';
|
|
9
|
-
import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse, GetCheckoutSessionStatusResponse, CreateBillingPortalResponse } from './types/subscriptions';
|
|
9
|
+
import { BuySubscriptionRequest, BuySubscriptionResponse, GetSubscriptionsResponse, MySubscriptionResponse, PaymentsListResponse, PaymentsQueryParams, CancelSubscriptionResponse, GetCheckoutSessionStatusResponse, CreateBillingPortalResponse, GetPendingPaymentResponse, CancelPendingPaymentResponse } from './types/subscriptions';
|
|
10
10
|
import { WorkspaceTypes } from '.';
|
|
11
11
|
import { MFAMethodsResponse, MFASetupRequest, MFASetupResponse, MFAStatusResponse, MFAVerificationSetupRequest, MFAVerificationSetupResponse, MFAEnableRequest, MFAEnableResponse, MFADisableResponse, MFAPrimaryRequest, MFAPrimaryResponse, MFAResetResponse, MFAOrganizationEnforceRequest, MFAOrganizationEnforceResponse, MagicLinkActivationRequest, MagicLinkActivationResponse, MagicLinkSendResponse, PasskeyAuthOptionsResult, PasskeyCompleteRegistrationRequest, PasskeyCompleteRegistrationResponse, MFAVerificationRequest, MFAVerificationLoginResponse, MFAResetRequest } from './types/mfa';
|
|
12
12
|
import { DeleteSettingsRequest, GetSettingsResponse, PartialUpdateSettingsRequest, UpdateSettingsRequest } from './types/settings';
|
|
@@ -125,6 +125,8 @@ export declare class ApiClient implements IApiClient {
|
|
|
125
125
|
cancelSubscription: () => Promise<CancelSubscriptionResponse>;
|
|
126
126
|
createBillingPortal: () => Promise<CreateBillingPortalResponse>;
|
|
127
127
|
getCheckoutSessionStatus: (id: string) => Promise<GetCheckoutSessionStatusResponse>;
|
|
128
|
+
getPendingPayment: () => Promise<GetPendingPaymentResponse>;
|
|
129
|
+
cancelPendingPayment: () => Promise<CancelPendingPaymentResponse>;
|
|
128
130
|
getDevices: () => Promise<DeviceListResponse>;
|
|
129
131
|
getDeviceDetails: (deviceId: string) => Promise<DeviceDetailsResponse>;
|
|
130
132
|
trustDevice: (data: TrustDeviceRequest) => Promise<TrustDeviceResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -299,6 +299,12 @@ class ApiClient {
|
|
|
299
299
|
this.getCheckoutSessionStatus = async (id) => {
|
|
300
300
|
return this.makeRequest(`subscriptions/checkout-session/${id}`, 'GET', null);
|
|
301
301
|
};
|
|
302
|
+
this.getPendingPayment = async () => {
|
|
303
|
+
return this.makeRequest('subscriptions/pending-payment', 'GET', null);
|
|
304
|
+
};
|
|
305
|
+
this.cancelPendingPayment = async () => {
|
|
306
|
+
return this.makeRequest('subscriptions/pending-payment', 'DELETE', null);
|
|
307
|
+
};
|
|
302
308
|
////// Device Management API
|
|
303
309
|
this.getDevices = async () => {
|
|
304
310
|
return this.makeRequest('devices', 'GET', null);
|
|
@@ -119,7 +119,13 @@ export interface EncryptedKey {
|
|
|
119
119
|
authTag: string;
|
|
120
120
|
message: string;
|
|
121
121
|
}
|
|
122
|
-
export interface
|
|
122
|
+
export interface StorageRepoBasic {
|
|
123
|
+
id: string;
|
|
124
|
+
name: string;
|
|
125
|
+
storageType: StorageType;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
}
|
|
128
|
+
export interface StorageBucket {
|
|
123
129
|
id: string;
|
|
124
130
|
name: string;
|
|
125
131
|
bucket: string;
|
|
@@ -132,6 +138,7 @@ export interface StorageUnit {
|
|
|
132
138
|
projectId?: string;
|
|
133
139
|
createdAt: string;
|
|
134
140
|
workspaceId: string;
|
|
141
|
+
repos?: StorageRepoBasic[];
|
|
135
142
|
}
|
|
136
143
|
export interface GetUnitsResponse {
|
|
137
144
|
success: boolean;
|
|
@@ -191,7 +198,7 @@ export interface ValidateBucketRequest extends ValidateUnitRequest {
|
|
|
191
198
|
}
|
|
192
199
|
export interface ValidateBucketResponse extends ValidateUnitResponse {
|
|
193
200
|
}
|
|
194
|
-
export interface
|
|
201
|
+
export interface StorageUnit extends StorageBucket {
|
|
195
202
|
}
|
|
196
203
|
export interface GetBucketsResponse {
|
|
197
204
|
success: boolean;
|
|
@@ -89,3 +89,48 @@ export interface GetCheckoutSessionStatusResponse {
|
|
|
89
89
|
message?: string;
|
|
90
90
|
error_code?: string;
|
|
91
91
|
}
|
|
92
|
+
export interface PendingPaymentSubscription {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
description: string;
|
|
96
|
+
}
|
|
97
|
+
export interface PendingPaymentSubscriptionPeriod {
|
|
98
|
+
id: string;
|
|
99
|
+
periodType: 'ALL_TIME' | 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
|
100
|
+
price: number;
|
|
101
|
+
}
|
|
102
|
+
export interface PendingPaymentData {
|
|
103
|
+
id: string;
|
|
104
|
+
stripePaymentId: string;
|
|
105
|
+
amount: number;
|
|
106
|
+
currency: string;
|
|
107
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'UNPAID' | 'EXPIRED';
|
|
108
|
+
createdAt: string;
|
|
109
|
+
subscription: PendingPaymentSubscription;
|
|
110
|
+
subscriptionPeriod: PendingPaymentSubscriptionPeriod;
|
|
111
|
+
checkoutUrl: string | null;
|
|
112
|
+
sessionStatus: string | null;
|
|
113
|
+
}
|
|
114
|
+
export interface GetPendingPaymentResponse {
|
|
115
|
+
success: boolean;
|
|
116
|
+
data: PendingPaymentData;
|
|
117
|
+
}
|
|
118
|
+
export interface CancelPendingPaymentData {
|
|
119
|
+
paymentId: string;
|
|
120
|
+
stripePaymentId: string;
|
|
121
|
+
cancelledAt: string;
|
|
122
|
+
}
|
|
123
|
+
export interface CancelPendingPaymentResponse {
|
|
124
|
+
success: boolean;
|
|
125
|
+
message: string;
|
|
126
|
+
data: CancelPendingPaymentData;
|
|
127
|
+
}
|
|
128
|
+
export interface PendingPaymentErrorResponse {
|
|
129
|
+
success: false;
|
|
130
|
+
error_code: 'NO_PENDING_PAYMENT' | 'USER_NOT_FOUND' | 'NO_ORGANIZATION' | 'SUBSCRIPTION_PERIOD_NOT_FOUND' | 'INTERNAL_ERROR';
|
|
131
|
+
message: string;
|
|
132
|
+
debug_info?: {
|
|
133
|
+
error_message: string;
|
|
134
|
+
error_type: string;
|
|
135
|
+
};
|
|
136
|
+
}
|