@camstack/server 1.2.847 → 1.2.849
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/CHANGELOG.md +16 -0
- package/dist/api/trpc/generated-cap-routers.js +9 -0
- package/dist/core/addon/instance-lifecycle.js +10 -6
- package/package.json +13 -9
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +4 -4
- package/system/dist/builtins/composer/composer.addon.mjs +4 -4
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +36 -8
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +36 -8
- package/system/dist/builtins/core-blocks/remote-service.d.ts +5 -1
- package/system/dist/builtins/core-blocks/remote-wiring.d.ts +3 -1
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.d.ts +0 -25
- package/system/dist/builtins/device-manager/device-manager.addon.js +62 -4
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +62 -4
- package/system/dist/builtins/device-manager/transitions/transitions-wiring.d.ts +6 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-BSDgRisG.mjs → capture-engine-CgCljSbM.mjs} +1 -1
- package/system/dist/{capture-engine-B0oRy06v.js → capture-engine-QQtJ9iXs.js} +1 -1
- package/system/dist/{composition-sources-SR0LOiwV.js → composition-sources-DxDmYFCD.js} +1 -1
- package/system/dist/{composition-sources-ujH0OBVn.mjs → composition-sources-pEPr0Ucn.mjs} +1 -1
- package/system/dist/{constants-B7eUjmLy.mjs → constants-CNZ_oxrp.mjs} +1 -1
- package/system/dist/{constants-Bu2PpZxT.js → constants-Df49f3b4.js} +1 -1
- package/system/dist/{device-ca-Ddx0w66k.mjs → device-ca-Bl-6F9mv.mjs} +1 -1
- package/system/dist/{device-ca-DQVQodun.js → device-ca-BzUtH2U5.js} +1 -1
- package/system/dist/{dist-C2g-bkW3.js → dist-DKsFOzpr.js} +329 -29
- package/system/dist/{dist-Btw-kJec.mjs → dist-zkNb0bBi.mjs} +329 -29
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-BGQRouDQ.mjs → hub-identity-BrGlipuh.mjs} +1 -1
- package/system/dist/{hub-identity-DiXO_HL1.js → hub-identity-Dv4V44gP.js} +1 -1
- package/system/dist/{hub-mdns-ciao-BR2Zdm6h.js → hub-mdns-ciao-DcWSdIki.js} +2 -2
- package/system/dist/{hub-mdns-ciao-DGGKuLGZ.mjs → hub-mdns-ciao-Dzht7PBY.mjs} +2 -2
- package/system/dist/index.js +50 -2507
- package/system/dist/index.mjs +50 -2507
- package/system/dist/kernel/bootstrap-config.d.ts +1 -2
- package/system/dist/kernel/capability-registry.d.ts +6 -2
- package/system/dist/{legacy-integration-rows-door-OnrCmUJI.js → legacy-integration-rows-door-CISh8s7H.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-50Uc78LM.mjs → legacy-integration-rows-door-CL6R8xaY.mjs} +1 -1
- package/system/dist/migrations/hub/2026-11-12-drop-retired-storage-leftovers.d.ts +16 -0
- package/system/dist/{rename-composition-block-CjVxHVX1.js → rename-composition-block-DFi7GTKn.js} +1 -1
- package/system/dist/{rename-composition-block-kGqHAdUc.mjs → rename-composition-block-DM_koTq7.mjs} +1 -1
- package/system/dist/{restore-archive-Cxhhx7mC.mjs → restore-archive-D_3y4vj-.mjs} +1 -1
- package/system/dist/{restore-archive-DQZdAca-.js → restore-archive-Daw2fB9X.js} +1 -1
- package/system/dist/{wal-maintenance-DoZE1qG9.mjs → wal-maintenance-BPohUtyD.mjs} +0 -0
- package/system/dist/{wal-maintenance-C4WfHqw5.js → wal-maintenance-GyMlkYI_.js} +0 -0
- package/system/package.json +1 -1
- package/system/dist/kernel/legacy-config-yaml.d.ts +0 -37
package/system/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $i as objectInputDeclaresAddonId, $n as compareVersions, An as bareAddonId, Cc as defineRecordKinds, Dc as expandCapMethods, Ds as DEVICE_STATUS_METHOD, Dt as LOG_LEVEL_RANK, Ei as lifecycleJobSchema, Es as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Gs as ReadinessTimeoutError, Ni as logLevelAtMost, O as CatalogFileSchema, Oo as unmetRequirements, Ot as METHOD_ACCESS_MAP, Pc as isDebugChannelName, Pi as looseSchema, Qc as parseJsonUnknown, Ra as resolveMethodAuth, Sl as EventCategory$1, Sr as describeUnmet, Ts as DATAPLANE_SECRET_HEADER$1, Us as RUNTIME_DEFAULTS, Vr as extractNestedAddonId, Ws as ReadinessRegistry, Xa as scopesAllowAddon, Za as scopesAllowDeviceCap, Zc as parseJsonObject, a as AGENT_MDNS_SERVICE_TYPE, ac as asJsonObject$1, al as scopeKey, bi as isVoidInput, bl as errMsg$1, di as isArrayOutputSchema, ea as objectInputDeclaresRequiredDeviceId, el as readinessKey, fi as isCollectionArrayMethod, ga as procedureAuthKey, hl as withoutCallerStamp, kc as getDebugInterest, lo as splitTranslationRef, mc as collectSecretMarkerRefs, nl as resolveCapMount, o as AGENT_MDNS_TXT_KEYS, oc as asNumber, oi as interpolate, pl as userError, s as ALL_CAPABILITY_DEFINITIONS, sc as asString$1, si as isAddonInstanceId, vc as createEvent$1, vi as isObjectInput, vo as supportedRuntimes, wc as emitDownForOwnedCaps, ws as CALLER_STAMPED_CAPABILITIES$1, x as CATALOG_LANGS, xi as kebabToCamel$1, xn as addonSettingsCapability, zt as PackageRequiresSchema } from "./dist-
|
|
3
|
-
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-
|
|
2
|
+
import { $i as objectInputDeclaresAddonId, $n as compareVersions, An as bareAddonId, Cc as defineRecordKinds, Dc as expandCapMethods, Ds as DEVICE_STATUS_METHOD, Dt as LOG_LEVEL_RANK, Ei as lifecycleJobSchema, Es as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Gs as ReadinessTimeoutError, Ni as logLevelAtMost, O as CatalogFileSchema, Oo as unmetRequirements, Ot as METHOD_ACCESS_MAP, Pc as isDebugChannelName, Pi as looseSchema, Qc as parseJsonUnknown, Ra as resolveMethodAuth, Sl as EventCategory$1, Sr as describeUnmet, Ts as DATAPLANE_SECRET_HEADER$1, Us as RUNTIME_DEFAULTS, Vr as extractNestedAddonId, Ws as ReadinessRegistry, Xa as scopesAllowAddon, Za as scopesAllowDeviceCap, Zc as parseJsonObject, a as AGENT_MDNS_SERVICE_TYPE, ac as asJsonObject$1, al as scopeKey, bi as isVoidInput, bl as errMsg$1, di as isArrayOutputSchema, ea as objectInputDeclaresRequiredDeviceId, el as readinessKey, fi as isCollectionArrayMethod, ga as procedureAuthKey, hl as withoutCallerStamp, kc as getDebugInterest, lo as splitTranslationRef, mc as collectSecretMarkerRefs, nl as resolveCapMount, o as AGENT_MDNS_TXT_KEYS, oc as asNumber, oi as interpolate, pl as userError, s as ALL_CAPABILITY_DEFINITIONS, sc as asString$1, si as isAddonInstanceId, vc as createEvent$1, vi as isObjectInput, vo as supportedRuntimes, wc as emitDownForOwnedCaps, ws as CALLER_STAMPED_CAPABILITIES$1, x as CATALOG_LANGS, xi as kebabToCamel$1, xn as addonSettingsCapability, zt as PackageRequiresSchema } from "./dist-zkNb0bBi.mjs";
|
|
3
|
+
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-Bl-6F9mv.mjs";
|
|
4
4
|
import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
|
|
5
5
|
import { a as redactLogText, i as redactLogMeta, r as redactLogEntry, t as isCredentialKeyName } from "./log-redactor-XLDrPzOi.mjs";
|
|
6
6
|
import { AlertCenterAddon, n as lastCauseAfterChunk, r as readRunnerDisplayName, t as CRASH_BREAKER_ERROR_PREFIX } from "./builtins/alerts/alerts.addon.mjs";
|
|
@@ -27,22 +27,22 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
|
|
|
27
27
|
import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
28
28
|
import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
|
|
29
29
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
30
|
-
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-
|
|
31
|
-
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-
|
|
30
|
+
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-BPohUtyD.mjs";
|
|
31
|
+
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-CL6R8xaY.mjs";
|
|
32
32
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
33
33
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
34
34
|
import { StorageOrchestratorAddon, a as createHubCapForwardService, i as HUB_CAP_FWD_SERVICE, o as stripForwardedCaller, r as HUB_CAP_FWD_ACTION, s as buildStorageLocationRegistry, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
35
35
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
36
|
-
import { A as evaluateExistingCert, B as AGENT_HTTPS_NAMES_COLLECTION, C as localCaCommonName, D as LEAF_RENEWAL_WINDOW_DAYS, E as CA_VALIDITY_DAYS, F as isConstrainedCa, H as AgentHttpsNames, I as isLocalOnlyHostname, L as permitsIdentity, M as PERMITTED_DNS_SUFFIXES, N as PERMITTED_IP_RANGES, O as MAX_LEAF_VALIDITY_DAYS, P as buildNameConstraintSet, R as permitsName, T as systemHostFacts, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, _ as pemDigest, a as AgentHttpsInstallError, c as certificateNames, d as describeHttpsLeaf, f as installAgentHttps, g as loadAgentHttps, h as issueAgentHttpsLeaf, i as loadOrCreateHubId, k as SERVER_AUTH_OID, l as collectAgentNames, m as isPrivateAddress, n as HUB_IDENTITY_RELATIVE, o as acceptAgentSans, p as isContainerBridgeAddress, r as isAnnouncedHubId, s as agentHttpsPaths, t as HUB_IDENTITY_FILE, u as createAgentHttpsRequest, v as pinnedHttpsCaFingerprint, w as collectCertIdentity, y as CA_COMMON_NAME, z as readNameConstraints } from "./hub-identity-
|
|
37
|
-
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-
|
|
36
|
+
import { A as evaluateExistingCert, B as AGENT_HTTPS_NAMES_COLLECTION, C as localCaCommonName, D as LEAF_RENEWAL_WINDOW_DAYS, E as CA_VALIDITY_DAYS, F as isConstrainedCa, H as AgentHttpsNames, I as isLocalOnlyHostname, L as permitsIdentity, M as PERMITTED_DNS_SUFFIXES, N as PERMITTED_IP_RANGES, O as MAX_LEAF_VALIDITY_DAYS, P as buildNameConstraintSet, R as permitsName, T as systemHostFacts, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, _ as pemDigest, a as AgentHttpsInstallError, c as certificateNames, d as describeHttpsLeaf, f as installAgentHttps, g as loadAgentHttps, h as issueAgentHttpsLeaf, i as loadOrCreateHubId, k as SERVER_AUTH_OID, l as collectAgentNames, m as isPrivateAddress, n as HUB_IDENTITY_RELATIVE, o as acceptAgentSans, p as isContainerBridgeAddress, r as isAnnouncedHubId, s as agentHttpsPaths, t as HUB_IDENTITY_FILE, u as createAgentHttpsRequest, v as pinnedHttpsCaFingerprint, w as collectCertIdentity, y as CA_COMMON_NAME, z as readNameConstraints } from "./hub-identity-BrGlipuh.mjs";
|
|
37
|
+
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-CNZ_oxrp.mjs";
|
|
38
38
|
import { $ as caFingerprint, A as emitProcessNodeRegistered, B as setProcessMeshTlsListenerState, C as verifyMembershipAnswer, Ct as parseOriginList, D as ServiceBroker, Dt as parseCidrList, E as Errors, Et as normalizeIp, F as setProcessMeshPeerTransportLookup, G as describeMeshLeaf, H as MESH_NODE_CERTIFICATES_COLUMNS, I as renewMeshCertificate, J as MeshCrl, K as getProcessMeshCertificateRegistry, L as revokeMeshCertificate, M as getProcessPeerLeaf, N as isProcessVerifiedMeshPeer, O as setProcessMeshTlsEnabler, Ot as readCidrSetting, P as onProcessNodeRegistered, Q as requireProcessMeshCa, R as getProcessMeshTlsListenerState, S as signMembershipProof, St as normalizeOrigin, SystemConfigAddon, T as TlsTcpTransporter, Tt as createCidrMatcher, U as MeshCertificateRegistry, V as MESH_NODE_CERTIFICATES_COLLECTION, W as RENEWAL_ABANDONED, X as MeshCaKeeper, Y as processMeshCrl, Z as getProcessMeshCaState, _ as keyFingerprintShort, _t as parseAgentDashboardOrigins, a as dialableHubHost, at as isValidAgentNodeId, b as MEMBERSHIP_PATHS, bt as OPAQUE_ORIGIN, c as PAIRING_MAX_CODE_ATTEMPTS, ct as loadMeshCa, d as PAIRING_PIN_DIGITS, dt as AGENT_UI_UNLOCK_TYP, et as caFingerprintCompact, f as PAIRING_PROTOCOL, ft as AGENT_UI_UNLOCK_USE, g as describeCsr, gt as mintAgentUiUnlockTicket, h as computePairingSas, ht as isAllowedAgentDashboardReturnTo, i as AgentPairing, it as generateMeshKeyPair, j as getProcessNodeMeshTransport, k as dropProcessPeer, l as PAIRING_MAX_SESSIONS, lt as AGENT_DASHBOARD_ORIGINS_FIELD, m as computePairingCommitment, mt as UnlockTicketJtiStore, n as HubPairing, nt as exportMeshPrivateKeyPem, o as hubHostFromMeshAddress, ot as issueMeshLeafForNode, p as PAIRING_TTL_MS, pt as AGENT_UI_UNLOCK_VERSION, q as setProcessMeshCertificateRegistry, r as PairingHttpError, rt as generateMeshCa, s as PAIRING_CODE_DIGITS, st as issueMeshLeafFromCsr, tt as createMeshCsrPem, u as PAIRING_PATHS, ut as AGENT_UI_UNLOCK_TTL_MS, v as signPairingProof, vt as verifyAgentUiUnlockTicket, w as MESH_TLS_PORT_HELLO_FIELD, wt as readOriginSetting, x as MembershipResponder, xt as isInsecureOrigin, y as verifyPairingProof, yt as InvalidCorsOriginError, z as openMeshTlsWhenRevocationsLoaded } from "./builtins/system-config/system-config.addon.mjs";
|
|
39
39
|
import "./builtins/system-config/index.mjs";
|
|
40
40
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
41
41
|
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-B9zFBNVa.mjs";
|
|
42
|
-
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-
|
|
42
|
+
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-Dzht7PBY.mjs";
|
|
43
43
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
44
44
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
45
|
-
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
45
|
+
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-D_3y4vj-.mjs";
|
|
46
46
|
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
|
|
47
47
|
import { z } from "zod";
|
|
48
48
|
import * as crypto$1 from "node:crypto";
|
|
@@ -1223,23 +1223,23 @@ function formatSocketPlane(window) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
//#endregion
|
|
1225
1225
|
//#region src/kernel/moleculer/mesh-queue-report.ts
|
|
1226
|
-
function isRecord$
|
|
1226
|
+
function isRecord$6(value) {
|
|
1227
1227
|
return typeof value === "object" && value !== null;
|
|
1228
1228
|
}
|
|
1229
1229
|
/** The shape `TcpWriter` keeps its sockets in. Anything else is not a mesh. */
|
|
1230
1230
|
function writerSocketsOf(broker) {
|
|
1231
|
-
if (!isRecord$
|
|
1231
|
+
if (!isRecord$6(broker)) return void 0;
|
|
1232
1232
|
const transit = broker["transit"];
|
|
1233
|
-
if (!isRecord$
|
|
1233
|
+
if (!isRecord$6(transit)) return void 0;
|
|
1234
1234
|
const transporter = transit["tx"];
|
|
1235
|
-
if (!isRecord$
|
|
1235
|
+
if (!isRecord$6(transporter)) return void 0;
|
|
1236
1236
|
const writer = transporter["writer"];
|
|
1237
|
-
if (!isRecord$
|
|
1237
|
+
if (!isRecord$6(writer)) return void 0;
|
|
1238
1238
|
const sockets = writer["sockets"];
|
|
1239
1239
|
return sockets instanceof Map ? sockets : void 0;
|
|
1240
1240
|
}
|
|
1241
1241
|
function readSocket(nodeId, socket) {
|
|
1242
|
-
if (typeof nodeId !== "string" || !isRecord$
|
|
1242
|
+
if (typeof nodeId !== "string" || !isRecord$6(socket)) return void 0;
|
|
1243
1243
|
const queuedBytes = socket["writableLength"];
|
|
1244
1244
|
const bytesWritten = socket["bytesWritten"];
|
|
1245
1245
|
if (typeof queuedBytes !== "number" || typeof bytesWritten !== "number") return void 0;
|
|
@@ -6289,7 +6289,7 @@ async function resolveUncached(options) {
|
|
|
6289
6289
|
}
|
|
6290
6290
|
//#endregion
|
|
6291
6291
|
//#region src/kernel/addon-class-resolver.ts
|
|
6292
|
-
function isRecord$
|
|
6292
|
+
function isRecord$5(value) {
|
|
6293
6293
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6294
6294
|
}
|
|
6295
6295
|
/**
|
|
@@ -6313,14 +6313,14 @@ function isRecord$6(value) {
|
|
|
6313
6313
|
function isAddonConstructor(fn) {
|
|
6314
6314
|
if (typeof fn !== "function") return false;
|
|
6315
6315
|
const proto = fn.prototype;
|
|
6316
|
-
if (!isRecord$
|
|
6316
|
+
if (!isRecord$5(proto)) return false;
|
|
6317
6317
|
return typeof proto["initialize"] === "function";
|
|
6318
6318
|
}
|
|
6319
6319
|
function resolveAddonClass(mod) {
|
|
6320
6320
|
let candidate = mod["default"];
|
|
6321
|
-
if (isRecord$
|
|
6321
|
+
if (isRecord$5(candidate) && "default" in candidate) candidate = candidate["default"];
|
|
6322
6322
|
if (isAddonConstructor(candidate)) return candidate;
|
|
6323
|
-
if (isRecord$
|
|
6323
|
+
if (isRecord$5(candidate)) {
|
|
6324
6324
|
const fn = Object.values(candidate).find(isAddonConstructor);
|
|
6325
6325
|
if (fn) return fn;
|
|
6326
6326
|
}
|
|
@@ -6329,7 +6329,7 @@ function resolveAddonClass(mod) {
|
|
|
6329
6329
|
}
|
|
6330
6330
|
//#endregion
|
|
6331
6331
|
//#region src/kernel/addon-loader.ts
|
|
6332
|
-
function isRecord$
|
|
6332
|
+
function isRecord$4(value) {
|
|
6333
6333
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6334
6334
|
}
|
|
6335
6335
|
/**
|
|
@@ -6427,12 +6427,12 @@ async function importAddonModuleFresh(entryPath) {
|
|
|
6427
6427
|
* AddonPackageManifest + AddonDeclaration.
|
|
6428
6428
|
*/
|
|
6429
6429
|
function isAddonPackageManifest(value) {
|
|
6430
|
-
if (!isRecord$
|
|
6430
|
+
if (!isRecord$4(value)) return false;
|
|
6431
6431
|
if (!Array.isArray(value.addons)) return false;
|
|
6432
|
-
return value.addons.every((a) => isRecord$
|
|
6432
|
+
return value.addons.every((a) => isRecord$4(a) && typeof a.id === "string");
|
|
6433
6433
|
}
|
|
6434
6434
|
function toAddonPackageManifest(value) {
|
|
6435
|
-
if (!isRecord$
|
|
6435
|
+
if (!isRecord$4(value)) return void 0;
|
|
6436
6436
|
if (!isAddonPackageManifest(value)) return void 0;
|
|
6437
6437
|
return value;
|
|
6438
6438
|
}
|
|
@@ -6598,7 +6598,7 @@ var AddonLoader = class {
|
|
|
6598
6598
|
}
|
|
6599
6599
|
if (!fs$1.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6600
6600
|
const modUnknown = await importAddonModuleFresh(entryPath);
|
|
6601
|
-
const mod = isRecord$
|
|
6601
|
+
const mod = isRecord$4(modUnknown) ? modUnknown : {};
|
|
6602
6602
|
const AddonClass = resolveAddonClass(mod);
|
|
6603
6603
|
if (!AddonClass) throw new Error(`No addon class in ${entryPath}`);
|
|
6604
6604
|
this.addons.set(declaration.id, {
|
|
@@ -6614,7 +6614,7 @@ var AddonLoader = class {
|
|
|
6614
6614
|
/** Load addon from a direct path (for development/testing) */
|
|
6615
6615
|
async loadFromPath(addonId, modulePath, packageName, declaration, packageVersion = "0.0.0") {
|
|
6616
6616
|
const modUnknown = await importAddonModuleFresh(modulePath);
|
|
6617
|
-
const mod = isRecord$
|
|
6617
|
+
const mod = isRecord$4(modUnknown) ? modUnknown : {};
|
|
6618
6618
|
const AddonClass = resolveAddonClass(mod);
|
|
6619
6619
|
if (!AddonClass) throw new Error(`Module ${modulePath} has no default export`);
|
|
6620
6620
|
this.addons.set(addonId, {
|
|
@@ -10793,11 +10793,17 @@ var CapabilityRegistry = class CapabilityRegistry {
|
|
|
10793
10793
|
* `status ⊆ runtimeState`, so the merged runtime slice parses and a
|
|
10794
10794
|
* runtime-only key such as `lastFetchedAt` is stripped. A slice that does not
|
|
10795
10795
|
* parse is `null`, logged once per `(cap, device)` transition with the device
|
|
10796
|
-
* tag; a held claim is `null` without a parse.
|
|
10797
|
-
*
|
|
10796
|
+
* tag; a held claim is `null` without a parse.
|
|
10797
|
+
*
|
|
10798
|
+
* A cap with no `status` block is never overlaid: its `getStatus`, if it has
|
|
10799
|
+
* one, is the cap's OWN method over its own output shape (`power-source`
|
|
10800
|
+
* answers `PowerSourceInfo`, not its runtime slice), so the merged slice is
|
|
10801
|
+
* the wrong answer for it.
|
|
10798
10802
|
*/
|
|
10799
10803
|
async resolveClaimedStatus(capName, deviceId) {
|
|
10800
10804
|
if (this.statusOverlay === null) return UNCLAIMED;
|
|
10805
|
+
const def = this.getDefinition(capName);
|
|
10806
|
+
if (def !== void 0 && def.status === void 0) return UNCLAIMED;
|
|
10801
10807
|
return this.parseClaimed(capName, deviceId, await this.statusOverlay.resolve(capName, deviceId));
|
|
10802
10808
|
}
|
|
10803
10809
|
parseClaimed(capName, deviceId, answer) {
|
|
@@ -11937,11 +11943,11 @@ function createDeviceSettingsResolver(door, addonId) {
|
|
|
11937
11943
|
}
|
|
11938
11944
|
//#endregion
|
|
11939
11945
|
//#region src/kernel/settings-door-view.ts
|
|
11940
|
-
function isRecord$
|
|
11946
|
+
function isRecord$3(value) {
|
|
11941
11947
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11942
11948
|
}
|
|
11943
11949
|
function asBlob(value) {
|
|
11944
|
-
return isRecord$
|
|
11950
|
+
return isRecord$3(value) ? value : {};
|
|
11945
11951
|
}
|
|
11946
11952
|
/**
|
|
11947
11953
|
* Every `system-settings` row under `prefix`, keyed by the suffix — or a throw.
|
|
@@ -12047,2473 +12053,6 @@ var bootstrapSchema = z.object({
|
|
|
12047
12053
|
bootstrap: bootstrapAddonsSchema.default(bootstrapAddonsSchema.parse({}))
|
|
12048
12054
|
});
|
|
12049
12055
|
//#endregion
|
|
12050
|
-
//#region ../../node_modules/js-yaml/dist/js-yaml.mjs
|
|
12051
|
-
/*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
12052
|
-
var __create = Object.create;
|
|
12053
|
-
var __defProp = Object.defineProperty;
|
|
12054
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12055
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12056
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
12057
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12058
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
12059
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12060
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12061
|
-
key = keys[i];
|
|
12062
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12063
|
-
get: ((k) => from[k]).bind(null, key),
|
|
12064
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12065
|
-
});
|
|
12066
|
-
}
|
|
12067
|
-
return to;
|
|
12068
|
-
};
|
|
12069
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
12070
|
-
value: mod,
|
|
12071
|
-
enumerable: true
|
|
12072
|
-
}) : target, mod));
|
|
12073
|
-
var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12074
|
-
function isNothing(subject) {
|
|
12075
|
-
return typeof subject === "undefined" || subject === null;
|
|
12076
|
-
}
|
|
12077
|
-
function isObject(subject) {
|
|
12078
|
-
return typeof subject === "object" && subject !== null;
|
|
12079
|
-
}
|
|
12080
|
-
function toArray(sequence) {
|
|
12081
|
-
if (Array.isArray(sequence)) return sequence;
|
|
12082
|
-
else if (isNothing(sequence)) return [];
|
|
12083
|
-
return [sequence];
|
|
12084
|
-
}
|
|
12085
|
-
function extend(target, source) {
|
|
12086
|
-
if (source) {
|
|
12087
|
-
const sourceKeys = Object.keys(source);
|
|
12088
|
-
for (let index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
12089
|
-
const key = sourceKeys[index];
|
|
12090
|
-
target[key] = source[key];
|
|
12091
|
-
}
|
|
12092
|
-
}
|
|
12093
|
-
return target;
|
|
12094
|
-
}
|
|
12095
|
-
function repeat(string, count) {
|
|
12096
|
-
let result = "";
|
|
12097
|
-
for (let cycle = 0; cycle < count; cycle += 1) result += string;
|
|
12098
|
-
return result;
|
|
12099
|
-
}
|
|
12100
|
-
function isNegativeZero(number) {
|
|
12101
|
-
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
12102
|
-
}
|
|
12103
|
-
module.exports.isNothing = isNothing;
|
|
12104
|
-
module.exports.isObject = isObject;
|
|
12105
|
-
module.exports.toArray = toArray;
|
|
12106
|
-
module.exports.repeat = repeat;
|
|
12107
|
-
module.exports.isNegativeZero = isNegativeZero;
|
|
12108
|
-
module.exports.extend = extend;
|
|
12109
|
-
}));
|
|
12110
|
-
var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12111
|
-
function formatError(exception, compact) {
|
|
12112
|
-
let where = "";
|
|
12113
|
-
const message = exception.reason || "(unknown reason)";
|
|
12114
|
-
if (!exception.mark) return message;
|
|
12115
|
-
if (exception.mark.name) where += "in \"" + exception.mark.name + "\" ";
|
|
12116
|
-
where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")";
|
|
12117
|
-
if (!compact && exception.mark.snippet) where += "\n\n" + exception.mark.snippet;
|
|
12118
|
-
return message + " " + where;
|
|
12119
|
-
}
|
|
12120
|
-
function YAMLException(reason, mark) {
|
|
12121
|
-
Error.call(this);
|
|
12122
|
-
this.name = "YAMLException";
|
|
12123
|
-
this.reason = reason;
|
|
12124
|
-
this.mark = mark;
|
|
12125
|
-
this.message = formatError(this, false);
|
|
12126
|
-
if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
|
|
12127
|
-
else this.stack = (/* @__PURE__ */ new Error()).stack || "";
|
|
12128
|
-
}
|
|
12129
|
-
YAMLException.prototype = Object.create(Error.prototype);
|
|
12130
|
-
YAMLException.prototype.constructor = YAMLException;
|
|
12131
|
-
YAMLException.prototype.toString = function toString(compact) {
|
|
12132
|
-
return this.name + ": " + formatError(this, compact);
|
|
12133
|
-
};
|
|
12134
|
-
module.exports = YAMLException;
|
|
12135
|
-
}));
|
|
12136
|
-
var require_snippet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12137
|
-
var common = require_common();
|
|
12138
|
-
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
12139
|
-
let head = "";
|
|
12140
|
-
let tail = "";
|
|
12141
|
-
const maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
12142
|
-
if (position - lineStart > maxHalfLength) {
|
|
12143
|
-
head = " ... ";
|
|
12144
|
-
lineStart = position - maxHalfLength + head.length;
|
|
12145
|
-
}
|
|
12146
|
-
if (lineEnd - position > maxHalfLength) {
|
|
12147
|
-
tail = " ...";
|
|
12148
|
-
lineEnd = position + maxHalfLength - tail.length;
|
|
12149
|
-
}
|
|
12150
|
-
return {
|
|
12151
|
-
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
|
|
12152
|
-
pos: position - lineStart + head.length
|
|
12153
|
-
};
|
|
12154
|
-
}
|
|
12155
|
-
function padStart(string, max) {
|
|
12156
|
-
return common.repeat(" ", max - string.length) + string;
|
|
12157
|
-
}
|
|
12158
|
-
function makeSnippet(mark, options) {
|
|
12159
|
-
options = Object.create(options || null);
|
|
12160
|
-
if (!mark.buffer) return null;
|
|
12161
|
-
if (!options.maxLength) options.maxLength = 79;
|
|
12162
|
-
if (typeof options.indent !== "number") options.indent = 1;
|
|
12163
|
-
if (typeof options.linesBefore !== "number") options.linesBefore = 3;
|
|
12164
|
-
if (typeof options.linesAfter !== "number") options.linesAfter = 2;
|
|
12165
|
-
const re = /\r?\n|\r|\0/g;
|
|
12166
|
-
const lineStarts = [0];
|
|
12167
|
-
const lineEnds = [];
|
|
12168
|
-
let match;
|
|
12169
|
-
let foundLineNo = -1;
|
|
12170
|
-
while (match = re.exec(mark.buffer)) {
|
|
12171
|
-
lineEnds.push(match.index);
|
|
12172
|
-
lineStarts.push(match.index + match[0].length);
|
|
12173
|
-
if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2;
|
|
12174
|
-
}
|
|
12175
|
-
if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
|
|
12176
|
-
let result = "";
|
|
12177
|
-
const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
12178
|
-
const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
12179
|
-
for (let i = 1; i <= options.linesBefore; i++) {
|
|
12180
|
-
if (foundLineNo - i < 0) break;
|
|
12181
|
-
const line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
|
|
12182
|
-
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
|
12183
|
-
}
|
|
12184
|
-
const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
12185
|
-
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
12186
|
-
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
12187
|
-
for (let i = 1; i <= options.linesAfter; i++) {
|
|
12188
|
-
if (foundLineNo + i >= lineEnds.length) break;
|
|
12189
|
-
const line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
|
|
12190
|
-
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
12191
|
-
}
|
|
12192
|
-
return result.replace(/\n$/, "");
|
|
12193
|
-
}
|
|
12194
|
-
module.exports = makeSnippet;
|
|
12195
|
-
}));
|
|
12196
|
-
var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12197
|
-
var YAMLException = require_exception();
|
|
12198
|
-
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
12199
|
-
"kind",
|
|
12200
|
-
"multi",
|
|
12201
|
-
"resolve",
|
|
12202
|
-
"construct",
|
|
12203
|
-
"instanceOf",
|
|
12204
|
-
"predicate",
|
|
12205
|
-
"represent",
|
|
12206
|
-
"representName",
|
|
12207
|
-
"defaultStyle",
|
|
12208
|
-
"styleAliases"
|
|
12209
|
-
];
|
|
12210
|
-
var YAML_NODE_KINDS = [
|
|
12211
|
-
"scalar",
|
|
12212
|
-
"sequence",
|
|
12213
|
-
"mapping"
|
|
12214
|
-
];
|
|
12215
|
-
function compileStyleAliases(map) {
|
|
12216
|
-
const result = {};
|
|
12217
|
-
if (map !== null) Object.keys(map).forEach(function(style) {
|
|
12218
|
-
map[style].forEach(function(alias) {
|
|
12219
|
-
result[String(alias)] = style;
|
|
12220
|
-
});
|
|
12221
|
-
});
|
|
12222
|
-
return result;
|
|
12223
|
-
}
|
|
12224
|
-
function Type(tag, options) {
|
|
12225
|
-
options = options || {};
|
|
12226
|
-
Object.keys(options).forEach(function(name) {
|
|
12227
|
-
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) throw new YAMLException("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type.");
|
|
12228
|
-
});
|
|
12229
|
-
this.options = options;
|
|
12230
|
-
this.tag = tag;
|
|
12231
|
-
this.kind = options["kind"] || null;
|
|
12232
|
-
this.resolve = options["resolve"] || function() {
|
|
12233
|
-
return true;
|
|
12234
|
-
};
|
|
12235
|
-
this.construct = options["construct"] || function(data) {
|
|
12236
|
-
return data;
|
|
12237
|
-
};
|
|
12238
|
-
this.instanceOf = options["instanceOf"] || null;
|
|
12239
|
-
this.predicate = options["predicate"] || null;
|
|
12240
|
-
this.represent = options["represent"] || null;
|
|
12241
|
-
this.representName = options["representName"] || null;
|
|
12242
|
-
this.defaultStyle = options["defaultStyle"] || null;
|
|
12243
|
-
this.multi = options["multi"] || false;
|
|
12244
|
-
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
12245
|
-
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) throw new YAMLException("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type.");
|
|
12246
|
-
}
|
|
12247
|
-
module.exports = Type;
|
|
12248
|
-
}));
|
|
12249
|
-
var require_schema = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12250
|
-
var YAMLException = require_exception();
|
|
12251
|
-
var Type = require_type();
|
|
12252
|
-
function compileList(schema, name) {
|
|
12253
|
-
const result = [];
|
|
12254
|
-
schema[name].forEach(function(currentType) {
|
|
12255
|
-
let newIndex = result.length;
|
|
12256
|
-
result.forEach(function(previousType, previousIndex) {
|
|
12257
|
-
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex;
|
|
12258
|
-
});
|
|
12259
|
-
result[newIndex] = currentType;
|
|
12260
|
-
});
|
|
12261
|
-
return result;
|
|
12262
|
-
}
|
|
12263
|
-
function compileMap() {
|
|
12264
|
-
const result = {
|
|
12265
|
-
scalar: {},
|
|
12266
|
-
sequence: {},
|
|
12267
|
-
mapping: {},
|
|
12268
|
-
fallback: {},
|
|
12269
|
-
multi: {
|
|
12270
|
-
scalar: [],
|
|
12271
|
-
sequence: [],
|
|
12272
|
-
mapping: [],
|
|
12273
|
-
fallback: []
|
|
12274
|
-
}
|
|
12275
|
-
};
|
|
12276
|
-
function collectType(type) {
|
|
12277
|
-
if (type.multi) {
|
|
12278
|
-
result.multi[type.kind].push(type);
|
|
12279
|
-
result.multi["fallback"].push(type);
|
|
12280
|
-
} else result[type.kind][type.tag] = result["fallback"][type.tag] = type;
|
|
12281
|
-
}
|
|
12282
|
-
for (let index = 0, length = arguments.length; index < length; index += 1) arguments[index].forEach(collectType);
|
|
12283
|
-
return result;
|
|
12284
|
-
}
|
|
12285
|
-
function Schema(definition) {
|
|
12286
|
-
return this.extend(definition);
|
|
12287
|
-
}
|
|
12288
|
-
Schema.prototype.extend = function extend(definition) {
|
|
12289
|
-
let implicit = [];
|
|
12290
|
-
let explicit = [];
|
|
12291
|
-
if (definition instanceof Type) explicit.push(definition);
|
|
12292
|
-
else if (Array.isArray(definition)) explicit = explicit.concat(definition);
|
|
12293
|
-
else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
12294
|
-
if (definition.implicit) implicit = implicit.concat(definition.implicit);
|
|
12295
|
-
if (definition.explicit) explicit = explicit.concat(definition.explicit);
|
|
12296
|
-
} else throw new YAMLException("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
12297
|
-
implicit.forEach(function(type) {
|
|
12298
|
-
if (!(type instanceof Type)) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
12299
|
-
if (type.loadKind && type.loadKind !== "scalar") throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
12300
|
-
if (type.multi) throw new YAMLException("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
12301
|
-
});
|
|
12302
|
-
explicit.forEach(function(type) {
|
|
12303
|
-
if (!(type instanceof Type)) throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
12304
|
-
});
|
|
12305
|
-
const result = Object.create(Schema.prototype);
|
|
12306
|
-
result.implicit = (this.implicit || []).concat(implicit);
|
|
12307
|
-
result.explicit = (this.explicit || []).concat(explicit);
|
|
12308
|
-
result.compiledImplicit = compileList(result, "implicit");
|
|
12309
|
-
result.compiledExplicit = compileList(result, "explicit");
|
|
12310
|
-
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
12311
|
-
return result;
|
|
12312
|
-
};
|
|
12313
|
-
module.exports = Schema;
|
|
12314
|
-
}));
|
|
12315
|
-
var require_str = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12316
|
-
module.exports = new (require_type())("tag:yaml.org,2002:str", {
|
|
12317
|
-
kind: "scalar",
|
|
12318
|
-
construct: function(data) {
|
|
12319
|
-
return data !== null ? data : "";
|
|
12320
|
-
}
|
|
12321
|
-
});
|
|
12322
|
-
}));
|
|
12323
|
-
var require_seq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12324
|
-
module.exports = new (require_type())("tag:yaml.org,2002:seq", {
|
|
12325
|
-
kind: "sequence",
|
|
12326
|
-
construct: function(data) {
|
|
12327
|
-
return data !== null ? data : [];
|
|
12328
|
-
}
|
|
12329
|
-
});
|
|
12330
|
-
}));
|
|
12331
|
-
var require_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12332
|
-
module.exports = new (require_type())("tag:yaml.org,2002:map", {
|
|
12333
|
-
kind: "mapping",
|
|
12334
|
-
construct: function(data) {
|
|
12335
|
-
return data !== null ? data : {};
|
|
12336
|
-
}
|
|
12337
|
-
});
|
|
12338
|
-
}));
|
|
12339
|
-
var require_failsafe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12340
|
-
module.exports = new (require_schema())({ explicit: [
|
|
12341
|
-
require_str(),
|
|
12342
|
-
require_seq(),
|
|
12343
|
-
require_map()
|
|
12344
|
-
] });
|
|
12345
|
-
}));
|
|
12346
|
-
var require_null = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12347
|
-
var Type = require_type();
|
|
12348
|
-
function resolveYamlNull(data) {
|
|
12349
|
-
if (data === null) return true;
|
|
12350
|
-
const max = data.length;
|
|
12351
|
-
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
12352
|
-
}
|
|
12353
|
-
function constructYamlNull() {
|
|
12354
|
-
return null;
|
|
12355
|
-
}
|
|
12356
|
-
function isNull(object) {
|
|
12357
|
-
return object === null;
|
|
12358
|
-
}
|
|
12359
|
-
module.exports = new Type("tag:yaml.org,2002:null", {
|
|
12360
|
-
kind: "scalar",
|
|
12361
|
-
resolve: resolveYamlNull,
|
|
12362
|
-
construct: constructYamlNull,
|
|
12363
|
-
predicate: isNull,
|
|
12364
|
-
represent: {
|
|
12365
|
-
canonical: function() {
|
|
12366
|
-
return "~";
|
|
12367
|
-
},
|
|
12368
|
-
lowercase: function() {
|
|
12369
|
-
return "null";
|
|
12370
|
-
},
|
|
12371
|
-
uppercase: function() {
|
|
12372
|
-
return "NULL";
|
|
12373
|
-
},
|
|
12374
|
-
camelcase: function() {
|
|
12375
|
-
return "Null";
|
|
12376
|
-
},
|
|
12377
|
-
empty: function() {
|
|
12378
|
-
return "";
|
|
12379
|
-
}
|
|
12380
|
-
},
|
|
12381
|
-
defaultStyle: "lowercase"
|
|
12382
|
-
});
|
|
12383
|
-
}));
|
|
12384
|
-
var require_bool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12385
|
-
var Type = require_type();
|
|
12386
|
-
function resolveYamlBoolean(data) {
|
|
12387
|
-
if (data === null) return false;
|
|
12388
|
-
const max = data.length;
|
|
12389
|
-
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
12390
|
-
}
|
|
12391
|
-
function constructYamlBoolean(data) {
|
|
12392
|
-
return data === "true" || data === "True" || data === "TRUE";
|
|
12393
|
-
}
|
|
12394
|
-
function isBoolean(object) {
|
|
12395
|
-
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
12396
|
-
}
|
|
12397
|
-
module.exports = new Type("tag:yaml.org,2002:bool", {
|
|
12398
|
-
kind: "scalar",
|
|
12399
|
-
resolve: resolveYamlBoolean,
|
|
12400
|
-
construct: constructYamlBoolean,
|
|
12401
|
-
predicate: isBoolean,
|
|
12402
|
-
represent: {
|
|
12403
|
-
lowercase: function(object) {
|
|
12404
|
-
return object ? "true" : "false";
|
|
12405
|
-
},
|
|
12406
|
-
uppercase: function(object) {
|
|
12407
|
-
return object ? "TRUE" : "FALSE";
|
|
12408
|
-
},
|
|
12409
|
-
camelcase: function(object) {
|
|
12410
|
-
return object ? "True" : "False";
|
|
12411
|
-
}
|
|
12412
|
-
},
|
|
12413
|
-
defaultStyle: "lowercase"
|
|
12414
|
-
});
|
|
12415
|
-
}));
|
|
12416
|
-
var require_int = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12417
|
-
var common = require_common();
|
|
12418
|
-
var Type = require_type();
|
|
12419
|
-
function isHexCode(c) {
|
|
12420
|
-
return c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102;
|
|
12421
|
-
}
|
|
12422
|
-
function isOctCode(c) {
|
|
12423
|
-
return c >= 48 && c <= 55;
|
|
12424
|
-
}
|
|
12425
|
-
function isDecCode(c) {
|
|
12426
|
-
return c >= 48 && c <= 57;
|
|
12427
|
-
}
|
|
12428
|
-
function resolveYamlInteger(data) {
|
|
12429
|
-
if (data === null) return false;
|
|
12430
|
-
const max = data.length;
|
|
12431
|
-
let index = 0;
|
|
12432
|
-
let hasDigits = false;
|
|
12433
|
-
if (!max) return false;
|
|
12434
|
-
let ch = data[index];
|
|
12435
|
-
if (ch === "-" || ch === "+") ch = data[++index];
|
|
12436
|
-
if (ch === "0") {
|
|
12437
|
-
if (index + 1 === max) return true;
|
|
12438
|
-
ch = data[++index];
|
|
12439
|
-
if (ch === "b") {
|
|
12440
|
-
index++;
|
|
12441
|
-
for (; index < max; index++) {
|
|
12442
|
-
ch = data[index];
|
|
12443
|
-
if (ch !== "0" && ch !== "1") return false;
|
|
12444
|
-
hasDigits = true;
|
|
12445
|
-
}
|
|
12446
|
-
return hasDigits && Number.isFinite(parseYamlInteger(data));
|
|
12447
|
-
}
|
|
12448
|
-
if (ch === "x") {
|
|
12449
|
-
index++;
|
|
12450
|
-
for (; index < max; index++) {
|
|
12451
|
-
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
12452
|
-
hasDigits = true;
|
|
12453
|
-
}
|
|
12454
|
-
return hasDigits && Number.isFinite(parseYamlInteger(data));
|
|
12455
|
-
}
|
|
12456
|
-
if (ch === "o") {
|
|
12457
|
-
index++;
|
|
12458
|
-
for (; index < max; index++) {
|
|
12459
|
-
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
12460
|
-
hasDigits = true;
|
|
12461
|
-
}
|
|
12462
|
-
return hasDigits && Number.isFinite(parseYamlInteger(data));
|
|
12463
|
-
}
|
|
12464
|
-
}
|
|
12465
|
-
for (; index < max; index++) {
|
|
12466
|
-
if (!isDecCode(data.charCodeAt(index))) return false;
|
|
12467
|
-
hasDigits = true;
|
|
12468
|
-
}
|
|
12469
|
-
if (!hasDigits) return false;
|
|
12470
|
-
return Number.isFinite(parseYamlInteger(data));
|
|
12471
|
-
}
|
|
12472
|
-
function parseYamlInteger(data) {
|
|
12473
|
-
let value = data;
|
|
12474
|
-
let sign = 1;
|
|
12475
|
-
let ch = value[0];
|
|
12476
|
-
if (ch === "-" || ch === "+") {
|
|
12477
|
-
if (ch === "-") sign = -1;
|
|
12478
|
-
value = value.slice(1);
|
|
12479
|
-
ch = value[0];
|
|
12480
|
-
}
|
|
12481
|
-
if (value === "0") return 0;
|
|
12482
|
-
if (ch === "0") {
|
|
12483
|
-
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
|
|
12484
|
-
if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
|
|
12485
|
-
if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
|
|
12486
|
-
}
|
|
12487
|
-
return sign * parseInt(value, 10);
|
|
12488
|
-
}
|
|
12489
|
-
function constructYamlInteger(data) {
|
|
12490
|
-
return parseYamlInteger(data);
|
|
12491
|
-
}
|
|
12492
|
-
function isInteger(object) {
|
|
12493
|
-
return Object.prototype.toString.call(object) === "[object Number]" && object % 1 === 0 && !common.isNegativeZero(object);
|
|
12494
|
-
}
|
|
12495
|
-
module.exports = new Type("tag:yaml.org,2002:int", {
|
|
12496
|
-
kind: "scalar",
|
|
12497
|
-
resolve: resolveYamlInteger,
|
|
12498
|
-
construct: constructYamlInteger,
|
|
12499
|
-
predicate: isInteger,
|
|
12500
|
-
represent: {
|
|
12501
|
-
binary: function(obj) {
|
|
12502
|
-
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
12503
|
-
},
|
|
12504
|
-
octal: function(obj) {
|
|
12505
|
-
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
12506
|
-
},
|
|
12507
|
-
decimal: function(obj) {
|
|
12508
|
-
return obj.toString(10);
|
|
12509
|
-
},
|
|
12510
|
-
hexadecimal: function(obj) {
|
|
12511
|
-
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
12512
|
-
}
|
|
12513
|
-
},
|
|
12514
|
-
defaultStyle: "decimal",
|
|
12515
|
-
styleAliases: {
|
|
12516
|
-
binary: [2, "bin"],
|
|
12517
|
-
octal: [8, "oct"],
|
|
12518
|
-
decimal: [10, "dec"],
|
|
12519
|
-
hexadecimal: [16, "hex"]
|
|
12520
|
-
}
|
|
12521
|
-
});
|
|
12522
|
-
}));
|
|
12523
|
-
var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12524
|
-
var common = require_common();
|
|
12525
|
-
var Type = require_type();
|
|
12526
|
-
var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
12527
|
-
var YAML_FLOAT_SPECIAL_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
12528
|
-
function resolveYamlFloat(data) {
|
|
12529
|
-
if (data === null) return false;
|
|
12530
|
-
if (!YAML_FLOAT_PATTERN.test(data)) return false;
|
|
12531
|
-
if (Number.isFinite(parseFloat(data, 10))) return true;
|
|
12532
|
-
return YAML_FLOAT_SPECIAL_PATTERN.test(data);
|
|
12533
|
-
}
|
|
12534
|
-
function constructYamlFloat(data) {
|
|
12535
|
-
let value = data.toLowerCase();
|
|
12536
|
-
const sign = value[0] === "-" ? -1 : 1;
|
|
12537
|
-
if ("+-".indexOf(value[0]) >= 0) value = value.slice(1);
|
|
12538
|
-
if (value === ".inf") return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
12539
|
-
else if (value === ".nan") return NaN;
|
|
12540
|
-
return sign * parseFloat(value, 10);
|
|
12541
|
-
}
|
|
12542
|
-
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
12543
|
-
function representYamlFloat(object, style) {
|
|
12544
|
-
if (isNaN(object)) switch (style) {
|
|
12545
|
-
case "lowercase": return ".nan";
|
|
12546
|
-
case "uppercase": return ".NAN";
|
|
12547
|
-
case "camelcase": return ".NaN";
|
|
12548
|
-
}
|
|
12549
|
-
else if (Number.POSITIVE_INFINITY === object) switch (style) {
|
|
12550
|
-
case "lowercase": return ".inf";
|
|
12551
|
-
case "uppercase": return ".INF";
|
|
12552
|
-
case "camelcase": return ".Inf";
|
|
12553
|
-
}
|
|
12554
|
-
else if (Number.NEGATIVE_INFINITY === object) switch (style) {
|
|
12555
|
-
case "lowercase": return "-.inf";
|
|
12556
|
-
case "uppercase": return "-.INF";
|
|
12557
|
-
case "camelcase": return "-.Inf";
|
|
12558
|
-
}
|
|
12559
|
-
else if (common.isNegativeZero(object)) return "-0.0";
|
|
12560
|
-
const res = object.toString(10);
|
|
12561
|
-
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
12562
|
-
}
|
|
12563
|
-
function isFloat(object) {
|
|
12564
|
-
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
12565
|
-
}
|
|
12566
|
-
module.exports = new Type("tag:yaml.org,2002:float", {
|
|
12567
|
-
kind: "scalar",
|
|
12568
|
-
resolve: resolveYamlFloat,
|
|
12569
|
-
construct: constructYamlFloat,
|
|
12570
|
-
predicate: isFloat,
|
|
12571
|
-
represent: representYamlFloat,
|
|
12572
|
-
defaultStyle: "lowercase"
|
|
12573
|
-
});
|
|
12574
|
-
}));
|
|
12575
|
-
var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12576
|
-
module.exports = require_failsafe().extend({ implicit: [
|
|
12577
|
-
require_null(),
|
|
12578
|
-
require_bool(),
|
|
12579
|
-
require_int(),
|
|
12580
|
-
require_float()
|
|
12581
|
-
] });
|
|
12582
|
-
}));
|
|
12583
|
-
var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12584
|
-
module.exports = require_json();
|
|
12585
|
-
}));
|
|
12586
|
-
var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12587
|
-
var Type = require_type();
|
|
12588
|
-
var YAML_DATE_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
|
|
12589
|
-
var YAML_TIMESTAMP_REGEXP = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
12590
|
-
function resolveYamlTimestamp(data) {
|
|
12591
|
-
if (data === null) return false;
|
|
12592
|
-
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
|
12593
|
-
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
|
12594
|
-
return false;
|
|
12595
|
-
}
|
|
12596
|
-
function constructYamlTimestamp(data) {
|
|
12597
|
-
let fraction = 0;
|
|
12598
|
-
let delta = null;
|
|
12599
|
-
let match = YAML_DATE_REGEXP.exec(data);
|
|
12600
|
-
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
12601
|
-
if (match === null) throw new Error("Date resolve error");
|
|
12602
|
-
const year = +match[1];
|
|
12603
|
-
const month = +match[2] - 1;
|
|
12604
|
-
const day = +match[3];
|
|
12605
|
-
if (!match[4]) return new Date(Date.UTC(year, month, day));
|
|
12606
|
-
const hour = +match[4];
|
|
12607
|
-
const minute = +match[5];
|
|
12608
|
-
const second = +match[6];
|
|
12609
|
-
if (match[7]) {
|
|
12610
|
-
fraction = match[7].slice(0, 3);
|
|
12611
|
-
while (fraction.length < 3) fraction += "0";
|
|
12612
|
-
fraction = +fraction;
|
|
12613
|
-
}
|
|
12614
|
-
if (match[9]) {
|
|
12615
|
-
const tzHour = +match[10];
|
|
12616
|
-
const tzMinute = +(match[11] || 0);
|
|
12617
|
-
delta = (tzHour * 60 + tzMinute) * 6e4;
|
|
12618
|
-
if (match[9] === "-") delta = -delta;
|
|
12619
|
-
}
|
|
12620
|
-
const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
12621
|
-
if (delta) date.setTime(date.getTime() - delta);
|
|
12622
|
-
return date;
|
|
12623
|
-
}
|
|
12624
|
-
function representYamlTimestamp(object) {
|
|
12625
|
-
return object.toISOString();
|
|
12626
|
-
}
|
|
12627
|
-
module.exports = new Type("tag:yaml.org,2002:timestamp", {
|
|
12628
|
-
kind: "scalar",
|
|
12629
|
-
resolve: resolveYamlTimestamp,
|
|
12630
|
-
construct: constructYamlTimestamp,
|
|
12631
|
-
instanceOf: Date,
|
|
12632
|
-
represent: representYamlTimestamp
|
|
12633
|
-
});
|
|
12634
|
-
}));
|
|
12635
|
-
var require_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12636
|
-
var Type = require_type();
|
|
12637
|
-
function resolveYamlMerge(data) {
|
|
12638
|
-
return data === "<<" || data === null;
|
|
12639
|
-
}
|
|
12640
|
-
module.exports = new Type("tag:yaml.org,2002:merge", {
|
|
12641
|
-
kind: "scalar",
|
|
12642
|
-
resolve: resolveYamlMerge
|
|
12643
|
-
});
|
|
12644
|
-
}));
|
|
12645
|
-
var require_binary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12646
|
-
var Type = require_type();
|
|
12647
|
-
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
12648
|
-
function resolveYamlBinary(data) {
|
|
12649
|
-
if (data === null) return false;
|
|
12650
|
-
let bitlen = 0;
|
|
12651
|
-
const max = data.length;
|
|
12652
|
-
const map = BASE64_MAP;
|
|
12653
|
-
for (let idx = 0; idx < max; idx++) {
|
|
12654
|
-
const code = map.indexOf(data.charAt(idx));
|
|
12655
|
-
if (code > 64) continue;
|
|
12656
|
-
if (code < 0) return false;
|
|
12657
|
-
bitlen += 6;
|
|
12658
|
-
}
|
|
12659
|
-
return bitlen % 8 === 0;
|
|
12660
|
-
}
|
|
12661
|
-
function constructYamlBinary(data) {
|
|
12662
|
-
const input = data.replace(/[\r\n=]/g, "");
|
|
12663
|
-
const max = input.length;
|
|
12664
|
-
const map = BASE64_MAP;
|
|
12665
|
-
let bits = 0;
|
|
12666
|
-
const result = [];
|
|
12667
|
-
for (let idx = 0; idx < max; idx++) {
|
|
12668
|
-
if (idx % 4 === 0 && idx) {
|
|
12669
|
-
result.push(bits >> 16 & 255);
|
|
12670
|
-
result.push(bits >> 8 & 255);
|
|
12671
|
-
result.push(bits & 255);
|
|
12672
|
-
}
|
|
12673
|
-
bits = bits << 6 | map.indexOf(input.charAt(idx));
|
|
12674
|
-
}
|
|
12675
|
-
const tailbits = max % 4 * 6;
|
|
12676
|
-
if (tailbits === 0) {
|
|
12677
|
-
result.push(bits >> 16 & 255);
|
|
12678
|
-
result.push(bits >> 8 & 255);
|
|
12679
|
-
result.push(bits & 255);
|
|
12680
|
-
} else if (tailbits === 18) {
|
|
12681
|
-
result.push(bits >> 10 & 255);
|
|
12682
|
-
result.push(bits >> 2 & 255);
|
|
12683
|
-
} else if (tailbits === 12) result.push(bits >> 4 & 255);
|
|
12684
|
-
return new Uint8Array(result);
|
|
12685
|
-
}
|
|
12686
|
-
function representYamlBinary(object) {
|
|
12687
|
-
let result = "";
|
|
12688
|
-
let bits = 0;
|
|
12689
|
-
const max = object.length;
|
|
12690
|
-
const map = BASE64_MAP;
|
|
12691
|
-
for (let idx = 0; idx < max; idx++) {
|
|
12692
|
-
if (idx % 3 === 0 && idx) {
|
|
12693
|
-
result += map[bits >> 18 & 63];
|
|
12694
|
-
result += map[bits >> 12 & 63];
|
|
12695
|
-
result += map[bits >> 6 & 63];
|
|
12696
|
-
result += map[bits & 63];
|
|
12697
|
-
}
|
|
12698
|
-
bits = (bits << 8) + object[idx];
|
|
12699
|
-
}
|
|
12700
|
-
const tail = max % 3;
|
|
12701
|
-
if (tail === 0) {
|
|
12702
|
-
result += map[bits >> 18 & 63];
|
|
12703
|
-
result += map[bits >> 12 & 63];
|
|
12704
|
-
result += map[bits >> 6 & 63];
|
|
12705
|
-
result += map[bits & 63];
|
|
12706
|
-
} else if (tail === 2) {
|
|
12707
|
-
result += map[bits >> 10 & 63];
|
|
12708
|
-
result += map[bits >> 4 & 63];
|
|
12709
|
-
result += map[bits << 2 & 63];
|
|
12710
|
-
result += map[64];
|
|
12711
|
-
} else if (tail === 1) {
|
|
12712
|
-
result += map[bits >> 2 & 63];
|
|
12713
|
-
result += map[bits << 4 & 63];
|
|
12714
|
-
result += map[64];
|
|
12715
|
-
result += map[64];
|
|
12716
|
-
}
|
|
12717
|
-
return result;
|
|
12718
|
-
}
|
|
12719
|
-
function isBinary(obj) {
|
|
12720
|
-
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
|
12721
|
-
}
|
|
12722
|
-
module.exports = new Type("tag:yaml.org,2002:binary", {
|
|
12723
|
-
kind: "scalar",
|
|
12724
|
-
resolve: resolveYamlBinary,
|
|
12725
|
-
construct: constructYamlBinary,
|
|
12726
|
-
predicate: isBinary,
|
|
12727
|
-
represent: representYamlBinary
|
|
12728
|
-
});
|
|
12729
|
-
}));
|
|
12730
|
-
var require_omap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12731
|
-
var Type = require_type();
|
|
12732
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
12733
|
-
var _toString = Object.prototype.toString;
|
|
12734
|
-
function resolveYamlOmap(data) {
|
|
12735
|
-
if (data === null) return true;
|
|
12736
|
-
const objectKeys = [];
|
|
12737
|
-
const object = data;
|
|
12738
|
-
for (let index = 0, length = object.length; index < length; index += 1) {
|
|
12739
|
-
const pair = object[index];
|
|
12740
|
-
let pairHasKey = false;
|
|
12741
|
-
if (_toString.call(pair) !== "[object Object]") return false;
|
|
12742
|
-
let pairKey;
|
|
12743
|
-
for (pairKey in pair) if (_hasOwnProperty.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true;
|
|
12744
|
-
else return false;
|
|
12745
|
-
if (!pairHasKey) return false;
|
|
12746
|
-
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
|
12747
|
-
else return false;
|
|
12748
|
-
}
|
|
12749
|
-
return true;
|
|
12750
|
-
}
|
|
12751
|
-
function constructYamlOmap(data) {
|
|
12752
|
-
return data !== null ? data : [];
|
|
12753
|
-
}
|
|
12754
|
-
module.exports = new Type("tag:yaml.org,2002:omap", {
|
|
12755
|
-
kind: "sequence",
|
|
12756
|
-
resolve: resolveYamlOmap,
|
|
12757
|
-
construct: constructYamlOmap
|
|
12758
|
-
});
|
|
12759
|
-
}));
|
|
12760
|
-
var require_pairs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12761
|
-
var Type = require_type();
|
|
12762
|
-
var _toString = Object.prototype.toString;
|
|
12763
|
-
function resolveYamlPairs(data) {
|
|
12764
|
-
if (data === null) return true;
|
|
12765
|
-
const object = data;
|
|
12766
|
-
const result = new Array(object.length);
|
|
12767
|
-
for (let index = 0, length = object.length; index < length; index += 1) {
|
|
12768
|
-
const pair = object[index];
|
|
12769
|
-
if (_toString.call(pair) !== "[object Object]") return false;
|
|
12770
|
-
const keys = Object.keys(pair);
|
|
12771
|
-
if (keys.length !== 1) return false;
|
|
12772
|
-
result[index] = [keys[0], pair[keys[0]]];
|
|
12773
|
-
}
|
|
12774
|
-
return true;
|
|
12775
|
-
}
|
|
12776
|
-
function constructYamlPairs(data) {
|
|
12777
|
-
if (data === null) return [];
|
|
12778
|
-
const object = data;
|
|
12779
|
-
const result = new Array(object.length);
|
|
12780
|
-
for (let index = 0, length = object.length; index < length; index += 1) {
|
|
12781
|
-
const pair = object[index];
|
|
12782
|
-
const keys = Object.keys(pair);
|
|
12783
|
-
result[index] = [keys[0], pair[keys[0]]];
|
|
12784
|
-
}
|
|
12785
|
-
return result;
|
|
12786
|
-
}
|
|
12787
|
-
module.exports = new Type("tag:yaml.org,2002:pairs", {
|
|
12788
|
-
kind: "sequence",
|
|
12789
|
-
resolve: resolveYamlPairs,
|
|
12790
|
-
construct: constructYamlPairs
|
|
12791
|
-
});
|
|
12792
|
-
}));
|
|
12793
|
-
var require_set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12794
|
-
var Type = require_type();
|
|
12795
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
12796
|
-
function resolveYamlSet(data) {
|
|
12797
|
-
if (data === null) return true;
|
|
12798
|
-
const object = data;
|
|
12799
|
-
for (const key in object) if (_hasOwnProperty.call(object, key)) {
|
|
12800
|
-
if (object[key] !== null) return false;
|
|
12801
|
-
}
|
|
12802
|
-
return true;
|
|
12803
|
-
}
|
|
12804
|
-
function constructYamlSet(data) {
|
|
12805
|
-
return data !== null ? data : {};
|
|
12806
|
-
}
|
|
12807
|
-
module.exports = new Type("tag:yaml.org,2002:set", {
|
|
12808
|
-
kind: "mapping",
|
|
12809
|
-
resolve: resolveYamlSet,
|
|
12810
|
-
construct: constructYamlSet
|
|
12811
|
-
});
|
|
12812
|
-
}));
|
|
12813
|
-
var require_default = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12814
|
-
module.exports = require_core().extend({
|
|
12815
|
-
implicit: [require_timestamp(), require_merge()],
|
|
12816
|
-
explicit: [
|
|
12817
|
-
require_binary(),
|
|
12818
|
-
require_omap(),
|
|
12819
|
-
require_pairs(),
|
|
12820
|
-
require_set()
|
|
12821
|
-
]
|
|
12822
|
-
});
|
|
12823
|
-
}));
|
|
12824
|
-
var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12825
|
-
var common = require_common();
|
|
12826
|
-
var YAMLException = require_exception();
|
|
12827
|
-
var makeSnippet = require_snippet();
|
|
12828
|
-
var DEFAULT_SCHEMA = require_default();
|
|
12829
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
12830
|
-
var CONTEXT_FLOW_IN = 1;
|
|
12831
|
-
var CONTEXT_FLOW_OUT = 2;
|
|
12832
|
-
var CONTEXT_BLOCK_IN = 3;
|
|
12833
|
-
var CONTEXT_BLOCK_OUT = 4;
|
|
12834
|
-
var CHOMPING_CLIP = 1;
|
|
12835
|
-
var CHOMPING_STRIP = 2;
|
|
12836
|
-
var CHOMPING_KEEP = 3;
|
|
12837
|
-
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
12838
|
-
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
12839
|
-
var PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
|
|
12840
|
-
var PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
|
|
12841
|
-
var PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;
|
|
12842
|
-
function _class(obj) {
|
|
12843
|
-
return Object.prototype.toString.call(obj);
|
|
12844
|
-
}
|
|
12845
|
-
function isEol(c) {
|
|
12846
|
-
return c === 10 || c === 13;
|
|
12847
|
-
}
|
|
12848
|
-
function isWhiteSpace(c) {
|
|
12849
|
-
return c === 9 || c === 32;
|
|
12850
|
-
}
|
|
12851
|
-
function isWsOrEol(c) {
|
|
12852
|
-
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
12853
|
-
}
|
|
12854
|
-
function isFlowIndicator(c) {
|
|
12855
|
-
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
12856
|
-
}
|
|
12857
|
-
function fromHexCode(c) {
|
|
12858
|
-
if (c >= 48 && c <= 57) return c - 48;
|
|
12859
|
-
const lc = c | 32;
|
|
12860
|
-
if (lc >= 97 && lc <= 102) return lc - 97 + 10;
|
|
12861
|
-
return -1;
|
|
12862
|
-
}
|
|
12863
|
-
function escapedHexLen(c) {
|
|
12864
|
-
if (c === 120) return 2;
|
|
12865
|
-
if (c === 117) return 4;
|
|
12866
|
-
if (c === 85) return 8;
|
|
12867
|
-
return 0;
|
|
12868
|
-
}
|
|
12869
|
-
function fromDecimalCode(c) {
|
|
12870
|
-
if (c >= 48 && c <= 57) return c - 48;
|
|
12871
|
-
return -1;
|
|
12872
|
-
}
|
|
12873
|
-
function simpleEscapeSequence(c) {
|
|
12874
|
-
switch (c) {
|
|
12875
|
-
case 48: return "\0";
|
|
12876
|
-
case 97: return "\x07";
|
|
12877
|
-
case 98: return "\b";
|
|
12878
|
-
case 116: return " ";
|
|
12879
|
-
case 9: return " ";
|
|
12880
|
-
case 110: return "\n";
|
|
12881
|
-
case 118: return "\v";
|
|
12882
|
-
case 102: return "\f";
|
|
12883
|
-
case 114: return "\r";
|
|
12884
|
-
case 101: return "\x1B";
|
|
12885
|
-
case 32: return " ";
|
|
12886
|
-
case 34: return "\"";
|
|
12887
|
-
case 47: return "/";
|
|
12888
|
-
case 92: return "\\";
|
|
12889
|
-
case 78: return "
";
|
|
12890
|
-
case 95: return "\xA0";
|
|
12891
|
-
case 76: return "\u2028";
|
|
12892
|
-
case 80: return "\u2029";
|
|
12893
|
-
default: return "";
|
|
12894
|
-
}
|
|
12895
|
-
}
|
|
12896
|
-
function charFromCodepoint(c) {
|
|
12897
|
-
if (c <= 65535) return String.fromCharCode(c);
|
|
12898
|
-
return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
|
|
12899
|
-
}
|
|
12900
|
-
function setProperty(object, key, value) {
|
|
12901
|
-
if (key === "__proto__") Object.defineProperty(object, key, {
|
|
12902
|
-
configurable: true,
|
|
12903
|
-
enumerable: true,
|
|
12904
|
-
writable: true,
|
|
12905
|
-
value
|
|
12906
|
-
});
|
|
12907
|
-
else object[key] = value;
|
|
12908
|
-
}
|
|
12909
|
-
var simpleEscapeCheck = new Array(256);
|
|
12910
|
-
var simpleEscapeMap = new Array(256);
|
|
12911
|
-
for (let i = 0; i < 256; i++) {
|
|
12912
|
-
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
12913
|
-
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
12914
|
-
}
|
|
12915
|
-
function State(input, options) {
|
|
12916
|
-
this.input = input;
|
|
12917
|
-
this.filename = options["filename"] || null;
|
|
12918
|
-
this.schema = options["schema"] || DEFAULT_SCHEMA;
|
|
12919
|
-
this.onWarning = options["onWarning"] || null;
|
|
12920
|
-
this.legacy = options["legacy"] || false;
|
|
12921
|
-
this.json = options["json"] || false;
|
|
12922
|
-
this.listener = options["listener"] || null;
|
|
12923
|
-
this.maxDepth = typeof options["maxDepth"] === "number" ? options["maxDepth"] : 100;
|
|
12924
|
-
this.maxMergeSeqLength = typeof options["maxMergeSeqLength"] === "number" ? options["maxMergeSeqLength"] : 20;
|
|
12925
|
-
this.implicitTypes = this.schema.compiledImplicit;
|
|
12926
|
-
this.typeMap = this.schema.compiledTypeMap;
|
|
12927
|
-
this.length = input.length;
|
|
12928
|
-
this.position = 0;
|
|
12929
|
-
this.line = 0;
|
|
12930
|
-
this.lineStart = 0;
|
|
12931
|
-
this.lineIndent = 0;
|
|
12932
|
-
this.depth = 0;
|
|
12933
|
-
this.firstTabInLine = -1;
|
|
12934
|
-
this.documents = [];
|
|
12935
|
-
this.anchorMapTransactions = [];
|
|
12936
|
-
}
|
|
12937
|
-
function generateError(state, message) {
|
|
12938
|
-
const mark = {
|
|
12939
|
-
name: state.filename,
|
|
12940
|
-
buffer: state.input.slice(0, -1),
|
|
12941
|
-
position: state.position,
|
|
12942
|
-
line: state.line,
|
|
12943
|
-
column: state.position - state.lineStart
|
|
12944
|
-
};
|
|
12945
|
-
mark.snippet = makeSnippet(mark);
|
|
12946
|
-
return new YAMLException(message, mark);
|
|
12947
|
-
}
|
|
12948
|
-
function throwError(state, message) {
|
|
12949
|
-
throw generateError(state, message);
|
|
12950
|
-
}
|
|
12951
|
-
function throwWarning(state, message) {
|
|
12952
|
-
if (state.onWarning) state.onWarning.call(null, generateError(state, message));
|
|
12953
|
-
}
|
|
12954
|
-
function storeAnchor(state, name, value) {
|
|
12955
|
-
const transactions = state.anchorMapTransactions;
|
|
12956
|
-
if (transactions.length !== 0) {
|
|
12957
|
-
const transaction = transactions[transactions.length - 1];
|
|
12958
|
-
if (!_hasOwnProperty.call(transaction, name)) transaction[name] = {
|
|
12959
|
-
existed: _hasOwnProperty.call(state.anchorMap, name),
|
|
12960
|
-
value: state.anchorMap[name]
|
|
12961
|
-
};
|
|
12962
|
-
}
|
|
12963
|
-
state.anchorMap[name] = value;
|
|
12964
|
-
}
|
|
12965
|
-
function beginAnchorTransaction(state) {
|
|
12966
|
-
state.anchorMapTransactions.push(Object.create(null));
|
|
12967
|
-
}
|
|
12968
|
-
function commitAnchorTransaction(state) {
|
|
12969
|
-
const transaction = state.anchorMapTransactions.pop();
|
|
12970
|
-
const transactions = state.anchorMapTransactions;
|
|
12971
|
-
if (transactions.length === 0) return;
|
|
12972
|
-
const parent = transactions[transactions.length - 1];
|
|
12973
|
-
const names = Object.keys(transaction);
|
|
12974
|
-
for (let index = 0, length = names.length; index < length; index += 1) {
|
|
12975
|
-
const name = names[index];
|
|
12976
|
-
if (!_hasOwnProperty.call(parent, name)) parent[name] = transaction[name];
|
|
12977
|
-
}
|
|
12978
|
-
}
|
|
12979
|
-
function rollbackAnchorTransaction(state) {
|
|
12980
|
-
const transaction = state.anchorMapTransactions.pop();
|
|
12981
|
-
const names = Object.keys(transaction);
|
|
12982
|
-
for (let index = names.length - 1; index >= 0; index -= 1) {
|
|
12983
|
-
const entry = transaction[names[index]];
|
|
12984
|
-
if (entry.existed) state.anchorMap[names[index]] = entry.value;
|
|
12985
|
-
else delete state.anchorMap[names[index]];
|
|
12986
|
-
}
|
|
12987
|
-
}
|
|
12988
|
-
function snapshotState(state) {
|
|
12989
|
-
return {
|
|
12990
|
-
position: state.position,
|
|
12991
|
-
line: state.line,
|
|
12992
|
-
lineStart: state.lineStart,
|
|
12993
|
-
lineIndent: state.lineIndent,
|
|
12994
|
-
firstTabInLine: state.firstTabInLine,
|
|
12995
|
-
tag: state.tag,
|
|
12996
|
-
anchor: state.anchor,
|
|
12997
|
-
kind: state.kind,
|
|
12998
|
-
result: state.result
|
|
12999
|
-
};
|
|
13000
|
-
}
|
|
13001
|
-
function restoreState(state, snapshot) {
|
|
13002
|
-
state.position = snapshot.position;
|
|
13003
|
-
state.line = snapshot.line;
|
|
13004
|
-
state.lineStart = snapshot.lineStart;
|
|
13005
|
-
state.lineIndent = snapshot.lineIndent;
|
|
13006
|
-
state.firstTabInLine = snapshot.firstTabInLine;
|
|
13007
|
-
state.tag = snapshot.tag;
|
|
13008
|
-
state.anchor = snapshot.anchor;
|
|
13009
|
-
state.kind = snapshot.kind;
|
|
13010
|
-
state.result = snapshot.result;
|
|
13011
|
-
}
|
|
13012
|
-
var directiveHandlers = {
|
|
13013
|
-
YAML: function handleYamlDirective(state, name, args) {
|
|
13014
|
-
if (state.version !== null) throwError(state, "duplication of %YAML directive");
|
|
13015
|
-
if (args.length !== 1) throwError(state, "YAML directive accepts exactly one argument");
|
|
13016
|
-
const match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
13017
|
-
if (match === null) throwError(state, "ill-formed argument of the YAML directive");
|
|
13018
|
-
const major = parseInt(match[1], 10);
|
|
13019
|
-
const minor = parseInt(match[2], 10);
|
|
13020
|
-
if (major !== 1) throwError(state, "unacceptable YAML version of the document");
|
|
13021
|
-
state.version = args[0];
|
|
13022
|
-
state.checkLineBreaks = minor < 2;
|
|
13023
|
-
if (minor !== 1 && minor !== 2) throwWarning(state, "unsupported YAML version of the document");
|
|
13024
|
-
},
|
|
13025
|
-
TAG: function handleTagDirective(state, name, args) {
|
|
13026
|
-
let prefix;
|
|
13027
|
-
if (args.length !== 2) throwError(state, "TAG directive accepts exactly two arguments");
|
|
13028
|
-
const handle = args[0];
|
|
13029
|
-
prefix = args[1];
|
|
13030
|
-
if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
13031
|
-
if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle");
|
|
13032
|
-
if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
13033
|
-
try {
|
|
13034
|
-
prefix = decodeURIComponent(prefix);
|
|
13035
|
-
} catch (err) {
|
|
13036
|
-
throwError(state, "tag prefix is malformed: " + prefix);
|
|
13037
|
-
}
|
|
13038
|
-
state.tagMap[handle] = prefix;
|
|
13039
|
-
}
|
|
13040
|
-
};
|
|
13041
|
-
function captureSegment(state, start, end, checkJson) {
|
|
13042
|
-
if (start < end) {
|
|
13043
|
-
const _result = state.input.slice(start, end);
|
|
13044
|
-
if (checkJson) for (let _position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
13045
|
-
const _character = _result.charCodeAt(_position);
|
|
13046
|
-
if (!(_character === 9 || _character >= 32 && _character <= 1114111)) throwError(state, "expected valid JSON character");
|
|
13047
|
-
}
|
|
13048
|
-
else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters");
|
|
13049
|
-
state.result += _result;
|
|
13050
|
-
}
|
|
13051
|
-
}
|
|
13052
|
-
function mergeMappings(state, destination, source, overridableKeys) {
|
|
13053
|
-
if (!common.isObject(source)) throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
13054
|
-
const sourceKeys = Object.keys(source);
|
|
13055
|
-
for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
13056
|
-
const key = sourceKeys[index];
|
|
13057
|
-
if (!_hasOwnProperty.call(destination, key)) {
|
|
13058
|
-
setProperty(destination, key, source[key]);
|
|
13059
|
-
overridableKeys[key] = true;
|
|
13060
|
-
}
|
|
13061
|
-
}
|
|
13062
|
-
}
|
|
13063
|
-
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
13064
|
-
if (Array.isArray(keyNode)) {
|
|
13065
|
-
keyNode = Array.prototype.slice.call(keyNode);
|
|
13066
|
-
for (let index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
13067
|
-
if (Array.isArray(keyNode[index])) throwError(state, "nested arrays are not supported inside keys");
|
|
13068
|
-
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") keyNode[index] = "[object Object]";
|
|
13069
|
-
}
|
|
13070
|
-
}
|
|
13071
|
-
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") keyNode = "[object Object]";
|
|
13072
|
-
keyNode = String(keyNode);
|
|
13073
|
-
if (_result === null) _result = {};
|
|
13074
|
-
if (keyTag === "tag:yaml.org,2002:merge") if (Array.isArray(valueNode)) {
|
|
13075
|
-
if (valueNode.length > state.maxMergeSeqLength) throwError(state, "merge sequence length exceeded maxMergeSeqLength (" + state.maxMergeSeqLength + ")");
|
|
13076
|
-
const seen = /* @__PURE__ */ new Set();
|
|
13077
|
-
for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
13078
|
-
const src = valueNode[index];
|
|
13079
|
-
if (seen.has(src)) continue;
|
|
13080
|
-
seen.add(src);
|
|
13081
|
-
mergeMappings(state, _result, src, overridableKeys);
|
|
13082
|
-
}
|
|
13083
|
-
} else mergeMappings(state, _result, valueNode, overridableKeys);
|
|
13084
|
-
else {
|
|
13085
|
-
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
13086
|
-
state.line = startLine || state.line;
|
|
13087
|
-
state.lineStart = startLineStart || state.lineStart;
|
|
13088
|
-
state.position = startPos || state.position;
|
|
13089
|
-
throwError(state, "duplicated mapping key");
|
|
13090
|
-
}
|
|
13091
|
-
setProperty(_result, keyNode, valueNode);
|
|
13092
|
-
delete overridableKeys[keyNode];
|
|
13093
|
-
}
|
|
13094
|
-
return _result;
|
|
13095
|
-
}
|
|
13096
|
-
function readLineBreak(state) {
|
|
13097
|
-
const ch = state.input.charCodeAt(state.position);
|
|
13098
|
-
if (ch === 10) state.position++;
|
|
13099
|
-
else if (ch === 13) {
|
|
13100
|
-
state.position++;
|
|
13101
|
-
if (state.input.charCodeAt(state.position) === 10) state.position++;
|
|
13102
|
-
} else throwError(state, "a line break is expected");
|
|
13103
|
-
state.line += 1;
|
|
13104
|
-
state.lineStart = state.position;
|
|
13105
|
-
state.firstTabInLine = -1;
|
|
13106
|
-
}
|
|
13107
|
-
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
13108
|
-
let lineBreaks = 0;
|
|
13109
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13110
|
-
while (ch !== 0) {
|
|
13111
|
-
while (isWhiteSpace(ch)) {
|
|
13112
|
-
if (ch === 9 && state.firstTabInLine === -1) state.firstTabInLine = state.position;
|
|
13113
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13114
|
-
}
|
|
13115
|
-
if (allowComments && ch === 35) do
|
|
13116
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13117
|
-
while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
13118
|
-
if (isEol(ch)) {
|
|
13119
|
-
readLineBreak(state);
|
|
13120
|
-
ch = state.input.charCodeAt(state.position);
|
|
13121
|
-
lineBreaks++;
|
|
13122
|
-
state.lineIndent = 0;
|
|
13123
|
-
while (ch === 32) {
|
|
13124
|
-
state.lineIndent++;
|
|
13125
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13126
|
-
}
|
|
13127
|
-
} else break;
|
|
13128
|
-
}
|
|
13129
|
-
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation");
|
|
13130
|
-
return lineBreaks;
|
|
13131
|
-
}
|
|
13132
|
-
function testDocumentSeparator(state) {
|
|
13133
|
-
let _position = state.position;
|
|
13134
|
-
let ch = state.input.charCodeAt(_position);
|
|
13135
|
-
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
13136
|
-
_position += 3;
|
|
13137
|
-
ch = state.input.charCodeAt(_position);
|
|
13138
|
-
if (ch === 0 || isWsOrEol(ch)) return true;
|
|
13139
|
-
}
|
|
13140
|
-
return false;
|
|
13141
|
-
}
|
|
13142
|
-
function writeFoldedLines(state, count) {
|
|
13143
|
-
if (count === 1) state.result += " ";
|
|
13144
|
-
else if (count > 1) state.result += common.repeat("\n", count - 1);
|
|
13145
|
-
}
|
|
13146
|
-
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
13147
|
-
let captureStart;
|
|
13148
|
-
let captureEnd;
|
|
13149
|
-
let hasPendingContent;
|
|
13150
|
-
let _line;
|
|
13151
|
-
let _lineStart;
|
|
13152
|
-
let _lineIndent;
|
|
13153
|
-
const _kind = state.kind;
|
|
13154
|
-
const _result = state.result;
|
|
13155
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13156
|
-
if (isWsOrEol(ch) || isFlowIndicator(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) return false;
|
|
13157
|
-
if (ch === 63 || ch === 45) {
|
|
13158
|
-
const following = state.input.charCodeAt(state.position + 1);
|
|
13159
|
-
if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) return false;
|
|
13160
|
-
}
|
|
13161
|
-
state.kind = "scalar";
|
|
13162
|
-
state.result = "";
|
|
13163
|
-
captureStart = captureEnd = state.position;
|
|
13164
|
-
hasPendingContent = false;
|
|
13165
|
-
while (ch !== 0) {
|
|
13166
|
-
if (ch === 58) {
|
|
13167
|
-
const following = state.input.charCodeAt(state.position + 1);
|
|
13168
|
-
if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) break;
|
|
13169
|
-
} else if (ch === 35) {
|
|
13170
|
-
if (isWsOrEol(state.input.charCodeAt(state.position - 1))) break;
|
|
13171
|
-
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && isFlowIndicator(ch)) break;
|
|
13172
|
-
else if (isEol(ch)) {
|
|
13173
|
-
_line = state.line;
|
|
13174
|
-
_lineStart = state.lineStart;
|
|
13175
|
-
_lineIndent = state.lineIndent;
|
|
13176
|
-
skipSeparationSpace(state, false, -1);
|
|
13177
|
-
if (state.lineIndent >= nodeIndent) {
|
|
13178
|
-
hasPendingContent = true;
|
|
13179
|
-
ch = state.input.charCodeAt(state.position);
|
|
13180
|
-
continue;
|
|
13181
|
-
} else {
|
|
13182
|
-
state.position = captureEnd;
|
|
13183
|
-
state.line = _line;
|
|
13184
|
-
state.lineStart = _lineStart;
|
|
13185
|
-
state.lineIndent = _lineIndent;
|
|
13186
|
-
break;
|
|
13187
|
-
}
|
|
13188
|
-
}
|
|
13189
|
-
if (hasPendingContent) {
|
|
13190
|
-
captureSegment(state, captureStart, captureEnd, false);
|
|
13191
|
-
writeFoldedLines(state, state.line - _line);
|
|
13192
|
-
captureStart = captureEnd = state.position;
|
|
13193
|
-
hasPendingContent = false;
|
|
13194
|
-
}
|
|
13195
|
-
if (!isWhiteSpace(ch)) captureEnd = state.position + 1;
|
|
13196
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13197
|
-
}
|
|
13198
|
-
captureSegment(state, captureStart, captureEnd, false);
|
|
13199
|
-
if (state.result) return true;
|
|
13200
|
-
state.kind = _kind;
|
|
13201
|
-
state.result = _result;
|
|
13202
|
-
return false;
|
|
13203
|
-
}
|
|
13204
|
-
function readSingleQuotedScalar(state, nodeIndent) {
|
|
13205
|
-
let captureStart;
|
|
13206
|
-
let captureEnd;
|
|
13207
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13208
|
-
if (ch !== 39) return false;
|
|
13209
|
-
state.kind = "scalar";
|
|
13210
|
-
state.result = "";
|
|
13211
|
-
state.position++;
|
|
13212
|
-
captureStart = captureEnd = state.position;
|
|
13213
|
-
while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 39) {
|
|
13214
|
-
captureSegment(state, captureStart, state.position, true);
|
|
13215
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13216
|
-
if (ch === 39) {
|
|
13217
|
-
captureStart = state.position;
|
|
13218
|
-
state.position++;
|
|
13219
|
-
captureEnd = state.position;
|
|
13220
|
-
} else return true;
|
|
13221
|
-
} else if (isEol(ch)) {
|
|
13222
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
13223
|
-
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
13224
|
-
captureStart = captureEnd = state.position;
|
|
13225
|
-
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
13226
|
-
else {
|
|
13227
|
-
state.position++;
|
|
13228
|
-
if (!isWhiteSpace(ch)) captureEnd = state.position;
|
|
13229
|
-
}
|
|
13230
|
-
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
13231
|
-
}
|
|
13232
|
-
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
13233
|
-
let captureStart;
|
|
13234
|
-
let captureEnd;
|
|
13235
|
-
let tmp;
|
|
13236
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13237
|
-
if (ch !== 34) return false;
|
|
13238
|
-
state.kind = "scalar";
|
|
13239
|
-
state.result = "";
|
|
13240
|
-
state.position++;
|
|
13241
|
-
captureStart = captureEnd = state.position;
|
|
13242
|
-
while ((ch = state.input.charCodeAt(state.position)) !== 0) if (ch === 34) {
|
|
13243
|
-
captureSegment(state, captureStart, state.position, true);
|
|
13244
|
-
state.position++;
|
|
13245
|
-
return true;
|
|
13246
|
-
} else if (ch === 92) {
|
|
13247
|
-
captureSegment(state, captureStart, state.position, true);
|
|
13248
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13249
|
-
if (isEol(ch)) skipSeparationSpace(state, false, nodeIndent);
|
|
13250
|
-
else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
13251
|
-
state.result += simpleEscapeMap[ch];
|
|
13252
|
-
state.position++;
|
|
13253
|
-
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
13254
|
-
let hexLength = tmp;
|
|
13255
|
-
let hexResult = 0;
|
|
13256
|
-
for (; hexLength > 0; hexLength--) {
|
|
13257
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13258
|
-
if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
|
|
13259
|
-
else throwError(state, "expected hexadecimal character");
|
|
13260
|
-
}
|
|
13261
|
-
state.result += charFromCodepoint(hexResult);
|
|
13262
|
-
state.position++;
|
|
13263
|
-
} else throwError(state, "unknown escape sequence");
|
|
13264
|
-
captureStart = captureEnd = state.position;
|
|
13265
|
-
} else if (isEol(ch)) {
|
|
13266
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
13267
|
-
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
13268
|
-
captureStart = captureEnd = state.position;
|
|
13269
|
-
} else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
13270
|
-
else {
|
|
13271
|
-
state.position++;
|
|
13272
|
-
if (!isWhiteSpace(ch)) captureEnd = state.position;
|
|
13273
|
-
}
|
|
13274
|
-
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
13275
|
-
}
|
|
13276
|
-
function readFlowCollection(state, nodeIndent) {
|
|
13277
|
-
let readNext = true;
|
|
13278
|
-
let _line;
|
|
13279
|
-
let _lineStart;
|
|
13280
|
-
let _pos;
|
|
13281
|
-
const _tag = state.tag;
|
|
13282
|
-
let _result;
|
|
13283
|
-
const _anchor = state.anchor;
|
|
13284
|
-
let terminator;
|
|
13285
|
-
let isPair;
|
|
13286
|
-
let isExplicitPair;
|
|
13287
|
-
let isMapping;
|
|
13288
|
-
const overridableKeys = Object.create(null);
|
|
13289
|
-
let keyNode;
|
|
13290
|
-
let keyTag;
|
|
13291
|
-
let valueNode;
|
|
13292
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13293
|
-
if (ch === 91) {
|
|
13294
|
-
terminator = 93;
|
|
13295
|
-
isMapping = false;
|
|
13296
|
-
_result = [];
|
|
13297
|
-
} else if (ch === 123) {
|
|
13298
|
-
terminator = 125;
|
|
13299
|
-
isMapping = true;
|
|
13300
|
-
_result = {};
|
|
13301
|
-
} else return false;
|
|
13302
|
-
if (state.anchor !== null) storeAnchor(state, state.anchor, _result);
|
|
13303
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13304
|
-
while (ch !== 0) {
|
|
13305
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
13306
|
-
ch = state.input.charCodeAt(state.position);
|
|
13307
|
-
if (ch === terminator) {
|
|
13308
|
-
state.position++;
|
|
13309
|
-
state.tag = _tag;
|
|
13310
|
-
state.anchor = _anchor;
|
|
13311
|
-
state.kind = isMapping ? "mapping" : "sequence";
|
|
13312
|
-
state.result = _result;
|
|
13313
|
-
return true;
|
|
13314
|
-
} else if (!readNext) throwError(state, "missed comma between flow collection entries");
|
|
13315
|
-
else if (ch === 44) throwError(state, "expected the node content, but found ','");
|
|
13316
|
-
keyTag = keyNode = valueNode = null;
|
|
13317
|
-
isPair = isExplicitPair = false;
|
|
13318
|
-
if (ch === 63) {
|
|
13319
|
-
if (isWsOrEol(state.input.charCodeAt(state.position + 1))) {
|
|
13320
|
-
isPair = isExplicitPair = true;
|
|
13321
|
-
state.position++;
|
|
13322
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
13323
|
-
}
|
|
13324
|
-
}
|
|
13325
|
-
_line = state.line;
|
|
13326
|
-
_lineStart = state.lineStart;
|
|
13327
|
-
_pos = state.position;
|
|
13328
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
13329
|
-
keyTag = state.tag;
|
|
13330
|
-
keyNode = state.result;
|
|
13331
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
13332
|
-
ch = state.input.charCodeAt(state.position);
|
|
13333
|
-
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
13334
|
-
isPair = true;
|
|
13335
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13336
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
13337
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
13338
|
-
valueNode = state.result;
|
|
13339
|
-
}
|
|
13340
|
-
if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
13341
|
-
else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
13342
|
-
else _result.push(keyNode);
|
|
13343
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
13344
|
-
ch = state.input.charCodeAt(state.position);
|
|
13345
|
-
if (ch === 44) {
|
|
13346
|
-
readNext = true;
|
|
13347
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13348
|
-
} else readNext = false;
|
|
13349
|
-
}
|
|
13350
|
-
throwError(state, "unexpected end of the stream within a flow collection");
|
|
13351
|
-
}
|
|
13352
|
-
function readBlockScalar(state, nodeIndent) {
|
|
13353
|
-
let folding;
|
|
13354
|
-
let chomping = CHOMPING_CLIP;
|
|
13355
|
-
let didReadContent = false;
|
|
13356
|
-
let detectedIndent = false;
|
|
13357
|
-
let textIndent = nodeIndent;
|
|
13358
|
-
let emptyLines = 0;
|
|
13359
|
-
let atMoreIndented = false;
|
|
13360
|
-
let tmp;
|
|
13361
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13362
|
-
if (ch === 124) folding = false;
|
|
13363
|
-
else if (ch === 62) folding = true;
|
|
13364
|
-
else return false;
|
|
13365
|
-
state.kind = "scalar";
|
|
13366
|
-
state.result = "";
|
|
13367
|
-
while (ch !== 0) {
|
|
13368
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13369
|
-
if (ch === 43 || ch === 45) if (CHOMPING_CLIP === chomping) chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
13370
|
-
else throwError(state, "repeat of a chomping mode identifier");
|
|
13371
|
-
else if ((tmp = fromDecimalCode(ch)) >= 0) if (tmp === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
13372
|
-
else if (!detectedIndent) {
|
|
13373
|
-
textIndent = nodeIndent + tmp - 1;
|
|
13374
|
-
detectedIndent = true;
|
|
13375
|
-
} else throwError(state, "repeat of an indentation width identifier");
|
|
13376
|
-
else break;
|
|
13377
|
-
}
|
|
13378
|
-
if (isWhiteSpace(ch)) {
|
|
13379
|
-
do
|
|
13380
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13381
|
-
while (isWhiteSpace(ch));
|
|
13382
|
-
if (ch === 35) do
|
|
13383
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13384
|
-
while (!isEol(ch) && ch !== 0);
|
|
13385
|
-
}
|
|
13386
|
-
while (ch !== 0) {
|
|
13387
|
-
readLineBreak(state);
|
|
13388
|
-
state.lineIndent = 0;
|
|
13389
|
-
ch = state.input.charCodeAt(state.position);
|
|
13390
|
-
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
13391
|
-
state.lineIndent++;
|
|
13392
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13393
|
-
}
|
|
13394
|
-
if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent;
|
|
13395
|
-
if (isEol(ch)) {
|
|
13396
|
-
emptyLines++;
|
|
13397
|
-
continue;
|
|
13398
|
-
}
|
|
13399
|
-
if (!detectedIndent && textIndent === 0) throwError(state, "missing indentation for block scalar");
|
|
13400
|
-
if (state.lineIndent < textIndent) {
|
|
13401
|
-
if (chomping === CHOMPING_KEEP) state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
13402
|
-
else if (chomping === CHOMPING_CLIP) {
|
|
13403
|
-
if (didReadContent) state.result += "\n";
|
|
13404
|
-
}
|
|
13405
|
-
break;
|
|
13406
|
-
}
|
|
13407
|
-
if (folding) if (isWhiteSpace(ch)) {
|
|
13408
|
-
atMoreIndented = true;
|
|
13409
|
-
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
13410
|
-
} else if (atMoreIndented) {
|
|
13411
|
-
atMoreIndented = false;
|
|
13412
|
-
state.result += common.repeat("\n", emptyLines + 1);
|
|
13413
|
-
} else if (emptyLines === 0) {
|
|
13414
|
-
if (didReadContent) state.result += " ";
|
|
13415
|
-
} else state.result += common.repeat("\n", emptyLines);
|
|
13416
|
-
else state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
13417
|
-
didReadContent = true;
|
|
13418
|
-
detectedIndent = true;
|
|
13419
|
-
emptyLines = 0;
|
|
13420
|
-
const captureStart = state.position;
|
|
13421
|
-
while (!isEol(ch) && ch !== 0) ch = state.input.charCodeAt(++state.position);
|
|
13422
|
-
captureSegment(state, captureStart, state.position, false);
|
|
13423
|
-
}
|
|
13424
|
-
return true;
|
|
13425
|
-
}
|
|
13426
|
-
function readBlockSequence(state, nodeIndent) {
|
|
13427
|
-
const _tag = state.tag;
|
|
13428
|
-
const _anchor = state.anchor;
|
|
13429
|
-
const _result = [];
|
|
13430
|
-
let detected = false;
|
|
13431
|
-
if (state.firstTabInLine !== -1) return false;
|
|
13432
|
-
if (state.anchor !== null) storeAnchor(state, state.anchor, _result);
|
|
13433
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13434
|
-
while (ch !== 0) {
|
|
13435
|
-
if (state.firstTabInLine !== -1) {
|
|
13436
|
-
state.position = state.firstTabInLine;
|
|
13437
|
-
throwError(state, "tab characters must not be used in indentation");
|
|
13438
|
-
}
|
|
13439
|
-
if (ch !== 45) break;
|
|
13440
|
-
if (!isWsOrEol(state.input.charCodeAt(state.position + 1))) break;
|
|
13441
|
-
detected = true;
|
|
13442
|
-
state.position++;
|
|
13443
|
-
if (skipSeparationSpace(state, true, -1)) {
|
|
13444
|
-
if (state.lineIndent <= nodeIndent) {
|
|
13445
|
-
_result.push(null);
|
|
13446
|
-
ch = state.input.charCodeAt(state.position);
|
|
13447
|
-
continue;
|
|
13448
|
-
}
|
|
13449
|
-
}
|
|
13450
|
-
const _line = state.line;
|
|
13451
|
-
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
13452
|
-
_result.push(state.result);
|
|
13453
|
-
skipSeparationSpace(state, true, -1);
|
|
13454
|
-
ch = state.input.charCodeAt(state.position);
|
|
13455
|
-
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a sequence entry");
|
|
13456
|
-
else if (state.lineIndent < nodeIndent) break;
|
|
13457
|
-
}
|
|
13458
|
-
if (detected) {
|
|
13459
|
-
state.tag = _tag;
|
|
13460
|
-
state.anchor = _anchor;
|
|
13461
|
-
state.kind = "sequence";
|
|
13462
|
-
state.result = _result;
|
|
13463
|
-
return true;
|
|
13464
|
-
}
|
|
13465
|
-
return false;
|
|
13466
|
-
}
|
|
13467
|
-
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
13468
|
-
let allowCompact;
|
|
13469
|
-
let _keyLine;
|
|
13470
|
-
let _keyLineStart;
|
|
13471
|
-
let _keyPos;
|
|
13472
|
-
const _tag = state.tag;
|
|
13473
|
-
const _anchor = state.anchor;
|
|
13474
|
-
const _result = {};
|
|
13475
|
-
const overridableKeys = Object.create(null);
|
|
13476
|
-
let keyTag = null;
|
|
13477
|
-
let keyNode = null;
|
|
13478
|
-
let valueNode = null;
|
|
13479
|
-
let atExplicitKey = false;
|
|
13480
|
-
let detected = false;
|
|
13481
|
-
if (state.firstTabInLine !== -1) return false;
|
|
13482
|
-
if (state.anchor !== null) storeAnchor(state, state.anchor, _result);
|
|
13483
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13484
|
-
while (ch !== 0) {
|
|
13485
|
-
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
13486
|
-
state.position = state.firstTabInLine;
|
|
13487
|
-
throwError(state, "tab characters must not be used in indentation");
|
|
13488
|
-
}
|
|
13489
|
-
const following = state.input.charCodeAt(state.position + 1);
|
|
13490
|
-
const _line = state.line;
|
|
13491
|
-
if ((ch === 63 || ch === 58) && isWsOrEol(following)) {
|
|
13492
|
-
if (ch === 63) {
|
|
13493
|
-
if (atExplicitKey) {
|
|
13494
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
13495
|
-
keyTag = keyNode = valueNode = null;
|
|
13496
|
-
}
|
|
13497
|
-
detected = true;
|
|
13498
|
-
atExplicitKey = true;
|
|
13499
|
-
allowCompact = true;
|
|
13500
|
-
} else if (atExplicitKey) {
|
|
13501
|
-
atExplicitKey = false;
|
|
13502
|
-
allowCompact = true;
|
|
13503
|
-
} else throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
13504
|
-
state.position += 1;
|
|
13505
|
-
ch = following;
|
|
13506
|
-
} else {
|
|
13507
|
-
_keyLine = state.line;
|
|
13508
|
-
_keyLineStart = state.lineStart;
|
|
13509
|
-
_keyPos = state.position;
|
|
13510
|
-
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break;
|
|
13511
|
-
if (state.line === _line) {
|
|
13512
|
-
ch = state.input.charCodeAt(state.position);
|
|
13513
|
-
while (isWhiteSpace(ch)) ch = state.input.charCodeAt(++state.position);
|
|
13514
|
-
if (ch === 58) {
|
|
13515
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13516
|
-
if (!isWsOrEol(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
13517
|
-
if (atExplicitKey) {
|
|
13518
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
13519
|
-
keyTag = keyNode = valueNode = null;
|
|
13520
|
-
}
|
|
13521
|
-
detected = true;
|
|
13522
|
-
atExplicitKey = false;
|
|
13523
|
-
allowCompact = false;
|
|
13524
|
-
keyTag = state.tag;
|
|
13525
|
-
keyNode = state.result;
|
|
13526
|
-
} else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
13527
|
-
else {
|
|
13528
|
-
state.tag = _tag;
|
|
13529
|
-
state.anchor = _anchor;
|
|
13530
|
-
return true;
|
|
13531
|
-
}
|
|
13532
|
-
} else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
13533
|
-
else {
|
|
13534
|
-
state.tag = _tag;
|
|
13535
|
-
state.anchor = _anchor;
|
|
13536
|
-
return true;
|
|
13537
|
-
}
|
|
13538
|
-
}
|
|
13539
|
-
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
13540
|
-
if (atExplicitKey) {
|
|
13541
|
-
_keyLine = state.line;
|
|
13542
|
-
_keyLineStart = state.lineStart;
|
|
13543
|
-
_keyPos = state.position;
|
|
13544
|
-
}
|
|
13545
|
-
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result;
|
|
13546
|
-
else valueNode = state.result;
|
|
13547
|
-
if (!atExplicitKey) {
|
|
13548
|
-
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
13549
|
-
keyTag = keyNode = valueNode = null;
|
|
13550
|
-
}
|
|
13551
|
-
skipSeparationSpace(state, true, -1);
|
|
13552
|
-
ch = state.input.charCodeAt(state.position);
|
|
13553
|
-
}
|
|
13554
|
-
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) throwError(state, "bad indentation of a mapping entry");
|
|
13555
|
-
else if (state.lineIndent < nodeIndent) break;
|
|
13556
|
-
}
|
|
13557
|
-
if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
13558
|
-
if (detected) {
|
|
13559
|
-
state.tag = _tag;
|
|
13560
|
-
state.anchor = _anchor;
|
|
13561
|
-
state.kind = "mapping";
|
|
13562
|
-
state.result = _result;
|
|
13563
|
-
}
|
|
13564
|
-
return detected;
|
|
13565
|
-
}
|
|
13566
|
-
function readTagProperty(state) {
|
|
13567
|
-
let isVerbatim = false;
|
|
13568
|
-
let isNamed = false;
|
|
13569
|
-
let tagHandle;
|
|
13570
|
-
let tagName;
|
|
13571
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13572
|
-
if (ch !== 33) return false;
|
|
13573
|
-
if (state.tag !== null) throwError(state, "duplication of a tag property");
|
|
13574
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13575
|
-
if (ch === 60) {
|
|
13576
|
-
isVerbatim = true;
|
|
13577
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13578
|
-
} else if (ch === 33) {
|
|
13579
|
-
isNamed = true;
|
|
13580
|
-
tagHandle = "!!";
|
|
13581
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13582
|
-
} else tagHandle = "!";
|
|
13583
|
-
let _position = state.position;
|
|
13584
|
-
if (isVerbatim) {
|
|
13585
|
-
do
|
|
13586
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13587
|
-
while (ch !== 0 && ch !== 62);
|
|
13588
|
-
if (state.position < state.length) {
|
|
13589
|
-
tagName = state.input.slice(_position, state.position);
|
|
13590
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13591
|
-
} else throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
13592
|
-
} else {
|
|
13593
|
-
while (ch !== 0 && !isWsOrEol(ch)) {
|
|
13594
|
-
if (ch === 33) if (!isNamed) {
|
|
13595
|
-
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
13596
|
-
if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters");
|
|
13597
|
-
isNamed = true;
|
|
13598
|
-
_position = state.position + 1;
|
|
13599
|
-
} else throwError(state, "tag suffix cannot contain exclamation marks");
|
|
13600
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13601
|
-
}
|
|
13602
|
-
tagName = state.input.slice(_position, state.position);
|
|
13603
|
-
if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
13604
|
-
}
|
|
13605
|
-
if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
13606
|
-
try {
|
|
13607
|
-
tagName = decodeURIComponent(tagName);
|
|
13608
|
-
} catch (err) {
|
|
13609
|
-
throwError(state, "tag name is malformed: " + tagName);
|
|
13610
|
-
}
|
|
13611
|
-
if (isVerbatim) state.tag = tagName;
|
|
13612
|
-
else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
|
|
13613
|
-
else if (tagHandle === "!") state.tag = "!" + tagName;
|
|
13614
|
-
else if (tagHandle === "!!") state.tag = "tag:yaml.org,2002:" + tagName;
|
|
13615
|
-
else throwError(state, "undeclared tag handle \"" + tagHandle + "\"");
|
|
13616
|
-
return true;
|
|
13617
|
-
}
|
|
13618
|
-
function readAnchorProperty(state) {
|
|
13619
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13620
|
-
if (ch !== 38) return false;
|
|
13621
|
-
if (state.anchor !== null) throwError(state, "duplication of an anchor property");
|
|
13622
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13623
|
-
const _position = state.position;
|
|
13624
|
-
while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) ch = state.input.charCodeAt(++state.position);
|
|
13625
|
-
if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character");
|
|
13626
|
-
state.anchor = state.input.slice(_position, state.position);
|
|
13627
|
-
return true;
|
|
13628
|
-
}
|
|
13629
|
-
function readAlias(state) {
|
|
13630
|
-
let ch = state.input.charCodeAt(state.position);
|
|
13631
|
-
if (ch !== 42) return false;
|
|
13632
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13633
|
-
const _position = state.position;
|
|
13634
|
-
while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) ch = state.input.charCodeAt(++state.position);
|
|
13635
|
-
if (state.position === _position) throwError(state, "name of an alias node must contain at least one character");
|
|
13636
|
-
const alias = state.input.slice(_position, state.position);
|
|
13637
|
-
if (!_hasOwnProperty.call(state.anchorMap, alias)) throwError(state, "unidentified alias \"" + alias + "\"");
|
|
13638
|
-
state.result = state.anchorMap[alias];
|
|
13639
|
-
skipSeparationSpace(state, true, -1);
|
|
13640
|
-
return true;
|
|
13641
|
-
}
|
|
13642
|
-
function tryReadBlockMappingFromProperty(state, propertyStart, nodeIndent, flowIndent) {
|
|
13643
|
-
const fallbackState = snapshotState(state);
|
|
13644
|
-
beginAnchorTransaction(state);
|
|
13645
|
-
restoreState(state, propertyStart);
|
|
13646
|
-
state.tag = null;
|
|
13647
|
-
state.anchor = null;
|
|
13648
|
-
state.kind = null;
|
|
13649
|
-
state.result = null;
|
|
13650
|
-
if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === "mapping") {
|
|
13651
|
-
commitAnchorTransaction(state);
|
|
13652
|
-
return true;
|
|
13653
|
-
}
|
|
13654
|
-
rollbackAnchorTransaction(state);
|
|
13655
|
-
restoreState(state, fallbackState);
|
|
13656
|
-
return false;
|
|
13657
|
-
}
|
|
13658
|
-
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
13659
|
-
let allowBlockScalars;
|
|
13660
|
-
let allowBlockCollections;
|
|
13661
|
-
let indentStatus = 1;
|
|
13662
|
-
let atNewLine = false;
|
|
13663
|
-
let hasContent = false;
|
|
13664
|
-
let propertyStart = null;
|
|
13665
|
-
let type;
|
|
13666
|
-
let flowIndent;
|
|
13667
|
-
let blockIndent;
|
|
13668
|
-
if (state.depth >= state.maxDepth) throwError(state, "nesting exceeded maxDepth (" + state.maxDepth + ")");
|
|
13669
|
-
state.depth += 1;
|
|
13670
|
-
if (state.listener !== null) state.listener("open", state);
|
|
13671
|
-
state.tag = null;
|
|
13672
|
-
state.anchor = null;
|
|
13673
|
-
state.kind = null;
|
|
13674
|
-
state.result = null;
|
|
13675
|
-
const allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
13676
|
-
if (allowToSeek) {
|
|
13677
|
-
if (skipSeparationSpace(state, true, -1)) {
|
|
13678
|
-
atNewLine = true;
|
|
13679
|
-
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
13680
|
-
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
13681
|
-
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
13682
|
-
}
|
|
13683
|
-
}
|
|
13684
|
-
if (indentStatus === 1) while (true) {
|
|
13685
|
-
const ch = state.input.charCodeAt(state.position);
|
|
13686
|
-
const propertyState = snapshotState(state);
|
|
13687
|
-
if (atNewLine && (ch === 33 && state.tag !== null || ch === 38 && state.anchor !== null)) break;
|
|
13688
|
-
if (!readTagProperty(state) && !readAnchorProperty(state)) break;
|
|
13689
|
-
if (propertyStart === null) propertyStart = propertyState;
|
|
13690
|
-
if (skipSeparationSpace(state, true, -1)) {
|
|
13691
|
-
atNewLine = true;
|
|
13692
|
-
allowBlockCollections = allowBlockStyles;
|
|
13693
|
-
if (state.lineIndent > parentIndent) indentStatus = 1;
|
|
13694
|
-
else if (state.lineIndent === parentIndent) indentStatus = 0;
|
|
13695
|
-
else if (state.lineIndent < parentIndent) indentStatus = -1;
|
|
13696
|
-
} else allowBlockCollections = false;
|
|
13697
|
-
}
|
|
13698
|
-
if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
|
|
13699
|
-
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
13700
|
-
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) flowIndent = parentIndent;
|
|
13701
|
-
else flowIndent = parentIndent + 1;
|
|
13702
|
-
blockIndent = state.position - state.lineStart;
|
|
13703
|
-
if (indentStatus === 1) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
|
|
13704
|
-
else {
|
|
13705
|
-
const ch = state.input.charCodeAt(state.position);
|
|
13706
|
-
if (propertyStart !== null && allowBlockStyles && !allowBlockCollections && ch !== 124 && ch !== 62 && tryReadBlockMappingFromProperty(state, propertyStart, propertyStart.position - propertyStart.lineStart, flowIndent)) hasContent = true;
|
|
13707
|
-
else if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
|
|
13708
|
-
else if (readAlias(state)) {
|
|
13709
|
-
hasContent = true;
|
|
13710
|
-
if (state.tag !== null || state.anchor !== null) throwError(state, "alias node should not have any properties");
|
|
13711
|
-
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
13712
|
-
hasContent = true;
|
|
13713
|
-
if (state.tag === null) state.tag = "?";
|
|
13714
|
-
}
|
|
13715
|
-
if (state.anchor !== null) storeAnchor(state, state.anchor, state.result);
|
|
13716
|
-
}
|
|
13717
|
-
else if (indentStatus === 0) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
13718
|
-
}
|
|
13719
|
-
if (state.tag === null) {
|
|
13720
|
-
if (state.anchor !== null) storeAnchor(state, state.anchor, state.result);
|
|
13721
|
-
} else if (state.tag === "?") {
|
|
13722
|
-
if (state.result !== null && state.kind !== "scalar") throwError(state, "unacceptable node kind for !<?> tag; it should be \"scalar\", not \"" + state.kind + "\"");
|
|
13723
|
-
for (let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
13724
|
-
type = state.implicitTypes[typeIndex];
|
|
13725
|
-
if (type.resolve(state.result)) {
|
|
13726
|
-
state.result = type.construct(state.result);
|
|
13727
|
-
state.tag = type.tag;
|
|
13728
|
-
if (state.anchor !== null) storeAnchor(state, state.anchor, state.result);
|
|
13729
|
-
break;
|
|
13730
|
-
}
|
|
13731
|
-
}
|
|
13732
|
-
} else if (state.tag !== "!") {
|
|
13733
|
-
if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
13734
|
-
else {
|
|
13735
|
-
type = null;
|
|
13736
|
-
const typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
13737
|
-
for (let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
13738
|
-
type = typeList[typeIndex];
|
|
13739
|
-
break;
|
|
13740
|
-
}
|
|
13741
|
-
}
|
|
13742
|
-
if (!type) throwError(state, "unknown tag !<" + state.tag + ">");
|
|
13743
|
-
if (state.result !== null && type.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + "> tag; it should be \"" + type.kind + "\", not \"" + state.kind + "\"");
|
|
13744
|
-
if (!type.resolve(state.result, state.tag)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
13745
|
-
else {
|
|
13746
|
-
state.result = type.construct(state.result, state.tag);
|
|
13747
|
-
if (state.anchor !== null) storeAnchor(state, state.anchor, state.result);
|
|
13748
|
-
}
|
|
13749
|
-
}
|
|
13750
|
-
if (state.listener !== null) state.listener("close", state);
|
|
13751
|
-
state.depth -= 1;
|
|
13752
|
-
return state.tag !== null || state.anchor !== null || hasContent;
|
|
13753
|
-
}
|
|
13754
|
-
function readDocument(state) {
|
|
13755
|
-
const documentStart = state.position;
|
|
13756
|
-
let hasDirectives = false;
|
|
13757
|
-
let ch;
|
|
13758
|
-
state.version = null;
|
|
13759
|
-
state.checkLineBreaks = state.legacy;
|
|
13760
|
-
state.tagMap = Object.create(null);
|
|
13761
|
-
state.anchorMap = Object.create(null);
|
|
13762
|
-
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
13763
|
-
skipSeparationSpace(state, true, -1);
|
|
13764
|
-
ch = state.input.charCodeAt(state.position);
|
|
13765
|
-
if (state.lineIndent > 0 || ch !== 37) break;
|
|
13766
|
-
hasDirectives = true;
|
|
13767
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13768
|
-
let _position = state.position;
|
|
13769
|
-
while (ch !== 0 && !isWsOrEol(ch)) ch = state.input.charCodeAt(++state.position);
|
|
13770
|
-
const directiveName = state.input.slice(_position, state.position);
|
|
13771
|
-
const directiveArgs = [];
|
|
13772
|
-
if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length");
|
|
13773
|
-
while (ch !== 0) {
|
|
13774
|
-
while (isWhiteSpace(ch)) ch = state.input.charCodeAt(++state.position);
|
|
13775
|
-
if (ch === 35) {
|
|
13776
|
-
do
|
|
13777
|
-
ch = state.input.charCodeAt(++state.position);
|
|
13778
|
-
while (ch !== 0 && !isEol(ch));
|
|
13779
|
-
break;
|
|
13780
|
-
}
|
|
13781
|
-
if (isEol(ch)) break;
|
|
13782
|
-
_position = state.position;
|
|
13783
|
-
while (ch !== 0 && !isWsOrEol(ch)) ch = state.input.charCodeAt(++state.position);
|
|
13784
|
-
directiveArgs.push(state.input.slice(_position, state.position));
|
|
13785
|
-
}
|
|
13786
|
-
if (ch !== 0) readLineBreak(state);
|
|
13787
|
-
if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
13788
|
-
else throwWarning(state, "unknown document directive \"" + directiveName + "\"");
|
|
13789
|
-
}
|
|
13790
|
-
skipSeparationSpace(state, true, -1);
|
|
13791
|
-
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
13792
|
-
state.position += 3;
|
|
13793
|
-
skipSeparationSpace(state, true, -1);
|
|
13794
|
-
} else if (hasDirectives) throwError(state, "directives end mark is expected");
|
|
13795
|
-
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
13796
|
-
skipSeparationSpace(state, true, -1);
|
|
13797
|
-
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
13798
|
-
state.documents.push(state.result);
|
|
13799
|
-
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
13800
|
-
if (state.input.charCodeAt(state.position) === 46) {
|
|
13801
|
-
state.position += 3;
|
|
13802
|
-
skipSeparationSpace(state, true, -1);
|
|
13803
|
-
}
|
|
13804
|
-
return;
|
|
13805
|
-
}
|
|
13806
|
-
if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected");
|
|
13807
|
-
}
|
|
13808
|
-
function loadDocuments(input, options) {
|
|
13809
|
-
input = String(input);
|
|
13810
|
-
options = options || {};
|
|
13811
|
-
if (input.length !== 0) {
|
|
13812
|
-
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) input += "\n";
|
|
13813
|
-
if (input.charCodeAt(0) === 65279) input = input.slice(1);
|
|
13814
|
-
}
|
|
13815
|
-
const state = new State(input, options);
|
|
13816
|
-
const nullpos = input.indexOf("\0");
|
|
13817
|
-
if (nullpos !== -1) {
|
|
13818
|
-
state.position = nullpos;
|
|
13819
|
-
throwError(state, "null byte is not allowed in input");
|
|
13820
|
-
}
|
|
13821
|
-
state.input += "\0";
|
|
13822
|
-
while (state.input.charCodeAt(state.position) === 32) {
|
|
13823
|
-
state.lineIndent += 1;
|
|
13824
|
-
state.position += 1;
|
|
13825
|
-
}
|
|
13826
|
-
while (state.position < state.length - 1) readDocument(state);
|
|
13827
|
-
return state.documents;
|
|
13828
|
-
}
|
|
13829
|
-
function loadAll(input, iterator, options) {
|
|
13830
|
-
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
13831
|
-
options = iterator;
|
|
13832
|
-
iterator = null;
|
|
13833
|
-
}
|
|
13834
|
-
const documents = loadDocuments(input, options);
|
|
13835
|
-
if (typeof iterator !== "function") return documents;
|
|
13836
|
-
for (let index = 0, length = documents.length; index < length; index += 1) iterator(documents[index]);
|
|
13837
|
-
}
|
|
13838
|
-
function load(input, options) {
|
|
13839
|
-
const documents = loadDocuments(input, options);
|
|
13840
|
-
if (documents.length === 0) return;
|
|
13841
|
-
else if (documents.length === 1) return documents[0];
|
|
13842
|
-
throw new YAMLException("expected a single document in the stream, but found more");
|
|
13843
|
-
}
|
|
13844
|
-
module.exports.loadAll = loadAll;
|
|
13845
|
-
module.exports.load = load;
|
|
13846
|
-
}));
|
|
13847
|
-
var require_dumper = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
13848
|
-
var common = require_common();
|
|
13849
|
-
var YAMLException = require_exception();
|
|
13850
|
-
var DEFAULT_SCHEMA = require_default();
|
|
13851
|
-
var _toString = Object.prototype.toString;
|
|
13852
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
13853
|
-
var CHAR_BOM = 65279;
|
|
13854
|
-
var CHAR_TAB = 9;
|
|
13855
|
-
var CHAR_LINE_FEED = 10;
|
|
13856
|
-
var CHAR_CARRIAGE_RETURN = 13;
|
|
13857
|
-
var CHAR_SPACE = 32;
|
|
13858
|
-
var CHAR_EXCLAMATION = 33;
|
|
13859
|
-
var CHAR_DOUBLE_QUOTE = 34;
|
|
13860
|
-
var CHAR_SHARP = 35;
|
|
13861
|
-
var CHAR_PERCENT = 37;
|
|
13862
|
-
var CHAR_AMPERSAND = 38;
|
|
13863
|
-
var CHAR_SINGLE_QUOTE = 39;
|
|
13864
|
-
var CHAR_ASTERISK = 42;
|
|
13865
|
-
var CHAR_COMMA = 44;
|
|
13866
|
-
var CHAR_MINUS = 45;
|
|
13867
|
-
var CHAR_COLON = 58;
|
|
13868
|
-
var CHAR_EQUALS = 61;
|
|
13869
|
-
var CHAR_GREATER_THAN = 62;
|
|
13870
|
-
var CHAR_QUESTION = 63;
|
|
13871
|
-
var CHAR_COMMERCIAL_AT = 64;
|
|
13872
|
-
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
13873
|
-
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
13874
|
-
var CHAR_GRAVE_ACCENT = 96;
|
|
13875
|
-
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
13876
|
-
var CHAR_VERTICAL_LINE = 124;
|
|
13877
|
-
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
13878
|
-
var ESCAPE_SEQUENCES = {};
|
|
13879
|
-
ESCAPE_SEQUENCES[0] = "\\0";
|
|
13880
|
-
ESCAPE_SEQUENCES[7] = "\\a";
|
|
13881
|
-
ESCAPE_SEQUENCES[8] = "\\b";
|
|
13882
|
-
ESCAPE_SEQUENCES[9] = "\\t";
|
|
13883
|
-
ESCAPE_SEQUENCES[10] = "\\n";
|
|
13884
|
-
ESCAPE_SEQUENCES[11] = "\\v";
|
|
13885
|
-
ESCAPE_SEQUENCES[12] = "\\f";
|
|
13886
|
-
ESCAPE_SEQUENCES[13] = "\\r";
|
|
13887
|
-
ESCAPE_SEQUENCES[27] = "\\e";
|
|
13888
|
-
ESCAPE_SEQUENCES[34] = "\\\"";
|
|
13889
|
-
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
13890
|
-
ESCAPE_SEQUENCES[133] = "\\N";
|
|
13891
|
-
ESCAPE_SEQUENCES[160] = "\\_";
|
|
13892
|
-
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
13893
|
-
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
13894
|
-
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
13895
|
-
"y",
|
|
13896
|
-
"Y",
|
|
13897
|
-
"yes",
|
|
13898
|
-
"Yes",
|
|
13899
|
-
"YES",
|
|
13900
|
-
"on",
|
|
13901
|
-
"On",
|
|
13902
|
-
"ON",
|
|
13903
|
-
"n",
|
|
13904
|
-
"N",
|
|
13905
|
-
"no",
|
|
13906
|
-
"No",
|
|
13907
|
-
"NO",
|
|
13908
|
-
"off",
|
|
13909
|
-
"Off",
|
|
13910
|
-
"OFF"
|
|
13911
|
-
];
|
|
13912
|
-
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
13913
|
-
function compileStyleMap(schema, map) {
|
|
13914
|
-
if (map === null) return {};
|
|
13915
|
-
const result = {};
|
|
13916
|
-
const keys = Object.keys(map);
|
|
13917
|
-
for (let index = 0, length = keys.length; index < length; index += 1) {
|
|
13918
|
-
let tag = keys[index];
|
|
13919
|
-
let style = String(map[tag]);
|
|
13920
|
-
if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
13921
|
-
const type = schema.compiledTypeMap["fallback"][tag];
|
|
13922
|
-
if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style];
|
|
13923
|
-
result[tag] = style;
|
|
13924
|
-
}
|
|
13925
|
-
return result;
|
|
13926
|
-
}
|
|
13927
|
-
function encodeHex(character) {
|
|
13928
|
-
let handle;
|
|
13929
|
-
let length;
|
|
13930
|
-
const string = character.toString(16).toUpperCase();
|
|
13931
|
-
if (character <= 255) {
|
|
13932
|
-
handle = "x";
|
|
13933
|
-
length = 2;
|
|
13934
|
-
} else if (character <= 65535) {
|
|
13935
|
-
handle = "u";
|
|
13936
|
-
length = 4;
|
|
13937
|
-
} else if (character <= 4294967295) {
|
|
13938
|
-
handle = "U";
|
|
13939
|
-
length = 8;
|
|
13940
|
-
} else throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
|
|
13941
|
-
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
13942
|
-
}
|
|
13943
|
-
var QUOTING_TYPE_SINGLE = 1;
|
|
13944
|
-
var QUOTING_TYPE_DOUBLE = 2;
|
|
13945
|
-
function State(options) {
|
|
13946
|
-
this.schema = options["schema"] || DEFAULT_SCHEMA;
|
|
13947
|
-
this.indent = Math.max(1, options["indent"] || 2);
|
|
13948
|
-
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
13949
|
-
this.skipInvalid = options["skipInvalid"] || false;
|
|
13950
|
-
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
13951
|
-
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
13952
|
-
this.sortKeys = options["sortKeys"] || false;
|
|
13953
|
-
this.lineWidth = options["lineWidth"] || 80;
|
|
13954
|
-
this.noRefs = options["noRefs"] || false;
|
|
13955
|
-
this.noCompatMode = options["noCompatMode"] || false;
|
|
13956
|
-
this.condenseFlow = options["condenseFlow"] || false;
|
|
13957
|
-
this.quotingType = options["quotingType"] === "\"" ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
13958
|
-
this.forceQuotes = options["forceQuotes"] || false;
|
|
13959
|
-
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
|
|
13960
|
-
this.implicitTypes = this.schema.compiledImplicit;
|
|
13961
|
-
this.explicitTypes = this.schema.compiledExplicit;
|
|
13962
|
-
this.tag = null;
|
|
13963
|
-
this.result = "";
|
|
13964
|
-
this.duplicates = [];
|
|
13965
|
-
this.usedDuplicates = null;
|
|
13966
|
-
}
|
|
13967
|
-
function indentString(string, spaces) {
|
|
13968
|
-
const ind = common.repeat(" ", spaces);
|
|
13969
|
-
let position = 0;
|
|
13970
|
-
let result = "";
|
|
13971
|
-
const length = string.length;
|
|
13972
|
-
while (position < length) {
|
|
13973
|
-
let line;
|
|
13974
|
-
const next = string.indexOf("\n", position);
|
|
13975
|
-
if (next === -1) {
|
|
13976
|
-
line = string.slice(position);
|
|
13977
|
-
position = length;
|
|
13978
|
-
} else {
|
|
13979
|
-
line = string.slice(position, next + 1);
|
|
13980
|
-
position = next + 1;
|
|
13981
|
-
}
|
|
13982
|
-
if (line.length && line !== "\n") result += ind;
|
|
13983
|
-
result += line;
|
|
13984
|
-
}
|
|
13985
|
-
return result;
|
|
13986
|
-
}
|
|
13987
|
-
function generateNextLine(state, level) {
|
|
13988
|
-
return "\n" + common.repeat(" ", state.indent * level);
|
|
13989
|
-
}
|
|
13990
|
-
function testImplicitResolving(state, str) {
|
|
13991
|
-
for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) if (state.implicitTypes[index].resolve(str)) return true;
|
|
13992
|
-
return false;
|
|
13993
|
-
}
|
|
13994
|
-
function isWhitespace(c) {
|
|
13995
|
-
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
13996
|
-
}
|
|
13997
|
-
function isPrintable(c) {
|
|
13998
|
-
return c >= 32 && c <= 126 || c >= 161 && c <= 55295 && c !== 8232 && c !== 8233 || c >= 57344 && c <= 65533 && c !== CHAR_BOM || c >= 65536 && c <= 1114111;
|
|
13999
|
-
}
|
|
14000
|
-
function isNsCharOrWhitespace(c) {
|
|
14001
|
-
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
14002
|
-
}
|
|
14003
|
-
function isPlainSafe(c, prev, inblock) {
|
|
14004
|
-
const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
14005
|
-
const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
14006
|
-
return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
|
|
14007
|
-
}
|
|
14008
|
-
function isPlainSafeFirst(c) {
|
|
14009
|
-
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
14010
|
-
}
|
|
14011
|
-
function isPlainSafeLast(c) {
|
|
14012
|
-
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
14013
|
-
}
|
|
14014
|
-
function codePointAt(string, pos) {
|
|
14015
|
-
const first = string.charCodeAt(pos);
|
|
14016
|
-
let second;
|
|
14017
|
-
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
|
|
14018
|
-
second = string.charCodeAt(pos + 1);
|
|
14019
|
-
if (second >= 56320 && second <= 57343) return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
14020
|
-
}
|
|
14021
|
-
return first;
|
|
14022
|
-
}
|
|
14023
|
-
function needIndentIndicator(string) {
|
|
14024
|
-
return /^\n* /.test(string);
|
|
14025
|
-
}
|
|
14026
|
-
var STYLE_PLAIN = 1;
|
|
14027
|
-
var STYLE_SINGLE = 2;
|
|
14028
|
-
var STYLE_LITERAL = 3;
|
|
14029
|
-
var STYLE_FOLDED = 4;
|
|
14030
|
-
var STYLE_DOUBLE = 5;
|
|
14031
|
-
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
14032
|
-
let i;
|
|
14033
|
-
let char = 0;
|
|
14034
|
-
let prevChar = null;
|
|
14035
|
-
let hasLineBreak = false;
|
|
14036
|
-
let hasFoldableLine = false;
|
|
14037
|
-
const shouldTrackWidth = lineWidth !== -1;
|
|
14038
|
-
let previousLineBreak = -1;
|
|
14039
|
-
let plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
|
|
14040
|
-
if (singleLineOnly || forceQuotes) for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
14041
|
-
char = codePointAt(string, i);
|
|
14042
|
-
if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
14043
|
-
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
14044
|
-
prevChar = char;
|
|
14045
|
-
}
|
|
14046
|
-
else {
|
|
14047
|
-
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
14048
|
-
char = codePointAt(string, i);
|
|
14049
|
-
if (char === CHAR_LINE_FEED) {
|
|
14050
|
-
hasLineBreak = true;
|
|
14051
|
-
if (shouldTrackWidth) {
|
|
14052
|
-
hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
14053
|
-
previousLineBreak = i;
|
|
14054
|
-
}
|
|
14055
|
-
} else if (!isPrintable(char)) return STYLE_DOUBLE;
|
|
14056
|
-
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
14057
|
-
prevChar = char;
|
|
14058
|
-
}
|
|
14059
|
-
hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
14060
|
-
}
|
|
14061
|
-
if (!hasLineBreak && !hasFoldableLine) {
|
|
14062
|
-
if (plain && !forceQuotes && !testAmbiguousType(string)) return STYLE_PLAIN;
|
|
14063
|
-
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
14064
|
-
}
|
|
14065
|
-
if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
|
|
14066
|
-
if (!forceQuotes) return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
14067
|
-
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
14068
|
-
}
|
|
14069
|
-
function writeScalar(state, string, level, iskey, inblock) {
|
|
14070
|
-
state.dump = function() {
|
|
14071
|
-
if (string.length === 0) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"\"" : "''";
|
|
14072
|
-
if (!state.noCompatMode) {
|
|
14073
|
-
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) return state.quotingType === QUOTING_TYPE_DOUBLE ? "\"" + string + "\"" : "'" + string + "'";
|
|
14074
|
-
}
|
|
14075
|
-
const indent = state.indent * Math.max(1, level);
|
|
14076
|
-
const lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
14077
|
-
const singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
14078
|
-
function testAmbiguity(string) {
|
|
14079
|
-
return testImplicitResolving(state, string);
|
|
14080
|
-
}
|
|
14081
|
-
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
|
|
14082
|
-
case STYLE_PLAIN: return string;
|
|
14083
|
-
case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'";
|
|
14084
|
-
case STYLE_LITERAL: return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
14085
|
-
case STYLE_FOLDED: return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
14086
|
-
case STYLE_DOUBLE: return "\"" + escapeString(string, lineWidth) + "\"";
|
|
14087
|
-
default: throw new YAMLException("impossible error: invalid scalar style");
|
|
14088
|
-
}
|
|
14089
|
-
}();
|
|
14090
|
-
}
|
|
14091
|
-
function blockHeader(string, indentPerLevel) {
|
|
14092
|
-
const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
14093
|
-
const clip = string[string.length - 1] === "\n";
|
|
14094
|
-
return indentIndicator + (clip && (string[string.length - 2] === "\n" || string === "\n") ? "+" : clip ? "" : "-") + "\n";
|
|
14095
|
-
}
|
|
14096
|
-
function dropEndingNewline(string) {
|
|
14097
|
-
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
14098
|
-
}
|
|
14099
|
-
function foldString(string, width) {
|
|
14100
|
-
const lineRe = /(\n+)([^\n]*)/g;
|
|
14101
|
-
let result = function() {
|
|
14102
|
-
let nextLF = string.indexOf("\n");
|
|
14103
|
-
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
14104
|
-
lineRe.lastIndex = nextLF;
|
|
14105
|
-
return foldLine(string.slice(0, nextLF), width);
|
|
14106
|
-
}();
|
|
14107
|
-
let prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
14108
|
-
let moreIndented;
|
|
14109
|
-
let match;
|
|
14110
|
-
while (match = lineRe.exec(string)) {
|
|
14111
|
-
const prefix = match[1];
|
|
14112
|
-
const line = match[2];
|
|
14113
|
-
moreIndented = line[0] === " ";
|
|
14114
|
-
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
14115
|
-
prevMoreIndented = moreIndented;
|
|
14116
|
-
}
|
|
14117
|
-
return result;
|
|
14118
|
-
}
|
|
14119
|
-
function foldLine(line, width) {
|
|
14120
|
-
if (line === "" || line[0] === " ") return line;
|
|
14121
|
-
const breakRe = / [^ ]/g;
|
|
14122
|
-
let match;
|
|
14123
|
-
let start = 0;
|
|
14124
|
-
let end;
|
|
14125
|
-
let curr = 0;
|
|
14126
|
-
let next = 0;
|
|
14127
|
-
let result = "";
|
|
14128
|
-
while (match = breakRe.exec(line)) {
|
|
14129
|
-
next = match.index;
|
|
14130
|
-
if (next - start > width) {
|
|
14131
|
-
end = curr > start ? curr : next;
|
|
14132
|
-
result += "\n" + line.slice(start, end);
|
|
14133
|
-
start = end + 1;
|
|
14134
|
-
}
|
|
14135
|
-
curr = next;
|
|
14136
|
-
}
|
|
14137
|
-
result += "\n";
|
|
14138
|
-
if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
14139
|
-
else result += line.slice(start);
|
|
14140
|
-
return result.slice(1);
|
|
14141
|
-
}
|
|
14142
|
-
function escapeString(string) {
|
|
14143
|
-
let result = "";
|
|
14144
|
-
let char = 0;
|
|
14145
|
-
for (let i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
|
|
14146
|
-
char = codePointAt(string, i);
|
|
14147
|
-
const escapeSeq = ESCAPE_SEQUENCES[char];
|
|
14148
|
-
if (!escapeSeq && isPrintable(char)) {
|
|
14149
|
-
result += string[i];
|
|
14150
|
-
if (char >= 65536) result += string[i + 1];
|
|
14151
|
-
} else result += escapeSeq || encodeHex(char);
|
|
14152
|
-
}
|
|
14153
|
-
return result;
|
|
14154
|
-
}
|
|
14155
|
-
function writeFlowSequence(state, level, object) {
|
|
14156
|
-
let _result = "";
|
|
14157
|
-
const _tag = state.tag;
|
|
14158
|
-
for (let index = 0, length = object.length; index < length; index += 1) {
|
|
14159
|
-
let value = object[index];
|
|
14160
|
-
if (state.replacer) value = state.replacer.call(object, String(index), value);
|
|
14161
|
-
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
|
|
14162
|
-
if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
|
|
14163
|
-
_result += state.dump;
|
|
14164
|
-
}
|
|
14165
|
-
}
|
|
14166
|
-
state.tag = _tag;
|
|
14167
|
-
state.dump = "[" + _result + "]";
|
|
14168
|
-
}
|
|
14169
|
-
function writeBlockSequence(state, level, object, compact) {
|
|
14170
|
-
let _result = "";
|
|
14171
|
-
const _tag = state.tag;
|
|
14172
|
-
for (let index = 0, length = object.length; index < length; index += 1) {
|
|
14173
|
-
let value = object[index];
|
|
14174
|
-
if (state.replacer) value = state.replacer.call(object, String(index), value);
|
|
14175
|
-
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
14176
|
-
if (!compact || _result !== "") _result += generateNextLine(state, level);
|
|
14177
|
-
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-";
|
|
14178
|
-
else _result += "- ";
|
|
14179
|
-
_result += state.dump;
|
|
14180
|
-
}
|
|
14181
|
-
}
|
|
14182
|
-
state.tag = _tag;
|
|
14183
|
-
state.dump = _result || "[]";
|
|
14184
|
-
}
|
|
14185
|
-
function writeFlowMapping(state, level, object) {
|
|
14186
|
-
let _result = "";
|
|
14187
|
-
const _tag = state.tag;
|
|
14188
|
-
const objectKeyList = Object.keys(object);
|
|
14189
|
-
for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
14190
|
-
let pairBuffer = "";
|
|
14191
|
-
if (_result !== "") pairBuffer += ", ";
|
|
14192
|
-
if (state.condenseFlow) pairBuffer += "\"";
|
|
14193
|
-
const objectKey = objectKeyList[index];
|
|
14194
|
-
let objectValue = object[objectKey];
|
|
14195
|
-
if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
14196
|
-
if (!writeNode(state, level, objectKey, false, false)) continue;
|
|
14197
|
-
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
14198
|
-
pairBuffer += state.dump + (state.condenseFlow ? "\"" : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
14199
|
-
if (!writeNode(state, level, objectValue, false, false)) continue;
|
|
14200
|
-
pairBuffer += state.dump;
|
|
14201
|
-
_result += pairBuffer;
|
|
14202
|
-
}
|
|
14203
|
-
state.tag = _tag;
|
|
14204
|
-
state.dump = "{" + _result + "}";
|
|
14205
|
-
}
|
|
14206
|
-
function writeBlockMapping(state, level, object, compact) {
|
|
14207
|
-
let _result = "";
|
|
14208
|
-
const _tag = state.tag;
|
|
14209
|
-
const objectKeyList = Object.keys(object);
|
|
14210
|
-
if (state.sortKeys === true) objectKeyList.sort();
|
|
14211
|
-
else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys);
|
|
14212
|
-
else if (state.sortKeys) throw new YAMLException("sortKeys must be a boolean or a function");
|
|
14213
|
-
for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
14214
|
-
let pairBuffer = "";
|
|
14215
|
-
if (!compact || _result !== "") pairBuffer += generateNextLine(state, level);
|
|
14216
|
-
const objectKey = objectKeyList[index];
|
|
14217
|
-
let objectValue = object[objectKey];
|
|
14218
|
-
if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
|
|
14219
|
-
if (!writeNode(state, level + 1, objectKey, true, true, true)) continue;
|
|
14220
|
-
const explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
14221
|
-
if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?";
|
|
14222
|
-
else pairBuffer += "? ";
|
|
14223
|
-
pairBuffer += state.dump;
|
|
14224
|
-
if (explicitPair) pairBuffer += generateNextLine(state, level);
|
|
14225
|
-
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) continue;
|
|
14226
|
-
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
|
|
14227
|
-
else pairBuffer += ": ";
|
|
14228
|
-
pairBuffer += state.dump;
|
|
14229
|
-
_result += pairBuffer;
|
|
14230
|
-
}
|
|
14231
|
-
state.tag = _tag;
|
|
14232
|
-
state.dump = _result || "{}";
|
|
14233
|
-
}
|
|
14234
|
-
function detectType(state, object, explicit) {
|
|
14235
|
-
const typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
14236
|
-
for (let index = 0, length = typeList.length; index < length; index += 1) {
|
|
14237
|
-
const type = typeList[index];
|
|
14238
|
-
if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
|
|
14239
|
-
if (explicit) if (type.multi && type.representName) state.tag = type.representName(object);
|
|
14240
|
-
else state.tag = type.tag;
|
|
14241
|
-
else state.tag = "?";
|
|
14242
|
-
if (type.represent) {
|
|
14243
|
-
const style = state.styleMap[type.tag] || type.defaultStyle;
|
|
14244
|
-
let _result;
|
|
14245
|
-
if (_toString.call(type.represent) === "[object Function]") _result = type.represent(object, style);
|
|
14246
|
-
else if (_hasOwnProperty.call(type.represent, style)) _result = type.represent[style](object, style);
|
|
14247
|
-
else throw new YAMLException("!<" + type.tag + "> tag resolver accepts not \"" + style + "\" style");
|
|
14248
|
-
state.dump = _result;
|
|
14249
|
-
}
|
|
14250
|
-
return true;
|
|
14251
|
-
}
|
|
14252
|
-
}
|
|
14253
|
-
return false;
|
|
14254
|
-
}
|
|
14255
|
-
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
|
|
14256
|
-
state.tag = null;
|
|
14257
|
-
state.dump = object;
|
|
14258
|
-
if (!detectType(state, object, false)) detectType(state, object, true);
|
|
14259
|
-
const type = _toString.call(state.dump);
|
|
14260
|
-
const inblock = block;
|
|
14261
|
-
if (block) block = state.flowLevel < 0 || state.flowLevel > level;
|
|
14262
|
-
const objectOrArray = type === "[object Object]" || type === "[object Array]";
|
|
14263
|
-
let duplicateIndex;
|
|
14264
|
-
let duplicate;
|
|
14265
|
-
if (objectOrArray) {
|
|
14266
|
-
duplicateIndex = state.duplicates.indexOf(object);
|
|
14267
|
-
duplicate = duplicateIndex !== -1;
|
|
14268
|
-
}
|
|
14269
|
-
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) compact = false;
|
|
14270
|
-
if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex;
|
|
14271
|
-
else {
|
|
14272
|
-
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true;
|
|
14273
|
-
if (type === "[object Object]") if (block && Object.keys(state.dump).length !== 0) {
|
|
14274
|
-
writeBlockMapping(state, level, state.dump, compact);
|
|
14275
|
-
if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
14276
|
-
} else {
|
|
14277
|
-
writeFlowMapping(state, level, state.dump);
|
|
14278
|
-
if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
14279
|
-
}
|
|
14280
|
-
else if (type === "[object Array]") if (block && state.dump.length !== 0) {
|
|
14281
|
-
if (state.noArrayIndent && !isblockseq && level > 0) writeBlockSequence(state, level - 1, state.dump, compact);
|
|
14282
|
-
else writeBlockSequence(state, level, state.dump, compact);
|
|
14283
|
-
if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
14284
|
-
} else {
|
|
14285
|
-
writeFlowSequence(state, level, state.dump);
|
|
14286
|
-
if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
14287
|
-
}
|
|
14288
|
-
else if (type === "[object String]") {
|
|
14289
|
-
if (state.tag !== "?") writeScalar(state, state.dump, level, iskey, inblock);
|
|
14290
|
-
} else if (type === "[object Undefined]") return false;
|
|
14291
|
-
else {
|
|
14292
|
-
if (state.skipInvalid) return false;
|
|
14293
|
-
throw new YAMLException("unacceptable kind of an object to dump " + type);
|
|
14294
|
-
}
|
|
14295
|
-
if (state.tag !== null && state.tag !== "?") {
|
|
14296
|
-
let tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
|
|
14297
|
-
if (state.tag[0] === "!") tagStr = "!" + tagStr;
|
|
14298
|
-
else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") tagStr = "!!" + tagStr.slice(18);
|
|
14299
|
-
else tagStr = "!<" + tagStr + ">";
|
|
14300
|
-
state.dump = tagStr + " " + state.dump;
|
|
14301
|
-
}
|
|
14302
|
-
}
|
|
14303
|
-
return true;
|
|
14304
|
-
}
|
|
14305
|
-
function getDuplicateReferences(object, state) {
|
|
14306
|
-
const objects = [];
|
|
14307
|
-
const duplicatesIndexes = [];
|
|
14308
|
-
inspectNode(object, objects, duplicatesIndexes);
|
|
14309
|
-
const length = duplicatesIndexes.length;
|
|
14310
|
-
for (let index = 0; index < length; index += 1) state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
14311
|
-
state.usedDuplicates = new Array(length);
|
|
14312
|
-
}
|
|
14313
|
-
function inspectNode(object, objects, duplicatesIndexes) {
|
|
14314
|
-
if (object !== null && typeof object === "object") {
|
|
14315
|
-
const index = objects.indexOf(object);
|
|
14316
|
-
if (index !== -1) {
|
|
14317
|
-
if (duplicatesIndexes.indexOf(index) === -1) duplicatesIndexes.push(index);
|
|
14318
|
-
} else {
|
|
14319
|
-
objects.push(object);
|
|
14320
|
-
if (Array.isArray(object)) for (let i = 0, length = object.length; i < length; i += 1) inspectNode(object[i], objects, duplicatesIndexes);
|
|
14321
|
-
else {
|
|
14322
|
-
const objectKeyList = Object.keys(object);
|
|
14323
|
-
for (let i = 0, length = objectKeyList.length; i < length; i += 1) inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes);
|
|
14324
|
-
}
|
|
14325
|
-
}
|
|
14326
|
-
}
|
|
14327
|
-
}
|
|
14328
|
-
function dump(input, options) {
|
|
14329
|
-
options = options || {};
|
|
14330
|
-
const state = new State(options);
|
|
14331
|
-
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
14332
|
-
let value = input;
|
|
14333
|
-
if (state.replacer) value = state.replacer.call({ "": value }, "", value);
|
|
14334
|
-
if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
|
|
14335
|
-
return "";
|
|
14336
|
-
}
|
|
14337
|
-
module.exports.dump = dump;
|
|
14338
|
-
}));
|
|
14339
|
-
var import_js_yaml = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14340
|
-
var loader = require_loader();
|
|
14341
|
-
var dumper = require_dumper();
|
|
14342
|
-
function renamed(from, to) {
|
|
14343
|
-
return function() {
|
|
14344
|
-
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
14345
|
-
};
|
|
14346
|
-
}
|
|
14347
|
-
module.exports.Type = require_type();
|
|
14348
|
-
module.exports.Schema = require_schema();
|
|
14349
|
-
module.exports.FAILSAFE_SCHEMA = require_failsafe();
|
|
14350
|
-
module.exports.JSON_SCHEMA = require_json();
|
|
14351
|
-
module.exports.CORE_SCHEMA = require_core();
|
|
14352
|
-
module.exports.DEFAULT_SCHEMA = require_default();
|
|
14353
|
-
module.exports.load = loader.load;
|
|
14354
|
-
module.exports.loadAll = loader.loadAll;
|
|
14355
|
-
module.exports.dump = dumper.dump;
|
|
14356
|
-
module.exports.YAMLException = require_exception();
|
|
14357
|
-
module.exports.types = {
|
|
14358
|
-
binary: require_binary(),
|
|
14359
|
-
float: require_float(),
|
|
14360
|
-
map: require_map(),
|
|
14361
|
-
null: require_null(),
|
|
14362
|
-
pairs: require_pairs(),
|
|
14363
|
-
set: require_set(),
|
|
14364
|
-
timestamp: require_timestamp(),
|
|
14365
|
-
bool: require_bool(),
|
|
14366
|
-
int: require_int(),
|
|
14367
|
-
merge: require_merge(),
|
|
14368
|
-
omap: require_omap(),
|
|
14369
|
-
seq: require_seq(),
|
|
14370
|
-
str: require_str()
|
|
14371
|
-
};
|
|
14372
|
-
module.exports.safeLoad = renamed("safeLoad", "load");
|
|
14373
|
-
module.exports.safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
14374
|
-
module.exports.safeDump = renamed("safeDump", "dump");
|
|
14375
|
-
})))(), 1);
|
|
14376
|
-
var { Type, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load, loadAll, dump, YAMLException, types, safeLoad, safeLoadAll, safeDump } = import_js_yaml.default;
|
|
14377
|
-
import_js_yaml.default;
|
|
14378
|
-
//#endregion
|
|
14379
|
-
//#region src/kernel/legacy-config-yaml.ts
|
|
14380
|
-
/**
|
|
14381
|
-
* TRANSITION — delete this module, its spec and the `js-yaml` dependency one
|
|
14382
|
-
* release after it ships (D1018).
|
|
14383
|
-
*
|
|
14384
|
-
* CamStack no longer has a `config.yaml`: the bootstrap config is the
|
|
14385
|
-
* environment plus built-in defaults. A node updated from a release that still
|
|
14386
|
-
* had the file must not change port, host or data directory silently, so for
|
|
14387
|
-
* ONE release the file is parsed here, only to compare: a key whose legacy value
|
|
14388
|
-
* differs from the effective env/default value, and whose environment variable
|
|
14389
|
-
* is not set, is still applied, with a warning naming the variable that
|
|
14390
|
-
* replaces it. A file that matches the defaults is ignored.
|
|
14391
|
-
*
|
|
14392
|
-
* Like `bootstrap-config.ts`, this runs before any logger exists, so the
|
|
14393
|
-
* `console.*` calls are the documented residual (see `ConfigManager`).
|
|
14394
|
-
*/
|
|
14395
|
-
/** The former image default, searched after `CONFIG_PATH` so a recreated container still finds its volume. */
|
|
14396
|
-
var FORMER_IMAGE_CONFIG_PATH = "/config/config.yaml";
|
|
14397
|
-
/** The bootstrap keys a legacy file could still set, with the variable that now owns each. */
|
|
14398
|
-
var LEGACY_KEYS = [
|
|
14399
|
-
{
|
|
14400
|
-
key: "port",
|
|
14401
|
-
envVar: "CAMSTACK_PORT"
|
|
14402
|
-
},
|
|
14403
|
-
{
|
|
14404
|
-
key: "host",
|
|
14405
|
-
envVar: "CAMSTACK_HOST"
|
|
14406
|
-
},
|
|
14407
|
-
{
|
|
14408
|
-
key: "dataPath",
|
|
14409
|
-
envVar: "CAMSTACK_DATA"
|
|
14410
|
-
}
|
|
14411
|
-
];
|
|
14412
|
-
var NOTHING_TO_APPLY = {
|
|
14413
|
-
overrides: {},
|
|
14414
|
-
notes: []
|
|
14415
|
-
};
|
|
14416
|
-
function isRecord$3(value) {
|
|
14417
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14418
|
-
}
|
|
14419
|
-
function isEnvSet(env, name) {
|
|
14420
|
-
const value = env[name];
|
|
14421
|
-
return value !== void 0 && value !== "";
|
|
14422
|
-
}
|
|
14423
|
-
/** Where the legacy file would be: `CONFIG_PATH`, the former image default, then under the data root. */
|
|
14424
|
-
function legacyConfigYamlCandidates(env) {
|
|
14425
|
-
const dataRoot = isEnvSet(env, "CAMSTACK_DATA") ? env["CAMSTACK_DATA"] ?? "camstack-data" : path$1.join(process.cwd(), DEFAULT_DATA_PATH);
|
|
14426
|
-
return [
|
|
14427
|
-
...isEnvSet(env, "CONFIG_PATH") ? [env["CONFIG_PATH"] ?? ""] : [],
|
|
14428
|
-
FORMER_IMAGE_CONFIG_PATH,
|
|
14429
|
-
path$1.join(dataRoot, "config.yaml")
|
|
14430
|
-
];
|
|
14431
|
-
}
|
|
14432
|
-
function findLegacyFile(env) {
|
|
14433
|
-
return legacyConfigYamlCandidates(env).find((candidate) => fs$1.existsSync(candidate));
|
|
14434
|
-
}
|
|
14435
|
-
/** The legacy value of a key when it is well-formed, else undefined. */
|
|
14436
|
-
function legacyValue(server, key) {
|
|
14437
|
-
const value = server[key];
|
|
14438
|
-
if (key === "port") return typeof value === "number" && Number.isInteger(value) && value > 0 && value < 65536 ? value : void 0;
|
|
14439
|
-
return typeof value === "string" && value !== "" ? value : void 0;
|
|
14440
|
-
}
|
|
14441
|
-
/** Retired-key notices the file used to earn at boot; they leave with the file. */
|
|
14442
|
-
function retiredKeyNotes(raw) {
|
|
14443
|
-
const notes = [];
|
|
14444
|
-
const section = raw["bootstrap"];
|
|
14445
|
-
if (isRecord$3(section) && "installSource" in section) notes.push({
|
|
14446
|
-
level: "warn",
|
|
14447
|
-
message: "bootstrap.installSource ignored — addons always install from npm; a workspace build reaches a node through `camstack deploy`."
|
|
14448
|
-
});
|
|
14449
|
-
if (isRecord$3(section) && "requiredAddons" in section) notes.push({
|
|
14450
|
-
level: "warn",
|
|
14451
|
-
message: "bootstrap.requiredAddons ignored — the first-boot addon set always comes from the server package."
|
|
14452
|
-
});
|
|
14453
|
-
const keychain = raw["keychain"];
|
|
14454
|
-
if (isRecord$3(keychain) && ("keyFile" in keychain || "previousKeyFile" in keychain)) notes.push({
|
|
14455
|
-
level: "warn",
|
|
14456
|
-
message: "keychain.keyFile / keychain.previousKeyFile ignored — the external master key is a fixed mounted path: mount the file at /run/secrets/camstack-master-key (the key being rotated away from at /run/secrets/camstack-master-key.previous)."
|
|
14457
|
-
});
|
|
14458
|
-
return notes;
|
|
14459
|
-
}
|
|
14460
|
-
/**
|
|
14461
|
-
* Compare a legacy config.yaml, if one exists, with what env and defaults give.
|
|
14462
|
-
* Pure of side effects except for reading the file.
|
|
14463
|
-
*/
|
|
14464
|
-
function reconcileLegacyConfigYaml(env, effective) {
|
|
14465
|
-
const file = findLegacyFile(env);
|
|
14466
|
-
if (file === void 0) return NOTHING_TO_APPLY;
|
|
14467
|
-
let raw;
|
|
14468
|
-
try {
|
|
14469
|
-
raw = asJsonObject(load(fs$1.readFileSync(file, "utf-8"))) ?? {};
|
|
14470
|
-
} catch (err) {
|
|
14471
|
-
return {
|
|
14472
|
-
overrides: {},
|
|
14473
|
-
notes: [{
|
|
14474
|
-
level: "warn",
|
|
14475
|
-
message: `${file} could not be parsed (${err instanceof Error ? err.message : String(err)}) and is ignored — config.yaml is no longer read. Delete it.`
|
|
14476
|
-
}]
|
|
14477
|
-
};
|
|
14478
|
-
}
|
|
14479
|
-
const serverRaw = raw["server"];
|
|
14480
|
-
const server = isRecord$3(serverRaw) ? serverRaw : {};
|
|
14481
|
-
const overrides = {};
|
|
14482
|
-
const notes = [...retiredKeyNotes(raw)];
|
|
14483
|
-
for (const { key, envVar } of LEGACY_KEYS) {
|
|
14484
|
-
if (isEnvSet(env, envVar)) continue;
|
|
14485
|
-
const legacy = legacyValue(server, key);
|
|
14486
|
-
if (legacy === void 0 || legacy === effective[key]) continue;
|
|
14487
|
-
if (key === "port" && typeof legacy === "number") overrides.port = legacy;
|
|
14488
|
-
else if (key === "host" && typeof legacy === "string") overrides.host = legacy;
|
|
14489
|
-
else if (key === "dataPath" && typeof legacy === "string") overrides.dataPath = legacy;
|
|
14490
|
-
notes.push({
|
|
14491
|
-
level: "warn",
|
|
14492
|
-
message: `${file} is no longer read, but sets server.${key}=${String(legacy)}, still applied for this release: set ${envVar}=${String(legacy)} and delete ${file}.`
|
|
14493
|
-
});
|
|
14494
|
-
}
|
|
14495
|
-
if (!notes.some((n) => n.level === "warn")) notes.push({
|
|
14496
|
-
level: "info",
|
|
14497
|
-
message: `${file} is no longer read and matches the defaults: it can be deleted.`
|
|
14498
|
-
});
|
|
14499
|
-
return {
|
|
14500
|
-
overrides,
|
|
14501
|
-
notes
|
|
14502
|
-
};
|
|
14503
|
-
}
|
|
14504
|
-
/** Notes already printed by this process: the loader runs twice per boot (main.ts and ConfigManager). */
|
|
14505
|
-
var printedNotes = /* @__PURE__ */ new Set();
|
|
14506
|
-
/** Print each note once per process, the way the bootstrap prints everything else. */
|
|
14507
|
-
function logLegacyNotes(notes) {
|
|
14508
|
-
for (const note of notes) {
|
|
14509
|
-
const id = `${note.level}:${note.message}`;
|
|
14510
|
-
if (printedNotes.has(id)) continue;
|
|
14511
|
-
printedNotes.add(id);
|
|
14512
|
-
if (note.level === "warn") console.warn(`[Phase1] WARN ${note.message}`);
|
|
14513
|
-
else console.log(`[Phase1] ${note.message}`);
|
|
14514
|
-
}
|
|
14515
|
-
}
|
|
14516
|
-
//#endregion
|
|
14517
12056
|
//#region src/kernel/bootstrap-config.ts
|
|
14518
12057
|
/**
|
|
14519
12058
|
* Environment + defaults: loading —
|
|
@@ -14537,18 +12076,10 @@ var ENV_VAR_MAP = {
|
|
|
14537
12076
|
/**
|
|
14538
12077
|
* Built-in defaults with the environment applied — THE bootstrap loader: the
|
|
14539
12078
|
* hub's `main.ts` and `ConfigManager` come through here, so a key is read in one
|
|
14540
|
-
* place. There is no config.yaml (D1018);
|
|
14541
|
-
* node that still has one lives in `legacy-config-yaml.ts`.
|
|
12079
|
+
* place. There is no config.yaml (D1018); a leftover file is not read.
|
|
14542
12080
|
*/
|
|
14543
12081
|
function loadBootstrapConfig(env = process.env) {
|
|
14544
|
-
|
|
14545
|
-
const envServer = isRecord$2(fromEnv["server"]) ? fromEnv["server"] : {};
|
|
14546
|
-
const legacy = reconcileLegacyConfigYaml(env, bootstrapSchema.parse(fromEnv).server);
|
|
14547
|
-
logLegacyNotes(legacy.notes);
|
|
14548
|
-
return bootstrapSchema.parse({ server: {
|
|
14549
|
-
...envServer,
|
|
14550
|
-
...legacy.overrides
|
|
14551
|
-
} });
|
|
12082
|
+
return bootstrapSchema.parse(applyEnvOverrides({}, env));
|
|
14552
12083
|
}
|
|
14553
12084
|
/**
|
|
14554
12085
|
* Deep-set a value in a nested plain object using a dot-notation path.
|
|
@@ -28171,7 +25702,13 @@ var en_default = {
|
|
|
28171
25702
|
"timedRunConfig.timedRun_quickRunDuration.label": "One-tap run",
|
|
28172
25703
|
"section.s_timed-run.title": "One-tap run",
|
|
28173
25704
|
"section.s_timed-run.description": "How long the Run button starts this device for. The hub switches it off when the time is up.",
|
|
28174
|
-
"integration-instances.addon-not-running": "\"{{addon}}\" is not running: start it first"
|
|
25705
|
+
"integration-instances.addon-not-running": "\"{{addon}}\" is not running: start it first",
|
|
25706
|
+
"ir-transmitter.learn-unsupported": "The transmitter {{name}} cannot learn a code",
|
|
25707
|
+
"ir-transmitter.learn-timeout": "The transmitter {{name}} learned nothing within the time limit. Point the remote at it and try again.",
|
|
25708
|
+
"ir-transmitter.learn-undecodable": "The code learned by {{name}} could not be read",
|
|
25709
|
+
"ir-transmitter.learn-busy": "The transmitter {{name}} is already learning a code",
|
|
25710
|
+
"ir-transmitter.native-unsupported": "The transmitter {{name}} cannot send this kind of code",
|
|
25711
|
+
"ir-transmitter.no-code": "Nothing to send: give a pulse train or a native code"
|
|
28175
25712
|
};
|
|
28176
25713
|
//#endregion
|
|
28177
25714
|
//#region src/i18n/it.json
|
|
@@ -28434,7 +25971,13 @@ var it_default = {
|
|
|
28434
25971
|
"timedRunConfig.timedRun_quickRunDuration.label": "Avvio rapido",
|
|
28435
25972
|
"section.s_timed-run.title": "Avvio rapido",
|
|
28436
25973
|
"section.s_timed-run.description": "Per quanto tempo il pulsante Avvia accende questo dispositivo. L'hub lo spegne allo scadere del tempo.",
|
|
28437
|
-
"integration-instances.addon-not-running": "\"{{addon}}\" non è in esecuzione: avvialo prima"
|
|
25974
|
+
"integration-instances.addon-not-running": "\"{{addon}}\" non è in esecuzione: avvialo prima",
|
|
25975
|
+
"ir-transmitter.learn-unsupported": "Il trasmettitore {{name}} non può apprendere un codice",
|
|
25976
|
+
"ir-transmitter.learn-timeout": "Il trasmettitore {{name}} non ha appreso nulla entro il tempo limite. Punta il telecomando verso di esso e riprova.",
|
|
25977
|
+
"ir-transmitter.learn-undecodable": "Il codice appreso da {{name}} non può essere letto",
|
|
25978
|
+
"ir-transmitter.learn-busy": "Il trasmettitore {{name}} sta già apprendendo un codice",
|
|
25979
|
+
"ir-transmitter.native-unsupported": "Il trasmettitore {{name}} non può inviare questo tipo di codice",
|
|
25980
|
+
"ir-transmitter.no-code": "Niente da inviare: indica un treno di impulsi o un codice nativo"
|
|
28438
25981
|
};
|
|
28439
25982
|
//#endregion
|
|
28440
25983
|
//#region src/i18n/catalog-registry.ts
|