@3e/sqa-common 6.17.0-13 → 6.17.0-14

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/index.d.ts CHANGED
@@ -733,17 +733,22 @@ declare module '@3e/sqa-common' {
733
733
  | 'kpis'
734
734
 
735
735
  export type Granularity =
736
- | '1 minute'
737
- | '5 minutes'
738
- | '10 minutes'
739
- | '15 minutes'
740
- | '30 minutes'
741
- | '1 hour'
742
- | '1 day'
743
- | '1 week'
744
- | '1 month'
745
- | '3 months'
746
- | '1 year'
736
+ | '1-days'
737
+ | '1-hours'
738
+ | '1-minutes'
739
+ | '1-months'
740
+ | '1-weeks'
741
+ | '1-years'
742
+ | '10-minutes'
743
+ | '15-minutes'
744
+ | '3-months'
745
+ | '30-minutes'
746
+ | '5-minutes'
747
+ | 'change'
748
+ | 'normalized'
749
+ | 'raw'
750
+ | 'scaled'
751
+ | 'statelog'
747
752
 
748
753
  export type Period =
749
754
  | 'last-15-minutes'
@@ -770,6 +775,72 @@ declare module '@3e/sqa-common' {
770
775
  | 'since-beginning'
771
776
  | 'custom'
772
777
 
778
+ export type ShortLDTypeValue =
779
+ | 'ac-input'
780
+ | 'ac-node'
781
+ | 'ac-phase'
782
+ | 'account'
783
+ | 'battery'
784
+ | 'bearing'
785
+ | 'blade'
786
+ | 'connection'
787
+ | 'dc-input'
788
+ | 'dc-node'
789
+ | 'generator'
790
+ | 'inverter'
791
+ | 'inverter-device'
792
+ | 'logger'
793
+ | 'module-group'
794
+ | 'mppt'
795
+ | 'nacelle'
796
+ | 'portfolio'
797
+ | 'power-unit'
798
+ | 'rotor'
799
+ | 'sensor'
800
+ | 'site'
801
+ | 'site-group'
802
+ | 'spv'
803
+ | 'strings'
804
+ | 'tower'
805
+ | 'tracker'
806
+ | 'transmission'
807
+ | 'turbine'
808
+ | 'yaw'
809
+
810
+ export type LongLDTypeValue =
811
+ | 'sq/ld_type/ac_input'
812
+ | 'sq/ld_type/ac_node'
813
+ | 'sq/ld_type/ac_phase'
814
+ | 'sq/ld_type/account'
815
+ | 'sq/ld_type/battery'
816
+ | 'sq/ld_type/bearing'
817
+ | 'sq/ld_type/blade'
818
+ | 'sq/ld_type/connection'
819
+ | 'sq/ld_type/dc_input'
820
+ | 'sq/ld_type/dc_node'
821
+ | 'sq/ld_type/generator'
822
+ | 'sq/ld_type/inverter'
823
+ | 'sq/ld_type/inverter_device'
824
+ | 'sq/ld_type/logger'
825
+ | 'sq/ld_type/module_group'
826
+ | 'sq/ld_type/mppt'
827
+ | 'sq/ld_type/nacelle'
828
+ | 'sq/ld_type/portfolio'
829
+ | 'sq/ld_type/power_unit'
830
+ | 'sq/ld_type/rotor'
831
+ | 'sq/ld_type/sensor'
832
+ | 'sq/ld_type/site'
833
+ | 'sq/ld_type/site_group'
834
+ | 'sq/ld_type/spv'
835
+ | 'sq/ld_type/strings'
836
+ | 'sq/ld_type/tower'
837
+ | 'sq/ld_type/tracker'
838
+ | 'sq/ld_type/transmission'
839
+ | 'sq/ld_type/turbine'
840
+ | 'sq/ld_type/yaw'
841
+
842
+ export type LdTypeValue = ShortLDTypeValue | LongLDTypeValue
843
+
773
844
  export type LevelValue =
774
845
  | 'site-group'
775
846
  | 'site'
@@ -1645,7 +1716,7 @@ declare module '@3e/sqa-common' {
1645
1716
  /**
1646
1717
  * Generate a new password for the user
1647
1718
  *
1648
- * Password will
1719
+ * The Password will:
1649
1720
  * - be between 12 and 100 characters
1650
1721
  * - contain at least one lower-case character
1651
1722
  * - contain at least one upper-case character
@@ -1683,7 +1754,7 @@ declare module '@3e/sqa-common' {
1683
1754
  * @param ldType - The Logical Device Type to convert. Accepts both short
1684
1755
  * form (e.g. 'inverter') or full SQID (e.g. '/sq/ld_type/inverter')
1685
1756
  */
1686
- convertLDTypeToRefCategory(ldType: string): string | null
1757
+ convertLDTypeToRefCategory(ldType: LdTypeValue): string | null
1687
1758
 
1688
1759
  /**
1689
1760
  * Make a Ref from an LD Type and a SQID
@@ -1695,7 +1766,7 @@ declare module '@3e/sqa-common' {
1695
1766
  * form (e.g. 'inverter') or full SQID (e.g. '/sq/ld_type/inverter')
1696
1767
  * @param sqid - The SQID of the object
1697
1768
  */
1698
- refFromLDTypeAndSQID(ldType: string, sqid: string): string | null
1769
+ refFromLDTypeAndSQID(ldType: LdTypeValue, sqid: string): string | null
1699
1770
 
1700
1771
  /**
1701
1772
  * Returns the refresh period for the view in milliseconds, or null if the view should not be refreshed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3e/sqa-common",
3
- "version": "6.17.0-13",
3
+ "version": "6.17.0-14",
4
4
  "description": "SynaptiQ utilities package",
5
5
  "main": "sqa_common.js",
6
6
  "dependencies": {
package/sqa_common.js CHANGED
@@ -1214,7 +1214,7 @@ function DV(a,b){return function(c,d){function e(){return g(new Y(null,1,5,Z,[1]
1214
1214
  function EV(a,b){function c(){return lt.h(ak.g(d,function(e){e=X(e);var f=x.g(e,Pw),g=x.g(e,lt),h=x.g(e,$A);return vc(g)?vg.l(e,VE,!1,H([lt,$O.g(null,function(){return $O.g(f.m?f.m():f.call(null),function(k){return $O.g(null,function(){return $O.g(ak.l(d,vg,VE,!0,H([$A,function(){var l=Cy.h(dE.h(YT(k)));return u(l)?l:h}()])),function(){return lP(k)})})})})])):e}))}var d=Yj(new q(null,1,[Pw,b],null));return new q(null,2,[my,DV(function(e,f){return $O.g(null,function(){return $O.g(c(),function(g){return $O.g(null,
1215
1215
  function(){var h=lP;var k=Cy.h(dE.h(YT(g)));u(k)?(k=Pk(YT(f),Lx,"Authorization",["Bearer ",v.h(k)].join("")),k=fo.h?fo.h(k):fo.call(null,k),k=a.g?a.g(e,k):a.call(null,e,k)):k=g;return h(k)})})})},function(){return ak.g(d,function(e){e=X(e);var f=x.g(e,lt),g=x.g(e,VE),h=x.g(e,$A);if(!(f instanceof EP))throw Error("Assert failed: (p/promise? promise)");vc(g)||(vc(h)?e=zg.l(e,lt,H([VE])):(f=vg.l,h=new q(null,3,[Gt,tC,dE,new q(null,1,[Cy,h],null),Lx,new q(null,1,["Content-Type","application/json"],null)],
1216
1216
  null),h=fo.h?fo.h(h):fo.call(null,h),h=a.g?a.g("/token/refresh",h):a.call(null,"/token/refresh",h),e=f.call(vg,e,VE,!1,H([lt,h]))));return e})}),dq,function(){return Zj(d,new q(null,1,[Pw,b],null))}],null)}if("undefined"===typeof GO||"undefined"===typeof HO||"undefined"===typeof OT||"undefined"===typeof FV)var FV=null;
1217
- function GV(a,b){b=X(b);var c=x.j(b,Gt,"GET"),d=x.g(b,oB),e=x.g(b,dE);b=x.g(b,Lx);var f=Cm.l(H([b,new q(null,1,["X-SQA-Common-Version","6.17.0-13"],null)])),g=FP(),h=FV;u(h)?GP(function(){if(u(d)){var k=v.h(a);var l=v,m=l.h,p=fo(d),r=[],w;for(w in p)Ua(w,p[w],r);k=[k,"?",m.call(l,r.join("\x26"))].join("")}else k=a;l={method:c,headers:fo(f),body:fo(e)};return h.g?h.g(k,l):h.call(null,k,l)}(),function(k){return KP(g,ko(k,H([lo,!0])))}):nP(g,Io("Api fn not set",gj));return g}
1217
+ function GV(a,b){b=X(b);var c=x.j(b,Gt,"GET"),d=x.g(b,oB),e=x.g(b,dE);b=x.g(b,Lx);var f=Cm.l(H([b,new q(null,1,["X-SQA-Common-Version","6.17.0-14"],null)])),g=FP(),h=FV;u(h)?GP(function(){if(u(d)){var k=v.h(a);var l=v,m=l.h,p=fo(d),r=[],w;for(w in p)Ua(w,p[w],r);k=[k,"?",m.call(l,r.join("\x26"))].join("")}else k=a;l={method:c,headers:fo(f),body:fo(e)};return h.g?h.g(k,l):h.call(null,k,l)}(),function(k){return KP(g,ko(k,H([lo,!0])))}):nP(g,Io("Api fn not set",gj));return g}
1218
1218
  var HV=mo(GV),IV=function IV(a){switch(arguments.length){case 2:return IV.g(arguments[0],arguments[1]);case 3:return IV.j(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",v.h(arguments.length)].join(""));}};IV.g=function(a,b){return IV.j(a,b,null)};
1219
1219
  IV.j=function(a,b,c){function d(){return l(new Y(null,2,5,Z,[rg,h.g?h.g(a,g):h.call(null,a,g)],null))}c=X(c);var e=x.g(c,vE),f=x.g(c,ar),g=Lk(b,new Y(null,2,5,Z,[oB,qq],null),!0),h=function(){function m(p,r){return u(f)?EP.race(Qc(Gj.g(lP,new Y(null,2,5,Z,[f,GV(p,r)],null)))):GV(p,r)}return Ah.h?Ah.h(m):Ah.call(null,m)}(),k=FP(),l=function r(p){return HP(GP(JP(p),function(w){var A=R(w,0),C=R(w,1);return $O.g(null,function(){return lP(function(){var G=X(C),P=x.g(G,Yn);G=x.g(G,dE);if(z.g(P,200)){var V=
1220
1220
  X(G);G=x.g(V,pF);P=x.g(V,eG);var T=x.g(V,uz);V=x.g(V,ay);V=Jk(V,new Y(null,2,5,Z,[Xs,jz],null));if(u(G))return null;u(e)&&(e.h?e.h(P):e.call(null,P));u(T)?(G=Z,P=Ek.g(A,P),T=Lk(g,new Y(null,2,5,Z,[oB,jz],null),V),T=h.g?h.g(a,T):h.call(null,a,T),P=new q(null,2,[$v,TA,To,new Y(null,2,5,G,[P,T],null)],null)):P=Ek.g(A,P);return P}if(z.g(P,404))return A;throw Io(["Non 200 status code returned in paged api call for ",v.h(a)].join(""),g);}())})}),function(w,A){return null!=A?nP(k,A):Mg(w)&&z.g($v.h(w),TA)?