@symbo.ls/sdk 2.31.34 → 2.31.36

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.
Files changed (34) hide show
  1. package/dist/cjs/config/environment.js +13 -17
  2. package/dist/cjs/index.js +6 -6
  3. package/dist/cjs/services/AuthService.js +1 -128
  4. package/dist/cjs/services/BaseService.js +0 -15
  5. package/dist/cjs/services/CollabService.js +6 -5
  6. package/dist/esm/config/environment.js +13 -17
  7. package/dist/esm/index.js +26 -159
  8. package/dist/esm/services/AdminService.js +13 -32
  9. package/dist/esm/services/AuthService.js +14 -148
  10. package/dist/esm/services/BaseService.js +13 -32
  11. package/dist/esm/services/BranchService.js +13 -32
  12. package/dist/esm/services/CollabService.js +19 -37
  13. package/dist/esm/services/CoreService.js +13 -32
  14. package/dist/esm/services/DnsService.js +13 -32
  15. package/dist/esm/services/FileService.js +13 -32
  16. package/dist/esm/services/PaymentService.js +13 -32
  17. package/dist/esm/services/PlanService.js +13 -32
  18. package/dist/esm/services/ProjectService.js +13 -32
  19. package/dist/esm/services/PullRequestService.js +13 -32
  20. package/dist/esm/services/ScreenshotService.js +13 -32
  21. package/dist/esm/services/SubscriptionService.js +13 -32
  22. package/dist/esm/services/index.js +20 -153
  23. package/dist/esm/utils/CollabClient.js +13 -17
  24. package/dist/node/config/environment.js +13 -17
  25. package/dist/node/index.js +6 -6
  26. package/dist/node/services/AuthService.js +1 -118
  27. package/dist/node/services/BaseService.js +0 -15
  28. package/dist/node/services/CollabService.js +6 -5
  29. package/package.json +6 -6
  30. package/src/config/environment.js +13 -18
  31. package/src/index.js +27 -23
  32. package/src/services/AuthService.js +1 -154
  33. package/src/services/BaseService.js +1 -21
  34. package/src/services/CollabService.js +8 -6
package/dist/esm/index.js CHANGED
@@ -14104,8 +14104,8 @@ var CONFIG = {
14104
14104
  apiUrl: "https://dev.api.symbols.app",
14105
14105
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
14106
14106
  typesenseCollectionName: "docs",
14107
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
14108
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
14107
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
14108
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
14109
14109
  typesensePort: "443",
14110
14110
  typesenseProtocol: "https"
14111
14111
  },
@@ -14117,22 +14117,18 @@ var CONFIG = {
14117
14117
  basedOrg: "symbols",
14118
14118
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
14119
14119
  typesenseCollectionName: "docs",
14120
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
14121
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
14120
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
14121
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
14122
14122
  typesensePort: "443",
14123
14123
  typesenseProtocol: "https"
14124
14124
  },
14125
14125
  upcoming: {
14126
- // socketUrl: 'https://upcoming.api.symbols.app',
14127
- // apiUrl: 'https://upcoming.api.symbols.app',
14128
- // githubClientId: 'Ov23liWF7NvdZ056RV5J'
14129
- // cloning from dev
14130
- socketUrl: "https://dev.api.symbols.app",
14131
- apiUrl: "https://dev.api.symbols.app",
14132
- githubClientId: "Ov23liHxyWFBxS8f1gnF",
14126
+ socketUrl: "https://upcoming.api.symbols.app",
14127
+ apiUrl: "https://upcoming.api.symbols.app",
14128
+ githubClientId: "Ov23liWF7NvdZ056RV5J",
14133
14129
  typesenseCollectionName: "docs",
14134
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
14135
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
14130
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
14131
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
14136
14132
  typesensePort: "443",
14137
14133
  typesenseProtocol: "https"
14138
14134
  },
@@ -14144,8 +14140,8 @@ var CONFIG = {
14144
14140
  basedOrg: "symbols",
14145
14141
  githubClientId: "Ov23ligwZDQVD0VfuWNa",
14146
14142
  typesenseCollectionName: "docs",
14147
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
14148
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
14143
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
14144
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
14149
14145
  typesensePort: "443",
14150
14146
  typesenseProtocol: "https"
14151
14147
  },
