@actdim/dynstruct 1.1.1 → 1.1.3
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/appDomain/appContracts.d.ts +3 -3
- package/dist/appDomain/appContracts.d.ts.map +1 -1
- package/dist/appDomain/appContracts.es.js.map +1 -1
- package/dist/appDomain/security/securityContracts.d.ts +1 -1
- package/dist/appDomain/security/securityContracts.d.ts.map +1 -1
- package/dist/appDomain/security/securityContracts.es.js.map +1 -1
- package/dist/appDomain/security/securityProvider.d.ts +1 -1
- package/dist/appDomain/security/securityProvider.d.ts.map +1 -1
- package/dist/appDomain/security/securityProvider.es.js +62 -62
- package/dist/appDomain/security/securityProvider.es.js.map +1 -1
- package/dist/componentModel/DynamicContent.d.ts +2 -2
- package/dist/componentModel/DynamicContent.d.ts.map +1 -1
- package/dist/componentModel/DynamicContent.es.js +1 -1
- package/dist/componentModel/DynamicContent.es.js.map +1 -1
- package/dist/componentModel/adapters.d.ts +13 -7
- package/dist/componentModel/adapters.d.ts.map +1 -1
- package/dist/componentModel/adapters.es.js +22 -17
- package/dist/componentModel/adapters.es.js.map +1 -1
- package/dist/componentModel/componentContext.d.ts.map +1 -1
- package/dist/componentModel/componentContext.es.js +58 -56
- package/dist/componentModel/componentContext.es.js.map +1 -1
- package/dist/componentModel/contracts.d.ts +173 -4
- package/dist/componentModel/contracts.d.ts.map +1 -1
- package/dist/componentModel/contracts.es.js +11 -1
- package/dist/componentModel/contracts.es.js.map +1 -1
- package/dist/componentModel/core.d.ts +17 -0
- package/dist/componentModel/core.d.ts.map +1 -0
- package/dist/componentModel/core.es.js +162 -0
- package/dist/componentModel/core.es.js.map +1 -0
- package/dist/componentModel/react.d.ts +5 -0
- package/dist/componentModel/react.d.ts.map +1 -0
- package/dist/componentModel/react.es.js +201 -0
- package/dist/componentModel/react.es.js.map +1 -0
- package/dist/net/client.d.ts +2 -1
- package/dist/net/client.d.ts.map +1 -1
- package/dist/net/client.es.js +46 -45
- package/dist/net/client.es.js.map +1 -1
- package/dist/services/NavService.d.ts +1 -1
- package/dist/services/NavService.d.ts.map +1 -1
- package/dist/services/NavService.es.js +9 -9
- package/dist/services/NavService.es.js.map +1 -1
- package/dist/services/StorageService.d.ts +4 -3
- package/dist/services/StorageService.d.ts.map +1 -1
- package/dist/services/StorageService.es.js +15 -15
- package/dist/services/StorageService.es.js.map +1 -1
- package/package.json +8 -7
- package/dist/componentModel/componentModel.d.ts +0 -165
- package/dist/componentModel/componentModel.d.ts.map +0 -1
- package/dist/componentModel/componentModel.es.js +0 -343
- package/dist/componentModel/componentModel.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.es.js","sources":["../../src/net/client.ts"],"sourcesContent":["import { v4 as uuid } from \"uuid\";\r\nimport httpStatus from \"http-status\";\r\nimport { getResponseResult, IFetcher, IRequestCallbacks, IRequestParams, IRequestState } from \"./request\";\r\nimport { ApiError } from \"./apiError\";\r\nimport { BaseAppMsgStruct, BaseAppContext } from \"@/appDomain/appContracts\";\r\nimport { MsgBus } from \"@actdim/msgmesh/msgBusCore\";\r\n\r\n// MLWEB-2172\r\n\r\n// TODO: support request cancellation\r\n// https://stackoverflow.com/questions/31061838/how-do-i-cancel-an-http-fetch-request\r\n// https://mukeshprajapati0251.medium.com/cancel-rest-api-pending-request-1af65e70366d\r\n\r\nexport function extractApiName(name: string, suffixes: string[]): string | null {\r\n if (!name) {\r\n return name;\r\n }\r\n const escaped = suffixes.map((s) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"));\r\n const group = escaped.join(\"|\");\r\n const pattern = new RegExp(`(_?(${group}))+?$`, \"i\");\r\n\r\n let result = name.replace(pattern, \"\");\r\n\r\n result = result.trim();\r\n return result.length > 0 ? result : name;\r\n}\r\n\r\nconst API_SUFFIXES = [\"api\", \"controller\", \"client\", \"fetcher\"];\r\n// App(Api)ClientBase\r\nexport class ClientBase {\r\n protected baseUrl: string;\r\n protected name: string;\r\n // private requestStates\r\n private requestStateMap: Map<string, IRequestState>;\r\n\r\n private fetcher: IFetcher;\r\n\r\n private msgBus: MsgBus<BaseAppMsgStruct>;\r\n\r\n private accessToken: string;\r\n\r\n private init: Promise<any>;\r\n\r\n constructor(context: BaseAppContext, fetcher?: IFetcher) {\r\n this.fetcher = fetcher || window;\r\n this.requestStateMap = new Map<string, IRequestState>();\r\n this.msgBus = context.msgBus;\r\n // TODO: unsubscribe\r\n this.msgBus.on({\r\n channel: \"APP-SECURITY-AUTH-SIGNIN\",\r\n group: \"out\",\r\n callback: (msg) => {\r\n this.accessToken = msg.payload.accessToken;\r\n }\r\n });\r\n this.init = Promise.all([this.getBaseUrlAsync(), this.updateSecurityAsync()]);\r\n }\r\n\r\n protected async getBaseUrlAsync() {\r\n const msg = await this.msgBus.dispatchAsync({\r\n channel: \"APP-CONFIG-GET\"\r\n });\r\n const config = msg.payload;\r\n const apiName = extractApiName(this.name, API_SUFFIXES);\r\n const apiEntry = Object.entries(config.apis).find((entry) => entry[0].toLowerCase() === apiName?.toLowerCase());\r\n this.baseUrl = apiEntry?.[1].url || config.baseUrl;\r\n }\r\n\r\n private async updateSecurityAsync() {\r\n if (!this.accessToken) {\r\n const msg = await this.msgBus.dispatchAsync({\r\n channel: \"APP-SECURITY-GET-CONTEXT\"\r\n });\r\n this.accessToken = msg.payload.accessToken;\r\n }\r\n return this.accessToken;\r\n }\r\n\r\n private async addAuthorizationAsync(request: IRequestParams) {\r\n const accessToken = await this.updateSecurityAsync();\r\n if (!accessToken) {\r\n throw ApiError.create({\r\n status: httpStatus.UNAUTHORIZED\r\n });\r\n }\r\n const authorizationHeader = \"Authorization\";\r\n const headers = request.headers;\r\n const headerValue = `Bearer ${accessToken}`;\r\n if (headers instanceof Headers) {\r\n // if (headers.has(authorizationHeader)) {\r\n // headers.delete(authorizationHeader)\r\n // }\r\n // headers.append(authorizationHeader, headerValue);\r\n headers.set(authorizationHeader, headerValue);\r\n } else {\r\n throw new Error(\"Unsupported headers\"); // object type\r\n }\r\n }\r\n\r\n private async executeRequestInternalAsync(request: IRequestState) {\r\n try {\r\n let proceed = true;\r\n const onBeforeSendRequest = request.callbacks && request.callbacks.onBeforeSendRequest;\r\n if (onBeforeSendRequest) {\r\n const event = {\r\n request: request,\r\n cancel: false,\r\n handled: false\r\n } as Parameters<IRequestCallbacks[\"onBeforeSendRequest\"]>[0];\r\n await onBeforeSendRequest(event);\r\n if (event.cancel) {\r\n // interrupt\r\n proceed = false;\r\n request.status = \"canceled\";\r\n if (event.handled) {\r\n request.result = event.result;\r\n } else {\r\n // ApiError?\r\n throw new Error(\"The request was aborted\"); // has been? canceled?\r\n }\r\n }\r\n }\r\n if (proceed) {\r\n request.status = \"executing\";\r\n const response = await this.fetcher.fetch(request.url, request);\r\n ApiError.assert(response, request);\r\n let onResponseRead = request.callbacks && request.callbacks.onResponseRead;\r\n if (!onResponseRead) {\r\n onResponseRead = async (event) => {\r\n const result = await getResponseResult(response, request);\r\n event.result = result;\r\n };\r\n }\r\n const event = {\r\n response: response\r\n } as Parameters<IRequestCallbacks[\"onResponseRead\"]>[0];\r\n\r\n await onResponseRead(event);\r\n request.result = event.result;\r\n request.status = \"succeeded\";\r\n }\r\n } catch (err) {\r\n request.status = \"failed\";\r\n // throw ApiError.create(undefined, request);\r\n throw err;\r\n }\r\n return request;\r\n }\r\n\r\n private async executeRequestAsync(request: IRequestState): Promise<IRequestState> {\r\n let attempt = 0;\r\n do {\r\n try {\r\n if (request.useAuth) {\r\n await this.addAuthorizationAsync(request);\r\n }\r\n return await this.executeRequestInternalAsync(request);\r\n } catch (err) {\r\n if (err instanceof ApiError) {\r\n if (attempt > 0) {\r\n throw err;\r\n }\r\n if (err.status === httpStatus.UPGRADE_REQUIRED) {\r\n // await this.context.msgBus.dispatchAsync({\r\n // channel: \"APP_RELOAD\" // APP_REQUEST_UPDGRADE\r\n // });\r\n throw err;\r\n } else if (err.status === httpStatus.UNAUTHORIZED) {\r\n if (err.response?.headers?.get(\"token-expired\")) {\r\n // token expired or invalid\r\n await this.msgBus.dispatchAsync({\r\n channel: \"APP-SECURITY-AUTH-REFRESH\"\r\n });\r\n } else {\r\n await this.msgBus.dispatchAsync({\r\n channel: \"APP-SECURITY-REQUEST-AUTH\"\r\n });\r\n }\r\n // codes:\r\n // TOKEN_EXPIRED\r\n // TOKEN_INVALID\r\n // TOKEN_MISSING\r\n // AUTH_REQUIRED\r\n // header: WWW-Authenticate\r\n continue;\r\n }\r\n continue;\r\n }\r\n throw err;\r\n } finally {\r\n attempt++;\r\n }\r\n } while (true);\r\n }\r\n\r\n // T extends IApiResponse\r\n public async fetchAsync<T>(requestParams: IRequestParams): Promise<T> {\r\n await this.init;\r\n\r\n const defaultParams: Partial<IRequestParams> = {\r\n contentType: \"application/json\",\r\n method: \"POST\",\r\n body: null,\r\n headers: {},\r\n cache: \"default\",\r\n credentials: \"same-origin\",\r\n mode: \"cors\"\r\n };\r\n\r\n requestParams = { ...defaultParams, ...requestParams };\r\n if (!requestParams.id) {\r\n requestParams.id = uuid();\r\n }\r\n\r\n if (!(requestParams.headers instanceof Headers)) {\r\n requestParams.headers = new Headers(requestParams.headers);\r\n }\r\n\r\n requestParams.headers.append(\"Content-Type\", requestParams.contentType);\r\n // \"api-version\"\r\n\r\n if (requestParams.method === \"POST\") {\r\n if (!requestParams.body) {\r\n requestParams.body = \"\";\r\n }\r\n }\r\n\r\n let request = {\r\n ...requestParams,\r\n status: \"queued\",\r\n response: undefined,\r\n result: undefined\r\n } as IRequestState;\r\n\r\n this.requestStateMap.set(requestParams.id, request);\r\n\r\n await this.executeRequestAsync(request);\r\n return request.result;\r\n }\r\n}\r\n/* \r\nif (status === 404) {\r\n return response.text().then((_responseText) => {\r\n let result404: any = null;\r\n result404 = _responseText === \"\" ? null : JSON.parse(_responseText, this.jsonParseReviver) as __API__ProblemDetails;\r\n return throwException(\"Not Found\", status, _responseText, _headers, result404);\r\n });\r\n } else if (status !== 200 && status !== 204) {\r\n return response.text().then((_responseText) => {\r\n return throwException(\"An unexpected server error occurred.\", status, _responseText, _headers);\r\n });\r\n }\r\n\r\nBLOB\r\nlet reader = new FileReader();\r\n reader.onload = event => resolve((event.target as any).result);\r\n reader.readAsText(blob);\r\n*/\r\n"],"names":["extractApiName","name","suffixes","group","s","pattern","result","API_SUFFIXES","ClientBase","context","fetcher","msg","config","apiName","apiEntry","entry","request","accessToken","ApiError","httpStatus","authorizationHeader","headers","headerValue","proceed","onBeforeSendRequest","event","response","onResponseRead","getResponseResult","err","attempt","requestParams","uuid"],"mappings":";;;;AAaO,SAASA,EAAeC,GAAcC,GAAmC;AAC5E,MAAI,CAACD;AACD,WAAOA;AAGX,QAAME,IADUD,EAAS,IAAI,CAACE,MAAMA,EAAE,QAAQ,uBAAuB,MAAM,CAAC,EACtD,KAAK,GAAG,GACxBC,IAAU,IAAI,OAAO,OAAOF,CAAK,SAAS,GAAG;AAEnD,MAAIG,IAASL,EAAK,QAAQI,GAAS,EAAE;AAErC,SAAAC,IAASA,EAAO,KAAA,GACTA,EAAO,SAAS,IAAIA,IAASL;AACxC;AAEA,MAAMM,IAAe,CAAC,OAAO,cAAc,UAAU,SAAS;AAEvD,MAAMC,EAAW;AAAA,EACV;AAAA,EACA;AAAA;AAAA,EAEF;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAER,YAAYC,GAAyBC,GAAoB;AACrD,SAAK,UAAUA,KAAW,QAC1B,KAAK,sCAAsB,IAAA,GAC3B,KAAK,SAASD,EAAQ,QAEtB,KAAK,OAAO,GAAG;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,MACP,UAAU,CAACE,MAAQ;AACf,aAAK,cAAcA,EAAI,QAAQ;AAAA,MACnC;AAAA,IAAA,CACH,GACD,KAAK,OAAO,QAAQ,IAAI,CAAC,KAAK,mBAAmB,KAAK,oBAAA,CAAqB,CAAC;AAAA,EAChF;AAAA,EAEA,MAAgB,kBAAkB;AAI9B,UAAMC,KA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AgB,EAAE,GAV6B;AAAA,MAC3C,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,SAAS,CAAA;AAAA,MACT,OAAO;AAAA,MACP,aAAa;AAAA,MACb,MAAM;AAAA,IAAA,GAG0B,GAAGA,EAAA,GAClCA,EAAc,OACfA,EAAc,KAAKC,EAAA,IAGjBD,EAAc,mBAAmB,YACnCA,EAAc,UAAU,IAAI,QAAQA,EAAc,OAAO,IAG7DA,EAAc,QAAQ,OAAO,gBAAgBA,EAAc,WAAW,GAGlEA,EAAc,WAAW,WACpBA,EAAc,SACfA,EAAc,OAAO;AAI7B,QAAIf,IAAU;AAAA,MACV,GAAGe;AAAA,MACH,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,QAAQ;AAAA,IAAA;AAGZ,gBAAK,gBAAgB,IAAIA,EAAc,IAAIf,CAAO,GAElD,MAAM,KAAK,oBAAoBA,CAAO,GAC/BA,EAAQ;AAAA,EACnB;AACJ;"}
|
|
1
|
+
{"version":3,"file":"client.es.js","sources":["../../src/net/client.ts"],"sourcesContent":["import { v4 as uuid } from \"uuid\";\r\nimport httpStatus from \"http-status\";\r\nimport { getResponseResult, IFetcher, IRequestCallbacks, IRequestParams, IRequestState } from \"./request\";\r\nimport { ApiError } from \"./apiError\";\r\nimport { BaseAppMsgStruct, BaseAppContext } from \"@/appDomain/appContracts\";\r\nimport { MsgBus } from \"@actdim/msgmesh/contracts\";\r\n\r\n// MLWEB-2172\r\n\r\n// TODO: support request cancellation\r\n// https://stackoverflow.com/questions/31061838/how-do-i-cancel-an-http-fetch-request\r\n// https://mukeshprajapati0251.medium.com/cancel-rest-api-pending-request-1af65e70366d\r\n\r\nexport function extractApiName(name: string, suffixes: string[]): string | null {\r\n if (!name) {\r\n return name;\r\n // return null; // ?\r\n }\r\n const escaped = suffixes.map((s) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"));\r\n const group = escaped.join(\"|\");\r\n const pattern = new RegExp(`(_?(${group}))+?$`, \"i\");\r\n\r\n let result = name.replace(pattern, \"\");\r\n\r\n result = result.trim();\r\n return result.length > 0 ? result : name;\r\n}\r\n\r\nconst API_SUFFIXES = [\"api\", \"controller\", \"client\", \"fetcher\"];\r\n// App(Api)ClientBase\r\nexport class ClientBase {\r\n protected baseUrl: string;\r\n\r\n protected name: string;\r\n\r\n // private requestStates\r\n private requestStateMap: Map<string, IRequestState>;\r\n\r\n private fetcher: IFetcher;\r\n\r\n private msgBus: MsgBus<BaseAppMsgStruct>;\r\n\r\n private accessToken: string;\r\n\r\n private init: Promise<any>;\r\n\r\n private apiSuffixes: string[];\r\n\r\n constructor(context: BaseAppContext, fetcher?: IFetcher, apiSuffixes = API_SUFFIXES) {\r\n this.apiSuffixes = apiSuffixes;\r\n this.fetcher = fetcher || window;\r\n this.requestStateMap = new Map<string, IRequestState>();\r\n this.msgBus = context.msgBus;\r\n // TODO: unsubscribe\r\n this.msgBus.on({\r\n channel: \"APP-SECURITY-AUTH-SIGNIN\",\r\n group: \"out\",\r\n callback: (msg) => {\r\n this.accessToken = msg.payload.accessToken;\r\n }\r\n });\r\n this.init = Promise.all([this.getBaseUrlAsync(), this.updateSecurityAsync()]);\r\n }\r\n\r\n protected async getBaseUrlAsync() {\r\n const msg = await this.msgBus.request({\r\n channel: \"APP-CONFIG-GET\"\r\n });\r\n const config = msg.payload;\r\n const apiName = extractApiName(this.name, this.apiSuffixes);\r\n const apiEntry = Object.entries(config.apis).find((entry) => entry[0].toLowerCase() === apiName?.toLowerCase());\r\n if (!apiEntry) {\r\n // console.debug\r\n console.warn(`API \"${apiName}\" is not defined in the current configuration. Using default configuration.`);\r\n }\r\n this.baseUrl = apiEntry?.[1].url || config.baseUrl;\r\n }\r\n\r\n private async updateSecurityAsync() {\r\n if (!this.accessToken) {\r\n const msg = await this.msgBus.request({\r\n channel: \"APP-SECURITY-GET-CONTEXT\"\r\n });\r\n this.accessToken = msg.payload.accessToken;\r\n }\r\n return this.accessToken;\r\n }\r\n\r\n private async addAuthorizationAsync(request: IRequestParams) {\r\n const accessToken = await this.updateSecurityAsync();\r\n if (!accessToken) {\r\n throw ApiError.create({\r\n status: httpStatus.UNAUTHORIZED\r\n });\r\n }\r\n const authorizationHeader = \"Authorization\";\r\n const headers = request.headers;\r\n const headerValue = `Bearer ${accessToken}`;\r\n if (headers instanceof Headers) {\r\n // if (headers.has(authorizationHeader)) {\r\n // headers.delete(authorizationHeader)\r\n // }\r\n // headers.append(authorizationHeader, headerValue);\r\n headers.set(authorizationHeader, headerValue);\r\n } else {\r\n throw new Error(\"Unsupported headers\"); // object type\r\n }\r\n }\r\n\r\n private async executeRequestInternalAsync(request: IRequestState) {\r\n try {\r\n let proceed = true;\r\n const onBeforeSendRequest = request.callbacks && request.callbacks.onBeforeSendRequest;\r\n if (onBeforeSendRequest) {\r\n const event = {\r\n request: request,\r\n cancel: false,\r\n handled: false\r\n } as Parameters<IRequestCallbacks[\"onBeforeSendRequest\"]>[0];\r\n await onBeforeSendRequest(event);\r\n if (event.cancel) {\r\n // interrupt\r\n proceed = false;\r\n request.status = \"canceled\";\r\n if (event.handled) {\r\n request.result = event.result;\r\n } else {\r\n // ApiError?\r\n throw new Error(\"The request was aborted\"); // has been? canceled?\r\n }\r\n }\r\n }\r\n if (proceed) {\r\n request.status = \"executing\";\r\n const response = await this.fetcher.fetch(request.url, request);\r\n ApiError.assert(response, request);\r\n let onResponseRead = request.callbacks && request.callbacks.onResponseRead;\r\n if (!onResponseRead) {\r\n onResponseRead = async (event) => {\r\n const result = await getResponseResult(response, request);\r\n event.result = result;\r\n };\r\n }\r\n const event = {\r\n response: response\r\n } as Parameters<IRequestCallbacks[\"onResponseRead\"]>[0];\r\n\r\n await onResponseRead(event);\r\n request.result = event.result;\r\n request.status = \"succeeded\";\r\n }\r\n } catch (err) {\r\n request.status = \"failed\";\r\n // throw ApiError.create(undefined, request);\r\n throw err;\r\n }\r\n return request;\r\n }\r\n\r\n private async executeRequestAsync(request: IRequestState): Promise<IRequestState> {\r\n let attempt = 0;\r\n do {\r\n try {\r\n if (request.useAuth) {\r\n await this.addAuthorizationAsync(request);\r\n }\r\n return await this.executeRequestInternalAsync(request);\r\n } catch (err) {\r\n if (err instanceof ApiError) {\r\n if (attempt > 0) {\r\n throw err;\r\n }\r\n if (err.status === httpStatus.UPGRADE_REQUIRED) {\r\n // await this.context.msgBus.request({\r\n // channel: \"APP_RELOAD\" // APP_REQUEST_UPDGRADE\r\n // });\r\n throw err;\r\n } else if (err.status === httpStatus.UNAUTHORIZED) {\r\n if (err.response?.headers?.get(\"token-expired\")) {\r\n // token expired or invalid\r\n await this.msgBus.request({\r\n channel: \"APP-SECURITY-AUTH-REFRESH\"\r\n });\r\n } else {\r\n await this.msgBus.request({\r\n channel: \"APP-SECURITY-REQUEST-AUTH\"\r\n });\r\n }\r\n // codes:\r\n // TOKEN_EXPIRED\r\n // TOKEN_INVALID\r\n // TOKEN_MISSING\r\n // AUTH_REQUIRED\r\n // header: WWW-Authenticate\r\n continue;\r\n }\r\n continue;\r\n }\r\n throw err;\r\n } finally {\r\n attempt++;\r\n }\r\n } while (true);\r\n }\r\n\r\n // T extends IApiResponse\r\n public async fetchAsync<T>(requestParams: IRequestParams): Promise<T> {\r\n await this.init;\r\n\r\n const defaultParams: Partial<IRequestParams> = {\r\n contentType: \"application/json\",\r\n method: \"POST\",\r\n body: null,\r\n headers: {},\r\n cache: \"default\",\r\n credentials: \"same-origin\",\r\n mode: \"cors\"\r\n };\r\n\r\n requestParams = { ...defaultParams, ...requestParams };\r\n if (!requestParams.id) {\r\n requestParams.id = uuid();\r\n }\r\n\r\n if (!(requestParams.headers instanceof Headers)) {\r\n requestParams.headers = new Headers(requestParams.headers);\r\n }\r\n\r\n requestParams.headers.append(\"Content-Type\", requestParams.contentType);\r\n // \"api-version\"\r\n\r\n if (requestParams.method === \"POST\") {\r\n if (!requestParams.body) {\r\n requestParams.body = \"\";\r\n }\r\n }\r\n\r\n let request = {\r\n ...requestParams,\r\n status: \"queued\",\r\n response: undefined,\r\n result: undefined\r\n } as IRequestState;\r\n\r\n this.requestStateMap.set(requestParams.id, request);\r\n\r\n await this.executeRequestAsync(request);\r\n return request.result;\r\n }\r\n}\r\n/* \r\nif (status === 404) {\r\n return response.text().then((_responseText) => {\r\n let result404: any = null;\r\n result404 = _responseText === \"\" ? null : JSON.parse(_responseText, this.jsonParseReviver) as __API__ProblemDetails;\r\n return throwException(\"Not Found\", status, _responseText, _headers, result404);\r\n });\r\n } else if (status !== 200 && status !== 204) {\r\n return response.text().then((_responseText) => {\r\n return throwException(\"An unexpected server error occurred.\", status, _responseText, _headers);\r\n });\r\n }\r\n\r\nBLOB\r\nlet reader = new FileReader();\r\n reader.onload = event => resolve((event.target as any).result);\r\n reader.readAsText(blob);\r\n*/\r\n"],"names":["extractApiName","name","suffixes","group","s","pattern","result","API_SUFFIXES","ClientBase","context","fetcher","apiSuffixes","msg","config","apiName","apiEntry","entry","request","accessToken","ApiError","httpStatus","authorizationHeader","headers","headerValue","proceed","onBeforeSendRequest","event","response","onResponseRead","getResponseResult","err","attempt","requestParams","uuid"],"mappings":";;;;AAaO,SAASA,EAAeC,GAAcC,GAAmC;AAC5E,MAAI,CAACD;AACD,WAAOA;AAIX,QAAME,IADUD,EAAS,IAAI,CAACE,MAAMA,EAAE,QAAQ,uBAAuB,MAAM,CAAC,EACtD,KAAK,GAAG,GACxBC,IAAU,IAAI,OAAO,OAAOF,CAAK,SAAS,GAAG;AAEnD,MAAIG,IAASL,EAAK,QAAQI,GAAS,EAAE;AAErC,SAAAC,IAASA,EAAO,KAAA,GACTA,EAAO,SAAS,IAAIA,IAASL;AACxC;AAEA,MAAMM,IAAe,CAAC,OAAO,cAAc,UAAU,SAAS;AAEvD,MAAMC,EAAW;AAAA,EACV;AAAA,EAEA;AAAA;AAAA,EAGF;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAER,YAAYC,GAAyBC,GAAoBC,IAAcJ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B,cAHIY,IAAU,KAGVD,EAAI,WAAWV,EAAW;AAI1B,kBAAMU;AACV,cAAWA,EAAI,WAAWV,EAAW,cAAc;AAC/C,YAAIU,EAAI,UAAU,SAAS,IAAI,eAAe,IAE1C,MAAM,KAAK,OAAO,QAAQ;AAAA,cACtB,SAAS;AAAA,YAAA,CACZ,IAED,MAAM,KAAK,OAAO,QAAQ;AAAA,cACtB,SAAS;AAAA,YAAA,CACZ;AAQL;AAAA,UACJ;AACA;AAAA,QACJ;AACA,cAAMA;AAAA,MACV,UAAA;AACI,QAAAC;AAAA,MACJ;AAAA,WACK;AAAA,EACb;AAAA;AAAA,EAGA,MAAa,WAAcC,GAA2C;AAClE,UAAM,KAAK,MAYXA,IAAgB,EAAE,GAV6B;AAAA,MAC3C,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,SAAS,CAAA;AAAA,MACT,OAAO;AAAA,MACP,aAAa;AAAA,MACb,MAAM;AAAA,IAAA,GAG0B,GAAGA,EAAA,GAClCA,EAAc,OACfA,EAAc,KAAKC,EAAA,IAGjBD,EAAc,mBAAmB,YACnCA,EAAc,UAAU,IAAI,QAAQA,EAAc,OAAO,IAG7DA,EAAc,QAAQ,OAAO,gBAAgBA,EAAc,WAAW,GAGlEA,EAAc,WAAW,WACpBA,EAAc,SACfA,EAAc,OAAO;AAI7B,QAAIf,IAAU;AAAA,MACV,GAAGe;AAAA,MACH,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,QAAQ;AAAA,IAAA;AAGZ,gBAAK,gBAAgB,IAAIA,EAAc,IAAIf,CAAO,GAElD,MAAM,KAAK,oBAAoBA,CAAO,GAC/BA,EAAQ;AAAA,EACnB;AACJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseAppMsgChannels, BaseAppMsgStruct, NavContext, NavRoutes } from '../appDomain/appContracts';
|
|
2
|
-
import { Component, ComponentParams, ComponentStruct } from '../componentModel/
|
|
2
|
+
import { Component, ComponentParams, ComponentStruct } from '../componentModel/contracts';
|
|
3
3
|
type Struct = ComponentStruct<BaseAppMsgStruct, {
|
|
4
4
|
props: {
|
|
5
5
|
history: NavContext[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavService.d.ts","sourceRoot":"","sources":["../../src/services/NavService.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavService.d.ts","sourceRoot":"","sources":["../../src/services/NavService.tsx"],"names":[],"mappings":"AAQA,OAAO,EACH,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,SAAS,EACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACR,SAAS,EAGT,eAAe,EACf,eAAe,EAClB,MAAM,4BAA4B,CAAC;AAGpC,KAAK,MAAM,GAAG,eAAe,CACzB,gBAAgB,EAChB;IACI,KAAK,EAAE;QACH,OAAO,EAAE,UAAU,EAAE,CAAC;QACtB,MAAM,EAAE,SAAS,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE;QACN,OAAO,EAAE,kBAAkB,CACrB,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,yBAAyB,CAC9B,CAAC;KACL,CAAC;CACL,CACJ,CAAC;AAIF,eAAO,MAAM,aAAa,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,sBA+E5D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACtC,eAAO,MAAM,YAAY,8BAAuB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useNavigate as p, useLocation as m, useNavigationType as y, useParams as h, useSearchParams as N } from "react-router-dom";
|
|
2
|
-
import { getFC as P, useComponent as v } from "../componentModel/
|
|
2
|
+
import { getFC as P, useComponent as v } from "../componentModel/react.es.js";
|
|
3
3
|
const A = (n) => {
|
|
4
|
-
let
|
|
4
|
+
let t, o;
|
|
5
5
|
const e = p(), c = m(), i = y(), l = h(), [u] = N();
|
|
6
|
-
return
|
|
6
|
+
return t = v({
|
|
7
7
|
props: {
|
|
8
8
|
history: [],
|
|
9
9
|
routes: void 0
|
|
@@ -18,8 +18,8 @@ const A = (n) => {
|
|
|
18
18
|
},
|
|
19
19
|
ex: {
|
|
20
20
|
callback: async (a) => {
|
|
21
|
-
const
|
|
22
|
-
e(o.routes[
|
|
21
|
+
const s = a.payload.route;
|
|
22
|
+
e(o.routes[s].path(a.payload.params));
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -38,15 +38,15 @@ const A = (n) => {
|
|
|
38
38
|
},
|
|
39
39
|
events: {
|
|
40
40
|
onLayout: (a) => {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
41
|
+
const s = o.history;
|
|
42
|
+
if (s) {
|
|
43
43
|
const r = {
|
|
44
44
|
location: c,
|
|
45
45
|
searchParams: u,
|
|
46
46
|
params: l,
|
|
47
47
|
navType: i
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
s.push(r), a.msgBus.send({
|
|
50
50
|
channel: "APP-NAV-CONTEXT-CHANGED",
|
|
51
51
|
group: "in",
|
|
52
52
|
payload: r
|
|
@@ -55,7 +55,7 @@ const A = (n) => {
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
view: () => null
|
|
58
|
-
}, n), o =
|
|
58
|
+
}, n), o = t.model, t;
|
|
59
59
|
}, C = P(A);
|
|
60
60
|
export {
|
|
61
61
|
C as NavServiceFC,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavService.es.js","sources":["../../src/services/NavService.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"NavService.es.js","sources":["../../src/services/NavService.tsx"],"sourcesContent":["import {\r\n To,\r\n useLocation,\r\n useNavigate,\r\n useNavigationType,\r\n useParams,\r\n useSearchParams,\r\n} from 'react-router-dom';\r\nimport {\r\n BaseAppMsgChannels,\r\n BaseAppMsgStruct,\r\n NavContext,\r\n NavRoutes,\r\n} from '@/appDomain/appContracts';\r\nimport type {\r\n Component,\r\n ComponentDef,\r\n ComponentModel,\r\n ComponentParams,\r\n ComponentStruct,\r\n} from '@/componentModel/contracts';\r\nimport { getFC, useComponent } from '@/componentModel/react';\r\n\r\ntype Struct = ComponentStruct<\r\n BaseAppMsgStruct,\r\n {\r\n props: {\r\n history: NavContext[];\r\n routes: NavRoutes;\r\n };\r\n msgScope: {\r\n provide: BaseAppMsgChannels<\r\n | 'APP-NAV-GOTO'\r\n | 'APP-NAV-GET-CONTEXT'\r\n | 'APP-NAV-READ-HISTORY'\r\n | 'APP-NAV-CONTEXT-CHANGED'\r\n >;\r\n };\r\n }\r\n>;\r\n\r\n// const store = new PersistentStore('history');\r\n\r\nexport const useNavService = (params: ComponentParams<Struct>) => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n const navigate = useNavigate();\r\n\r\n const location = useLocation();\r\n const navType = useNavigationType();\r\n const nvaParams = useParams();\r\n const [searchParams] = useSearchParams();\r\n\r\n const def: ComponentDef<Struct> = {\r\n props: {\r\n history: [],\r\n routes: undefined,\r\n },\r\n msgBroker: {\r\n provide: {\r\n 'APP-NAV-GOTO': {\r\n in: {\r\n callback: async (msg) => {\r\n navigate(msg.payload as To);\r\n },\r\n },\r\n ex: {\r\n callback: async (msg) => {\r\n const route = msg.payload.route;\r\n navigate(m.routes[route].path(msg.payload.params));\r\n },\r\n },\r\n },\r\n 'APP-NAV-GET-CONTEXT': {\r\n in: {\r\n callback: (msg) => {\r\n return m.history[m.history.length - 1];\r\n },\r\n },\r\n },\r\n 'APP-NAV-READ-HISTORY': {\r\n in: {\r\n callback: (msg) => {\r\n return m.history[m.history.length - 1];\r\n },\r\n },\r\n },\r\n 'APP-NAV-CONTEXT-CHANGED': {},\r\n },\r\n },\r\n events: {\r\n onLayout: (c) => {\r\n const history = m.history;\r\n if (history) {\r\n const ctx = {\r\n location: location,\r\n searchParams: searchParams,\r\n params: nvaParams,\r\n navType: navType,\r\n };\r\n history.push(ctx);\r\n c.msgBus.send({\r\n channel: 'APP-NAV-CONTEXT-CHANGED',\r\n group: 'in',\r\n payload: ctx,\r\n });\r\n }\r\n },\r\n },\r\n view: () => {\r\n return null;\r\n },\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n\r\n // deps\r\n // location, navType, params, searchParams\r\n\r\n return c;\r\n};\r\n\r\nexport type NavServiceStruct = Struct;\r\nexport const NavServiceFC = getFC(useNavService);\r\n"],"names":["useNavService","params","c","m","navigate","useNavigate","location","useLocation","navType","useNavigationType","nvaParams","useParams","searchParams","useSearchParams","useComponent","msg","route","history","ctx","NavServiceFC","getFC"],"mappings":";;AA2CO,MAAMA,IAAgB,CAACC,MAAoC;AAC9D,MAAIC,GACAC;AAEJ,QAAMC,IAAWC,EAAA,GAEXC,IAAWC,EAAA,GACXC,IAAUC,EAAA,GACVC,IAAYC,EAAA,GACZ,CAACC,CAAY,IAAIC,EAAA;AA+DvB,SAAAX,IAAIY,EA7D8B;AAAA,IAC9B,OAAO;AAAA,MACH,SAAS,CAAA;AAAA,MACT,QAAQ;AAAA,IAAA;AAAA,IAEZ,WAAW;AAAA,MACP,SAAS;AAAA,QACL,gBAAgB;AAAA,UACZ,IAAI;AAAA,YACA,UAAU,OAAOC,MAAQ;AACrB,cAAAX,EAASW,EAAI,OAAa;AAAA,YAC9B;AAAA,UAAA;AAAA,UAEJ,IAAI;AAAA,YACA,UAAU,OAAOA,MAAQ;AACrB,oBAAMC,IAAQD,EAAI,QAAQ;AAC1B,cAAAX,EAASD,EAAE,OAAOa,CAAK,EAAE,KAAKD,EAAI,QAAQ,MAAM,CAAC;AAAA,YACrD;AAAA,UAAA;AAAA,QACJ;AAAA,QAEJ,uBAAuB;AAAA,UACnB,IAAI;AAAA,YACA,UAAU,CAACA,MACAZ,EAAE,QAAQA,EAAE,QAAQ,SAAS,CAAC;AAAA,UACzC;AAAA,QACJ;AAAA,QAEJ,wBAAwB;AAAA,UACpB,IAAI;AAAA,YACA,UAAU,CAACY,MACAZ,EAAE,QAAQA,EAAE,QAAQ,SAAS,CAAC;AAAA,UACzC;AAAA,QACJ;AAAA,QAEJ,2BAA2B,CAAA;AAAA,MAAC;AAAA,IAChC;AAAA,IAEJ,QAAQ;AAAA,MACJ,UAAU,CAACD,MAAM;AACb,cAAMe,IAAUd,EAAE;AAClB,YAAIc,GAAS;AACT,gBAAMC,IAAM;AAAA,YACR,UAAAZ;AAAA,YACA,cAAAM;AAAA,YACA,QAAQF;AAAA,YACR,SAAAF;AAAA,UAAA;AAEJ,UAAAS,EAAQ,KAAKC,CAAG,GAChBhB,EAAE,OAAO,KAAK;AAAA,YACV,SAAS;AAAA,YACT,OAAO;AAAA,YACP,SAASgB;AAAA,UAAA,CACZ;AAAA,QACL;AAAA,MACJ;AAAA,IAAA;AAAA,IAEJ,MAAM,MACK;AAAA,EACX,GAGkBjB,CAAM,GAC5BE,IAAID,EAAE,OAKCA;AACX,GAGaiB,IAAeC,EAAMpB,CAAa;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ComponentParams, ComponentStruct, Component } from '../componentModel/
|
|
1
|
+
import { ComponentParams, ComponentStruct, Component } from '../componentModel/contracts';
|
|
2
2
|
import { BaseAppMsgChannels, BaseAppMsgStruct } from '../appDomain/appContracts';
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
3
4
|
type Struct = ComponentStruct<BaseAppMsgStruct, {
|
|
4
|
-
props: {
|
|
5
|
-
|
|
5
|
+
props: PropsWithChildren & {
|
|
6
|
+
storeName?: string;
|
|
6
7
|
};
|
|
7
8
|
msgScope: {
|
|
8
9
|
provide: BaseAppMsgChannels<'APP-KV-STORE-GET' | 'APP-KV-STORE-SET' | 'APP-KV-STORE-REMOVE'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageService.d.ts","sourceRoot":"","sources":["../../src/services/StorageService.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,eAAe,
|
|
1
|
+
{"version":3,"file":"StorageService.d.ts","sourceRoot":"","sources":["../../src/services/StorageService.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,eAAe,EACf,SAAS,EAGZ,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAqB,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,KAAK,MAAM,GAAG,eAAe,CACzB,gBAAgB,EAChB;IACI,KAAK,EAAE,iBAAiB,GAAG;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,QAAQ,EAAE;QACN,OAAO,EAAE,kBAAkB,CACvB,kBAAkB,GAAG,kBAAkB,GAAG,qBAAqB,CAClE,CAAC;KACL,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,sBA+DhE,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAC1C,eAAO,MAAM,gBAAgB,8BAA2B,CAAC"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { getFC as
|
|
1
|
+
import { getFC as c, useComponent as l } from "../componentModel/react.es.js";
|
|
2
2
|
import { PersistentStore as y } from "@actdim/utico/store/persistentStore";
|
|
3
3
|
const m = (s) => {
|
|
4
|
-
let t,
|
|
5
|
-
async function
|
|
6
|
-
a = await y.
|
|
4
|
+
let t, n;
|
|
5
|
+
async function r() {
|
|
6
|
+
a = await y.open(n.storeName);
|
|
7
7
|
}
|
|
8
|
-
let a,
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
let a, i;
|
|
9
|
+
const o = new Promise((e) => {
|
|
10
|
+
i = e;
|
|
11
11
|
});
|
|
12
12
|
return t = l({
|
|
13
13
|
props: {
|
|
14
|
-
|
|
14
|
+
storeName: ""
|
|
15
15
|
},
|
|
16
16
|
msgBroker: {
|
|
17
17
|
provide: {
|
|
18
18
|
"APP-KV-STORE-GET": {
|
|
19
19
|
in: {
|
|
20
|
-
callback: async (e) => (await
|
|
20
|
+
callback: async (e) => (await o, (await a.get(e.payload.key))?.data.value)
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"APP-KV-STORE-SET": {
|
|
24
24
|
in: {
|
|
25
25
|
callback: async (e) => {
|
|
26
|
-
await
|
|
26
|
+
await o, await a.set(
|
|
27
27
|
{
|
|
28
28
|
key: e.payload.key
|
|
29
29
|
},
|
|
@@ -35,19 +35,19 @@ const m = (s) => {
|
|
|
35
35
|
"APP-KV-STORE-REMOVE": {
|
|
36
36
|
in: {
|
|
37
37
|
callback: async (e) => {
|
|
38
|
-
await
|
|
38
|
+
await o, await a.delete(e.payload.key);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
events: {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
onChangeStoreName: () => {
|
|
46
|
+
r();
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
}, s),
|
|
50
|
-
}, u =
|
|
49
|
+
}, s), n = t.model, r().then(() => i()), t;
|
|
50
|
+
}, u = c(m);
|
|
51
51
|
export {
|
|
52
52
|
u as StorageServiceFC,
|
|
53
53
|
m as useStorageService
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageService.es.js","sources":["../../src/services/StorageService.tsx"],"sourcesContent":["import {\r\n ComponentParams,\r\n ComponentStruct,\r\n
|
|
1
|
+
{"version":3,"file":"StorageService.es.js","sources":["../../src/services/StorageService.tsx"],"sourcesContent":["import {\r\n ComponentParams,\r\n ComponentStruct,\r\n Component,\r\n ComponentModel,\r\n ComponentDef,\r\n} from '@/componentModel/contracts';\r\nimport { getFC, useComponent } from '@/componentModel/react';\r\nimport { PersistentStore } from '@actdim/utico/store/persistentStore';\r\nimport { BaseAppMsgChannels, BaseAppMsgStruct, useBaseAppContext } from '@/appDomain/appContracts';\r\nimport { PropsWithChildren } from 'react';\r\n\r\ntype Struct = ComponentStruct<\r\n BaseAppMsgStruct,\r\n {\r\n props: PropsWithChildren & {\r\n storeName?: string;\r\n };\r\n msgScope: {\r\n provide: BaseAppMsgChannels<\r\n 'APP-KV-STORE-GET' | 'APP-KV-STORE-SET' | 'APP-KV-STORE-REMOVE'\r\n >;\r\n };\r\n }\r\n>;\r\n\r\nexport const useStorageService = (params: ComponentParams<Struct>) => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n async function _updateStoreAsync() {\r\n store = await PersistentStore.open(m.storeName);\r\n }\r\n\r\n let store: PersistentStore;\r\n let ready: () => void;\r\n const init = new Promise<void>((res) => {\r\n ready = res;\r\n });\r\n\r\n const def: ComponentDef<Struct> = {\r\n props: {\r\n storeName: '',\r\n },\r\n msgBroker: {\r\n provide: {\r\n 'APP-KV-STORE-GET': {\r\n in: {\r\n callback: async (msg) => {\r\n await init;\r\n const item = await store.get(msg.payload.key);\r\n return item?.data.value;\r\n },\r\n },\r\n },\r\n 'APP-KV-STORE-SET': {\r\n in: {\r\n callback: async (msg) => {\r\n await init;\r\n await store.set(\r\n {\r\n key: msg.payload.key,\r\n },\r\n msg.payload.value,\r\n );\r\n },\r\n },\r\n },\r\n 'APP-KV-STORE-REMOVE': {\r\n in: {\r\n callback: async (msg) => {\r\n await init;\r\n await store.delete(msg.payload.key);\r\n },\r\n },\r\n },\r\n },\r\n },\r\n events: {\r\n onChangeStoreName: () => {\r\n _updateStoreAsync();\r\n },\r\n },\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n _updateStoreAsync().then(() => ready());\r\n return c;\r\n};\r\n\r\nexport type StorageServiceStruct = Struct;\r\nexport const StorageServiceFC = getFC(useStorageService);\r\n"],"names":["useStorageService","params","c","m","_updateStoreAsync","store","PersistentStore","ready","init","res","useComponent","msg","StorageServiceFC","getFC"],"mappings":";;AA0BO,MAAMA,IAAoB,CAACC,MAAoC;AAClE,MA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3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A type-safe component system for large-scale apps: explicit dependencies, message bus communication, and structure-first, declarative design",
|
|
5
5
|
"author": "Pavel Borodaev",
|
|
6
6
|
"license": "Proprietary",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"components",
|
|
19
19
|
"react",
|
|
20
20
|
"component-model",
|
|
21
|
-
"
|
|
21
|
+
"architecture",
|
|
22
22
|
"modularity",
|
|
23
23
|
"structure",
|
|
24
24
|
"communication"
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"test": "npx vitest --config=vitest.node.config.ts --no-cache",
|
|
56
56
|
"test:w": "npx vitest --config=vitest.node.config.ts --watch",
|
|
57
57
|
"test:v8": "npx vite",
|
|
58
|
-
"lint": "eslint
|
|
59
|
-
"build": "tsc -b && vite build",
|
|
58
|
+
"lint": "eslint \"./**/*.{ts,tsx}\" -f visualstudio --ext .ts,.tsx --report-unused-disable-directives --max-warnings 0",
|
|
59
|
+
"build": "tsc -b tsconfig.json --noEmit && vite build",
|
|
60
60
|
"pnpm:u": "pnpm update",
|
|
61
61
|
"pnpm:ou": "pnpm outdated",
|
|
62
62
|
"ncu:l": "ncu",
|
|
@@ -67,11 +67,12 @@
|
|
|
67
67
|
"format": "prettier --write .",
|
|
68
68
|
"format:check": "prettier --check .",
|
|
69
69
|
"storybook": "storybook dev -p 6006",
|
|
70
|
-
"build-storybook": "storybook build"
|
|
70
|
+
"build-storybook": "storybook build",
|
|
71
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
|
-
"@actdim/msgmesh": "^1.2.
|
|
74
|
-
"@actdim/utico": "^1.1.
|
|
74
|
+
"@actdim/msgmesh": "^1.2.3",
|
|
75
|
+
"@actdim/utico": "^1.1.2",
|
|
75
76
|
"http-status": "^2.1.0",
|
|
76
77
|
"jwt-decode": "^4.0.0",
|
|
77
78
|
"mobx": "^6.15.0",
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, FC, ReactNode } from 'react';
|
|
2
|
-
import { $CG_IN, $CG_OUT, Msg, MsgBus, MsgProviderParams, MsgStruct, MsgSubscriberParams, OutStruct } from '@actdim/msgmesh/msgBusCore';
|
|
3
|
-
import { HasKeys, MaybeKeyOf, MaybePromise, Require, Skip } from '@actdim/utico/typeCore';
|
|
4
|
-
import { ComponentMsgHeaders, TreeNode } from './contracts';
|
|
5
|
-
export declare enum ComponentMsgFilter {
|
|
6
|
-
None = 0,
|
|
7
|
-
FromAncestors = 1,
|
|
8
|
-
FromDescendants = 2
|
|
9
|
-
}
|
|
10
|
-
export type MsgChannelGroupProviderParams<TStruct extends MsgStruct = MsgStruct, TChannel extends keyof TStruct = keyof TStruct, TGroup extends keyof TStruct[TChannel] = typeof $CG_IN, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders, TScope = any> = Skip<MsgProviderParams<TStruct, TChannel, TGroup>, 'channel' | 'group' | 'callback' | 'filter'> & {
|
|
11
|
-
callback?: (msgIn: Msg<TStruct, TChannel, TGroup, TMsgHeaders>, headers: TMsgHeaders, scope: TScope) => MaybePromise<OutStruct<TStruct, TChannel>>;
|
|
12
|
-
filter?: (msg: Msg<TStruct, TChannel, TGroup, TMsgHeaders>, scope: TScope) => boolean;
|
|
13
|
-
componentFilter?: ComponentMsgFilter;
|
|
14
|
-
};
|
|
15
|
-
export type MsgChannelGroupSubscriberParams<TStruct extends MsgStruct = MsgStruct, TChannel extends keyof TStruct = keyof TStruct, TGroup extends keyof TStruct[TChannel] = typeof $CG_IN, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders, TScope = any> = Skip<MsgSubscriberParams<TStruct, TChannel, TGroup>, 'channel' | 'group' | 'callback' | 'filter'> & {
|
|
16
|
-
callback?: (msg: Msg<TStruct, TChannel, TGroup, TMsgHeaders>, scope: TScope) => void;
|
|
17
|
-
filter?: (msg: Msg<TStruct, TChannel, TGroup, TMsgHeaders>, scope: TScope) => boolean;
|
|
18
|
-
componentFilter?: ComponentMsgFilter;
|
|
19
|
-
};
|
|
20
|
-
export type MsgBrokerScope<TStruct extends MsgStruct, TKeysToProvide extends keyof TStruct = keyof TStruct, TKeysToSubscribe extends keyof TStruct = keyof TStruct, TKeysToPublish extends keyof TStruct = keyof TStruct> = {
|
|
21
|
-
provide?: TKeysToProvide;
|
|
22
|
-
subscribe?: TKeysToSubscribe;
|
|
23
|
-
publish?: TKeysToPublish;
|
|
24
|
-
};
|
|
25
|
-
export type ComponentPropStruct = Record<string, any>;
|
|
26
|
-
export type ComponentMethodStruct = Record<string, Function>;
|
|
27
|
-
export type ComponentRefStruct = {
|
|
28
|
-
[name: string]: ComponentStruct | ((params: any) => ComponentStruct);
|
|
29
|
-
};
|
|
30
|
-
export type ComponentStructBase<TMsgStruct extends MsgStruct = MsgStruct, TPropStruct extends ComponentPropStruct = ComponentPropStruct, TMsgScope extends MsgBrokerScope<TMsgStruct> = MsgBrokerScope<TMsgStruct>> = {
|
|
31
|
-
props?: TPropStruct;
|
|
32
|
-
actions?: ComponentMethodStruct;
|
|
33
|
-
effects?: string[] | string | undefined;
|
|
34
|
-
children?: ComponentRefStruct;
|
|
35
|
-
msgScope?: TMsgScope;
|
|
36
|
-
};
|
|
37
|
-
export type ComponentStruct<TMsgStruct extends MsgStruct = MsgStruct, T extends ComponentStructBase<TMsgStruct> = ComponentStructBase<TMsgStruct>> = T & {
|
|
38
|
-
msg: TMsgStruct;
|
|
39
|
-
};
|
|
40
|
-
export type MsgBroker<TStructToProvide extends MsgStruct = MsgStruct, TStructToSubscribe extends MsgStruct = MsgStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders, TScope = any> = Require<{
|
|
41
|
-
provide?: Require<{
|
|
42
|
-
[TChannel in keyof TStructToProvide]: {
|
|
43
|
-
[TGroup in keyof Skip<TStructToProvide[TChannel], typeof $CG_OUT>]?: MsgChannelGroupProviderParams<TStructToProvide, TChannel, TGroup, TMsgHeaders, TScope>;
|
|
44
|
-
};
|
|
45
|
-
}, HasKeys<TStructToProvide>>;
|
|
46
|
-
subscribe?: Require<{
|
|
47
|
-
[TChannel in keyof TStructToSubscribe]: {
|
|
48
|
-
[TGroup in keyof TStructToSubscribe[TChannel]]?: MsgChannelGroupSubscriberParams<TStructToSubscribe, TChannel, TGroup, TMsgHeaders, TScope>;
|
|
49
|
-
};
|
|
50
|
-
}, HasKeys<TStructToSubscribe>>;
|
|
51
|
-
abortController?: AbortController;
|
|
52
|
-
}, HasKeys<TStructToProvide & TStructToSubscribe>>;
|
|
53
|
-
type ValueConverter<TTo, TFrom> = {
|
|
54
|
-
convert(value: TFrom): TTo;
|
|
55
|
-
convertBack(value: TTo): TFrom;
|
|
56
|
-
};
|
|
57
|
-
type ValidationResult = {
|
|
58
|
-
valid: boolean;
|
|
59
|
-
message: string;
|
|
60
|
-
};
|
|
61
|
-
type Validator<T> = {
|
|
62
|
-
options: {
|
|
63
|
-
blur: boolean;
|
|
64
|
-
};
|
|
65
|
-
validate: (value: T) => MaybePromise<ValidationResult>;
|
|
66
|
-
};
|
|
67
|
-
declare const $isBinding: unique symbol;
|
|
68
|
-
declare class Binding<T = any, TFrom = any> {
|
|
69
|
-
readonly get: () => T;
|
|
70
|
-
readonly set: (value: T) => void;
|
|
71
|
-
readonly converter: ValueConverter<T, TFrom>;
|
|
72
|
-
readonly validator: Validator<T>;
|
|
73
|
-
readonly readOnly: boolean;
|
|
74
|
-
constructor(get: () => T, set?: (value: T) => void, converter?: ValueConverter<T, TFrom>, validator?: Validator<T>);
|
|
75
|
-
[$isBinding]: boolean;
|
|
76
|
-
}
|
|
77
|
-
export declare function isBinding(obj: any): obj is Binding;
|
|
78
|
-
export declare function bind<T, TFrom = any>(get: () => T, set?: (value: T) => void, converter?: ValueConverter<T, TFrom>, validator?: Validator<T>): Binding<T, TFrom>;
|
|
79
|
-
export declare function bindProp<T extends object, P extends keyof T>(target: () => T, prop: P): Binding<T[P], any>;
|
|
80
|
-
export type ComponentPropSource<T> = T | Binding<T>;
|
|
81
|
-
export type ComponentPropParams<TPropStruct extends ComponentPropStruct> = {
|
|
82
|
-
[P in keyof TPropStruct]?: ComponentPropSource<TPropStruct[P]>;
|
|
83
|
-
};
|
|
84
|
-
declare const $ON_GET = "onGet";
|
|
85
|
-
declare const $ON_CHANGING = "onChanging";
|
|
86
|
-
declare const $ON_CHANGE = "onChange";
|
|
87
|
-
type PropValueChangingHandler<TProp = PropertyKey> = (prop: TProp, oldValue: any, newValue: any) => boolean;
|
|
88
|
-
type PropValueChangeHandler<TProp = PropertyKey> = (prop: TProp, value: any) => void;
|
|
89
|
-
type ValueChangingHandler<T = any> = (oldValue: T, newValue: T) => boolean;
|
|
90
|
-
type ValueChangeHandler<T = any> = (value: T) => void;
|
|
91
|
-
type ComponentEvents<TStruct extends ComponentStruct = ComponentStruct> = {
|
|
92
|
-
onPropChanging?: PropValueChangingHandler<keyof TStruct['props']>;
|
|
93
|
-
onPropChange?: PropValueChangeHandler<keyof TStruct['props']>;
|
|
94
|
-
onInit?: (component: Component<TStruct>) => void;
|
|
95
|
-
onLayout?: (component: Component<TStruct>) => void;
|
|
96
|
-
onReady?: (component: Component<TStruct>) => void;
|
|
97
|
-
onLayoutDestroy?: (component: Component<TStruct>) => void;
|
|
98
|
-
onDestroy?: (component: Component<TStruct>) => void;
|
|
99
|
-
onError?: (component: Component<TStruct>, error: any) => void;
|
|
100
|
-
} & {
|
|
101
|
-
[P in keyof TStruct['props'] as `${typeof $ON_GET}${Capitalize<P & string>}`]?: () => TStruct['props'][P];
|
|
102
|
-
} & {
|
|
103
|
-
[P in keyof TStruct['props'] as `${typeof $ON_CHANGING}${Capitalize<P & string>}`]?: ValueChangingHandler<TStruct['props']>;
|
|
104
|
-
} & {
|
|
105
|
-
[P in keyof TStruct['props'] as `${typeof $ON_CHANGE}${Capitalize<P & string>}`]?: ValueChangeHandler<TStruct['props']>;
|
|
106
|
-
};
|
|
107
|
-
type ComponentViewProps = {
|
|
108
|
-
render?: boolean;
|
|
109
|
-
} & PropsWithChildren;
|
|
110
|
-
type ComponentViewImplFn<TStruct extends ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders> = (props: ComponentViewProps, component?: Component<TStruct, TMsgHeaders>) => ReactNode;
|
|
111
|
-
type ComponentViewFn = (props: ComponentViewProps) => ReactNode;
|
|
112
|
-
export type ComponentMsgBroker<TStruct extends ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders> = MsgBroker<Pick<TStruct['msg'], MaybeKeyOf<TStruct['msg'], TStruct['msgScope']['provide']>>, Pick<TStruct['msg'], MaybeKeyOf<TStruct['msg'], TStruct['msgScope']['subscribe']>>, TMsgHeaders, Component<TStruct, TMsgHeaders>>;
|
|
113
|
-
export type EffectFn<TStruct extends ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders> = (component: Component<TStruct, TMsgHeaders>) => void | (() => void);
|
|
114
|
-
export type ComponentDef<TStruct extends ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders> = {
|
|
115
|
-
name?: string;
|
|
116
|
-
props?: Require<TStruct['props'], HasKeys<TStruct['props']>>;
|
|
117
|
-
actions?: Require<TStruct['actions'], HasKeys<TStruct['actions']>>;
|
|
118
|
-
effects?: keyof TStruct['effects'] extends never ? never : Record<TStruct['effects'] extends string ? TStruct['effects'] : TStruct['effects'][number], EffectFn<TStruct, TMsgHeaders>>;
|
|
119
|
-
children?: ComponentDefChildren<TStruct['children']>;
|
|
120
|
-
events?: ComponentEvents<TStruct>;
|
|
121
|
-
msgBroker?: ComponentMsgBroker<TStruct, TMsgHeaders>;
|
|
122
|
-
msgBus?: MsgBus<TStruct['msg'], TMsgHeaders>;
|
|
123
|
-
view?: ComponentViewImplFn<TStruct, TMsgHeaders>;
|
|
124
|
-
};
|
|
125
|
-
type ComponentDefChildren<TRefStruct extends ComponentRefStruct> = Require<{
|
|
126
|
-
[P in keyof TRefStruct]: TRefStruct[P] extends (params: infer TParams) => infer T ? T extends ComponentStruct ? (params: TParams) => Component<T> : never : TRefStruct[P] extends ComponentStruct ? Component<TRefStruct[P]> : never;
|
|
127
|
-
}, HasKeys<TRefStruct>>;
|
|
128
|
-
type ComponentChildren<TRefStruct extends ComponentRefStruct> = {
|
|
129
|
-
[P in keyof TRefStruct as TRefStruct[P] extends Function ? `${Capitalize<P & string>}` : P]: TRefStruct[P] extends (params: infer TParams) => infer T ? T extends ComponentStruct ? FC<ComponentParams<T> & TParams> : never : TRefStruct[P] extends ComponentStruct ? Component<TRefStruct[P]> : never;
|
|
130
|
-
};
|
|
131
|
-
export type ComponentMsgStruct<TStruct extends ComponentStruct = ComponentStruct> = Pick<TStruct['msg'], MaybeKeyOf<TStruct['msg'], TStruct['msgScope']['provide']> | MaybeKeyOf<TStruct['msg'], TStruct['msgScope']['subscribe']> | MaybeKeyOf<TStruct['msg'], TStruct['msgScope']['publish']>>;
|
|
132
|
-
export type ComponentBase<TStruct extends ComponentStruct = ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders> = {
|
|
133
|
-
id: string;
|
|
134
|
-
parentId: string;
|
|
135
|
-
getHierarchyId(): string;
|
|
136
|
-
getParent(): string | undefined;
|
|
137
|
-
getChildren(): string[];
|
|
138
|
-
getChainUp(): string[];
|
|
139
|
-
getChainDown(): string[];
|
|
140
|
-
getNodeMap(): Map<string, TreeNode>;
|
|
141
|
-
bindings: Map<PropertyKey, Binding>;
|
|
142
|
-
msgBus: MsgBus<ComponentMsgStruct<TStruct>, TMsgHeaders>;
|
|
143
|
-
msgBroker: ComponentMsgBroker<TStruct>;
|
|
144
|
-
effects: Record<string, EffectController>;
|
|
145
|
-
View: ComponentViewFn;
|
|
146
|
-
};
|
|
147
|
-
export type ComponentModel<TStruct extends ComponentStruct = ComponentStruct> = TStruct['props'] & Readonly<TStruct['actions']>;
|
|
148
|
-
export type Component<TStruct extends ComponentStruct = ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders> = {
|
|
149
|
-
readonly model: ComponentModel<TStruct>;
|
|
150
|
-
readonly children: Readonly<ComponentChildren<TStruct['children']>>;
|
|
151
|
-
} & Readonly<ComponentBase<TStruct, TMsgHeaders>>;
|
|
152
|
-
export type ComponentParams<TStruct extends ComponentStruct = ComponentStruct> = ComponentPropParams<TStruct['props']> & ComponentEvents<TStruct>;
|
|
153
|
-
export declare function toHtmlId(url: string, segmentsCount?: number): string;
|
|
154
|
-
export type EffectController = {
|
|
155
|
-
start: () => void;
|
|
156
|
-
pause: () => void;
|
|
157
|
-
resume: () => void;
|
|
158
|
-
stop: () => void;
|
|
159
|
-
restart: () => void;
|
|
160
|
-
};
|
|
161
|
-
export declare function createEffect<TStruct extends ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders>(component: Component<TStruct, TMsgHeaders>, name: string, fn: EffectFn<TStruct, TMsgHeaders>): EffectController;
|
|
162
|
-
export declare function useComponent<TStruct extends ComponentStruct = ComponentStruct, TMsgHeaders extends ComponentMsgHeaders = ComponentMsgHeaders>(componentDef: ComponentDef<TStruct, TMsgHeaders>, params: ComponentParams<TStruct>): any;
|
|
163
|
-
export declare function getFC<TStruct extends ComponentStruct>(factory: (params: ComponentParams<TStruct>) => Component<TStruct>): FC<ComponentParams<TStruct>>;
|
|
164
|
-
export {};
|
|
165
|
-
//# sourceMappingURL=componentModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentModel.d.ts","sourceRoot":"","sources":["../../src/componentModel/componentModel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAA8B,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EACH,MAAM,EACN,OAAO,EAGP,GAAG,EACH,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,SAAS,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAE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