@furystack/rest-service 6.1.7 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/actions/error-action.js.map +1 -1
  2. package/dist/actions/get-current-user.js.map +1 -1
  3. package/dist/actions/is-authenticated.js.map +1 -1
  4. package/dist/actions/login.js.map +1 -1
  5. package/dist/actions/logout.js.map +1 -1
  6. package/dist/actions/not-found-action.js.map +1 -1
  7. package/dist/api-manager.js.map +1 -1
  8. package/dist/authenticate.js.map +1 -1
  9. package/dist/authorize.js.map +1 -1
  10. package/dist/authorize.spec.js.map +1 -1
  11. package/dist/endpoint-generators/create-delete-endpoint.js.map +1 -1
  12. package/dist/endpoint-generators/create-get-collection-endpoint.js.map +1 -1
  13. package/dist/endpoint-generators/create-get-collection-endpoint.spec.js.map +1 -1
  14. package/dist/endpoint-generators/create-get-entity-endpoint.js.map +1 -1
  15. package/dist/endpoint-generators/create-get-entity-endpoint.spec.js.map +1 -1
  16. package/dist/endpoint-generators/create-patch-endpoint.js.map +1 -1
  17. package/dist/endpoint-generators/create-post-endpoint.js.map +1 -1
  18. package/dist/helpers.js.map +1 -1
  19. package/dist/http-authentication-settings.js.map +1 -1
  20. package/dist/http-user-context.js.map +1 -1
  21. package/dist/schema-validator/schema-validator.js.map +1 -1
  22. package/dist/schema-validator/schema-validator.test.js.map +1 -1
  23. package/dist/server-manager.js.map +1 -1
  24. package/dist/static-server-manager.js +1 -1
  25. package/dist/static-server-manager.js.map +1 -1
  26. package/dist/static-server-manager.spec.js +60 -18
  27. package/dist/static-server-manager.spec.js.map +1 -1
  28. package/package.json +9 -9
  29. package/src/actions/error-action.spec.ts +2 -2
  30. package/src/actions/error-action.ts +2 -1
  31. package/src/actions/get-current-user.spec.ts +1 -1
  32. package/src/actions/get-current-user.ts +4 -2
  33. package/src/actions/is-authenticated.spec.ts +1 -1
  34. package/src/actions/is-authenticated.ts +2 -1
  35. package/src/actions/login-action.spec.ts +1 -1
  36. package/src/actions/login.ts +3 -2
  37. package/src/actions/logout-action.spec.ts +1 -1
  38. package/src/actions/logout.ts +2 -1
  39. package/src/actions/not-found-action.spec.ts +1 -1
  40. package/src/actions/not-found-action.ts +2 -1
  41. package/src/add-cors-header.spec.ts +1 -1
  42. package/src/api-manager.ts +12 -7
  43. package/src/authenticate.spec.ts +2 -2
  44. package/src/authenticate.ts +2 -1
  45. package/src/authorize.spec.ts +4 -3
  46. package/src/authorize.ts +2 -1
  47. package/src/endpoint-generators/create-delete-endpoint.spec.ts +1 -1
  48. package/src/endpoint-generators/create-delete-endpoint.ts +4 -3
  49. package/src/endpoint-generators/create-get-collection-endpoint.spec.ts +3 -2
  50. package/src/endpoint-generators/create-get-collection-endpoint.ts +4 -3
  51. package/src/endpoint-generators/create-get-entity-endpoint.spec.ts +4 -2
  52. package/src/endpoint-generators/create-get-entity-endpoint.ts +5 -3
  53. package/src/endpoint-generators/create-patch-endpoint.spec.ts +1 -1
  54. package/src/endpoint-generators/create-patch-endpoint.ts +4 -3
  55. package/src/endpoint-generators/create-post-endpoint.spec.ts +1 -1
  56. package/src/endpoint-generators/create-post-endpoint.ts +6 -4
  57. package/src/endpoint-generators/utils.ts +1 -1
  58. package/src/helpers.ts +8 -6
  59. package/src/http-authentication-settings.ts +4 -2
  60. package/src/http-user-context.spec.ts +1 -1
  61. package/src/http-user-context.ts +4 -3
  62. package/src/request-action-implementation.ts +3 -3
  63. package/src/rest-service.integration.spec.ts +1 -1
  64. package/src/rest.integration.test.ts +1 -1
  65. package/src/schema-validator/schema-validation-error.ts +1 -1
  66. package/src/schema-validator/schema-validator.test.ts +2 -1
  67. package/src/schema-validator/schema-validator.ts +2 -1
  68. package/src/server-manager.ts +5 -4
  69. package/src/server-response-extensions.ts +1 -1
  70. package/src/static-server-manager.spec.ts +67 -19
  71. package/src/static-server-manager.ts +4 -2
  72. package/src/utils.ts +2 -2
  73. package/src/validate.integration.schema.ts +1 -1
  74. package/src/validate.integration.spec.ts +1 -1
  75. package/src/validate.ts +1 -1
  76. package/types/actions/error-action.d.ts +1 -1
  77. package/types/actions/error-action.d.ts.map +1 -1
  78. package/types/actions/get-current-user.d.ts +2 -2
  79. package/types/actions/get-current-user.d.ts.map +1 -1
  80. package/types/actions/is-authenticated.d.ts +1 -1
  81. package/types/actions/is-authenticated.d.ts.map +1 -1
  82. package/types/actions/login.d.ts +2 -2
  83. package/types/actions/login.d.ts.map +1 -1
  84. package/types/actions/logout.d.ts +1 -1
  85. package/types/actions/logout.d.ts.map +1 -1
  86. package/types/actions/not-found-action.d.ts +1 -1
  87. package/types/actions/not-found-action.d.ts.map +1 -1
  88. package/types/api-manager.d.ts +6 -6
  89. package/types/api-manager.d.ts.map +1 -1
  90. package/types/authenticate.d.ts +1 -1
  91. package/types/authenticate.d.ts.map +1 -1
  92. package/types/authorize.d.ts +1 -1
  93. package/types/authorize.d.ts.map +1 -1
  94. package/types/endpoint-generators/create-delete-endpoint.d.ts +3 -3
  95. package/types/endpoint-generators/create-delete-endpoint.d.ts.map +1 -1
  96. package/types/endpoint-generators/create-get-collection-endpoint.d.ts +3 -3
  97. package/types/endpoint-generators/create-get-collection-endpoint.d.ts.map +1 -1
  98. package/types/endpoint-generators/create-get-entity-endpoint.d.ts +3 -3
  99. package/types/endpoint-generators/create-get-entity-endpoint.d.ts.map +1 -1
  100. package/types/endpoint-generators/create-patch-endpoint.d.ts +3 -3
  101. package/types/endpoint-generators/create-patch-endpoint.d.ts.map +1 -1
  102. package/types/endpoint-generators/create-post-endpoint.d.ts +3 -3
  103. package/types/endpoint-generators/create-post-endpoint.d.ts.map +1 -1
  104. package/types/endpoint-generators/utils.d.ts +1 -1
  105. package/types/endpoint-generators/utils.d.ts.map +1 -1
  106. package/types/helpers.d.ts +6 -6
  107. package/types/helpers.d.ts.map +1 -1
  108. package/types/http-authentication-settings.d.ts +3 -2
  109. package/types/http-authentication-settings.d.ts.map +1 -1
  110. package/types/http-user-context.d.ts +3 -3
  111. package/types/http-user-context.d.ts.map +1 -1
  112. package/types/request-action-implementation.d.ts +3 -3
  113. package/types/request-action-implementation.d.ts.map +1 -1
  114. package/types/rest.integration.test.d.ts +1 -1
  115. package/types/rest.integration.test.d.ts.map +1 -1
  116. package/types/schema-validator/schema-validation-error.d.ts +1 -1
  117. package/types/schema-validator/schema-validation-error.d.ts.map +1 -1
  118. package/types/schema-validator/schema-validator.d.ts +1 -1
  119. package/types/schema-validator/schema-validator.d.ts.map +1 -1
  120. package/types/server-manager.d.ts +3 -3
  121. package/types/server-manager.d.ts.map +1 -1
  122. package/types/server-response-extensions.d.ts +1 -1
  123. package/types/server-response-extensions.d.ts.map +1 -1
  124. package/types/static-server-manager.d.ts +1 -1
  125. package/types/static-server-manager.d.ts.map +1 -1
  126. package/types/utils.d.ts +2 -2
  127. package/types/utils.d.ts.map +1 -1
  128. package/types/validate.d.ts +1 -1
  129. package/types/validate.d.ts.map +1 -1
  130. package/types/validate.integration.schema.d.ts +1 -1
  131. package/types/validate.integration.schema.d.ts.map +1 -1
