@furystack/rest-service 7.0.12 → 7.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/actions/error-action.js.map +1 -1
- package/esm/actions/error-action.spec.d.ts +2 -0
- package/esm/actions/error-action.spec.d.ts.map +1 -0
- package/esm/actions/error-action.spec.js +47 -0
- package/esm/actions/error-action.spec.js.map +1 -0
- package/esm/actions/get-current-user.spec.d.ts +2 -0
- package/esm/actions/get-current-user.spec.d.ts.map +1 -0
- package/esm/actions/get-current-user.spec.js +19 -0
- package/esm/actions/get-current-user.spec.js.map +1 -0
- package/esm/actions/is-authenticated.spec.d.ts +2 -0
- package/esm/actions/is-authenticated.spec.d.ts.map +1 -0
- package/esm/actions/is-authenticated.spec.js +18 -0
- package/esm/actions/is-authenticated.spec.js.map +1 -0
- package/esm/actions/login-action.spec.d.ts +2 -0
- package/esm/actions/login-action.spec.d.ts.map +1 -0
- package/esm/actions/login-action.spec.js +34 -0
- package/esm/actions/login-action.spec.js.map +1 -0
- package/esm/actions/login.js.map +1 -1
- package/esm/actions/logout-action.spec.d.ts +2 -0
- package/esm/actions/logout-action.spec.d.ts.map +1 -0
- package/esm/actions/logout-action.spec.js +22 -0
- package/esm/actions/logout-action.spec.js.map +1 -0
- package/esm/actions/not-found-action.spec.d.ts +2 -0
- package/esm/actions/not-found-action.spec.d.ts.map +1 -0
- package/esm/actions/not-found-action.spec.js +16 -0
- package/esm/actions/not-found-action.spec.js.map +1 -0
- package/esm/add-cors-header.spec.d.ts +2 -0
- package/esm/add-cors-header.spec.d.ts.map +1 -0
- package/esm/add-cors-header.spec.js +98 -0
- package/esm/add-cors-header.spec.js.map +1 -0
- package/esm/api-manager.js.map +1 -1
- package/esm/authenticate.js.map +1 -1
- package/esm/authenticate.spec.d.ts +2 -0
- package/esm/authenticate.spec.d.ts.map +1 -0
- package/esm/authenticate.spec.js +58 -0
- package/esm/authenticate.spec.js.map +1 -0
- package/esm/authorize.js.map +1 -1
- package/esm/authorize.spec.d.ts +2 -0
- package/esm/authorize.spec.d.ts.map +1 -0
- package/esm/authorize.spec.js +54 -0
- package/esm/authorize.spec.js.map +1 -0
- package/esm/endpoint-generators/create-delete-endpoint.spec.d.ts +2 -0
- package/esm/endpoint-generators/create-delete-endpoint.spec.d.ts.map +1 -0
- package/esm/endpoint-generators/create-delete-endpoint.spec.js +34 -0
- package/esm/endpoint-generators/create-delete-endpoint.spec.js.map +1 -0
- package/esm/endpoint-generators/create-get-collection-endpoint.spec.d.ts +2 -0
- package/esm/endpoint-generators/create-get-collection-endpoint.spec.d.ts.map +1 -0
- package/esm/endpoint-generators/create-get-collection-endpoint.spec.js +156 -0
- package/esm/endpoint-generators/create-get-collection-endpoint.spec.js.map +1 -0
- package/esm/endpoint-generators/create-get-entity-endpoint.js.map +1 -1
- package/esm/endpoint-generators/create-get-entity-endpoint.spec.d.ts +2 -0
- package/esm/endpoint-generators/create-get-entity-endpoint.spec.d.ts.map +1 -0
- package/esm/endpoint-generators/create-get-entity-endpoint.spec.js +74 -0
- package/esm/endpoint-generators/create-get-entity-endpoint.spec.js.map +1 -0
- package/esm/endpoint-generators/create-patch-endpoint.spec.d.ts +2 -0
- package/esm/endpoint-generators/create-patch-endpoint.spec.d.ts.map +1 -0
- package/esm/endpoint-generators/create-patch-endpoint.spec.js +37 -0
- package/esm/endpoint-generators/create-patch-endpoint.spec.js.map +1 -0
- package/esm/endpoint-generators/create-post-endpoint.js.map +1 -1
- package/esm/endpoint-generators/create-post-endpoint.spec.d.ts +2 -0
- package/esm/endpoint-generators/create-post-endpoint.spec.d.ts.map +1 -0
- package/esm/endpoint-generators/create-post-endpoint.spec.js +35 -0
- package/esm/endpoint-generators/create-post-endpoint.spec.js.map +1 -0
- package/esm/helpers.spec.d.ts +2 -0
- package/esm/helpers.spec.d.ts.map +1 -0
- package/esm/helpers.spec.js +34 -0
- package/esm/helpers.spec.js.map +1 -0
- package/esm/http-user-context.d.ts +3 -0
- package/esm/http-user-context.d.ts.map +1 -1
- package/esm/http-user-context.js.map +1 -1
- package/esm/http-user-context.spec.d.ts +3 -0
- package/esm/http-user-context.spec.d.ts.map +1 -0
- package/esm/http-user-context.spec.js +269 -0
- package/esm/http-user-context.spec.js.map +1 -0
- package/esm/incoming-message-extensions.spec.d.ts +2 -0
- package/esm/incoming-message-extensions.spec.d.ts.map +1 -0
- package/esm/incoming-message-extensions.spec.js +38 -0
- package/esm/incoming-message-extensions.spec.js.map +1 -0
- package/esm/mime-types.spec.d.ts +2 -0
- package/esm/mime-types.spec.d.ts.map +1 -0
- package/esm/mime-types.spec.js +14 -0
- package/esm/mime-types.spec.js.map +1 -0
- package/esm/request-action-implementation.d.ts +3 -0
- package/esm/request-action-implementation.d.ts.map +1 -1
- package/esm/rest-service.integration.spec.d.ts +2 -0
- package/esm/rest-service.integration.spec.d.ts.map +1 -0
- package/esm/rest-service.integration.spec.js +156 -0
- package/esm/rest-service.integration.spec.js.map +1 -0
- package/esm/rest.integration.test.d.ts +89 -0
- package/esm/rest.integration.test.d.ts.map +1 -0
- package/esm/rest.integration.test.js +154 -0
- package/esm/rest.integration.test.js.map +1 -0
- package/esm/schema-validator/schema-validator.js.map +1 -1
- package/esm/schema-validator/schema-validator.test.d.ts +2 -0
- package/esm/schema-validator/schema-validator.test.d.ts.map +1 -0
- package/esm/schema-validator/schema-validator.test.js +61 -0
- package/esm/schema-validator/schema-validator.test.js.map +1 -0
- package/esm/server-manager.d.ts +3 -0
- package/esm/server-manager.d.ts.map +1 -1
- package/esm/server-manager.js.map +1 -1
- package/esm/server-response-extensions.js.map +1 -1
- package/esm/server-response-extensions.spec.d.ts +2 -0
- package/esm/server-response-extensions.spec.d.ts.map +1 -0
- package/esm/server-response-extensions.spec.js +52 -0
- package/esm/server-response-extensions.spec.js.map +1 -0
- package/esm/static-server-manager.d.ts +3 -0
- package/esm/static-server-manager.d.ts.map +1 -1
- package/esm/static-server-manager.js.map +1 -1
- package/esm/static-server-manager.spec.d.ts +2 -0
- package/esm/static-server-manager.spec.d.ts.map +1 -0
- package/esm/static-server-manager.spec.js +216 -0
- package/esm/static-server-manager.spec.js.map +1 -0
- package/esm/utils.d.ts +3 -0
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js.map +1 -1
- package/esm/validate.integration.spec.d.ts +2 -0
- package/esm/validate.integration.spec.d.ts.map +1 -0
- package/esm/validate.integration.spec.js +211 -0
- package/esm/validate.integration.spec.js.map +1 -0
- package/esm/validate.js.map +1 -1
- package/package.json +11 -11
- package/src/actions/error-action.spec.ts +1 -1
- package/src/actions/get-current-user.spec.ts +1 -1
- package/src/actions/is-authenticated.spec.ts +1 -1
- package/src/actions/login-action.spec.ts +2 -2
- package/src/actions/logout-action.spec.ts +2 -2
- package/src/actions/not-found-action.spec.ts +1 -1
- package/src/add-cors-header.spec.ts +1 -1
- package/src/authenticate.spec.ts +3 -3
- package/src/authorize.spec.ts +2 -2
- package/src/endpoint-generators/create-delete-endpoint.spec.ts +3 -3
- package/src/endpoint-generators/create-get-collection-endpoint.spec.ts +3 -3
- package/src/endpoint-generators/create-get-entity-endpoint.spec.ts +3 -3
- package/src/endpoint-generators/create-patch-endpoint.spec.ts +3 -3
- package/src/endpoint-generators/create-post-endpoint.spec.ts +3 -3
- package/src/helpers.spec.ts +4 -4
- package/src/http-user-context.spec.ts +3 -3
- package/src/mime-types.spec.ts +1 -1
- package/src/rest-service.integration.spec.ts +4 -4
- package/src/rest.integration.test.ts +2 -3
- package/src/schema-validator/schema-validator.test.ts +4 -4
- package/src/server-response-extensions.spec.ts +1 -1
- package/src/static-server-manager.spec.ts +2 -2
- package/src/validate.integration.spec.ts +4 -7
package/src/authorize.spec.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Injector } from '@furystack/inject'
|
|
|
3
3
|
import { usingAsync } from '@furystack/utils'
|
|
4
4
|
import type { User } from '@furystack/core'
|
|
5
5
|
import { IdentityContext } from '@furystack/core'
|
|
6
|
-
import { Authorize } from './authorize'
|
|
6
|
+
import { Authorize } from './authorize.js'
|
|
7
7
|
import type { ServerResponse } from 'http'
|
|
8
|
-
import { EmptyResult } from './request-action-implementation'
|
|
8
|
+
import { EmptyResult } from './request-action-implementation.js'
|
|
9
9
|
import { describe, it, expect, vi } from 'vitest'
|
|
10
10
|
|
|
11
11
|
describe('Authorize', () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { usingAsync } from '@furystack/utils'
|
|
2
2
|
import { Injector } from '@furystack/inject'
|
|
3
3
|
import type { DeleteEndpoint } from '@furystack/rest'
|
|
4
|
-
import { createDeleteEndpoint } from './create-delete-endpoint'
|
|
5
|
-
import { MockClass, setupContext } from './utils'
|
|
6
|
-
import { useRestService } from '../helpers'
|
|
4
|
+
import { createDeleteEndpoint } from './create-delete-endpoint.js'
|
|
5
|
+
import { MockClass, setupContext } from './utils.js'
|
|
6
|
+
import { useRestService } from '../helpers.js'
|
|
7
7
|
import { getDataSetFor } from '@furystack/repository'
|
|
8
8
|
import { describe, it, expect } from 'vitest'
|
|
9
9
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { usingAsync } from '@furystack/utils'
|
|
2
2
|
import { Injector } from '@furystack/inject'
|
|
3
|
-
import { MockClass, setupContext } from './utils'
|
|
4
|
-
import { createGetCollectionEndpoint } from './create-get-collection-endpoint'
|
|
3
|
+
import { MockClass, setupContext } from './utils.js'
|
|
4
|
+
import { createGetCollectionEndpoint } from './create-get-collection-endpoint.js'
|
|
5
5
|
import type { GetCollectionEndpoint, GetCollectionResult } from '@furystack/rest'
|
|
6
6
|
import { serializeToQueryString } from '@furystack/rest'
|
|
7
7
|
import type { FindOptions } from '@furystack/core'
|
|
8
8
|
import { getDataSetFor, getRepository } from '@furystack/repository'
|
|
9
|
-
import { useRestService } from '../helpers'
|
|
9
|
+
import { useRestService } from '../helpers.js'
|
|
10
10
|
import { describe, it, expect } from 'vitest'
|
|
11
11
|
|
|
12
12
|
const addMockEntities = async (i: Injector) =>
|
|
@@ -2,10 +2,10 @@ import { usingAsync } from '@furystack/utils'
|
|
|
2
2
|
import { Injector } from '@furystack/inject'
|
|
3
3
|
import type { GetEntityEndpoint } from '@furystack/rest'
|
|
4
4
|
import { serializeToQueryString } from '@furystack/rest'
|
|
5
|
-
import { MockClass, setupContext } from './utils'
|
|
6
|
-
import { createGetEntityEndpoint } from './create-get-entity-endpoint'
|
|
5
|
+
import { MockClass, setupContext } from './utils.js'
|
|
6
|
+
import { createGetEntityEndpoint } from './create-get-entity-endpoint.js'
|
|
7
7
|
import { getDataSetFor } from '@furystack/repository'
|
|
8
|
-
import { useRestService } from '../helpers'
|
|
8
|
+
import { useRestService } from '../helpers.js'
|
|
9
9
|
import { describe, it, expect } from 'vitest'
|
|
10
10
|
|
|
11
11
|
describe('createGetEntityEndpoint', () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { usingAsync } from '@furystack/utils'
|
|
2
2
|
import { Injector } from '@furystack/inject'
|
|
3
3
|
import type { PatchEndpoint } from '@furystack/rest'
|
|
4
|
-
import { createPatchEndpoint } from './create-patch-endpoint'
|
|
5
|
-
import { MockClass, setupContext } from './utils'
|
|
4
|
+
import { createPatchEndpoint } from './create-patch-endpoint.js'
|
|
5
|
+
import { MockClass, setupContext } from './utils.js'
|
|
6
6
|
import { getDataSetFor } from '@furystack/repository'
|
|
7
|
-
import { useRestService } from '../helpers'
|
|
7
|
+
import { useRestService } from '../helpers.js'
|
|
8
8
|
import { describe, it, expect } from 'vitest'
|
|
9
9
|
|
|
10
10
|
describe('createPatchEndpoint', () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { usingAsync } from '@furystack/utils'
|
|
2
2
|
import { Injector } from '@furystack/inject'
|
|
3
3
|
import type { PostEndpoint } from '@furystack/rest'
|
|
4
|
-
import { createPostEndpoint } from './create-post-endpoint'
|
|
5
|
-
import { MockClass, setupContext } from './utils'
|
|
6
|
-
import { useRestService } from '../helpers'
|
|
4
|
+
import { createPostEndpoint } from './create-post-endpoint.js'
|
|
5
|
+
import { MockClass, setupContext } from './utils.js'
|
|
6
|
+
import { useRestService } from '../helpers.js'
|
|
7
7
|
import { getDataSetFor } from '@furystack/repository'
|
|
8
8
|
import { describe, it, expect } from 'vitest'
|
|
9
9
|
|
package/src/helpers.spec.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Injector } from '@furystack/inject'
|
|
2
2
|
import { usingAsync } from '@furystack/utils'
|
|
3
|
-
import { ApiManager } from './api-manager'
|
|
4
|
-
import { HttpAuthenticationSettings } from './http-authentication-settings'
|
|
5
|
-
import { useHttpAuthentication, useRestService, useStaticFiles } from './helpers'
|
|
6
|
-
import { StaticServerManager } from './static-server-manager'
|
|
3
|
+
import { ApiManager } from './api-manager.js'
|
|
4
|
+
import { HttpAuthenticationSettings } from './http-authentication-settings.js'
|
|
5
|
+
import { useHttpAuthentication, useRestService, useStaticFiles } from './helpers.js'
|
|
6
|
+
import { StaticServerManager } from './static-server-manager.js'
|
|
7
7
|
import { describe, it, expect } from 'vitest'
|
|
8
8
|
|
|
9
9
|
describe('Injector extensions', () => {
|
|
@@ -2,10 +2,10 @@ 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'
|
|
5
|
-
import { DefaultSession } from './models/default-session'
|
|
6
|
-
import { HttpUserContext } from './http-user-context'
|
|
5
|
+
import { DefaultSession } from './models/default-session.js'
|
|
6
|
+
import { HttpUserContext } from './http-user-context.js'
|
|
7
7
|
import { PasswordAuthenticator, PasswordCredential, UnauthenticatedError } from '@furystack/security'
|
|
8
|
-
import { useHttpAuthentication } from './helpers'
|
|
8
|
+
import { useHttpAuthentication } from './helpers.js'
|
|
9
9
|
import { describe, it, expect, vi } from 'vitest'
|
|
10
10
|
|
|
11
11
|
export const prepareInjector = async (i: Injector) => {
|
package/src/mime-types.spec.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Injector } from '@furystack/inject'
|
|
2
2
|
import './helpers'
|
|
3
3
|
import { usingAsync, PathHelper } from '@furystack/utils'
|
|
4
|
-
import { GetCurrentUser, IsAuthenticated, LoginAction, LogoutAction } from './actions'
|
|
4
|
+
import { GetCurrentUser, IsAuthenticated, LoginAction, LogoutAction } from './actions/index.js'
|
|
5
5
|
import type { RestApi } from '@furystack/rest'
|
|
6
6
|
import { User, InMemoryStore, addStore } from '@furystack/core'
|
|
7
|
-
import { DefaultSession } from './models/default-session'
|
|
8
|
-
import { JsonResult } from './request-action-implementation'
|
|
9
|
-
import { useHttpAuthentication, useRestService } from './helpers'
|
|
7
|
+
import { DefaultSession } from './models/default-session.js'
|
|
8
|
+
import { JsonResult } from './request-action-implementation.js'
|
|
9
|
+
import { useHttpAuthentication, useRestService } from './helpers.js'
|
|
10
10
|
import { describe, it, expect } from 'vitest'
|
|
11
11
|
import { serializeValue } from '@furystack/rest'
|
|
12
12
|
|
|
@@ -2,9 +2,8 @@ import { Injector } from '@furystack/inject'
|
|
|
2
2
|
import type { RestApi } from '@furystack/rest'
|
|
3
3
|
import { createClient } from '@furystack/rest-client-fetch'
|
|
4
4
|
import { usingAsync } from '@furystack/utils'
|
|
5
|
-
import { JsonResult } from './request-action-implementation'
|
|
6
|
-
import './helpers'
|
|
7
|
-
import { useRestService } from './helpers'
|
|
5
|
+
import { JsonResult } from './request-action-implementation.js'
|
|
6
|
+
import { useRestService } from './helpers.js'
|
|
8
7
|
import { describe, it, expect } from 'vitest'
|
|
9
8
|
|
|
10
9
|
export interface EchoApi extends RestApi {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SchemaValidator } from './schema-validator'
|
|
2
|
-
import type { BodyParameters, Language } from './validate-examples'
|
|
3
|
-
import { exampleSchema } from './validate-examples'
|
|
4
|
-
import { SchemaValidationError } from './schema-validation-error'
|
|
1
|
+
import { SchemaValidator } from './schema-validator.js'
|
|
2
|
+
import type { BodyParameters, Language } from './validate-examples.js'
|
|
3
|
+
import { exampleSchema } from './validate-examples.js'
|
|
4
|
+
import { SchemaValidationError } from './schema-validation-error.js'
|
|
5
5
|
import { describe, it, expect } from 'vitest'
|
|
6
6
|
|
|
7
7
|
describe('ValidateSchema', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Socket } from 'net'
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'http'
|
|
3
3
|
import './server-response-extensions'
|
|
4
|
-
import { BypassResult, JsonResult, PlainTextResult } from './request-action-implementation'
|
|
4
|
+
import { BypassResult, JsonResult, PlainTextResult } from './request-action-implementation.js'
|
|
5
5
|
import { describe, it, expect, vi } from 'vitest'
|
|
6
6
|
|
|
7
7
|
describe('ServerResponse extensions', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injector } from '@furystack/inject'
|
|
2
2
|
import { sleepAsync, usingAsync } from '@furystack/utils'
|
|
3
|
-
import { ServerManager } from './server-manager'
|
|
4
|
-
import { StaticServerManager } from './static-server-manager'
|
|
3
|
+
import { ServerManager } from './server-manager.js'
|
|
4
|
+
import { StaticServerManager } from './static-server-manager.js'
|
|
5
5
|
import { describe, it, expect, vi } from 'vitest'
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { Injector } from '@furystack/inject'
|
|
2
2
|
import { createClient, ResponseError } from '@furystack/rest-client-fetch'
|
|
3
3
|
import { usingAsync } from '@furystack/utils'
|
|
4
|
-
import { JsonResult } from './request-action-implementation'
|
|
5
|
-
import { Validate } from './validate'
|
|
6
|
-
import './helpers'
|
|
7
|
-
|
|
4
|
+
import { JsonResult } from './request-action-implementation.js'
|
|
5
|
+
import { Validate } from './validate.js'
|
|
8
6
|
import schema from './validate.integration.spec.schema.json' assert { type: 'json' }
|
|
9
|
-
import type { ValidationApi } from './validate.integration.schema'
|
|
10
|
-
import { useRestService } from './helpers'
|
|
7
|
+
import type { ValidationApi } from './validate.integration.schema.js'
|
|
8
|
+
import { useRestService } from './helpers.js'
|
|
11
9
|
import { describe, it, expect } from 'vitest'
|
|
12
|
-
import { assert } from 'console'
|
|
13
10
|
|
|
14
11
|
// To recreate: yarn ts-json-schema-generator -f tsconfig.json --no-type-check -p packages/rest-service/src/validate.integration.schema.ts -o packages/rest-service/src/validate.integration.spec.schema.json
|
|
15
12
|
|