ayiin 2.0.12 → 2.0.14
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/{ayiin/index.d.ts → index.d.ts} +0 -1
- package/{ayiin/index.js → index.js} +0 -2
- package/{ayiin/methods → methods}/response.d.ts +26 -6
- package/{ayiin/methods → methods}/response.js +6 -6
- package/package.json +3 -3
- package/tsconfig.json +0 -35
- /package/{ayiin/bin → bin}/cli.d.ts +0 -0
- /package/{ayiin/bin → bin}/cli.js +0 -0
- /package/{ayiin/methods → methods}/crypt.d.ts +0 -0
- /package/{ayiin/methods → methods}/crypt.js +0 -0
- /package/{ayiin/methods → methods}/index.d.ts +0 -0
- /package/{ayiin/methods → methods}/index.js +0 -0
- /package/{ayiin/methods → methods}/tools.d.ts +0 -0
- /package/{ayiin/methods → methods}/tools.js +0 -0
|
@@ -3,10 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const package_json_1 = __importDefault(require("../package.json"));
|
|
7
6
|
const methods_1 = __importDefault(require("./methods"));
|
|
8
7
|
class Ayiin extends methods_1.default {
|
|
9
|
-
version = package_json_1.default.version;
|
|
10
8
|
constructor() {
|
|
11
9
|
super();
|
|
12
10
|
}
|
|
@@ -1,35 +1,55 @@
|
|
|
1
1
|
declare class ResponseApi {
|
|
2
|
-
success: (caption
|
|
2
|
+
success: ({ caption, data, code, }: {
|
|
3
|
+
caption: string;
|
|
4
|
+
data: any;
|
|
5
|
+
code?: number;
|
|
6
|
+
}) => {
|
|
3
7
|
responseCode: number;
|
|
4
8
|
responseSuccess: boolean;
|
|
5
9
|
responseMessage: string;
|
|
6
10
|
responseData: any;
|
|
7
11
|
};
|
|
8
|
-
badRequest: (caption
|
|
12
|
+
badRequest: ({ caption, title, data, }: {
|
|
13
|
+
caption: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
data?: any;
|
|
16
|
+
}) => {
|
|
9
17
|
responseCode: number;
|
|
10
18
|
responseSuccess: boolean;
|
|
11
19
|
responseMessage: string;
|
|
12
20
|
responseData: any;
|
|
13
21
|
};
|
|
14
|
-
invalidFields: (caption
|
|
22
|
+
invalidFields: ({ caption, data }: {
|
|
23
|
+
caption: string;
|
|
24
|
+
data?: any;
|
|
25
|
+
}) => {
|
|
15
26
|
responseCode: number;
|
|
16
27
|
responseSuccess: boolean;
|
|
17
28
|
responseMessage: string;
|
|
18
29
|
responseData: any;
|
|
19
30
|
};
|
|
20
|
-
notFound: (caption
|
|
31
|
+
notFound: ({ caption, data }: {
|
|
32
|
+
caption: string;
|
|
33
|
+
data?: any;
|
|
34
|
+
}) => {
|
|
21
35
|
responseCode: number;
|
|
22
36
|
responseSuccess: boolean;
|
|
23
37
|
responseMessage: string;
|
|
24
38
|
responseData: any;
|
|
25
39
|
};
|
|
26
|
-
unauthorized: (caption
|
|
40
|
+
unauthorized: ({ caption, data }: {
|
|
41
|
+
caption: string;
|
|
42
|
+
data?: any;
|
|
43
|
+
}) => {
|
|
27
44
|
responseCode: number;
|
|
28
45
|
responseSuccess: boolean;
|
|
29
46
|
responseMessage: string;
|
|
30
47
|
responseData: any;
|
|
31
48
|
};
|
|
32
|
-
internalServer: (caption
|
|
49
|
+
internalServer: ({ caption, data }: {
|
|
50
|
+
caption: string;
|
|
51
|
+
data?: any;
|
|
52
|
+
}) => {
|
|
33
53
|
responseCode: number;
|
|
34
54
|
responseSuccess: boolean;
|
|
35
55
|
responseMessage: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class ResponseApi {
|
|
4
|
-
success = (caption, data, code) => {
|
|
4
|
+
success = ({ caption, data, code, }) => {
|
|
5
5
|
code = code ? Number(String(code) + "7400") : 2007400;
|
|
6
6
|
return {
|
|
7
7
|
responseCode: code,
|
|
@@ -10,7 +10,7 @@ class ResponseApi {
|
|
|
10
10
|
responseData: data,
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
badRequest = (caption, title, data) => {
|
|
13
|
+
badRequest = ({ caption, title, data, }) => {
|
|
14
14
|
return {
|
|
15
15
|
responseCode: 4007400,
|
|
16
16
|
responseSuccess: false,
|
|
@@ -18,7 +18,7 @@ class ResponseApi {
|
|
|
18
18
|
responseData: data,
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
invalidFields = (caption, data) => {
|
|
21
|
+
invalidFields = ({ caption, data }) => {
|
|
22
22
|
return {
|
|
23
23
|
responseCode: 4007401,
|
|
24
24
|
responseSuccess: false,
|
|
@@ -26,7 +26,7 @@ class ResponseApi {
|
|
|
26
26
|
responseData: data,
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
notFound = (caption, data) => {
|
|
29
|
+
notFound = ({ caption, data }) => {
|
|
30
30
|
return {
|
|
31
31
|
responseCode: 4047400,
|
|
32
32
|
responseSuccess: false,
|
|
@@ -34,7 +34,7 @@ class ResponseApi {
|
|
|
34
34
|
responseData: data,
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
unauthorized = (caption, data) => {
|
|
37
|
+
unauthorized = ({ caption, data }) => {
|
|
38
38
|
return {
|
|
39
39
|
responseCode: 4017400,
|
|
40
40
|
responseSuccess: false,
|
|
@@ -42,7 +42,7 @@ class ResponseApi {
|
|
|
42
42
|
responseData: data,
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
-
internalServer = (caption, data) => {
|
|
45
|
+
internalServer = ({ caption, data }) => {
|
|
46
46
|
return {
|
|
47
47
|
responseCode: 5007400,
|
|
48
48
|
responseSuccess: false,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ayiin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"description": "Library Pribadi Yang Gak Ada Isinya",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ayiin": "./
|
|
7
|
+
"ayiin": "./bin/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc"
|
package/tsconfig.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"rootDir": "./src",
|
|
4
|
-
"outDir": "./ayiin",
|
|
5
|
-
"resolveJsonModule": true,
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"alwaysStrict": true,
|
|
10
|
-
"incremental": true,
|
|
11
|
-
// Environment setup & latest features
|
|
12
|
-
"target": "esnext",
|
|
13
|
-
"module": "nodenext",
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"allowJs": true,
|
|
16
|
-
"types": ["@types/node"],
|
|
17
|
-
|
|
18
|
-
// Bundler mode
|
|
19
|
-
"moduleResolution": "nodenext",
|
|
20
|
-
|
|
21
|
-
// Best practices
|
|
22
|
-
"strict": true,
|
|
23
|
-
"skipLibCheck": true,
|
|
24
|
-
"noFallthroughCasesInSwitch": true,
|
|
25
|
-
"noUncheckedIndexedAccess": true,
|
|
26
|
-
"noImplicitOverride": true,
|
|
27
|
-
|
|
28
|
-
// Some stricter flags (disabled by default)
|
|
29
|
-
"noUnusedLocals": false,
|
|
30
|
-
"noUnusedParameters": false,
|
|
31
|
-
"noPropertyAccessFromIndexSignature": false
|
|
32
|
-
},
|
|
33
|
-
"include": ["src/**/*"],
|
|
34
|
-
"exclude": ["node_modules", "**/*.spec.ts"]
|
|
35
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|