@uniformdev/project-map 17.1.1-alpha.752

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/LICENSE.txt ADDED
@@ -0,0 +1,2 @@
1
+ © 2022 Uniform Systems, Inc. All Rights Reserved.
2
+ See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ Sitemap functionality for Uniform Platform
2
+
3
+ part of the [Uniform Platform](https://uniform.app). See our [documentation](https://docs.uniform.app) for more details.
@@ -0,0 +1 @@
1
+ var l=Object.create;var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var b=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(a,e)=>(typeof require!="undefined"?require:a)[e]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var g=(r,a)=>()=>(r&&(a=r(r=0)),a);var I=(r,a)=>()=>(a||r((a={exports:{}}).exports,a),a.exports),S=(r,a)=>{for(var e in a)n(r,e,{get:a[e],enumerable:!0})},f=(r,a,e,t)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of N(a))!y.call(r,p)&&p!==e&&n(r,p,{get:()=>a[p],enumerable:!(t=m(a,p))||t.enumerable});return r};var C=(r,a,e)=>(e=r!=null?l(R(r)):{},f(a||!r||!r.__esModule?n(e,"default",{value:r,enumerable:!0}):e,r)),v=r=>f(n({},"__esModule",{value:!0}),r);import{ApiClient as U}from"@uniformdev/context/api";var O="/",u=class extends U{constructor(e){super(e);this.fetchProjectMapDefinitions=async e=>{let t=this.createUrl("/api/v1/project-map",{projectId:e});return await this.apiClient(t)};this.fetchProjectMapDefinition=async e=>{let t=this.createUrl("/api/v1/project-map",{...e,projectMapId:e.projectMapId});return await this.apiClient(t)};this.upsertProjectMap=async e=>{let t=this.createUrl("/api/v1/project-map");return(await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectMap:e.projectMap})})).projectMapId};this.deleteProjectMap=async e=>{let t=this.createUrl("/api/v1/project-map");await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectMapId:e.projectMapId}),expectNoContent:!0})};this.upsertProjectMapNodes=async e=>{let t=this.createUrl("/api/v1/project-map-nodes");await this.apiClient(t,{method:"PUT",body:JSON.stringify({projectId:e.projectId,projectMapId:e.projectMapId,nodes:e.nodes.map(p=>({...p,node:{...this.cleanProjectMapNode(p.node)}}))}),expectNoContent:!0})};this.deleteProjectMapNode=async e=>{let t=this.createUrl("/api/v1/project-map-nodes");(!e.path||this.validatePath(e.path))&&await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectMapId:e.projectMapId}),expectNoContent:!0})};this.fetchSubtree=async e=>{var M;let t={};t.projectId=e.projectId,e.projectMapId&&(t.projectMapId=e.projectMapId),e.path&&this.validatePath(e.path)&&(t.path=e.path),e.depth&&(t.depth=e.depth.toString()),e.expanded&&(t.expanded="true"),t.tree="true";let p=this.createUrl("/api/v1/project-map-nodes",t),h={...(await this.apiClient(p)).tree},o=[h];for(;o&&o.length>0;){let i=o.pop(),s;(M=i==null?void 0:i.children)==null||M.forEach(c=>{c.parent=j(i),c.previousSibling=j(s),s&&(s.nextSibling=j(c)),s=c,o.push(c)})}return h};this.fetchNodes=async e=>{let t={};t.projectId=e.projectId,e.projectMapId&&(t.projectMapId=e.projectMapId),e.path&&this.validatePath(e.path)&&(t.path=e.path),e.id&&(t.id=e.id),e.limit&&(t.limit=e.limit.toString()),e.offset&&(t.offset=e.offset.toString()),e.expanded&&(t.expanded="true");let p=this.createUrl("/api/v1/project-map-nodes",t);return await this.apiClient(p)}}cleanProjectMapNode(e){var t,p,d;return{id:((d=(p=(t=e.id)==null?void 0:t.match(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i))==null?void 0:p.length)!=null?d:0)==1?e.id:void 0,path:e.path,name:e.name,type:e.type,compositionId:e.compositionId,description:e.description}}validatePath(e){let t=/[*%!&@]/g;if(e==null?void 0:e.match(t))throw"path cannot contain reserved characters * % ! & @";return!0}},P=class extends u{constructor(a){super({...a,bypassCache:!0})}},j=r=>r?{...r,parent:void 0,children:void 0}:void 0;export{b as a,g as b,I as c,S as d,C as e,v as f,O as g,u as h,P as i};
@@ -0,0 +1 @@
1
+ var l=Object.create;var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var b=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(a,e)=>(typeof require!="undefined"?require:a)[e]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var g=(r,a)=>()=>(r&&(a=r(r=0)),a);var I=(r,a)=>()=>(a||r((a={exports:{}}).exports,a),a.exports),S=(r,a)=>{for(var e in a)n(r,e,{get:a[e],enumerable:!0})},M=(r,a,e,t)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of N(a))!y.call(r,i)&&i!==e&&n(r,i,{get:()=>a[i],enumerable:!(t=m(a,i))||t.enumerable});return r};var C=(r,a,e)=>(e=r!=null?l(R(r)):{},M(a||!r||!r.__esModule?n(e,"default",{value:r,enumerable:!0}):e,r)),v=r=>M(n({},"__esModule",{value:!0}),r);import{ApiClient as U}from"@uniformdev/context/api";var x="/",h=class extends U{constructor(e){super(e);this.fetchProjectMapDefinitions=async e=>{let t=this.createUrl("/api/v1/sitemap",{projectId:e});return await this.apiClient(t)};this.fetchProjectMapDefinition=async e=>{let t=this.createUrl("/api/v1/sitemap",{...e,sitemapId:e.projectMapId});return await this.apiClient(t)};this.upsertProjectMap=async e=>{let t=this.createUrl("/api/v1/sitemap");return(await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,sitemap:e.projectMap,projectMap:void 0})})).sitemapId};this.deleteProjectMap=async e=>{let t=this.createUrl("/api/v1/sitemap");await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,sitemapId:e.projectMapId,projectMapId:void 0}),expectNoContent:!0})};this.upsertProjectMapNodes=async e=>{let t=this.createUrl("/api/v1/sitemap-nodes");await this.apiClient(t,{method:"PUT",body:JSON.stringify({projectId:e.projectId,sitemapId:e.projectMapId,nodes:e.nodes.map(i=>({...i,node:{...this.cleanProjectMapNode(i.node)}}))}),expectNoContent:!0})};this.deleteProjectMapNode=async e=>{let t=this.createUrl("/api/v1/sitemap-nodes");(!e.path||this.validatePath(e.path))&&await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,sitemapId:e.projectMapId}),expectNoContent:!0})};this.fetchSubtree=async e=>{var f;let t={};t.projectId=e.projectId,e.projectMapId&&(t.sitemapId=e.projectMapId),e.path&&this.validatePath(e.path)&&(t.path=e.path),e.depth&&(t.depth=e.depth.toString()),t.tree="true";let i=this.createUrl("/api/v1/sitemap-nodes",t),j={...(await this.apiClient(i)).tree},s=[j];for(;s&&s.length>0;){let c=s.pop(),o;(f=c==null?void 0:c.children)==null||f.forEach(p=>{p.parent=u(c),p.previousSibling=u(o),o&&(o.nextSibling=u(p)),o=p,s.push(p)})}return j};this.fetchNodes=async e=>{let t={};t.projectId=e.projectId,e.projectMapId&&(t.sitemapId=e.projectMapId),e.path&&this.validatePath(e.path)&&(t.path=e.path),e.id&&(t.id=e.id),e.limit&&(t.limit=e.limit.toString()),e.offset&&(t.offset=e.offset.toString());let i=this.createUrl("/api/v1/sitemap-nodes",t);return await this.apiClient(i)}}cleanProjectMapNode(e){var t,i,d;return{id:((d=(i=(t=e.id)==null?void 0:t.match(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i))==null?void 0:i.length)!=null?d:0)==1?e.id:void 0,path:e.path,name:e.name,type:e.type,compositionId:e.compositionId,description:e.description}}validatePath(e){let t=/[*%!&@]/g;if(e==null?void 0:e.match(t))throw"path cannot contain reserved characters * % ! & @";return!0}},P=class extends h{constructor(a){super({...a,bypassCache:!0})}},u=r=>r?{...r,parent:void 0,children:void 0}:void 0;export{b as a,g as b,I as c,S as d,C as e,v as f,x as g,h,P as i};
@@ -0,0 +1,5 @@
1
+ import { UniformCLIPlugin } from '@uniformdev/cli';
2
+
3
+ declare const uniformCLI: UniformCLIPlugin;
4
+
5
+ export { uniformCLI };