bailinghub 0.9.3 → 0.9.4
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/.dockerignore +1 -0
- package/.gitignore +1 -0
- package/.npmignore +1 -0
- package/Dockerfile +1 -0
- package/README.en.md +6 -6
- package/README.md +6 -6
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +7 -7
- package/docker-compose.images.yml +2 -2
- package/docs/CHANGELOG.en.md +12 -1
- package/docs/CHANGELOG.md +12 -1
- package/docs/DOCX_DEPENDENCY.en.md +26 -0
- package/docs/DOCX_DEPENDENCY.md +26 -0
- package/docs/IMPLEMENTATION_STATUS.en.md +19 -15
- package/docs/IMPLEMENTATION_STATUS.md +19 -15
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/NOTIFICATION_DURABILITY.en.md +47 -0
- package/docs/NOTIFICATION_DURABILITY.md +47 -0
- package/docs/OPERATIONS.en.md +6 -2
- package/docs/OPERATIONS.md +6 -2
- package/docs/README.en.md +4 -0
- package/docs/README.md +4 -0
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
- package/docs/RELEASE_NOTES_NEXT.md +3 -3
- package/docs/RELEASE_NOTES_v0.9.4.en.md +42 -0
- package/docs/RELEASE_NOTES_v0.9.4.md +42 -0
- package/docs/UPGRADE_v0.9.4.en.md +57 -0
- package/docs/UPGRADE_v0.9.4.md +57 -0
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +533 -0
- package/node_modules/@xmldom/xmldom/LICENSE +8 -0
- package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
- package/node_modules/@xmldom/xmldom/index.d.ts +96 -0
- package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
- package/node_modules/@xmldom/xmldom/lib/conventions.js +214 -0
- package/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
- package/node_modules/@xmldom/xmldom/lib/dom.js +2266 -0
- package/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
- package/node_modules/@xmldom/xmldom/lib/index.js +4 -0
- package/node_modules/@xmldom/xmldom/lib/sax.js +683 -0
- package/node_modules/@xmldom/xmldom/package.json +75 -0
- package/node_modules/@xmldom/xmldom/readme.md +356 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/bluebird/LICENSE +21 -0
- package/node_modules/bluebird/README.md +51 -0
- package/node_modules/bluebird/changelog.md +1 -0
- package/node_modules/bluebird/js/browser/bluebird.core.js +3739 -0
- package/node_modules/bluebird/js/browser/bluebird.core.min.js +31 -0
- package/node_modules/bluebird/js/browser/bluebird.js +5581 -0
- package/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
- package/node_modules/bluebird/js/release/any.js +21 -0
- package/node_modules/bluebird/js/release/assert.js +55 -0
- package/node_modules/bluebird/js/release/async.js +161 -0
- package/node_modules/bluebird/js/release/bind.js +67 -0
- package/node_modules/bluebird/js/release/bluebird.js +11 -0
- package/node_modules/bluebird/js/release/call_get.js +123 -0
- package/node_modules/bluebird/js/release/cancel.js +129 -0
- package/node_modules/bluebird/js/release/catch_filter.js +42 -0
- package/node_modules/bluebird/js/release/context.js +69 -0
- package/node_modules/bluebird/js/release/debuggability.js +916 -0
- package/node_modules/bluebird/js/release/direct_resolve.js +46 -0
- package/node_modules/bluebird/js/release/each.js +30 -0
- package/node_modules/bluebird/js/release/errors.js +116 -0
- package/node_modules/bluebird/js/release/es5.js +80 -0
- package/node_modules/bluebird/js/release/filter.js +12 -0
- package/node_modules/bluebird/js/release/finally.js +111 -0
- package/node_modules/bluebird/js/release/generators.js +223 -0
- package/node_modules/bluebird/js/release/join.js +168 -0
- package/node_modules/bluebird/js/release/map.js +168 -0
- package/node_modules/bluebird/js/release/method.js +55 -0
- package/node_modules/bluebird/js/release/nodeback.js +51 -0
- package/node_modules/bluebird/js/release/nodeify.js +58 -0
- package/node_modules/bluebird/js/release/promise.js +773 -0
- package/node_modules/bluebird/js/release/promise_array.js +184 -0
- package/node_modules/bluebird/js/release/promisify.js +314 -0
- package/node_modules/bluebird/js/release/props.js +118 -0
- package/node_modules/bluebird/js/release/queue.js +73 -0
- package/node_modules/bluebird/js/release/race.js +49 -0
- package/node_modules/bluebird/js/release/reduce.js +172 -0
- package/node_modules/bluebird/js/release/schedule.js +61 -0
- package/node_modules/bluebird/js/release/settle.js +43 -0
- package/node_modules/bluebird/js/release/some.js +148 -0
- package/node_modules/bluebird/js/release/synchronous_inspection.js +103 -0
- package/node_modules/bluebird/js/release/thenables.js +86 -0
- package/node_modules/bluebird/js/release/timers.js +93 -0
- package/node_modules/bluebird/js/release/using.js +226 -0
- package/node_modules/bluebird/js/release/util.js +379 -0
- package/node_modules/bluebird/package.json +76 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/dingbat-to-unicode/README.md +79 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.d.ts +8 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.js +1066 -0
- package/node_modules/dingbat-to-unicode/dist/index.d.ts +7 -0
- package/node_modules/dingbat-to-unicode/dist/index.js +44 -0
- package/node_modules/dingbat-to-unicode/package.json +39 -0
- package/node_modules/duck/LICENSE +22 -0
- package/node_modules/duck/README.md +184 -0
- package/node_modules/duck/index.js +267 -0
- package/node_modules/duck/makefile +4 -0
- package/node_modules/duck/package.json +23 -0
- package/node_modules/duck/test/duck.test.js +160 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +17 -0
- package/node_modules/jszip/CHANGES.md +204 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/deps.js +37 -0
- package/node_modules/jszip/dist/jszip.js +11577 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/graph.svg +601 -0
- package/node_modules/jszip/index.d.ts +330 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +501 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/lop/LICENSE +22 -0
- package/node_modules/lop/README.md +248 -0
- package/node_modules/lop/index.js +18 -0
- package/node_modules/lop/lib/StringSource.js +53 -0
- package/node_modules/lop/lib/Token.js +7 -0
- package/node_modules/lop/lib/TokenIterator.js +28 -0
- package/node_modules/lop/lib/bottom-up.js +128 -0
- package/node_modules/lop/lib/errors.js +22 -0
- package/node_modules/lop/lib/lazy-iterators.js +81 -0
- package/node_modules/lop/lib/parser.js +11 -0
- package/node_modules/lop/lib/parsing-results.js +103 -0
- package/node_modules/lop/lib/regex-tokeniser.js +70 -0
- package/node_modules/lop/lib/rules.js +313 -0
- package/node_modules/lop/lib/testing.js +69 -0
- package/node_modules/lop/makefile +4 -0
- package/node_modules/lop/package.json +24 -0
- package/node_modules/lop/test/StringSource.test.js +21 -0
- package/node_modules/lop/test/TokenIterator.test.js +17 -0
- package/node_modules/lop/test/Tokeniser.js +50 -0
- package/node_modules/lop/test/Tokeniser.test.js +38 -0
- package/node_modules/lop/test/bottom-up.test.js +187 -0
- package/node_modules/lop/test/errors.test.js +36 -0
- package/node_modules/lop/test/lazy-iterators.test.js +53 -0
- package/node_modules/lop/test/lop.test.js +27 -0
- package/node_modules/lop/test/regex-tokeniser.test.js +114 -0
- package/node_modules/lop/test/results.test.js +8 -0
- package/node_modules/lop/test/rules.test.js +617 -0
- package/node_modules/mammoth/LICENSE +22 -0
- package/node_modules/mammoth/SOURCE.json +57 -0
- package/node_modules/mammoth/browser/docx/files.js +14 -0
- package/node_modules/mammoth/browser/unzip.js +12 -0
- package/node_modules/mammoth/lib/document-to-html.js +469 -0
- package/node_modules/mammoth/lib/documents.js +254 -0
- package/node_modules/mammoth/lib/docx/body-reader.js +798 -0
- package/node_modules/mammoth/lib/docx/comments-reader.js +31 -0
- package/node_modules/mammoth/lib/docx/content-types-reader.js +58 -0
- package/node_modules/mammoth/lib/docx/document-xml-reader.js +30 -0
- package/node_modules/mammoth/lib/docx/docx-reader.js +226 -0
- package/node_modules/mammoth/lib/docx/files.js +80 -0
- package/node_modules/mammoth/lib/docx/notes-reader.js +28 -0
- package/node_modules/mammoth/lib/docx/numbering-xml.js +111 -0
- package/node_modules/mammoth/lib/docx/office-xml-reader.js +73 -0
- package/node_modules/mammoth/lib/docx/relationships-reader.js +43 -0
- package/node_modules/mammoth/lib/docx/style-map.js +75 -0
- package/node_modules/mammoth/lib/docx/styles-reader.js +90 -0
- package/node_modules/mammoth/lib/docx/uris.js +21 -0
- package/node_modules/mammoth/lib/html/ast.js +51 -0
- package/node_modules/mammoth/lib/html/index.js +41 -0
- package/node_modules/mammoth/lib/html/simplify.js +88 -0
- package/node_modules/mammoth/lib/images.js +31 -0
- package/node_modules/mammoth/lib/index.d.ts +86 -0
- package/node_modules/mammoth/lib/index.js +111 -0
- package/node_modules/mammoth/lib/options-reader.js +107 -0
- package/node_modules/mammoth/lib/promises.js +42 -0
- package/node_modules/mammoth/lib/raw-text.js +14 -0
- package/node_modules/mammoth/lib/results.js +72 -0
- package/node_modules/mammoth/lib/style-reader.js +365 -0
- package/node_modules/mammoth/lib/styles/document-matchers.js +100 -0
- package/node_modules/mammoth/lib/styles/html-paths.js +75 -0
- package/node_modules/mammoth/lib/styles/parser/tokeniser.js +30 -0
- package/node_modules/mammoth/lib/transforms.js +62 -0
- package/node_modules/mammoth/lib/underline.js +11 -0
- package/node_modules/mammoth/lib/unzip.js +20 -0
- package/node_modules/mammoth/lib/writers/html-writer.js +159 -0
- package/node_modules/mammoth/lib/writers/index.js +14 -0
- package/node_modules/mammoth/lib/writers/markdown-writer.js +163 -0
- package/node_modules/mammoth/lib/xml/index.js +8 -0
- package/node_modules/mammoth/lib/xml/nodes.js +70 -0
- package/node_modules/mammoth/lib/xml/reader.js +69 -0
- package/node_modules/mammoth/lib/xml/writer.js +61 -0
- package/node_modules/mammoth/lib/xml/xmldom.js +23 -0
- package/node_modules/mammoth/lib/zipfile.js +72 -0
- package/node_modules/mammoth/package.json +39 -0
- package/node_modules/mammoth/upstream-package.json +64 -0
- package/node_modules/option/.npmignore +1 -0
- package/node_modules/option/LICENSE +22 -0
- package/node_modules/option/README.md +101 -0
- package/node_modules/option/index.js +88 -0
- package/node_modules/option/package.json +23 -0
- package/node_modules/option/test/options.test.js +174 -0
- package/node_modules/pako/CHANGELOG.md +164 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +43 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/underscore/LICENSE +22 -0
- package/node_modules/underscore/README.md +34 -0
- package/node_modules/underscore/amd/_baseCreate.js +21 -0
- package/node_modules/underscore/amd/_baseIteratee.js +15 -0
- package/node_modules/underscore/amd/_cb.js +12 -0
- package/node_modules/underscore/amd/_chainResult.js +10 -0
- package/node_modules/underscore/amd/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/amd/_createAssigner.js +24 -0
- package/node_modules/underscore/amd/_createEscaper.js +21 -0
- package/node_modules/underscore/amd/_createIndexFinder.js +30 -0
- package/node_modules/underscore/amd/_createPredicateIndexFinder.js +18 -0
- package/node_modules/underscore/amd/_createReduce.js +30 -0
- package/node_modules/underscore/amd/_createSizePropertyCheck.js +13 -0
- package/node_modules/underscore/amd/_deepGet.js +15 -0
- package/node_modules/underscore/amd/_escapeMap.js +15 -0
- package/node_modules/underscore/amd/_executeBound.js +16 -0
- package/node_modules/underscore/amd/_flatten.js +32 -0
- package/node_modules/underscore/amd/_getByteLength.js +8 -0
- package/node_modules/underscore/amd/_getLength.js +8 -0
- package/node_modules/underscore/amd/_group.js +18 -0
- package/node_modules/underscore/amd/_has.js +10 -0
- package/node_modules/underscore/amd/_hasObjectTag.js +7 -0
- package/node_modules/underscore/amd/_isArrayLike.js +11 -0
- package/node_modules/underscore/amd/_isBufferLike.js +9 -0
- package/node_modules/underscore/amd/_keyInObj.js +11 -0
- package/node_modules/underscore/amd/_methodFingerprint.js +44 -0
- package/node_modules/underscore/amd/_optimizeCb.js +27 -0
- package/node_modules/underscore/amd/_setup.js +70 -0
- package/node_modules/underscore/amd/_shallowProperty.js +12 -0
- package/node_modules/underscore/amd/_stringTagBug.js +19 -0
- package/node_modules/underscore/amd/_tagTester.js +13 -0
- package/node_modules/underscore/amd/_toBufferView.js +15 -0
- package/node_modules/underscore/amd/_toPath.js +11 -0
- package/node_modules/underscore/amd/_unescapeMap.js +8 -0
- package/node_modules/underscore/amd/after.js +14 -0
- package/node_modules/underscore/amd/allKeys.js +15 -0
- package/node_modules/underscore/amd/before.js +18 -0
- package/node_modules/underscore/amd/bind.js +15 -0
- package/node_modules/underscore/amd/bindAll.js +19 -0
- package/node_modules/underscore/amd/chain.js +12 -0
- package/node_modules/underscore/amd/chunk.js +17 -0
- package/node_modules/underscore/amd/clone.js +11 -0
- package/node_modules/underscore/amd/compact.js +10 -0
- package/node_modules/underscore/amd/compose.js +18 -0
- package/node_modules/underscore/amd/constant.js +12 -0
- package/node_modules/underscore/amd/contains.js +12 -0
- package/node_modules/underscore/amd/countBy.js +12 -0
- package/node_modules/underscore/amd/create.js +14 -0
- package/node_modules/underscore/amd/debounce.js +43 -0
- package/node_modules/underscore/amd/defaults.js +8 -0
- package/node_modules/underscore/amd/defer.js +9 -0
- package/node_modules/underscore/amd/delay.js +13 -0
- package/node_modules/underscore/amd/difference.js +14 -0
- package/node_modules/underscore/amd/each.js +25 -0
- package/node_modules/underscore/amd/escape.js +8 -0
- package/node_modules/underscore/amd/every.js +17 -0
- package/node_modules/underscore/amd/extend.js +8 -0
- package/node_modules/underscore/amd/extendOwn.js +10 -0
- package/node_modules/underscore/amd/filter.js +15 -0
- package/node_modules/underscore/amd/find.js +12 -0
- package/node_modules/underscore/amd/findIndex.js +8 -0
- package/node_modules/underscore/amd/findKey.js +15 -0
- package/node_modules/underscore/amd/findLastIndex.js +8 -0
- package/node_modules/underscore/amd/findWhere.js +11 -0
- package/node_modules/underscore/amd/first.js +13 -0
- package/node_modules/underscore/amd/flatten.js +11 -0
- package/node_modules/underscore/amd/functions.js +14 -0
- package/node_modules/underscore/amd/get.js +14 -0
- package/node_modules/underscore/amd/groupBy.js +11 -0
- package/node_modules/underscore/amd/has.js +19 -0
- package/node_modules/underscore/amd/identity.js +10 -0
- package/node_modules/underscore/amd/index-default.js +12 -0
- package/node_modules/underscore/amd/index.js +154 -0
- package/node_modules/underscore/amd/indexBy.js +11 -0
- package/node_modules/underscore/amd/indexOf.js +11 -0
- package/node_modules/underscore/amd/initial.js +12 -0
- package/node_modules/underscore/amd/intersection.js +22 -0
- package/node_modules/underscore/amd/invert.js +15 -0
- package/node_modules/underscore/amd/invoke.js +28 -0
- package/node_modules/underscore/amd/isArguments.js +19 -0
- package/node_modules/underscore/amd/isArray.js +9 -0
- package/node_modules/underscore/amd/isArrayBuffer.js +7 -0
- package/node_modules/underscore/amd/isBoolean.js +10 -0
- package/node_modules/underscore/amd/isDataView.js +17 -0
- package/node_modules/underscore/amd/isDate.js +7 -0
- package/node_modules/underscore/amd/isElement.js +10 -0
- package/node_modules/underscore/amd/isEmpty.js +18 -0
- package/node_modules/underscore/amd/isEqual.js +133 -0
- package/node_modules/underscore/amd/isError.js +7 -0
- package/node_modules/underscore/amd/isFinite.js +10 -0
- package/node_modules/underscore/amd/isFunction.js +18 -0
- package/node_modules/underscore/amd/isMap.js +7 -0
- package/node_modules/underscore/amd/isMatch.js +17 -0
- package/node_modules/underscore/amd/isNaN.js +10 -0
- package/node_modules/underscore/amd/isNull.js +10 -0
- package/node_modules/underscore/amd/isNumber.js +7 -0
- package/node_modules/underscore/amd/isObject.js +11 -0
- package/node_modules/underscore/amd/isRegExp.js +7 -0
- package/node_modules/underscore/amd/isSet.js +7 -0
- package/node_modules/underscore/amd/isString.js +7 -0
- package/node_modules/underscore/amd/isSymbol.js +7 -0
- package/node_modules/underscore/amd/isTypedArray.js +16 -0
- package/node_modules/underscore/amd/isUndefined.js +10 -0
- package/node_modules/underscore/amd/isWeakMap.js +7 -0
- package/node_modules/underscore/amd/isWeakSet.js +7 -0
- package/node_modules/underscore/amd/iteratee.js +13 -0
- package/node_modules/underscore/amd/keys.js +17 -0
- package/node_modules/underscore/amd/last.js +13 -0
- package/node_modules/underscore/amd/lastIndexOf.js +9 -0
- package/node_modules/underscore/amd/map.js +18 -0
- package/node_modules/underscore/amd/mapObject.js +19 -0
- package/node_modules/underscore/amd/matcher.js +14 -0
- package/node_modules/underscore/amd/max.js +30 -0
- package/node_modules/underscore/amd/memoize.js +17 -0
- package/node_modules/underscore/amd/min.js +30 -0
- package/node_modules/underscore/amd/mixin.js +18 -0
- package/node_modules/underscore/amd/negate.js +12 -0
- package/node_modules/underscore/amd/noop.js +8 -0
- package/node_modules/underscore/amd/now.js +10 -0
- package/node_modules/underscore/amd/object.js +20 -0
- package/node_modules/underscore/amd/omit.js +20 -0
- package/node_modules/underscore/amd/once.js +9 -0
- package/node_modules/underscore/amd/pairs.js +17 -0
- package/node_modules/underscore/amd/partial.js +25 -0
- package/node_modules/underscore/amd/partition.js +11 -0
- package/node_modules/underscore/amd/pick.js +25 -0
- package/node_modules/underscore/amd/pipe.js +13 -0
- package/node_modules/underscore/amd/pluck.js +10 -0
- package/node_modules/underscore/amd/property.js +14 -0
- package/node_modules/underscore/amd/propertyOf.js +13 -0
- package/node_modules/underscore/amd/random.js +14 -0
- package/node_modules/underscore/amd/range.js +27 -0
- package/node_modules/underscore/amd/reduce.js +9 -0
- package/node_modules/underscore/amd/reduceRight.js +8 -0
- package/node_modules/underscore/amd/reject.js +10 -0
- package/node_modules/underscore/amd/rest.js +12 -0
- package/node_modules/underscore/amd/restArguments.js +33 -0
- package/node_modules/underscore/amd/result.js +25 -0
- package/node_modules/underscore/amd/sample.js +27 -0
- package/node_modules/underscore/amd/shuffle.js +10 -0
- package/node_modules/underscore/amd/size.js +11 -0
- package/node_modules/underscore/amd/some.js +17 -0
- package/node_modules/underscore/amd/sortBy.js +26 -0
- package/node_modules/underscore/amd/sortedIndex.js +18 -0
- package/node_modules/underscore/amd/tap.js +13 -0
- package/node_modules/underscore/amd/template.js +103 -0
- package/node_modules/underscore/amd/templateSettings.js +13 -0
- package/node_modules/underscore/amd/throttle.js +51 -0
- package/node_modules/underscore/amd/times.js +13 -0
- package/node_modules/underscore/amd/toArray.js +18 -0
- package/node_modules/underscore/amd/toPath.js +12 -0
- package/node_modules/underscore/amd/underscore-array-methods.js +30 -0
- package/node_modules/underscore/amd/underscore.js +29 -0
- package/node_modules/underscore/amd/unescape.js +8 -0
- package/node_modules/underscore/amd/union.js +11 -0
- package/node_modules/underscore/amd/uniq.js +37 -0
- package/node_modules/underscore/amd/uniqueId.js +13 -0
- package/node_modules/underscore/amd/unzip.js +17 -0
- package/node_modules/underscore/amd/values.js +16 -0
- package/node_modules/underscore/amd/where.js +11 -0
- package/node_modules/underscore/amd/without.js +10 -0
- package/node_modules/underscore/amd/wrap.js +12 -0
- package/node_modules/underscore/amd/zip.js +9 -0
- package/node_modules/underscore/cjs/_baseCreate.js +20 -0
- package/node_modules/underscore/cjs/_baseIteratee.js +19 -0
- package/node_modules/underscore/cjs/_cb.js +12 -0
- package/node_modules/underscore/cjs/_chainResult.js +8 -0
- package/node_modules/underscore/cjs/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/cjs/_createAssigner.js +20 -0
- package/node_modules/underscore/cjs/_createEscaper.js +19 -0
- package/node_modules/underscore/cjs/_createIndexFinder.js +30 -0
- package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +17 -0
- package/node_modules/underscore/cjs/_createReduce.js +30 -0
- package/node_modules/underscore/cjs/_createSizePropertyCheck.js +11 -0
- package/node_modules/underscore/cjs/_deepGet.js +11 -0
- package/node_modules/underscore/cjs/_escapeMap.js +11 -0
- package/node_modules/underscore/cjs/_executeBound.js +15 -0
- package/node_modules/underscore/cjs/_flatten.js +33 -0
- package/node_modules/underscore/cjs/_getByteLength.js +6 -0
- package/node_modules/underscore/cjs/_getLength.js +6 -0
- package/node_modules/underscore/cjs/_group.js +17 -0
- package/node_modules/underscore/cjs/_has.js +8 -0
- package/node_modules/underscore/cjs/_hasObjectTag.js +5 -0
- package/node_modules/underscore/cjs/_isArrayLike.js +10 -0
- package/node_modules/underscore/cjs/_isBufferLike.js +8 -0
- package/node_modules/underscore/cjs/_keyInObj.js +7 -0
- package/node_modules/underscore/cjs/_methodFingerprint.js +44 -0
- package/node_modules/underscore/cjs/_optimizeCb.js +23 -0
- package/node_modules/underscore/cjs/_setup.js +66 -0
- package/node_modules/underscore/cjs/_shallowProperty.js +8 -0
- package/node_modules/underscore/cjs/_stringTagBug.js +18 -0
- package/node_modules/underscore/cjs/_tagTester.js +11 -0
- package/node_modules/underscore/cjs/_toBufferView.js +13 -0
- package/node_modules/underscore/cjs/_toPath.js +10 -0
- package/node_modules/underscore/cjs/_unescapeMap.js +7 -0
- package/node_modules/underscore/cjs/after.js +10 -0
- package/node_modules/underscore/cjs/allKeys.js +15 -0
- package/node_modules/underscore/cjs/before.js +14 -0
- package/node_modules/underscore/cjs/bind.js +15 -0
- package/node_modules/underscore/cjs/bindAll.js +19 -0
- package/node_modules/underscore/cjs/chain.js +10 -0
- package/node_modules/underscore/cjs/chunk.js +15 -0
- package/node_modules/underscore/cjs/clone.js +11 -0
- package/node_modules/underscore/cjs/compact.js +8 -0
- package/node_modules/underscore/cjs/compose.js +14 -0
- package/node_modules/underscore/cjs/constant.js +8 -0
- package/node_modules/underscore/cjs/contains.js +12 -0
- package/node_modules/underscore/cjs/countBy.js +11 -0
- package/node_modules/underscore/cjs/create.js +13 -0
- package/node_modules/underscore/cjs/debounce.js +42 -0
- package/node_modules/underscore/cjs/defaults.js +7 -0
- package/node_modules/underscore/cjs/defer.js +9 -0
- package/node_modules/underscore/cjs/delay.js +11 -0
- package/node_modules/underscore/cjs/difference.js +15 -0
- package/node_modules/underscore/cjs/each.js +25 -0
- package/node_modules/underscore/cjs/escape.js +7 -0
- package/node_modules/underscore/cjs/every.js +17 -0
- package/node_modules/underscore/cjs/extend.js +7 -0
- package/node_modules/underscore/cjs/extendOwn.js +9 -0
- package/node_modules/underscore/cjs/filter.js +14 -0
- package/node_modules/underscore/cjs/find.js +12 -0
- package/node_modules/underscore/cjs/findIndex.js +6 -0
- package/node_modules/underscore/cjs/findKey.js +14 -0
- package/node_modules/underscore/cjs/findLastIndex.js +6 -0
- package/node_modules/underscore/cjs/findWhere.js +10 -0
- package/node_modules/underscore/cjs/first.js +11 -0
- package/node_modules/underscore/cjs/flatten.js +9 -0
- package/node_modules/underscore/cjs/functions.js +12 -0
- package/node_modules/underscore/cjs/get.js +14 -0
- package/node_modules/underscore/cjs/groupBy.js +10 -0
- package/node_modules/underscore/cjs/has.js +18 -0
- package/node_modules/underscore/cjs/identity.js +6 -0
- package/node_modules/underscore/cjs/index-default.js +11 -0
- package/node_modules/underscore/cjs/index.js +278 -0
- package/node_modules/underscore/cjs/indexBy.js +9 -0
- package/node_modules/underscore/cjs/indexOf.js +11 -0
- package/node_modules/underscore/cjs/initial.js +10 -0
- package/node_modules/underscore/cjs/intersection.js +21 -0
- package/node_modules/underscore/cjs/invert.js +13 -0
- package/node_modules/underscore/cjs/invoke.js +30 -0
- package/node_modules/underscore/cjs/isArguments.js +18 -0
- package/node_modules/underscore/cjs/isArray.js +8 -0
- package/node_modules/underscore/cjs/isArrayBuffer.js +5 -0
- package/node_modules/underscore/cjs/isBoolean.js +8 -0
- package/node_modules/underscore/cjs/isDataView.js +18 -0
- package/node_modules/underscore/cjs/isDate.js +5 -0
- package/node_modules/underscore/cjs/isElement.js +6 -0
- package/node_modules/underscore/cjs/isEmpty.js +20 -0
- package/node_modules/underscore/cjs/isEqual.js +140 -0
- package/node_modules/underscore/cjs/isError.js +5 -0
- package/node_modules/underscore/cjs/isFinite.js +9 -0
- package/node_modules/underscore/cjs/isFunction.js +17 -0
- package/node_modules/underscore/cjs/isMap.js +7 -0
- package/node_modules/underscore/cjs/isMatch.js +15 -0
- package/node_modules/underscore/cjs/isNaN.js +9 -0
- package/node_modules/underscore/cjs/isNull.js +6 -0
- package/node_modules/underscore/cjs/isNumber.js +5 -0
- package/node_modules/underscore/cjs/isObject.js +7 -0
- package/node_modules/underscore/cjs/isRegExp.js +5 -0
- package/node_modules/underscore/cjs/isSet.js +7 -0
- package/node_modules/underscore/cjs/isString.js +5 -0
- package/node_modules/underscore/cjs/isSymbol.js +5 -0
- package/node_modules/underscore/cjs/isTypedArray.js +17 -0
- package/node_modules/underscore/cjs/isUndefined.js +6 -0
- package/node_modules/underscore/cjs/isWeakMap.js +7 -0
- package/node_modules/underscore/cjs/isWeakSet.js +5 -0
- package/node_modules/underscore/cjs/iteratee.js +12 -0
- package/node_modules/underscore/cjs/keys.js +18 -0
- package/node_modules/underscore/cjs/last.js +11 -0
- package/node_modules/underscore/cjs/lastIndexOf.js +8 -0
- package/node_modules/underscore/cjs/map.js +18 -0
- package/node_modules/underscore/cjs/mapObject.js +18 -0
- package/node_modules/underscore/cjs/matcher.js +13 -0
- package/node_modules/underscore/cjs/max.js +31 -0
- package/node_modules/underscore/cjs/memoize.js +15 -0
- package/node_modules/underscore/cjs/min.js +31 -0
- package/node_modules/underscore/cjs/mixin.js +20 -0
- package/node_modules/underscore/cjs/negate.js +8 -0
- package/node_modules/underscore/cjs/noop.js +4 -0
- package/node_modules/underscore/cjs/now.js +6 -0
- package/node_modules/underscore/cjs/object.js +18 -0
- package/node_modules/underscore/cjs/omit.js +24 -0
- package/node_modules/underscore/cjs/once.js +8 -0
- package/node_modules/underscore/cjs/pairs.js +15 -0
- package/node_modules/underscore/cjs/partial.js +25 -0
- package/node_modules/underscore/cjs/partition.js +9 -0
- package/node_modules/underscore/cjs/pick.js +28 -0
- package/node_modules/underscore/cjs/pipe.js +12 -0
- package/node_modules/underscore/cjs/pluck.js +9 -0
- package/node_modules/underscore/cjs/property.js +13 -0
- package/node_modules/underscore/cjs/propertyOf.js +12 -0
- package/node_modules/underscore/cjs/random.js +10 -0
- package/node_modules/underscore/cjs/range.js +23 -0
- package/node_modules/underscore/cjs/reduce.js +7 -0
- package/node_modules/underscore/cjs/reduceRight.js +6 -0
- package/node_modules/underscore/cjs/reject.js +10 -0
- package/node_modules/underscore/cjs/rest.js +10 -0
- package/node_modules/underscore/cjs/restArguments.js +29 -0
- package/node_modules/underscore/cjs/result.js +24 -0
- package/node_modules/underscore/cjs/sample.js +29 -0
- package/node_modules/underscore/cjs/shuffle.js +8 -0
- package/node_modules/underscore/cjs/size.js +10 -0
- package/node_modules/underscore/cjs/some.js +17 -0
- package/node_modules/underscore/cjs/sortBy.js +26 -0
- package/node_modules/underscore/cjs/sortedIndex.js +17 -0
- package/node_modules/underscore/cjs/tap.js +9 -0
- package/node_modules/underscore/cjs/template.js +103 -0
- package/node_modules/underscore/cjs/templateSettings.js +11 -0
- package/node_modules/underscore/cjs/throttle.js +49 -0
- package/node_modules/underscore/cjs/times.js +11 -0
- package/node_modules/underscore/cjs/toArray.js +22 -0
- package/node_modules/underscore/cjs/toPath.js +11 -0
- package/node_modules/underscore/cjs/underscore-array-methods.js +31 -0
- package/node_modules/underscore/cjs/underscore.js +27 -0
- package/node_modules/underscore/cjs/unescape.js +7 -0
- package/node_modules/underscore/cjs/union.js +11 -0
- package/node_modules/underscore/cjs/uniq.js +38 -0
- package/node_modules/underscore/cjs/uniqueId.js +9 -0
- package/node_modules/underscore/cjs/unzip.js +17 -0
- package/node_modules/underscore/cjs/values.js +14 -0
- package/node_modules/underscore/cjs/where.js +10 -0
- package/node_modules/underscore/cjs/without.js +9 -0
- package/node_modules/underscore/cjs/wrap.js +10 -0
- package/node_modules/underscore/cjs/zip.js +8 -0
- package/node_modules/underscore/modules/.eslintrc +21 -0
- package/node_modules/underscore/modules/_baseCreate.js +18 -0
- package/node_modules/underscore/modules/_baseIteratee.js +17 -0
- package/node_modules/underscore/modules/_cb.js +10 -0
- package/node_modules/underscore/modules/_chainResult.js +6 -0
- package/node_modules/underscore/modules/_collectNonEnumProps.js +40 -0
- package/node_modules/underscore/modules/_createAssigner.js +18 -0
- package/node_modules/underscore/modules/_createEscaper.js +17 -0
- package/node_modules/underscore/modules/_createIndexFinder.js +28 -0
- package/node_modules/underscore/modules/_createPredicateIndexFinder.js +15 -0
- package/node_modules/underscore/modules/_createReduce.js +28 -0
- package/node_modules/underscore/modules/_createSizePropertyCheck.js +9 -0
- package/node_modules/underscore/modules/_deepGet.js +9 -0
- package/node_modules/underscore/modules/_escapeMap.js +9 -0
- package/node_modules/underscore/modules/_executeBound.js +13 -0
- package/node_modules/underscore/modules/_flatten.js +33 -0
- package/node_modules/underscore/modules/_getByteLength.js +4 -0
- package/node_modules/underscore/modules/_getLength.js +4 -0
- package/node_modules/underscore/modules/_group.js +15 -0
- package/node_modules/underscore/modules/_has.js +6 -0
- package/node_modules/underscore/modules/_hasObjectTag.js +3 -0
- package/node_modules/underscore/modules/_isArrayLike.js +8 -0
- package/node_modules/underscore/modules/_isBufferLike.js +6 -0
- package/node_modules/underscore/modules/_keyInObj.js +5 -0
- package/node_modules/underscore/modules/_methodFingerprint.js +37 -0
- package/node_modules/underscore/modules/_optimizeCb.js +21 -0
- package/node_modules/underscore/modules/_setup.js +43 -0
- package/node_modules/underscore/modules/_shallowProperty.js +6 -0
- package/node_modules/underscore/modules/_stringTagBug.js +13 -0
- package/node_modules/underscore/modules/_tagTester.js +9 -0
- package/node_modules/underscore/modules/_toBufferView.js +11 -0
- package/node_modules/underscore/modules/_toPath.js +8 -0
- package/node_modules/underscore/modules/_unescapeMap.js +5 -0
- package/node_modules/underscore/modules/after.js +8 -0
- package/node_modules/underscore/modules/allKeys.js +13 -0
- package/node_modules/underscore/modules/before.js +12 -0
- package/node_modules/underscore/modules/bind.js +13 -0
- package/node_modules/underscore/modules/bindAll.js +17 -0
- package/node_modules/underscore/modules/chain.js +8 -0
- package/node_modules/underscore/modules/chunk.js +13 -0
- package/node_modules/underscore/modules/clone.js +9 -0
- package/node_modules/underscore/modules/compact.js +6 -0
- package/node_modules/underscore/modules/compose.js +12 -0
- package/node_modules/underscore/modules/constant.js +6 -0
- package/node_modules/underscore/modules/contains.js +10 -0
- package/node_modules/underscore/modules/countBy.js +9 -0
- package/node_modules/underscore/modules/create.js +11 -0
- package/node_modules/underscore/modules/debounce.js +40 -0
- package/node_modules/underscore/modules/defaults.js +5 -0
- package/node_modules/underscore/modules/defer.js +7 -0
- package/node_modules/underscore/modules/delay.js +9 -0
- package/node_modules/underscore/modules/difference.js +13 -0
- package/node_modules/underscore/modules/each.js +23 -0
- package/node_modules/underscore/modules/escape.js +5 -0
- package/node_modules/underscore/modules/every.js +15 -0
- package/node_modules/underscore/modules/extend.js +5 -0
- package/node_modules/underscore/modules/extendOwn.js +7 -0
- package/node_modules/underscore/modules/filter.js +12 -0
- package/node_modules/underscore/modules/find.js +10 -0
- package/node_modules/underscore/modules/findIndex.js +4 -0
- package/node_modules/underscore/modules/findKey.js +12 -0
- package/node_modules/underscore/modules/findLastIndex.js +4 -0
- package/node_modules/underscore/modules/findWhere.js +8 -0
- package/node_modules/underscore/modules/first.js +9 -0
- package/node_modules/underscore/modules/flatten.js +7 -0
- package/node_modules/underscore/modules/functions.js +10 -0
- package/node_modules/underscore/modules/get.js +12 -0
- package/node_modules/underscore/modules/groupBy.js +8 -0
- package/node_modules/underscore/modules/has.js +16 -0
- package/node_modules/underscore/modules/identity.js +4 -0
- package/node_modules/underscore/modules/index-all.js +18 -0
- package/node_modules/underscore/modules/index-default.js +27 -0
- package/node_modules/underscore/modules/index.js +200 -0
- package/node_modules/underscore/modules/indexBy.js +7 -0
- package/node_modules/underscore/modules/indexOf.js +9 -0
- package/node_modules/underscore/modules/initial.js +8 -0
- package/node_modules/underscore/modules/intersection.js +19 -0
- package/node_modules/underscore/modules/invert.js +11 -0
- package/node_modules/underscore/modules/invoke.js +28 -0
- package/node_modules/underscore/modules/isArguments.js +16 -0
- package/node_modules/underscore/modules/isArray.js +6 -0
- package/node_modules/underscore/modules/isArrayBuffer.js +3 -0
- package/node_modules/underscore/modules/isBoolean.js +6 -0
- package/node_modules/underscore/modules/isDataView.js +16 -0
- package/node_modules/underscore/modules/isDate.js +3 -0
- package/node_modules/underscore/modules/isElement.js +4 -0
- package/node_modules/underscore/modules/isEmpty.js +18 -0
- package/node_modules/underscore/modules/isEqual.js +153 -0
- package/node_modules/underscore/modules/isError.js +3 -0
- package/node_modules/underscore/modules/isFinite.js +7 -0
- package/node_modules/underscore/modules/isFunction.js +15 -0
- package/node_modules/underscore/modules/isMap.js +5 -0
- package/node_modules/underscore/modules/isMatch.js +13 -0
- package/node_modules/underscore/modules/isNaN.js +7 -0
- package/node_modules/underscore/modules/isNull.js +4 -0
- package/node_modules/underscore/modules/isNumber.js +3 -0
- package/node_modules/underscore/modules/isObject.js +5 -0
- package/node_modules/underscore/modules/isRegExp.js +3 -0
- package/node_modules/underscore/modules/isSet.js +5 -0
- package/node_modules/underscore/modules/isString.js +3 -0
- package/node_modules/underscore/modules/isSymbol.js +3 -0
- package/node_modules/underscore/modules/isTypedArray.js +15 -0
- package/node_modules/underscore/modules/isUndefined.js +4 -0
- package/node_modules/underscore/modules/isWeakMap.js +5 -0
- package/node_modules/underscore/modules/isWeakSet.js +3 -0
- package/node_modules/underscore/modules/iteratee.js +10 -0
- package/node_modules/underscore/modules/keys.js +16 -0
- package/node_modules/underscore/modules/last.js +9 -0
- package/node_modules/underscore/modules/lastIndexOf.js +6 -0
- package/node_modules/underscore/modules/map.js +16 -0
- package/node_modules/underscore/modules/mapObject.js +16 -0
- package/node_modules/underscore/modules/matcher.js +11 -0
- package/node_modules/underscore/modules/max.js +29 -0
- package/node_modules/underscore/modules/memoize.js +13 -0
- package/node_modules/underscore/modules/min.js +29 -0
- package/node_modules/underscore/modules/mixin.js +18 -0
- package/node_modules/underscore/modules/negate.js +6 -0
- package/node_modules/underscore/modules/noop.js +2 -0
- package/node_modules/underscore/modules/now.js +4 -0
- package/node_modules/underscore/modules/object.js +16 -0
- package/node_modules/underscore/modules/omit.js +22 -0
- package/node_modules/underscore/modules/once.js +6 -0
- package/node_modules/underscore/modules/package.json +1 -0
- package/node_modules/underscore/modules/pairs.js +13 -0
- package/node_modules/underscore/modules/partial.js +24 -0
- package/node_modules/underscore/modules/partition.js +7 -0
- package/node_modules/underscore/modules/pick.js +26 -0
- package/node_modules/underscore/modules/pluck.js +7 -0
- package/node_modules/underscore/modules/property.js +11 -0
- package/node_modules/underscore/modules/propertyOf.js +10 -0
- package/node_modules/underscore/modules/random.js +8 -0
- package/node_modules/underscore/modules/range.js +21 -0
- package/node_modules/underscore/modules/reduce.js +5 -0
- package/node_modules/underscore/modules/reduceRight.js +4 -0
- package/node_modules/underscore/modules/reject.js +8 -0
- package/node_modules/underscore/modules/rest.js +8 -0
- package/node_modules/underscore/modules/restArguments.js +27 -0
- package/node_modules/underscore/modules/result.js +22 -0
- package/node_modules/underscore/modules/sample.js +27 -0
- package/node_modules/underscore/modules/shuffle.js +6 -0
- package/node_modules/underscore/modules/size.js +8 -0
- package/node_modules/underscore/modules/some.js +15 -0
- package/node_modules/underscore/modules/sortBy.js +24 -0
- package/node_modules/underscore/modules/sortedIndex.js +15 -0
- package/node_modules/underscore/modules/tap.js +7 -0
- package/node_modules/underscore/modules/template.js +101 -0
- package/node_modules/underscore/modules/templateSettings.js +9 -0
- package/node_modules/underscore/modules/throttle.js +47 -0
- package/node_modules/underscore/modules/times.js +9 -0
- package/node_modules/underscore/modules/toArray.js +20 -0
- package/node_modules/underscore/modules/toPath.js +9 -0
- package/node_modules/underscore/modules/underscore-array-methods.js +31 -0
- package/node_modules/underscore/modules/underscore.js +25 -0
- package/node_modules/underscore/modules/unescape.js +5 -0
- package/node_modules/underscore/modules/union.js +9 -0
- package/node_modules/underscore/modules/uniq.js +36 -0
- package/node_modules/underscore/modules/uniqueId.js +7 -0
- package/node_modules/underscore/modules/unzip.js +15 -0
- package/node_modules/underscore/modules/values.js +12 -0
- package/node_modules/underscore/modules/where.js +8 -0
- package/node_modules/underscore/modules/without.js +7 -0
- package/node_modules/underscore/modules/wrap.js +8 -0
- package/node_modules/underscore/modules/zip.js +6 -0
- package/node_modules/underscore/package.json +124 -0
- package/node_modules/underscore/underscore-esm-min.js +5 -0
- package/node_modules/underscore/underscore-esm-min.js.map +1 -0
- package/node_modules/underscore/underscore-esm.js +2056 -0
- package/node_modules/underscore/underscore-esm.js.map +1 -0
- package/node_modules/underscore/underscore-min.js +6 -0
- package/node_modules/underscore/underscore-min.js.map +1 -0
- package/node_modules/underscore/underscore-node-f.cjs +2180 -0
- package/node_modules/underscore/underscore-node-f.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.cjs +11 -0
- package/node_modules/underscore/underscore-node.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.mjs +7 -0
- package/node_modules/underscore/underscore-node.mjs.map +1 -0
- package/node_modules/underscore/underscore-umd-min.js +6 -0
- package/node_modules/underscore/underscore-umd-min.js.map +1 -0
- package/node_modules/underscore/underscore-umd.js +2064 -0
- package/node_modules/underscore/underscore-umd.js.map +1 -0
- package/node_modules/underscore/underscore.js +2064 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/xmlbuilder/CHANGELOG.md +438 -0
- package/node_modules/xmlbuilder/LICENSE +21 -0
- package/node_modules/xmlbuilder/README.md +86 -0
- package/node_modules/xmlbuilder/appveyor.yml +20 -0
- package/node_modules/xmlbuilder/lib/Utility.js +83 -0
- package/node_modules/xmlbuilder/lib/XMLAttribute.js +41 -0
- package/node_modules/xmlbuilder/lib/XMLCData.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLComment.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLDTDAttList.js +50 -0
- package/node_modules/xmlbuilder/lib/XMLDTDElement.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLDTDEntity.js +56 -0
- package/node_modules/xmlbuilder/lib/XMLDTDNotation.js +37 -0
- package/node_modules/xmlbuilder/lib/XMLDeclaration.js +40 -0
- package/node_modules/xmlbuilder/lib/XMLDocType.js +108 -0
- package/node_modules/xmlbuilder/lib/XMLDocument.js +49 -0
- package/node_modules/xmlbuilder/lib/XMLDocumentCB.js +414 -0
- package/node_modules/xmlbuilder/lib/XMLDummy.js +29 -0
- package/node_modules/xmlbuilder/lib/XMLElement.js +111 -0
- package/node_modules/xmlbuilder/lib/XMLNode.js +467 -0
- package/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLRaw.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLStreamWriter.js +287 -0
- package/node_modules/xmlbuilder/lib/XMLStringWriter.js +341 -0
- package/node_modules/xmlbuilder/lib/XMLStringifier.js +163 -0
- package/node_modules/xmlbuilder/lib/XMLText.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLWriterBase.js +90 -0
- package/node_modules/xmlbuilder/lib/index.js +53 -0
- package/node_modules/xmlbuilder/package.json +37 -0
- package/package.json +13 -5
- package/scripts/check-doc-links.mjs +2 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-package-artifact.mjs +19 -0
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/dependency-audit.mjs +49 -96
- package/scripts/dependency-audit.test.mjs +70 -106
- package/scripts/docx-browser-test.mjs +56 -0
- package/scripts/docx-compatibility.test.mjs +39 -0
- package/scripts/docx-fixtures.mjs +19 -0
- package/scripts/export-oss.mjs +3 -0
- package/scripts/generate-third-party-notices.mjs +6 -2
- package/scripts/install.sh +1 -1
- package/scripts/notification-console-test.mjs +172 -0
- package/scripts/oss-boundary-check.mjs +3 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +5 -1
- package/scripts/vendor-mammoth.mjs +130 -0
- package/scripts/verify-github-repo.mjs +4 -0
- package/scripts/verify-oss-export.mjs +3 -0
- package/sql/068_notification_outbox.sql +28 -0
- package/sql/README.en.md +8 -0
- package/sql/README.md +8 -0
- package/src/app/approval-continuations.mysql.test.ts +1 -1
- package/src/app/delivery-dlq-replay.mysql.test.ts +2 -2
- package/src/app/delivery.ts +115 -1
- package/src/app/engine.ts +5 -4
- package/src/app/kernel-usage-lifecycle.mysql.test.ts +1 -1
- package/src/app/kernel.ts +8 -0
- package/src/app/notification-outbox.test.ts +321 -0
- package/src/app/notification-outbox.ts +123 -0
- package/src/app/operational-metrics.test.ts +15 -0
- package/src/app/operational-metrics.ts +9 -0
- package/src/app/outbound.ts +28 -0
- package/src/app/runtime-evidence-maintenance.test.ts +34 -1
- package/src/app/runtime-lifecycle-default.ts +7 -0
- package/src/app/runtime-lifecycle.ts +8 -0
- package/src/app/tool-approvals.ts +68 -31
- package/src/core/contracts/delivery-replay.ts +1 -0
- package/src/core/contracts/notification-outbox.ts +54 -0
- package/src/core/observability/openmetrics.test.ts +18 -0
- package/src/core/observability/openmetrics.ts +17 -0
- package/src/core/runtime/finish-runtime.test.ts +20 -0
- package/src/core/runtime/finish-runtime.ts +13 -5
- package/src/core/runtime/inhub-runtime.ts +10 -2
- package/src/core/runtime/notification-outbox-work.ts +15 -0
- package/src/core/state/notification-outbox.ts +66 -0
- package/src/core/state/state-contracts.ts +4 -0
- package/src/infrastructure/config/config-approval-ledger.ts +23 -1
- package/src/infrastructure/config/config-delivery-dlq-ledger.ts +26 -13
- package/src/infrastructure/config/configstore.ts +8 -4
- package/src/infrastructure/state/notification-outbox-jsonl.ts +80 -0
- package/src/infrastructure/state/notification-outbox-mysql.ts +100 -0
- package/src/infrastructure/state/notification-outbox-storage.test.ts +325 -0
- package/src/infrastructure/state/state-jsonl.ts +64 -13
- package/src/infrastructure/state/state-mysql.ts +36 -5
- package/src/routes/admin-notifications.test.ts +75 -0
- package/src/routes/admin-notifications.ts +77 -0
- package/src/routes/admin-runtime.test.ts +25 -0
- package/src/routes/admin-runtime.ts +15 -0
- package/src/routes/admin.ts +1 -0
- package/src/test-support/notification-outbox-journal-crash-child.ts +20 -0
- package/vendor/bailinghub-mammoth-library-1.12.0-bailinghub.1.tgz +0 -0
- package/vendor/mammoth-library/LICENSE +22 -0
- package/vendor/mammoth-library/SOURCE.json +57 -0
- package/vendor/mammoth-library/browser/docx/files.js +14 -0
- package/vendor/mammoth-library/browser/unzip.js +12 -0
- package/vendor/mammoth-library/lib/document-to-html.js +469 -0
- package/vendor/mammoth-library/lib/documents.js +254 -0
- package/vendor/mammoth-library/lib/docx/body-reader.js +798 -0
- package/vendor/mammoth-library/lib/docx/comments-reader.js +31 -0
- package/vendor/mammoth-library/lib/docx/content-types-reader.js +58 -0
- package/vendor/mammoth-library/lib/docx/document-xml-reader.js +30 -0
- package/vendor/mammoth-library/lib/docx/docx-reader.js +226 -0
- package/vendor/mammoth-library/lib/docx/files.js +80 -0
- package/vendor/mammoth-library/lib/docx/notes-reader.js +28 -0
- package/vendor/mammoth-library/lib/docx/numbering-xml.js +111 -0
- package/vendor/mammoth-library/lib/docx/office-xml-reader.js +73 -0
- package/vendor/mammoth-library/lib/docx/relationships-reader.js +43 -0
- package/vendor/mammoth-library/lib/docx/style-map.js +75 -0
- package/vendor/mammoth-library/lib/docx/styles-reader.js +90 -0
- package/vendor/mammoth-library/lib/docx/uris.js +21 -0
- package/vendor/mammoth-library/lib/html/ast.js +51 -0
- package/vendor/mammoth-library/lib/html/index.js +41 -0
- package/vendor/mammoth-library/lib/html/simplify.js +88 -0
- package/vendor/mammoth-library/lib/images.js +31 -0
- package/vendor/mammoth-library/lib/index.d.ts +86 -0
- package/vendor/mammoth-library/lib/index.js +111 -0
- package/vendor/mammoth-library/lib/options-reader.js +107 -0
- package/vendor/mammoth-library/lib/promises.js +42 -0
- package/vendor/mammoth-library/lib/raw-text.js +14 -0
- package/vendor/mammoth-library/lib/results.js +72 -0
- package/vendor/mammoth-library/lib/style-reader.js +365 -0
- package/vendor/mammoth-library/lib/styles/document-matchers.js +100 -0
- package/vendor/mammoth-library/lib/styles/html-paths.js +75 -0
- package/vendor/mammoth-library/lib/styles/parser/tokeniser.js +30 -0
- package/vendor/mammoth-library/lib/transforms.js +62 -0
- package/vendor/mammoth-library/lib/underline.js +11 -0
- package/vendor/mammoth-library/lib/unzip.js +20 -0
- package/vendor/mammoth-library/lib/writers/html-writer.js +159 -0
- package/vendor/mammoth-library/lib/writers/index.js +14 -0
- package/vendor/mammoth-library/lib/writers/markdown-writer.js +163 -0
- package/vendor/mammoth-library/lib/xml/index.js +8 -0
- package/vendor/mammoth-library/lib/xml/nodes.js +70 -0
- package/vendor/mammoth-library/lib/xml/reader.js +69 -0
- package/vendor/mammoth-library/lib/xml/writer.js +61 -0
- package/vendor/mammoth-library/lib/xml/xmldom.js +23 -0
- package/vendor/mammoth-library/lib/zipfile.js +72 -0
- package/vendor/mammoth-library/package.json +39 -0
- package/vendor/mammoth-library/upstream-package.json +64 -0
- package/vendor/mammoth-library-distribution.json +4 -0
- package/web/console/assets/{Accounts-DKhw_QLr.js → Accounts-Dhj6PjXP.js} +1 -1
- package/web/console/assets/{AgentClients-CM4_5HaA.js → AgentClients-CMy8StAH.js} +1 -1
- package/web/console/assets/{AgentTasks-CkQgZTU5.js → AgentTasks-DA1xZdmP.js} +1 -1
- package/web/console/assets/{Approvals-B9O9TkbO.js → Approvals-DIsd7R8N.js} +1 -1
- package/web/console/assets/{Audit-2vDC1SPu.js → Audit-AUDABLTX.js} +1 -1
- package/web/console/assets/{BrandLockup-BgASiRSE.js → BrandLockup-CffORQse.js} +1 -1
- package/web/console/assets/{Channels-A-GvkNBt.js → Channels-B8rjsM0S.js} +1 -1
- package/web/console/assets/{ChatEntries-BLxymI67.js → ChatEntries-iZjJMEUZ.js} +1 -1
- package/web/console/assets/{Clients-DeNlmvS6.js → Clients-CwgpGCSD.js} +1 -1
- package/web/console/assets/{Cost-CBq_L4Kz.js → Cost-B2tNxu71.js} +1 -1
- package/web/console/assets/{Credentials-DmtbctNj.js → Credentials-BuwFB-fV.js} +1 -1
- package/web/console/assets/{Diagnostics-BbcRDiA-.js → Diagnostics-z5glms11.js} +1 -1
- package/web/console/assets/{Executors-gGgmQrDt.js → Executors-Bc4SvjeH.js} +1 -1
- package/web/console/assets/{Kb-lgY6OXUz.js → Kb-BRbRHxLy.js} +1 -1
- package/web/console/assets/{Login-DA6BASZd.js → Login-CGgLGTE1.js} +1 -1
- package/web/console/assets/{Projects-DEbmB_sT.js → Projects-CPWw3con.js} +1 -1
- package/web/console/assets/{Routes-qS6LLoyS.js → Routes-CMIaE0Bx.js} +1 -1
- package/web/console/assets/Runs-B8HuE700.js +3 -0
- package/web/console/assets/Runs-Bv6CV_Hk.css +1 -0
- package/web/console/assets/{Setup-DEpVF5uw.js → Setup-G8RKzliR.js} +1 -1
- package/web/console/assets/{Shell-DgoPgK1E.js → Shell-DimHgraJ.js} +1 -1
- package/web/console/assets/{StorageBuckets-DJtNN769.js → StorageBuckets-CiVYXIE2.js} +1 -1
- package/web/console/assets/{SystemSettings-0DEUgeTR.js → SystemSettings-DF8sZNen.js} +1 -1
- package/web/console/assets/{SystemStatus-CR1phiPE.js → SystemStatus-BlHywK13.js} +1 -1
- package/web/console/assets/{Targets-D65l-IMB.js → Targets-BXaoPoAJ.js} +1 -1
- package/web/console/assets/{Tools-DqtrINrN.js → Tools-B22lNHXq.js} +1 -1
- package/web/console/assets/{Usage-B5njXNjx.js → Usage-C02EzoI2.js} +1 -1
- package/web/console/assets/{UsageAccess-ChnB4pjb.js → UsageAccess-DOb-cyPE.js} +1 -1
- package/web/console/assets/{UsageHelp-BBKIvbQ5.js → UsageHelp-CzS2gI40.js} +1 -1
- package/web/console/assets/{index-sLKrJd_p.js → index-CK0ZCTZv.js} +2 -2
- package/web/console/assets/{request-BpaimqEb.js → request-DKycpD7z.js} +1 -1
- package/web/console/assets/{schema-D0Z4kFCZ.js → schema-SCiNxBlR.js} +1 -1
- package/web/console/index.html +1 -1
- package/web-admin/package-lock.json +5 -23
- package/web-admin/package.json +1 -1
- package/web-admin/src/components/NotificationOutboxPanel.vue +106 -0
- package/web-admin/src/pages/Runs.vue +8 -2
- package/security/dependency-audit-exceptions.json +0 -192
- package/web/console/assets/Runs-CvGTV8I-.css +0 -1
- package/web/console/assets/Runs-DG-VLRSc.js +0 -3
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import { mkdtemp, readFile, rm, writeFile, appendFile, mkdir } from 'node:fs/promises';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { pathToFileURL } from 'node:url';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { fork } from 'node:child_process';
|
|
10
|
+
import { createPool } from 'mysql2/promise';
|
|
11
|
+
import type { Job } from '../../core/contracts/types';
|
|
12
|
+
import { JsonlStore } from './state-jsonl';
|
|
13
|
+
import { MysqlStore } from './state-mysql';
|
|
14
|
+
import { migrateBailingHubCoreSchema } from '../schema/core-schema-migrator';
|
|
15
|
+
import { ApprovalLedger } from '../config/config-approval-ledger';
|
|
16
|
+
import { DeliveryDlqLedger } from '../config/config-delivery-dlq-ledger';
|
|
17
|
+
import { MysqlNotificationOutbox } from './notification-outbox-mysql';
|
|
18
|
+
import type { ApprovalNotificationDraft } from '../../core/contracts/notification-outbox';
|
|
19
|
+
import { safeNotificationError } from '../../core/state/notification-outbox';
|
|
20
|
+
|
|
21
|
+
const mysqlEnabled = process.env.BAILING_NOTIFICATION_OUTBOX_TEST_MYSQL === '1';
|
|
22
|
+
const now = () => new Date().toISOString();
|
|
23
|
+
function job(patch: Partial<Job> = {}): Job {
|
|
24
|
+
return { job_id: randomUUID(), request_id: `notification-${randomUUID()}`, status: 'running', target: 'llm', source: 'synthetic',
|
|
25
|
+
profile: 'synthetic', project: '', input_preview: '', metadata: {}, callback_url: 'https://synthetic.invalid/callback',
|
|
26
|
+
created_at: now(), updated_at: now(), ...patch };
|
|
27
|
+
}
|
|
28
|
+
async function fixture(backend: 'jsonl' | 'mysql', baselineRoot?: string) {
|
|
29
|
+
if (backend === 'jsonl') {
|
|
30
|
+
const dir = await mkdtemp(join(tmpdir(), 'notification-journal-'));
|
|
31
|
+
const path = join(dir, 'state.jsonl'), store = new JsonlStore(path); await store.init();
|
|
32
|
+
return { store, path, pool: null, mysql: null, close: async () => { await store.close(); await rm(dir, { recursive: true, force: true }); } };
|
|
33
|
+
}
|
|
34
|
+
const database = `notification_outbox_${randomUUID().replaceAll('-', '')}`;
|
|
35
|
+
const mysql = { host: '127.0.0.1', port: Number(process.env.BAILING_NOTIFICATION_OUTBOX_TEST_MYSQL_PORT ?? 16307), user: 'root', password: '', database, connectionLimit: 8 };
|
|
36
|
+
const admin = createPool({ ...mysql, database: undefined, timezone: 'Z' });
|
|
37
|
+
await admin.query(`CREATE DATABASE \`${database}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin`);
|
|
38
|
+
const pool = createPool({ ...mysql, timezone: 'Z' });
|
|
39
|
+
try {
|
|
40
|
+
const migrator = baselineRoot ? (await import(pathToFileURL(join(baselineRoot, 'src/infrastructure/schema/core-schema-migrator.ts')).href)).migrateBailingHubCoreSchema : migrateBailingHubCoreSchema;
|
|
41
|
+
await migrator({ mysql, logger: { log() {}, warn() {} } });
|
|
42
|
+
const store = new MysqlStore(mysql, { get: async () => pool, close: async () => {} }); await store.init();
|
|
43
|
+
return { store, pool, mysql, path: '', close: async () => { await pool.end(); await admin.query(`DROP DATABASE \`${database}\``); await admin.end(); } };
|
|
44
|
+
} catch (error) { await pool.end(); await admin.query(`DROP DATABASE \`${database}\``); await admin.end(); throw error; }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
for (const backend of ['jsonl', 'mysql'] as const) {
|
|
48
|
+
test(`${backend}: terminal transaction freezes payload, duplicates and stale completions cannot emit again`, { skip: backend === 'mysql' && !mysqlEnabled }, async () => {
|
|
49
|
+
const h = await fixture(backend);
|
|
50
|
+
try {
|
|
51
|
+
const original = job({ claim_token: 'claim-1', dispatch: { delivery: { type: 'webhook', url: 'https://synthetic.invalid/delivery' } } });
|
|
52
|
+
await h.store.createJob(original);
|
|
53
|
+
await h.store.updateJob(original.job_id, { claim_token: 'claim-1' });
|
|
54
|
+
assert.equal(await h.store.completeJobWithNotifications({ ...original, claim_token: 'stale' }, { status: 'done' }), null);
|
|
55
|
+
const results = await Promise.all([1, 2].map(() => h.store.completeJobWithNotifications(original, { status: 'done', result: { text: 'first' } }, { brandName: 'Frozen brand' })));
|
|
56
|
+
assert.equal(results.filter(Boolean).length, 1);
|
|
57
|
+
assert.equal(await h.store.completeJobWithNotifications(original, { status: 'done', result: { text: 'overwrite' } }), null);
|
|
58
|
+
const events = await h.store.notificationOutbox.list();
|
|
59
|
+
assert.deepEqual(events.map(event => event.kind).sort(), ['callback', 'delivery']);
|
|
60
|
+
assert.equal(events[0]!.payload.job.result?.['text'], 'first');
|
|
61
|
+
assert.equal(events[0]!.payload.brand_name, 'Frozen brand');
|
|
62
|
+
await h.store.updateJob(original.job_id, { status: 'queued', attempts: 0, claim_token: undefined });
|
|
63
|
+
await h.store.updateJob(original.job_id, { status: 'running' });
|
|
64
|
+
await h.store.completeJobWithNotifications((await h.store.getJob(original.job_id))!, { status: 'done', result: { text: 'second' } });
|
|
65
|
+
const both = await h.store.notificationOutbox.list();
|
|
66
|
+
assert.equal(both.length, 4);
|
|
67
|
+
assert.equal(new Set(both.map(event => event.event_id)).size, 4);
|
|
68
|
+
assert.equal(both.filter(event => event.payload.job.result?.['text'] === 'first').length, 2);
|
|
69
|
+
assert.equal((await h.store.notificationOutbox.snapshot({ kinds: ['callback'] })).counts.pending, 2);
|
|
70
|
+
assert.equal((await h.store.notificationOutbox.list({ kinds: ['callback'], limit: 1, offset: 1 })).length, 1);
|
|
71
|
+
assert.equal((await h.store.notificationOutbox.list({ kinds: [] })).length, 0);
|
|
72
|
+
} finally { await h.close(); }
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test(`${backend}: ordinary terminal writes and TTL are durable; initial terminal and legacy state are not replayed`, { skip: backend === 'mysql' && !mysqlEnabled }, async () => {
|
|
76
|
+
const h = await fixture(backend);
|
|
77
|
+
try {
|
|
78
|
+
await h.store.createJob(job({ status: 'done' }));
|
|
79
|
+
assert.equal((await h.store.notificationOutbox.list()).length, 0);
|
|
80
|
+
const queued = job({ status: 'queued', created_at: new Date(Date.now() - 60_000).toISOString() });
|
|
81
|
+
await h.store.createJob(queued);
|
|
82
|
+
assert.equal(await h.store.expireStaleQueued(1000), 1);
|
|
83
|
+
assert.equal((await h.store.notificationOutbox.list()).length, 1);
|
|
84
|
+
assert.equal(await h.store.expireStaleQueued(1000), 0);
|
|
85
|
+
const rejected = job(); await h.store.createJob(rejected);
|
|
86
|
+
await h.store.updateJobIfStatus(rejected.job_id, ['running'], { status: 'rejected' });
|
|
87
|
+
const child = job({ source: 'delivery', target: 'sms-notify', callback_url: undefined }); await h.store.createJob(child);
|
|
88
|
+
await h.store.updateJob(child.job_id, { status: 'error', error: 'synthetic' });
|
|
89
|
+
assert.deepEqual((await h.store.notificationOutbox.list()).map(event => event.kind).sort(), ['callback', 'callback', 'delivery-dlq']);
|
|
90
|
+
if (h.path) {
|
|
91
|
+
const restarted = new JsonlStore(h.path); await restarted.init();
|
|
92
|
+
assert.equal((await restarted.notificationOutbox.list()).length, 3);
|
|
93
|
+
const records = (await readFile(h.path, 'utf8')).trim().split('\n').map(line => JSON.parse(line));
|
|
94
|
+
assert.ok(records.some(record => record.kind === 'job' && record.job.status === 'error' && record.notifications?.length));
|
|
95
|
+
}
|
|
96
|
+
} finally { await h.close(); }
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test(`${backend}: leases, expired-owner fencing, uncertainty and manual retry preserve identity`, { skip: backend === 'mysql' && !mysqlEnabled }, async () => {
|
|
100
|
+
const h = await fixture(backend);
|
|
101
|
+
try {
|
|
102
|
+
const original = job({ dispatch: { delivery: { type: 'channel', channel: 'synthetic', to: 'nobody' } } });
|
|
103
|
+
await h.store.createJob(original); await h.store.completeJobWithNotifications(original, { status: 'done', result: { text: 'synthetic' } });
|
|
104
|
+
const old = new Date(Date.now() - 20_000).toISOString();
|
|
105
|
+
// Make the expired first claim without any external call.
|
|
106
|
+
const claimed = await h.store.notificationOutbox.claim({ owner: 'old', leaseMs: 100, now: new Date(Date.now() + 1000).toISOString() });
|
|
107
|
+
assert.equal(claimed.length, 2);
|
|
108
|
+
if (h.pool) await h.pool.query('UPDATE bz_notification_outbox SET lease_until=?', [old.replace('T', ' ').replace('Z', '')]);
|
|
109
|
+
else {
|
|
110
|
+
await appendFile(h.path, JSON.stringify({ kind: 'notification-events', events: claimed.map(event => ({ ...event, lease_until: old })) }) + '\n');
|
|
111
|
+
const reopened = new JsonlStore(h.path); await reopened.init(); h.store = reopened;
|
|
112
|
+
}
|
|
113
|
+
const callback = claimed.find(event => event.kind === 'callback')!, native = claimed.find(event => event.kind === 'delivery')!;
|
|
114
|
+
assert.equal(await h.store.notificationOutbox.complete(callback.event_id, callback.lease_token!), false);
|
|
115
|
+
assert.equal(await h.store.notificationOutbox.renew(callback.event_id, callback.lease_token!, 1000), false);
|
|
116
|
+
const claims = await Promise.all([1, 2].map(i => h.store.notificationOutbox.claim({ owner: `worker-${i}`, leaseMs: 60_000 })));
|
|
117
|
+
const all = claims.flat(); assert.equal(all.length, 1); assert.equal(all[0]!.event_id, callback.event_id);
|
|
118
|
+
assert.equal((await h.store.notificationOutbox.get(native.event_id))?.status, 'uncertain');
|
|
119
|
+
assert.equal(await h.store.notificationOutbox.retry(native.event_id), false);
|
|
120
|
+
assert.equal(await h.store.notificationOutbox.retry(native.event_id, { allowUncertain: true, expectedStatus: 'failed' }), false);
|
|
121
|
+
assert.equal(await h.store.notificationOutbox.retry(native.event_id, { allowUncertain: true, expectedStatus: 'uncertain' }), true);
|
|
122
|
+
assert.equal((await h.store.notificationOutbox.get(native.event_id))?.attempts, 1);
|
|
123
|
+
assert.equal((await h.store.notificationOutbox.get(native.event_id))?.cycle_attempts, 0);
|
|
124
|
+
assert.equal(await h.store.notificationOutbox.fail(callback.event_id, all[0]!.lease_token!, { status: 'failed', error: 'https://secret.invalid/?token=secret' }), true);
|
|
125
|
+
assert.equal((await h.store.notificationOutbox.get(callback.event_id))?.last_error, 'notification_delivery_failed');
|
|
126
|
+
assert.equal(await h.store.notificationOutbox.retry(callback.event_id, { expectedStatus: 'failed' }), true);
|
|
127
|
+
const renewed = (await h.store.notificationOutbox.claim({ owner: 'new', kinds: ['callback'], leaseMs: 1000 }))[0]!;
|
|
128
|
+
assert.equal(renewed.attempts, 3); assert.equal(renewed.cycle_attempts, 1);
|
|
129
|
+
assert.equal(await h.store.notificationOutbox.renew(renewed.event_id, renewed.lease_token!, 2000), true);
|
|
130
|
+
assert.equal(await h.store.notificationOutbox.complete(renewed.event_id, renewed.lease_token!), true);
|
|
131
|
+
assert.equal(await h.store.notificationOutbox.retry(renewed.event_id, { allowUncertain: true }), false);
|
|
132
|
+
// A provider can return a secret which looks like a syntactically valid code.
|
|
133
|
+
// Neither persistence nor get/list may promote it to an operator-visible code.
|
|
134
|
+
for (const [unsafe, expected] of [
|
|
135
|
+
['SyntheticTokenA123456789', 'notification_delivery_failed'],
|
|
136
|
+
['private_customer_refund_details', 'notification_delivery_failed'],
|
|
137
|
+
['notification_unknown_private_suffix', 'notification_delivery_failed'],
|
|
138
|
+
['webhook_http_503', 'webhook_http_503'],
|
|
139
|
+
]) {
|
|
140
|
+
const privateJob = job(); await h.store.createJob(privateJob);
|
|
141
|
+
await h.store.completeJobWithNotifications(privateJob, { status: 'done' });
|
|
142
|
+
const privateEvent = (await h.store.notificationOutbox.claim({ owner: 'privacy', kinds: ['callback'], limit: 1 }))[0]!;
|
|
143
|
+
assert.equal(await h.store.notificationOutbox.fail(privateEvent.event_id, privateEvent.lease_token!, { status: 'failed', error: unsafe! }), true);
|
|
144
|
+
assert.equal((await h.store.notificationOutbox.get(privateEvent.event_id))?.last_error, expected);
|
|
145
|
+
assert.equal((await h.store.notificationOutbox.list({ kinds: ['callback'], statuses: ['failed'] })).find(event => event.event_id === privateEvent.event_id)?.last_error, expected);
|
|
146
|
+
if (h.pool) {
|
|
147
|
+
const [stored]: any = await h.pool.query('SELECT last_error FROM bz_notification_outbox WHERE event_id=?', [privateEvent.event_id]);
|
|
148
|
+
assert.equal(stored[0].last_error, expected);
|
|
149
|
+
} else if (unsafe !== expected) assert.ok(!(await readFile(h.path, 'utf8')).includes(unsafe!));
|
|
150
|
+
}
|
|
151
|
+
} finally { await h.close(); }
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
test('notification error boundary accepts only known Core codes and exact HTTP status codes', () => {
|
|
156
|
+
assert.equal(safeNotificationError(undefined), undefined);
|
|
157
|
+
for (const code of ['notification_delivery_failed', 'notification_delivery_uncertain', 'notification_attempt_limit',
|
|
158
|
+
'notification_child_binding_conflict', 'approval_notification_binding_conflict', 'webhook_acknowledgement_unavailable',
|
|
159
|
+
'webhook_http_100', 'webhook_http_429', 'webhook_http_599']) assert.equal(safeNotificationError(code), code);
|
|
160
|
+
for (const text of ['', 'SyntheticTokenA123456789', 'private_customer_refund_details', 'webhook_http_099', 'webhook_http_600',
|
|
161
|
+
'webhook_http_500_secret', 'webhook_http_500\n', 'notification_attempt_limit:secret', 'NOTIFICATION_ATTEMPT_LIMIT']) {
|
|
162
|
+
assert.equal(safeNotificationError(text), 'notification_delivery_failed');
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test('JSONL repairs only an incomplete tail, keeps valid no-newline records, and rejects damaged middle data', async () => {
|
|
167
|
+
const h = await fixture('jsonl');
|
|
168
|
+
try {
|
|
169
|
+
const original = job(); await h.store.createJob(original);
|
|
170
|
+
await h.store.completeJobWithNotifications(original, { status: 'done' });
|
|
171
|
+
await appendFile(h.path, '{"kind":"job","job":');
|
|
172
|
+
const reopened = new JsonlStore(h.path); await reopened.init();
|
|
173
|
+
assert.equal((await reopened.getJob(original.job_id))?.status, 'done');
|
|
174
|
+
assert.equal((await reopened.notificationOutbox.list()).length, 1);
|
|
175
|
+
await reopened.createJob(job());
|
|
176
|
+
const valid = await readFile(h.path, 'utf8');
|
|
177
|
+
await writeFile(h.path, valid.trimEnd());
|
|
178
|
+
await new JsonlStore(h.path).init();
|
|
179
|
+
assert.ok((await readFile(h.path, 'utf8')).endsWith('\n'));
|
|
180
|
+
await writeFile(h.path, '{bad}\n' + valid);
|
|
181
|
+
await assert.rejects(new JsonlStore(h.path).init(), /jsonl_journal_corrupt_record/);
|
|
182
|
+
} finally { await h.close(); }
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test('JSONL failed append exposes no terminal state or intention, and refuses further writes until reopen', async () => {
|
|
186
|
+
const h = await fixture('jsonl');
|
|
187
|
+
try {
|
|
188
|
+
const original = job(); await h.store.createJob(original);
|
|
189
|
+
await rm(h.path); await mkdir(h.path);
|
|
190
|
+
await assert.rejects(h.store.completeJobWithNotifications(original, { status: 'done' }));
|
|
191
|
+
assert.equal((await h.store.getJob(original.job_id))?.status, 'running');
|
|
192
|
+
assert.equal((await h.store.notificationOutbox.list()).length, 0);
|
|
193
|
+
await assert.rejects(h.store.updateJob(original.job_id, { status: 'done' }), /jsonl_journal_reopen_required/);
|
|
194
|
+
} finally { await h.close(); }
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
test('JSONL actual SIGKILL after file sync but before memory publication recovers the terminal and original event together', async () => {
|
|
198
|
+
const h = await fixture('jsonl');
|
|
199
|
+
const child = fork(fileURLToPath(new URL('../../test-support/notification-outbox-journal-crash-child.ts', import.meta.url)), [],
|
|
200
|
+
{ execArgv: ['--import', 'tsx'], env: { PATH: process.env.PATH }, stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });
|
|
201
|
+
const timeout = setTimeout(() => child.kill('SIGKILL'), 10_000);
|
|
202
|
+
try {
|
|
203
|
+
const checkpoint = new Promise<any>((resolve, reject) => {
|
|
204
|
+
child.once('message', (message: any) => message.error ? reject(new Error(message.error)) : resolve(message));
|
|
205
|
+
child.once('error', reject);
|
|
206
|
+
child.once('exit', () => reject(new Error('journal worker exited before its checkpoint')));
|
|
207
|
+
});
|
|
208
|
+
const exit = new Promise<NodeJS.Signals | null>(resolve => child.once('exit', (_code, signal) => resolve(signal)));
|
|
209
|
+
const original = job(); child.send({ path: h.path, job: original });
|
|
210
|
+
assert.equal((await checkpoint).stage, 'after-sync-before-memory-publication');
|
|
211
|
+
assert.equal(await exit, 'SIGKILL');
|
|
212
|
+
const reopened = new JsonlStore(h.path); await reopened.init();
|
|
213
|
+
assert.equal((await reopened.getJob(original.job_id))?.status, 'done');
|
|
214
|
+
const events = await reopened.notificationOutbox.list(); assert.equal(events.length, 1);
|
|
215
|
+
assert.equal(events[0]!.payload.job.result?.['text'], 'synthetic committed');
|
|
216
|
+
assert.equal(await reopened.completeJobWithNotifications(original, { status: 'done' }), null);
|
|
217
|
+
const claimed = await reopened.notificationOutbox.claim({ owner: 'restarted' });
|
|
218
|
+
assert.equal(claimed[0]!.event_id, events[0]!.event_id);
|
|
219
|
+
assert.equal((await reopened.getJob(original.job_id))?.status, 'done', 'recovering a notification never requeues its business parent');
|
|
220
|
+
} finally { clearTimeout(timeout); child.kill('SIGKILL'); await h.close(); }
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test('MySQL terminal transaction rolls back on outbox failure; lost COMMIT response does not duplicate intentions', { skip: !mysqlEnabled }, async () => {
|
|
224
|
+
const h = await fixture('mysql');
|
|
225
|
+
try {
|
|
226
|
+
const original = job(); await h.store.createJob(original);
|
|
227
|
+
let fault: 'insert' | 'commit' = 'insert';
|
|
228
|
+
const store = new MysqlStore(h.mysql!, { close: async () => {}, get: async () => ({ ...h.pool!, getConnection: async () => {
|
|
229
|
+
const connection = await h.pool!.getConnection(), query = connection.query.bind(connection), commit = connection.commit.bind(connection);
|
|
230
|
+
connection.query = (async (sql: any, values: any) => {
|
|
231
|
+
if (String(sql).startsWith('INSERT INTO bz_notification_outbox') && fault === 'insert') throw new Error('synthetic_outbox_failure');
|
|
232
|
+
return query(sql, values);
|
|
233
|
+
}) as any;
|
|
234
|
+
connection.commit = async () => { await commit(); if (fault === 'commit') throw new Error('synthetic_commit_response_lost'); };
|
|
235
|
+
const release = connection.release.bind(connection);
|
|
236
|
+
connection.release = () => { connection.query = query as any; connection.commit = commit; release(); };
|
|
237
|
+
return connection;
|
|
238
|
+
} }) as any });
|
|
239
|
+
await store.init();
|
|
240
|
+
await assert.rejects(store.completeJobWithNotifications(original, { status: 'done' }), /synthetic_outbox_failure/);
|
|
241
|
+
assert.equal((await h.store.getJob(original.job_id))?.status, 'running');
|
|
242
|
+
assert.equal((await h.store.notificationOutbox.list()).length, 0);
|
|
243
|
+
fault = 'commit';
|
|
244
|
+
await assert.rejects(store.completeJobWithNotifications(original, { status: 'done' }), /synthetic_commit_response_lost/);
|
|
245
|
+
assert.equal((await h.store.getJob(original.job_id))?.status, 'done');
|
|
246
|
+
assert.equal((await h.store.notificationOutbox.list()).length, 1);
|
|
247
|
+
assert.equal(await h.store.completeJobWithNotifications(original, { status: 'done' }), null);
|
|
248
|
+
} finally { await h.close(); }
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
test('MySQL approval creation and frozen notification share the owning transaction, including lost COMMIT acknowledgement', { skip: !mysqlEnabled }, async () => {
|
|
252
|
+
const h = await fixture('mysql');
|
|
253
|
+
try {
|
|
254
|
+
const original = job(); await h.store.createJob(original);
|
|
255
|
+
const approval = { job_id: original.job_id, request_id: original.request_id, provider: 'synthetic', tool: 'synthetic_tool', scope: 'synthetic.write', risk: 'high', args_hash: 'a'.repeat(64), args_json: '{"x":1}' };
|
|
256
|
+
const draft: ApprovalNotificationDraft = { job: original, provider_name: 'synthetic', subject: 'synthetic-subject', brand_name: 'Frozen',
|
|
257
|
+
snap: { tool: approval.tool, scope: approval.scope, risk: 'high', policy: 'approval', reason: 'synthetic', method: 'POST', path: '/synthetic', args_json: approval.args_json, args_hash: approval.args_hash },
|
|
258
|
+
destination: { type: 'webhook', url: 'https://synthetic.invalid/approval' } };
|
|
259
|
+
let fault: 'insert' | 'commit' = 'insert';
|
|
260
|
+
const ledger = new ApprovalLedger(() => ({ getConnection: async () => {
|
|
261
|
+
const connection = await h.pool!.getConnection(), query = connection.query.bind(connection), commit = connection.commit.bind(connection), release = connection.release.bind(connection);
|
|
262
|
+
connection.query = (async (sql: any, values: any) => {
|
|
263
|
+
if (String(sql).startsWith('INSERT INTO bz_notification_outbox') && fault === 'insert') throw new Error('synthetic_intent_failure');
|
|
264
|
+
return query(sql, values);
|
|
265
|
+
}) as any;
|
|
266
|
+
connection.commit = async () => { await commit(); if (fault === 'commit') throw new Error('synthetic_approval_commit_lost'); };
|
|
267
|
+
connection.release = () => { connection.query = query as any; connection.commit = commit; release(); };
|
|
268
|
+
return connection;
|
|
269
|
+
} }));
|
|
270
|
+
await assert.rejects(ledger.createWithNotification(approval, draft), /synthetic_intent_failure/);
|
|
271
|
+
const goodLedger = new ApprovalLedger(() => h.pool!);
|
|
272
|
+
assert.equal(await goodLedger.find(original.job_id, approval.tool, approval.args_hash, 'pending'), null);
|
|
273
|
+
assert.equal((await h.store.notificationOutbox.list()).length, 0);
|
|
274
|
+
fault = 'commit';
|
|
275
|
+
await assert.rejects(ledger.createWithNotification(approval, draft), /synthetic_approval_commit_lost/);
|
|
276
|
+
const saved = await goodLedger.find(original.job_id, approval.tool, approval.args_hash, 'pending'); assert.ok(saved);
|
|
277
|
+
const configOutbox = new MysqlNotificationOutbox(() => h.pool!);
|
|
278
|
+
const events = await configOutbox.list({ kinds: ['approval-notification'] }); assert.equal(events.length, 1);
|
|
279
|
+
assert.equal(events[0]!.event_id, `approval:${saved.id}`);
|
|
280
|
+
assert.equal((events[0]!.payload as ApprovalNotificationDraft).destination?.url, 'https://synthetic.invalid/approval');
|
|
281
|
+
assert.equal((await h.store.notificationOutbox.list({ kinds: ['callback', 'delivery', 'delivery-dlq'] })).length, 0);
|
|
282
|
+
assert.equal((await h.store.notificationOutbox.claim({ owner: 'state', kinds: ['callback', 'delivery', 'delivery-dlq'] })).length, 0);
|
|
283
|
+
assert.equal((await configOutbox.claim({ owner: 'config', kinds: ['approval-notification'] })).length, 1);
|
|
284
|
+
await assert.rejects(goodLedger.createWithNotification(approval, { ...draft, subject: 'test', job: { ...original, job_id: 'other' } }), /binding_mismatch/);
|
|
285
|
+
} finally { await h.close(); }
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
test('MySQL durable DLQ event identity deduplicates concurrent creation and retains resolved status', { skip: !mysqlEnabled }, async () => {
|
|
289
|
+
const h = await fixture('mysql');
|
|
290
|
+
try {
|
|
291
|
+
const ledger = new DeliveryDlqLedger(() => h.pool!);
|
|
292
|
+
const record = { parentJobId: 'synthetic-parent', channel: 'synthetic-channel', recipient: 'synthetic-recipient', content: 'synthetic payload', error: 'synthetic_failure', deliveryKind: 'native_channel' as const, eventId: `synthetic:${randomUUID()}` };
|
|
293
|
+
await Promise.all(Array.from({ length: 8 }, () => ledger.record(record)));
|
|
294
|
+
const rows = await ledger.list(); assert.equal(rows.length, 1); assert.equal(rows[0]!.event_id, record.eventId);
|
|
295
|
+
assert.equal((await ledger.get(rows[0]!.id))?.event_id, record.eventId);
|
|
296
|
+
await ledger.resolveByEventId(record.eventId); await ledger.record(record);
|
|
297
|
+
assert.equal((await ledger.get(rows[0]!.id))?.resolved, true);
|
|
298
|
+
await assert.rejects(ledger.record({ ...record, recipient: 'different' }), /notification_dlq_identity_conflict/);
|
|
299
|
+
await ledger.record({ ...record, eventId: undefined }); await ledger.record({ ...record, eventId: undefined });
|
|
300
|
+
assert.equal((await ledger.list(true)).length, 3, 'legacy rows without event identities keep their existing semantics');
|
|
301
|
+
} finally { await h.close(); }
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const baselineRoot = process.env.BAILING_NOTIFICATION_OUTBOX_BASELINE_ROOT;
|
|
305
|
+
test('MySQL 067 -> 068 migration preserves original rows and checksums, adds no retrospective notifications, and runs once', { skip: !mysqlEnabled || !baselineRoot }, async () => {
|
|
306
|
+
const h = await fixture('mysql', baselineRoot);
|
|
307
|
+
try {
|
|
308
|
+
const original = job({ status: 'done', result: { text: 'legacy immutable' } }); await h.store.createJob(original);
|
|
309
|
+
await h.pool!.query("INSERT INTO bz_delivery_dlq(parent_job_id,channel,recipient,content,error,resolved,created_at) VALUES (?,?,?,?,?,0,NOW())", [original.job_id, 'legacy', 'synthetic', 'legacy body', 'legacy error']);
|
|
310
|
+
const [beforeJobs]: any = await h.pool!.query('SELECT * FROM bz_jobs');
|
|
311
|
+
const [beforeDlq]: any = await h.pool!.query('SELECT * FROM bz_delivery_dlq');
|
|
312
|
+
const [beforeMigrations]: any = await h.pool!.query('SELECT filename,checksum_sha256 FROM bz_schema_migrations ORDER BY filename');
|
|
313
|
+
const result = await migrateBailingHubCoreSchema({ mysql: h.mysql!, logger: { log() {}, warn() {} } });
|
|
314
|
+
assert.deepEqual(result.appliedFiles, ['068_notification_outbox.sql']);
|
|
315
|
+
const [afterJobs]: any = await h.pool!.query('SELECT * FROM bz_jobs');
|
|
316
|
+
const [afterDlq]: any = await h.pool!.query('SELECT * FROM bz_delivery_dlq');
|
|
317
|
+
assert.deepEqual(afterJobs, beforeJobs);
|
|
318
|
+
assert.deepEqual(afterDlq.map(({ event_id: _event, ...row }: any) => row), beforeDlq);
|
|
319
|
+
assert.equal(afterDlq[0].event_id, null);
|
|
320
|
+
assert.equal((await h.store.notificationOutbox.list()).length, 0);
|
|
321
|
+
assert.equal((await migrateBailingHubCoreSchema({ mysql: h.mysql!, logger: { log() {}, warn() {} } })).appliedFiles.length, 0);
|
|
322
|
+
const [afterMigrations]: any = await h.pool!.query('SELECT filename,checksum_sha256 FROM bz_schema_migrations WHERE filename<>? ORDER BY filename', ['068_notification_outbox.sql']);
|
|
323
|
+
assert.deepEqual(afterMigrations, beforeMigrations);
|
|
324
|
+
} finally { await h.close(); }
|
|
325
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
|
-
import {
|
|
3
|
+
import { mkdir, open, readFile } from 'node:fs/promises';
|
|
4
4
|
import { dirname } from 'node:path';
|
|
5
5
|
import { completeTraceEntry } from '../../core/runtime/trace-runtime';
|
|
6
6
|
import { JOB_STATUSES, TERMINAL_JOB_STATUSES, type AuditEntry, type Job } from '../../core/contracts/types';
|
|
@@ -9,6 +9,9 @@ import type { ApprovalRequeueInput, ApprovalRequeueOutcome } from '../../core/co
|
|
|
9
9
|
import { approvalRequeuePlan } from '../../core/state/approval-continuation';
|
|
10
10
|
import { deliveryRequeuePlan } from '../../core/state/delivery-replay';
|
|
11
11
|
import type { DeliveryRequeueInput, DeliveryRequeueOutcome } from '../../core/contracts/delivery-replay';
|
|
12
|
+
import type { NotificationEvent } from '../../core/contracts/notification-outbox';
|
|
13
|
+
import { completionMatches, terminalJob, terminalNotifications } from '../../core/state/notification-outbox';
|
|
14
|
+
import { JsonlNotificationOutbox } from './notification-outbox-jsonl';
|
|
12
15
|
|
|
13
16
|
/** jsonl 后端:本地烟测与最小私有部署。状态仍是中枢自己的,不进业务库。 */
|
|
14
17
|
export class JsonlStore implements RuntimeStateStore {
|
|
@@ -16,9 +19,15 @@ export class JsonlStore implements RuntimeStateStore {
|
|
|
16
19
|
private readonly byRequest = new Map<string, string>();
|
|
17
20
|
private readonly locks = new Map<string, { owner: string; expiresAt: number }>();
|
|
18
21
|
private jobWrite: Promise<void> = Promise.resolve();
|
|
22
|
+
private writeFailed = false;
|
|
23
|
+
readonly notificationOutbox = new JsonlNotificationOutbox(work => this.serialJobWrite(work),
|
|
24
|
+
events => this.persistRecord({ kind: 'notification-events', events }));
|
|
19
25
|
|
|
20
26
|
private async serialJobWrite<T>(write: () => Promise<T>): Promise<T> {
|
|
21
|
-
const work = this.jobWrite.then(
|
|
27
|
+
const work = this.jobWrite.then(() => {
|
|
28
|
+
if (this.writeFailed) throw new Error('jsonl_journal_reopen_required');
|
|
29
|
+
return write();
|
|
30
|
+
});
|
|
22
31
|
this.jobWrite = work.then(() => undefined, () => undefined);
|
|
23
32
|
return await work;
|
|
24
33
|
}
|
|
@@ -28,18 +37,34 @@ export class JsonlStore implements RuntimeStateStore {
|
|
|
28
37
|
async init(): Promise<void> {
|
|
29
38
|
await mkdir(dirname(this.path), { recursive: true });
|
|
30
39
|
if (!existsSync(this.path)) return;
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
let bytes = await readFile(this.path);
|
|
41
|
+
// A killed append may leave an incomplete final line. Never concatenate a
|
|
42
|
+
// subsequent record onto that fragment, or silently skip damaged middle data.
|
|
43
|
+
if (bytes.length && bytes[bytes.length - 1] !== 10) {
|
|
44
|
+
const boundary = bytes.lastIndexOf(10) + 1;
|
|
45
|
+
const tail = bytes.subarray(boundary).toString('utf8');
|
|
46
|
+
let complete = false;
|
|
47
|
+
try { JSON.parse(tail); complete = true; } catch { /* incomplete tail */ }
|
|
48
|
+
const file = await open(this.path, 'r+');
|
|
49
|
+
try {
|
|
50
|
+
if (complete) { await file.write(Buffer.from('\n'), 0, 1, bytes.length); bytes = Buffer.concat([bytes, Buffer.from('\n')]); }
|
|
51
|
+
else { await file.truncate(boundary); bytes = bytes.subarray(0, boundary); }
|
|
52
|
+
await file.sync();
|
|
53
|
+
} finally { await file.close(); }
|
|
54
|
+
}
|
|
55
|
+
for (const line of bytes.toString('utf8').split('\n')) {
|
|
33
56
|
const l = line.trim();
|
|
34
57
|
if (!l) continue;
|
|
35
58
|
try {
|
|
36
|
-
const rec = JSON.parse(l) as { kind?: string; job?: Job };
|
|
59
|
+
const rec = JSON.parse(l) as { kind?: string; job?: Job; notifications?: NotificationEvent[]; events?: NotificationEvent[] };
|
|
37
60
|
if (rec.kind === 'job' && rec.job) {
|
|
38
61
|
this.jobs.set(rec.job.job_id, rec.job);
|
|
39
62
|
this.byRequest.set(rec.job.request_id, rec.job.job_id);
|
|
63
|
+
if (rec.notifications) this.notificationOutbox.publish(rec.notifications);
|
|
40
64
|
}
|
|
65
|
+
if (rec.kind === 'notification-events' && rec.events) this.notificationOutbox.publish(rec.events);
|
|
41
66
|
} catch {
|
|
42
|
-
|
|
67
|
+
throw new Error('jsonl_journal_corrupt_record');
|
|
43
68
|
}
|
|
44
69
|
}
|
|
45
70
|
}
|
|
@@ -51,6 +76,9 @@ export class JsonlStore implements RuntimeStateStore {
|
|
|
51
76
|
|
|
52
77
|
async createJob(job: Job): Promise<void> {
|
|
53
78
|
await this.serialJobWrite(async () => {
|
|
79
|
+
if (this.jobs.has(job.job_id) || this.byRequest.has(job.request_id)) {
|
|
80
|
+
throw Object.assign(new Error('job_identity_conflict'), { code: 'ER_DUP_ENTRY' });
|
|
81
|
+
}
|
|
54
82
|
await this.persist(job);
|
|
55
83
|
this.jobs.set(job.job_id, job);
|
|
56
84
|
this.byRequest.set(job.request_id, job.job_id);
|
|
@@ -61,13 +89,22 @@ export class JsonlStore implements RuntimeStateStore {
|
|
|
61
89
|
return await this.serialJobWrite(async () => this.writeJob(jobId, patch));
|
|
62
90
|
}
|
|
63
91
|
|
|
64
|
-
|
|
92
|
+
async completeJobWithNotifications(original: Job, patch: Partial<Job>, context?: { brandName?: string }): Promise<Job | null> {
|
|
93
|
+
return this.serialJobWrite(async () => {
|
|
94
|
+
if (!terminalJob({ ...original, ...patch }) || !completionMatches(this.jobs.get(original.job_id) ?? null, original)) return null;
|
|
95
|
+
return this.writeJob(original.job_id, patch, undefined, context);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private async writeJob(jobId: string, patch: Partial<Job>, expectedStatuses?: Array<Job['status']>, context?: { brandName?: string }): Promise<Job | null> {
|
|
65
100
|
const cur = this.jobs.get(jobId);
|
|
66
101
|
if (!cur || (expectedStatuses && !expectedStatuses.includes(cur.status))) return null;
|
|
67
102
|
const { approval_continuation_keys: _ignored, delivery_replay_keys: _ignoredDelivery, ...ordinaryPatch } = patch;
|
|
68
103
|
const next: Job = { ...cur, ...ordinaryPatch, updated_at: new Date().toISOString() };
|
|
69
|
-
|
|
104
|
+
const events = terminalNotifications(cur, next, context);
|
|
105
|
+
await this.persist(next, events);
|
|
70
106
|
this.jobs.set(jobId, next);
|
|
107
|
+
this.notificationOutbox.publish(events);
|
|
71
108
|
return next;
|
|
72
109
|
}
|
|
73
110
|
|
|
@@ -217,8 +254,7 @@ export class JsonlStore implements RuntimeStateStore {
|
|
|
217
254
|
let n = 0;
|
|
218
255
|
for (const job of this.jobs.values()) {
|
|
219
256
|
if (job.status === 'queued' && job.created_at && new Date(job.created_at).getTime() < cutoff) {
|
|
220
|
-
await this.
|
|
221
|
-
n++;
|
|
257
|
+
if (await this.updateJobIfStatus(job.job_id, ['queued'], { status: 'error', error: '排队超时:执行器长时间不可用,任务已过期(避免恢复后陈旧任务全量重放)' })) n++;
|
|
222
258
|
}
|
|
223
259
|
}
|
|
224
260
|
return n;
|
|
@@ -300,14 +336,29 @@ export class JsonlStore implements RuntimeStateStore {
|
|
|
300
336
|
}
|
|
301
337
|
|
|
302
338
|
async appendAudit(entry: AuditEntry): Promise<void> {
|
|
303
|
-
await
|
|
339
|
+
await this.serialJobWrite(() => this.persistRecord({ kind: 'audit', entry: completeTraceEntry(entry) }));
|
|
304
340
|
}
|
|
305
341
|
|
|
306
342
|
async pruneAuditOlderThan(_cutoffIso: string): Promise<number> {
|
|
307
343
|
return 0;
|
|
308
344
|
}
|
|
309
345
|
|
|
310
|
-
|
|
311
|
-
|
|
346
|
+
async close(): Promise<void> { await this.jobWrite; }
|
|
347
|
+
|
|
348
|
+
private async persist(job: Job, notifications: NotificationEvent[] = []): Promise<void> {
|
|
349
|
+
await this.persistRecord({ kind: 'job', job, ...(notifications.length ? { notifications } : {}) });
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
private async persistRecord(record: unknown): Promise<void> {
|
|
353
|
+
try {
|
|
354
|
+
const file = await open(this.path, 'a');
|
|
355
|
+
try { await file.writeFile(JSON.stringify(record) + '\n', 'utf8'); await file.sync(); }
|
|
356
|
+
finally { await file.close(); }
|
|
357
|
+
} catch (error) {
|
|
358
|
+
// A write/sync acknowledgement can be ambiguous. Reopen the journal before
|
|
359
|
+
// accepting another mutation instead of creating a second terminal event.
|
|
360
|
+
this.writeFailed = true;
|
|
361
|
+
throw error;
|
|
362
|
+
}
|
|
312
363
|
}
|
|
313
364
|
}
|
|
@@ -11,11 +11,14 @@ import type { ApprovalRequeueInput, ApprovalRequeueOutcome } from '../../core/co
|
|
|
11
11
|
import { approvalRequeuePlan } from '../../core/state/approval-continuation';
|
|
12
12
|
import { deliveryRequeuePlan } from '../../core/state/delivery-replay';
|
|
13
13
|
import { isOriginalExecutorDelivery, type DeliveryRequeueInput, type DeliveryRequeueOutcome } from '../../core/contracts/delivery-replay';
|
|
14
|
+
import { completionMatches, terminalNotifications } from '../../core/state/notification-outbox';
|
|
15
|
+
import { insertNotificationEvents, MysqlNotificationOutbox } from './notification-outbox-mysql';
|
|
14
16
|
|
|
15
17
|
/** mysql 后端:生产状态库。对应 sql/001_init_state.sql 的 bz_ 表。 */
|
|
16
18
|
export class MysqlStore implements RuntimeStateStore {
|
|
17
19
|
private pool!: Pool;
|
|
18
20
|
private readonly poolOwner: MysqlPoolResource;
|
|
21
|
+
readonly notificationOutbox = new MysqlNotificationOutbox(() => this.pool);
|
|
19
22
|
|
|
20
23
|
constructor(cfg: AppConfig['state']['mysql'], poolOwner?: MysqlPoolResource) {
|
|
21
24
|
this.poolOwner = poolOwner ?? new MysqlPoolOwner(cfg);
|
|
@@ -54,6 +57,32 @@ export class MysqlStore implements RuntimeStateStore {
|
|
|
54
57
|
return this.writeJob(jobId, patch);
|
|
55
58
|
}
|
|
56
59
|
|
|
60
|
+
async completeJobWithNotifications(original: Job, patch: Partial<Job>, context?: { brandName?: string }): Promise<Job | null> {
|
|
61
|
+
if (!['done', 'error', 'rejected'].includes(String(patch.status))) return null;
|
|
62
|
+
return this.writeTerminalJob(original.job_id, patch, undefined, original, context);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private async writeTerminalJob(jobId: string, patch: Partial<Job>, expectedStatuses?: Job['status'][], original?: Job,
|
|
66
|
+
context?: { brandName?: string }): Promise<Job | null> {
|
|
67
|
+
const connection = await this.pool.getConnection();
|
|
68
|
+
try {
|
|
69
|
+
await connection.beginTransaction();
|
|
70
|
+
const [rows]: any = await connection.query('SELECT * FROM bz_jobs WHERE job_id=? FOR UPDATE', [jobId]);
|
|
71
|
+
const previous = rows[0] ? rowToJob(rows[0]) : null;
|
|
72
|
+
if (!previous || (expectedStatuses && !expectedStatuses.includes(previous.status)) || (original && !completionMatches(previous, original))) {
|
|
73
|
+
await connection.commit(); return null;
|
|
74
|
+
}
|
|
75
|
+
const update = mysqlJobUpdatePlan(patch, new Date().toISOString());
|
|
76
|
+
await connection.query(`UPDATE bz_jobs SET ${update.assignments.join(',')} WHERE job_id=?`, [...update.values, jobId]);
|
|
77
|
+
const [updatedRows]: any = await connection.query('SELECT * FROM bz_jobs WHERE job_id=?', [jobId]);
|
|
78
|
+
const updated = rowToJob(updatedRows[0]);
|
|
79
|
+
await insertNotificationEvents(connection, terminalNotifications(previous, updated, context));
|
|
80
|
+
await connection.commit();
|
|
81
|
+
return updated;
|
|
82
|
+
} catch (error) { await connection.rollback().catch(() => undefined); throw error; }
|
|
83
|
+
finally { connection.release(); }
|
|
84
|
+
}
|
|
85
|
+
|
|
57
86
|
async requeueApprovedJobOnce(input: ApprovalRequeueInput): Promise<ApprovalRequeueOutcome> {
|
|
58
87
|
const conn = await this.pool.getConnection();
|
|
59
88
|
try {
|
|
@@ -110,6 +139,7 @@ export class MysqlStore implements RuntimeStateStore {
|
|
|
110
139
|
}
|
|
111
140
|
|
|
112
141
|
private async writeJob(jobId: string, patch: Partial<Job>, expectedStatuses?: Array<Job['status']>): Promise<Job | null> {
|
|
142
|
+
if (['done', 'error', 'rejected'].includes(String(patch.status))) return this.writeTerminalJob(jobId, patch, expectedStatuses);
|
|
113
143
|
const plan = mysqlJobUpdatePlan(patch, new Date().toISOString());
|
|
114
144
|
const whereStatus = expectedStatuses?.length ? ` AND status IN (${expectedStatuses.map(() => '?').join(',')})` : '';
|
|
115
145
|
const [r]: any = await this.pool.query(
|
|
@@ -312,11 +342,12 @@ export class MysqlStore implements RuntimeStateStore {
|
|
|
312
342
|
|
|
313
343
|
async expireStaleQueued(ttlMs: number): Promise<number> {
|
|
314
344
|
const cutoff = dt(new Date(Date.now() - ttlMs).toISOString());
|
|
315
|
-
const [
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
345
|
+
const [rows]: any = await this.pool.query("SELECT job_id FROM bz_jobs WHERE status='queued' AND created_at<? ORDER BY created_at LIMIT 500", [cutoff]);
|
|
346
|
+
let count = 0;
|
|
347
|
+
for (const row of rows) if (await this.updateJobIfStatus(row.job_id, ['queued'], {
|
|
348
|
+
status: 'error', error: '排队超时:执行器长时间不可用,任务已过期(避免恢复后陈旧任务全量重放)',
|
|
349
|
+
})) count++;
|
|
350
|
+
return count;
|
|
320
351
|
}
|
|
321
352
|
|
|
322
353
|
async countInflightByThread(threadId: number): Promise<number> {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
import { Readable } from 'node:stream';
|
|
4
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
|
+
import type { Principal } from '../app/auth';
|
|
6
|
+
import type { RuntimeStateStore } from '../core/state/state-contracts';
|
|
7
|
+
import type { ConfigStoreContract } from '../infrastructure/config/configstore';
|
|
8
|
+
import type { NotificationEvent, NotificationOutboxRepository } from '../core/contracts/notification-outbox';
|
|
9
|
+
import { handleAdminNotificationsFor } from './admin-notifications';
|
|
10
|
+
|
|
11
|
+
const path = '/admin/api/notification-outbox';
|
|
12
|
+
const admin = { kind: 'admin', via: 'session', username: 'operator', role: 'admin' } as Principal;
|
|
13
|
+
const viewer = { ...admin, role: 'viewer' } as Principal;
|
|
14
|
+
function fixture() {
|
|
15
|
+
const event = { event_id: 'event:synthetic', kind: 'callback', job_id: 'job', request_id: 'request', status: 'uncertain',
|
|
16
|
+
attempts: 2, cycle_attempts: 2, recovery: 'retry', created_at: new Date().toISOString(), updated_at: new Date().toISOString(), available_at: new Date().toISOString(),
|
|
17
|
+
payload: { job: { input: 'private content', callback_url: 'https://example.invalid/?token=secret' } }, lease_token: 'private-lease',
|
|
18
|
+
last_error: 'SELECT private SQL password' } as NotificationEvent;
|
|
19
|
+
const calls: string[] = [];
|
|
20
|
+
const outbox = {
|
|
21
|
+
async list(options: Parameters<NotificationOutboxRepository['list']>[0]) { calls.push(`list:${options?.kinds?.[0]}:${options?.offset}`); return [event]; },
|
|
22
|
+
async snapshot(options: Parameters<NotificationOutboxRepository['snapshot']>[0]) { calls.push(`snapshot:${options?.kinds?.[0]}`); return { counts: { pending: 0, processing: 0, completed: 0, skipped: 0, failed: 0, uncertain: 1 }, oldestPendingAgeSeconds: 0, expiredLeases: 0 }; },
|
|
23
|
+
async get() { return event; },
|
|
24
|
+
async retry(_id: string, options: Parameters<NotificationOutboxRepository['retry']>[1]) { calls.push('retry'); if (options?.expectedStatus !== event.status) return false; event.status = 'pending'; return true; },
|
|
25
|
+
} as unknown as NotificationOutboxRepository;
|
|
26
|
+
const deps = { stateStore: { notificationOutbox: outbox, async completeJobWithNotifications() { throw new Error('must not rerun business'); }, async appendAudit() { calls.push('audit'); } } as unknown as RuntimeStateStore,
|
|
27
|
+
configStore: null as ConfigStoreContract | null, now: () => new Date().toISOString() };
|
|
28
|
+
return { deps, calls, event, outbox };
|
|
29
|
+
}
|
|
30
|
+
async function request(deps: ReturnType<typeof fixture>['deps'], method: string, url: string, principal = admin, payload?: unknown) {
|
|
31
|
+
const req = Readable.from(payload === undefined ? [] : [Buffer.from(JSON.stringify(payload))]) as IncomingMessage;
|
|
32
|
+
req.url = url; req.headers = {};
|
|
33
|
+
const result = { status: 0, body: '' };
|
|
34
|
+
const res = { writeHead(status: number) { result.status = status; }, setHeader() {}, end(body: string) { result.body = String(body); } } as unknown as ServerResponse;
|
|
35
|
+
await handleAdminNotificationsFor(deps, method, url.split('?')[0]!, req, res, principal);
|
|
36
|
+
return { ...result, json: JSON.parse(result.body) };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
test('notification summaries omit payload, destination and lease; state/config are partitioned by kind', async () => {
|
|
40
|
+
const f = fixture();
|
|
41
|
+
const result = await request(f.deps, 'GET', `${path}?kind=callback&offset=20`, viewer);
|
|
42
|
+
assert.equal(result.status, 200);
|
|
43
|
+
assert.equal(result.json.items[0].last_error, 'notification_delivery_failed');
|
|
44
|
+
assert.doesNotMatch(result.body, /private|token=secret|lease_token|payload/);
|
|
45
|
+
assert.deepEqual(f.calls, ['list:callback:20', 'snapshot:callback']);
|
|
46
|
+
f.event.last_error = 'PRIVATE_TOKEN_WITHOUT_SPACES';
|
|
47
|
+
assert.doesNotMatch((await request(f.deps, 'GET', `${path}?kind=callback`, viewer)).body, /PRIVATE_TOKEN/);
|
|
48
|
+
assert.equal((await request(f.deps, 'GET', `${path}?kind=approval-notification`, viewer)).status, 503);
|
|
49
|
+
f.deps.configStore = { notificationOutbox: f.outbox, approvals: { createWithNotification: async () => 1 } } as unknown as ConfigStoreContract;
|
|
50
|
+
await request(f.deps, 'GET', `${path}?kind=approval-notification`, viewer);
|
|
51
|
+
assert.equal(f.calls.at(-1), 'snapshot:approval-notification');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('viewer cannot retry, and uncertain retry requires explicit acknowledgment without touching the original job', async () => {
|
|
55
|
+
const f = fixture(); const url = `${path}/event%3Asynthetic/retry`;
|
|
56
|
+
const body = { kind: 'callback', expected_status: 'uncertain' };
|
|
57
|
+
assert.equal((await request(f.deps, 'POST', url, viewer, { ...body, allow_uncertain: true })).status, 403);
|
|
58
|
+
assert.equal((await request(f.deps, 'POST', url, admin, body)).status, 409);
|
|
59
|
+
assert.deepEqual(f.calls, []);
|
|
60
|
+
assert.equal((await request(f.deps, 'POST', url, admin, { ...body, allow_uncertain: true })).status, 200);
|
|
61
|
+
assert.deepEqual(f.calls, ['retry', 'audit']);
|
|
62
|
+
assert.equal(f.event.event_id, 'event:synthetic');
|
|
63
|
+
assert.equal(f.event.status, 'pending');
|
|
64
|
+
assert.equal((await request(f.deps, 'POST', url, admin, { ...body, allow_uncertain: true })).status, 409);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('notification retry rejects mismatched kind, completed state and invalid input', async () => {
|
|
68
|
+
const f = fixture();
|
|
69
|
+
assert.equal((await request(f.deps, 'POST', `${path}/event%3Asynthetic/retry`, admin, null)).status, 400);
|
|
70
|
+
assert.equal((await request(f.deps, 'POST', `${path}/event%3Asynthetic/retry`, admin, { kind: 'delivery', expected_status: 'failed' })).status, 404);
|
|
71
|
+
assert.equal((await request(f.deps, 'POST', `${path}/event%3Asynthetic/retry`, admin, { kind: 'callback', expected_status: 'completed' })).status, 400);
|
|
72
|
+
assert.equal((await request(f.deps, 'GET', `${path}?offset=-1`)).status, 400);
|
|
73
|
+
assert.equal((await request(f.deps, 'GET', `${path}?status=arbitrary`)).status, 400);
|
|
74
|
+
assert.deepEqual(f.calls, []);
|
|
75
|
+
});
|