gomtm 0.0.224 → 0.0.225

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.
@@ -10,6 +10,7 @@ export declare const MTM_SERVER_COOKIE_ACTIVATE_URL = "mtm:serverUrl";
10
10
  export declare const MTM_SERVER_COOKIE_ACTIVATE_SELFBACKEND_URL = "mtm:selfbackendUrl";
11
11
  export declare const DEFAULT_revalidate_SECONDS = 3;
12
12
  export declare const LOGIN_CALLBACK_URL_KEY = "back";
13
+ export declare const MTM_API_PREFIX = "/api";
13
14
  export declare const ExtKey_Hostname = "host";
14
15
  export declare const ExtKey_mtmaccessToken = "access_token";
15
16
  export declare const ItemAction_list_new_item = "list_new_item";
@@ -10,6 +10,7 @@ const MTM_SERVER_COOKIE_ACTIVATE_URL = "mtm:serverUrl";
10
10
  const MTM_SERVER_COOKIE_ACTIVATE_SELFBACKEND_URL = "mtm:selfbackendUrl";
11
11
  const DEFAULT_revalidate_SECONDS = 3;
12
12
  const LOGIN_CALLBACK_URL_KEY = "back";
13
+ const MTM_API_PREFIX = "/api";
13
14
  const ExtKey_Hostname = "host";
14
15
  const ExtKey_mtmaccessToken = "access_token";
15
16
  const ItemAction_list_new_item = "list_new_item";
@@ -45,6 +46,7 @@ export {
45
46
  ListView_DefaultPageSize,
46
47
  Listview_list_filter,
47
48
  MEMBER_ROLE,
49
+ MTM_API_PREFIX,
48
50
  MTM_SERVER_COOKIE_ACTIVATE_SELFBACKEND_URL,
49
51
  MTM_SERVER_COOKIE_ACTIVATE_URL,
50
52
  MTM_SITE_HOSTNAME,
@@ -37,6 +37,7 @@ var __async = (__this, __arguments, generator) => {
37
37
  import { createPromiseClient } from "@connectrpc/connect";
38
38
  import { createConnectTransport } from "@connectrpc/connect-web";
39
39
  import { merge } from "lodash";
40
+ import { MTM_API_PREFIX } from "./consts";
40
41
  import { MtmService } from "./gomtmpb/mtm/sppb/mtm_connect";
41
42
  const ssrGetBackendUrl = () => {
42
43
  var _a;
@@ -48,11 +49,11 @@ const ssrGetBackendUrl = () => {
48
49
  return `https://${process.env.VERCEL_URL}`;
49
50
  }
50
51
  }
51
- return "https://localhost";
52
+ return "";
52
53
  };
53
54
  function createMtmServiceClient(service, url) {
54
55
  const baseUrl = ssrGetBackendUrl();
55
- const apiUrl = new URL("/api", baseUrl).toString();
56
+ const apiUrl = new URL(MTM_API_PREFIX, baseUrl).toString();
56
57
  console.info("gomtm apiUrl:", baseUrl);
57
58
  return createPromiseClient(
58
59
  service,
@@ -52,9 +52,6 @@ export declare const isDebugValueAtom: import("jotai").PrimitiveAtom<boolean> &
52
52
  };
53
53
  export declare const isDebugAtom: import("jotai").WritableAtom<boolean, [value: boolean], void>;
54
54
  export declare const transportAtom: import("jotai").Atom<Transport>;
55
- export declare const useGomtmBackend: () => {
56
- gomtmBaseUrl: string;
57
- };
58
55
  interface GomtmAppProps {
59
56
  backendUrl?: string | null;
60
57
  }
@@ -37,10 +37,6 @@ const isDebugAtom = atom((get) => {
37
37
  const transportAtom = atom((get) => {
38
38
  const baseUrl = get(curd3BackendUrlAtom);
39
39
  const cookiesStr = get(cookiesAtom);
40
- console.log("transportAtom :", {
41
- baseUrl,
42
- cookiesStr
43
- });
44
40
  return createConnectTransport({
45
41
  baseUrl,
46
42
  fetch: gomtmFetcher({
@@ -48,12 +44,6 @@ const transportAtom = atom((get) => {
48
44
  })
49
45
  });
50
46
  });
51
- const useGomtmBackend = () => {
52
- const [gomtmBaseUrl, setgomtmBaseUrl] = useAtom(gomtmBaseUrlAtom);
53
- return {
54
- gomtmBaseUrl
55
- };
56
- };
57
47
  const AppContext = createContext(void 0);
58
48
  function GomtmProvider(props) {
59
49
  const { children } = props;
@@ -99,7 +89,6 @@ export {
99
89
  isDebugValueAtom,
100
90
  mtmAppStore,
101
91
  transportAtom,
102
- useGomtmBackend,
103
92
  useHostname,
104
93
  useMtmApp,
105
94
  useMtmBackendUrl