@xube/kit-constants 0.0.1

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/http.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import z from "zod";
2
+ export declare const STATUS_CODE = "statusCode";
3
+ export declare const StatusCode: {
4
+ readonly OK: 200;
5
+ readonly Created: 201;
6
+ readonly PartialSuccess: 206;
7
+ readonly BadRequest: 400;
8
+ readonly Unauthorized: 401;
9
+ readonly Forbidden: 403;
10
+ readonly NotFound: 404;
11
+ readonly Conflict: 409;
12
+ readonly InternalError: 500;
13
+ };
14
+ export declare const StatusCodeSchema: z.ZodNativeEnum<{
15
+ readonly OK: 200;
16
+ readonly Created: 201;
17
+ readonly PartialSuccess: 206;
18
+ readonly BadRequest: 400;
19
+ readonly Unauthorized: 401;
20
+ readonly Forbidden: 403;
21
+ readonly NotFound: 404;
22
+ readonly Conflict: 409;
23
+ readonly InternalError: 500;
24
+ }>;
25
+ export type StatusCode = z.infer<typeof StatusCodeSchema>;
package/dist/http.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.StatusCodeSchema = exports.StatusCode = exports.STATUS_CODE = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.STATUS_CODE = "statusCode";
9
+ exports.StatusCode = {
10
+ OK: 200,
11
+ Created: 201,
12
+ PartialSuccess: 206,
13
+ BadRequest: 400,
14
+ Unauthorized: 401,
15
+ Forbidden: 403,
16
+ NotFound: 404,
17
+ Conflict: 409,
18
+ InternalError: 500
19
+ };
20
+ exports.StatusCodeSchema = zod_1.default.nativeEnum(exports.StatusCode);
@@ -0,0 +1,3 @@
1
+ export * from "./http";
2
+ export declare const ERROR = "error";
3
+ export declare const DATA = "data";
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
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
+ exports.DATA = exports.ERROR = void 0;
18
+ __exportStar(require("./http"), exports);
19
+ exports.ERROR = "error";
20
+ exports.DATA = "data";
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@xube/kit-constants",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+ssh://git@github.com/XubeLtd/dev-kit.git"
12
+ },
13
+ "author": "Xube Pty Ltd",
14
+ "license": "MIT",
15
+ "bugs": {
16
+ "url": "https://github.com/XubeLtd/dev-kit/issues"
17
+ },
18
+ "homepage": "https://github.com/XubeLtd/dev-kit#readme",
19
+ "dependencies": {
20
+ "zod": "^3.21.4"
21
+ }
22
+ }
package/src/http.ts ADDED
@@ -0,0 +1,17 @@
1
+ import z from "zod";
2
+
3
+ export const STATUS_CODE = "statusCode";
4
+ export const StatusCode = {
5
+ OK: 200,
6
+ Created: 201,
7
+ PartialSuccess: 206,
8
+ BadRequest: 400,
9
+ Unauthorized: 401,
10
+ Forbidden: 403,
11
+ NotFound: 404,
12
+ Conflict: 409,
13
+ InternalError: 500
14
+ } as const;
15
+
16
+ export const StatusCodeSchema = z.nativeEnum(StatusCode);
17
+ export type StatusCode = z.infer<typeof StatusCodeSchema>;
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./http"
2
+
3
+ export const ERROR = "error";
4
+ export const DATA = "data";
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../kit-build/tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src",
5
+ "outDir": "./dist"
6
+ },
7
+ "exclude": ["**/*.test.ts", "**/*.mock.ts", "dist"]
8
+ }