simpleloan_api 1.0.1 → 1.0.4

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.
@@ -0,0 +1,11 @@
1
+ import * as vue from 'vue';
2
+
3
+ type Mode = "development" | "production";
4
+ declare const mode: vue.Ref<Mode>;
5
+ declare function setMode(newMode: Mode): void;
6
+ declare function getMode(): Mode;
7
+ declare function setToken(newToken: string): void;
8
+ declare function removeToken(): void;
9
+ declare function getToken(): string | null;
10
+
11
+ export { getMode, getToken, mode, removeToken, setMode, setToken };
@@ -0,0 +1,11 @@
1
+ import * as vue from 'vue';
2
+
3
+ type Mode = "development" | "production";
4
+ declare const mode: vue.Ref<Mode>;
5
+ declare function setMode(newMode: Mode): void;
6
+ declare function getMode(): Mode;
7
+ declare function setToken(newToken: string): void;
8
+ declare function removeToken(): void;
9
+ declare function getToken(): string | null;
10
+
11
+ export { getMode, getToken, mode, removeToken, setMode, setToken };
package/dist/index.js CHANGED
@@ -1,20 +1,59 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
15
9
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./fetch"), exports);
18
- __exportStar(require("./repositories"), exports);
19
- __exportStar(require("./settings"), exports);
20
- //# sourceMappingURL=index.js.map
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var simpleloan_api_exports = {};
22
+ __export(simpleloan_api_exports, {
23
+ getMode: () => getMode,
24
+ getToken: () => getToken,
25
+ mode: () => mode,
26
+ removeToken: () => removeToken,
27
+ setMode: () => setMode,
28
+ setToken: () => setToken
29
+ });
30
+ module.exports = __toCommonJS(simpleloan_api_exports);
31
+
32
+ // src/settings/index.ts
33
+ var import_vue = require("vue");
34
+ var token = null;
35
+ var mode = (0, import_vue.ref)("development");
36
+ function setMode(newMode) {
37
+ mode.value = newMode;
38
+ }
39
+ function getMode() {
40
+ return mode.value;
41
+ }
42
+ function setToken(newToken) {
43
+ token = newToken;
44
+ }
45
+ function removeToken() {
46
+ token = null;
47
+ }
48
+ function getToken() {
49
+ return token;
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ getMode,
54
+ getToken,
55
+ mode,
56
+ removeToken,
57
+ setMode,
58
+ setToken
59
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,27 @@
1
+ // src/settings/index.ts
2
+ import { ref } from "vue";
3
+ var token = null;
4
+ var mode = ref("development");
5
+ function setMode(newMode) {
6
+ mode.value = newMode;
7
+ }
8
+ function getMode() {
9
+ return mode.value;
10
+ }
11
+ function setToken(newToken) {
12
+ token = newToken;
13
+ }
14
+ function removeToken() {
15
+ token = null;
16
+ }
17
+ function getToken() {
18
+ return token;
19
+ }
20
+ export {
21
+ getMode,
22
+ getToken,
23
+ mode,
24
+ removeToken,
25
+ setMode,
26
+ setToken
27
+ };
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "simpleloan_api",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
+ "module": "dist/index.mjs",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
5
10
  "scripts": {
6
- "build": "tsc",
11
+ "build": "tsup index.ts --format cjs,esm --dts",
12
+ "lint": "tsc",
7
13
  "test": "echo \"Error: no test specified\" && exit 1"
8
14
  },
9
15
  "keywords": [
@@ -13,7 +19,9 @@
13
19
  "license": "ISC",
14
20
  "description": "simpleloan api methods with types",
15
21
  "dependencies": {
22
+ "@types/node": "^22.1.0",
23
+ "tsup": "^8.2.4",
16
24
  "typescript": "^5.5.4",
17
25
  "vue": "^3.2.13"
18
26
  }
19
- }
27
+ }
@@ -1,120 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.useFetch = useFetch;
40
- var vue_1 = require("vue");
41
- var settings_1 = require("../settings");
42
- function getContent(response) {
43
- return __awaiter(this, void 0, void 0, function () {
44
- var contentType;
45
- return __generator(this, function (_a) {
46
- contentType = response.headers.get("Content-Type");
47
- if (!contentType)
48
- return [2 /*return*/, null];
49
- if (contentType.includes("application/json")) {
50
- return [2 /*return*/, response.json()];
51
- }
52
- if (contentType.includes("text")) {
53
- return [2 /*return*/, response.text()];
54
- }
55
- if (contentType.includes("application/octet-stream") ||
56
- contentType.includes("blob")) {
57
- return [2 /*return*/, response.blob()];
58
- }
59
- return [2 /*return*/];
60
- });
61
- });
62
- }
63
- function getHeaders() {
64
- return {
65
- Accept: "application/json, text/plain, */*",
66
- "Content-Type": "application/json; text/html; image/png",
67
- };
68
- }
69
- function getApiUrl() {
70
- return settings_1.mode.value === "production"
71
- ? "portal.simpleloan.ru/api/"
72
- : "slb.medv.ru/api/";
73
- }
74
- function getBody(params) {
75
- return JSON.stringify({
76
- _data: params.body || undefined,
77
- _searchParams: params.search || undefined,
78
- _token: (0, settings_1.getToken)(),
79
- });
80
- }
81
- function useFetch(url) {
82
- var response = (0, vue_1.ref)(null);
83
- var pending = (0, vue_1.ref)(false);
84
- var fullUrl = getApiUrl() + url;
85
- function post(params) {
86
- return __awaiter(this, void 0, void 0, function () {
87
- var body, search, fetchResponse, content, error_1;
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0:
91
- pending.value = true;
92
- body = params === null || params === void 0 ? void 0 : params.body;
93
- search = params === null || params === void 0 ? void 0 : params.search;
94
- _a.label = 1;
95
- case 1:
96
- _a.trys.push([1, 4, , 5]);
97
- return [4 /*yield*/, fetch(fullUrl, {
98
- method: "POST",
99
- body: getBody({ body: body, search: search }),
100
- headers: getHeaders(),
101
- })];
102
- case 2:
103
- fetchResponse = _a.sent();
104
- return [4 /*yield*/, getContent(fetchResponse)];
105
- case 3:
106
- content = _a.sent();
107
- response.value = content;
108
- return [3 /*break*/, 5];
109
- case 4:
110
- error_1 = _a.sent();
111
- response.value = null;
112
- return [3 /*break*/, 5];
113
- case 5: return [2 /*return*/, response.value];
114
- }
115
- });
116
- });
117
- }
118
- return { post: post, response: response, pending: pending };
119
- }
120
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fetch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,4BA8BC;AAnFD,2BAA+B;AAE/B,wCAA6C;AAE7C,SAAe,UAAU,CAAC,QAAkB;;;;YACpC,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YACzD,IAAI,CAAC,WAAW;gBAAE,sBAAO,IAAI,EAAC;YAE9B,IAAI,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBAC7C,sBAAO,QAAQ,CAAC,IAAI,EAAE,EAAC;YACzB,CAAC;YAED,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjC,sBAAO,QAAQ,CAAC,IAAI,EAAE,EAAC;YACzB,CAAC;YAED,IACE,WAAW,CAAC,QAAQ,CAAC,0BAA0B,CAAC;gBAChD,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5B,CAAC;gBACD,sBAAO,QAAQ,CAAC,IAAI,EAAE,EAAC;YACzB,CAAC;;;;CACF;AAED,SAAS,UAAU;IACjB,OAAO;QACL,MAAM,EAAE,mCAAmC;QAC3C,cAAc,EAAE,wCAAwC;KACzD,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,eAAI,CAAC,KAAK,KAAK,YAAY;QAChC,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,kBAAkB,CAAC;AACzB,CAAC;AAED,SAAS,OAAO,CAAC,MAA6C;IAC5D,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS;QAC/B,aAAa,EAAE,MAAM,CAAC,MAAM,IAAI,SAAS;QACzC,MAAM,EAAE,IAAA,mBAAQ,GAAE;KACnB,CAAC,CAAC;AACL,CAAC;AAUD,SAAgB,QAAQ,CAAU,GAAW;IAC3C,IAAM,QAAQ,GAAG,IAAA,SAAG,EAClB,IAAI,CACyB,CAAC;IAChC,IAAM,OAAO,GAAG,IAAA,SAAG,EAAU,KAAK,CAAC,CAAC;IACpC,IAAM,OAAO,GAAG,SAAS,EAAE,GAAG,GAAG,CAAC;IAElC,SAAe,IAAI,CAAC,MAAyB;;;;;;wBAC3C,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;wBAEf,IAAI,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC;wBACpB,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC;;;;wBAGN,qBAAM,KAAK,CAAC,OAAO,EAAE;gCACzC,MAAM,EAAE,MAAM;gCACd,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC;gCAC/B,OAAO,EAAE,UAAU,EAAE;6BACtB,CAAC,EAAA;;wBAJI,aAAa,GAAG,SAIpB;wBAEc,qBAAM,UAAU,CAAC,aAAa,CAAC,EAAA;;wBAAzC,OAAO,GAAG,SAA+B;wBAC/C,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC;;;;wBAEzB,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;;4BAGxB,sBAAO,QAAQ,CAAC,KAAK,EAAC;;;;KACvB;IAED,OAAO,EAAE,IAAI,MAAA,EAAE,QAAQ,UAAA,EAAE,OAAO,SAAA,EAAE,CAAC;AACrC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fetch/types/index.ts"],"names":[],"mappings":""}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,iDAA8B;AAC9B,6CAA0B"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGetGeneral = void 0;
4
- var fetch_1 = require("../../fetch");
5
- var useGetGeneral = function () {
6
- return (0, fetch_1.useFetch)("general/get/");
7
- };
8
- exports.useGetGeneral = useGetGeneral;
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/repositories/general/index.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAGhC,IAAM,aAAa,GAAG;IAC3B,OAAA,IAAA,gBAAQ,EAA0B,cAAc,CAAC;AAAjD,CAAiD,CAAC;AADvC,QAAA,aAAa,iBAC0B"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/repositories/general/types/index.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./general"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mode = void 0;
4
- exports.setMode = setMode;
5
- exports.getMode = getMode;
6
- exports.setToken = setToken;
7
- exports.removeToken = removeToken;
8
- exports.getToken = getToken;
9
- var vue_1 = require("vue");
10
- var token = null;
11
- exports.mode = (0, vue_1.ref)("development");
12
- function setMode(newMode) {
13
- exports.mode.value = newMode;
14
- }
15
- function getMode() {
16
- return exports.mode.value;
17
- }
18
- function setToken(newToken) {
19
- token = newToken;
20
- }
21
- function removeToken() {
22
- token = null;
23
- }
24
- function getToken() {
25
- return token;
26
- }
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/settings/index.ts"],"names":[],"mappings":";;;AASA,0BAEC;AAGD,0BAEC;AAGD,4BAEC;AAGD,kCAEC;AAGD,4BAEC;AA/BD,2BAA0B;AAI1B,IAAI,KAAK,GAAkB,IAAI,CAAC;AAEnB,QAAA,IAAI,GAAG,IAAA,SAAG,EAAO,aAAa,CAAC,CAAC;AAG7C,SAAgB,OAAO,CAAC,OAAa;IACnC,YAAI,CAAC,KAAK,GAAG,OAAO,CAAC;AACvB,CAAC;AAGD,SAAgB,OAAO;IACrB,OAAO,YAAI,CAAC,KAAK,CAAA;AACnB,CAAC;AAGD,SAAgB,QAAQ,CAAC,QAAgB;IACvC,KAAK,GAAG,QAAQ,CAAC;AACnB,CAAC;AAGD,SAAgB,WAAW;IACzB,KAAK,GAAG,IAAI,CAAC;AACf,CAAC;AAGD,SAAgB,QAAQ;IACtB,OAAO,KAAK,CAAC;AACf,CAAC"}
package/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './src'
@@ -1,84 +0,0 @@
1
- import { Ref, ref } from "vue";
2
- import { ApiResponse, PostParams, SearchParams } from "./types";
3
- import { getToken, mode } from "../settings";
4
-
5
- async function getContent(response: Response) {
6
- const contentType = response.headers.get("Content-Type");
7
- if (!contentType) return null;
8
-
9
- if (contentType.includes("application/json")) {
10
- return response.json();
11
- }
12
-
13
- if (contentType.includes("text")) {
14
- return response.text();
15
- }
16
-
17
- if (
18
- contentType.includes("application/octet-stream") ||
19
- contentType.includes("blob")
20
- ) {
21
- return response.blob();
22
- }
23
- }
24
-
25
- function getHeaders() {
26
- return {
27
- Accept: "application/json, text/plain, */*",
28
- "Content-Type": "application/json; text/html; image/png",
29
- };
30
- }
31
-
32
- function getApiUrl() {
33
- return mode.value === "production"
34
- ? "portal.simpleloan.ru/api/"
35
- : "slb.medv.ru/api/";
36
- }
37
-
38
- function getBody(params: { body?: any; search?: SearchParams }) {
39
- return JSON.stringify({
40
- _data: params.body || undefined,
41
- _searchParams: params.search || undefined,
42
- _token: getToken(),
43
- });
44
- }
45
-
46
- type FetchReturn<T, Body> = {
47
- response: Ref<ApiResponse<T> | null>;
48
- pending: Ref<boolean>;
49
- post(params: PostParams<Body>): Promise<ApiResponse<T> | null>;
50
- };
51
-
52
- export function useFetch<T, Body>(url: string): FetchReturn<T, Body>;
53
-
54
- export function useFetch<T, Body>(url: string) {
55
- const response = ref<ApiResponse<T> | null>(
56
- null
57
- ) as Ref<ApiResponse<T> | null>;
58
- const pending = ref<boolean>(false);
59
- const fullUrl = getApiUrl() + url;
60
-
61
- async function post(params?: PostParams<Body>) {
62
- pending.value = true;
63
-
64
- const body = params?.body;
65
- const search = params?.search;
66
-
67
- try {
68
- const fetchResponse = await fetch(fullUrl, {
69
- method: "POST",
70
- body: getBody({ body, search }),
71
- headers: getHeaders(),
72
- });
73
-
74
- const content = await getContent(fetchResponse);
75
- response.value = content;
76
- } catch (error) {
77
- response.value = null;
78
- }
79
-
80
- return response.value;
81
- }
82
-
83
- return { post, response, pending };
84
- }
@@ -1,20 +0,0 @@
1
- export type ApiResponse<T> = {
2
- _code: number;
3
- _message?: string;
4
- _detail?: { [param: string]: string[] };
5
- _data_total_size?: number;
6
- _data?: T;
7
- };
8
-
9
- export type SearchParams = {
10
- _filter?: Record<string, any>;
11
- _page_size?: number;
12
- _fields?: string[];
13
- _start_index?: number;
14
- _sort?: string[];
15
- };
16
-
17
- export type PostParams<Body> = {
18
- body: Body;
19
- search?: SearchParams;
20
- };
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './fetch'
2
- export * from './repositories'
3
- export * from './settings'
@@ -1,7 +0,0 @@
1
- import { useFetch } from "../../fetch";
2
- import { General } from "./types";
3
-
4
- export const useGetGeneral = () =>
5
- useFetch<General, { id: number }>("general/get/");
6
-
7
-
@@ -1,5 +0,0 @@
1
- export type General = {
2
- id: number;
3
- user_id: number;
4
- salespoint_id: number;
5
- }
@@ -1 +0,0 @@
1
- export * from './general'
@@ -1,32 +0,0 @@
1
- import { ref } from "vue";
2
-
3
- type Mode = "development" | "production";
4
-
5
- let token: string | null = null;
6
-
7
- export const mode = ref<Mode>("development");
8
-
9
-
10
- export function setMode(newMode: Mode) {
11
- mode.value = newMode;
12
- }
13
-
14
-
15
- export function getMode() {
16
- return mode.value
17
- }
18
-
19
-
20
- export function setToken(newToken: string) {
21
- token = newToken;
22
- }
23
-
24
-
25
- export function removeToken() {
26
- token = null;
27
- }
28
-
29
-
30
- export function getToken() {
31
- return token;
32
- }
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "dist",
4
- "lib": [
5
- "es2016",
6
- "dom",
7
- ],
8
- "sourceMap": true
9
- },
10
- "include": [
11
- "src/**/*.ts"
12
- ]
13
- }