@symbo.ls/sdk 2.33.2 → 2.33.4
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/cjs/config/environment.js +17 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/services/CollabService.js +26 -38
- package/dist/esm/config/environment.js +17 -0
- package/dist/esm/index.js +44 -38
- package/dist/esm/services/AdminService.js +17 -0
- package/dist/esm/services/AuthService.js +17 -0
- package/dist/esm/services/BaseService.js +17 -0
- package/dist/esm/services/BranchService.js +17 -0
- package/dist/esm/services/CollabService.js +43 -38
- package/dist/esm/services/DnsService.js +17 -0
- package/dist/esm/services/FileService.js +17 -0
- package/dist/esm/services/PaymentService.js +17 -0
- package/dist/esm/services/PlanService.js +17 -0
- package/dist/esm/services/ProjectService.js +17 -0
- package/dist/esm/services/PullRequestService.js +17 -0
- package/dist/esm/services/ScreenshotService.js +17 -0
- package/dist/esm/services/SubscriptionService.js +17 -0
- package/dist/esm/services/TrackingService.js +17 -0
- package/dist/esm/services/index.js +43 -38
- package/dist/esm/utils/CollabClient.js +17 -0
- package/dist/node/config/environment.js +17 -0
- package/dist/node/index.js +1 -0
- package/dist/node/services/CollabService.js +26 -38
- package/package.json +6 -6
- package/src/config/environment.js +17 -0
- package/src/index.js +3 -0
- package/src/services/CollabService.js +39 -41
|
@@ -126,6 +126,22 @@ const CONFIG = {
|
|
|
126
126
|
typesensePort: "443",
|
|
127
127
|
typesenseProtocol: "https"
|
|
128
128
|
},
|
|
129
|
+
preview: {
|
|
130
|
+
socketUrl: "https://api.symbols.app",
|
|
131
|
+
apiUrl: "https://api.symbols.app",
|
|
132
|
+
basedEnv: "production",
|
|
133
|
+
basedProject: "platform-v2-sm",
|
|
134
|
+
basedOrg: "symbols",
|
|
135
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
136
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
137
|
+
// For grafana tracing
|
|
138
|
+
grafanaAppName: "Symbols Preview",
|
|
139
|
+
typesenseCollectionName: "docs",
|
|
140
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
141
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
142
|
+
typesensePort: "443",
|
|
143
|
+
typesenseProtocol: "https"
|
|
144
|
+
},
|
|
129
145
|
production: {
|
|
130
146
|
socketUrl: "https://api.symbols.app",
|
|
131
147
|
apiUrl: "https://api.symbols.app",
|
|
@@ -177,6 +193,7 @@ const getConfig = () => {
|
|
|
177
193
|
isDevelopment: (0, import_utils.isDevelopment)(env),
|
|
178
194
|
isTesting: env === "testing",
|
|
179
195
|
isStaging: env === "staging",
|
|
196
|
+
isPreview: env === "preview",
|
|
180
197
|
isProduction: env === "production"
|
|
181
198
|
// Store all environment variables for potential future use
|
|
182
199
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -64,6 +64,7 @@ class SDK {
|
|
|
64
64
|
this._services = /* @__PURE__ */ new Map();
|
|
65
65
|
this._context = {};
|
|
66
66
|
this._options = this._validateOptions(options);
|
|
67
|
+
this.environment = import_environment.default;
|
|
67
68
|
this.rootBus = import_rootEventBus.rootBus;
|
|
68
69
|
this._createServiceProxies();
|
|
69
70
|
}
|
|
@@ -148,16 +148,15 @@ class CollabService extends import_BaseService.BaseService {
|
|
|
148
148
|
...options
|
|
149
149
|
};
|
|
150
150
|
let { authToken: jwt } = mergedOptions;
|
|
151
|
-
const {
|
|
152
|
-
projectId,
|
|
153
|
-
branch = "main",
|
|
154
|
-
pro
|
|
155
|
-
} = mergedOptions;
|
|
151
|
+
const { projectId, branch = "main", pro } = mergedOptions;
|
|
156
152
|
if (!jwt && this._tokenManager) {
|
|
157
153
|
try {
|
|
158
154
|
jwt = await this._tokenManager.ensureValidToken();
|
|
159
155
|
} catch (error) {
|
|
160
|
-
console.warn(
|
|
156
|
+
console.warn(
|
|
157
|
+
"[CollabService] Failed to obtain auth token from token manager",
|
|
158
|
+
error
|
|
159
|
+
);
|
|
161
160
|
}
|
|
162
161
|
if (!jwt && typeof this._tokenManager.getAccessToken === "function") {
|
|
163
162
|
jwt = this._tokenManager.getAccessToken();
|
|
@@ -256,32 +255,28 @@ class CollabService extends import_BaseService.BaseService {
|
|
|
256
255
|
import_rootEventBus.rootBus.emit("checkpoint:done", { version, origin: "auto" });
|
|
257
256
|
});
|
|
258
257
|
socket == null ? void 0 : socket.on("clients", this._handleClientsEvent.bind(this));
|
|
259
|
-
socket == null ? void 0 : socket.on(
|
|
260
|
-
|
|
261
|
-
this._handleBundleDoneEvent.bind(this)
|
|
262
|
-
);
|
|
263
|
-
socket == null ? void 0 : socket.on(
|
|
264
|
-
"bundle:error",
|
|
265
|
-
this._handleBundleErrorEvent.bind(this)
|
|
266
|
-
);
|
|
258
|
+
socket == null ? void 0 : socket.on("bundle:done", this._handleBundleDoneEvent.bind(this));
|
|
259
|
+
socket == null ? void 0 : socket.on("bundle:error", this._handleBundleErrorEvent.bind(this));
|
|
267
260
|
if (this._pendingOps.length) {
|
|
268
261
|
console.log(
|
|
269
262
|
`[CollabService] Flushing ${this._pendingOps.length} offline operation batch(es)`
|
|
270
263
|
);
|
|
271
|
-
this._pendingOps.forEach(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
264
|
+
this._pendingOps.forEach(
|
|
265
|
+
({ changes, granularChanges, orders, options: opOptions }) => {
|
|
266
|
+
const { message } = opOptions || {};
|
|
267
|
+
const ts = Date.now();
|
|
268
|
+
const payload = {
|
|
269
|
+
changes,
|
|
270
|
+
granularChanges,
|
|
271
|
+
orders,
|
|
272
|
+
ts
|
|
273
|
+
};
|
|
274
|
+
if (message) {
|
|
275
|
+
payload.message = message;
|
|
276
|
+
}
|
|
277
|
+
this.socket.emit("ops", payload);
|
|
282
278
|
}
|
|
283
|
-
|
|
284
|
-
});
|
|
279
|
+
);
|
|
285
280
|
this._pendingOps.length = 0;
|
|
286
281
|
}
|
|
287
282
|
await this._client.ready;
|
|
@@ -303,7 +298,9 @@ class CollabService extends import_BaseService.BaseService {
|
|
|
303
298
|
var _a;
|
|
304
299
|
if ((_a = this._client) == null ? void 0 : _a.socket) {
|
|
305
300
|
if (this._pendingConnectReject) {
|
|
306
|
-
this._pendingConnectReject(
|
|
301
|
+
this._pendingConnectReject(
|
|
302
|
+
new Error("[CollabService] Connection attempt aborted")
|
|
303
|
+
);
|
|
307
304
|
this._pendingConnectReject = null;
|
|
308
305
|
}
|
|
309
306
|
this._detachSocketLifecycleListeners();
|
|
@@ -376,9 +373,7 @@ class CollabService extends import_BaseService.BaseService {
|
|
|
376
373
|
processedTuples.push(...options.append);
|
|
377
374
|
}
|
|
378
375
|
this._stateManager.applyChanges(tuples, { ...options });
|
|
379
|
-
const stringifiedGranularTuples = stringifyFunctionsForTransport(
|
|
380
|
-
processedTuples
|
|
381
|
-
);
|
|
376
|
+
const stringifiedGranularTuples = stringifyFunctionsForTransport(processedTuples);
|
|
382
377
|
const stringifiedTuples = stringifyFunctionsForTransport(tuples);
|
|
383
378
|
const { message } = options;
|
|
384
379
|
if (!this.isConnected()) {
|
|
@@ -393,13 +388,6 @@ class CollabService extends import_BaseService.BaseService {
|
|
|
393
388
|
}
|
|
394
389
|
if ((_b = this.socket) == null ? void 0 : _b.connected) {
|
|
395
390
|
const ts = Date.now();
|
|
396
|
-
console.log("[CollabService] Sending operations to the backend", {
|
|
397
|
-
changes: stringifiedTuples,
|
|
398
|
-
granularChanges: stringifiedGranularTuples,
|
|
399
|
-
orders,
|
|
400
|
-
ts,
|
|
401
|
-
message
|
|
402
|
-
});
|
|
403
391
|
const payload = {
|
|
404
392
|
changes: stringifiedTuples,
|
|
405
393
|
granularChanges: stringifiedGranularTuples,
|
|
@@ -104,6 +104,22 @@ var CONFIG = {
|
|
|
104
104
|
typesensePort: "443",
|
|
105
105
|
typesenseProtocol: "https"
|
|
106
106
|
},
|
|
107
|
+
preview: {
|
|
108
|
+
socketUrl: "https://api.symbols.app",
|
|
109
|
+
apiUrl: "https://api.symbols.app",
|
|
110
|
+
basedEnv: "production",
|
|
111
|
+
basedProject: "platform-v2-sm",
|
|
112
|
+
basedOrg: "symbols",
|
|
113
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
114
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
115
|
+
// For grafana tracing
|
|
116
|
+
grafanaAppName: "Symbols Preview",
|
|
117
|
+
typesenseCollectionName: "docs",
|
|
118
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
119
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
120
|
+
typesensePort: "443",
|
|
121
|
+
typesenseProtocol: "https"
|
|
122
|
+
},
|
|
107
123
|
production: {
|
|
108
124
|
socketUrl: "https://api.symbols.app",
|
|
109
125
|
apiUrl: "https://api.symbols.app",
|
|
@@ -154,6 +170,7 @@ var getConfig = () => {
|
|
|
154
170
|
isDevelopment: isDevelopment(env),
|
|
155
171
|
isTesting: env === "testing",
|
|
156
172
|
isStaging: env === "staging",
|
|
173
|
+
isPreview: env === "preview",
|
|
157
174
|
isProduction: env === "production"
|
|
158
175
|
// Store all environment variables for potential future use
|
|
159
176
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -31066,6 +31066,22 @@ var CONFIG = {
|
|
|
31066
31066
|
typesensePort: "443",
|
|
31067
31067
|
typesenseProtocol: "https"
|
|
31068
31068
|
},
|
|
31069
|
+
preview: {
|
|
31070
|
+
socketUrl: "https://api.symbols.app",
|
|
31071
|
+
apiUrl: "https://api.symbols.app",
|
|
31072
|
+
basedEnv: "production",
|
|
31073
|
+
basedProject: "platform-v2-sm",
|
|
31074
|
+
basedOrg: "symbols",
|
|
31075
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
31076
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
31077
|
+
// For grafana tracing
|
|
31078
|
+
grafanaAppName: "Symbols Preview",
|
|
31079
|
+
typesenseCollectionName: "docs",
|
|
31080
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
31081
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
31082
|
+
typesensePort: "443",
|
|
31083
|
+
typesenseProtocol: "https"
|
|
31084
|
+
},
|
|
31069
31085
|
production: {
|
|
31070
31086
|
socketUrl: "https://api.symbols.app",
|
|
31071
31087
|
apiUrl: "https://api.symbols.app",
|
|
@@ -31116,6 +31132,7 @@ var getConfig = () => {
|
|
|
31116
31132
|
isDevelopment: isDevelopment(env),
|
|
31117
31133
|
isTesting: env === "testing",
|
|
31118
31134
|
isStaging: env === "staging",
|
|
31135
|
+
isPreview: env === "preview",
|
|
31119
31136
|
isProduction: env === "production"
|
|
31120
31137
|
// Store all environment variables for potential future use
|
|
31121
31138
|
};
|
|
@@ -43222,16 +43239,15 @@ var CollabService = class extends BaseService {
|
|
|
43222
43239
|
...options
|
|
43223
43240
|
};
|
|
43224
43241
|
let { authToken: jwt } = mergedOptions;
|
|
43225
|
-
const {
|
|
43226
|
-
projectId,
|
|
43227
|
-
branch = "main",
|
|
43228
|
-
pro
|
|
43229
|
-
} = mergedOptions;
|
|
43242
|
+
const { projectId, branch = "main", pro } = mergedOptions;
|
|
43230
43243
|
if (!jwt && this._tokenManager) {
|
|
43231
43244
|
try {
|
|
43232
43245
|
jwt = await this._tokenManager.ensureValidToken();
|
|
43233
43246
|
} catch (error) {
|
|
43234
|
-
console.warn(
|
|
43247
|
+
console.warn(
|
|
43248
|
+
"[CollabService] Failed to obtain auth token from token manager",
|
|
43249
|
+
error
|
|
43250
|
+
);
|
|
43235
43251
|
}
|
|
43236
43252
|
if (!jwt && typeof this._tokenManager.getAccessToken === "function") {
|
|
43237
43253
|
jwt = this._tokenManager.getAccessToken();
|
|
@@ -43330,32 +43346,28 @@ var CollabService = class extends BaseService {
|
|
|
43330
43346
|
rootBus.emit("checkpoint:done", { version: version2, origin: "auto" });
|
|
43331
43347
|
});
|
|
43332
43348
|
socket == null ? void 0 : socket.on("clients", this._handleClientsEvent.bind(this));
|
|
43333
|
-
socket == null ? void 0 : socket.on(
|
|
43334
|
-
|
|
43335
|
-
this._handleBundleDoneEvent.bind(this)
|
|
43336
|
-
);
|
|
43337
|
-
socket == null ? void 0 : socket.on(
|
|
43338
|
-
"bundle:error",
|
|
43339
|
-
this._handleBundleErrorEvent.bind(this)
|
|
43340
|
-
);
|
|
43349
|
+
socket == null ? void 0 : socket.on("bundle:done", this._handleBundleDoneEvent.bind(this));
|
|
43350
|
+
socket == null ? void 0 : socket.on("bundle:error", this._handleBundleErrorEvent.bind(this));
|
|
43341
43351
|
if (this._pendingOps.length) {
|
|
43342
43352
|
console.log(
|
|
43343
43353
|
`[CollabService] Flushing ${this._pendingOps.length} offline operation batch(es)`
|
|
43344
43354
|
);
|
|
43345
|
-
this._pendingOps.forEach(
|
|
43346
|
-
|
|
43347
|
-
|
|
43348
|
-
|
|
43349
|
-
|
|
43350
|
-
|
|
43351
|
-
|
|
43352
|
-
|
|
43353
|
-
|
|
43354
|
-
|
|
43355
|
-
|
|
43355
|
+
this._pendingOps.forEach(
|
|
43356
|
+
({ changes, granularChanges, orders, options: opOptions }) => {
|
|
43357
|
+
const { message } = opOptions || {};
|
|
43358
|
+
const ts = Date.now();
|
|
43359
|
+
const payload = {
|
|
43360
|
+
changes,
|
|
43361
|
+
granularChanges,
|
|
43362
|
+
orders,
|
|
43363
|
+
ts
|
|
43364
|
+
};
|
|
43365
|
+
if (message) {
|
|
43366
|
+
payload.message = message;
|
|
43367
|
+
}
|
|
43368
|
+
this.socket.emit("ops", payload);
|
|
43356
43369
|
}
|
|
43357
|
-
|
|
43358
|
-
});
|
|
43370
|
+
);
|
|
43359
43371
|
this._pendingOps.length = 0;
|
|
43360
43372
|
}
|
|
43361
43373
|
await this._client.ready;
|
|
@@ -43377,7 +43389,9 @@ var CollabService = class extends BaseService {
|
|
|
43377
43389
|
var _a2;
|
|
43378
43390
|
if ((_a2 = this._client) == null ? void 0 : _a2.socket) {
|
|
43379
43391
|
if (this._pendingConnectReject) {
|
|
43380
|
-
this._pendingConnectReject(
|
|
43392
|
+
this._pendingConnectReject(
|
|
43393
|
+
new Error("[CollabService] Connection attempt aborted")
|
|
43394
|
+
);
|
|
43381
43395
|
this._pendingConnectReject = null;
|
|
43382
43396
|
}
|
|
43383
43397
|
this._detachSocketLifecycleListeners();
|
|
@@ -43450,9 +43464,7 @@ var CollabService = class extends BaseService {
|
|
|
43450
43464
|
processedTuples.push(...options.append);
|
|
43451
43465
|
}
|
|
43452
43466
|
this._stateManager.applyChanges(tuples, { ...options });
|
|
43453
|
-
const stringifiedGranularTuples = stringifyFunctionsForTransport(
|
|
43454
|
-
processedTuples
|
|
43455
|
-
);
|
|
43467
|
+
const stringifiedGranularTuples = stringifyFunctionsForTransport(processedTuples);
|
|
43456
43468
|
const stringifiedTuples = stringifyFunctionsForTransport(tuples);
|
|
43457
43469
|
const { message } = options;
|
|
43458
43470
|
if (!this.isConnected()) {
|
|
@@ -43467,13 +43479,6 @@ var CollabService = class extends BaseService {
|
|
|
43467
43479
|
}
|
|
43468
43480
|
if ((_b = this.socket) == null ? void 0 : _b.connected) {
|
|
43469
43481
|
const ts = Date.now();
|
|
43470
|
-
console.log("[CollabService] Sending operations to the backend", {
|
|
43471
|
-
changes: stringifiedTuples,
|
|
43472
|
-
granularChanges: stringifiedGranularTuples,
|
|
43473
|
-
orders,
|
|
43474
|
-
ts,
|
|
43475
|
-
message
|
|
43476
|
-
});
|
|
43477
43482
|
const payload = {
|
|
43478
43483
|
changes: stringifiedTuples,
|
|
43479
43484
|
granularChanges: stringifiedGranularTuples,
|
|
@@ -48561,6 +48566,7 @@ var SDK = class {
|
|
|
48561
48566
|
this._services = /* @__PURE__ */ new Map();
|
|
48562
48567
|
this._context = {};
|
|
48563
48568
|
this._options = this._validateOptions(options);
|
|
48569
|
+
this.environment = environment_default;
|
|
48564
48570
|
this.rootBus = rootBus;
|
|
48565
48571
|
this._createServiceProxies();
|
|
48566
48572
|
}
|
|
@@ -108,6 +108,22 @@ var CONFIG = {
|
|
|
108
108
|
typesensePort: "443",
|
|
109
109
|
typesenseProtocol: "https"
|
|
110
110
|
},
|
|
111
|
+
preview: {
|
|
112
|
+
socketUrl: "https://api.symbols.app",
|
|
113
|
+
apiUrl: "https://api.symbols.app",
|
|
114
|
+
basedEnv: "production",
|
|
115
|
+
basedProject: "platform-v2-sm",
|
|
116
|
+
basedOrg: "symbols",
|
|
117
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
118
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
119
|
+
// For grafana tracing
|
|
120
|
+
grafanaAppName: "Symbols Preview",
|
|
121
|
+
typesenseCollectionName: "docs",
|
|
122
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
123
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
124
|
+
typesensePort: "443",
|
|
125
|
+
typesenseProtocol: "https"
|
|
126
|
+
},
|
|
111
127
|
production: {
|
|
112
128
|
socketUrl: "https://api.symbols.app",
|
|
113
129
|
apiUrl: "https://api.symbols.app",
|
|
@@ -158,6 +174,7 @@ var getConfig = () => {
|
|
|
158
174
|
isDevelopment: isDevelopment(env),
|
|
159
175
|
isTesting: env === "testing",
|
|
160
176
|
isStaging: env === "staging",
|
|
177
|
+
isPreview: env === "preview",
|
|
161
178
|
isProduction: env === "production"
|
|
162
179
|
// Store all environment variables for potential future use
|
|
163
180
|
};
|
|
@@ -108,6 +108,22 @@ var CONFIG = {
|
|
|
108
108
|
typesensePort: "443",
|
|
109
109
|
typesenseProtocol: "https"
|
|
110
110
|
},
|
|
111
|
+
preview: {
|
|
112
|
+
socketUrl: "https://api.symbols.app",
|
|
113
|
+
apiUrl: "https://api.symbols.app",
|
|
114
|
+
basedEnv: "production",
|
|
115
|
+
basedProject: "platform-v2-sm",
|
|
116
|
+
basedOrg: "symbols",
|
|
117
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
118
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
119
|
+
// For grafana tracing
|
|
120
|
+
grafanaAppName: "Symbols Preview",
|
|
121
|
+
typesenseCollectionName: "docs",
|
|
122
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
123
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
124
|
+
typesensePort: "443",
|
|
125
|
+
typesenseProtocol: "https"
|
|
126
|
+
},
|
|
111
127
|
production: {
|
|
112
128
|
socketUrl: "https://api.symbols.app",
|
|
113
129
|
apiUrl: "https://api.symbols.app",
|
|
@@ -158,6 +174,7 @@ var getConfig = () => {
|
|
|
158
174
|
isDevelopment: isDevelopment(env),
|
|
159
175
|
isTesting: env === "testing",
|
|
160
176
|
isStaging: env === "staging",
|
|
177
|
+
isPreview: env === "preview",
|
|
161
178
|
isProduction: env === "production"
|
|
162
179
|
// Store all environment variables for potential future use
|
|
163
180
|
};
|
|
@@ -108,6 +108,22 @@ var CONFIG = {
|
|
|
108
108
|
typesensePort: "443",
|
|
109
109
|
typesenseProtocol: "https"
|
|
110
110
|
},
|
|
111
|
+
preview: {
|
|
112
|
+
socketUrl: "https://api.symbols.app",
|
|
113
|
+
apiUrl: "https://api.symbols.app",
|
|
114
|
+
basedEnv: "production",
|
|
115
|
+
basedProject: "platform-v2-sm",
|
|
116
|
+
basedOrg: "symbols",
|
|
117
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
118
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
119
|
+
// For grafana tracing
|
|
120
|
+
grafanaAppName: "Symbols Preview",
|
|
121
|
+
typesenseCollectionName: "docs",
|
|
122
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
123
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
124
|
+
typesensePort: "443",
|
|
125
|
+
typesenseProtocol: "https"
|
|
126
|
+
},
|
|
111
127
|
production: {
|
|
112
128
|
socketUrl: "https://api.symbols.app",
|
|
113
129
|
apiUrl: "https://api.symbols.app",
|
|
@@ -158,6 +174,7 @@ var getConfig = () => {
|
|
|
158
174
|
isDevelopment: isDevelopment(env),
|
|
159
175
|
isTesting: env === "testing",
|
|
160
176
|
isStaging: env === "staging",
|
|
177
|
+
isPreview: env === "preview",
|
|
161
178
|
isProduction: env === "production"
|
|
162
179
|
// Store all environment variables for potential future use
|
|
163
180
|
};
|
|
@@ -108,6 +108,22 @@ var CONFIG = {
|
|
|
108
108
|
typesensePort: "443",
|
|
109
109
|
typesenseProtocol: "https"
|
|
110
110
|
},
|
|
111
|
+
preview: {
|
|
112
|
+
socketUrl: "https://api.symbols.app",
|
|
113
|
+
apiUrl: "https://api.symbols.app",
|
|
114
|
+
basedEnv: "production",
|
|
115
|
+
basedProject: "platform-v2-sm",
|
|
116
|
+
basedOrg: "symbols",
|
|
117
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
118
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
119
|
+
// For grafana tracing
|
|
120
|
+
grafanaAppName: "Symbols Preview",
|
|
121
|
+
typesenseCollectionName: "docs",
|
|
122
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
123
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
124
|
+
typesensePort: "443",
|
|
125
|
+
typesenseProtocol: "https"
|
|
126
|
+
},
|
|
111
127
|
production: {
|
|
112
128
|
socketUrl: "https://api.symbols.app",
|
|
113
129
|
apiUrl: "https://api.symbols.app",
|
|
@@ -158,6 +174,7 @@ var getConfig = () => {
|
|
|
158
174
|
isDevelopment: isDevelopment(env),
|
|
159
175
|
isTesting: env === "testing",
|
|
160
176
|
isStaging: env === "staging",
|
|
177
|
+
isPreview: env === "preview",
|
|
161
178
|
isProduction: env === "production"
|
|
162
179
|
// Store all environment variables for potential future use
|
|
163
180
|
};
|
|
@@ -14191,6 +14191,22 @@ var CONFIG = {
|
|
|
14191
14191
|
typesensePort: "443",
|
|
14192
14192
|
typesenseProtocol: "https"
|
|
14193
14193
|
},
|
|
14194
|
+
preview: {
|
|
14195
|
+
socketUrl: "https://api.symbols.app",
|
|
14196
|
+
apiUrl: "https://api.symbols.app",
|
|
14197
|
+
basedEnv: "production",
|
|
14198
|
+
basedProject: "platform-v2-sm",
|
|
14199
|
+
basedOrg: "symbols",
|
|
14200
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
14201
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
14202
|
+
// For grafana tracing
|
|
14203
|
+
grafanaAppName: "Symbols Preview",
|
|
14204
|
+
typesenseCollectionName: "docs",
|
|
14205
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
14206
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
14207
|
+
typesensePort: "443",
|
|
14208
|
+
typesenseProtocol: "https"
|
|
14209
|
+
},
|
|
14194
14210
|
production: {
|
|
14195
14211
|
socketUrl: "https://api.symbols.app",
|
|
14196
14212
|
apiUrl: "https://api.symbols.app",
|
|
@@ -14241,6 +14257,7 @@ var getConfig = () => {
|
|
|
14241
14257
|
isDevelopment: isDevelopment(env),
|
|
14242
14258
|
isTesting: env === "testing",
|
|
14243
14259
|
isStaging: env === "staging",
|
|
14260
|
+
isPreview: env === "preview",
|
|
14244
14261
|
isProduction: env === "production"
|
|
14245
14262
|
// Store all environment variables for potential future use
|
|
14246
14263
|
};
|
|
@@ -25297,16 +25314,15 @@ var CollabService = class extends BaseService {
|
|
|
25297
25314
|
...options
|
|
25298
25315
|
};
|
|
25299
25316
|
let { authToken: jwt } = mergedOptions;
|
|
25300
|
-
const {
|
|
25301
|
-
projectId,
|
|
25302
|
-
branch = "main",
|
|
25303
|
-
pro
|
|
25304
|
-
} = mergedOptions;
|
|
25317
|
+
const { projectId, branch = "main", pro } = mergedOptions;
|
|
25305
25318
|
if (!jwt && this._tokenManager) {
|
|
25306
25319
|
try {
|
|
25307
25320
|
jwt = await this._tokenManager.ensureValidToken();
|
|
25308
25321
|
} catch (error) {
|
|
25309
|
-
console.warn(
|
|
25322
|
+
console.warn(
|
|
25323
|
+
"[CollabService] Failed to obtain auth token from token manager",
|
|
25324
|
+
error
|
|
25325
|
+
);
|
|
25310
25326
|
}
|
|
25311
25327
|
if (!jwt && typeof this._tokenManager.getAccessToken === "function") {
|
|
25312
25328
|
jwt = this._tokenManager.getAccessToken();
|
|
@@ -25405,32 +25421,28 @@ var CollabService = class extends BaseService {
|
|
|
25405
25421
|
rootBus.emit("checkpoint:done", { version: version2, origin: "auto" });
|
|
25406
25422
|
});
|
|
25407
25423
|
socket == null ? void 0 : socket.on("clients", this._handleClientsEvent.bind(this));
|
|
25408
|
-
socket == null ? void 0 : socket.on(
|
|
25409
|
-
|
|
25410
|
-
this._handleBundleDoneEvent.bind(this)
|
|
25411
|
-
);
|
|
25412
|
-
socket == null ? void 0 : socket.on(
|
|
25413
|
-
"bundle:error",
|
|
25414
|
-
this._handleBundleErrorEvent.bind(this)
|
|
25415
|
-
);
|
|
25424
|
+
socket == null ? void 0 : socket.on("bundle:done", this._handleBundleDoneEvent.bind(this));
|
|
25425
|
+
socket == null ? void 0 : socket.on("bundle:error", this._handleBundleErrorEvent.bind(this));
|
|
25416
25426
|
if (this._pendingOps.length) {
|
|
25417
25427
|
console.log(
|
|
25418
25428
|
`[CollabService] Flushing ${this._pendingOps.length} offline operation batch(es)`
|
|
25419
25429
|
);
|
|
25420
|
-
this._pendingOps.forEach(
|
|
25421
|
-
|
|
25422
|
-
|
|
25423
|
-
|
|
25424
|
-
|
|
25425
|
-
|
|
25426
|
-
|
|
25427
|
-
|
|
25428
|
-
|
|
25429
|
-
|
|
25430
|
-
|
|
25430
|
+
this._pendingOps.forEach(
|
|
25431
|
+
({ changes, granularChanges, orders, options: opOptions }) => {
|
|
25432
|
+
const { message } = opOptions || {};
|
|
25433
|
+
const ts = Date.now();
|
|
25434
|
+
const payload = {
|
|
25435
|
+
changes,
|
|
25436
|
+
granularChanges,
|
|
25437
|
+
orders,
|
|
25438
|
+
ts
|
|
25439
|
+
};
|
|
25440
|
+
if (message) {
|
|
25441
|
+
payload.message = message;
|
|
25442
|
+
}
|
|
25443
|
+
this.socket.emit("ops", payload);
|
|
25431
25444
|
}
|
|
25432
|
-
|
|
25433
|
-
});
|
|
25445
|
+
);
|
|
25434
25446
|
this._pendingOps.length = 0;
|
|
25435
25447
|
}
|
|
25436
25448
|
await this._client.ready;
|
|
@@ -25452,7 +25464,9 @@ var CollabService = class extends BaseService {
|
|
|
25452
25464
|
var _a;
|
|
25453
25465
|
if ((_a = this._client) == null ? void 0 : _a.socket) {
|
|
25454
25466
|
if (this._pendingConnectReject) {
|
|
25455
|
-
this._pendingConnectReject(
|
|
25467
|
+
this._pendingConnectReject(
|
|
25468
|
+
new Error("[CollabService] Connection attempt aborted")
|
|
25469
|
+
);
|
|
25456
25470
|
this._pendingConnectReject = null;
|
|
25457
25471
|
}
|
|
25458
25472
|
this._detachSocketLifecycleListeners();
|
|
@@ -25525,9 +25539,7 @@ var CollabService = class extends BaseService {
|
|
|
25525
25539
|
processedTuples.push(...options.append);
|
|
25526
25540
|
}
|
|
25527
25541
|
this._stateManager.applyChanges(tuples, { ...options });
|
|
25528
|
-
const stringifiedGranularTuples = stringifyFunctionsForTransport(
|
|
25529
|
-
processedTuples
|
|
25530
|
-
);
|
|
25542
|
+
const stringifiedGranularTuples = stringifyFunctionsForTransport(processedTuples);
|
|
25531
25543
|
const stringifiedTuples = stringifyFunctionsForTransport(tuples);
|
|
25532
25544
|
const { message } = options;
|
|
25533
25545
|
if (!this.isConnected()) {
|
|
@@ -25542,13 +25554,6 @@ var CollabService = class extends BaseService {
|
|
|
25542
25554
|
}
|
|
25543
25555
|
if ((_b = this.socket) == null ? void 0 : _b.connected) {
|
|
25544
25556
|
const ts = Date.now();
|
|
25545
|
-
console.log("[CollabService] Sending operations to the backend", {
|
|
25546
|
-
changes: stringifiedTuples,
|
|
25547
|
-
granularChanges: stringifiedGranularTuples,
|
|
25548
|
-
orders,
|
|
25549
|
-
ts,
|
|
25550
|
-
message
|
|
25551
|
-
});
|
|
25552
25557
|
const payload = {
|
|
25553
25558
|
changes: stringifiedTuples,
|
|
25554
25559
|
granularChanges: stringifiedGranularTuples,
|
|
@@ -108,6 +108,22 @@ var CONFIG = {
|
|
|
108
108
|
typesensePort: "443",
|
|
109
109
|
typesenseProtocol: "https"
|
|
110
110
|
},
|
|
111
|
+
preview: {
|
|
112
|
+
socketUrl: "https://api.symbols.app",
|
|
113
|
+
apiUrl: "https://api.symbols.app",
|
|
114
|
+
basedEnv: "production",
|
|
115
|
+
basedProject: "platform-v2-sm",
|
|
116
|
+
basedOrg: "symbols",
|
|
117
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
118
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
119
|
+
// For grafana tracing
|
|
120
|
+
grafanaAppName: "Symbols Preview",
|
|
121
|
+
typesenseCollectionName: "docs",
|
|
122
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
123
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
124
|
+
typesensePort: "443",
|
|
125
|
+
typesenseProtocol: "https"
|
|
126
|
+
},
|
|
111
127
|
production: {
|
|
112
128
|
socketUrl: "https://api.symbols.app",
|
|
113
129
|
apiUrl: "https://api.symbols.app",
|
|
@@ -158,6 +174,7 @@ var getConfig = () => {
|
|
|
158
174
|
isDevelopment: isDevelopment(env),
|
|
159
175
|
isTesting: env === "testing",
|
|
160
176
|
isStaging: env === "staging",
|
|
177
|
+
isPreview: env === "preview",
|
|
161
178
|
isProduction: env === "production"
|
|
162
179
|
// Store all environment variables for potential future use
|
|
163
180
|
};
|
|
@@ -108,6 +108,22 @@ var CONFIG = {
|
|
|
108
108
|
typesensePort: "443",
|
|
109
109
|
typesenseProtocol: "https"
|
|
110
110
|
},
|
|
111
|
+
preview: {
|
|
112
|
+
socketUrl: "https://api.symbols.app",
|
|
113
|
+
apiUrl: "https://api.symbols.app",
|
|
114
|
+
basedEnv: "production",
|
|
115
|
+
basedProject: "platform-v2-sm",
|
|
116
|
+
basedOrg: "symbols",
|
|
117
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
118
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
119
|
+
// For grafana tracing
|
|
120
|
+
grafanaAppName: "Symbols Preview",
|
|
121
|
+
typesenseCollectionName: "docs",
|
|
122
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
123
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
124
|
+
typesensePort: "443",
|
|
125
|
+
typesenseProtocol: "https"
|
|
126
|
+
},
|
|
111
127
|
production: {
|
|
112
128
|
socketUrl: "https://api.symbols.app",
|
|
113
129
|
apiUrl: "https://api.symbols.app",
|
|
@@ -158,6 +174,7 @@ var getConfig = () => {
|
|
|
158
174
|
isDevelopment: isDevelopment(env),
|
|
159
175
|
isTesting: env === "testing",
|
|
160
176
|
isStaging: env === "staging",
|
|
177
|
+
isPreview: env === "preview",
|
|
161
178
|
isProduction: env === "production"
|
|
162
179
|
// Store all environment variables for potential future use
|
|
163
180
|
};
|