@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 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 { ValidationDetails } from "./validations";
2
- export declare enum FileStatus {
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?: ValidationDetails[];
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";
@@ -1,11 +1,5 @@
1
- export declare enum MessageType {
2
- HELP = "help",
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<typeof MessageType.HELP>;
20
- export type ErrorMessageDetails = MessageDetails<typeof MessageType.ERROR>;
21
- export type WarningMessageDetails = MessageDetails<typeof MessageType.WARNING>;
22
- export type InfoMessageDetails = MessageDetails<typeof MessageType.INFO>;
23
- export type SuccessMessageDetails = MessageDetails<typeof MessageType.SUCCESS>;
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||{});
@@ -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 declare enum PackageManagers {
2
- NPM = "npm",
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";
@@ -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
@@ -1,7 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UserType = void 0;
7
- var UserType = exports.UserType = (e => (e.INTERNAL = "internal", e.EXTERNAL = "external", e.SERVICE = "service", e))(UserType || {});
1
+ "use strict";
package/dist/user.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- export declare enum UserType {
2
- INTERNAL = "internal",
3
- EXTERNAL = "external",
4
- SERVICE = "service"
5
- }
1
+ export type UserType = "external" | "internal" | "service" | "admin";
6
2
  export interface UserBase {
7
3
  /**
8
4
  * The user's ID.
package/dist/user.mjs CHANGED
@@ -1 +0,0 @@
1
- export var UserType=(e=>(e.INTERNAL="internal",e.EXTERNAL="external",e.SERVICE="service",e))(UserType||{});
@@ -1,16 +1,16 @@
1
1
  import type { MessageDetails, MessageType } from "./messages";
2
- export type ValidationDetails<TMessageType extends typeof MessageType.ERROR | typeof MessageType.WARNING | typeof MessageType.INFO | typeof MessageType.HELP | typeof MessageType.SUCCESS = typeof MessageType.ERROR | typeof MessageType.WARNING | typeof MessageType.INFO | typeof MessageType.HELP | typeof MessageType.SUCCESS> = MessageDetails<TMessageType> & {
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
- field?: string | null;
9
+ path?: string | null;
10
10
  };
11
- export type ErrorValidationDetails = ValidationDetails<typeof MessageType.ERROR>;
12
- export type WarningValidationDetails = ValidationDetails<typeof MessageType.WARNING>;
13
- export type InfoValidationDetails = ValidationDetails<typeof MessageType.INFO>;
14
- export type HelpValidationDetails = ValidationDetails<typeof MessageType.HELP>;
15
- export type SuccessValidationDetails = ValidationDetails<typeof MessageType.SUCCESS>;
16
- export type InferValidationType<TMessageType extends MessageType> = TMessageType extends typeof MessageType.ERROR ? ErrorValidationDetails : TMessageType extends typeof MessageType.WARNING ? WarningValidationDetails : TMessageType extends typeof MessageType.INFO ? InfoValidationDetails : TMessageType extends typeof MessageType.SUCCESS ? SuccessValidationDetails : ValidationDetails;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/types",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "description": "A package containing many base TypeScript type definitions that are shared across many projects.",
6
6
  "repository": {