@stryke/types 0.6.2 → 0.6.3
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/file.cjs +1 -7
- package/dist/file.d.ts +3 -8
- package/dist/file.mjs +0 -1
- package/dist/messages.cjs +1 -7
- package/dist/messages.d.ts +7 -13
- package/dist/messages.mjs +0 -1
- package/dist/package-manager.cjs +1 -8
- package/dist/package-manager.d.ts +2 -12
- package/dist/package-manager.mjs +0 -1
- package/dist/user.cjs +1 -7
- package/dist/user.d.ts +1 -5
- package/dist/user.mjs +0 -1
- package/dist/validations.d.ts +8 -8
- package/package.json +1 -1
package/dist/file.cjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FileStatus = void 0;
|
|
7
|
-
var FileStatus = exports.FileStatus = (i => (i.INITIALIZED = "initialized", i.VALIDATED = "validated", i.UPLOADED = "uploaded", i.FAILED = "failed", i))(FileStatus || {});
|
|
1
|
+
"use strict";
|
package/dist/file.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
3
|
-
INITIALIZED = "initialized",
|
|
4
|
-
VALIDATED = "validated",
|
|
5
|
-
UPLOADED = "uploaded",
|
|
6
|
-
FAILED = "failed"
|
|
7
|
-
}
|
|
1
|
+
import type { ValidationDetail } from "./validations";
|
|
2
|
+
export type FileStatus = "initialized" | "validated" | "uploaded" | "failed";
|
|
8
3
|
/**
|
|
9
4
|
* A type that representing a file object.
|
|
10
5
|
*/
|
|
11
6
|
export type FileResult = {
|
|
12
7
|
name: string;
|
|
13
8
|
status: FileStatus;
|
|
14
|
-
issues?:
|
|
9
|
+
issues?: ValidationDetail[];
|
|
15
10
|
size?: number;
|
|
16
11
|
mimeType?: string;
|
|
17
12
|
lastModified?: number;
|
package/dist/file.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var FileStatus=(i=>(i.INITIALIZED="initialized",i.VALIDATED="validated",i.UPLOADED="uploaded",i.FAILED="failed",i))(FileStatus||{});
|
package/dist/messages.cjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MessageType = void 0;
|
|
7
|
-
var MessageType = exports.MessageType = (e => (e.HELP = "help", e.ERROR = "error", e.WARNING = "warning", e.INFO = "info", e.SUCCESS = "success", e))(MessageType || {});
|
|
1
|
+
"use strict";
|
package/dist/messages.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
ERROR = "error",
|
|
4
|
-
WARNING = "warning",
|
|
5
|
-
INFO = "info",
|
|
6
|
-
SUCCESS = "success"
|
|
7
|
-
}
|
|
8
|
-
export type MessageDetails<TMessageType extends typeof MessageType.HELP | typeof MessageType.ERROR | typeof MessageType.WARNING | typeof MessageType.INFO | typeof MessageType.SUCCESS = typeof MessageType.HELP | typeof MessageType.ERROR | typeof MessageType.WARNING | typeof MessageType.INFO | typeof MessageType.SUCCESS> = {
|
|
1
|
+
export type MessageType = "help" | "error" | "warning" | "info" | "success";
|
|
2
|
+
export type MessageDetails<TMessageType extends MessageType = MessageType> = {
|
|
9
3
|
code: string;
|
|
10
4
|
message?: string;
|
|
11
5
|
type: TMessageType;
|
|
@@ -16,8 +10,8 @@ export type MessageDetails<TMessageType extends typeof MessageType.HELP | typeof
|
|
|
16
10
|
type: TMessageType;
|
|
17
11
|
params?: Record<string, any>;
|
|
18
12
|
};
|
|
19
|
-
export type HelpMessageDetails = MessageDetails<
|
|
20
|
-
export type ErrorMessageDetails = MessageDetails<
|
|
21
|
-
export type WarningMessageDetails = MessageDetails<
|
|
22
|
-
export type InfoMessageDetails = MessageDetails<
|
|
23
|
-
export type SuccessMessageDetails = MessageDetails<
|
|
13
|
+
export type HelpMessageDetails = MessageDetails<"help">;
|
|
14
|
+
export type ErrorMessageDetails = MessageDetails<"error">;
|
|
15
|
+
export type WarningMessageDetails = MessageDetails<"warning">;
|
|
16
|
+
export type InfoMessageDetails = MessageDetails<"info">;
|
|
17
|
+
export type SuccessMessageDetails = MessageDetails<"success">;
|
package/dist/messages.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var MessageType=(e=>(e.HELP="help",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.SUCCESS="success",e))(MessageType||{});
|
package/dist/package-manager.cjs
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PackageManagers = exports.PackageManagerLockFiles = void 0;
|
|
7
|
-
var PackageManagers = exports.PackageManagers = (p => (p.NPM = "npm", p.YARN = "yarn", p.PNPM = "pnpm", p.BUN = "bun", p))(PackageManagers || {}),
|
|
8
|
-
PackageManagerLockFiles = exports.PackageManagerLockFiles = (p => (p.NPM = "package-lock.json", p.YARN = "yarn.lock", p.PNPM = "pnpm-lock.yaml", p.BUN = "bun.lock", p))(PackageManagerLockFiles || {});
|
|
1
|
+
"use strict";
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
YARN = "yarn",
|
|
4
|
-
PNPM = "pnpm",
|
|
5
|
-
BUN = "bun"
|
|
6
|
-
}
|
|
7
|
-
export declare enum PackageManagerLockFiles {
|
|
8
|
-
NPM = "package-lock.json",
|
|
9
|
-
YARN = "yarn.lock",
|
|
10
|
-
PNPM = "pnpm-lock.yaml",
|
|
11
|
-
BUN = "bun.lock"
|
|
12
|
-
}
|
|
1
|
+
export type PackageManager = "npm" | "yarn" | "pnpm" | "bun";
|
|
2
|
+
export type PackageManagerLockFile = "package-lock.json" | "yarn.lock" | "pnpm-lock.yaml" | "bun.lock";
|
package/dist/package-manager.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var PackageManagers=(p=>(p.NPM="npm",p.YARN="yarn",p.PNPM="pnpm",p.BUN="bun",p))(PackageManagers||{}),PackageManagerLockFiles=(p=>(p.NPM="package-lock.json",p.YARN="yarn.lock",p.PNPM="pnpm-lock.yaml",p.BUN="bun.lock",p))(PackageManagerLockFiles||{});
|
package/dist/user.cjs
CHANGED
package/dist/user.d.ts
CHANGED
package/dist/user.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var UserType=(e=>(e.INTERNAL="internal",e.EXTERNAL="external",e.SERVICE="service",e))(UserType||{});
|
package/dist/validations.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { MessageDetails, MessageType } from "./messages";
|
|
2
|
-
export type
|
|
2
|
+
export type ValidationDetail<TMessageType extends MessageType = MessageType> = MessageDetails<TMessageType> & {
|
|
3
3
|
/**
|
|
4
4
|
* The field path that the message is related to.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* If `undefined` or `null`, the message is not related to a specific field - in this case it is likely a global/form message.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
path?: string | null;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type InferValidationType<TMessageType extends MessageType> = TMessageType extends
|
|
11
|
+
export type ErrorValidationDetail = ValidationDetail<"error">;
|
|
12
|
+
export type WarningValidationDetail = ValidationDetail<"warning">;
|
|
13
|
+
export type InfoValidationDetail = ValidationDetail<"info">;
|
|
14
|
+
export type HelpValidationDetail = ValidationDetail<"help">;
|
|
15
|
+
export type SuccessValidationDetail = ValidationDetail<"success">;
|
|
16
|
+
export type InferValidationType<TMessageType extends MessageType> = TMessageType extends "error" ? ErrorValidationDetail : TMessageType extends "warning" ? WarningValidationDetail : TMessageType extends "help" ? InfoValidationDetail : TMessageType extends "info" ? SuccessValidationDetail : ValidationDetail;
|