UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

189 lines (188 loc) 4.76 kB
import { normalizeNumericId as m } from "../../utils/functions/StringUtils.js"; import { EntityType as l } from "@sage-bionetworks/synapse-client"; import { RestrictionLevel as y, AnnotationsValueType as r } from "@sage-bionetworks/synapse-types"; import { MOCK_FILE_HANDLE_ID as a, mockFileHandle as f, mockPreviewFileHandle as u } from "../mock_file_handle.js"; import { MOCK_USER_ID_2 as s, MOCK_USER_ID as t } from "../user/mock_user_profile.js"; import d from "./mockProject.js"; const o = d.id, p = d.name, i = "syn30000", n = "My mock file entity", g = "45745485", e = { id: i, parentId: o, dataFileHandleId: a, name: n, concreteType: "org.sagebionetworks.repo.model.FileEntity", createdBy: t.toString(), modifiedBy: s.toString(), etag: "00000000-0000-0000-0000-000000000000", versionNumber: 3, versionLabel: "a label for version 3", isLatestVersion: !0, createdOn: "2021-03-02T15:05:34.973Z", modifiedOn: "2021-03-05T11:31:24.521Z" }, b = [ { id: i, modifiedBy: t.toString(), versionNumber: 1, versionLabel: "a label for version 1", versionComment: "a comment", contentSize: "100", contentMd5: "d836adae5632872014783b05cd2f76d7", modifiedByPrincipalId: t.toString(), modifiedOn: "2021-03-02T15:05:34.973Z", isLatestVersion: !1 }, { id: i, modifiedBy: t.toString(), versionNumber: 3, versionLabel: "a label for version 3", versionComment: "a comment about version 3", contentSize: "100", contentMd5: "bc91a4a16ccb21944fcee55275dc4574", modifiedByPrincipalId: t.toString(), modifiedOn: "2021-03-05T11:31:24.521Z", isLatestVersion: !0 } ], v = { 3: { id: i, parentId: o, dataFileHandleId: a, name: n, concreteType: "org.sagebionetworks.repo.model.FileEntity", createdBy: t.toString(), modifiedBy: t.toString(), etag: "00000000-0000-0000-0000-000000000000", versionNumber: 3, versionLabel: "a label for version 3", isLatestVersion: !0 }, 1: { id: i, parentId: o, dataFileHandleId: a, name: n, concreteType: "org.sagebionetworks.repo.model.FileEntity", createdBy: t.toString(), modifiedBy: t.toString(), etag: "00000000-0000-0000-0000-000000000000", versionNumber: 1, versionLabel: "a label for version 1", isLatestVersion: !1 } }, c = { path: [ { name: "root", id: "syn4489", type: "org.sagebionetworks.repo.model.Folder" }, { name: p, id: o, type: "org.sagebionetworks.repo.model.Project" }, { name: n, id: i, type: "org.sagebionetworks.repo.model.FileEntity" } ] }, I = { entity: e, entityType: l.file, fileHandles: [f, u], annotations: { id: i, etag: "00000000-0000-0000-0000-000000000000", annotations: { myStringKey: { type: r.STRING, value: ["myValue"] }, myIntegerKey: { type: r.LONG, value: [4325435345213, 4321] }, myFloatKey: { type: r.LONG, value: [1.5, 17 / 13] } } }, rootWikiId: g, fileName: e.name, benefactorAcl: d.bundle.accessControlList, permissions: { canView: !0, canEdit: !0, canMove: !0, canAddChild: !0, canCertifiedUserEdit: !0, canCertifiedUserAddChild: !0, isCertifiedUser: !0, canChangePermissions: !0, canChangeSettings: !0, canDelete: !0, canDownload: !0, canUpload: !0, canEnableInheritance: !0, ownerPrincipalId: 3350396, canPublicRead: !0, canModerate: !0, isCertificationRequired: !0, isEntityOpenData: !1, isUserDataContributor: !0 }, threadCount: 5, path: c, restrictionInformation: { objectId: m(i), restrictionDetails: [], restrictionLevel: y.OPEN, hasUnmetAccessRequirement: !1 }, hasChildren: !1 }, E = { id: e.id, name: e.name, etag: e.etag, createdOn: e.createdOn, modifiedOn: e.modifiedOn, createdBy: e.createdBy, modifiedBy: e.modifiedBy, parentId: "syn4489", concreteType: "org.sagebionetworks.repo.model.FileEntity", myStringKey: "myValue", myIntegerKey: [4325435345213, 4321], myFloatKey: [1.5, 17 / 13] }, F = { id: e.id, name: e.name, type: e.concreteType, versionNumber: 3, versionLabel: "a label for version 3", benefactorId: 123, createdOn: e.createdOn, modifiedOn: e.modifiedOn, createdBy: t.toString(), // TODO: Replace with a valid mock user ID modifiedBy: s.toString(), isLatestVersion: !0 }, N = { id: i, name: n, entity: e, bundle: I, json: E, versions: v, versionInfo: b, entityHeader: F, path: c }; export { i as MOCK_FILE_ENTITY_ID, n as MOCK_FILE_NAME, N as default }; //# sourceMappingURL=mockFileEntity.js.map