@warlock.js/notifications 5.2.3 → 5.2.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.
Files changed (80) hide show
  1. package/cjs/{channel_api-ChOeNKM1.cjs → channel_api-CBB_XoIl.cjs} +22 -22
  2. package/cjs/{channel_api-ChOeNKM1.cjs.map → channel_api-CBB_XoIl.cjs.map} +1 -1
  3. package/cjs/chunk-fl3r8ClO.cjs +41 -0
  4. package/cjs/index.cjs +1 -1
  5. package/cjs/index.cjs.map +1 -1
  6. package/cjs/rabbitmq-driver-BFvpezlq.cjs +3 -0
  7. package/cjs/{src-Dy5nwVcs.cjs → src-DJA8APmy.cjs} +6 -34
  8. package/cjs/{src-Dy5nwVcs.cjs.map → src-DJA8APmy.cjs.map} +1 -1
  9. package/esm/channels/database-channel.d.mts.map +1 -1
  10. package/esm/config.d.mts.map +1 -1
  11. package/esm/dispatch/define-channel.d.mts.map +1 -1
  12. package/esm/dispatch/define-notification.d.mts.map +1 -1
  13. package/esm/dispatch/define-notification.mjs.map +1 -1
  14. package/esm/dispatch/notifications-event-bus.mjs.map +1 -1
  15. package/esm/dispatch/notify.mjs.map +1 -1
  16. package/esm/errors.d.mts.map +1 -1
  17. package/esm/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs.map +1 -1
  18. package/esm/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs.map +1 -1
  19. package/esm/herald/src/message-managers/event-consumer.mjs.map +1 -1
  20. package/esm/herald/src/use-case-broadcast.mjs.map +1 -1
  21. package/esm/herald/src/utils/connect-to-broker.mjs.map +1 -1
  22. package/esm/in-app/base-notifications-repository.d.mts.map +1 -1
  23. package/esm/in-app/database-notification.d.mts.map +1 -1
  24. package/esm/in-app/in-app.d.mts.map +1 -1
  25. package/esm/migration/notification-columns.mjs.map +1 -1
  26. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.1/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs.map +1 -1
  27. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.1/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs.map +1 -1
  28. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.1/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs.map +1 -1
  29. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.1/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs.map +1 -1
  30. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.1/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs.map +1 -1
  31. package/esm/node_modules/.pnpm/@mongez_reinforcements@4.0.1/node_modules/@mongez/reinforcements/esm/string/words.mjs.map +1 -1
  32. package/esm/node_modules/.pnpm/@mongez_supportive-is@2.1.4/node_modules/@mongez/supportive-is/esm/index.mjs.map +1 -1
  33. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/channel_api.mjs.map +1 -1
  34. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel.mjs.map +1 -1
  35. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel_model.mjs.map +1 -1
  36. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connect.mjs.map +1 -1
  37. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connection.mjs.map +1 -1
  38. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/credentials.mjs.map +1 -1
  39. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/error.mjs.map +1 -1
  40. package/esm/node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/format.mjs.map +1 -1
  41. package/esm/node_modules/.pnpm/buffer-more-ints@1.0.0/node_modules/buffer-more-ints/buffer-more-ints.mjs.map +1 -1
  42. package/esm/node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/dayjs.min.mjs.map +1 -1
  43. package/esm/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.mjs.map +1 -1
  44. package/esm/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.mjs.map +1 -1
  45. package/esm/queue/herald-queue.mjs.map +1 -1
  46. package/esm/queue/notifications-worker.mjs.map +1 -1
  47. package/esm/seal/src/factory/validators.mjs.map +1 -1
  48. package/esm/seal/src/helpers/validation-helpers.mjs.map +1 -1
  49. package/esm/seal/src/mutators/number-mutators.mjs.map +1 -1
  50. package/esm/seal/src/mutators/scalar-mutators.mjs.map +1 -1
  51. package/esm/seal/src/mutators/string-mutators.mjs.map +1 -1
  52. package/esm/seal/src/rules/array/array-rules.mjs.map +1 -1
  53. package/esm/seal/src/rules/common/enum.mjs.map +1 -1
  54. package/esm/seal/src/rules/common/literal.mjs.map +1 -1
  55. package/esm/seal/src/rules/common/unknown-key.mjs.map +1 -1
  56. package/esm/seal/src/rules/conditional/required-if-rules.mjs.map +1 -1
  57. package/esm/seal/src/rules/core/union.mjs.map +1 -1
  58. package/esm/seal/src/rules/core/when.mjs.map +1 -1
  59. package/esm/seal/src/rules/date/date-day-rules.mjs.map +1 -1
  60. package/esm/seal/src/rules/date/date-period-rules.mjs.map +1 -1
  61. package/esm/seal/src/rules/date/date-special-rules.mjs.map +1 -1
  62. package/esm/seal/src/rules/date/date.mjs.map +1 -1
  63. package/esm/seal/src/rules/length/length-rules.mjs.map +1 -1
  64. package/esm/seal/src/rules/scalar/accepted-rule.mjs.map +1 -1
  65. package/esm/seal/src/rules/scalar/declined-rule.mjs.map +1 -1
  66. package/esm/seal/src/rules/string/credit-card.mjs.map +1 -1
  67. package/esm/seal/src/rules/string/id-formats.mjs.map +1 -1
  68. package/esm/seal/src/rules/string/string-comparison.mjs.map +1 -1
  69. package/esm/seal/src/standard-schema/json-schema.mjs.map +1 -1
  70. package/esm/seal/src/standard-schema/map-result.mjs.map +1 -1
  71. package/esm/seal/src/validators/date-validator.mjs.map +1 -1
  72. package/esm/seal/src/validators/discriminated-union-validator.mjs.map +1 -1
  73. package/esm/seal/src/validators/lazy-validator.mjs.map +1 -1
  74. package/esm/seal/src/validators/methods/required-methods.mjs.map +1 -1
  75. package/esm/seal/src/validators/object-validator.mjs.map +1 -1
  76. package/esm/seal/src/validators/record-validator.mjs.map +1 -1
  77. package/esm/seal/src/validators/scalar-validator.mjs.map +1 -1
  78. package/esm/seal/src/validators/union-validator.mjs.map +1 -1
  79. package/package.json +6 -6
  80. package/cjs/rabbitmq-driver-Drn1T40o.cjs +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mongez+supportive-is@2.1.4/node_modules/@mongez/supportive-is/esm/index.mjs"],"sourcesContent":["//#region ../supportive-is/src/index.ts\n/**\n* Determine whether the given value is a number whatever if its data type is String or Number\n*/\nfunction isNumeric(value) {\n\treturn /^[+-]?\\d+(\\.\\d+)?([Ee][+-]?\\d+)?$/.test(String(value));\n}\n/**\n* Check if the given value is int\n*/\nconst isInt = (value) => typeof value === \"number\" && Number.isInteger(value);\n/**\n* Check if the given value is float\n*/\nconst isFloat = (value) => typeof value === \"number\" && Number.isFinite(value) && /^-?\\d+\\.\\d+$/.test(String(value));\n/**\n* Check if the given value is a regex\n*/\nconst isRegex = (value) => Boolean(value) && value.constructor?.name === \"RegExp\";\n/**\n* Check if the given value is an object\n*/\nconst isObject = (value) => Boolean(value) && typeof value === \"object\";\n/**\n* Check if the given value is a plain object\n*/\nconst isPlainObject = (value) => {\n\tif (!value || typeof value !== \"object\") return false;\n\tif (Object.getPrototypeOf(value) === null) return true;\n\treturn value.constructor?.name === \"Object\";\n};\n/**\n* Check if the given value is validId\n*/\nconst isValidId = (value) => Boolean(value && /^[A-Za-z][\\w\\-:.]*$/.test(String(value)));\n/**\n* Check if the given value is a form element\n*/\nconst isFormElement = (value) => typeof HTMLFormElement === \"undefined\" ? false : value instanceof HTMLFormElement;\n/**\n* Check if the given value is a form data\n*/\nconst isFormData = (value) => value instanceof FormData;\n/**\n* Check if the given value is iterable\n*/\nconst isIterable = (value) => value !== null && value !== void 0 && typeof value[Symbol.iterator] === \"function\";\n/**\n* Check if the given value is a scalar value\n*/\nconst isScalar = (value) => [\n\t\"string\",\n\t\"boolean\",\n\t\"number\",\n\t\"symbol\",\n\t\"bigint\"\n].includes(typeof value);\n/**\n* Check if the given value is a string\n*/\nconst isString = (value) => typeof value === \"string\";\n/**\n* Check if the given value is a pr value\n*/\nconst isPrimitive = (value) => [\n\t\"string\",\n\t\"boolean\",\n\t\"number\",\n\t\"bigint\"\n].includes(typeof value);\n/**\n* Check if the given value is a promise\n*/\nconst isPromise = (value) => Boolean(value) && value instanceof Promise;\n/**\n* Check if the given value is a date\n*/\nconst isDate = (value) => Boolean(value) && typeof value === \"object\" && value instanceof Date;\n/**\n* Check if the given value is a generator\n*/\nconst isGenerator = (value) => Boolean(value) && typeof value === \"object\" && typeof value.next === \"function\" && typeof value[Symbol.iterator] === \"function\" && value[Symbol.iterator]() === value;\n/**\n* Check if the given value is empty\n* Zero does not considered empty\n* Empty object is considered empty\n* Empty array is considered empty\n*/\nconst isEmpty = (value) => {\n\tif ([\n\t\t0,\n\t\ttrue,\n\t\tfalse\n\t].includes(value)) return false;\n\tif ([\n\t\t\"\",\n\t\tnull,\n\t\tvoid 0\n\t].includes(value)) return true;\n\tif (typeof value === \"number\" && Number.isNaN(value)) return false;\n\tif (value instanceof Date) return false;\n\tif (value instanceof Map || value instanceof Set) return value.size === 0;\n\tif (typeof value === \"object\" && !Array.isArray(value) && typeof value[Symbol.iterator] !== \"function\") return Object.keys(value).length === 0;\n\tif (isIterable(value)) return value.length === 0;\n\tif (isNumeric(value)) return false;\n\treturn true;\n};\n/**\n* Check if the given value is a valid json\n*/\nconst isJson = (value) => {\n\tif (!value || typeof value !== \"string\") return false;\n\tif (![\"[\", \"{\"].includes(value?.[0])) return false;\n\ttry {\n\t\tJSON.parse(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n/**\n* Check if the given value is valid url\n*/\nconst isUrl = (value) => {\n\tif (!value || typeof value !== \"string\") return false;\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (![\"http:\", \"https:\"].includes(url.protocol)) return false;\n\t\tconst hostname = url.hostname;\n\t\tif (!hostname.includes(\".\")) return false;\n\t\tif (hostname.split(\".\").some((label) => label.length === 0)) return false;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n/**\n* Check if the given value is a valid email\n*/\nconst isEmail = (value) => typeof value === \"string\" && /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(value);\n/**\n* Check if current user is opening from mobile\n*/\nconst isMobile = {\n\t/**\n\t* Determine whether the current visitor is opening from an Android device\n\t*/\n\tandroid: () => navigator.userAgent.match(/Android/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an ios device\n\t*/\n\tios: () => navigator.userAgent.match(/iPhone|iPad|iPod/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an Iphone\n\t*/\n\tiphone: () => navigator.userAgent.match(/iPhone/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an ipad\n\t*/\n\tipad: () => navigator.userAgent.match(/iPad/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an ipod\n\t*/\n\tipod: () => navigator.userAgent.match(/iPod/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an windows mobile\n\t*/\n\twindows: () => navigator.userAgent.match(/IEMobile/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from mobile whatever its type\n\t*/\n\tany: () => isMobile.android() || isMobile.ios() || isMobile.windows()\n};\n/**\n* Determine if current user is opening from macOS\n*/\nconst isMac = () => navigator.userAgent.match(/mac/i) !== null;\n/**\n* Check if current browser is the given name\n*/\nconst isBrowser = (browser) => {\n\treturn {\n\t\tchrome: isChrome(),\n\t\tfirefox: isFirefox(),\n\t\topera: isOpera(),\n\t\tedge: isEdge(),\n\t\tie: isIE(),\n\t\tsafari: isSafari()\n\t}[browser.toLowerCase()] === true;\n};\n/**\n* Check if current browser is chrome browser\n*/\nconst isChrome = () => !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);\n/**\n* Check if current browser is firefox\n*/\nconst isFirefox = () => typeof window.InstallTrigger !== \"undefined\";\n/**\n* Check if current browser is safari\n*/\nconst isSafari = () => {\n\tif (typeof navigator === \"undefined\") return false;\n\tconst ua = navigator.userAgent || \"\";\n\treturn /Safari/i.test(ua) && !/Chrome|Chromium|Edg|OPR|Android/i.test(ua);\n};\n/**\n* Check if current browser is opera\n*/\nconst isOpera = () => {\n\tif (typeof window === \"undefined\") return false;\n\tconst w = window;\n\treturn !!w.opr && !!w.opr.addons || !!w.opera || typeof navigator !== \"undefined\" && navigator.userAgent.indexOf(\" OPR/\") >= 0;\n};\n/**\n* Check if current browser is internet explorer\n*/\nconst isIE = () => !!document.documentMode;\n/**\n* Check if current browser is edge\n*/\nconst isEdge = () => {\n\treturn !!!document.documentMode && !!window.StyleMedia;\n};\n/**\n* Determine whether the current visitor is opening from desktop\n*/\nconst isDesktop = () => !isMobile.any();\n/**\n* A simple lightweight library to validate values against certain types of data\n* For full documentation on github\n* Repo: https://github.com/hassanzohdy/supportive-is\n*\n* First released 01/12/2017\n* Licensed under MIT (http://opensource.org/licenses/MIT)\n*/\nconst Is = {\n\t/**\n\t* Determine whether the given value is a number whatever if its data type is String or Number\n\t*/\n\tnumeric: isNumeric,\n\t/**\n\t* Determine whether the given value is an integer and its data type is number\n\t* As Number.isInteger considers 1.0 to be valid integer, regex will be used instead\n\t*/\n\tint: isInt,\n\t/**\n\t* Determine whether the given value is a float number and its data type is number\n\t*/\n\tfloat: isFloat,\n\t/**\n\t* Determine whether the given value is a regular expression\n\t*/\n\tregex: isRegex,\n\t/**\n\t* Determine whether the given value is an object\n\t*/\n\tobject: isObject,\n\t/**\n\t* Determine whether the given value is a plain object\n\t*/\n\tplainObject: isPlainObject,\n\t/**\n\t* Determine whether the given value is an array\n\t*/\n\tarray: Array.isArray,\n\t/**\n\t* Determine whether the given value is valid html attribute `id`\n\t*/\n\tvalidHtmlId: isValidId,\n\t/**\n\t* determine if the given value is an instance of form element\n\t*/\n\tformElement: isFormElement,\n\t/**\n\t* @alias formElement\n\t*/\n\tform: isFormElement,\n\t/**\n\t* determine if the given value is an instance of form data\n\t*/\n\tformData: isFormData,\n\t/**\n\t* Determine whether the given value is iterable\n\t*/\n\titerable: isIterable,\n\t/**\n\t* Determine whether the given value is a scalar\n\t* Scalar types are strings, booleans, integers and\n\t*/\n\tscalar: isScalar,\n\t/**\n\t* Determine if the given value is a primitive value\n\t*/\n\tprimitive: isPrimitive,\n\t/**\n\t* Determine whether the given value is a promise\n\t*/\n\tpromise: isPromise,\n\t/**\n\t* Determine whether the given value is a date\n\t*/\n\tdate: isDate,\n\t/**\n\t* Determine whether the given value is a generator\n\t*/\n\tgenerator: isGenerator,\n\t/**\n\t* Determine whether the given value if an empty\n\t* This can be validated against any type of values\n\t* undefined or nullable values will be considered empty\n\t* Objects that doesn't have any properties will be considered empty\n\t* Arrays and Strings will be empty based on its length\n\t* The 0 'Zero\" number will not be considered empty\n\t*/\n\tempty: isEmpty,\n\t/**\n\t* Determine whether the given value is a valid json string\n\t*/\n\tjson: isJson,\n\t/**\n\t* Determine whether the given value is a valid url\n\t*/\n\turl: isUrl,\n\t/**\n\t* Determine whether the given value is a valid email\n\t*/\n\temail: isEmail,\n\t/**\n\t* Determine the current visitor is opening from mobile\n\t* Please Note this method depends on the user agent\n\t*/\n\tmobile: isMobile,\n\t/**\n\t* Determine if current user is opening from macOS\n\t*/\n\tmac: isMac,\n\t/**\n\t* Determine whether the current visitor is opening from desktop\n\t*/\n\tdesktop: isDesktop,\n\t/**\n\t* Check if the current browser is the given name\n\t* To detect browser version as well, pass the version number as the second argument\n\t*/\n\tbrowser: isBrowser,\n\tchrome: isChrome,\n\tfirefox: isFirefox,\n\tsafari: isSafari,\n\topera: isOpera,\n\tie: isIE,\n\tedge: isEdge\n};\n\n//#endregion\nexport { Is, Is as default, isBrowser, isChrome, isDate, isDesktop, isEdge, isEmail, isEmpty, isFirefox, isFloat, isFormData, isFormElement, isGenerator, isIE, isInt, isIterable, isJson, isMac, isMobile, isNumeric, isObject, isOpera, isPlainObject, isPrimitive, isPromise, isRegex, isSafari, isScalar, isString, isUrl, isValidId };\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,SAAS,UAAU,OAAO;CACzB,OAAO,oCAAoC,KAAK,OAAO,KAAK,CAAC;AAC9D;;;;AAIA,MAAM,SAAS,UAAU,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK;;;;AAI5E,MAAM,WAAW,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,eAAe,KAAK,OAAO,KAAK,CAAC;;;;AAInH,MAAM,WAAW,UAAU,QAAQ,KAAK,KAAK,MAAM,aAAa,SAAS;;;;AAIzE,MAAM,YAAY,UAAU,QAAQ,KAAK,KAAK,OAAO,UAAU;;;;AAI/D,MAAM,iBAAiB,UAAU;CAChC,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO;CAChD,IAAI,OAAO,eAAe,KAAK,MAAM,MAAM,OAAO;CAClD,OAAO,MAAM,aAAa,SAAS;AACpC;;;;AAIA,MAAM,aAAa,UAAU,QAAQ,SAAS,sBAAsB,KAAK,OAAO,KAAK,CAAC,CAAC;;;;AAIvF,MAAM,iBAAiB,UAAU,OAAO,oBAAoB,cAAc,QAAQ,iBAAiB;;;;AAInG,MAAM,cAAc,UAAU,iBAAiB;;;;AAI/C,MAAM,cAAc,UAAU,UAAU,QAAQ,UAAU,KAAK,KAAK,OAAO,MAAM,OAA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AAIzD,MAAM,iBAAiB;CACtB,IAAI,OAAO,cAAc,aAAa,OAAO;CAC7C,MAAM,KAAK,UAAU,aAAa;CAClC,OAAO,UAAU,KAAK,EAAE,KAAK,CAAC,mCAAmC,KAAK,EAAE;AACzE;;;;AAIA,MAAM,gBAAgB;CACrB,IAAI,OAAO,WAAW,aAAa,OAAO;CAC1C,MAAM,IAAI;CACV,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,IAAI,UAAU,CAAC,CAAC,EAAE,SAAS,OAAO,cAAc,eAAe,UAAU,UAAU,QAAQ,OAAO,KAAK;AAC9H;;;;AAIA,MAAM,aAAa,CAAC,CAAC,SAAS;;;;AAI9B,MAAM,eAAe;CACpB,OAAO,CAAC,CAAC,CAAC,SAAS,gBAAgB,CAAC,CAAC,OAAO;AAC7C;;;;AAIA,MAAM,kBAAkB,CAAC,SAAS,IAAI;;;;;;;;;AAStC,MAAM,KAAK;;;;CAIV,SAAS;;;;;CAKT,KAAK;;;;CAIL,OAAO;;;;CAIP,OAAO;;;;CAIP,QAAQ;;;;CAIR,aAAa;;;;CAIb,OAAO,MAAM;;;;CAIb,aAAa;;;;CAIb,aAAa;;;;CAIb,MAAM;;;;CAIN,UAAU;;;;CAIV,UAAU;;;;;CAKV,QAAQ;;;;CAIR,WAAW;;;;CAIX,SAAS;;;;CAIT,MAAM;;;;CAIN,WAAW;;;;;;;;;CASX,OAAO;;;;CAIP,MAAM;;;;CAIN,KAAK;;;;CAIL,OAAO;;;;;CAKP,QAAQ;;;;CAIR,KAAK;;;;CAIL,SAAS;;;;;CAKT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,OAAO;CACP,IAAI;CACJ,MAAM;AACP"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@mongez+supportive-is@2.1.4/node_modules/@mongez/supportive-is/esm/index.mjs"],"sourcesContent":["//#region ../supportive-is/src/index.ts\n/**\n* Determine whether the given value is a number whatever if its data type is String or Number\n*/\nfunction isNumeric(value) {\n\treturn /^[+-]?\\d+(\\.\\d+)?([Ee][+-]?\\d+)?$/.test(String(value));\n}\n/**\n* Check if the given value is int\n*/\nconst isInt = (value) => typeof value === \"number\" && Number.isInteger(value);\n/**\n* Check if the given value is float\n*/\nconst isFloat = (value) => typeof value === \"number\" && Number.isFinite(value) && /^-?\\d+\\.\\d+$/.test(String(value));\n/**\n* Check if the given value is a regex\n*/\nconst isRegex = (value) => Boolean(value) && value.constructor?.name === \"RegExp\";\n/**\n* Check if the given value is an object\n*/\nconst isObject = (value) => Boolean(value) && typeof value === \"object\";\n/**\n* Check if the given value is a plain object\n*/\nconst isPlainObject = (value) => {\n\tif (!value || typeof value !== \"object\") return false;\n\tif (Object.getPrototypeOf(value) === null) return true;\n\treturn value.constructor?.name === \"Object\";\n};\n/**\n* Check if the given value is validId\n*/\nconst isValidId = (value) => Boolean(value && /^[A-Za-z][\\w\\-:.]*$/.test(String(value)));\n/**\n* Check if the given value is a form element\n*/\nconst isFormElement = (value) => typeof HTMLFormElement === \"undefined\" ? false : value instanceof HTMLFormElement;\n/**\n* Check if the given value is a form data\n*/\nconst isFormData = (value) => value instanceof FormData;\n/**\n* Check if the given value is iterable\n*/\nconst isIterable = (value) => value !== null && value !== void 0 && typeof value[Symbol.iterator] === \"function\";\n/**\n* Check if the given value is a scalar value\n*/\nconst isScalar = (value) => [\n\t\"string\",\n\t\"boolean\",\n\t\"number\",\n\t\"symbol\",\n\t\"bigint\"\n].includes(typeof value);\n/**\n* Check if the given value is a string\n*/\nconst isString = (value) => typeof value === \"string\";\n/**\n* Check if the given value is a pr value\n*/\nconst isPrimitive = (value) => [\n\t\"string\",\n\t\"boolean\",\n\t\"number\",\n\t\"bigint\"\n].includes(typeof value);\n/**\n* Check if the given value is a promise\n*/\nconst isPromise = (value) => Boolean(value) && value instanceof Promise;\n/**\n* Check if the given value is a date\n*/\nconst isDate = (value) => Boolean(value) && typeof value === \"object\" && value instanceof Date;\n/**\n* Check if the given value is a generator\n*/\nconst isGenerator = (value) => Boolean(value) && typeof value === \"object\" && typeof value.next === \"function\" && typeof value[Symbol.iterator] === \"function\" && value[Symbol.iterator]() === value;\n/**\n* Check if the given value is empty\n* Zero does not considered empty\n* Empty object is considered empty\n* Empty array is considered empty\n*/\nconst isEmpty = (value) => {\n\tif ([\n\t\t0,\n\t\ttrue,\n\t\tfalse\n\t].includes(value)) return false;\n\tif ([\n\t\t\"\",\n\t\tnull,\n\t\tvoid 0\n\t].includes(value)) return true;\n\tif (typeof value === \"number\" && Number.isNaN(value)) return false;\n\tif (value instanceof Date) return false;\n\tif (value instanceof Map || value instanceof Set) return value.size === 0;\n\tif (typeof value === \"object\" && !Array.isArray(value) && typeof value[Symbol.iterator] !== \"function\") return Object.keys(value).length === 0;\n\tif (isIterable(value)) return value.length === 0;\n\tif (isNumeric(value)) return false;\n\treturn true;\n};\n/**\n* Check if the given value is a valid json\n*/\nconst isJson = (value) => {\n\tif (!value || typeof value !== \"string\") return false;\n\tif (![\"[\", \"{\"].includes(value?.[0])) return false;\n\ttry {\n\t\tJSON.parse(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n/**\n* Check if the given value is valid url\n*/\nconst isUrl = (value) => {\n\tif (!value || typeof value !== \"string\") return false;\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (![\"http:\", \"https:\"].includes(url.protocol)) return false;\n\t\tconst hostname = url.hostname;\n\t\tif (!hostname.includes(\".\")) return false;\n\t\tif (hostname.split(\".\").some((label) => label.length === 0)) return false;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n/**\n* Check if the given value is a valid email\n*/\nconst isEmail = (value) => typeof value === \"string\" && /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(value);\n/**\n* Check if current user is opening from mobile\n*/\nconst isMobile = {\n\t/**\n\t* Determine whether the current visitor is opening from an Android device\n\t*/\n\tandroid: () => navigator.userAgent.match(/Android/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an ios device\n\t*/\n\tios: () => navigator.userAgent.match(/iPhone|iPad|iPod/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an Iphone\n\t*/\n\tiphone: () => navigator.userAgent.match(/iPhone/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an ipad\n\t*/\n\tipad: () => navigator.userAgent.match(/iPad/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an ipod\n\t*/\n\tipod: () => navigator.userAgent.match(/iPod/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from an windows mobile\n\t*/\n\twindows: () => navigator.userAgent.match(/IEMobile/i) !== null,\n\t/**\n\t* Determine whether the current visitor is opening from mobile whatever its type\n\t*/\n\tany: () => isMobile.android() || isMobile.ios() || isMobile.windows()\n};\n/**\n* Determine if current user is opening from macOS\n*/\nconst isMac = () => navigator.userAgent.match(/mac/i) !== null;\n/**\n* Check if current browser is the given name\n*/\nconst isBrowser = (browser) => {\n\treturn {\n\t\tchrome: isChrome(),\n\t\tfirefox: isFirefox(),\n\t\topera: isOpera(),\n\t\tedge: isEdge(),\n\t\tie: isIE(),\n\t\tsafari: isSafari()\n\t}[browser.toLowerCase()] === true;\n};\n/**\n* Check if current browser is chrome browser\n*/\nconst isChrome = () => !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);\n/**\n* Check if current browser is firefox\n*/\nconst isFirefox = () => typeof window.InstallTrigger !== \"undefined\";\n/**\n* Check if current browser is safari\n*/\nconst isSafari = () => {\n\tif (typeof navigator === \"undefined\") return false;\n\tconst ua = navigator.userAgent || \"\";\n\treturn /Safari/i.test(ua) && !/Chrome|Chromium|Edg|OPR|Android/i.test(ua);\n};\n/**\n* Check if current browser is opera\n*/\nconst isOpera = () => {\n\tif (typeof window === \"undefined\") return false;\n\tconst w = window;\n\treturn !!w.opr && !!w.opr.addons || !!w.opera || typeof navigator !== \"undefined\" && navigator.userAgent.indexOf(\" OPR/\") >= 0;\n};\n/**\n* Check if current browser is internet explorer\n*/\nconst isIE = () => !!document.documentMode;\n/**\n* Check if current browser is edge\n*/\nconst isEdge = () => {\n\treturn !!!document.documentMode && !!window.StyleMedia;\n};\n/**\n* Determine whether the current visitor is opening from desktop\n*/\nconst isDesktop = () => !isMobile.any();\n/**\n* A simple lightweight library to validate values against certain types of data\n* For full documentation on github\n* Repo: https://github.com/hassanzohdy/supportive-is\n*\n* First released 01/12/2017\n* Licensed under MIT (http://opensource.org/licenses/MIT)\n*/\nconst Is = {\n\t/**\n\t* Determine whether the given value is a number whatever if its data type is String or Number\n\t*/\n\tnumeric: isNumeric,\n\t/**\n\t* Determine whether the given value is an integer and its data type is number\n\t* As Number.isInteger considers 1.0 to be valid integer, regex will be used instead\n\t*/\n\tint: isInt,\n\t/**\n\t* Determine whether the given value is a float number and its data type is number\n\t*/\n\tfloat: isFloat,\n\t/**\n\t* Determine whether the given value is a regular expression\n\t*/\n\tregex: isRegex,\n\t/**\n\t* Determine whether the given value is an object\n\t*/\n\tobject: isObject,\n\t/**\n\t* Determine whether the given value is a plain object\n\t*/\n\tplainObject: isPlainObject,\n\t/**\n\t* Determine whether the given value is an array\n\t*/\n\tarray: Array.isArray,\n\t/**\n\t* Determine whether the given value is valid html attribute `id`\n\t*/\n\tvalidHtmlId: isValidId,\n\t/**\n\t* determine if the given value is an instance of form element\n\t*/\n\tformElement: isFormElement,\n\t/**\n\t* @alias formElement\n\t*/\n\tform: isFormElement,\n\t/**\n\t* determine if the given value is an instance of form data\n\t*/\n\tformData: isFormData,\n\t/**\n\t* Determine whether the given value is iterable\n\t*/\n\titerable: isIterable,\n\t/**\n\t* Determine whether the given value is a scalar\n\t* Scalar types are strings, booleans, integers and\n\t*/\n\tscalar: isScalar,\n\t/**\n\t* Determine if the given value is a primitive value\n\t*/\n\tprimitive: isPrimitive,\n\t/**\n\t* Determine whether the given value is a promise\n\t*/\n\tpromise: isPromise,\n\t/**\n\t* Determine whether the given value is a date\n\t*/\n\tdate: isDate,\n\t/**\n\t* Determine whether the given value is a generator\n\t*/\n\tgenerator: isGenerator,\n\t/**\n\t* Determine whether the given value if an empty\n\t* This can be validated against any type of values\n\t* undefined or nullable values will be considered empty\n\t* Objects that doesn't have any properties will be considered empty\n\t* Arrays and Strings will be empty based on its length\n\t* The 0 'Zero\" number will not be considered empty\n\t*/\n\tempty: isEmpty,\n\t/**\n\t* Determine whether the given value is a valid json string\n\t*/\n\tjson: isJson,\n\t/**\n\t* Determine whether the given value is a valid url\n\t*/\n\turl: isUrl,\n\t/**\n\t* Determine whether the given value is a valid email\n\t*/\n\temail: isEmail,\n\t/**\n\t* Determine the current visitor is opening from mobile\n\t* Please Note this method depends on the user agent\n\t*/\n\tmobile: isMobile,\n\t/**\n\t* Determine if current user is opening from macOS\n\t*/\n\tmac: isMac,\n\t/**\n\t* Determine whether the current visitor is opening from desktop\n\t*/\n\tdesktop: isDesktop,\n\t/**\n\t* Check if the current browser is the given name\n\t* To detect browser version as well, pass the version number as the second argument\n\t*/\n\tbrowser: isBrowser,\n\tchrome: isChrome,\n\tfirefox: isFirefox,\n\tsafari: isSafari,\n\topera: isOpera,\n\tie: isIE,\n\tedge: isEdge\n};\n\n//#endregion\nexport { Is, Is as default, isBrowser, isChrome, isDate, isDesktop, isEdge, isEmail, isEmpty, isFirefox, isFloat, isFormData, isFormElement, isGenerator, isIE, isInt, isIterable, isJson, isMac, isMobile, isNumeric, isObject, isOpera, isPlainObject, isPrimitive, isPromise, isRegex, isSafari, isScalar, isString, isUrl, isValidId };\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,SAAS,UAAU,OAAO;CACzB,OAAO,oCAAoC,KAAK,OAAO,KAAK,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AAO,CAAC,CAAC,CAAC,SAAS,gBAAgB,CAAC,CAAC,OAAO;AAC7C;;;;AAIA,MAAM,kBAAkB,CAAC,SAAS,IAAI;;;;;;;;;AAStC,MAAM,KAAK;;;;CAIV,SAAS;;;;;CAKT,KAAK;;;;CAIL,OAAO;;;;CAIP,OAAO;;;;CAIP,QAAQ;;;;CAIR,aAAa;;;;CAIb,OAAO,MAAM;;;;CAIb,aAAa;;;;CAIb,aAAa;;;;CAIb,MAAM;;;;CAIN,UAAU;;;;CAIV,UAAU;;;;;CAKV,QAAQ;;;;CAIR,WAAW;;;;CAIX,SAAS;;;;CAIT,MAAM;;;;CAIN,WAAW;;;;;;;;;CASX,OAAO;;;;CAIP,MAAM;;;;CAIN,KAAK;;;;CAIL,OAAO;;;;;CAKP,QAAQ;;;;CAIR,KAAK;;;;CAIL,SAAS;;;;;CAKT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,OAAO;CACP,IAAI;CACJ,MAAM;AACP"}
