@openneuro/app 4.26.1 → 4.27.0-alpha.1

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/vite.config.js CHANGED
@@ -20,7 +20,7 @@ export default defineConfig({
20
20
  "@apollo/client/link/ws",
21
21
  "@apollo/client/utilities",
22
22
  ],
23
- exclude: ["buffer", "stream-browserify"],
23
+ exclude: ["stream-browserify"],
24
24
  },
25
25
  resolve: {
26
26
  alias: [
@@ -33,6 +33,8 @@ export default defineConfig({
33
33
  { find: "stream", replacement: "stream-browserify" },
34
34
  // sax -> Buffer shim
35
35
  { find: "buffer", replacement: "buffer/" },
36
+ // bids-validator deno buffer
37
+ { find: "node:buffer", replacement: "buffer/" },
36
38
  // Workaround UMD -> ESM issues in pluralize
37
39
  {
38
40
  find: "pluralize",
@@ -1,21 +0,0 @@
1
- import { init as initApm } from "@elastic/apm-rum"
2
- import { config } from "./config"
3
- import { version } from "../lerna.json"
4
-
5
- export let apm
6
-
7
- export function setupApm() {
8
- if (
9
- config.sentry.environment === "production" ||
10
- config.sentry.environment === "staging"
11
- ) {
12
- apm = initApm({
13
- serverUrl: config.ELASTIC_APM_SERVER_URL,
14
- serviceName: "openneuro-app",
15
- serviceVersion: version,
16
- environment: config.sentry.environment,
17
- })
18
- }
19
- }
20
-
21
- setupApm()
@@ -1,25 +0,0 @@
1
- import { getKibanaURL } from "../kibana"
2
- import { vi } from "vitest"
3
-
4
- vi.mock("../../config.ts")
5
-
6
- describe("getKibanaURL", () => {
7
- it("returns a valid url when env var ELASTICSEARCH_CLOUD_ID exists", () => {
8
- const config = {
9
- elasticsearch: {
10
- cloudID:
11
- "openneuro-staging:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjYjQ2MWUyYzA5ZDU0MDVlODRmM2I0NDJiMDA0NmIzOSRhMjEzNmNkMGU2YjA0NTllOTVhMWU2MDRiNTViOTY0OA==",
12
- },
13
- }
14
- const url = getKibanaURL(config)
15
- expect(url).toEqual(
16
- "https://a2136cd0e6b0459e95a1e604b55b9648.us-east-1.aws.found.io:9243/app/discover#/",
17
- )
18
- })
19
-
20
- it("returns a localhost url when ELASTICSEARCH_CLOUD_ID does not exist", () => {
21
- const config = {}
22
- const url = getKibanaURL(config)
23
- expect(url).toEqual("http://localhost:5601/app/discover#/")
24
- })
25
- })
@@ -1,24 +0,0 @@
1
- import { config } from "../config"
2
-
3
- /**
4
- * Extract kibana deployment uri from ELASTICSEARCH_CLOUD_ID (prod/staging)
5
- * or use localhost url.
6
- * For localhost url to be available, the kibana service must be enabled (docker-compose).
7
- */
8
- export const getKibanaURL = (config) => {
9
- if (config?.elasticsearch?.cloudID) {
10
- const ELASTICSEARCH_CLOUD_ID = config.elasticsearch.cloudID
11
- const base64 = /:(.+?==)$/.exec(ELASTICSEARCH_CLOUD_ID)[1]
12
- const decoded = atob(base64)
13
- const [, hostname, deploymentId] = /^(.+?)\$.+?\$(.+?)$/.exec(decoded)
14
- return `https://${deploymentId}.${hostname}:9243/app/discover#/`
15
- } else {
16
- return "http://localhost:5601/app/discover#/"
17
- }
18
- }
19
- const url = getKibanaURL(config)
20
- // query params for index "logs-reexporter" with selected fields "dataset_id" and "text"
21
- const reexportLogQueryParams =
22
- "_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(dataset_id,tag,s3_export_successful,github_export_successful,error),filters:!(),index:'548067b0-607a-11eb-becc-a73e7e29924c',interval:auto,query:(language:kuery,query:''),sort:!())"
23
-
24
- export const reexporterLogsURL = `${url}?${reexportLogQueryParams}`