@warlock.js/notifications 5.26.0 → 5.28.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.
- package/CHANGELOG.md +12 -0
- package/cjs/index.cjs +1 -1
- package/cjs/rabbitmq-driver-CYeFwv0w.cjs +3 -0
- package/cjs/{src-BVlqtCR2.cjs → src-B6UVThgW.cjs} +26 -11
- package/cjs/src-B6UVThgW.cjs.map +1 -0
- package/esm/node_modules/.pnpm/{@mongez_supportive-is@2.1.5 → @mongez_supportive-is@3.0.0}/node_modules/@mongez/supportive-is/esm/index.mjs +8 -3
- package/esm/node_modules/.pnpm/@mongez_supportive-is@3.0.0/node_modules/@mongez/supportive-is/esm/index.mjs.map +1 -0
- package/esm/seal/src/helpers/is-empty-value.mjs +1 -1
- package/esm/seal/src/mutators/number-mutators.mjs +1 -1
- package/esm/seal/src/mutators/object-mutators.mjs +1 -1
- package/esm/seal/src/rules/common/type-rules.mjs +1 -1
- package/esm/seal/src/rules/string/email.mjs +1 -1
- package/esm/seal/src/validators/discriminated-union-validator.mjs +6 -2
- package/esm/seal/src/validators/discriminated-union-validator.mjs.map +1 -1
- package/esm/seal/src/validators/numeric-validator.mjs +1 -1
- package/esm/seal/src/validators/object-validator.mjs +12 -6
- package/esm/seal/src/validators/object-validator.mjs.map +1 -1
- package/esm/seal/src/validators/record-validator.mjs +1 -1
- package/llms.txt +8 -8
- package/package.json +7 -7
- package/cjs/rabbitmq-driver-DvWaCPES.cjs +0 -3
- package/cjs/src-BVlqtCR2.cjs.map +0 -1
- package/esm/node_modules/.pnpm/@mongez_supportive-is@2.1.5/node_modules/@mongez/supportive-is/esm/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to `@warlock.js/notifications` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 5.28.0 - 2026-10-01
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Lockstep release; package APIs are unchanged. `llms.txt` now lists every skill topic with its description (frontmatter in CRLF files was skipped).
|
|
12
|
+
|
|
13
|
+
## 5.27.0 - 2026-10-01
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Lockstep release; package APIs are unchanged.
|
|
18
|
+
|
|
7
19
|
## 5.26.0 - 2026-09-30
|
|
8
20
|
|
|
9
21
|
### Changed
|
package/cjs/index.cjs
CHANGED
|
@@ -988,7 +988,7 @@ Or with your preferred package manager:
|
|
|
988
988
|
async function loadHerald() {
|
|
989
989
|
if (heraldModule) return heraldModule;
|
|
990
990
|
try {
|
|
991
|
-
heraldModule = await Promise.resolve().then(() => require("./src-
|
|
991
|
+
heraldModule = await Promise.resolve().then(() => require("./src-B6UVThgW.cjs"));
|
|
992
992
|
return heraldModule;
|
|
993
993
|
} catch {
|
|
994
994
|
throw new Error(INSTALL_INSTRUCTIONS);
|
|
@@ -707,7 +707,7 @@ const invalidRule = (rule, context) => {
|
|
|
707
707
|
};
|
|
708
708
|
|
|
709
709
|
//#endregion
|
|
710
|
-
//#region ../node_modules/.pnpm/@mongez+supportive-is@
|
|
710
|
+
//#region ../node_modules/.pnpm/@mongez+supportive-is@3.0.0/node_modules/@mongez/supportive-is/esm/index.mjs
|
|
711
711
|
/**
|
|
712
712
|
* Determine whether the given value is a number whatever if its data type is String or Number
|
|
713
713
|
*/
|
|
@@ -728,6 +728,7 @@ const isFloat = (value) => typeof value === "number" && Number.isFinite(value) &
|
|
|
728
728
|
const isRegex = (value) => Boolean(value) && value.constructor?.name === "RegExp";
|
|
729
729
|
/**
|
|
730
730
|
* Check if the given value is an object
|
|
731
|
+
* Arrays, dates and class instances are objects; `null` and functions are not
|
|
731
732
|
*/
|
|
732
733
|
const isObject = (value) => Boolean(value) && typeof value === "object";
|
|
733
734
|
/**
|
|
@@ -765,7 +766,8 @@ const isScalar = (value) => [
|
|
|
765
766
|
"bigint"
|
|
766
767
|
].includes(typeof value);
|
|
767
768
|
/**
|
|
768
|
-
* Check if the given value is a
|
|
769
|
+
* Check if the given value is a primitive value
|
|
770
|
+
* (string, boolean, number or bigint — symbols, `null` and `undefined` are not)
|
|
769
771
|
*/
|
|
770
772
|
const isPrimitive = (value) => [
|
|
771
773
|
"string",
|
|
@@ -783,6 +785,9 @@ const isPromise = (value) => Boolean(value) && value instanceof Promise;
|
|
|
783
785
|
const isDate = (value) => Boolean(value) && typeof value === "object" && value instanceof Date;
|
|
784
786
|
/**
|
|
785
787
|
* Check if the given value is a generator
|
|
788
|
+
* Duck-typed: any object with a `next()` method that is its own iterator, so
|
|
789
|
+
* the predicate is `IterableIterator` (not `Generator`, whose `return` and
|
|
790
|
+
* `throw` methods are not verified)
|
|
786
791
|
*/
|
|
787
792
|
const isGenerator = (value) => Boolean(value) && typeof value === "object" && typeof value.next === "function" && typeof value[Symbol.iterator] === "function" && value[Symbol.iterator]() === value;
|
|
788
793
|
/**
|
|
@@ -815,7 +820,7 @@ const isEmpty = (value) => {
|
|
|
815
820
|
*/
|
|
816
821
|
const isJson = (value) => {
|
|
817
822
|
if (!value || typeof value !== "string") return false;
|
|
818
|
-
if (!["[", "{"].includes(value
|
|
823
|
+
if (!["[", "{"].includes(value[0])) return false;
|
|
819
824
|
try {
|
|
820
825
|
JSON.parse(value);
|
|
821
826
|
return true;
|
|
@@ -7652,6 +7657,10 @@ var LiteralValidator = class extends BaseValidator {
|
|
|
7652
7657
|
|
|
7653
7658
|
//#endregion
|
|
7654
7659
|
//#region ../seal/src/validators/discriminated-union-validator.ts
|
|
7660
|
+
/** Whether a value read from the payload can be a discriminator key. */
|
|
7661
|
+
function isDiscriminatorValue(value) {
|
|
7662
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
7663
|
+
}
|
|
7655
7664
|
/**
|
|
7656
7665
|
* Discriminated union validator — routes payloads by a shared discriminator field.
|
|
7657
7666
|
*
|
|
@@ -7731,7 +7740,7 @@ var DiscriminatedUnionValidator = class DiscriminatedUnionValidator extends Base
|
|
|
7731
7740
|
data: void 0
|
|
7732
7741
|
};
|
|
7733
7742
|
const discriminatorValue = data[this.discriminator];
|
|
7734
|
-
const branch = this.branches.get(discriminatorValue);
|
|
7743
|
+
const branch = isDiscriminatorValue(discriminatorValue) ? this.branches.get(discriminatorValue) : void 0;
|
|
7735
7744
|
if (!branch) {
|
|
7736
7745
|
const allowed = [...this.branches.keys()].map((k) => String(k)).join(", ");
|
|
7737
7746
|
return {
|
|
@@ -8618,7 +8627,8 @@ var ObjectValidator = class ObjectValidator extends BaseValidator {
|
|
|
8618
8627
|
if (mutatedData === void 0 || mutatedData === null) return result;
|
|
8619
8628
|
const errors = [];
|
|
8620
8629
|
const validatedData = {};
|
|
8621
|
-
const
|
|
8630
|
+
const fieldErrors = [];
|
|
8631
|
+
const validationPromises = Object.entries(this.schema).filter(([, validator]) => !this.isComputedValidator(validator)).map(async ([key, validator], index) => {
|
|
8622
8632
|
const value = mutatedData?.[key] !== void 0 ? mutatedData[key] : validator.getDefaultValue();
|
|
8623
8633
|
const childContext = {
|
|
8624
8634
|
...context,
|
|
@@ -8629,16 +8639,18 @@ var ObjectValidator = class ObjectValidator extends BaseValidator {
|
|
|
8629
8639
|
};
|
|
8630
8640
|
const childResult = await validator.validate(value, childContext);
|
|
8631
8641
|
if (childResult.data !== void 0 && !validator.isOmitted()) validatedData[key] = childResult.data;
|
|
8632
|
-
if (childResult.isValid === false)
|
|
8642
|
+
if (childResult.isValid === false) fieldErrors[index] = childResult.errors;
|
|
8633
8643
|
});
|
|
8634
8644
|
await Promise.all(validationPromises);
|
|
8645
|
+
for (const childErrors of fieldErrors) if (childErrors) errors.push(...childErrors);
|
|
8635
8646
|
if (errors.length > 0) return {
|
|
8636
8647
|
isValid: false,
|
|
8637
8648
|
errors,
|
|
8638
8649
|
data: void 0
|
|
8639
8650
|
};
|
|
8640
8651
|
const computedFields = this.getComputedFields();
|
|
8641
|
-
const
|
|
8652
|
+
const computedErrors = [];
|
|
8653
|
+
const computedPromises = Object.entries(computedFields).map(async ([key, validator], index) => {
|
|
8642
8654
|
const childContext = {
|
|
8643
8655
|
...context,
|
|
8644
8656
|
parent: validatedData,
|
|
@@ -8646,15 +8658,18 @@ var ObjectValidator = class ObjectValidator extends BaseValidator {
|
|
|
8646
8658
|
};
|
|
8647
8659
|
const childResult = await validator.validate(validatedData, childContext);
|
|
8648
8660
|
if (childResult.data !== void 0 && !validator.isOmitted()) validatedData[key] = childResult.data;
|
|
8649
|
-
if (childResult.isValid === false)
|
|
8661
|
+
if (childResult.isValid === false) computedErrors[index] = childResult.errors;
|
|
8650
8662
|
});
|
|
8651
8663
|
await Promise.all(computedPromises);
|
|
8664
|
+
for (const childErrors of computedErrors) if (childErrors) errors.push(...childErrors);
|
|
8652
8665
|
if (errors.length > 0) return {
|
|
8653
8666
|
isValid: false,
|
|
8654
8667
|
errors,
|
|
8655
8668
|
data: void 0
|
|
8656
8669
|
};
|
|
8657
|
-
const
|
|
8670
|
+
const orderedData = {};
|
|
8671
|
+
for (const key of Object.keys(this.schema)) if (key in validatedData) orderedData[key] = validatedData[key];
|
|
8672
|
+
const cleanedData = removeUndefinedValues(orderedData);
|
|
8658
8673
|
const transformedData = await this.startTransformationPipeline(cleanedData, context);
|
|
8659
8674
|
return {
|
|
8660
8675
|
isValid: true,
|
|
@@ -10810,7 +10825,7 @@ async function connectToBroker(options) {
|
|
|
10810
10825
|
switch (driverType) {
|
|
10811
10826
|
case "rabbitmq": {
|
|
10812
10827
|
const rabbitOptions = options;
|
|
10813
|
-
const { RabbitMQDriver } = await Promise.resolve().then(() => require("./rabbitmq-driver-
|
|
10828
|
+
const { RabbitMQDriver } = await Promise.resolve().then(() => require("./rabbitmq-driver-CYeFwv0w.cjs"));
|
|
10814
10829
|
driver = new RabbitMQDriver(rabbitOptions);
|
|
10815
10830
|
break;
|
|
10816
10831
|
}
|
|
@@ -11134,4 +11149,4 @@ exports.heraldChannel = heraldChannel;
|
|
|
11134
11149
|
exports.pendingSubscribers = pendingSubscribers;
|
|
11135
11150
|
exports.publishEvent = publishEvent;
|
|
11136
11151
|
exports.subscribeConsumer = subscribeConsumer;
|
|
11137
|
-
//# sourceMappingURL=src-
|
|
11152
|
+
//# sourceMappingURL=src-B6UVThgW.cjs.map
|