@blue-labs/language 5.0.0-rc.0 → 5.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Blue-BwbQa9VQ.js +98 -0
- package/dist/{Blue-B7SYp5QY.mjs → Blue-Cnkas-g6.mjs} +2122 -2049
- package/dist/conformance.js +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/dist/lib/model/NodeDeserializer.d.ts +5 -0
- package/dist/lib/model/NodeDeserializer.d.ts.map +1 -1
- package/dist/lib/model/Schema.d.ts +6 -0
- package/dist/lib/model/Schema.d.ts.map +1 -1
- package/dist/lib/repository/BuiltinRuntimeTypes.d.ts +4 -12
- package/dist/lib/repository/BuiltinRuntimeTypes.d.ts.map +1 -1
- package/dist/lib/utils/NodeToMapListOrValue.d.ts.map +1 -1
- package/dist/lib/utils/SchemaToMapListOrValue.d.ts +15 -0
- package/dist/lib/utils/SchemaToMapListOrValue.d.ts.map +1 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/repositoryVersioning/BlueContextResolver.d.ts +1 -0
- package/dist/lib/utils/repositoryVersioning/BlueContextResolver.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/Blue-CTQkRrnu.js +0 -98
package/dist/conformance.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("node:fs"),u=require("node:path"),oe=require("node:crypto"),q=require("node:url"),ae=require("js-yaml"),N=require("node:assert/strict"),o=require("./Blue-CTQkRrnu.js");require("big.js");const x=require("@blue-labs/repository-contract");var B=typeof document<"u"?document.currentScript:null;class ue{static toBlueIdInput(e){return e.isListElementContext()?o.NodeToBlueIdInput.getListElement(e.toNode(),0):o.NodeToBlueIdInput.get(e.toNode())}}class d{constructor(e,r=!1,i=!1,n=!0,a=!1){this.strictCanonical=r,this.resolvedStructural=i,this.strictBlueIdValidation=n,this.listElementContext=a,this.name=e.getName(),this.description=e.getDescription(),this.type=this.freezeChild(e.getType(),!1),this.itemType=this.freezeChild(e.getItemType(),!1),this.keyType=this.freezeChild(e.getKeyType(),!1),this.valueType=this.freezeChild(e.getValueType(),!1),this.value=e.getValue(),this.items=this.freezeItems(e.getItems()),this.properties=this.freezeProperties(e.getProperties()),this.contracts=this.freezeChild(e.getContractsNode(),!1),this.referenceBlueId=e.getReferenceBlueId(),this.schema=e.getSchema()?.clone(),this.mergePolicy=e.getMergePolicy(),this.previousBlueId=e.getPreviousBlueId(),this.position=e.getPosition(),this.blue=this.freezeChild(e.getBlue(),!1),this.inlineValue=e.isInlineValue(),this.validatePayloadShape(),this.blueIdValue=this.computeBlueId()}name;description;type;itemType;keyType;valueType;value;items;properties;contracts;referenceBlueId;schema;mergePolicy;previousBlueId;position;blue;inlineValue;blueIdValue;static empty(){return new d(new o.BlueNode,!0,!1)}static fromNode(e){return new d(e,!0,!1)}static fromResolvedNode(e){return new d(e,!1,!0,!1)}static fromUncheckedCanonicalNode(e){return new d(e,!0,!1,!1)}static calculateBlueId(e){return o.BlueIdCalculator.calculateBlueIdSync(e.map(r=>r.toNode()))}toNode(){const e=new o.BlueNode().setName(this.name).setDescription(this.description).setType(this.type?.toNode()).setItemType(this.itemType?.toNode()).setKeyType(this.keyType?.toNode()).setValueType(this.valueType?.toNode()).setReferenceBlueId(this.referenceBlueId).setSchema(this.schema?.clone()).setMergePolicy(this.mergePolicy).setPreviousBlueId(this.previousBlueId).setPosition(this.position).setBlue(this.blue?.toNode()).setInlineValue(this.inlineValue);return this.value!==void 0&&e.setValue(this.value),this.items!==void 0&&e.setItems(this.items.map(r=>r.toNode())),this.properties!==void 0&&e.setProperties(Object.fromEntries(Object.entries(this.properties).map(([r,i])=>[r,i.toNode()]))),this.contracts!==void 0&&e.setContractsNode(this.contracts.toNode()),e}blueId(){return this.blueIdValue}getName(){return this.name}getDescription(){return this.description}getType(){return this.type}getItemType(){return this.itemType}getKeyType(){return this.keyType}getValueType(){return this.valueType}getValue(){return this.value}getItems(){return this.items}getProperties(){return this.properties}getContracts(){return this.contracts}getReferenceBlueId(){return this.referenceBlueId}getSchema(){return this.schema?.clone()}getMergePolicy(){return this.mergePolicy}getPreviousBlueId(){return this.previousBlueId}getPosition(){return this.position}getBlue(){return this.blue}isInlineValue(){return this.inlineValue}property(e){return e===x.OBJECT_CONTRACTS?this.contracts:this.properties?.[e]}item(e){return e>=0?this.items?.[e]:void 0}at(e){const r=typeof e=="string"?this.pointerSegments(e):e.map(String);return d.atSegments(this,r)}static atSegments(e,r){let i=e;for(const n of r){if(i===void 0)return;i.items!==void 0&&n!==x.OBJECT_CONTRACTS?i=i.item(d.parseArrayIndex(n)):i=i.property(n)}return i}pathIndex(){const e=new Map;return this.indexPaths("/",e),e}hasItems(){return this.items!==void 0}hasProperties(){return this.properties!==void 0}isReferenceOnly(){return this.referenceBlueId!==void 0&&this.name===void 0&&this.description===void 0&&this.type===void 0&&this.itemType===void 0&&this.keyType===void 0&&this.valueType===void 0&&(this.value===void 0||this.value===null)&&this.items===void 0&&this.properties===void 0&&this.contracts===void 0&&this.schema===void 0&&this.mergePolicy===void 0&&this.previousBlueId===void 0&&this.position===void 0&&this.blue===void 0}isPreviousOnly(){return this.previousBlueId!==void 0&&this.name===void 0&&this.description===void 0&&this.type===void 0&&this.itemType===void 0&&this.keyType===void 0&&this.valueType===void 0&&(this.value===void 0||this.value===null)&&this.items===void 0&&this.properties===void 0&&this.contracts===void 0&&this.schema===void 0&&this.mergePolicy===void 0&&this.position===void 0&&this.blue===void 0&&this.referenceBlueId===void 0}isStrictCanonical(){return this.strictCanonical}isResolvedStructural(){return this.resolvedStructural}isStrictBlueIdValidation(){return this.strictBlueIdValidation}isListElementContext(){return this.listElementContext}isEmptyNode(){return this.name===void 0&&this.description===void 0&&this.type===void 0&&this.itemType===void 0&&this.keyType===void 0&&this.valueType===void 0&&(this.value===void 0||this.value===null)&&this.items===void 0&&this.properties===void 0&&this.contracts===void 0&&this.referenceBlueId===void 0&&this.schema===void 0&&this.mergePolicy===void 0&&this.previousBlueId===void 0&&this.position===void 0&&this.blue===void 0}withProperty(e,r){const i=this.toNode();if(e===x.OBJECT_CONTRACTS)i.setContractsNode(this.nodeOrUndefined(r));else if(r===void 0)i.removeProperty(e);else{const n=r instanceof d?r.toNode():r.clone();i.addProperty(e,n)}return new d(i,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,this.listElementContext)}withItems(e){const r=this.toNode();return r.setItems(e.map(i=>i instanceof d?i.toNode():i.clone())),new d(r,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,this.listElementContext)}withoutPosition(){if(this.position===void 0)return this;const e=this.toNode();return e.setPosition(void 0),new d(e,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,this.listElementContext)}freezeChild(e,r){return e===void 0?void 0:new d(e,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,r)}freezeItems(e){if(e!==void 0)return Object.freeze(e.map(r=>new d(r,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,!0)))}freezeProperties(e){if(e===void 0)return;const r=Object.entries(e).flatMap(([i,n])=>{if(i===x.OBJECT_CONTRACTS)return[];const a=new d(n,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,!1);return this.strictCanonical&&a.isEmptyNode()?[]:[[i,a]]});return r.length===0?void 0:Object.freeze(Object.fromEntries(r))}validatePayloadShape(){if([this.value!==void 0&&this.value!==null,this.items!==void 0,this.properties!==void 0&&Object.keys(this.properties).length>0].filter(Boolean).length>1)throw new Error("A Blue node may contain only one payload kind: value, items, or object fields.");if(this.strictCanonical&&this.referenceBlueId!==void 0&&!this.isReferenceOnly())throw new Error('"blueId" nodes must be reference-only and cannot contain sibling fields.');if(this.strictCanonical&&this.previousBlueId!==void 0){if(!this.isPreviousOnly())throw new Error('"$previous" list anchors must be single-key list items.');if(!this.listElementContext)throw new Error('"$previous" is valid only as the first list item in direct BlueId input.')}if(this.strictCanonical&&this.blue!==void 0)throw new Error('"blue" is a preprocessing directive and must not appear in canonical BlueId input.');if(this.strictCanonical&&this.position!==void 0)throw new Error('"$pos" overlays are not valid direct BlueId input.')}computeBlueId(){return this.strictCanonical?this.strictBlueIdValidation?o.BlueIdCalculator.calculateBlueIdInputSync(ue.toBlueIdInput(this)):o.BlueIdCalculator.calculateBlueIdSync(this.toNode()):this.isReferenceOnly()?this.referenceBlueId:o.BlueIdCalculator.calculateBlueIdWithResolvedBlueIdMetadataSync(this.toNode())}nodeOrUndefined(e){if(e!==void 0)return e instanceof d?e.toNode():e.clone()}indexPaths(e,r){r.set(e,this),this.items?.forEach((i,n)=>i.indexPaths(this.appendPointer(e,String(n)),r)),Object.entries(this.properties??{}).forEach(([i,n])=>n.indexPaths(this.appendPointer(e,i),r)),this.contracts?.indexPaths(this.appendPointer(e,x.OBJECT_CONTRACTS),r)}pointerSegments(e){return e===""||e==="/"?[]:e.replace(/^\//,"").split("/").filter(r=>r.length>0).map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"))}appendPointer(e,r){const i=r.replace(/~/g,"~0").replace(/\//g,"~1");return e==="/"?`/${i}`:`${e}/${i}`}static parseArrayIndex(e){const r=Number(e);return Number.isInteger(r)&&r>=0?r:-1}}const O="sha256:3387cb4b6626fc56cec91d584b2df7f37c229e396dee990750ac50e762a1bc1d",k=77;class M{constructor(e,r,i,n,a,E,y){this.specVersion=e,this.fixturePackageIdentity=r,this.passedIds=i,this.failed=n,this.identityMatches=a,this.requiredCoverage=E,this.exactFixtureSet=y}fixturePackageIdentityMatchesFixtureFiles(){return this.identityMatches}hasRequiredFixtureCoverage(){return this.requiredCoverage}hasExactRequiredFixtureSet(){return this.exactFixtureSet}passedFixtureIds(){return[...this.passedIds]}failedFixtureIds(){return this.failed.map(e=>e.fixtureId)}failures(){return[...this.failed]}}const _=u.dirname(q.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:B&&B.tagName.toUpperCase()==="SCRIPT"&&B.src||new URL("conformance.js",document.baseURI).href)),ce=ge([u.join(_,"fixtures/blue-language-1.0"),u.join(_,"lib/conformance/fixtures/blue-language-1.0"),u.resolve(process.cwd(),"libs/language/src/lib/conformance/fixtures/blue-language-1.0")]),S=u.join(ce,"fixtures"),le=u.join(S,"manifest.yaml");function K(){return he()===O}function J(){return C().length===k}function z(){const t=new Set(C().map(r=>r.path)),e=pe(S).filter(r=>r!=="manifest.yaml");return e.length===t.size&&e.every(r=>t.has(r))}function C(){const t=de();if(!Array.isArray(t.fixtures))throw new Error('Fixture manifest field "fixtures" must be a list.');return t.fixtures.map(e=>{if(!R(e))throw new Error("Fixture manifest entries must be objects.");const r=H(b(e,"path"));return{id:b(e,"id"),category:b(e,"category"),path:b(e,"path"),operation:R(r)?ye(r,"operation"):void 0}})}function de(){return H("manifest.yaml")}function H(t){const e=ae.load(f.readFileSync(u.join(S,t),"utf8"));if(!R(e))throw new Error(`Fixture ${t} must be an object.`);return e}function he(){const t=C(),e=oe.createHash("sha256");e.update(`manifest.yaml
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("node:fs"),u=require("node:path"),oe=require("node:crypto"),q=require("node:url"),ae=require("js-yaml"),N=require("node:assert/strict"),o=require("./Blue-BwbQa9VQ.js");require("big.js");const x=require("@blue-labs/repository-contract");var B=typeof document<"u"?document.currentScript:null;class ue{static toBlueIdInput(e){return e.isListElementContext()?o.NodeToBlueIdInput.getListElement(e.toNode(),0):o.NodeToBlueIdInput.get(e.toNode())}}class d{constructor(e,r=!1,i=!1,n=!0,a=!1){this.strictCanonical=r,this.resolvedStructural=i,this.strictBlueIdValidation=n,this.listElementContext=a,this.name=e.getName(),this.description=e.getDescription(),this.type=this.freezeChild(e.getType(),!1),this.itemType=this.freezeChild(e.getItemType(),!1),this.keyType=this.freezeChild(e.getKeyType(),!1),this.valueType=this.freezeChild(e.getValueType(),!1),this.value=e.getValue(),this.items=this.freezeItems(e.getItems()),this.properties=this.freezeProperties(e.getProperties()),this.contracts=this.freezeChild(e.getContractsNode(),!1),this.referenceBlueId=e.getReferenceBlueId(),this.schema=e.getSchema()?.clone(),this.mergePolicy=e.getMergePolicy(),this.previousBlueId=e.getPreviousBlueId(),this.position=e.getPosition(),this.blue=this.freezeChild(e.getBlue(),!1),this.inlineValue=e.isInlineValue(),this.validatePayloadShape(),this.blueIdValue=this.computeBlueId()}name;description;type;itemType;keyType;valueType;value;items;properties;contracts;referenceBlueId;schema;mergePolicy;previousBlueId;position;blue;inlineValue;blueIdValue;static empty(){return new d(new o.BlueNode,!0,!1)}static fromNode(e){return new d(e,!0,!1)}static fromResolvedNode(e){return new d(e,!1,!0,!1)}static fromUncheckedCanonicalNode(e){return new d(e,!0,!1,!1)}static calculateBlueId(e){return o.BlueIdCalculator.calculateBlueIdSync(e.map(r=>r.toNode()))}toNode(){const e=new o.BlueNode().setName(this.name).setDescription(this.description).setType(this.type?.toNode()).setItemType(this.itemType?.toNode()).setKeyType(this.keyType?.toNode()).setValueType(this.valueType?.toNode()).setReferenceBlueId(this.referenceBlueId).setSchema(this.schema?.clone()).setMergePolicy(this.mergePolicy).setPreviousBlueId(this.previousBlueId).setPosition(this.position).setBlue(this.blue?.toNode()).setInlineValue(this.inlineValue);return this.value!==void 0&&e.setValue(this.value),this.items!==void 0&&e.setItems(this.items.map(r=>r.toNode())),this.properties!==void 0&&e.setProperties(Object.fromEntries(Object.entries(this.properties).map(([r,i])=>[r,i.toNode()]))),this.contracts!==void 0&&e.setContractsNode(this.contracts.toNode()),e}blueId(){return this.blueIdValue}getName(){return this.name}getDescription(){return this.description}getType(){return this.type}getItemType(){return this.itemType}getKeyType(){return this.keyType}getValueType(){return this.valueType}getValue(){return this.value}getItems(){return this.items}getProperties(){return this.properties}getContracts(){return this.contracts}getReferenceBlueId(){return this.referenceBlueId}getSchema(){return this.schema?.clone()}getMergePolicy(){return this.mergePolicy}getPreviousBlueId(){return this.previousBlueId}getPosition(){return this.position}getBlue(){return this.blue}isInlineValue(){return this.inlineValue}property(e){return e===x.OBJECT_CONTRACTS?this.contracts:this.properties?.[e]}item(e){return e>=0?this.items?.[e]:void 0}at(e){const r=typeof e=="string"?this.pointerSegments(e):e.map(String);return d.atSegments(this,r)}static atSegments(e,r){let i=e;for(const n of r){if(i===void 0)return;i.items!==void 0&&n!==x.OBJECT_CONTRACTS?i=i.item(d.parseArrayIndex(n)):i=i.property(n)}return i}pathIndex(){const e=new Map;return this.indexPaths("/",e),e}hasItems(){return this.items!==void 0}hasProperties(){return this.properties!==void 0}isReferenceOnly(){return this.referenceBlueId!==void 0&&this.name===void 0&&this.description===void 0&&this.type===void 0&&this.itemType===void 0&&this.keyType===void 0&&this.valueType===void 0&&(this.value===void 0||this.value===null)&&this.items===void 0&&this.properties===void 0&&this.contracts===void 0&&this.schema===void 0&&this.mergePolicy===void 0&&this.previousBlueId===void 0&&this.position===void 0&&this.blue===void 0}isPreviousOnly(){return this.previousBlueId!==void 0&&this.name===void 0&&this.description===void 0&&this.type===void 0&&this.itemType===void 0&&this.keyType===void 0&&this.valueType===void 0&&(this.value===void 0||this.value===null)&&this.items===void 0&&this.properties===void 0&&this.contracts===void 0&&this.schema===void 0&&this.mergePolicy===void 0&&this.position===void 0&&this.blue===void 0&&this.referenceBlueId===void 0}isStrictCanonical(){return this.strictCanonical}isResolvedStructural(){return this.resolvedStructural}isStrictBlueIdValidation(){return this.strictBlueIdValidation}isListElementContext(){return this.listElementContext}isEmptyNode(){return this.name===void 0&&this.description===void 0&&this.type===void 0&&this.itemType===void 0&&this.keyType===void 0&&this.valueType===void 0&&(this.value===void 0||this.value===null)&&this.items===void 0&&this.properties===void 0&&this.contracts===void 0&&this.referenceBlueId===void 0&&this.schema===void 0&&this.mergePolicy===void 0&&this.previousBlueId===void 0&&this.position===void 0&&this.blue===void 0}withProperty(e,r){const i=this.toNode();if(e===x.OBJECT_CONTRACTS)i.setContractsNode(this.nodeOrUndefined(r));else if(r===void 0)i.removeProperty(e);else{const n=r instanceof d?r.toNode():r.clone();i.addProperty(e,n)}return new d(i,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,this.listElementContext)}withItems(e){const r=this.toNode();return r.setItems(e.map(i=>i instanceof d?i.toNode():i.clone())),new d(r,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,this.listElementContext)}withoutPosition(){if(this.position===void 0)return this;const e=this.toNode();return e.setPosition(void 0),new d(e,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,this.listElementContext)}freezeChild(e,r){return e===void 0?void 0:new d(e,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,r)}freezeItems(e){if(e!==void 0)return Object.freeze(e.map(r=>new d(r,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,!0)))}freezeProperties(e){if(e===void 0)return;const r=Object.entries(e).flatMap(([i,n])=>{if(i===x.OBJECT_CONTRACTS)return[];const a=new d(n,this.strictCanonical,this.resolvedStructural,this.strictBlueIdValidation,!1);return this.strictCanonical&&a.isEmptyNode()?[]:[[i,a]]});return r.length===0?void 0:Object.freeze(Object.fromEntries(r))}validatePayloadShape(){if([this.value!==void 0&&this.value!==null,this.items!==void 0,this.properties!==void 0&&Object.keys(this.properties).length>0].filter(Boolean).length>1)throw new Error("A Blue node may contain only one payload kind: value, items, or object fields.");if(this.strictCanonical&&this.referenceBlueId!==void 0&&!this.isReferenceOnly())throw new Error('"blueId" nodes must be reference-only and cannot contain sibling fields.');if(this.strictCanonical&&this.previousBlueId!==void 0){if(!this.isPreviousOnly())throw new Error('"$previous" list anchors must be single-key list items.');if(!this.listElementContext)throw new Error('"$previous" is valid only as the first list item in direct BlueId input.')}if(this.strictCanonical&&this.blue!==void 0)throw new Error('"blue" is a preprocessing directive and must not appear in canonical BlueId input.');if(this.strictCanonical&&this.position!==void 0)throw new Error('"$pos" overlays are not valid direct BlueId input.')}computeBlueId(){return this.strictCanonical?this.strictBlueIdValidation?o.BlueIdCalculator.calculateBlueIdInputSync(ue.toBlueIdInput(this)):o.BlueIdCalculator.calculateBlueIdSync(this.toNode()):this.isReferenceOnly()?this.referenceBlueId:o.BlueIdCalculator.calculateBlueIdWithResolvedBlueIdMetadataSync(this.toNode())}nodeOrUndefined(e){if(e!==void 0)return e instanceof d?e.toNode():e.clone()}indexPaths(e,r){r.set(e,this),this.items?.forEach((i,n)=>i.indexPaths(this.appendPointer(e,String(n)),r)),Object.entries(this.properties??{}).forEach(([i,n])=>n.indexPaths(this.appendPointer(e,i),r)),this.contracts?.indexPaths(this.appendPointer(e,x.OBJECT_CONTRACTS),r)}pointerSegments(e){return e===""||e==="/"?[]:e.replace(/^\//,"").split("/").filter(r=>r.length>0).map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"))}appendPointer(e,r){const i=r.replace(/~/g,"~0").replace(/\//g,"~1");return e==="/"?`/${i}`:`${e}/${i}`}static parseArrayIndex(e){const r=Number(e);return Number.isInteger(r)&&r>=0?r:-1}}const O="sha256:3387cb4b6626fc56cec91d584b2df7f37c229e396dee990750ac50e762a1bc1d",k=77;class M{constructor(e,r,i,n,a,E,y){this.specVersion=e,this.fixturePackageIdentity=r,this.passedIds=i,this.failed=n,this.identityMatches=a,this.requiredCoverage=E,this.exactFixtureSet=y}fixturePackageIdentityMatchesFixtureFiles(){return this.identityMatches}hasRequiredFixtureCoverage(){return this.requiredCoverage}hasExactRequiredFixtureSet(){return this.exactFixtureSet}passedFixtureIds(){return[...this.passedIds]}failedFixtureIds(){return this.failed.map(e=>e.fixtureId)}failures(){return[...this.failed]}}const _=u.dirname(q.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:B&&B.tagName.toUpperCase()==="SCRIPT"&&B.src||new URL("conformance.js",document.baseURI).href)),ce=ge([u.join(_,"fixtures/blue-language-1.0"),u.join(_,"lib/conformance/fixtures/blue-language-1.0"),u.resolve(process.cwd(),"libs/language/src/lib/conformance/fixtures/blue-language-1.0")]),S=u.join(ce,"fixtures"),le=u.join(S,"manifest.yaml");function K(){return he()===O}function J(){return C().length===k}function z(){const t=new Set(C().map(r=>r.path)),e=pe(S).filter(r=>r!=="manifest.yaml");return e.length===t.size&&e.every(r=>t.has(r))}function C(){const t=de();if(!Array.isArray(t.fixtures))throw new Error('Fixture manifest field "fixtures" must be a list.');return t.fixtures.map(e=>{if(!R(e))throw new Error("Fixture manifest entries must be objects.");const r=H(b(e,"path"));return{id:b(e,"id"),category:b(e,"category"),path:b(e,"path"),operation:R(r)?ye(r,"operation"):void 0}})}function de(){return H("manifest.yaml")}function H(t){const e=ae.load(f.readFileSync(u.join(S,t),"utf8"));if(!R(e))throw new Error(`Fixture ${t} must be an object.`);return e}function he(){const t=C(),e=oe.createHash("sha256");e.update(`manifest.yaml
|
|
2
2
|
`,"utf8"),e.update(fe(f.readFileSync(le,"utf8")),"utf8");for(const r of t)e.update(`
|
|
3
3
|
--- ${r.path}
|
|
4
4
|
`,"utf8"),e.update(G(f.readFileSync(u.join(S,r.path),"utf8")),"utf8");return`sha256:${e.digest("hex")}`}function fe(t){const e=G(t);if(!/^fixturePackageIdentity:.*$/m.test(e))throw new Error("Manifest is missing fixturePackageIdentity line.");return e.replace(/^fixturePackageIdentity:.*$/m,'fixturePackageIdentity: ""')}function G(t){return t.replace(/\r\n/g,`
|
package/dist/conformance.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { createHash as re } from "node:crypto";
|
|
|
4
4
|
import { fileURLToPath as _ } from "node:url";
|
|
5
5
|
import se from "js-yaml";
|
|
6
6
|
import O from "node:assert/strict";
|
|
7
|
-
import { am as v, c as P, p as C, q as ne, an as y, ao as L, ap as oe, aq as ae, ar as ce, y as le, s as ue, C as de, g as D, as as he, N as fe, at as pe, l as ye, au as ge, av as me } from "./Blue-
|
|
7
|
+
import { am as v, c as P, p as C, q as ne, an as y, ao as L, ap as oe, aq as ae, ar as ce, y as le, s as ue, C as de, g as D, as as he, N as fe, at as pe, l as ye, au as ge, av as me } from "./Blue-Cnkas-g6.mjs";
|
|
8
8
|
import "big.js";
|
|
9
9
|
import { OBJECT_CONTRACTS as x } from "@blue-labs/repository-contract";
|
|
10
10
|
class Ie {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("big.js");const s=require("./Blue-CTQkRrnu.js"),w=require("bs58"),c=require("@blue-labs/shared-utils"),F=require("base32.js"),B=require("@blue-labs/repository-contract");require("js-sha256");const I=require("radash");require("zod");require("js-yaml");const z=e=>e&&e.__esModule?e:{default:e},J=z(w),U=e=>s.blueObjectSchema.safeParse(e).success,D=e=>c.isNonNullable(e)&&"blueId"in e&&c.isNonNullable(e.blueId),q=e=>c.isNonNullable(e)&&"name"in e&&c.isNonNullable(e.name),j=e=>c.isNonNullable(e)&&"items"in e&&c.isNonNullable(e.items),C=e=>c.isNonNullable(e)&&"type"in e&&c.isNonNullable(e.type),V=e=>c.isNonNullable(e)&&"value"in e&&c.isNonNullable(e.value),W=(e,t)=>e.required({type:!0}).safeParse(t).success;class x{static convert(t){const r=J.default.decode(t),i=new Uint8Array(2+r.length);i[0]=18,i[1]=32,i.set(r,2);const n=new Uint8Array(2+i.length);return n[0]=1,n[1]=85,n.set(i,2),"b"+new F.Encoder({type:"rfc4648",lc:!0}).write(n).finalize().replace(/=/g,"")}}const f=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof s.BlueNode),d=e=>e instanceof s.BigIntegerNumber||e instanceof s.BigDecimalNumber,Y=e=>e.replace(/~1/g,"/").replace(/~0/g,"~");function h(e){if(e==="/")return[];if(!e.startsWith("/"))throw new Error(`Path must start with '/': ${e}`);return e.split("/").slice(1).map(Y)}function g(e){if(e==="-")return-1;const t=typeof e=="number"?e:parseInt(e,10);if(isNaN(t))throw new Error(`Invalid array index (NaN) from '${e}'`);if(!Number.isFinite(t))throw new Error(`Invalid array index '${e}' results in non-finite number ${t}`);return t}function M(e,t,r,i=!0){switch(t){case"name":return r?i?e.getName()??null:e:e.getName();case"description":return r?i?e.getDescription():e:e.getDescription();case"type":return e.getType();case"itemType":return e.getItemType();case"keyType":return e.getKeyType();case"valueType":return e.getValueType();case"value":return r?i?e.getValue()??null:e:e.getValue();case"blueId":return r?i?e.getBlueId()??null:e:e.getBlueId();case"blue":return e.getBlue();case"items":return e.getItems();case"properties":return e.getProperties();case B.OBJECT_CONTRACTS:return e.getContracts();default:return}}function E(e,t,r=!0){if(e instanceof s.BlueNode){const i=M(e,t,!0,r);if(i!==void 0||["name","description","type","itemType","keyType","valueType","value","blueId","blue","items","properties",B.OBJECT_CONTRACTS].includes(t))return i;if(/^-?\d+$/.test(t)&&t!=="-"){const o=e.getItems(),l=parseInt(t,10);return o&&l>=0&&l<o.length?o[l]:void 0}const n=e.getProperties();return n&&t in n?n[t]:void 0}if(Array.isArray(e)){if(t==="-")return;const i=g(t);return i>=0&&i<e.length?e[i]:void 0}if(f(e))return e[t]}function p(e,t){if(t.length===0)return{parent:e,key:"value",actualTarget:e.getValue()??e};let r=e;for(let n=0;n<t.length-1;++n){const o=t[n],l=E(r,o);if(l===void 0)throw new Error(`Cannot resolve '/${t.slice(0,n+1).join("/")}'`);r=l}const i=t[t.length-1];if(r instanceof s.BlueNode){const n=E(r,i,!1);if((typeof n!="object"||n===null||d(n))&&!(n instanceof s.BlueNode)&&!Array.isArray(n)&&["name","description","value","blueId"].includes(i))return{parent:r,key:i,actualTarget:n}}return Array.isArray(r)&&i==="-"?{parent:r,key:"-"}:r instanceof s.BlueNode&&r.getItems()&&i==="-"?{parent:r,key:"-"}:{parent:r,key:Array.isArray(r)?g(i):i}}function P(e,t){if(e instanceof s.BlueNode){const r=t,i=M(e,r,!1);if(i!==void 0||["name","description","type","itemType","keyType","valueType","value","blueId","blue","items","properties",B.OBJECT_CONTRACTS].includes(r))return i;if(typeof t=="number"||typeof t=="string"&&/^\d+$/.test(t)){const n=e.getItems(),o=typeof t=="number"?t:parseInt(t,10);if(n&&o>=0&&o<n.length)return n[o]}return e.getProperties()?.[r]}return Array.isArray(e)||f(e)?e[t]:e}function a(e){if(e instanceof s.BlueNode)return e;if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||d(e))return s.NodeDeserializer.deserializeUnchecked(e);const t=b(e);return s.NodeDeserializer.deserializeUnchecked(t)}function b(e){if(e===void 0)return null;if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(b);const t={};for(const[r,i]of Object.entries(e))t[r]=b(i);return t}function A(e,t,r){if(e instanceof s.BlueNode){const i=t;switch(i){case"name":e.setName(r);return;case"description":e.setDescription(r);return;case"type":e.setType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"itemType":e.setItemType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"keyType":e.setKeyType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"valueType":e.setValueType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"value":{const n=r;e.setValue(n===void 0?null:n);return}case"blueId":e.setBlueId(r);return;case"blue":e.setBlue(r instanceof s.BlueNode||r===void 0?r:a(r));return;case"items":e.setItems(r);return;case"properties":e.setProperties(r);return;case B.OBJECT_CONTRACTS:e.setContracts(r);return;default:{if(r===void 0){const n=e.getProperties();n&&i in n&&delete n[i]}else e.getProperties()||e.setProperties({}),e.addProperty(i,r instanceof s.BlueNode?r:a(r));return}}}Array.isArray(e)?e.splice(g(t),1):f(e)&&(r===void 0?delete e[t]:e[t]=r)}function K(e,t,r,i){let n=-1;if(t!=="-"&&(n=typeof t=="number"?t:parseInt(t,10),isNaN(n)))throw new Error(`Invalid numeric key for BlueNode item operation: ${t}`);if(n<-1)throw new Error(`Invalid array index for BlueNode items: ${n}`);let o=e.getItems();if(o||(o=[],e.setItems(o)),!i&&n!==-1&&n>o.length)throw new Error(`ADD operation failed: Target array index '${n}' is greater than array length ${o.length}.`);if(t==="-")o.push(r);else if(i){if(n>=0)if(n<o.length)o[n]=r;else{for(let l=o.length;l<n;l++)o.push(s.NodeDeserializer.deserialize(null));o.push(r)}}else o.splice(n,0,r)}function y(e,t,r,i){if(Array.isArray(e)){const n=t==="-"?e.length:g(t);if(!i&&n>e.length)throw new Error(`ADD operation failed: Target array index '${n}' is greater than array length ${e.length}. Path involving key '${t}'.`);if(n<0&&t!=="-")throw new Error(`Invalid negative array index: ${t}`);const o=a(r);if(i){if(n>=0&&n<e.length)e[n]=o;else if(n>=e.length){for(let l=e.length;l<n;l++)e.push(s.NodeDeserializer.deserialize(null));e.push(o)}}else e.splice(n,0,o);return}if(e instanceof s.BlueNode){t==="-"||typeof t=="number"&&!isNaN(t)||typeof t=="string"&&/^\d+$/.test(t)?K(e,t,a(r),i):A(e,t,r);return}if(f(e)){e[t]=a(r);return}throw new Error(`Cannot insert into parent of type ${typeof e}`)}function H(e,t){if(Array.isArray(e)){const r=g(t);r===-1&&t==="-"?e.length>0&&e.pop():r>=0&&r<e.length&&e.splice(r,1);return}if(e instanceof s.BlueNode){if(typeof t=="number"||typeof t=="string"&&/^-?\d+$/.test(t)){const r=e.getItems();if(r){const i=g(t);i===-1&&t==="-"?r.length>0&&r.pop():i>=0&&i<r.length&&r.splice(i,1),r.length===0&&e.setItems(void 0);return}}A(e,t,void 0)}else f(e)&&delete e[t]}function S(e){if(e instanceof s.BlueNode)return e.clone();if(Array.isArray(e))return e.map(r=>S(r));if(f(e)){const t={};return Object.keys(e).forEach(r=>{t[r]=S(e[r])}),t}return e}function m(e,t){if(e===t||e instanceof s.BlueNode&&(e.isInlineValue()||e.getValue()!==void 0)&&m(e.getValue()??null,t)||t instanceof s.BlueNode&&(t.isInlineValue()||t.getValue()!==void 0)&&m(e,t.getValue()??null))return!0;if(e instanceof s.BlueNode&&t instanceof s.BlueNode||d(e)&&d(t)||d(e)&&typeof t=="number"||typeof e=="number"&&d(t))return e.toString()===t.toString();if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,i)=>m(r,t[i]));if(f(e)&&f(t)){const r=Object.keys(e),i=Object.keys(t);return r.length===i.length&&r.every(n=>m(e[n],t[n]))}return!1}function L(e,t){const{parent:r,key:i}=p(e,h(t));return P(r,i)}function _(e,t,r){const i=h(t);if(i.length===0&&t==="/"){const l=a(r);e.setValue(l.getValue()??null),l.getItems()?e.setItems(l.getItems()):e.setItems(void 0);return}const{parent:n,key:o}=p(e,i);y(n,o,r,!0)}function G(e,t,r){const i=h(t);if(i.length===0&&t==="/"){if(e.getItems()&&Array.isArray(r)){const l=a(r);l.getItems()?(e.setItems(l.getItems()),e.setValue(null)):(e.setValue(l.getValue()??null),e.setItems(void 0))}else{const l=a(r);e.setValue(l.getValue()??null),l.getItems()&&e.setItems(l.getItems())}return!0}const{parent:n,key:o}=p(e,i);return y(n,o,r,!1),!0}function Q(e,t,r){const i=h(t);if(i.length===0&&t==="/"){const u=a(r);return e.setValue(u.getValue()??null),u.getItems()?e.setItems(u.getItems()):e.setItems(void 0),!0}const{parent:n,key:o,actualTarget:l}=p(e,i);if(l!==void 0&&n instanceof s.BlueNode)A(n,o,r);else{const u=P(n,o),N=Array.isArray(n)||n instanceof s.BlueNode&&n.getItems()&&(typeof o=="number"||typeof o=="string"&&/^\d+$/.test(o));if(u===void 0){if(N)throw new Error(`REPLACE failed: Target array index '${o.toString()}' is out of bounds or does not exist at path '${t}'.`);y(n,o,r,!0)}else y(n,o,r,!0)}return!0}function $(e,t){const r=h(t);if(r.length===0&&t==="/")return e.setValue(null),e.setItems(void 0),e.setProperties(void 0),!0;const{parent:i,key:n}=p(e,r);return H(i,n),!0}function X(e,t,r){const i=S(L(e,t));return _(e,r,i),!0}function Z(e,t,r){const i=h(t),{parent:n,key:o}=p(e,i),l=P(n,o);if(l===void 0)throw new Error(`MOVE failed: 'from' location '${t}' does not exist.`);return $(e,t)?(_(e,r,l),!0):!1}function k(e,t,r){const i=L(e,t);let n=r;if(i instanceof s.BlueNode)if((r===null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"||d(r))&&(i.isInlineValue()||i.getValue()!==void 0)){if(!m(i.getValue()??null,r))throw new Error(`TEST failed at '${t}': Expected ${JSON.stringify(r)}, got ${JSON.stringify(i.getValue()??null)}`);return!0}else typeof r=="object"&&!(r instanceof s.BlueNode)&&(n=a(r));else if(d(i)&&typeof r=="number")i instanceof s.BigIntegerNumber?n=new s.BigIntegerNumber(r.toString()):i instanceof s.BigDecimalNumber&&(n=new s.BigDecimalNumber(r.toString()));else if((i===null||typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&d(r)){const o=r;!m(i,o.toString())&&(typeof i=="number"&&parseFloat(o.toString()))}if(!m(i,n)){const o=i instanceof s.BlueNode?i.toString():JSON.stringify(i),l=n instanceof s.BlueNode?n.toString():JSON.stringify(n);throw new Error(`TEST failed at '${t}': Expected ${l}, got ${o}`)}return!0}function ee(e,t){switch(t.op){case"add":return G(e,t.path,t.val);case"replace":return Q(e,t.path,t.val);case"remove":return $(e,t.path);case"copy":return X(e,t.from,t.path);case"move":return Z(e,t.from,t.path);case"test":return k(e,t.path,t.val)}}function te(e,t,r=!1){const i=r?e:e.clone();return ee(i,t),i}const re=Object.freeze(Object.defineProperty({__proto__:null,BasicTypesVerifier:s.BasicTypesVerifier,DictionaryProcessor:s.DictionaryProcessor,ListProcessor:s.ListProcessor,MetadataPropagator:s.MetadataPropagator,SchemaPropagator:s.SchemaPropagator,SchemaVerifier:s.SchemaVerifier,SequentialMergingProcessor:s.SequentialMergingProcessor,TypeAssigner:s.TypeAssigner,ValuePropagator:s.ValuePropagator},Symbol.toStringTag,{value:"Module"}));class ie{semanticIdentity;cyclicSetIdentity;constructor(t={}){const r=t.nodeProvider??s.createNodeProvider(()=>[]),i=t.mergingProcessor??s.createDefaultMergingProcessor();this.semanticIdentity=new s.SemanticIdentityService({nodeProvider:r,mergingProcessor:i}),this.cyclicSetIdentity=this.semanticIdentity.createCyclicSetIdentityService()}prepareStorageNode(t,r){const i=this.preprocessForStorage(t,r);if(this.hasThisReference(i))throw new Error("Self-references using this or this#k are not supported in single-document provider storage ingest.");return this.preparePreprocessedStorageNode(i)}prepareStorageNodeList(t,r){if(t.length===0)throw new Error("List of nodes cannot be null or empty");const i=t.map(l=>this.preprocessForStorage(l,r));if(s.CyclicSetIdentityService.hasThisReference(i)){const l=this.cyclicSetIdentity.calculate(i);return l.nodes.forEach(u=>s.StorageShapeValidator.validateStorageShape(u)),{blueId:l.blueId,nodes:l.nodes,documentBlueIds:l.documentBlueIds,isCyclicSet:!0}}const n=i.map(l=>this.preparePreprocessedStorageNode(l).node);return{blueId:this.semanticIdentity.hashMinimalTrusted(n),nodes:n}}preprocessForStorage(t,r){s.StorageShapeValidator.validateStorageShape(t);const i=r(t);return s.StorageShapeValidator.validateStorageShape(i),i}preparePreprocessedStorageNode(t){const r=this.prepareSemanticStorage(t);return s.StorageShapeValidator.validateStorageShape(r.node),r}prepareSemanticStorage(t){const r=this.semanticIdentity.minimizeAuthoring(t);return{blueId:this.semanticIdentity.hashMinimalTrusted(r),node:r}}hasThisReference(t){const r=t.getReferenceBlueId();return r!==void 0&&(r==="this"||r.startsWith("this#"))?!0:[t.getType(),t.getItemType(),t.getKeyType(),t.getValueType(),t.getBlue(),...t.getItems()??[],...Object.values(t.getProperties()??{})].some(n=>n!==void 0&&this.hasThisReference(n))}}const T=async e=>{if(D(e))return e;try{const t=s.jsonBlueValueSchema.parse(e),{Blue:r}=await Promise.resolve().then(()=>require("./Blue-CTQkRrnu.js")).then(n=>n.Blue$1),i=await new r().calculateBlueId(t);return{...e,blueId:i}}catch(t){throw new Error(`Failed enriching object with Blue ID: ${t}`)}},se=e=>e?.items,ne=e=>e?.value,oe=e=>c.isNullable(e)?{}:I.omit(e,s.OBJECT_SPECIFIC_KEYS),le=e=>C(e)?e.type.name??null:V(e)?I.pascal(typeof e.value):j(e)?"List":null,R=e=>c.isNonNullable(e)&&Object.keys(I.omit(e,["blueId"])).length>0,ue=e=>{try{const t=s.NodeDeserializer.deserialize(e),r=s.NodeToMapListOrValue.get(t);return s.blueObjectSchema.parse(r)}catch(t){throw new Error(`Failed transforming JSON-like value to BlueObject: ${t}`)}},v=async e=>{const{resolveFunction:t,signal:r=new AbortController().signal,omitItems:i}=e,n=e.count??e.items.length;let o=await I.map(e.items,async u=>await T(u));const l=Math.max(o?.length-n,0);for(let u=o.length-1;u>=l;u--)if(!R(o[u])){const N=await t(o[u],{signal:r});if(Array.isArray(N))return v({...e,items:[...o.slice(0,u),...N,...o.slice(u+1)]});const O=await T(N);if(i?.includes(O.blueId))return v({...e,items:[...o.slice(0,u),...o.slice(u+1)]});o=[...o.slice(0,u),O,...o.slice(u+1)]}return o};class ae extends s.PreloadedNodeProvider{blueIdToContentMap=new Map;blueIdToMultipleDocumentsMap=new Map;preprocessor;storageService;constructor(t=[]){super();const r=new s.Preprocessor({nodeProvider:this});this.preprocessor=i=>r.preprocessWithDefaultBlue(i),this.storageService=new ie({nodeProvider:this}),t.forEach(i=>this.processNode(i))}processNode(t){s.Nodes.hasItemsOnly(t)?this.processNodeWithItems(t):this.processSingleNode(t)}processSingleNode(t){const r=s.NodeContentHandler.parseAndCalculateBlueIdForNode(t,this.preprocessor,this.storageService);this.blueIdToContentMap.set(r.blueId,r.content),this.blueIdToMultipleDocumentsMap.set(r.blueId,r.isMultipleDocuments);const i=t.getName();i&&this.addToNameMap(i,r.blueId)}processNodeWithItems(t){const r=t.getItems();if(!r)return;const i=this.storeNodeList(r);this.addListItemNames(i.blueId,i.content)}processNodeList(t){this.storeNodeList(t)}storeNodeList(t){const r=s.NodeContentHandler.parseAndCalculateBlueIdForNodeList(t,this.preprocessor,this.storageService);return this.blueIdToContentMap.set(r.blueId,r.content),this.blueIdToMultipleDocumentsMap.set(r.blueId,!0),r}fetchContentByBlueId(t){const r=this.blueIdToContentMap.get(t),i=this.blueIdToMultipleDocumentsMap.get(t);return r!==void 0&&i!==void 0?s.NodeContentHandler.resolveThisReferences(r,t,i):null}addSingleNodes(...t){t.forEach(r=>this.processNode(r))}addSingleDocs(...t){t.forEach(r=>{const i=s.yamlBlueParse(r);if(i!==void 0){const n=s.NodeDeserializer.deserialize(i);this.processNode(n)}})}getBlueIdByName(t){const r=this.nameToBlueIdsMap.get(t);if(!r||r.length===0)throw new Error(`No node with name "${t}"`);return r[0]}getNodeByName(t){const r=this.findNodeByName(t);if(!r)throw new Error(`No node with name "${t}"`);return r}addListAndItsItemsFromNodes(t){const r=this.storeNodeList(t);if(s.CyclicSetIdentityService.hasThisReference(t)){this.addListItemNames(r.blueId,r.content);return}t.forEach(i=>this.processNode(i))}addListAndItsItemsFromDoc(t){const r=s.yamlBlueParse(t);if(r!==void 0){const n=s.NodeDeserializer.deserialize(r).getItems();n&&this.addListAndItsItems(n)}}addListAndItsItems(t){Array.isArray(t)?this.addListAndItsItemsFromNodes(t):this.addListAndItsItemsFromDoc(t)}addList(t){this.processNodeList(t)}addListItemNames(t,r){Array.isArray(r)&&r.forEach((i,n)=>{const l=s.NodeDeserializer.deserialize(i).getName();l&&this.addToNameMap(l,`${t}#${n}`)})}}exports.BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID=s.BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID;exports.BUILTIN_RUNTIME_TYPE_NAME_TO_BLUE_ID_MAP=s.BUILTIN_RUNTIME_TYPE_NAME_TO_BLUE_ID_MAP;exports.Base58Sha256Provider=s.Base58Sha256Provider;exports.Blue=s.Blue;exports.BlueIdCalculator=s.BlueIdCalculator;exports.BlueNode=s.BlueNode;exports.BlueNodeTypeSchema=s.BlueNodeTypeSchema;exports.JsonCanonicalizer=s.JsonCanonicalizer;exports.Limits=s.Limits;exports.Merger=s.Merger;exports.NodeProviderWrapper=s.NodeProviderWrapper;exports.NodeResolver=s.NodeResolver;exports.NodeToMapListOrValue=s.NodeToMapListOrValue;exports.NodeToObjectConverter=s.NodeToObjectConverter;exports.Nodes=s.Nodes;exports.PathLimits=s.PathLimits;exports.PathLimitsBuilder=s.PathLimitsBuilder;exports.Properties=s.Properties;exports.ResolvedBlueNode=s.ResolvedBlueNode;exports.SCHEMA_FIELDS=s.SCHEMA_FIELDS;exports.Schema=s.Schema;exports.SemanticIdentityService=s.SemanticIdentityService;exports.TypeSchemaResolver=s.TypeSchemaResolver;exports.baseBlueObjectSchema=s.baseBlueObjectSchema;exports.blueDescriptionField=s.blueDescriptionField;exports.blueIdField=s.blueIdField;exports.blueIdSchema=s.blueIdSchema;exports.blueNameField=s.blueNameField;exports.blueNodeField=s.blueNodeField;exports.blueObjectBooleanValueSchema=s.blueObjectBooleanValueSchema;exports.blueObjectNumberValueSchema=s.blueObjectNumberValueSchema;exports.blueObjectSchema=s.blueObjectSchema;exports.blueObjectStringListItemsSchema=s.blueObjectStringListItemsSchema;exports.blueObjectStringValueSchema=s.blueObjectStringValueSchema;exports.canonicalizeRepositoryContent=s.canonicalizeRepositoryContent;exports.createNodeProvider=s.createNodeProvider;exports.getBlueDescriptionAnnotation=s.getBlueDescriptionAnnotation;exports.getBlueIdAnnotation=s.getBlueIdAnnotation;exports.getBlueNameAnnotation=s.getBlueNameAnnotation;exports.getBlueNodeAnnotation=s.getBlueNodeAnnotation;exports.getTypeBlueIdAnnotation=s.getTypeBlueIdAnnotation;exports.isBigDecimalNumber=s.isBigDecimalNumber;exports.isBigIntegerNumber=s.isBigIntegerNumber;exports.isBigNumber=s.isBigNumber;exports.isBlueNodeSchema=s.isBlueNodeSchema;exports.isJsonBlueArray=s.isJsonBlueArray;exports.isJsonBlueObject=s.isJsonBlueObject;exports.isJsonBlueValue=s.isJsonBlueValue;exports.isUrl=s.isUrl;exports.jsonBlueValueSchema=s.jsonBlueValueSchema;exports.withBlueDescription=s.withBlueDescription;exports.withBlueId=s.withBlueId;exports.withBlueName=s.withBlueName;exports.withBlueNode=s.withBlueNode;exports.withTypeBlueId=s.withTypeBlueId;exports.yamlBlueDump=s.yamlBlueDump;exports.yamlBlueParse=s.yamlBlueParse;exports.BasicNodeProvider=ae;exports.BlueIdToCid=x;exports.MergingProcessors=re;exports.applyBlueNodePatch=te;exports.enrichWithBlueId=T;exports.getBlueObjectItems=se;exports.getBlueObjectProperties=oe;exports.getBlueObjectTypeLabel=le;exports.getBlueObjectValue=ne;exports.hasBlueObjectBlueIdDefined=D;exports.hasBlueObjectItemsDefined=j;exports.hasBlueObjectNameDefined=q;exports.hasBlueObjectTypeDefined=C;exports.hasBlueObjectValueDefined=V;exports.isBlueObject=U;exports.isBlueObjectResolved=R;exports.isGivenBlueObjectTypeSchema=W;exports.normalizeToBlueObject=ue;exports.resolveBlueObjectItems=v;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("big.js");const s=require("./Blue-BwbQa9VQ.js"),w=require("bs58"),c=require("@blue-labs/shared-utils"),F=require("base32.js"),B=require("@blue-labs/repository-contract");require("js-sha256");const I=require("radash");require("zod");require("js-yaml");const z=e=>e&&e.__esModule?e:{default:e},J=z(w),U=e=>s.blueObjectSchema.safeParse(e).success,D=e=>c.isNonNullable(e)&&"blueId"in e&&c.isNonNullable(e.blueId),q=e=>c.isNonNullable(e)&&"name"in e&&c.isNonNullable(e.name),j=e=>c.isNonNullable(e)&&"items"in e&&c.isNonNullable(e.items),C=e=>c.isNonNullable(e)&&"type"in e&&c.isNonNullable(e.type),V=e=>c.isNonNullable(e)&&"value"in e&&c.isNonNullable(e.value),W=(e,t)=>e.required({type:!0}).safeParse(t).success;class x{static convert(t){const r=J.default.decode(t),i=new Uint8Array(2+r.length);i[0]=18,i[1]=32,i.set(r,2);const n=new Uint8Array(2+i.length);return n[0]=1,n[1]=85,n.set(i,2),"b"+new F.Encoder({type:"rfc4648",lc:!0}).write(n).finalize().replace(/=/g,"")}}const f=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof s.BlueNode),d=e=>e instanceof s.BigIntegerNumber||e instanceof s.BigDecimalNumber,Y=e=>e.replace(/~1/g,"/").replace(/~0/g,"~");function h(e){if(e==="/")return[];if(!e.startsWith("/"))throw new Error(`Path must start with '/': ${e}`);return e.split("/").slice(1).map(Y)}function g(e){if(e==="-")return-1;const t=typeof e=="number"?e:parseInt(e,10);if(isNaN(t))throw new Error(`Invalid array index (NaN) from '${e}'`);if(!Number.isFinite(t))throw new Error(`Invalid array index '${e}' results in non-finite number ${t}`);return t}function M(e,t,r,i=!0){switch(t){case"name":return r?i?e.getName()??null:e:e.getName();case"description":return r?i?e.getDescription():e:e.getDescription();case"type":return e.getType();case"itemType":return e.getItemType();case"keyType":return e.getKeyType();case"valueType":return e.getValueType();case"value":return r?i?e.getValue()??null:e:e.getValue();case"blueId":return r?i?e.getBlueId()??null:e:e.getBlueId();case"blue":return e.getBlue();case"items":return e.getItems();case"properties":return e.getProperties();case B.OBJECT_CONTRACTS:return e.getContracts();default:return}}function E(e,t,r=!0){if(e instanceof s.BlueNode){const i=M(e,t,!0,r);if(i!==void 0||["name","description","type","itemType","keyType","valueType","value","blueId","blue","items","properties",B.OBJECT_CONTRACTS].includes(t))return i;if(/^-?\d+$/.test(t)&&t!=="-"){const o=e.getItems(),l=parseInt(t,10);return o&&l>=0&&l<o.length?o[l]:void 0}const n=e.getProperties();return n&&t in n?n[t]:void 0}if(Array.isArray(e)){if(t==="-")return;const i=g(t);return i>=0&&i<e.length?e[i]:void 0}if(f(e))return e[t]}function p(e,t){if(t.length===0)return{parent:e,key:"value",actualTarget:e.getValue()??e};let r=e;for(let n=0;n<t.length-1;++n){const o=t[n],l=E(r,o);if(l===void 0)throw new Error(`Cannot resolve '/${t.slice(0,n+1).join("/")}'`);r=l}const i=t[t.length-1];if(r instanceof s.BlueNode){const n=E(r,i,!1);if((typeof n!="object"||n===null||d(n))&&!(n instanceof s.BlueNode)&&!Array.isArray(n)&&["name","description","value","blueId"].includes(i))return{parent:r,key:i,actualTarget:n}}return Array.isArray(r)&&i==="-"?{parent:r,key:"-"}:r instanceof s.BlueNode&&r.getItems()&&i==="-"?{parent:r,key:"-"}:{parent:r,key:Array.isArray(r)?g(i):i}}function P(e,t){if(e instanceof s.BlueNode){const r=t,i=M(e,r,!1);if(i!==void 0||["name","description","type","itemType","keyType","valueType","value","blueId","blue","items","properties",B.OBJECT_CONTRACTS].includes(r))return i;if(typeof t=="number"||typeof t=="string"&&/^\d+$/.test(t)){const n=e.getItems(),o=typeof t=="number"?t:parseInt(t,10);if(n&&o>=0&&o<n.length)return n[o]}return e.getProperties()?.[r]}return Array.isArray(e)||f(e)?e[t]:e}function a(e){if(e instanceof s.BlueNode)return e;if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||d(e))return s.NodeDeserializer.deserializeUnchecked(e);const t=b(e);return s.NodeDeserializer.deserializeUnchecked(t)}function b(e){if(e===void 0)return null;if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(b);const t={};for(const[r,i]of Object.entries(e))t[r]=b(i);return t}function A(e,t,r){if(e instanceof s.BlueNode){const i=t;switch(i){case"name":e.setName(r);return;case"description":e.setDescription(r);return;case"type":e.setType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"itemType":e.setItemType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"keyType":e.setKeyType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"valueType":e.setValueType(r instanceof s.BlueNode||typeof r=="string"||r===void 0?r:a(r));return;case"value":{const n=r;e.setValue(n===void 0?null:n);return}case"blueId":e.setBlueId(r);return;case"blue":e.setBlue(r instanceof s.BlueNode||r===void 0?r:a(r));return;case"items":e.setItems(r);return;case"properties":e.setProperties(r);return;case B.OBJECT_CONTRACTS:e.setContracts(r);return;default:{if(r===void 0){const n=e.getProperties();n&&i in n&&delete n[i]}else e.getProperties()||e.setProperties({}),e.addProperty(i,r instanceof s.BlueNode?r:a(r));return}}}Array.isArray(e)?e.splice(g(t),1):f(e)&&(r===void 0?delete e[t]:e[t]=r)}function K(e,t,r,i){let n=-1;if(t!=="-"&&(n=typeof t=="number"?t:parseInt(t,10),isNaN(n)))throw new Error(`Invalid numeric key for BlueNode item operation: ${t}`);if(n<-1)throw new Error(`Invalid array index for BlueNode items: ${n}`);let o=e.getItems();if(o||(o=[],e.setItems(o)),!i&&n!==-1&&n>o.length)throw new Error(`ADD operation failed: Target array index '${n}' is greater than array length ${o.length}.`);if(t==="-")o.push(r);else if(i){if(n>=0)if(n<o.length)o[n]=r;else{for(let l=o.length;l<n;l++)o.push(s.NodeDeserializer.deserialize(null));o.push(r)}}else o.splice(n,0,r)}function y(e,t,r,i){if(Array.isArray(e)){const n=t==="-"?e.length:g(t);if(!i&&n>e.length)throw new Error(`ADD operation failed: Target array index '${n}' is greater than array length ${e.length}. Path involving key '${t}'.`);if(n<0&&t!=="-")throw new Error(`Invalid negative array index: ${t}`);const o=a(r);if(i){if(n>=0&&n<e.length)e[n]=o;else if(n>=e.length){for(let l=e.length;l<n;l++)e.push(s.NodeDeserializer.deserialize(null));e.push(o)}}else e.splice(n,0,o);return}if(e instanceof s.BlueNode){t==="-"||typeof t=="number"&&!isNaN(t)||typeof t=="string"&&/^\d+$/.test(t)?K(e,t,a(r),i):A(e,t,r);return}if(f(e)){e[t]=a(r);return}throw new Error(`Cannot insert into parent of type ${typeof e}`)}function H(e,t){if(Array.isArray(e)){const r=g(t);r===-1&&t==="-"?e.length>0&&e.pop():r>=0&&r<e.length&&e.splice(r,1);return}if(e instanceof s.BlueNode){if(typeof t=="number"||typeof t=="string"&&/^-?\d+$/.test(t)){const r=e.getItems();if(r){const i=g(t);i===-1&&t==="-"?r.length>0&&r.pop():i>=0&&i<r.length&&r.splice(i,1),r.length===0&&e.setItems(void 0);return}}A(e,t,void 0)}else f(e)&&delete e[t]}function S(e){if(e instanceof s.BlueNode)return e.clone();if(Array.isArray(e))return e.map(r=>S(r));if(f(e)){const t={};return Object.keys(e).forEach(r=>{t[r]=S(e[r])}),t}return e}function m(e,t){if(e===t||e instanceof s.BlueNode&&(e.isInlineValue()||e.getValue()!==void 0)&&m(e.getValue()??null,t)||t instanceof s.BlueNode&&(t.isInlineValue()||t.getValue()!==void 0)&&m(e,t.getValue()??null))return!0;if(e instanceof s.BlueNode&&t instanceof s.BlueNode||d(e)&&d(t)||d(e)&&typeof t=="number"||typeof e=="number"&&d(t))return e.toString()===t.toString();if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,i)=>m(r,t[i]));if(f(e)&&f(t)){const r=Object.keys(e),i=Object.keys(t);return r.length===i.length&&r.every(n=>m(e[n],t[n]))}return!1}function L(e,t){const{parent:r,key:i}=p(e,h(t));return P(r,i)}function _(e,t,r){const i=h(t);if(i.length===0&&t==="/"){const l=a(r);e.setValue(l.getValue()??null),l.getItems()?e.setItems(l.getItems()):e.setItems(void 0);return}const{parent:n,key:o}=p(e,i);y(n,o,r,!0)}function G(e,t,r){const i=h(t);if(i.length===0&&t==="/"){if(e.getItems()&&Array.isArray(r)){const l=a(r);l.getItems()?(e.setItems(l.getItems()),e.setValue(null)):(e.setValue(l.getValue()??null),e.setItems(void 0))}else{const l=a(r);e.setValue(l.getValue()??null),l.getItems()&&e.setItems(l.getItems())}return!0}const{parent:n,key:o}=p(e,i);return y(n,o,r,!1),!0}function Q(e,t,r){const i=h(t);if(i.length===0&&t==="/"){const u=a(r);return e.setValue(u.getValue()??null),u.getItems()?e.setItems(u.getItems()):e.setItems(void 0),!0}const{parent:n,key:o,actualTarget:l}=p(e,i);if(l!==void 0&&n instanceof s.BlueNode)A(n,o,r);else{const u=P(n,o),N=Array.isArray(n)||n instanceof s.BlueNode&&n.getItems()&&(typeof o=="number"||typeof o=="string"&&/^\d+$/.test(o));if(u===void 0){if(N)throw new Error(`REPLACE failed: Target array index '${o.toString()}' is out of bounds or does not exist at path '${t}'.`);y(n,o,r,!0)}else y(n,o,r,!0)}return!0}function $(e,t){const r=h(t);if(r.length===0&&t==="/")return e.setValue(null),e.setItems(void 0),e.setProperties(void 0),!0;const{parent:i,key:n}=p(e,r);return H(i,n),!0}function X(e,t,r){const i=S(L(e,t));return _(e,r,i),!0}function Z(e,t,r){const i=h(t),{parent:n,key:o}=p(e,i),l=P(n,o);if(l===void 0)throw new Error(`MOVE failed: 'from' location '${t}' does not exist.`);return $(e,t)?(_(e,r,l),!0):!1}function k(e,t,r){const i=L(e,t);let n=r;if(i instanceof s.BlueNode)if((r===null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"||d(r))&&(i.isInlineValue()||i.getValue()!==void 0)){if(!m(i.getValue()??null,r))throw new Error(`TEST failed at '${t}': Expected ${JSON.stringify(r)}, got ${JSON.stringify(i.getValue()??null)}`);return!0}else typeof r=="object"&&!(r instanceof s.BlueNode)&&(n=a(r));else if(d(i)&&typeof r=="number")i instanceof s.BigIntegerNumber?n=new s.BigIntegerNumber(r.toString()):i instanceof s.BigDecimalNumber&&(n=new s.BigDecimalNumber(r.toString()));else if((i===null||typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&d(r)){const o=r;!m(i,o.toString())&&(typeof i=="number"&&parseFloat(o.toString()))}if(!m(i,n)){const o=i instanceof s.BlueNode?i.toString():JSON.stringify(i),l=n instanceof s.BlueNode?n.toString():JSON.stringify(n);throw new Error(`TEST failed at '${t}': Expected ${l}, got ${o}`)}return!0}function ee(e,t){switch(t.op){case"add":return G(e,t.path,t.val);case"replace":return Q(e,t.path,t.val);case"remove":return $(e,t.path);case"copy":return X(e,t.from,t.path);case"move":return Z(e,t.from,t.path);case"test":return k(e,t.path,t.val)}}function te(e,t,r=!1){const i=r?e:e.clone();return ee(i,t),i}const re=Object.freeze(Object.defineProperty({__proto__:null,BasicTypesVerifier:s.BasicTypesVerifier,DictionaryProcessor:s.DictionaryProcessor,ListProcessor:s.ListProcessor,MetadataPropagator:s.MetadataPropagator,SchemaPropagator:s.SchemaPropagator,SchemaVerifier:s.SchemaVerifier,SequentialMergingProcessor:s.SequentialMergingProcessor,TypeAssigner:s.TypeAssigner,ValuePropagator:s.ValuePropagator},Symbol.toStringTag,{value:"Module"}));class ie{semanticIdentity;cyclicSetIdentity;constructor(t={}){const r=t.nodeProvider??s.createNodeProvider(()=>[]),i=t.mergingProcessor??s.createDefaultMergingProcessor();this.semanticIdentity=new s.SemanticIdentityService({nodeProvider:r,mergingProcessor:i}),this.cyclicSetIdentity=this.semanticIdentity.createCyclicSetIdentityService()}prepareStorageNode(t,r){const i=this.preprocessForStorage(t,r);if(this.hasThisReference(i))throw new Error("Self-references using this or this#k are not supported in single-document provider storage ingest.");return this.preparePreprocessedStorageNode(i)}prepareStorageNodeList(t,r){if(t.length===0)throw new Error("List of nodes cannot be null or empty");const i=t.map(l=>this.preprocessForStorage(l,r));if(s.CyclicSetIdentityService.hasThisReference(i)){const l=this.cyclicSetIdentity.calculate(i);return l.nodes.forEach(u=>s.StorageShapeValidator.validateStorageShape(u)),{blueId:l.blueId,nodes:l.nodes,documentBlueIds:l.documentBlueIds,isCyclicSet:!0}}const n=i.map(l=>this.preparePreprocessedStorageNode(l).node);return{blueId:this.semanticIdentity.hashMinimalTrusted(n),nodes:n}}preprocessForStorage(t,r){s.StorageShapeValidator.validateStorageShape(t);const i=r(t);return s.StorageShapeValidator.validateStorageShape(i),i}preparePreprocessedStorageNode(t){const r=this.prepareSemanticStorage(t);return s.StorageShapeValidator.validateStorageShape(r.node),r}prepareSemanticStorage(t){const r=this.semanticIdentity.minimizeAuthoring(t);return{blueId:this.semanticIdentity.hashMinimalTrusted(r),node:r}}hasThisReference(t){const r=t.getReferenceBlueId();return r!==void 0&&(r==="this"||r.startsWith("this#"))?!0:[t.getType(),t.getItemType(),t.getKeyType(),t.getValueType(),t.getBlue(),...t.getItems()??[],...Object.values(t.getProperties()??{})].some(n=>n!==void 0&&this.hasThisReference(n))}}const T=async e=>{if(D(e))return e;try{const t=s.jsonBlueValueSchema.parse(e),{Blue:r}=await Promise.resolve().then(()=>require("./Blue-BwbQa9VQ.js")).then(n=>n.Blue$1),i=await new r().calculateBlueId(t);return{...e,blueId:i}}catch(t){throw new Error(`Failed enriching object with Blue ID: ${t}`)}},se=e=>e?.items,ne=e=>e?.value,oe=e=>c.isNullable(e)?{}:I.omit(e,s.OBJECT_SPECIFIC_KEYS),le=e=>C(e)?e.type.name??null:V(e)?I.pascal(typeof e.value):j(e)?"List":null,R=e=>c.isNonNullable(e)&&Object.keys(I.omit(e,["blueId"])).length>0,ue=e=>{try{const t=s.NodeDeserializer.deserialize(e),r=s.NodeToMapListOrValue.get(t);return s.blueObjectSchema.parse(r)}catch(t){throw new Error(`Failed transforming JSON-like value to BlueObject: ${t}`)}},v=async e=>{const{resolveFunction:t,signal:r=new AbortController().signal,omitItems:i}=e,n=e.count??e.items.length;let o=await I.map(e.items,async u=>await T(u));const l=Math.max(o?.length-n,0);for(let u=o.length-1;u>=l;u--)if(!R(o[u])){const N=await t(o[u],{signal:r});if(Array.isArray(N))return v({...e,items:[...o.slice(0,u),...N,...o.slice(u+1)]});const O=await T(N);if(i?.includes(O.blueId))return v({...e,items:[...o.slice(0,u),...o.slice(u+1)]});o=[...o.slice(0,u),O,...o.slice(u+1)]}return o};class ae extends s.PreloadedNodeProvider{blueIdToContentMap=new Map;blueIdToMultipleDocumentsMap=new Map;preprocessor;storageService;constructor(t=[]){super();const r=new s.Preprocessor({nodeProvider:this});this.preprocessor=i=>r.preprocessWithDefaultBlue(i),this.storageService=new ie({nodeProvider:this}),t.forEach(i=>this.processNode(i))}processNode(t){s.Nodes.hasItemsOnly(t)?this.processNodeWithItems(t):this.processSingleNode(t)}processSingleNode(t){const r=s.NodeContentHandler.parseAndCalculateBlueIdForNode(t,this.preprocessor,this.storageService);this.blueIdToContentMap.set(r.blueId,r.content),this.blueIdToMultipleDocumentsMap.set(r.blueId,r.isMultipleDocuments);const i=t.getName();i&&this.addToNameMap(i,r.blueId)}processNodeWithItems(t){const r=t.getItems();if(!r)return;const i=this.storeNodeList(r);this.addListItemNames(i.blueId,i.content)}processNodeList(t){this.storeNodeList(t)}storeNodeList(t){const r=s.NodeContentHandler.parseAndCalculateBlueIdForNodeList(t,this.preprocessor,this.storageService);return this.blueIdToContentMap.set(r.blueId,r.content),this.blueIdToMultipleDocumentsMap.set(r.blueId,!0),r}fetchContentByBlueId(t){const r=this.blueIdToContentMap.get(t),i=this.blueIdToMultipleDocumentsMap.get(t);return r!==void 0&&i!==void 0?s.NodeContentHandler.resolveThisReferences(r,t,i):null}addSingleNodes(...t){t.forEach(r=>this.processNode(r))}addSingleDocs(...t){t.forEach(r=>{const i=s.yamlBlueParse(r);if(i!==void 0){const n=s.NodeDeserializer.deserialize(i);this.processNode(n)}})}getBlueIdByName(t){const r=this.nameToBlueIdsMap.get(t);if(!r||r.length===0)throw new Error(`No node with name "${t}"`);return r[0]}getNodeByName(t){const r=this.findNodeByName(t);if(!r)throw new Error(`No node with name "${t}"`);return r}addListAndItsItemsFromNodes(t){const r=this.storeNodeList(t);if(s.CyclicSetIdentityService.hasThisReference(t)){this.addListItemNames(r.blueId,r.content);return}t.forEach(i=>this.processNode(i))}addListAndItsItemsFromDoc(t){const r=s.yamlBlueParse(t);if(r!==void 0){const n=s.NodeDeserializer.deserialize(r).getItems();n&&this.addListAndItsItems(n)}}addListAndItsItems(t){Array.isArray(t)?this.addListAndItsItemsFromNodes(t):this.addListAndItsItemsFromDoc(t)}addList(t){this.processNodeList(t)}addListItemNames(t,r){Array.isArray(r)&&r.forEach((i,n)=>{const l=s.NodeDeserializer.deserialize(i).getName();l&&this.addToNameMap(l,`${t}#${n}`)})}}exports.BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID=s.BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID;exports.BUILTIN_RUNTIME_TYPE_NAME_TO_BLUE_ID_MAP=s.BUILTIN_RUNTIME_TYPE_NAME_TO_BLUE_ID_MAP;exports.Base58Sha256Provider=s.Base58Sha256Provider;exports.Blue=s.Blue;exports.BlueIdCalculator=s.BlueIdCalculator;exports.BlueNode=s.BlueNode;exports.BlueNodeTypeSchema=s.BlueNodeTypeSchema;exports.JsonCanonicalizer=s.JsonCanonicalizer;exports.Limits=s.Limits;exports.Merger=s.Merger;exports.NodeProviderWrapper=s.NodeProviderWrapper;exports.NodeResolver=s.NodeResolver;exports.NodeToMapListOrValue=s.NodeToMapListOrValue;exports.NodeToObjectConverter=s.NodeToObjectConverter;exports.Nodes=s.Nodes;exports.PathLimits=s.PathLimits;exports.PathLimitsBuilder=s.PathLimitsBuilder;exports.Properties=s.Properties;exports.ResolvedBlueNode=s.ResolvedBlueNode;exports.SCHEMA_FIELDS=s.SCHEMA_FIELDS;exports.Schema=s.Schema;exports.SemanticIdentityService=s.SemanticIdentityService;exports.TypeSchemaResolver=s.TypeSchemaResolver;exports.baseBlueObjectSchema=s.baseBlueObjectSchema;exports.blueDescriptionField=s.blueDescriptionField;exports.blueIdField=s.blueIdField;exports.blueIdSchema=s.blueIdSchema;exports.blueNameField=s.blueNameField;exports.blueNodeField=s.blueNodeField;exports.blueObjectBooleanValueSchema=s.blueObjectBooleanValueSchema;exports.blueObjectNumberValueSchema=s.blueObjectNumberValueSchema;exports.blueObjectSchema=s.blueObjectSchema;exports.blueObjectStringListItemsSchema=s.blueObjectStringListItemsSchema;exports.blueObjectStringValueSchema=s.blueObjectStringValueSchema;exports.canonicalizeRepositoryContent=s.canonicalizeRepositoryContent;exports.createNodeProvider=s.createNodeProvider;exports.getBlueDescriptionAnnotation=s.getBlueDescriptionAnnotation;exports.getBlueIdAnnotation=s.getBlueIdAnnotation;exports.getBlueNameAnnotation=s.getBlueNameAnnotation;exports.getBlueNodeAnnotation=s.getBlueNodeAnnotation;exports.getTypeBlueIdAnnotation=s.getTypeBlueIdAnnotation;exports.isBigDecimalNumber=s.isBigDecimalNumber;exports.isBigIntegerNumber=s.isBigIntegerNumber;exports.isBigNumber=s.isBigNumber;exports.isBlueNodeSchema=s.isBlueNodeSchema;exports.isJsonBlueArray=s.isJsonBlueArray;exports.isJsonBlueObject=s.isJsonBlueObject;exports.isJsonBlueValue=s.isJsonBlueValue;exports.isUrl=s.isUrl;exports.jsonBlueValueSchema=s.jsonBlueValueSchema;exports.withBlueDescription=s.withBlueDescription;exports.withBlueId=s.withBlueId;exports.withBlueName=s.withBlueName;exports.withBlueNode=s.withBlueNode;exports.withTypeBlueId=s.withTypeBlueId;exports.yamlBlueDump=s.yamlBlueDump;exports.yamlBlueParse=s.yamlBlueParse;exports.BasicNodeProvider=ae;exports.BlueIdToCid=x;exports.MergingProcessors=re;exports.applyBlueNodePatch=te;exports.enrichWithBlueId=T;exports.getBlueObjectItems=se;exports.getBlueObjectProperties=oe;exports.getBlueObjectTypeLabel=le;exports.getBlueObjectValue=ne;exports.hasBlueObjectBlueIdDefined=D;exports.hasBlueObjectItemsDefined=j;exports.hasBlueObjectNameDefined=q;exports.hasBlueObjectTypeDefined=C;exports.hasBlueObjectValueDefined=V;exports.isBlueObject=U;exports.isBlueObjectResolved=R;exports.isGivenBlueObjectTypeSchema=W;exports.normalizeToBlueObject=ue;exports.resolveBlueObjectItems=v;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "big.js";
|
|
2
|
-
import { b as L, B as b, a as v, c as a, N as f, d as J, D as U, L as x, M as W, S as K, e as Y, f as q, T as H, V as G, g as Q, h as X, i as Z, C as j, j as N, k, O as ee, l as te, P as se, m as re, n as ie, o as B, y as C } from "./Blue-
|
|
3
|
-
import { x as Ge, z as Qe, q as Xe, s as Ze, p as ke, t as et, J as tt, u as st, K as rt, E as it, I as nt, A as ot, v as at, w as ct, Q as lt, R as ut, G as dt, F as ft, r as mt, W as gt, a4 as pt, a7 as ht, U as yt, aa as It, ae as Nt, Z as St, Y as Tt, _ as Bt, X as bt, H as vt, a3 as At, a6 as Pt, a9 as Et, ac as Ot, af as Vt, al as Ct, ak as Mt, aj as Dt, ad as $t, a0 as Lt, $ as jt, a1 as wt, ai as Rt, a2 as _t, a5 as Ft, a8 as zt, ab as Jt, ag as Ut, ah as xt } from "./Blue-
|
|
2
|
+
import { b as L, B as b, a as v, c as a, N as f, d as J, D as U, L as x, M as W, S as K, e as Y, f as q, T as H, V as G, g as Q, h as X, i as Z, C as j, j as N, k, O as ee, l as te, P as se, m as re, n as ie, o as B, y as C } from "./Blue-Cnkas-g6.mjs";
|
|
3
|
+
import { x as Ge, z as Qe, q as Xe, s as Ze, p as ke, t as et, J as tt, u as st, K as rt, E as it, I as nt, A as ot, v as at, w as ct, Q as lt, R as ut, G as dt, F as ft, r as mt, W as gt, a4 as pt, a7 as ht, U as yt, aa as It, ae as Nt, Z as St, Y as Tt, _ as Bt, X as bt, H as vt, a3 as At, a6 as Pt, a9 as Et, ac as Ot, af as Vt, al as Ct, ak as Mt, aj as Dt, ad as $t, a0 as Lt, $ as jt, a1 as wt, ai as Rt, a2 as _t, a5 as Ft, a8 as zt, ab as Jt, ag as Ut, ah as xt } from "./Blue-Cnkas-g6.mjs";
|
|
4
4
|
import ne from "bs58";
|
|
5
5
|
import { isNonNullable as u, isNullable as oe } from "@blue-labs/shared-utils";
|
|
6
6
|
import ae from "base32.js";
|
|
@@ -540,7 +540,7 @@ const D = async (e) => {
|
|
|
540
540
|
if (ue(e))
|
|
541
541
|
return e;
|
|
542
542
|
try {
|
|
543
|
-
const t = k.parse(e), { Blue: s } = await import("./Blue-
|
|
543
|
+
const t = k.parse(e), { Blue: s } = await import("./Blue-Cnkas-g6.mjs").then((i) => i.aw), r = await new s().calculateBlueId(t);
|
|
544
544
|
return {
|
|
545
545
|
...e,
|
|
546
546
|
blueId: r
|
|
@@ -9,5 +9,10 @@ export declare class NodeDeserializer {
|
|
|
9
9
|
private static handlePosition;
|
|
10
10
|
private static handleSchema;
|
|
11
11
|
private static validateSchemaKeywordShape;
|
|
12
|
+
private static isExplicitNumericValue;
|
|
13
|
+
private static isExplicitSchemaScalar;
|
|
14
|
+
private static isScalarType;
|
|
15
|
+
private static isNumericType;
|
|
16
|
+
private static isCoreType;
|
|
12
17
|
}
|
|
13
18
|
//# sourceMappingURL=NodeDeserializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeDeserializer.d.ts","sourceRoot":"","sources":["../../../src/lib/model/NodeDeserializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"NodeDeserializer.d.ts","sourceRoot":"","sources":["../../../src/lib/model/NodeDeserializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAgDlC,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO;IAOhC,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO;IAOzC,OAAO,CAAC,MAAM,CAAC,UAAU;IAiKzB,OAAO,CAAC,MAAM,CAAC,WAAW;IAiC1B,OAAO,CAAC,MAAM,CAAC,WAAW;IA0B1B,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAanC,OAAO,CAAC,MAAM,CAAC,cAAc;IAO7B,OAAO,CAAC,MAAM,CAAC,YAAY;IA2C3B,OAAO,CAAC,MAAM,CAAC,0BAA0B;IA2CzC,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAcrC,OAAO,CAAC,MAAM,CAAC,sBAAsB;IA2BrC,OAAO,CAAC,MAAM,CAAC,YAAY;IAS3B,OAAO,CAAC,MAAM,CAAC,aAAa;IAO5B,OAAO,CAAC,MAAM,CAAC,UAAU;CAU1B"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { BlueNode } from './Node';
|
|
2
2
|
export declare const SCHEMA_FIELDS: readonly ["required", "minLength", "maxLength", "minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf", "minItems", "maxItems", "uniqueItems", "minFields", "maxFields"];
|
|
3
3
|
export type SchemaField = (typeof SCHEMA_FIELDS)[number];
|
|
4
|
+
export declare const BOOLEAN_SCHEMA_FIELDS: readonly ["required", "uniqueItems"];
|
|
5
|
+
export declare const INTEGER_SCHEMA_FIELDS: readonly ["minLength", "maxLength", "minItems", "maxItems", "minFields", "maxFields"];
|
|
6
|
+
export declare const NUMERIC_SCHEMA_FIELDS: readonly ["minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf"];
|
|
7
|
+
export declare function isBooleanSchemaField(field: SchemaField): boolean;
|
|
8
|
+
export declare function isIntegerSchemaField(field: SchemaField): boolean;
|
|
9
|
+
export declare function isNumericSchemaField(field: SchemaField): boolean;
|
|
4
10
|
export declare class Schema {
|
|
5
11
|
private readonly fields;
|
|
6
12
|
private enumValues?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/lib/model/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,eAAO,MAAM,aAAa,8LAchB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8C;IACrE,OAAO,CAAC,UAAU,CAAC,CAAa;IAEzB,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS;IAI7C,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM;IAS5D,OAAO,IAAI,QAAQ,EAAE,GAAG,SAAS;IAIjC,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,GAAG,MAAM;IAK/C,OAAO,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE;IASpC,KAAK,IAAI,MAAM;CAQvB"}
|
|
1
|
+
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/lib/model/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,eAAO,MAAM,aAAa,8LAchB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,qBAAqB,sCAAuC,CAAC;AAE1E,eAAO,MAAM,qBAAqB,uFAOxB,CAAC;AAEX,eAAO,MAAM,qBAAqB,uFAMxB,CAAC;AAMX,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAEhE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAEhE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAEhE;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8C;IACrE,OAAO,CAAC,UAAU,CAAC,CAAa;IAEzB,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS;IAI7C,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM;IAS5D,OAAO,IAAI,QAAQ,EAAE,GAAG,SAAS;IAIjC,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,GAAG,MAAM;IAK/C,OAAO,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE;IASpC,KAAK,IAAI,MAAM;CAQvB"}
|
|
@@ -44,9 +44,7 @@ export declare const BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID: {
|
|
|
44
44
|
blueId: string;
|
|
45
45
|
};
|
|
46
46
|
itemType: {
|
|
47
|
-
|
|
48
|
-
blueId: string;
|
|
49
|
-
};
|
|
47
|
+
blueId: string;
|
|
50
48
|
};
|
|
51
49
|
description: string;
|
|
52
50
|
};
|
|
@@ -113,9 +111,7 @@ export declare const BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID: {
|
|
|
113
111
|
blueId: string;
|
|
114
112
|
};
|
|
115
113
|
itemType: {
|
|
116
|
-
|
|
117
|
-
blueId: string;
|
|
118
|
-
};
|
|
114
|
+
blueId: string;
|
|
119
115
|
};
|
|
120
116
|
description: string;
|
|
121
117
|
schema: {
|
|
@@ -174,9 +170,7 @@ export declare const BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID: {
|
|
|
174
170
|
blueId: string;
|
|
175
171
|
};
|
|
176
172
|
keyType: {
|
|
177
|
-
|
|
178
|
-
blueId: string;
|
|
179
|
-
};
|
|
173
|
+
blueId: string;
|
|
180
174
|
};
|
|
181
175
|
description: string;
|
|
182
176
|
schema: {
|
|
@@ -204,9 +198,7 @@ export declare const BUILTIN_RUNTIME_TYPE_CONTENT_BY_BLUE_ID: {
|
|
|
204
198
|
blueId: string;
|
|
205
199
|
};
|
|
206
200
|
itemType: {
|
|
207
|
-
|
|
208
|
-
blueId: string;
|
|
209
|
-
};
|
|
201
|
+
blueId: string;
|
|
210
202
|
};
|
|
211
203
|
description: string;
|
|
212
204
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuiltinRuntimeTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/repository/BuiltinRuntimeTypes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,uCAAuC
|
|
1
|
+
{"version":3,"file":"BuiltinRuntimeTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/repository/BuiltinRuntimeTypes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Rf,CAAC;AAEtC,eAAO,MAAM,wCAAwC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKzE,CAAC;AAqBJ,eAAO,MAAM,gCAAgC,EAAE,cAY9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeToMapListOrValue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/NodeToMapListOrValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"NodeToMapListOrValue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/NodeToMapListOrValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA0BzC;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,qBAAa,oBAAoB;IAC/B;;;;;;;;;OASG;IACH,MAAM,CAAC,GAAG,CACR,IAAI,EAAE,QAAQ,EACd,iBAAiB,GAAE,QAAQ,GAAG,2BAAwC,GACrE,SAAS;IA2HZ,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;IAe3C,OAAO,CAAC,MAAM,CAAC,eAAe;IAa9B,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAahC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JsonObject, JsonValue } from 'type-fest';
|
|
2
|
+
import { BlueNode } from '../model/Node';
|
|
3
|
+
import { Schema } from '../model/Schema';
|
|
4
|
+
type NodeConverter = (node: BlueNode) => JsonValue;
|
|
5
|
+
type ValueConverter = (value: BlueNode['value']) => JsonValue | undefined;
|
|
6
|
+
export declare class SchemaToMapListOrValue {
|
|
7
|
+
static get(schema: Schema, nodeConverter: NodeConverter, valueConverter: ValueConverter): JsonObject;
|
|
8
|
+
private static schemaFieldValue;
|
|
9
|
+
private static numericValue;
|
|
10
|
+
private static scalarOrExplicitNode;
|
|
11
|
+
private static isPlainScalar;
|
|
12
|
+
private static put;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=SchemaToMapListOrValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaToMapListOrValue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/SchemaToMapListOrValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAIL,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AAEzB,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,QAAQ,KAAK,SAAS,CAAC;AACnD,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,SAAS,GAAG,SAAS,CAAC;AAE1E,qBAAa,sBAAsB;IACjC,MAAM,CAAC,GAAG,CACR,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAC7B,UAAU;IAqBb,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAiB/B,OAAO,CAAC,MAAM,CAAC,YAAY;IAU3B,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAUnC,OAAO,CAAC,MAAM,CAAC,aAAa;IAsB5B,OAAO,CAAC,MAAM,CAAC,GAAG;CASnB"}
|
|
@@ -7,6 +7,7 @@ export * from './StorageShapeValidator';
|
|
|
7
7
|
export { BlueIdToCid } from './BlueIdToCid';
|
|
8
8
|
export { JsonCanonicalizer } from './JsonCanonicalizer';
|
|
9
9
|
export * from './NodeToMapListOrValue';
|
|
10
|
+
export * from './SchemaToMapListOrValue';
|
|
10
11
|
export * from './NodeToBlueIdInput';
|
|
11
12
|
export * as Properties from './Properties';
|
|
12
13
|
export * from './NodeTransformer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC"}
|
|
@@ -12,6 +12,7 @@ export declare class BlueContextResolver {
|
|
|
12
12
|
constructor(options: BlueContextResolverOptions);
|
|
13
13
|
transform(node: BlueNode, blueContext: BlueContext): BlueNode;
|
|
14
14
|
private computeTargetRepoVersionIndexes;
|
|
15
|
+
private addImplicitBuiltinRuntimeTypesRepository;
|
|
15
16
|
private unknownRepoBlueIdError;
|
|
16
17
|
}
|
|
17
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlueContextResolver.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/repositoryVersioning/BlueContextResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"BlueContextResolver.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/repositoryVersioning/BlueContextResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAMxE,UAAU,0BAA0B;IAClC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAe;gBAEjC,OAAO,EAAE,0BAA0B;IAKxC,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAG,QAAQ;IAoBpE,OAAO,CAAC,+BAA+B;IAoCvC,OAAO,CAAC,wCAAwC;IAmBhD,OAAO,CAAC,sBAAsB;CAoB/B"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blue-labs/language",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.2",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@blue-labs/repository-contract": "5.0.0-rc.
|
|
6
|
-
"@blue-labs/shared-utils": "5.0.0-rc.
|
|
5
|
+
"@blue-labs/repository-contract": "5.0.0-rc.2",
|
|
6
|
+
"@blue-labs/shared-utils": "5.0.0-rc.2",
|
|
7
7
|
"@types/big.js": "^6.2.2",
|
|
8
8
|
"@types/js-yaml": "^4.0.9",
|
|
9
9
|
"base32.js": "^0.1.0",
|