@jfdevelops/react-layout 0.22.0 → 0.22.2
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/dist/create-config/create-resource-links.cjs +31 -17
- package/dist/create-config/create-resource-links.cjs.map +1 -1
- package/dist/create-config/create-resource-links.d.cts +9 -2
- package/dist/create-config/create-resource-links.d.cts.map +1 -1
- package/dist/create-config/create-resource-links.d.mts +9 -2
- package/dist/create-config/create-resource-links.d.mts.map +1 -1
- package/dist/create-config/create-resource-links.mjs +32 -17
- package/dist/create-config/create-resource-links.mjs.map +1 -1
- package/dist/create-config/define-layout.cjs +3 -2
- package/dist/create-config/define-layout.cjs.map +1 -1
- package/dist/create-config/define-layout.d.cts.map +1 -1
- package/dist/create-config/define-layout.d.mts.map +1 -1
- package/dist/create-config/define-layout.mjs +3 -2
- package/dist/create-config/define-layout.mjs.map +1 -1
- package/dist/create-config/for-paths/builder.cjs +6 -6
- package/dist/create-config/for-paths/builder.cjs.map +1 -1
- package/dist/create-config/for-paths/builder.mjs +6 -6
- package/dist/create-config/for-paths/builder.mjs.map +1 -1
- package/dist/create-config/for-resource.cjs +2 -1
- package/dist/create-config/for-resource.cjs.map +1 -1
- package/dist/create-config/for-resource.d.cts.map +1 -1
- package/dist/create-config/for-resource.d.mts.map +1 -1
- package/dist/create-config/for-resource.mjs +2 -1
- package/dist/create-config/for-resource.mjs.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.cjs +15 -14
- package/dist/create-config/for-resources/create-for-resources.cjs.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.mjs +15 -14
- package/dist/create-config/for-resources/create-for-resources.mjs.map +1 -1
- package/dist/create-config/index.d.cts +1 -1
- package/dist/create-config/index.d.mts +1 -1
- package/dist/errors/invalid-component.cjs +15 -7
- package/dist/errors/invalid-component.cjs.map +1 -1
- package/dist/errors/invalid-component.d.cts +106 -10
- package/dist/errors/invalid-component.d.cts.map +1 -1
- package/dist/errors/invalid-component.d.mts +106 -10
- package/dist/errors/invalid-component.d.mts.map +1 -1
- package/dist/errors/invalid-component.mjs +15 -7
- package/dist/errors/invalid-component.mjs.map +1 -1
- package/dist/errors/invalid-config.cjs +8 -3
- package/dist/errors/invalid-config.cjs.map +1 -1
- package/dist/errors/invalid-config.d.cts +96 -6
- package/dist/errors/invalid-config.d.cts.map +1 -1
- package/dist/errors/invalid-config.d.mts +96 -6
- package/dist/errors/invalid-config.d.mts.map +1 -1
- package/dist/errors/invalid-config.mjs +8 -3
- package/dist/errors/invalid-config.mjs.map +1 -1
- package/dist/errors/invalid-path.cjs +11 -5
- package/dist/errors/invalid-path.cjs.map +1 -1
- package/dist/errors/invalid-path.d.cts +100 -8
- package/dist/errors/invalid-path.d.cts.map +1 -1
- package/dist/errors/invalid-path.d.mts +100 -8
- package/dist/errors/invalid-path.d.mts.map +1 -1
- package/dist/errors/invalid-path.mjs +11 -5
- package/dist/errors/invalid-path.mjs.map +1 -1
- package/dist/errors/invalid-resource.cjs +11 -5
- package/dist/errors/invalid-resource.cjs.map +1 -1
- package/dist/errors/invalid-resource.d.cts +100 -8
- package/dist/errors/invalid-resource.d.cts.map +1 -1
- package/dist/errors/invalid-resource.d.mts +100 -8
- package/dist/errors/invalid-resource.d.mts.map +1 -1
- package/dist/errors/invalid-resource.mjs +11 -5
- package/dist/errors/invalid-resource.mjs.map +1 -1
- package/dist/errors/invalid-sub-resource.cjs +12 -5
- package/dist/errors/invalid-sub-resource.cjs.map +1 -1
- package/dist/errors/invalid-sub-resource.d.cts +103 -9
- package/dist/errors/invalid-sub-resource.d.cts.map +1 -1
- package/dist/errors/invalid-sub-resource.d.mts +103 -9
- package/dist/errors/invalid-sub-resource.d.mts.map +1 -1
- package/dist/errors/invalid-sub-resource.mjs +12 -5
- package/dist/errors/invalid-sub-resource.mjs.map +1 -1
- package/dist/errors/layout-configuration-error.cjs +17 -0
- package/dist/errors/layout-configuration-error.cjs.map +1 -0
- package/dist/errors/layout-configuration-error.d.cts +99 -0
- package/dist/errors/layout-configuration-error.d.cts.map +1 -0
- package/dist/errors/layout-configuration-error.d.mts +99 -0
- package/dist/errors/layout-configuration-error.d.mts.map +1 -0
- package/dist/errors/layout-configuration-error.mjs +17 -0
- package/dist/errors/layout-configuration-error.mjs.map +1 -0
- package/dist/errors/missing-path-variable.cjs +12 -5
- package/dist/errors/missing-path-variable.cjs.map +1 -1
- package/dist/errors/missing-path-variable.d.cts +99 -7
- package/dist/errors/missing-path-variable.d.cts.map +1 -1
- package/dist/errors/missing-path-variable.d.mts +99 -7
- package/dist/errors/missing-path-variable.d.mts.map +1 -1
- package/dist/errors/missing-path-variable.mjs +12 -5
- package/dist/errors/missing-path-variable.mjs.map +1 -1
- package/dist/errors/react-layout-error.cjs +38 -43
- package/dist/errors/react-layout-error.cjs.map +1 -1
- package/dist/errors/react-layout-error.d.cts +81 -38
- package/dist/errors/react-layout-error.d.cts.map +1 -1
- package/dist/errors/react-layout-error.d.mts +81 -38
- package/dist/errors/react-layout-error.d.mts.map +1 -1
- package/dist/errors/react-layout-error.mjs +39 -43
- package/dist/errors/react-layout-error.mjs.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.d.cts +4 -2
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +5 -4
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.cts +107 -0
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.mts +107 -0
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.mts.map +1 -0
- package/dist/resource.cjs +2 -1
- package/dist/resource.cjs.map +1 -1
- package/dist/resource.d.cts.map +1 -1
- package/dist/resource.d.mts.map +1 -1
- package/dist/resource.mjs +3 -1
- package/dist/resource.mjs.map +1 -1
- package/package.json +8 -6
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
const require_react_layout_error = require('./react-layout-error.cjs');
|
|
2
|
+
let arktype = require("arktype");
|
|
2
3
|
|
|
3
4
|
//#region src/errors/invalid-sub-resource.ts
|
|
4
|
-
const
|
|
5
|
+
const context = (0, arktype.type)({
|
|
6
|
+
"reason?": "string",
|
|
7
|
+
"resource?": "string",
|
|
8
|
+
scope: "'subResource'",
|
|
9
|
+
subResource: "unknown",
|
|
10
|
+
"validSubResources?": "string[]"
|
|
11
|
+
});
|
|
5
12
|
/** Thrown when a requested sub-resource is invalid or unavailable. */
|
|
6
13
|
var InvalidSubResourceError = class extends require_react_layout_error.createReactLayoutError({
|
|
7
14
|
code: "invalidSubResource",
|
|
8
|
-
scope
|
|
9
|
-
})((
|
|
10
|
-
return `[${scope}]: Sub-resource ${JSON.stringify(subResource) ?? `"${String(subResource)}"`}${resource ? ` for resource "${resource}"` : ""} is not available.${reason ? ` ${reason}` : ""}${validSubResources && validSubResources.length > 0 ? ` Available sub-resources are ${new Intl.ListFormat("en", {
|
|
15
|
+
scope: "subResource"
|
|
16
|
+
}).defineContext(context).implement(({ context, scope }) => {
|
|
17
|
+
return `[${scope}]: Sub-resource ${JSON.stringify(context.subResource) ?? `"${String(context.subResource)}"`}${context.resource ? ` for resource "${context.resource}"` : ""} is not available.${context.reason ? ` ${context.reason}` : ""}${context.validSubResources && context.validSubResources.length > 0 ? ` Available sub-resources are ${new Intl.ListFormat("en", {
|
|
11
18
|
style: "long",
|
|
12
19
|
type: "disjunction"
|
|
13
|
-
}).format(validSubResources)}.` : ""}`;
|
|
20
|
+
}).format(context.validSubResources)}.` : ""}`;
|
|
14
21
|
}) {};
|
|
15
22
|
|
|
16
23
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-sub-resource.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/invalid-sub-resource.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/invalid-sub-resource.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type({\n 'reason?': 'string',\n 'resource?': 'string',\n scope: \"'subResource'\",\n subResource: 'unknown',\n 'validSubResources?': 'string[]',\n});\n\nexport type InvalidSubResourceContext = typeof context.infer;\n\n/** Thrown when a requested sub-resource is invalid or unavailable. */\nexport class InvalidSubResourceError extends createReactLayoutError({\n code: 'invalidSubResource',\n scope: 'subResource',\n})\n .defineContext(context)\n .implement(({ context, scope }) => {\n const quotedSubResource =\n JSON.stringify(context.subResource) ??\n `\"${String(context.subResource)}\"`;\n const resourceMessage = context.resource\n ? ` for resource \"${context.resource}\"`\n : '';\n const reasonMessage = context.reason ? ` ${context.reason}` : '';\n const validSubResourcesMessage =\n context.validSubResources && context.validSubResources.length > 0\n ? ` Available sub-resources are ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(context.validSubResources)}.`\n : '';\n\n return `[${scope}]: Sub-resource ${quotedSubResource}${resourceMessage} is not available.${reasonMessage}${validSubResourcesMessage}`;\n }) {}\n"],"mappings":";;;;AAGA,MAAM,4BAAe;CACnB,WAAW;CACX,aAAa;CACb,OAAO;CACP,aAAa;CACb,sBAAsB;AACxB,CAAC;;AAKD,IAAa,0BAAb,cAA6CA,kDAAuB;CAClE,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WAAW,EAAE,SAAS,YAAY;CAgBjC,OAAO,IAAI,MAAM,kBAdf,KAAK,UAAU,QAAQ,WAAW,KAClC,IAAI,OAAO,QAAQ,WAAW,EAAE,KACV,QAAQ,WAC5B,kBAAkB,QAAQ,SAAS,KACnC,GAUmE,oBATjD,QAAQ,SAAS,IAAI,QAAQ,WAAW,KAE5D,QAAQ,qBAAqB,QAAQ,kBAAkB,SAAS,IAC5D,gCAAgC,IAAI,KAAK,WAAW,MAAM;EACxD,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,QAAQ,iBAAiB,EAAE,KACrC;AAGR,CAAC,EAAE,CAAC"}
|
|
@@ -1,15 +1,109 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors/invalid-sub-resource.d.ts
|
|
4
|
-
declare const
|
|
5
|
-
|
|
6
|
-
interface InvalidSubResourceContext extends ReactLayoutErrorContext<typeof scope> {
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
5
|
+
scope: "subResource";
|
|
7
6
|
subResource: unknown;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
7
|
+
reason?: string | undefined;
|
|
8
|
+
resource?: string | undefined;
|
|
9
|
+
validSubResources?: string[] | undefined;
|
|
10
|
+
}, {}>;
|
|
11
|
+
type InvalidSubResourceContext = typeof context.infer;
|
|
12
|
+
declare const InvalidSubResourceError_base: ImplementedErrorClass<{
|
|
13
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
14
|
+
code: string;
|
|
15
|
+
scope: string;
|
|
16
|
+
}, {}>;
|
|
17
|
+
} & {
|
|
18
|
+
data: {
|
|
19
|
+
readonly property: "context";
|
|
20
|
+
readonly resolve: ({
|
|
21
|
+
definition,
|
|
22
|
+
input
|
|
23
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
24
|
+
code: string;
|
|
25
|
+
scope: string;
|
|
26
|
+
}, {}>>) => {
|
|
27
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
message: ({
|
|
31
|
+
definition,
|
|
32
|
+
data,
|
|
33
|
+
implementation
|
|
34
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
35
|
+
code: string;
|
|
36
|
+
scope: string;
|
|
37
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
38
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
39
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
40
|
+
}>;
|
|
41
|
+
} & {
|
|
42
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
43
|
+
code: string;
|
|
44
|
+
scope: string;
|
|
45
|
+
}, {}>>): {
|
|
46
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
47
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
48
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
49
|
+
};
|
|
50
|
+
} & {
|
|
51
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
52
|
+
data: {
|
|
53
|
+
readonly property: "context";
|
|
54
|
+
readonly resolve: ({
|
|
55
|
+
definition,
|
|
56
|
+
input
|
|
57
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
58
|
+
code: string;
|
|
59
|
+
scope: string;
|
|
60
|
+
}, {}>>) => {
|
|
61
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
message: ({
|
|
65
|
+
definition,
|
|
66
|
+
data,
|
|
67
|
+
implementation
|
|
68
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
69
|
+
code: string;
|
|
70
|
+
scope: string;
|
|
71
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
72
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
73
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
74
|
+
}>;
|
|
75
|
+
} & {
|
|
76
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
77
|
+
code: string;
|
|
78
|
+
scope: string;
|
|
79
|
+
}, {}>>): {
|
|
80
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
81
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
82
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
83
|
+
};
|
|
84
|
+
}>>): {
|
|
85
|
+
name: string;
|
|
86
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
87
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
88
|
+
message: string;
|
|
89
|
+
context: unknown;
|
|
90
|
+
};
|
|
91
|
+
}, {
|
|
92
|
+
readonly code: string;
|
|
93
|
+
readonly scope: string;
|
|
94
|
+
}, {
|
|
95
|
+
scope: "subResource";
|
|
96
|
+
subResource: unknown;
|
|
97
|
+
reason?: string | undefined;
|
|
98
|
+
resource?: string | undefined;
|
|
99
|
+
validSubResources?: string[] | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
scope: "subResource";
|
|
102
|
+
subResource: unknown;
|
|
103
|
+
reason?: string | undefined;
|
|
104
|
+
resource?: string | undefined;
|
|
105
|
+
validSubResources?: string[] | undefined;
|
|
106
|
+
}>;
|
|
13
107
|
/** Thrown when a requested sub-resource is invalid or unavailable. */
|
|
14
108
|
declare class InvalidSubResourceError extends InvalidSubResourceError_base {}
|
|
15
109
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-sub-resource.d.cts","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.d.cts","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA;;;;;;;KAQD,yBAAA,UAAmC,OAAA,CAAQ,KAAK;AAAA,cAAC,4BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAGhD,uBAAA,SAAgC,4BAsBzC"}
|
|
@@ -1,15 +1,109 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors/invalid-sub-resource.d.ts
|
|
4
|
-
declare const
|
|
5
|
-
|
|
6
|
-
interface InvalidSubResourceContext extends ReactLayoutErrorContext<typeof scope> {
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
5
|
+
scope: "subResource";
|
|
7
6
|
subResource: unknown;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
7
|
+
reason?: string | undefined;
|
|
8
|
+
resource?: string | undefined;
|
|
9
|
+
validSubResources?: string[] | undefined;
|
|
10
|
+
}, {}>;
|
|
11
|
+
type InvalidSubResourceContext = typeof context.infer;
|
|
12
|
+
declare const InvalidSubResourceError_base: ImplementedErrorClass<{
|
|
13
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
14
|
+
code: string;
|
|
15
|
+
scope: string;
|
|
16
|
+
}, {}>;
|
|
17
|
+
} & {
|
|
18
|
+
data: {
|
|
19
|
+
readonly property: "context";
|
|
20
|
+
readonly resolve: ({
|
|
21
|
+
definition,
|
|
22
|
+
input
|
|
23
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
24
|
+
code: string;
|
|
25
|
+
scope: string;
|
|
26
|
+
}, {}>>) => {
|
|
27
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
message: ({
|
|
31
|
+
definition,
|
|
32
|
+
data,
|
|
33
|
+
implementation
|
|
34
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
35
|
+
code: string;
|
|
36
|
+
scope: string;
|
|
37
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
38
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
39
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
40
|
+
}>;
|
|
41
|
+
} & {
|
|
42
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
43
|
+
code: string;
|
|
44
|
+
scope: string;
|
|
45
|
+
}, {}>>): {
|
|
46
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
47
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
48
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
49
|
+
};
|
|
50
|
+
} & {
|
|
51
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
52
|
+
data: {
|
|
53
|
+
readonly property: "context";
|
|
54
|
+
readonly resolve: ({
|
|
55
|
+
definition,
|
|
56
|
+
input
|
|
57
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
58
|
+
code: string;
|
|
59
|
+
scope: string;
|
|
60
|
+
}, {}>>) => {
|
|
61
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
message: ({
|
|
65
|
+
definition,
|
|
66
|
+
data,
|
|
67
|
+
implementation
|
|
68
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
69
|
+
code: string;
|
|
70
|
+
scope: string;
|
|
71
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
72
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
73
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
74
|
+
}>;
|
|
75
|
+
} & {
|
|
76
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
77
|
+
code: string;
|
|
78
|
+
scope: string;
|
|
79
|
+
}, {}>>): {
|
|
80
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
81
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
82
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
83
|
+
};
|
|
84
|
+
}>>): {
|
|
85
|
+
name: string;
|
|
86
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
87
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
88
|
+
message: string;
|
|
89
|
+
context: unknown;
|
|
90
|
+
};
|
|
91
|
+
}, {
|
|
92
|
+
readonly code: string;
|
|
93
|
+
readonly scope: string;
|
|
94
|
+
}, {
|
|
95
|
+
scope: "subResource";
|
|
96
|
+
subResource: unknown;
|
|
97
|
+
reason?: string | undefined;
|
|
98
|
+
resource?: string | undefined;
|
|
99
|
+
validSubResources?: string[] | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
scope: "subResource";
|
|
102
|
+
subResource: unknown;
|
|
103
|
+
reason?: string | undefined;
|
|
104
|
+
resource?: string | undefined;
|
|
105
|
+
validSubResources?: string[] | undefined;
|
|
106
|
+
}>;
|
|
13
107
|
/** Thrown when a requested sub-resource is invalid or unavailable. */
|
|
14
108
|
declare class InvalidSubResourceError extends InvalidSubResourceError_base {}
|
|
15
109
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-sub-resource.d.mts","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.d.mts","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA;;;;;;;KAQD,yBAAA,UAAmC,OAAA,CAAQ,KAAK;AAAA,cAAC,4BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAGhD,uBAAA,SAAgC,4BAsBzC"}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { createReactLayoutError } from "./react-layout-error.mjs";
|
|
2
|
+
import { type } from "arktype";
|
|
2
3
|
|
|
3
4
|
//#region src/errors/invalid-sub-resource.ts
|
|
4
|
-
const
|
|
5
|
+
const context = type({
|
|
6
|
+
"reason?": "string",
|
|
7
|
+
"resource?": "string",
|
|
8
|
+
scope: "'subResource'",
|
|
9
|
+
subResource: "unknown",
|
|
10
|
+
"validSubResources?": "string[]"
|
|
11
|
+
});
|
|
5
12
|
/** Thrown when a requested sub-resource is invalid or unavailable. */
|
|
6
13
|
var InvalidSubResourceError = class extends createReactLayoutError({
|
|
7
14
|
code: "invalidSubResource",
|
|
8
|
-
scope
|
|
9
|
-
})((
|
|
10
|
-
return `[${scope}]: Sub-resource ${JSON.stringify(subResource) ?? `"${String(subResource)}"`}${resource ? ` for resource "${resource}"` : ""} is not available.${reason ? ` ${reason}` : ""}${validSubResources && validSubResources.length > 0 ? ` Available sub-resources are ${new Intl.ListFormat("en", {
|
|
15
|
+
scope: "subResource"
|
|
16
|
+
}).defineContext(context).implement(({ context, scope }) => {
|
|
17
|
+
return `[${scope}]: Sub-resource ${JSON.stringify(context.subResource) ?? `"${String(context.subResource)}"`}${context.resource ? ` for resource "${context.resource}"` : ""} is not available.${context.reason ? ` ${context.reason}` : ""}${context.validSubResources && context.validSubResources.length > 0 ? ` Available sub-resources are ${new Intl.ListFormat("en", {
|
|
11
18
|
style: "long",
|
|
12
19
|
type: "disjunction"
|
|
13
|
-
}).format(validSubResources)}.` : ""}`;
|
|
20
|
+
}).format(context.validSubResources)}.` : ""}`;
|
|
14
21
|
}) {};
|
|
15
22
|
|
|
16
23
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-sub-resource.mjs","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.mjs","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type({\n 'reason?': 'string',\n 'resource?': 'string',\n scope: \"'subResource'\",\n subResource: 'unknown',\n 'validSubResources?': 'string[]',\n});\n\nexport type InvalidSubResourceContext = typeof context.infer;\n\n/** Thrown when a requested sub-resource is invalid or unavailable. */\nexport class InvalidSubResourceError extends createReactLayoutError({\n code: 'invalidSubResource',\n scope: 'subResource',\n})\n .defineContext(context)\n .implement(({ context, scope }) => {\n const quotedSubResource =\n JSON.stringify(context.subResource) ??\n `\"${String(context.subResource)}\"`;\n const resourceMessage = context.resource\n ? ` for resource \"${context.resource}\"`\n : '';\n const reasonMessage = context.reason ? ` ${context.reason}` : '';\n const validSubResourcesMessage =\n context.validSubResources && context.validSubResources.length > 0\n ? ` Available sub-resources are ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(context.validSubResources)}.`\n : '';\n\n return `[${scope}]: Sub-resource ${quotedSubResource}${resourceMessage} is not available.${reasonMessage}${validSubResourcesMessage}`;\n }) {}\n"],"mappings":";;;;AAGA,MAAM,UAAU,KAAK;CACnB,WAAW;CACX,aAAa;CACb,OAAO;CACP,aAAa;CACb,sBAAsB;AACxB,CAAC;;AAKD,IAAa,0BAAb,cAA6C,uBAAuB;CAClE,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WAAW,EAAE,SAAS,YAAY;CAgBjC,OAAO,IAAI,MAAM,kBAdf,KAAK,UAAU,QAAQ,WAAW,KAClC,IAAI,OAAO,QAAQ,WAAW,EAAE,KACV,QAAQ,WAC5B,kBAAkB,QAAQ,SAAS,KACnC,GAUmE,oBATjD,QAAQ,SAAS,IAAI,QAAQ,WAAW,KAE5D,QAAQ,qBAAqB,QAAQ,kBAAkB,SAAS,IAC5D,gCAAgC,IAAI,KAAK,WAAW,MAAM;EACxD,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,QAAQ,iBAAiB,EAAE,KACrC;AAGR,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const require_react_layout_error = require('./react-layout-error.cjs');
|
|
2
|
+
let arktype = require("arktype");
|
|
3
|
+
|
|
4
|
+
//#region src/errors/layout-configuration-error.ts
|
|
5
|
+
const context = (0, arktype.type)("string").pipe((message) => ({
|
|
6
|
+
message,
|
|
7
|
+
scope: "configuration"
|
|
8
|
+
}));
|
|
9
|
+
/** Thrown when a layout or resource configuration cannot be used. */
|
|
10
|
+
var LayoutConfigurationError = class extends require_react_layout_error.createReactLayoutError({
|
|
11
|
+
code: "layoutConfiguration",
|
|
12
|
+
scope: "configuration"
|
|
13
|
+
}).defineContext(context).implement(({ context }) => context.message) {};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.LayoutConfigurationError = LayoutConfigurationError;
|
|
17
|
+
//# sourceMappingURL=layout-configuration-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-configuration-error.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/layout-configuration-error.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type('string').pipe((message) => ({\n message,\n scope: 'configuration',\n}));\n\nexport type LayoutConfigurationErrorContext = typeof context.infer;\n\n/** Thrown when a layout or resource configuration cannot be used. */\nexport class LayoutConfigurationError extends createReactLayoutError({\n code: 'layoutConfiguration',\n scope: 'configuration',\n})\n .defineContext(context)\n .implement(({ context }) => context.message) {}\n"],"mappings":";;;;AAGA,MAAM,4BAAe,QAAQ,EAAE,MAAM,aAAa;CAChD;CACA,OAAO;AACT,EAAE;;AAKF,IAAa,2BAAb,cAA8CA,kDAAuB;CACnE,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WAAW,EAAE,cAAc,QAAQ,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/layout-configuration-error.d.ts
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<(In: string) => import("arktype").Out<{
|
|
5
|
+
message: string;
|
|
6
|
+
scope: string;
|
|
7
|
+
}>, {}>;
|
|
8
|
+
type LayoutConfigurationErrorContext = typeof context.infer;
|
|
9
|
+
declare const LayoutConfigurationError_base: ImplementedErrorClass<{
|
|
10
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
11
|
+
code: string;
|
|
12
|
+
scope: string;
|
|
13
|
+
}, {}>;
|
|
14
|
+
} & {
|
|
15
|
+
data: {
|
|
16
|
+
readonly property: "context";
|
|
17
|
+
readonly resolve: ({
|
|
18
|
+
definition,
|
|
19
|
+
input
|
|
20
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
21
|
+
code: string;
|
|
22
|
+
scope: string;
|
|
23
|
+
}, {}>>) => {
|
|
24
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
message: ({
|
|
28
|
+
definition,
|
|
29
|
+
data,
|
|
30
|
+
implementation
|
|
31
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
32
|
+
code: string;
|
|
33
|
+
scope: string;
|
|
34
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
35
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
36
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
37
|
+
}>;
|
|
38
|
+
} & {
|
|
39
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
40
|
+
code: string;
|
|
41
|
+
scope: string;
|
|
42
|
+
}, {}>>): {
|
|
43
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
44
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
45
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
46
|
+
};
|
|
47
|
+
} & {
|
|
48
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
49
|
+
data: {
|
|
50
|
+
readonly property: "context";
|
|
51
|
+
readonly resolve: ({
|
|
52
|
+
definition,
|
|
53
|
+
input
|
|
54
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
55
|
+
code: string;
|
|
56
|
+
scope: string;
|
|
57
|
+
}, {}>>) => {
|
|
58
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
message: ({
|
|
62
|
+
definition,
|
|
63
|
+
data,
|
|
64
|
+
implementation
|
|
65
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
66
|
+
code: string;
|
|
67
|
+
scope: string;
|
|
68
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
69
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
70
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
71
|
+
}>;
|
|
72
|
+
} & {
|
|
73
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
74
|
+
code: string;
|
|
75
|
+
scope: string;
|
|
76
|
+
}, {}>>): {
|
|
77
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
78
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
79
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
80
|
+
};
|
|
81
|
+
}>>): {
|
|
82
|
+
name: string;
|
|
83
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
84
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
85
|
+
message: string;
|
|
86
|
+
context: unknown;
|
|
87
|
+
};
|
|
88
|
+
}, {
|
|
89
|
+
readonly code: string;
|
|
90
|
+
readonly scope: string;
|
|
91
|
+
}, string, {
|
|
92
|
+
message: string;
|
|
93
|
+
scope: string;
|
|
94
|
+
}>;
|
|
95
|
+
/** Thrown when a layout or resource configuration cannot be used. */
|
|
96
|
+
declare class LayoutConfigurationError extends LayoutConfigurationError_base {}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { LayoutConfigurationError, LayoutConfigurationErrorContext };
|
|
99
|
+
//# sourceMappingURL=layout-configuration-error.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-configuration-error.d.cts","names":[],"sources":["../../src/errors/layout-configuration-error.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA,EAAA,EAAA,+BAAA,GAAA;;;;KAKD,+BAAA,UAAyC,OAAA,CAAQ,KAAK;AAAA,cAAC,6BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAGtD,wBAAA,SAAiC,6BAKA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/layout-configuration-error.d.ts
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<(In: string) => import("arktype").Out<{
|
|
5
|
+
message: string;
|
|
6
|
+
scope: string;
|
|
7
|
+
}>, {}>;
|
|
8
|
+
type LayoutConfigurationErrorContext = typeof context.infer;
|
|
9
|
+
declare const LayoutConfigurationError_base: ImplementedErrorClass<{
|
|
10
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
11
|
+
code: string;
|
|
12
|
+
scope: string;
|
|
13
|
+
}, {}>;
|
|
14
|
+
} & {
|
|
15
|
+
data: {
|
|
16
|
+
readonly property: "context";
|
|
17
|
+
readonly resolve: ({
|
|
18
|
+
definition,
|
|
19
|
+
input
|
|
20
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
21
|
+
code: string;
|
|
22
|
+
scope: string;
|
|
23
|
+
}, {}>>) => {
|
|
24
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
message: ({
|
|
28
|
+
definition,
|
|
29
|
+
data,
|
|
30
|
+
implementation
|
|
31
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
32
|
+
code: string;
|
|
33
|
+
scope: string;
|
|
34
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
35
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
36
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
37
|
+
}>;
|
|
38
|
+
} & {
|
|
39
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
40
|
+
code: string;
|
|
41
|
+
scope: string;
|
|
42
|
+
}, {}>>): {
|
|
43
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
44
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
45
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
46
|
+
};
|
|
47
|
+
} & {
|
|
48
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
49
|
+
data: {
|
|
50
|
+
readonly property: "context";
|
|
51
|
+
readonly resolve: ({
|
|
52
|
+
definition,
|
|
53
|
+
input
|
|
54
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
55
|
+
code: string;
|
|
56
|
+
scope: string;
|
|
57
|
+
}, {}>>) => {
|
|
58
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
message: ({
|
|
62
|
+
definition,
|
|
63
|
+
data,
|
|
64
|
+
implementation
|
|
65
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
66
|
+
code: string;
|
|
67
|
+
scope: string;
|
|
68
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
69
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
70
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
71
|
+
}>;
|
|
72
|
+
} & {
|
|
73
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
74
|
+
code: string;
|
|
75
|
+
scope: string;
|
|
76
|
+
}, {}>>): {
|
|
77
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
78
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
79
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
80
|
+
};
|
|
81
|
+
}>>): {
|
|
82
|
+
name: string;
|
|
83
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
84
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
85
|
+
message: string;
|
|
86
|
+
context: unknown;
|
|
87
|
+
};
|
|
88
|
+
}, {
|
|
89
|
+
readonly code: string;
|
|
90
|
+
readonly scope: string;
|
|
91
|
+
}, string, {
|
|
92
|
+
message: string;
|
|
93
|
+
scope: string;
|
|
94
|
+
}>;
|
|
95
|
+
/** Thrown when a layout or resource configuration cannot be used. */
|
|
96
|
+
declare class LayoutConfigurationError extends LayoutConfigurationError_base {}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { LayoutConfigurationError, LayoutConfigurationErrorContext };
|
|
99
|
+
//# sourceMappingURL=layout-configuration-error.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-configuration-error.d.mts","names":[],"sources":["../../src/errors/layout-configuration-error.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA,EAAA,EAAA,+BAAA,GAAA;;;;KAKD,+BAAA,UAAyC,OAAA,CAAQ,KAAK;AAAA,cAAC,6BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAGtD,wBAAA,SAAiC,6BAKA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createReactLayoutError } from "./react-layout-error.mjs";
|
|
2
|
+
import { type } from "arktype";
|
|
3
|
+
|
|
4
|
+
//#region src/errors/layout-configuration-error.ts
|
|
5
|
+
const context = type("string").pipe((message) => ({
|
|
6
|
+
message,
|
|
7
|
+
scope: "configuration"
|
|
8
|
+
}));
|
|
9
|
+
/** Thrown when a layout or resource configuration cannot be used. */
|
|
10
|
+
var LayoutConfigurationError = class extends createReactLayoutError({
|
|
11
|
+
code: "layoutConfiguration",
|
|
12
|
+
scope: "configuration"
|
|
13
|
+
}).defineContext(context).implement(({ context }) => context.message) {};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { LayoutConfigurationError };
|
|
17
|
+
//# sourceMappingURL=layout-configuration-error.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-configuration-error.mjs","names":[],"sources":["../../src/errors/layout-configuration-error.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type('string').pipe((message) => ({\n message,\n scope: 'configuration',\n}));\n\nexport type LayoutConfigurationErrorContext = typeof context.infer;\n\n/** Thrown when a layout or resource configuration cannot be used. */\nexport class LayoutConfigurationError extends createReactLayoutError({\n code: 'layoutConfiguration',\n scope: 'configuration',\n})\n .defineContext(context)\n .implement(({ context }) => context.message) {}\n"],"mappings":";;;;AAGA,MAAM,UAAU,KAAK,QAAQ,EAAE,MAAM,aAAa;CAChD;CACA,OAAO;AACT,EAAE;;AAKF,IAAa,2BAAb,cAA8C,uBAAuB;CACnE,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WAAW,EAAE,cAAc,QAAQ,OAAO,EAAE,CAAC"}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
const require_react_layout_error = require('./react-layout-error.cjs');
|
|
2
|
+
let arktype = require("arktype");
|
|
2
3
|
|
|
3
4
|
//#region src/errors/missing-path-variable.ts
|
|
4
|
-
const
|
|
5
|
+
const context = (0, arktype.type)({
|
|
6
|
+
path: "string",
|
|
7
|
+
"providedVariables?": "string[]",
|
|
8
|
+
scope: "'pathVariable'",
|
|
9
|
+
variable: "string"
|
|
10
|
+
});
|
|
5
11
|
/** Thrown when a required layout path variable was not provided. */
|
|
6
12
|
var MissingPathVariableError = class extends require_react_layout_error.createReactLayoutError({
|
|
7
13
|
code: "missingPathVariable",
|
|
8
|
-
scope
|
|
9
|
-
})((
|
|
10
|
-
|
|
14
|
+
scope: "pathVariable"
|
|
15
|
+
}).defineContext(context).implement(({ context, scope }) => {
|
|
16
|
+
const providedMessage = context.providedVariables && context.providedVariables.length > 0 ? ` Provided variables were ${new Intl.ListFormat("en", {
|
|
11
17
|
style: "long",
|
|
12
18
|
type: "disjunction"
|
|
13
|
-
}).format(providedVariables.map((provided) => `$${provided}`))}.` : " No path variables were provided."
|
|
19
|
+
}).format(context.providedVariables.map((provided) => `$${provided}`))}.` : " No path variables were provided.";
|
|
20
|
+
return `[${scope}]: Path "${context.path}" requires $${context.variable}.${providedMessage}`;
|
|
14
21
|
}) {};
|
|
15
22
|
|
|
16
23
|
//#endregion
|