@event-driven-io/emmett 0.39.0 → 0.39.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/{chunk-O2VMBOV4.js → chunk-AZDDB5SF.js} +19 -9
- package/dist/chunk-AZDDB5SF.js.map +1 -0
- package/dist/{chunk-FMH3M5GB.cjs → chunk-WND32L6P.cjs} +22 -12
- package/dist/chunk-WND32L6P.cjs.map +1 -0
- package/dist/cli.cjs +7 -7
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/{index-7wNEMFlg.d.cts → index-Amos00J7.d.cts} +8 -0
- package/dist/{index-7wNEMFlg.d.ts → index-Amos00J7.d.ts} +8 -0
- package/dist/index.cjs +19 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-FMH3M5GB.cjs.map +0 -1
- package/dist/chunk-O2VMBOV4.js.map +0 -1
|
@@ -37,28 +37,38 @@ var isErrorConstructor = (expect) => {
|
|
|
37
37
|
expect.prototype.constructor === expect;
|
|
38
38
|
};
|
|
39
39
|
var EmmettError = class _EmmettError extends Error {
|
|
40
|
+
static Codes = {
|
|
41
|
+
ValidationError: 400,
|
|
42
|
+
IllegalStateError: 403,
|
|
43
|
+
NotFoundError: 404,
|
|
44
|
+
ConcurrencyError: 412,
|
|
45
|
+
InternalServerError: 500
|
|
46
|
+
};
|
|
40
47
|
errorCode;
|
|
41
48
|
constructor(options) {
|
|
42
|
-
const errorCode = options && typeof options === "object" && "errorCode" in options ? options.errorCode : isNumber(options) ? options :
|
|
49
|
+
const errorCode = options && typeof options === "object" && "errorCode" in options ? options.errorCode : isNumber(options) ? options : _EmmettError.Codes.InternalServerError;
|
|
43
50
|
const message = options && typeof options === "object" && "message" in options ? options.message : isString(options) ? options : `Error with status code '${errorCode}' ocurred during Emmett processing`;
|
|
44
51
|
super(message);
|
|
45
52
|
this.errorCode = errorCode;
|
|
46
53
|
Object.setPrototypeOf(this, _EmmettError.prototype);
|
|
47
54
|
}
|
|
48
55
|
static mapFrom(error) {
|
|
49
|
-
if (error
|
|
56
|
+
if (_EmmettError.isInstanceOf(error)) {
|
|
50
57
|
return error;
|
|
51
58
|
}
|
|
52
59
|
return new _EmmettError({
|
|
53
|
-
errorCode: "errorCode" in error && error.errorCode !== void 0 && error.errorCode !== null ? error.errorCode :
|
|
60
|
+
errorCode: "errorCode" in error && error.errorCode !== void 0 && error.errorCode !== null ? error.errorCode : _EmmettError.Codes.InternalServerError,
|
|
54
61
|
message: error.message ?? "An unknown error occurred"
|
|
55
62
|
});
|
|
56
63
|
}
|
|
64
|
+
static isInstanceOf(error, errorCode) {
|
|
65
|
+
return typeof error === "object" && error !== null && "errorCode" in error && isNumber(error.errorCode) && (errorCode === void 0 || error.errorCode === errorCode);
|
|
66
|
+
}
|
|
57
67
|
};
|
|
58
68
|
var ConcurrencyError = class _ConcurrencyError extends EmmettError {
|
|
59
69
|
constructor(current, expected, message) {
|
|
60
70
|
super({
|
|
61
|
-
errorCode:
|
|
71
|
+
errorCode: EmmettError.Codes.ConcurrencyError,
|
|
62
72
|
message: message ?? `Expected version ${expected.toString()} does not match current ${current?.toString()}`
|
|
63
73
|
});
|
|
64
74
|
this.current = current;
|
|
@@ -69,7 +79,7 @@ var ConcurrencyError = class _ConcurrencyError extends EmmettError {
|
|
|
69
79
|
var ConcurrencyInMemoryDatabaseError = class _ConcurrencyInMemoryDatabaseError extends EmmettError {
|
|
70
80
|
constructor(message) {
|
|
71
81
|
super({
|
|
72
|
-
errorCode:
|
|
82
|
+
errorCode: EmmettError.Codes.ConcurrencyError,
|
|
73
83
|
message: message ?? `Expected document state does not match current one!`
|
|
74
84
|
});
|
|
75
85
|
Object.setPrototypeOf(this, _ConcurrencyInMemoryDatabaseError.prototype);
|
|
@@ -78,7 +88,7 @@ var ConcurrencyInMemoryDatabaseError = class _ConcurrencyInMemoryDatabaseError e
|
|
|
78
88
|
var ValidationError = class _ValidationError extends EmmettError {
|
|
79
89
|
constructor(message) {
|
|
80
90
|
super({
|
|
81
|
-
errorCode:
|
|
91
|
+
errorCode: EmmettError.Codes.ValidationError,
|
|
82
92
|
message: message ?? `Validation Error ocurred during Emmett processing`
|
|
83
93
|
});
|
|
84
94
|
Object.setPrototypeOf(this, _ValidationError.prototype);
|
|
@@ -87,7 +97,7 @@ var ValidationError = class _ValidationError extends EmmettError {
|
|
|
87
97
|
var IllegalStateError = class _IllegalStateError extends EmmettError {
|
|
88
98
|
constructor(message) {
|
|
89
99
|
super({
|
|
90
|
-
errorCode:
|
|
100
|
+
errorCode: EmmettError.Codes.IllegalStateError,
|
|
91
101
|
message: message ?? `Illegal State ocurred during Emmett processing`
|
|
92
102
|
});
|
|
93
103
|
Object.setPrototypeOf(this, _IllegalStateError.prototype);
|
|
@@ -96,7 +106,7 @@ var IllegalStateError = class _IllegalStateError extends EmmettError {
|
|
|
96
106
|
var NotFoundError = class _NotFoundError extends EmmettError {
|
|
97
107
|
constructor(options) {
|
|
98
108
|
super({
|
|
99
|
-
errorCode:
|
|
109
|
+
errorCode: EmmettError.Codes.NotFoundError,
|
|
100
110
|
message: options?.message ?? (options?.id ? options.type ? `${options.type} with ${options.id} was not found during Emmett processing` : `State with ${options.id} was not found during Emmett processing` : options?.type ? `${options.type} was not found during Emmett processing` : "State was not found during Emmett processing")
|
|
101
111
|
});
|
|
102
112
|
Object.setPrototypeOf(this, _NotFoundError.prototype);
|
|
@@ -148,4 +158,4 @@ export {
|
|
|
148
158
|
IllegalStateError,
|
|
149
159
|
NotFoundError
|
|
150
160
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-AZDDB5SF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config/plugins/index.ts","../src/validation/index.ts","../src/errors/index.ts","../src/validation/dates.ts"],"sourcesContent":["export type EmmettPluginConfig =\n | {\n name: string;\n register: EmmettPluginRegistration[];\n }\n | string;\n\nexport type EmmettPluginType = 'cli';\n\nexport type EmmettCliPluginRegistration = { pluginType: 'cli'; path?: string };\n\nexport type EmmettPluginRegistration = EmmettCliPluginRegistration;\n\nexport type EmmettCliCommand = {\n addCommand<CliCommand>(command: CliCommand): CliCommand;\n};\n\nexport type EmmettCliPlugin = {\n pluginType: 'cli';\n name: string;\n registerCommands: (program: EmmettCliCommand) => Promise<void> | void;\n};\n\nexport type EmmettPlugin = EmmettCliPlugin;\n\nexport const isPluginConfig = (\n plugin: Partial<EmmettPluginConfig> | string | undefined,\n): plugin is EmmettPluginConfig =>\n plugin !== undefined &&\n (typeof plugin === 'string' ||\n ('name' in plugin &&\n plugin.name !== undefined &&\n typeof plugin.name === 'string'));\n","import { ValidationError } from '../errors';\n\nexport const enum ValidationErrors {\n NOT_A_NONEMPTY_STRING = 'NOT_A_NONEMPTY_STRING',\n NOT_A_POSITIVE_NUMBER = 'NOT_A_POSITIVE_NUMBER',\n NOT_AN_UNSIGNED_BIGINT = 'NOT_AN_UNSIGNED_BIGINT',\n}\n\nexport const isNumber = (val: unknown): val is number =>\n typeof val === 'number' && val === val;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isBigint = (val: any): val is bigint =>\n typeof val === 'bigint' && val === val;\n\nexport const isString = (val: unknown): val is string =>\n typeof val === 'string';\n\nexport const assertNotEmptyString = (value: unknown): string => {\n if (!isString(value) || value.length === 0) {\n throw new ValidationError(ValidationErrors.NOT_A_NONEMPTY_STRING);\n }\n return value;\n};\n\nexport const assertPositiveNumber = (value: unknown): number => {\n if (!isNumber(value) || value <= 0) {\n throw new ValidationError(ValidationErrors.NOT_A_POSITIVE_NUMBER);\n }\n return value;\n};\n\nexport const assertUnsignedBigInt = (value: string): bigint => {\n const number = BigInt(value);\n if (number < 0) {\n throw new ValidationError(ValidationErrors.NOT_AN_UNSIGNED_BIGINT);\n }\n return number;\n};\n\nexport * from './dates';\n","import { isNumber, isString } from '../validation';\n\nexport type ErrorConstructor<ErrorType extends Error> = new (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n) => ErrorType;\n\nexport const isErrorConstructor = <ErrorType extends Error>(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n expect: Function,\n): expect is ErrorConstructor<ErrorType> => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (\n typeof expect === 'function' &&\n expect.prototype &&\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n expect.prototype.constructor === expect\n );\n};\n\nexport class EmmettError extends Error {\n public static readonly Codes = {\n ValidationError: 400,\n IllegalStateError: 403,\n NotFoundError: 404,\n ConcurrencyError: 412,\n InternalServerError: 500,\n };\n\n public errorCode: number;\n\n constructor(\n options?: { errorCode: number; message?: string } | string | number,\n ) {\n const errorCode =\n options && typeof options === 'object' && 'errorCode' in options\n ? options.errorCode\n : isNumber(options)\n ? options\n : EmmettError.Codes.InternalServerError;\n const message =\n options && typeof options === 'object' && 'message' in options\n ? options.message\n : isString(options)\n ? options\n : `Error with status code '${errorCode}' ocurred during Emmett processing`;\n\n super(message);\n this.errorCode = errorCode;\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, EmmettError.prototype);\n }\n\n public static mapFrom(\n error: Error | { message?: string; errorCode?: number },\n ): EmmettError {\n if (EmmettError.isInstanceOf(error)) {\n return error;\n }\n\n return new EmmettError({\n errorCode:\n 'errorCode' in error &&\n error.errorCode !== undefined &&\n error.errorCode !== null\n ? error.errorCode\n : EmmettError.Codes.InternalServerError,\n message: error.message ?? 'An unknown error occurred',\n });\n }\n\n public static isInstanceOf<ErrorType extends EmmettError = EmmettError>(\n error: unknown,\n errorCode?: (typeof EmmettError.Codes)[keyof typeof EmmettError.Codes],\n ): error is ErrorType {\n return (\n typeof error === 'object' &&\n error !== null &&\n 'errorCode' in error &&\n isNumber(error.errorCode) &&\n (errorCode === undefined || error.errorCode === errorCode)\n );\n }\n}\n\nexport class ConcurrencyError extends EmmettError {\n constructor(\n public current: string | undefined,\n public expected: string,\n message?: string,\n ) {\n super({\n errorCode: EmmettError.Codes.ConcurrencyError,\n message:\n message ??\n `Expected version ${expected.toString()} does not match current ${current?.toString()}`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, ConcurrencyError.prototype);\n }\n}\n\n// TODO: Make it derive from ConcurrencyError to avoid code duplication\n// Or add additional type to distinguinsh both errors\nexport class ConcurrencyInMemoryDatabaseError extends EmmettError {\n constructor(message?: string) {\n super({\n errorCode: EmmettError.Codes.ConcurrencyError,\n message: message ?? `Expected document state does not match current one!`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, ConcurrencyInMemoryDatabaseError.prototype);\n }\n}\n\nexport class ValidationError extends EmmettError {\n constructor(message?: string) {\n super({\n errorCode: EmmettError.Codes.ValidationError,\n message: message ?? `Validation Error ocurred during Emmett processing`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\nexport class IllegalStateError extends EmmettError {\n constructor(message?: string) {\n super({\n errorCode: EmmettError.Codes.IllegalStateError,\n message: message ?? `Illegal State ocurred during Emmett processing`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, IllegalStateError.prototype);\n }\n}\n\nexport class NotFoundError extends EmmettError {\n constructor(options?: { id: string; type: string; message?: string }) {\n super({\n errorCode: EmmettError.Codes.NotFoundError,\n message:\n options?.message ??\n (options?.id\n ? options.type\n ? `${options.type} with ${options.id} was not found during Emmett processing`\n : `State with ${options.id} was not found during Emmett processing`\n : options?.type\n ? `${options.type} was not found during Emmett processing`\n : 'State was not found during Emmett processing'),\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { ValidationError } from '../errors';\n\nexport const formatDateToUtcYYYYMMDD = (date: Date) => {\n // Use the 'en-CA' locale which formats as 'yyyy-mm-dd'\n const formatter = new Intl.DateTimeFormat('en-CA', {\n timeZone: 'UTC',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n });\n\n // Format the date\n return formatter.format(date);\n};\n\n// Function to validate 'yyyy-mm-dd' format\nexport const isValidYYYYMMDD = (dateString: string) => {\n const regex = /^\\d{4}-\\d{2}-\\d{2}$/;\n return regex.test(dateString);\n};\n\nexport const parseDateFromUtcYYYYMMDD = (dateString: string) => {\n const date = new Date(dateString + 'T00:00:00Z');\n\n if (!isValidYYYYMMDD(dateString)) {\n throw new ValidationError('Invalid date format, must be yyyy-mm-dd');\n }\n\n if (isNaN(date.getTime())) {\n throw new ValidationError('Invalid date format');\n }\n\n return date;\n};\n"],"mappings":";AAyBO,IAAM,iBAAiB,CAC5B,WAEA,WAAW,WACV,OAAO,WAAW,YAChB,UAAU,UACT,OAAO,SAAS,UAChB,OAAO,OAAO,SAAS;;;AC9BtB,IAAW,mBAAX,kBAAWA,sBAAX;AACL,EAAAA,kBAAA,2BAAwB;AACxB,EAAAA,kBAAA,2BAAwB;AACxB,EAAAA,kBAAA,4BAAyB;AAHT,SAAAA;AAAA,GAAA;AAMX,IAAM,WAAW,CAAC,QACvB,OAAO,QAAQ,YAAY,QAAQ;AAG9B,IAAM,WAAW,CAAC,QACvB,OAAO,QAAQ,YAAY,QAAQ;AAE9B,IAAM,WAAW,CAAC,QACvB,OAAO,QAAQ;AAEV,IAAM,uBAAuB,CAAC,UAA2B;AAC9D,MAAI,CAAC,SAAS,KAAK,KAAK,MAAM,WAAW,GAAG;AAC1C,UAAM,IAAI,gBAAgB,mDAAsC;AAAA,EAClE;AACA,SAAO;AACT;AAEO,IAAM,uBAAuB,CAAC,UAA2B;AAC9D,MAAI,CAAC,SAAS,KAAK,KAAK,SAAS,GAAG;AAClC,UAAM,IAAI,gBAAgB,mDAAsC;AAAA,EAClE;AACA,SAAO;AACT;AAEO,IAAM,u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AAS;AAAA,IACjD,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EACP,CAAC;AAGD,SAAO,UAAU,OAAO,IAAI;AAC9B;AAGO,IAAM,kBAAkB,CAAC,eAAuB;AACrD,QAAM,QAAQ;AACd,SAAO,MAAM,KAAK,UAAU;AAC9B;AAEO,IAAM,2BAA2B,CAAC,eAAuB;AAC9D,QAAM,OAAO,oBAAI,KAAK,aAAa,YAAY;AAE/C,MAAI,CAAC,gBAAgB,UAAU,GAAG;AAChC,UAAM,IAAI,gBAAgB,yCAAyC;AAAA,EACrE;AAEA,MAAI,MAAM,KAAK,QAAQ,CAAC,GAAG;AACzB,UAAM,IAAI,gBAAgB,qBAAqB;AAAA,EACjD;AAEA,SAAO;AACT;","names":["ValidationErrors"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;// src/config/plugins/index.ts
|
|
2
2
|
var isPluginConfig = (plugin) => plugin !== void 0 && (typeof plugin === "string" || "name" in plugin && plugin.name !== void 0 && typeof plugin.name === "string");
|
|
3
3
|
|
|
4
4
|
// src/validation/index.ts
|
|
@@ -36,29 +36,39 @@ var isErrorConstructor = (expect) => {
|
|
|
36
36
|
return typeof expect === "function" && expect.prototype && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
37
37
|
expect.prototype.constructor === expect;
|
|
38
38
|
};
|
|
39
|
-
var EmmettError = class _EmmettError extends Error {
|
|
39
|
+
var EmmettError = (_class = class _EmmettError extends Error {
|
|
40
|
+
static __initStatic() {this.Codes = {
|
|
41
|
+
ValidationError: 400,
|
|
42
|
+
IllegalStateError: 403,
|
|
43
|
+
NotFoundError: 404,
|
|
44
|
+
ConcurrencyError: 412,
|
|
45
|
+
InternalServerError: 500
|
|
46
|
+
}}
|
|
40
47
|
|
|
41
48
|
constructor(options) {
|
|
42
|
-
const errorCode = options && typeof options === "object" && "errorCode" in options ? options.errorCode : isNumber(options) ? options :
|
|
49
|
+
const errorCode = options && typeof options === "object" && "errorCode" in options ? options.errorCode : isNumber(options) ? options : _EmmettError.Codes.InternalServerError;
|
|
43
50
|
const message = options && typeof options === "object" && "message" in options ? options.message : isString(options) ? options : `Error with status code '${errorCode}' ocurred during Emmett processing`;
|
|
44
51
|
super(message);
|
|
45
52
|
this.errorCode = errorCode;
|
|
46
53
|
Object.setPrototypeOf(this, _EmmettError.prototype);
|
|
47
54
|
}
|
|
48
55
|
static mapFrom(error) {
|
|
49
|
-
if (error
|
|
56
|
+
if (_EmmettError.isInstanceOf(error)) {
|
|
50
57
|
return error;
|
|
51
58
|
}
|
|
52
59
|
return new _EmmettError({
|
|
53
|
-
errorCode: "errorCode" in error && error.errorCode !== void 0 && error.errorCode !== null ? error.errorCode :
|
|
60
|
+
errorCode: "errorCode" in error && error.errorCode !== void 0 && error.errorCode !== null ? error.errorCode : _EmmettError.Codes.InternalServerError,
|
|
54
61
|
message: _nullishCoalesce(error.message, () => ( "An unknown error occurred"))
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
|
-
|
|
64
|
+
static isInstanceOf(error, errorCode) {
|
|
65
|
+
return typeof error === "object" && error !== null && "errorCode" in error && isNumber(error.errorCode) && (errorCode === void 0 || error.errorCode === errorCode);
|
|
66
|
+
}
|
|
67
|
+
}, _class.__initStatic(), _class);
|
|
58
68
|
var ConcurrencyError = class _ConcurrencyError extends EmmettError {
|
|
59
69
|
constructor(current, expected, message) {
|
|
60
70
|
super({
|
|
61
|
-
errorCode:
|
|
71
|
+
errorCode: EmmettError.Codes.ConcurrencyError,
|
|
62
72
|
message: _nullishCoalesce(message, () => ( `Expected version ${expected.toString()} does not match current ${_optionalChain([current, 'optionalAccess', _ => _.toString, 'call', _2 => _2()])}`))
|
|
63
73
|
});
|
|
64
74
|
this.current = current;
|
|
@@ -69,7 +79,7 @@ var ConcurrencyError = class _ConcurrencyError extends EmmettError {
|
|
|
69
79
|
var ConcurrencyInMemoryDatabaseError = class _ConcurrencyInMemoryDatabaseError extends EmmettError {
|
|
70
80
|
constructor(message) {
|
|
71
81
|
super({
|
|
72
|
-
errorCode:
|
|
82
|
+
errorCode: EmmettError.Codes.ConcurrencyError,
|
|
73
83
|
message: _nullishCoalesce(message, () => ( `Expected document state does not match current one!`))
|
|
74
84
|
});
|
|
75
85
|
Object.setPrototypeOf(this, _ConcurrencyInMemoryDatabaseError.prototype);
|
|
@@ -78,7 +88,7 @@ var ConcurrencyInMemoryDatabaseError = class _ConcurrencyInMemoryDatabaseError e
|
|
|
78
88
|
var ValidationError = class _ValidationError extends EmmettError {
|
|
79
89
|
constructor(message) {
|
|
80
90
|
super({
|
|
81
|
-
errorCode:
|
|
91
|
+
errorCode: EmmettError.Codes.ValidationError,
|
|
82
92
|
message: _nullishCoalesce(message, () => ( `Validation Error ocurred during Emmett processing`))
|
|
83
93
|
});
|
|
84
94
|
Object.setPrototypeOf(this, _ValidationError.prototype);
|
|
@@ -87,7 +97,7 @@ var ValidationError = class _ValidationError extends EmmettError {
|
|
|
87
97
|
var IllegalStateError = class _IllegalStateError extends EmmettError {
|
|
88
98
|
constructor(message) {
|
|
89
99
|
super({
|
|
90
|
-
errorCode:
|
|
100
|
+
errorCode: EmmettError.Codes.IllegalStateError,
|
|
91
101
|
message: _nullishCoalesce(message, () => ( `Illegal State ocurred during Emmett processing`))
|
|
92
102
|
});
|
|
93
103
|
Object.setPrototypeOf(this, _IllegalStateError.prototype);
|
|
@@ -96,7 +106,7 @@ var IllegalStateError = class _IllegalStateError extends EmmettError {
|
|
|
96
106
|
var NotFoundError = class _NotFoundError extends EmmettError {
|
|
97
107
|
constructor(options) {
|
|
98
108
|
super({
|
|
99
|
-
errorCode:
|
|
109
|
+
errorCode: EmmettError.Codes.NotFoundError,
|
|
100
110
|
message: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _3 => _3.message]), () => ( (_optionalChain([options, 'optionalAccess', _4 => _4.id]) ? options.type ? `${options.type} with ${options.id} was not found during Emmett processing` : `State with ${options.id} was not found during Emmett processing` : _optionalChain([options, 'optionalAccess', _5 => _5.type]) ? `${options.type} was not found during Emmett processing` : "State was not found during Emmett processing")))
|
|
101
111
|
});
|
|
102
112
|
Object.setPrototypeOf(this, _NotFoundError.prototype);
|
|
@@ -148,4 +158,4 @@ var parseDateFromUtcYYYYMMDD = (dateString) => {
|
|
|
148
158
|
|
|
149
159
|
|
|
150
160
|
exports.isPluginConfig = isPluginConfig; exports.formatDateToUtcYYYYMMDD = formatDateToUtcYYYYMMDD; exports.isValidYYYYMMDD = isValidYYYYMMDD; exports.parseDateFromUtcYYYYMMDD = parseDateFromUtcYYYYMMDD; exports.ValidationErrors = ValidationErrors; exports.isNumber = isNumber; exports.isBigint = isBigint; exports.isString = isString; exports.assertNotEmptyString = assertNotEmptyString; exports.assertPositiveNumber = assertPositiveNumber; exports.assertUnsignedBigInt = assertUnsignedBigInt; exports.isErrorConstructor = isErrorConstructor; exports.EmmettError = EmmettError; exports.ConcurrencyError = ConcurrencyError; exports.ConcurrencyInMemoryDatabaseError = ConcurrencyInMemoryDatabaseError; exports.ValidationError = ValidationError; exports.IllegalStateError = IllegalStateError; exports.NotFoundError = NotFoundError;
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-WND32L6P.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/emmett/emmett/src/packages/emmett/dist/chunk-WND32L6P.cjs","../src/config/plugins/index.ts","../src/validation/index.ts","../src/errors/index.ts","../src/validation/dates.ts"],"names":["ValidationErrors"],"mappings":"AAAA;ACyBO,IAAM,eAAA,EAAiB,CAC5B,MAAA,EAAA,GAEA,OAAA,IAAW,KAAA,EAAA,GAAA,CACV,OAAO,OAAA,IAAW,SAAA,GAChB,OAAA,GAAU,OAAA,GACT,MAAA,CAAO,KAAA,IAAS,KAAA,EAAA,GAChB,OAAO,MAAA,CAAO,KAAA,IAAS,QAAA,CAAA;AD9B7B;AACA;AEDO,IAAW,iBAAA,kBAAX,CAAA,CAAWA,iBAAAA,EAAAA,GAAX;AACL,EAAAA,iBAAAA,CAAA,uBAAA,EAAA,EAAwB,uBAAA;AACxB,EAAAA,iBAAAA,CAAA,uBAAA,EAAA,EAAwB,uBAAA;AACxB,EAAAA,iBAAAA,CAAA,wBAAA,EAAA,EAAyB,wBAAA;AAHT,EAAA,OAAAA,iBAAAA;AAAA,CAAA,CAAA,CAAA,iBAAA,GAAA,CAAA,CAAA,CAAA;AAMX,IAAM,SAAA,EAAW,CAAC,GAAA,EAAA,GACvB,OAAO,IAAA,IAAQ,SAAA,GAAY,IAAA,IAAQ,GAAA;AAG9B,IAAM,SAAA,EAAW,CAAC,GAAA,EAAA,GACvB,OAAO,IAAA,IAAQ,SAAA,GAAY,IAAA,IAAQ,GAAA;AAE9B,I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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/emmett/emmett/src/packages/emmett/dist/chunk-WND32L6P.cjs","sourcesContent":[null,"export type EmmettPluginConfig =\n | {\n name: string;\n register: EmmettPluginRegistration[];\n }\n | string;\n\nexport type EmmettPluginType = 'cli';\n\nexport type EmmettCliPluginRegistration = { pluginType: 'cli'; path?: string };\n\nexport type EmmettPluginRegistration = EmmettCliPluginRegistration;\n\nexport type EmmettCliCommand = {\n addCommand<CliCommand>(command: CliCommand): CliCommand;\n};\n\nexport type EmmettCliPlugin = {\n pluginType: 'cli';\n name: string;\n registerCommands: (program: EmmettCliCommand) => Promise<void> | void;\n};\n\nexport type EmmettPlugin = EmmettCliPlugin;\n\nexport const isPluginConfig = (\n plugin: Partial<EmmettPluginConfig> | string | undefined,\n): plugin is EmmettPluginConfig =>\n plugin !== undefined &&\n (typeof plugin === 'string' ||\n ('name' in plugin &&\n plugin.name !== undefined &&\n typeof plugin.name === 'string'));\n","import { ValidationError } from '../errors';\n\nexport const enum ValidationErrors {\n NOT_A_NONEMPTY_STRING = 'NOT_A_NONEMPTY_STRING',\n NOT_A_POSITIVE_NUMBER = 'NOT_A_POSITIVE_NUMBER',\n NOT_AN_UNSIGNED_BIGINT = 'NOT_AN_UNSIGNED_BIGINT',\n}\n\nexport const isNumber = (val: unknown): val is number =>\n typeof val === 'number' && val === val;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isBigint = (val: any): val is bigint =>\n typeof val === 'bigint' && val === val;\n\nexport const isString = (val: unknown): val is string =>\n typeof val === 'string';\n\nexport const assertNotEmptyString = (value: unknown): string => {\n if (!isString(value) || value.length === 0) {\n throw new ValidationError(ValidationErrors.NOT_A_NONEMPTY_STRING);\n }\n return value;\n};\n\nexport const assertPositiveNumber = (value: unknown): number => {\n if (!isNumber(value) || value <= 0) {\n throw new ValidationError(ValidationErrors.NOT_A_POSITIVE_NUMBER);\n }\n return value;\n};\n\nexport const assertUnsignedBigInt = (value: string): bigint => {\n const number = BigInt(value);\n if (number < 0) {\n throw new ValidationError(ValidationErrors.NOT_AN_UNSIGNED_BIGINT);\n }\n return number;\n};\n\nexport * from './dates';\n","import { isNumber, isString } from '../validation';\n\nexport type ErrorConstructor<ErrorType extends Error> = new (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n) => ErrorType;\n\nexport const isErrorConstructor = <ErrorType extends Error>(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n expect: Function,\n): expect is ErrorConstructor<ErrorType> => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return (\n typeof expect === 'function' &&\n expect.prototype &&\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n expect.prototype.constructor === expect\n );\n};\n\nexport class EmmettError extends Error {\n public static readonly Codes = {\n ValidationError: 400,\n IllegalStateError: 403,\n NotFoundError: 404,\n ConcurrencyError: 412,\n InternalServerError: 500,\n };\n\n public errorCode: number;\n\n constructor(\n options?: { errorCode: number; message?: string } | string | number,\n ) {\n const errorCode =\n options && typeof options === 'object' && 'errorCode' in options\n ? options.errorCode\n : isNumber(options)\n ? options\n : EmmettError.Codes.InternalServerError;\n const message =\n options && typeof options === 'object' && 'message' in options\n ? options.message\n : isString(options)\n ? options\n : `Error with status code '${errorCode}' ocurred during Emmett processing`;\n\n super(message);\n this.errorCode = errorCode;\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, EmmettError.prototype);\n }\n\n public static mapFrom(\n error: Error | { message?: string; errorCode?: number },\n ): EmmettError {\n if (EmmettError.isInstanceOf(error)) {\n return error;\n }\n\n return new EmmettError({\n errorCode:\n 'errorCode' in error &&\n error.errorCode !== undefined &&\n error.errorCode !== null\n ? error.errorCode\n : EmmettError.Codes.InternalServerError,\n message: error.message ?? 'An unknown error occurred',\n });\n }\n\n public static isInstanceOf<ErrorType extends EmmettError = EmmettError>(\n error: unknown,\n errorCode?: (typeof EmmettError.Codes)[keyof typeof EmmettError.Codes],\n ): error is ErrorType {\n return (\n typeof error === 'object' &&\n error !== null &&\n 'errorCode' in error &&\n isNumber(error.errorCode) &&\n (errorCode === undefined || error.errorCode === errorCode)\n );\n }\n}\n\nexport class ConcurrencyError extends EmmettError {\n constructor(\n public current: string | undefined,\n public expected: string,\n message?: string,\n ) {\n super({\n errorCode: EmmettError.Codes.ConcurrencyError,\n message:\n message ??\n `Expected version ${expected.toString()} does not match current ${current?.toString()}`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, ConcurrencyError.prototype);\n }\n}\n\n// TODO: Make it derive from ConcurrencyError to avoid code duplication\n// Or add additional type to distinguinsh both errors\nexport class ConcurrencyInMemoryDatabaseError extends EmmettError {\n constructor(message?: string) {\n super({\n errorCode: EmmettError.Codes.ConcurrencyError,\n message: message ?? `Expected document state does not match current one!`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, ConcurrencyInMemoryDatabaseError.prototype);\n }\n}\n\nexport class ValidationError extends EmmettError {\n constructor(message?: string) {\n super({\n errorCode: EmmettError.Codes.ValidationError,\n message: message ?? `Validation Error ocurred during Emmett processing`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\nexport class IllegalStateError extends EmmettError {\n constructor(message?: string) {\n super({\n errorCode: EmmettError.Codes.IllegalStateError,\n message: message ?? `Illegal State ocurred during Emmett processing`,\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, IllegalStateError.prototype);\n }\n}\n\nexport class NotFoundError extends EmmettError {\n constructor(options?: { id: string; type: string; message?: string }) {\n super({\n errorCode: EmmettError.Codes.NotFoundError,\n message:\n options?.message ??\n (options?.id\n ? options.type\n ? `${options.type} with ${options.id} was not found during Emmett processing`\n : `State with ${options.id} was not found during Emmett processing`\n : options?.type\n ? `${options.type} was not found during Emmett processing`\n : 'State was not found during Emmett processing'),\n });\n\n // 👇️ because we are extending a built-in class\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { ValidationError } from '../errors';\n\nexport const formatDateToUtcYYYYMMDD = (date: Date) => {\n // Use the 'en-CA' locale which formats as 'yyyy-mm-dd'\n const formatter = new Intl.DateTimeFormat('en-CA', {\n timeZone: 'UTC',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n });\n\n // Format the date\n return formatter.format(date);\n};\n\n// Function to validate 'yyyy-mm-dd' format\nexport const isValidYYYYMMDD = (dateString: string) => {\n const regex = /^\\d{4}-\\d{2}-\\d{2}$/;\n return regex.test(dateString);\n};\n\nexport const parseDateFromUtcYYYYMMDD = (dateString: string) => {\n const date = new Date(dateString + 'T00:00:00Z');\n\n if (!isValidYYYYMMDD(dateString)) {\n throw new ValidationError('Invalid date format, must be yyyy-mm-dd');\n }\n\n if (isNaN(date.getTime())) {\n throw new ValidationError('Invalid date format');\n }\n\n return date;\n};\n"]}
|
package/dist/cli.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkWND32L6Pcjs = require('./chunk-WND32L6P.cjs');
|
|
6
6
|
|
|
7
7
|
// src/cli.ts
|
|
8
8
|
var _commander = require('commander');
|
|
@@ -86,15 +86,15 @@ var importPluginsConfig = async (options) => {
|
|
|
86
86
|
try {
|
|
87
87
|
const imported = await Promise.resolve().then(() => _interopRequireWildcard(require(configPath)));
|
|
88
88
|
if (!imported.default) {
|
|
89
|
-
return new (0,
|
|
89
|
+
return new (0, _chunkWND32L6Pcjs.EmmettError)(PluginsConfigImportError.missingDefaultExport);
|
|
90
90
|
}
|
|
91
91
|
if (!imported.default.plugins || !Array.isArray(imported.default.plugins)) {
|
|
92
|
-
return new (0,
|
|
92
|
+
return new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
93
93
|
PluginsConfigImportError.missingPluginsPropertyExport
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
if (!imported.default.plugins.every(
|
|
97
|
-
return new (0,
|
|
96
|
+
if (!imported.default.plugins.every(_chunkWND32L6Pcjs.isPluginConfig)) {
|
|
97
|
+
return new (0, _chunkWND32L6Pcjs.EmmettError)(PluginsConfigImportError.wrongPluginStructure);
|
|
98
98
|
}
|
|
99
99
|
return { plugins: imported.default.plugins };
|
|
100
100
|
} catch (error) {
|
|
@@ -102,7 +102,7 @@ var importPluginsConfig = async (options) => {
|
|
|
102
102
|
console.warn("Didn`t find config file: " + configPath, error);
|
|
103
103
|
return { plugins: [] };
|
|
104
104
|
}
|
|
105
|
-
return new (0,
|
|
105
|
+
return new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
106
106
|
`Error: Couldn't load file:` + error.toString()
|
|
107
107
|
);
|
|
108
108
|
}
|
|
@@ -112,7 +112,7 @@ var loadPlugins = async (options) => {
|
|
|
112
112
|
const pluginsConfig = await importPluginsConfig({
|
|
113
113
|
configPath: _optionalChain([options, 'optionalAccess', _3 => _3.configPath])
|
|
114
114
|
});
|
|
115
|
-
if (pluginsConfig instanceof
|
|
115
|
+
if (pluginsConfig instanceof _chunkWND32L6Pcjs.EmmettError) throw pluginsConfig;
|
|
116
116
|
if (pluginsConfig.plugins.length === 0) {
|
|
117
117
|
console.log(`No extensions specified in config ${_optionalChain([options, 'optionalAccess', _4 => _4.configPath])}.`);
|
|
118
118
|
return [];
|
package/dist/cli.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import { E as EmmettPluginsConfig, a as EmmettError, b as EmmettPluginType, c as EmmettPlugin, d as EmmettCliPlugin } from './index-
|
|
3
|
+
import { E as EmmettPluginsConfig, a as EmmettError, b as EmmettPluginType, c as EmmettPlugin, d as EmmettCliPlugin } from './index-Amos00J7.cjs';
|
|
4
4
|
|
|
5
5
|
declare const sampleConfig: (plugins?: string[]) => string;
|
|
6
6
|
declare const generateConfigFile: (configPath: string, collectionNames: string[]) => void;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import { E as EmmettPluginsConfig, a as EmmettError, b as EmmettPluginType, c as EmmettPlugin, d as EmmettCliPlugin } from './index-
|
|
3
|
+
import { E as EmmettPluginsConfig, a as EmmettError, b as EmmettPluginType, c as EmmettPlugin, d as EmmettCliPlugin } from './index-Amos00J7.js';
|
|
4
4
|
|
|
5
5
|
declare const sampleConfig: (plugins?: string[]) => string;
|
|
6
6
|
declare const generateConfigFile: (configPath: string, collectionNames: string[]) => void;
|
package/dist/cli.js
CHANGED
|
@@ -26,6 +26,13 @@ type EmmettPluginsConfig = {
|
|
|
26
26
|
type ErrorConstructor<ErrorType extends Error> = new (...args: any[]) => ErrorType;
|
|
27
27
|
declare const isErrorConstructor: <ErrorType extends Error>(expect: Function) => expect is ErrorConstructor<ErrorType>;
|
|
28
28
|
declare class EmmettError extends Error {
|
|
29
|
+
static readonly Codes: {
|
|
30
|
+
ValidationError: number;
|
|
31
|
+
IllegalStateError: number;
|
|
32
|
+
NotFoundError: number;
|
|
33
|
+
ConcurrencyError: number;
|
|
34
|
+
InternalServerError: number;
|
|
35
|
+
};
|
|
29
36
|
errorCode: number;
|
|
30
37
|
constructor(options?: {
|
|
31
38
|
errorCode: number;
|
|
@@ -35,6 +42,7 @@ declare class EmmettError extends Error {
|
|
|
35
42
|
message?: string;
|
|
36
43
|
errorCode?: number;
|
|
37
44
|
}): EmmettError;
|
|
45
|
+
static isInstanceOf<ErrorType extends EmmettError = EmmettError>(error: unknown, errorCode?: (typeof EmmettError.Codes)[keyof typeof EmmettError.Codes]): error is ErrorType;
|
|
38
46
|
}
|
|
39
47
|
declare class ConcurrencyError extends EmmettError {
|
|
40
48
|
current: string | undefined;
|
|
@@ -26,6 +26,13 @@ type EmmettPluginsConfig = {
|
|
|
26
26
|
type ErrorConstructor<ErrorType extends Error> = new (...args: any[]) => ErrorType;
|
|
27
27
|
declare const isErrorConstructor: <ErrorType extends Error>(expect: Function) => expect is ErrorConstructor<ErrorType>;
|
|
28
28
|
declare class EmmettError extends Error {
|
|
29
|
+
static readonly Codes: {
|
|
30
|
+
ValidationError: number;
|
|
31
|
+
IllegalStateError: number;
|
|
32
|
+
NotFoundError: number;
|
|
33
|
+
ConcurrencyError: number;
|
|
34
|
+
InternalServerError: number;
|
|
35
|
+
};
|
|
29
36
|
errorCode: number;
|
|
30
37
|
constructor(options?: {
|
|
31
38
|
errorCode: number;
|
|
@@ -35,6 +42,7 @@ declare class EmmettError extends Error {
|
|
|
35
42
|
message?: string;
|
|
36
43
|
errorCode?: number;
|
|
37
44
|
}): EmmettError;
|
|
45
|
+
static isInstanceOf<ErrorType extends EmmettError = EmmettError>(error: unknown, errorCode?: (typeof EmmettError.Codes)[keyof typeof EmmettError.Codes]): error is ErrorType;
|
|
38
46
|
}
|
|
39
47
|
declare class ConcurrencyError extends EmmettError {
|
|
40
48
|
current: string | undefined;
|
package/dist/index.cjs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkWND32L6Pcjs = require('./chunk-WND32L6P.cjs');
|
|
21
21
|
|
|
22
22
|
// src/typing/command.ts
|
|
23
23
|
var command = (...args) => {
|
|
@@ -140,13 +140,16 @@ var assertExpectedVersionMatchesCurrent = (current, expected, defaultVersion) =>
|
|
|
140
140
|
if (!matchesExpectedVersion(current, expected, defaultVersion))
|
|
141
141
|
throw new ExpectedVersionConflictError(current, expected);
|
|
142
142
|
};
|
|
143
|
-
var ExpectedVersionConflictError = class _ExpectedVersionConflictError extends
|
|
143
|
+
var ExpectedVersionConflictError = class _ExpectedVersionConflictError extends _chunkWND32L6Pcjs.ConcurrencyError {
|
|
144
144
|
constructor(current, expected) {
|
|
145
145
|
super(_optionalChain([current, 'optionalAccess', _7 => _7.toString, 'call', _8 => _8()]), _optionalChain([expected, 'optionalAccess', _9 => _9.toString, 'call', _10 => _10()]));
|
|
146
146
|
Object.setPrototypeOf(this, _ExpectedVersionConflictError.prototype);
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
-
var isExpectedVersionConflictError = (error2) => error2 instanceof ExpectedVersionConflictError
|
|
149
|
+
var isExpectedVersionConflictError = (error2) => error2 instanceof ExpectedVersionConflictError || _chunkWND32L6Pcjs.EmmettError.isInstanceOf(
|
|
150
|
+
error2,
|
|
151
|
+
ExpectedVersionConflictError.Codes.ConcurrencyError
|
|
152
|
+
);
|
|
150
153
|
|
|
151
154
|
// src/eventStore/inMemoryEventStore.ts
|
|
152
155
|
var _uuid = require('uuid');
|
|
@@ -423,7 +426,7 @@ var TaskProcessor = (_class = class {
|
|
|
423
426
|
enqueue(task, options) {
|
|
424
427
|
if (this.queue.length >= this.options.maxQueueSize) {
|
|
425
428
|
return Promise.reject(
|
|
426
|
-
new (0,
|
|
429
|
+
new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
427
430
|
"Too many pending connections. Please try again later."
|
|
428
431
|
)
|
|
429
432
|
);
|
|
@@ -633,7 +636,7 @@ var asyncRetry = async (fn, opts) => {
|
|
|
633
636
|
try {
|
|
634
637
|
const result = await fn();
|
|
635
638
|
if (_optionalChain([opts, 'optionalAccess', _27 => _27.shouldRetryResult]) && opts.shouldRetryResult(result)) {
|
|
636
|
-
throw new (0,
|
|
639
|
+
throw new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
637
640
|
`Retrying because of result: ${JSONParser.stringify(result)}`
|
|
638
641
|
);
|
|
639
642
|
}
|
|
@@ -664,7 +667,7 @@ var operationResult = (result, options) => {
|
|
|
664
667
|
const { successful } = result;
|
|
665
668
|
const { operationName, collectionName } = options;
|
|
666
669
|
if (!successful)
|
|
667
|
-
throw new (0,
|
|
670
|
+
throw new (0, _chunkWND32L6Pcjs.ConcurrencyInMemoryDatabaseError)(
|
|
668
671
|
_nullishCoalesce(errorMessage, () => ( `${operationName} on ${collectionName} failed. Expected document state does not match current one! Result: ${JSONParser.stringify(result)}!`))
|
|
669
672
|
);
|
|
670
673
|
}
|
|
@@ -1312,7 +1315,7 @@ function thenNothingHappensHandler(events) {
|
|
|
1312
1315
|
function thenThrowsErrorHandler(error2, args) {
|
|
1313
1316
|
if (error2 instanceof AssertionError) throw error2;
|
|
1314
1317
|
if (args.length === 0) return;
|
|
1315
|
-
if (!
|
|
1318
|
+
if (!_chunkWND32L6Pcjs.isErrorConstructor.call(void 0, args[0])) {
|
|
1316
1319
|
assertTrue(
|
|
1317
1320
|
args[0](error2),
|
|
1318
1321
|
`Error didn't match the error condition: ${_optionalChain([error2, 'optionalAccess', _61 => _61.toString, 'call', _62 => _62()])}`
|
|
@@ -1451,7 +1454,7 @@ var InMemoryProjectionSpec = {
|
|
|
1451
1454
|
} catch (error2) {
|
|
1452
1455
|
if (error2 instanceof AssertionError) throw error2;
|
|
1453
1456
|
if (args.length === 0) return;
|
|
1454
|
-
if (!
|
|
1457
|
+
if (!_chunkWND32L6Pcjs.isErrorConstructor.call(void 0, args[0])) {
|
|
1455
1458
|
assertTrue(
|
|
1456
1459
|
args[0](error2),
|
|
1457
1460
|
`Error didn't match the error condition: ${_optionalChain([error2, 'optionalAccess', _70 => _70.toString, 'call', _71 => _71()])}`
|
|
@@ -1728,7 +1731,7 @@ var getInMemoryMessageBus = () => {
|
|
|
1728
1731
|
send: async (command2) => {
|
|
1729
1732
|
const handlers = allHandlers.get(command2.type);
|
|
1730
1733
|
if (handlers === void 0 || handlers.length === 0)
|
|
1731
|
-
throw new (0,
|
|
1734
|
+
throw new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
1732
1735
|
`No handler registered for command ${command2.type}!`
|
|
1733
1736
|
);
|
|
1734
1737
|
const commandHandler = handlers[0];
|
|
@@ -1749,7 +1752,7 @@ var getInMemoryMessageBus = () => {
|
|
|
1749
1752
|
(registered) => commandTypes.includes(registered)
|
|
1750
1753
|
);
|
|
1751
1754
|
if (alreadyRegistered.length > 0)
|
|
1752
|
-
throw new (0,
|
|
1755
|
+
throw new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
1753
1756
|
`Cannot register handler for commands ${alreadyRegistered.join(", ")} as they're already registered!`
|
|
1754
1757
|
);
|
|
1755
1758
|
for (const commandType of commandTypes) {
|
|
@@ -1778,15 +1781,15 @@ var getInMemoryMessageBus = () => {
|
|
|
1778
1781
|
// src/processors/processors.ts
|
|
1779
1782
|
var getCheckpoint = (message2) => {
|
|
1780
1783
|
return "checkpoint" in message2.metadata && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1781
|
-
|
|
1784
|
+
_chunkWND32L6Pcjs.isBigint.call(void 0, message2.metadata.checkpoint) ? (
|
|
1782
1785
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1783
1786
|
message2.metadata.checkpoint
|
|
1784
1787
|
) : "globalPosition" in message2.metadata && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1785
|
-
|
|
1788
|
+
_chunkWND32L6Pcjs.isBigint.call(void 0, message2.metadata.globalPosition) ? (
|
|
1786
1789
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1787
1790
|
message2.metadata.globalPosition
|
|
1788
1791
|
) : "streamPosition" in message2.metadata && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1789
|
-
|
|
1792
|
+
_chunkWND32L6Pcjs.isBigint.call(void 0, message2.metadata.streamPosition) ? (
|
|
1790
1793
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1791
1794
|
message2.metadata.streamPosition
|
|
1792
1795
|
) : null;
|
|
@@ -1954,7 +1957,7 @@ var inMemoryProcessingScope = (options) => {
|
|
|
1954
1957
|
const processingScope = (handler, partialContext) => {
|
|
1955
1958
|
const database = _nullishCoalesce(processorDatabase, () => ( _optionalChain([partialContext, 'optionalAccess', _110 => _110.database])));
|
|
1956
1959
|
if (!database)
|
|
1957
|
-
throw new (0,
|
|
1960
|
+
throw new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
1958
1961
|
`InMemory processor '${options.processorId}' is missing database. Ensure that you passed it through options`
|
|
1959
1962
|
);
|
|
1960
1963
|
return handler({ ...partialContext, database });
|
|
@@ -2012,7 +2015,7 @@ var filterProjections = (type, projections2) => {
|
|
|
2012
2015
|
(proj) => proj.name
|
|
2013
2016
|
);
|
|
2014
2017
|
if (duplicateRegistrations.length > 0) {
|
|
2015
|
-
throw new (0,
|
|
2018
|
+
throw new (0, _chunkWND32L6Pcjs.EmmettError)(`You cannot register multiple projections with the same name (or without the name).
|
|
2016
2019
|
Ensure that:
|
|
2017
2020
|
${JSONParser.stringify(duplicateRegistrations)}
|
|
2018
2021
|
have different names`);
|
|
@@ -2149,5 +2152,5 @@ var projections = {
|
|
|
2149
2152
|
|
|
2150
2153
|
|
|
2151
2154
|
|
|
2152
|
-
exports.AssertionError = AssertionError; exports.CommandHandler = CommandHandler; exports.CommandHandlerStreamVersionConflictRetryOptions = CommandHandlerStreamVersionConflictRetryOptions; exports.ConcurrencyError =
|
|
2155
|
+
exports.AssertionError = AssertionError; exports.CommandHandler = CommandHandler; exports.CommandHandlerStreamVersionConflictRetryOptions = CommandHandlerStreamVersionConflictRetryOptions; exports.ConcurrencyError = _chunkWND32L6Pcjs.ConcurrencyError; exports.ConcurrencyInMemoryDatabaseError = _chunkWND32L6Pcjs.ConcurrencyInMemoryDatabaseError; exports.DATABASE_REQUIRED_ERROR_MESSAGE = DATABASE_REQUIRED_ERROR_MESSAGE; exports.DeciderCommandHandler = DeciderCommandHandler; exports.DeciderSpecification = DeciderSpecification; exports.EmmettError = _chunkWND32L6Pcjs.EmmettError; exports.ExpectedVersionConflictError = ExpectedVersionConflictError; exports.GlobalStreamCaughtUpType = GlobalStreamCaughtUpType; exports.IllegalStateError = _chunkWND32L6Pcjs.IllegalStateError; exports.InMemoryEventStoreDefaultStreamVersion = InMemoryEventStoreDefaultStreamVersion; exports.InMemoryProjectionSpec = InMemoryProjectionSpec; exports.InProcessLock = InProcessLock; exports.JSONParser = JSONParser; exports.MessageProcessor = MessageProcessor; exports.MessageProcessorType = MessageProcessorType; exports.NO_CONCURRENCY_CHECK = NO_CONCURRENCY_CHECK; exports.NoRetries = NoRetries; exports.NotFoundError = _chunkWND32L6Pcjs.NotFoundError; exports.ParseError = ParseError; exports.STREAM_DOES_NOT_EXIST = STREAM_DOES_NOT_EXIST; exports.STREAM_EXISTS = STREAM_EXISTS; exports.TaskProcessor = TaskProcessor; exports.ValidationError = _chunkWND32L6Pcjs.ValidationError; exports.ValidationErrors = _chunkWND32L6Pcjs.ValidationErrors; exports.WrapEventStore = WrapEventStore; exports.accept = accept; exports.argMatches = argMatches; exports.argValue = argValue; exports.arrayUtils = arrayUtils; exports.assertDeepEqual = assertDeepEqual; exports.assertDoesNotThrow = assertDoesNotThrow; exports.assertEqual = assertEqual; exports.assertExpectedVersionMatchesCurrent = assertExpectedVersionMatchesCurrent; exports.assertFails = assertFails; exports.assertFalse = assertFalse; exports.assertIsNotNull = assertIsNotNull; exports.assertIsNull = assertIsNull; exports.assertMatches = assertMatches; exports.assertNotDeepEqual = assertNotDeepEqual; exports.assertNotEmptyString = _chunkWND32L6Pcjs.assertNotEmptyString; exports.assertNotEqual = assertNotEqual; exports.assertOk = assertOk; exports.assertPositiveNumber = _chunkWND32L6Pcjs.assertPositiveNumber; exports.assertRejects = assertRejects; exports.assertThat = assertThat; exports.assertThatArray = assertThatArray; exports.assertThrows = assertThrows; exports.assertThrowsAsync = assertThrowsAsync; exports.assertTrue = assertTrue; exports.assertUnsignedBigInt = _chunkWND32L6Pcjs.assertUnsignedBigInt; exports.asyncAwaiter = asyncAwaiter; exports.asyncProjections = asyncProjections; exports.asyncRetry = asyncRetry; exports.canCreateEventStoreSession = canCreateEventStoreSession; exports.caughtUpEventFrom = caughtUpEventFrom; exports.command = command; exports.complete = complete; exports.deepEquals = deepEquals; exports.defaultProcessingMessageProcessingScope = defaultProcessingMessageProcessingScope; exports.delay = delay; exports.documentExists = documentExists; exports.error = error; exports.event = event; exports.eventInStream = eventInStream; exports.eventsInStream = eventsInStream; exports.expectInMemoryDocuments = expectInMemoryDocuments; exports.filterProjections = filterProjections; exports.formatDateToUtcYYYYMMDD = _chunkWND32L6Pcjs.formatDateToUtcYYYYMMDD; exports.forwardToMessageBus = forwardToMessageBus; exports.getCheckpoint = getCheckpoint; exports.getInMemoryDatabase = getInMemoryDatabase; exports.getInMemoryEventStore = getInMemoryEventStore; exports.getInMemoryMessageBus = getInMemoryMessageBus; exports.globalStreamCaughtUp = globalStreamCaughtUp; exports.handleInMemoryProjections = handleInMemoryProjections; exports.ignore = ignore; exports.inMemoryCheckpointer = inMemoryCheckpointer; exports.inMemoryMultiStreamProjection = inMemoryMultiStreamProjection; exports.inMemoryProjection = inMemoryProjection; exports.inMemoryProjector = inMemoryProjector; exports.inMemoryReactor = inMemoryReactor; exports.inMemorySingleStreamProjection = inMemorySingleStreamProjection; exports.inlineProjections = inlineProjections; exports.isBigint = _chunkWND32L6Pcjs.isBigint; exports.isEquatable = isEquatable; exports.isErrorConstructor = _chunkWND32L6Pcjs.isErrorConstructor; exports.isExpectedVersionConflictError = isExpectedVersionConflictError; exports.isGlobalStreamCaughtUp = isGlobalStreamCaughtUp; exports.isNotInternalEvent = isNotInternalEvent; exports.isNumber = _chunkWND32L6Pcjs.isNumber; exports.isPluginConfig = _chunkWND32L6Pcjs.isPluginConfig; exports.isString = _chunkWND32L6Pcjs.isString; exports.isSubscriptionEvent = isSubscriptionEvent; exports.isSubset = isSubset; exports.isValidYYYYMMDD = _chunkWND32L6Pcjs.isValidYYYYMMDD; exports.matchesExpectedVersion = matchesExpectedVersion; exports.merge = merge; exports.message = message; exports.newEventsInStream = newEventsInStream; exports.nulloSessionFactory = nulloSessionFactory; exports.parseDateFromUtcYYYYMMDD = _chunkWND32L6Pcjs.parseDateFromUtcYYYYMMDD; exports.projection = projection; exports.projections = projections; exports.projector = projector; exports.publish = publish; exports.reactor = reactor; exports.reply = reply; exports.schedule = schedule; exports.send = send; exports.sum = sum; exports.tryPublishMessagesAfterCommit = tryPublishMessagesAfterCommit; exports.verifyThat = verifyThat; exports.wasMessageHandled = wasMessageHandled;
|
|
2153
2156
|
//# sourceMappingURL=index.cjs.map
|