Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-morph should be added as a direct dependency #153

Open
martin-juul opened this issue Sep 28, 2024 · 0 comments
Open

ts-morph should be added as a direct dependency #153

martin-juul opened this issue Sep 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@martin-juul
Copy link

Describe the bug
If the package is added as a dependency of a project without ts-morph, it is not possible to run the tool.

yarn generate-api-client     
yarn run v1.22.22
$ openapi-rq -i ./api.json -c axios --initialPageParam=1 --nextPageParam=nextPage -o resources/app/api-client
node:internal/modules/esm/resolve:839
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'ts-morph' imported from /home/martin/dev/baander/node_modules/@7nohe/openapi-react-query-codegen/dist/createSource.mjs
    at packageResolve (node:internal/modules/esm/resolve:839:9)
    at moduleResolve (node:internal/modules/esm/resolve:908:18)
    at defaultResolve (node:internal/modules/esm/resolve:1038:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:554:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:523:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

To Reproduce
node.js v22.7.0
yarn v1.22.22

Install the package as a dev dependency

Add a script to generate a client:

    "scripts": {
        "clean": "rimraf public/build",
        "build": "yarn clean && tsc && vite build",
        "dev": "yarn clean && vite",
        "generate-api-client": "openapi-rq -i ./api.json -c axios --initialPageParam=1 --nextPageParam=nextPage -o resources/app/api-client"
    },

Without ts-morph added as a devDependency i get the above error.

OpenAPI spec file

{"openapi":"3.1.0","info":{"title":"B\u00e5nder api docs","version":"0.0.1","description":"B\u00e5nder.App is a sophisticated media server developed with the primary goal to deliver high performance and seamless experience for users.\nBeing built on top of Laravel framework and PostgreSQL for database, it leverages the power of robust backend technologies, providing high security, reliability, and scalability.\n\nThe main focus of B\u00e5nder.App is efficient media management and delivery.\nThis application is designed to handle large amounts of media files while ensuring quick and efficient access.\nImplemented queuing functionality through Redis offers efficient job management and load handling.\nThe media information is organized and easily searchable, ensuring users can always find what they are looking for quickly and easily."},"servers":[{"url":"https:\/\/baander.test\/api"}],"security":[{"http":[]}],"paths":{"\/libraries\/{library}\/albums":{"get":{"operationId":"albums.index","summary":"Get a collection of albums","tags":["Album"],"parameters":[{"name":"library","in":"path","required":true,"description":"The library slug","schema":{"type":"string"}},{"name":"fields","in":"query","description":"Comma seperated string of fields you want to select. If nothing is defined `select *` is default.\n- title\n- slug\n- year\n- directory","schema":{"type":"string"}},{"name":"relations","in":"query","description":"Comma seperated string of relations\n- albumArist\n- cover\n- library\n- songs","schema":{"type":"string"}},{"name":"page","in":"query","description":"Current page","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"Items per page","schema":{"type":"integer"}},{"name":"genres","in":"query","description":"_Extension_ Comma seperated list of genres","schema":{"type":"string"}}],"responses":{"200":{"description":"Json paginated set of `AlbumResourceResource`","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/AlbumResourceResource"}},"total":{"type":"integer","description":"Total number of items being paginated."},"count":{"type":"integer","description":"The number of items for the current page"},"limit":{"type":"integer","description":"The number of items per page"},"currentPage":{"type":"integer","description":"The number of current page"},"nextPage":{"type":"integer","description":"The number of next page"},"lastPage":{"type":"integer","description":"The number of last page"}},"required":["data","total","count","limit","currentPage","nextPage","lastPage"]}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/libraries\/{library}\/albums\/{album}":{"get":{"operationId":"albums.show","summary":"Get an album","tags":["Album"],"parameters":[{"name":"library","in":"path","required":true,"description":"The library slug","schema":{"type":"string"}},{"name":"album","in":"path","required":true,"description":"The album slug","schema":{"type":"string"}}],"responses":{"200":{"description":"`AlbumResourceResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AlbumResourceResource"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/libraries\/{library}\/artists":{"get":{"operationId":"artists.index","summary":"Get a collection of artists","tags":["Artist"],"parameters":[{"name":"library","in":"path","required":true,"schema":{"type":"string"}},{"name":"fields","in":"query","description":"Comma seperated string of fields you want to select. If nothing is defined `select *` is default.\n- title\n- slug","schema":{"type":"string"}},{"name":"relations","in":"query","description":"Comma seperated string of relations\n- portrait\n- songs","schema":{"type":"string"}},{"name":"page","in":"query","description":"Current page","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"Items per page","schema":{"type":"integer"}},{"name":"genres","in":"query","description":"_Extension_ Comma seperated list of genres","schema":{"type":"string"}}],"responses":{"200":{"description":"Json paginated set of `ArtistResource`","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/ArtistResource"}},"total":{"type":"integer","description":"Total number of items being paginated."},"count":{"type":"integer","description":"The number of items for the current page"},"limit":{"type":"integer","description":"The number of items per page"},"currentPage":{"type":"integer","description":"The number of current page"},"nextPage":{"type":"integer","description":"The number of next page"},"lastPage":{"type":"integer","description":"The number of last page"}},"required":["data","total","count","limit","currentPage","nextPage","lastPage"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/libraries\/{library}\/artists\/{artist}":{"get":{"operationId":"artists.show","summary":"Get an artist","tags":["Artist"],"parameters":[{"name":"library","in":"path","required":true,"schema":{"type":"string"}},{"name":"artist","in":"path","required":true,"description":"The artist slug","schema":{"type":"string"}}],"responses":{"200":{"description":"`ArtistResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ArtistResource"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/auth\/login":{"post":{"operationId":"auth.login","summary":"Login","tags":["Auth"],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/LoginRequest"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"accessToken":{"$ref":"#\/components\/schemas\/NewAccessTokenResource"},"refreshToken":{"$ref":"#\/components\/schemas\/NewAccessTokenResource"}},"required":["accessToken","refreshToken"]}}}},"401":{"description":"An error","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview.","example":"Invalid credentials."}},"required":["message"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}},"security":[{}]}},"\/auth\/refreshToken":{"post":{"operationId":"auth.refreshToken","description":"Needs refresh token with ability \"issue-access-token\"","summary":"Refresh token","tags":["Auth"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"accessToken":{"$ref":"#\/components\/schemas\/NewAccessTokenResource"}},"required":["accessToken"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/auth\/streamToken":{"post":{"operationId":"auth.streamToken","description":"Needs refresh token with ability \"issue-access-token\"","summary":"Get a stream token","tags":["Auth"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"streamToken":{"$ref":"#\/components\/schemas\/NewAccessTokenResource"}},"required":["streamToken"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/auth\/register":{"post":{"operationId":"auth.register","summary":"Register","tags":["Auth"],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RegisterRequest"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"accessToken":{"$ref":"#\/components\/schemas\/NewAccessTokenResource"},"refreshToken":{"$ref":"#\/components\/schemas\/NewAccessTokenResource"}},"required":["accessToken","refreshToken"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}},"security":[{}]}},"\/auth\/forgotPassword":{"post":{"operationId":"auth.forgotPassword","summary":"Request reset password link","tags":["Auth"],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ForgotPasswordRequest"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}},"security":[{}]}},"\/auth\/resetPassword":{"post":{"operationId":"auth.resetPassword","summary":"Reset password","tags":["Auth"],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ResetPasswordRequest"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Password reset successfully."}},"required":["message"]}}}},"400":{"description":"An error","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview.","example":"Provided invalid token."}},"required":["message"]}}}},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}},"security":[{}]}},"\/auth\/verify\/:id\/:hash":{"post":{"operationId":"auth.verify","summary":"Verify email","tags":["Auth"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"`UserResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UserResource"}}}},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}},"security":[{}]}},"\/genres":{"get":{"operationId":"genres.index","summary":"Get a collection of genres","tags":["Genre"],"parameters":[{"name":"fields","in":"query","description":"Comma seperated string of fields you want to select. If nothing is defined `select *` is default.\n- name\n- slug","schema":{"type":"string"}},{"name":"relations","in":"query","description":"Comma seperated string of relations\n- songs","schema":{"type":"string"}},{"name":"librarySlug","in":"query","description":"Constrain the query to only fetch genres that are contained within the given library","schema":{"type":"string"}},{"name":"page","in":"query","description":"Current page","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"Items per page","schema":{"type":"integer"}}],"responses":{"200":{"description":"Json paginated set of `GenreResource`","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/GenreResource"}},"total":{"type":"integer","description":"Total number of items being paginated."},"count":{"type":"integer","description":"The number of items for the current page"},"limit":{"type":"integer","description":"The number of items per page"},"currentPage":{"type":"integer","description":"The number of current page"},"nextPage":{"type":"integer","description":"The number of next page"},"lastPage":{"type":"integer","description":"The number of last page"}},"required":["data","total","count","limit","currentPage","nextPage","lastPage"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/genres\/{genre}":{"get":{"operationId":"genres.show","summary":"Get a genre","tags":["Genre"],"parameters":[{"name":"genre","in":"path","required":true,"description":"The genre slug","schema":{"type":"string"}}],"responses":{"200":{"description":"`GenreResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GenreResource"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"patch":{"operationId":"genres.update","summary":"Update a genre","tags":["Genre"],"parameters":[{"name":"genre","in":"path","required":true,"description":"The genre slug","schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateGenreRequest"}}}},"responses":{"200":{"description":"`GenreResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/GenreResource"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}},"delete":{"operationId":"genres.destroy","summary":"Delete a genre","tags":["Genre"],"parameters":[{"name":"genre","in":"path","required":true,"description":"The genre slug","schema":{"type":"string"}}],"responses":{"204":{"description":"No content","content":{"application\/json":{"schema":{"type":"null"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/images\/{image}":{"get":{"operationId":"image.serve","summary":"Get an image asset","tags":["Image"],"parameters":[{"name":"image","in":"path","required":true,"description":"The image public id","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"string"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"}},"security":[{}]}},"\/jobs\/scanLibrary\/{slug}":{"post":{"operationId":"job.library-scan","summary":"Scan a library","tags":["Job"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Job started successfully"}},"required":["message"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/libraries":{"get":{"operationId":"libraries.index","summary":"Get a collection of media libraries","tags":["Library"],"parameters":[{"name":"page","in":"query","description":"Current page","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"Items per page","schema":{"type":"integer"}}],"responses":{"200":{"description":"Json paginated set of `LibraryResource`","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/LibraryResource"}},"total":{"type":"integer","description":"Total number of items being paginated."},"count":{"type":"integer","description":"The number of items for the current page"},"limit":{"type":"integer","description":"The number of items per page"},"currentPage":{"type":"integer","description":"The number of current page"},"nextPage":{"type":"integer","description":"The number of next page"},"lastPage":{"type":"integer","description":"The number of last page"}},"required":["data","total","count","limit","currentPage","nextPage","lastPage"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}},"post":{"operationId":"library.create","summary":"Create a library","tags":["Library"],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateLibraryRequest"}}}},"responses":{"200":{"description":"`LibraryResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/LibraryResource"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/libraries\/:slug":{"patch":{"operationId":"library.update","summary":"Update a library specified by the provided slug","tags":["Library"],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateLibraryRequest"}}}},"responses":{"200":{"description":"`LibraryResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/LibraryResource"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}},"delete":{"operationId":"library.delete","summary":"Delete a library","tags":["Library"],"responses":{"204":{"description":"No content","content":{"application\/json":{"schema":{"type":"null"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/opcache\/status":{"get":{"operationId":"opCache.getStatus","summary":"Get status","tags":["OpCache"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"opcache_enabled":{"type":"boolean"},"file_cache":{"type":"string"},"file_cache_only":{"type":"boolean"},"cache_full":{"type":"boolean"},"restart_pending":{"type":"boolean"},"":{"type":"object"},"memory_usage":{"type":"object","properties":{"used_memory":{"type":"integer"},"free_memory":{"type":"integer"},"wasted_memory":{"type":"integer"},"current_wasted_percentage":{"type":"number"}},"required":["used_memory","free_memory","wasted_memory","current_wasted_percentage"]},"interned_strings_usage":{"type":"object","properties":{"buffer_size":{"type":"integer"},"used_memory":{"type":"integer"},"free_memory":{"type":"integer"},"number_of_strings":{"type":"integer"}},"required":["buffer_size","used_memory","free_memory","number_of_strings"]},"opcache_statistics":{"type":"object","properties":{"num_cached_scripts":{"type":"integer"},"num_cached_keys":{"type":"integer"},"max_cached_keys":{"type":"integer"},"hits":{"type":"integer"},"start_time":{"type":"integer"},"last_restart_time":{"type":"integer"},"oom_restarts":{"type":"integer"},"hash_restarts":{"type":"integer"},"manual_restarts":{"type":"integer"},"misses":{"type":"integer"},"blacklist_misses":{"type":"integer"},"blacklist_miss_ratio":{"type":"integer"},"opcache_hit_rate":{"type":"number"}},"required":["num_cached_scripts","num_cached_keys","max_cached_keys","hits","start_time","last_restart_time","oom_restarts","hash_restarts","manual_restarts","misses","blacklist_misses","blacklist_miss_ratio","opcache_hit_rate"]},"jit":{"type":"object","properties":{"enabled":{"type":"boolean"},"on":{"type":"boolean"},"kind":{"type":"integer"},"opt_level":{"type":"integer"},"opt_flags":{"type":"integer"},"buffer_size":{"type":"integer"},"buffer_free":{"type":"integer"}},"required":["enabled","on","kind","opt_level","opt_flags","buffer_size","buffer_free"]}},"required":["opcache_enabled","file_cache","file_cache_only","cache_full","restart_pending",null,"memory_usage","interned_strings_usage","opcache_statistics","jit"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/opcache\/config":{"get":{"operationId":"opcache.getConfig","summary":"Get config","tags":["OpCache"],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"directives":{"type":"object","properties":{"property":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"string"}]}},"required":["property"]},"version":{"type":"object","properties":{"version":{"type":"string"},"opcache_product_name":{"type":"string"}},"required":["version","opcache_product_name"]},"blacklist":{"type":"array","items":{"type":"string"}}},"required":["directives","version","blacklist"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/opcache\/clear":{"post":{"operationId":"opcache.clear","summary":"Clear","tags":["OpCache"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/opcache\/compile":{"post":{"operationId":"opcache.compile","summary":"Compile cache","tags":["OpCache"],"parameters":[{"name":"force","in":"query","schema":{"type":"string"}}],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object","properties":{"totalFiles":{"type":"integer"},"compiled":{"type":"integer"}},"required":["totalFiles","compiled"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/libraries\/{library}\/songs":{"get":{"operationId":"songs.index","summary":"Get a collection of songs","tags":["Song"],"parameters":[{"name":"library","in":"path","required":true,"description":"The library slug","schema":{"type":"string"}},{"name":"page","in":"query","description":"Current page","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"Items per page","schema":{"type":"integer"}},{"name":"genreNames","in":"query","description":"Comma seperated list of genre names You can only search for names or slugs. Not both.","schema":{"type":"string"}},{"name":"genreSlugs","in":"query","description":"Comma seperated list of genre slugs","schema":{"type":"string"}},{"name":"relations","in":"query","description":"Comma seperated string of relations\n- album\n- artists\n- album.albumArtist\n- genres","schema":{"type":"string"}}],"responses":{"200":{"description":"Json paginated set of `SongResource`","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/SongResource"}},"total":{"type":"integer","description":"Total number of items being paginated."},"count":{"type":"integer","description":"The number of items for the current page"},"limit":{"type":"integer","description":"The number of items per page"},"currentPage":{"type":"integer","description":"The number of current page"},"nextPage":{"type":"integer","description":"The number of next page"},"lastPage":{"type":"integer","description":"The number of last page"}},"required":["data","total","count","limit","currentPage","nextPage","lastPage"]}}}},"400":{"description":"An error","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview.","example":"You cannot search for genre names and slugs at the same time"}},"required":["message"]}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/libraries\/{library}\/songs\/{publicId}":{"get":{"operationId":"songs.show","summary":"Get a song by public id","tags":["Song"],"parameters":[{"name":"library","in":"path","required":true,"description":"The library slug","schema":{"type":"string"}},{"name":"publicId","in":"path","required":true,"schema":{"type":"string"}},{"name":"relations","in":"query","description":"Comma seperated string of relations\n- album\n- artists\n- albumArtist\n- genres","schema":{"type":"string"}}],"responses":{"200":{"description":"`SongResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SongResource"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/libraries\/{library}\/songs\/stream\/song\/{song}\/direct":{"get":{"operationId":"songs.stream","description":"Requires token with \"access-stream\"","summary":"Direct stream the song","tags":["Song"],"parameters":[{"name":"library","in":"path","required":true,"description":"The library slug","schema":{"type":"string"}},{"name":"song","in":"path","required":true,"description":"The song public id","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application\/json":{"schema":{"type":"object"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/users":{"get":{"operationId":"users.index","summary":"Get a collection of users","tags":["User"],"responses":{"200":{"description":"Json paginated set of `UserResource`","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/UserResource"}},"total":{"type":"integer","description":"Total number of items being paginated."},"count":{"type":"integer","description":"The number of items for the current page"},"limit":{"type":"integer","description":"The number of items per page"},"currentPage":{"type":"integer","description":"The number of current page"},"nextPage":{"type":"integer","description":"The number of next page"},"lastPage":{"type":"integer","description":"The number of last page"}},"required":["data","total","count","limit","currentPage","nextPage","lastPage"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"post":{"operationId":"users.store","description":"This is endpoint allows administrators to create users","summary":"Create user","tags":["User"],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateUserRequest"}}}},"responses":{"200":{"description":"`UserResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UserResource"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/users\/{user}":{"patch":{"operationId":"users.update","summary":"Update a user","tags":["User"],"parameters":[{"name":"user","in":"path","required":true,"description":"The user ID","schema":{"type":"integer"}}],"requestBody":{"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdateUserRequest"}}}},"responses":{"200":{"description":"`UserResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UserResource"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}},"get":{"operationId":"users.show","summary":"Get small user detail info","tags":["User"],"parameters":[{"name":"user","in":"path","required":true,"description":"The user ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"`UserResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UserResource"}}}},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}},"delete":{"operationId":"users.destroy","summary":"Delete a user","tags":["User"],"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content","content":{"application\/json":{"schema":{"type":"null"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/users\/me":{"get":{"operationId":"users.me","summary":"Get the authenticated user","tags":["User"],"responses":{"200":{"description":"`UserResource`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UserResource"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"}}}},"\/users\/tokens\/{user}":{"get":{"operationId":"userToken.getUserTokens","summary":"Get a collection of tokens","tags":["UserToken"],"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"perPage","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Json paginated set of `PersonalAccessTokenViewResource`","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/PersonalAccessTokenViewResource"}},"total":{"type":"integer","description":"Total number of items being paginated."},"count":{"type":"integer","description":"The number of items for the current page"},"limit":{"type":"integer","description":"The number of items per page"},"currentPage":{"type":"integer","description":"The number of current page"},"nextPage":{"type":"integer","description":"The number of next page"},"lastPage":{"type":"integer","description":"The number of last page"}},"required":["data","total","count","limit","currentPage","nextPage","lastPage"]}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"422":{"$ref":"#\/components\/responses\/ValidationException"},"403":{"$ref":"#\/components\/responses\/AuthorizationException"}}}},"\/users\/tokens\/{token}":{"delete":{"operationId":"userToken.revokeToken","summary":"Revoke a given token","tags":["UserToken"],"parameters":[{"name":"token","in":"path","required":true,"description":"The token ID","schema":{"type":"integer"}}],"responses":{"204":{"description":"No content","content":{"application\/json":{"schema":{"type":"null"}}}},"401":{"$ref":"#\/components\/responses\/AuthenticationException"},"404":{"$ref":"#\/components\/responses\/ModelNotFoundException"}}}}},"components":{"securitySchemes":{"http":{"type":"http","description":"### Access token\nOnly tokens with the ability 'access-api' will have access to the endpoints. Access tokens have a lifetime of 1h.\n\n### Stream token\nStream tokens can only be used for accessing media streams. Stream tokens have a lifetime of 1d.\n\n### Refresh token\nThe refresh token has the 'issue-access-token' ability. Refresh tokens have a lifetime of 7d.\nIt can be used to refresh access and stream tokens.\n\n#### Tip\n\nTokens can be used as a query parameter in cases where its not possible to add a header (e.g. mp3 streaming in the browser). Append the query parameter `_token=YOUR_TOKEN`.","scheme":"bearer","bearerFormat":""}},"schemas":{"AlbumResourceResource":{"type":"object","properties":{"title":{"type":"string"},"slug":{"type":"string"},"year":{"type":["integer","null"]},"directory":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"coverUrl":{"type":"string","description":"Cover relation"},"albumArtist":{"description":"Album artist relation","$ref":"#\/components\/schemas\/ArtistResource"},"songs":{"type":"array","description":"Songs relation","items":{"$ref":"#\/components\/schemas\/SongResource"}}},"required":["title","slug","year","directory","createdAt","updatedAt"],"title":"AlbumResourceResource"},"AlbumWithoutSongsResource":{"type":"object","properties":{"title":{"type":"string"},"slug":{"type":"string"},"year":{"type":["integer","null"]},"directory":{"type":"string"},"coverUrl":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"albumArtist":{"description":"Album artist relation","$ref":"#\/components\/schemas\/ArtistResource"}},"required":["title","slug","year","directory","createdAt","updatedAt"],"title":"AlbumWithoutSongsResource"},"ArtistResource":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"portrait":{"description":"Portrait relation","$ref":"#\/components\/schemas\/ImageResource"}},"required":["name","slug","createdAt","updatedAt"],"title":"ArtistResource"},"CreateLibraryRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"path":{"type":"string","maxLength":1000},"type":{"$ref":"#\/components\/schemas\/LibraryType"},"order":{"type":"integer"}},"required":["name","path","type","order"],"title":"CreateLibraryRequest"},"CreateUserRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":160},"email":{"type":"string","format":"email","maxLength":254},"password":{"type":"string","minLength":1,"maxLength":100}},"required":["name","email","password"],"title":"CreateUserRequest"},"ForgotPasswordRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"url":{"type":"string"}},"required":["email"],"title":"ForgotPasswordRequest"},"GenreResource":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"songs":{"type":"array","description":"Songs relation","items":{"$ref":"#\/components\/schemas\/SongResource"}}},"required":["name","slug","createdAt","updatedAt"],"title":"GenreResource"},"ImageResource":{"type":"object","properties":{"public_id":{"type":"string"},"path":{"type":"string"},"extension":{"type":"string"},"size":{"type":"integer"},"mime_type":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"url":{"type":"string"}},"required":["public_id","path","extension","size","mime_type","width","height","url"],"title":"ImageResource"},"LibraryResource":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"path":{"type":"string"},"type":{"type":"string"},"order":{"type":"integer"},"lastScan":{"type":["string","null"]},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["name","slug","path","type","order","lastScan","createdAt","updatedAt"],"title":"LibraryResource"},"LibraryType":{"type":"string","enum":["music","podcast","audiobook","movie","tv_show"],"title":"LibraryType"},"LoginRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"},"remember":{"type":"boolean"}},"required":["email","password"],"title":"LoginRequest"},"NewAccessTokenResource":{"type":"object","properties":{"token":{"type":"string"},"abilities":{"type":"string"},"expiresAt":{"type":"string"}},"required":["token","abilities","expiresAt"],"title":"NewAccessTokenResource"},"PersonalAccessTokenViewResource":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"abilities":{"type":["array","null"],"items":{"type":"string"}},"userAgent":{"type":["string","null"]},"clientName":{"type":["string","null"]},"clientVersion":{"type":["string","null"]},"clientType":{"type":["string","null"]},"deviceOperatingSystem":{"type":["string","null"]},"deviceName":{"type":["string","null"]},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","abilities","userAgent","clientName","clientVersion","clientType","deviceOperatingSystem","deviceName","lastUsedAt","expiresAt","createdAt","updatedAt"],"title":"PersonalAccessTokenViewResource"},"RegisterRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":255},"password":{"type":"string"},"password_confirmation":{"type":"string"},"name":{"type":"string"}},"required":["email","password","password_confirmation"],"title":"RegisterRequest"},"ResetPasswordRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"token":{"type":"string"},"password":{"type":"string"},"password_confirmation":{"type":"string"}},"required":["email","token","password","password_confirmation"],"title":"ResetPasswordRequest"},"SongResource":{"type":"object","properties":{"public_id":{"type":"string"},"title":{"type":"string"},"year":{"type":["integer","null"]},"comment":{"type":["string","null"]},"disc":{"type":["integer","null"]},"length":{"type":["string","null"]},"durationHuman":{"type":"string"},"lyrics":{"type":["string","null"]},"lyricsExist":{"type":"boolean"},"modifiedTime":{"type":["integer","null"]},"path":{"type":"string"},"track":{"type":["integer","null"]},"size":{"type":"integer"},"sizeHuman":{"type":"string"},"mimeType":{"type":"string"},"hash":{"type":["string","null"]},"stream":{"type":["string","null"]},"librarySlug":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"album":{"$ref":"#\/components\/schemas\/AlbumWithoutSongsResource"},"artists":{"type":"array","items":{"$ref":"#\/components\/schemas\/ArtistResource"}}},"required":["public_id","title","year","comment","disc","length","durationHuman","lyrics","lyricsExist","modifiedTime","path","track","size","sizeHuman","mimeType","hash","createdAt","updatedAt"],"title":"SongResource"},"UpdateGenreRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"],"title":"UpdateGenreRequest"},"UpdateLibraryRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"path":{"type":"string","maxLength":1000},"type":{"$ref":"#\/components\/schemas\/LibraryType"},"order":{"type":"integer"}},"title":"UpdateLibraryRequest"},"UpdateUserRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":254},"password":{"type":"string","maxLength":100}},"title":"UpdateUserRequest"},"UserResource":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"isAdmin":{"type":"boolean"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["name","email","isAdmin","createdAt","updatedAt"],"title":"UserResource"}},"responses":{"ModelNotFoundException":{"description":"Not found","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"AuthenticationException":{"description":"Unauthenticated","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}},"AuthorizationException":{"description":"Authorization error","content":{"application\/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}}}}}

Expected behavior

All necessary dependencies should be part of the package. If you're concerned about locking consumers out of newer versions then you could depend on the version you need or newer e.g. >=23.0.0

Screenshots
If applicable, add screenshots or logs to help explain your problem.

image

  • OS: [e.g. macOS]
  • Ubuntu 24.04 under WSL 2

Additional context

commander and glob doesn't seem to be necessary?

warning " > @7nohe/[email protected]" has unmet peer dependency "[email protected]".
warning " > @7nohe/[email protected]" has unmet peer dependency "[email protected]".
warning " > @7nohe/[email protected]" has unmet peer dependency "[email protected]".
@7nohe 7nohe added the bug Something isn't working label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants