ayiin 2.0.8 → 2.0.9

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,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const package_json_1 = __importDefault(require("../../package.json"));
8
+ // CLI entry point
9
+ console.log("Welcome to ayiin CLI!");
10
+ const args = process.argv.slice(2);
11
+ if (args.length === 0) {
12
+ console.log("Usage: ayiin <command>");
13
+ process.exit(0);
14
+ }
15
+ switch (args[0]) {
16
+ case "hello":
17
+ console.log("Hai Ayiin, CLI sudah jalan!");
18
+ break;
19
+ case "version":
20
+ console.log(`ayiin CLI v${package_json_1.default.version}`);
21
+ break;
22
+ case "help":
23
+ console.log("Available commands: hello, version, help");
24
+ break;
25
+ default:
26
+ console.log(`Unknown command: ${args[0]}`);
27
+ }
@@ -54,31 +54,31 @@ declare class BaseMethods<C extends Crypt, T extends Tools, R extends ResponseAp
54
54
  responseMessage: string;
55
55
  responseData: any;
56
56
  };
57
- badRequestResponse: (caption: string, title?: string) => {
57
+ badRequestResponse: (caption: string, title?: string, data?: any) => {
58
58
  responseCode: number;
59
59
  responseSuccess: boolean;
60
60
  responseMessage: string;
61
61
  responseData: any;
62
62
  };
63
- invalidFieldsResponse: (caption: string) => {
63
+ invalidFieldsResponse: (caption: string, data?: any) => {
64
64
  responseCode: number;
65
65
  responseSuccess: boolean;
66
66
  responseMessage: string;
67
67
  responseData: any;
68
68
  };
69
- notFoundResponse: (caption: string) => {
69
+ notFoundResponse: (caption: string, data?: any) => {
70
70
  responseCode: number;
71
71
  responseSuccess: boolean;
72
72
  responseMessage: string;
73
73
  responseData: any;
74
74
  };
75
- unauthorizedResponse: (caption: string) => {
75
+ unauthorizedResponse: (caption: string, data?: any) => {
76
76
  responseCode: number;
77
77
  responseSuccess: boolean;
78
78
  responseMessage: string;
79
79
  responseData: any;
80
80
  };
81
- internalServerErrorResponse: (caption: string) => {
81
+ internalServerErrorResponse: (caption: string, data?: any) => {
82
82
  responseCode: number;
83
83
  responseSuccess: boolean;
84
84
  responseMessage: string;
@@ -58,11 +58,11 @@ class BaseMethods {
58
58
  * */
59
59
  randomString = (length, prefix) => this.tools.randomString(length, prefix);
60
60
  successResponse = (caption, data, code) => this.response.successResponse(caption, data, code);
61
- badRequestResponse = (caption, title) => this.response.badRequestResponse(caption, title);
62
- invalidFieldsResponse = (caption) => this.response.invalidFieldsResponse(caption);
63
- notFoundResponse = (caption) => this.response.notFoundResponse(caption);
64
- unauthorizedResponse = (caption) => this.response.unauthorizedResponse(caption);
65
- internalServerErrorResponse = (caption) => this.response.internalServerErrorResponse(caption);
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,8 +1,11 @@
1
1
  {
2
2
  "name": "ayiin",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Library Pribadi Yang Gak Ada Isinya",
5
5
  "main": "ayiin/index.js",
6
+ "bin": {
7
+ "ayiin": "./ayiin/bin/cli.js"
8
+ },
6
9
  "scripts": {
7
10
  "build": "tsc"
8
11
  },