decocms 2.281.1 → 2.281.2

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 (192) hide show
  1. package/dist/client/assets/{AlertCircle-CXhNEqPD.js → AlertCircle-BeQFaTo3.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DBqrhl2C.js → ArrowNarrowLeft-C-IANgnQ.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-rrM45Ijo.js → CheckCircle-Dh4A5tI_.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DAKkigRT.js → ChevronDown-D9aZn2Hi.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-nEY3RpXH.js → ChevronRight-CkL59Zuk.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-T3_ih6Xh.js → ChevronUp-C7hCnblE.js} +1 -1
  7. package/dist/client/assets/{Container-CNCAIie1.js → Container-CSvdcipc.js} +1 -1
  8. package/dist/client/assets/{LinkExternal01-C_NJPXt5.js → LinkExternal01-sdvrsKlM.js} +1 -1
  9. package/dist/client/assets/{Lock01-DDr7tDu1.js → Lock01-CneVnDQd.js} +1 -1
  10. package/dist/client/assets/{Palette-CF-36u-L.js → Palette-Bo0ad1R6.js} +1 -1
  11. package/dist/client/assets/{Play-dn0rkS_S.js → Play-BhoAd8Uu.js} +1 -1
  12. package/dist/client/assets/{Plus-BIO83iih.js → Plus-79r9zazJ.js} +1 -1
  13. package/dist/client/assets/{SearchMd-DL-HZIzn.js → SearchMd-00qF-7Ba.js} +1 -1
  14. package/dist/client/assets/{Settings02-B4pMJgrZ.js → Settings02-B6cIpcv6.js} +1 -1
  15. package/dist/client/assets/{Star01-DBidYcso.js → Star01-RArWROxo.js} +1 -1
  16. package/dist/client/assets/{Sun-DQm1w3KD.js → Sun-CaIYIMZ6.js} +1 -1
  17. package/dist/client/assets/{Tool01-C5f9n9uP.js → Tool01-BK4G_l0X.js} +1 -1
  18. package/dist/client/assets/{Trash01-EeQ8Zxiu.js → Trash01-PNv-fbRK.js} +1 -1
  19. package/dist/client/assets/{Upload01-DE3P0cg1.js → Upload01-BeVyQxbB.js} +1 -1
  20. package/dist/client/assets/{User01-Bs_IysOn.js → User01-BirINwKI.js} +1 -1
  21. package/dist/client/assets/{Users03-BRYBv6NS.js → Users03-Dpk7x7z4.js} +1 -1
  22. package/dist/client/assets/{X-CBjgNj3x.js → X-KSz9xyi5.js} +1 -1
  23. package/dist/client/assets/{XCircle-CQ9zwOam.js → XCircle-uU-3aWe3.js} +1 -1
  24. package/dist/client/assets/{Zap-BD4ZFQrP.js → Zap-DvQy6Azt.js} +1 -1
  25. package/dist/client/assets/{ZapSquare-DHFKeZJh.js → ZapSquare-Dk1UmO2a.js} +1 -1
  26. package/dist/client/assets/{accordion-GCOEctc7.js → accordion-w6xYXziw.js} +1 -1
  27. package/dist/client/assets/{agent-icon-DplMDRl4.js → agent-icon-CMOX8nfk.js} +1 -1
  28. package/dist/client/assets/{agents-list-CoSoD24U.js → agents-list-CeEeRXns.js} +1 -1
  29. package/dist/client/assets/ai-providers-_ruFOoFf.js +1 -0
  30. package/dist/client/assets/{alert-dialog-BK8KGRx2.js → alert-dialog-DtwmYIx7.js} +1 -1
  31. package/dist/client/assets/{auth-catchall-RbdT4yVD.js → auth-catchall-CMH1u4oJ.js} +1 -1
  32. package/dist/client/assets/{automation-list-row-C705Yh5a.js → automation-list-row-Sb9JaQY9.js} +1 -1
  33. package/dist/client/assets/{automations-BydFkRPy.js → automations-Dmw1cKQC.js} +1 -1
  34. package/dist/client/assets/{avatar-C1O6Osya.js → avatar-BSJnhSPL.js} +1 -1
  35. package/dist/client/assets/{badge-BwdrcyuF.js → badge-BbahYJz-.js} +1 -1
  36. package/dist/client/assets/{brand-context-CLck9szL.js → brand-context-9yJi8LtT.js} +1 -1
  37. package/dist/client/assets/{card-xoTyoUzT.js → card-BBjkVedQ.js} +1 -1
  38. package/dist/client/assets/{chat-context-BhPaXK8c.js → chat-context-BVA22TkC.js} +1 -1
  39. package/dist/client/assets/{checkbox-DBty8aLc.js → checkbox-BNYrEZke.js} +1 -1
  40. package/dist/client/assets/{collection-detail-BqXZI6Ah.js → collection-detail-WDWjdfFo.js} +1 -1
  41. package/dist/client/assets/{collection-display-button-DPonZkkK.js → collection-display-button-C_SpzkVL.js} +1 -1
  42. package/dist/client/assets/{collection-search-RHsPhPz2.js → collection-search-3gkmMFfK.js} +1 -1
  43. package/dist/client/assets/{collection-table-wrapper-CX0YdlzW.js → collection-table-wrapper-Nq245ZaG.js} +1 -1
  44. package/dist/client/assets/{collection-tabs-laFjVKNt.js → collection-tabs-DQAAB0E9.js} +1 -1
  45. package/dist/client/assets/{collections-CEapp19h.js → collections-CvC03WFa.js} +1 -1
  46. package/dist/client/assets/{command-CFefGdlU.js → command-COmac0HY.js} +1 -1
  47. package/dist/client/assets/{connection-card-2yAhTble.js → connection-card-C-lcUJmx.js} +1 -1
  48. package/dist/client/assets/{connection-detail-BEAMJjqO.js → connection-detail-DXUAuxOs.js} +1 -1
  49. package/dist/client/assets/{connection-form-helpers-BIEYG16e.js → connection-form-helpers-Beczk_I1.js} +1 -1
  50. package/dist/client/assets/{connections-CrrfLcZW.js → connections-jiDZ88zc.js} +1 -1
  51. package/dist/client/assets/{constants-C_TmFsOA.js → constants-BXYBvBo8.js} +1 -1
  52. package/dist/client/assets/{constants-PT5ZjaoS.js → constants-K9p6sFeA.js} +1 -1
  53. package/dist/client/assets/{dialog-I6EZrcC4.js → dialog-Cu_M3bSF.js} +1 -1
  54. package/dist/client/assets/{drawer-Cr1xQU7_.js → drawer-C0zWk4g_.js} +1 -1
  55. package/dist/client/assets/{dropdown-menu-Bt-RAfAA.js → dropdown-menu-DVLrmulo.js} +1 -1
  56. package/dist/client/assets/{dynamic-plugin-layout-CxPNRort.js → dynamic-plugin-layout-4eAl2fmh.js} +1 -1
  57. package/dist/client/assets/{empty-state-Bhhvv6ge.js → empty-state-BKZHnGIj.js} +1 -1
  58. package/dist/client/assets/{empty-state-Da0P4sNf.js → empty-state-CUC0Gkix.js} +1 -1
  59. package/dist/client/assets/{extract-connection-data-YSOD0s7F.js → extract-connection-data-CvyRIMCz.js} +1 -1
  60. package/dist/client/assets/{features-DC23zh9K.js → features-XCvz9PLL.js} +1 -1
  61. package/dist/client/assets/{form-D3y3maub.js → form-Ddm04alF.js} +1 -1
  62. package/dist/client/assets/{general-LiXqwrB9.js → general-DUSBEOfs.js} +1 -1
  63. package/dist/client/assets/{index-Btnitjvh.js → index-BH8gPP0f.js} +1 -1
  64. package/dist/client/assets/{index-DqjQmEPO.js → index-BHskyDSR.js} +1 -1
  65. package/dist/client/assets/{index-5_sz47Di.js → index-BPDAXzpD.js} +1 -1
  66. package/dist/client/assets/{index-D_GUV09H.js → index-BdfTJahg.js} +1 -1
  67. package/dist/client/assets/{index-BmhIlyjL.js → index-BhIzdEY1.js} +2 -2
  68. package/dist/client/assets/{index-Dme-mJko.js → index-BrtLQXUh.js} +1 -1
  69. package/dist/client/assets/{index-DPaYtFLz.js → index-CU16qbkD.js} +4 -4
  70. package/dist/client/assets/{index-CRos__3S.js → index-Cg0hncqj.js} +1 -1
  71. package/dist/client/assets/{index-CO3fR9Ko.js → index-FLw-zxvs.js} +1 -1
  72. package/dist/client/assets/{index-fNR5FZEy.js → index-uAQGGxtu.js} +1 -1
  73. package/dist/client/assets/{infiniteQueryObserver-Ck6-lBoi.js → infiniteQueryObserver-BO26Xlha.js} +1 -1
  74. package/dist/client/assets/{input-CEJVxq-W.js → input-Bz8fx1AG.js} +1 -1
  75. package/dist/client/assets/{integration-icon-CGDfaqlX.js → integration-icon-Byenx_4j.js} +1 -1
  76. package/dist/client/assets/{label-BEKYrLdl.js → label-DaHwCWWB.js} +1 -1
  77. package/dist/client/assets/{layout-CyxzjLg9.js → layout-C8AFQnZg.js} +1 -1
  78. package/dist/client/assets/{lean-canvas-recruit-modal-CmQRxcah.js → lean-canvas-recruit-modal-mykHJAKm.js} +1 -1
  79. package/dist/client/assets/{login-DiS0NvDa.js → login-DwiMJDl5.js} +1 -1
  80. package/dist/client/assets/{members-x2qbZXG0.js → members-Cd_WsIS9.js} +1 -1
  81. package/dist/client/assets/{monaco-editor-DyHKFOcp.js → monaco-editor-D27CWon0.js} +1 -1
  82. package/dist/client/assets/{monitoring-stats-row-Ch99ovXK.js → monitoring-stats-row-C-XRpFjl.js} +1 -1
  83. package/dist/client/assets/{oauth-callback-444nKRTA.js → oauth-callback-GuSY-vSr.js} +1 -1
  84. package/dist/client/assets/{oauth-callback-ai-provider-BRlp0DX0.js → oauth-callback-ai-provider-D3FgevI5.js} +1 -1
  85. package/dist/client/assets/{onboarding-B3bb6-wd.js → onboarding-PM_BE0uA.js} +1 -1
  86. package/dist/client/assets/{org-layout-DFpYJ_Lo.js → org-layout-C251Cbcv.js} +1 -1
  87. package/dist/client/assets/{org-plugin-layout-kFeLgDd0.js → org-plugin-layout-BwQLOazi.js} +1 -1
  88. package/dist/client/assets/{plugin-empty-state-Bko3r1k8.js → plugin-empty-state-DLXHjQeu.js} +1 -1
  89. package/dist/client/assets/{plugin-header-CXbjkO1n.js → plugin-header-BddmOg85.js} +1 -1
  90. package/dist/client/assets/{plugin-layout-CIVWtpIX.js → plugin-layout-RqfANRb_.js} +1 -1
  91. package/dist/client/assets/{popover-CCe-io9u.js → popover-BEF8mI0w.js} +1 -1
  92. package/dist/client/assets/{profile-D_pdnSKR.js → profile-DrdPa8Y7.js} +1 -1
  93. package/dist/client/assets/{project-app-view-MzkBCRXu.js → project-app-view-XrA_5t6Q.js} +1 -1
  94. package/dist/client/assets/registry-hvW8DAlR.js +2 -0
  95. package/dist/client/assets/{registry-layout-CmilG4JD.js → registry-layout-CwCyJT-v.js} +1 -1
  96. package/dist/client/assets/{required-auth-layout-CQr_32Dx.js → required-auth-layout-Cxviv7yN.js} +1 -1
  97. package/dist/client/assets/{reset-password-CHd8PV0A.js → reset-password-DYbWh4Wq.js} +1 -1
  98. package/dist/client/assets/{scroll-area-BNJqNM4f.js → scroll-area-_gjorSmM.js} +1 -1
  99. package/dist/client/assets/{search-input-PSurQh24.js → search-input-Dflevf_r.js} +1 -1
  100. package/dist/client/assets/{select-model-BdhWY7A6.js → select-model-BgS5BYlp.js} +1 -1
  101. package/dist/client/assets/{select-CF-fumth.js → select-ruUaRI3f.js} +1 -1
  102. package/dist/client/assets/{settings-layout-DJjHY9on.js → settings-layout-C9QCDWL8.js} +1 -1
  103. package/dist/client/assets/{shell-layout-CYRZAES3.js → shell-layout-Lnkya_bN.js} +1 -1
  104. package/dist/client/assets/{skeleton-CFa_G4KV.js → skeleton-CvZ1yhmk.js} +1 -1
  105. package/dist/client/assets/{sso-jUma78jG.js → sso-DVCm0NAv.js} +1 -1
  106. package/dist/client/assets/{store-BidlQxlt.js → store-BAtOk8g6.js} +1 -1
  107. package/dist/client/assets/store-registry-DyRkwg3g.js +2 -0
  108. package/dist/client/assets/{switch-Bq5n9MM5.js → switch-C4VRxkon.js} +1 -1
  109. package/dist/client/assets/{table-D8U2FVwS.js → table-C1xMho2l.js} +1 -1
  110. package/dist/client/assets/{tabs-DZ9yv9Br.js → tabs-MUC8gGmo.js} +1 -1
  111. package/dist/client/assets/{task-status-BzX77iHN.js → task-status-DBTk3ApD.js} +1 -1
  112. package/dist/client/assets/{textarea-bXmYFJXP.js → textarea-Dh5aI-9Q.js} +1 -1
  113. package/dist/client/assets/{toggle-group-t_YGlspr.js → toggle-group-qqPb8p7Z.js} +1 -1
  114. package/dist/client/assets/{tools-list-cUqdJ3b_.js → tools-list-5INqbH2J.js} +1 -1
  115. package/dist/client/assets/{types-DbJzRwxS.js → types-Bp-YI7R5.js} +1 -1
  116. package/dist/client/assets/{use-ai-providers-Ca34Evp_.js → use-ai-providers-BXn7VXga.js} +1 -1
  117. package/dist/client/assets/{use-collections-cZx-7LAh.js → use-collections-Dg7sh01O.js} +1 -1
  118. package/dist/client/assets/{use-connection-p8a1oY0W.js → use-connection-DhM_x-jA.js} +1 -1
  119. package/dist/client/assets/{use-copy-DkWpaj2z.js → use-copy-BuEIWb6s.js} +1 -1
  120. package/dist/client/assets/{use-create-virtual-mcp-B4h9UEp3.js → use-create-virtual-mcp-KKiF-MXD.js} +1 -1
  121. package/dist/client/assets/{use-decopilot-events-iE3IpGU0.js → use-decopilot-events-BSRQhWTI.js} +1 -1
  122. package/dist/client/assets/{use-delete-connection-DcPjQahA.js → use-delete-connection-EjeBh_jx.js} +1 -1
  123. package/dist/client/assets/{use-infinite-scroll-D3-JOxfi.js → use-infinite-scroll-BvRRlmDj.js} +1 -1
  124. package/dist/client/assets/{use-list-state-Cutqtn4Q.js → use-list-state-DJ8S20f9.js} +1 -1
  125. package/dist/client/assets/{use-mcp-tools-RW8NgX67.js → use-mcp-tools-C0kKBiKr.js} +1 -1
  126. package/dist/client/assets/{use-members-CW1rjgPD.js → use-members-D4VPX3yK.js} +1 -1
  127. package/dist/client/assets/{use-mobile-9jKemf9v.js → use-mobile-BXRLCdzR.js} +1 -1
  128. package/dist/client/assets/{use-navigate-to-agent-DN_dQjlH.js → use-navigate-to-agent-C1QNfHMd.js} +1 -1
  129. package/dist/client/assets/{use-org-sso-BoJNANa1.js → use-org-sso-C1E2S5f1.js} +1 -1
  130. package/dist/client/assets/{use-organization-settings-tmi1I_13.js → use-organization-settings-NQDr_YDe.js} +1 -1
  131. package/dist/client/assets/{use-registry-connections-RSYINl6E.js → use-registry-connections-2buwPIEr.js} +1 -1
  132. package/dist/client/assets/{use-status-sounds-B0YHvwY0.js → use-status-sounds-C5rJSnr7.js} +1 -1
  133. package/dist/client/assets/{use-tasks-COmwvqVp.js → use-tasks-DoJvFu21.js} +1 -1
  134. package/dist/client/assets/{use-view-mode-4mnvs45U.js → use-view-mode-eHr1pnSD.js} +1 -1
  135. package/dist/client/assets/{use-virtual-mcp-VkyufnqQ.js → use-virtual-mcp-DPQanfrd.js} +1 -1
  136. package/dist/client/assets/useInfiniteQuery-Cozeocmy.js +1 -0
  137. package/dist/client/assets/{user-DfQBAoTe.js → user-D-0Dg4hb.js} +1 -1
  138. package/dist/client/assets/{view-mode-toggle-DZRGDH4V.js → view-mode-toggle-C9JdTAIx.js} +1 -1
  139. package/dist/client/assets/{workflow-CTAxciPV.js → workflow-Bo7CKW-_.js} +1 -1
  140. package/dist/client/assets/workflow-detail-cv-DGPKy.js +1 -0
  141. package/dist/client/index.html +1 -1
  142. package/dist/server/cli.js +380 -380
  143. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  144. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  145. package/dist/server/node_modules/ansi-styles/license +9 -0
  146. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  147. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  148. package/dist/server/node_modules/pg/LICENSE +21 -0
  149. package/dist/server/node_modules/pg/README.md +95 -0
  150. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  151. package/dist/server/node_modules/pg/lib/client.js +743 -0
  152. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  153. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  154. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  155. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  156. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  157. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  158. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  159. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  160. package/dist/server/node_modules/pg/lib/index.js +73 -0
  161. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  162. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  163. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  164. package/dist/server/node_modules/pg/lib/query.js +252 -0
  165. package/dist/server/node_modules/pg/lib/result.js +109 -0
  166. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  167. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  168. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  169. package/dist/server/node_modules/pg/package.json +76 -0
  170. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  171. package/dist/server/node_modules/{postgres-date/license → xtend/LICENSE} +1 -2
  172. package/dist/server/node_modules/xtend/README.md +32 -0
  173. package/dist/server/node_modules/xtend/immutable.js +19 -0
  174. package/dist/server/node_modules/xtend/mutable.js +17 -0
  175. package/dist/server/node_modules/xtend/package.json +55 -0
  176. package/dist/server/node_modules/xtend/test.js +103 -0
  177. package/dist/server/server.js +302 -302
  178. package/package.json +1 -1
  179. package/dist/client/assets/ai-providers-CVli8tvY.js +0 -1
  180. package/dist/client/assets/registry-DQpmbY6_.js +0 -2
  181. package/dist/client/assets/store-registry-BhTsbsT8.js +0 -2
  182. package/dist/client/assets/useInfiniteQuery-VV_yJwGh.js +0 -1
  183. package/dist/client/assets/workflow-detail-DJaSQC-o.js +0 -1
  184. package/dist/server/node_modules/postgres-date/index.js +0 -116
  185. package/dist/server/node_modules/postgres-date/package.json +0 -33
  186. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  187. package/dist/server/node_modules/split2/LICENSE +0 -13
  188. package/dist/server/node_modules/split2/README.md +0 -85
  189. package/dist/server/node_modules/split2/bench.js +0 -27
  190. package/dist/server/node_modules/split2/index.js +0 -141
  191. package/dist/server/node_modules/split2/package.json +0 -39
  192. package/dist/server/node_modules/split2/test.js +0 -409
