50p82u21t54k 0.0.4 → 0.0.5

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,32 +1,43 @@
1
- let n = "";
2
- function o(t) {
1
+ let u = "", n = !1;
2
+ function r(t) {
3
+ u = t;
4
+ }
5
+ function c() {
6
+ return `${u}/api`;
7
+ }
8
+ function l(t) {
3
9
  n = t;
4
10
  }
5
- function r() {
6
- return `${n}/api`;
11
+ function i() {
12
+ return n;
7
13
  }
8
- const u = {
9
- install(t, a) {
10
- o(a.baseURL);
14
+ const g = {
15
+ install(t, s) {
16
+ r(s.baseURL), l(s.status);
11
17
  }
12
18
  };
13
- async function c() {
19
+ async function f() {
20
+ const t = {
21
+ status: !1,
22
+ message: "",
23
+ data: []
24
+ };
14
25
  try {
15
- const t = `${r()}/products`, a = await fetch(t, {
26
+ const s = `${c()}/products`, e = await fetch(s, {
16
27
  method: "GET"
17
- }), e = await a.text(), s = {
18
- status: a.status,
19
- data: ""
20
- };
21
- return s.status != 200 ? (console.log("!200"), s.data = e, s) : (a.ok && (console.log(JSON.parse(e)), s.data = e), s);
22
- } catch (t) {
23
- return {
24
- status: -1,
25
- data: `${t}`
26
- };
28
+ }), a = await e.text();
29
+ if (i() && (console.log(e.status), console.log(a)), t.status = e.status == 200, !t.status)
30
+ return t.message = a, t;
31
+ if (t.status && e.ok) {
32
+ const o = JSON.parse(a);
33
+ return t.data = o.results.data, t;
34
+ }
35
+ return t;
36
+ } catch (s) {
37
+ return t.status = !1, t.message = `${s}`, t;
27
38
  }
28
39
  }
29
40
  export {
30
- c as getProducts,
31
- u as libraryPlugin
41
+ f as getProducts,
42
+ g as libraryPlugin
32
43
  };
@@ -1 +1 @@
1
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["50p82u21t54k"]={}))})(this,function(t){"use strict";let e="";function a(n){e=n}function i(){return`${e}/api`}const r={install(n,o){a(o.baseURL)}};async function c(){try{const n=`${i()}/products`,o=await fetch(n,{method:"GET"}),u=await o.text(),s={status:o.status,data:""};return s.status!=200?(console.log("!200"),s.data=u,s):(o.ok&&(console.log(JSON.parse(u)),s.data=u),s)}catch(n){return{status:-1,data:`${n}`}}}t.getProducts=c,t.libraryPlugin=r,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(e,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e["50p82u21t54k"]={}))})(this,function(e){"use strict";let s="",a=!1;function i(t){s=t}function r(){return`${s}/api`}function c(t){a=t}function f(){return a}const d={install(t,n){i(n.baseURL),c(n.status)}};async function l(){const t={status:!1,message:"",data:[]};try{const n=`${r()}/products`,u=await fetch(n,{method:"GET"}),o=await u.text();if(f()&&(console.log(u.status),console.log(o)),t.status=u.status==200,!t.status)return t.message=o,t;if(t.status&&u.ok){const g=JSON.parse(o);return t.data=g.results.data,t}return t}catch(n){return t.status=!1,t.message=`${n}`,t}}e.getProducts=l,e.libraryPlugin=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
package/dist/plugin.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { App } from 'vue';
2
2
 
3
3
  export declare function getBaseURL(): string;
4
+ export declare function getDebugMode(): boolean;
4
5
  declare const _default: {
5
6
  install(_: App, options: {
6
7
  baseURL: string;
8
+ status: boolean;
7
9
  }): void;
8
10
  };
9
11
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAQzB,wBAAgB,UAAU,IAAI,MAAM,CAEnC;;eAGY,GAAG,WAAW;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;;AAD9C,wBAIC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AASzB,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAMD,wBAAgB,YAAY,IAAI,OAAO,CAEtC;;eAGY,GAAG,WAAW;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE;;AAD/D,wBAKC"}
@@ -1,4 +1,4 @@
1
- import { ReturnData } from '../util/type';
1
+ import { ProductsResponse } from './model';
2
2
 
3
- export declare function getProducts(): Promise<ReturnData>;
3
+ export declare function getProducts(): Promise<ProductsResponse>;
4
4
  //# sourceMappingURL=method.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/products/method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,wBAAsB,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC,CA0CvD"}
1
+ {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/products/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1C,wBAAsB,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAwC7D"}
@@ -1,7 +1,24 @@
1
- export type ProductsResponse = {
2
- id: string;
1
+ import { BaseType } from '../util/type';
2
+
3
+ export type ProductsResponse = BaseType & {
4
+ data: Product[];
5
+ };
6
+ export type Product = {
7
+ code: string;
8
+ id: number;
9
+ name: string;
10
+ platformProduct: [];
11
+ seq: number;
12
+ };
13
+ export type PlatformProduct = {
14
+ categoryid: number;
15
+ com: string;
16
+ flag: number;
17
+ id: number;
18
+ id_PlatformMaster: number;
19
+ id_ProductMaster: number;
20
+ img: string;
3
21
  name: string;
4
- email: string;
5
- createdAt: string;
22
+ url: string;
6
23
  };
7
24
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/products/model.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/products/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,IAAI,EAAE,OAAO,EAAE,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,EAAE,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA"}
@@ -1,5 +1,5 @@
1
- export type ReturnData = {
2
- status: number;
3
- data: string;
1
+ export type BaseType = {
2
+ status: boolean;
3
+ message: string;
4
4
  };
5
5
  //# sourceMappingURL=type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/util/type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/util/type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "50p82u21t54k",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "A description of your library",
5
5
  "main": "dist/50p82u21t54k.umd.js",
6
6
  "module": "dist/50p82u21t54k.es.js",