lumen-framework 3.1.1 → 4.0.0
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/README.md +75 -109
- package/bin/lumen +23 -41
- package/dist/cli.cjs +856 -479
- package/dist/cli.cjs.map +4 -4
- package/dist/index.js +3273 -1719
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +3251 -1697
- package/dist/index.mjs.map +4 -4
- package/dist/testing.js +280 -0
- package/dist/testing.js.map +7 -0
- package/dist/testing.mjs +252 -0
- package/dist/testing.mjs.map +7 -0
- package/dist/types/errors/links-only-error.d.ts +13 -0
- package/dist/types/errors/reserved-field-name-error.d.ts +13 -0
- package/dist/types/errors/unknown-attribute-error.d.ts +13 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/interfaces.d.ts +1 -1
- package/dist/types/packages/application/index.d.ts +38 -45
- package/dist/types/packages/application/initialize.d.ts +3 -5
- package/dist/types/packages/application/interfaces.d.ts +13 -5
- package/dist/types/packages/application/utils/create-controller.d.ts +14 -4
- package/dist/types/packages/application/utils/create-serializer.d.ts +2 -2
- package/dist/types/packages/application/utils/normalize-port.d.ts +1 -3
- package/dist/types/packages/application/utils/resolve-visibility.d.ts +15 -0
- package/dist/types/packages/application/utils/restrict-open-namespaces.d.ts +19 -0
- package/dist/types/packages/application/utils/validate-attributes.d.ts +17 -0
- package/dist/types/packages/application/utils/validate-links-only.d.ts +19 -0
- package/dist/types/packages/application/utils/validate-namespaced-serializers.d.ts +3 -3
- package/dist/types/packages/application/utils/validate-reserved-names.d.ts +12 -0
- package/dist/types/packages/application/utils/warn-query-param-names.d.ts +10 -0
- package/dist/types/packages/cli/commands/dbcreate.d.ts +1 -1
- package/dist/types/packages/cli/commands/dbdrop.d.ts +1 -1
- package/dist/types/packages/cli/commands/destroy.d.ts +3 -2
- package/dist/types/packages/cli/commands/generate.d.ts +5 -5
- package/dist/types/packages/cli/commands/index.d.ts +0 -1
- package/dist/types/packages/cli/generator/index.d.ts +6 -6
- package/dist/types/packages/cli/generator/interfaces.d.ts +3 -3
- package/dist/types/packages/cli/generator/utils/create-generator.d.ts +2 -2
- package/dist/types/packages/cli/generator/utils/generate-type.d.ts +9 -9
- package/dist/types/packages/cli/generator/utils/migration-conflict.d.ts +4 -4
- package/dist/types/packages/cli/templates/pnpm-workspace.d.ts +15 -0
- package/dist/types/packages/cli/utils/create-spinner.d.ts +14 -0
- package/dist/types/packages/cli/utils/print-statements.d.ts +12 -0
- package/dist/types/packages/cli/utils/server-database.d.ts +27 -0
- package/dist/types/packages/compiler/interfaces.d.ts +1 -1
- package/dist/types/packages/config/interfaces.d.ts +10 -4
- package/dist/types/packages/controller/constants.d.ts +7 -2
- package/dist/types/packages/controller/errors/related-record-not-found-error.d.ts +4 -4
- package/dist/types/packages/controller/index.d.ts +364 -473
- package/dist/types/packages/controller/interfaces.d.ts +21 -6
- package/dist/types/packages/controller/utils/find-many.d.ts +2 -5
- package/dist/types/packages/controller/utils/find-one.d.ts +2 -5
- package/dist/types/packages/controller/utils/params-to-query.d.ts +8 -10
- package/dist/types/packages/controller/utils/resolve-relationships.d.ts +1 -3
- package/dist/types/packages/controller/utils/validate-relationships.d.ts +5 -3
- package/dist/types/packages/controller/visibility/errors.d.ts +21 -0
- package/dist/types/packages/controller/visibility/index.d.ts +51 -0
- package/dist/types/packages/database/attribute/index.d.ts +4 -6
- package/dist/types/packages/database/attribute/interfaces.d.ts +1 -1
- package/dist/types/packages/database/attribute/utils/create-attribute.d.ts +3 -5
- package/dist/types/packages/database/attribute/utils/create-getter.d.ts +2 -2
- package/dist/types/packages/database/attribute/utils/create-setter.d.ts +3 -5
- package/dist/types/packages/database/constants.d.ts +1 -0
- package/dist/types/packages/database/errors/index.d.ts +1 -0
- package/dist/types/packages/database/errors/invalid-driver-error.d.ts +1 -3
- package/dist/types/packages/database/errors/migrations-pending-error.d.ts +1 -3
- package/dist/types/packages/database/errors/model-missing-error.d.ts +1 -3
- package/dist/types/packages/database/errors/relationship-config-error.d.ts +10 -0
- package/dist/types/packages/database/errors/unique-constraint-error.d.ts +1 -1
- package/dist/types/packages/database/index.d.ts +9 -6
- package/dist/types/packages/database/initialize.d.ts +3 -5
- package/dist/types/packages/database/interfaces.d.ts +115 -25
- package/dist/types/packages/database/migration/index.d.ts +5 -7
- package/dist/types/packages/database/migration/interfaces.d.ts +2 -4
- package/dist/types/packages/database/migration/utils/generate-timestamp.d.ts +9 -1
- package/dist/types/packages/database/model/index.d.ts +348 -759
- package/dist/types/packages/database/model/initialize-class.d.ts +7 -1
- package/dist/types/packages/database/model/interfaces.d.ts +30 -12
- package/dist/types/packages/database/model/utils/attribute.d.ts +14 -0
- package/dist/types/packages/database/model/utils/get-columns.d.ts +1 -3
- package/dist/types/packages/database/model/utils/persistence.d.ts +5 -14
- package/dist/types/packages/database/model/utils/process-write-error.d.ts +2 -2
- package/dist/types/packages/database/model/utils/run-hooks.d.ts +7 -3
- package/dist/types/packages/database/model/utils/validate.d.ts +4 -1
- package/dist/types/packages/database/query/errors/record-not-found-error.d.ts +1 -1
- package/dist/types/packages/database/query/index.d.ts +179 -3
- package/dist/types/packages/database/query/runner/index.d.ts +1 -3
- package/dist/types/packages/database/query/runner/utils/build-results.d.ts +3 -4
- package/dist/types/packages/database/query/utils/format-select.d.ts +1 -3
- package/dist/types/packages/database/relationship/index.d.ts +7 -6
- package/dist/types/packages/database/relationship/interfaces.d.ts +16 -3
- package/dist/types/packages/database/relationship/utils/getters.d.ts +7 -13
- package/dist/types/packages/database/relationship/utils/inverse-setters.d.ts +5 -9
- package/dist/types/packages/database/relationship/utils/setters.d.ts +7 -13
- package/dist/types/packages/database/relationship/utils/unassociate.d.ts +1 -3
- package/dist/types/packages/database/relationship/utils/update-relationship.d.ts +6 -2
- package/dist/types/packages/database/transaction/index.d.ts +9 -10
- package/dist/types/packages/database/transaction/interfaces.d.ts +7 -1
- package/dist/types/packages/database/utils/connect.d.ts +16 -3
- package/dist/types/packages/database/utils/create-migrations.d.ts +1 -3
- package/dist/types/packages/database/utils/normalize-model-name.d.ts +1 -3
- package/dist/types/packages/database/utils/pending-migrations.d.ts +1 -3
- package/dist/types/packages/database/utils/primary-key-type.d.ts +10 -0
- package/dist/types/packages/database/utils/type-for-column.d.ts +3 -5
- package/dist/types/packages/database/utils/validate-relationships.d.ts +13 -0
- package/dist/types/packages/database/validation/errors/validation-error.d.ts +4 -4
- package/dist/types/packages/database/validation/index.d.ts +3 -5
- package/dist/types/packages/database/validation/interfaces.d.ts +1 -1
- package/dist/types/packages/freezeable/map/index.d.ts +1 -3
- package/dist/types/packages/freezeable/set/index.d.ts +1 -3
- package/dist/types/packages/freezeable/utils/freeze.d.ts +5 -15
- package/dist/types/packages/freezeable/utils/is-frozen.d.ts +1 -3
- package/dist/types/packages/fs/index.d.ts +7 -7
- package/dist/types/packages/fs/interfaces.d.ts +4 -4
- package/dist/types/packages/fs/utils/parse-path.d.ts +2 -2
- package/dist/types/packages/fs/watcher/interfaces.d.ts +1 -1
- package/dist/types/packages/jsonapi/errors/invalid-content-type-error.d.ts +3 -5
- package/dist/types/packages/jsonapi/errors/not-acceptable-error.d.ts +2 -4
- package/dist/types/packages/jsonapi/errors/unsupported-media-type-error.d.ts +2 -4
- package/dist/types/packages/jsonapi/index.d.ts +1 -1
- package/dist/types/packages/jsonapi/interfaces.d.ts +47 -36
- package/dist/types/packages/jsonapi/utils/has-media-type-params.d.ts +1 -1
- package/dist/types/packages/jsonapi/utils/is-jsonapi.d.ts +1 -1
- package/dist/types/packages/jsonapi/utils/media-type.d.ts +2 -2
- package/dist/types/packages/loader/builder/index.d.ts +3 -3
- package/dist/types/packages/loader/builder/interfaces.d.ts +7 -7
- package/dist/types/packages/loader/builder/utils/create-children-builder.d.ts +2 -2
- package/dist/types/packages/loader/builder/utils/create-parent-builder.d.ts +9 -2
- package/dist/types/packages/loader/builder/utils/sort-by-namespace.d.ts +2 -2
- package/dist/types/packages/loader/index.d.ts +1 -1
- package/dist/types/packages/loader/interfaces.d.ts +2 -2
- package/dist/types/packages/loader/resolver/index.d.ts +2 -2
- package/dist/types/packages/loader/resolver/utils/closest-ancestor.d.ts +2 -2
- package/dist/types/packages/loader/resolver/utils/closest-child.d.ts +2 -2
- package/dist/types/packages/logger/constants.d.ts +3 -3
- package/dist/types/packages/logger/errors/invalid-config-error.d.ts +5 -0
- package/dist/types/packages/logger/index.d.ts +65 -142
- package/dist/types/packages/logger/interfaces.d.ts +52 -10
- package/dist/types/packages/logger/request-logger/index.d.ts +3 -5
- package/dist/types/packages/logger/request-logger/interfaces.d.ts +5 -5
- package/dist/types/packages/logger/request-logger/templates.d.ts +5 -9
- package/dist/types/packages/logger/request-logger/utils/filter-params.d.ts +6 -1
- package/dist/types/packages/logger/request-logger/utils/log-json.d.ts +2 -4
- package/dist/types/packages/logger/request-logger/utils/log-text.d.ts +1 -3
- package/dist/types/packages/logger/request-logger/utils/params-for.d.ts +9 -0
- package/dist/types/packages/logger/utils/error-name.d.ts +7 -0
- package/dist/types/packages/logger/utils/line.d.ts +1 -3
- package/dist/types/packages/logger/writer/constants.d.ts +0 -1
- package/dist/types/packages/logger/writer/index.d.ts +6 -6
- package/dist/types/packages/logger/writer/interfaces.d.ts +2 -2
- package/dist/types/packages/logger/writer/utils/format-message.d.ts +2 -2
- package/dist/types/packages/lumenify/index.d.ts +20 -5
- package/dist/types/packages/lumenify/utils/create-response-proxy.d.ts +1 -1
- package/dist/types/packages/pm/cluster/index.d.ts +56 -7
- package/dist/types/packages/pm/cluster/interfaces.d.ts +2 -1
- package/dist/types/packages/pm/index.d.ts +2 -2
- package/dist/types/packages/router/definitions/context/index.d.ts +5 -7
- package/dist/types/packages/router/definitions/context/utils/create-definition-group.d.ts +3 -5
- package/dist/types/packages/router/definitions/context/utils/create-definition.d.ts +11 -6
- package/dist/types/packages/router/definitions/context/utils/normalize-resource-args.d.ts +4 -5
- package/dist/types/packages/router/definitions/index.d.ts +5 -9
- package/dist/types/packages/router/definitions/interfaces.d.ts +4 -4
- package/dist/types/packages/router/index.d.ts +23 -11
- package/dist/types/packages/router/interfaces.d.ts +4 -4
- package/dist/types/packages/router/namespace/index.d.ts +7 -9
- package/dist/types/packages/router/namespace/interfaces.d.ts +3 -3
- package/dist/types/packages/router/namespace/utils/normalize-name.d.ts +1 -3
- package/dist/types/packages/router/namespace/utils/normalize-path.d.ts +1 -3
- package/dist/types/packages/router/resource/index.d.ts +7 -8
- package/dist/types/packages/router/resource/interfaces.d.ts +12 -4
- package/dist/types/packages/router/resource/utils/normalize-only.d.ts +3 -5
- package/dist/types/packages/router/route/action/enhancers/resource.d.ts +1 -3
- package/dist/types/packages/router/route/action/enhancers/track-perf.d.ts +1 -3
- package/dist/types/packages/router/route/action/index.d.ts +7 -2
- package/dist/types/packages/router/route/action/interfaces.d.ts +4 -0
- package/dist/types/packages/router/route/action/utils/create-page-links.d.ts +21 -5
- package/dist/types/packages/router/route/action/utils/get-action-name.d.ts +1 -3
- package/dist/types/packages/router/route/action/utils/get-controller-name.d.ts +1 -3
- package/dist/types/packages/router/route/index.d.ts +13 -9
- package/dist/types/packages/router/route/interfaces.d.ts +7 -5
- package/dist/types/packages/router/route/params/errors/client-generated-id-error.d.ts +4 -4
- package/dist/types/packages/router/route/params/errors/forbidden-parameter-error.d.ts +4 -4
- package/dist/types/packages/router/route/params/errors/index.d.ts +1 -0
- package/dist/types/packages/router/route/params/errors/invalid-parameter-error.d.ts +4 -6
- package/dist/types/packages/router/route/params/errors/parameter-not-nullable-error.d.ts +4 -6
- package/dist/types/packages/router/route/params/errors/parameter-range-error.d.ts +9 -0
- package/dist/types/packages/router/route/params/errors/parameter-required-error.d.ts +4 -6
- package/dist/types/packages/router/route/params/errors/parameter-type-error.d.ts +4 -6
- package/dist/types/packages/router/route/params/errors/parameter-value-error.d.ts +4 -6
- package/dist/types/packages/router/route/params/errors/resource-mismatch-error.d.ts +4 -6
- package/dist/types/packages/router/route/params/index.d.ts +5 -9
- package/dist/types/packages/router/route/params/interfaces.d.ts +12 -8
- package/dist/types/packages/router/route/params/parameter/forbidden-parameter.d.ts +1 -1
- package/dist/types/packages/router/route/params/parameter/ignored-parameter.d.ts +14 -0
- package/dist/types/packages/router/route/params/parameter/index.d.ts +21 -5
- package/dist/types/packages/router/route/params/parameter/interfaces.d.ts +2 -2
- package/dist/types/packages/router/route/params/parameter/utils/validate-range.d.ts +3 -0
- package/dist/types/packages/router/route/params/parameter/utils/validate-value.d.ts +1 -3
- package/dist/types/packages/router/route/params/parameter-group/index.d.ts +3 -5
- package/dist/types/packages/router/route/params/parameter-group/utils/missing-params.d.ts +8 -0
- package/dist/types/packages/router/route/params/utils/get-data-params.d.ts +5 -1
- package/dist/types/packages/router/route/params/utils/get-default-collection-params.d.ts +1 -3
- package/dist/types/packages/router/route/params/utils/get-default-member-params.d.ts +5 -2
- package/dist/types/packages/router/route/params/utils/get-query-params.d.ts +3 -9
- package/dist/types/packages/router/route/params/utils/get-url-params.d.ts +1 -3
- package/dist/types/packages/router/route/params/utils/parse-column-value.d.ts +16 -0
- package/dist/types/packages/router/route/params/utils/validate-client-id.d.ts +1 -1
- package/dist/types/packages/router/route/params/utils/validate-resource-id.d.ts +1 -3
- package/dist/types/packages/router/route/params/utils/validate-type.d.ts +3 -5
- package/dist/types/packages/router/route/utils/get-dynamic-segments.d.ts +1 -3
- package/dist/types/packages/router/route/utils/get-static-path.d.ts +6 -2
- package/dist/types/packages/router/utils/create-replacer.d.ts +10 -2
- package/dist/types/packages/serializer/index.d.ts +243 -434
- package/dist/types/packages/serializer/interfaces.d.ts +19 -1
- package/dist/types/packages/serializer/utils/include-tree.d.ts +12 -3
- package/dist/types/packages/serializer/utils/load-linkage.d.ts +9 -3
- package/dist/types/packages/server/errors/error-list.d.ts +25 -0
- package/dist/types/packages/server/errors/method-not-allowed-error.d.ts +11 -0
- package/dist/types/packages/server/index.d.ts +9 -9
- package/dist/types/packages/server/interfaces.d.ts +59 -7
- package/dist/types/packages/server/request/constants.d.ts +2 -2
- package/dist/types/packages/server/request/index.d.ts +3 -5
- package/dist/types/packages/server/request/interfaces.d.ts +72 -8
- package/dist/types/packages/server/request/parser/errors/malformed-request-error.d.ts +3 -5
- package/dist/types/packages/server/request/parser/index.d.ts +6 -1
- package/dist/types/packages/server/request/parser/utils/format.d.ts +13 -11
- package/dist/types/packages/server/request/parser/utils/normalize-document.d.ts +13 -0
- package/dist/types/packages/server/request/parser/utils/parse-nested-object.d.ts +1 -3
- package/dist/types/packages/server/request/parser/utils/parse-read.d.ts +2 -4
- package/dist/types/packages/server/request/parser/utils/parse-write.d.ts +17 -1
- package/dist/types/packages/server/request/utils/get-domain.d.ts +1 -3
- package/dist/types/packages/server/responder/index.d.ts +1 -3
- package/dist/types/packages/server/responder/utils/content-type-for.d.ts +8 -0
- package/dist/types/packages/server/responder/utils/data-for.d.ts +3 -5
- package/dist/types/packages/server/responder/utils/normalize.d.ts +2 -3
- package/dist/types/packages/server/response/index.d.ts +3 -5
- package/dist/types/packages/server/response/interfaces.d.ts +14 -3
- package/dist/types/packages/server/utils/client-ip-for.d.ts +10 -0
- package/dist/types/packages/server/utils/create-server-error.d.ts +11 -3
- package/dist/types/packages/server/utils/request-id-for.d.ts +9 -0
- package/dist/types/packages/server/utils/set-cors-headers.d.ts +2 -2
- package/dist/types/packages/server/utils/source-for.d.ts +19 -3
- package/dist/types/packages/server/utils/status-for-error.d.ts +6 -0
- package/dist/types/packages/server/utils/validate-accept.d.ts +1 -1
- package/dist/types/packages/server/utils/validate-content-type.d.ts +8 -3
- package/dist/types/packages/testing/audit-visibility.d.ts +189 -0
- package/dist/types/packages/testing/index.d.ts +4 -0
- package/dist/types/packages/testing/start-app.d.ts +52 -0
- package/dist/types/packages/testing/utils/identifiers-in.d.ts +14 -0
- package/dist/types/testing.d.ts +9 -0
- package/dist/types/utils/chalk.d.ts +16 -0
- package/dist/types/utils/pick.d.ts +2 -2
- package/package.json +54 -26
- package/dist/types/packages/cli/commands/test.d.ts +0 -4
- package/dist/types/packages/logger/utils/sql.d.ts +0 -4
- package/dist/types/packages/router/route/params/parameter-group/utils/has-required-params.d.ts +0 -5
- package/dist/types/utils/create-query-string.d.ts +0 -6
- package/dist/types/utils/has-own-property.d.ts +0 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export default function typeForColumn(column: Database$column): string | undefined;
|
|
1
|
+
import type { DatabaseColumn } from '../interfaces';
|
|
2
|
+
/** @internal */
|
|
3
|
+
export default function typeForColumn(column: DatabaseColumn): string | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModelClass } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Check every relationship of `models`, once all of them are initialized:
|
|
4
|
+
* its `inverse` must name a relationship on the related model that points
|
|
5
|
+
* back (or, for a join model, the many-to-many relationship through it), of
|
|
6
|
+
* a kind that pairs with it, and its foreign key must be a column where it
|
|
7
|
+
* is expected. A mistake used to surface only on the first write that set
|
|
8
|
+
* the relationship, as an unrelated-looking `500`. Throws listing every
|
|
9
|
+
* problem.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export default function validateRelationships(models: Iterable<ModelClass>): void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ServerErrorSource } from '../../../server';
|
|
2
2
|
/**
|
|
3
3
|
* A model validator (`static validates`) rejected an attribute. Answered with
|
|
4
4
|
* 422 and a pointer to the attribute, which clients such as ember-data map to
|
|
5
5
|
* field errors. The rejected value is deliberately not in the message: it
|
|
6
6
|
* ends up in logs and may be a secret (e.g. a password).
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @internal
|
|
9
9
|
*/
|
|
10
10
|
declare class ValidationError extends Error {
|
|
11
11
|
key: string;
|
|
12
|
-
source:
|
|
12
|
+
source: ServerErrorSource;
|
|
13
13
|
constructor(key: string);
|
|
14
14
|
}
|
|
15
|
-
declare const _default: new (...args: Array<any>) => ValidationError & import("../../../server
|
|
15
|
+
declare const _default: new (...args: Array<any>) => ValidationError & import("../../../server").ServerError;
|
|
16
16
|
export default _default;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
* @private
|
|
4
|
-
*/
|
|
1
|
+
import type { ValidationOptions } from './interfaces';
|
|
2
|
+
/** @internal */
|
|
5
3
|
declare class Validation<T> {
|
|
6
4
|
key: string;
|
|
7
5
|
value: T;
|
|
8
6
|
validator: (value?: T) => boolean;
|
|
9
|
-
constructor(opts:
|
|
7
|
+
constructor(opts: ValidationOptions<T>);
|
|
10
8
|
isValid(): boolean;
|
|
11
9
|
}
|
|
12
10
|
export default Validation;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private
|
|
3
|
-
*/
|
|
1
|
+
/** @internal */
|
|
4
2
|
export default function freeze<T extends object>(value: T): T;
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
3
|
+
/** @internal */
|
|
8
4
|
export declare function freezeArray<T>(target: T[]): readonly T[];
|
|
9
|
-
/**
|
|
10
|
-
* @private
|
|
11
|
-
*/
|
|
5
|
+
/** @internal */
|
|
12
6
|
export declare function freezeValue<T>(value: T): T;
|
|
13
|
-
/**
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
7
|
+
/** @internal */
|
|
16
8
|
export declare function freezeProps<T extends object>(target: T, makePublic: boolean, ...props: string[]): T;
|
|
17
|
-
/**
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
9
|
+
/** @internal */
|
|
20
10
|
export declare function deepFreezeProps<T extends object>(target: T, makePublic: boolean, ...props: string[]): T;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Stats } from 'fs';
|
|
2
2
|
import Watcher from './watcher';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ReadOptions, WriteOptions } from './interfaces';
|
|
4
4
|
export { default as rmrf } from './utils/rmrf';
|
|
5
5
|
export { default as exists } from './utils/exists';
|
|
6
6
|
export { default as isJSFile } from './utils/is-js-file';
|
|
7
7
|
export { default as parsePath } from './utils/parse-path';
|
|
8
|
-
export type {
|
|
8
|
+
export type { ParsedPath } from './interfaces';
|
|
9
9
|
/**
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
@@ -29,23 +29,23 @@ export declare function rmdir(path: string): Promise<void>;
|
|
|
29
29
|
/**
|
|
30
30
|
* @private
|
|
31
31
|
*/
|
|
32
|
-
export declare function readdir(path: string, opts?:
|
|
32
|
+
export declare function readdir(path: string, opts?: ReadOptions): Promise<Array<string>>;
|
|
33
33
|
/**
|
|
34
34
|
* @private
|
|
35
35
|
*/
|
|
36
|
-
export declare function readdirRec(path: string, opts?:
|
|
36
|
+
export declare function readdirRec(path: string, opts?: ReadOptions): Promise<Array<string>>;
|
|
37
37
|
/**
|
|
38
38
|
* @private
|
|
39
39
|
*/
|
|
40
|
-
export declare function readFile(path: string, opts?:
|
|
40
|
+
export declare function readFile(path: string, opts?: ReadOptions): Promise<string | Buffer>;
|
|
41
41
|
/**
|
|
42
42
|
* @private
|
|
43
43
|
*/
|
|
44
|
-
export declare function writeFile(path: string, data: string | Buffer, opts?:
|
|
44
|
+
export declare function writeFile(path: string, data: string | Buffer, opts?: WriteOptions): Promise<void>;
|
|
45
45
|
/**
|
|
46
46
|
* @private
|
|
47
47
|
*/
|
|
48
|
-
export declare function appendFile(path: string, data: string | Buffer, opts?:
|
|
48
|
+
export declare function appendFile(path: string, data: string | Buffer, opts?: WriteOptions): Promise<void>;
|
|
49
49
|
/**
|
|
50
50
|
* @private
|
|
51
51
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type WriteOptions = string | {
|
|
2
2
|
mode?: number;
|
|
3
3
|
flag?: string;
|
|
4
4
|
encoding?: string | null;
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
6
|
+
export type ReadOptions = string | {
|
|
7
7
|
flag?: string;
|
|
8
8
|
encoding?: string | null;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
11
|
-
export interface
|
|
10
|
+
export type PathRemover = (source: string) => string;
|
|
11
|
+
export interface ParsedPath {
|
|
12
12
|
root: string;
|
|
13
13
|
dir: string;
|
|
14
14
|
base: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ParsedPath } from '../index';
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
4
|
*/
|
|
5
|
-
export default function resolvePath(cwd?: string, dir?: string, name?: string):
|
|
5
|
+
export default function resolvePath(cwd?: string, dir?: string, name?: string): ParsedPath;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private
|
|
3
|
-
*/
|
|
1
|
+
/** @internal */
|
|
4
2
|
declare class InvalidContentTypeError extends TypeError {
|
|
5
|
-
constructor(contentType?: string);
|
|
3
|
+
constructor(contentType?: string, accepted?: Array<string>);
|
|
6
4
|
}
|
|
7
|
-
declare const _default: new (...args: Array<any>) => InvalidContentTypeError & import("../../server
|
|
5
|
+
declare const _default: new (...args: Array<any>) => InvalidContentTypeError & import("../../server").ServerError;
|
|
8
6
|
export default _default;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private
|
|
3
|
-
*/
|
|
1
|
+
/** @internal */
|
|
4
2
|
declare class NotAcceptableError extends TypeError {
|
|
5
3
|
constructor(accept: string);
|
|
6
4
|
}
|
|
7
|
-
declare const _default: new (...args: Array<any>) => NotAcceptableError & import("../../server
|
|
5
|
+
declare const _default: new (...args: Array<any>) => NotAcceptableError & import("../../server").ServerError;
|
|
8
6
|
export default _default;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private
|
|
3
|
-
*/
|
|
1
|
+
/** @internal */
|
|
4
2
|
declare class UnsupportedMediaTypeError extends TypeError {
|
|
5
3
|
constructor(contentType: string);
|
|
6
4
|
}
|
|
7
|
-
declare const _default: new (...args: Array<any>) => UnsupportedMediaTypeError & import("../../server
|
|
5
|
+
declare const _default: new (...args: Array<any>) => UnsupportedMediaTypeError & import("../../server").ServerError;
|
|
8
6
|
export default _default;
|
|
@@ -4,4 +4,4 @@ export { default as isJSONAPI } from './utils/is-jsonapi';
|
|
|
4
4
|
export { default as hasMediaTypeParams } from './utils/has-media-type-params';
|
|
5
5
|
export { parseAccept, parseMediaType } from './utils/media-type';
|
|
6
6
|
export type { MediaType } from './utils/media-type';
|
|
7
|
-
export type {
|
|
7
|
+
export type { JsonApiVersion, JsonApiDocument, JsonApiErrorObject, JsonApiDocumentLinks, JsonApiResourceObject, JsonApiIdentifierObject, JsonApiRelationshipObject, JsonApiRelationshipDocument } from './interfaces';
|
|
@@ -1,66 +1,77 @@
|
|
|
1
|
-
type
|
|
2
|
-
interface
|
|
3
|
-
[key: string]:
|
|
4
|
-
meta?:
|
|
1
|
+
type JsonApiValue = string | number | boolean | JsonApiBaseObject | Array<JsonApiBaseObject> | null | undefined;
|
|
2
|
+
interface JsonApiBaseObject {
|
|
3
|
+
[key: string]: JsonApiValue;
|
|
4
|
+
meta?: JsonApiBaseObject;
|
|
5
5
|
}
|
|
6
|
-
interface
|
|
6
|
+
interface JsonApiLinkObject {
|
|
7
7
|
href: string;
|
|
8
|
-
meta?:
|
|
8
|
+
meta?: JsonApiBaseObject;
|
|
9
9
|
}
|
|
10
|
-
type
|
|
11
|
-
interface
|
|
12
|
-
self?:
|
|
13
|
-
related?:
|
|
10
|
+
type JsonApiLink = string | JsonApiLinkObject | null;
|
|
11
|
+
interface JsonApiResourceLinksObject {
|
|
12
|
+
self?: JsonApiLink;
|
|
13
|
+
related?: JsonApiLink;
|
|
14
14
|
}
|
|
15
|
-
export type
|
|
16
|
-
export interface
|
|
15
|
+
export type JsonApiVersion = '1.0';
|
|
16
|
+
export interface JsonApiIdentifierObject {
|
|
17
17
|
id: string;
|
|
18
18
|
type: string;
|
|
19
|
-
meta?:
|
|
19
|
+
meta?: JsonApiBaseObject;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface JsonApiResourceObject {
|
|
22
22
|
id: string;
|
|
23
23
|
type: string;
|
|
24
|
-
links?:
|
|
25
|
-
attributes?:
|
|
24
|
+
links?: JsonApiResourceLinksObject;
|
|
25
|
+
attributes?: JsonApiBaseObject;
|
|
26
26
|
relationships?: {
|
|
27
|
-
[key: string]:
|
|
27
|
+
[key: string]: JsonApiRelationshipObject | null | undefined;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
export interface
|
|
31
|
-
data
|
|
32
|
-
meta?:
|
|
33
|
-
links?:
|
|
30
|
+
export interface JsonApiRelationshipObject {
|
|
31
|
+
data?: JsonApiIdentifierObject | Array<JsonApiIdentifierObject> | null;
|
|
32
|
+
meta?: JsonApiBaseObject;
|
|
33
|
+
links?: JsonApiResourceLinksObject;
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
36
|
-
first?:
|
|
37
|
-
last?:
|
|
38
|
-
prev?:
|
|
39
|
-
next?:
|
|
35
|
+
export interface JsonApiDocumentLinks extends JsonApiResourceLinksObject {
|
|
36
|
+
first?: JsonApiLink;
|
|
37
|
+
last?: JsonApiLink;
|
|
38
|
+
prev?: JsonApiLink | null;
|
|
39
|
+
next?: JsonApiLink | null;
|
|
40
40
|
}
|
|
41
|
-
export interface
|
|
41
|
+
export interface JsonApiErrorObject {
|
|
42
42
|
id?: string;
|
|
43
43
|
code?: string;
|
|
44
|
-
meta?:
|
|
44
|
+
meta?: JsonApiBaseObject;
|
|
45
45
|
title?: string;
|
|
46
46
|
status?: string;
|
|
47
47
|
detail?: string;
|
|
48
48
|
links?: {
|
|
49
|
-
about:
|
|
49
|
+
about: JsonApiLink;
|
|
50
50
|
};
|
|
51
51
|
source?: {
|
|
52
52
|
pointer?: string;
|
|
53
53
|
parameter?: string;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
export interface
|
|
57
|
-
data?: Array<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
export interface JsonApiDocument {
|
|
57
|
+
data?: Array<JsonApiResourceObject> | JsonApiResourceObject;
|
|
58
|
+
meta?: JsonApiBaseObject;
|
|
59
|
+
links?: JsonApiDocumentLinks;
|
|
60
|
+
errors?: Array<JsonApiErrorObject>;
|
|
61
|
+
included?: Array<JsonApiResourceObject>;
|
|
61
62
|
jsonapi?: {
|
|
62
|
-
version:
|
|
63
|
-
meta?:
|
|
63
|
+
version: JsonApiVersion;
|
|
64
|
+
meta?: JsonApiBaseObject;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The document a relationship endpoint responds with: the relationship's
|
|
69
|
+
* resource linkage as primary data.
|
|
70
|
+
*/
|
|
71
|
+
export interface JsonApiRelationshipDocument extends Omit<JsonApiRelationshipObject, 'links'> {
|
|
72
|
+
links: JsonApiResourceLinksObject;
|
|
73
|
+
jsonapi: {
|
|
74
|
+
version: JsonApiVersion;
|
|
64
75
|
};
|
|
65
76
|
}
|
|
66
77
|
export {};
|
|
@@ -5,7 +5,7 @@ export type MediaType = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Parse a single media type, e.g. a `Content-Type` header value.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export declare function parseMediaType(value: string): MediaType;
|
|
11
11
|
/**
|
|
@@ -14,6 +14,6 @@ export declare function parseMediaType(value: string): MediaType;
|
|
|
14
14
|
* Per RFC 7231 §5.3.2 the `q` weight (and any accept-extension after it) is
|
|
15
15
|
* not a media type parameter, so it is not reported in `params`.
|
|
16
16
|
*
|
|
17
|
-
* @
|
|
17
|
+
* @internal
|
|
18
18
|
*/
|
|
19
19
|
export declare function parseAccept(value: string): Array<MediaType>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { BundleNamespace } from '../index';
|
|
2
|
+
import type { BuilderClass, BuilderConstruct } from './interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* @private
|
|
5
5
|
*/
|
|
6
|
-
export declare function build<T>(group:
|
|
6
|
+
export declare function build<T>(group: BundleNamespace<BuilderClass<T>>, construct: BuilderConstruct<T>): BundleNamespace<T>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
1
|
+
import type { BundleNamespace, BundleNamespaceGroup } from '../index';
|
|
2
|
+
export type BuilderClass<T> = new (...args: Array<any>) => T;
|
|
3
|
+
export type NamespaceMeta<T> = {
|
|
4
4
|
key: string;
|
|
5
|
-
value:
|
|
5
|
+
value: BundleNamespace<BuilderClass<T>>;
|
|
6
6
|
parent: T | null;
|
|
7
7
|
};
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
8
|
+
export type ParentBuilder<T> = (target: BundleNamespaceGroup<BuilderClass<T>>) => Array<NamespaceMeta<T>>;
|
|
9
|
+
export type ChildrenBuilder<T> = (target: Array<NamespaceMeta<T>>) => Array<Array<[string, T]>>;
|
|
10
|
+
export type BuilderConstruct<T> = (key: string, value: BuilderClass<T>, parent?: T | null) => T;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export default function createChildrenBuilder<T>(construct:
|
|
1
|
+
import type { BuilderConstruct, ChildrenBuilder } from '../interfaces';
|
|
2
|
+
export default function createChildrenBuilder<T>(construct: BuilderConstruct<T>): ChildrenBuilder<T>;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { BuilderConstruct, ParentBuilder } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Build each namespace's `application` module and record it as the
|
|
4
|
+
* namespace's parent, constructed with its own parent namespace's. A
|
|
5
|
+
* namespace without an `application` module takes its closest ancestor's, so
|
|
6
|
+
* its modules still get what the ancestors' ApplicationControllers declare
|
|
7
|
+
* (hooks, settings).
|
|
8
|
+
*/
|
|
9
|
+
export default function createParentBuilder<T>(construct: BuilderConstruct<T>): ParentBuilder<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundleNamespace } from '../../index';
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
4
|
*/
|
|
5
|
-
export default function sortByNamespace<T>([a]: [string,
|
|
5
|
+
export default function sortByNamespace<T>([a]: [string, BundleNamespace<T>], [b]: [string, BundleNamespace<T>]): number;
|
|
@@ -5,4 +5,4 @@ import type { Loader } from './interfaces';
|
|
|
5
5
|
export declare function createLoader(path: string): Loader;
|
|
6
6
|
export { build } from './builder';
|
|
7
7
|
export { closestAncestor, closestChild } from './resolver';
|
|
8
|
-
export type { Loader,
|
|
8
|
+
export type { Loader, BundleNamespace, BundleNamespaceGroup } from './interfaces';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FreezeableMap } from '../freezeable';
|
|
2
2
|
export type Loader = (type: string) => any;
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
3
|
+
export type BundleNamespace<T> = FreezeableMap<string, T>;
|
|
4
|
+
export type BundleNamespaceGroup<T> = FreezeableMap<string, BundleNamespace<T>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundleNamespace, BundleNamespaceGroup } from '../index';
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
4
|
*/
|
|
5
|
-
export declare function resolve<T>(group:
|
|
5
|
+
export declare function resolve<T>(group: BundleNamespace<T>): BundleNamespaceGroup<T>;
|
|
6
6
|
export { default as closestAncestor } from './utils/closest-ancestor';
|
|
7
7
|
export { default as closestChild } from './utils/closest-child';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export default function closestAncestor<T>(source:
|
|
1
|
+
import type { BundleNamespace } from '../../index';
|
|
2
|
+
export default function closestAncestor<T>(source: BundleNamespace<T>, key: string): T | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export default function closestChild<T>(source:
|
|
1
|
+
import type { BundleNamespace } from '../../index';
|
|
2
|
+
export default function closestChild<T>(source: BundleNamespace<T>, key: string): T | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FreezeableMap, FreezeableSet } from '../freezeable';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LogLevel, LogFormat } from './interfaces';
|
|
3
3
|
export declare const DEBUG = "DEBUG";
|
|
4
4
|
export declare const INFO = "INFO";
|
|
5
5
|
export declare const WARN = "WARN";
|
|
6
6
|
export declare const ERROR = "ERROR";
|
|
7
|
-
export declare const FORMATS: FreezeableSet<
|
|
8
|
-
export declare const LEVELS: FreezeableMap<
|
|
7
|
+
export declare const FORMATS: FreezeableSet<LogFormat>;
|
|
8
|
+
export declare const LEVELS: FreezeableMap<LogLevel, number>;
|