@@ -14157,8 +14153,8 @@ var CONFIG = {
14157
14153
  basedOrg: "symbols",
14158
14154
  githubClientId: "Ov23liFAlOEIXtX3dBtR",
14159
14155
  typesenseCollectionName: "docs",
14160
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
14161
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
14156
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
14157
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
14162
14158
  typesensePort: "443",
14163
14159
  typesenseProtocol: "https"
14164
14160
  }
@@ -14643,20 +14639,10 @@ var BaseService = class {
14643
14639
  }
14644
14640
  this._tokenManager = getTokenManager({
14645
14641
  apiUrl: this._apiUrl,
14646
- onTokenRefresh: (tokens) => {
14647
- this.updateContext({ authToken: tokens.accessToken });
14648
- },
14649
- onTokenExpired: () => {
14650
- this.updateContext({ authToken: null });
14651
- },
14652
14642
  onTokenError: (error) => {
14653
14643
  console.error("Token management error:", error);
14654
14644
  }
14655
14645
  });
14656
- const { authToken } = this._context;
14657
- if (authToken && !this._tokenManager.hasTokens()) {
14658
- this._tokenManager.setTokens({ access_token: authToken });
14659
- }
14660
14646
  this._setReady();
14661
14647
  } catch (error) {
14662
14648
  this._setError(error);
@@ -14722,11 +14708,6 @@ var BaseService = class {
14722
14708
  error
14723
14709
  );
14724
14710
  }
14725
- } else if (this._requiresInit(options.methodName)) {
14726
- const { authToken } = this._context;
14727
- if (authToken) {
14728
- defaultHeaders.Authorization = `Bearer ${authToken}`;
14729
- }
14730
14711
  }
