@k-4u/resource-mapper-core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aws-icons-last-updated +1 -0
- package/.svelte-kit/ambient.d.ts +263 -0
- package/.svelte-kit/generated/client/app.js +31 -0
- package/.svelte-kit/generated/client/matchers.js +1 -0
- package/.svelte-kit/generated/client/nodes/0.js +1 -0
- package/.svelte-kit/generated/client/nodes/1.js +1 -0
- package/.svelte-kit/generated/client/nodes/2.js +3 -0
- package/.svelte-kit/generated/client/nodes/3.js +3 -0
- package/.svelte-kit/generated/client-optimized/app.js +31 -0
- package/.svelte-kit/generated/client-optimized/matchers.js +1 -0
- package/.svelte-kit/generated/client-optimized/nodes/0.js +1 -0
- package/.svelte-kit/generated/client-optimized/nodes/1.js +1 -0
- package/.svelte-kit/generated/client-optimized/nodes/2.js +3 -0
- package/.svelte-kit/generated/client-optimized/nodes/3.js +3 -0
- package/.svelte-kit/generated/root.js +3 -0
- package/.svelte-kit/generated/root.svelte +68 -0
- package/.svelte-kit/generated/server/internal.js +53 -0
- package/.svelte-kit/non-ambient.d.ts +43 -0
- package/.svelte-kit/output/client/.vite/manifest.json +175 -0
- package/.svelte-kit/output/client/_app/immutable/assets/0.Czt_67iE.css +1 -0
- package/.svelte-kit/output/client/_app/immutable/assets/TeamContactCard.Dxj5nUCr.css +1 -0
- package/.svelte-kit/output/client/_app/immutable/assets/helpers.ysDrpaDf.css +1 -0
- package/.svelte-kit/output/client/_app/immutable/assets/libavoid.DQJapW5w.wasm +0 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/BlLuv0eP.js +46 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/CSBHmwYv.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/CTCi5ueQ.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/CfOzjaik.js +2 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/D4PdvFNs.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/DXgP-QUS.js +2 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/DlbDC5An.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/chunks/wRWe7aK9.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/entry/app.ConrMuHl.js +2 -0
- package/.svelte-kit/output/client/_app/immutable/entry/start.Bm6FyGme.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/nodes/0.d3cL-ETU.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/nodes/1.D6z9rPGv.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/nodes/2.CLD-8chl.js +1 -0
- package/.svelte-kit/output/client/_app/immutable/nodes/3.DXYeBoel.js +1 -0
- package/.svelte-kit/output/client/_app/version.json +1 -0
- package/.svelte-kit/output/client/libavoid.wasm +0 -0
- package/.svelte-kit/output/client/static/robots.txt +3 -0
- package/.svelte-kit/output/prerendered/dependencies/_app/env.js +1 -0
- package/.svelte-kit/output/server/.vite/manifest.json +224 -0
- package/.svelte-kit/output/server/_app/immutable/assets/LoadingOverlay.DBbe6V8W.css +1 -0
- package/.svelte-kit/output/server/_app/immutable/assets/_layout.Czt_67iE.css +1 -0
- package/.svelte-kit/output/server/_app/immutable/assets/_page.D9P41uDZ.css +1 -0
- package/.svelte-kit/output/server/chunks/ErrorDisplay.js +59 -0
- package/.svelte-kit/output/server/chunks/LoadingOverlay.js +12 -0
- package/.svelte-kit/output/server/chunks/LoadingOverlay.svelte_svelte_type_style_lang.js +1671 -0
- package/.svelte-kit/output/server/chunks/connections.js +33 -0
- package/.svelte-kit/output/server/chunks/diagram.js +7 -0
- package/.svelte-kit/output/server/chunks/environment.js +34 -0
- package/.svelte-kit/output/server/chunks/equality.js +57 -0
- package/.svelte-kit/output/server/chunks/exports.js +174 -0
- package/.svelte-kit/output/server/chunks/false.js +4 -0
- package/.svelte-kit/output/server/chunks/index.js +59 -0
- package/.svelte-kit/output/server/chunks/index2.js +2939 -0
- package/.svelte-kit/output/server/chunks/index3.js +20 -0
- package/.svelte-kit/output/server/chunks/internal.js +1017 -0
- package/.svelte-kit/output/server/chunks/shared.js +770 -0
- package/.svelte-kit/output/server/chunks/utils.js +43 -0
- package/.svelte-kit/output/server/entries/pages/_error.svelte.js +64 -0
- package/.svelte-kit/output/server/entries/pages/_layout.svelte.js +65 -0
- package/.svelte-kit/output/server/entries/pages/_page.svelte.js +3991 -0
- package/.svelte-kit/output/server/entries/pages/_page.ts.js +30 -0
- package/.svelte-kit/output/server/entries/pages/group/_groupId_/_page.svelte.js +67 -0
- package/.svelte-kit/output/server/entries/pages/group/_groupId_/_page.ts.js +47 -0
- package/.svelte-kit/output/server/index.js +3747 -0
- package/.svelte-kit/output/server/internal.js +13 -0
- package/.svelte-kit/output/server/manifest-full.js +47 -0
- package/.svelte-kit/output/server/manifest.js +47 -0
- package/.svelte-kit/output/server/nodes/0.js +8 -0
- package/.svelte-kit/output/server/nodes/1.js +8 -0
- package/.svelte-kit/output/server/nodes/2.js +10 -0
- package/.svelte-kit/output/server/nodes/3.js +10 -0
- package/.svelte-kit/output/server/remote-entry.js +557 -0
- package/.svelte-kit/tsconfig.json +61 -0
- package/.svelte-kit/types/route_meta_data.json +8 -0
- package/.svelte-kit/types/src/routes/$types.d.ts +26 -0
- package/.svelte-kit/types/src/routes/group/[groupId]/$types.d.ts +21 -0
- package/.svelte-kit/types/src/routes/group/[groupId]/proxy+page.ts +49 -0
- package/.svelte-kit/types/src/routes/proxy+page.ts +33 -0
- package/build/_app/env.js +1 -0
- package/build/_app/env.js.br +1 -0
- package/build/_app/env.js.gz +0 -0
- package/build/_app/immutable/assets/0.Czt_67iE.css +1 -0
- package/build/_app/immutable/assets/0.Czt_67iE.css.br +0 -0
- package/build/_app/immutable/assets/0.Czt_67iE.css.gz +0 -0
- package/build/_app/immutable/assets/TeamContactCard.Dxj5nUCr.css +1 -0
- package/build/_app/immutable/assets/TeamContactCard.Dxj5nUCr.css.br +0 -0
- package/build/_app/immutable/assets/TeamContactCard.Dxj5nUCr.css.gz +0 -0
- package/build/_app/immutable/assets/helpers.ysDrpaDf.css +1 -0
- package/build/_app/immutable/assets/helpers.ysDrpaDf.css.br +0 -0
- package/build/_app/immutable/assets/helpers.ysDrpaDf.css.gz +0 -0
- package/build/_app/immutable/assets/libavoid.DQJapW5w.wasm +0 -0
- package/build/_app/immutable/assets/libavoid.DQJapW5w.wasm.br +0 -0
- package/build/_app/immutable/assets/libavoid.DQJapW5w.wasm.gz +0 -0
- package/build/_app/immutable/chunks/BlLuv0eP.js +46 -0
- package/build/_app/immutable/chunks/BlLuv0eP.js.br +0 -0
- package/build/_app/immutable/chunks/BlLuv0eP.js.gz +0 -0
- package/build/_app/immutable/chunks/CSBHmwYv.js +1 -0
- package/build/_app/immutable/chunks/CSBHmwYv.js.br +0 -0
- package/build/_app/immutable/chunks/CSBHmwYv.js.gz +0 -0
- package/build/_app/immutable/chunks/CTCi5ueQ.js +1 -0
- package/build/_app/immutable/chunks/CTCi5ueQ.js.br +0 -0
- package/build/_app/immutable/chunks/CTCi5ueQ.js.gz +0 -0
- package/build/_app/immutable/chunks/CfOzjaik.js +2 -0
- package/build/_app/immutable/chunks/CfOzjaik.js.br +0 -0
- package/build/_app/immutable/chunks/CfOzjaik.js.gz +0 -0
- package/build/_app/immutable/chunks/D4PdvFNs.js +1 -0
- package/build/_app/immutable/chunks/D4PdvFNs.js.br +0 -0
- package/build/_app/immutable/chunks/D4PdvFNs.js.gz +0 -0
- package/build/_app/immutable/chunks/DXgP-QUS.js +2 -0
- package/build/_app/immutable/chunks/DXgP-QUS.js.br +0 -0
- package/build/_app/immutable/chunks/DXgP-QUS.js.gz +0 -0
- package/build/_app/immutable/chunks/DlbDC5An.js +1 -0
- package/build/_app/immutable/chunks/DlbDC5An.js.br +0 -0
- package/build/_app/immutable/chunks/DlbDC5An.js.gz +0 -0
- package/build/_app/immutable/chunks/wRWe7aK9.js +1 -0
- package/build/_app/immutable/chunks/wRWe7aK9.js.br +0 -0
- package/build/_app/immutable/chunks/wRWe7aK9.js.gz +0 -0
- package/build/_app/immutable/entry/app.ConrMuHl.js +2 -0
- package/build/_app/immutable/entry/app.ConrMuHl.js.br +0 -0
- package/build/_app/immutable/entry/app.ConrMuHl.js.gz +0 -0
- package/build/_app/immutable/entry/start.Bm6FyGme.js +1 -0
- package/build/_app/immutable/entry/start.Bm6FyGme.js.br +2 -0
- package/build/_app/immutable/entry/start.Bm6FyGme.js.gz +0 -0
- package/build/_app/immutable/nodes/0.d3cL-ETU.js +1 -0
- package/build/_app/immutable/nodes/0.d3cL-ETU.js.br +0 -0
- package/build/_app/immutable/nodes/0.d3cL-ETU.js.gz +0 -0
- package/build/_app/immutable/nodes/1.D6z9rPGv.js +1 -0
- package/build/_app/immutable/nodes/1.D6z9rPGv.js.br +0 -0
- package/build/_app/immutable/nodes/1.D6z9rPGv.js.gz +0 -0
- package/build/_app/immutable/nodes/2.CLD-8chl.js +1 -0
- package/build/_app/immutable/nodes/2.CLD-8chl.js.br +0 -0
- package/build/_app/immutable/nodes/2.CLD-8chl.js.gz +0 -0
- package/build/_app/immutable/nodes/3.DXYeBoel.js +1 -0
- package/build/_app/immutable/nodes/3.DXYeBoel.js.br +0 -0
- package/build/_app/immutable/nodes/3.DXYeBoel.js.gz +0 -0
- package/build/_app/version.json +1 -0
- package/build/_app/version.json.br +0 -0
- package/build/_app/version.json.gz +0 -0
- package/build/index.html +34 -0
- package/build/index.html.br +0 -0
- package/build/index.html.gz +0 -0
- package/build/libavoid.wasm +0 -0
- package/build/libavoid.wasm.br +0 -0
- package/build/libavoid.wasm.gz +0 -0
- package/build/static/robots.txt +3 -0
- package/coverage/coverage-final.json +6 -0
- package/coverage/coverage-summary.json +7 -0
- package/coverage/junit.xml +57 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +131 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/stores/index.html +116 -0
- package/coverage/lcov-report/stores/routingStore.ts.html +781 -0
- package/coverage/lcov-report/utils/flow/helpers.ts.html +127 -0
- package/coverage/lcov-report/utils/flow/index.html +161 -0
- package/coverage/lcov-report/utils/flow/layout.ts.html +805 -0
- package/coverage/lcov-report/utils/flow/serviceIds.ts.html +97 -0
- package/coverage/lcov-report/utils/flow/servicesGraph.ts.html +859 -0
- package/coverage/lcov.info +646 -0
- package/coverage/test-results.json +1 -0
- package/data/services/api/api-gateway.yaml +18 -0
- package/data/services/api/group-info.yaml +7 -0
- package/data/services/api/lambda-orders.yaml +21 -0
- package/data/services/api/lambda-products.yaml +15 -0
- package/data/services/api/lambda-users.yaml +15 -0
- package/data/services/compute/alb.yaml +15 -0
- package/data/services/compute/ecs-inventory.yaml +16 -0
- package/data/services/compute/ecs-notification.yaml +15 -0
- package/data/services/compute/group-info.yaml +7 -0
- package/data/services/data/dynamodb-notifications.yaml +12 -0
- package/data/services/data/dynamodb-orders.yaml +9 -0
- package/data/services/data/dynamodb-products.yaml +9 -0
- package/data/services/data/dynamodb-users.yaml +9 -0
- package/data/services/data/group-info.yaml +7 -0
- package/data/services/data/rds-postgres.yaml +9 -0
- package/data/services/data/redis.yaml +10 -0
- package/data/services/frontend/cloudfront.yaml +12 -0
- package/data/services/frontend/group-info.yaml +7 -0
- package/data/services/frontend/route53.yaml +15 -0
- package/data/services/frontend/s3-website.yaml +9 -0
- package/data/teams/cloud-shepherds.yaml +15 -0
- package/data/teams/data-wizards.yaml +15 -0
- package/data/teams/interface-architects.yaml +19 -0
- package/e2e/demo.test.ts +54 -0
- package/e2e/header-toolbar.simple.spec.ts +0 -0
- package/e2e/header-toolbar.spec.ts +53 -0
- package/e2e/layout.spec.ts +30 -0
- package/package.json +69 -0
- package/playwright.config.ts +10 -0
- package/plugins/mapper-data-plugin.ts +32 -0
- package/project.json +23 -0
- package/src/app.css +125 -0
- package/src/app.d.ts +31 -0
- package/src/app.html +11 -0
- package/src/lib/assets/favicon.svg +19 -0
- package/src/lib/components/EmptyState.svelte +37 -0
- package/src/lib/components/ErrorDisplay.svelte +82 -0
- package/src/lib/components/FlowCanvas.svelte +223 -0
- package/src/lib/components/GenericSidebarCard.svelte +44 -0
- package/src/lib/components/GroupDetailSidebar.svelte +31 -0
- package/src/lib/components/Header.svelte +57 -0
- package/src/lib/components/Legend.svelte +25 -0
- package/src/lib/components/LoadingOverlay.svelte +42 -0
- package/src/lib/components/LoadingSpinner.svelte +10 -0
- package/src/lib/components/ServiceDetailSidebar.svelte +90 -0
- package/src/lib/components/TeamContactCard.svelte +166 -0
- package/src/lib/components/flow/ExternalNode.svelte +45 -0
- package/src/lib/components/flow/MainGroupNode.svelte +24 -0
- package/src/lib/components/flow/ServiceGroupNode.svelte +17 -0
- package/src/lib/components/flow/ServiceNode.svelte +40 -0
- package/src/lib/components/flow/SnakeEdge.svelte +206 -0
- package/src/lib/components/flow/index.ts +6 -0
- package/src/lib/components/index.ts +12 -0
- package/src/lib/data/connections.ts +26 -0
- package/src/lib/data/groups.ts +11 -0
- package/src/lib/data/services.ts +12 -0
- package/src/lib/data/teams.ts +11 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/state/theme.svelte.ts +21 -0
- package/src/lib/stores/diagram.ts +6 -0
- package/src/lib/stores/routingStore.test.ts +133 -0
- package/src/lib/stores/routingStore.ts +232 -0
- package/src/lib/utils/awsIcons.ts +117 -0
- package/src/lib/utils/flow/groupOverviewGraph.ts +73 -0
- package/src/lib/utils/flow/helpers.ts +14 -0
- package/src/lib/utils/flow/layout.test.ts +271 -0
- package/src/lib/utils/flow/layout.ts +240 -0
- package/src/lib/utils/flow/serviceIds.ts +5 -0
- package/src/lib/utils/flow/servicesGraph.test.ts +119 -0
- package/src/lib/utils/flow/servicesGraph.ts +258 -0
- package/src/routes/+error.svelte +36 -0
- package/src/routes/+layout.svelte +27 -0
- package/src/routes/+page.svelte +81 -0
- package/src/routes/+page.ts +31 -0
- package/src/routes/group/[groupId]/+page.svelte +102 -0
- package/src/routes/group/[groupId]/+page.ts +48 -0
- package/src/routes/layout.css +0 -0
- package/static/static/robots.txt +3 -0
- package/svelte.config.js +28 -0
- package/tailwind.config.js +12 -0
- package/tsconfig.json +22 -0
- package/vite.config.ts +81 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import { get_request_store, with_request_store } from "@sveltejs/kit/internal/server";
|
|
2
|
+
import { parse } from "devalue";
|
|
3
|
+
import { error, json } from "@sveltejs/kit";
|
|
4
|
+
import { u as stringify_remote_arg, v as flatten_issues, w as create_field_proxy, x as normalize_issue, y as set_nested_value, z as deep_set, k as stringify, f as create_remote_key, h as handle_error_and_jsonify } from "./chunks/shared.js";
|
|
5
|
+
import { ValidationError, HttpError, SvelteKitError } from "@sveltejs/kit/internal";
|
|
6
|
+
import { B as BROWSER } from "./chunks/false.js";
|
|
7
|
+
import { b as base, c as app_dir, p as prerendering } from "./chunks/environment.js";
|
|
8
|
+
function create_validator(validate_or_fn, maybe_fn) {
|
|
9
|
+
if (!maybe_fn) {
|
|
10
|
+
return (arg) => {
|
|
11
|
+
if (arg !== void 0) {
|
|
12
|
+
error(400, "Bad Request");
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
if (validate_or_fn === "unchecked") {
|
|
17
|
+
return (arg) => arg;
|
|
18
|
+
}
|
|
19
|
+
if ("~standard" in validate_or_fn) {
|
|
20
|
+
return async (arg) => {
|
|
21
|
+
const { event, state } = get_request_store();
|
|
22
|
+
const result = await validate_or_fn["~standard"].validate(arg);
|
|
23
|
+
if (result.issues) {
|
|
24
|
+
error(
|
|
25
|
+
400,
|
|
26
|
+
await state.handleValidationError({
|
|
27
|
+
issues: result.issues,
|
|
28
|
+
event
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return result.value;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
throw new Error(
|
|
36
|
+
'Invalid validator passed to remote function. Expected "unchecked" or a Standard Schema (https://standardschema.dev)'
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
async function get_response(info, arg, state, get_result) {
|
|
40
|
+
await 0;
|
|
41
|
+
const cache = get_cache(info, state);
|
|
42
|
+
return cache[stringify_remote_arg(arg, state.transport)] ??= get_result();
|
|
43
|
+
}
|
|
44
|
+
function parse_remote_response(data, transport) {
|
|
45
|
+
const revivers = {};
|
|
46
|
+
for (const key in transport) {
|
|
47
|
+
revivers[key] = transport[key].decode;
|
|
48
|
+
}
|
|
49
|
+
return parse(data, revivers);
|
|
50
|
+
}
|
|
51
|
+
async function run_remote_function(event, state, allow_cookies, get_input, fn) {
|
|
52
|
+
const store = {
|
|
53
|
+
event: {
|
|
54
|
+
...event,
|
|
55
|
+
setHeaders: () => {
|
|
56
|
+
throw new Error("setHeaders is not allowed in remote functions");
|
|
57
|
+
},
|
|
58
|
+
cookies: {
|
|
59
|
+
...event.cookies,
|
|
60
|
+
set: (name, value, opts) => {
|
|
61
|
+
if (!allow_cookies) {
|
|
62
|
+
throw new Error("Cannot set cookies in `query` or `prerender` functions");
|
|
63
|
+
}
|
|
64
|
+
if (opts.path && !opts.path.startsWith("/")) {
|
|
65
|
+
throw new Error("Cookies set in remote functions must have an absolute path");
|
|
66
|
+
}
|
|
67
|
+
return event.cookies.set(name, value, opts);
|
|
68
|
+
},
|
|
69
|
+
delete: (name, opts) => {
|
|
70
|
+
if (!allow_cookies) {
|
|
71
|
+
throw new Error("Cannot delete cookies in `query` or `prerender` functions");
|
|
72
|
+
}
|
|
73
|
+
if (opts.path && !opts.path.startsWith("/")) {
|
|
74
|
+
throw new Error("Cookies deleted in remote functions must have an absolute path");
|
|
75
|
+
}
|
|
76
|
+
return event.cookies.delete(name, opts);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
state: {
|
|
81
|
+
...state,
|
|
82
|
+
is_in_remote_function: true
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const input = await with_request_store(store, get_input);
|
|
86
|
+
return with_request_store(store, () => fn(input));
|
|
87
|
+
}
|
|
88
|
+
function get_cache(info, state = get_request_store().state) {
|
|
89
|
+
let cache = state.remote_data?.get(info);
|
|
90
|
+
if (cache === void 0) {
|
|
91
|
+
cache = {};
|
|
92
|
+
(state.remote_data ??= /* @__PURE__ */ new Map()).set(info, cache);
|
|
93
|
+
}
|
|
94
|
+
return cache;
|
|
95
|
+
}
|
|
96
|
+
// @__NO_SIDE_EFFECTS__
|
|
97
|
+
function command(validate_or_fn, maybe_fn) {
|
|
98
|
+
const fn = maybe_fn ?? validate_or_fn;
|
|
99
|
+
const validate = create_validator(validate_or_fn, maybe_fn);
|
|
100
|
+
const __ = { type: "command", id: "", name: "" };
|
|
101
|
+
const wrapper = (arg) => {
|
|
102
|
+
const { event, state } = get_request_store();
|
|
103
|
+
if (state.is_endpoint_request) {
|
|
104
|
+
if (!["POST", "PUT", "PATCH", "DELETE"].includes(event.request.method)) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Cannot call a command (\`${__.name}(${maybe_fn ? "..." : ""})\`) from a ${event.request.method} handler`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
} else if (!event.isRemoteRequest) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
`Cannot call a command (\`${__.name}(${maybe_fn ? "..." : ""})\`) during server-side rendering`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
state.refreshes ??= {};
|
|
115
|
+
const promise = Promise.resolve(
|
|
116
|
+
run_remote_function(event, state, true, () => validate(arg), fn)
|
|
117
|
+
);
|
|
118
|
+
promise.updates = () => {
|
|
119
|
+
throw new Error(`Cannot call '${__.name}(...).updates(...)' on the server`);
|
|
120
|
+
};
|
|
121
|
+
return (
|
|
122
|
+
/** @type {ReturnType<RemoteCommand<Input, Output>>} */
|
|
123
|
+
promise
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
Object.defineProperty(wrapper, "__", { value: __ });
|
|
127
|
+
Object.defineProperty(wrapper, "pending", {
|
|
128
|
+
get: () => 0
|
|
129
|
+
});
|
|
130
|
+
return wrapper;
|
|
131
|
+
}
|
|
132
|
+
// @__NO_SIDE_EFFECTS__
|
|
133
|
+
function form(validate_or_fn, maybe_fn) {
|
|
134
|
+
const fn = maybe_fn ?? validate_or_fn;
|
|
135
|
+
const schema = !maybe_fn || validate_or_fn === "unchecked" ? null : (
|
|
136
|
+
/** @type {any} */
|
|
137
|
+
validate_or_fn
|
|
138
|
+
);
|
|
139
|
+
function create_instance(key) {
|
|
140
|
+
const instance = {};
|
|
141
|
+
instance.method = "POST";
|
|
142
|
+
Object.defineProperty(instance, "enhance", {
|
|
143
|
+
value: () => {
|
|
144
|
+
return { action: instance.action, method: instance.method };
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const __ = {
|
|
148
|
+
type: "form",
|
|
149
|
+
name: "",
|
|
150
|
+
id: "",
|
|
151
|
+
fn: async (data, meta, form_data) => {
|
|
152
|
+
const output = {};
|
|
153
|
+
output.submission = true;
|
|
154
|
+
const { event, state } = get_request_store();
|
|
155
|
+
const validated = await schema?.["~standard"].validate(data);
|
|
156
|
+
if (meta.validate_only) {
|
|
157
|
+
return validated?.issues?.map((issue) => normalize_issue(issue, true)) ?? [];
|
|
158
|
+
}
|
|
159
|
+
if (validated?.issues !== void 0) {
|
|
160
|
+
handle_issues(output, validated.issues, form_data);
|
|
161
|
+
} else {
|
|
162
|
+
if (validated !== void 0) {
|
|
163
|
+
data = validated.value;
|
|
164
|
+
}
|
|
165
|
+
state.refreshes ??= {};
|
|
166
|
+
const issue = create_issues();
|
|
167
|
+
try {
|
|
168
|
+
output.result = await run_remote_function(
|
|
169
|
+
event,
|
|
170
|
+
state,
|
|
171
|
+
true,
|
|
172
|
+
() => data,
|
|
173
|
+
(data2) => !maybe_fn ? fn() : fn(data2, issue)
|
|
174
|
+
);
|
|
175
|
+
} catch (e) {
|
|
176
|
+
if (e instanceof ValidationError) {
|
|
177
|
+
handle_issues(output, e.issues, form_data);
|
|
178
|
+
} else {
|
|
179
|
+
throw e;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (!event.isRemoteRequest) {
|
|
184
|
+
get_cache(__, state)[""] ??= output;
|
|
185
|
+
}
|
|
186
|
+
return output;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
Object.defineProperty(instance, "__", { value: __ });
|
|
190
|
+
Object.defineProperty(instance, "action", {
|
|
191
|
+
get: () => `?/remote=${__.id}`,
|
|
192
|
+
enumerable: true
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(instance, "fields", {
|
|
195
|
+
get() {
|
|
196
|
+
const data = get_cache(__)?.[""];
|
|
197
|
+
const issues = flatten_issues(data?.issues ?? []);
|
|
198
|
+
return create_field_proxy(
|
|
199
|
+
{},
|
|
200
|
+
() => data?.input ?? {},
|
|
201
|
+
(path, value) => {
|
|
202
|
+
if (data?.submission) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const input = path.length === 0 ? value : deep_set(data?.input ?? {}, path.map(String), value);
|
|
206
|
+
(get_cache(__)[""] ??= {}).input = input;
|
|
207
|
+
},
|
|
208
|
+
() => issues
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
Object.defineProperty(instance, "result", {
|
|
213
|
+
get() {
|
|
214
|
+
try {
|
|
215
|
+
return get_cache(__)?.[""]?.result;
|
|
216
|
+
} catch {
|
|
217
|
+
return void 0;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(instance, "pending", {
|
|
222
|
+
get: () => 0
|
|
223
|
+
});
|
|
224
|
+
Object.defineProperty(instance, "preflight", {
|
|
225
|
+
// preflight is a noop on the server
|
|
226
|
+
value: () => instance
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(instance, "validate", {
|
|
229
|
+
value: () => {
|
|
230
|
+
throw new Error("Cannot call validate() on the server");
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
if (key == void 0) {
|
|
234
|
+
Object.defineProperty(instance, "for", {
|
|
235
|
+
/** @type {RemoteForm<any, any>['for']} */
|
|
236
|
+
value: (key2) => {
|
|
237
|
+
const { state } = get_request_store();
|
|
238
|
+
const cache_key = __.id + "|" + JSON.stringify(key2);
|
|
239
|
+
let instance2 = (state.form_instances ??= /* @__PURE__ */ new Map()).get(cache_key);
|
|
240
|
+
if (!instance2) {
|
|
241
|
+
instance2 = create_instance(key2);
|
|
242
|
+
instance2.__.id = `${__.id}/${encodeURIComponent(JSON.stringify(key2))}`;
|
|
243
|
+
instance2.__.name = __.name;
|
|
244
|
+
state.form_instances.set(cache_key, instance2);
|
|
245
|
+
}
|
|
246
|
+
return instance2;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return instance;
|
|
251
|
+
}
|
|
252
|
+
return create_instance();
|
|
253
|
+
}
|
|
254
|
+
function handle_issues(output, issues, form_data) {
|
|
255
|
+
output.issues = issues.map((issue) => normalize_issue(issue, true));
|
|
256
|
+
if (form_data) {
|
|
257
|
+
output.input = {};
|
|
258
|
+
for (let key of form_data.keys()) {
|
|
259
|
+
if (/^[.\]]?_/.test(key)) continue;
|
|
260
|
+
const is_array = key.endsWith("[]");
|
|
261
|
+
const values = form_data.getAll(key).filter((value) => typeof value === "string");
|
|
262
|
+
if (is_array) key = key.slice(0, -2);
|
|
263
|
+
set_nested_value(
|
|
264
|
+
/** @type {Record<string, any>} */
|
|
265
|
+
output.input,
|
|
266
|
+
key,
|
|
267
|
+
is_array ? values : values[0]
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function create_issues() {
|
|
273
|
+
return (
|
|
274
|
+
/** @type {InvalidField<any>} */
|
|
275
|
+
new Proxy(
|
|
276
|
+
/** @param {string} message */
|
|
277
|
+
(message) => {
|
|
278
|
+
if (typeof message !== "string") {
|
|
279
|
+
throw new Error(
|
|
280
|
+
"`invalid` should now be imported from `@sveltejs/kit` to throw validation issues. The second parameter provided to the form function (renamed to `issue`) is still used to construct issues, e.g. `invalid(issue.field('message'))`. For more info see https://github.com/sveltejs/kit/pulls/14768"
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
return create_issue(message);
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
get(target, prop) {
|
|
287
|
+
if (typeof prop === "symbol") return (
|
|
288
|
+
/** @type {any} */
|
|
289
|
+
target[prop]
|
|
290
|
+
);
|
|
291
|
+
return create_issue_proxy(prop, []);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
);
|
|
296
|
+
function create_issue(message, path = []) {
|
|
297
|
+
return {
|
|
298
|
+
message,
|
|
299
|
+
path
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function create_issue_proxy(key, path) {
|
|
303
|
+
const new_path = [...path, key];
|
|
304
|
+
const issue_func = (message) => create_issue(message, new_path);
|
|
305
|
+
return new Proxy(issue_func, {
|
|
306
|
+
get(target, prop) {
|
|
307
|
+
if (typeof prop === "symbol") return (
|
|
308
|
+
/** @type {any} */
|
|
309
|
+
target[prop]
|
|
310
|
+
);
|
|
311
|
+
if (/^\d+$/.test(prop)) {
|
|
312
|
+
return create_issue_proxy(parseInt(prop, 10), new_path);
|
|
313
|
+
}
|
|
314
|
+
return create_issue_proxy(prop, new_path);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
// @__NO_SIDE_EFFECTS__
|
|
320
|
+
function prerender(validate_or_fn, fn_or_options, maybe_options) {
|
|
321
|
+
const maybe_fn = typeof fn_or_options === "function" ? fn_or_options : void 0;
|
|
322
|
+
const options = maybe_options ?? (maybe_fn ? void 0 : fn_or_options);
|
|
323
|
+
const fn = maybe_fn ?? validate_or_fn;
|
|
324
|
+
const validate = create_validator(validate_or_fn, maybe_fn);
|
|
325
|
+
const __ = {
|
|
326
|
+
type: "prerender",
|
|
327
|
+
id: "",
|
|
328
|
+
name: "",
|
|
329
|
+
has_arg: !!maybe_fn,
|
|
330
|
+
inputs: options?.inputs,
|
|
331
|
+
dynamic: options?.dynamic
|
|
332
|
+
};
|
|
333
|
+
const wrapper = (arg) => {
|
|
334
|
+
const promise = (async () => {
|
|
335
|
+
const { event, state } = get_request_store();
|
|
336
|
+
const payload = stringify_remote_arg(arg, state.transport);
|
|
337
|
+
const id = __.id;
|
|
338
|
+
const url = `${base}/${app_dir}/remote/${id}${payload ? `/${payload}` : ""}`;
|
|
339
|
+
if (!state.prerendering && !BROWSER && !event.isRemoteRequest) {
|
|
340
|
+
try {
|
|
341
|
+
return await get_response(__, arg, state, async () => {
|
|
342
|
+
const key = stringify_remote_arg(arg, state.transport);
|
|
343
|
+
const cache = get_cache(__, state);
|
|
344
|
+
const promise3 = cache[key] ??= fetch(new URL(url, event.url.origin).href).then(
|
|
345
|
+
async (response) => {
|
|
346
|
+
if (!response.ok) {
|
|
347
|
+
throw new Error("Prerendered response not found");
|
|
348
|
+
}
|
|
349
|
+
const prerendered = await response.json();
|
|
350
|
+
if (prerendered.type === "error") {
|
|
351
|
+
error(prerendered.status, prerendered.error);
|
|
352
|
+
}
|
|
353
|
+
return prerendered.result;
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
return parse_remote_response(await promise3, state.transport);
|
|
357
|
+
});
|
|
358
|
+
} catch {
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (state.prerendering?.remote_responses.has(url)) {
|
|
362
|
+
return (
|
|
363
|
+
/** @type {Promise<any>} */
|
|
364
|
+
state.prerendering.remote_responses.get(url)
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
const promise2 = get_response(
|
|
368
|
+
__,
|
|
369
|
+
arg,
|
|
370
|
+
state,
|
|
371
|
+
() => run_remote_function(event, state, false, () => validate(arg), fn)
|
|
372
|
+
);
|
|
373
|
+
if (state.prerendering) {
|
|
374
|
+
state.prerendering.remote_responses.set(url, promise2);
|
|
375
|
+
}
|
|
376
|
+
const result = await promise2;
|
|
377
|
+
if (state.prerendering) {
|
|
378
|
+
const body = { type: "result", result: stringify(result, state.transport) };
|
|
379
|
+
state.prerendering.dependencies.set(url, {
|
|
380
|
+
body: JSON.stringify(body),
|
|
381
|
+
response: json(body)
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
return result;
|
|
385
|
+
})();
|
|
386
|
+
promise.catch(() => {
|
|
387
|
+
});
|
|
388
|
+
return (
|
|
389
|
+
/** @type {RemoteResource<Output>} */
|
|
390
|
+
promise
|
|
391
|
+
);
|
|
392
|
+
};
|
|
393
|
+
Object.defineProperty(wrapper, "__", { value: __ });
|
|
394
|
+
return wrapper;
|
|
395
|
+
}
|
|
396
|
+
// @__NO_SIDE_EFFECTS__
|
|
397
|
+
function query(validate_or_fn, maybe_fn) {
|
|
398
|
+
const fn = maybe_fn ?? validate_or_fn;
|
|
399
|
+
const validate = create_validator(validate_or_fn, maybe_fn);
|
|
400
|
+
const __ = { type: "query", id: "", name: "" };
|
|
401
|
+
const wrapper = (arg) => {
|
|
402
|
+
if (prerendering) {
|
|
403
|
+
throw new Error(
|
|
404
|
+
`Cannot call query '${__.name}' while prerendering, as prerendered pages need static data. Use 'prerender' from $app/server instead`
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
const { event, state } = get_request_store();
|
|
408
|
+
const get_remote_function_result = () => run_remote_function(event, state, false, () => validate(arg), fn);
|
|
409
|
+
const promise = get_response(__, arg, state, get_remote_function_result);
|
|
410
|
+
promise.catch(() => {
|
|
411
|
+
});
|
|
412
|
+
promise.set = (value) => update_refresh_value(get_refresh_context(__, "set", arg), value);
|
|
413
|
+
promise.refresh = () => {
|
|
414
|
+
const refresh_context = get_refresh_context(__, "refresh", arg);
|
|
415
|
+
const is_immediate_refresh = !refresh_context.cache[refresh_context.cache_key];
|
|
416
|
+
const value = is_immediate_refresh ? promise : get_remote_function_result();
|
|
417
|
+
return update_refresh_value(refresh_context, value, is_immediate_refresh);
|
|
418
|
+
};
|
|
419
|
+
promise.withOverride = () => {
|
|
420
|
+
throw new Error(`Cannot call '${__.name}.withOverride()' on the server`);
|
|
421
|
+
};
|
|
422
|
+
return (
|
|
423
|
+
/** @type {RemoteQuery<Output>} */
|
|
424
|
+
promise
|
|
425
|
+
);
|
|
426
|
+
};
|
|
427
|
+
Object.defineProperty(wrapper, "__", { value: __ });
|
|
428
|
+
return wrapper;
|
|
429
|
+
}
|
|
430
|
+
// @__NO_SIDE_EFFECTS__
|
|
431
|
+
function batch(validate_or_fn, maybe_fn) {
|
|
432
|
+
const fn = maybe_fn ?? validate_or_fn;
|
|
433
|
+
const validate = create_validator(validate_or_fn, maybe_fn);
|
|
434
|
+
const __ = {
|
|
435
|
+
type: "query_batch",
|
|
436
|
+
id: "",
|
|
437
|
+
name: "",
|
|
438
|
+
run: async (args, options) => {
|
|
439
|
+
const { event, state } = get_request_store();
|
|
440
|
+
return run_remote_function(
|
|
441
|
+
event,
|
|
442
|
+
state,
|
|
443
|
+
false,
|
|
444
|
+
async () => Promise.all(args.map(validate)),
|
|
445
|
+
async (input) => {
|
|
446
|
+
const get_result = await fn(input);
|
|
447
|
+
return Promise.all(
|
|
448
|
+
input.map(async (arg, i) => {
|
|
449
|
+
try {
|
|
450
|
+
return { type: "result", data: get_result(arg, i) };
|
|
451
|
+
} catch (error2) {
|
|
452
|
+
return {
|
|
453
|
+
type: "error",
|
|
454
|
+
error: await handle_error_and_jsonify(event, state, options, error2),
|
|
455
|
+
status: error2 instanceof HttpError || error2 instanceof SvelteKitError ? error2.status : 500
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
})
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
let batching = { args: [], resolvers: [] };
|
|
465
|
+
const wrapper = (arg) => {
|
|
466
|
+
if (prerendering) {
|
|
467
|
+
throw new Error(
|
|
468
|
+
`Cannot call query.batch '${__.name}' while prerendering, as prerendered pages need static data. Use 'prerender' from $app/server instead`
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
const { event, state } = get_request_store();
|
|
472
|
+
const get_remote_function_result = () => {
|
|
473
|
+
return new Promise((resolve, reject) => {
|
|
474
|
+
batching.args.push(arg);
|
|
475
|
+
batching.resolvers.push({ resolve, reject });
|
|
476
|
+
if (batching.args.length > 1) return;
|
|
477
|
+
setTimeout(async () => {
|
|
478
|
+
const batched = batching;
|
|
479
|
+
batching = { args: [], resolvers: [] };
|
|
480
|
+
try {
|
|
481
|
+
return await run_remote_function(
|
|
482
|
+
event,
|
|
483
|
+
state,
|
|
484
|
+
false,
|
|
485
|
+
async () => Promise.all(batched.args.map(validate)),
|
|
486
|
+
async (input) => {
|
|
487
|
+
const get_result = await fn(input);
|
|
488
|
+
for (let i = 0; i < batched.resolvers.length; i++) {
|
|
489
|
+
try {
|
|
490
|
+
batched.resolvers[i].resolve(get_result(input[i], i));
|
|
491
|
+
} catch (error2) {
|
|
492
|
+
batched.resolvers[i].reject(error2);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
);
|
|
497
|
+
} catch (error2) {
|
|
498
|
+
for (const resolver of batched.resolvers) {
|
|
499
|
+
resolver.reject(error2);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}, 0);
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
const promise = get_response(__, arg, state, get_remote_function_result);
|
|
506
|
+
promise.catch(() => {
|
|
507
|
+
});
|
|
508
|
+
promise.set = (value) => update_refresh_value(get_refresh_context(__, "set", arg), value);
|
|
509
|
+
promise.refresh = () => {
|
|
510
|
+
const refresh_context = get_refresh_context(__, "refresh", arg);
|
|
511
|
+
const is_immediate_refresh = !refresh_context.cache[refresh_context.cache_key];
|
|
512
|
+
const value = is_immediate_refresh ? promise : get_remote_function_result();
|
|
513
|
+
return update_refresh_value(refresh_context, value, is_immediate_refresh);
|
|
514
|
+
};
|
|
515
|
+
promise.withOverride = () => {
|
|
516
|
+
throw new Error(`Cannot call '${__.name}.withOverride()' on the server`);
|
|
517
|
+
};
|
|
518
|
+
return (
|
|
519
|
+
/** @type {RemoteQuery<Output>} */
|
|
520
|
+
promise
|
|
521
|
+
);
|
|
522
|
+
};
|
|
523
|
+
Object.defineProperty(wrapper, "__", { value: __ });
|
|
524
|
+
return wrapper;
|
|
525
|
+
}
|
|
526
|
+
Object.defineProperty(query, "batch", { value: batch, enumerable: true });
|
|
527
|
+
function get_refresh_context(__, action, arg) {
|
|
528
|
+
const { state } = get_request_store();
|
|
529
|
+
const { refreshes } = state;
|
|
530
|
+
if (!refreshes) {
|
|
531
|
+
const name = __.type === "query_batch" ? `query.batch '${__.name}'` : `query '${__.name}'`;
|
|
532
|
+
throw new Error(
|
|
533
|
+
`Cannot call ${action} on ${name} because it is not executed in the context of a command/form remote function`
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
const cache = get_cache(__, state);
|
|
537
|
+
const cache_key = stringify_remote_arg(arg, state.transport);
|
|
538
|
+
const refreshes_key = create_remote_key(__.id, cache_key);
|
|
539
|
+
return { __, state, refreshes, refreshes_key, cache, cache_key };
|
|
540
|
+
}
|
|
541
|
+
function update_refresh_value({ __, refreshes, refreshes_key, cache, cache_key }, value, is_immediate_refresh = false) {
|
|
542
|
+
const promise = Promise.resolve(value);
|
|
543
|
+
if (!is_immediate_refresh) {
|
|
544
|
+
cache[cache_key] = promise;
|
|
545
|
+
}
|
|
546
|
+
if (__.id) {
|
|
547
|
+
refreshes[refreshes_key] = promise;
|
|
548
|
+
}
|
|
549
|
+
return promise.then(() => {
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
export {
|
|
553
|
+
command,
|
|
554
|
+
form,
|
|
555
|
+
prerender,
|
|
556
|
+
query
|
|
557
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"paths": {
|
|
4
|
+
"$shared": [
|
|
5
|
+
"../../shared/src"
|
|
6
|
+
],
|
|
7
|
+
"$shared/*": [
|
|
8
|
+
"../../shared/src/*"
|
|
9
|
+
],
|
|
10
|
+
"$lib": [
|
|
11
|
+
"../src/lib"
|
|
12
|
+
],
|
|
13
|
+
"$lib/*": [
|
|
14
|
+
"../src/lib/*"
|
|
15
|
+
],
|
|
16
|
+
"$app/types": [
|
|
17
|
+
"./types/index.d.ts"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"rootDirs": [
|
|
21
|
+
"..",
|
|
22
|
+
"./types"
|
|
23
|
+
],
|
|
24
|
+
"verbatimModuleSyntax": true,
|
|
25
|
+
"isolatedModules": true,
|
|
26
|
+
"lib": [
|
|
27
|
+
"esnext",
|
|
28
|
+
"DOM",
|
|
29
|
+
"DOM.Iterable"
|
|
30
|
+
],
|
|
31
|
+
"moduleResolution": "bundler",
|
|
32
|
+
"module": "esnext",
|
|
33
|
+
"noEmit": true,
|
|
34
|
+
"target": "esnext"
|
|
35
|
+
},
|
|
36
|
+
"include": [
|
|
37
|
+
"ambient.d.ts",
|
|
38
|
+
"non-ambient.d.ts",
|
|
39
|
+
"./types/**/$types.d.ts",
|
|
40
|
+
"../vite.config.js",
|
|
41
|
+
"../vite.config.ts",
|
|
42
|
+
"../src/**/*.js",
|
|
43
|
+
"../src/**/*.ts",
|
|
44
|
+
"../src/**/*.svelte",
|
|
45
|
+
"../test/**/*.js",
|
|
46
|
+
"../test/**/*.ts",
|
|
47
|
+
"../test/**/*.svelte",
|
|
48
|
+
"../tests/**/*.js",
|
|
49
|
+
"../tests/**/*.ts",
|
|
50
|
+
"../tests/**/*.svelte"
|
|
51
|
+
],
|
|
52
|
+
"exclude": [
|
|
53
|
+
"../node_modules/**",
|
|
54
|
+
"../src/service-worker.js",
|
|
55
|
+
"../src/service-worker/**/*.js",
|
|
56
|
+
"../src/service-worker.ts",
|
|
57
|
+
"../src/service-worker/**/*.ts",
|
|
58
|
+
"../src/service-worker.d.ts",
|
|
59
|
+
"../src/service-worker/**/*.d.ts"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as Kit from '@sveltejs/kit';
|
|
2
|
+
|
|
3
|
+
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
type MatcherParam<M> = M extends (param : string) => param is infer U ? U extends string ? U : string : string;
|
|
6
|
+
type RouteParams = { };
|
|
7
|
+
type RouteId = '/';
|
|
8
|
+
type MaybeWithVoid<T> = {} extends T ? T | void : T;
|
|
9
|
+
export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];
|
|
10
|
+
type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>>
|
|
11
|
+
type EnsureDefined<T> = T extends null | undefined ? {} : T;
|
|
12
|
+
type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
|
|
13
|
+
export type Snapshot<T = any> = Kit.Snapshot<T>;
|
|
14
|
+
type PageParentData = EnsureDefined<LayoutData>;
|
|
15
|
+
type LayoutRouteId = RouteId | "/" | "/group/[groupId]" | null
|
|
16
|
+
type LayoutParams = RouteParams & { groupId?: string }
|
|
17
|
+
type LayoutParentData = EnsureDefined<{}>;
|
|
18
|
+
|
|
19
|
+
export type PageServerData = null;
|
|
20
|
+
export type PageLoad<OutputData extends OutputDataShape<PageParentData> = OutputDataShape<PageParentData>> = Kit.Load<RouteParams, PageServerData, PageParentData, OutputData, RouteId>;
|
|
21
|
+
export type PageLoadEvent = Parameters<PageLoad>[0];
|
|
22
|
+
export type PageData = Expand<Omit<PageParentData, keyof Kit.LoadProperties<Awaited<ReturnType<typeof import('./proxy+page.js').load>>>> & OptionalUnion<EnsureDefined<Kit.LoadProperties<Awaited<ReturnType<typeof import('./proxy+page.js').load>>>>>>;
|
|
23
|
+
export type PageProps = { params: RouteParams; data: PageData }
|
|
24
|
+
export type LayoutServerData = null;
|
|
25
|
+
export type LayoutData = Expand<LayoutParentData>;
|
|
26
|
+
export type LayoutProps = { params: LayoutParams; data: LayoutData; children: import("svelte").Snippet }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as Kit from '@sveltejs/kit';
|
|
2
|
+
|
|
3
|
+
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
type MatcherParam<M> = M extends (param : string) => param is infer U ? U extends string ? U : string : string;
|
|
6
|
+
type RouteParams = { groupId: string };
|
|
7
|
+
type RouteId = '/group/[groupId]';
|
|
8
|
+
type MaybeWithVoid<T> = {} extends T ? T | void : T;
|
|
9
|
+
export type RequiredKeys<T> = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T];
|
|
10
|
+
type OutputDataShape<T> = MaybeWithVoid<Omit<App.PageData, RequiredKeys<T>> & Partial<Pick<App.PageData, keyof T & keyof App.PageData>> & Record<string, any>>
|
|
11
|
+
type EnsureDefined<T> = T extends null | undefined ? {} : T;
|
|
12
|
+
type OptionalUnion<U extends Record<string, any>, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude<A, keyof U>]?: never } & U : never;
|
|
13
|
+
export type Snapshot<T = any> = Kit.Snapshot<T>;
|
|
14
|
+
type PageParentData = EnsureDefined<import('../../$types.js').LayoutData>;
|
|
15
|
+
|
|
16
|
+
export type EntryGenerator = () => Promise<Array<RouteParams>> | Array<RouteParams>;
|
|
17
|
+
export type PageServerData = null;
|
|
18
|
+
export type PageLoad<OutputData extends OutputDataShape<PageParentData> = OutputDataShape<PageParentData>> = Kit.Load<RouteParams, PageServerData, PageParentData, OutputData, RouteId>;
|
|
19
|
+
export type PageLoadEvent = Parameters<PageLoad>[0];
|
|
20
|
+
export type PageData = Expand<Omit<PageParentData, keyof Kit.LoadProperties<Awaited<ReturnType<typeof import('./proxy+page.js').load>>>> & OptionalUnion<EnsureDefined<Kit.LoadProperties<Awaited<ReturnType<typeof import('./proxy+page.js').load>>>>>>;
|
|
21
|
+
export type PageProps = { params: RouteParams; data: PageData }
|