diff --git a/.husky/pre-commit b/.husky/pre-commit index 1db632d3d..953902f5c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') [ -z "$FILES" ] && exit 0 diff --git a/apps/api/package.json b/apps/api/package.json index e9f2216a7..f0d3009d2 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -16,8 +16,8 @@ "dependencies": { "@casl/ability": "^6.7.0", "@casl/prisma": "^1.4.1", + "@douglasneuroinformatics/libjs": "^0.0.1", "@douglasneuroinformatics/nestjs": "^3.0.0", - "@douglasneuroinformatics/utils": "^1.2.2", "@faker-js/faker": "^8.4.1", "@nestjs/axios": "^3.0.2", "@nestjs/common": "^10.3.3", @@ -51,9 +51,9 @@ "zod": "^3.22.4" }, "devDependencies": { + "@douglasneuroinformatics/esbuild-plugin-native-modules": "^0.0.1", + "@douglasneuroinformatics/esbuild-plugin-prisma": "^0.0.1", "@nestjs/testing": "^10.3.3", - "@open-data-capture/esbuild-plugin-native-modules": "workspace:*", - "@open-data-capture/esbuild-plugin-prisma": "workspace:*", "@open-data-capture/esbuild-plugin-runtime": "workspace:*", "@types/express": "^4.17.21", "@types/lodash": "^4.17.0", diff --git a/apps/api/scripts/build.js b/apps/api/scripts/build.js index a591f4f9d..98b61c309 100644 --- a/apps/api/scripts/build.js +++ b/apps/api/scripts/build.js @@ -3,8 +3,8 @@ import module from 'module'; import path from 'path'; import url from 'url'; -import { nativeModulesPlugin } from '@open-data-capture/esbuild-plugin-native-modules'; -import { prismaPlugin } from '@open-data-capture/esbuild-plugin-prisma'; +import { nativeModulesPlugin } from '@douglasneuroinformatics/esbuild-plugin-native-modules'; +import { prismaPlugin } from '@douglasneuroinformatics/esbuild-plugin-prisma'; import { runtimePlugin } from '@open-data-capture/esbuild-plugin-runtime'; import esbuild from 'esbuild'; import esbuildPluginTsc from 'esbuild-plugin-tsc'; diff --git a/apps/api/src/demo/demo.service.ts b/apps/api/src/demo/demo.service.ts index 6145ce7b3..dc5a849dc 100644 --- a/apps/api/src/demo/demo.service.ts +++ b/apps/api/src/demo/demo.service.ts @@ -1,5 +1,5 @@ import type { FormDataType } from '@douglasneuroinformatics/form-types'; -import { randomValue } from '@douglasneuroinformatics/utils'; +import { randomValue } from '@douglasneuroinformatics/libjs'; import { faker } from '@faker-js/faker'; import { Injectable, Logger, NotImplementedException } from '@nestjs/common'; import { type Json, toUpperCase } from '@open-data-capture/common/core'; diff --git a/apps/api/src/groups/groups.controller.ts b/apps/api/src/groups/groups.controller.ts index eb8932efe..d655e9749 100644 --- a/apps/api/src/groups/groups.controller.ts +++ b/apps/api/src/groups/groups.controller.ts @@ -1,7 +1,6 @@ -import { CurrentUser, type EntityController } from '@douglasneuroinformatics/nestjs/core'; +import { CurrentUser } from '@douglasneuroinformatics/nestjs/core'; import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'; import { ApiOperation, ApiTags } from '@nestjs/swagger'; -import type { Group } from '@open-data-capture/common/group'; import { RouteAccess } from '@/core/decorators/route-access.decorator'; import type { AppAbility } from '@/core/types'; @@ -12,7 +11,7 @@ import { GroupsService } from './groups.service'; @ApiTags('Groups') @Controller('groups') -export class GroupsController implements EntityController { +export class GroupsController { constructor(private readonly groupsService: GroupsService) {} @ApiOperation({ summary: 'Create Group' }) diff --git a/apps/api/src/groups/groups.service.ts b/apps/api/src/groups/groups.service.ts index f2cfcc27d..6c5713ec7 100644 --- a/apps/api/src/groups/groups.service.ts +++ b/apps/api/src/groups/groups.service.ts @@ -1,6 +1,4 @@ -import { EntityService } from '@douglasneuroinformatics/nestjs/core'; import { ConflictException, Injectable, NotFoundException } from '@nestjs/common'; -import type { Group } from '@open-data-capture/common/group'; import { accessibleQuery } from '@/ability/ability.utils'; import type { EntityOperationOptions } from '@/core/types'; @@ -11,7 +9,7 @@ import { CreateGroupDto } from './dto/create-group.dto'; import { UpdateGroupDto } from './dto/update-group.dto'; @Injectable() -export class GroupsService implements EntityService { +export class GroupsService { constructor(@InjectModel('Group') private readonly groupModel: Model<'Group'>) {} async create(group: CreateGroupDto) { diff --git a/apps/api/src/instrument-records/instrument-records.service.ts b/apps/api/src/instrument-records/instrument-records.service.ts index 1a54cb08e..140edbc9e 100644 --- a/apps/api/src/instrument-records/instrument-records.service.ts +++ b/apps/api/src/instrument-records/instrument-records.service.ts @@ -1,4 +1,4 @@ -import { yearsPassed } from '@douglasneuroinformatics/utils'; +import { yearsPassed } from '@douglasneuroinformatics/libjs'; import { Injectable } from '@nestjs/common'; import type { AnyInstrument, InstrumentMeasureValue } from '@open-data-capture/common/instrument'; import type { diff --git a/apps/api/src/subjects/subjects.service.ts b/apps/api/src/subjects/subjects.service.ts index 9f242ec3d..7591892b4 100644 --- a/apps/api/src/subjects/subjects.service.ts +++ b/apps/api/src/subjects/subjects.service.ts @@ -1,7 +1,5 @@ -import type { EntityService } from '@douglasneuroinformatics/nestjs/core'; import { CryptoService } from '@douglasneuroinformatics/nestjs/modules'; import { ConflictException, Injectable, NotFoundException } from '@nestjs/common'; -import type { Subject } from '@open-data-capture/common/subject'; import type { Prisma } from '@open-data-capture/database/core'; import unidecode from 'unidecode'; @@ -13,7 +11,7 @@ import type { Model, ModelUpdateData } from '@/prisma/prisma.types'; import { SubjectIdentificationDataDto } from './dto/subject-identification-data.dto'; @Injectable() -export class SubjectsService implements EntityService> { +export class SubjectsService { constructor( @InjectModel('Subject') private readonly subjectModel: Model<'Subject'>, private readonly cryptoService: CryptoService diff --git a/apps/api/src/users/users.service.ts b/apps/api/src/users/users.service.ts index e479f2431..d5af71317 100644 --- a/apps/api/src/users/users.service.ts +++ b/apps/api/src/users/users.service.ts @@ -1,7 +1,5 @@ -import type { EntityService } from '@douglasneuroinformatics/nestjs/core'; import { CryptoService } from '@douglasneuroinformatics/nestjs/modules'; import { ConflictException, Injectable, NotFoundException } from '@nestjs/common'; -import { type User } from '@open-data-capture/common/user'; import { accessibleQuery } from '@/ability/ability.utils'; import type { EntityOperationOptions } from '@/core/types'; @@ -14,7 +12,7 @@ import { CreateUserDto } from './dto/create-user.dto'; import type { UpdateUserDto } from './dto/update-user.dto'; @Injectable() -export class UsersService implements EntityService { +export class UsersService { constructor( @InjectModel('User') private readonly userModel: Model<'User'>, private readonly cryptoService: CryptoService, diff --git a/apps/api/src/visits/visits.controller.ts b/apps/api/src/visits/visits.controller.ts index 6e6c841fc..81e845f66 100644 --- a/apps/api/src/visits/visits.controller.ts +++ b/apps/api/src/visits/visits.controller.ts @@ -1,4 +1,3 @@ -import type { EntityController } from '@douglasneuroinformatics/nestjs/core'; import { Body, Controller, Post } from '@nestjs/common'; import { ApiOperation } from '@nestjs/swagger'; import type { Visit } from '@open-data-capture/common/visit'; @@ -9,7 +8,7 @@ import { CreateVisitDto } from './dto/create-visit.dto'; import { VisitsService } from './visits.service'; @Controller('visits') -export class VisitsController implements Pick, 'create'> { +export class VisitsController { constructor(private readonly visitsService: VisitsService) {} @ApiOperation({ description: 'Create Visit' }) diff --git a/apps/gateway/package.json b/apps/gateway/package.json index f4ebdf5f0..08380555a 100644 --- a/apps/gateway/package.json +++ b/apps/gateway/package.json @@ -41,8 +41,8 @@ "zod": "^3.22.4" }, "devDependencies": { - "@open-data-capture/esbuild-plugin-native-modules": "workspace:*", - "@open-data-capture/esbuild-plugin-prisma": "workspace:*", + "@douglasneuroinformatics/esbuild-plugin-native-modules": "^0.0.1", + "@douglasneuroinformatics/esbuild-plugin-prisma": "^0.0.1", "@open-data-capture/tailwindcss": "workspace:*", "@open-data-capture/vite-plugin-runtime": "workspace:*", "@types/compression": "^1.7.5", @@ -52,6 +52,7 @@ "@types/react-dom": "^18.2.21", "@vitejs/plugin-react-swc": "^3.6.0", "autoprefixer": "^10.4.18", + "esbuild": "^0.20.1", "postcss": "^8.4.35", "tailwindcss": "^3.4.1", "vite": "^5.1.6" diff --git a/apps/gateway/scripts/build.js b/apps/gateway/scripts/build.js index 5b3e76e16..439552e2b 100644 --- a/apps/gateway/scripts/build.js +++ b/apps/gateway/scripts/build.js @@ -5,8 +5,8 @@ import fs from 'fs/promises'; import path from 'path'; import url from 'url'; -import { nativeModulesPlugin } from '@open-data-capture/esbuild-plugin-native-modules'; -import { prismaPlugin } from '@open-data-capture/esbuild-plugin-prisma'; +import { nativeModulesPlugin } from '@douglasneuroinformatics/esbuild-plugin-native-modules'; +import { prismaPlugin } from '@douglasneuroinformatics/esbuild-plugin-prisma'; import esbuild from 'esbuild'; const __filename = url.fileURLToPath(import.meta.url); diff --git a/apps/playground/package.json b/apps/playground/package.json index ed342284f..f150ca056 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -16,8 +16,8 @@ "test:dev": "env-cmd -f ../../.env --use-shell 'start-server-and-test \"pnpm exec vite --mode test\" \"http://localhost:${PLAYGROUND_DEV_SERVER_PORT}\" cy:open'" }, "dependencies": { + "@douglasneuroinformatics/libjs": "^0.0.1", "@douglasneuroinformatics/ui": "^6.2.2", - "@douglasneuroinformatics/utils": "^1.2.2", "@headlessui/react": "^1.7.18", "@heroicons/react": "^2.1.1", "@open-data-capture/common": "workspace:*", diff --git a/apps/web/package.json b/apps/web/package.json index c757657da..0bee29d69 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -20,6 +20,7 @@ }, "dependencies": { "@casl/ability": "^6.7.0", + "@douglasneuroinformatics/libjs": "^0.0.1", "@douglasneuroinformatics/ui": "^6.2.2", "@douglasneuroinformatics/utils": "^1.2.2", "@headlessui/react": "^1.7.18", diff --git a/apps/web/src/components/Layout/Sidebar.tsx b/apps/web/src/components/Layout/Sidebar.tsx index daadcce54..28b4bb5c3 100644 --- a/apps/web/src/components/Layout/Sidebar.tsx +++ b/apps/web/src/components/Layout/Sidebar.tsx @@ -1,5 +1,5 @@ +import { toBasicISOString } from '@douglasneuroinformatics/libjs'; import { ThemeToggle } from '@douglasneuroinformatics/ui/legacy'; -import { toBasicISOString } from '@douglasneuroinformatics/utils'; import { toLowerCase } from '@open-data-capture/common/core'; import { Branding } from '@open-data-capture/react-core'; import { AnimatePresence, motion } from 'framer-motion'; diff --git a/apps/web/src/config.ts b/apps/web/src/config.ts index 843a4830c..c78099911 100644 --- a/apps/web/src/config.ts +++ b/apps/web/src/config.ts @@ -1,4 +1,4 @@ -import { deepFreeze } from '@douglasneuroinformatics/utils'; +import { deepFreeze } from '@douglasneuroinformatics/libjs'; import { $BooleanString } from '@open-data-capture/common/core'; import { z } from 'zod'; diff --git a/apps/web/src/features/auth/components/DemoModal.tsx b/apps/web/src/features/auth/components/DemoModal.tsx index cab63b34c..43e1c9356 100644 --- a/apps/web/src/features/auth/components/DemoModal.tsx +++ b/apps/web/src/features/auth/components/DemoModal.tsx @@ -1,5 +1,5 @@ +import { snakeToCamelCase } from '@douglasneuroinformatics/libjs'; import { Card, Modal } from '@douglasneuroinformatics/ui/legacy'; -import { snakeToCamelCase } from '@douglasneuroinformatics/utils'; import type { LoginCredentials } from '@open-data-capture/common/auth'; import { DEMO_USERS } from '@open-data-capture/demo'; import { useTranslation } from 'react-i18next'; diff --git a/apps/web/src/features/subjects/components/AssignmentsTable.tsx b/apps/web/src/features/subjects/components/AssignmentsTable.tsx index 375eeb493..51979bee1 100644 --- a/apps/web/src/features/subjects/components/AssignmentsTable.tsx +++ b/apps/web/src/features/subjects/components/AssignmentsTable.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; +import { toBasicISOString } from '@douglasneuroinformatics/libjs'; import { ClientTable } from '@douglasneuroinformatics/ui/legacy'; -import { toBasicISOString } from '@douglasneuroinformatics/utils'; import type { Assignment, AssignmentStatus } from '@open-data-capture/common/assignment'; import type { UnilingualInstrumentSummary } from '@open-data-capture/common/instrument'; import { useTranslation } from 'react-i18next'; diff --git a/apps/web/src/features/subjects/components/SubjectsTable.tsx b/apps/web/src/features/subjects/components/SubjectsTable.tsx index 0758c654c..1d7950fa7 100644 --- a/apps/web/src/features/subjects/components/SubjectsTable.tsx +++ b/apps/web/src/features/subjects/components/SubjectsTable.tsx @@ -1,8 +1,8 @@ import { useState } from 'react'; +import { toBasicISOString } from '@douglasneuroinformatics/libjs'; import { useDownload } from '@douglasneuroinformatics/ui/hooks'; import { ClientTable, Dropdown, SearchBar } from '@douglasneuroinformatics/ui/legacy'; -import { toBasicISOString } from '@douglasneuroinformatics/utils'; import type { InstrumentRecordsExport } from '@open-data-capture/common/instrument-records'; import type { Subject } from '@open-data-capture/common/subject'; import axios from 'axios'; diff --git a/apps/web/src/features/subjects/components/TabLink.tsx b/apps/web/src/features/subjects/components/TabLink.tsx index 3d09429f5..a8e5e849a 100644 --- a/apps/web/src/features/subjects/components/TabLink.tsx +++ b/apps/web/src/features/subjects/components/TabLink.tsx @@ -1,7 +1,7 @@ import { clsx } from 'clsx'; import { NavLink } from 'react-router-dom'; -export const TabLink = ({ dataCy, label, pathname }: { dataCy?: string; label: string; pathname: string}) => ( +export const TabLink = ({ dataCy, label, pathname }: { dataCy?: string; label: string; pathname: string }) => ( @@ -10,7 +10,7 @@ export const TabLink = ({ dataCy, label, pathname }: { dataCy?: string; label: s isActive ? 'border-sky-500 text-slate-900 dark:text-slate-100' : 'border-slate-300' ) } - data-cy = {dataCy} + data-cy={dataCy} to={pathname} > {label} diff --git a/apps/web/src/features/subjects/components/VisualizationHeader.tsx b/apps/web/src/features/subjects/components/VisualizationHeader.tsx index 33161b653..d0224d2c1 100644 --- a/apps/web/src/features/subjects/components/VisualizationHeader.tsx +++ b/apps/web/src/features/subjects/components/VisualizationHeader.tsx @@ -1,4 +1,4 @@ -import { toBasicISOString } from '@douglasneuroinformatics/utils'; +import { toBasicISOString } from '@douglasneuroinformatics/libjs'; import { useTranslation } from 'react-i18next'; export type VisualizationHeaderProps = { diff --git a/apps/web/src/features/subjects/pages/SubjectTablePage.tsx b/apps/web/src/features/subjects/pages/SubjectTablePage.tsx index bdc52bb10..f5a17e25c 100644 --- a/apps/web/src/features/subjects/pages/SubjectTablePage.tsx +++ b/apps/web/src/features/subjects/pages/SubjectTablePage.tsx @@ -1,5 +1,5 @@ +import { camelToSnakeCase, toBasicISOString } from '@douglasneuroinformatics/libjs'; import { ClientTable, Dropdown } from '@douglasneuroinformatics/ui/legacy'; -import { camelToSnakeCase, toBasicISOString } from '@douglasneuroinformatics/utils'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; @@ -42,19 +42,18 @@ export const SubjectTablePage = () => {
- +
- +
- +
-
diff --git a/apps/web/src/test/server/handlers/form.handlers.ts b/apps/web/src/test/server/handlers/form.handlers.ts index 251a0a5b4..241f1dafd 100644 --- a/apps/web/src/test/server/handlers/form.handlers.ts +++ b/apps/web/src/test/server/handlers/form.handlers.ts @@ -218,6 +218,10 @@ export const formHandlers = [ //handler for cognitive assessment http.get('/v1/instruments/65dd26ad933b24c8b9023ca7', () => { return HttpResponse.json({ + __model__: 'Instrument', + bundle: + '(async()=>{const{InstrumentFactory:t}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new t({kind:"FORM",language:["en","fr"],validationSchema:e.object({abstraction:e.number().int().gte(0).lte(2),attention:e.number().int().gte(0).lte(6),delayedRecall:e.number().int().gte(0).lte(5),language:e.number().int().gte(0).lte(3),lowEdu:e.boolean(),naming:e.number().int().gte(0).lte(3),orientation:e.number().int().gte(0).lte(6),visuospatialExecutive:e.number().int().gte(0).lte(5)})}).defineInstrument({name:"MontrealCognitiveAssessment",tags:{en:["Cognitive"],fr:["Cognitif"]},version:8.1,content:{abstraction:{kind:"numeric",label:{en:"Abstraction",fr:"Abstraction"},max:2,min:0,variant:"default"},attention:{kind:"numeric",label:{en:"Attention",fr:"Attention"},max:6,min:0,variant:"default"},delayedRecall:{kind:"numeric",label:{en:"Delayed Recall",fr:"Rappel"},max:5,min:0,variant:"default"},language:{kind:"numeric",label:{en:"Language",fr:"Langue"},max:3,min:0,variant:"default"},lowEdu:{kind:"binary",label:{en:"Less Than 12 Years of Education",fr:"Moins de 12 ans d\'\\xE9tudes"},options:{en:{f:"No",t:"Yes"},fr:{f:"No",t:"Oui"}},variant:"radio"},naming:{kind:"numeric",label:{en:"Naming",fr:"D\\xE9nomination"},max:3,min:0,variant:"default"},orientation:{kind:"numeric",label:{en:"Orientation",fr:"Orientation"},max:6,min:0,variant:"default"},visuospatialExecutive:{kind:"numeric",label:{en:"Visuospatial/Executive",fr:"Visuospatial/Ex\\xE9cutif"},max:5,min:0,variant:"default"}},details:{description:{en:"The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.",fr:"Le Montreal Cognitive Assessment (MoCA) a \\xE9t\\xE9 con\\xE7ue comme un instrument de d\\xE9pistage rapide des troubles cognitifs l\\xE9gers. Il \\xE9value diff\\xE9rents domaines cognitifs : l\'attention et la concentration, les fonctions ex\\xE9cutives, la m\\xE9moire, le langage, les capacit\\xE9s visuoconstructives, la pens\\xE9e conceptuelle, les calculs et l\'orientation. Le MoCA peut \\xEAtre administr\\xE9 par toute personne qui comprend et suit les instructions, mais seul un professionnel de la sant\\xE9 sp\\xE9cialis\\xE9 dans le domaine cognitif peut interpr\\xE9ter les r\\xE9sultats. L\'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est consid\\xE9r\\xE9 comme normal."},estimatedDuration:10,instructions:{en:["All instructions may be repeated once."],fr:["Toutes les instructions peuvent \\xEAtre r\\xE9p\\xE9t\\xE9es une fois."]},license:"UNLICENSED",title:{en:"Montreal Cognitive Assessment",fr:"Montreal Cognitive Assessment"}},measures:{abstraction:{kind:"const",ref:"abstraction"},attention:{kind:"const",ref:"attention"},delayedRecall:{kind:"const",ref:"delayedRecall"},language:{kind:"const",ref:"language"},naming:{kind:"const",ref:"naming"},orientation:{kind:"const",ref:"orientation"},totalScore:{kind:"computed",label:{en:"Total Score",fr:"Score total"},value:i=>{let n=0;return Object.values(i).forEach(a=>{n+=Number(a)}),n}},visuospatialExecutive:{kind:"const",ref:"visuospatialExecutive"}}})})();\n', + createdAt: '2024-02-27T00:02:41.459Z', details: { authors: [], description: { @@ -237,31 +241,27 @@ export const formHandlers = [ fr: 'Montreal Cognitive Assessment' } }, - createdAt: '2024-02-27T00:02:41.459Z', - updatedAt: '2024-02-27T00:02:41.459Z', id: '65dd26ad933b24c8b9023ca7', - source: - "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n abstraction: z.number().int().gte(0).lte(2),\n attention: z.number().int().gte(0).lte(6),\n delayedRecall: z.number().int().gte(0).lte(5),\n language: z.number().int().gte(0).lte(3),\n lowEdu: z.boolean(),\n naming: z.number().int().gte(0).lte(3),\n orientation: z.number().int().gte(0).lte(6),\n visuospatialExecutive: z.number().int().gte(0).lte(5)\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'MontrealCognitiveAssessment',\n tags: {\n en: ['Cognitive'],\n fr: ['Cognitif']\n },\n version: 8.1,\n content: {\n abstraction: {\n kind: 'numeric',\n label: {\n en: 'Abstraction',\n fr: 'Abstraction'\n },\n max: 2,\n min: 0,\n variant: 'default'\n },\n attention: {\n kind: 'numeric',\n label: {\n en: 'Attention',\n fr: 'Attention'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n delayedRecall: {\n kind: 'numeric',\n label: {\n en: 'Delayed Recall',\n fr: 'Rappel'\n },\n max: 5,\n min: 0,\n variant: 'default'\n },\n language: {\n kind: 'numeric',\n label: {\n en: 'Language',\n fr: 'Langue'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n lowEdu: {\n kind: 'binary',\n label: {\n en: 'Less Than 12 Years of Education',\n fr: \"Moins de 12 ans d'études\"\n },\n options: {\n en: {\n f: 'No',\n t: 'Yes'\n },\n fr: {\n f: 'No',\n t: 'Oui'\n }\n },\n variant: 'radio'\n },\n naming: {\n kind: 'numeric',\n label: {\n en: 'Naming',\n fr: 'Dénomination'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n orientation: {\n kind: 'numeric',\n label: {\n en: 'Orientation',\n fr: 'Orientation'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n visuospatialExecutive: {\n kind: 'numeric',\n label: {\n en: 'Visuospatial/Executive',\n fr: 'Visuospatial/Exécutif'\n },\n max: 5,\n min: 0,\n variant: 'default'\n }\n },\n details: {\n description: {\n en: 'The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.',\n fr: \"Le Montreal Cognitive Assessment (MoCA) a été conçue comme un instrument de dépistage rapide des troubles cognitifs légers. Il évalue différents domaines cognitifs : l'attention et la concentration, les fonctions exécutives, la mémoire, le langage, les capacités visuoconstructives, la pensée conceptuelle, les calculs et l'orientation. Le MoCA peut être administré par toute personne qui comprend et suit les instructions, mais seul un professionnel de la santé spécialisé dans le domaine cognitif peut interpréter les résultats. L'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est considéré comme normal.\"\n },\n estimatedDuration: 10,\n instructions: {\n en: ['All instructions may be repeated once.'],\n fr: ['Toutes les instructions peuvent être répétées une fois.']\n },\n license: 'UNLICENSED',\n title: {\n en: 'Montreal Cognitive Assessment',\n fr: 'Montreal Cognitive Assessment'\n }\n },\n measures: {\n abstraction: {\n kind: 'const',\n ref: 'abstraction'\n },\n attention: {\n kind: 'const',\n ref: 'attention'\n },\n delayedRecall: {\n kind: 'const',\n ref: 'delayedRecall'\n },\n language: {\n kind: 'const',\n ref: 'language'\n },\n naming: {\n kind: 'const',\n ref: 'naming'\n },\n orientation: {\n kind: 'const',\n ref: 'orientation'\n },\n totalScore: {\n kind: 'computed',\n label: {\n en: 'Total Score',\n fr: 'Score total'\n },\n value: (data) => {\n let sum = 0;\n Object.values(data).forEach((value) => {\n sum += Number(value);\n });\n return sum;\n }\n },\n visuospatialExecutive: {\n kind: 'const',\n ref: 'visuospatialExecutive'\n }\n }\n});\n", - bundle: - '(async()=>{const{InstrumentFactory:t}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new t({kind:"FORM",language:["en","fr"],validationSchema:e.object({abstraction:e.number().int().gte(0).lte(2),attention:e.number().int().gte(0).lte(6),delayedRecall:e.number().int().gte(0).lte(5),language:e.number().int().gte(0).lte(3),lowEdu:e.boolean(),naming:e.number().int().gte(0).lte(3),orientation:e.number().int().gte(0).lte(6),visuospatialExecutive:e.number().int().gte(0).lte(5)})}).defineInstrument({name:"MontrealCognitiveAssessment",tags:{en:["Cognitive"],fr:["Cognitif"]},version:8.1,content:{abstraction:{kind:"numeric",label:{en:"Abstraction",fr:"Abstraction"},max:2,min:0,variant:"default"},attention:{kind:"numeric",label:{en:"Attention",fr:"Attention"},max:6,min:0,variant:"default"},delayedRecall:{kind:"numeric",label:{en:"Delayed Recall",fr:"Rappel"},max:5,min:0,variant:"default"},language:{kind:"numeric",label:{en:"Language",fr:"Langue"},max:3,min:0,variant:"default"},lowEdu:{kind:"binary",label:{en:"Less Than 12 Years of Education",fr:"Moins de 12 ans d\'\\xE9tudes"},options:{en:{f:"No",t:"Yes"},fr:{f:"No",t:"Oui"}},variant:"radio"},naming:{kind:"numeric",label:{en:"Naming",fr:"D\\xE9nomination"},max:3,min:0,variant:"default"},orientation:{kind:"numeric",label:{en:"Orientation",fr:"Orientation"},max:6,min:0,variant:"default"},visuospatialExecutive:{kind:"numeric",label:{en:"Visuospatial/Executive",fr:"Visuospatial/Ex\\xE9cutif"},max:5,min:0,variant:"default"}},details:{description:{en:"The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.",fr:"Le Montreal Cognitive Assessment (MoCA) a \\xE9t\\xE9 con\\xE7ue comme un instrument de d\\xE9pistage rapide des troubles cognitifs l\\xE9gers. Il \\xE9value diff\\xE9rents domaines cognitifs : l\'attention et la concentration, les fonctions ex\\xE9cutives, la m\\xE9moire, le langage, les capacit\\xE9s visuoconstructives, la pens\\xE9e conceptuelle, les calculs et l\'orientation. Le MoCA peut \\xEAtre administr\\xE9 par toute personne qui comprend et suit les instructions, mais seul un professionnel de la sant\\xE9 sp\\xE9cialis\\xE9 dans le domaine cognitif peut interpr\\xE9ter les r\\xE9sultats. L\'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est consid\\xE9r\\xE9 comme normal."},estimatedDuration:10,instructions:{en:["All instructions may be repeated once."],fr:["Toutes les instructions peuvent \\xEAtre r\\xE9p\\xE9t\\xE9es une fois."]},license:"UNLICENSED",title:{en:"Montreal Cognitive Assessment",fr:"Montreal Cognitive Assessment"}},measures:{abstraction:{kind:"const",ref:"abstraction"},attention:{kind:"const",ref:"attention"},delayedRecall:{kind:"const",ref:"delayedRecall"},language:{kind:"const",ref:"language"},naming:{kind:"const",ref:"naming"},orientation:{kind:"const",ref:"orientation"},totalScore:{kind:"computed",label:{en:"Total Score",fr:"Score total"},value:i=>{let n=0;return Object.values(i).forEach(a=>{n+=Number(a)}),n}},visuospatialExecutive:{kind:"const",ref:"visuospatialExecutive"}}})})();\n', kind: 'FORM', language: ['en', 'fr'], name: 'MontrealCognitiveAssessment', + source: + "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n abstraction: z.number().int().gte(0).lte(2),\n attention: z.number().int().gte(0).lte(6),\n delayedRecall: z.number().int().gte(0).lte(5),\n language: z.number().int().gte(0).lte(3),\n lowEdu: z.boolean(),\n naming: z.number().int().gte(0).lte(3),\n orientation: z.number().int().gte(0).lte(6),\n visuospatialExecutive: z.number().int().gte(0).lte(5)\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'MontrealCognitiveAssessment',\n tags: {\n en: ['Cognitive'],\n fr: ['Cognitif']\n },\n version: 8.1,\n content: {\n abstraction: {\n kind: 'numeric',\n label: {\n en: 'Abstraction',\n fr: 'Abstraction'\n },\n max: 2,\n min: 0,\n variant: 'default'\n },\n attention: {\n kind: 'numeric',\n label: {\n en: 'Attention',\n fr: 'Attention'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n delayedRecall: {\n kind: 'numeric',\n label: {\n en: 'Delayed Recall',\n fr: 'Rappel'\n },\n max: 5,\n min: 0,\n variant: 'default'\n },\n language: {\n kind: 'numeric',\n label: {\n en: 'Language',\n fr: 'Langue'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n lowEdu: {\n kind: 'binary',\n label: {\n en: 'Less Than 12 Years of Education',\n fr: \"Moins de 12 ans d'études\"\n },\n options: {\n en: {\n f: 'No',\n t: 'Yes'\n },\n fr: {\n f: 'No',\n t: 'Oui'\n }\n },\n variant: 'radio'\n },\n naming: {\n kind: 'numeric',\n label: {\n en: 'Naming',\n fr: 'Dénomination'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n orientation: {\n kind: 'numeric',\n label: {\n en: 'Orientation',\n fr: 'Orientation'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n visuospatialExecutive: {\n kind: 'numeric',\n label: {\n en: 'Visuospatial/Executive',\n fr: 'Visuospatial/Exécutif'\n },\n max: 5,\n min: 0,\n variant: 'default'\n }\n },\n details: {\n description: {\n en: 'The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.',\n fr: \"Le Montreal Cognitive Assessment (MoCA) a été conçue comme un instrument de dépistage rapide des troubles cognitifs légers. Il évalue différents domaines cognitifs : l'attention et la concentration, les fonctions exécutives, la mémoire, le langage, les capacités visuoconstructives, la pensée conceptuelle, les calculs et l'orientation. Le MoCA peut être administré par toute personne qui comprend et suit les instructions, mais seul un professionnel de la santé spécialisé dans le domaine cognitif peut interpréter les résultats. L'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est considéré comme normal.\"\n },\n estimatedDuration: 10,\n instructions: {\n en: ['All instructions may be repeated once.'],\n fr: ['Toutes les instructions peuvent être répétées une fois.']\n },\n license: 'UNLICENSED',\n title: {\n en: 'Montreal Cognitive Assessment',\n fr: 'Montreal Cognitive Assessment'\n }\n },\n measures: {\n abstraction: {\n kind: 'const',\n ref: 'abstraction'\n },\n attention: {\n kind: 'const',\n ref: 'attention'\n },\n delayedRecall: {\n kind: 'const',\n ref: 'delayedRecall'\n },\n language: {\n kind: 'const',\n ref: 'language'\n },\n naming: {\n kind: 'const',\n ref: 'naming'\n },\n orientation: {\n kind: 'const',\n ref: 'orientation'\n },\n totalScore: {\n kind: 'computed',\n label: {\n en: 'Total Score',\n fr: 'Score total'\n },\n value: (data) => {\n let sum = 0;\n Object.values(data).forEach((value) => {\n sum += Number(value);\n });\n return sum;\n }\n },\n visuospatialExecutive: {\n kind: 'const',\n ref: 'visuospatialExecutive'\n }\n }\n});\n", tags: { en: ['Cognitive'], fr: ['Cognitif'] }, - version: 8.1, - __model__: 'Instrument' + updatedAt: '2024-02-27T00:02:41.459Z', + version: 8.1 }); }), //form submission handler for cognitve assessment http.post('/v1/instrument-records', () => { return HttpResponse.json({ + __model__: 'InstrumentRecord', + assignmentId: null, createdAt: '2024-03-04T16:46:16.661Z', - updatedAt: '2024-03-04T16:46:16.661Z', - id: '65e5fad8269e4a9f2ed48fd4', data: { abstraction: 1, attention: 1, @@ -274,10 +274,10 @@ export const formHandlers = [ }, date: '2024-03-04T16:46:16.629Z', groupId: null, - subjectId: '3069e89784e0e22b4d070e9c6117c3fe48666c44b4036762b1109c005ab4d6d4', + id: '65e5fad8269e4a9f2ed48fd4', instrumentId: '65dd26ad933b24c8b9023ca7', - assignmentId: null, - __model__: 'InstrumentRecord' + subjectId: '3069e89784e0e22b4d070e9c6117c3fe48666c44b4036762b1109c005ab4d6d4', + updatedAt: '2024-03-04T16:46:16.661Z' }); }) ]; diff --git a/apps/web/src/test/server/handlers/instrument-manager.handlers.ts b/apps/web/src/test/server/handlers/instrument-manager.handlers.ts index ccc4c538a..c6868e143 100644 --- a/apps/web/src/test/server/handlers/instrument-manager.handlers.ts +++ b/apps/web/src/test/server/handlers/instrument-manager.handlers.ts @@ -189,6 +189,10 @@ export const manageInstrumentHandlers = [ http.get('/v1/instruments/65e730e24344d866399e41e8', () => { return HttpResponse.json({ + __model__: 'Instrument', + bundle: + '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', + createdAt: '2024-03-05T14:49:06.485Z', details: { authors: [], description: { @@ -208,27 +212,27 @@ export const manageInstrumentHandlers = [ fr: 'Questionnaire sur le bonheur' } }, - createdAt: '2024-03-05T14:49:06.485Z', - updatedAt: '2024-03-05T14:49:06.485Z', id: '65e730e24344d866399e41e8', - source: - "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n overallHappiness: z.number().int().gte(1).lte(10),\n reasonForSadness: z.string().optional()\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'HappinessQuestionnaire',\n tags: {\n en: ['Well-Being'],\n fr: ['Bien-être']\n },\n version: 1,\n content: {\n overallHappiness: {\n description: {\n en: 'Overall happiness from 1 through 10 (inclusive)',\n fr: 'Bonheur général de 1 à 10 (inclus)'\n },\n kind: 'numeric',\n label: {\n en: 'Overall Happiness',\n fr: 'Bonheur général'\n },\n max: 10,\n min: 1,\n variant: 'slider'\n },\n reasonForSadness: {\n deps: ['overallHappiness'],\n kind: 'dynamic',\n render: (data) => {\n if (!data?.overallHappiness || data.overallHappiness >= 5) {\n return null;\n }\n return {\n label: {\n en: 'Reason for Sadness',\n fr: 'Raison de la tristesse'\n },\n isRequired: false,\n kind: 'text',\n variant: 'long'\n };\n }\n }\n },\n details: {\n description: {\n en: 'The Happiness Questionnaire is a questionnaire about happiness.',\n fr: 'Le questionnaire sur le bonheur est un questionnaire sur le bonheur.'\n },\n estimatedDuration: 1,\n instructions: {\n en: ['Please answer the question based on your current feelings.'],\n fr: ['Veuillez répondre à la question en fonction de vos sentiments actuels.']\n },\n license: 'AGPL-3.0',\n title: {\n en: 'Happiness Questionnaire',\n fr: 'Questionnaire sur le bonheur'\n }\n },\n measures: {\n overallHappiness: {\n kind: 'const',\n ref: 'overallHappiness'\n }\n }\n});\n", - bundle: - '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM', language: ['en', 'fr'], name: 'HappinessQuestionnaire', + source: + "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n overallHappiness: z.number().int().gte(1).lte(10),\n reasonForSadness: z.string().optional()\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'HappinessQuestionnaire',\n tags: {\n en: ['Well-Being'],\n fr: ['Bien-être']\n },\n version: 1,\n content: {\n overallHappiness: {\n description: {\n en: 'Overall happiness from 1 through 10 (inclusive)',\n fr: 'Bonheur général de 1 à 10 (inclus)'\n },\n kind: 'numeric',\n label: {\n en: 'Overall Happiness',\n fr: 'Bonheur général'\n },\n max: 10,\n min: 1,\n variant: 'slider'\n },\n reasonForSadness: {\n deps: ['overallHappiness'],\n kind: 'dynamic',\n render: (data) => {\n if (!data?.overallHappiness || data.overallHappiness >= 5) {\n return null;\n }\n return {\n label: {\n en: 'Reason for Sadness',\n fr: 'Raison de la tristesse'\n },\n isRequired: false,\n kind: 'text',\n variant: 'long'\n };\n }\n }\n },\n details: {\n description: {\n en: 'The Happiness Questionnaire is a questionnaire about happiness.',\n fr: 'Le questionnaire sur le bonheur est un questionnaire sur le bonheur.'\n },\n estimatedDuration: 1,\n instructions: {\n en: ['Please answer the question based on your current feelings.'],\n fr: ['Veuillez répondre à la question en fonction de vos sentiments actuels.']\n },\n license: 'AGPL-3.0',\n title: {\n en: 'Happiness Questionnaire',\n fr: 'Questionnaire sur le bonheur'\n }\n },\n measures: {\n overallHappiness: {\n kind: 'const',\n ref: 'overallHappiness'\n }\n }\n});\n", tags: { en: ['Well-Being'], fr: ['Bien-être'] }, - version: 1, - __model__: 'Instrument' + updatedAt: '2024-03-05T14:49:06.485Z', + version: 1 }); }), http.get('/v1/instruments/65dd26a1933b24c8b9023ca1', () => { return HttpResponse.json({ + __model__: 'Instrument', + bundle: + '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', + createdAt: '2024-03-05T14:49:06.485Z', details: { authors: [], description: { @@ -248,27 +252,27 @@ export const manageInstrumentHandlers = [ fr: 'Questionnaire sur le bonheur' } }, - createdAt: '2024-03-05T14:49:06.485Z', - updatedAt: '2024-03-05T14:49:06.485Z', id: '65e730e24344d866399e41e8', - source: - "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n overallHappiness: z.number().int().gte(1).lte(10),\n reasonForSadness: z.string().optional()\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'HappinessQuestionnaire',\n tags: {\n en: ['Well-Being'],\n fr: ['Bien-être']\n },\n version: 1,\n content: {\n overallHappiness: {\n description: {\n en: 'Overall happiness from 1 through 10 (inclusive)',\n fr: 'Bonheur général de 1 à 10 (inclus)'\n },\n kind: 'numeric',\n label: {\n en: 'Overall Happiness',\n fr: 'Bonheur général'\n },\n max: 10,\n min: 1,\n variant: 'slider'\n },\n reasonForSadness: {\n deps: ['overallHappiness'],\n kind: 'dynamic',\n render: (data) => {\n if (!data?.overallHappiness || data.overallHappiness >= 5) {\n return null;\n }\n return {\n label: {\n en: 'Reason for Sadness',\n fr: 'Raison de la tristesse'\n },\n isRequired: false,\n kind: 'text',\n variant: 'long'\n };\n }\n }\n },\n details: {\n description: {\n en: 'The Happiness Questionnaire is a questionnaire about happiness.',\n fr: 'Le questionnaire sur le bonheur est un questionnaire sur le bonheur.'\n },\n estimatedDuration: 1,\n instructions: {\n en: ['Please answer the question based on your current feelings.'],\n fr: ['Veuillez répondre à la question en fonction de vos sentiments actuels.']\n },\n license: 'AGPL-3.0',\n title: {\n en: 'Happiness Questionnaire',\n fr: 'Questionnaire sur le bonheur'\n }\n },\n measures: {\n overallHappiness: {\n kind: 'const',\n ref: 'overallHappiness'\n }\n }\n});\n", - bundle: - '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM', language: ['en', 'fr'], name: 'HappinessQuestionnaire', + source: + "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n overallHappiness: z.number().int().gte(1).lte(10),\n reasonForSadness: z.string().optional()\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'HappinessQuestionnaire',\n tags: {\n en: ['Well-Being'],\n fr: ['Bien-être']\n },\n version: 1,\n content: {\n overallHappiness: {\n description: {\n en: 'Overall happiness from 1 through 10 (inclusive)',\n fr: 'Bonheur général de 1 à 10 (inclus)'\n },\n kind: 'numeric',\n label: {\n en: 'Overall Happiness',\n fr: 'Bonheur général'\n },\n max: 10,\n min: 1,\n variant: 'slider'\n },\n reasonForSadness: {\n deps: ['overallHappiness'],\n kind: 'dynamic',\n render: (data) => {\n if (!data?.overallHappiness || data.overallHappiness >= 5) {\n return null;\n }\n return {\n label: {\n en: 'Reason for Sadness',\n fr: 'Raison de la tristesse'\n },\n isRequired: false,\n kind: 'text',\n variant: 'long'\n };\n }\n }\n },\n details: {\n description: {\n en: 'The Happiness Questionnaire is a questionnaire about happiness.',\n fr: 'Le questionnaire sur le bonheur est un questionnaire sur le bonheur.'\n },\n estimatedDuration: 1,\n instructions: {\n en: ['Please answer the question based on your current feelings.'],\n fr: ['Veuillez répondre à la question en fonction de vos sentiments actuels.']\n },\n license: 'AGPL-3.0',\n title: {\n en: 'Happiness Questionnaire',\n fr: 'Questionnaire sur le bonheur'\n }\n },\n measures: {\n overallHappiness: {\n kind: 'const',\n ref: 'overallHappiness'\n }\n }\n});\n", tags: { en: ['Well-Being'], fr: ['Bien-être'] }, - version: 1, - __model__: 'Instrument' + updatedAt: '2024-03-05T14:49:06.485Z', + version: 1 }); }), http.get('/v1/instruments/65dd26ad933b24c8b9023ca7', () => { return HttpResponse.json({ + __model__: 'Instrument', + bundle: + '(async()=>{const{InstrumentFactory:t}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new t({kind:"FORM",language:["en","fr"],validationSchema:e.object({abstraction:e.number().int().gte(0).lte(2),attention:e.number().int().gte(0).lte(6),delayedRecall:e.number().int().gte(0).lte(5),language:e.number().int().gte(0).lte(3),lowEdu:e.boolean(),naming:e.number().int().gte(0).lte(3),orientation:e.number().int().gte(0).lte(6),visuospatialExecutive:e.number().int().gte(0).lte(5)})}).defineInstrument({name:"MontrealCognitiveAssessment",tags:{en:["Cognitive"],fr:["Cognitif"]},version:8.1,content:{abstraction:{kind:"numeric",label:{en:"Abstraction",fr:"Abstraction"},max:2,min:0,variant:"default"},attention:{kind:"numeric",label:{en:"Attention",fr:"Attention"},max:6,min:0,variant:"default"},delayedRecall:{kind:"numeric",label:{en:"Delayed Recall",fr:"Rappel"},max:5,min:0,variant:"default"},language:{kind:"numeric",label:{en:"Language",fr:"Langue"},max:3,min:0,variant:"default"},lowEdu:{kind:"binary",label:{en:"Less Than 12 Years of Education",fr:"Moins de 12 ans d\'\\xE9tudes"},options:{en:{f:"No",t:"Yes"},fr:{f:"No",t:"Oui"}},variant:"radio"},naming:{kind:"numeric",label:{en:"Naming",fr:"D\\xE9nomination"},max:3,min:0,variant:"default"},orientation:{kind:"numeric",label:{en:"Orientation",fr:"Orientation"},max:6,min:0,variant:"default"},visuospatialExecutive:{kind:"numeric",label:{en:"Visuospatial/Executive",fr:"Visuospatial/Ex\\xE9cutif"},max:5,min:0,variant:"default"}},details:{description:{en:"The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.",fr:"Le Montreal Cognitive Assessment (MoCA) a \\xE9t\\xE9 con\\xE7ue comme un instrument de d\\xE9pistage rapide des troubles cognitifs l\\xE9gers. Il \\xE9value diff\\xE9rents domaines cognitifs : l\'attention et la concentration, les fonctions ex\\xE9cutives, la m\\xE9moire, le langage, les capacit\\xE9s visuoconstructives, la pens\\xE9e conceptuelle, les calculs et l\'orientation. Le MoCA peut \\xEAtre administr\\xE9 par toute personne qui comprend et suit les instructions, mais seul un professionnel de la sant\\xE9 sp\\xE9cialis\\xE9 dans le domaine cognitif peut interpr\\xE9ter les r\\xE9sultats. L\'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est consid\\xE9r\\xE9 comme normal."},estimatedDuration:10,instructions:{en:["All instructions may be repeated once."],fr:["Toutes les instructions peuvent \\xEAtre r\\xE9p\\xE9t\\xE9es une fois."]},license:"UNLICENSED",title:{en:"Montreal Cognitive Assessment",fr:"Montreal Cognitive Assessment"}},measures:{abstraction:{kind:"const",ref:"abstraction"},attention:{kind:"const",ref:"attention"},delayedRecall:{kind:"const",ref:"delayedRecall"},language:{kind:"const",ref:"language"},naming:{kind:"const",ref:"naming"},orientation:{kind:"const",ref:"orientation"},totalScore:{kind:"computed",label:{en:"Total Score",fr:"Score total"},value:i=>{let n=0;return Object.values(i).forEach(a=>{n+=Number(a)}),n}},visuospatialExecutive:{kind:"const",ref:"visuospatialExecutive"}}})})();\n', + createdAt: '2024-02-27T00:02:41.459Z', details: { authors: [], description: { @@ -288,27 +292,27 @@ export const manageInstrumentHandlers = [ fr: 'Montreal Cognitive Assessment' } }, - createdAt: '2024-02-27T00:02:41.459Z', - updatedAt: '2024-02-27T00:02:41.459Z', id: '65dd26ad933b24c8b9023ca7', - source: - "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n abstraction: z.number().int().gte(0).lte(2),\n attention: z.number().int().gte(0).lte(6),\n delayedRecall: z.number().int().gte(0).lte(5),\n language: z.number().int().gte(0).lte(3),\n lowEdu: z.boolean(),\n naming: z.number().int().gte(0).lte(3),\n orientation: z.number().int().gte(0).lte(6),\n visuospatialExecutive: z.number().int().gte(0).lte(5)\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'MontrealCognitiveAssessment',\n tags: {\n en: ['Cognitive'],\n fr: ['Cognitif']\n },\n version: 8.1,\n content: {\n abstraction: {\n kind: 'numeric',\n label: {\n en: 'Abstraction',\n fr: 'Abstraction'\n },\n max: 2,\n min: 0,\n variant: 'default'\n },\n attention: {\n kind: 'numeric',\n label: {\n en: 'Attention',\n fr: 'Attention'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n delayedRecall: {\n kind: 'numeric',\n label: {\n en: 'Delayed Recall',\n fr: 'Rappel'\n },\n max: 5,\n min: 0,\n variant: 'default'\n },\n language: {\n kind: 'numeric',\n label: {\n en: 'Language',\n fr: 'Langue'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n lowEdu: {\n kind: 'binary',\n label: {\n en: 'Less Than 12 Years of Education',\n fr: \"Moins de 12 ans d'études\"\n },\n options: {\n en: {\n f: 'No',\n t: 'Yes'\n },\n fr: {\n f: 'No',\n t: 'Oui'\n }\n },\n variant: 'radio'\n },\n naming: {\n kind: 'numeric',\n label: {\n en: 'Naming',\n fr: 'Dénomination'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n orientation: {\n kind: 'numeric',\n label: {\n en: 'Orientation',\n fr: 'Orientation'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n visuospatialExecutive: {\n kind: 'numeric',\n label: {\n en: 'Visuospatial/Executive',\n fr: 'Visuospatial/Exécutif'\n },\n max: 5,\n min: 0,\n variant: 'default'\n }\n },\n details: {\n description: {\n en: 'The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.',\n fr: \"Le Montreal Cognitive Assessment (MoCA) a été conçue comme un instrument de dépistage rapide des troubles cognitifs légers. Il évalue différents domaines cognitifs : l'attention et la concentration, les fonctions exécutives, la mémoire, le langage, les capacités visuoconstructives, la pensée conceptuelle, les calculs et l'orientation. Le MoCA peut être administré par toute personne qui comprend et suit les instructions, mais seul un professionnel de la santé spécialisé dans le domaine cognitif peut interpréter les résultats. L'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est considéré comme normal.\"\n },\n estimatedDuration: 10,\n instructions: {\n en: ['All instructions may be repeated once.'],\n fr: ['Toutes les instructions peuvent être répétées une fois.']\n },\n license: 'UNLICENSED',\n title: {\n en: 'Montreal Cognitive Assessment',\n fr: 'Montreal Cognitive Assessment'\n }\n },\n measures: {\n abstraction: {\n kind: 'const',\n ref: 'abstraction'\n },\n attention: {\n kind: 'const',\n ref: 'attention'\n },\n delayedRecall: {\n kind: 'const',\n ref: 'delayedRecall'\n },\n language: {\n kind: 'const',\n ref: 'language'\n },\n naming: {\n kind: 'const',\n ref: 'naming'\n },\n orientation: {\n kind: 'const',\n ref: 'orientation'\n },\n totalScore: {\n kind: 'computed',\n label: {\n en: 'Total Score',\n fr: 'Score total'\n },\n value: (data) => {\n let sum = 0;\n Object.values(data).forEach((value) => {\n sum += Number(value);\n });\n return sum;\n }\n },\n visuospatialExecutive: {\n kind: 'const',\n ref: 'visuospatialExecutive'\n }\n }\n});\n", - bundle: - '(async()=>{const{InstrumentFactory:t}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new t({kind:"FORM",language:["en","fr"],validationSchema:e.object({abstraction:e.number().int().gte(0).lte(2),attention:e.number().int().gte(0).lte(6),delayedRecall:e.number().int().gte(0).lte(5),language:e.number().int().gte(0).lte(3),lowEdu:e.boolean(),naming:e.number().int().gte(0).lte(3),orientation:e.number().int().gte(0).lte(6),visuospatialExecutive:e.number().int().gte(0).lte(5)})}).defineInstrument({name:"MontrealCognitiveAssessment",tags:{en:["Cognitive"],fr:["Cognitif"]},version:8.1,content:{abstraction:{kind:"numeric",label:{en:"Abstraction",fr:"Abstraction"},max:2,min:0,variant:"default"},attention:{kind:"numeric",label:{en:"Attention",fr:"Attention"},max:6,min:0,variant:"default"},delayedRecall:{kind:"numeric",label:{en:"Delayed Recall",fr:"Rappel"},max:5,min:0,variant:"default"},language:{kind:"numeric",label:{en:"Language",fr:"Langue"},max:3,min:0,variant:"default"},lowEdu:{kind:"binary",label:{en:"Less Than 12 Years of Education",fr:"Moins de 12 ans d\'\\xE9tudes"},options:{en:{f:"No",t:"Yes"},fr:{f:"No",t:"Oui"}},variant:"radio"},naming:{kind:"numeric",label:{en:"Naming",fr:"D\\xE9nomination"},max:3,min:0,variant:"default"},orientation:{kind:"numeric",label:{en:"Orientation",fr:"Orientation"},max:6,min:0,variant:"default"},visuospatialExecutive:{kind:"numeric",label:{en:"Visuospatial/Executive",fr:"Visuospatial/Ex\\xE9cutif"},max:5,min:0,variant:"default"}},details:{description:{en:"The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.",fr:"Le Montreal Cognitive Assessment (MoCA) a \\xE9t\\xE9 con\\xE7ue comme un instrument de d\\xE9pistage rapide des troubles cognitifs l\\xE9gers. Il \\xE9value diff\\xE9rents domaines cognitifs : l\'attention et la concentration, les fonctions ex\\xE9cutives, la m\\xE9moire, le langage, les capacit\\xE9s visuoconstructives, la pens\\xE9e conceptuelle, les calculs et l\'orientation. Le MoCA peut \\xEAtre administr\\xE9 par toute personne qui comprend et suit les instructions, mais seul un professionnel de la sant\\xE9 sp\\xE9cialis\\xE9 dans le domaine cognitif peut interpr\\xE9ter les r\\xE9sultats. L\'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est consid\\xE9r\\xE9 comme normal."},estimatedDuration:10,instructions:{en:["All instructions may be repeated once."],fr:["Toutes les instructions peuvent \\xEAtre r\\xE9p\\xE9t\\xE9es une fois."]},license:"UNLICENSED",title:{en:"Montreal Cognitive Assessment",fr:"Montreal Cognitive Assessment"}},measures:{abstraction:{kind:"const",ref:"abstraction"},attention:{kind:"const",ref:"attention"},delayedRecall:{kind:"const",ref:"delayedRecall"},language:{kind:"const",ref:"language"},naming:{kind:"const",ref:"naming"},orientation:{kind:"const",ref:"orientation"},totalScore:{kind:"computed",label:{en:"Total Score",fr:"Score total"},value:i=>{let n=0;return Object.values(i).forEach(a=>{n+=Number(a)}),n}},visuospatialExecutive:{kind:"const",ref:"visuospatialExecutive"}}})})();\n', kind: 'FORM', language: ['en', 'fr'], name: 'MontrealCognitiveAssessment', + source: + "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n abstraction: z.number().int().gte(0).lte(2),\n attention: z.number().int().gte(0).lte(6),\n delayedRecall: z.number().int().gte(0).lte(5),\n language: z.number().int().gte(0).lte(3),\n lowEdu: z.boolean(),\n naming: z.number().int().gte(0).lte(3),\n orientation: z.number().int().gte(0).lte(6),\n visuospatialExecutive: z.number().int().gte(0).lte(5)\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'MontrealCognitiveAssessment',\n tags: {\n en: ['Cognitive'],\n fr: ['Cognitif']\n },\n version: 8.1,\n content: {\n abstraction: {\n kind: 'numeric',\n label: {\n en: 'Abstraction',\n fr: 'Abstraction'\n },\n max: 2,\n min: 0,\n variant: 'default'\n },\n attention: {\n kind: 'numeric',\n label: {\n en: 'Attention',\n fr: 'Attention'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n delayedRecall: {\n kind: 'numeric',\n label: {\n en: 'Delayed Recall',\n fr: 'Rappel'\n },\n max: 5,\n min: 0,\n variant: 'default'\n },\n language: {\n kind: 'numeric',\n label: {\n en: 'Language',\n fr: 'Langue'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n lowEdu: {\n kind: 'binary',\n label: {\n en: 'Less Than 12 Years of Education',\n fr: \"Moins de 12 ans d'études\"\n },\n options: {\n en: {\n f: 'No',\n t: 'Yes'\n },\n fr: {\n f: 'No',\n t: 'Oui'\n }\n },\n variant: 'radio'\n },\n naming: {\n kind: 'numeric',\n label: {\n en: 'Naming',\n fr: 'Dénomination'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n orientation: {\n kind: 'numeric',\n label: {\n en: 'Orientation',\n fr: 'Orientation'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n visuospatialExecutive: {\n kind: 'numeric',\n label: {\n en: 'Visuospatial/Executive',\n fr: 'Visuospatial/Exécutif'\n },\n max: 5,\n min: 0,\n variant: 'default'\n }\n },\n details: {\n description: {\n en: 'The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.',\n fr: \"Le Montreal Cognitive Assessment (MoCA) a été conçue comme un instrument de dépistage rapide des troubles cognitifs légers. Il évalue différents domaines cognitifs : l'attention et la concentration, les fonctions exécutives, la mémoire, le langage, les capacités visuoconstructives, la pensée conceptuelle, les calculs et l'orientation. Le MoCA peut être administré par toute personne qui comprend et suit les instructions, mais seul un professionnel de la santé spécialisé dans le domaine cognitif peut interpréter les résultats. L'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est considéré comme normal.\"\n },\n estimatedDuration: 10,\n instructions: {\n en: ['All instructions may be repeated once.'],\n fr: ['Toutes les instructions peuvent être répétées une fois.']\n },\n license: 'UNLICENSED',\n title: {\n en: 'Montreal Cognitive Assessment',\n fr: 'Montreal Cognitive Assessment'\n }\n },\n measures: {\n abstraction: {\n kind: 'const',\n ref: 'abstraction'\n },\n attention: {\n kind: 'const',\n ref: 'attention'\n },\n delayedRecall: {\n kind: 'const',\n ref: 'delayedRecall'\n },\n language: {\n kind: 'const',\n ref: 'language'\n },\n naming: {\n kind: 'const',\n ref: 'naming'\n },\n orientation: {\n kind: 'const',\n ref: 'orientation'\n },\n totalScore: {\n kind: 'computed',\n label: {\n en: 'Total Score',\n fr: 'Score total'\n },\n value: (data) => {\n let sum = 0;\n Object.values(data).forEach((value) => {\n sum += Number(value);\n });\n return sum;\n }\n },\n visuospatialExecutive: {\n kind: 'const',\n ref: 'visuospatialExecutive'\n }\n }\n});\n", tags: { en: ['Cognitive'], fr: ['Cognitif'] }, - version: 8.1, - __model__: 'Instrument' + updatedAt: '2024-02-27T00:02:41.459Z', + version: 8.1 }); }), http.get('/v1/instruments/render/65dd26ad933b24c8b9023ca7', () => { return HttpResponse.json({ + __model__: 'Instrument', + bundle: + '(async()=>{const{InstrumentFactory:t}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new t({kind:"FORM",language:["en","fr"],validationSchema:e.object({abstraction:e.number().int().gte(0).lte(2),attention:e.number().int().gte(0).lte(6),delayedRecall:e.number().int().gte(0).lte(5),language:e.number().int().gte(0).lte(3),lowEdu:e.boolean(),naming:e.number().int().gte(0).lte(3),orientation:e.number().int().gte(0).lte(6),visuospatialExecutive:e.number().int().gte(0).lte(5)})}).defineInstrument({name:"MontrealCognitiveAssessment",tags:{en:["Cognitive"],fr:["Cognitif"]},version:8.1,content:{abstraction:{kind:"numeric",label:{en:"Abstraction",fr:"Abstraction"},max:2,min:0,variant:"default"},attention:{kind:"numeric",label:{en:"Attention",fr:"Attention"},max:6,min:0,variant:"default"},delayedRecall:{kind:"numeric",label:{en:"Delayed Recall",fr:"Rappel"},max:5,min:0,variant:"default"},language:{kind:"numeric",label:{en:"Language",fr:"Langue"},max:3,min:0,variant:"default"},lowEdu:{kind:"binary",label:{en:"Less Than 12 Years of Education",fr:"Moins de 12 ans d\'\\xE9tudes"},options:{en:{f:"No",t:"Yes"},fr:{f:"No",t:"Oui"}},variant:"radio"},naming:{kind:"numeric",label:{en:"Naming",fr:"D\\xE9nomination"},max:3,min:0,variant:"default"},orientation:{kind:"numeric",label:{en:"Orientation",fr:"Orientation"},max:6,min:0,variant:"default"},visuospatialExecutive:{kind:"numeric",label:{en:"Visuospatial/Executive",fr:"Visuospatial/Ex\\xE9cutif"},max:5,min:0,variant:"default"}},details:{description:{en:"The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.",fr:"Le Montreal Cognitive Assessment (MoCA) a \\xE9t\\xE9 con\\xE7ue comme un instrument de d\\xE9pistage rapide des troubles cognitifs l\\xE9gers. Il \\xE9value diff\\xE9rents domaines cognitifs : l\'attention et la concentration, les fonctions ex\\xE9cutives, la m\\xE9moire, le langage, les capacit\\xE9s visuoconstructives, la pens\\xE9e conceptuelle, les calculs et l\'orientation. Le MoCA peut \\xEAtre administr\\xE9 par toute personne qui comprend et suit les instructions, mais seul un professionnel de la sant\\xE9 sp\\xE9cialis\\xE9 dans le domaine cognitif peut interpr\\xE9ter les r\\xE9sultats. L\'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est consid\\xE9r\\xE9 comme normal."},estimatedDuration:10,instructions:{en:["All instructions may be repeated once."],fr:["Toutes les instructions peuvent \\xEAtre r\\xE9p\\xE9t\\xE9es une fois."]},license:"UNLICENSED",title:{en:"Montreal Cognitive Assessment",fr:"Montreal Cognitive Assessment"}},measures:{abstraction:{kind:"const",ref:"abstraction"},attention:{kind:"const",ref:"attention"},delayedRecall:{kind:"const",ref:"delayedRecall"},language:{kind:"const",ref:"language"},naming:{kind:"const",ref:"naming"},orientation:{kind:"const",ref:"orientation"},totalScore:{kind:"computed",label:{en:"Total Score",fr:"Score total"},value:i=>{let n=0;return Object.values(i).forEach(a=>{n+=Number(a)}),n}},visuospatialExecutive:{kind:"const",ref:"visuospatialExecutive"}}})})();\n', + createdAt: '2024-02-27T00:02:41.459Z', details: { authors: [], description: { @@ -328,22 +332,18 @@ export const manageInstrumentHandlers = [ fr: 'Montreal Cognitive Assessment' } }, - createdAt: '2024-02-27T00:02:41.459Z', - updatedAt: '2024-02-27T00:02:41.459Z', id: '65dd26ad933b24c8b9023ca7', - source: - "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n abstraction: z.number().int().gte(0).lte(2),\n attention: z.number().int().gte(0).lte(6),\n delayedRecall: z.number().int().gte(0).lte(5),\n language: z.number().int().gte(0).lte(3),\n lowEdu: z.boolean(),\n naming: z.number().int().gte(0).lte(3),\n orientation: z.number().int().gte(0).lte(6),\n visuospatialExecutive: z.number().int().gte(0).lte(5)\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'MontrealCognitiveAssessment',\n tags: {\n en: ['Cognitive'],\n fr: ['Cognitif']\n },\n version: 8.1,\n content: {\n abstraction: {\n kind: 'numeric',\n label: {\n en: 'Abstraction',\n fr: 'Abstraction'\n },\n max: 2,\n min: 0,\n variant: 'default'\n },\n attention: {\n kind: 'numeric',\n label: {\n en: 'Attention',\n fr: 'Attention'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n delayedRecall: {\n kind: 'numeric',\n label: {\n en: 'Delayed Recall',\n fr: 'Rappel'\n },\n max: 5,\n min: 0,\n variant: 'default'\n },\n language: {\n kind: 'numeric',\n label: {\n en: 'Language',\n fr: 'Langue'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n lowEdu: {\n kind: 'binary',\n label: {\n en: 'Less Than 12 Years of Education',\n fr: \"Moins de 12 ans d'études\"\n },\n options: {\n en: {\n f: 'No',\n t: 'Yes'\n },\n fr: {\n f: 'No',\n t: 'Oui'\n }\n },\n variant: 'radio'\n },\n naming: {\n kind: 'numeric',\n label: {\n en: 'Naming',\n fr: 'Dénomination'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n orientation: {\n kind: 'numeric',\n label: {\n en: 'Orientation',\n fr: 'Orientation'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n visuospatialExecutive: {\n kind: 'numeric',\n label: {\n en: 'Visuospatial/Executive',\n fr: 'Visuospatial/Exécutif'\n },\n max: 5,\n min: 0,\n variant: 'default'\n }\n },\n details: {\n description: {\n en: 'The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.',\n fr: \"Le Montreal Cognitive Assessment (MoCA) a été conçue comme un instrument de dépistage rapide des troubles cognitifs légers. Il évalue différents domaines cognitifs : l'attention et la concentration, les fonctions exécutives, la mémoire, le langage, les capacités visuoconstructives, la pensée conceptuelle, les calculs et l'orientation. Le MoCA peut être administré par toute personne qui comprend et suit les instructions, mais seul un professionnel de la santé spécialisé dans le domaine cognitif peut interpréter les résultats. L'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est considéré comme normal.\"\n },\n estimatedDuration: 10,\n instructions: {\n en: ['All instructions may be repeated once.'],\n fr: ['Toutes les instructions peuvent être répétées une fois.']\n },\n license: 'UNLICENSED',\n title: {\n en: 'Montreal Cognitive Assessment',\n fr: 'Montreal Cognitive Assessment'\n }\n },\n measures: {\n abstraction: {\n kind: 'const',\n ref: 'abstraction'\n },\n attention: {\n kind: 'const',\n ref: 'attention'\n },\n delayedRecall: {\n kind: 'const',\n ref: 'delayedRecall'\n },\n language: {\n kind: 'const',\n ref: 'language'\n },\n naming: {\n kind: 'const',\n ref: 'naming'\n },\n orientation: {\n kind: 'const',\n ref: 'orientation'\n },\n totalScore: {\n kind: 'computed',\n label: {\n en: 'Total Score',\n fr: 'Score total'\n },\n value: (data) => {\n let sum = 0;\n Object.values(data).forEach((value) => {\n sum += Number(value);\n });\n return sum;\n }\n },\n visuospatialExecutive: {\n kind: 'const',\n ref: 'visuospatialExecutive'\n }\n }\n});\n", - bundle: - '(async()=>{const{InstrumentFactory:t}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new t({kind:"FORM",language:["en","fr"],validationSchema:e.object({abstraction:e.number().int().gte(0).lte(2),attention:e.number().int().gte(0).lte(6),delayedRecall:e.number().int().gte(0).lte(5),language:e.number().int().gte(0).lte(3),lowEdu:e.boolean(),naming:e.number().int().gte(0).lte(3),orientation:e.number().int().gte(0).lte(6),visuospatialExecutive:e.number().int().gte(0).lte(5)})}).defineInstrument({name:"MontrealCognitiveAssessment",tags:{en:["Cognitive"],fr:["Cognitif"]},version:8.1,content:{abstraction:{kind:"numeric",label:{en:"Abstraction",fr:"Abstraction"},max:2,min:0,variant:"default"},attention:{kind:"numeric",label:{en:"Attention",fr:"Attention"},max:6,min:0,variant:"default"},delayedRecall:{kind:"numeric",label:{en:"Delayed Recall",fr:"Rappel"},max:5,min:0,variant:"default"},language:{kind:"numeric",label:{en:"Language",fr:"Langue"},max:3,min:0,variant:"default"},lowEdu:{kind:"binary",label:{en:"Less Than 12 Years of Education",fr:"Moins de 12 ans d\'\\xE9tudes"},options:{en:{f:"No",t:"Yes"},fr:{f:"No",t:"Oui"}},variant:"radio"},naming:{kind:"numeric",label:{en:"Naming",fr:"D\\xE9nomination"},max:3,min:0,variant:"default"},orientation:{kind:"numeric",label:{en:"Orientation",fr:"Orientation"},max:6,min:0,variant:"default"},visuospatialExecutive:{kind:"numeric",label:{en:"Visuospatial/Executive",fr:"Visuospatial/Ex\\xE9cutif"},max:5,min:0,variant:"default"}},details:{description:{en:"The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.",fr:"Le Montreal Cognitive Assessment (MoCA) a \\xE9t\\xE9 con\\xE7ue comme un instrument de d\\xE9pistage rapide des troubles cognitifs l\\xE9gers. Il \\xE9value diff\\xE9rents domaines cognitifs : l\'attention et la concentration, les fonctions ex\\xE9cutives, la m\\xE9moire, le langage, les capacit\\xE9s visuoconstructives, la pens\\xE9e conceptuelle, les calculs et l\'orientation. Le MoCA peut \\xEAtre administr\\xE9 par toute personne qui comprend et suit les instructions, mais seul un professionnel de la sant\\xE9 sp\\xE9cialis\\xE9 dans le domaine cognitif peut interpr\\xE9ter les r\\xE9sultats. L\'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est consid\\xE9r\\xE9 comme normal."},estimatedDuration:10,instructions:{en:["All instructions may be repeated once."],fr:["Toutes les instructions peuvent \\xEAtre r\\xE9p\\xE9t\\xE9es une fois."]},license:"UNLICENSED",title:{en:"Montreal Cognitive Assessment",fr:"Montreal Cognitive Assessment"}},measures:{abstraction:{kind:"const",ref:"abstraction"},attention:{kind:"const",ref:"attention"},delayedRecall:{kind:"const",ref:"delayedRecall"},language:{kind:"const",ref:"language"},naming:{kind:"const",ref:"naming"},orientation:{kind:"const",ref:"orientation"},totalScore:{kind:"computed",label:{en:"Total Score",fr:"Score total"},value:i=>{let n=0;return Object.values(i).forEach(a=>{n+=Number(a)}),n}},visuospatialExecutive:{kind:"const",ref:"visuospatialExecutive"}}})})();\n', kind: 'FORM', language: ['en', 'fr'], name: 'MontrealCognitiveAssessment', + source: + "/* eslint-disable perfectionist/sort-objects */\n\nconst { InstrumentFactory } = await import('/runtime/v0.0.1/core.js');\nconst { z } = await import('/runtime/v0.0.1/zod.js');\n\nconst instrumentFactory = new InstrumentFactory({\n kind: 'FORM',\n language: ['en', 'fr'],\n validationSchema: z.object({\n abstraction: z.number().int().gte(0).lte(2),\n attention: z.number().int().gte(0).lte(6),\n delayedRecall: z.number().int().gte(0).lte(5),\n language: z.number().int().gte(0).lte(3),\n lowEdu: z.boolean(),\n naming: z.number().int().gte(0).lte(3),\n orientation: z.number().int().gte(0).lte(6),\n visuospatialExecutive: z.number().int().gte(0).lte(5)\n })\n});\n\nexport default instrumentFactory.defineInstrument({\n name: 'MontrealCognitiveAssessment',\n tags: {\n en: ['Cognitive'],\n fr: ['Cognitif']\n },\n version: 8.1,\n content: {\n abstraction: {\n kind: 'numeric',\n label: {\n en: 'Abstraction',\n fr: 'Abstraction'\n },\n max: 2,\n min: 0,\n variant: 'default'\n },\n attention: {\n kind: 'numeric',\n label: {\n en: 'Attention',\n fr: 'Attention'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n delayedRecall: {\n kind: 'numeric',\n label: {\n en: 'Delayed Recall',\n fr: 'Rappel'\n },\n max: 5,\n min: 0,\n variant: 'default'\n },\n language: {\n kind: 'numeric',\n label: {\n en: 'Language',\n fr: 'Langue'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n lowEdu: {\n kind: 'binary',\n label: {\n en: 'Less Than 12 Years of Education',\n fr: \"Moins de 12 ans d'études\"\n },\n options: {\n en: {\n f: 'No',\n t: 'Yes'\n },\n fr: {\n f: 'No',\n t: 'Oui'\n }\n },\n variant: 'radio'\n },\n naming: {\n kind: 'numeric',\n label: {\n en: 'Naming',\n fr: 'Dénomination'\n },\n max: 3,\n min: 0,\n variant: 'default'\n },\n orientation: {\n kind: 'numeric',\n label: {\n en: 'Orientation',\n fr: 'Orientation'\n },\n max: 6,\n min: 0,\n variant: 'default'\n },\n visuospatialExecutive: {\n kind: 'numeric',\n label: {\n en: 'Visuospatial/Executive',\n fr: 'Visuospatial/Exécutif'\n },\n max: 5,\n min: 0,\n variant: 'default'\n }\n },\n details: {\n description: {\n en: 'The Montreal Cognitive Assessment (MoCA) was designed as a rapid screening instrument for mild cognitive dysfunction. It assesses different cognitive domains: attention and concentration, executive functions, memory, language, visuoconstructional skills, conceptual thinking, calculations, and orientation. The MoCA may be administered by anyone who understands and follows the instructions, however, only a health professional with expertise in the cognitive field may interpret the results. Time to administer the MoCA is approximately 10 minutes. The total possible score is 30 points; a score of 26 or above is considered normal.',\n fr: \"Le Montreal Cognitive Assessment (MoCA) a été conçue comme un instrument de dépistage rapide des troubles cognitifs légers. Il évalue différents domaines cognitifs : l'attention et la concentration, les fonctions exécutives, la mémoire, le langage, les capacités visuoconstructives, la pensée conceptuelle, les calculs et l'orientation. Le MoCA peut être administré par toute personne qui comprend et suit les instructions, mais seul un professionnel de la santé spécialisé dans le domaine cognitif peut interpréter les résultats. L'administration du MoCA dure environ 10 minutes. Le score total possible est de 30 points ; un score de 26 ou plus est considéré comme normal.\"\n },\n estimatedDuration: 10,\n instructions: {\n en: ['All instructions may be repeated once.'],\n fr: ['Toutes les instructions peuvent être répétées une fois.']\n },\n license: 'UNLICENSED',\n title: {\n en: 'Montreal Cognitive Assessment',\n fr: 'Montreal Cognitive Assessment'\n }\n },\n measures: {\n abstraction: {\n kind: 'const',\n ref: 'abstraction'\n },\n attention: {\n kind: 'const',\n ref: 'attention'\n },\n delayedRecall: {\n kind: 'const',\n ref: 'delayedRecall'\n },\n language: {\n kind: 'const',\n ref: 'language'\n },\n naming: {\n kind: 'const',\n ref: 'naming'\n },\n orientation: {\n kind: 'const',\n ref: 'orientation'\n },\n totalScore: {\n kind: 'computed',\n label: {\n en: 'Total Score',\n fr: 'Score total'\n },\n value: (data) => {\n let sum = 0;\n Object.values(data).forEach((value) => {\n sum += Number(value);\n });\n return sum;\n }\n },\n visuospatialExecutive: {\n kind: 'const',\n ref: 'visuospatialExecutive'\n }\n }\n});\n", tags: { en: ['Cognitive'], fr: ['Cognitif'] }, - version: 8.1, - __model__: 'Instrument' + updatedAt: '2024-02-27T00:02:41.459Z', + version: 8.1 }); }) ]; diff --git a/apps/web/src/test/server/handlers/subject.handlers.ts b/apps/web/src/test/server/handlers/subject.handlers.ts index 08fdedeac..4a6f90c96 100644 --- a/apps/web/src/test/server/handlers/subject.handlers.ts +++ b/apps/web/src/test/server/handlers/subject.handlers.ts @@ -205,224 +205,224 @@ export const subjectHandlers = [ () => { return HttpResponse.json([ { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 3 + }, createdAt: '2024-03-05T14:49:18.784Z', - updatedAt: '2024-03-05T14:49:18.784Z', - id: '65e730ee4344d866399e420b', data: { overallHappiness: 3 }, date: '2023-01-15T05:52:34.896Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e420b', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 3 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.784Z' }, { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 1 + }, createdAt: '2024-03-05T14:49:18.787Z', - updatedAt: '2024-03-05T14:49:18.787Z', - id: '65e730ee4344d866399e420c', data: { overallHappiness: 1 }, date: '2023-04-06T16:57:48.693Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e420c', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.787Z' + }, + { + __model__: 'InstrumentRecord', + assignmentId: null, computedMeasures: { overallHappiness: 1 }, - __model__: 'InstrumentRecord' - }, - { createdAt: '2024-03-05T14:49:18.792Z', - updatedAt: '2024-03-05T14:49:18.792Z', - id: '65e730ee4344d866399e420d', data: { overallHappiness: 1 }, date: '2022-09-02T13:02:47.401Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e420d', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 1 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.792Z' }, { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 5 + }, createdAt: '2024-03-05T14:49:18.795Z', - updatedAt: '2024-03-05T14:49:18.795Z', - id: '65e730ee4344d866399e420e', data: { overallHappiness: 5 }, date: '2022-09-11T01:23:49.002Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e420e', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 5 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.795Z' }, { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 6 + }, createdAt: '2024-03-05T14:49:18.799Z', - updatedAt: '2024-03-05T14:49:18.799Z', - id: '65e730ee4344d866399e420f', data: { overallHappiness: 6 }, date: '2024-01-30T03:43:00.887Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e420f', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 6 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.799Z' }, { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 5 + }, createdAt: '2024-03-05T14:49:18.803Z', - updatedAt: '2024-03-05T14:49:18.803Z', - id: '65e730ee4344d866399e4210', data: { overallHappiness: 5 }, date: '2022-10-05T06:26:36.475Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e4210', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 5 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.803Z' }, { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 3 + }, createdAt: '2024-03-05T14:49:18.808Z', - updatedAt: '2024-03-05T14:49:18.808Z', - id: '65e730ee4344d866399e4211', data: { overallHappiness: 3 }, date: '2022-07-01T23:16:42.333Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e4211', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 3 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.808Z' }, { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 4 + }, createdAt: '2024-03-05T14:49:18.812Z', - updatedAt: '2024-03-05T14:49:18.812Z', - id: '65e730ee4344d866399e4212', data: { overallHappiness: 4 }, date: '2023-11-05T11:35:23.888Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e4212', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 4 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.812Z' }, { + __model__: 'InstrumentRecord', + assignmentId: null, + computedMeasures: { + overallHappiness: 9 + }, createdAt: '2024-03-05T14:49:18.816Z', - updatedAt: '2024-03-05T14:49:18.816Z', - id: '65e730ee4344d866399e4213', data: { overallHappiness: 9 }, date: '2022-08-13T11:44:16.693Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e4213', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.816Z' + }, + { + __model__: 'InstrumentRecord', + assignmentId: null, computedMeasures: { overallHappiness: 9 }, - __model__: 'InstrumentRecord' - }, - { createdAt: '2024-03-05T14:49:18.819Z', - updatedAt: '2024-03-05T14:49:18.819Z', - id: '65e730ee4344d866399e4214', data: { overallHappiness: 9 }, date: '2023-08-09T10:42:00.598Z', groupId: '65e730ee4344d866399e41f2', - subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', - instrumentId: '65e730e24344d866399e41e8', - assignmentId: null, + id: '65e730ee4344d866399e4214', instrument: { bundle: '(async()=>{const{InstrumentFactory:s}=await import("/runtime/v0.0.1/core.js"),{z:e}=await import("/runtime/v0.0.1/zod.js");return new s({kind:"FORM",language:["en","fr"],validationSchema:e.object({overallHappiness:e.number().int().gte(1).lte(10),reasonForSadness:e.string().optional()})}).defineInstrument({name:"HappinessQuestionnaire",tags:{en:["Well-Being"],fr:["Bien-\\xEAtre"]},version:1,content:{overallHappiness:{description:{en:"Overall happiness from 1 through 10 (inclusive)",fr:"Bonheur g\\xE9n\\xE9ral de 1 \\xE0 10 (inclus)"},kind:"numeric",label:{en:"Overall Happiness",fr:"Bonheur g\\xE9n\\xE9ral"},max:10,min:1,variant:"slider"},reasonForSadness:{deps:["overallHappiness"],kind:"dynamic",render:n=>!n?.overallHappiness||n.overallHappiness>=5?null:{label:{en:"Reason for Sadness",fr:"Raison de la tristesse"},isRequired:!1,kind:"text",variant:"long"}}},details:{description:{en:"The Happiness Questionnaire is a questionnaire about happiness.",fr:"Le questionnaire sur le bonheur est un questionnaire sur le bonheur."},estimatedDuration:1,instructions:{en:["Please answer the question based on your current feelings."],fr:["Veuillez r\\xE9pondre \\xE0 la question en fonction de vos sentiments actuels."]},license:"AGPL-3.0",title:{en:"Happiness Questionnaire",fr:"Questionnaire sur le bonheur"}},measures:{overallHappiness:{kind:"const",ref:"overallHappiness"}}})})();\n', kind: 'FORM' }, - computedMeasures: { - overallHappiness: 9 - }, - __model__: 'InstrumentRecord' + instrumentId: '65e730e24344d866399e41e8', + subjectId: '19c68118c1f5e170001a1a87316621e0d28158e1adb7fc037ef491e9ad427214', + updatedAt: '2024-03-05T14:49:18.819Z' } ]); } diff --git a/packages/demo/package.json b/packages/demo/package.json index 999e29dbb..f988c0833 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -12,7 +12,7 @@ "lint": "tsc && eslint --fix src" }, "dependencies": { - "@douglasneuroinformatics/utils": "^1.2.2", + "@douglasneuroinformatics/libjs": "^0.0.1", "@open-data-capture/common": "workspace:*" } } diff --git a/packages/demo/src/index.ts b/packages/demo/src/index.ts index a0d45458f..3cca8105d 100644 --- a/packages/demo/src/index.ts +++ b/packages/demo/src/index.ts @@ -1,4 +1,4 @@ -import { deepFreeze } from '@douglasneuroinformatics/utils'; +import { deepFreeze } from '@douglasneuroinformatics/libjs'; import type { Group } from '@open-data-capture/common/group'; import type { User } from '@open-data-capture/common/user'; diff --git a/packages/esbuild-plugin-native-modules/package.json b/packages/esbuild-plugin-native-modules/package.json deleted file mode 100644 index d5bc49694..000000000 --- a/packages/esbuild-plugin-native-modules/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@open-data-capture/esbuild-plugin-native-modules", - "version": "0.0.0", - "license": "AGPL-3.0", - "type": "module", - "main": "./src/index.js", - "scripts": { - "format": "prettier --write src", - "lint": "eslint --fix src" - }, - "peerDependencies": { - "esbuild": "0.x" - } -} diff --git a/packages/esbuild-plugin-native-modules/src/index.js b/packages/esbuild-plugin-native-modules/src/index.js deleted file mode 100644 index 2daf32bb9..000000000 --- a/packages/esbuild-plugin-native-modules/src/index.js +++ /dev/null @@ -1,48 +0,0 @@ -import module from 'module'; - -/** - * Adds support to esbuild for loading native node modules - * - * This works by intercepting import paths for .node files in the "file" namespace - * and adding them to the 'node-file' namespace instead. - * - * @returns {import('esbuild').Plugin} - */ -export function nativeModulesPlugin() { - const require = module.createRequire(import.meta.url); - return { - name: 'native-modules', - setup(build) { - // If a ".node" file is imported within a module in the "file" namespace, resolve - // it to an absolute path and put it into the "node-file" virtual namespace. - build.onResolve({ filter: /\.node$/, namespace: 'file' }, (args) => ({ - namespace: 'node-file', - path: require.resolve(args.path, { paths: [args.resolveDir] }) - })); - - // Files in the "node-file" virtual namespace call "require()" on the - // path from esbuild of the ".node" file in the output directory. - build.onLoad({ filter: /.*/, namespace: 'node-file' }, (args) => ({ - contents: ` - import path from ${JSON.stringify(args.path)} - try { module.exports = require(path) } - catch {} - ` - })); - - // If a ".node" file is imported within a module in the "node-file" namespace, put - // it in the "file" namespace where esbuild's default loading behavior will handle - // it. It is already an absolute path since we resolved it to one above. - build.onResolve({ filter: /\.node$/, namespace: 'node-file' }, (args) => ({ - namespace: 'file', - path: args.path - })); - - // Tell esbuild's default loading behavior to use the "file" loader for - // these ".node" files. - let opts = build.initialOptions; - opts.loader = opts.loader || {}; - opts.loader['.node'] = 'file'; - } - }; -} diff --git a/packages/esbuild-plugin-prisma/package.json b/packages/esbuild-plugin-prisma/package.json deleted file mode 100644 index 2b3484377..000000000 --- a/packages/esbuild-plugin-prisma/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@open-data-capture/esbuild-plugin-prisma", - "version": "0.0.0", - "license": "AGPL-3.0", - "type": "module", - "main": "./src/index.js", - "scripts": { - "format": "prettier --write src", - "lint": "eslint --fix src" - }, - "dependencies": { - "@prisma/get-platform": "^5.11.0" - }, - "peerDependencies": { - "@prisma/client": "5.x", - "@prisma/engines": "5.x", - "esbuild": "0.x", - "prisma": "5.x" - } -} diff --git a/packages/esbuild-plugin-prisma/src/index.js b/packages/esbuild-plugin-prisma/src/index.js deleted file mode 100644 index d82a4889c..000000000 --- a/packages/esbuild-plugin-prisma/src/index.js +++ /dev/null @@ -1,33 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -/** - * Copy the Prisma query engine to the specified directory - * @param {Object} options - * @param {string} options.outdir - the location where the engine should be copied - * @returns {import('esbuild').Plugin} - */ -export function prismaPlugin(options) { - return { - name: 'prisma', - setup(build) { - build.onEnd(async () => { - const { getEnginesPath } = (await import('@prisma/engines')).default; - const { getBinaryTargetForCurrentPlatform } = (await import('@prisma/get-platform')).default; - - const binaryTarget = await getBinaryTargetForCurrentPlatform(); - const enginesDir = getEnginesPath(); - const engineFile = (await fs.promises.readdir(enginesDir)).find((filename) => { - return filename.startsWith(`libquery_engine-${binaryTarget}`) && filename.endsWith('.node'); - }); - if (!engineFile) { - throw new Error(`Failed to find prisma query engine '${engineFile}' in directory: ${enginesDir}`); - } - if (!fs.existsSync(options.outdir)) { - await fs.promises.mkdir(options.outdir, { recursive: true }); - } - await fs.promises.copyFile(path.join(enginesDir, engineFile), path.join(options.outdir, engineFile)); - }); - } - }; -} diff --git a/packages/instrument-renderer/package.json b/packages/instrument-renderer/package.json index f2266b9c2..5a8fced16 100644 --- a/packages/instrument-renderer/package.json +++ b/packages/instrument-renderer/package.json @@ -17,8 +17,8 @@ "storybook": "storybook dev -p 6006" }, "dependencies": { + "@douglasneuroinformatics/libjs": "^0.0.1", "@douglasneuroinformatics/ui": "^6.2.2", - "@douglasneuroinformatics/utils": "^1.2.2", "@headlessui/react": "^1.7.18", "@heroicons/react": "^2.1.1", "@open-data-capture/common": "workspace:*", diff --git a/packages/instrument-renderer/src/components/InstrumentSummary.tsx b/packages/instrument-renderer/src/components/InstrumentSummary.tsx index 0fb2aede4..0b032d8af 100644 --- a/packages/instrument-renderer/src/components/InstrumentSummary.tsx +++ b/packages/instrument-renderer/src/components/InstrumentSummary.tsx @@ -1,6 +1,6 @@ +import { toBasicISOString } from '@douglasneuroinformatics/libjs'; import { useDownload } from '@douglasneuroinformatics/ui/hooks'; import { Card } from '@douglasneuroinformatics/ui/legacy'; -import { toBasicISOString } from '@douglasneuroinformatics/utils'; import { ArrowDownTrayIcon, PrinterIcon } from '@heroicons/react/24/outline'; import { toLowerCase } from '@open-data-capture/common/core'; import type { InstrumentKind, SomeUnilingualInstrument } from '@open-data-capture/common/instrument'; diff --git a/packages/react-core/package.json b/packages/react-core/package.json index d87834ecf..0e4aae7ba 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -15,8 +15,8 @@ "storybook": "storybook dev -p 6006" }, "dependencies": { + "@douglasneuroinformatics/libjs": "^0.0.1", "@douglasneuroinformatics/ui": "^6.2.2", - "@douglasneuroinformatics/utils": "^1.2.2", "@heroicons/react": "^2.1.1", "@open-data-capture/i18next": "workspace:*", "react-i18next": "^14.1.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5e862862..2131b1468 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -154,12 +154,12 @@ importers: '@casl/prisma': specifier: ^1.4.1 version: 1.4.1(@casl/ability@6.7.0)(@prisma/client@5.11.0) + '@douglasneuroinformatics/libjs': + specifier: ^0.0.1 + version: 0.0.1(typescript@5.3.3) '@douglasneuroinformatics/nestjs': specifier: ^3.0.0 version: 3.0.0(@nestjs/common@10.3.3)(@nestjs/core@10.3.3)(@nestjs/platform-express@10.3.3)(@nestjs/testing@10.3.3)(express@4.18.3)(mongodb@6.5.0)(reflect-metadata@0.1.14)(rxjs@7.8.1) - '@douglasneuroinformatics/utils': - specifier: ^1.2.2 - version: 1.2.2 '@faker-js/faker': specifier: ^8.4.1 version: 8.4.1 @@ -254,15 +254,15 @@ importers: specifier: ^3.22.4 version: 3.22.4 devDependencies: + '@douglasneuroinformatics/esbuild-plugin-native-modules': + specifier: ^0.0.1 + version: 0.0.1(esbuild@0.20.1) + '@douglasneuroinformatics/esbuild-plugin-prisma': + specifier: ^0.0.1 + version: 0.0.1(@prisma/client@5.11.0)(@prisma/engines@5.11.0)(esbuild@0.20.1)(prisma@5.11.0) '@nestjs/testing': specifier: ^10.3.3 version: 10.3.3(@nestjs/common@10.3.3)(@nestjs/core@10.3.3)(@nestjs/platform-express@10.3.3) - '@open-data-capture/esbuild-plugin-native-modules': - specifier: workspace:* - version: link:../../packages/esbuild-plugin-native-modules - '@open-data-capture/esbuild-plugin-prisma': - specifier: workspace:* - version: link:../../packages/esbuild-plugin-prisma '@open-data-capture/esbuild-plugin-runtime': specifier: workspace:* version: link:../../packages/esbuild-plugin-runtime @@ -292,7 +292,7 @@ importers: version: 0.20.1 esbuild-plugin-tsc: specifier: ^0.4.0 - version: 0.4.0(typescript@5.4.2) + version: 0.4.0(typescript@5.3.3) nodemon: specifier: ^3.1.0 version: 3.1.0 @@ -363,12 +363,12 @@ importers: specifier: ^3.22.4 version: 3.22.4 devDependencies: - '@open-data-capture/esbuild-plugin-native-modules': - specifier: workspace:* - version: link:../../packages/esbuild-plugin-native-modules - '@open-data-capture/esbuild-plugin-prisma': - specifier: workspace:* - version: link:../../packages/esbuild-plugin-prisma + '@douglasneuroinformatics/esbuild-plugin-native-modules': + specifier: ^0.0.1 + version: 0.0.1(esbuild@0.20.1) + '@douglasneuroinformatics/esbuild-plugin-prisma': + specifier: ^0.0.1 + version: 0.0.1(@prisma/client@5.11.0)(@prisma/engines@5.11.0)(esbuild@0.20.1)(prisma@5.11.0) '@open-data-capture/tailwindcss': specifier: workspace:* version: link:../../packages/tailwindcss @@ -396,6 +396,9 @@ importers: autoprefixer: specifier: ^10.4.18 version: 10.4.18(postcss@8.4.35) + esbuild: + specifier: ^0.20.1 + version: 0.20.1 postcss: specifier: ^8.4.35 version: 8.4.35 @@ -426,7 +429,7 @@ importers: devDependencies: '@astrojs/check': specifier: ^0.5.8 - version: 0.5.8(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.4.2) + version: 0.5.8(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.3.3) '@astrojs/sitemap': specifier: ^3.1.1 version: 3.1.1 @@ -447,7 +450,7 @@ importers: version: 4.17.12 astro: specifier: ^4.5.2 - version: 4.5.2(@types/node@20.11.26)(typescript@5.4.2) + version: 4.5.2(@types/node@20.11.26)(typescript@5.3.3) sharp: specifier: ^0.33.2 version: 0.33.2 @@ -457,12 +460,12 @@ importers: apps/playground: dependencies: + '@douglasneuroinformatics/libjs': + specifier: ^0.0.1 + version: 0.0.1(typescript@5.3.3) '@douglasneuroinformatics/ui': specifier: ^6.2.2 version: 6.2.2(@headlessui/tailwindcss@0.2.0)(@tailwindcss/container-queries@0.1.1)(@types/react-dom@18.2.21)(@types/react@18.2.65)(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.4.1) - '@douglasneuroinformatics/utils': - specifier: ^1.2.2 - version: 1.2.2 '@headlessui/react': specifier: ^1.7.18 version: 1.7.18(react-dom@18.2.0)(react@18.2.0) @@ -581,6 +584,9 @@ importers: '@casl/ability': specifier: ^6.7.0 version: 6.7.0 + '@douglasneuroinformatics/libjs': + specifier: ^0.0.1 + version: 0.0.1(typescript@5.3.3) '@douglasneuroinformatics/ui': specifier: ^6.2.2 version: 6.2.2(@headlessui/tailwindcss@0.2.0)(@tailwindcss/container-queries@0.1.1)(@types/react-dom@18.2.21)(@types/react@18.2.65)(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.4.1) @@ -796,9 +802,9 @@ importers: packages/demo: dependencies: - '@douglasneuroinformatics/utils': - specifier: ^1.2.2 - version: 1.2.2 + '@douglasneuroinformatics/libjs': + specifier: ^0.0.1 + version: 0.0.1(typescript@5.3.3) '@open-data-capture/common': specifier: workspace:* version: link:../common @@ -864,30 +870,6 @@ importers: specifier: ^5.1.6 version: 5.1.6(@types/node@20.11.26) - packages/esbuild-plugin-native-modules: - dependencies: - esbuild: - specifier: 0.x - version: 0.20.1 - - packages/esbuild-plugin-prisma: - dependencies: - '@prisma/client': - specifier: 5.x - version: 5.11.0(prisma@5.11.0) - '@prisma/engines': - specifier: 5.x - version: 5.11.0 - '@prisma/get-platform': - specifier: ^5.11.0 - version: 5.11.0 - esbuild: - specifier: 0.x - version: 0.20.1 - prisma: - specifier: 5.x - version: 5.11.0 - packages/esbuild-plugin-runtime: dependencies: '@open-data-capture/runtime-resolve': @@ -961,12 +943,12 @@ importers: packages/instrument-renderer: dependencies: + '@douglasneuroinformatics/libjs': + specifier: ^0.0.1 + version: 0.0.1(typescript@5.3.3) '@douglasneuroinformatics/ui': specifier: ^6.2.2 version: 6.2.2(@headlessui/tailwindcss@0.2.0)(@tailwindcss/container-queries@0.1.1)(@types/react-dom@18.2.21)(@types/react@18.2.65)(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.4.1) - '@douglasneuroinformatics/utils': - specifier: ^1.2.2 - version: 1.2.2 '@headlessui/react': specifier: ^1.7.18 version: 1.7.18(react-dom@18.2.0)(react@18.2.0) @@ -1085,12 +1067,12 @@ importers: packages/react-core: dependencies: + '@douglasneuroinformatics/libjs': + specifier: ^0.0.1 + version: 0.0.1(typescript@5.3.3) '@douglasneuroinformatics/ui': specifier: ^6.2.2 version: 6.2.2(@headlessui/tailwindcss@0.2.0)(@tailwindcss/container-queries@0.1.1)(@types/react-dom@18.2.21)(@types/react@18.2.65)(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.4.1) - '@douglasneuroinformatics/utils': - specifier: ^1.2.2 - version: 1.2.2 '@heroicons/react': specifier: ^2.1.1 version: 2.1.1(react@18.2.0) @@ -1227,7 +1209,7 @@ importers: version: 0.4.4(rollup@4.13.0) '@rollup/plugin-typescript': specifier: ^11.1.6 - version: 11.1.6(rollup@4.13.0)(typescript@5.4.2) + version: 11.1.6(rollup@4.13.0)(typescript@5.3.3) '@types/react': specifier: ^18.2.65 version: 18.2.65 @@ -1248,7 +1230,7 @@ importers: version: 4.13.0 rollup-plugin-dts: specifier: ^6.1.0 - version: 6.1.0(rollup@4.13.0)(typescript@5.4.2) + version: 6.1.0(rollup@4.13.0)(typescript@5.3.3) zod: specifier: ^3.22.4 version: 3.22.4 @@ -1334,18 +1316,18 @@ packages: is-potential-custom-element-name: 1.0.1 dev: true - /@astrojs/check@0.5.8(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.4.2): + /@astrojs/check@0.5.8(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.3.3): resolution: { integrity: sha512-O3lPUIwhlRtya8KcUDfB0+vBPgj/qVoNvTUhYTTDx0uEsHBbssO5RSFezw6KVBxps6zIR8+YAyOoRKPBhMB7KQ== } hasBin: true peerDependencies: typescript: ^5.0.0 dependencies: - '@astrojs/language-server': 2.8.0(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.4.2) + '@astrojs/language-server': 2.8.0(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.3.3) chokidar: 3.6.0 fast-glob: 3.3.2 kleur: 4.1.5 - typescript: 5.4.2 + typescript: 5.3.3 yargs: 17.7.2 transitivePeerDependencies: - prettier @@ -1367,7 +1349,7 @@ packages: { integrity: sha512-tGmHvrhpzuz0JBHaJX8GywN9g4rldVNHtkoVDC3m/DdzBO70jGoVuc0uuNVglRYnsdwkbG0K02Iw3nOOR3/Y4g== } dev: true - /@astrojs/language-server@2.8.0(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.4.2): + /@astrojs/language-server@2.8.0(prettier-plugin-astro@0.12.3)(prettier@3.2.5)(typescript@5.3.3): resolution: { integrity: sha512-WFRwvsWNCQ2I+DEJzRkF/uX0LeJN/oGabr0hnwec8alQzHbzyoqogHmE+i+cU8Mb34ouwsLXa/LlqjEqFbkSZw== } hasBin: true @@ -1382,7 +1364,7 @@ packages: dependencies: '@astrojs/compiler': 2.7.0 '@jridgewell/sourcemap-codec': 1.4.15 - '@volar/kit': 2.1.2(typescript@5.4.2) + '@volar/kit': 2.1.2(typescript@5.3.3) '@volar/language-core': 2.1.2 '@volar/language-server': 2.1.2 '@volar/language-service': 2.1.2 @@ -1438,7 +1420,7 @@ packages: '@astrojs/markdown-remark': 4.3.0 '@mdx-js/mdx': 3.0.1 acorn: 8.11.3 - astro: 4.5.2(@types/node@20.11.26)(typescript@5.4.2) + astro: 4.5.2(@types/node@20.11.26)(typescript@5.3.3) es-module-lexer: 1.4.1 estree-util-visit: 2.0.0 github-slugger: 2.0.0 @@ -1482,7 +1464,7 @@ packages: '@pagefind/default-ui': 1.0.4 '@types/hast': 3.0.4 '@types/mdast': 4.0.3 - astro: 4.5.2(@types/node@20.11.26)(typescript@5.4.2) + astro: 4.5.2(@types/node@20.11.26)(typescript@5.3.3) astro-expressive-code: 0.32.4(astro@4.5.2) bcp-47: 2.1.0 hast-util-select: 6.0.2 @@ -1507,7 +1489,7 @@ packages: astro: ^3.0.0 || ^4.0.0 tailwindcss: ^3.0.24 dependencies: - astro: 4.5.2(@types/node@20.11.26)(typescript@5.4.2) + astro: 4.5.2(@types/node@20.11.26)(typescript@5.3.3) autoprefixer: 10.4.18(postcss@8.4.35) postcss: 8.4.35 postcss-load-config: 4.0.2(postcss@8.4.35) @@ -3063,6 +3045,31 @@ packages: engines: { node: '>=10.0.0' } dev: true + /@douglasneuroinformatics/esbuild-plugin-native-modules@0.0.1(esbuild@0.20.1): + resolution: + { integrity: sha512-xWOcxPi+secE/RN7yJKyty4GRKxixsUiVj43DoLxaGyEqy2rbAsbiK8UHfMJ21us6QwvLOQLgxpuoxzqzfVcsg== } + peerDependencies: + esbuild: 0.x + dependencies: + esbuild: 0.20.1 + dev: true + + /@douglasneuroinformatics/esbuild-plugin-prisma@0.0.1(@prisma/client@5.11.0)(@prisma/engines@5.11.0)(esbuild@0.20.1)(prisma@5.11.0): + resolution: + { integrity: sha512-DsLOAS4h03jFB/3muCxvD0EfTugBc4oOfYjY9CipJ5yIUsBPBVk5IkG0FEZERQr/qO9cg6djxMAkNDuH/y5wXg== } + peerDependencies: + '@prisma/client': 5.x + '@prisma/engines': 5.x + esbuild: 0.x + prisma: 5.x + dependencies: + '@prisma/client': 5.11.0(prisma@5.11.0) + '@prisma/engines': 5.11.0 + '@prisma/get-platform': 5.11.0 + esbuild: 0.20.1 + prisma: 5.11.0 + dev: true + /@douglasneuroinformatics/eslint-config@3.0.3(eslint@8.57.0)(typescript@5.3.3): resolution: { integrity: sha512-bfx27Hb4iaASnIEYgExp84+5DhYVHPFntkY4MtuPS/skKHS9voJijpIXTeUMQeEywCua2PmnFFnXz7xpNgcpXQ== } @@ -3089,9 +3096,20 @@ packages: dependencies: type-fest: 4.12.0 + /@douglasneuroinformatics/libjs@0.0.1(typescript@5.3.3): + resolution: + { integrity: sha512-Tu9cbmkD95dsGj8vY+TO5Tnh3o2VUEG7iHNaM3nrJF2UsomYEvXI/zUoopLs/VGmjA3VUyj1ycFgsjsmS0/tTw== } + peerDependencies: + typescript: ^5.1.0 + dependencies: + type-fest: 4.12.0 + typescript: 5.3.3 + dev: false + /@douglasneuroinformatics/nestjs@3.0.0(@nestjs/common@10.3.3)(@nestjs/core@10.3.3)(@nestjs/platform-express@10.3.3)(@nestjs/testing@10.3.3)(express@4.18.3)(mongodb@6.5.0)(reflect-metadata@0.1.14)(rxjs@7.8.1): resolution: { integrity: sha512-XLTNc0QK4ND+by/8vR9XL2uUHZ+eL9vy/pGf/OAk4DB0CRJkgo3C8aLqqWFJinAv/JyLHxhj3NOCju6Gf8ci0w== } + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. peerDependencies: '@nestjs/common': ^10.2.3 '@nestjs/core': ^10.2.3 @@ -3122,6 +3140,7 @@ packages: /@douglasneuroinformatics/ui@6.2.2(@headlessui/tailwindcss@0.2.0)(@tailwindcss/container-queries@0.1.1)(@types/react-dom@18.2.21)(@types/react@18.2.65)(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.4.1): resolution: { integrity: sha512-ZlMdUAfApeFg60GC8UAJkxg+izFI98ntNAGLRdNRV4kPKp1LKMUQml0BV7l9mNx5RYmonGrxlCTlTfZ8tW4wJw== } + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. peerDependencies: '@headlessui/tailwindcss': ^0.2.0 '@tailwindcss/container-queries': ^0.1.1 @@ -6146,7 +6165,7 @@ packages: terser: 5.29.1 dev: true - /@rollup/plugin-typescript@11.1.6(rollup@4.13.0)(typescript@5.4.2): + /@rollup/plugin-typescript@11.1.6(rollup@4.13.0)(typescript@5.3.3): resolution: { integrity: sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA== } engines: { node: '>=14.0.0' } @@ -6163,7 +6182,7 @@ packages: '@rollup/pluginutils': 5.1.0(rollup@4.13.0) resolve: 1.22.8 rollup: 4.13.0 - typescript: 5.4.2 + typescript: 5.3.3 dev: true /@rollup/pluginutils@5.1.0(rollup@4.13.0): @@ -7988,7 +8007,7 @@ packages: resolution: { integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A== } dependencies: - '@types/node': 17.0.45 + '@types/node': 20.11.26 dev: true /@types/scheduler@0.16.8: @@ -8443,7 +8462,7 @@ packages: pretty-format: 29.7.0 dev: true - /@volar/kit@2.1.2(typescript@5.4.2): + /@volar/kit@2.1.2(typescript@5.3.3): resolution: { integrity: sha512-u20R1lCWCgFYBCHC+FR/e9J+P61vUNQpyWt4keAY+zpVHEHsSXVA2xWMJV1l1Iq5Dd0jBUSqrb1zsEya455AzA== } peerDependencies: @@ -8452,7 +8471,7 @@ packages: '@volar/language-service': 2.1.2 '@volar/typescript': 2.1.2 typesafe-path: 0.2.2 - typescript: 5.4.2 + typescript: 5.3.3 vscode-languageserver-textdocument: 1.0.11 vscode-uri: 3.0.8 dev: true @@ -8597,7 +8616,7 @@ packages: geckodriver: 4.3.3 get-port: 7.0.0 import-meta-resolve: 4.0.0 - locate-app: 2.2.23 + locate-app: 2.2.24 safaridriver: 0.1.2 split2: 4.2.0 wait-port: 1.1.0 @@ -9120,12 +9139,12 @@ packages: peerDependencies: astro: ^3.3.0 || ^4.0.0-beta dependencies: - astro: 4.5.2(@types/node@20.11.26)(typescript@5.4.2) + astro: 4.5.2(@types/node@20.11.26)(typescript@5.3.3) hast-util-to-html: 8.0.4 remark-expressive-code: 0.32.4 dev: true - /astro@4.5.2(@types/node@20.11.26)(typescript@5.4.2): + /astro@4.5.2(@types/node@20.11.26)(typescript@5.3.3): resolution: { integrity: sha512-Nq3GojlwXJ3XD047khraCWu/6aqGFfcyq7Q0blpTBSZnCz2s4Zri04PHvUkbKF7TK2UljkFuTXKP0CE4ZuJi9Q== } engines: { node: '>=18.14.1', npm: '>=6.14.0' } @@ -9186,7 +9205,7 @@ packages: shiki: 1.1.7 string-width: 7.1.0 strip-ansi: 7.1.0 - tsconfck: 3.0.3(typescript@5.4.2) + tsconfck: 3.0.3(typescript@5.3.3) unist-util-visit: 5.0.0 vfile: 6.0.1 vite: 5.1.6(@types/node@20.11.26) @@ -9326,7 +9345,6 @@ packages: /b4a@1.6.6: resolution: { integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg== } - requiresBuild: true dev: true /babel-core@7.0.0-bridge.0(@babel/core@7.24.0): @@ -11479,14 +11497,14 @@ packages: { integrity: sha512-jyfL/pwPqaFXyKnj8lP8iLk6Z0m099uXR45aSN8Av1XD4vhvQutxxPzgA2bTcAwQpa1zCXDcWOlhFgyP3GKqhQ== } dev: true - /esbuild-plugin-tsc@0.4.0(typescript@5.4.2): + /esbuild-plugin-tsc@0.4.0(typescript@5.3.3): resolution: { integrity: sha512-q9gWIovt1nkwchMLc2zhyksaiHOv3kDK4b0AUol8lkMCRhJ1zavgfb2fad6BKp7FT9rh/OHmEBXVjczLoi/0yw== } peerDependencies: typescript: ^4.0.0 || ^5.0.0 dependencies: strip-comments: 2.0.1 - typescript: 5.4.2 + typescript: 5.3.3 dev: true /esbuild-register@3.5.0(esbuild@0.18.20): @@ -12232,7 +12250,6 @@ packages: /fast-fifo@1.3.2: resolution: { integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== } - requiresBuild: true dev: true /fast-glob@3.3.2: @@ -14541,7 +14558,6 @@ packages: /jsbn@1.1.0: resolution: { integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== } - requiresBuild: true /jscodeshift@0.15.2(@babel/preset-env@7.24.0): resolution: @@ -14911,11 +14927,11 @@ packages: pkg-types: 1.0.3 dev: true - /locate-app@2.2.23: + /locate-app@2.2.24: resolution: - { integrity: sha512-lzrYJYveAd5BG5utKSSDhDGQsAk6+2y8kORpM7Es+qDNDYMwWDt+Sex2yZkmkhG39An42jsc/Mi1AljOZumvdQ== } + { integrity: sha512-vdoBy+xJYzEw+AIZkSW1SYEuWvZOMyhIW1dMIdD+MJP6K7DHfxJcCxktDbIS0aBtPyL2MkqiEa+GoDUz47zTlg== } dependencies: - n12: 1.8.26 + n12: 1.8.27 type-fest: 2.13.0 userhome: 1.0.0 dev: true @@ -16284,9 +16300,9 @@ packages: object-assign: 4.1.1 thenify-all: 1.6.0 - /n12@1.8.26: + /n12@1.8.27: resolution: - { integrity: sha512-BUTP59AmN33pLdGLkKphoxhXD8eLi3YCCuEmUXiIPGdmujKEJmyG1T3WL4N7RPr3+t4FdTeGLyejBq/WL0sCWw== } + { integrity: sha512-mYeuH53HBGNBjWaFAaJ9+OTzJIVu4ViyC4aleux7RdkPChUj9jTfnO070FAj3PwsY4/Wlj2vAZ1WITXXG0SAmQ== } dev: true /nanoid@3.3.7: @@ -17795,7 +17811,6 @@ packages: /queue-tick@1.0.1: resolution: { integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag== } - requiresBuild: true dev: true /quick-format-unescaped@4.0.4: @@ -18695,7 +18710,7 @@ packages: is-plain-object: 3.0.1 dev: true - /rollup-plugin-dts@6.1.0(rollup@4.13.0)(typescript@5.4.2): + /rollup-plugin-dts@6.1.0(rollup@4.13.0)(typescript@5.3.3): resolution: { integrity: sha512-ijSCPICkRMDKDLBK9torss07+8dl9UpY9z1N/zTeA1cIqdzMlpkV3MOOC7zukyvQfDyxa1s3Dl2+DeiP/G6DOw== } engines: { node: '>=16' } @@ -18705,7 +18720,7 @@ packages: dependencies: magic-string: 0.30.8 rollup: 4.13.0 - typescript: 5.4.2 + typescript: 5.3.3 optionalDependencies: '@babel/code-frame': 7.23.5 dev: true @@ -19121,7 +19136,6 @@ packages: /simple-concat@1.0.1: resolution: { integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== } - requiresBuild: true /simple-get@4.0.1: resolution: @@ -19368,7 +19382,6 @@ packages: /sprintf-js@1.1.3: resolution: { integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== } - requiresBuild: true /sqlite3@5.1.7: resolution: @@ -19534,7 +19547,6 @@ packages: /streamx@2.16.1: resolution: { integrity: sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ== } - requiresBuild: true dependencies: fast-fifo: 1.3.2 queue-tick: 1.0.1 @@ -20256,7 +20268,7 @@ packages: { integrity: sha512-aafbuAQOTEeWmA7wtcL94w6I89EgLD7F+IlWkr596wYxeb0oveWDO5dQpv85YP0CGbxXT/qXBIeV6IYLcoZ2uA== } dev: false - /tsconfck@3.0.3(typescript@5.4.2): + /tsconfck@3.0.3(typescript@5.3.3): resolution: { integrity: sha512-4t0noZX9t6GcPTfBAbIbbIU4pfpCwh0ueq3S4O/5qXI1VwK1outmxhe9dOiEWqMz3MW2LKgDTpqWV+37IWuVbA== } engines: { node: ^18 || >=20 } @@ -20267,7 +20279,7 @@ packages: typescript: optional: true dependencies: - typescript: 5.4.2 + typescript: 5.3.3 dev: true /tslib@1.14.1: @@ -20519,14 +20531,6 @@ packages: { integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== } engines: { node: '>=14.17' } hasBin: true - dev: true - - /typescript@5.4.2: - resolution: - { integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ== } - engines: { node: '>=14.17' } - hasBin: true - dev: true /ufo@1.4.0: resolution: @@ -22042,6 +22046,7 @@ packages: name: github-script version: 7.0.1 engines: { node: '>=20.0.0 <21.0.0' } + prepare: true requiresBuild: true dependencies: '@actions/core': 1.10.1