akanjs 2.0.5 → 2.0.6
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/cli/application/application.runner.ts +1 -1
- package/cli/build.ts +2 -1
- package/cli/cloud/cloud.runner.ts +7 -8
- package/cli/index.js +176 -43
- package/cli/library/library.runner.ts +2 -2
- package/cli/module/module.runner.ts +2 -2
- package/cli/npmRegistry.ts +13 -0
- package/cli/openBrowser.ts +15 -0
- package/cli/pluralizeName.ts +5 -0
- package/cli/scalar/scalar.prompt.ts +2 -2
- package/cli/scalar/scalar.runner.ts +2 -2
- package/cli/semver.ts +18 -0
- package/cli/templates/lib/sig.ts +2 -2
- package/cli/workspace/workspace.runner.ts +3 -3
- package/client/cookie.ts +10 -15
- package/common/index.ts +1 -0
- package/common/jwtDecode.ts +17 -0
- package/devkit/akanApp/akanApp.host.ts +46 -9
- package/devkit/akanConfig/akanConfig.ts +2 -1
- package/devkit/incrementalBuilder/incrementalBuilder.host.ts +83 -9
- package/document/dataLoader.ts +140 -6
- package/document/database.ts +1 -1
- package/package.json +7 -13
- package/server/akanApp.ts +197 -32
- package/server/di/diLifecycle.ts +1 -1
- package/server/proxy/localeWebProxy.ts +29 -12
- package/service/serviceModule.ts +1 -6
- package/signal/base.signal.ts +1 -1
- package/signal/signalRegistry.ts +35 -10
- package/types/cli/npmRegistry.d.ts +1 -0
- package/types/cli/openBrowser.d.ts +1 -0
- package/types/cli/pluralizeName.d.ts +1 -0
- package/types/cli/semver.d.ts +1 -0
- package/types/client/cookie.d.ts +6 -1
- package/types/common/index.d.ts +1 -0
- package/types/common/jwtDecode.d.ts +2 -0
- package/types/devkit/incrementalBuilder/incrementalBuilder.host.d.ts +9 -5
- package/types/document/dataLoader.d.ts +21 -2
- package/types/document/database.d.ts +1 -1
- package/types/service/serviceModule.d.ts +1 -1
- package/types/signal/signalRegistry.d.ts +25 -4
- package/ui/Signal/Doc.tsx +2 -3
|
@@ -3,6 +3,14 @@ import type { InternalCls } from "./internal.d.ts";
|
|
|
3
3
|
import type { ServerSignalCls } from "./serverSignal.d.ts";
|
|
4
4
|
import type { SliceCls } from "./slice.d.ts";
|
|
5
5
|
import type { SerializedSignal } from "./types.d.ts";
|
|
6
|
+
type SignalBaseRef<SigCls> = SigCls extends {
|
|
7
|
+
srv: {
|
|
8
|
+
srv: {
|
|
9
|
+
refName: infer RefName;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
} ? RefName : never;
|
|
13
|
+
type SignalWithBase<RefName extends string, SigCls> = SignalBaseRef<SigCls> extends RefName ? SigCls : never;
|
|
6
14
|
export declare class DatabaseSignal<IntlCls extends InternalCls = InternalCls, EndpCls extends EndpointCls = EndpointCls, SlceCls extends SliceCls = SliceCls, SrvrCls extends ServerSignalCls = ServerSignalCls> {
|
|
7
15
|
internal: IntlCls;
|
|
8
16
|
endpoint: EndpCls;
|
|
@@ -21,8 +29,21 @@ export declare class ServiceSignal<IntlCls extends InternalCls = InternalCls, En
|
|
|
21
29
|
/** Registry for database and service signals used by routing and fetch serialization. */
|
|
22
30
|
export declare class SignalRegistry {
|
|
23
31
|
#private;
|
|
24
|
-
static registerDatabase<IntlCls extends InternalCls, EndpCls extends EndpointCls, SlceCls extends SliceCls, SrvrCls extends ServerSignalCls>(internal:
|
|
25
|
-
static getDatabase(refName: string): DatabaseSignal<
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
static registerDatabase<RefName extends string, IntlCls extends InternalCls, EndpCls extends EndpointCls, SlceCls extends SliceCls, SrvrCls extends ServerSignalCls>(refName: RefName, internal: SignalWithBase<RefName, IntlCls>, endpoint: SignalWithBase<RefName, EndpCls>, slice: SignalWithBase<RefName, SlceCls>, server: SrvrCls): DatabaseSignal<IntlCls, EndpCls, SlceCls, SrvrCls>;
|
|
33
|
+
static getDatabase(refName: string): DatabaseSignal<InternalCls, EndpointCls<import("../service.d.ts").ServiceModel<import("../service.d.ts").ServiceCls, any, any, {
|
|
34
|
+
[x: `${Uncapitalize<string>}Service`]: import("../service.d.ts").ExtractInjectInfoObject<{}> & import("../service.d.ts").Service;
|
|
35
|
+
}>, {
|
|
36
|
+
[key: string]: import("./endpointInfo.d.ts").EndpointInfo<import("./endpointInfo.d.ts").EndpointType, {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}, any, any, any, any, import("../constant.d.ts").ConstantFieldTypeInput, never, never, boolean>;
|
|
39
|
+
}>, SliceCls, ServerSignalCls> | undefined;
|
|
40
|
+
static registerService<RefName extends string, IntlCls extends InternalCls, EndpCls extends EndpointCls, SrvrCls extends ServerSignalCls>(refName: RefName, internal: SignalWithBase<RefName, IntlCls>, endpoint: SignalWithBase<RefName, EndpCls>, server: SrvrCls): ServiceSignal<IntlCls, EndpCls, SrvrCls>;
|
|
41
|
+
static getService(refName: string): ServiceSignal<InternalCls, EndpointCls<import("../service.d.ts").ServiceModel<import("../service.d.ts").ServiceCls, any, any, {
|
|
42
|
+
[x: `${Uncapitalize<string>}Service`]: import("../service.d.ts").ExtractInjectInfoObject<{}> & import("../service.d.ts").Service;
|
|
43
|
+
}>, {
|
|
44
|
+
[key: string]: import("./endpointInfo.d.ts").EndpointInfo<import("./endpointInfo.d.ts").EndpointType, {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}, any, any, any, any, import("../constant.d.ts").ConstantFieldTypeInput, never, never, boolean>;
|
|
47
|
+
}>, ServerSignalCls> | undefined;
|
|
28
48
|
}
|
|
49
|
+
export {};
|
package/ui/Signal/Doc.tsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { fetch, usePage } from "akanjs/client";
|
|
3
|
-
import { lowerlize } from "akanjs/common";
|
|
3
|
+
import { decodeJwtPayload, lowerlize } from "akanjs/common";
|
|
4
4
|
import { type Account, type FetchProxy, getDefaultAccount } from "akanjs/fetch";
|
|
5
5
|
import { st } from "akanjs/store";
|
|
6
|
-
import { jwtDecode } from "jwt-decode";
|
|
7
6
|
import { type ReactNode, useEffect, useState } from "react";
|
|
8
7
|
import { AiOutlineApi, AiOutlineCopy } from "react-icons/ai";
|
|
9
8
|
import { BiLock } from "react-icons/bi";
|
|
@@ -105,7 +104,7 @@ const DocAuthModal = ({ children }: DocAuthModalProps) => {
|
|
|
105
104
|
const tryJwt = st.use.tryJwt();
|
|
106
105
|
const [jwt, setJwt] = useState(tryJwt);
|
|
107
106
|
const [modalOpen, setModalOpen] = useState(false);
|
|
108
|
-
const decodedAccount = jwt ?
|
|
107
|
+
const decodedAccount = jwt ? decodeJwtPayload<Account>(jwt) : null;
|
|
109
108
|
const accountStr = JSON.stringify(decodedAccount ?? getDefaultAccount(), null, 2);
|
|
110
109
|
return (
|
|
111
110
|
<>
|