Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into beta-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 5, 2024
2 parents 016abe5 + cc045b8 commit 5e3ae36
Show file tree
Hide file tree
Showing 53 changed files with 1,213 additions and 698 deletions.
678 changes: 339 additions & 339 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/atlas-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "0.18.1",
"version": "0.19.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -80,7 +80,7 @@
"@mongodb-js/devtools-connect": "^2.6.3",
"@mongodb-js/oidc-plugin": "^0.4.0",
"hadron-app-registry": "^9.1.11",
"compass-preferences-model": "^2.20.2",
"compass-preferences-model": "^2.21.0",
"electron": "^29.4.2",
"hadron-ipc": "^3.2.15",
"lodash": "^4.17.21",
Expand Down
5 changes: 3 additions & 2 deletions packages/atlas-service/src/atlas-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { createNoopLoggerAndTelemetry } from '@mongodb-js/compass-logging/provid
import { CompassAtlasAuthService } from './compass-atlas-auth-service';

const ATLAS_CONFIG = {
atlasApiBaseUrl: 'http://example.com/api/private',
atlasApiUnauthBaseUrl: 'http://api.example.com',
wsBaseUrl: 'ws://example.com',
cloudBaseUrl: 'ws://example.com/cloud',
atlasApiBaseUrl: 'http://example.com/api',
atlasLogin: {
clientId: 'some-client-id',
issuer: 'http://example.com/oauth2/default',
Expand Down
20 changes: 13 additions & 7 deletions packages/atlas-service/src/atlas-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@ export class AtlasService {
) {
this.config = getAtlasConfig(preferences);
}
privateUnAuthEndpoint(path: string): string {
return `${this.config.atlasApiUnauthBaseUrl}/${path}`;
adminApiEndpoint(path?: string, requestId?: string): string {
const uri = encodeURI(
`${this.config.atlasApiBaseUrl}${path ? `/${path}` : ''}`
);
const query = requestId
? `?request_id=${encodeURIComponent(requestId)}`
: '';
return `${uri}${query}`;
}
cloudEndpoint(path?: string): string {
return encodeURI(`${this.config.cloudBaseUrl}${path ? `/${path}` : ''}`);
}
privateAtlasEndpoint(path: string, requestId?: string): string {
return `${this.config.atlasApiBaseUrl}/${path}${
requestId ? `?request_id=${requestId}` : ''
}`;
driverProxyEndpoint(path?: string): string {
return encodeURI(`${this.config.wsBaseUrl}${path ? `/${path}` : ''}`);
}
async fetch(url: RequestInfo, init?: RequestInit): Promise<Response> {
throwIfNetworkTrafficDisabled(this.preferences);
Expand Down Expand Up @@ -75,7 +82,6 @@ export class AtlasService {
throw err;
}
}

async authenticatedFetch(
url: RequestInfo,
init?: RequestInit
Expand Down
5 changes: 3 additions & 2 deletions packages/atlas-service/src/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ describe('CompassAuthServiceMain', function () {
};

const defaultConfig = {
atlasApiBaseUrl: 'http://example.com',
atlasApiUnauthBaseUrl: 'http://example.com/unauth',
wsBaseUrl: 'ws://example.com',
cloudBaseUrl: 'ws://example.com/cloud',
atlasApiBaseUrl: 'http://example.com/api',
atlasLogin: {
issuer: 'http://example.com',
clientId: '1234abcd',
Expand Down
80 changes: 55 additions & 25 deletions packages/atlas-service/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,63 +78,95 @@ export async function throwIfNotOk(
}

export type AtlasServiceConfig = {
/**
* MongoDB Driver WebSocket proxy base url
*/
wsBaseUrl: string;
/**
* Cloud UI backend base url
*/
cloudBaseUrl: string;
/**
* Atlas admin API base url
*/
atlasApiBaseUrl: string;
atlasApiUnauthBaseUrl: string;
/**
* Atlas OIDC config
*/
atlasLogin: {
clientId: string;
issuer: string;
};
/**
* Atlas Account Portal UI base url
*/
authPortalUrl: string;
};

/**
* Atlas service backend configurations.
* - compass-dev: locally running compass kanopy backend (localhost)
* - compass: compass kanopy backend (compass.mongodb.com)
* - atlas-local: local mms backend (localhost)
* - atlas-dev: dev mms backend (cloud-dev.mongodb.com)
* - atlas: mms backend (cloud.mongodb.com)
* - atlas-local: local mms backend (localhost)
* - atlas-dev: dev mms backend (cloud-dev.mongodb.com)
* - atlas: mms backend (cloud.mongodb.com)
* - web-sandbox-atlas-local: local mms backend + proxy (localhost / proxy prefix)
* - web-sandbox-atlas-dev: dev mms backend + proxy (cloud-dev.mongodb.com / proxy prefix)
* - web-sandbox-atlas: mms backend + proxy (cloud.mongodb.com / proxy prefix)
*/
const config = {
'compass-dev': {
atlasApiBaseUrl: 'http://localhost:8080',
atlasApiUnauthBaseUrl: 'http://localhost:8080',
'atlas-local': {
wsBaseUrl: 'ws://localhost:61001/ws',
cloudBaseUrl: '',
atlasApiBaseUrl: 'http://localhost:8080/api/private',
atlasLogin: {
clientId: '0oajzdcznmE8GEyio297',
issuer: 'https://auth.mongodb.com/oauth2/default',
clientId: '0oaq1le5jlzxCuTbu357',
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
},
authPortalUrl: 'https://account.mongodb.com/account/login',
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
},
compass: {
atlasApiBaseUrl: 'https://compass.mongodb.com',
atlasApiUnauthBaseUrl: 'https://compass.mongodb.com',
'atlas-dev': {
wsBaseUrl: '',
cloudBaseUrl: '',
atlasApiBaseUrl: 'https://cloud-dev.mongodb.com/api/private',
atlasLogin: {
clientId: '0oaq1le5jlzxCuTbu357',
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
},
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
},
atlas: {
wsBaseUrl: '',
cloudBaseUrl: '',
atlasApiBaseUrl: 'https://cloud.mongodb.com/api/private',
atlasLogin: {
clientId: '0oajzdcznmE8GEyio297',
issuer: 'https://auth.mongodb.com/oauth2/default',
},
authPortalUrl: 'https://account.mongodb.com/account/login',
},
'atlas-local': {
'web-sandbox-atlas-local': {
wsBaseUrl: 'ws://localhost:1337',
cloudBaseUrl: '/cloud-mongodb-com',
atlasApiBaseUrl: 'http://localhost:8080/api/private',
atlasApiUnauthBaseUrl: 'http://localhost:8080/api/private/unauth',
atlasLogin: {
clientId: '0oaq1le5jlzxCuTbu357',
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
},
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
},
'atlas-dev': {
'web-sandbox-atlas-dev': {
wsBaseUrl: 'ws://localhost:1337',
cloudBaseUrl: '/cloud-mongodb-com',
atlasApiBaseUrl: 'https://cloud-dev.mongodb.com/api/private',
atlasApiUnauthBaseUrl: 'https://cloud-dev.mongodb.com/api/private/unauth',
atlasLogin: {
clientId: '0oaq1le5jlzxCuTbu357',
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
},
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
},
atlas: {
'web-sandbox-atlas': {
wsBaseUrl: 'ws://localhost:1337',
cloudBaseUrl: '/cloud-mongodb-com',
atlasApiBaseUrl: 'https://cloud.mongodb.com/api/private',
atlasApiUnauthBaseUrl: 'https://cloud.mongodb.com/api/private/unauth',
atlasLogin: {
clientId: '0oajzdcznmE8GEyio297',
issuer: 'https://auth.mongodb.com/oauth2/default',
Expand All @@ -148,9 +180,7 @@ export function getAtlasConfig(
) {
const { atlasServiceBackendPreset } = preferences.getPreferences();
const envConfig = {
atlasApiBaseUrl: process.env.COMPASS_ATLAS_SERVICE_BASE_URL_OVERRIDE,
atlasApiUnauthBaseUrl:
process.env.COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE,
atlasApiBaseUrl: process.env.COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE,
atlasLogin: {
clientId: process.env.COMPASS_CLIENT_ID_OVERRIDE,
issuer: process.env.COMPASS_OIDC_ISSUER_OVERRIDE,
Expand All @@ -160,7 +190,7 @@ export function getAtlasConfig(
return defaultsDeep(
envConfig,
config[atlasServiceBackendPreset]
) as typeof envConfig & typeof config[keyof typeof config];
) as AtlasServiceConfig;
}

export function getTrackingUserInfo(userInfo: AtlasUserInfo) {
Expand Down
20 changes: 10 additions & 10 deletions packages/compass-aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@mongodb-js/compass-aggregations",
"description": "Compass Aggregation Pipeline Builder",
"private": true,
"version": "9.30.0",
"version": "9.31.0",
"main": "dist/index.js",
"compass:main": "src/index.ts",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -61,23 +61,23 @@
"@dnd-kit/core": "^6.0.7",
"@dnd-kit/sortable": "^7.0.2",
"@dnd-kit/utilities": "^3.2.1",
"@mongodb-js/atlas-service": "^0.18.1",
"@mongodb-js/compass-app-stores": "^7.14.0",
"@mongodb-js/compass-collection": "^4.27.0",
"@mongodb-js/atlas-service": "^0.19.0",
"@mongodb-js/compass-app-stores": "^7.15.0",
"@mongodb-js/compass-collection": "^4.28.0",
"@mongodb-js/compass-components": "^1.25.1",
"@mongodb-js/compass-connections": "^1.29.0",
"@mongodb-js/compass-crud": "^13.28.0",
"@mongodb-js/compass-connections": "^1.30.0",
"@mongodb-js/compass-crud": "^13.29.0",
"@mongodb-js/compass-editor": "^0.24.1",
"@mongodb-js/compass-field-store": "^9.4.0",
"@mongodb-js/compass-generative-ai": "^0.11.1",
"@mongodb-js/compass-field-store": "^9.5.0",
"@mongodb-js/compass-generative-ai": "^0.12.0",
"@mongodb-js/compass-logging": "^1.2.18",
"@mongodb-js/compass-utils": "^0.6.4",
"@mongodb-js/compass-workspaces": "^0.9.0",
"@mongodb-js/compass-workspaces": "^0.10.0",
"@mongodb-js/explain-plan-helper": "^1.1.12",
"@mongodb-js/mongodb-constants": "^0.10.0",
"@mongodb-js/my-queries-storage": "^0.8.1",
"bson": "^6.7.0",
"compass-preferences-model": "^2.20.2",
"compass-preferences-model": "^2.21.0",
"ejson-shell-parser": "^2.0.1",
"hadron-app-registry": "^9.1.11",
"hadron-document": "^8.5.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/compass-app-stores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "7.14.0",
"version": "7.15.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -75,7 +75,7 @@
},
"dependencies": {
"@mongodb-js/compass-components": "^1.25.1",
"@mongodb-js/compass-connections": "^1.29.0",
"@mongodb-js/compass-connections": "^1.30.0",
"@mongodb-js/compass-logging": "^1.2.18",
"@mongodb-js/connection-info": "^0.3.0",
"hadron-app-registry": "^9.1.11",
Expand Down
10 changes: 5 additions & 5 deletions packages/compass-collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "4.27.0",
"version": "4.28.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -48,13 +48,13 @@
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
},
"dependencies": {
"@mongodb-js/compass-app-stores": "^7.14.0",
"@mongodb-js/compass-app-stores": "^7.15.0",
"@mongodb-js/compass-components": "^1.25.1",
"@mongodb-js/compass-connections": "^1.29.0",
"@mongodb-js/compass-connections": "^1.30.0",
"@mongodb-js/connection-info": "^0.3.0",
"@mongodb-js/compass-logging": "^1.2.18",
"@mongodb-js/compass-workspaces": "^0.9.0",
"compass-preferences-model": "^2.20.2",
"@mongodb-js/compass-workspaces": "^0.10.0",
"compass-preferences-model": "^2.21.0",
"hadron-app-registry": "^9.1.11",
"mongodb-collection-model": "^5.20.0",
"mongodb-ns": "^2.4.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/compass-connection-import-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "0.25.0",
"version": "0.26.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -52,9 +52,9 @@
},
"dependencies": {
"@mongodb-js/compass-components": "^1.25.1",
"@mongodb-js/compass-connections": "^1.29.0",
"@mongodb-js/connection-storage": "^0.11.0",
"compass-preferences-model": "^2.20.2",
"@mongodb-js/compass-connections": "^1.30.0",
"@mongodb-js/connection-storage": "^0.12.0",
"compass-preferences-model": "^2.21.0",
"hadron-ipc": "^3.2.15",
"react": "^17.0.2"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/compass-connections-navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "1.27.0",
"version": "1.28.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -49,9 +49,9 @@
"dependencies": {
"@mongodb-js/compass-components": "^1.25.1",
"@mongodb-js/connection-info": "^0.3.0",
"@mongodb-js/connection-form": "^1.27.0",
"@mongodb-js/compass-workspaces": "^0.9.0",
"compass-preferences-model": "^2.20.2",
"@mongodb-js/connection-form": "^1.28.0",
"@mongodb-js/compass-workspaces": "^0.10.0",
"compass-preferences-model": "^2.21.0",
"react": "^17.0.2",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.6"
Expand Down
10 changes: 5 additions & 5 deletions packages/compass-connections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "1.29.0",
"version": "1.30.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down Expand Up @@ -54,11 +54,11 @@
"@mongodb-js/compass-components": "^1.25.1",
"bson": "^6.7.0",
"@mongodb-js/compass-logging": "^1.2.18",
"@mongodb-js/compass-maybe-protect-connection-string": "^0.18.2",
"@mongodb-js/connection-form": "^1.27.0",
"@mongodb-js/compass-maybe-protect-connection-string": "^0.19.0",
"@mongodb-js/connection-form": "^1.28.0",
"@mongodb-js/connection-info": "^0.3.0",
"@mongodb-js/connection-storage": "^0.11.0",
"compass-preferences-model": "^2.20.2",
"@mongodb-js/connection-storage": "^0.12.0",
"compass-preferences-model": "^2.21.0",
"hadron-app-registry": "^9.1.11",
"lodash": "^4.17.21",
"mongodb-build-info": "^1.7.2",
Expand Down
Loading

0 comments on commit 5e3ae36

Please sign in to comment.