@aghamdi/shared-types 0.1.0
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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +28 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +25 -0
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var src_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(src_exports);
|
|
19
|
+
|
|
20
|
+
// src/mia-server-response.ts
|
|
21
|
+
var MiaServerResponse = class {
|
|
22
|
+
};
|
|
23
|
+
MiaServerResponse.send = (status, message, data) => {
|
|
24
|
+
const response = {
|
|
25
|
+
status,
|
|
26
|
+
message,
|
|
27
|
+
data
|
|
28
|
+
};
|
|
29
|
+
return response;
|
|
30
|
+
};
|
|
31
|
+
MiaServerResponse.sendData = (data) => {
|
|
32
|
+
const response = {
|
|
33
|
+
status: 200,
|
|
34
|
+
message: "Success",
|
|
35
|
+
data
|
|
36
|
+
};
|
|
37
|
+
return response;
|
|
38
|
+
};
|
|
39
|
+
MiaServerResponse.sendError = (error) => {
|
|
40
|
+
const response = {
|
|
41
|
+
status: 400,
|
|
42
|
+
message: "Failed",
|
|
43
|
+
data: error
|
|
44
|
+
};
|
|
45
|
+
return response;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/mia-server-response.ts"],"sourcesContent":["export * from './mia-server-response'","export default class MiaServerResponse {\n status?: number;\n message?: string;\n data: any;\n\n static send = (status: number, message: string, data: any) => {\n const response: MiaServerResponse = {\n status: status,\n message: message,\n data: data\n };\n return response;\n }\n static sendData = (data: any) => {\n const response: MiaServerResponse = {\n status: 200,\n message: \"Success\",\n data: data\n };\n return response;\n }\n static sendError = (error: any) => {\n const response: MiaServerResponse = {\n status: 400,\n message: \"Failed\",\n data: error\n };\n return response;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;;;ACAA,IAAqB,oBAArB,MAAuC;AA6BvC;AA7BqB,kBAKZ,OAAO,CAAC,QAAgB,SAAiB,SAAc;AAC5D,QAAM,WAA8B;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,SAAO;AACT;AAZmB,kBAaZ,WAAW,CAAC,SAAc;AAC/B,QAAM,WAA8B;AAAA,IAClC,QAAQ;AAAA,IACR,SAAS;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AApBmB,kBAqBZ,YAAY,CAAC,UAAe;AACjC,QAAM,WAA8B;AAAA,IAClC,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACA,SAAO;AACT;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/mia-server-response.ts
|
|
2
|
+
var MiaServerResponse = class {
|
|
3
|
+
};
|
|
4
|
+
MiaServerResponse.send = (status, message, data) => {
|
|
5
|
+
const response = {
|
|
6
|
+
status,
|
|
7
|
+
message,
|
|
8
|
+
data
|
|
9
|
+
};
|
|
10
|
+
return response;
|
|
11
|
+
};
|
|
12
|
+
MiaServerResponse.sendData = (data) => {
|
|
13
|
+
const response = {
|
|
14
|
+
status: 200,
|
|
15
|
+
message: "Success",
|
|
16
|
+
data
|
|
17
|
+
};
|
|
18
|
+
return response;
|
|
19
|
+
};
|
|
20
|
+
MiaServerResponse.sendError = (error) => {
|
|
21
|
+
const response = {
|
|
22
|
+
status: 400,
|
|
23
|
+
message: "Failed",
|
|
24
|
+
data: error
|
|
25
|
+
};
|
|
26
|
+
return response;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mia-server-response.ts"],"sourcesContent":["export default class MiaServerResponse {\n status?: number;\n message?: string;\n data: any;\n\n static send = (status: number, message: string, data: any) => {\n const response: MiaServerResponse = {\n status: status,\n message: message,\n data: data\n };\n return response;\n }\n static sendData = (data: any) => {\n const response: MiaServerResponse = {\n status: 200,\n message: \"Success\",\n data: data\n };\n return response;\n }\n static sendError = (error: any) => {\n const response: MiaServerResponse = {\n status: 400,\n message: \"Failed\",\n data: error\n };\n return response;\n }\n}\n"],"mappings":";AAAA,IAAqB,oBAArB,MAAuC;AA6BvC;AA7BqB,kBAKZ,OAAO,CAAC,QAAgB,SAAiB,SAAc;AAC5D,QAAM,WAA8B;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,SAAO;AACT;AAZmB,kBAaZ,WAAW,CAAC,SAAc;AAC/B,QAAM,WAA8B;AAAA,IAClC,QAAQ;AAAA,IACR,SAAS;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AApBmB,kBAqBZ,YAAY,CAAC,UAAe;AACjC,QAAM,WAA8B;AAAA,IAClC,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACA,SAAO;AACT;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aghamdi/shared-types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Provide typescript interfaces for common types and some classes",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsup",
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"auth",
|
|
13
|
+
"authorization",
|
|
14
|
+
"current",
|
|
15
|
+
"user"
|
|
16
|
+
],
|
|
17
|
+
"author": "Abdullah AlGhamdi",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"tsup": "^8.0.2"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"/dist"
|
|
24
|
+
]
|
|
25
|
+
}
|