@squiz/base-components
Advanced tools
Comparing version 0.0.4 to 0.0.5
import { CommonPrefix } from '@aws-sdk/client-s3'; | ||
import { ArtefactVersionKey, ArtefactSearchKey, ArtefactCompositeKey } from './types'; | ||
/** | ||
* This functions returns the full artefact key for upload or download from S3 for a given artefact. | ||
*/ | ||
export declare function getKeyFromArtefactVersionKey(composite: ArtefactVersionKey | ArtefactCompositeKey): string; | ||
/** | ||
* This function returns a string that can be used to search S3 to determine if an artefact exists for the given artefact information. | ||
*/ | ||
export declare function getVersionKeyFromArtefactVersionKey(composite: ArtefactVersionKey | ArtefactCompositeKey): string; | ||
export declare function getArtefactCompositeFromKey(key: string): ArtefactCompositeKey; | ||
@@ -4,0 +12,0 @@ export declare function getArtefactKeyFromComposite({ type, namespace, artefact, version, file }: ArtefactCompositeKey): string; |
export * from './types'; | ||
export * from './functions'; | ||
export * from './repoStructure'; | ||
export { SetEnums, SetManifest, SetComponent, SetConfiguration, SetEnvironment, SetHeaders } from '@squiz/base-component-schemas'; |
@@ -1,2 +0,2 @@ | ||
var y=(t=>(t.Component="Component",t.ComponentSet="ComponentSet",t))(y||{}),r="/",m=(t=>(t.Component="component",t.ComponentSet="component-set",t))(m||{});function C(e){let[n]=e.split(r);if(n==="component"){let[t,i,o,s,p]=e.split(r);return{type:t,namespace:i,artefact:o,version:s,file:p}}else if(n==="component-set"){let[t,i,o,s]=e.split(r);return{type:t,artefact:i,version:o,file:s}}throw Error(`Unknown type: ${n}`)}function c({type:e,namespace:n,artefact:t,version:i,file:o}){if(e==="component")return`${e}${r}${n}${r}${t}${r}${i}${r}${o}`;if(e==="component-set")return`${e}${r}${t}${r}${i}${r}${o}`;throw Error(`Unknown type: ${e}`)}function A({type:e,namespace:n,artefact:t}){if(e==="component")return`${e}${r}${n}${r}${t}${r}`;if(e==="component-set")return`${e}${r}${t}${r}`;throw Error(`Unknown type: ${e}`)}function x(e){let n=[];return e.forEach(t=>{let i=t.Prefix;if(i){let o=i.split(r),[s]=o;if(s==="component"){let[,p,a,d]=o;n.push({type:s,namespace:p,artefact:a,version:d})}else if(s==="component-set"){let[,p,a]=o;n.push({type:s,artefact:p,version:a})}}}),n}function S(e){if(e.type==="component")return c({...e,file:"component.zip"});if(e.type==="component-set")return c({...e,file:"setManifest.zip"});throw Error(`Unknown type: ${e.type}`)}var f=(e=>(e.Latest="latest",e.All="all",e))(f||{});export{r as ARTEFACT_KEY_DELIMITER,m as ArtefactKeyType,y as ArtefactType,f as SetEnums,C as getArtefactCompositeFromKey,c as getArtefactKeyFromComposite,S as getArtefactKeyFromVersionKey,x as getArtefactKeysFromVersionPrefixList,A as getArtefactListPrefix}; | ||
var u=(n=>(n.Component="Component",n.ComponentSet="ComponentSet",n))(u||{}),t="/",c=(n=>(n.Component="component",n.ComponentSet="component-set",n))(c||{}),m=(n=>(n.Component="component.zip",n.ComponentSet="set-manifest.json",n))(m||{});function S(e){if(e.type==="component")return["component",e.namespace,e.artefact,e.version,"component.zip"].join(t);if(e.type==="component-set")return["component-set",e.artefact,e.version,"set-manifest.json"].join(t);throw Error(`Unknown type: ${e.type}`)}function x(e){if(e.type==="component")return["component",e.namespace,e.artefact,e.version].join(t);if(e.type==="component-set")return["component-set",e.artefact,e.version].join(t);throw Error(`Unknown type: ${e.type}`)}function K(e){let[r]=e.split(t);if(r==="component"){let[n,s,o,i,p]=e.split(t);return{type:n,namespace:s,artefact:o,version:i,file:p}}else if(r==="component-set"){let[n,s,o,i]=e.split(t);return{type:n,artefact:s,version:o,file:i}}throw Error(`Unknown type: ${r}`)}function f({type:e,namespace:r,artefact:n,version:s,file:o}){if(e==="component")return`${e}${t}${r}${t}${n}${t}${s}${t}${o}`;if(e==="component-set")return`${e}${t}${n}${t}${s}${t}${o}`;throw Error(`Unknown type: ${e}`)}function v({type:e,namespace:r,artefact:n}){if(e==="component")return`${e}${t}${r}${t}${n}${t}`;if(e==="component-set")return`${e}${t}${n}${t}`;throw Error(`Unknown type: ${e}`)}function E(e){let r=[];return e.forEach(n=>{let s=n.Prefix;if(s){let o=s.split(t),[i]=o;if(i==="component"){let[,p,a,C]=o;r.push({type:i,namespace:p,artefact:a,version:C})}else if(i==="component-set"){let[,p,a]=o;r.push({type:i,artefact:p,version:a})}}}),r}function P(e){if(e.type==="component")return f({...e,file:"component.zip"});if(e.type==="component-set")return f({...e,file:"set-manifest.json"});throw Error(`Unknown type: ${e.type}`)}var y="package.json",b={components:"/packages/components/",componentSets:"/packages/component-sets/"},j={sourceRoot:"src",packagePath:y,manifestPath:"src/manifest.json"},V={distRoot:"dist",uiPath:"dist/UI/",headlessPath:"dist/Headless/",manifestPath:"manifest.json"},w={packagePath:y,manifestPath:"setManifest.json"};var d=(e=>(e.Latest="latest",e.All="all",e))(d||{});export{t as ARTEFACT_KEY_DELIMITER,m as ArtefactFile,c as ArtefactKeyType,u as ArtefactType,y as DEFAULT_PACKAGE_PATH,d as SetEnums,b as artefactLocation,V as componentDistStructure,j as componentRepoStructure,w as componentSetRepoStructure,K as getArtefactCompositeFromKey,f as getArtefactKeyFromComposite,P as getArtefactKeyFromVersionKey,E as getArtefactKeysFromVersionPrefixList,v as getArtefactListPrefix,S as getKeyFromArtefactVersionKey,x as getVersionKeyFromArtefactVersionKey}; | ||
//# sourceMappingURL=index.js.map |
@@ -10,2 +10,6 @@ export declare enum ArtefactType { | ||
} | ||
export declare enum ArtefactFile { | ||
Component = "component.zip", | ||
ComponentSet = "set-manifest.json" | ||
} | ||
export type ArtefactSearchKey = { | ||
@@ -20,3 +24,3 @@ type: string | ArtefactKeyType.Component | ArtefactKeyType.ComponentSet; | ||
export type ArtefactCompositeKey = ArtefactVersionKey & { | ||
file: string; | ||
file: string | ArtefactFile.Component | ArtefactFile.ComponentSet; | ||
}; | ||
@@ -23,0 +27,0 @@ export type UpdateMessage = { |
{ | ||
"name": "@squiz/base-components", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "", | ||
@@ -32,3 +32,3 @@ "keywords": [], | ||
"types": "lib/index.d.ts", | ||
"gitHead": "bb8c00c6421be67257a527f1c11ee664a0432f7e" | ||
"gitHead": "9b0e90ce464c7d6c820e443eb578a8016b6412ca" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
43508
12
103