@openneuro/server 4.44.5 → 4.44.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/server",
3
- "version": "4.44.5",
3
+ "version": "4.44.6",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -21,7 +21,7 @@
21
21
  "@elastic/elasticsearch": "8.13.1",
22
22
  "@graphql-tools/schema": "^10.0.0",
23
23
  "@keyv/redis": "^4.5.0",
24
- "@openneuro/search": "^4.44.5",
24
+ "@openneuro/search": "^4.44.6",
25
25
  "@sentry/node": "^10.37.0",
26
26
  "@sentry/profiling-node": "^10.37.0",
27
27
  "base64url": "^3.0.0",
@@ -89,5 +89,5 @@
89
89
  "publishConfig": {
90
90
  "access": "public"
91
91
  },
92
- "gitHead": "337fffde4c5ea0c3f6f26f7f93d5357197036aa7"
92
+ "gitHead": "1c266a5a49f11d604ea83725661c7896df40eca1"
93
93
  }
@@ -14,7 +14,7 @@ import * as subscriptions from "../handlers/subscriptions"
14
14
  import { generateDataladCookie } from "../libs/authentication/jwt"
15
15
  import { redis } from "../libs/redis"
16
16
  import CacheItem, { CacheType } from "../cache/item"
17
- import { updateDatasetRevision } from "./draft"
17
+ import { getDraftRevision, updateDatasetRevision } from "./draft"
18
18
  import { encodeFilePath, filesUrl, fileUrl, getFileName } from "./files"
19
19
  import { getAccessionNumber } from "../libs/dataset"
20
20
  import Dataset from "../models/dataset"
@@ -80,28 +80,6 @@ export const createDataset = async (
80
80
  }
81
81
  }
82
82
 
83
- interface WorkerDraftFields {
84
- // Commit id hash
85
- ref: string
86
- // Commit tree ref
87
- tree: string
88
- // Commit message
89
- message: string
90
- // Commit author time
91
- modified: string
92
- }
93
-
94
- /**
95
- * Return the latest commit
96
- * @param {string} id Dataset accession number
97
- */
98
- export const getDraftHead = async (id): Promise<WorkerDraftFields> => {
99
- const draftRes = await request
100
- .get(`${getDatasetWorker(id)}/datasets/${id}/draft`)
101
- .set("Accept", "application/json")
102
- return draftRes.body
103
- }
104
-
105
83
  /**
106
84
  * Fetch dataset document and related fields
107
85
  */
@@ -109,7 +87,7 @@ export const getDataset = async (id) => {
109
87
  const dataset = await Dataset.findOne({ id }).lean()
110
88
  return {
111
89
  ...dataset,
112
- revision: (await getDraftHead(id)).ref,
90
+ revision: getDraftRevision(id),
113
91
  }
114
92
  }
115
93
 
@@ -24,6 +24,7 @@ import { derivatives } from "./derivatives"
24
24
  import { promiseTimeout } from "../../utils/promiseTimeout"
25
25
  import { datasetEvents } from "./datasetEvents"
26
26
  import semver from "semver"
27
+ import { getDraftInfo } from "../../datalad/draft"
27
28
 
28
29
  export const dataset = async (obj, { id }, { user, userInfo }) => {
29
30
  await checkDatasetRead(id, user, userInfo)
@@ -280,7 +281,7 @@ const worker = (obj) => getDatasetWorker(obj.id)
280
281
  const Dataset = {
281
282
  uploader: (ds, _, context) => user(ds, { id: ds.uploader }, context),
282
283
  draft: async (obj) => {
283
- const draftHead = await datalad.getDraftHead(obj.id)
284
+ const draftHead = await getDraftInfo(obj.id)
284
285
  return {
285
286
  id: obj.id,
286
287
  revision: draftHead.ref,
@@ -14,11 +14,11 @@ import DeprecatedSnapshot from "../../models/deprecatedSnapshot"
14
14
  import { redis } from "../../libs/redis"
15
15
  import CacheItem, { CacheType } from "../../cache/item"
16
16
  import { normalizeDOI } from "../../libs/doi/normalize"
17
- import { getDraftHead } from "../../datalad/dataset"
18
17
  import { downloadFiles } from "../../datalad/snapshots"
19
18
  import { snapshotValidation } from "./validation"
20
19
  import { advancedDatasetSearchConnection } from "./dataset-search"
21
20
  import { contributors } from "../../datalad/contributors"
21
+ import { getDraftInfo } from "../../datalad/draft"
22
22
 
23
23
  export const snapshots = (obj) => {
24
24
  return datalad.getSnapshots(obj.id)
@@ -279,7 +279,7 @@ export const latestSnapshot = async (obj, _, context) => {
279
279
  // In the case where there are no real snapshots, return most recent commit as snapshot
280
280
  return await snapshot(
281
281
  obj,
282
- { datasetId: obj.id, tag: (await getDraftHead(obj.id)).ref },
282
+ { datasetId: obj.id, tag: (await getDraftInfo(obj.id)).ref },
283
283
  context,
284
284
  )
285
285
  }
package/src/sentry.ts CHANGED
@@ -4,7 +4,8 @@ import config from "./config"
4
4
  import { version } from "./lerna.json"
5
5
 
6
6
  Sentry.init({
7
- dsn: config.sentry.DSN,
7
+ dsn:
8
+ "https://baebfdeb279ddb0c39c876feefd464c8@o4507748938350592.ingest.us.sentry.io/4507750879461376",
8
9
  environment: config.sentry.ENVIRONMENT,
9
10
  integrations: [
10
11
  nodeProfilingIntegration(),