@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
|
@@ -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
|
};
|
|
@@ -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
|
};
|
|
@@ -17014,6 +17014,22 @@ var CONFIG = {
|
|
|
17014
17014
|
typesensePort: "443",
|
|
17015
17015
|
typesenseProtocol: "https"
|
|
17016
17016
|
},
|
|
17017
|
+
preview: {
|
|
17018
|
+
socketUrl: "https://api.symbols.app",
|
|
17019
|
+
apiUrl: "https://api.symbols.app",
|
|
17020
|
+
basedEnv: "production",
|
|
17021
|
+
basedProject: "platform-v2-sm",
|
|
17022
|
+
basedOrg: "symbols",
|
|
17023
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
17024
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
17025
|
+
// For grafana tracing
|
|
17026
|
+
grafanaAppName: "Symbols Preview",
|
|
17027
|
+
typesenseCollectionName: "docs",
|
|
17028
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
17029
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
17030
|
+
typesensePort: "443",
|
|
17031
|
+
typesenseProtocol: "https"
|
|
17032
|
+
},
|
|
17017
17033
|
production: {
|
|
17018
17034
|
socketUrl: "https://api.symbols.app",
|
|
17019
17035
|
apiUrl: "https://api.symbols.app",
|
|
@@ -17064,6 +17080,7 @@ var getConfig = () => {
|
|
|
17064
17080
|
isDevelopment: isDevelopment(env),
|
|
17065
17081
|
isTesting: env === "testing",
|
|
17066
17082
|
isStaging: env === "staging",
|
|
17083
|
+
isPreview: env === "preview",
|
|
17067
17084
|
isProduction: env === "production"
|
|
17068
17085
|
// Store all environment variables for potential future use
|
|
17069
17086
|
};
|
|
@@ -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,
|
|
@@ -17568,6 +17568,22 @@ var CONFIG = {
|
|
|
17568
17568
|
typesensePort: "443",
|
|
17569
17569
|
typesenseProtocol: "https"
|
|
17570
17570
|
},
|
|
17571
|
+
preview: {
|
|
17572
|
+
socketUrl: "https://api.symbols.app",
|
|
17573
|
+
apiUrl: "https://api.symbols.app",
|
|
17574
|
+
basedEnv: "production",
|
|
17575
|
+
basedProject: "platform-v2-sm",
|
|
17576
|
+
basedOrg: "symbols",
|
|
17577
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
17578
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
17579
|
+
// For grafana tracing
|
|
17580
|
+
grafanaAppName: "Symbols Preview",
|
|
17581
|
+
typesenseCollectionName: "docs",
|
|
17582
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
17583
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
17584
|
+
typesensePort: "443",
|
|
17585
|
+
typesenseProtocol: "https"
|
|
17586
|
+
},
|
|
17571
17587
|
production: {
|
|
17572
17588
|
socketUrl: "https://api.symbols.app",
|
|
17573
17589
|
apiUrl: "https://api.symbols.app",
|
|
@@ -17618,6 +17634,7 @@ var getConfig = () => {
|
|
|
17618
17634
|
isDevelopment: isDevelopment(env),
|
|
17619
17635
|
isTesting: env === "testing",
|
|
17620
17636
|
isStaging: env === "staging",
|
|
17637
|
+
isPreview: env === "preview",
|
|
17621
17638
|
isProduction: env === "production"
|
|
17622
17639
|
// Store all environment variables for potential future use
|
|
17623
17640
|
};
|
|
@@ -103,6 +103,22 @@ const CONFIG = {
|
|
|
103
103
|
typesensePort: "443",
|
|
104
104
|
typesenseProtocol: "https"
|
|
105
105
|
},
|
|
106
|
+
preview: {
|
|
107
|
+
socketUrl: "https://api.symbols.app",
|
|
108
|
+
apiUrl: "https://api.symbols.app",
|
|
109
|
+
basedEnv: "production",
|
|
110
|
+
basedProject: "platform-v2-sm",
|
|
111
|
+
basedOrg: "symbols",
|
|
112
|
+
githubClientId: "Ov23liFAlOEIXtX3dBtR",
|
|
113
|
+
grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae",
|
|
114
|
+
// For grafana tracing
|
|
115
|
+
grafanaAppName: "Symbols Preview",
|
|
116
|
+
typesenseCollectionName: "docs",
|
|
117
|
+
typesenseApiKey: "awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA",
|
|
118
|
+
typesenseHost: "tl2qpnwxev4cjm36p-1.a1.typesense.net",
|
|
119
|
+
typesensePort: "443",
|
|
120
|
+
typesenseProtocol: "https"
|
|
121
|
+
},
|
|
106
122
|
production: {
|
|
107
123
|
socketUrl: "https://api.symbols.app",
|
|
108
124
|
apiUrl: "https://api.symbols.app",
|
|
@@ -154,6 +170,7 @@ const 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/node/index.js
CHANGED
|
@@ -126,16 +126,15 @@ class CollabService extends BaseService {
|
|
|
126
126
|
...options
|
|
127
127
|
};
|
|
128
128
|
let { authToken: jwt } = mergedOptions;
|
|
129
|
-
const {
|
|
130
|
-
projectId,
|
|
131
|
-
branch = "main",
|
|
132
|
-
pro
|
|
133
|
-
} = mergedOptions;
|
|
129
|
+
const { projectId, branch = "main", pro } = mergedOptions;
|
|
134
130
|
if (!jwt && this._tokenManager) {
|
|
135
131
|
try {
|
|
136
132
|
jwt = await this._tokenManager.ensureValidToken();
|
|
137
133
|
} catch (error) {
|
|
138
|
-
console.warn(
|
|
134
|
+
console.warn(
|
|
135
|
+
"[CollabService] Failed to obtain auth token from token manager",
|
|
136
|
+
error
|
|
137
|
+
);
|
|
139
138
|
}
|
|
140
139
|
if (!jwt && typeof this._tokenManager.getAccessToken === "function") {
|
|
141
140
|
jwt = this._tokenManager.getAccessToken();
|
|
@@ -234,32 +233,28 @@ class CollabService extends BaseService {
|
|
|
234
233
|
rootBus.emit("checkpoint:done", { version, origin: "auto" });
|
|
235
234
|
});
|
|
236
235
|
socket == null ? void 0 : socket.on("clients", this._handleClientsEvent.bind(this));
|
|
237
|
-
socket == null ? void 0 : socket.on(
|
|
238
|
-
|
|
239
|
-
this._handleBundleDoneEvent.bind(this)
|
|
240
|
-
);
|
|
241
|
-
socket == null ? void 0 : socket.on(
|
|
242
|
-
"bundle:error",
|
|
243
|
-
this._handleBundleErrorEvent.bind(this)
|
|
244
|
-
);
|
|
236
|
+
socket == null ? void 0 : socket.on("bundle:done", this._handleBundleDoneEvent.bind(this));
|
|
237
|
+
socket == null ? void 0 : socket.on("bundle:error", this._handleBundleErrorEvent.bind(this));
|
|
245
238
|
if (this._pendingOps.length) {
|
|
246
239
|
console.log(
|
|
247
240
|
`[CollabService] Flushing ${this._pendingOps.length} offline operation batch(es)`
|
|
248
241
|
);
|
|
249
|
-
this._pendingOps.forEach(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
242
|
+
this._pendingOps.forEach(
|
|
243
|
+
({ changes, granularChanges, orders, options: opOptions }) => {
|
|
244
|
+
const { message } = opOptions || {};
|
|
245
|
+
const ts = Date.now();
|
|
246
|
+
const payload = {
|
|
247
|
+
changes,
|
|
248
|
+
granularChanges,
|
|
249
|
+
orders,
|
|
250
|
+
ts
|
|
251
|
+
};
|
|
252
|
+
if (message) {
|
|
253
|
+
payload.message = message;
|
|
254
|
+
}
|
|
255
|
+
this.socket.emit("ops", payload);
|
|
260
256
|
}
|
|
261
|
-
|
|
262
|
-
});
|
|
257
|
+
);
|
|
263
258
|
this._pendingOps.length = 0;
|
|
264
259
|
}
|
|
265
260
|
await this._client.ready;
|
|
@@ -281,7 +276,9 @@ class CollabService extends BaseService {
|
|
|
281
276
|
var _a;
|
|
282
277
|
if ((_a = this._client) == null ? void 0 : _a.socket) {
|
|
283
278
|
if (this._pendingConnectReject) {
|
|
284
|
-
this._pendingConnectReject(
|
|
279
|
+
this._pendingConnectReject(
|
|
280
|
+
new Error("[CollabService] Connection attempt aborted")
|
|
281
|
+
);
|
|
285
282
|
this._pendingConnectReject = null;
|
|
286
283
|
}
|
|
287
284
|
this._detachSocketLifecycleListeners();
|
|
@@ -354,9 +351,7 @@ class CollabService extends BaseService {
|
|
|
354
351
|
processedTuples.push(...options.append);
|
|
355
352
|
}
|
|
356
353
|
this._stateManager.applyChanges(tuples, { ...options });
|
|
357
|
-
const stringifiedGranularTuples = stringifyFunctionsForTransport(
|
|
358
|
-
processedTuples
|
|
359
|
-
);
|
|
354
|
+
const stringifiedGranularTuples = stringifyFunctionsForTransport(processedTuples);
|
|
360
355
|
const stringifiedTuples = stringifyFunctionsForTransport(tuples);
|
|
361
356
|
const { message } = options;
|
|
362
357
|
if (!this.isConnected()) {
|
|
@@ -371,13 +366,6 @@ class CollabService extends BaseService {
|
|
|
371
366
|
}
|
|
372
367
|
if ((_b = this.socket) == null ? void 0 : _b.connected) {
|
|
373
368
|
const ts = Date.now();
|
|
374
|
-
console.log("[CollabService] Sending operations to the backend", {
|
|
375
|
-
changes: stringifiedTuples,
|
|
376
|
-
granularChanges: stringifiedGranularTuples,
|
|
377
|
-
orders,
|
|
378
|
-
ts,
|
|
379
|
-
message
|
|
380
|
-
});
|
|
381
369
|
const payload = {
|
|
382
370
|
changes: stringifiedTuples,
|
|
383
371
|
granularChanges: stringifiedGranularTuples,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/sdk",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"test:user": "cross-env NODE_ENV=$NODE_ENV npx tape integration-tests/index.js integration-tests/user/*.test.js | tap-spec"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@domql/element": "^2.33.
|
|
50
|
-
"@domql/utils": "^2.33.
|
|
49
|
+
"@domql/element": "^2.33.4",
|
|
50
|
+
"@domql/utils": "^2.33.4",
|
|
51
51
|
"@grafana/faro-web-sdk": "^1.19.0",
|
|
52
52
|
"@grafana/faro-web-tracing": "^1.19.0",
|
|
53
|
-
"@symbo.ls/router": "^2.33.
|
|
54
|
-
"@symbo.ls/socket": "^2.33.
|
|
53
|
+
"@symbo.ls/router": "^2.33.4",
|
|
54
|
+
"@symbo.ls/socket": "^2.33.4",
|
|
55
55
|
"acorn": "^8.14.0",
|
|
56
56
|
"acorn-walk": "^8.3.4",
|
|
57
57
|
"dexie": "^4.0.11",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"tap-spec": "^5.0.0",
|
|
74
74
|
"tape": "^5.9.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "fee8c901e8201c02e2be6b07507d91401c8903d7"
|
|
77
77
|
}
|
|
@@ -98,6 +98,22 @@ const CONFIG = {
|
|
|
98
98
|
typesensePort: '443',
|
|
99
99
|
typesenseProtocol: 'https'
|
|
100
100
|
},
|
|
101
|
+
preview: {
|
|
102
|
+
socketUrl: 'https://api.symbols.app',
|
|
103
|
+
apiUrl: 'https://api.symbols.app',
|
|
104
|
+
basedEnv: 'production',
|
|
105
|
+
basedProject: 'platform-v2-sm',
|
|
106
|
+
basedOrg: 'symbols',
|
|
107
|
+
githubClientId: 'Ov23liFAlOEIXtX3dBtR',
|
|
108
|
+
grafanaUrl:
|
|
109
|
+
'https://faro-collector-prod-us-east-0.grafana.net/collect/5c1089f3c3eea4ec5658e05c3f53baae', // For grafana tracing
|
|
110
|
+
grafanaAppName: 'Symbols Preview',
|
|
111
|
+
typesenseCollectionName: 'docs',
|
|
112
|
+
typesenseApiKey: 'awmcVpbWqZi9IUgmvslp1C5LKDU8tMjA',
|
|
113
|
+
typesenseHost: 'tl2qpnwxev4cjm36p-1.a1.typesense.net',
|
|
114
|
+
typesensePort: '443',
|
|
115
|
+
typesenseProtocol: 'https'
|
|
116
|
+
},
|
|
101
117
|
production: {
|
|
102
118
|
socketUrl: 'https://api.symbols.app',
|
|
103
119
|
apiUrl: 'https://api.symbols.app',
|
|
@@ -164,6 +180,7 @@ export const getConfig = () => {
|
|
|
164
180
|
isDevelopment: isDevelopment(env),
|
|
165
181
|
isTesting: env === 'testing',
|
|
166
182
|
isStaging: env === 'staging',
|
|
183
|
+
isPreview: env === 'preview',
|
|
167
184
|
isProduction: env === 'production'
|
|
168
185
|
// Store all environment variables for potential future use
|
|
169
186
|
}
|
package/src/index.js
CHANGED
|
@@ -34,6 +34,9 @@ export class SDK {
|
|
|
34
34
|
this._context = {}
|
|
35
35
|
this._options = this._validateOptions(options)
|
|
36
36
|
|
|
37
|
+
// Expose resolved environment config on SDK instance
|
|
38
|
+
this.environment = environment
|
|
39
|
+
|
|
37
40
|
// Expose root event bus on SDK instance
|
|
38
41
|
this.rootBus = rootBus
|
|
39
42
|
|