gomtm 0.0.264 → 0.0.266

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.
@@ -1,10 +1,10 @@
1
1
  import type { Message, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
2
2
  import type { CallOptions, ConnectError, Transport } from "@connectrpc/connect";
3
3
  import type { GetNextPageParamFunction, InfiniteData, QueryFunction, UseInfiniteQueryOptions, UseSuspenseInfiniteQueryOptions } from "@tanstack/react-query";
4
+ import { MtmError } from "../gomtmpb/mtm/sppb/mtm_pb";
4
5
  import { type ConnectInfiniteQueryKey } from "./connect-query-key";
5
6
  import type { MethodUnaryDescriptor } from "./method-unary-descriptor";
6
7
  import { type DisableQuery } from "./utils";
7
- import { MtmError } from "../gomtmpb/mtm/sppb/mtm_pb";
8
8
  export interface ConnectInfiniteQueryOptions<I extends Message<I>, O extends Message<O>, ParamKey extends keyof PartialMessage<I>> {
9
9
  pageParamKey: ParamKey;
10
10
  transport: Transport;
@@ -71,6 +71,7 @@ function createUseInfiniteQueryOptions(methodSig, input, {
71
71
  }) {
72
72
  const queryKey = createConnectInfiniteQueryKey(
73
73
  methodSig,
74
+ // input,
74
75
  input === disableQuery ? void 0 : __spreadProps(__spreadValues({}, input), {
75
76
  [pageParamKey]: void 0
76
77
  })
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -15,6 +17,7 @@ var __spreadValues = (a, b) => {
15
17
  }
16
18
  return a;
17
19
  };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
18
21
  var __async = (__this, __arguments, generator) => {
19
22
  return new Promise((resolve, reject) => {
20
23
  var fulfilled = (value) => {
@@ -85,13 +88,16 @@ const useListView = () => {
85
88
  function CommonListView() {
86
89
  const a = useListView();
87
90
  const listQuery = useSuspenseInfiniteQuery(a.methodList, {
88
- page: 1
91
+ pagination: {
92
+ page: 1
93
+ }
89
94
  }, {
90
95
  pageParamKey: "pagination",
91
- getNextPageParam: (res, b, c) => {
92
- return {
93
- page: ((c == null ? void 0 : c.page) || 0) + 1
94
- };
96
+ getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => {
97
+ var _a;
98
+ const a2 = __spreadProps(__spreadValues({}, lastPageParam), { page: (((_a = lastPage.Pagination) == null ? void 0 : _a.page) || 1) + 1 });
99
+ console.log("getNextPageParam", a2);
100
+ return a2;
95
101
  }
96
102
  });
97
103
  if (!(listQuery == null ? void 0 : listQuery.data)) {
@@ -25,7 +25,11 @@ const LzFrontLayout = lazy(() => import("./front-layout"));
25
25
  const LayoutBase = (props) => {
26
26
  const { layoutName, children } = props;
27
27
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 0, children: [
28
- layoutName == "front" ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Fragment, { children: "loading" }), children: /* @__PURE__ */ jsx(LzFrontLayout, { children }) }) : (
28
+ layoutName == "front" ? /* @__PURE__ */ jsxs(LzFrontLayout, { children: [
29
+ " ",
30
+ children,
31
+ " "
32
+ ] }) : (
29
33
  // layoutName == "front" ? <FrontLayout>{children}</FrontLayout> :
30
34
  layoutName == "dash5" ? /* @__PURE__ */ jsx(LzDash5, { children }) : layoutName == "debug" ? /* @__PURE__ */ jsx(LzDebugLayout, { children }) : layoutName == "demo1" ? /* @__PURE__ */ jsx(LzDemoLayout, { children }) : layoutName == "default" ? /* @__PURE__ */ jsx(Fragment, { children }) : children
31
35
  ),
@@ -2,6 +2,7 @@ import { ServiceType } from "@bufbuild/protobuf";
2
2
  export declare const ssrGetBackendUrl: () => string;
3
3
  export declare const gomtmApiUrl: () => string;
4
4
  export declare function createMtmServiceClient<T extends ServiceType>(service: T, url?: string): import("@connectrpc/connect").PromiseClient<T>;
5
+ export declare function createTransport(): import("@connectrpc/connect").Transport;
5
6
  export declare function createMtmServiceClientByName<T extends ServiceType>(svcName: string, url?: string): import("@connectrpc/connect").PromiseClient<ServiceType>;
6
7
  type CustomRequestInit = RequestInit & {
7
8
  cookieStr?: string;
@@ -67,6 +67,12 @@ function createMtmServiceClient(service, url) {
67
67
  })
68
68
  );
69
69
  }
70
+ function createTransport() {
71
+ return createConnectTransport({
72
+ baseUrl: gomtmApiUrl(),
73
+ fetch: gomtmFetcher()
74
+ });
75
+ }
70
76
  function createMtmServiceClientByName(svcName, url) {
71
77
  let svcType = void 0;
72
78
  for (const a of allServices) {
@@ -139,6 +145,7 @@ const gomtmFetcher = (initGlobal) => {
139
145
  export {
140
146
  createMtmServiceClient,
141
147
  createMtmServiceClientByName,
148
+ createTransport,
142
149
  gomtmApiUrl,
143
150
  gomtmFetcher,
144
151
  ssrGetBackendUrl