@flashbacktech/flashbackclient 0.2.24 → 0.2.25
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
|
@@ -19,6 +19,7 @@ import { CreateRepoAiApiKeyRequest, CreateRepoAiApiKeyResponse, DeleteRepoAiApiK
|
|
|
19
19
|
import { AiLlmStatsResponse, CreateAiLlmRequest, CreateAiLlmResponse, DeleteAiLlmResponse, GetAiLlmsResponse, UpdateAiLlmRequest, UpdateAiLlmResponse, ValidateAiLlmResponse } from './types/ai/aillm';
|
|
20
20
|
import { CreatePolicyRequest, GetPoliciesQuery, GetPolicyViolationsQuery, GetPolicyViolationsResponse, PolicyDTO, UpdatePolicyRequest, PolicyValidationRequest, PolicyValidationResponse, PolicyRecommendationRequest, PolicyRecommendationResponse } from './types/ai/policy';
|
|
21
21
|
import { CreateConversationRequest, CreateConversationResponse, SendPromptRequest, SendPromptResponse, GetConversationsRequest, GetConversationsResponse, GetConversationMessagesResponse, GetConversationMessagesRequest } from './types/ai/conversation';
|
|
22
|
+
import { GetLinksRequest, GetLinksResponse, CreateLinkRequest, CreateLinkResponse, UpdateLinkRequest, UpdateLinkResponse, DeleteLinkResponse } from './types/platform/links';
|
|
22
23
|
interface ErrorResponse {
|
|
23
24
|
message?: string;
|
|
24
25
|
[key: string]: any;
|
|
@@ -37,7 +38,7 @@ export declare class ApiClient implements IApiClient {
|
|
|
37
38
|
setDebug: (debug: boolean) => void;
|
|
38
39
|
setAuthToken: (token: string | null) => void;
|
|
39
40
|
authenticate: (token: string, provider: ProviderType, deviceInfo?: DeviceInfo) => Promise<any>;
|
|
40
|
-
exchangeCode: (code: string, provider: ProviderType
|
|
41
|
+
exchangeCode: (code: string, provider: ProviderType) => Promise<OAuth2ResponseDTO>;
|
|
41
42
|
private exchangeGithubCode;
|
|
42
43
|
private exchangeWeb3StellarCode;
|
|
43
44
|
/**
|
|
@@ -100,6 +101,10 @@ export declare class ApiClient implements IApiClient {
|
|
|
100
101
|
requestPasswordReset: (email: string) => Promise<ActionResponse>;
|
|
101
102
|
resetPassword: (data: ResetPasswordBody) => Promise<ActionResponse>;
|
|
102
103
|
requestDemo: (data: DemoRequestBody) => Promise<DemoRequestResponse>;
|
|
104
|
+
getLinks: (query?: GetLinksRequest) => Promise<GetLinksResponse>;
|
|
105
|
+
createLink: (data: CreateLinkRequest) => Promise<CreateLinkResponse>;
|
|
106
|
+
updateLink: (linkId: string, data: UpdateLinkRequest) => Promise<UpdateLinkResponse>;
|
|
107
|
+
deleteLink: (linkId: string) => Promise<DeleteLinkResponse>;
|
|
103
108
|
private validateDateRange;
|
|
104
109
|
getDailyStats(params: StatsQueryParams): Promise<StatsResponse>;
|
|
105
110
|
getDailyStats(params: StatsQueryWithBucketParams): Promise<StatsResponse>;
|
package/dist/api/client.js
CHANGED
|
@@ -40,10 +40,10 @@ class ApiClient {
|
|
|
40
40
|
throw new Error(`Unsupported provider: ${provider}`);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
this.exchangeCode = async (code, provider
|
|
43
|
+
this.exchangeCode = async (code, provider) => {
|
|
44
44
|
switch (provider) {
|
|
45
45
|
case interfaces_1.ProviderType.GOOGLE:
|
|
46
|
-
return this.exchangeGoogleCode(code
|
|
46
|
+
return this.exchangeGoogleCode(code);
|
|
47
47
|
case interfaces_1.ProviderType.GITHUB:
|
|
48
48
|
return this.exchangeGithubCode(code);
|
|
49
49
|
case interfaces_1.ProviderType.WEB3_STELLAR:
|
|
@@ -152,8 +152,8 @@ class ApiClient {
|
|
|
152
152
|
refresh_token: refreshToken,
|
|
153
153
|
});
|
|
154
154
|
};
|
|
155
|
-
this.exchangeGoogleCode = async (code
|
|
156
|
-
return this.makeRequest('auth/google/exchange', 'POST', { code
|
|
155
|
+
this.exchangeGoogleCode = async (code) => {
|
|
156
|
+
return this.makeRequest('auth/google/exchange', 'POST', { code });
|
|
157
157
|
};
|
|
158
158
|
// Token Management
|
|
159
159
|
this.getTokens = async () => {
|
|
@@ -243,6 +243,35 @@ class ApiClient {
|
|
|
243
243
|
this.requestDemo = async (data) => {
|
|
244
244
|
return this.makeRequest('demo/request', 'POST', data);
|
|
245
245
|
};
|
|
246
|
+
////// Links API
|
|
247
|
+
this.getLinks = async (query) => {
|
|
248
|
+
const queryParams = new URLSearchParams();
|
|
249
|
+
if (query?.from) {
|
|
250
|
+
queryParams.append('from', query.from);
|
|
251
|
+
}
|
|
252
|
+
if (query?.to) {
|
|
253
|
+
queryParams.append('to', query.to);
|
|
254
|
+
}
|
|
255
|
+
if (query?.take !== undefined) {
|
|
256
|
+
queryParams.append('take', query.take.toString());
|
|
257
|
+
}
|
|
258
|
+
if (query?.skip !== undefined) {
|
|
259
|
+
queryParams.append('skip', query.skip.toString());
|
|
260
|
+
}
|
|
261
|
+
if (query?.status) {
|
|
262
|
+
queryParams.append('status', query.status);
|
|
263
|
+
}
|
|
264
|
+
return this.makeRequest(`links${queryParams.toString() ? `?${queryParams.toString()}` : ''}`, 'GET', null);
|
|
265
|
+
};
|
|
266
|
+
this.createLink = async (data) => {
|
|
267
|
+
return this.makeRequest('links', 'POST', data);
|
|
268
|
+
};
|
|
269
|
+
this.updateLink = async (linkId, data) => {
|
|
270
|
+
return this.makeRequest(`links/${linkId}`, 'PUT', data);
|
|
271
|
+
};
|
|
272
|
+
this.deleteLink = async (linkId) => {
|
|
273
|
+
return this.makeRequest(`links/${linkId}`, 'DELETE', null);
|
|
274
|
+
};
|
|
246
275
|
this.getRepoStats = async (params) => {
|
|
247
276
|
const queryParams = new URLSearchParams();
|
|
248
277
|
if (params && params.repoId && params.repoId.length > 0) {
|
package/dist/api/index.d.ts
CHANGED
|
@@ -20,4 +20,5 @@ import * as AiApiKeyTypes from './types/ai/aiapikey';
|
|
|
20
20
|
import * as AiLlmTypes from './types/ai/aillm';
|
|
21
21
|
import * as PolicyTypes from './types/ai/policy';
|
|
22
22
|
import * as ConversationTypes from './types/ai/conversation';
|
|
23
|
-
|
|
23
|
+
import * as LinksTypes from './types/platform/links';
|
|
24
|
+
export { ApiClient, ApiTypes, AuthTypes, StatsTypes, ApiInterfaces, HttpError, BridgeTypes, EmailTypes, QuotaTypes, SubscriptionTypes, DeviceTypes, MFATypes, SettingsTypes, RolesTypes, WorkspaceTypes, OrganizationTypes, NodeRegistrationTypes, SystemEventTypes, UserTypes, AiApiKeyTypes, AiLlmTypes, PolicyTypes, ConversationTypes, LinksTypes };
|
package/dist/api/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ConversationTypes = exports.PolicyTypes = exports.AiLlmTypes = exports.AiApiKeyTypes = exports.UserTypes = exports.SystemEventTypes = exports.NodeRegistrationTypes = exports.OrganizationTypes = exports.WorkspaceTypes = exports.RolesTypes = exports.SettingsTypes = exports.MFATypes = exports.DeviceTypes = exports.SubscriptionTypes = exports.QuotaTypes = exports.EmailTypes = exports.BridgeTypes = exports.HttpError = exports.ApiInterfaces = exports.StatsTypes = exports.AuthTypes = exports.ApiTypes = exports.ApiClient = void 0;
|
|
36
|
+
exports.LinksTypes = exports.ConversationTypes = exports.PolicyTypes = exports.AiLlmTypes = exports.AiApiKeyTypes = exports.UserTypes = exports.SystemEventTypes = exports.NodeRegistrationTypes = exports.OrganizationTypes = exports.WorkspaceTypes = exports.RolesTypes = exports.SettingsTypes = exports.MFATypes = exports.DeviceTypes = exports.SubscriptionTypes = exports.QuotaTypes = exports.EmailTypes = exports.BridgeTypes = exports.HttpError = exports.ApiInterfaces = exports.StatsTypes = exports.AuthTypes = exports.ApiTypes = exports.ApiClient = void 0;
|
|
37
37
|
const client_1 = require("./client");
|
|
38
38
|
Object.defineProperty(exports, "ApiClient", { enumerable: true, get: function () { return client_1.ApiClient; } });
|
|
39
39
|
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return client_1.HttpError; } });
|
|
@@ -79,3 +79,5 @@ const PolicyTypes = __importStar(require("./types/ai/policy"));
|
|
|
79
79
|
exports.PolicyTypes = PolicyTypes;
|
|
80
80
|
const ConversationTypes = __importStar(require("./types/ai/conversation"));
|
|
81
81
|
exports.ConversationTypes = ConversationTypes;
|
|
82
|
+
const LinksTypes = __importStar(require("./types/platform/links"));
|
|
83
|
+
exports.LinksTypes = LinksTypes;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface ActivationLinkDTO {
|
|
2
|
+
id: string;
|
|
3
|
+
createdAt: Date | string;
|
|
4
|
+
description: string;
|
|
5
|
+
email: string;
|
|
6
|
+
activatedAt: Date | string | null;
|
|
7
|
+
createdBy: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GetLinksRequest {
|
|
10
|
+
from?: string;
|
|
11
|
+
to?: string;
|
|
12
|
+
take?: number;
|
|
13
|
+
skip?: number;
|
|
14
|
+
status?: 'activated' | 'pending' | 'all';
|
|
15
|
+
}
|
|
16
|
+
export interface GetLinksResponse {
|
|
17
|
+
success: boolean;
|
|
18
|
+
links: ActivationLinkDTO[];
|
|
19
|
+
total: number;
|
|
20
|
+
skip: number;
|
|
21
|
+
take: number;
|
|
22
|
+
error_code?: string;
|
|
23
|
+
message?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CreateLinkRequest {
|
|
26
|
+
name: string;
|
|
27
|
+
email: string;
|
|
28
|
+
}
|
|
29
|
+
export interface CreateLinkResponse {
|
|
30
|
+
success: boolean;
|
|
31
|
+
calendarUrl: string;
|
|
32
|
+
error_code?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface UpdateLinkRequest {
|
|
35
|
+
description?: string;
|
|
36
|
+
email?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface UpdateLinkResponse {
|
|
39
|
+
success: boolean;
|
|
40
|
+
link: ActivationLinkDTO;
|
|
41
|
+
error_code?: string;
|
|
42
|
+
message?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface DeleteLinkResponse {
|
|
45
|
+
success: boolean;
|
|
46
|
+
message: string;
|
|
47
|
+
error_code?: string;
|
|
48
|
+
}
|