@cybertools/providers 0.0.0-stage → 1.0.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/LICENSE +201 -0
- package/README.md +20 -2
- package/dist/audits/index.cjs +26 -0
- package/dist/audits/index.d.cts +13 -0
- package/dist/audits/index.d.mts +13 -0
- package/dist/audits/index.mjs +19 -0
- package/dist/audits/model.cjs +44 -0
- package/dist/audits/model.d.cts +37 -0
- package/dist/audits/model.d.mts +37 -0
- package/dist/audits/model.mjs +35 -0
- package/dist/coin/index.cjs +20 -0
- package/dist/coin/index.d.cts +11 -0
- package/dist/coin/index.d.mts +11 -0
- package/dist/coin/index.mjs +13 -0
- package/dist/coin/model.cjs +49 -0
- package/dist/coin/model.d.cts +35 -0
- package/dist/coin/model.d.mts +35 -0
- package/dist/coin/model.mjs +41 -0
- package/dist/findings/index.cjs +16 -0
- package/dist/findings/index.d.cts +10 -0
- package/dist/findings/index.d.mts +10 -0
- package/dist/findings/index.mjs +11 -0
- package/dist/findings/model.cjs +40 -0
- package/dist/findings/model.d.cts +35 -0
- package/dist/findings/model.d.mts +35 -0
- package/dist/findings/model.mjs +32 -0
- package/dist/iterations/index.cjs +20 -0
- package/dist/iterations/index.d.cts +11 -0
- package/dist/iterations/index.d.mts +11 -0
- package/dist/iterations/index.mjs +12 -0
- package/dist/iterations/model.cjs +70 -0
- package/dist/iterations/model.d.cts +69 -0
- package/dist/iterations/model.d.mts +69 -0
- package/dist/iterations/model.mjs +61 -0
- package/dist/legacyCoin/index.cjs +20 -0
- package/dist/legacyCoin/index.d.cts +13 -0
- package/dist/legacyCoin/index.d.mts +13 -0
- package/dist/legacyCoin/index.mjs +16 -0
- package/package.json +88 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { deserialize as deserialize$1, makeDeserializeById, makeDeserializeCollection, makeSerializeById, makeSerializeCollection, serialize as serialize$1 } from "@cybertools/utils";
|
|
2
|
+
//#region src/coin/model.ts
|
|
3
|
+
const dateFields = [
|
|
4
|
+
"createdAt",
|
|
5
|
+
"deployedAt",
|
|
6
|
+
"priceUpdatedAt",
|
|
7
|
+
"deadAmountUpdatedAt",
|
|
8
|
+
"finishedAt"
|
|
9
|
+
];
|
|
10
|
+
const getBackendInitialState = () => ({
|
|
11
|
+
slug: "",
|
|
12
|
+
name: "",
|
|
13
|
+
icon: "",
|
|
14
|
+
description: "",
|
|
15
|
+
badges: [],
|
|
16
|
+
marketcap: "",
|
|
17
|
+
price: "",
|
|
18
|
+
dollarPrice: "",
|
|
19
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
20
|
+
deployedAt: /* @__PURE__ */ new Date(),
|
|
21
|
+
priceUpdatedAt: /* @__PURE__ */ new Date(),
|
|
22
|
+
deadAmountUpdatedAt: /* @__PURE__ */ new Date()
|
|
23
|
+
});
|
|
24
|
+
const getInitialState = () => ({
|
|
25
|
+
...getBackendInitialState(),
|
|
26
|
+
id: "",
|
|
27
|
+
loaded: false,
|
|
28
|
+
loading: false,
|
|
29
|
+
processing: false
|
|
30
|
+
});
|
|
31
|
+
const deserialize = (resource) => deserialize$1(resource, { dateFields });
|
|
32
|
+
const deserializeCollection = makeDeserializeCollection(deserialize);
|
|
33
|
+
const deserializeBySlug = makeDeserializeById(deserialize, "slug");
|
|
34
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
35
|
+
const serialize = (resource) => serialize$1(resource, dateFields);
|
|
36
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
37
|
+
const serializeCollection = makeSerializeCollection(serialize);
|
|
38
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
39
|
+
const serializeBySlug = makeSerializeById(serialize, "slug");
|
|
40
|
+
//#endregion
|
|
41
|
+
export { deserialize, deserializeBySlug, deserializeCollection, getBackendInitialState, getInitialState, serialize, serializeBySlug, serializeCollection };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_findings_model = require("./model.cjs");
|
|
3
|
+
//#region src/findings/index.ts
|
|
4
|
+
const { Provider: FindingsProvider, useCollection, useResource, useResourceValue, useCollectionDispatch, useResourceDispatch } = (0, require("@cybertools/react").makeProvider)({ getResourceInitialState: require_findings_model.getInitialState });
|
|
5
|
+
const useFindings = useCollection;
|
|
6
|
+
const useFinding = useResource;
|
|
7
|
+
const useFindingValue = useResourceValue;
|
|
8
|
+
const useFindingsDispatch = useCollectionDispatch;
|
|
9
|
+
const useFindingDispatch = useResourceDispatch;
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.FindingsProvider = FindingsProvider;
|
|
12
|
+
exports.useFinding = useFinding;
|
|
13
|
+
exports.useFindingDispatch = useFindingDispatch;
|
|
14
|
+
exports.useFindingValue = useFindingValue;
|
|
15
|
+
exports.useFindings = useFindings;
|
|
16
|
+
exports.useFindingsDispatch = useFindingsDispatch;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Finding, FindingBackend } from "./model.cjs";
|
|
2
|
+
//#region src/findings/index.d.ts
|
|
3
|
+
declare const FindingsProvider: import("react").MemoExoticComponent<(props: import("@cybertools/react").CollectionProviderProps<Finding>) => import("react").ReactElement>;
|
|
4
|
+
export declare const useFindings: <S = import("@cybertools/react").Collection<Finding>>(selector?: ((state: import("@cybertools/react").Collection<Finding>) => S) | undefined) => S;
|
|
5
|
+
export declare const useFinding: <S = Finding>(id: string, selector?: ((resource: Finding) => S) | undefined) => S;
|
|
6
|
+
export declare const useFindingValue: <K extends keyof Finding>(id: string, fieldKey: K) => Finding[K];
|
|
7
|
+
export declare const useFindingsDispatch: () => (update: import("@cybertools/react").CollectionUpdate<Finding>) => void;
|
|
8
|
+
export declare const useFindingDispatch: (id: string) => (action: (resource: Finding) => Finding) => void;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { type Finding, type FindingBackend, FindingsProvider };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Finding, FindingBackend } from "./model.mjs";
|
|
2
|
+
//#region src/findings/index.d.ts
|
|
3
|
+
declare const FindingsProvider: import("react").MemoExoticComponent<(props: import("@cybertools/react").CollectionProviderProps<Finding>) => import("react").ReactElement>;
|
|
4
|
+
export declare const useFindings: <S = import("@cybertools/react").Collection<Finding>>(selector?: ((state: import("@cybertools/react").Collection<Finding>) => S) | undefined) => S;
|
|
5
|
+
export declare const useFinding: <S = Finding>(id: string, selector?: ((resource: Finding) => S) | undefined) => S;
|
|
6
|
+
export declare const useFindingValue: <K extends keyof Finding>(id: string, fieldKey: K) => Finding[K];
|
|
7
|
+
export declare const useFindingsDispatch: () => (update: import("@cybertools/react").CollectionUpdate<Finding>) => void;
|
|
8
|
+
export declare const useFindingDispatch: (id: string) => (action: (resource: Finding) => Finding) => void;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { type Finding, type FindingBackend, FindingsProvider };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getInitialState } from "./model.mjs";
|
|
2
|
+
import { makeProvider } from "@cybertools/react";
|
|
3
|
+
//#region src/findings/index.ts
|
|
4
|
+
const { Provider: FindingsProvider, useCollection, useResource, useResourceValue, useCollectionDispatch, useResourceDispatch } = makeProvider({ getResourceInitialState: getInitialState });
|
|
5
|
+
const useFindings = useCollection;
|
|
6
|
+
const useFinding = useResource;
|
|
7
|
+
const useFindingValue = useResourceValue;
|
|
8
|
+
const useFindingsDispatch = useCollectionDispatch;
|
|
9
|
+
const useFindingDispatch = useResourceDispatch;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { FindingsProvider, useFinding, useFindingDispatch, useFindingValue, useFindings, useFindingsDispatch };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _cybertools_utils = require("@cybertools/utils");
|
|
3
|
+
//#region src/findings/model.ts
|
|
4
|
+
const getBackendInitialState = () => ({
|
|
5
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
6
|
+
updatedAt: /* @__PURE__ */ new Date(),
|
|
7
|
+
title: "",
|
|
8
|
+
code: "",
|
|
9
|
+
severity: "minor",
|
|
10
|
+
status: "unresolved",
|
|
11
|
+
locations: [],
|
|
12
|
+
description: "",
|
|
13
|
+
recommendation: "",
|
|
14
|
+
comment: ""
|
|
15
|
+
});
|
|
16
|
+
const getInitialState = () => ({
|
|
17
|
+
...getBackendInitialState(),
|
|
18
|
+
processing: false,
|
|
19
|
+
id: "",
|
|
20
|
+
loaded: false,
|
|
21
|
+
loading: false
|
|
22
|
+
});
|
|
23
|
+
const deserialize = (resource) => (0, _cybertools_utils.deserialize)(resource, { dateFields: ["createdAt", "updatedAt"] });
|
|
24
|
+
const deserializeCollection = (0, _cybertools_utils.makeDeserializeCollection)(deserialize);
|
|
25
|
+
const deserializeById = (0, _cybertools_utils.makeDeserializeById)(deserialize);
|
|
26
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
27
|
+
const serialize = (resource) => (0, _cybertools_utils.serialize)(resource, ["createdAt", "updatedAt"]);
|
|
28
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
29
|
+
const serializeCollection = (0, _cybertools_utils.makeSerializeCollection)(serialize);
|
|
30
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
31
|
+
const serializeById = (0, _cybertools_utils.makeSerializeById)(serialize);
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.deserialize = deserialize;
|
|
34
|
+
exports.deserializeById = deserializeById;
|
|
35
|
+
exports.deserializeCollection = deserializeCollection;
|
|
36
|
+
exports.getBackendInitialState = getBackendInitialState;
|
|
37
|
+
exports.getInitialState = getInitialState;
|
|
38
|
+
exports.serialize = serialize;
|
|
39
|
+
exports.serializeById = serializeById;
|
|
40
|
+
exports.serializeCollection = serializeCollection;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/findings/model.d.ts
|
|
2
|
+
export interface FindingBackend {
|
|
3
|
+
createdAt: Date;
|
|
4
|
+
updatedAt: Date;
|
|
5
|
+
title: string;
|
|
6
|
+
code: string;
|
|
7
|
+
/** critical, medium, minor */
|
|
8
|
+
severity: string;
|
|
9
|
+
/** unresolved, resolved, semiResolved, acknowledged, renounced, multisign */
|
|
10
|
+
status: string;
|
|
11
|
+
/** array of strings */
|
|
12
|
+
locations: string[];
|
|
13
|
+
description: string;
|
|
14
|
+
recommendation: string;
|
|
15
|
+
comment: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface Finding extends FindingBackend {
|
|
19
|
+
processing: boolean;
|
|
20
|
+
id: string;
|
|
21
|
+
loaded: boolean;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const getBackendInitialState: () => FindingBackend;
|
|
25
|
+
export declare const getInitialState: () => Finding;
|
|
26
|
+
export declare const deserialize: (resource: unknown) => Record<string, unknown>;
|
|
27
|
+
export declare const deserializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
28
|
+
export declare const deserializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
29
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
30
|
+
export declare const serialize: (resource: unknown) => Record<string, unknown>;
|
|
31
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
32
|
+
export declare const serializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
33
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
34
|
+
export declare const serializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
35
|
+
//#endregion
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/findings/model.d.ts
|
|
2
|
+
export interface FindingBackend {
|
|
3
|
+
createdAt: Date;
|
|
4
|
+
updatedAt: Date;
|
|
5
|
+
title: string;
|
|
6
|
+
code: string;
|
|
7
|
+
/** critical, medium, minor */
|
|
8
|
+
severity: string;
|
|
9
|
+
/** unresolved, resolved, semiResolved, acknowledged, renounced, multisign */
|
|
10
|
+
status: string;
|
|
11
|
+
/** array of strings */
|
|
12
|
+
locations: string[];
|
|
13
|
+
description: string;
|
|
14
|
+
recommendation: string;
|
|
15
|
+
comment: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface Finding extends FindingBackend {
|
|
19
|
+
processing: boolean;
|
|
20
|
+
id: string;
|
|
21
|
+
loaded: boolean;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const getBackendInitialState: () => FindingBackend;
|
|
25
|
+
export declare const getInitialState: () => Finding;
|
|
26
|
+
export declare const deserialize: (resource: unknown) => Record<string, unknown>;
|
|
27
|
+
export declare const deserializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
28
|
+
export declare const deserializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
29
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
30
|
+
export declare const serialize: (resource: unknown) => Record<string, unknown>;
|
|
31
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
32
|
+
export declare const serializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
33
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
34
|
+
export declare const serializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
35
|
+
//#endregion
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { deserialize as deserialize$1, makeDeserializeById, makeDeserializeCollection, makeSerializeById, makeSerializeCollection, serialize as serialize$1 } from "@cybertools/utils";
|
|
2
|
+
//#region src/findings/model.ts
|
|
3
|
+
const getBackendInitialState = () => ({
|
|
4
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
5
|
+
updatedAt: /* @__PURE__ */ new Date(),
|
|
6
|
+
title: "",
|
|
7
|
+
code: "",
|
|
8
|
+
severity: "minor",
|
|
9
|
+
status: "unresolved",
|
|
10
|
+
locations: [],
|
|
11
|
+
description: "",
|
|
12
|
+
recommendation: "",
|
|
13
|
+
comment: ""
|
|
14
|
+
});
|
|
15
|
+
const getInitialState = () => ({
|
|
16
|
+
...getBackendInitialState(),
|
|
17
|
+
processing: false,
|
|
18
|
+
id: "",
|
|
19
|
+
loaded: false,
|
|
20
|
+
loading: false
|
|
21
|
+
});
|
|
22
|
+
const deserialize = (resource) => deserialize$1(resource, { dateFields: ["createdAt", "updatedAt"] });
|
|
23
|
+
const deserializeCollection = makeDeserializeCollection(deserialize);
|
|
24
|
+
const deserializeById = makeDeserializeById(deserialize);
|
|
25
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
26
|
+
const serialize = (resource) => serialize$1(resource, ["createdAt", "updatedAt"]);
|
|
27
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
28
|
+
const serializeCollection = makeSerializeCollection(serialize);
|
|
29
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
30
|
+
const serializeById = makeSerializeById(serialize);
|
|
31
|
+
//#endregion
|
|
32
|
+
export { deserialize, deserializeById, deserializeCollection, getBackendInitialState, getInitialState, serialize, serializeById, serializeCollection };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_iterations_model = require("./model.cjs");
|
|
3
|
+
let _cybertools_react = require("@cybertools/react");
|
|
4
|
+
//#region src/iterations/index.ts
|
|
5
|
+
const getIterationInitialState = require_iterations_model.getInitialState;
|
|
6
|
+
const { Provider: IterationsProvider, useCollection, useResource, useResourceValue, useCollectionDispatch, useResourceDispatch } = (0, _cybertools_react.makeProvider)({ getResourceInitialState: require_iterations_model.getInitialState });
|
|
7
|
+
const useIterations = useCollection;
|
|
8
|
+
const useIteration = useResource;
|
|
9
|
+
const useIterationValue = useResourceValue;
|
|
10
|
+
const useIterationsDispatch = useCollectionDispatch;
|
|
11
|
+
const useIterationDispatch = useResourceDispatch;
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.IterationsProvider = IterationsProvider;
|
|
14
|
+
exports.getFilesInitialState = require_iterations_model.getFilesInitialState;
|
|
15
|
+
exports.getIterationInitialState = getIterationInitialState;
|
|
16
|
+
exports.useIteration = useIteration;
|
|
17
|
+
exports.useIterationDispatch = useIterationDispatch;
|
|
18
|
+
exports.useIterationValue = useIterationValue;
|
|
19
|
+
exports.useIterations = useIterations;
|
|
20
|
+
exports.useIterationsDispatch = useIterationsDispatch;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Iteration, IterationBackend, IterationFile, getFilesInitialState } from "./model.cjs";
|
|
2
|
+
//#region src/iterations/index.d.ts
|
|
3
|
+
export declare const getIterationInitialState: () => Iteration;
|
|
4
|
+
declare const IterationsProvider: import("react").MemoExoticComponent<(props: import("@cybertools/react").CollectionProviderProps<Iteration>) => import("react").ReactElement>;
|
|
5
|
+
export declare const useIterations: <S = import("@cybertools/react").Collection<Iteration>>(selector?: ((state: import("@cybertools/react").Collection<Iteration>) => S) | undefined) => S;
|
|
6
|
+
export declare const useIteration: <S = Iteration>(id: string, selector?: ((resource: Iteration) => S) | undefined) => S;
|
|
7
|
+
export declare const useIterationValue: <K extends keyof Iteration>(id: string, fieldKey: K) => Iteration[K];
|
|
8
|
+
export declare const useIterationsDispatch: () => (update: import("@cybertools/react").CollectionUpdate<Iteration>) => void;
|
|
9
|
+
export declare const useIterationDispatch: (id: string) => (action: (resource: Iteration) => Iteration) => void;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { type Iteration, type IterationBackend, type IterationFile, IterationsProvider, getFilesInitialState };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Iteration, IterationBackend, IterationFile, getFilesInitialState } from "./model.mjs";
|
|
2
|
+
//#region src/iterations/index.d.ts
|
|
3
|
+
export declare const getIterationInitialState: () => Iteration;
|
|
4
|
+
declare const IterationsProvider: import("react").MemoExoticComponent<(props: import("@cybertools/react").CollectionProviderProps<Iteration>) => import("react").ReactElement>;
|
|
5
|
+
export declare const useIterations: <S = import("@cybertools/react").Collection<Iteration>>(selector?: ((state: import("@cybertools/react").Collection<Iteration>) => S) | undefined) => S;
|
|
6
|
+
export declare const useIteration: <S = Iteration>(id: string, selector?: ((resource: Iteration) => S) | undefined) => S;
|
|
7
|
+
export declare const useIterationValue: <K extends keyof Iteration>(id: string, fieldKey: K) => Iteration[K];
|
|
8
|
+
export declare const useIterationsDispatch: () => (update: import("@cybertools/react").CollectionUpdate<Iteration>) => void;
|
|
9
|
+
export declare const useIterationDispatch: (id: string) => (action: (resource: Iteration) => Iteration) => void;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { type Iteration, type IterationBackend, type IterationFile, IterationsProvider, getFilesInitialState };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getFilesInitialState, getInitialState } from "./model.mjs";
|
|
2
|
+
import { makeProvider } from "@cybertools/react";
|
|
3
|
+
//#region src/iterations/index.ts
|
|
4
|
+
const getIterationInitialState = getInitialState;
|
|
5
|
+
const { Provider: IterationsProvider, useCollection, useResource, useResourceValue, useCollectionDispatch, useResourceDispatch } = makeProvider({ getResourceInitialState: getInitialState });
|
|
6
|
+
const useIterations = useCollection;
|
|
7
|
+
const useIteration = useResource;
|
|
8
|
+
const useIterationValue = useResourceValue;
|
|
9
|
+
const useIterationsDispatch = useCollectionDispatch;
|
|
10
|
+
const useIterationDispatch = useResourceDispatch;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { IterationsProvider, getFilesInitialState, getIterationInitialState, useIteration, useIterationDispatch, useIterationValue, useIterations, useIterationsDispatch };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _cybertools_utils = require("@cybertools/utils");
|
|
3
|
+
//#region src/iterations/model.ts
|
|
4
|
+
const dateFields = [
|
|
5
|
+
"updatedAt",
|
|
6
|
+
"progressedAt",
|
|
7
|
+
"finishedAt"
|
|
8
|
+
];
|
|
9
|
+
const getFilesInitialState = () => ({
|
|
10
|
+
path: "",
|
|
11
|
+
sha256: ""
|
|
12
|
+
});
|
|
13
|
+
const getBackendInitialState = () => ({
|
|
14
|
+
updatedAt: /* @__PURE__ */ new Date(),
|
|
15
|
+
progressedAt: /* @__PURE__ */ new Date(),
|
|
16
|
+
finishedAt: null,
|
|
17
|
+
findingIds: [],
|
|
18
|
+
aiFindingIds: [],
|
|
19
|
+
source: "deployed",
|
|
20
|
+
address: "",
|
|
21
|
+
network: "",
|
|
22
|
+
repository: "",
|
|
23
|
+
commit: "",
|
|
24
|
+
files: [],
|
|
25
|
+
highCriticality: true,
|
|
26
|
+
badgeApplicable: "",
|
|
27
|
+
autoSort: true,
|
|
28
|
+
githubUploaded: false,
|
|
29
|
+
composerSource: "deployedAddress",
|
|
30
|
+
composerAddress: "",
|
|
31
|
+
composerNetwork: "",
|
|
32
|
+
filterFiles: [],
|
|
33
|
+
introduction: "",
|
|
34
|
+
hidden: false
|
|
35
|
+
});
|
|
36
|
+
const getInitialState = () => ({
|
|
37
|
+
...getBackendInitialState(),
|
|
38
|
+
id: "",
|
|
39
|
+
editMode: true,
|
|
40
|
+
localComposerLoading: false,
|
|
41
|
+
localComposer: false,
|
|
42
|
+
localComposerFunctions: "",
|
|
43
|
+
localComposerDir: "",
|
|
44
|
+
processing: false,
|
|
45
|
+
editingId: "",
|
|
46
|
+
findingsStatsLoaded: false,
|
|
47
|
+
findingsOverviewLoaded: false,
|
|
48
|
+
selectedFindingIds: [],
|
|
49
|
+
loaded: false,
|
|
50
|
+
loading: false
|
|
51
|
+
});
|
|
52
|
+
const deserialize = (resource) => (0, _cybertools_utils.deserialize)(resource, { dateFields });
|
|
53
|
+
const deserializeCollection = (0, _cybertools_utils.makeDeserializeCollection)(deserialize);
|
|
54
|
+
const deserializeById = (0, _cybertools_utils.makeDeserializeById)(deserialize);
|
|
55
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
56
|
+
const serialize = (resource) => (0, _cybertools_utils.serialize)(resource, dateFields);
|
|
57
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
58
|
+
const serializeCollection = (0, _cybertools_utils.makeSerializeCollection)(serialize);
|
|
59
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
60
|
+
const serializeById = (0, _cybertools_utils.makeSerializeById)(serialize);
|
|
61
|
+
//#endregion
|
|
62
|
+
exports.deserialize = deserialize;
|
|
63
|
+
exports.deserializeById = deserializeById;
|
|
64
|
+
exports.deserializeCollection = deserializeCollection;
|
|
65
|
+
exports.getBackendInitialState = getBackendInitialState;
|
|
66
|
+
exports.getFilesInitialState = getFilesInitialState;
|
|
67
|
+
exports.getInitialState = getInitialState;
|
|
68
|
+
exports.serialize = serialize;
|
|
69
|
+
exports.serializeById = serializeById;
|
|
70
|
+
exports.serializeCollection = serializeCollection;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//#region src/iterations/model.d.ts
|
|
2
|
+
export interface IterationFile {
|
|
3
|
+
path: string;
|
|
4
|
+
sha256: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface IterationBackend {
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
progressedAt: Date;
|
|
10
|
+
finishedAt: Date | null;
|
|
11
|
+
findingIds: string[];
|
|
12
|
+
aiFindingIds: string[];
|
|
13
|
+
/** files | repository | deployed */
|
|
14
|
+
source: string;
|
|
15
|
+
/** if deployed */
|
|
16
|
+
address: string;
|
|
17
|
+
/** if deployed */
|
|
18
|
+
network: string;
|
|
19
|
+
/** if repository */
|
|
20
|
+
repository: string;
|
|
21
|
+
/** if repository */
|
|
22
|
+
commit: string;
|
|
23
|
+
files: IterationFile[];
|
|
24
|
+
highCriticality: boolean;
|
|
25
|
+
/** Yes, No, Disable */
|
|
26
|
+
badgeApplicable: string;
|
|
27
|
+
autoSort: boolean;
|
|
28
|
+
githubUploaded: boolean;
|
|
29
|
+
/** testingDeploy, localFiles, deployedAddress */
|
|
30
|
+
composerSource: string;
|
|
31
|
+
/** if testingDeploy */
|
|
32
|
+
composerAddress: string;
|
|
33
|
+
/** slither accepted networks */
|
|
34
|
+
composerNetwork: string;
|
|
35
|
+
/** composer parse specific files */
|
|
36
|
+
filterFiles: string[];
|
|
37
|
+
introduction: string;
|
|
38
|
+
hidden: boolean;
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
}
|
|
41
|
+
export interface Iteration extends IterationBackend {
|
|
42
|
+
id: string;
|
|
43
|
+
editMode: boolean;
|
|
44
|
+
localComposerLoading: boolean;
|
|
45
|
+
/** found local configuration */
|
|
46
|
+
localComposer: boolean;
|
|
47
|
+
localComposerFunctions: string;
|
|
48
|
+
localComposerDir: string;
|
|
49
|
+
processing: boolean;
|
|
50
|
+
editingId: string;
|
|
51
|
+
findingsStatsLoaded: boolean;
|
|
52
|
+
findingsOverviewLoaded: boolean;
|
|
53
|
+
selectedFindingIds: string[];
|
|
54
|
+
loaded: boolean;
|
|
55
|
+
loading: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare const getFilesInitialState: () => IterationFile;
|
|
58
|
+
export declare const getBackendInitialState: () => IterationBackend;
|
|
59
|
+
export declare const getInitialState: () => Iteration;
|
|
60
|
+
export declare const deserialize: (resource: unknown) => Record<string, unknown>;
|
|
61
|
+
export declare const deserializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
62
|
+
export declare const deserializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
63
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
64
|
+
export declare const serialize: (resource: unknown) => Record<string, unknown>;
|
|
65
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
66
|
+
export declare const serializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
67
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
68
|
+
export declare const serializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
69
|
+
//#endregion
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//#region src/iterations/model.d.ts
|
|
2
|
+
export interface IterationFile {
|
|
3
|
+
path: string;
|
|
4
|
+
sha256: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface IterationBackend {
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
progressedAt: Date;
|
|
10
|
+
finishedAt: Date | null;
|
|
11
|
+
findingIds: string[];
|
|
12
|
+
aiFindingIds: string[];
|
|
13
|
+
/** files | repository | deployed */
|
|
14
|
+
source: string;
|
|
15
|
+
/** if deployed */
|
|
16
|
+
address: string;
|
|
17
|
+
/** if deployed */
|
|
18
|
+
network: string;
|
|
19
|
+
/** if repository */
|
|
20
|
+
repository: string;
|
|
21
|
+
/** if repository */
|
|
22
|
+
commit: string;
|
|
23
|
+
files: IterationFile[];
|
|
24
|
+
highCriticality: boolean;
|
|
25
|
+
/** Yes, No, Disable */
|
|
26
|
+
badgeApplicable: string;
|
|
27
|
+
autoSort: boolean;
|
|
28
|
+
githubUploaded: boolean;
|
|
29
|
+
/** testingDeploy, localFiles, deployedAddress */
|
|
30
|
+
composerSource: string;
|
|
31
|
+
/** if testingDeploy */
|
|
32
|
+
composerAddress: string;
|
|
33
|
+
/** slither accepted networks */
|
|
34
|
+
composerNetwork: string;
|
|
35
|
+
/** composer parse specific files */
|
|
36
|
+
filterFiles: string[];
|
|
37
|
+
introduction: string;
|
|
38
|
+
hidden: boolean;
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
}
|
|
41
|
+
export interface Iteration extends IterationBackend {
|
|
42
|
+
id: string;
|
|
43
|
+
editMode: boolean;
|
|
44
|
+
localComposerLoading: boolean;
|
|
45
|
+
/** found local configuration */
|
|
46
|
+
localComposer: boolean;
|
|
47
|
+
localComposerFunctions: string;
|
|
48
|
+
localComposerDir: string;
|
|
49
|
+
processing: boolean;
|
|
50
|
+
editingId: string;
|
|
51
|
+
findingsStatsLoaded: boolean;
|
|
52
|
+
findingsOverviewLoaded: boolean;
|
|
53
|
+
selectedFindingIds: string[];
|
|
54
|
+
loaded: boolean;
|
|
55
|
+
loading: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare const getFilesInitialState: () => IterationFile;
|
|
58
|
+
export declare const getBackendInitialState: () => IterationBackend;
|
|
59
|
+
export declare const getInitialState: () => Iteration;
|
|
60
|
+
export declare const deserialize: (resource: unknown) => Record<string, unknown>;
|
|
61
|
+
export declare const deserializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
62
|
+
export declare const deserializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
63
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
64
|
+
export declare const serialize: (resource: unknown) => Record<string, unknown>;
|
|
65
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
66
|
+
export declare const serializeCollection: (collection: readonly unknown[]) => Record<string, unknown>[];
|
|
67
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
68
|
+
export declare const serializeById: (collection: readonly unknown[] | Record<string, unknown>) => [Record<string, Record<string, unknown>>, unknown[]];
|
|
69
|
+
//#endregion
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { deserialize as deserialize$1, makeDeserializeById, makeDeserializeCollection, makeSerializeById, makeSerializeCollection, serialize as serialize$1 } from "@cybertools/utils";
|
|
2
|
+
//#region src/iterations/model.ts
|
|
3
|
+
const dateFields = [
|
|
4
|
+
"updatedAt",
|
|
5
|
+
"progressedAt",
|
|
6
|
+
"finishedAt"
|
|
7
|
+
];
|
|
8
|
+
const getFilesInitialState = () => ({
|
|
9
|
+
path: "",
|
|
10
|
+
sha256: ""
|
|
11
|
+
});
|
|
12
|
+
const getBackendInitialState = () => ({
|
|
13
|
+
updatedAt: /* @__PURE__ */ new Date(),
|
|
14
|
+
progressedAt: /* @__PURE__ */ new Date(),
|
|
15
|
+
finishedAt: null,
|
|
16
|
+
findingIds: [],
|
|
17
|
+
aiFindingIds: [],
|
|
18
|
+
source: "deployed",
|
|
19
|
+
address: "",
|
|
20
|
+
network: "",
|
|
21
|
+
repository: "",
|
|
22
|
+
commit: "",
|
|
23
|
+
files: [],
|
|
24
|
+
highCriticality: true,
|
|
25
|
+
badgeApplicable: "",
|
|
26
|
+
autoSort: true,
|
|
27
|
+
githubUploaded: false,
|
|
28
|
+
composerSource: "deployedAddress",
|
|
29
|
+
composerAddress: "",
|
|
30
|
+
composerNetwork: "",
|
|
31
|
+
filterFiles: [],
|
|
32
|
+
introduction: "",
|
|
33
|
+
hidden: false
|
|
34
|
+
});
|
|
35
|
+
const getInitialState = () => ({
|
|
36
|
+
...getBackendInitialState(),
|
|
37
|
+
id: "",
|
|
38
|
+
editMode: true,
|
|
39
|
+
localComposerLoading: false,
|
|
40
|
+
localComposer: false,
|
|
41
|
+
localComposerFunctions: "",
|
|
42
|
+
localComposerDir: "",
|
|
43
|
+
processing: false,
|
|
44
|
+
editingId: "",
|
|
45
|
+
findingsStatsLoaded: false,
|
|
46
|
+
findingsOverviewLoaded: false,
|
|
47
|
+
selectedFindingIds: [],
|
|
48
|
+
loaded: false,
|
|
49
|
+
loading: false
|
|
50
|
+
});
|
|
51
|
+
const deserialize = (resource) => deserialize$1(resource, { dateFields });
|
|
52
|
+
const deserializeCollection = makeDeserializeCollection(deserialize);
|
|
53
|
+
const deserializeById = makeDeserializeById(deserialize);
|
|
54
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
55
|
+
const serialize = (resource) => serialize$1(resource, dateFields);
|
|
56
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
57
|
+
const serializeCollection = makeSerializeCollection(serialize);
|
|
58
|
+
/** @deprecated Use deserialize — kept for @cybertools/ui compatibility. */
|
|
59
|
+
const serializeById = makeSerializeById(serialize);
|
|
60
|
+
//#endregion
|
|
61
|
+
export { deserialize, deserializeById, deserializeCollection, getBackendInitialState, getFilesInitialState, getInitialState, serialize, serializeById, serializeCollection };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/legacyCoin/index.ts
|
|
3
|
+
const { Provider: LegacyCoinProvider, useCollection, useResource, useResourceDispatch } = (0, require("@cybertools/react").makeProvider)();
|
|
4
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
5
|
+
const useCoins = useCollection;
|
|
6
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
7
|
+
const useCoin = useResource;
|
|
8
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
9
|
+
const useAirdrop = (slug) => {
|
|
10
|
+
const { airdrop } = useResource(slug);
|
|
11
|
+
return airdrop;
|
|
12
|
+
};
|
|
13
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
14
|
+
const useCoinResourceDispatch = useResourceDispatch;
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.LegacyCoinProvider = LegacyCoinProvider;
|
|
17
|
+
exports.useAirdrop = useAirdrop;
|
|
18
|
+
exports.useCoin = useCoin;
|
|
19
|
+
exports.useCoinResourceDispatch = useCoinResourceDispatch;
|
|
20
|
+
exports.useCoins = useCoins;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Coin } from "../coin/model.cjs";
|
|
2
|
+
//#region src/legacyCoin/index.d.ts
|
|
3
|
+
declare const LegacyCoinProvider: import("react").MemoExoticComponent<(props: import("@cybertools/react").CollectionProviderProps<Coin>) => import("react").ReactElement>;
|
|
4
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
5
|
+
export declare const useCoins: <S = import("@cybertools/react").Collection<Coin>>(selector?: ((state: import("@cybertools/react").Collection<Coin>) => S) | undefined) => S;
|
|
6
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
7
|
+
export declare const useCoin: <S = Coin>(id: string, selector?: ((resource: Coin) => S) | undefined) => S;
|
|
8
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
9
|
+
export declare const useAirdrop: (slug: string) => unknown;
|
|
10
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
11
|
+
export declare const useCoinResourceDispatch: (id: string) => (action: (resource: Coin) => Coin) => void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { LegacyCoinProvider };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Coin } from "../coin/model.mjs";
|
|
2
|
+
//#region src/legacyCoin/index.d.ts
|
|
3
|
+
declare const LegacyCoinProvider: import("react").MemoExoticComponent<(props: import("@cybertools/react").CollectionProviderProps<Coin>) => import("react").ReactElement>;
|
|
4
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
5
|
+
export declare const useCoins: <S = import("@cybertools/react").Collection<Coin>>(selector?: ((state: import("@cybertools/react").Collection<Coin>) => S) | undefined) => S;
|
|
6
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
7
|
+
export declare const useCoin: <S = Coin>(id: string, selector?: ((resource: Coin) => S) | undefined) => S;
|
|
8
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
9
|
+
export declare const useAirdrop: (slug: string) => unknown;
|
|
10
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
11
|
+
export declare const useCoinResourceDispatch: (id: string) => (action: (resource: Coin) => Coin) => void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { LegacyCoinProvider };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { makeProvider } from "@cybertools/react";
|
|
2
|
+
//#region src/legacyCoin/index.ts
|
|
3
|
+
const { Provider: LegacyCoinProvider, useCollection, useResource, useResourceDispatch } = makeProvider();
|
|
4
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
5
|
+
const useCoins = useCollection;
|
|
6
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
7
|
+
const useCoin = useResource;
|
|
8
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
9
|
+
const useAirdrop = (slug) => {
|
|
10
|
+
const { airdrop } = useResource(slug);
|
|
11
|
+
return airdrop;
|
|
12
|
+
};
|
|
13
|
+
/** @deprecated Use @cybertools/providers/coin. Separate context from CoinProvider. */
|
|
14
|
+
const useCoinResourceDispatch = useResourceDispatch;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { LegacyCoinProvider, useAirdrop, useCoin, useCoinResourceDispatch, useCoins };
|