gomtm 0.0.183 → 0.0.184

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,34 +1,22 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useAtom } from "jotai";
4
- import { ScopeProvider } from "mtxlib/jotai/ScopeProvider";
5
- import { AtomsHydrator } from "mtxlib/jotai/jotai-helper";
4
+ import { ScopeAtomsHydrator } from "mtxlib/jotai/jotai-helper";
6
5
  import { usePathname } from "next/navigation";
7
- import { useMemo } from "react";
8
6
  import { MtUnaryCallErrorView } from "../components/MtUnaryCallErrorView";
9
7
  import { curd3ItemsAtom, curd3ListParamsAtom, curdMethodListAtom, curdSvcAtom } from "./curd.atoms";
10
8
  import { ListItemView } from "./list-item/ListItem";
11
9
  function Curd3ListProviderV2(props) {
12
10
  const { params, children } = props;
13
11
  const pathName = usePathname();
14
- const svcName = useMemo(() => {
15
- if (pathName.startsWith("/gomtmadmin/post")) {
16
- return "sppb.MtmService";
17
- }
18
- }, [pathName]);
19
- const listMethod = useMemo(() => {
20
- if (pathName == null ? void 0 : pathName.startsWith("/gomtmadmin/post")) {
21
- return "blogPostList";
22
- }
23
- }, [pathName]);
24
- return /* @__PURE__ */ jsx(ScopeProvider, { atoms: [curd3ListParamsAtom, curdMethodListAtom, curdSvcAtom], children: /* @__PURE__ */ jsxs(AtomsHydrator, { atomValues: [
25
- [curd3ListParamsAtom, params],
26
- [curdMethodListAtom, listMethod],
27
- [curdSvcAtom, svcName]
12
+ return /* @__PURE__ */ jsxs(ScopeAtomsHydrator, { atomValues: [
13
+ [curd3ListParamsAtom, params]
14
+ // [curdMethodListAtom, listMethod],
15
+ // [curdSvcAtom, svcName]
28
16
  ], children: [
29
17
  /* @__PURE__ */ jsx(Curd3ListProviderV2Debug, {}),
30
18
  children
31
- ] }) });
19
+ ] });
32
20
  }
33
21
  const Curd2ListViewV2 = () => {
34
22
  const [res] = useAtom(curd3ItemsAtom);
@@ -49,7 +37,6 @@ const Curd3ListProviderV2Debug = () => {
49
37
  ] })
50
38
  ] });
51
39
  };
52
- const curdConfig = {};
53
40
  export {
54
41
  Curd2ListViewV2,
55
42
  Curd3ListProviderV2,
@@ -16,3 +16,7 @@ export declare const curd3ListParamsAtom: import("jotai").PrimitiveAtom<PlainMes
16
16
  init: PlainMessage<AnyMessage>;
17
17
  };
18
18
  export declare const curd3ItemsAtom: import("jotai").Atom<Promise<PlainMessage<MtmError> | CommontListRes>>;
19
+ export declare const curdPathAtom: import("jotai").PrimitiveAtom<string> & {
20
+ init: string;
21
+ };
22
+ export declare const curd3ItemsV2Atom: import("jotai").Atom<Promise<CommontListRes>>;
@@ -20,7 +20,8 @@ var __async = (__this, __arguments, generator) => {
20
20
  });
21
21
  };
22
22
  import { atom } from "jotai";
23
- import { createMtmServiceClientByName } from "../gomtm-clients-ss";
23
+ import { createMtmServiceClient, createMtmServiceClientByName } from "../gomtm-clients-ss";
24
+ import { MtmService } from "../gomtmpb/mtm/sppb/mtm_connect";
24
25
  const curdDashPathPrefixAtom = atom("/gomtmadmin");
25
26
  const curdActivateIdAtom = atom("");
26
27
  const curdSvcAtom = atom("sppb.MtmService");
@@ -44,11 +45,25 @@ const curd3ItemsAtom = atom((get) => __async(void 0, null, function* () {
44
45
  const data = yield methodFn(params);
45
46
  return data;
46
47
  }));
48
+ const curdPathAtom = atom("");
49
+ const curd3ItemsV2Atom = atom((get) => __async(void 0, null, function* () {
50
+ const client = yield createMtmServiceClient(MtmService);
51
+ const slugPath = get(curdPathAtom);
52
+ const data = yield client.curdList({
53
+ params: {
54
+ slugs: slugPath
55
+ }
56
+ });
57
+ console.log("list response data", data);
58
+ return data;
59
+ }));
47
60
  export {
48
61
  curd3ItemsAtom,
62
+ curd3ItemsV2Atom,
49
63
  curd3ListParamsAtom,
50
64
  curdActivateIdAtom,
51
65
  curdDashPathPrefixAtom,
52
66
  curdMethodListAtom,
67
+ curdPathAtom,
53
68
  curdSvcAtom
54
69
  };
@@ -1730,32 +1730,6 @@ export declare class FormCreateReq extends Message<FormCreateReq> {
1730
1730
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FormCreateReq;
1731
1731
  static equals(a: FormCreateReq | PlainMessage<FormCreateReq> | undefined, b: FormCreateReq | PlainMessage<FormCreateReq> | undefined): boolean;
1732
1732
  }
