@nizza/core 0.1.0
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/README.md +3 -0
- package/dist/environments/environment.d.ts +20 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +12 -0
- package/dist/lib/domain/AggregateRoot.d.ts +10 -0
- package/dist/lib/domain/errors/DomainError.d.ts +12 -0
- package/dist/lib/domain/errors/api.d.ts +4 -0
- package/dist/lib/domain/errors/app.d.ts +7 -0
- package/dist/lib/domain/errors/index.d.ts +3 -0
- package/dist/lib/domain/index.d.ts +2 -0
- package/dist/lib/providers/StoreProvider.d.ts +10 -0
- package/dist/lib/providers/index.d.ts +1 -0
- package/dist/lib/types/api-graphql-types.d.ts +332 -0
- package/dist/lib/types/app-module.d.ts +8 -0
- package/dist/lib/types/index.d.ts +5 -0
- package/dist/lib/types/mobx-store.d.ts +3 -0
- package/dist/lib/types/utils.d.ts +20 -0
- package/dist/lib/utils/Result.d.ts +26 -0
- package/dist/lib/utils/apiCall.d.ts +2 -0
- package/dist/lib/utils/fingerprint.d.ts +1 -0
- package/dist/lib/utils/helpers.d.ts +5 -0
- package/dist/lib/utils/index.d.ts +5 -0
- package/dist/lib/utils/lazyLoad.d.ts +7 -0
- package/dist/typings/libs.d.ts +0 -0
- package/package.json +22 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const environment: {
|
|
2
|
+
AWS: {
|
|
3
|
+
region: string | undefined;
|
|
4
|
+
cognito: {
|
|
5
|
+
userPoolId: string;
|
|
6
|
+
userPoolWebClientId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
apiUrls: {
|
|
10
|
+
restV1: string;
|
|
11
|
+
restV2: string;
|
|
12
|
+
graphql: string;
|
|
13
|
+
};
|
|
14
|
+
publicUrls: {
|
|
15
|
+
platformSite: string;
|
|
16
|
+
nizzaCdn: string;
|
|
17
|
+
bundleSite: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default environment;
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var P=Object.defineProperty;var V=(e,n,i)=>n in e?P(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var s=(e,n,i)=>(V(e,typeof n!="symbol"?n+"":n,i),i);import U,{createContext as G,useContext as C,useMemo as M,lazy as q,Suspense as $}from"react";class h{constructor(n){s(this,"aggregate");s(this,"_numSetPropsApplied",0);this.aggregate=n}setProps(n){for(const[i,a]of Object.entries(n))i in this.aggregate&&(this.aggregate[i]=a);this._numSetPropsApplied++}get isFirstSetProps(){return this._numSetPropsApplied===1}}class c extends Error{constructor(n,i,a){super(i),this.message=i,this.value=a,this.name=n}toDTO(){return{name:this.name,message:this.message,...this.value&&{value:this.value}}}}class L extends c{constructor(n){super("RESOURCE_NOT_FOUND_ERROR",`Resource with id '${n}' not found.`,n)}}class z extends c{constructor(n){var i;super("APP_UNEXPECTED_ERROR",(i=n.message)!=null?i:"An unexpected error occurred.",n)}}class B extends c{constructor(){super("APP_ACCOUNT_INVALID_ERROR","Account not defined")}}var b={exports:{}},u={};/*
|
|
2
|
+
object-assign
|
|
3
|
+
(c) Sindre Sorhus
|
|
4
|
+
@license MIT
|
|
5
|
+
*/var E=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;function X(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function J(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var n={},i=0;i<10;i++)n["_"+String.fromCharCode(i)]=i;var a=Object.getOwnPropertyNames(n).map(function(d){return n[d]});if(a.join("")!=="0123456789")return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach(function(d){t[d]=d}),Object.keys(Object.assign({},t)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}J();/** @license React v17.0.2
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/var W=U,O=60103;if(u.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var D=Symbol.for;O=D("react.element"),u.Fragment=D("react.fragment")}var Y=W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Z=Object.prototype.hasOwnProperty,K={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,i){var a,t={},d=null,l=null;i!==void 0&&(d=""+i),n.key!==void 0&&(d=""+n.key),n.ref!==void 0&&(l=n.ref);for(a in n)Z.call(n,a)&&!K.hasOwnProperty(a)&&(t[a]=n[a]);if(e&&e.defaultProps)for(a in n=e.defaultProps,n)t[a]===void 0&&(t[a]=n[a]);return{$$typeof:O,type:e,key:d,ref:l,props:t,_owner:Y.current}}u.jsx=T,u.jsxs=T,b.exports=u;const f=b.exports.jsx;let S=new Map;const g=G(S),ee=({children:e,stores:n})=>{const i=C(g),a=M(()=>{if(!n.length)return i;const t=new Map;return n.forEach(d=>{let l;try{l=d()}catch{l=new d}t.set(d,l)}),S=new Map([...i,...t])},[n]);return f(g.Provider,{value:a,children:e})};function ne(e){return C(g).get(e)}function ie(e){return S.get(e)}var I=(e=>(e.Add="add",e.Remove="remove",e))(I||{}),_=(e=>(e.Active="active",e.Inactive="inactive",e))(_||{});const ae={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},oe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ManageCollectionProduct"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ManageCollectionProductInInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"manageCollectionProduct"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},re={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},me={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]};var se=Object.freeze(Object.defineProperty({__proto__:null,Methods:I,Status:_,AddCollectionDocument:ae,DeleteCollectionDocument:te,FindCollectionDocument:de,GetAllCollectionsDocument:le,ManageCollectionProductDocument:oe,SearchCollectionsDocument:re,UpdateCollectionDocument:me},Symbol.toStringTag,{value:"Module"}));async function ue({url:e,method:n="GET",raw:i=!1,...a}){var r;const t={"Content-Type":"application/json",...a.headers},d=await fetch(e,{method:n,...a,headers:t});if(i)return d;const l=await d.json();if(!d.ok){const m=(r=l==null?void 0:l.message)!=null?r:d.statusText;throw new Error(m)}return l}function ke(e=8){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";const a=n.length;for(let t=0;t<e;t++)i+=n.charAt(Math.floor(Math.random()*a));return i}function ce(e){return new h(e)}const ve=e=>{const n=Object.entries(e).map(([i,a])=>`${i}=${a}`).join("&");return n?`?${n}`:""},pe=(e,n,i={fallback:null})=>{let a=e;n&&(a=()=>e().then(d=>({default:n(d)})));const t=q(a);return d=>f($,{fallback:i.fallback,children:f(t,{...d})})};class k{constructor(n,i,a){s(this,"isOk");s(this,"isErr");s(this,"error");s(this,"_value");if(n&&i)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!n&&!i)throw new Error("InvalidOperation: A failing result needs to contain an error message");this.isOk=n,this.isErr=!n,this.error=i,this._value=a,Object.freeze(this)}get value(){if(this.isErr)throw new Error("Can't get the value of an error result. Use 'errorValue' instead.");return this._value}static ok(n){return new k(!0,void 0,n)}static fail(n){return new k(!1,n)}static combine(n){for(const i of n)if(i.isErr)return i;return k.ok()}}class w{constructor(n){s(this,"value");this.value=n}isErr(){return!0}isOk(){return!1}}class A{constructor(n){s(this,"value");this.value=n}isErr(){return!1}isOk(){return!0}}const Ne=e=>new w(e),fe=e=>new A(e);/*! js-cookie v3.0.1 | MIT */function v(e){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var a in i)e[a]=i[a]}return e}var Se={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function F(e,n){function i(t,d,l){if(typeof document!="undefined"){l=v({},n,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var m in l)!l[m]||(r+="; "+m,l[m]!==!0&&(r+="="+l[m].split(";")[0]));return document.cookie=t+"="+e.write(d,t)+r}}function a(t){if(!(typeof document=="undefined"||arguments.length&&!t)){for(var d=document.cookie?document.cookie.split("; "):[],l={},r=0;r<d.length;r++){var m=d[r].split("="),x=m.slice(1).join("=");try{var N=decodeURIComponent(m[0]);if(l[N]=e.read(x,N),t===N)break}catch{}}return t?l[t]:l}}return Object.create({set:i,get:a,remove:function(t,d){i(t,"",v({},d,{expires:-1}))},withAttributes:function(t){return F(this.converter,v({},this.attributes,t))},withConverter:function(t){return F(v({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}var j=F(Se,{path:"/"}),p,ge=new Uint8Array(16);function Fe(){if(!p&&(p=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!p))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return p(ge)}var ye=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ce(e){return typeof e=="string"&&ye.test(e)}for(var o=[],y=0;y<256;++y)o.push((y+256).toString(16).substr(1));function he(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=(o[e[n+0]]+o[e[n+1]]+o[e[n+2]]+o[e[n+3]]+"-"+o[e[n+4]]+o[e[n+5]]+"-"+o[e[n+6]]+o[e[n+7]]+"-"+o[e[n+8]]+o[e[n+9]]+"-"+o[e[n+10]]+o[e[n+11]]+o[e[n+12]]+o[e[n+13]]+o[e[n+14]]+o[e[n+15]]).toLowerCase();if(!Ce(i))throw TypeError("Stringified UUID is invalid");return i}function be(e,n,i){e=e||{};var a=e.random||(e.rng||Fe)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,n){i=i||0;for(var t=0;t<16;++t)n[i+t]=a[t];return n}return he(a)}const R="FINGERPRINT_LIVE_SHOPPING",Ee=()=>{let e=j.get(R);return e||(e=be(),j.set(R,e,{expires:1}),e)};export{B as AccountInvalidError,h as AggregateRoot,se as ApiGraphqlTypes,c as DomainError,w as Err,A as Ok,L as ResourceNotFoundError,k as Result,ee as StoreProvider,z as UnexpectedError,ue as apiCall,ce as createAggregateRoot,fe as err,Ee as getFingerprint,ie as getStore,pe as lazyLoad,Ne as ok,ve as searchParams,ke as shortId,ne as useStore};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface IAggregateRoot {
|
|
2
|
+
toPrimitives: () => Record<string, any>;
|
|
3
|
+
}
|
|
4
|
+
export declare class AggregateRoot<Aggregate, Props> {
|
|
5
|
+
private aggregate;
|
|
6
|
+
private _numSetPropsApplied;
|
|
7
|
+
constructor(aggregate: Aggregate);
|
|
8
|
+
setProps(props: Partial<Props>): void;
|
|
9
|
+
get isFirstSetProps(): boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface DomainErrorDTO {
|
|
2
|
+
name: string;
|
|
3
|
+
message: string;
|
|
4
|
+
value?: any;
|
|
5
|
+
}
|
|
6
|
+
export declare class DomainError extends Error {
|
|
7
|
+
message: string;
|
|
8
|
+
value?: any;
|
|
9
|
+
constructor(name: string, message: string, value?: any);
|
|
10
|
+
toDTO(): DomainErrorDTO;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { StoreClass, StoreFactory } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
stores: (StoreClass | StoreFactory)[];
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const StoreProvider: FC<Props>;
|
|
8
|
+
export declare function useStore<T>(identifier: StoreClass<T>): T;
|
|
9
|
+
export declare function getStore<T>(identifier: StoreClass<T>): T;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StoreProvider';
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
+
export declare type Maybe<T> = T | null;
|
|
3
|
+
export declare type InputMaybe<T> = Maybe<T>;
|
|
4
|
+
export declare type Exact<T extends {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}> = {
|
|
7
|
+
[K in keyof T]: T[K];
|
|
8
|
+
};
|
|
9
|
+
export declare type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
10
|
+
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
11
|
+
};
|
|
12
|
+
export declare type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
13
|
+
[SubKey in K]: Maybe<T[SubKey]>;
|
|
14
|
+
};
|
|
15
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
16
|
+
export declare type Scalars = {
|
|
17
|
+
ID: string;
|
|
18
|
+
String: string;
|
|
19
|
+
Boolean: boolean;
|
|
20
|
+
Int: number;
|
|
21
|
+
Float: number;
|
|
22
|
+
DateTime: any;
|
|
23
|
+
};
|
|
24
|
+
export declare type Collection = {
|
|
25
|
+
__typename?: 'Collection';
|
|
26
|
+
account?: Maybe<Scalars['String']>;
|
|
27
|
+
createdat?: Maybe<Scalars['DateTime']>;
|
|
28
|
+
description?: Maybe<Scalars['String']>;
|
|
29
|
+
duration?: Maybe<Scalars['String']>;
|
|
30
|
+
id: Scalars['String'];
|
|
31
|
+
isArray?: Maybe<Scalars['Boolean']>;
|
|
32
|
+
method?: Maybe<Scalars['String']>;
|
|
33
|
+
name: Scalars['String'];
|
|
34
|
+
path?: Maybe<Scalars['String']>;
|
|
35
|
+
products?: Maybe<Array<Product>>;
|
|
36
|
+
status?: Maybe<Scalars['String']>;
|
|
37
|
+
};
|
|
38
|
+
export declare type CollectionResult = CollectionSuccess | ErrorGeneral;
|
|
39
|
+
export declare type CollectionResultArray = CollectionSuccessArray | ErrorGeneral;
|
|
40
|
+
export declare type CollectionSuccess = {
|
|
41
|
+
__typename?: 'CollectionSuccess';
|
|
42
|
+
data?: Maybe<Collection>;
|
|
43
|
+
duration?: Maybe<Scalars['String']>;
|
|
44
|
+
isArray?: Maybe<Scalars['Boolean']>;
|
|
45
|
+
method?: Maybe<Scalars['String']>;
|
|
46
|
+
path?: Maybe<Scalars['String']>;
|
|
47
|
+
};
|
|
48
|
+
export declare type CollectionSuccessArray = {
|
|
49
|
+
__typename?: 'CollectionSuccessArray';
|
|
50
|
+
data?: Maybe<Array<Collection>>;
|
|
51
|
+
duration?: Maybe<Scalars['String']>;
|
|
52
|
+
isArray?: Maybe<Scalars['Boolean']>;
|
|
53
|
+
method?: Maybe<Scalars['String']>;
|
|
54
|
+
path?: Maybe<Scalars['String']>;
|
|
55
|
+
};
|
|
56
|
+
export declare type CreateCollectionInput = {
|
|
57
|
+
account: Scalars['String'];
|
|
58
|
+
description?: InputMaybe<Scalars['String']>;
|
|
59
|
+
name: Scalars['String'];
|
|
60
|
+
status?: InputMaybe<Status>;
|
|
61
|
+
};
|
|
62
|
+
export declare type Error = {
|
|
63
|
+
message: Scalars['String'];
|
|
64
|
+
statusCode: Scalars['String'];
|
|
65
|
+
timestamp: Scalars['String'];
|
|
66
|
+
};
|
|
67
|
+
export declare type ErrorGeneral = Error & {
|
|
68
|
+
__typename?: 'ErrorGeneral';
|
|
69
|
+
message: Scalars['String'];
|
|
70
|
+
statusCode: Scalars['String'];
|
|
71
|
+
timestamp: Scalars['String'];
|
|
72
|
+
};
|
|
73
|
+
export declare type ManageCollectionProductInInput = {
|
|
74
|
+
account: Scalars['String'];
|
|
75
|
+
id: Scalars['String'];
|
|
76
|
+
method: Methods;
|
|
77
|
+
productId: Scalars['String'];
|
|
78
|
+
};
|
|
79
|
+
export declare enum Methods {
|
|
80
|
+
Add = "add",
|
|
81
|
+
Remove = "remove"
|
|
82
|
+
}
|
|
83
|
+
export declare type Mutation = {
|
|
84
|
+
__typename?: 'Mutation';
|
|
85
|
+
createCollection: CollectionResult;
|
|
86
|
+
deleteCollection: CollectionResult;
|
|
87
|
+
manageCollectionProduct: CollectionResult;
|
|
88
|
+
updateCollection: CollectionResult;
|
|
89
|
+
};
|
|
90
|
+
export declare type MutationCreateCollectionArgs = {
|
|
91
|
+
data: CreateCollectionInput;
|
|
92
|
+
};
|
|
93
|
+
export declare type MutationDeleteCollectionArgs = {
|
|
94
|
+
data: QueryInput;
|
|
95
|
+
};
|
|
96
|
+
export declare type MutationManageCollectionProductArgs = {
|
|
97
|
+
data: ManageCollectionProductInInput;
|
|
98
|
+
};
|
|
99
|
+
export declare type MutationUpdateCollectionArgs = {
|
|
100
|
+
data: UpdateCollectionInput;
|
|
101
|
+
};
|
|
102
|
+
export declare type Product = {
|
|
103
|
+
__typename?: 'Product';
|
|
104
|
+
account: Scalars['String'];
|
|
105
|
+
createdat?: Maybe<Scalars['String']>;
|
|
106
|
+
id: Scalars['String'];
|
|
107
|
+
link?: Maybe<Scalars['String']>;
|
|
108
|
+
pictures?: Maybe<Array<Scalars['String']>>;
|
|
109
|
+
price: Scalars['Float'];
|
|
110
|
+
salesprice?: Maybe<Scalars['Float']>;
|
|
111
|
+
status?: Maybe<Status>;
|
|
112
|
+
title: Scalars['String'];
|
|
113
|
+
};
|
|
114
|
+
export declare type Query = {
|
|
115
|
+
__typename?: 'Query';
|
|
116
|
+
findCollection: CollectionResult;
|
|
117
|
+
getAllCollection: CollectionResultArray;
|
|
118
|
+
searchCollection: CollectionResultArray;
|
|
119
|
+
};
|
|
120
|
+
export declare type QueryFindCollectionArgs = {
|
|
121
|
+
data: QueryInput;
|
|
122
|
+
};
|
|
123
|
+
export declare type QueryGetAllCollectionArgs = {
|
|
124
|
+
data: QueryInput;
|
|
125
|
+
};
|
|
126
|
+
export declare type QuerySearchCollectionArgs = {
|
|
127
|
+
data: QueryInput;
|
|
128
|
+
};
|
|
129
|
+
export declare type QueryInput = {
|
|
130
|
+
account: Scalars['String'];
|
|
131
|
+
id?: InputMaybe<Scalars['String']>;
|
|
132
|
+
limit?: InputMaybe<Scalars['Float']>;
|
|
133
|
+
page?: InputMaybe<Scalars['Float']>;
|
|
134
|
+
search?: InputMaybe<Scalars['String']>;
|
|
135
|
+
};
|
|
136
|
+
export declare enum Status {
|
|
137
|
+
Active = "active",
|
|
138
|
+
Inactive = "inactive"
|
|
139
|
+
}
|
|
140
|
+
export declare type UpdateCollectionInput = {
|
|
141
|
+
account: Scalars['String'];
|
|
142
|
+
description?: InputMaybe<Scalars['String']>;
|
|
143
|
+
id: Scalars['String'];
|
|
144
|
+
name?: InputMaybe<Scalars['String']>;
|
|
145
|
+
status?: InputMaybe<Status>;
|
|
146
|
+
};
|
|
147
|
+
export declare type AddCollectionMutationVariables = Exact<{
|
|
148
|
+
data: CreateCollectionInput;
|
|
149
|
+
}>;
|
|
150
|
+
export declare type AddCollectionMutation = {
|
|
151
|
+
__typename?: 'Mutation';
|
|
152
|
+
createCollection: {
|
|
153
|
+
__typename: 'CollectionSuccess';
|
|
154
|
+
data?: {
|
|
155
|
+
__typename?: 'Collection';
|
|
156
|
+
id: string;
|
|
157
|
+
} | null;
|
|
158
|
+
} | {
|
|
159
|
+
__typename: 'ErrorGeneral';
|
|
160
|
+
message: string;
|
|
161
|
+
statusCode: string;
|
|
162
|
+
timestamp: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
export declare type DeleteCollectionMutationVariables = Exact<{
|
|
166
|
+
data: QueryInput;
|
|
167
|
+
}>;
|
|
168
|
+
export declare type DeleteCollectionMutation = {
|
|
169
|
+
__typename?: 'Mutation';
|
|
170
|
+
deleteCollection: {
|
|
171
|
+
__typename: 'CollectionSuccess';
|
|
172
|
+
} | {
|
|
173
|
+
__typename: 'ErrorGeneral';
|
|
174
|
+
message: string;
|
|
175
|
+
statusCode: string;
|
|
176
|
+
timestamp: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
export declare type FindCollectionQueryVariables = Exact<{
|
|
180
|
+
data: QueryInput;
|
|
181
|
+
}>;
|
|
182
|
+
export declare type FindCollectionQuery = {
|
|
183
|
+
__typename?: 'Query';
|
|
184
|
+
findCollection: {
|
|
185
|
+
__typename: 'CollectionSuccess';
|
|
186
|
+
data?: {
|
|
187
|
+
__typename?: 'Collection';
|
|
188
|
+
id: string;
|
|
189
|
+
account?: string | null;
|
|
190
|
+
name: string;
|
|
191
|
+
description?: string | null;
|
|
192
|
+
status?: string | null;
|
|
193
|
+
createdat?: any | null;
|
|
194
|
+
products?: Array<{
|
|
195
|
+
__typename?: 'Product';
|
|
196
|
+
id: string;
|
|
197
|
+
account: string;
|
|
198
|
+
title: string;
|
|
199
|
+
link?: string | null;
|
|
200
|
+
pictures?: Array<string> | null;
|
|
201
|
+
price: number;
|
|
202
|
+
salesprice?: number | null;
|
|
203
|
+
status?: Status | null;
|
|
204
|
+
createdat?: string | null;
|
|
205
|
+
}> | null;
|
|
206
|
+
} | null;
|
|
207
|
+
} | {
|
|
208
|
+
__typename: 'ErrorGeneral';
|
|
209
|
+
message: string;
|
|
210
|
+
statusCode: string;
|
|
211
|
+
timestamp: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
export declare type GetAllCollectionsQueryVariables = Exact<{
|
|
215
|
+
data: QueryInput;
|
|
216
|
+
}>;
|
|
217
|
+
export declare type GetAllCollectionsQuery = {
|
|
218
|
+
__typename?: 'Query';
|
|
219
|
+
getAllCollection: {
|
|
220
|
+
__typename: 'CollectionSuccessArray';
|
|
221
|
+
data?: Array<{
|
|
222
|
+
__typename?: 'Collection';
|
|
223
|
+
id: string;
|
|
224
|
+
account?: string | null;
|
|
225
|
+
name: string;
|
|
226
|
+
description?: string | null;
|
|
227
|
+
status?: string | null;
|
|
228
|
+
createdat?: any | null;
|
|
229
|
+
products?: Array<{
|
|
230
|
+
__typename?: 'Product';
|
|
231
|
+
id: string;
|
|
232
|
+
account: string;
|
|
233
|
+
title: string;
|
|
234
|
+
link?: string | null;
|
|
235
|
+
pictures?: Array<string> | null;
|
|
236
|
+
price: number;
|
|
237
|
+
salesprice?: number | null;
|
|
238
|
+
status?: Status | null;
|
|
239
|
+
createdat?: string | null;
|
|
240
|
+
}> | null;
|
|
241
|
+
}> | null;
|
|
242
|
+
} | {
|
|
243
|
+
__typename: 'ErrorGeneral';
|
|
244
|
+
message: string;
|
|
245
|
+
statusCode: string;
|
|
246
|
+
timestamp: string;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
export declare type ManageCollectionProductMutationVariables = Exact<{
|
|
250
|
+
data: ManageCollectionProductInInput;
|
|
251
|
+
}>;
|
|
252
|
+
export declare type ManageCollectionProductMutation = {
|
|
253
|
+
__typename?: 'Mutation';
|
|
254
|
+
manageCollectionProduct: {
|
|
255
|
+
__typename: 'CollectionSuccess';
|
|
256
|
+
} | {
|
|
257
|
+
__typename: 'ErrorGeneral';
|
|
258
|
+
message: string;
|
|
259
|
+
statusCode: string;
|
|
260
|
+
timestamp: string;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
export declare type SearchCollectionsQueryVariables = Exact<{
|
|
264
|
+
data: QueryInput;
|
|
265
|
+
}>;
|
|
266
|
+
export declare type SearchCollectionsQuery = {
|
|
267
|
+
__typename?: 'Query';
|
|
268
|
+
searchCollection: {
|
|
269
|
+
__typename: 'CollectionSuccessArray';
|
|
270
|
+
data?: Array<{
|
|
271
|
+
__typename?: 'Collection';
|
|
272
|
+
id: string;
|
|
273
|
+
account?: string | null;
|
|
274
|
+
name: string;
|
|
275
|
+
description?: string | null;
|
|
276
|
+
status?: string | null;
|
|
277
|
+
createdat?: any | null;
|
|
278
|
+
products?: Array<{
|
|
279
|
+
__typename?: 'Product';
|
|
280
|
+
id: string;
|
|
281
|
+
account: string;
|
|
282
|
+
title: string;
|
|
283
|
+
link?: string | null;
|
|
284
|
+
pictures?: Array<string> | null;
|
|
285
|
+
price: number;
|
|
286
|
+
salesprice?: number | null;
|
|
287
|
+
status?: Status | null;
|
|
288
|
+
createdat?: string | null;
|
|
289
|
+
}> | null;
|
|
290
|
+
}> | null;
|
|
291
|
+
} | {
|
|
292
|
+
__typename: 'ErrorGeneral';
|
|
293
|
+
message: string;
|
|
294
|
+
statusCode: string;
|
|
295
|
+
timestamp: string;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
export declare type UpdateCollectionMutationVariables = Exact<{
|
|
299
|
+
data: UpdateCollectionInput;
|
|
300
|
+
}>;
|
|
301
|
+
export declare type UpdateCollectionMutation = {
|
|
302
|
+
__typename?: 'Mutation';
|
|
303
|
+
updateCollection: {
|
|
304
|
+
__typename: 'CollectionSuccess';
|
|
305
|
+
} | {
|
|
306
|
+
__typename: 'ErrorGeneral';
|
|
307
|
+
message: string;
|
|
308
|
+
statusCode: string;
|
|
309
|
+
timestamp: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
export declare const AddCollectionDocument: DocumentNode<AddCollectionMutation, Exact<{
|
|
313
|
+
data: CreateCollectionInput;
|
|
314
|
+
}>>;
|
|
315
|
+
export declare const DeleteCollectionDocument: DocumentNode<DeleteCollectionMutation, Exact<{
|
|
316
|
+
data: QueryInput;
|
|
317
|
+
}>>;
|
|
318
|
+
export declare const FindCollectionDocument: DocumentNode<FindCollectionQuery, Exact<{
|
|
319
|
+
data: QueryInput;
|
|
320
|
+
}>>;
|
|
321
|
+
export declare const GetAllCollectionsDocument: DocumentNode<GetAllCollectionsQuery, Exact<{
|
|
322
|
+
data: QueryInput;
|
|
323
|
+
}>>;
|
|
324
|
+
export declare const ManageCollectionProductDocument: DocumentNode<ManageCollectionProductMutation, Exact<{
|
|
325
|
+
data: ManageCollectionProductInInput;
|
|
326
|
+
}>>;
|
|
327
|
+
export declare const SearchCollectionsDocument: DocumentNode<SearchCollectionsQuery, Exact<{
|
|
328
|
+
data: QueryInput;
|
|
329
|
+
}>>;
|
|
330
|
+
export declare const UpdateCollectionDocument: DocumentNode<UpdateCollectionMutation, Exact<{
|
|
331
|
+
data: UpdateCollectionInput;
|
|
332
|
+
}>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import environment from '../../environments/environment';
|
|
2
|
+
export declare type Constructor<T = any> = new (...args: any[]) => T;
|
|
3
|
+
export interface ApiV1Response<T = any> {
|
|
4
|
+
success: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
data: T;
|
|
7
|
+
}
|
|
8
|
+
export interface ApiV2Response<T = any> {
|
|
9
|
+
data: T;
|
|
10
|
+
isArray: boolean;
|
|
11
|
+
path: string;
|
|
12
|
+
duration: string;
|
|
13
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
14
|
+
}
|
|
15
|
+
export declare type Primitive = string | boolean | number;
|
|
16
|
+
export interface ApiCall extends RequestInit {
|
|
17
|
+
url: RequestInfo;
|
|
18
|
+
raw?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare type Environment<T> = typeof environment & T;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare class Result<V, E = string> {
|
|
2
|
+
isOk: boolean;
|
|
3
|
+
isErr: boolean;
|
|
4
|
+
error: E;
|
|
5
|
+
private _value;
|
|
6
|
+
constructor(isOk: boolean, error?: E, value?: V);
|
|
7
|
+
get value(): V;
|
|
8
|
+
static ok<U>(value?: U): Result<U, never>;
|
|
9
|
+
static fail<F = string>(error: F): Result<never, F>;
|
|
10
|
+
static combine(results: Result<any, any>[]): Result<any, any>;
|
|
11
|
+
}
|
|
12
|
+
export declare type Either<L, A> = Err<L, A> | Ok<L, A>;
|
|
13
|
+
export declare class Err<L, A> {
|
|
14
|
+
readonly value: L;
|
|
15
|
+
constructor(value: L);
|
|
16
|
+
isErr(): this is Err<L, A>;
|
|
17
|
+
isOk(): this is Ok<L, A>;
|
|
18
|
+
}
|
|
19
|
+
export declare class Ok<L, A> {
|
|
20
|
+
readonly value: A;
|
|
21
|
+
constructor(value: A);
|
|
22
|
+
isErr(): this is Err<L, A>;
|
|
23
|
+
isOk(): this is Ok<L, A>;
|
|
24
|
+
}
|
|
25
|
+
export declare const ok: <L, A>(l: L) => Either<L, A>;
|
|
26
|
+
export declare const err: <L, A>(a: A) => Either<L, A>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getFingerprint: () => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AggregateRoot } from '../domain';
|
|
2
|
+
import { Primitive } from '../types';
|
|
3
|
+
export declare function shortId(length?: number): string;
|
|
4
|
+
export declare function createAggregateRoot<Props, Aggregate>(aggregate: Aggregate): AggregateRoot<Aggregate, Props>;
|
|
5
|
+
export declare const searchParams: (params: Record<string, Primitive>) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Opts {
|
|
3
|
+
fallback: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare type Unpromisify<T> = T extends Promise<infer P> ? P : never;
|
|
6
|
+
export declare const lazyLoad: <T extends Promise<any>, U extends React.ComponentType<any>>(importFunc: () => T, selectorFunc?: ((s: Unpromisify<T>) => U) | undefined, opts?: Opts) => (props: React.ComponentProps<U>) => JSX.Element;
|
|
7
|
+
export {};
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nizza/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "dist/index.es.js",
|
|
5
|
+
"module": "dist/index.es.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"source": "src/index.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"js-cookie": "^3.0.1",
|
|
13
|
+
"uuid": "^8.3.2"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/js-cookie": "^3.0.2",
|
|
17
|
+
"@types/uuid": "^8.3.1"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "rimraf dist"
|
|
21
|
+
}
|
|
22
|
+
}
|