50p82u21t54k 0.0.3 → 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,19 +1,43 @@
1
- let e = "";
2
- function s(n) {
3
- e = n;
1
+ let u = "", n = !1;
2
+ function r(t) {
3
+ u = t;
4
4
  }
5
- function t() {
6
- return e;
5
+ function c() {
6
+ return `${u}/api`;
7
7
  }
8
- const a = {
9
- install(n, o) {
10
- s(o.baseURL);
8
+ function l(t) {
9
+ n = t;
10
+ }
11
+ function i() {
12
+ return n;
13
+ }
14
+ const g = {
15
+ install(t, s) {
16
+ r(s.baseURL), l(s.status);
11
17
  }
12
18
  };
13
- async function l() {
14
- return console.log("method", t()), t();
19
+ async function f() {
20
+ const t = {
21
+ status: !1,
22
+ message: "",
23
+ data: []
24
+ };
25
+ try {
26
+ const s = `${c()}/products`, e = await fetch(s, {
27
+ method: "GET"
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;
38
+ }
15
39
  }
16
40
  export {
17
- l as getProduct,
18
- a as libraryPlugin
41
+ f as getProducts,
42
+ g as libraryPlugin
19
43
  };
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["50p82u21t54k"]={}))})(this,function(e){"use strict";let t="";function i(o){t=o}function n(){return t}const u={install(o,f){i(f.baseURL)}};async function s(){return console.log("method",n()),n()}e.getProduct=s,e.libraryPlugin=u,Object.defineProperty(e,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,2 +1,4 @@
1
- export declare function getProduct(): Promise<string>;
1
+ import { ProductsResponse } from './model';
2
+
3
+ export declare function getProducts(): Promise<ProductsResponse>;
2
4
  //# sourceMappingURL=method.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/products/method.ts"],"names":[],"mappings":"AAEA,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAGlD"}
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"}
@@ -0,0 +1,5 @@
1
+ export type BaseType = {
2
+ status: boolean;
3
+ message: string;
4
+ };
5
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
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.3",
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",