1733
- export declare class CurdListReq extends Message<CurdListReq> {
1734
- path: string;
1735
- type: string;
1736
- params: {
1737
- [key: string]: string;
1738
- };
1739
- constructor(data?: PartialMessage<CurdListReq>);
1740
- static readonly runtime: typeof proto3;
1741
- static readonly typeName = "sppb.CurdListReq";
1742
- static readonly fields: FieldList;
1743
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CurdListReq;
1744
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CurdListReq;
1745
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CurdListReq;
1746
- static equals(a: CurdListReq | PlainMessage<CurdListReq> | undefined, b: CurdListReq | PlainMessage<CurdListReq> | undefined): boolean;
1747
- }
1748
- export declare class CurdListRes extends Message<CurdListRes> {
1749
- items: ListItem[];
1750
- constructor(data?: PartialMessage<CurdListRes>);
1751
- static readonly runtime: typeof proto3;
1752
- static readonly typeName = "sppb.CurdListRes";
1753
- static readonly fields: FieldList;
1754
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CurdListRes;
1755
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CurdListRes;
1756
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CurdListRes;
1757
- static equals(a: CurdListRes | PlainMessage<CurdListRes> | undefined, b: CurdListRes | PlainMessage<CurdListRes> | undefined): boolean;
1758
- }
1759
1733
  export declare const slugs: import("@bufbuild/protobuf").Extension<FieldOptions, string>;
1760
1734
  export declare const is_title: import("@bufbuild/protobuf").Extension<FieldOptions, boolean>;
1761
1735
  export declare const is_sub_title: import("@bufbuild/protobuf").Extension<FieldOptions, boolean>;
@@ -6919,88 +6919,6 @@ __publicField(_FormCreateReq, "fields", proto3.util.newFieldList(() => [
6919
6919
  { no: 1, name: "input", kind: "message", T: FormSchema }
6920
6920
  ]));
6921
6921
  let FormCreateReq = _FormCreateReq;
6922
- const _CurdListReq = class _CurdListReq extends Message {
6923
- constructor(data) {
6924
- super();
6925
- /**
6926
- * @generated from field: string path = 1;
6927
- */
6928
- __publicField(this, "path", "");
6929
- /**
6930
- * @generated from field: string type = 2;
6931
- */
6932
- __publicField(this, "type", "");
6933
- /**
6934
- * @generated from field: map<string, string> params = 3;
6935
- */
6936
- __publicField(this, "params", {});
6937
- proto3.util.initPartial(data, this);
6938
- }
6939
- static fromBinary(bytes, options) {
6940
- return new _CurdListReq().fromBinary(bytes, options);
6941
- }
6942
- static fromJson(jsonValue, options) {
6943
- return new _CurdListReq().fromJson(jsonValue, options);
6944
- }
6945
- static fromJsonString(jsonString, options) {
6946
- return new _CurdListReq().fromJsonString(jsonString, options);
6947
- }
6948
- static equals(a, b) {
6949
- return proto3.util.equals(_CurdListReq, a, b);
6950
- }
6951
- };
6952
- __publicField(_CurdListReq, "runtime", proto3);
6953
- __publicField(_CurdListReq, "typeName", "sppb.CurdListReq");
6954
- __publicField(_CurdListReq, "fields", proto3.util.newFieldList(() => [
6955
- {
6956
- no: 1,
6957
- name: "path",
6958
- kind: "scalar",
6959
- T: 9
6960
- /* ScalarType.STRING */
6961
- },
6962
- {
6963
- no: 2,
6964
- name: "type",
6965
- kind: "scalar",
6966
- T: 9
6967
- /* ScalarType.STRING */
6968
- },
6969
- { no: 3, name: "params", kind: "map", K: 9, V: {
6970
- kind: "scalar",
6971
- T: 9
6972
- /* ScalarType.STRING */
6973
- } }
6974
- ]));
6975
- let CurdListReq = _CurdListReq;
6976
- const _CurdListRes = class _CurdListRes extends Message {
6977
- constructor(data) {
6978
- super();
6979
- /**
6980
- * @generated from field: repeated sppb.ListItem items = 1;
6981
- */
6982
- __publicField(this, "items", []);
6983
- proto3.util.initPartial(data, this);
6984
- }
6985
- static fromBinary(bytes, options) {
6986
- return new _CurdListRes().fromBinary(bytes, options);
6987
- }
6988
- static fromJson(jsonValue, options) {
6989
- return new _CurdListRes().fromJson(jsonValue, options);
6990
- }
6991
- static fromJsonString(jsonString, options) {
6992
- return new _CurdListRes().fromJsonString(jsonString, options);
6993
- }
6994
- static equals(a, b) {
6995
- return proto3.util.equals(_CurdListRes, a, b);
6996
- }
6997
- };
6998
- __publicField(_CurdListRes, "runtime", proto3);
6999
- __publicField(_CurdListRes, "typeName", "sppb.CurdListRes");
7000
- __publicField(_CurdListRes, "fields", proto3.util.newFieldList(() => [
7001
- { no: 1, name: "items", kind: "message", T: ListItem, repeated: true }
7002
- ]));
7003
- let CurdListRes = _CurdListRes;
7004
6922
  const slugs = proto3.makeExtension(
7005
6923
  "sppb.slugs",
7006
6924
  FieldOptions,
@@ -7082,8 +7000,6 @@ export {
7082
7000
  CommonListItem,
7083
7001
  CommontListReq,
7084
7002
  CommontListRes,
7085
- CurdListReq,
7086
- CurdListRes,
7087
7003
  CurdView,
7088
7004
  CurdViewCreateReq,
7089
7005
  CurdViewGetReq,