@iotexproject/kit 0.1.30 → 0.1.31

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/dist/index.d.ts CHANGED
@@ -8927,11 +8927,12 @@ declare class Analysis extends BaseDBModule {
8927
8927
  msg: any;
8928
8928
  referral_code?: undefined;
8929
8929
  }>;
8930
- create_refer({ refer_id, user_id, device_id, data, }: {
8930
+ create_refer({ refer_id, refer_id_type, user_id, device_id, data, }: {
8931
8931
  refer_id: string;
8932
+ refer_id_type: "referral_code" | "user_id";
8932
8933
  user_id: string;
8933
8934
  device_id: string;
8934
- data?: Record<string, any>;
8935
+ data: Record<string, any>;
8935
8936
  }, ctx?: {
8936
8937
  authData?: {
8937
8938
  app_id: string;
@@ -8949,6 +8950,22 @@ declare class Analysis extends BaseDBModule {
8949
8950
  api_key: string;
8950
8951
  };
8951
8952
  }): Promise<Record<string, any>>;
8953
+ fetch_user_point({ user_id, }: {
8954
+ user_id: string;
8955
+ }, ctx?: {
8956
+ authData?: {
8957
+ app_id: string;
8958
+ api_key: string;
8959
+ };
8960
+ }): Promise<{
8961
+ ok: boolean;
8962
+ point: number;
8963
+ msg?: undefined;
8964
+ } | {
8965
+ ok: boolean;
8966
+ msg: any;
8967
+ point?: undefined;
8968
+ }>;
8952
8969
  }
8953
8970
  declare class Analyzer extends BaseDBModule {
8954
8971
  tvl(): Promise<any>;
@@ -10198,8 +10215,6 @@ declare class Point {
10198
10215
  }>;
10199
10216
  upload_event({ action_id, }: {
10200
10217
  action_id: number;
10201
- device_id?: string;
10202
- refer_id?: string;
10203
10218
  }, ctx?: {
10204
10219
  authData?: {
10205
10220
  sub: string;
@@ -10235,6 +10250,11 @@ declare class Point {
10235
10250
  sub: string;
10236
10251
  };
10237
10252
  }): Promise<any>;
10253
+ my_point(args?: any, ctx?: {
10254
+ authData?: {
10255
+ sub: string;
10256
+ };
10257
+ }): Promise<any>;
10238
10258
  }
10239
10259
  declare const modules$4: {
10240
10260
  point: Point;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var L=({url:A="http://localhost:9527",ctx:B}={})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{for(let E in T){if(typeof T[E]==="object")T[E]=JSON.stringify(T[E],(J,H)=>typeof H==="bigint"?H.toString():H);if(T[E]==null)delete T[E]}const w=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;let b;if(B)b=await fetch(w,{headers:{...B}});else b=await fetch(w);return b.json()}}})}}),K=async({args:A={},prop:B,method:G,url:C,fetchRequestInit:j})=>{if(!j?.method||j?.method==="GET"){for(let T in A){if(typeof A[T]==="object")A[T]=JSON.stringify(A[T],(w,b)=>typeof b==="bigint"?b.toString():b);if(A[T]==null)delete A[T]}const z=`${C}/${String(B)}/${String(G)}?${new URLSearchParams(A).toString()}`;return(await fetch(z,{...j})).json()}if(j?.method==="POST"){const z=`${C}/${String(B)}/${String(G)}`;return(await fetch(z,{...j,body:JSON.stringify(A)})).json()}},N=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{return K({args:T,prop:C,method:D,url:A,fetchRequestInit:B})}}})}}),Q=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{return K({args:T,prop:C,method:D,url:A,fetchRequestInit:B})}}})}}),S=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{const w=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;return(await fetch(w,{method:"GET",...B})).json()}}})}}),U=({url:A="http://localhost:9527",ctx:B}={})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{let w=!1;for(let H in T){if(typeof T[H]==="object")w=!0;if(T[H]==null)delete T[H]}let b,E,J={};if(w)b=`${A}/${String(C)}/${String(D)}`;else b=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;if(B)J.headers={...B};if(w)J.method="POST",J.body=JSON.stringify(T);return E=await fetch(b,J),E.json()}}})}});export{S as createIotexscanClient,U as createIoidClient,Q as createClientWithIoPayServer,N as createClientWithDBServer,L as createClient};
1
+ var U=({url:j="http://localhost:9527",ctx:z}={})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{for(let K in b){if(typeof b[K]==="object")b[K]=JSON.stringify(b[K],(Q,N)=>typeof N==="bigint"?N.toString():N);if(b[K]==null)delete b[K]}const H=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;let D;if(z)D=await fetch(H,{headers:{...z}});else D=await fetch(H);return D.json()}}})}}),S=async({args:j={},prop:z,method:L,url:B,fetchRequestInit:G})=>{if(!G?.method||G?.method==="GET"){for(let b in j){if(typeof j[b]==="object")j[b]=JSON.stringify(j[b],(H,D)=>typeof D==="bigint"?D.toString():D);if(j[b]==null)delete j[b]}const J=`${B}/${String(z)}/${String(L)}?${new URLSearchParams(j).toString()}`;return(await fetch(J,{...G})).json()}if(G?.method==="POST"){const J=`${B}/${String(z)}/${String(L)}`;return(await fetch(J,{...G,body:JSON.stringify(j)})).json()}},V=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{return S({args:b,prop:B,method:C,url:j,fetchRequestInit:z})}}})}}),W=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{return S({args:b,prop:B,method:C,url:j,fetchRequestInit:z})}}})}}),X=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{const H=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;return(await fetch(H,{method:"GET",...z})).json()}}})}}),Y=({url:j="http://localhost:9527",ctx:z}={})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{let H=!1;for(let N in b){if(typeof b[N]==="object")H=!0;if(b[N]==null)delete b[N]}let D,K,Q={};if(H)D=`${j}/${String(B)}/${String(C)}`;else D=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;if(z)Q.headers={...z};if(H)Q.method="POST",Q.body=JSON.stringify(b);return K=await fetch(D,Q),K.json()}}})}});export{X as createIotexscanClient,Y as createIoidClient,W as createClientWithIoPayServer,V as createClientWithDBServer,U as createClient};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iotexproject/kit",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "v0.1.30",
5
+ "version": "v0.1.31",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {