ayiin 2.0.9 → 2.0.10

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.
@@ -48,37 +48,57 @@ declare class BaseMethods<C extends Crypt, T extends Tools, R extends ResponseAp
48
48
  * @param {number} length
49
49
  * */
50
50
  randomString: (length: number, prefix?: string) => string;
51
- successResponse: (caption: string, data: any, code?: number) => {
51
+ successResponse: ({ caption, data, code, }: {
52
+ caption: string;
53
+ data: any;
54
+ code?: number;
55
+ }) => {
52
56
  responseCode: number;
53
57
  responseSuccess: boolean;
54
58
  responseMessage: string;
55
59
  responseData: any;
56
60
  };
57
- badRequestResponse: (caption: string, title?: string, data?: any) => {
61
+ badRequestResponse: ({ caption, title, data, }: {
62
+ caption: string;
63
+ title?: string;
64
+ data?: any;
65
+ }) => {
58
66
  responseCode: number;
59
67
  responseSuccess: boolean;
60
68
  responseMessage: string;
61
69
  responseData: any;
62
70
  };
63
- invalidFieldsResponse: (caption: string, data?: any) => {
71
+ invalidFieldsResponse: ({ caption, data, }: {
72
+ caption: string;
73
+ data?: any;
74
+ }) => {
64
75
  responseCode: number;
65
76
  responseSuccess: boolean;
66
77
  responseMessage: string;
67
78
  responseData: any;
68
79
  };
69
- notFoundResponse: (caption: string, data?: any) => {
80
+ notFoundResponse: ({ caption, data }: {
81
+ caption: string;
82
+ data?: any;
83
+ }) => {
70
84
  responseCode: number;
71
85
  responseSuccess: boolean;
72
86
  responseMessage: string;
73
87
  responseData: any;
74
88
  };
75
- unauthorizedResponse: (caption: string, data?: any) => {
89
+ unauthorizedResponse: ({ caption, data }: {
90
+ caption: string;
91
+ data?: any;
92
+ }) => {
76
93
  responseCode: number;
77
94
  responseSuccess: boolean;
78
95
  responseMessage: string;
79
96
  responseData: any;
80
97
  };
81
- internalServerErrorResponse: (caption: string, data?: any) => {
98
+ internalServerErrorResponse: ({ caption, data, }: {
99
+ caption: string;
100
+ data?: any;
101
+ }) => {
82
102
  responseCode: number;
83
103
  responseSuccess: boolean;
84
104
  responseMessage: string;
@@ -57,12 +57,12 @@ class BaseMethods {
57
57
  * @param {number} length
58
58
  * */
59
59
  randomString = (length, prefix) => this.tools.randomString(length, prefix);
60
- successResponse = (caption, data, code) => this.response.successResponse(caption, data, code);
61
- badRequestResponse = (caption, title, data) => this.response.badRequestResponse(caption, title, data);
62
- invalidFieldsResponse = (caption, data) => this.response.invalidFieldsResponse(caption, data);
63
- notFoundResponse = (caption, data) => this.response.notFoundResponse(caption, data);
64
- unauthorizedResponse = (caption, data) => this.response.unauthorizedResponse(caption, data);
65
- internalServerErrorResponse = (caption, data) => this.response.internalServerErrorResponse(caption, data);
60
+ successResponse = ({ caption, data, code, }) => this.response.successResponse(caption, data, code);
61
+ badRequestResponse = ({ caption, title, data, }) => this.response.badRequestResponse(caption, title, data);
62
+ invalidFieldsResponse = ({ caption, data, }) => this.response.invalidFieldsResponse(caption, data);
63
+ notFoundResponse = ({ caption, data }) => this.response.notFoundResponse(caption, data);
64
+ unauthorizedResponse = ({ caption, data }) => this.response.unauthorizedResponse(caption, data);
65
+ internalServerErrorResponse = ({ caption, data, }) => this.response.internalServerErrorResponse(caption, data);
66
66
  }
67
67
  class Methods extends BaseMethods {
68
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ayiin",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Library Pribadi Yang Gak Ada Isinya",
5
5
  "main": "ayiin/index.js",
6
6
  "bin": {