@kehto/paja 0.8.0 → 0.9.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 +69 -2
- package/dist/browser-host.js +2529 -1038
- package/dist/browser-host.js.map +1 -1
- package/dist/{chunk-NFJCS5PG.js → chunk-OWVINAW7.js} +369 -10
- package/dist/chunk-OWVINAW7.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +199 -5
- package/dist/index.js +11 -1
- package/package.json +10 -10
- package/dist/chunk-NFJCS5PG.js.map +0 -1
|
@@ -697,12 +697,12 @@ async function resolvePajaPointer(value, options = {}) {
|
|
|
697
697
|
const pointer = decodePajaPointer(value);
|
|
698
698
|
const relays = uniqueRelayUrls([...pointer.relays, ...options.relays ?? []]);
|
|
699
699
|
if (relays.length === 0) {
|
|
700
|
-
throw new Error("Pointer
|
|
700
|
+
throw new Error("Pointer has no relay hints or enabled configured live relays.");
|
|
701
701
|
}
|
|
702
702
|
const pool = options.pool ?? new SimplePool();
|
|
703
703
|
const ownsPool = options.pool === void 0;
|
|
704
704
|
try {
|
|
705
|
-
const event = await resolvePointerEvent(pointer, pool, relays, options.maxWaitMs
|
|
705
|
+
const event = await resolvePointerEvent(pointer, pool, relays, normalizeMaxWaitMs(options.maxWaitMs));
|
|
706
706
|
const blossomServers = [...options.blossomServers ?? []];
|
|
707
707
|
const resolved = await resolveNapplet({
|
|
708
708
|
event,
|
|
@@ -731,7 +731,26 @@ async function resolvePajaPointer(value, options = {}) {
|
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
function injectPajaRuntimeCsp(html, origins) {
|
|
734
|
-
const
|
|
734
|
+
const grantedOrigins = [...new Set(origins)].sort();
|
|
735
|
+
const connectSrc = grantedOrigins.length > 0 ? `connect-src ${grantedOrigins.join(" ")}` : "connect-src 'none'";
|
|
736
|
+
const value = [
|
|
737
|
+
"default-src 'none'",
|
|
738
|
+
"script-src 'unsafe-inline'",
|
|
739
|
+
"style-src 'unsafe-inline'",
|
|
740
|
+
"img-src data: blob:",
|
|
741
|
+
"font-src data:",
|
|
742
|
+
connectSrc,
|
|
743
|
+
"worker-src 'none'",
|
|
744
|
+
"child-src 'none'",
|
|
745
|
+
"frame-src 'none'",
|
|
746
|
+
"media-src 'none'",
|
|
747
|
+
"object-src 'none'",
|
|
748
|
+
"manifest-src 'none'",
|
|
749
|
+
"prefetch-src 'none'",
|
|
750
|
+
"base-uri 'none'",
|
|
751
|
+
"form-action 'none'",
|
|
752
|
+
"frame-ancestors 'self'"
|
|
753
|
+
].join("; ");
|
|
735
754
|
const meta = `<meta http-equiv="Content-Security-Policy" content="${escapeAttribute2(value)}">`;
|
|
736
755
|
if (/<head[^>]*>/i.test(html)) {
|
|
737
756
|
return html.replace(/<head[^>]*>/i, (open) => `${open}${meta}`);
|
|
@@ -743,19 +762,96 @@ function injectPajaRuntimeCsp(html, origins) {
|
|
|
743
762
|
}
|
|
744
763
|
async function resolvePointerEvent(pointer, pool, relays, maxWaitMs) {
|
|
745
764
|
const filter = pointer.type === "naddr" ? addressableFilter(pointer) : eventFilter(pointer);
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
label: "kehto-paja-runtime"
|
|
749
|
-
});
|
|
750
|
-
const event = events.filter((candidate) => matchesPointer(pointer, candidate)).sort((a, b) => b.created_at - a.created_at)[0];
|
|
765
|
+
const result = await queryPointerRelays(pool, relays, filter, maxWaitMs);
|
|
766
|
+
const event = result.events.filter((candidate) => matchesPointer(pointer, candidate)).sort((a, b) => b.created_at - a.created_at)[0];
|
|
751
767
|
if (!event) {
|
|
752
|
-
|
|
768
|
+
if (result.timedOut) {
|
|
769
|
+
throw new Error(
|
|
770
|
+
`Relay resolution timed out after ${maxWaitMs}ms for ${pointer.type} pointer across ${relays.length} relays before complete EOSE.`
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
const failures = relayFailureReasons(result.reasons);
|
|
774
|
+
if (result.error || failures.length > 0) {
|
|
775
|
+
const detail = result.error instanceof Error ? result.error.message : result.error === void 0 ? failures.join("; ") : String(result.error);
|
|
776
|
+
throw new Error(`Relay query failed for ${pointer.type} pointer before complete EOSE: ${detail}`);
|
|
777
|
+
}
|
|
778
|
+
throw new Error(
|
|
779
|
+
`All ${relays.length} relays reached EOSE without a matching ${pointer.type} napplet manifest event.`
|
|
780
|
+
);
|
|
753
781
|
}
|
|
754
782
|
if (!isNappletManifestKind(event.kind)) {
|
|
755
783
|
throw new Error(`Pointer resolved kind ${event.kind}; expected ${formatNappletManifestKinds()}.`);
|
|
756
784
|
}
|
|
757
785
|
return event;
|
|
758
786
|
}
|
|
787
|
+
function queryPointerRelays(pool, relays, filter, maxWaitMs) {
|
|
788
|
+
if (pool.subscribeManyEose) {
|
|
789
|
+
return queryPointerRelaySubscription(pool, relays, filter, maxWaitMs);
|
|
790
|
+
}
|
|
791
|
+
return queryPointerRelaySync(pool, relays, filter, maxWaitMs);
|
|
792
|
+
}
|
|
793
|
+
function queryPointerRelaySubscription(pool, relays, filter, maxWaitMs) {
|
|
794
|
+
return new Promise((resolve2) => {
|
|
795
|
+
const events = [];
|
|
796
|
+
let settled = false;
|
|
797
|
+
let subscription;
|
|
798
|
+
const finish = (result) => {
|
|
799
|
+
if (settled) return;
|
|
800
|
+
settled = true;
|
|
801
|
+
clearTimeout(deadline);
|
|
802
|
+
resolve2({ events, ...result });
|
|
803
|
+
};
|
|
804
|
+
const deadline = setTimeout(() => {
|
|
805
|
+
finish({ reasons: [], timedOut: true });
|
|
806
|
+
void subscription?.close("Paja pointer relay deadline exceeded");
|
|
807
|
+
}, maxWaitMs);
|
|
808
|
+
try {
|
|
809
|
+
subscription = pool.subscribeManyEose([...relays], filter, {
|
|
810
|
+
maxWait: maxWaitMs,
|
|
811
|
+
label: "kehto-paja-runtime",
|
|
812
|
+
onevent(event) {
|
|
813
|
+
events.push(event);
|
|
814
|
+
},
|
|
815
|
+
onclose(reasons) {
|
|
816
|
+
finish({ reasons, timedOut: false });
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
} catch (error) {
|
|
820
|
+
finish({ reasons: [], timedOut: false, error });
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
function queryPointerRelaySync(pool, relays, filter, maxWaitMs) {
|
|
825
|
+
return new Promise((resolve2) => {
|
|
826
|
+
let settled = false;
|
|
827
|
+
const finish = (result) => {
|
|
828
|
+
if (settled) return;
|
|
829
|
+
settled = true;
|
|
830
|
+
clearTimeout(deadline);
|
|
831
|
+
resolve2(result);
|
|
832
|
+
};
|
|
833
|
+
const deadline = setTimeout(() => {
|
|
834
|
+
finish({ events: [], reasons: [], timedOut: true });
|
|
835
|
+
}, maxWaitMs);
|
|
836
|
+
void pool.querySync([...relays], filter, {
|
|
837
|
+
maxWait: maxWaitMs,
|
|
838
|
+
label: "kehto-paja-runtime"
|
|
839
|
+
}).then(
|
|
840
|
+
(events) => finish({ events, reasons: [], timedOut: false }),
|
|
841
|
+
(error) => finish({ events: [], reasons: [], timedOut: false, error })
|
|
842
|
+
);
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
function relayFailureReasons(reasons) {
|
|
846
|
+
return [...new Set(reasons.map((reason) => reason.trim()).filter((reason) => reason.length > 0 && reason !== "closed automatically on eose").map((reason) => reason.slice(0, 160)))].slice(0, 3);
|
|
847
|
+
}
|
|
848
|
+
function normalizeMaxWaitMs(value) {
|
|
849
|
+
if (value === void 0) return 5e3;
|
|
850
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
851
|
+
throw new Error("Pointer relay deadline must be a positive number of milliseconds.");
|
|
852
|
+
}
|
|
853
|
+
return Math.floor(value);
|
|
854
|
+
}
|
|
759
855
|
function addressableFilter(pointer) {
|
|
760
856
|
if (pointer.kind !== NAPPLET_KIND_NAMED) {
|
|
761
857
|
throw new Error(`naddr kind ${pointer.kind} is not a named NIP-5D napplet manifest kind.`);
|
|
@@ -937,9 +1033,258 @@ function defaultSleep(ms) {
|
|
|
937
1033
|
});
|
|
938
1034
|
}
|
|
939
1035
|
|
|
1036
|
+
// src/installed-napplet-catalog.ts
|
|
1037
|
+
import { manifestToIntentCatalogEntry } from "@kehto/services";
|
|
1038
|
+
function matchesInstalledNappletRecord(record, target) {
|
|
1039
|
+
return target.dTag === record.dTag && target.aggregateHash === record.aggregateHash;
|
|
1040
|
+
}
|
|
1041
|
+
var InstalledNappletCatalog = class {
|
|
1042
|
+
records = /* @__PURE__ */ new Map();
|
|
1043
|
+
listeners = /* @__PURE__ */ new Set();
|
|
1044
|
+
/** Insert or replace a record from an already resolver-verified pointer. */
|
|
1045
|
+
install(resolved) {
|
|
1046
|
+
const record = freezeRecord({
|
|
1047
|
+
dTag: resolved.dTag,
|
|
1048
|
+
aggregateHash: resolved.aggregateHash,
|
|
1049
|
+
pointer: copyPointer(resolved.pointer),
|
|
1050
|
+
...resolved.manifest.title === void 0 ? {} : { title: resolved.manifest.title },
|
|
1051
|
+
archetypes: resolved.manifest.archetypes.map((archetype) => ({
|
|
1052
|
+
slug: archetype.slug,
|
|
1053
|
+
convention: archetype.convention,
|
|
1054
|
+
...archetype.eventKinds === void 0 ? {} : { eventKinds: [...archetype.eventKinds] }
|
|
1055
|
+
}))
|
|
1056
|
+
});
|
|
1057
|
+
this.records.set(record.dTag, record);
|
|
1058
|
+
this.notify(record.dTag);
|
|
1059
|
+
return record;
|
|
1060
|
+
}
|
|
1061
|
+
/** Remove an artifact explicitly; frame teardown never calls this method. */
|
|
1062
|
+
remove(dTag) {
|
|
1063
|
+
const removed = this.records.delete(dTag);
|
|
1064
|
+
if (removed) this.notify(dTag);
|
|
1065
|
+
return removed;
|
|
1066
|
+
}
|
|
1067
|
+
/** Return whether a verified installation exists for a d-tag. */
|
|
1068
|
+
has(dTag) {
|
|
1069
|
+
return this.records.has(dTag);
|
|
1070
|
+
}
|
|
1071
|
+
/** Return immutable serializable installed-artifact facts. */
|
|
1072
|
+
installed() {
|
|
1073
|
+
return [...this.records.values()];
|
|
1074
|
+
}
|
|
1075
|
+
/** Return a verified record by d-tag. */
|
|
1076
|
+
get(dTag) {
|
|
1077
|
+
return this.records.get(dTag);
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* Atomically confirm that a resolved target still belongs to the exact record
|
|
1081
|
+
* selected before an async operation. The record object is the catalog version
|
|
1082
|
+
* token, so even a same-identity replacement cannot pass this check.
|
|
1083
|
+
*/
|
|
1084
|
+
validateCurrent(selected, target) {
|
|
1085
|
+
if (this.records.get(selected.dTag) !== selected) return null;
|
|
1086
|
+
return matchesInstalledNappletRecord(selected, target) ? selected : null;
|
|
1087
|
+
}
|
|
1088
|
+
/** Return exact handler candidates derived only from installed manifests. */
|
|
1089
|
+
intentCatalog() {
|
|
1090
|
+
return this.installed().map((record) => manifestToIntentCatalogEntry({
|
|
1091
|
+
dTag: record.dTag,
|
|
1092
|
+
...record.title === void 0 ? {} : { title: record.title },
|
|
1093
|
+
archetypes: record.archetypes.map((archetype) => ({
|
|
1094
|
+
slug: archetype.slug,
|
|
1095
|
+
convention: archetype.convention,
|
|
1096
|
+
...archetype.eventKinds === void 0 ? {} : { eventKinds: [...archetype.eventKinds] }
|
|
1097
|
+
}))
|
|
1098
|
+
}));
|
|
1099
|
+
}
|
|
1100
|
+
/** Subscribe to explicit install and artifact-removal changes. */
|
|
1101
|
+
onChanged(listener) {
|
|
1102
|
+
this.listeners.add(listener);
|
|
1103
|
+
return () => this.listeners.delete(listener);
|
|
1104
|
+
}
|
|
1105
|
+
notify(dTag) {
|
|
1106
|
+
for (const listener of this.listeners) listener(dTag);
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
function copyPointer(pointer) {
|
|
1110
|
+
if (pointer.type === "naddr") {
|
|
1111
|
+
return Object.freeze({
|
|
1112
|
+
type: "naddr",
|
|
1113
|
+
value: pointer.value,
|
|
1114
|
+
identifier: pointer.identifier,
|
|
1115
|
+
pubkey: pointer.pubkey,
|
|
1116
|
+
kind: pointer.kind,
|
|
1117
|
+
relays: Object.freeze([...pointer.relays])
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
return Object.freeze({
|
|
1121
|
+
type: "nevent",
|
|
1122
|
+
value: pointer.value,
|
|
1123
|
+
id: pointer.id,
|
|
1124
|
+
...pointer.author === void 0 ? {} : { author: pointer.author },
|
|
1125
|
+
...pointer.kind === void 0 ? {} : { kind: pointer.kind },
|
|
1126
|
+
relays: Object.freeze([...pointer.relays])
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
function freezeRecord(record) {
|
|
1130
|
+
return Object.freeze({
|
|
1131
|
+
...record,
|
|
1132
|
+
archetypes: Object.freeze(record.archetypes.map((archetype) => Object.freeze({
|
|
1133
|
+
...archetype,
|
|
1134
|
+
...archetype.eventKinds === void 0 ? {} : { eventKinds: Object.freeze([...archetype.eventKinds]) }
|
|
1135
|
+
})))
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
// src/browser-intent-controller.ts
|
|
1140
|
+
var MAX_INTENT_DELIVERY_ATTEMPTS = 10;
|
|
1141
|
+
var BrowserIntentController = class {
|
|
1142
|
+
constructor(options) {
|
|
1143
|
+
this.options = options;
|
|
1144
|
+
this.maxAttempts = normalizeAttempts(options.maxAttempts);
|
|
1145
|
+
}
|
|
1146
|
+
options;
|
|
1147
|
+
maxAttempts;
|
|
1148
|
+
retain(params) {
|
|
1149
|
+
const retained = freezeRetention(params);
|
|
1150
|
+
let started;
|
|
1151
|
+
let delivered = false;
|
|
1152
|
+
return {
|
|
1153
|
+
start: () => {
|
|
1154
|
+
started ??= this.start(retained, () => delivered, () => {
|
|
1155
|
+
delivered = true;
|
|
1156
|
+
});
|
|
1157
|
+
return started;
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
async start(params, isDelivered, markDelivered) {
|
|
1162
|
+
let reason = "no-current-target";
|
|
1163
|
+
for (let attempt = 1; attempt <= this.maxAttempts; attempt += 1) {
|
|
1164
|
+
let generation;
|
|
1165
|
+
try {
|
|
1166
|
+
generation = await this.options.openOrReuse(params, attempt);
|
|
1167
|
+
} catch {
|
|
1168
|
+
reason = "open-failed";
|
|
1169
|
+
continue;
|
|
1170
|
+
}
|
|
1171
|
+
if (!generation) {
|
|
1172
|
+
reason = "open-failed";
|
|
1173
|
+
continue;
|
|
1174
|
+
}
|
|
1175
|
+
try {
|
|
1176
|
+
await this.options.waitForReady(generation);
|
|
1177
|
+
} catch {
|
|
1178
|
+
reason = "ready-failed";
|
|
1179
|
+
continue;
|
|
1180
|
+
}
|
|
1181
|
+
if (!await this.options.isCurrent(generation)) {
|
|
1182
|
+
reason = "no-current-target";
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
if (isDelivered()) return;
|
|
1186
|
+
markDelivered();
|
|
1187
|
+
try {
|
|
1188
|
+
await this.options.send(generation, params.delivery);
|
|
1189
|
+
return;
|
|
1190
|
+
} catch {
|
|
1191
|
+
this.options.onTerminal?.(params, "send-failed");
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
this.options.onTerminal?.(params, reason);
|
|
1196
|
+
}
|
|
1197
|
+
};
|
|
1198
|
+
function normalizeAttempts(value) {
|
|
1199
|
+
if (value === void 0) return 2;
|
|
1200
|
+
if (!Number.isFinite(value)) throw new TypeError("maxAttempts must be finite");
|
|
1201
|
+
return Math.min(MAX_INTENT_DELIVERY_ATTEMPTS, Math.max(1, Math.floor(value)));
|
|
1202
|
+
}
|
|
1203
|
+
function freezeRetention(params) {
|
|
1204
|
+
if (!params || typeof params.handler !== "string" || params.handler.length === 0) {
|
|
1205
|
+
throw new TypeError("Intent retention requires a handler");
|
|
1206
|
+
}
|
|
1207
|
+
const delivery = freezeValue({ ...params.delivery });
|
|
1208
|
+
const behavior = params.behavior === void 0 ? void 0 : freezeValue({ ...params.behavior });
|
|
1209
|
+
return Object.freeze({
|
|
1210
|
+
handler: params.handler,
|
|
1211
|
+
delivery,
|
|
1212
|
+
...behavior === void 0 ? {} : { behavior }
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
function freezeValue(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
1216
|
+
if (typeof value !== "object" || value === null) return value;
|
|
1217
|
+
const existing = seen.get(value);
|
|
1218
|
+
if (existing !== void 0) return existing;
|
|
1219
|
+
if (Array.isArray(value)) {
|
|
1220
|
+
const copy2 = [];
|
|
1221
|
+
seen.set(value, copy2);
|
|
1222
|
+
for (const item of value) copy2.push(freezeValue(item, seen));
|
|
1223
|
+
return Object.freeze(copy2);
|
|
1224
|
+
}
|
|
1225
|
+
const copy = {};
|
|
1226
|
+
seen.set(value, copy);
|
|
1227
|
+
for (const [key, item] of Object.entries(value)) copy[key] = freezeValue(item, seen);
|
|
1228
|
+
return Object.freeze(copy);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
940
1231
|
// src/server.ts
|
|
941
1232
|
import { createServer } from "http";
|
|
942
1233
|
import { readFileSync as readFileSync2 } from "fs";
|
|
1234
|
+
|
|
1235
|
+
// src/target-cors.ts
|
|
1236
|
+
var PAJA_TARGET_CORS_HINT = "Paja sandboxes the napplet frame without allow-same-origin, so its assets are requested with `Origin: null`. Allow that origin in the napplet dev server, e.g. Vite `server: { cors: { origin: '*' } }`.";
|
|
1237
|
+
function classifyTargetCors(targetUrl, allowOrigin) {
|
|
1238
|
+
const value = allowOrigin?.trim() ?? null;
|
|
1239
|
+
if (value === "*" || value === "null") {
|
|
1240
|
+
return {
|
|
1241
|
+
status: "allowed",
|
|
1242
|
+
targetUrl,
|
|
1243
|
+
allowOrigin: value,
|
|
1244
|
+
detail: `Target allows the sandboxed frame's null origin (access-control-allow-origin: ${value}).`,
|
|
1245
|
+
hint: null
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
if (value === null || value === "") {
|
|
1249
|
+
return {
|
|
1250
|
+
status: "blocked",
|
|
1251
|
+
targetUrl,
|
|
1252
|
+
allowOrigin: null,
|
|
1253
|
+
detail: "Target sent no access-control-allow-origin for an Origin: null request.",
|
|
1254
|
+
hint: PAJA_TARGET_CORS_HINT
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
return {
|
|
1258
|
+
status: "blocked",
|
|
1259
|
+
targetUrl,
|
|
1260
|
+
allowOrigin: value,
|
|
1261
|
+
detail: `Target only allows origin "${value}", not the sandboxed frame's null origin.`,
|
|
1262
|
+
hint: PAJA_TARGET_CORS_HINT
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
var defaultTargetCorsFetch = (input, init) => fetch(input, init);
|
|
1266
|
+
async function probeTargetCors(targetUrl, fetchImpl = defaultTargetCorsFetch) {
|
|
1267
|
+
try {
|
|
1268
|
+
const response = await fetchImpl(targetUrl, {
|
|
1269
|
+
method: "GET",
|
|
1270
|
+
headers: {
|
|
1271
|
+
origin: "null",
|
|
1272
|
+
accept: "text/html, application/xhtml+xml;q=0.9, */*;q=0.8"
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
return classifyTargetCors(targetUrl, response.headers.get("access-control-allow-origin"));
|
|
1276
|
+
} catch (error) {
|
|
1277
|
+
return {
|
|
1278
|
+
status: "unreachable",
|
|
1279
|
+
targetUrl,
|
|
1280
|
+
allowOrigin: null,
|
|
1281
|
+
detail: `Target CORS probe failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
1282
|
+
hint: "Confirm the napplet dev server is running and --target-url points at it."
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// src/server.ts
|
|
943
1288
|
async function startPajaServer(input) {
|
|
944
1289
|
const rawOptions = resolvePajaRawOptions(input.options);
|
|
945
1290
|
const options = normalizePajaOptions(rawOptions);
|
|
@@ -975,6 +1320,15 @@ async function startPajaServer(input) {
|
|
|
975
1320
|
response.end(targetHtml);
|
|
976
1321
|
return;
|
|
977
1322
|
}
|
|
1323
|
+
if (requestUrl === "/__kehto/target-cors.json") {
|
|
1324
|
+
const diagnostic = await probeTargetCors(hostConfig.target.url);
|
|
1325
|
+
response.writeHead(200, {
|
|
1326
|
+
"cache-control": "no-store",
|
|
1327
|
+
"content-type": "application/json; charset=utf-8"
|
|
1328
|
+
});
|
|
1329
|
+
response.end(JSON.stringify(diagnostic));
|
|
1330
|
+
return;
|
|
1331
|
+
}
|
|
978
1332
|
if (requestUrl === "/__kehto/browser-host.js") {
|
|
979
1333
|
const browserScript = readBrowserHostScript();
|
|
980
1334
|
response.writeHead(200, { "content-type": "text/javascript; charset=utf-8" });
|
|
@@ -1104,6 +1458,11 @@ export {
|
|
|
1104
1458
|
getMissingServices,
|
|
1105
1459
|
ReadinessError,
|
|
1106
1460
|
waitForTargetUrl,
|
|
1461
|
+
InstalledNappletCatalog,
|
|
1462
|
+
BrowserIntentController,
|
|
1463
|
+
PAJA_TARGET_CORS_HINT,
|
|
1464
|
+
classifyTargetCors,
|
|
1465
|
+
probeTargetCors,
|
|
1107
1466
|
startPajaServer
|
|
1108
1467
|
};
|
|
1109
|
-
//# sourceMappingURL=chunk-
|
|
1468
|
+
//# sourceMappingURL=chunk-OWVINAW7.js.map
|