@taskora-uni/common 1.0.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.
@@ -0,0 +1 @@
1
+ export * from "./rpc-status.enum";
@@ -0,0 +1,17 @@
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("./rpc-status.enum"), exports);
@@ -0,0 +1,87 @@
1
+ export declare enum RpcStatus {
2
+ /**
3
+ * Operation completed successfully.
4
+ * Maps to HTTP 200 OK.
5
+ */
6
+ OK = 0,
7
+ /**
8
+ * Operation was cancelled by the caller.
9
+ * Maps to HTTP 499 Client Closed Request.
10
+ */
11
+ CANCELLED = 1,
12
+ /**
13
+ * Unknown error occurred.
14
+ * Maps to HTTP 500 Internal Server Error.
15
+ */
16
+ UNKNOWN = 2,
17
+ /**
18
+ * Client provided an invalid argument.
19
+ * Maps to HTTP 400 Bad Request.
20
+ */
21
+ INVALID_ARGUMENT = 3,
22
+ /**
23
+ * Operation exceeded its deadline.
24
+ * Maps to HTTP 504 Gateway Timeout.
25
+ */
26
+ DEADLINE_EXCEEDED = 4,
27
+ /**
28
+ * Requested entity was not found.
29
+ * Maps to HTTP 404 Not Found.
30
+ */
31
+ NOT_FOUND = 5,
32
+ /**
33
+ * Entity already exists.
34
+ * Maps to HTTP 409 Conflict.
35
+ */
36
+ ALREADY_EXISTS = 6,
37
+ /**
38
+ * Caller lacks permission for the operation.
39
+ * Maps to HTTP 403 Forbidden.
40
+ */
41
+ PERMISSION_DENIED = 7,
42
+ /**
43
+ * Resource was exhausted, such as quota or rate limits.
44
+ * Maps to HTTP 429 Too Many Requests.
45
+ */
46
+ RESOURCE_EXHAUSTED = 8,
47
+ /**
48
+ * System is not in the required state.
49
+ * Maps to HTTP 400 Bad Request.
50
+ */
51
+ FAILED_PRECONDITION = 9,
52
+ /**
53
+ * Operation was aborted due to a conflict.
54
+ * Maps to HTTP 409 Conflict.
55
+ */
56
+ ABORTED = 10,
57
+ /**
58
+ * Operation accessed a value outside the valid range.
59
+ * Maps to HTTP 400 Bad Request.
60
+ */
61
+ OUT_OF_RANGE = 11,
62
+ /**
63
+ * Operation is not implemented or supported.
64
+ * Maps to HTTP 501 Not Implemented.
65
+ */
66
+ UNIMPLEMENTED = 12,
67
+ /**
68
+ * Internal server error occurred.
69
+ * Maps to HTTP 500 Internal Server Error.
70
+ */
71
+ INTERNAL = 13,
72
+ /**
73
+ * Service is currently unavailable.
74
+ * Maps to HTTP 503 Service Unavailable.
75
+ */
76
+ UNAVAILABLE = 14,
77
+ /**
78
+ * Unrecoverable data corruption or loss was detected.
79
+ * Maps to HTTP 500 Internal Server Error.
80
+ */
81
+ DATA_LOSS = 15,
82
+ /**
83
+ * Request lacks valid authentication credentials.
84
+ * Maps to HTTP 401 Unauthorized.
85
+ */
86
+ UNAUTHENTICATED = 16
87
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RpcStatus = void 0;
4
+ var RpcStatus;
5
+ (function (RpcStatus) {
6
+ /**
7
+ * Operation completed successfully.
8
+ * Maps to HTTP 200 OK.
9
+ */
10
+ RpcStatus[RpcStatus["OK"] = 0] = "OK";
11
+ /**
12
+ * Operation was cancelled by the caller.
13
+ * Maps to HTTP 499 Client Closed Request.
14
+ */
15
+ RpcStatus[RpcStatus["CANCELLED"] = 1] = "CANCELLED";
16
+ /**
17
+ * Unknown error occurred.
18
+ * Maps to HTTP 500 Internal Server Error.
19
+ */
20
+ RpcStatus[RpcStatus["UNKNOWN"] = 2] = "UNKNOWN";
21
+ /**
22
+ * Client provided an invalid argument.
23
+ * Maps to HTTP 400 Bad Request.
24
+ */
25
+ RpcStatus[RpcStatus["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT";
26
+ /**
27
+ * Operation exceeded its deadline.
28
+ * Maps to HTTP 504 Gateway Timeout.
29
+ */
30
+ RpcStatus[RpcStatus["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED";
31
+ /**
32
+ * Requested entity was not found.
33
+ * Maps to HTTP 404 Not Found.
34
+ */
35
+ RpcStatus[RpcStatus["NOT_FOUND"] = 5] = "NOT_FOUND";
36
+ /**
37
+ * Entity already exists.
38
+ * Maps to HTTP 409 Conflict.
39
+ */
40
+ RpcStatus[RpcStatus["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS";
41
+ /**
42
+ * Caller lacks permission for the operation.
43
+ * Maps to HTTP 403 Forbidden.
44
+ */
45
+ RpcStatus[RpcStatus["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED";
46
+ /**
47
+ * Resource was exhausted, such as quota or rate limits.
48
+ * Maps to HTTP 429 Too Many Requests.
49
+ */
50
+ RpcStatus[RpcStatus["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED";
51
+ /**
52
+ * System is not in the required state.
53
+ * Maps to HTTP 400 Bad Request.
54
+ */
55
+ RpcStatus[RpcStatus["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION";
56
+ /**
57
+ * Operation was aborted due to a conflict.
58
+ * Maps to HTTP 409 Conflict.
59
+ */
60
+ RpcStatus[RpcStatus["ABORTED"] = 10] = "ABORTED";
61
+ /**
62
+ * Operation accessed a value outside the valid range.
63
+ * Maps to HTTP 400 Bad Request.
64
+ */
65
+ RpcStatus[RpcStatus["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE";
66
+ /**
67
+ * Operation is not implemented or supported.
68
+ * Maps to HTTP 501 Not Implemented.
69
+ */
70
+ RpcStatus[RpcStatus["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED";
71
+ /**
72
+ * Internal server error occurred.
73
+ * Maps to HTTP 500 Internal Server Error.
74
+ */
75
+ RpcStatus[RpcStatus["INTERNAL"] = 13] = "INTERNAL";
76
+ /**
77
+ * Service is currently unavailable.
78
+ * Maps to HTTP 503 Service Unavailable.
79
+ */
80
+ RpcStatus[RpcStatus["UNAVAILABLE"] = 14] = "UNAVAILABLE";
81
+ /**
82
+ * Unrecoverable data corruption or loss was detected.
83
+ * Maps to HTTP 500 Internal Server Error.
84
+ */
85
+ RpcStatus[RpcStatus["DATA_LOSS"] = 15] = "DATA_LOSS";
86
+ /**
87
+ * Request lacks valid authentication credentials.
88
+ * Maps to HTTP 401 Unauthorized.
89
+ */
90
+ RpcStatus[RpcStatus["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED";
91
+ })(RpcStatus || (exports.RpcStatus = RpcStatus = {}));
@@ -0,0 +1 @@
1
+ export * from "./enums";
@@ -0,0 +1,17 @@
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("./enums"), exports);
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@taskora-uni/common",
3
+ "version": "1.0.0",
4
+ "description": "Shared common modules for Taskora Uni backend services",
5
+ "license": "MIT",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "type": "commonjs",
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "devDependencies": {
16
+ "@taskora-uni/core": "latest",
17
+ "@types/node": "^25.5.0",
18
+ "oxfmt": "^0.42.0",
19
+ "typescript": "^6.0.2"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc -p tsconfig.build.json",
23
+ "format": "oxfmt --config oxfmt.config.mjs",
24
+ "format:check": "oxfmt --check --config oxfmt.config.mjs"
25
+ }
26
+ }