@@ -1,6 +1,7 @@
1
1
  import { RequestError } from '@furystack/rest'
2
2
  import { AuthorizationError } from '@furystack/core'
3
- import { JsonResult, RequestAction } from '../request-action-implementation'
3
+ import type { RequestAction } from '../request-action-implementation'
4
+ import { JsonResult } from '../request-action-implementation'
4
5
  import { SchemaValidationError } from '../schema-validator'
5
6
 
6
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { Injector } from '@furystack/inject'
2
2
  import { usingAsync } from '@furystack/utils'
3
3
  import { GetCurrentUser } from './get-current-user'
4
- import { IncomingMessage, ServerResponse } from 'http'
4
+ import type { IncomingMessage, ServerResponse } from 'http'
5
5
  import { IdentityContext } from '@furystack/core'
6
6
 
7
7
  describe('getCurrentUser', () => {
@@ -1,6 +1,8 @@
1
- import { getCurrentUser, User } from '@furystack/core'
1
+ import type { User } from '@furystack/core'
2
+ import { getCurrentUser } from '@furystack/core'
2
3
  import { Authenticate } from '../authenticate'
3
- import { JsonResult, RequestAction } from '../request-action-implementation'
4
+ import type { RequestAction } from '../request-action-implementation'
5
+ import { JsonResult } from '../request-action-implementation'
4
6
 
5
7
  /**
6
8
  * Action that returns the current authenticated user
@@ -1,7 +1,7 @@
1
1
  import { Injector } from '@furystack/inject'
2
2
  import { usingAsync } from '@furystack/utils'
3
3
  import { IsAuthenticated } from './is-authenticated'
4
- import { IncomingMessage, ServerResponse } from 'http'
4
+ import type { IncomingMessage, ServerResponse } from 'http'
5
5
  import { IdentityContext } from '@furystack/core'
6
6
 
7
7
  describe('isAuthenticated', () => {
@@ -1,5 +1,6 @@
1
1
  import { isAuthenticated } from '@furystack/core'
2
- import { JsonResult, RequestAction } from '../request-action-implementation'
2
+ import type { RequestAction } from '../request-action-implementation'
3
+ import { JsonResult } from '../request-action-implementation'
3
4
 
4
5
  /**
5
6
  * Action that returns if the current user is authenticated
@@ -1,4 +1,4 @@
1
- import { IncomingMessage, ServerResponse } from 'http'
1
+ import type { IncomingMessage, ServerResponse } from 'http'
2
2
  import { Injector } from '@furystack/inject'
3
3
  import { usingAsync } from '@furystack/utils'
4
4
  import { LoginAction } from './login'
@@ -1,8 +1,9 @@
1
1
  import { HttpUserContext } from '../http-user-context'
2
2
  import '../helpers'
3
- import { User } from '@furystack/core'
3
+ import type { User } from '@furystack/core'
4
4
  import { RequestError } from '@furystack/rest'
5
- import { JsonResult, RequestAction } from '../request-action-implementation'
5
+ import type { RequestAction } from '../request-action-implementation'
6
+ import { JsonResult } from '../request-action-implementation'
6
7
 
7
8
  /**
8
9
  * Action that logs in the current user
@@ -2,7 +2,7 @@ import { Injector } from '@furystack/inject'
2
2
  import { usingAsync } from '@furystack/utils'
3
3
  import { HttpUserContext } from '../http-user-context'
4
4
  import { LogoutAction } from './logout'
5
- import { IncomingMessage, ServerResponse } from 'http'
5
+ import type { IncomingMessage, ServerResponse } from 'http'
6
6
 
7
7
  describe('LogoutAction', () => {
8
8
  const request = { url: 'https://google.com' } as IncomingMessage
@@ -1,5 +1,6 @@
1
1
  import { HttpUserContext } from '../http-user-context'
2
- import { EmptyResult, RequestAction } from '../request-action-implementation'
2
+ import type { RequestAction } from '../request-action-implementation'
3
+ import { EmptyResult } from '../request-action-implementation'
3
4
 
4
5
  /**
5
6
  * Action that logs out the current user
@@ -1,7 +1,7 @@
1
1
  import { Injector } from '@furystack/inject'
2
2
  import { usingAsync } from '@furystack/utils'
3
3
  import { NotFoundAction } from './not-found-action'
4
- import { IncomingMessage, ServerResponse } from 'http'
4
+ import type { IncomingMessage, ServerResponse } from 'http'
5
5
 
6
6
  describe('NotFoundAction tests', () => {
7
7
  const request = { url: 'https://google.com' } as IncomingMessage
@@ -1,4 +1,5 @@
1
- import { JsonResult, RequestAction } from '../request-action-implementation'
1
+ import type { RequestAction } from '../request-action-implementation'
2
+ import { JsonResult } from '../request-action-implementation'
2
3
 
3
4
  /**
4
5
  * @returns The standard Not Found action result
@@ -1,4 +1,4 @@
1
- import { IncomingMessage, ServerResponse } from 'http'
1
+ import type { IncomingMessage, ServerResponse } from 'http'
2
2
  import { Utils } from './utils'
3
3
 
4
4
  describe('AddCorsHeaders', () => {
@@ -1,16 +1,21 @@
1
- import { Disposable, PathHelper, usingAsync } from '@furystack/utils'
2
- import { deserializeQueryString, RestApi } from '@furystack/rest'
3
- import { Injectable, Injected, Injector } from '@furystack/inject'
4
- import { ServerManager, OnRequest } from './server-manager'
1
+ import type { Disposable } from '@furystack/utils'
2
+ import { PathHelper, usingAsync } from '@furystack/utils'
3
+ import type { RestApi } from '@furystack/rest'
4
+ import { deserializeQueryString } from '@furystack/rest'
5
+ import type { Injector } from '@furystack/inject'
6
+ import { Injectable, Injected } from '@furystack/inject'
7
+ import type { OnRequest } from './server-manager'
8
+ import { ServerManager } from './server-manager'
5
9
  import { pathToRegexp, match } from 'path-to-regexp'
6
10
  import { NotFoundAction } from './actions/not-found-action'
7
- import { CorsOptions } from './models/cors-options'
11
+ import type { CorsOptions } from './models/cors-options'
8
12
  import { Utils } from './utils'
9
13
  import { ErrorAction } from './actions/error-action'
10
14
  import './server-response-extensions'
11
- import { IdentityContext, User } from '@furystack/core'
15
+ import type { User } from '@furystack/core'
16
+ import { IdentityContext } from '@furystack/core'
12
17
  import { HttpUserContext } from './http-user-context'
13
- import { RequestAction } from './request-action-implementation'
18
+ import type { RequestAction } from './request-action-implementation'
14
19
 
15
20
  export type RestApiImplementation<T extends RestApi> = {
16
21
  [TMethod in keyof T]: {
@@ -1,9 +1,9 @@
1
- import { IncomingMessage } from 'http'
1
+ import type { IncomingMessage } from 'http'
2
2
  import { Injector } from '@furystack/inject'
3
3
  import { usingAsync } from '@furystack/utils'
4
4
  import { HttpUserContext } from './http-user-context'
5
5
  import { Authenticate } from './authenticate'
6
- import { ServerResponse } from 'http'
6
+ import type { ServerResponse } from 'http'
7
7
  import { IdentityContext } from '@furystack/core'
8
8
  import { EmptyResult } from './request-action-implementation'
9
9
 
@@ -1,7 +1,8 @@
1
1
  import { isAuthenticated } from '@furystack/core'
2
2
  import { sleepAsync } from '@furystack/utils'
3
3
  import { HttpUserContext } from './http-user-context'
4
- import { ActionResult, JsonResult, RequestAction, RequestActionOptions } from './request-action-implementation'
4
+ import type { ActionResult, RequestAction, RequestActionOptions } from './request-action-implementation'
5
+ import { JsonResult } from './request-action-implementation'
5
6
 
6
7
  export const Authenticate =
7
8
  () =>
@@ -1,9 +1,10 @@
1
- import { IncomingMessage } from 'http'
1
+ import type { IncomingMessage } from 'http'
2
2
  import { Injector } from '@furystack/inject'
3
3
  import { usingAsync } from '@furystack/utils'
4
- import { User, IdentityContext } from '@furystack/core'
4
+ import type { User } from '@furystack/core'
5
+ import { IdentityContext } from '@furystack/core'
5
6
  import { Authorize } from './authorize'
6
- import { ServerResponse } from 'http'
7
+ import type { ServerResponse } from 'http'
7
8
  import { EmptyResult } from './request-action-implementation'
8
9
 
9
10
  describe('Authorize', () => {
package/src/authorize.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { isAuthorized } from '@furystack/core'
2
2
  import { sleepAsync } from '@furystack/utils'
3
- import { ActionResult, JsonResult, RequestAction, RequestActionOptions } from './request-action-implementation'
3
+ import type { ActionResult, RequestAction, RequestActionOptions } from './request-action-implementation'
4
+ import { JsonResult } from './request-action-implementation'
4
5
 
5
6
  export const Authorize =
6
7
  (...roles: string[]) =>
@@ -1,6 +1,6 @@
1
1
  import { usingAsync } from '@furystack/utils'
2
2
  import { Injector } from '@furystack/inject'
3
- import { DeleteEndpoint } from '@furystack/rest'
3
+ import type { DeleteEndpoint } from '@furystack/rest'
4
4
  import { createDeleteEndpoint } from './create-delete-endpoint'
5
5
  import got from 'got'
6
6
  import { MockClass, setupContext } from './utils'
@@ -1,7 +1,8 @@
1
- import { Constructable } from '@furystack/inject'
2
- import { DeleteEndpoint } from '@furystack/rest'
1
+ import type { Constructable } from '@furystack/inject'
2
+ import type { DeleteEndpoint } from '@furystack/rest'
3
3
  import '@furystack/repository'
4
- import { JsonResult, RequestAction } from '../request-action-implementation'
4
+ import type { RequestAction } from '../request-action-implementation'
5
+ import { JsonResult } from '../request-action-implementation'
5
6
  import { getRepository } from '@furystack/repository'
6
7
 
7
8
  /**
@@ -3,8 +3,9 @@ import { Injector } from '@furystack/inject'
3
3
  import got from 'got'
4
4
  import { MockClass, setupContext } from './utils'
5
5
  import { createGetCollectionEndpoint } from './create-get-collection-endpoint'
6
- import { GetCollectionEndpoint, GetCollectionResult, serializeToQueryString } from '@furystack/rest'
7
- import { FindOptions } from '@furystack/core'
6
+ import type { GetCollectionEndpoint, GetCollectionResult } from '@furystack/rest'
7
+ import { serializeToQueryString } from '@furystack/rest'
8
+ import type { FindOptions } from '@furystack/core'
8
9
  import { getDataSetFor, getRepository } from '@furystack/repository'
9
10
  import { useRestService } from '../helpers'
10
11
 
@@ -1,7 +1,8 @@
1
- import { Constructable } from '@furystack/inject'
2
- import { GetCollectionEndpoint } from '@furystack/rest'
1
+ import type { Constructable } from '@furystack/inject'
2
+ import type { GetCollectionEndpoint } from '@furystack/rest'
3
3
  import '@furystack/repository'
4
- import { JsonResult, RequestAction } from '../request-action-implementation'
4
+ import type { RequestAction } from '../request-action-implementation'
5
+ import { JsonResult } from '../request-action-implementation'
5
6
  import { getRepository } from '@furystack/repository'
6
7
 
7
8
  /**
@@ -1,7 +1,9 @@
1
1
  import { usingAsync } from '@furystack/utils'
2
2
  import { Injector } from '@furystack/inject'
3
- import { GetEntityEndpoint, serializeToQueryString } from '@furystack/rest'
4
- import got, { HTTPError } from 'got'
3
+ import type { GetEntityEndpoint } from '@furystack/rest'
4
+ import { serializeToQueryString } from '@furystack/rest'
5
+ import type { HTTPError } from 'got'
6
+ import got from 'got'
5
7
  import { MockClass, setupContext } from './utils'
6
8
  import { createGetEntityEndpoint } from './create-get-entity-endpoint'
7
9
  import { getDataSetFor } from '@furystack/repository'
@@ -1,7 +1,9 @@
1
- import { Constructable } from '@furystack/inject'
2
- import { RequestError, GetEntityEndpoint } from '@furystack/rest'
1
+ import type { Constructable } from '@furystack/inject'
2
+ import type { GetEntityEndpoint } from '@furystack/rest'
3
+ import { RequestError } from '@furystack/rest'
3
4
  import '@furystack/repository'
4
- import { JsonResult, RequestAction } from '../request-action-implementation'
5
+ import type { RequestAction } from '../request-action-implementation'
6
+ import { JsonResult } from '../request-action-implementation'
5
7
  import { getRepository } from '@furystack/repository'
6
8
 
7
9
  /**
@@ -1,6 +1,6 @@
1
1
  import { usingAsync } from '@furystack/utils'
2
2
  import { Injector } from '@furystack/inject'
3
- import { PatchEndpoint } from '@furystack/rest'
3
+ import type { PatchEndpoint } from '@furystack/rest'
4
4
  import { createPatchEndpoint } from './create-patch-endpoint'
5
5
  import got from 'got'
6
6
  import { MockClass, setupContext } from './utils'
@@ -1,8 +1,9 @@
1
- import { Constructable } from '@furystack/inject'
2
- import { PatchEndpoint } from '@furystack/rest'
1
+ import type { Constructable } from '@furystack/inject'
2
+ import type { PatchEndpoint } from '@furystack/rest'
3
3
  import '@furystack/repository'
4
4
  import '../incoming-message-extensions'
5
- import { JsonResult, RequestAction } from '../request-action-implementation'
5
+ import type { RequestAction } from '../request-action-implementation'
6
+ import { JsonResult } from '../request-action-implementation'
6
7
  import { getRepository } from '@furystack/repository'
7
8
 
8
9
  /**
@@ -1,6 +1,6 @@
1
1
  import { usingAsync } from '@furystack/utils'
2
2
  import { Injector } from '@furystack/inject'
3
- import { PostEndpoint } from '@furystack/rest'
3
+ import type { PostEndpoint } from '@furystack/rest'
4
4
  import { createPostEndpoint } from './create-post-endpoint'
5
5
  import got from 'got'
6
6
  import { MockClass, setupContext } from './utils'
@@ -1,9 +1,11 @@
1
- import { Constructable } from '@furystack/inject'
2
- import { RequestError, PostEndpoint } from '@furystack/rest'
1
+ import type { Constructable } from '@furystack/inject'
2
+ import type { PostEndpoint } from '@furystack/rest'
3
+ import { RequestError } from '@furystack/rest'
3
4
  import '@furystack/repository'
4
5
  import '../incoming-message-extensions'
5
- import { JsonResult, RequestAction } from '../request-action-implementation'
6
- import { WithOptionalId } from '@furystack/core'
6
+ import type { RequestAction } from '../request-action-implementation'
7
+ import { JsonResult } from '../request-action-implementation'
8
+ import type { WithOptionalId } from '@furystack/core'
7
9
  import { getRepository } from '@furystack/repository'
8
10
  /**
9
11
  * Creates a POST endpoint for updating entities
@@ -1,4 +1,4 @@
1
- import { Injector } from '@furystack/inject'
1
+ import type { Injector } from '@furystack/inject'
2
2
  import { addStore, InMemoryStore, User } from '@furystack/core'
3
3
  import { DefaultSession } from '../models/default-session'
4
4
  import '@furystack/repository'
package/src/helpers.ts CHANGED
@@ -1,10 +1,12 @@
1
- import { User } from '@furystack/core'
2
- import { Injector } from '@furystack/inject'
1
+ import type { User } from '@furystack/core'
2
+ import type { Injector } from '@furystack/inject'
3
3
  import { HttpAuthenticationSettings } from './http-authentication-settings'
4
- import { RestApi } from '@furystack/rest'
5
- import { ApiManager, ImplementApiOptions } from './api-manager'
6
- import { DefaultSession } from './models/default-session'
7
- import { StaticServerManager, StaticServerOptions } from './static-server-manager'
4
+ import type { RestApi } from '@furystack/rest'
5
+ import type { ImplementApiOptions } from './api-manager'
6
+ import { ApiManager } from './api-manager'
7
+ import type { DefaultSession } from './models/default-session'
8
+ import type { StaticServerOptions } from './static-server-manager'
9
+ import { StaticServerManager } from './static-server-manager'
8
10
 
9
11
  /**
10
12
  * Sets up the @furystack/rest-service with the provided settings
@@ -1,5 +1,7 @@
1
- import { PhysicalStore, User, StoreManager } from '@furystack/core'
2
- import { Constructable, Injectable } from '@furystack/inject'
1
+ import type { PhysicalStore, StoreManager } from '@furystack/core'
2
+ import { User } from '@furystack/core'
3
+ import type { Constructable } from '@furystack/inject'
4
+ import { Injectable } from '@furystack/inject'
3
5
  import { DefaultSession } from './models/default-session'
4
6
 
5
7
  /**
@@ -1,4 +1,4 @@
1
- import { IncomingMessage, ServerResponse } from 'http'
1
+ import type { IncomingMessage, ServerResponse } from 'http'
2
2
  import { usingAsync } from '@furystack/utils'
3
3
  import { Injector } from '@furystack/inject'
4
4
  import { User, StoreManager, InMemoryStore, addStore } from '@furystack/core'
@@ -1,8 +1,9 @@
1
- import { IncomingMessage, ServerResponse } from 'http'
2
- import { User, StoreManager } from '@furystack/core'
1
+ import type { IncomingMessage, ServerResponse } from 'http'
2
+ import type { User } from '@furystack/core'
3
+ import { StoreManager } from '@furystack/core'
3
4
  import { Injectable, Injected } from '@furystack/inject'
4
5
  import { HttpAuthenticationSettings } from './http-authentication-settings'
5
- import { DefaultSession } from './models/default-session'
6
+ import type { DefaultSession } from './models/default-session'
6
7
  import { PasswordAuthenticator, UnauthenticatedError } from '@furystack/security'
7
8
  import { randomBytes } from 'crypto'
8
9
 
@@ -1,6 +1,6 @@
1
- import { Injector } from '@furystack/inject'
2
- import { ServerResponse } from 'http'
3
- import { IncomingMessage } from 'http'
1
+ import type { Injector } from '@furystack/inject'
2
+ import type { ServerResponse } from 'http'
3
+ import type { IncomingMessage } from 'http'
4
4
 
5
5
  export interface ActionResult<T> {
6
6
  statusCode: number
@@ -2,7 +2,7 @@ import { Injector } from '@furystack/inject'
2
2
  import './helpers'
3
3
  import { usingAsync, PathHelper } from '@furystack/utils'
4
4
  import { GetCurrentUser, IsAuthenticated, LoginAction, LogoutAction } from './actions'
5
- import { RestApi } from '@furystack/rest'
5
+ import type { RestApi } from '@furystack/rest'
6
6
  import { User, InMemoryStore, addStore } from '@furystack/core'
7
7
  import { DefaultSession } from './models/default-session'
8
8
  import got from 'got'
@@ -1,5 +1,5 @@
1
1
  import { Injector } from '@furystack/inject'
2
- import { RestApi } from '@furystack/rest'
2
+ import type { RestApi } from '@furystack/rest'
3
3
  import { createClient } from '@furystack/rest-client-got'
4
4
  import { usingAsync } from '@furystack/utils'
5
5
  import { JsonResult } from './request-action-implementation'
@@ -1,5 +1,5 @@
1
1
  import { RequestError } from '@furystack/rest'
2
- import { ErrorObject } from 'ajv'
2
+ import type { ErrorObject } from 'ajv'
3
3
 
4
4
  /**
5
5
  * Custom Error class for Schema Validation Errors
@@ -1,5 +1,6 @@
1
1
  import { SchemaValidator } from './schema-validator'
2
- import { exampleSchema, BodyParameters, Language } from './validate-examples'
2
+ import type { BodyParameters, Language } from './validate-examples'
3
+ import { exampleSchema } from './validate-examples'
3
4
  import { SchemaValidationError } from './schema-validation-error'
4
5
 
5
6
  describe('ValidateSchema', () => {
@@ -1,4 +1,5 @@
1
- import Ajv, { ErrorObject, Options } from 'ajv'
1
+ import type { ErrorObject, Options } from 'ajv'
2
+ import Ajv from 'ajv'
2
3
  import useFormats from 'ajv-formats'
3
4
  import { SchemaValidationError } from './schema-validation-error'
4
5
 
@@ -1,9 +1,10 @@
1
1
  import { Injectable } from '@furystack/inject'
2
- import { Disposable } from '@furystack/utils'
3
- import { Server, createServer } from 'http'
2
+ import type { Disposable } from '@furystack/utils'
3
+ import type { Server } from 'http'
4
+ import { createServer } from 'http'
4
5
  import Semaphore from 'semaphore-async-await'
5
- import { IncomingMessage, ServerResponse } from 'http'
6
- import { Socket } from 'net'
6
+ import type { IncomingMessage, ServerResponse } from 'http'
7
+ import type { Socket } from 'net'
7
8
 
8
9
  export interface ServerOptions {
9
10
  hostName?: string
@@ -1,5 +1,5 @@
1
1
  import http from 'http'
2
- import { ActionResult } from './request-action-implementation'
2
+ import type { ActionResult } from './request-action-implementation'
3
3
 
4
4
  export interface SendJsonOptions<T> {
5
5
  statusCode?: number