14731
14712
  try {
14732
14713
  const response = await fetch(url2, {
@@ -14929,118 +14910,10 @@ var AuthService = class extends BaseService {
14929
14910
  "pro2",
14930
14911
  "enterprise"
14931
14912
  ]);
14932
- this._initialized = false;
14933
- this._apiUrl = null;
14934
- this._tokenManager = null;
14935
14913
  this._projectRoleCache = /* @__PURE__ */ new Map();
14936
14914
  this._roleCacheExpiry = 5 * 60 * 1e3;
14937
14915
  }
14938
- init({ context }) {
14939
- try {
14940
- const { appKey, authToken } = context || this._context;
14941
- this._apiUrl = environment_default.apiUrl;
14942
- if (!this._apiUrl) {
14943
- throw new Error("Auth service base URL not configured");
14944
- }
14945
- this._tokenManager = getTokenManager({
14946
- apiUrl: this._apiUrl,
14947
- onTokenRefresh: (tokens) => {
14948
- this.updateContext({ authToken: tokens.accessToken });
14949
- },
14950
- onTokenExpired: () => {
14951
- this.updateContext({ authToken: null });
14952
- },
14953
- onTokenError: (error) => {
14954
- console.error("Token management error:", error);
14955
- }
14956
- });
14957
- if (authToken && !this._tokenManager.hasTokens()) {
14958
- this._tokenManager.setTokens({ access_token: authToken });
14959
- }
14960
- this._info = {
14961
- config: {
14962
- apiUrl: this._apiUrl,
14963
- appKey: appKey ? `${appKey.substr(0, 4)}...${appKey.substr(-4)}` : null,
14964
- hasToken: Boolean(authToken)
14965
- }
14966
- };
14967
- this._initialized = true;
14968
- this._setReady();
14969
- } catch (error) {
14970
- this._setError(error);
14971
- throw error;
14972
- }
14973
- }
14974
- // Helper method to make HTTP requests
14975
- async _request(endpoint, options = {}) {
14976
- const url2 = `${this._apiUrl}/core${endpoint}`;
14977
- const defaultHeaders = {};
14978
- if (!(options.body instanceof FormData)) {
14979
- defaultHeaders["Content-Type"] = "application/json";
14980
- }
14981
- if (this._requiresInit(options.methodName) && this._tokenManager) {
14982
- try {
14983
- const validToken = await this._tokenManager.ensureValidToken();
14984
- if (validToken) {
14985
- const authHeader = this._tokenManager.getAuthHeader();
14986
- if (authHeader) {
14987
- defaultHeaders.Authorization = authHeader;
14988
- }
14989
- }
14990
- } catch (error) {
14991
- console.warn(
14992
- "Token management failed, proceeding without authentication:",
14993
- error
14994
- );
14995
- }
14996
- } else if (this._requiresInit(options.methodName)) {
14997
- const { authToken } = this._context;
14998
- if (authToken) {
14999
- defaultHeaders.Authorization = `Bearer ${authToken}`;
15000
- }
15001
- }
15002
- try {
15003
- const response = await fetch(url2, {
15004
- ...options,
15005
- headers: {
15006
- ...defaultHeaders,
15007
- ...options.headers
15008
- }
15009
- });
15010
- if (!response.ok) {
15011
- let error = {
15012
- message: `HTTP ${response.status}: ${response.statusText}`
15013
- };
15014
- try {
15015
- error = await response.json();
15016
- } catch {
15017
- }
15018
- throw new Error(error.message || error.error || "Request failed", { cause: error });
15019
- }
15020
- return response.status === 204 ? null : response.json();
15021
- } catch (error) {
15022
- throw new Error(`Request failed: ${error.message}`, { cause: error });
15023
- }
15024
- }
15025
- _requiresInit(methodName) {
15026
- const noInitMethods = /* @__PURE__ */ new Set([
15027
- "register",
15028
- "login",
15029
- "googleAuth",
15030
- "googleAuthCallback",
15031
- "githubAuth",
15032
- "requestPasswordReset",
15033
- "confirmPasswordReset",
15034
- "confirmRegistration",
15035
- "verifyEmail"
15036
- ]);
15037
- return !noInitMethods.has(methodName);
15038
- }
15039
- _requireReady(methodName) {
15040
- if (this._requiresInit(methodName) && !this._initialized) {
15041
- throw new Error("Auth service not initialized");
15042
- }
15043
- }
14916
+ // Use BaseService.init/_request/_requireReady implementations
15044
14917
  // ==================== AUTH METHODS ====================
15045
14918
  async register(userData) {
15046
14919
  try {
@@ -15076,7 +14949,6 @@ var AuthService = class extends BaseService {
15076
14949
  if (this._tokenManager) {
15077
14950
  this._tokenManager.setTokens(tokenData);
15078
14951
  }
15079
- this.updateContext({ authToken: tokens.accessToken });
15080
14952
  }
15081
14953
  if (response.success) {
15082
14954
  return response.data;
@@ -15096,12 +14968,10 @@ var AuthService = class extends BaseService {
15096
14968
  if (this._tokenManager) {
15097
14969
  this._tokenManager.clearTokens();
15098
14970
  }
15099
- this.updateContext({ authToken: null });
15100
14971
  } catch (error) {
15101
14972
  if (this._tokenManager) {
15102
14973
  this._tokenManager.clearTokens();
15103
14974
  }
15104
- this.updateContext({ authToken: null });
15105
14975
  throw new Error(`Logout failed: ${error.message}`, { cause: error });
15106
14976
  }
15107
14977
  }
@@ -15143,7 +15013,6 @@ var AuthService = class extends BaseService {
15143
15013
  if (this._tokenManager) {
15144
15014
  this._tokenManager.setTokens(tokenData);
15145
15015
  }
15146
- this.updateContext({ authToken: tokens.accessToken });
15147
15016
  }
15148
15017
  if (response.success) {
15149
15018
  return response.data;
@@ -15176,7 +15045,6 @@ var AuthService = class extends BaseService {
15176
15045
  if (this._tokenManager) {
15177
15046
  this._tokenManager.setTokens(tokenData);
15178
15047
  }
15179
- this.updateContext({ authToken: tokens.accessToken });
15180
15048
  }
15181
15049
  if (response.success) {
15182
15050
  return response.data;
@@ -15209,7 +15077,6 @@ var AuthService = class extends BaseService {
15209
15077
  if (this._tokenManager) {
15210
15078
  this._tokenManager.setTokens(tokenData);
15211
15079
  }
15212
- this.updateContext({ authToken: tokens.accessToken });
15213
15080
  }
15214
15081
  if (response.success) {
15215
15082
  return response.data;
@@ -15821,7 +15688,6 @@ var AuthService = class extends BaseService {
15821
15688
  this._tokenManager = null;
15822
15689
  }
15823
15690
  this._projectRoleCache.clear();
15824
- this._initialized = false;
15825
15691
  this._setReady(false);
15826
15692
  }
15827
15693
  };
@@ -28493,7 +28359,6 @@ var CollabService = class extends BaseService {
28493
28359
  (_b2 = this._client.socket) == null ? void 0 : _b2.once("connect", resolve);
28494
28360
  }
28495
28361
  });
28496
- console.log("[CollabService] socket connected");
28497
28362
  (_b = this._client.socket) == null ? void 0 : _b.on("ops", ({ changes }) => {
28498
28363
  console.log(`ops event`);
28499
28364
  this._stateManager.applyChanges(changes, { fromSocket: true });
@@ -28523,9 +28388,7 @@ var CollabService = class extends BaseService {
28523
28388
  this._pendingOps.length = 0;
28524
28389
  }
28525
28390
  this._connected = true;
28526
- console.log("[CollabService] Connected to project:", projectId);
28527
28391
  } catch (err) {
28528
- console.error("[CollabService] Connection failed:", err);
28529
28392
  throw err;
28530
28393
  }
28531
28394
  }
@@ -28774,7 +28637,9 @@ var CollabService = class extends BaseService {
28774
28637
  title: "Failed to update item",
28775
28638
  message: error.message
28776
28639
  });
28777
- throw new Error(`Failed to update item: ${error.message}`, { cause: error });
28640
+ throw new Error(`Failed to update item: ${error.message}`, {
28641
+ cause: error
28642
+ });
28778
28643
  }
28779
28644
  }
28780
28645
  deleteItem(type, key, opts = {}) {
@@ -28799,7 +28664,9 @@ var CollabService = class extends BaseService {
28799
28664
  title: "Failed to delete item",
28800
28665
  message: error.message
28801
28666
  });
28802
- throw new Error(`Failed to delete item: ${error.message}`, { cause: error });
28667
+ throw new Error(`Failed to delete item: ${error.message}`, {
28668
+ cause: error
28669
+ });
28803
28670
  }
28804
28671
  }
28805
28672
  /* ---------- socket event helpers ---------- */
@@ -33084,9 +32951,11 @@ var SDK = class {
33084
32951
  }
33085
32952
  // Update context
33086
32953
  updateContext(newContext) {
33087
- if (newContext && typeof newContext === "object") {
33088
- Object.assign(this._context, newContext);
33089
- }
32954
+ const { authToken, ...sanitized } = newContext || {};
32955
+ this._context = {
32956
+ ...this._context,
32957
+ ...sanitized
32958
+ };
33090
32959
  for (const service of this._services.values()) {
33091
32960
  service.updateContext(this._context);
33092
32961
  }
@@ -33094,9 +32963,7 @@ var SDK = class {
33094
32963
  // Check if SDK is ready
33095
32964
  isReady() {
33096
32965
  const sdkServices = Array.from(this._services.values());
33097
- return sdkServices.length > 0 && sdkServices.every(
33098
- (service) => service.isReady()
33099
- );
32966
+ return sdkServices.length > 0 && sdkServices.every((service) => service.isReady());
33100
32967
  }
33101
32968
  // Get SDK status
33102
32969
  getStatus() {
@@ -46,8 +46,8 @@ var CONFIG = {
46
46
  apiUrl: "https://dev.api.symbols.app",
47
47
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
48
48
  typesenseCollectionName: "docs",
49
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
50
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
49
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
50
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
51
51
  typesensePort: "443",
52
52
  typesenseProtocol: "https"
53
53
  },
@@ -59,22 +59,18 @@ var CONFIG = {
59
59
  basedOrg: "symbols",
60
60
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
61
61
  typesenseCollectionName: "docs",
62
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
63
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
62
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
63
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
64
64
  typesensePort: "443",
65
65
  typesenseProtocol: "https"
66
66
  },
67
67
  upcoming: {
68
- // socketUrl: 'https://upcoming.api.symbols.app',
69
- // apiUrl: 'https://upcoming.api.symbols.app',
70
- // githubClientId: 'Ov23liWF7NvdZ056RV5J'
71
- // cloning from dev
72
- socketUrl: "https://dev.api.symbols.app",
73
- apiUrl: "https://dev.api.symbols.app",
74
- githubClientId: "Ov23liHxyWFBxS8f1gnF",
68
+ socketUrl: "https://upcoming.api.symbols.app",
69
+ apiUrl: "https://upcoming.api.symbols.app",
70
+ githubClientId: "Ov23liWF7NvdZ056RV5J",
75
71
  typesenseCollectionName: "docs",
76
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
77
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
72
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
73
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
78
74
  typesensePort: "443",
79
75
  typesenseProtocol: "https"
80
76
  },
@@ -86,8 +82,8 @@ var CONFIG = {
86
82
  basedOrg: "symbols",
87
83
  githubClientId: "Ov23ligwZDQVD0VfuWNa",
88
84
  typesenseCollectionName: "docs",
89
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
90
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
85
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
86
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
91
87
  typesensePort: "443",
92
88
  typesenseProtocol: "https"
93
89
  },
@@ -99,8 +95,8 @@ var CONFIG = {
99
95
  basedOrg: "symbols",
100
96
  githubClientId: "Ov23liFAlOEIXtX3dBtR",
101
97
  typesenseCollectionName: "docs",
102
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
103
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
98
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
99
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
104
100
  typesensePort: "443",
105
101
  typesenseProtocol: "https"
106
102
  }
@@ -585,20 +581,10 @@ var BaseService = class {
585
581
  }
586
582
  this._tokenManager = getTokenManager({
587
583
  apiUrl: this._apiUrl,
588
- onTokenRefresh: (tokens) => {
589
- this.updateContext({ authToken: tokens.accessToken });
590
- },
591
- onTokenExpired: () => {
592
- this.updateContext({ authToken: null });
593
- },
594
584
  onTokenError: (error) => {
595
585
  console.error("Token management error:", error);
596
586
  }
597
587
  });
598
- const { authToken } = this._context;
599
- if (authToken && !this._tokenManager.hasTokens()) {
600
- this._tokenManager.setTokens({ access_token: authToken });
601
- }
602
588
  this._setReady();
603
589
  } catch (error) {
604
590
  this._setError(error);
@@ -664,11 +650,6 @@ var BaseService = class {
664
650
  error
665
651
  );
666
652
  }
667
- } else if (this._requiresInit(options.methodName)) {
668
- const { authToken } = this._context;
669
- if (authToken) {
670
- defaultHeaders.Authorization = `Bearer ${authToken}`;
671
- }
672
653
  }
673
654
  try {
674
655
  const response = await fetch(url, {
@@ -46,8 +46,8 @@ var CONFIG = {
46
46
  apiUrl: "https://dev.api.symbols.app",
47
47
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
48
48
  typesenseCollectionName: "docs",
49
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
50
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
49
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
50
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
51
51
  typesensePort: "443",
52
52
  typesenseProtocol: "https"
53
53
  },
@@ -59,22 +59,18 @@ var CONFIG = {
59
59
  basedOrg: "symbols",
60
60
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
61
61
  typesenseCollectionName: "docs",
62
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
63
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
62
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
63
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
64
64
  typesensePort: "443",
65
65
  typesenseProtocol: "https"
66
66
  },
67
67
  upcoming: {
68
- // socketUrl: 'https://upcoming.api.symbols.app',
69
- // apiUrl: 'https://upcoming.api.symbols.app',
70
- // githubClientId: 'Ov23liWF7NvdZ056RV5J'
71
- // cloning from dev
72
- socketUrl: "https://dev.api.symbols.app",
73
- apiUrl: "https://dev.api.symbols.app",
74
- githubClientId: "Ov23liHxyWFBxS8f1gnF",
68
+ socketUrl: "https://upcoming.api.symbols.app",
69
+ apiUrl: "https://upcoming.api.symbols.app",
70
+ githubClientId: "Ov23liWF7NvdZ056RV5J",
75
71
  typesenseCollectionName: "docs",
76
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
77
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
72
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
73
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
78
74
  typesensePort: "443",
79
75
  typesenseProtocol: "https"
80
76
  },
@@ -86,8 +82,8 @@ var CONFIG = {
86
82
  basedOrg: "symbols",
87
83
  githubClientId: "Ov23ligwZDQVD0VfuWNa",
88
84
  typesenseCollectionName: "docs",
89
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
90
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
85
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
86
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
91
87
  typesensePort: "443",
92
88
  typesenseProtocol: "https"
93
89
  },
@@ -99,8 +95,8 @@ var CONFIG = {
99
95
  basedOrg: "symbols",
100
96
  githubClientId: "Ov23liFAlOEIXtX3dBtR",
101
97
  typesenseCollectionName: "docs",
102
- typesenseApiKey: "uvxRxi1FHfoxqv29CcyMGVEUtdsow4Ix",
103
- typesenseHost: "wy4zjlqe0h5v2g1np-1.a1.typesense.net",
98
+ typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
99
+ typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
104
100
  typesensePort: "443",
105
101
  typesenseProtocol: "https"
106
102
  }
@@ -585,20 +581,10 @@ var BaseService = class {
585
581
  }
586
582
  this._tokenManager = getTokenManager({
587
583
  apiUrl: this._apiUrl,
588
- onTokenRefresh: (tokens) => {
589
- this.updateContext({ authToken: tokens.accessToken });
590
- },
591
- onTokenExpired: () => {
592
- this.updateContext({ authToken: null });
593
- },
594
584
  onTokenError: (error) => {
595
585
  console.error("Token management error:", error);
596
586
  }
597
587
  });
598
- const { authToken } = this._context;
599
- if (authToken && !this._tokenManager.hasTokens()) {
600
- this._tokenManager.setTokens({ access_token: authToken });
601
- }
602
588
  this._setReady();
603
589
  } catch (error) {
604
590
  this._setError(error);
@@ -664,11 +650,6 @@ var BaseService = class {
664
650
  error
665
651
  );
666
652
  }
667
- } else if (this._requiresInit(options.methodName)) {
668
- const { authToken } = this._context;
669
- if (authToken) {
670
- defaultHeaders.Authorization = `Bearer ${authToken}`;
671
- }
672
653
  }
673
654
  try {
674
655
  const response = await fetch(url, {
@@ -871,118 +852,10 @@ var AuthService = class extends BaseService {
871
852
  "pro2",
872
853
  "enterprise"
873
854
  ]);
874
- this._initialized = false;
875
- this._apiUrl = null;
876
- this._tokenManager = null;
877
855
  this._projectRoleCache = /* @__PURE__ */ new Map();
878
856
  this._roleCacheExpiry = 5 * 60 * 1e3;
879
857
  }
880
- init({ context }) {
881
- try {
882
- const { appKey, authToken } = context || this._context;
883
- this._apiUrl = environment_default.apiUrl;
884
- if (!this._apiUrl) {
885
- throw new Error("Auth service base URL not configured");
886
- }
887
- this._tokenManager = getTokenManager({
888
- apiUrl: this._apiUrl,
889
- onTokenRefresh: (tokens) => {
890
- this.updateContext({ authToken: tokens.accessToken });
891
- },
892
- onTokenExpired: () => {
893
- this.updateContext({ authToken: null });
894
- },
895
- onTokenError: (error) => {
896
- console.error("Token management error:", error);
897
- }
898
- });
899
- if (authToken && !this._tokenManager.hasTokens()) {
900
- this._tokenManager.setTokens({ access_token: authToken });
901
- }
902
- this._info = {
903
- config: {
904
- apiUrl: this._apiUrl,
905
- appKey: appKey ? `${appKey.substr(0, 4)}...${appKey.substr(-4)}` : null,
906
- hasToken: Boolean(authToken)
907
- }
908
- };
909
- this._initialized = true;
910
- this._setReady();
911
- } catch (error) {
912
- this._setError(error);
913
- throw error;
914
- }
915
- }
916
- // Helper method to make HTTP requests
917
- async _request(endpoint, options = {}) {
918
- const url = `${this._apiUrl}/core${endpoint}`;
919
- const defaultHeaders = {};
920
- if (!(options.body instanceof FormData)) {
921
- defaultHeaders["Content-Type"] = "application/json";
922
- }
923
- if (this._requiresInit(options.methodName) && this._tokenManager) {
924
- try {
925
- const validToken = await this._tokenManager.ensureValidToken();
926
- if (validToken) {
927
- const authHeader = this._tokenManager.getAuthHeader();
928
- if (authHeader) {
929
- defaultHeaders.Authorization = authHeader;
930
- }
931
- }
932
- } catch (error) {
933
- console.warn(
934
- "Token management failed, proceeding without authentication:",
935
- error
936
- );
937
- }
938
- } else if (this._requiresInit(options.methodName)) {
939
- const { authToken } = this._context;
940
- if (authToken) {
941
- defaultHeaders.Authorization = `Bearer ${authToken}`;
942
- }
943
- }
944
- try {
945
- const response = await fetch(url, {
946
- ...options,
947
- headers: {
948
- ...defaultHeaders,
949
- ...options.headers
950
- }
951
- });
952
- if (!response.ok) {
953
- let error = {
954
- message: `HTTP ${response.status}: ${response.statusText}`
955
- };
956
- try {
957
- error = await response.json();
958
- } catch {
959
- }
960
- throw new Error(error.message || error.error || "Request failed", { cause: error });
961
- }
962
- return response.status === 204 ? null : response.json();
963
- } catch (error) {
964
- throw new Error(`Request failed: ${error.message}`, { cause: error });
965
- }
966
- }
967
- _requiresInit(methodName) {
968
- const noInitMethods = /* @__PURE__ */ new Set([
969
- "register",
970
- "login",
971
- "googleAuth",
972
- "googleAuthCallback",
973
- "githubAuth",
974
- "requestPasswordReset",
975
- "confirmPasswordReset",
976
- "confirmRegistration",
977
- "verifyEmail"
978
- ]);
979
- return !noInitMethods.has(methodName);
980
- }
981
- _requireReady(methodName) {
982
- if (this._requiresInit(methodName) && !this._initialized) {
983
- throw new Error("Auth service not initialized");
984
- }
985
- }
858
+ // Use BaseService.init/_request/_requireReady implementations
986
859
  // ==================== AUTH METHODS ====================
987
860
  async register(userData) {
988
861
  try {
@@ -1018,7 +891,6 @@ var AuthService = class extends BaseService {
1018
891
  if (this._tokenManager) {
1019
892
  this._tokenManager.setTokens(tokenData);
1020
893
  }
1021
- this.updateContext({ authToken: tokens.accessToken });
1022
894
  }
1023
895
  if (response.success) {
1024
896
  return response.data;
@@ -1038,12 +910,10 @@ var AuthService = class extends BaseService {
1038
910
  if (this._tokenManager) {
1039
911
  this._tokenManager.clearTokens();
1040
912
  }
1041
- this.updateContext({ authToken: null });
1042
913
  } catch (error) {
1043
914
  if (this._tokenManager) {
1044
915
  this._tokenManager.clearTokens();
1045
916
  }
1046
- this.updateContext({ authToken: null });
1047
917
  throw new Error(`Logout failed: ${error.message}`, { cause: error });
1048
918
  }
1049
919
  }
@@ -1085,7 +955,6 @@ var AuthService = class extends BaseService {
1085
955
  if (this._tokenManager) {
1086
956
  this._tokenManager.setTokens(tokenData);
1087
957
  }
1088
- this.updateContext({ authToken: tokens.accessToken });
1089
958
  }
1090
959
  if (response.success) {
1091
960
  return response.data;
@@ -1118,7 +987,6 @@ var AuthService = class extends BaseService {
1118
987
  if (this._tokenManager) {
1119
988
  this._tokenManager.setTokens(tokenData);
1120
989
  }
1121
- this.updateContext({ authToken: tokens.accessToken });
1122
990
  }
1123
991
  if (response.success) {
1124
992
  return response.data;
@@ -1151,7 +1019,6 @@ var AuthService = class extends BaseService {
1151
1019
  if (this._tokenManager) {
1152
1020
  this._tokenManager.setTokens(tokenData);
1153
1021
  }
1154
- this.updateContext({ authToken: tokens.accessToken });
1155
1022
  }
1156
1023
  if (response.success) {
1157
1024
  return response.data;
@@ -1763,7 +1630,6 @@ var AuthService = class extends BaseService {
1763
1630
  this._tokenManager = null;
1764
1631
  }
1765
1632
  this._projectRoleCache.clear();
1766
- this._initialized = false;
1767
1633
  this._setReady(false);
1768
1634
  }
1769
1635
  };