@flashbacktech/flashbackclient 0.2.24 → 0.2.26

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.
@@ -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, uid?: string, token?: string) => Promise<OAuth2ResponseDTO>;
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>;
@@ -40,10 +40,10 @@ class ApiClient {
40
40
  throw new Error(`Unsupported provider: ${provider}`);
41
41
  }
42
42
  };
43
- this.exchangeCode = async (code, provider, uid, token) => {
43
+ this.exchangeCode = async (code, provider) => {
44
44
  switch (provider) {
45
45
  case interfaces_1.ProviderType.GOOGLE:
46
- return this.exchangeGoogleCode(code, uid, token);
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, uid, token) => {
156
- return this.makeRequest('auth/google/exchange', 'POST', { code, uid, token });
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) {
@@ -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
- export { ApiClient, ApiTypes, AuthTypes, StatsTypes, ApiInterfaces, HttpError, BridgeTypes, EmailTypes, QuotaTypes, SubscriptionTypes, DeviceTypes, MFATypes, SettingsTypes, RolesTypes, WorkspaceTypes, OrganizationTypes, NodeRegistrationTypes, SystemEventTypes, UserTypes, AiApiKeyTypes, AiLlmTypes, PolicyTypes, ConversationTypes };
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,54 @@
1
+ export interface CreatorInfo {
2
+ email: string;
3
+ name: string;
4
+ lastName: string;
5
+ }
6
+ export interface ActivationLinkDTO {
7
+ id: string;
8
+ createdAt: Date | string;
9
+ description: string;
10
+ email: string;
11
+ activatedAt: Date | string | null;
12
+ createdBy: string;
13
+ creator: CreatorInfo;
14
+ }
15
+ export interface GetLinksRequest {
16
+ from?: string;
17
+ to?: string;
18
+ take?: number;
19
+ skip?: number;
20
+ status?: 'activated' | 'pending' | 'all';
21
+ }
22
+ export interface GetLinksResponse {
23
+ success: boolean;
24
+ links: ActivationLinkDTO[];
25
+ total: number;
26
+ skip: number;
27
+ take: number;
28
+ error_code?: string;
29
+ message?: string;
30
+ }
31
+ export interface CreateLinkRequest {
32
+ name: string;
33
+ email: string;
34
+ }
35
+ export interface CreateLinkResponse {
36
+ success: boolean;
37
+ calendarUrl: string;
38
+ error_code?: string;
39
+ }
40
+ export interface UpdateLinkRequest {
41
+ description?: string;
42
+ email?: string;
43
+ }
44
+ export interface UpdateLinkResponse {
45
+ success: boolean;
46
+ link: ActivationLinkDTO;
47
+ error_code?: string;
48
+ message?: string;
49
+ }
50
+ export interface DeleteLinkResponse {
51
+ success: boolean;
52
+ message: string;
53
+ error_code?: string;
54
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.2.24",
3
+ "version": "0.2.26",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"