@intrig/core 0.0.15-2 → 0.0.15-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/README.md +1 -12
- package/main.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
3
|
-
<g transform="translate(-41.904154,-168.00498)">
|
|
4
|
-
<path style="fill:#00D8C0;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" d="m 114.89996,168.10498 c -1.06916,0 -1.9358,0.86714 -1.9358,1.96733 v 3.84059 h -2.61224 c -1.09993,0 -1.9668,0.86664 -1.9668,1.9358 0,1.06918 0.86687,1.9358 1.9668,1.9358 h 2.61224 v 13.58211 c 0,1.09993 0.86664,1.96681 1.9358,1.96681 1.06916,0 1.9358,-0.86688 1.9358,-1.96681 V 177.7845 h 2.55023 c 1.1002,0 1.96681,-0.86662 1.96681,-1.9358 0,-1.06916 -0.86661,-1.9358 -1.96681,-1.9358 h -2.55023 v -3.84059 c 0,-1.10019 -0.86664,-1.96733 -1.9358,-1.96733 z" />
|
|
5
|
-
<path style="fill:#00D8C0;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" d="m 105.8658,183.59235 c 0,-3.2075 -2.6002,-5.8077 -5.8077,-5.8077 -3.20751,0 -5.8077,2.6002 -5.8077,5.82483 1.2e-4,4.19734 0,4.49999 0,7.73546 0,1.07815 -0.866741,1.94487 -1.935903,1.94487 -1.069175,0 -1.935901,-0.86672 -1.935901,-1.94487 0,-3.23547 9.4e-5,-3.11312 0,-7.74183 0,-5.35659 4.333654,-9.69026 9.679504,-9.69026 5.34584,0 9.6795,4.33367 9.6795,9.69275 v 7.68735 c 0,1.11218 -0.86674,1.97892 -1.9359,1.97892 -1.06916,0 -1.9359,-0.86674 -1.9359,-1.97892 z" />
|
|
6
|
-
<path style="fill:#00D8C0;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" d="m 124.57948,173.88189 c -1.06917,0 -1.9358,0.86662 -1.9358,1.96681 v 7.74371 7.7742 c 0,1.09993 0.86663,1.96681 1.9358,1.96681 1.06915,0 1.9358,-0.86688 1.9358,-1.96681 v -7.75921 c 0,-3.23303 2.62074,-5.85381 5.83065,-5.83841 1.0461,0.0155 1.91306,-0.85113 1.91306,-1.92029 0,-1.06916 -0.86696,-1.936 -1.91306,-1.9513 -2.18669,-0.006 -4.20651,0.71897 -5.83117,1.94458 -0.004,-1.09694 -0.86834,-1.96009 -1.93528,-1.96009 z" />
|
|
7
|
-
<path style="fill:#00D8C0;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" d="m 137.48551,193.318 c -1.06916,0 -1.9359,-0.86674 -1.9359,-1.96666 v -10.95446 c 0,-1.10019 0.86674,-1.96693 1.9359,-1.96693 1.06916,0 1.9359,0.86674 1.9359,1.96693 v 10.95446 c 0,1.09992 -0.86674,1.96666 -1.9359,1.96666 z" />
|
|
8
|
-
<circle style="fill:#00D8C0;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" cx="137.48552" cy="175.84875" r="1.9358984" />
|
|
9
|
-
<path style="fill:#00D8C0;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" d="m 159.42593,173.88189 c -1.06916,0 -1.93632,0.86662 -1.93632,1.96681 v 0.001 a 9.6795038,9.6795038 0 0 0 -5.8074,-1.93683 9.6795038,9.6795038 0 0 0 -9.67951,9.67951 9.6795038,9.6795038 0 0 0 9.67951,9.67951 9.6795038,9.6795038 0 0 0 5.8074,-1.9668 v 3.82199 c 0,3.28811 -2.60016,5.88852 -5.83168,5.88078 l -93.953959,-0.008 c -1.099919,0 -1.966805,0.86664 -1.966805,1.9358 0,1.06916 0.866886,1.93631 1.966805,1.93631 l 93.934319,0.005 c 5.38943,0.0105 9.72344,-4.32282 9.72344,-9.74927 v -11.5347 -7.74371 c 0,-1.10019 -0.86662,-1.96681 -1.9358,-1.96681 z m -7.74372,3.90312 a 5.8077041,5.8077041 0 0 1 5.8074,5.80172 v 0.0114 a 5.8077041,5.8077041 0 0 1 -5.8074,5.80223 5.8077041,5.8077041 0 0 1 -5.80791,-5.80792 5.8077041,5.8077041 0 0 1 5.80791,-5.8074 z" />
|
|
10
|
-
<path style="fill:#00D8C0;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" d="m 85.216195,193.318 c -1.069162,0 -1.9359,-0.86674 -1.9359,-1.96666 v -20.98655 c 0,-1.10019 0.866738,-1.96693 1.9359,-1.96693 1.069162,0 1.935901,0.86674 1.935901,1.96693 v 20.98655 c 0,1.09992 -0.866739,1.96666 -1.935901,1.96666 z" />
|
|
11
|
-
<path style="fill:#888888;fill-opacity:1;stroke:#ffffff;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:0.2" d="m 81.734029,179.04592 -23.717415,0.004 c -8.78429,0.0146 -16.011886,7.2611 -16.01246,16.03158 v 5.1e-4 5.2e-4 c 5.65e-4,8.77049 7.109474,15.87969 15.953032,15.8812 h 9.220626 c 1.249561,0 2.206067,-0.97006 2.206067,-2.16731 0,-1.19725 -0.956114,-2.16783 -2.231906,-2.16783 l -8.990665,-0.0114 c -6.451791,-0.0129 -11.597742,-5.20849 -11.597742,-11.61738 0,-6.40889 5.145707,-11.60343 11.493355,-11.60343 6.347649,0 11.493356,5.19457 11.493356,11.60343 0,8.81624 7.059408,15.96376 15.695682,15.9644 l 66.275541,0.002 c 9.23414,-3e-5 16.47858,-7.14834 16.47858,-15.96595 0,-4.51466 -1.90726,-8.58331 -5.00021,-11.48715 v 9.75754 c 0.086,0.56895 0.14469,1.14707 0.14469,1.73995 0,6.40551 -5.19367,11.59754 -11.62978,11.60756 l -66.117409,0.009 c -6.422849,0 -11.565661,-5.20583 -11.566219,-11.62771 v -5.2e-4 -5.2e-4 c 4.13e-4,-5.32739 3.16079,-9.8136 7.902877,-11.17968 z" />
|
|
12
|
-
</g>
|
|
13
|
-
</svg>
|
|
2
|
+
<img src="https://raw.githubusercontent.com/intrigsoft/intrig-core/refs/heads/main/docs/images/intrig-logo.svg" alt="Intrig Logo" width="300"/>
|
|
14
3
|
</div>
|
|
15
4
|
|
|
16
5
|
# Intrig Core
|
package/main.js
CHANGED
|
@@ -6110,9 +6110,9 @@ function reactContextTemplate(_path, apisToSync) {
|
|
|
6110
6110
|
${apisToSync.map((a)=>`${a.id}?: DefaultConfigs`).join(",\n ")}
|
|
6111
6111
|
}`;
|
|
6112
6112
|
return ts`
|
|
6113
|
-
|
|
6113
|
+
import { NetworkAction, NetworkState } from '@intrig/react/network-state';
|
|
6114
6114
|
import { AxiosProgressEvent, AxiosRequestConfig } from 'axios';
|
|
6115
|
-
import { ZodSchema } from 'zod';
|
|
6115
|
+
import { ZodSchema, ZodType, ZodTypeDef } from 'zod';
|
|
6116
6116
|
import { createContext, useContext, Dispatch } from 'react';
|
|
6117
6117
|
import { DefaultConfigs } from '@intrig/react/intrig-provider';
|
|
6118
6118
|
|
|
@@ -6124,6 +6124,8 @@ interface RequestType<T = any> extends AxiosRequestConfig {
|
|
|
6124
6124
|
source: string
|
|
6125
6125
|
}
|
|
6126
6126
|
|
|
6127
|
+
export type ZodOut<T> = ZodType<T, ZodTypeDef, unknown>;
|
|
6128
|
+
|
|
6127
6129
|
/**
|
|
6128
6130
|
* Defines the ContextType interface for managing global state, dispatching actions,
|
|
6129
6131
|
* and holding a collection of Axios instances.
|
|
@@ -6138,7 +6140,7 @@ export interface ContextType {
|
|
|
6138
6140
|
filteredState: GlobalState;
|
|
6139
6141
|
dispatch: Dispatch<NetworkAction<unknown, unknown>>;
|
|
6140
6142
|
configs: ${configType};
|
|
6141
|
-
execute: <T>(request: RequestType, dispatch: (state: NetworkState<T>) => void, schema:
|
|
6143
|
+
execute: <T>(request: RequestType, dispatch: (state: NetworkState<T>) => void, schema: ZodOut<T> | undefined, errorSchema: ZodOut<T> | undefined) => Promise<void>;
|
|
6142
6144
|
}
|
|
6143
6145
|
|
|
6144
6146
|
/**
|
|
@@ -7244,12 +7246,12 @@ import axios, {
|
|
|
7244
7246
|
InternalAxiosRequestConfig,
|
|
7245
7247
|
isAxiosError,
|
|
7246
7248
|
} from 'axios';
|
|
7247
|
-
import { ZodSchema
|
|
7249
|
+
import { ZodSchema } from 'zod';
|
|
7248
7250
|
import logger from './logger';
|
|
7249
7251
|
import {flushSync} from "react-dom";
|
|
7250
7252
|
import {createParser} from "eventsource-parser";
|
|
7251
7253
|
|
|
7252
|
-
import {Context, RequestType, GlobalState} from './intrig-context';
|
|
7254
|
+
import {Context, RequestType, GlobalState, ZodOut} from './intrig-context';
|
|
7253
7255
|
|
|
7254
7256
|
/**
|
|
7255
7257
|
* Handles state updates for network requests based on the provided action.
|
|
@@ -7666,8 +7668,6 @@ export function useNetworkState<T, E = unknown>({
|
|
|
7666
7668
|
return [networkState, deboundedExecute, clear, dispatch];
|
|
7667
7669
|
}
|
|
7668
7670
|
|
|
7669
|
-
type ZodOut<T> = ZodType<T, ZodTypeDef, unknown>;
|
|
7670
|
-
|
|
7671
7671
|
/**
|
|
7672
7672
|
* A hook for making transient calls that can be aborted and validated against schemas.
|
|
7673
7673
|
*
|
|
@@ -13820,7 +13820,7 @@ async function bootstrap() {
|
|
|
13820
13820
|
} else {
|
|
13821
13821
|
try {
|
|
13822
13822
|
await external_nest_commander_namespaceObject.CommandFactory.run(AppModule, {
|
|
13823
|
-
logger:
|
|
13823
|
+
logger: false,
|
|
13824
13824
|
errorHandler (err) {
|
|
13825
13825
|
if (err.code === 'commander.help') {
|
|
13826
13826
|
return process.exit(0);
|