@@ -1,409 +0,0 @@
1
- 'use strict'
2
-
3
- const test = require('tape')
4
- const split = require('./')
5
- const callback = require('callback-stream')
6
- const strcb = callback.bind(null, { decodeStrings: false })
7
- const objcb = callback.bind(null, { objectMode: true })
8
-
9
- test('split two lines on end', function (t) {
10
- t.plan(2)
11
-
12
- const input = split()
13
-
14
- input.pipe(strcb(function (err, list) {
15
- t.error(err)
16
- t.deepEqual(list, ['hello', 'world'])
17
- }))
18
-
19
- input.end('hello\nworld')
20
- })
21
-
22
- test('split two lines on two writes', function (t) {
23
- t.plan(2)
24
-
25
- const input = split()
26
-
27
- input.pipe(strcb(function (err, list) {
28
- t.error(err)
29
- t.deepEqual(list, ['hello', 'world'])
30
- }))
31
-
32
- input.write('hello')
33
- input.write('\nworld')
34
- input.end()
35
- })
36
-
37
- test('split four lines on three writes', function (t) {
38
- t.plan(2)
39
-
40
- const input = split()
41
-
42
- input.pipe(strcb(function (err, list) {
43
- t.error(err)
44
- t.deepEqual(list, ['hello', 'world', 'bye', 'world'])
45
- }))
46
-
47
- input.write('hello\nwor')
48
- input.write('ld\nbye\nwo')
49
- input.write('rld')
50
- input.end()
51
- })
52
-
53
- test('accumulate multiple writes', function (t) {
54
- t.plan(2)
55
-
56
- const input = split()
57
-
58
- input.pipe(strcb(function (err, list) {
59
- t.error(err)
60
- t.deepEqual(list, ['helloworld'])
61
- }))
62
-
63
- input.write('hello')
64
- input.write('world')
65
- input.end()
66
- })
67
-
68
- test('split using a custom string matcher', function (t) {
69
- t.plan(2)
70
-
71
- const input = split('~')
72
-
73
- input.pipe(strcb(function (err, list) {
74
- t.error(err)
75
- t.deepEqual(list, ['hello', 'world'])
76
- }))
77
-
78
- input.end('hello~world')
79
- })
80
-
81
- test('split using a custom regexp matcher', function (t) {
82
- t.plan(2)
83
-
84
- const input = split(/~/)
85
-
86
- input.pipe(strcb(function (err, list) {
87
- t.error(err)
88
- t.deepEqual(list, ['hello', 'world'])
89
- }))
90
-
91
- input.end('hello~world')
92
- })
93
-
94
- test('support an option argument', function (t) {
95
- t.plan(2)
96
-
97
- const input = split({ highWaterMark: 2 })
98
-
99
- input.pipe(strcb(function (err, list) {
100
- t.error(err)
101
- t.deepEqual(list, ['hello', 'world'])
102
- }))
103
-
104
- input.end('hello\nworld')
105
- })
106
-
107
- test('support a mapper function', function (t) {
108
- t.plan(2)
109
-
110
- const a = { a: '42' }
111
- const b = { b: '24' }
112
-
113
- const input = split(JSON.parse)
114
-
115
- input.pipe(objcb(function (err, list) {
116
- t.error(err)
117
- t.deepEqual(list, [a, b])
118
- }))
119
-
120
- input.write(JSON.stringify(a))
121
- input.write('\n')
122
- input.end(JSON.stringify(b))
123
- })
124
-
125
- test('split lines windows-style', function (t) {
126
- t.plan(2)
127
-
128
- const input = split()
129
-
130
- input.pipe(strcb(function (err, list) {
131
- t.error(err)
132
- t.deepEqual(list, ['hello', 'world'])
133
- }))
134
-
135
- input.end('hello\r\nworld')
136
- })
137
-
138
- test('splits a buffer', function (t) {
139
- t.plan(2)
140
-
141
- const input = split()
142
-
143
- input.pipe(strcb(function (err, list) {
144
- t.error(err)
145
- t.deepEqual(list, ['hello', 'world'])
146
- }))
147
-
148
- input.end(Buffer.from('hello\nworld'))
149
- })
150
-
151
- test('do not end on undefined', function (t) {
152
- t.plan(2)
153
-
154
- const input = split(function (line) { })
155
-
156
- input.pipe(strcb(function (err, list) {
157
- t.error(err)
158
- t.deepEqual(list, [])
159
- }))
160
-
161
- input.end(Buffer.from('hello\nworld'))
162
- })
163
-
164
- test('has destroy method', function (t) {
165
- t.plan(1)
166
-
167
- const input = split(function (line) { })
168
-
169
- input.on('close', function () {
170
- t.ok(true, 'close emitted')
171
- t.end()
172
- })
173
-
174
- input.destroy()
175
- })
176
-
177
- test('support custom matcher and mapper', function (t) {
178
- t.plan(4)
179
-
180
- const a = { a: '42' }
181
- const b = { b: '24' }
182
- const input = split('~', JSON.parse)
183
-
184
- t.equal(input.matcher, '~')
185
- t.equal(typeof input.mapper, 'function')
186
-
187
- input.pipe(objcb(function (err, list) {
188
- t.notOk(err, 'no errors')
189
- t.deepEqual(list, [a, b])
190
- }))
191
-
192
- input.write(JSON.stringify(a))
193
- input.write('~')
194
- input.end(JSON.stringify(b))
195
- })
196
-
197
- test('support custom matcher and options', function (t) {
198
- t.plan(6)
199
-
200
- const input = split('~', { highWaterMark: 1024 })
201
-
202
- t.equal(input.matcher, '~')
203
- t.equal(typeof input.mapper, 'function')
204
- t.equal(input._readableState.highWaterMark, 1024)
205
- t.equal(input._writableState.highWaterMark, 1024)
206
-
207
- input.pipe(strcb(function (err, list) {
208
- t.error(err)
209
- t.deepEqual(list, ['hello', 'world'])
210
- }))
211
-
212
- input.end('hello~world')
213
- })
214
-
215
- test('support mapper and options', function (t) {
216
- t.plan(6)
217
-
218
- const a = { a: '42' }
219
- const b = { b: '24' }
220
- const input = split(JSON.parse, { highWaterMark: 1024 })
221
-
222
- t.ok(input.matcher instanceof RegExp, 'matcher is RegExp')
223
- t.equal(typeof input.mapper, 'function')
224
- t.equal(input._readableState.highWaterMark, 1024)
225
- t.equal(input._writableState.highWaterMark, 1024)
226
-
227
- input.pipe(objcb(function (err, list) {
228
- t.error(err)
229
- t.deepEqual(list, [a, b])
230
- }))
231
-
232
- input.write(JSON.stringify(a))
233
- input.write('\n')
234
- input.end(JSON.stringify(b))
235
- })
236
-
237
- test('split utf8 chars', function (t) {
238
- t.plan(2)
239
-
240
- const input = split()
241
-
242
- input.pipe(strcb(function (err, list) {
243
- t.error(err)
244
- t.deepEqual(list, ['烫烫烫', '锟斤拷'])
245
- }))
246
-
247
- const buf = Buffer.from('烫烫烫\r\n锟斤拷', 'utf8')
248
- for (let i = 0; i < buf.length; ++i) {
249
- input.write(buf.slice(i, i + 1))
250
- }
251
- input.end()
252
- })
253
-
254
- test('split utf8 chars 2by2', function (t) {
255
- t.plan(2)
256
-
257
- const input = split()
258
-
259
- input.pipe(strcb(function (err, list) {
260
- t.error(err)
261
- t.deepEqual(list, ['烫烫烫', '烫烫烫'])
262
- }))
263
-
264
- const str = '烫烫烫\r\n烫烫烫'
265
- const buf = Buffer.from(str, 'utf8')
266
- for (let i = 0; i < buf.length; i += 2) {
267
- input.write(buf.slice(i, i + 2))
268
- }
269
- input.end()
270
- })
271
-
272
- test('split lines when the \n comes at the end of a chunk', function (t) {
273
- t.plan(2)
274
-
275
- const input = split()
276
-
277
- input.pipe(strcb(function (err, list) {
278
- t.error(err)
279
- t.deepEqual(list, ['hello', 'world'])
280
- }))
281
-
282
- input.write('hello\n')
283
- input.end('world')
284
- })
285
-
286
- test('truncated utf-8 char', function (t) {
287
- t.plan(2)
288
-
289
- const input = split()
290
-
291
- input.pipe(strcb(function (err, list) {
292
- t.error(err)
293
- t.deepEqual(list, ['烫' + Buffer.from('e7', 'hex').toString()])
294
- }))
295
-
296
- const str = '烫烫'
297
- const buf = Buffer.from(str, 'utf8')
298
-
299
- input.write(buf.slice(0, 3))
300
- input.end(buf.slice(3, 4))
301
- })
302
-
303
- test('maximum buffer limit', function (t) {
304
- t.plan(1)
305
-
306
- const input = split({ maxLength: 2 })
307
- input.on('error', function (err) {
308
- t.ok(err)
309
- })
310
-
311
- input.resume()
312
-
313
- input.write('hey')
314
- })
315
-
316
- test('readable highWaterMark', function (t) {
317
- const input = split()
318
- t.equal(input._readableState.highWaterMark, 16)
319
- t.end()
320
- })
321
-
322
- test('maxLength < chunk size', function (t) {
323
- t.plan(2)
324
-
325
- const input = split({ maxLength: 2 })
326
-
327
- input.pipe(strcb(function (err, list) {
328
- t.error(err)
329
- t.deepEqual(list, ['a', 'b'])
330
- }))
331
-
332
- input.end('a\nb')
333
- })
334
-
335
- test('maximum buffer limit w/skip', function (t) {
336
- t.plan(2)
337
-
338
- const input = split({ maxLength: 2, skipOverflow: true })
339
-
340
- input.pipe(strcb(function (err, list) {
341
- t.error(err)
342
- t.deepEqual(list, ['a', 'b', 'c'])
343
- }))
344
-
345
- input.write('a\n123')
346
- input.write('456')
347
- input.write('789\nb\nc')
348
- input.end()
349
- })
350
-
351
- test("don't modify the options object", function (t) {
352
- t.plan(2)
353
-
354
- const options = {}
355
- const input = split(options)
356
-
357
- input.pipe(strcb(function (err, list) {
358
- t.error(err)
359
- t.same(options, {})
360
- }))
361
-
362
- input.end()
363
- })
364
-
365
- test('mapper throws flush', function (t) {
366
- t.plan(1)
367
- const error = new Error()
368
- const input = split(function () {
369
- throw error
370
- })
371
-
372
- input.on('error', (err, list) => {
373
- t.same(err, error)
374
- })
375
- input.end('hello')
376
- })
377
-
378
- test('mapper throws on transform', function (t) {
379
- t.plan(1)
380
-
381
- const error = new Error()
382
- const input = split(function (l) {
383
- throw error
384
- })
385
-
386
- input.on('error', (err) => {
387
- t.same(err, error)
388
- })
389
- input.write('a')
390
- input.write('\n')
391
- input.end('b')
392
- })
393
-
394
- test('supports Symbol.split', function (t) {
395
- t.plan(2)
396
-
397
- const input = split({
398
- [Symbol.split] (str) {
399
- return str.split('~')
400
- }
401
- })
402
-
403
- input.pipe(strcb(function (err, list) {
404
- t.error(err)
405
- t.deepEqual(list, ['hello', 'world'])
406
- }))
407
-
408
- input.end('hello~world')
409
- })