@@ -1 +1 @@
1
- {"version":3,"file":"channel_api.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/channel_api.js"],"sourcesContent":["var raw_connect = require('./lib/connect').connect;\nvar ChannelModel = require('./lib/channel_model').ChannelModel;\nvar promisify = require('util').promisify;\n\nfunction connect(url, connOptions) {\n return promisify(function(cb) {\n return raw_connect(url, connOptions, cb);\n })()\n .then(function(conn) {\n return new ChannelModel(conn);\n });\n};\n\nmodule.exports.connect = connect;\nmodule.exports.credentials = require('./lib/credentials');\nmodule.exports.IllegalOperationError = require('./lib/error').IllegalOperationError;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;CAAA,IAAI,gCAAuC;CAC3C,IAAI,uCAA8C;CAClD,IAAI,sBAAoB,MAAM,EAAE;CAEhC,SAAS,QAAQ,KAAK,aAAa;EACjC,OAAO,UAAU,SAAS,IAAI;GAC5B,OAAO,YAAY,KAAK,aAAa,EAAE;EACzC,CAAC,EAAE,EACF,KAAK,SAAS,MAAM;GACnB,OAAO,IAAI,aAAa,IAAI;EAC9B,CAAC;CACH;CAEA,OAAO,QAAQ,UAAU;CACzB,OAAO,QAAQ;CACf,OAAO,QAAQ,wCAA+C"}
1
+ {"version":3,"file":"channel_api.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/channel_api.js"],"sourcesContent":["var raw_connect = require('./lib/connect').connect;\nvar ChannelModel = require('./lib/channel_model').ChannelModel;\nvar promisify = require('util').promisify;\n\nfunction connect(url, connOptions) {\n return promisify(function(cb) {\n return raw_connect(url, connOptions, cb);\n })()\n .then(function(conn) {\n return new ChannelModel(conn);\n });\n};\n\nmodule.exports.connect = connect;\nmodule.exports.credentials = require('./lib/credentials');\nmodule.exports.IllegalOperationError = require('./lib/error').IllegalOperationError;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;CAAA,IAAI,gCAAuC;CAC3C,IAAI,uCAA8C;CAClD,IAAI,sBAAoB,MAAM,CAAC,CAAC;CAEhC,SAAS,QAAQ,KAAK,aAAa;EACjC,OAAO,UAAU,SAAS,IAAI;GAC5B,OAAO,YAAY,KAAK,aAAa,EAAE;EACzC,CAAC,CAAC,CAAC,CAAC,CACH,KAAK,SAAS,MAAM;GACnB,OAAO,IAAI,aAAa,IAAI;EAC9B,CAAC;CACH;CAEA,OAAO,QAAQ,UAAU;CACzB,OAAO,QAAQ;CACf,OAAO,QAAQ,wCAA+C"}
@@ -1 +1 @@
1
- {"version":3,"file":"channel.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel.js"],"sourcesContent":["//\n//\n//\n\n// Channel machinery.\n\n'use strict';\n\nvar defs = require('./defs');\nvar closeMsg = require('./format').closeMessage;\nvar inspect = require('./format').inspect;\nvar methodName = require('./format').methodName;\nvar assert = require('assert');\nvar EventEmitter = require('events');\nvar fmt = require('util').format;\nvar IllegalOperationError = require('./error').IllegalOperationError;\nvar stackCapture = require('./error').stackCapture;\n\nclass Channel extends EventEmitter {\n constructor (connection) {\n super();\n\n this.connection = connection;\n // for the presently outstanding RPC\n this.reply = null;\n // for the RPCs awaiting action\n this.pending = [];\n // for unconfirmed messages\n this.lwm = 1; // the least, unconfirmed deliveryTag\n this.unconfirmed = []; // rolling window of delivery callbacks\n this.on('ack', this.handleConfirm.bind(this, function (cb) {\n if (cb)\n cb(null);\n }));\n this.on('nack', this.handleConfirm.bind(this, function (cb) {\n if (cb)\n cb(new Error('message nacked'));\n }));\n this.on('close', function () {\n var cb;\n while (cb = this.unconfirmed.shift()) {\n if (cb)\n cb(new Error('channel closed'));\n }\n });\n // message frame state machine\n this.handleMessage = acceptDeliveryOrReturn;\n }\n\n setOptions(options) {\n this.options = options;\n }\n\n allocate () {\n this.ch = this.connection.freshChannel(this, this.options);\n return this;\n }\n\n // Incoming frames are either notifications of e.g., message delivery,\n // or replies to something we've sent. In general I deal with the\n // former by emitting an event, and with the latter by keeping a track\n // of what's expecting a reply.\n //\n // The AMQP specification implies that RPCs can't be pipelined; that\n // is, you can have only one outstanding RPC on a channel at a\n // time. Certainly that's what RabbitMQ and its clients assume. For\n // this reason, I buffer RPCs if the channel is already waiting for a\n // reply.\n // Just send the damn frame.\n sendImmediately (method, fields) {\n return this.connection.sendMethod(this.ch, method, fields);\n }\n\n // Invariant: !this.reply -> pending.length == 0. That is, whenever we\n // clear a reply, we must send another RPC (and thereby fill\n // this.reply) if there is one waiting. The invariant relevant here\n // and in `accept`.\n sendOrEnqueue (method, fields, reply) {\n if (!this.reply) { // if no reply waiting, we can go\n assert(this.pending.length === 0);\n this.reply = reply;\n this.sendImmediately(method, fields);\n }\n else {\n this.pending.push({\n method: method,\n fields: fields,\n reply: reply\n });\n }\n }\n\n sendMessage (fields, properties, content) {\n return this.connection.sendMessage(\n this.ch,\n defs.BasicPublish, fields,\n defs.BasicProperties, properties,\n content);\n }\n\n // Internal, synchronously resolved RPC; the return value is resolved\n // with the whole frame.\n _rpc (method, fields, expect, cb) {\n var self = this;\n\n function reply (err, f) {\n if (err === null) {\n if (f.id === expect) {\n return cb(null, f);\n }\n else {\n // We have detected a problem, so it's up to us to close the\n // channel\n var expectedName = methodName(expect);\n\n var e = new Error(fmt(\"Expected %s; got %s\",\n expectedName, inspect(f, false)));\n self.closeWithError(f.id, fmt('Expected %s; got %s',\n expectedName, methodName(f.id)),\n defs.constants.UNEXPECTED_FRAME, e);\n return cb(e);\n }\n }\n\n\n // An error will be given if, for example, this is waiting to be\n // sent and the connection closes\n else if (err instanceof Error)\n return cb(err);\n\n\n // A close frame will be given if this is the RPC awaiting reply\n // and the channel is closed by the server\n else {\n // otherwise, it's a close frame\n var closeReason = (err.fields.classId << 16) + err.fields.methodId;\n var e = (method === closeReason)\n ? fmt(\"Operation failed: %s; %s\",\n methodName(method), closeMsg(err))\n : fmt(\"Channel closed by server: %s\", closeMsg(err));\n var closeFrameError = new Error(e);\n closeFrameError.code = err.fields.replyCode;\n closeFrameError.classId = err.fields.classId;\n closeFrameError.methodId = err.fields.methodId;\n return cb(closeFrameError);\n }\n }\n\n this.sendOrEnqueue(method, fields, reply);\n }\n\n // Move to entirely closed state.\n toClosed (capturedStack) {\n this._rejectPending();\n invalidateSend(this, 'Channel closed', capturedStack);\n this.accept = invalidOp('Channel closed', capturedStack);\n this.connection.releaseChannel(this.ch);\n this.emit('close');\n }\n\n // Stop being able to send and receive methods and content. Used when\n // we close the channel. Invokes the continuation once the server has\n // acknowledged the close, but before the channel is moved to the\n // closed state.\n toClosing (capturedStack, k) {\n var send = this.sendImmediately.bind(this);\n invalidateSend(this, 'Channel closing', capturedStack);\n\n this.accept = function (f) {\n if (f.id === defs.ChannelCloseOk) {\n if (k)\n k();\n var s = stackCapture('ChannelCloseOk frame received');\n this.toClosed(s);\n }\n else if (f.id === defs.ChannelClose) {\n send(defs.ChannelCloseOk, {});\n }\n // else ignore frame\n };\n }\n\n _rejectPending () {\n function rej (r) {\n r(new Error(\"Channel ended, no reply will be forthcoming\"));\n }\n if (this.reply !== null)\n rej(this.reply);\n this.reply = null;\n\n var discard;\n while (discard = this.pending.shift())\n rej(discard.reply);\n this.pending = null; // so pushes will break\n }\n\n closeBecause (reason, code, k) {\n this.sendImmediately(defs.ChannelClose, {\n replyText: reason,\n replyCode: code,\n methodId: 0, classId: 0\n });\n var s = stackCapture('closeBecause called: ' + reason);\n this.toClosing(s, k);\n }\n\n // If we close because there's been an error, we need to distinguish\n // between what we tell the server (`reason`) and what we report as\n // the cause in the client (`error`).\n closeWithError (id, reason, code, error) {\n var self = this;\n this.closeBecause(reason, code, function () {\n error.code = code;\n // content frames and consumer errors do not provide a method a class/method ID\n if (id) {\n error.classId = defs.info(id).classId;\n error.methodId = defs.info(id).methodId;\n }\n self.emit('error', error);\n });\n }\n\n // A trampolining state machine for message frames on a channel. A\n // message arrives in at least two frames: first, a method announcing\n // the message (either a BasicDeliver or BasicGetOk); then, a message\n // header with the message properties; then, zero or more content\n // frames.\n // Keep the try/catch localised, in an attempt to avoid disabling\n // optimisation\n acceptMessageFrame (f) {\n try {\n this.handleMessage = this.handleMessage(f);\n }\n catch (msg) {\n if (typeof msg === 'string') {\n this.closeWithError(f.id, msg, defs.constants.UNEXPECTED_FRAME,\n new Error(msg));\n }\n else if (msg instanceof Error) {\n this.closeWithError(f.id, 'Error while processing message',\n defs.constants.INTERNAL_ERROR, msg);\n }\n else {\n this.closeWithError(f.id, 'Internal error while processing message',\n defs.constants.INTERNAL_ERROR,\n new Error(msg.toString()));\n }\n }\n }\n\n handleConfirm (handle, f) {\n var tag = f.deliveryTag;\n var multi = f.multiple;\n\n if (multi) {\n var confirmed = this.unconfirmed.splice(0, tag - this.lwm + 1);\n this.lwm = tag + 1;\n confirmed.forEach(handle);\n }\n else {\n var c;\n if (tag === this.lwm) {\n c = this.unconfirmed.shift();\n this.lwm++;\n // Advance the LWM and the window to the next non-gap, or\n // possibly to the end\n while (this.unconfirmed[0] === null) {\n this.unconfirmed.shift();\n this.lwm++;\n }\n }\n else {\n c = this.unconfirmed[tag - this.lwm];\n this.unconfirmed[tag - this.lwm] = null;\n }\n // Technically, in the single-deliveryTag case, I should report a\n // protocol breach if it's already been confirmed.\n handle(c);\n }\n }\n\n pushConfirmCallback (cb) {\n // `null` is used specifically for marking already confirmed slots,\n // so I coerce `undefined` and `null` to false; functions are never\n // falsey.\n this.unconfirmed.push(cb || false);\n }\n\n onBufferDrain () {\n this.emit('drain');\n }\n\n accept(f) {\n\n switch (f.id) {\n\n // Message frames\n case undefined: // content frame!\n case defs.BasicDeliver:\n case defs.BasicReturn:\n case defs.BasicProperties:\n return this.acceptMessageFrame(f);\n\n // confirmations, need to do confirm.select first\n case defs.BasicAck:\n return this.emit('ack', f.fields);\n case defs.BasicNack:\n return this.emit('nack', f.fields);\n case defs.BasicCancel:\n // The broker can send this if e.g., the queue is deleted.\n return this.emit('cancel', f.fields);\n\n case defs.ChannelClose:\n // Any remote closure is an error to us. Reject the pending reply\n // with the close frame, so it can see whether it was that\n // operation that caused it to close.\n if (this.reply) {\n var reply = this.reply; this.reply = null;\n reply(f);\n }\n var emsg = \"Channel closed by server: \" + closeMsg(f);\n this.sendImmediately(defs.ChannelCloseOk, {});\n\n var error = new Error(emsg);\n error.code = f.fields.replyCode;\n error.classId = f.fields.classId;\n error.methodId = f.fields.methodId;\n this.emit('error', error);\n\n var s = stackCapture(emsg);\n this.toClosed(s);\n return;\n\n case defs.BasicFlow:\n // RabbitMQ doesn't send this, it just blocks the TCP socket\n return this.closeWithError(f.id, \"Flow not implemented\",\n defs.constants.NOT_IMPLEMENTED,\n new Error('Flow not implemented'));\n\n default: // assume all other things are replies\n // Resolving the reply may lead to another RPC; to make sure we\n // don't hold that up, clear this.reply\n var reply = this.reply; this.reply = null;\n // however, maybe there's an RPC waiting to go? If so, that'll\n // fill this.reply again, restoring the invariant. This does rely\n // on any response being recv'ed after resolving the promise,\n // below; hence, I use synchronous defer.\n if (this.pending.length > 0) {\n var send = this.pending.shift();\n this.reply = send.reply;\n this.sendImmediately(send.method, send.fields);\n }\n return reply(null, f);\n }\n }\n}\n\n// Shutdown protocol. There's three scenarios:\n//\n// 1. The application decides to shut the channel\n// 2. The server decides to shut the channel, possibly because of\n// something the application did\n// 3. The connection is closing, so there won't be any more frames\n// going back and forth.\n//\n// 1 and 2 involve an exchange of method frames (Close and CloseOk),\n// while 3 doesn't; the connection simply says \"shutdown\" to the\n// channel, which then acts as if it's closing, without going through\n// the exchange.\n\nfunction invalidOp(msg, stack) {\n return function() {\n throw new IllegalOperationError(msg, stack);\n };\n}\n\nfunction invalidateSend(ch, msg, stack) {\n ch.sendImmediately = ch.sendOrEnqueue = ch.sendMessage =\n invalidOp(msg, stack);\n}\n\n// Kick off a message delivery given a BasicDeliver or BasicReturn\n// frame (BasicGet uses the RPC mechanism)\nfunction acceptDeliveryOrReturn(f) {\n var event;\n if (f.id === defs.BasicDeliver) event = 'delivery';\n else if (f.id === defs.BasicReturn) event = 'return';\n else throw fmt(\"Expected BasicDeliver or BasicReturn; got %s\",\n inspect(f));\n\n var self = this;\n var fields = f.fields;\n return acceptMessage(function(message) {\n message.fields = fields;\n self.emit(event, message);\n });\n}\n\n// Move to the state of waiting for message frames (headers, then\n// one or more content frames)\nfunction acceptMessage(continuation) {\n var totalSize = 0, remaining = 0;\n var buffers = null;\n\n var message = {\n fields: null,\n properties: null,\n content: null\n };\n\n return headers;\n\n // expect a headers frame\n function headers(f) {\n if (f.id === defs.BasicProperties) {\n message.properties = f.fields;\n totalSize = remaining = f.size;\n\n // for zero-length messages, content frames aren't required.\n if (totalSize === 0) {\n message.content = Buffer.alloc(0);\n continuation(message);\n return acceptDeliveryOrReturn;\n }\n else {\n return content;\n }\n }\n else {\n throw \"Expected headers frame after delivery\";\n }\n }\n\n // expect a content frame\n // %%% TODO cancelled messages (sent as zero-length content frame)\n function content(f) {\n if (f.content) {\n var size = f.content.length;\n remaining -= size;\n if (remaining === 0) {\n if (buffers !== null) {\n buffers.push(f.content);\n message.content = Buffer.concat(buffers);\n }\n else {\n message.content = f.content;\n }\n continuation(message);\n return acceptDeliveryOrReturn;\n }\n else if (remaining < 0) {\n throw fmt(\"Too much content sent! Expected %d bytes\",\n totalSize);\n }\n else {\n if (buffers !== null)\n buffers.push(f.content);\n else\n buffers = [f.content];\n return content;\n }\n }\n else throw \"Expected content frame after headers\"\n }\n}\n\n// This adds just a bit more stuff useful for the APIs, but not\n// low-level machinery.\nclass BaseChannel extends Channel {\n constructor (connection) {\n super(connection);\n this.consumers = new Map();\n }\n\n // Not sure I like the ff, it's going to be changing hidden classes\n // all over the place. On the other hand, whaddya do.\n registerConsumer (tag, callback) {\n this.consumers.set(tag, callback);\n }\n\n unregisterConsumer (tag) {\n this.consumers.delete(tag);\n }\n\n dispatchMessage (fields, message) {\n var consumerTag = fields.consumerTag;\n var consumer = this.consumers.get(consumerTag);\n if (consumer) {\n return consumer(message);\n }\n else {\n // %%% Surely a race here\n throw new Error(\"Unknown consumer: \" + consumerTag);\n }\n }\n\n handleDelivery (message) {\n return this.dispatchMessage(message.fields, message);\n }\n\n handleCancel (fields) {\n var result = this.dispatchMessage(fields, null);\n this.unregisterConsumer(fields.consumerTag);\n return result;\n }\n}\n\nmodule.exports.acceptMessage = acceptMessage;\nmodule.exports.BaseChannel = BaseChannel;\nmodule.exports.Channel = Channel;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;CAQA,IAAI;CACJ,IAAI,4BAA+B;CACnC,IAAI,2BAA8B;CAClC,IAAI,8BAAiC;CACrC,IAAI,mBAAiB,QAAQ;CAC7B,IAAI,yBAAuB,QAAQ;CACnC,IAAI,gBAAc,MAAM,EAAE;CAC1B,IAAI,wCAA2C;CAC/C,IAAI,+BAAkC;CAEtC,IAAM,UAAN,cAAsB,aAAa;EACjC,YAAa,YAAY;GACvB,MAAM;GAEN,KAAK,aAAa;GAElB,KAAK,QAAQ;GAEb,KAAK,UAAU,CAAC;GAEhB,KAAK,MAAM;GACX,KAAK,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AU,OAAO,OAAO,OAAO;KACzC,OAEE,QAAQ,UAAU,EAAE;KAEtB,aAAa,OAAO;KACpB,OAAO;IACT,OACK,IAAI,YAAY,GACnB,MAAM,IAAI,4CACA,SAAS;SAEhB;KACH,IAAI,YAAY,MACd,QAAQ,KAAK,EAAE,OAAO;UAEtB,UAAU,CAAC,EAAE,OAAO;KACtB,OAAO;IACT;GACF,OACK,MAAM;EACb;CACF;CAIA,IAAM,cAAN,cAA0B,QAAQ;EAChC,YAAa,YAAY;GACvB,MAAM,UAAU;GAChB,KAAK,4BAAY,IAAI,IAAI;EAC3B;EAIA,iBAAkB,KAAK,UAAU;GAC/B,KAAK,UAAU,IAAI,KAAK,QAAQ;EAClC;EAEA,mBAAoB,KAAK;GACvB,KAAK,UAAU,OAAO,GAAG;EAC3B;EAEA,gBAAiB,QAAQ,SAAS;GAChC,IAAI,cAAc,OAAO;GACzB,IAAI,WAAW,KAAK,UAAU,IAAI,WAAW;GAC7C,IAAI,UACF,OAAO,SAAS,OAAO;QAIvB,MAAM,IAAI,MAAM,uBAAuB,WAAW;EAEtD;EAEA,eAAgB,SAAS;GACvB,OAAO,KAAK,gBAAgB,QAAQ,QAAQ,OAAO;EACrD;EAEA,aAAc,QAAQ;GACpB,IAAI,SAAS,KAAK,gBAAgB,QAAQ,IAAI;GAC9C,KAAK,mBAAmB,OAAO,WAAW;GAC1C,OAAO;EACT;CACF;CAEA,OAAO,QAAQ,gBAAgB;CAC/B,OAAO,QAAQ,cAAc;CAC7B,OAAO,QAAQ,UAAU"}
1
+ {"version":3,"file":"channel.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel.js"],"sourcesContent":["//\n//\n//\n\n// Channel machinery.\n\n'use strict';\n\nvar defs = require('./defs');\nvar closeMsg = require('./format').closeMessage;\nvar inspect = require('./format').inspect;\nvar methodName = require('./format').methodName;\nvar assert = require('assert');\nvar EventEmitter = require('events');\nvar fmt = require('util').format;\nvar IllegalOperationError = require('./error').IllegalOperationError;\nvar stackCapture = require('./error').stackCapture;\n\nclass Channel extends EventEmitter {\n constructor (connection) {\n super();\n\n this.connection = connection;\n // for the presently outstanding RPC\n this.reply = null;\n // for the RPCs awaiting action\n this.pending = [];\n // for unconfirmed messages\n this.lwm = 1; // the least, unconfirmed deliveryTag\n this.unconfirmed = []; // rolling window of delivery callbacks\n this.on('ack', this.handleConfirm.bind(this, function (cb) {\n if (cb)\n cb(null);\n }));\n this.on('nack', this.handleConfirm.bind(this, function (cb) {\n if (cb)\n cb(new Error('message nacked'));\n }));\n this.on('close', function () {\n var cb;\n while (cb = this.unconfirmed.shift()) {\n if (cb)\n cb(new Error('channel closed'));\n }\n });\n // message frame state machine\n this.handleMessage = acceptDeliveryOrReturn;\n }\n\n setOptions(options) {\n this.options = options;\n }\n\n allocate () {\n this.ch = this.connection.freshChannel(this, this.options);\n return this;\n }\n\n // Incoming frames are either notifications of e.g., message delivery,\n // or replies to something we've sent. In general I deal with the\n // former by emitting an event, and with the latter by keeping a track\n // of what's expecting a reply.\n //\n // The AMQP specification implies that RPCs can't be pipelined; that\n // is, you can have only one outstanding RPC on a channel at a\n // time. Certainly that's what RabbitMQ and its clients assume. For\n // this reason, I buffer RPCs if the channel is already waiting for a\n // reply.\n // Just send the damn frame.\n sendImmediately (method, fields) {\n return this.connection.sendMethod(this.ch, method, fields);\n }\n\n // Invariant: !this.reply -> pending.length == 0. That is, whenever we\n // clear a reply, we must send another RPC (and thereby fill\n // this.reply) if there is one waiting. The invariant relevant here\n // and in `accept`.\n sendOrEnqueue (method, fields, reply) {\n if (!this.reply) { // if no reply waiting, we can go\n assert(this.pending.length === 0);\n this.reply = reply;\n this.sendImmediately(method, fields);\n }\n else {\n this.pending.push({\n method: method,\n fields: fields,\n reply: reply\n });\n }\n }\n\n sendMessage (fields, properties, content) {\n return this.connection.sendMessage(\n this.ch,\n defs.BasicPublish, fields,\n defs.BasicProperties, properties,\n content);\n }\n\n // Internal, synchronously resolved RPC; the return value is resolved\n // with the whole frame.\n _rpc (method, fields, expect, cb) {\n var self = this;\n\n function reply (err, f) {\n if (err === null) {\n if (f.id === expect) {\n return cb(null, f);\n }\n else {\n // We have detected a problem, so it's up to us to close the\n // channel\n var expectedName = methodName(expect);\n\n var e = new Error(fmt(\"Expected %s; got %s\",\n expectedName, inspect(f, false)));\n self.closeWithError(f.id, fmt('Expected %s; got %s',\n expectedName, methodName(f.id)),\n defs.constants.UNEXPECTED_FRAME, e);\n return cb(e);\n }\n }\n\n\n // An error will be given if, for example, this is waiting to be\n // sent and the connection closes\n else if (err instanceof Error)\n return cb(err);\n\n\n // A close frame will be given if this is the RPC awaiting reply\n // and the channel is closed by the server\n else {\n // otherwise, it's a close frame\n var closeReason = (err.fields.classId << 16) + err.fields.methodId;\n var e = (method === closeReason)\n ? fmt(\"Operation failed: %s; %s\",\n methodName(method), closeMsg(err))\n : fmt(\"Channel closed by server: %s\", closeMsg(err));\n var closeFrameError = new Error(e);\n closeFrameError.code = err.fields.replyCode;\n closeFrameError.classId = err.fields.classId;\n closeFrameError.methodId = err.fields.methodId;\n return cb(closeFrameError);\n }\n }\n\n this.sendOrEnqueue(method, fields, reply);\n }\n\n // Move to entirely closed state.\n toClosed (capturedStack) {\n this._rejectPending();\n invalidateSend(this, 'Channel closed', capturedStack);\n this.accept = invalidOp('Channel closed', capturedStack);\n this.connection.releaseChannel(this.ch);\n this.emit('close');\n }\n\n // Stop being able to send and receive methods and content. Used when\n // we close the channel. Invokes the continuation once the server has\n // acknowledged the close, but before the channel is moved to the\n // closed state.\n toClosing (capturedStack, k) {\n var send = this.sendImmediately.bind(this);\n invalidateSend(this, 'Channel closing', capturedStack);\n\n this.accept = function (f) {\n if (f.id === defs.ChannelCloseOk) {\n if (k)\n k();\n var s = stackCapture('ChannelCloseOk frame received');\n this.toClosed(s);\n }\n else if (f.id === defs.ChannelClose) {\n send(defs.ChannelCloseOk, {});\n }\n // else ignore frame\n };\n }\n\n _rejectPending () {\n function rej (r) {\n r(new Error(\"Channel ended, no reply will be forthcoming\"));\n }\n if (this.reply !== null)\n rej(this.reply);\n this.reply = null;\n\n var discard;\n while (discard = this.pending.shift())\n rej(discard.reply);\n this.pending = null; // so pushes will break\n }\n\n closeBecause (reason, code, k) {\n this.sendImmediately(defs.ChannelClose, {\n replyText: reason,\n replyCode: code,\n methodId: 0, classId: 0\n });\n var s = stackCapture('closeBecause called: ' + reason);\n this.toClosing(s, k);\n }\n\n // If we close because there's been an error, we need to distinguish\n // between what we tell the server (`reason`) and what we report as\n // the cause in the client (`error`).\n closeWithError (id, reason, code, error) {\n var self = this;\n this.closeBecause(reason, code, function () {\n error.code = code;\n // content frames and consumer errors do not provide a method a class/method ID\n if (id) {\n error.classId = defs.info(id).classId;\n error.methodId = defs.info(id).methodId;\n }\n self.emit('error', error);\n });\n }\n\n // A trampolining state machine for message frames on a channel. A\n // message arrives in at least two frames: first, a method announcing\n // the message (either a BasicDeliver or BasicGetOk); then, a message\n // header with the message properties; then, zero or more content\n // frames.\n // Keep the try/catch localised, in an attempt to avoid disabling\n // optimisation\n acceptMessageFrame (f) {\n try {\n this.handleMessage = this.handleMessage(f);\n }\n catch (msg) {\n if (typeof msg === 'string') {\n this.closeWithError(f.id, msg, defs.constants.UNEXPECTED_FRAME,\n new Error(msg));\n }\n else if (msg instanceof Error) {\n this.closeWithError(f.id, 'Error while processing message',\n defs.constants.INTERNAL_ERROR, msg);\n }\n else {\n this.closeWithError(f.id, 'Internal error while processing message',\n defs.constants.INTERNAL_ERROR,\n new Error(msg.toString()));\n }\n }\n }\n\n handleConfirm (handle, f) {\n var tag = f.deliveryTag;\n var multi = f.multiple;\n\n if (multi) {\n var confirmed = this.unconfirmed.splice(0, tag - this.lwm + 1);\n this.lwm = tag + 1;\n confirmed.forEach(handle);\n }\n else {\n var c;\n if (tag === this.lwm) {\n c = this.unconfirmed.shift();\n this.lwm++;\n // Advance the LWM and the window to the next non-gap, or\n // possibly to the end\n while (this.unconfirmed[0] === null) {\n this.unconfirmed.shift();\n this.lwm++;\n }\n }\n else {\n c = this.unconfirmed[tag - this.lwm];\n this.unconfirmed[tag - this.lwm] = null;\n }\n // Technically, in the single-deliveryTag case, I should report a\n // protocol breach if it's already been confirmed.\n handle(c);\n }\n }\n\n pushConfirmCallback (cb) {\n // `null` is used specifically for marking already confirmed slots,\n // so I coerce `undefined` and `null` to false; functions are never\n // falsey.\n this.unconfirmed.push(cb || false);\n }\n\n onBufferDrain () {\n this.emit('drain');\n }\n\n accept(f) {\n\n switch (f.id) {\n\n // Message frames\n case undefined: // content frame!\n case defs.BasicDeliver:\n case defs.BasicReturn:\n case defs.BasicProperties:\n return this.acceptMessageFrame(f);\n\n // confirmations, need to do confirm.select first\n case defs.BasicAck:\n return this.emit('ack', f.fields);\n case defs.BasicNack:\n return this.emit('nack', f.fields);\n case defs.BasicCancel:\n // The broker can send this if e.g., the queue is deleted.\n return this.emit('cancel', f.fields);\n\n case defs.ChannelClose:\n // Any remote closure is an error to us. Reject the pending reply\n // with the close frame, so it can see whether it was that\n // operation that caused it to close.\n if (this.reply) {\n var reply = this.reply; this.reply = null;\n reply(f);\n }\n var emsg = \"Channel closed by server: \" + closeMsg(f);\n this.sendImmediately(defs.ChannelCloseOk, {});\n\n var error = new Error(emsg);\n error.code = f.fields.replyCode;\n error.classId = f.fields.classId;\n error.methodId = f.fields.methodId;\n this.emit('error', error);\n\n var s = stackCapture(emsg);\n this.toClosed(s);\n return;\n\n case defs.BasicFlow:\n // RabbitMQ doesn't send this, it just blocks the TCP socket\n return this.closeWithError(f.id, \"Flow not implemented\",\n defs.constants.NOT_IMPLEMENTED,\n new Error('Flow not implemented'));\n\n default: // assume all other things are replies\n // Resolving the reply may lead to another RPC; to make sure we\n // don't hold that up, clear this.reply\n var reply = this.reply; this.reply = null;\n // however, maybe there's an RPC waiting to go? If so, that'll\n // fill this.reply again, restoring the invariant. This does rely\n // on any response being recv'ed after resolving the promise,\n // below; hence, I use synchronous defer.\n if (this.pending.length > 0) {\n var send = this.pending.shift();\n this.reply = send.reply;\n this.sendImmediately(send.method, send.fields);\n }\n return reply(null, f);\n }\n }\n}\n\n// Shutdown protocol. There's three scenarios:\n//\n// 1. The application decides to shut the channel\n// 2. The server decides to shut the channel, possibly because of\n// something the application did\n// 3. The connection is closing, so there won't be any more frames\n// going back and forth.\n//\n// 1 and 2 involve an exchange of method frames (Close and CloseOk),\n// while 3 doesn't; the connection simply says \"shutdown\" to the\n// channel, which then acts as if it's closing, without going through\n// the exchange.\n\nfunction invalidOp(msg, stack) {\n return function() {\n throw new IllegalOperationError(msg, stack);\n };\n}\n\nfunction invalidateSend(ch, msg, stack) {\n ch.sendImmediately = ch.sendOrEnqueue = ch.sendMessage =\n invalidOp(msg, stack);\n}\n\n// Kick off a message delivery given a BasicDeliver or BasicReturn\n// frame (BasicGet uses the RPC mechanism)\nfunction acceptDeliveryOrReturn(f) {\n var event;\n if (f.id === defs.BasicDeliver) event = 'delivery';\n else if (f.id === defs.BasicReturn) event = 'return';\n else throw fmt(\"Expected BasicDeliver or BasicReturn; got %s\",\n inspect(f));\n\n var self = this;\n var fields = f.fields;\n return acceptMessage(function(message) {\n message.fields = fields;\n self.emit(event, message);\n });\n}\n\n// Move to the state of waiting for message frames (headers, then\n// one or more content frames)\nfunction acceptMessage(continuation) {\n var totalSize = 0, remaining = 0;\n var buffers = null;\n\n var message = {\n fields: null,\n properties: null,\n content: null\n };\n\n return headers;\n\n // expect a headers frame\n function headers(f) {\n if (f.id === defs.BasicProperties) {\n message.properties = f.fields;\n totalSize = remaining = f.size;\n\n // for zero-length messages, content frames aren't required.\n if (totalSize === 0) {\n message.content = Buffer.alloc(0);\n continuation(message);\n return acceptDeliveryOrReturn;\n }\n else {\n return content;\n }\n }\n else {\n throw \"Expected headers frame after delivery\";\n }\n }\n\n // expect a content frame\n // %%% TODO cancelled messages (sent as zero-length content frame)\n function content(f) {\n if (f.content) {\n var size = f.content.length;\n remaining -= size;\n if (remaining === 0) {\n if (buffers !== null) {\n buffers.push(f.content);\n message.content = Buffer.concat(buffers);\n }\n else {\n message.content = f.content;\n }\n continuation(message);\n return acceptDeliveryOrReturn;\n }\n else if (remaining < 0) {\n throw fmt(\"Too much content sent! Expected %d bytes\",\n totalSize);\n }\n else {\n if (buffers !== null)\n buffers.push(f.content);\n else\n buffers = [f.content];\n return content;\n }\n }\n else throw \"Expected content frame after headers\"\n }\n}\n\n// This adds just a bit more stuff useful for the APIs, but not\n// low-level machinery.\nclass BaseChannel extends Channel {\n constructor (connection) {\n super(connection);\n this.consumers = new Map();\n }\n\n // Not sure I like the ff, it's going to be changing hidden classes\n // all over the place. On the other hand, whaddya do.\n registerConsumer (tag, callback) {\n this.consumers.set(tag, callback);\n }\n\n unregisterConsumer (tag) {\n this.consumers.delete(tag);\n }\n\n dispatchMessage (fields, message) {\n var consumerTag = fields.consumerTag;\n var consumer = this.consumers.get(consumerTag);\n if (consumer) {\n return consumer(message);\n }\n else {\n // %%% Surely a race here\n throw new Error(\"Unknown consumer: \" + consumerTag);\n }\n }\n\n handleDelivery (message) {\n return this.dispatchMessage(message.fields, message);\n }\n\n handleCancel (fields) {\n var result = this.dispatchMessage(fields, null);\n this.unregisterConsumer(fields.consumerTag);\n return result;\n }\n}\n\nmodule.exports.acceptMessage = acceptMessage;\nmodule.exports.BaseChannel = BaseChannel;\nmodule.exports.Channel = Channel;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;CAQA,IAAI;CACJ,IAAI,4BAA+B;CACnC,IAAI,2BAA8B;CAClC,IAAI,8BAAiC;CACrC,IAAI,mBAAiB,QAAQ;CAC7B,IAAI,yBAAuB,QAAQ;CACnC,IAAI,gBAAc,MAAM,CAAC,CAAC;CAC1B,IAAI,wCAA2C;CAC/C,IAAI,+BAAkC;CAEtC,IAAM,UAAN,cAAsB,aAAa;EACjC,YAAa,YAAY;GACvB,MAAM;GAEN,KAAK,aAAa;GAElB,KAAK,QAAQ;GAEb,KAAK,UAAU,CAAC;GAEhB,KAA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AK,EAAE,OAAO;MACtB,QAAQ,UAAU,OAAO,OAAO,OAAO;KACzC,OAEE,QAAQ,UAAU,EAAE;KAEtB,aAAa,OAAO;KACpB,OAAO;IACT,OACK,IAAI,YAAY,GACnB,MAAM,IAAI,4CACA,SAAS;SAEhB;KACH,IAAI,YAAY,MACd,QAAQ,KAAK,EAAE,OAAO;UAEtB,UAAU,CAAC,EAAE,OAAO;KACtB,OAAO;IACT;GACF,OACK,MAAM;EACb;CACF;CAIA,IAAM,cAAN,cAA0B,QAAQ;EAChC,YAAa,YAAY;GACvB,MAAM,UAAU;GAChB,KAAK,4BAAY,IAAI,IAAI;EAC3B;EAIA,iBAAkB,KAAK,UAAU;GAC/B,KAAK,UAAU,IAAI,KAAK,QAAQ;EAClC;EAEA,mBAAoB,KAAK;GACvB,KAAK,UAAU,OAAO,GAAG;EAC3B;EAEA,gBAAiB,QAAQ,SAAS;GAChC,IAAI,cAAc,OAAO;GACzB,IAAI,WAAW,KAAK,UAAU,IAAI,WAAW;GAC7C,IAAI,UACF,OAAO,SAAS,OAAO;QAIvB,MAAM,IAAI,MAAM,uBAAuB,WAAW;EAEtD;EAEA,eAAgB,SAAS;GACvB,OAAO,KAAK,gBAAgB,QAAQ,QAAQ,OAAO;EACrD;EAEA,aAAc,QAAQ;GACpB,IAAI,SAAS,KAAK,gBAAgB,QAAQ,IAAI;GAC9C,KAAK,mBAAmB,OAAO,WAAW;GAC1C,OAAO;EACT;CACF;CAEA,OAAO,QAAQ,gBAAgB;CAC/B,OAAO,QAAQ,cAAc;CAC7B,OAAO,QAAQ,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"channel_model.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel_model.js"],"sourcesContent":["//\n//\n//\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst promisify = require('util').promisify;\nconst defs = require('./defs');\nconst {BaseChannel} = require('./channel');\nconst {acceptMessage} = require('./channel');\nconst Args = require('./api_args');\nconst {inspect} = require('./format');\n\nclass ChannelModel extends EventEmitter {\n constructor(connection) {\n super();\n this.connection = connection;\n\n ['error', 'close', 'blocked', 'unblocked'].forEach(ev => {\n connection.on(ev, this.emit.bind(this, ev));\n });\n }\n\n close() {\n return promisify(this.connection.close.bind(this.connection))();\n }\n\n updateSecret(newSecret, reason) {\n return promisify(this.connection._updateSecret.bind(this.connection))(newSecret, reason);\n }\n\n async createChannel(options) {\n const channel = new Channel(this.connection);\n channel.setOptions(options);\n await channel.open();\n return channel;\n }\n\n async createConfirmChannel(options) {\n const channel = new ConfirmChannel(this.connection);\n channel.setOptions(options);\n await channel.open();\n await channel.rpc(defs.ConfirmSelect, {nowait: false}, defs.ConfirmSelectOk);\n return channel;\n }\n}\n\n// Channels\n\nclass Channel extends BaseChannel {\n constructor(connection) {\n super(connection);\n this.on('delivery', this.handleDelivery.bind(this));\n this.on('cancel', this.handleCancel.bind(this));\n }\n\n // An RPC that returns a 'proper' promise, which resolves to just the\n // response's fields; this is intended to be suitable for implementing\n // API procedures.\n async rpc(method, fields, expect) {\n const f = await promisify(cb => {\n return this._rpc(method, fields, expect, cb);\n })();\n\n return f.fields;\n }\n\n // Do the remarkably simple channel open handshake\n async open() {\n const ch = await this.allocate.bind(this)();\n return ch.rpc(defs.ChannelOpen, {outOfBand: \"\"},\n defs.ChannelOpenOk);\n }\n\n close() {\n return promisify(cb => {\n return this.closeBecause(\"Goodbye\", defs.constants.REPLY_SUCCESS,\n cb);\n })();\n }\n\n // === Public API, declaring queues and stuff ===\n\n assertQueue(queue, options) {\n return this.rpc(defs.QueueDeclare,\n Args.assertQueue(queue, options),\n defs.QueueDeclareOk);\n }\n\n checkQueue(queue) {\n return this.rpc(defs.QueueDeclare,\n Args.checkQueue(queue),\n defs.QueueDeclareOk);\n }\n\n deleteQueue(queue, options) {\n return this.rpc(defs.QueueDelete,\n Args.deleteQueue(queue, options),\n defs.QueueDeleteOk);\n }\n\n purgeQueue(queue) {\n return this.rpc(defs.QueuePurge,\n Args.purgeQueue(queue),\n defs.QueuePurgeOk);\n }\n\n bindQueue(queue, source, pattern, argt) {\n return this.rpc(defs.QueueBind,\n Args.bindQueue(queue, source, pattern, argt),\n defs.QueueBindOk);\n }\n\n unbindQueue(queue, source, pattern, argt) {\n return this.rpc(defs.QueueUnbind,\n Args.unbindQueue(queue, source, pattern, argt),\n defs.QueueUnbindOk);\n }\n\n assertExchange(exchange, type, options) {\n // The server reply is an empty set of fields, but it's convenient\n // to have the exchange name handed to the continuation.\n return this.rpc(defs.ExchangeDeclare,\n Args.assertExchange(exchange, type, options),\n defs.ExchangeDeclareOk)\n .then(_ok => { return { exchange }; });\n }\n\n checkExchange(exchange) {\n return this.rpc(defs.ExchangeDeclare,\n Args.checkExchange(exchange),\n defs.ExchangeDeclareOk);\n }\n\n deleteExchange(name, options) {\n return this.rpc(defs.ExchangeDelete,\n Args.deleteExchange(name, options),\n defs.ExchangeDeleteOk);\n }\n\n bindExchange(dest, source, pattern, argt) {\n return this.rpc(defs.ExchangeBind,\n Args.bindExchange(dest, source, pattern, argt),\n defs.ExchangeBindOk);\n }\n\n unbindExchange(dest, source, pattern, argt) {\n return this.rpc(defs.ExchangeUnbind,\n Args.unbindExchange(dest, source, pattern, argt),\n defs.ExchangeUnbindOk);\n }\n\n // Working with messages\n\n publish(exchange, routingKey, content, options) {\n const fieldsAndProps = Args.publish(exchange, routingKey, options);\n return this.sendMessage(fieldsAndProps, fieldsAndProps, content);\n }\n\n sendToQueue(queue, content, options) {\n return this.publish('', queue, content, options);\n }\n\n consume(queue, callback, options) {\n // NB we want the callback to be run synchronously, so that we've\n // registered the consumerTag before any messages can arrive.\n const fields = Args.consume(queue, options);\n return new Promise((resolve, reject) => {\n this._rpc(defs.BasicConsume, fields, defs.BasicConsumeOk, (err, ok) => {\n if (err) return reject(err);\n this.registerConsumer(ok.fields.consumerTag, callback);\n resolve(ok.fields);\n });\n });\n }\n\n async cancel(consumerTag) {\n const ok = await promisify(cb => {\n this._rpc(defs.BasicCancel, Args.cancel(consumerTag),\n defs.BasicCancelOk,\n cb);\n })()\n .then(ok => {\n this.unregisterConsumer(consumerTag);\n return ok.fields;\n });\n }\n\n get(queue, options) {\n const fields = Args.get(queue, options);\n return new Promise((resolve, reject) => {\n this.sendOrEnqueue(defs.BasicGet, fields, (err, f) => {\n if (err) return reject(err);\n if (f.id === defs.BasicGetEmpty) {\n return resolve(false);\n }\n else if (f.id === defs.BasicGetOk) {\n const fields = f.fields;\n this.handleMessage = acceptMessage(m => {\n m.fields = fields;\n resolve(m);\n });\n }\n else {\n reject(new Error(`Unexpected response to BasicGet: ${inspect(f)}`));\n }\n });\n });\n }\n\n ack(message, allUpTo) {\n this.sendImmediately(\n defs.BasicAck,\n Args.ack(message.fields.deliveryTag, allUpTo));\n }\n\n ackAll() {\n this.sendImmediately(defs.BasicAck, Args.ack(0, true));\n }\n\n nack(message, allUpTo, requeue) {\n this.sendImmediately(\n defs.BasicNack,\n Args.nack(message.fields.deliveryTag, allUpTo, requeue));\n }\n\n nackAll(requeue) {\n this.sendImmediately(defs.BasicNack,\n Args.nack(0, true, requeue));\n }\n\n // `Basic.Nack` is not available in older RabbitMQ versions (or in the\n // AMQP specification), so you have to use the one-at-a-time\n // `Basic.Reject`. This is otherwise synonymous with\n // `#nack(message, false, requeue)`.\n reject(message, requeue) {\n this.sendImmediately(\n defs.BasicReject,\n Args.reject(message.fields.deliveryTag, requeue));\n }\n\n recover() {\n return this.rpc(defs.BasicRecover,\n Args.recover(),\n defs.BasicRecoverOk);\n }\n\n qos(count, global) {\n return this.rpc(defs.BasicQos,\n Args.prefetch(count, global),\n defs.BasicQosOk);\n }\n}\n\n// There are more options in AMQP than exposed here; RabbitMQ only\n// implements prefetch based on message count, and only for individual\n// channels or consumers. RabbitMQ v3.3.0 and after treat prefetch\n// (without `global` set) as per-consumer (for consumers following),\n// and prefetch with `global` set as per-channel.\nChannel.prototype.prefetch = Channel.prototype.qos\n\n// Confirm channel. This is a channel with confirms 'switched on',\n// meaning sent messages will provoke a responding 'ack' or 'nack'\n// from the server. The upshot of this is that `publish` and\n// `sendToQueue` both take a callback, which will be called either\n// with `null` as its argument to signify 'ack', or an exception as\n// its argument to signify 'nack'.\n\nclass ConfirmChannel extends Channel {\n publish(exchange, routingKey, content, options, cb) {\n this.pushConfirmCallback(cb);\n return super.publish(exchange, routingKey, content, options);\n }\n\n sendToQueue(queue, content, options, cb) {\n return this.publish('', queue, content, options, cb);\n }\n\n waitForConfirms() {\n const awaiting = [];\n const unconfirmed = this.unconfirmed;\n unconfirmed.forEach((val, index) => {\n if (val !== null) {\n const confirmed = new Promise((resolve, reject) => {\n unconfirmed[index] = err => {\n if (val) val(err);\n if (err === null) resolve();\n else reject(err);\n };\n });\n awaiting.push(confirmed);\n }\n });\n // Channel closed\n if (!this.pending) {\n var cb;\n while (cb = this.unconfirmed.shift()) {\n if (cb) cb(new Error('channel closed'));\n }\n }\n return Promise.all(awaiting);\n }\n}\n\nmodule.exports.ConfirmChannel = ConfirmChannel;\nmodule.exports.Channel = Channel;\nmodule.exports.ChannelModel = ChannelModel;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;CAMA,MAAM,yBAAuB,QAAQ;CACrC,MAAM,sBAAoB,MAAM,EAAE;CAClC,MAAM;CACN,MAAM,EAAC;CACP,MAAM,EAAC;CACP,MAAM;CACN,MAAM,EAAC;CAEP,IAAM,eAAN,cAA2B,aAAa;EACtC,YAAY,YAAY;GACtB,MAAM;GACN,KAAK,aAAa;GAElB;IAAC;IAAS;IAAS;IAAW;GAAW,EAAE,SAAQ,OAAM;IACvD,WAAW,GAAG,IAAI,KAAK,KAAK,KAAK,MAAM,EAAE,CAAC;GAC5C,CAAC;EACH;EAEA,QAAQ;GACN,OAAO,UAAU,KAAK,WAAW,MAAM,KAAK,KAAK,UAAU,CAAC,EAAE;EAChE;EAEA,aAAa,WAAW,QAAQ;GAC9B,OAAO,UAAU,KAAK,WAAW,cAAc,KAAK,KA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AAY,MAAM,GACjC,IAAI,IAAI,mBAAG,IAAI,MAAM,gBAAgB,CAAC;GAE1C;GACA,OAAO,QAAQ,IAAI,QAAQ;EAC7B;CACF;CAEA,OAAO,QAAQ,iBAAiB;CAChC,OAAO,QAAQ,UAAU;CACzB,OAAO,QAAQ,eAAe"}
1
+ {"version":3,"file":"channel_model.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/channel_model.js"],"sourcesContent":["//\n//\n//\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst promisify = require('util').promisify;\nconst defs = require('./defs');\nconst {BaseChannel} = require('./channel');\nconst {acceptMessage} = require('./channel');\nconst Args = require('./api_args');\nconst {inspect} = require('./format');\n\nclass ChannelModel extends EventEmitter {\n constructor(connection) {\n super();\n this.connection = connection;\n\n ['error', 'close', 'blocked', 'unblocked'].forEach(ev => {\n connection.on(ev, this.emit.bind(this, ev));\n });\n }\n\n close() {\n return promisify(this.connection.close.bind(this.connection))();\n }\n\n updateSecret(newSecret, reason) {\n return promisify(this.connection._updateSecret.bind(this.connection))(newSecret, reason);\n }\n\n async createChannel(options) {\n const channel = new Channel(this.connection);\n channel.setOptions(options);\n await channel.open();\n return channel;\n }\n\n async createConfirmChannel(options) {\n const channel = new ConfirmChannel(this.connection);\n channel.setOptions(options);\n await channel.open();\n await channel.rpc(defs.ConfirmSelect, {nowait: false}, defs.ConfirmSelectOk);\n return channel;\n }\n}\n\n// Channels\n\nclass Channel extends BaseChannel {\n constructor(connection) {\n super(connection);\n this.on('delivery', this.handleDelivery.bind(this));\n this.on('cancel', this.handleCancel.bind(this));\n }\n\n // An RPC that returns a 'proper' promise, which resolves to just the\n // response's fields; this is intended to be suitable for implementing\n // API procedures.\n async rpc(method, fields, expect) {\n const f = await promisify(cb => {\n return this._rpc(method, fields, expect, cb);\n })();\n\n return f.fields;\n }\n\n // Do the remarkably simple channel open handshake\n async open() {\n const ch = await this.allocate.bind(this)();\n return ch.rpc(defs.ChannelOpen, {outOfBand: \"\"},\n defs.ChannelOpenOk);\n }\n\n close() {\n return promisify(cb => {\n return this.closeBecause(\"Goodbye\", defs.constants.REPLY_SUCCESS,\n cb);\n })();\n }\n\n // === Public API, declaring queues and stuff ===\n\n assertQueue(queue, options) {\n return this.rpc(defs.QueueDeclare,\n Args.assertQueue(queue, options),\n defs.QueueDeclareOk);\n }\n\n checkQueue(queue) {\n return this.rpc(defs.QueueDeclare,\n Args.checkQueue(queue),\n defs.QueueDeclareOk);\n }\n\n deleteQueue(queue, options) {\n return this.rpc(defs.QueueDelete,\n Args.deleteQueue(queue, options),\n defs.QueueDeleteOk);\n }\n\n purgeQueue(queue) {\n return this.rpc(defs.QueuePurge,\n Args.purgeQueue(queue),\n defs.QueuePurgeOk);\n }\n\n bindQueue(queue, source, pattern, argt) {\n return this.rpc(defs.QueueBind,\n Args.bindQueue(queue, source, pattern, argt),\n defs.QueueBindOk);\n }\n\n unbindQueue(queue, source, pattern, argt) {\n return this.rpc(defs.QueueUnbind,\n Args.unbindQueue(queue, source, pattern, argt),\n defs.QueueUnbindOk);\n }\n\n assertExchange(exchange, type, options) {\n // The server reply is an empty set of fields, but it's convenient\n // to have the exchange name handed to the continuation.\n return this.rpc(defs.ExchangeDeclare,\n Args.assertExchange(exchange, type, options),\n defs.ExchangeDeclareOk)\n .then(_ok => { return { exchange }; });\n }\n\n checkExchange(exchange) {\n return this.rpc(defs.ExchangeDeclare,\n Args.checkExchange(exchange),\n defs.ExchangeDeclareOk);\n }\n\n deleteExchange(name, options) {\n return this.rpc(defs.ExchangeDelete,\n Args.deleteExchange(name, options),\n defs.ExchangeDeleteOk);\n }\n\n bindExchange(dest, source, pattern, argt) {\n return this.rpc(defs.ExchangeBind,\n Args.bindExchange(dest, source, pattern, argt),\n defs.ExchangeBindOk);\n }\n\n unbindExchange(dest, source, pattern, argt) {\n return this.rpc(defs.ExchangeUnbind,\n Args.unbindExchange(dest, source, pattern, argt),\n defs.ExchangeUnbindOk);\n }\n\n // Working with messages\n\n publish(exchange, routingKey, content, options) {\n const fieldsAndProps = Args.publish(exchange, routingKey, options);\n return this.sendMessage(fieldsAndProps, fieldsAndProps, content);\n }\n\n sendToQueue(queue, content, options) {\n return this.publish('', queue, content, options);\n }\n\n consume(queue, callback, options) {\n // NB we want the callback to be run synchronously, so that we've\n // registered the consumerTag before any messages can arrive.\n const fields = Args.consume(queue, options);\n return new Promise((resolve, reject) => {\n this._rpc(defs.BasicConsume, fields, defs.BasicConsumeOk, (err, ok) => {\n if (err) return reject(err);\n this.registerConsumer(ok.fields.consumerTag, callback);\n resolve(ok.fields);\n });\n });\n }\n\n async cancel(consumerTag) {\n const ok = await promisify(cb => {\n this._rpc(defs.BasicCancel, Args.cancel(consumerTag),\n defs.BasicCancelOk,\n cb);\n })()\n .then(ok => {\n this.unregisterConsumer(consumerTag);\n return ok.fields;\n });\n }\n\n get(queue, options) {\n const fields = Args.get(queue, options);\n return new Promise((resolve, reject) => {\n this.sendOrEnqueue(defs.BasicGet, fields, (err, f) => {\n if (err) return reject(err);\n if (f.id === defs.BasicGetEmpty) {\n return resolve(false);\n }\n else if (f.id === defs.BasicGetOk) {\n const fields = f.fields;\n this.handleMessage = acceptMessage(m => {\n m.fields = fields;\n resolve(m);\n });\n }\n else {\n reject(new Error(`Unexpected response to BasicGet: ${inspect(f)}`));\n }\n });\n });\n }\n\n ack(message, allUpTo) {\n this.sendImmediately(\n defs.BasicAck,\n Args.ack(message.fields.deliveryTag, allUpTo));\n }\n\n ackAll() {\n this.sendImmediately(defs.BasicAck, Args.ack(0, true));\n }\n\n nack(message, allUpTo, requeue) {\n this.sendImmediately(\n defs.BasicNack,\n Args.nack(message.fields.deliveryTag, allUpTo, requeue));\n }\n\n nackAll(requeue) {\n this.sendImmediately(defs.BasicNack,\n Args.nack(0, true, requeue));\n }\n\n // `Basic.Nack` is not available in older RabbitMQ versions (or in the\n // AMQP specification), so you have to use the one-at-a-time\n // `Basic.Reject`. This is otherwise synonymous with\n // `#nack(message, false, requeue)`.\n reject(message, requeue) {\n this.sendImmediately(\n defs.BasicReject,\n Args.reject(message.fields.deliveryTag, requeue));\n }\n\n recover() {\n return this.rpc(defs.BasicRecover,\n Args.recover(),\n defs.BasicRecoverOk);\n }\n\n qos(count, global) {\n return this.rpc(defs.BasicQos,\n Args.prefetch(count, global),\n defs.BasicQosOk);\n }\n}\n\n// There are more options in AMQP than exposed here; RabbitMQ only\n// implements prefetch based on message count, and only for individual\n// channels or consumers. RabbitMQ v3.3.0 and after treat prefetch\n// (without `global` set) as per-consumer (for consumers following),\n// and prefetch with `global` set as per-channel.\nChannel.prototype.prefetch = Channel.prototype.qos\n\n// Confirm channel. This is a channel with confirms 'switched on',\n// meaning sent messages will provoke a responding 'ack' or 'nack'\n// from the server. The upshot of this is that `publish` and\n// `sendToQueue` both take a callback, which will be called either\n// with `null` as its argument to signify 'ack', or an exception as\n// its argument to signify 'nack'.\n\nclass ConfirmChannel extends Channel {\n publish(exchange, routingKey, content, options, cb) {\n this.pushConfirmCallback(cb);\n return super.publish(exchange, routingKey, content, options);\n }\n\n sendToQueue(queue, content, options, cb) {\n return this.publish('', queue, content, options, cb);\n }\n\n waitForConfirms() {\n const awaiting = [];\n const unconfirmed = this.unconfirmed;\n unconfirmed.forEach((val, index) => {\n if (val !== null) {\n const confirmed = new Promise((resolve, reject) => {\n unconfirmed[index] = err => {\n if (val) val(err);\n if (err === null) resolve();\n else reject(err);\n };\n });\n awaiting.push(confirmed);\n }\n });\n // Channel closed\n if (!this.pending) {\n var cb;\n while (cb = this.unconfirmed.shift()) {\n if (cb) cb(new Error('channel closed'));\n }\n }\n return Promise.all(awaiting);\n }\n}\n\nmodule.exports.ConfirmChannel = ConfirmChannel;\nmodule.exports.Channel = Channel;\nmodule.exports.ChannelModel = ChannelModel;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;CAMA,MAAM,yBAAuB,QAAQ;CACrC,MAAM,sBAAoB,MAAM,CAAC,CAAC;CAClC,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,OAAO;EAC7D;EAEA,YAAY,OAAO,SAAS,SAAS,IAAI;GACvC,OAAO,KAAK,QAAQ,IAAI,OAAO,SAAS,SAAS,EAAE;EACrD;EAEA,kBAAkB;GAChB,MAAM,WAAW,CAAC;GAClB,MAAM,cAAc,KAAK;GACzB,YAAY,SAAS,KAAK,UAAU;IAClC,IAAI,QAAQ,MAAM;KAChB,MAAM,YAAY,IAAI,SAAS,SAAS,WAAW;MACjD,YAAY,UAAS,QAAO;OAC1B,IAAI,KAAK,IAAI,GAAG;OAChB,IAAI,QAAQ,MAAM,QAAQ;YACrB,OAAO,GAAG;MACjB;KACF,CAAC;KACD,SAAS,KAAK,SAAS;IACzB;GACF,CAAC;GAED,IAAI,CAAC,KAAK,SAAS;IACjB,IAAI;IACJ,OAAO,KAAK,KAAK,YAAY,MAAM,GACjC,IAAI,IAAI,mBAAG,IAAI,MAAM,gBAAgB,CAAC;GAE1C;GACA,OAAO,QAAQ,IAAI,QAAQ;EAC7B;CACF;CAEA,OAAO,QAAQ,iBAAiB;CAChC,OAAO,QAAQ,UAAU;CACzB,OAAO,QAAQ,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"connect.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connect.js"],"sourcesContent":["//\n//\n//\n\n// General-purpose API for glueing everything together.\n\n'use strict';\n\nvar URL = require('url-parse');\nvar QS = require('querystring');\nvar Connection = require('./connection').Connection;\nvar fmt = require('util').format;\nvar credentials = require('./credentials');\n\nfunction copyInto(obj, target) {\n var keys = Object.keys(obj);\n var i = keys.length;\n while (i--) {\n var k = keys[i];\n target[k] = obj[k];\n }\n return target;\n}\n\n// Adapted from util._extend, which is too fringe to use.\nfunction clone(obj) {\n return copyInto(obj, {});\n}\n\nvar CLIENT_PROPERTIES = {\n \"product\": \"amqplib\",\n \"version\": require('../package.json').version,\n \"platform\": fmt('Node.JS %s', process.version),\n \"information\": \"https://amqp-node.github.io/amqplib/\",\n \"capabilities\": {\n \"publisher_confirms\": true,\n \"exchange_exchange_bindings\": true,\n \"basic.nack\": true,\n \"consumer_cancel_notify\": true,\n \"connection.blocked\": true,\n \"authentication_failure_close\": true\n }\n};\n\n// Construct the main frames used in the opening handshake\nfunction openFrames(vhost, query, credentials, extraClientProperties) {\n if (!vhost)\n vhost = '/';\n else\n vhost = QS.unescape(vhost);\n\n var query = query || {};\n\n function intOrDefault(val, def) {\n return (val === undefined) ? def : parseInt(val);\n }\n\n var clientProperties = Object.create(CLIENT_PROPERTIES);\n\n return {\n // start-ok\n 'clientProperties': copyInto(extraClientProperties, clientProperties),\n 'mechanism': credentials.mechanism,\n 'response': credentials.response(),\n 'locale': query.locale || 'en_US',\n\n // tune-ok\n 'channelMax': intOrDefault(query.channelMax, 0),\n 'frameMax': intOrDefault(query.frameMax, 131072),\n 'heartbeat': intOrDefault(query.heartbeat, 0),\n\n // open\n 'virtualHost': vhost,\n 'capabilities': '',\n 'insist': 0\n };\n}\n\n// Decide on credentials based on what we're supplied.\nfunction credentialsFromUrl(parts) {\n var user = 'guest', passwd = 'guest';\n if (parts.username != '' || parts.password != '') {\n user = (parts.username) ? unescape(parts.username) : '';\n passwd = (parts.password) ? unescape(parts.password) : '';\n }\n return credentials.plain(user, passwd);\n}\n\nfunction connect(url, socketOptions, openCallback) {\n // tls.connect uses `util._extend()` on the options given it, which\n // copies only properties mentioned in `Object.keys()`, when\n // processing the options. So I have to make copies too, rather\n // than using `Object.create()`.\n var sockopts = clone(socketOptions || {});\n url = url || 'amqp://localhost';\n\n var noDelay = !!sockopts.noDelay;\n var timeout = sockopts.timeout;\n var keepAlive = !!sockopts.keepAlive;\n // 0 is default for node\n var keepAliveDelay = sockopts.keepAliveDelay || 0;\n\n var extraClientProperties = sockopts.clientProperties || {};\n\n var protocol, fields;\n if (typeof url === 'object') {\n protocol = (url.protocol || 'amqp') + ':';\n sockopts.host = url.hostname;\n sockopts.servername = sockopts.servername || url.hostname;\n sockopts.port = url.port || ((protocol === 'amqp:') ? 5672 : 5671);\n\n var user, pass;\n // Only default if both are missing, to have the same behaviour as\n // the stringly URL.\n if (url.username == undefined && url.password == undefined) {\n user = 'guest'; pass = 'guest';\n } else {\n user = url.username || '';\n pass = url.password || '';\n }\n\n var config = {\n locale: url.locale,\n channelMax: url.channelMax,\n frameMax: url.frameMax,\n heartbeat: url.heartbeat,\n };\n\n fields = openFrames(url.vhost, config, sockopts.credentials || credentials.plain(user, pass), extraClientProperties);\n } else {\n var parts = URL(url, true); // yes, parse the query string\n var host = parts.hostname.replace(/^\\[|\\]$/g, '');\n protocol = parts.protocol;\n sockopts.host = host;\n sockopts.servername = sockopts.servername || host;\n sockopts.port = parseInt(parts.port) || ((protocol === 'amqp:') ? 5672 : 5671);\n var vhost = parts.pathname ? parts.pathname.substr(1) : null;\n fields = openFrames(vhost, parts.query, sockopts.credentials || credentialsFromUrl(parts), extraClientProperties);\n }\n\n var sockok = false;\n var sock;\n\n function onConnect() {\n sockok = true;\n sock.setNoDelay(noDelay);\n if (keepAlive) sock.setKeepAlive(keepAlive, keepAliveDelay);\n\n var c = new Connection(sock);\n c.open(fields, function(err, ok) {\n // disable timeout once the connection is open, we don't want\n // it fouling things\n if (timeout) sock.setTimeout(0);\n if (err === null) {\n openCallback(null, c);\n } else {\n // The connection isn't closed by the server on e.g. wrong password\n sock.end();\n sock.destroy();\n openCallback(err);\n }\n });\n }\n\n if (protocol === 'amqp:') {\n sock = require('net').connect(sockopts, onConnect);\n }\n else if (protocol === 'amqps:') {\n sock = require('tls').connect(sockopts, onConnect);\n }\n else {\n throw new Error(\"Expected amqp: or amqps: as the protocol; got \" + protocol);\n }\n\n if (timeout) {\n sock.setTimeout(timeout, function() {\n sock.end();\n sock.destroy();\n openCallback(new Error('connect ETIMEDOUT'));\n });\n }\n\n sock.once('error', function(err) {\n if (!sockok) openCallback(err);\n });\n\n}\n\nmodule.exports.connect = connect;\nmodule.exports.credentialsFromUrl = credentialsFromUrl;\n"],"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,eAAe,mBAAmB,KAAK,GAAG,qBAAqB;EAClH;EAEA,IAAI,SAAS;EACb,IAAI;EAEJ,SAAS,YAAY;GACnB,SAAS;GACT,KAAK,WAAW,OAAO;GACvB,IAAI,WAAW,KAAK,aAAa,WAAW,cAAc;GAE1D,IAAI,IAAI,IAAI,WAAW,IAAI;GAC3B,EAAE,KAAK,QAAQ,SAAS,KAAK,IAAI;IAG/B,IAAI,SAAS,KAAK,WAAW,CAAC;IAC9B,IAAI,QAAQ,MACV,aAAa,MAAM,CAAC;SACf;KAEL,KAAK,IAAI;KACT,KAAK,QAAQ;KACb,aAAa,GAAG;IAClB;GACF,CAAC;EACH;EAEA,IAAI,aAAa,SACf,iBAAe,KAAK,EAAE,QAAQ,UAAU,SAAS;OAE9C,IAAI,aAAa,UACpB,iBAAe,KAAK,EAAE,QAAQ,UAAU,SAAS;OAGjD,MAAM,IAAI,MAAM,mDAAmD,QAAQ;EAG7E,IAAI,SACF,KAAK,WAAW,SAAS,WAAW;GAClC,KAAK,IAAI;GACT,KAAK,QAAQ;GACb,6BAAa,IAAI,MAAM,mBAAmB,CAAC;EAC7C,CAAC;EAGH,KAAK,KAAK,SAAS,SAAS,KAAK;GAC/B,IAAI,CAAC,QAAQ,aAAa,GAAG;EAC/B,CAAC;CAEH;CAEA,OAAO,QAAQ,UAAU;CACzB,OAAO,QAAQ,qBAAqB"}
1
+ {"version":3,"file":"connect.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connect.js"],"sourcesContent":["//\n//\n//\n\n// General-purpose API for glueing everything together.\n\n'use strict';\n\nvar URL = require('url-parse');\nvar QS = require('querystring');\nvar Connection = require('./connection').Connection;\nvar fmt = require('util').format;\nvar credentials = require('./credentials');\n\nfunction copyInto(obj, target) {\n var keys = Object.keys(obj);\n var i = keys.length;\n while (i--) {\n var k = keys[i];\n target[k] = obj[k];\n }\n return target;\n}\n\n// Adapted from util._extend, which is too fringe to use.\nfunction clone(obj) {\n return copyInto(obj, {});\n}\n\nvar CLIENT_PROPERTIES = {\n \"product\": \"amqplib\",\n \"version\": require('../package.json').version,\n \"platform\": fmt('Node.JS %s', process.version),\n \"information\": \"https://amqp-node.github.io/amqplib/\",\n \"capabilities\": {\n \"publisher_confirms\": true,\n \"exchange_exchange_bindings\": true,\n \"basic.nack\": true,\n \"consumer_cancel_notify\": true,\n \"connection.blocked\": true,\n \"authentication_failure_close\": true\n }\n};\n\n// Construct the main frames used in the opening handshake\nfunction openFrames(vhost, query, credentials, extraClientProperties) {\n if (!vhost)\n vhost = '/';\n else\n vhost = QS.unescape(vhost);\n\n var query = query || {};\n\n function intOrDefault(val, def) {\n return (val === undefined) ? def : parseInt(val);\n }\n\n var clientProperties = Object.create(CLIENT_PROPERTIES);\n\n return {\n // start-ok\n 'clientProperties': copyInto(extraClientProperties, clientProperties),\n 'mechanism': credentials.mechanism,\n 'response': credentials.response(),\n 'locale': query.locale || 'en_US',\n\n // tune-ok\n 'channelMax': intOrDefault(query.channelMax, 0),\n 'frameMax': intOrDefault(query.frameMax, 131072),\n 'heartbeat': intOrDefault(query.heartbeat, 0),\n\n // open\n 'virtualHost': vhost,\n 'capabilities': '',\n 'insist': 0\n };\n}\n\n// Decide on credentials based on what we're supplied.\nfunction credentialsFromUrl(parts) {\n var user = 'guest', passwd = 'guest';\n if (parts.username != '' || parts.password != '') {\n user = (parts.username) ? unescape(parts.username) : '';\n passwd = (parts.password) ? unescape(parts.password) : '';\n }\n return credentials.plain(user, passwd);\n}\n\nfunction connect(url, socketOptions, openCallback) {\n // tls.connect uses `util._extend()` on the options given it, which\n // copies only properties mentioned in `Object.keys()`, when\n // processing the options. So I have to make copies too, rather\n // than using `Object.create()`.\n var sockopts = clone(socketOptions || {});\n url = url || 'amqp://localhost';\n\n var noDelay = !!sockopts.noDelay;\n var timeout = sockopts.timeout;\n var keepAlive = !!sockopts.keepAlive;\n // 0 is default for node\n var keepAliveDelay = sockopts.keepAliveDelay || 0;\n\n var extraClientProperties = sockopts.clientProperties || {};\n\n var protocol, fields;\n if (typeof url === 'object') {\n protocol = (url.protocol || 'amqp') + ':';\n sockopts.host = url.hostname;\n sockopts.servername = sockopts.servername || url.hostname;\n sockopts.port = url.port || ((protocol === 'amqp:') ? 5672 : 5671);\n\n var user, pass;\n // Only default if both are missing, to have the same behaviour as\n // the stringly URL.\n if (url.username == undefined && url.password == undefined) {\n user = 'guest'; pass = 'guest';\n } else {\n user = url.username || '';\n pass = url.password || '';\n }\n\n var config = {\n locale: url.locale,\n channelMax: url.channelMax,\n frameMax: url.frameMax,\n heartbeat: url.heartbeat,\n };\n\n fields = openFrames(url.vhost, config, sockopts.credentials || credentials.plain(user, pass), extraClientProperties);\n } else {\n var parts = URL(url, true); // yes, parse the query string\n var host = parts.hostname.replace(/^\\[|\\]$/g, '');\n protocol = parts.protocol;\n sockopts.host = host;\n sockopts.servername = sockopts.servername || host;\n sockopts.port = parseInt(parts.port) || ((protocol === 'amqp:') ? 5672 : 5671);\n var vhost = parts.pathname ? parts.pathname.substr(1) : null;\n fields = openFrames(vhost, parts.query, sockopts.credentials || credentialsFromUrl(parts), extraClientProperties);\n }\n\n var sockok = false;\n var sock;\n\n function onConnect() {\n sockok = true;\n sock.setNoDelay(noDelay);\n if (keepAlive) sock.setKeepAlive(keepAlive, keepAliveDelay);\n\n var c = new Connection(sock);\n c.open(fields, function(err, ok) {\n // disable timeout once the connection is open, we don't want\n // it fouling things\n if (timeout) sock.setTimeout(0);\n if (err === null) {\n openCallback(null, c);\n } else {\n // The connection isn't closed by the server on e.g. wrong password\n sock.end();\n sock.destroy();\n openCallback(err);\n }\n });\n }\n\n if (protocol === 'amqp:') {\n sock = require('net').connect(sockopts, onConnect);\n }\n else if (protocol === 'amqps:') {\n sock = require('tls').connect(sockopts, onConnect);\n }\n else {\n throw new Error(\"Expected amqp: or amqps: as the protocol; got \" + protocol);\n }\n\n if (timeout) {\n sock.setTimeout(timeout, function() {\n sock.end();\n sock.destroy();\n openCallback(new Error('connect ETIMEDOUT'));\n });\n }\n\n sock.once('error', function(err) {\n if (!sockok) openCallback(err);\n });\n\n}\n\nmodule.exports.connect = connect;\nmodule.exports.credentialsFromUrl = credentialsFromUrl;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;CAQA,IAAI;CACJ,IAAI,eAAa,aAAa;CAC9B,IAAI,kCAAqC;CACzC,IAAI,gBAAc,MAAM,CAAC,CAAC;CAC1B,IAAI;CAEJ,SAAS,SAAS,KAAK,QAAQ;EAC7B,IAAI,OAAO,OAAO,KAAK,GAAG;EAC1B,IAAI,IAAI,KAAK;EACb,OAAO,KAAK;GACV,IAAI,IAAI,KAAK;GACb,OAAO,KAAK,IAAI;EAClB;EACA,OAAO;CACT;CAGA,SAAS,MAAM,KAAK;EAClB,OAAO,SAAS,KAAK,CAAC,CAAC;CACzB;CAEA,IAAI,oBAAoB;EACtB,WAAW;EACX,6BAAsC;EACtC,YAAY,IAAI,cAAc,QAAQ,OAAO;EAC7C,eAAe;EACf,gBAAgB;GACd,sBAAsB;GACtB,8BAA8B;GAC9B,cAAc;GACd,0BAA0B;GAC1B,sBAAsB;GACtB,gCAAgC;EAClC;CACF;CAGA,SAAS,WAAW,OAAO,OAAO,aAAa,uBAAuB;EACpE,IAAI,CAAC,OACH,QAAQ;OAER,QAAQ,GAAG,SAAS,KAAK;EAE3B,IAAI,QAAQ,SAAS,CAAC;EAEtB,SAAS,aAAa,KAAK,KAAK;GAC9B,OAAQ,QAAQ,SAAa,MAAM,SAAS,GAAG;EACjD;EAIA,OAAO;GAEL,oBAAoB,SAAS,uBAJR,OAAO,OAAO,iBAIgC,CAAC;GACpE,aAAa,YAAY;GACzB,YAAY,YAAY,SAAS;GACjC,UAAU,MAAM,UAAU;GAG1B,cAAc,aAAa,MAAM,YAAY,CAAC;GAC9C,YAAY,aAAa,MAAM,UAAU,MAAM;GAC/C,aAAa,aAAa,MAAM,WAAW,CAAC;GAG5C,eAAe;GACf,gBAAgB;GAChB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,cAAc;GAC7C,SAAS,OAAO,SAAS,MAAM,IAAI,MAAO,aAAa,UAAW,OAAO;GAEzE,SAAS,WADG,MAAM,WAAW,MAAM,SAAS,OAAO,CAAC,IAAI,MAC7B,MAAM,OAAO,SAAS,eAAe,mBAAmB,KAAK,GAAG,qBAAqB;EAClH;EAEA,IAAI,SAAS;EACb,IAAI;EAEJ,SAAS,YAAY;GACnB,SAAS;GACT,KAAK,WAAW,OAAO;GACvB,IAAI,WAAW,KAAK,aAAa,WAAW,cAAc;GAE1D,IAAI,IAAI,IAAI,WAAW,IAAI;GAC3B,EAAE,KAAK,QAAQ,SAAS,KAAK,IAAI;IAG/B,IAAI,SAAS,KAAK,WAAW,CAAC;IAC9B,IAAI,QAAQ,MACV,aAAa,MAAM,CAAC;SACf;KAEL,KAAK,IAAI;KACT,KAAK,QAAQ;KACb,aAAa,GAAG;IAClB;GACF,CAAC;EACH;EAEA,IAAI,aAAa,SACf,iBAAe,KAAK,CAAC,CAAC,QAAQ,UAAU,SAAS;OAE9C,IAAI,aAAa,UACpB,iBAAe,KAAK,CAAC,CAAC,QAAQ,UAAU,SAAS;OAGjD,MAAM,IAAI,MAAM,mDAAmD,QAAQ;EAG7E,IAAI,SACF,KAAK,WAAW,SAAS,WAAW;GAClC,KAAK,IAAI;GACT,KAAK,QAAQ;GACb,6BAAa,IAAI,MAAM,mBAAmB,CAAC;EAC7C,CAAC;EAGH,KAAK,KAAK,SAAS,SAAS,KAAK;GAC/B,IAAI,CAAC,QAAQ,aAAa,GAAG;EAC/B,CAAC;CAEH;CAEA,OAAO,QAAQ,UAAU;CACzB,OAAO,QAAQ,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"connection.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connection.js"],"sourcesContent":["//\n//\n//\n\n'use strict';\n\nvar defs = require('./defs');\nvar constants = defs.constants;\nvar frame = require('./frame');\nvar HEARTBEAT = frame.HEARTBEAT;\nvar Mux = require('./mux').Mux;\n\nvar Duplex = require('stream').Duplex;\nvar EventEmitter = require('events');\nvar Heart = require('./heartbeat').Heart;\n\nvar methodName = require('./format').methodName;\nvar closeMsg = require('./format').closeMessage;\nvar inspect = require('./format').inspect;\n\nvar BitSet = require('./bitset').BitSet;\nvar fmt = require('util').format;\nvar PassThrough = require('stream').PassThrough;\nvar IllegalOperationError = require('./error').IllegalOperationError;\nvar stackCapture = require('./error').stackCapture;\n\n// High-water mark for channel write buffers, in 'objects' (which are\n// encoded frames as buffers).\nvar DEFAULT_WRITE_HWM = 1024;\n// If all the frames of a message (method, properties, content) total\n// to less than this, copy them into a single buffer and write it all\n// at once. Note that this is less than the minimum frame size: if it\n// was greater, we might have to fragment the content.\nvar SINGLE_CHUNK_THRESHOLD = 2048;\n\nclass Connection extends EventEmitter {\n constructor (underlying) {\n super();\n\n var stream = this.stream = wrapStream(underlying);\n this.muxer = new Mux(stream);\n\n // frames\n this.rest = Buffer.alloc(0);\n this.frameMax = constants.FRAME_MIN_SIZE;\n this.sentSinceLastCheck = false;\n this.recvSinceLastCheck = false;\n\n this.expectSocketClose = false;\n this.freeChannels = new BitSet();\n this.channels = [{\n channel: { accept: channel0(this) },\n buffer: underlying\n }];\n }\n\n // This changed between versions, as did the codec, methods, etc. AMQP\n // 0-9-1 is fairly similar to 0.8, but better, and nothing implements\n // 0.8 that doesn't implement 0-9-1. In other words, it doesn't make\n // much sense to generalise here.\n sendProtocolHeader () {\n this.sendBytes(frame.PROTOCOL_HEADER);\n }\n\n /*\n The frighteningly complicated opening protocol (spec section 2.2.4):\n\n Client -> Server\n\n protocol header ->\n <- start\n start-ok ->\n .. next two zero or more times ..\n <- secure\n secure-ok ->\n <- tune\n tune-ok ->\n open ->\n <- open-ok\n\n If I'm only supporting SASL's PLAIN mechanism (which I am for the time\n being), it gets a bit easier since the server won't in general send\n back a `secure`, it'll just send `tune` after the `start-ok`.\n (SASL PLAIN: http://tools.ietf.org/html/rfc4616)\n\n */\n open (allFields, openCallback0) {\n var self = this;\n var openCallback = openCallback0 || function () { };\n\n // This is where we'll put our negotiated values\n var tunedOptions = Object.create(allFields);\n\n function wait (k) {\n self.step(function (err, frame) {\n if (err !== null)\n bail(err);\n else if (frame.channel !== 0) {\n bail(new Error(\n fmt(\"Frame on channel != 0 during handshake: %s\",\n inspect(frame, false))));\n }\n else\n k(frame);\n });\n }\n\n function expect (Method, k) {\n wait(function (frame) {\n if (frame.id === Method)\n k(frame);\n else {\n bail(new Error(\n fmt(\"Expected %s; got %s\",\n methodName(Method), inspect(frame, false))));\n }\n });\n }\n\n function bail (err) {\n openCallback(err);\n }\n\n function send (Method) {\n // This can throw an exception if there's some problem with the\n // options; e.g., something is a string instead of a number.\n self.sendMethod(0, Method, tunedOptions);\n }\n\n function negotiate (server, desired) {\n // We get sent values for channelMax, frameMax and heartbeat,\n // which we may accept or lower (subject to a minimum for\n // frameMax, but we'll leave that to the server to enforce). In\n // all cases, `0` really means \"no limit\", or rather the highest\n // value in the encoding, e.g., unsigned short for channelMax.\n if (server === 0 || desired === 0) {\n // i.e., whichever places a limit, if either\n return Math.max(server, desired);\n }\n else {\n return Math.min(server, desired);\n }\n }\n\n function onStart (start) {\n var mechanisms = start.fields.mechanisms.toString().split(' ');\n if (mechanisms.indexOf(allFields.mechanism) < 0) {\n bail(new Error(fmt('SASL mechanism %s is not provided by the server',\n allFields.mechanism)));\n return;\n }\n self.serverProperties = start.fields.serverProperties;\n try {\n send(defs.ConnectionStartOk);\n } catch (err) {\n bail(err);\n return;\n }\n wait(afterStartOk);\n }\n\n function afterStartOk (reply) {\n switch (reply.id) {\n case defs.ConnectionSecure:\n bail(new Error(\n \"Wasn't expecting to have to go through secure\"));\n break;\n case defs.ConnectionClose:\n bail(new Error(fmt(\"Handshake terminated by server: %s\",\n closeMsg(reply))));\n break;\n case defs.ConnectionTune:\n var fields = reply.fields;\n tunedOptions.frameMax =\n negotiate(fields.frameMax, allFields.frameMax);\n tunedOptions.channelMax =\n negotiate(fields.channelMax, allFields.channelMax);\n tunedOptions.heartbeat =\n negotiate(fields.heartbeat, allFields.heartbeat);\n try {\n send(defs.ConnectionTuneOk);\n send(defs.ConnectionOpen);\n } catch (err) {\n bail(err);\n return;\n }\n expect(defs.ConnectionOpenOk, onOpenOk);\n break;\n default:\n bail(new Error(\n fmt(\"Expected connection.secure, connection.close, \" +\n \"or connection.tune during handshake; got %s\",\n inspect(reply, false))));\n break;\n }\n }\n\n function onOpenOk (openOk) {\n // Impose the maximum of the encoded value, if the negotiated\n // value is zero, meaning \"no, no limits\"\n self.channelMax = tunedOptions.channelMax || 0xffff;\n self.frameMax = tunedOptions.frameMax || 0xffffffff;\n // 0 means \"no heartbeat\", rather than \"maximum period of\n // heartbeating\"\n self.heartbeat = tunedOptions.heartbeat;\n self.heartbeater = self.startHeartbeater();\n self.accept = mainAccept;\n succeed(openOk);\n }\n\n // If the server closes the connection, it's probably because of\n // something we did\n function endWhileOpening (err) {\n bail(err || new Error('Socket closed abruptly ' +\n 'during opening handshake'));\n }\n\n this.stream.on('end', endWhileOpening);\n this.stream.on('error', endWhileOpening);\n\n function succeed (ok) {\n self.stream.removeListener('end', endWhileOpening);\n self.stream.removeListener('error', endWhileOpening);\n self.stream.on('error', self.onSocketError.bind(self));\n self.stream.on('end', self.onSocketError.bind(\n self, new Error('Unexpected close')));\n self.on('frameError', self.onSocketError.bind(self));\n self.acceptLoop();\n openCallback(null, ok);\n }\n\n // Now kick off the handshake by prompting the server\n this.sendProtocolHeader();\n expect(defs.ConnectionStart, onStart);\n }\n\n // Closing things: AMQP has a closing handshake that applies to\n // closing both connects and channels. As the initiating party, I send\n // Close, then ignore all frames until I see either CloseOK --\n // which signifies that the other party has seen the Close and shut\n // the connection or channel down, so it's fine to free resources; or\n // Close, which means the other party also wanted to close the\n // whatever, and I should send CloseOk so it can free resources,\n // then go back to waiting for the CloseOk. If I receive a Close\n // out of the blue, I should throw away any unsent frames (they will\n // be ignored anyway) and send CloseOk, then clean up resources. In\n // general, Close out of the blue signals an error (or a forced\n // closure, which may as well be an error).\n //\n // RUNNING [1] --- send Close ---> Closing [2] ---> recv Close --+\n // | | [3]\n // | +------ send CloseOk ------+\n // recv Close recv CloseOk\n // | |\n // V V\n // Ended [4] ---- send CloseOk ---> Closed [5]\n //\n // [1] All frames accepted; getting a Close frame from the server\n // moves to Ended; client may initiate a close by sending Close\n // itself.\n // [2] Client has initiated a close; only CloseOk or (simulataneously\n // sent) Close is accepted.\n // [3] Simultaneous close\n // [4] Server won't send any more frames; accept no more frames, send\n // CloseOk.\n // [5] Fully closed, client will send no more, server will send no\n // more. Signal 'close' or 'error'.\n //\n // There are two signalling mechanisms used in the API. The first is\n // that calling `close` will return a promise, that will either\n // resolve once the connection or channel is cleanly shut down, or\n // will reject if the shutdown times out.\n //\n // The second is the 'close' and 'error' events. These are\n // emitted as above. The events will fire *before* promises are\n // resolved.\n // Close the connection without even giving a reason. Typical.\n close (closeCallback) {\n var k = closeCallback && function () { closeCallback(null); };\n this.closeBecause(\"Cheers, thanks\", constants.REPLY_SUCCESS, k);\n }\n\n // Close with a reason and a 'code'. I'm pretty sure RabbitMQ totally\n // ignores these; maybe it logs them. The continuation will be invoked\n // when the CloseOk has been received, and before the 'close' event.\n closeBecause (reason, code, k) {\n this.sendMethod(0, defs.ConnectionClose, {\n replyText: reason,\n replyCode: code,\n methodId: 0, classId: 0\n });\n var s = stackCapture('closeBecause called: ' + reason);\n this.toClosing(s, k);\n }\n\n closeWithError (reason, code, error) {\n this.emit('error', error);\n this.closeBecause(reason, code);\n }\n\n onSocketError (err) {\n if (!this.expectSocketClose) {\n // forestall any more calls to onSocketError, since we're signed\n // up for `'error'` *and* `'end'`\n this.expectSocketClose = true;\n this.emit('error', err);\n var s = stackCapture('Socket error');\n this.toClosed(s, err);\n }\n }\n\n // A close has been initiated. Repeat: a close has been initiated.\n // This means we should not send more frames, anyway they will be\n // ignored. We also have to shut down all the channels.\n toClosing (capturedStack, k) {\n var send = this.sendMethod.bind(this);\n\n this.accept = function (f) {\n if (f.id === defs.ConnectionCloseOk) {\n if (k)\n k();\n var s = stackCapture('ConnectionCloseOk received');\n this.toClosed(s, undefined);\n }\n else if (f.id === defs.ConnectionClose) {\n send(0, defs.ConnectionCloseOk, {});\n }\n // else ignore frame\n };\n invalidateSend(this, 'Connection closing', capturedStack);\n }\n\n _closeChannels (capturedStack) {\n for (var i = 1; i < this.channels.length; i++) {\n var ch = this.channels[i];\n if (ch !== null) {\n ch.channel.toClosed(capturedStack); // %%% or with an error? not clear\n }\n }\n }\n\n // A close has been confirmed. Cease all communication.\n toClosed (capturedStack, maybeErr) {\n this._closeChannels(capturedStack);\n var info = fmt('Connection closed (%s)',\n (maybeErr) ? maybeErr.toString() : 'by client');\n // Tidy up, invalidate enverything, dynamite the bridges.\n invalidateSend(this, info, capturedStack);\n this.accept = invalidOp(info, capturedStack);\n this.close = function (cb) {\n cb && cb(new IllegalOperationError(info, capturedStack));\n };\n if (this.heartbeater)\n this.heartbeater.clear();\n // This is certainly true now, if it wasn't before\n this.expectSocketClose = true;\n this.stream.end();\n this.emit('close', maybeErr);\n }\n\n _updateSecret(newSecret, reason, cb) {\n this.sendMethod(0, defs.ConnectionUpdateSecret, {\n newSecret,\n reason\n });\n this.once('update-secret-ok', cb);\n }\n\n // ===\n startHeartbeater () {\n if (this.heartbeat === 0)\n return null;\n else {\n var self = this;\n var hb = new Heart(this.heartbeat,\n this.checkSend.bind(this),\n this.checkRecv.bind(this));\n hb.on('timeout', function () {\n var hberr = new Error(\"Heartbeat timeout\");\n self.emit('error', hberr);\n var s = stackCapture('Heartbeat timeout');\n self.toClosed(s, hberr);\n });\n hb.on('beat', function () {\n self.sendHeartbeat();\n });\n return hb;\n }\n }\n\n // I use an array to keep track of the channels, rather than an\n // object. The channel identifiers are numbers, and allocated by the\n // connection. If I try to allocate low numbers when they are\n // available (which I do, by looking from the start of the bitset),\n // this ought to keep the array small, and out of 'sparse array\n // storage'. I also set entries to null, rather than deleting them, in\n // the expectation that the next channel allocation will fill the slot\n // again rather than growing the array. See\n // http://www.html5rocks.com/en/tutorials/speed/v8/\n freshChannel (channel, options) {\n var next = this.freeChannels.nextClearBit(1);\n if (next < 0 || next > this.channelMax)\n throw new Error(\"No channels left to allocate\");\n this.freeChannels.set(next);\n\n var hwm = (options && options.highWaterMark) || DEFAULT_WRITE_HWM;\n var writeBuffer = new PassThrough({\n objectMode: true, highWaterMark: hwm\n });\n this.channels[next] = { channel: channel, buffer: writeBuffer };\n writeBuffer.on('drain', function () {\n channel.onBufferDrain();\n });\n this.muxer.pipeFrom(writeBuffer);\n return next;\n }\n\n releaseChannel (channel) {\n this.freeChannels.clear(channel);\n var buffer = this.channels[channel].buffer;\n buffer.end(); // will also cause it to be unpiped\n this.channels[channel] = null;\n }\n\n acceptLoop () {\n var self = this;\n\n function go () {\n try {\n var f; while (f = self.recvFrame())\n self.accept(f);\n }\n catch (e) {\n self.emit('frameError', e);\n }\n }\n self.stream.on('readable', go);\n go();\n }\n\n step (cb) {\n var self = this;\n function recv () {\n var f;\n try {\n f = self.recvFrame();\n }\n catch (e) {\n cb(e, null);\n return;\n }\n if (f)\n cb(null, f);\n else\n self.stream.once('readable', recv);\n }\n recv();\n }\n\n checkSend () {\n var check = this.sentSinceLastCheck;\n this.sentSinceLastCheck = false;\n return check;\n }\n\n checkRecv () {\n var check = this.recvSinceLastCheck;\n this.recvSinceLastCheck = false;\n return check;\n }\n\n sendBytes (bytes) {\n this.sentSinceLastCheck = true;\n this.stream.write(bytes);\n }\n\n sendHeartbeat () {\n return this.sendBytes(frame.HEARTBEAT_BUF);\n }\n\n sendMethod (channel, Method, fields) {\n var frame = encodeMethod(Method, channel, fields);\n this.sentSinceLastCheck = true;\n var buffer = this.channels[channel].buffer;\n return buffer.write(frame);\n }\n\n sendMessage (channel, Method, fields, Properties, props, content) {\n if (!Buffer.isBuffer(content))\n throw new TypeError('content is not a buffer');\n\n var mframe = encodeMethod(Method, channel, fields);\n var pframe = encodeProperties(Properties, channel,\n content.length, props);\n var buffer = this.channels[channel].buffer;\n this.sentSinceLastCheck = true;\n\n var methodHeaderLen = mframe.length + pframe.length;\n var bodyLen = (content.length > 0) ?\n content.length + FRAME_OVERHEAD : 0;\n var allLen = methodHeaderLen + bodyLen;\n\n if (allLen < SINGLE_CHUNK_THRESHOLD) {\n // Use `allocUnsafe` to avoid excessive allocations and CPU usage\n // from zeroing. The returned Buffer is not zeroed and so must be\n // completely filled to be used safely.\n // See https://github.com/amqp-node/amqplib/pull/695\n var all = Buffer.allocUnsafe(allLen);\n var offset = mframe.copy(all, 0);\n offset += pframe.copy(all, offset);\n\n if (bodyLen > 0)\n makeBodyFrame(channel, content).copy(all, offset);\n return buffer.write(all);\n }\n else {\n if (methodHeaderLen < SINGLE_CHUNK_THRESHOLD) {\n // Use `allocUnsafe` to avoid excessive allocations and CPU usage\n // from zeroing. The returned Buffer is not zeroed and so must be\n // completely filled to be used safely.\n // See https://github.com/amqp-node/amqplib/pull/695\n var both = Buffer.allocUnsafe(methodHeaderLen);\n var offset = mframe.copy(both, 0);\n pframe.copy(both, offset);\n buffer.write(both);\n }\n else {\n buffer.write(mframe);\n buffer.write(pframe);\n }\n return this.sendContent(channel, content);\n }\n }\n\n sendContent (channel, body) {\n if (!Buffer.isBuffer(body)) {\n throw new TypeError(fmt(\"Expected buffer; got %s\", body));\n }\n var writeResult = true;\n var buffer = this.channels[channel].buffer;\n\n var maxBody = this.frameMax - FRAME_OVERHEAD;\n\n for (var offset = 0; offset < body.length; offset += maxBody) {\n var end = offset + maxBody;\n var slice = (end > body.length) ? body.subarray(offset) : body.subarray(offset, end);\n var bodyFrame = makeBodyFrame(channel, slice);\n writeResult = buffer.write(bodyFrame);\n }\n this.sentSinceLastCheck = true;\n return writeResult;\n }\n\n recvFrame () {\n // %%% identifying invariants might help here?\n var frame = parseFrame(this.rest);\n\n if (!frame) {\n var incoming = this.stream.read();\n if (incoming === null) {\n return false;\n }\n else {\n this.recvSinceLastCheck = true;\n this.rest = Buffer.concat([this.rest, incoming]);\n return this.recvFrame();\n }\n }\n else {\n this.rest = frame.rest;\n return decodeFrame(frame);\n }\n }\n}\n\n// Usual frame accept mode\nfunction mainAccept(frame) {\n var rec = this.channels[frame.channel];\n if (rec) { return rec.channel.accept(frame); }\n // NB CHANNEL_ERROR may not be right, but I don't know what is ..\n else\n this.closeWithError(\n fmt('Frame on unknown channel %d', frame.channel),\n constants.CHANNEL_ERROR,\n new Error(fmt(\"Frame on unknown channel: %s\",\n inspect(frame, false))));\n}\n\n// Handle anything that comes through on channel 0, that's the\n// connection control channel. This is only used once mainAccept is\n// installed as the frame handler, after the opening handshake.\nfunction channel0(connection) {\n return function(f) {\n // Once we get a 'close', we know 1. we'll get no more frames, and\n // 2. anything we send except close, or close-ok, will be\n // ignored. If we already sent 'close', this won't be invoked since\n // we're already in closing mode; if we didn't well we're not going\n // to send it now are we.\n if (f === HEARTBEAT); // ignore; it's already counted as activity\n // on the socket, which is its purpose\n else if (f.id === defs.ConnectionClose) {\n // Oh. OK. I guess we're done here then.\n connection.sendMethod(0, defs.ConnectionCloseOk, {});\n var emsg = fmt('Connection closed: %s', closeMsg(f));\n var s = stackCapture(emsg);\n var e = new Error(emsg);\n e.code = f.fields.replyCode;\n if (isFatalError(e)) {\n connection.emit('error', e);\n }\n connection.toClosed(s, e);\n }\n else if (f.id === defs.ConnectionBlocked) {\n connection.emit('blocked', f.fields.reason);\n }\n else if (f.id === defs.ConnectionUnblocked) {\n connection.emit('unblocked');\n }\n else if (f.id === defs.ConnectionUpdateSecretOk) {\n connection.emit('update-secret-ok');\n }\n else {\n connection.closeWithError(\n fmt(\"Unexpected frame on channel 0\"),\n constants.UNEXPECTED_FRAME,\n new Error(fmt(\"Unexpected frame on channel 0: %s\",\n inspect(f, false))));\n }\n };\n}\n\nfunction invalidOp(msg, stack) {\n return function() {\n throw new IllegalOperationError(msg, stack);\n };\n}\n\nfunction invalidateSend(conn, msg, stack) {\n conn.sendMethod = conn.sendContent = conn.sendMessage =\n invalidOp(msg, stack);\n}\n\nvar encodeMethod = defs.encodeMethod;\nvar encodeProperties = defs.encodeProperties;\n\nvar FRAME_OVERHEAD = defs.FRAME_OVERHEAD;\nvar makeBodyFrame = frame.makeBodyFrame;\n\nvar parseFrame = frame.parseFrame;\nvar decodeFrame = frame.decodeFrame;\n\nfunction wrapStream(s) {\n if (s instanceof Duplex) return s;\n else {\n var ws = new Duplex();\n ws.wrap(s); //wraps the readable side of things\n ws._write = function(chunk, encoding, callback) {\n return s.write(chunk, encoding, callback);\n };\n return ws;\n }\n}\n\nfunction isFatalError(error) {\n switch (error && error.code) {\n case defs.constants.CONNECTION_FORCED:\n case defs.constants.REPLY_SUCCESS:\n return false;\n default:\n return true;\n }\n}\n\nmodule.exports.Connection = Connection;\nmodule.exports.isFatalError = isFatalError;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;CAMA,IAAI;CACJ,IAAI,YAAY,KAAK;CACrB,IAAI;CACJ,IAAI,YAAY,MAAM;CACtB,IAAI,oBAAuB;CAE3B,IAAI,mBAAiB,QAAQ,EAAE;CAC/B,IAAI,yBAAuB,QAAQ;CACnC,IAAI,4BAA+B;CAEnC,IAAI,8BAAiC;CACrC,IAAI,4BAA+B;CACnC,IAAI,2BAA8B;CAElC,IAAI,0BAA6B;CACjC,IAAI,gBAAc,MAAM,EAAE;CAC1B,IAAI,wBAAsB,QAAQ,EAAE;CACpC,IAAI,wCAA2C;CAC/C,IAAI,+BAAkC;CAItC,IAAI,oBAAoB;CAKxB,IAAI,yBAAyB;CAE7B,IAAM,aAAN,cAAyB,aAAa;EACpC,YAAa,YAAY;GACvB,MAAM;GAEN,IAAI,SAAS,KAAK,SAAS,WAAW,UAAU;GAChD,KAAK,QAAQ,IAAI,IAAI,MAAM;GAG3B,KAAK,OAAO,OAAO,MAAM,CAAC;GAC1B,KAAK,WAAW,UAAU;GAC1B,KAAK,qBAAqB;GAC1B,KAAK,qBAAqB;GAE1B,KAAK,o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,KAAK,mBACrB,WAAW,KAAK,WAAW,EAAE,OAAO,MAAM;QAEvC,IAAI,EAAE,OAAO,KAAK,qBACrB,WAAW,KAAK,WAAW;QAExB,IAAI,EAAE,OAAO,KAAK,0BACrB,WAAW,KAAK,kBAAkB;QAGlC,WAAW,eACT,IAAI,+BAA+B,GACnC,UAAU,kBACV,IAAI,MAAM,IAAI,qCACA,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC;EAEvC;CACF;CAEA,SAAS,UAAU,KAAK,OAAO;EAC7B,OAAO,WAAW;GAChB,MAAM,IAAI,sBAAsB,KAAK,KAAK;EAC5C;CACF;CAEA,SAAS,eAAe,MAAM,KAAK,OAAO;EACxC,KAAK,aAAa,KAAK,cAAc,KAAK,cACxC,UAAU,KAAK,KAAK;CACxB;CAEA,IAAI,eAAe,KAAK;CACxB,IAAI,mBAAmB,KAAK;CAE5B,IAAI,iBAAiB,KAAK;CAC1B,IAAI,gBAAgB,MAAM;CAE1B,IAAI,aAAa,MAAM;CACvB,IAAI,cAAc,MAAM;CAExB,SAAS,WAAW,GAAG;EACrB,IAAI,aAAa,QAAQ,OAAO;OAC3B;GACH,IAAI,KAAK,IAAI,OAAO;GACpB,GAAG,KAAK,CAAC;GACT,GAAG,SAAS,SAAS,OAAO,UAAU,UAAU;IAC9C,OAAO,EAAE,MAAM,OAAO,UAAU,QAAQ;GAC1C;GACA,OAAO;EACT;CACF;CAEA,SAAS,aAAa,OAAO;EAC3B,QAAQ,SAAS,MAAM,MAAvB;GACA,KAAK,KAAK,UAAU;GACpB,KAAK,KAAK,UAAU,eAClB,OAAO;GACT,SACE,OAAO;EACT;CACF;CAEA,OAAO,QAAQ,aAAa;CAC5B,OAAO,QAAQ,eAAe"}
1
+ {"version":3,"file":"connection.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/connection.js"],"sourcesContent":["//\n//\n//\n\n'use strict';\n\nvar defs = require('./defs');\nvar constants = defs.constants;\nvar frame = require('./frame');\nvar HEARTBEAT = frame.HEARTBEAT;\nvar Mux = require('./mux').Mux;\n\nvar Duplex = require('stream').Duplex;\nvar EventEmitter = require('events');\nvar Heart = require('./heartbeat').Heart;\n\nvar methodName = require('./format').methodName;\nvar closeMsg = require('./format').closeMessage;\nvar inspect = require('./format').inspect;\n\nvar BitSet = require('./bitset').BitSet;\nvar fmt = require('util').format;\nvar PassThrough = require('stream').PassThrough;\nvar IllegalOperationError = require('./error').IllegalOperationError;\nvar stackCapture = require('./error').stackCapture;\n\n// High-water mark for channel write buffers, in 'objects' (which are\n// encoded frames as buffers).\nvar DEFAULT_WRITE_HWM = 1024;\n// If all the frames of a message (method, properties, content) total\n// to less than this, copy them into a single buffer and write it all\n// at once. Note that this is less than the minimum frame size: if it\n// was greater, we might have to fragment the content.\nvar SINGLE_CHUNK_THRESHOLD = 2048;\n\nclass Connection extends EventEmitter {\n constructor (underlying) {\n super();\n\n var stream = this.stream = wrapStream(underlying);\n this.muxer = new Mux(stream);\n\n // frames\n this.rest = Buffer.alloc(0);\n this.frameMax = constants.FRAME_MIN_SIZE;\n this.sentSinceLastCheck = false;\n this.recvSinceLastCheck = false;\n\n this.expectSocketClose = false;\n this.freeChannels = new BitSet();\n this.channels = [{\n channel: { accept: channel0(this) },\n buffer: underlying\n }];\n }\n\n // This changed between versions, as did the codec, methods, etc. AMQP\n // 0-9-1 is fairly similar to 0.8, but better, and nothing implements\n // 0.8 that doesn't implement 0-9-1. In other words, it doesn't make\n // much sense to generalise here.\n sendProtocolHeader () {\n this.sendBytes(frame.PROTOCOL_HEADER);\n }\n\n /*\n The frighteningly complicated opening protocol (spec section 2.2.4):\n\n Client -> Server\n\n protocol header ->\n <- start\n start-ok ->\n .. next two zero or more times ..\n <- secure\n secure-ok ->\n <- tune\n tune-ok ->\n open ->\n <- open-ok\n\n If I'm only supporting SASL's PLAIN mechanism (which I am for the time\n being), it gets a bit easier since the server won't in general send\n back a `secure`, it'll just send `tune` after the `start-ok`.\n (SASL PLAIN: http://tools.ietf.org/html/rfc4616)\n\n */\n open (allFields, openCallback0) {\n var self = this;\n var openCallback = openCallback0 || function () { };\n\n // This is where we'll put our negotiated values\n var tunedOptions = Object.create(allFields);\n\n function wait (k) {\n self.step(function (err, frame) {\n if (err !== null)\n bail(err);\n else if (frame.channel !== 0) {\n bail(new Error(\n fmt(\"Frame on channel != 0 during handshake: %s\",\n inspect(frame, false))));\n }\n else\n k(frame);\n });\n }\n\n function expect (Method, k) {\n wait(function (frame) {\n if (frame.id === Method)\n k(frame);\n else {\n bail(new Error(\n fmt(\"Expected %s; got %s\",\n methodName(Method), inspect(frame, false))));\n }\n });\n }\n\n function bail (err) {\n openCallback(err);\n }\n\n function send (Method) {\n // This can throw an exception if there's some problem with the\n // options; e.g., something is a string instead of a number.\n self.sendMethod(0, Method, tunedOptions);\n }\n\n function negotiate (server, desired) {\n // We get sent values for channelMax, frameMax and heartbeat,\n // which we may accept or lower (subject to a minimum for\n // frameMax, but we'll leave that to the server to enforce). In\n // all cases, `0` really means \"no limit\", or rather the highest\n // value in the encoding, e.g., unsigned short for channelMax.\n if (server === 0 || desired === 0) {\n // i.e., whichever places a limit, if either\n return Math.max(server, desired);\n }\n else {\n return Math.min(server, desired);\n }\n }\n\n function onStart (start) {\n var mechanisms = start.fields.mechanisms.toString().split(' ');\n if (mechanisms.indexOf(allFields.mechanism) < 0) {\n bail(new Error(fmt('SASL mechanism %s is not provided by the server',\n allFields.mechanism)));\n return;\n }\n self.serverProperties = start.fields.serverProperties;\n try {\n send(defs.ConnectionStartOk);\n } catch (err) {\n bail(err);\n return;\n }\n wait(afterStartOk);\n }\n\n function afterStartOk (reply) {\n switch (reply.id) {\n case defs.ConnectionSecure:\n bail(new Error(\n \"Wasn't expecting to have to go through secure\"));\n break;\n case defs.ConnectionClose:\n bail(new Error(fmt(\"Handshake terminated by server: %s\",\n closeMsg(reply))));\n break;\n case defs.ConnectionTune:\n var fields = reply.fields;\n tunedOptions.frameMax =\n negotiate(fields.frameMax, allFields.frameMax);\n tunedOptions.channelMax =\n negotiate(fields.channelMax, allFields.channelMax);\n tunedOptions.heartbeat =\n negotiate(fields.heartbeat, allFields.heartbeat);\n try {\n send(defs.ConnectionTuneOk);\n send(defs.ConnectionOpen);\n } catch (err) {\n bail(err);\n return;\n }\n expect(defs.ConnectionOpenOk, onOpenOk);\n break;\n default:\n bail(new Error(\n fmt(\"Expected connection.secure, connection.close, \" +\n \"or connection.tune during handshake; got %s\",\n inspect(reply, false))));\n break;\n }\n }\n\n function onOpenOk (openOk) {\n // Impose the maximum of the encoded value, if the negotiated\n // value is zero, meaning \"no, no limits\"\n self.channelMax = tunedOptions.channelMax || 0xffff;\n self.frameMax = tunedOptions.frameMax || 0xffffffff;\n // 0 means \"no heartbeat\", rather than \"maximum period of\n // heartbeating\"\n self.heartbeat = tunedOptions.heartbeat;\n self.heartbeater = self.startHeartbeater();\n self.accept = mainAccept;\n succeed(openOk);\n }\n\n // If the server closes the connection, it's probably because of\n // something we did\n function endWhileOpening (err) {\n bail(err || new Error('Socket closed abruptly ' +\n 'during opening handshake'));\n }\n\n this.stream.on('end', endWhileOpening);\n this.stream.on('error', endWhileOpening);\n\n function succeed (ok) {\n self.stream.removeListener('end', endWhileOpening);\n self.stream.removeListener('error', endWhileOpening);\n self.stream.on('error', self.onSocketError.bind(self));\n self.stream.on('end', self.onSocketError.bind(\n self, new Error('Unexpected close')));\n self.on('frameError', self.onSocketError.bind(self));\n self.acceptLoop();\n openCallback(null, ok);\n }\n\n // Now kick off the handshake by prompting the server\n this.sendProtocolHeader();\n expect(defs.ConnectionStart, onStart);\n }\n\n // Closing things: AMQP has a closing handshake that applies to\n // closing both connects and channels. As the initiating party, I send\n // Close, then ignore all frames until I see either CloseOK --\n // which signifies that the other party has seen the Close and shut\n // the connection or channel down, so it's fine to free resources; or\n // Close, which means the other party also wanted to close the\n // whatever, and I should send CloseOk so it can free resources,\n // then go back to waiting for the CloseOk. If I receive a Close\n // out of the blue, I should throw away any unsent frames (they will\n // be ignored anyway) and send CloseOk, then clean up resources. In\n // general, Close out of the blue signals an error (or a forced\n // closure, which may as well be an error).\n //\n // RUNNING [1] --- send Close ---> Closing [2] ---> recv Close --+\n // | | [3]\n // | +------ send CloseOk ------+\n // recv Close recv CloseOk\n // | |\n // V V\n // Ended [4] ---- send CloseOk ---> Closed [5]\n //\n // [1] All frames accepted; getting a Close frame from the server\n // moves to Ended; client may initiate a close by sending Close\n // itself.\n // [2] Client has initiated a close; only CloseOk or (simulataneously\n // sent) Close is accepted.\n // [3] Simultaneous close\n // [4] Server won't send any more frames; accept no more frames, send\n // CloseOk.\n // [5] Fully closed, client will send no more, server will send no\n // more. Signal 'close' or 'error'.\n //\n // There are two signalling mechanisms used in the API. The first is\n // that calling `close` will return a promise, that will either\n // resolve once the connection or channel is cleanly shut down, or\n // will reject if the shutdown times out.\n //\n // The second is the 'close' and 'error' events. These are\n // emitted as above. The events will fire *before* promises are\n // resolved.\n // Close the connection without even giving a reason. Typical.\n close (closeCallback) {\n var k = closeCallback && function () { closeCallback(null); };\n this.closeBecause(\"Cheers, thanks\", constants.REPLY_SUCCESS, k);\n }\n\n // Close with a reason and a 'code'. I'm pretty sure RabbitMQ totally\n // ignores these; maybe it logs them. The continuation will be invoked\n // when the CloseOk has been received, and before the 'close' event.\n closeBecause (reason, code, k) {\n this.sendMethod(0, defs.ConnectionClose, {\n replyText: reason,\n replyCode: code,\n methodId: 0, classId: 0\n });\n var s = stackCapture('closeBecause called: ' + reason);\n this.toClosing(s, k);\n }\n\n closeWithError (reason, code, error) {\n this.emit('error', error);\n this.closeBecause(reason, code);\n }\n\n onSocketError (err) {\n if (!this.expectSocketClose) {\n // forestall any more calls to onSocketError, since we're signed\n // up for `'error'` *and* `'end'`\n this.expectSocketClose = true;\n this.emit('error', err);\n var s = stackCapture('Socket error');\n this.toClosed(s, err);\n }\n }\n\n // A close has been initiated. Repeat: a close has been initiated.\n // This means we should not send more frames, anyway they will be\n // ignored. We also have to shut down all the channels.\n toClosing (capturedStack, k) {\n var send = this.sendMethod.bind(this);\n\n this.accept = function (f) {\n if (f.id === defs.ConnectionCloseOk) {\n if (k)\n k();\n var s = stackCapture('ConnectionCloseOk received');\n this.toClosed(s, undefined);\n }\n else if (f.id === defs.ConnectionClose) {\n send(0, defs.ConnectionCloseOk, {});\n }\n // else ignore frame\n };\n invalidateSend(this, 'Connection closing', capturedStack);\n }\n\n _closeChannels (capturedStack) {\n for (var i = 1; i < this.channels.length; i++) {\n var ch = this.channels[i];\n if (ch !== null) {\n ch.channel.toClosed(capturedStack); // %%% or with an error? not clear\n }\n }\n }\n\n // A close has been confirmed. Cease all communication.\n toClosed (capturedStack, maybeErr) {\n this._closeChannels(capturedStack);\n var info = fmt('Connection closed (%s)',\n (maybeErr) ? maybeErr.toString() : 'by client');\n // Tidy up, invalidate enverything, dynamite the bridges.\n invalidateSend(this, info, capturedStack);\n this.accept = invalidOp(info, capturedStack);\n this.close = function (cb) {\n cb && cb(new IllegalOperationError(info, capturedStack));\n };\n if (this.heartbeater)\n this.heartbeater.clear();\n // This is certainly true now, if it wasn't before\n this.expectSocketClose = true;\n this.stream.end();\n this.emit('close', maybeErr);\n }\n\n _updateSecret(newSecret, reason, cb) {\n this.sendMethod(0, defs.ConnectionUpdateSecret, {\n newSecret,\n reason\n });\n this.once('update-secret-ok', cb);\n }\n\n // ===\n startHeartbeater () {\n if (this.heartbeat === 0)\n return null;\n else {\n var self = this;\n var hb = new Heart(this.heartbeat,\n this.checkSend.bind(this),\n this.checkRecv.bind(this));\n hb.on('timeout', function () {\n var hberr = new Error(\"Heartbeat timeout\");\n self.emit('error', hberr);\n var s = stackCapture('Heartbeat timeout');\n self.toClosed(s, hberr);\n });\n hb.on('beat', function () {\n self.sendHeartbeat();\n });\n return hb;\n }\n }\n\n // I use an array to keep track of the channels, rather than an\n // object. The channel identifiers are numbers, and allocated by the\n // connection. If I try to allocate low numbers when they are\n // available (which I do, by looking from the start of the bitset),\n // this ought to keep the array small, and out of 'sparse array\n // storage'. I also set entries to null, rather than deleting them, in\n // the expectation that the next channel allocation will fill the slot\n // again rather than growing the array. See\n // http://www.html5rocks.com/en/tutorials/speed/v8/\n freshChannel (channel, options) {\n var next = this.freeChannels.nextClearBit(1);\n if (next < 0 || next > this.channelMax)\n throw new Error(\"No channels left to allocate\");\n this.freeChannels.set(next);\n\n var hwm = (options && options.highWaterMark) || DEFAULT_WRITE_HWM;\n var writeBuffer = new PassThrough({\n objectMode: true, highWaterMark: hwm\n });\n this.channels[next] = { channel: channel, buffer: writeBuffer };\n writeBuffer.on('drain', function () {\n channel.onBufferDrain();\n });\n this.muxer.pipeFrom(writeBuffer);\n return next;\n }\n\n releaseChannel (channel) {\n this.freeChannels.clear(channel);\n var buffer = this.channels[channel].buffer;\n buffer.end(); // will also cause it to be unpiped\n this.channels[channel] = null;\n }\n\n acceptLoop () {\n var self = this;\n\n function go () {\n try {\n var f; while (f = self.recvFrame())\n self.accept(f);\n }\n catch (e) {\n self.emit('frameError', e);\n }\n }\n self.stream.on('readable', go);\n go();\n }\n\n step (cb) {\n var self = this;\n function recv () {\n var f;\n try {\n f = self.recvFrame();\n }\n catch (e) {\n cb(e, null);\n return;\n }\n if (f)\n cb(null, f);\n else\n self.stream.once('readable', recv);\n }\n recv();\n }\n\n checkSend () {\n var check = this.sentSinceLastCheck;\n this.sentSinceLastCheck = false;\n return check;\n }\n\n checkRecv () {\n var check = this.recvSinceLastCheck;\n this.recvSinceLastCheck = false;\n return check;\n }\n\n sendBytes (bytes) {\n this.sentSinceLastCheck = true;\n this.stream.write(bytes);\n }\n\n sendHeartbeat () {\n return this.sendBytes(frame.HEARTBEAT_BUF);\n }\n\n sendMethod (channel, Method, fields) {\n var frame = encodeMethod(Method, channel, fields);\n this.sentSinceLastCheck = true;\n var buffer = this.channels[channel].buffer;\n return buffer.write(frame);\n }\n\n sendMessage (channel, Method, fields, Properties, props, content) {\n if (!Buffer.isBuffer(content))\n throw new TypeError('content is not a buffer');\n\n var mframe = encodeMethod(Method, channel, fields);\n var pframe = encodeProperties(Properties, channel,\n content.length, props);\n var buffer = this.channels[channel].buffer;\n this.sentSinceLastCheck = true;\n\n var methodHeaderLen = mframe.length + pframe.length;\n var bodyLen = (content.length > 0) ?\n content.length + FRAME_OVERHEAD : 0;\n var allLen = methodHeaderLen + bodyLen;\n\n if (allLen < SINGLE_CHUNK_THRESHOLD) {\n // Use `allocUnsafe` to avoid excessive allocations and CPU usage\n // from zeroing. The returned Buffer is not zeroed and so must be\n // completely filled to be used safely.\n // See https://github.com/amqp-node/amqplib/pull/695\n var all = Buffer.allocUnsafe(allLen);\n var offset = mframe.copy(all, 0);\n offset += pframe.copy(all, offset);\n\n if (bodyLen > 0)\n makeBodyFrame(channel, content).copy(all, offset);\n return buffer.write(all);\n }\n else {\n if (methodHeaderLen < SINGLE_CHUNK_THRESHOLD) {\n // Use `allocUnsafe` to avoid excessive allocations and CPU usage\n // from zeroing. The returned Buffer is not zeroed and so must be\n // completely filled to be used safely.\n // See https://github.com/amqp-node/amqplib/pull/695\n var both = Buffer.allocUnsafe(methodHeaderLen);\n var offset = mframe.copy(both, 0);\n pframe.copy(both, offset);\n buffer.write(both);\n }\n else {\n buffer.write(mframe);\n buffer.write(pframe);\n }\n return this.sendContent(channel, content);\n }\n }\n\n sendContent (channel, body) {\n if (!Buffer.isBuffer(body)) {\n throw new TypeError(fmt(\"Expected buffer; got %s\", body));\n }\n var writeResult = true;\n var buffer = this.channels[channel].buffer;\n\n var maxBody = this.frameMax - FRAME_OVERHEAD;\n\n for (var offset = 0; offset < body.length; offset += maxBody) {\n var end = offset + maxBody;\n var slice = (end > body.length) ? body.subarray(offset) : body.subarray(offset, end);\n var bodyFrame = makeBodyFrame(channel, slice);\n writeResult = buffer.write(bodyFrame);\n }\n this.sentSinceLastCheck = true;\n return writeResult;\n }\n\n recvFrame () {\n // %%% identifying invariants might help here?\n var frame = parseFrame(this.rest);\n\n if (!frame) {\n var incoming = this.stream.read();\n if (incoming === null) {\n return false;\n }\n else {\n this.recvSinceLastCheck = true;\n this.rest = Buffer.concat([this.rest, incoming]);\n return this.recvFrame();\n }\n }\n else {\n this.rest = frame.rest;\n return decodeFrame(frame);\n }\n }\n}\n\n// Usual frame accept mode\nfunction mainAccept(frame) {\n var rec = this.channels[frame.channel];\n if (rec) { return rec.channel.accept(frame); }\n // NB CHANNEL_ERROR may not be right, but I don't know what is ..\n else\n this.closeWithError(\n fmt('Frame on unknown channel %d', frame.channel),\n constants.CHANNEL_ERROR,\n new Error(fmt(\"Frame on unknown channel: %s\",\n inspect(frame, false))));\n}\n\n// Handle anything that comes through on channel 0, that's the\n// connection control channel. This is only used once mainAccept is\n// installed as the frame handler, after the opening handshake.\nfunction channel0(connection) {\n return function(f) {\n // Once we get a 'close', we know 1. we'll get no more frames, and\n // 2. anything we send except close, or close-ok, will be\n // ignored. If we already sent 'close', this won't be invoked since\n // we're already in closing mode; if we didn't well we're not going\n // to send it now are we.\n if (f === HEARTBEAT); // ignore; it's already counted as activity\n // on the socket, which is its purpose\n else if (f.id === defs.ConnectionClose) {\n // Oh. OK. I guess we're done here then.\n connection.sendMethod(0, defs.ConnectionCloseOk, {});\n var emsg = fmt('Connection closed: %s', closeMsg(f));\n var s = stackCapture(emsg);\n var e = new Error(emsg);\n e.code = f.fields.replyCode;\n if (isFatalError(e)) {\n connection.emit('error', e);\n }\n connection.toClosed(s, e);\n }\n else if (f.id === defs.ConnectionBlocked) {\n connection.emit('blocked', f.fields.reason);\n }\n else if (f.id === defs.ConnectionUnblocked) {\n connection.emit('unblocked');\n }\n else if (f.id === defs.ConnectionUpdateSecretOk) {\n connection.emit('update-secret-ok');\n }\n else {\n connection.closeWithError(\n fmt(\"Unexpected frame on channel 0\"),\n constants.UNEXPECTED_FRAME,\n new Error(fmt(\"Unexpected frame on channel 0: %s\",\n inspect(f, false))));\n }\n };\n}\n\nfunction invalidOp(msg, stack) {\n return function() {\n throw new IllegalOperationError(msg, stack);\n };\n}\n\nfunction invalidateSend(conn, msg, stack) {\n conn.sendMethod = conn.sendContent = conn.sendMessage =\n invalidOp(msg, stack);\n}\n\nvar encodeMethod = defs.encodeMethod;\nvar encodeProperties = defs.encodeProperties;\n\nvar FRAME_OVERHEAD = defs.FRAME_OVERHEAD;\nvar makeBodyFrame = frame.makeBodyFrame;\n\nvar parseFrame = frame.parseFrame;\nvar decodeFrame = frame.decodeFrame;\n\nfunction wrapStream(s) {\n if (s instanceof Duplex) return s;\n else {\n var ws = new Duplex();\n ws.wrap(s); //wraps the readable side of things\n ws._write = function(chunk, encoding, callback) {\n return s.write(chunk, encoding, callback);\n };\n return ws;\n }\n}\n\nfunction isFatalError(error) {\n switch (error && error.code) {\n case defs.constants.CONNECTION_FORCED:\n case defs.constants.REPLY_SUCCESS:\n return false;\n default:\n return true;\n }\n}\n\nmodule.exports.Connection = Connection;\nmodule.exports.isFatalError = isFatalError;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;CAMA,IAAI;CACJ,IAAI,YAAY,KAAK;CACrB,IAAI;CACJ,IAAI,YAAY,MAAM;CACtB,IAAI,oBAAuB;CAE3B,IAAI,mBAAiB,QAAQ,CAAC,CAAC;CAC/B,IAAI,yBAAuB,QAAQ;CACnC,IAAI,4BAA+B;CAEnC,IAAI,8BAAiC;CACrC,IAAI,4BAA+B;CACnC,IAAI,2BAA8B;CAElC,IAAI,0BAA6B;CACjC,IAAI,gBAAc,MAAM,CAAC,CAAC;CAC1B,IAAI,wBAAsB,QAAQ,CAAC,CAAC;CACpC,IAAI,wCAA2C;CAC/C,IAAI,+BAAkC;CAItC,IAAI,oBAAoB;CAKxB,IAAI,yBAAyB;CAE7B,IAAM,aAAN,cAAyB,aAAa;EACpC,YAAa,YAAY;GACvB,MAAM;GAEN,IAAI,SAAS,KAAK,SAAS,WAAW,UAAU;GAChD,KAAK,QAAQ,IAAI,IAAI,MAAM;GAG3B,KAAK,OAAO,OAAO,MAAM,CAAC;GAC1B,KAAK,WAAW,UAAU;G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../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/credentials.js"],"sourcesContent":["//\n//\n//\n\n// Different kind of credentials that can be supplied when opening a\n// connection, corresponding to SASL mechanisms There's only two\n// useful mechanisms that RabbitMQ implements:\n// * PLAIN (send username and password in the plain)\n// * EXTERNAL (assume the server will figure out who you are from\n// context, i.e., your SSL certificate)\nvar codec = require('./codec')\n\nmodule.exports.plain = function(user, passwd) {\n return {\n mechanism: 'PLAIN',\n response: function() {\n return Buffer.from(['', user, passwd].join(String.fromCharCode(0)))\n },\n username: user,\n password: passwd\n }\n}\n\nmodule.exports.amqplain = function(user, passwd) {\n return {\n mechanism: 'AMQPLAIN',\n response: function() {\n const buffer = Buffer.alloc(16384);\n const size = codec.encodeTable(buffer, { LOGIN: user, PASSWORD: passwd}, 0);\n return buffer.subarray(4, size);\n },\n username: user,\n password: passwd\n }\n}\n\nmodule.exports.external = function() {\n return {\n mechanism: 'EXTERNAL',\n response: function() { return Buffer.from(''); }\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CAUA,IAAI;CAEJ,OAAO,QAAQ,QAAQ,SAAS,MAAM,QAAQ;EAC5C,OAAO;GACL,WAAW;GACX,UAAU,WAAW;IACnB,OAAO,OAAO,KAAK;KAAC;KAAI;KAAM;IAAM,EAAE,KAAK,OAAO,aAAa,CAAC,CAAC,CAAC;GACpE;GACA,UAAU;GACV,UAAU;EACZ;CACF;CAEA,OAAO,QAAQ,WAAW,SAAS,MAAM,QAAQ;EAC/C,OAAO;GACL,WAAW;GACX,UAAU,WAAW;IACnB,MAAM,SAAS,OAAO,MAAM,KAAK;IACjC,MAAM,OAAO,MAAM,YAAY,QAAQ;KAAE,OAAO;KAAM,UAAU;IAAM,GAAG,CAAC;IAC1E,OAAO,OAAO,SAAS,GAAG,IAAI;GAChC;GACA,UAAU;GACV,UAAU;EACZ;CACF;CAEA,OAAO,QAAQ,WAAW,WAAW;EACnC,OAAO;GACL,WAAW;GACX,UAAU,WAAW;IAAE,OAAO,OAAO,KAAK,EAAE;GAAG;EACjD;CACF"}
1
+ {"version":3,"file":"credentials.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/credentials.js"],"sourcesContent":["//\n//\n//\n\n// Different kind of credentials that can be supplied when opening a\n// connection, corresponding to SASL mechanisms There's only two\n// useful mechanisms that RabbitMQ implements:\n// * PLAIN (send username and password in the plain)\n// * EXTERNAL (assume the server will figure out who you are from\n// context, i.e., your SSL certificate)\nvar codec = require('./codec')\n\nmodule.exports.plain = function(user, passwd) {\n return {\n mechanism: 'PLAIN',\n response: function() {\n return Buffer.from(['', user, passwd].join(String.fromCharCode(0)))\n },\n username: user,\n password: passwd\n }\n}\n\nmodule.exports.amqplain = function(user, passwd) {\n return {\n mechanism: 'AMQPLAIN',\n response: function() {\n const buffer = Buffer.alloc(16384);\n const size = codec.encodeTable(buffer, { LOGIN: user, PASSWORD: passwd}, 0);\n return buffer.subarray(4, size);\n },\n username: user,\n password: passwd\n }\n}\n\nmodule.exports.external = function() {\n return {\n mechanism: 'EXTERNAL',\n response: function() { return Buffer.from(''); }\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CAUA,IAAI;CAEJ,OAAO,QAAQ,QAAQ,SAAS,MAAM,QAAQ;EAC5C,OAAO;GACL,WAAW;GACX,UAAU,WAAW;IACnB,OAAO,OAAO,KAAK;KAAC;KAAI;KAAM;IAAM,CAAC,CAAC,KAAK,OAAO,aAAa,CAAC,CAAC,CAAC;GACpE;GACA,UAAU;GACV,UAAU;EACZ;CACF;CAEA,OAAO,QAAQ,WAAW,SAAS,MAAM,QAAQ;EAC/C,OAAO;GACL,WAAW;GACX,UAAU,WAAW;IACnB,MAAM,SAAS,OAAO,MAAM,KAAK;IACjC,MAAM,OAAO,MAAM,YAAY,QAAQ;KAAE,OAAO;KAAM,UAAU;IAAM,GAAG,CAAC;IAC1E,OAAO,OAAO,SAAS,GAAG,IAAI;GAChC;GACA,UAAU;GACV,UAAU;EACZ;CACF;CAEA,OAAO,QAAQ,WAAW,WAAW;EACnC,OAAO;GACL,WAAW;GACX,UAAU,WAAW;IAAE,OAAO,OAAO,KAAK,EAAE;GAAG;EACjD;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"error.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/error.js"],"sourcesContent":["var inherits = require('util').inherits;\n\nfunction trimStack(stack, num) {\n return stack && stack.split('\\n').slice(num).join('\\n');\n}\n\nfunction IllegalOperationError(msg, stack) {\n var tmp = new Error();\n this.message = msg;\n this.stack = this.toString() + '\\n' + trimStack(tmp.stack, 2);\n this.stackAtStateChange = stack;\n}\ninherits(IllegalOperationError, Error);\n\nIllegalOperationError.prototype.name = 'IllegalOperationError';\n\nfunction stackCapture(reason) {\n var e = new Error();\n return 'Stack capture: ' + reason + '\\n' +\n trimStack(e.stack, 2);\n}\n\nmodule.exports.IllegalOperationError = IllegalOperationError;\nmodule.exports.stackCapture = stackCapture;\n"],"x_google_ignoreList":[0],"mappings":";;;;CAAA,IAAI,qBAAmB,MAAM,EAAE;CAE/B,SAAS,UAAU,OAAO,KAAK;EAC7B,OAAO,SAAS,MAAM,MAAM,IAAI,EAAE,MAAM,GAAG,EAAE,KAAK,IAAI;CACxD;CAEA,SAAS,sBAAsB,KAAK,OAAO;EACzC,IAAI,sBAAM,IAAI,MAAM;EACpB,KAAK,UAAU;EACf,KAAK,QAAQ,KAAK,SAAS,IAAI,OAAO,UAAU,IAAI,OAAO,CAAC;EAC5D,KAAK,qBAAqB;CAC5B;CACA,SAAS,uBAAuB,KAAK;CAErC,sBAAsB,UAAU,OAAO;CAEvC,SAAS,aAAa,QAAQ;EAC5B,IAAI,oBAAI,IAAI,MAAM;EAClB,OAAO,oBAAoB,SAAS,OAClC,UAAU,EAAE,OAAO,CAAC;CACxB;CAEA,OAAO,QAAQ,wBAAwB;CACvC,OAAO,QAAQ,eAAe"}
1
+ {"version":3,"file":"error.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/error.js"],"sourcesContent":["var inherits = require('util').inherits;\n\nfunction trimStack(stack, num) {\n return stack && stack.split('\\n').slice(num).join('\\n');\n}\n\nfunction IllegalOperationError(msg, stack) {\n var tmp = new Error();\n this.message = msg;\n this.stack = this.toString() + '\\n' + trimStack(tmp.stack, 2);\n this.stackAtStateChange = stack;\n}\ninherits(IllegalOperationError, Error);\n\nIllegalOperationError.prototype.name = 'IllegalOperationError';\n\nfunction stackCapture(reason) {\n var e = new Error();\n return 'Stack capture: ' + reason + '\\n' +\n trimStack(e.stack, 2);\n}\n\nmodule.exports.IllegalOperationError = IllegalOperationError;\nmodule.exports.stackCapture = stackCapture;\n"],"x_google_ignoreList":[0],"mappings":";;;;CAAA,IAAI,qBAAmB,MAAM,CAAC,CAAC;CAE/B,SAAS,UAAU,OAAO,KAAK;EAC7B,OAAO,SAAS,MAAM,MAAM,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI;CACxD;CAEA,SAAS,sBAAsB,KAAK,OAAO;EACzC,IAAI,sBAAM,IAAI,MAAM;EACpB,KAAK,UAAU;EACf,KAAK,QAAQ,KAAK,SAAS,IAAI,OAAO,UAAU,IAAI,OAAO,CAAC;EAC5D,KAAK,qBAAqB;CAC5B;CACA,SAAS,uBAAuB,KAAK;CAErC,sBAAsB,UAAU,OAAO;CAEvC,SAAS,aAAa,QAAQ;EAC5B,IAAI,oBAAI,IAAI,MAAM;EAClB,OAAO,oBAAoB,SAAS,OAClC,UAAU,EAAE,OAAO,CAAC;CACxB;CAEA,OAAO,QAAQ,wBAAwB;CACvC,OAAO,QAAQ,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"format.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/format.js"],"sourcesContent":["//\n//\n//\n\n// Stringifying various things\n\n'use strict';\n\nvar defs = require('./defs');\nvar format = require('util').format;\nvar HEARTBEAT = require('./frame').HEARTBEAT;\n\nmodule.exports.closeMessage = function(close) {\n var code = close.fields.replyCode;\n return format('%d (%s) with message \"%s\"',\n code, defs.constant_strs[code],\n close.fields.replyText);\n}\n\nmodule.exports.methodName = function(id) {\n return defs.info(id).name;\n};\n\nmodule.exports.inspect = function(frame, showFields) {\n if (frame === HEARTBEAT) {\n return '<Heartbeat>';\n }\n else if (!frame.id) {\n return format('<Content channel:%d size:%d>',\n frame.channel, frame.size);\n }\n else {\n var info = defs.info(frame.id);\n return format('<%s channel:%d%s>', info.name, frame.channel,\n (showFields)\n ? ' ' + JSON.stringify(frame.fields, undefined, 2)\n : '');\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CAQA,IAAI;CACJ,IAAI,mBAAiB,MAAM,EAAE;CAC7B,IAAI,4BAA+B;CAEnC,OAAO,QAAQ,eAAe,SAAS,OAAO;EAC5C,IAAI,OAAO,MAAM,OAAO;EACxB,OAAO,OAAO,+BACA,MAAM,KAAK,cAAc,OACzB,MAAM,OAAO,SAAS;CACtC;CAEA,OAAO,QAAQ,aAAa,SAAS,IAAI;EACvC,OAAO,KAAK,KAAK,EAAE,EAAE;CACvB;CAEA,OAAO,QAAQ,UAAU,SAAS,OAAO,YAAY;EACnD,IAAI,UAAU,WACZ,OAAO;OAEJ,IAAI,CAAC,MAAM,IACd,OAAO,OAAO,gCACA,MAAM,SAAS,MAAM,IAAI;OAIvC,OAAO,OAAO,qBADH,KAAK,KAAK,MAAM,EACW,EAAE,MAAM,MAAM,SACrC,aACC,MAAM,KAAK,UAAU,MAAM,QAAQ,QAAW,CAAC,IAC/C,EAAE;CAEtB"}
1
+ {"version":3,"file":"format.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/amqplib@0.10.9/node_modules/amqplib/lib/format.js"],"sourcesContent":["//\n//\n//\n\n// Stringifying various things\n\n'use strict';\n\nvar defs = require('./defs');\nvar format = require('util').format;\nvar HEARTBEAT = require('./frame').HEARTBEAT;\n\nmodule.exports.closeMessage = function(close) {\n var code = close.fields.replyCode;\n return format('%d (%s) with message \"%s\"',\n code, defs.constant_strs[code],\n close.fields.replyText);\n}\n\nmodule.exports.methodName = function(id) {\n return defs.info(id).name;\n};\n\nmodule.exports.inspect = function(frame, showFields) {\n if (frame === HEARTBEAT) {\n return '<Heartbeat>';\n }\n else if (!frame.id) {\n return format('<Content channel:%d size:%d>',\n frame.channel, frame.size);\n }\n else {\n var info = defs.info(frame.id);\n return format('<%s channel:%d%s>', info.name, frame.channel,\n (showFields)\n ? ' ' + JSON.stringify(frame.fields, undefined, 2)\n : '');\n }\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CAQA,IAAI;CACJ,IAAI,mBAAiB,MAAM,CAAC,CAAC;CAC7B,IAAI,4BAA+B;CAEnC,OAAO,QAAQ,eAAe,SAAS,OAAO;EAC5C,IAAI,OAAO,MAAM,OAAO;EACxB,OAAO,OAAO,+BACA,MAAM,KAAK,cAAc,OACzB,MAAM,OAAO,SAAS;CACtC;CAEA,OAAO,QAAQ,aAAa,SAAS,IAAI;EACvC,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC;CACvB;CAEA,OAAO,QAAQ,UAAU,SAAS,OAAO,YAAY;EACnD,IAAI,UAAU,WACZ,OAAO;OAEJ,IAAI,CAAC,MAAM,IACd,OAAO,OAAO,gCACA,MAAM,SAAS,MAAM,IAAI;OAIvC,OAAO,OAAO,qBADH,KAAK,KAAK,MAAM,EACW,CAAC,CAAC,MAAM,MAAM,SACrC,aACC,MAAM,KAAK,UAAU,MAAM,QAAQ,QAAW,CAAC,IAC/C,EAAE;CAEtB"}