@powerhousedao/vetra-builder-package 0.0.27 → 0.0.29
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.
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
const getEnvVar = (key, defaultValue) => {
|
|
2
|
-
|
|
3
|
-
if (typeof window !== "undefined") {
|
|
4
|
-
// Browser environment - check window object for injected env vars
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
6
|
-
const windowEnv = window.__ENV__;
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
8
|
-
if (windowEnv && typeof windowEnv[key] === "string") {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
10
|
-
return windowEnv[key];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
// Node.js environment - check process.env
|
|
14
|
-
if (typeof process !== "undefined" && process.env) {
|
|
15
|
-
const value = process.env[key];
|
|
16
|
-
if (typeof value === "string") {
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return defaultValue;
|
|
2
|
+
return import.meta.env[key] ?? defaultValue;
|
|
21
3
|
};
|
|
22
4
|
export const config = {
|
|
23
|
-
renownGraphqlEndpoint: getEnvVar("
|
|
24
|
-
vetraGraphqlEndpoint: getEnvVar("
|
|
25
|
-
renownProfileBasePath: getEnvVar("
|
|
26
|
-
vetraPackageBasePath: getEnvVar("
|
|
27
|
-
vetraDriveBaseUrl: getEnvVar("
|
|
5
|
+
renownGraphqlEndpoint: getEnvVar("PH_VETRA_RENOWN_GRAPHQL_ENDPOINT", "https://switchboard.renown-staging.vetra.io/graphql"),
|
|
6
|
+
vetraGraphqlEndpoint: getEnvVar("PH_VETRA_VETRA_GRAPHQL_ENDPOINT", "https://switchboard.staging.vetra.io/graphql"),
|
|
7
|
+
renownProfileBasePath: getEnvVar("PH_VETRA_RENOWN_PROFILE_BASE_PATH", "phd://renown-staging.vetra.to"),
|
|
8
|
+
vetraPackageBasePath: getEnvVar("PH_VETRA_VETRA_PACKAGE_BASE_PATH", "phd://staging.vetra.to"),
|
|
9
|
+
vetraDriveBaseUrl: getEnvVar("PH_VETRA_DRIVE_BASE_URL", "https://switchboard.staging.vetra.io/d"),
|
|
28
10
|
};
|
|
@@ -23,11 +23,17 @@ export class VetraBuilderRelationalDbProcessor extends RelationalDbProcessor {
|
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
25
|
for (const operation of strand.operations) {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
try {
|
|
27
|
+
if (strand.documentType.includes("powerhouse/document-drive")) {
|
|
28
|
+
await this.handleDocumentDriveOperation(strand.documentId, strand.driveId, operation.action, operation.state);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
await this.builderTeamHandlers.handleBuilderTeamOperation(strand.documentId, operation.action, operation.state);
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.error(`VetraBuilderRelationalDbProcessor: Error processing operation ${JSON.stringify(operation.action)}:`, error);
|
|
36
|
+
break;
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
}
|