decocms 2.310.11 → 2.311.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-ahU9qvhl.js → AlertCircle-Cmv1CEej.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-Cfz7wXIJ.js → ArrowNarrowLeft-dh6WZRM9.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-fsqeZb8m.js → ArrowUpRight-ElKc4QT2.js} +1 -1
- package/dist/client/assets/{Check-BZWGhvVO.js → Check-C6557EUz.js} +1 -1
- package/dist/client/assets/{CheckCircle-DnZTB0rF.js → CheckCircle-CpTfilqS.js} +1 -1
- package/dist/client/assets/{ChevronDown-DByhDrk6.js → ChevronDown-DRryf8gN.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cvp-gXt7.js → ChevronRight-CdHf_zmd.js} +1 -1
- package/dist/client/assets/{ChevronUp-BFw72Msp.js → ChevronUp-B1cXKM4U.js} +1 -1
- package/dist/client/assets/{Container-BZ3zep7q.js → Container-DLynv0of.js} +1 -1
- package/dist/client/assets/{DotsVertical-Cd3-k7yF.js → DotsVertical-1_1TY_Iu.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BFjY57TU.js → LinkExternal01-kirIYSrs.js} +1 -1
- package/dist/client/assets/{Lock01-BbWgvWSs.js → Lock01-CjYZrQ5V.js} +1 -1
- package/dist/client/assets/{Palette-Cx-dqqQY.js → Palette-B_rCG80i.js} +1 -1
- package/dist/client/assets/{Play-BdhateWr.js → Play-CiAq5_x9.js} +1 -1
- package/dist/client/assets/{Plus-GSlHqxSR.js → Plus-CE4JnFcs.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CzqyqIwT.js → RefreshCcw01-7x7ZvE_9.js} +1 -1
- package/dist/client/assets/{SearchMd-DkP82Niw.js → SearchMd-GAS9PfFR.js} +1 -1
- package/dist/client/assets/{Settings02-9htEwxvh.js → Settings02-CQoon3Ff.js} +1 -1
- package/dist/client/assets/{Shield01-CjLFO2rl.js → Shield01-ji9zRv2d.js} +1 -1
- package/dist/client/assets/{Star01-DrZwq7mh.js → Star01-D8sWAc14.js} +1 -1
- package/dist/client/assets/{Sun-DF7l5QZq.js → Sun-vDwF3NGN.js} +1 -1
- package/dist/client/assets/{Tool01-nt_mUbwd.js → Tool01-oZSiObPU.js} +1 -1
- package/dist/client/assets/{Trash01-CDbu5eEt.js → Trash01-C5soIGl6.js} +1 -1
- package/dist/client/assets/{User01-CFEsXTLu.js → User01-LM25a1kB.js} +1 -1
- package/dist/client/assets/{Users03-Cx_Igx1u.js → Users03-DoI9lWmi.js} +1 -1
- package/dist/client/assets/{X-7na_kv9z.js → X-ZXZlQkhq.js} +1 -1
- package/dist/client/assets/{XCircle-Ds505nkY.js → XCircle-Dn1KJRiq.js} +1 -1
- package/dist/client/assets/{XClose-D8TG8w0F.js → XClose-q-SrK0tW.js} +1 -1
- package/dist/client/assets/{Zap-Dtq7fvFY.js → Zap-DJAH18FG.js} +1 -1
- package/dist/client/assets/{ZapSquare-4TndwMW9.js → ZapSquare-LAHLjkWd.js} +1 -1
- package/dist/client/assets/{accordion-DUY0OKAA.js → accordion-aPJ_VyDV.js} +1 -1
- package/dist/client/assets/{agent-icon-BxnaMyxC.js → agent-icon-w1gVp0JB.js} +1 -1
- package/dist/client/assets/{agents-list-CXSQuSMm.js → agents-list-Cq8OGy2L.js} +1 -1
- package/dist/client/assets/ai-providers-C7CtJZ9y.js +1 -0
- package/dist/client/assets/{alert-dialog-B9mZ-dpl.js → alert-dialog-GfhPvYdH.js} +1 -1
- package/dist/client/assets/{auth-catchall-COc5UUU3.js → auth-catchall-oPH9y-3s.js} +1 -1
- package/dist/client/assets/{automation-list-row-nmyGKTz1.js → automation-list-row-HhQTN_eX.js} +1 -1
- package/dist/client/assets/{automations-7nKH5SIF.js → automations-Dhn73Tf5.js} +1 -1
- package/dist/client/assets/{avatar-Cx0C50aU.js → avatar-CtUGIRZI.js} +1 -1
- package/dist/client/assets/{badge-Bht6nYmr.js → badge-CK6LsU4H.js} +1 -1
- package/dist/client/assets/{brand-context-BSxRXPau.js → brand-context-CY9Y_wu3.js} +1 -1
- package/dist/client/assets/{card-BFUnUENJ.js → card-BQEPs756.js} +1 -1
- package/dist/client/assets/{chat-context-C2w2gY8b.js → chat-context-S2WC0LWJ.js} +1 -1
- package/dist/client/assets/{checkbox-Do4xGcLt.js → checkbox-Bkr-bAkM.js} +1 -1
- package/dist/client/assets/{collection-detail-BZgUt9tx.js → collection-detail-B3rDTFtA.js} +1 -1
- package/dist/client/assets/{collection-display-button--S1OiIe7.js → collection-display-button-DWOOXKjP.js} +1 -1
- package/dist/client/assets/{collection-search-CHOGrD3q.js → collection-search-CFttyH_F.js} +1 -1
- package/dist/client/assets/{collection-search-B6mXUx7s.js → collection-search-DZrfYYOZ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CVw6SZCB.js → collection-table-wrapper-BLpRJJYg.js} +1 -1
- package/dist/client/assets/{collection-tabs-CSuzGYeY.js → collection-tabs-BgN6I-bX.js} +1 -1
- package/dist/client/assets/{collections-YX5wuZFA.js → collections-D7PE31gz.js} +1 -1
- package/dist/client/assets/{command-3yJ4z5LL.js → command-NKpG8Bjq.js} +1 -1
- package/dist/client/assets/{connection-card-lhhty3tj.js → connection-card-Bw6Csrb_.js} +1 -1
- package/dist/client/assets/{connection-detail-I0_vr7L4.js → connection-detail-B7_jkNkH.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CmguSpY9.js → connection-form-helpers-D9n2I0di.js} +1 -1
- package/dist/client/assets/{connections-C8bpnV9z.js → connections-CvsuOS9r.js} +1 -1
- package/dist/client/assets/{constants-DgceTPfw.js → constants-BCiQXBAS.js} +1 -1
- package/dist/client/assets/{constants-JFOjzs_O.js → constants-D5p8hSrx.js} +1 -1
- package/dist/client/assets/{dialog-drGvUDKx.js → dialog-Bco_TCNl.js} +1 -1
- package/dist/client/assets/{domain-settings-CEZLkEnq.js → domain-settings-Xq3tOabS.js} +1 -1
- package/dist/client/assets/{drawer-gLsUGUYZ.js → drawer-xfLDdv10.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BM7SQJAI.js → dropdown-menu-C29eDgrp.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DrewZkn_.js → dynamic-plugin-layout-2bYpHHwW.js} +1 -1
- package/dist/client/assets/{empty-state-fpPwV1WH.js → empty-state-CUAofipZ.js} +1 -1
- package/dist/client/assets/{empty-state-BYyDKvGo.js → empty-state-aTrcTcvL.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BgQtZAwu.js → extract-connection-data-CKwBsaAT.js} +1 -1
- package/dist/client/assets/{features-Bw9uyW0-.js → features-D9_mCTsW.js} +1 -1
- package/dist/client/assets/{form-ItOujfjm.js → form-CrTfBttw.js} +1 -1
- package/dist/client/assets/{general-CioSeVj_.js → general-CjiadXwc.js} +1 -1
- package/dist/client/assets/{index-DeAQDTDD.js → index-BRFAy-qc.js} +1 -1
- package/dist/client/assets/{index-D6KnSbAq.js → index-BgrgmG6r.js} +1 -1
- package/dist/client/assets/{index-CtG_0A9G.js → index-CF9ILFhD.js} +1 -1
- package/dist/client/assets/index-COjvr9O9.js +1 -0
- package/dist/client/assets/{index-B1Gx5hlg.js → index-CUZMrIc_.js} +1 -1
- package/dist/client/assets/{index-Bsg-EH8E.js → index-D2p5e1Iq.js} +1 -1
- package/dist/client/assets/{index-DEPlnunL.js → index-D4wqiAnr.js} +1 -1
- package/dist/client/assets/{index-DKs1F09Z.js → index-DFz3ygWn.js} +1 -1
- package/dist/client/assets/{index-CIViRjFd.js → index-DmUFwr5_.js} +2 -2
- package/dist/client/assets/{index-DXfyZm_Q.js → index-DniGxDKu.js} +1 -1
- package/dist/client/assets/{index-BlhCj6Vr.js → index-FnOOsGuu.js} +21 -21
- package/dist/client/assets/{index-D2foEawJ.js → index-ZSZq4ha4.js} +1 -1
- package/dist/client/assets/index-eoXEuVdd.js +1 -0
- package/dist/client/assets/{index-y_vkrCQM.js → index-m-YMatXe.js} +1 -1
- package/dist/client/assets/{index-C_pVEuWc.js → index-rcqbXXPT.js} +1 -1
- package/dist/client/assets/{index-BP4cosu_.js → index-xQKlqKQd.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CHcGJIyZ.js → infiniteQueryObserver-DsxEpQPG.js} +1 -1
- package/dist/client/assets/{input-DHXN30Se.js → input-Dpv2eGiI.js} +1 -1
- package/dist/client/assets/{integration-icon-CE13u9KA.js → integration-icon-DvOOsTvb.js} +1 -1
- package/dist/client/assets/{label-D4hgzggA.js → label-BQbLPzWS.js} +1 -1
- package/dist/client/assets/{layout-DUA6qsX1.js → layout-BTmL7V8R.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-Dk_y3TGU.js → lean-canvas-recruit-modal-BRgwNI1p.js} +1 -1
- package/dist/client/assets/{login-BvCw_OE1.js → login-nTOwFUFy.js} +1 -1
- package/dist/client/assets/{members-CVGvL4Y1.js → members-CSdeOjd-.js} +1 -1
- package/dist/client/assets/{monaco-editor-BYILvqNd.js → monaco-editor-DBzYYfTm.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CqXqzRk5.js → monitoring-stats-row-CnGugtMA.js} +1 -1
- package/dist/client/assets/{oauth-callback-D7Of-CbX.js → oauth-callback-Bh_DU5DY.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C1cnLxXi.js → oauth-callback-ai-provider-CD-ytcnR.js} +1 -1
- package/dist/client/assets/{onboarding-BGXXGyUe.js → onboarding-C5vaeZLY.js} +1 -1
- package/dist/client/assets/{org-layout-v1H0zG6y.js → org-layout-BvVTYQyf.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-Cp5rXvaP.js → org-plugin-layout-BTLenkdX.js} +1 -1
- package/dist/client/assets/{pair-B0T5l8E9.js → pair-BS3IG5t6.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-6Jmi0bPK.js → plugin-empty-state-Dad3DPDy.js} +1 -1
- package/dist/client/assets/{plugin-header-BT9Qe8pi.js → plugin-header-x0YNFhRo.js} +1 -1
- package/dist/client/assets/{plugin-layout-Bz8SL1ug.js → plugin-layout-Dj4_yi3O.js} +1 -1
- package/dist/client/assets/{popover-DN_EAxIz.js → popover-B8WVhvgZ.js} +1 -1
- package/dist/client/assets/{profile-D2kx_fYb.js → profile-b10WTUyM.js} +1 -1
- package/dist/client/assets/{project-app-view-DgYg19Pj.js → project-app-view-sIl32f2_.js} +1 -1
- package/dist/client/assets/registry-DJzEIPJ3.js +2 -0
- package/dist/client/assets/{registry-layout-Dm72Atxf.js → registry-layout-Py6FDR2L.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DU2PB2GW.js → required-auth-layout-Do2_0u5Q.js} +1 -1
- package/dist/client/assets/{reset-password-C2p0apyL.js → reset-password-CcFSycm8.js} +1 -1
- package/dist/client/assets/{roles-DQA7XHuT.js → roles-CZsVvePa.js} +1 -1
- package/dist/client/assets/{scroll-area-B7fmUAnT.js → scroll-area-CapTLssz.js} +1 -1
- package/dist/client/assets/{search-input-AF9T19og.js → search-input-B3-QUMJy.js} +1 -1
- package/dist/client/assets/{select-CZHjKwfO.js → select-BiWn49-h.js} +1 -1
- package/dist/client/assets/{select-model-BlAsfEc9.js → select-model-DJFwdiGN.js} +1 -1
- package/dist/client/assets/settings-layout-C1ry7l9n.js +1 -0
- package/dist/client/assets/{settings-section-BXkQzBkr.js → settings-section-BTX4cXxi.js} +1 -1
- package/dist/client/assets/{shell-layout-JI646xyd.js → shell-layout-DlzZ4J6J.js} +1 -1
- package/dist/client/assets/{skeleton-C_6B9i1g.js → skeleton-a_E_S2wJ.js} +1 -1
- package/dist/client/assets/{sso-Di5G8rB8.js → sso-AfMEk6Dy.js} +1 -1
- package/dist/client/assets/store-registry-BPOYIq53.js +2 -0
- package/dist/client/assets/{store-CKIiY2Vu.js → store-s1uRnPlo.js} +1 -1
- package/dist/client/assets/{switch-CUSfwbkU.js → switch-D3y2gsCU.js} +1 -1
- package/dist/client/assets/{table-DZ_h-O6Z.js → table-a45IGOSD.js} +1 -1
- package/dist/client/assets/{tabs-uISMLeAy.js → tabs-BsmpywaL.js} +1 -1
- package/dist/client/assets/{task-status-CJyTA8Rw.js → task-status-CFCyD2cy.js} +1 -1
- package/dist/client/assets/{textarea-CIie7gX7.js → textarea-B0QB1zGt.js} +1 -1
- package/dist/client/assets/{toggle-group-BHW5m7l7.js → toggle-group-CPj_hGHZ.js} +1 -1
- package/dist/client/assets/{tools-list-Co0vKxcI.js → tools-list-DoTFUqEd.js} +1 -1
- package/dist/client/assets/{tooltip-BqHns4a-.js → tooltip-D0CdZrZw.js} +1 -1
- package/dist/client/assets/{types-D-EHCq_Z.js → types-aIDaxl-h.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BsQlVMAK.js → use-ai-providers-D6qL7o2m.js} +1 -1
- package/dist/client/assets/{use-collections-CnoXaIh_.js → use-collections-DkViK-ks.js} +1 -1
- package/dist/client/assets/{use-connection-BNCCSdZe.js → use-connection-DsgQsacQ.js} +1 -1
- package/dist/client/assets/{use-copy-Sel_ed9z.js → use-copy-C3VsdLUz.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BQoRa9OB.js → use-create-virtual-mcp-DFh-QFWC.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BMTKanQV.js → use-debounced-autosave-CjjUnotJ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DdA0Y3DD.js → use-decopilot-events-VFA0NpGh.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BWRBYoeT.js → use-delete-connection-DEMGFn-u.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DnI8M6Qu.js → use-infinite-scroll-B2tsJ9ux.js} +1 -1
- package/dist/client/assets/{use-list-state-DsQyot8y.js → use-list-state-BpfDykv5.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CnV9GUfc.js → use-mcp-tools-DNblcX_j.js} +1 -1
- package/dist/client/assets/{use-members-DLA-hyIR.js → use-members-DxYWJoha.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-4oqXDdSQ.js → use-navigate-to-agent-DCNL3mVa.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DDplWK7C.js → use-org-auth-client-C7TX5eR-.js} +1 -1
- package/dist/client/assets/{use-org-sso-CQqTWoyG.js → use-org-sso-Dyy57SLz.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DapIx2FQ.js → use-organization-roles-BlI3X92b.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BjvugK__.js → use-organization-settings-i2PHXa36.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C_7HIX-0.js → use-registry-connections-D1RD1ejX.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CF5-vUhW.js → use-status-sounds-CVXVTk3B.js} +1 -1
- package/dist/client/assets/{use-tasks-C84qgBY4.js → use-tasks-D09f9MF3.js} +1 -1
- package/dist/client/assets/{use-view-mode-fPkbWIir.js → use-view-mode-tC1P9KD5.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DOhzVNjI.js → use-virtual-mcp-DmRVQfcC.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-g_wIax9o.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DvCTqtUR.js +1 -0
- package/dist/client/assets/{user-BPKG95sg.js → user-B65qTFCS.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CQCc5-lH.js → view-mode-toggle-0sx2tKzV.js} +1 -1
- package/dist/client/assets/{workflow-DiliYcMw.js → workflow-CjnkA-nG.js} +1 -1
- package/dist/client/assets/workflow-detail-CvZcqR8g.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +8 -2
- package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/{ansi-regex → ansi-styles}/package.json +13 -20
- package/dist/server/node_modules/ansi-styles/readme.md +173 -0
- package/dist/server/node_modules/{postgres-interval/license → pg/LICENSE} +6 -6
- package/dist/server/node_modules/pg/README.md +95 -0
- package/dist/server/node_modules/pg/esm/index.mjs +20 -0
- package/dist/server/node_modules/pg/lib/client.js +743 -0
- package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
- package/dist/server/node_modules/pg/lib/connection.js +221 -0
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
- package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/dist/server/node_modules/pg/lib/defaults.js +91 -0
- package/dist/server/node_modules/pg/lib/index.js +73 -0
- package/dist/server/node_modules/pg/lib/native/client.js +323 -0
- package/dist/server/node_modules/pg/lib/native/index.js +2 -0
- package/dist/server/node_modules/pg/lib/native/query.js +165 -0
- package/dist/server/node_modules/pg/lib/query.js +252 -0
- package/dist/server/node_modules/pg/lib/result.js +109 -0
- package/dist/server/node_modules/pg/lib/stream.js +83 -0
- package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/dist/server/node_modules/pg/lib/utils.js +217 -0
- package/dist/server/node_modules/pg/package.json +76 -0
- package/dist/server/server.js +7 -1
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-BIC302BH.js +0 -1
- package/dist/client/assets/index-B9nyMJrW.js +0 -1
- package/dist/client/assets/index-DIuUyRol.js +0 -1
- package/dist/client/assets/registry-CmDKb_pT.js +0 -2
- package/dist/client/assets/settings-layout-DFUOXvP0.js +0 -1
- package/dist/client/assets/store-registry-Deux9YT9.js +0 -2
- package/dist/client/assets/useInfiniteQuery-COOjSqOK.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DcjdAjkk.js +0 -1
- package/dist/client/assets/workflow-detail-DD2pgq9B.js +0 -1
- package/dist/server/node_modules/ansi-regex/index.d.ts +0 -33
- package/dist/server/node_modules/ansi-regex/index.js +0 -14
- package/dist/server/node_modules/ansi-regex/readme.md +0 -66
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/dist/server/node_modules/emoji-regex/README.md +0 -107
- package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
- package/dist/server/node_modules/emoji-regex/index.js +0 -4
- package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
- package/dist/server/node_modules/emoji-regex/package.json +0 -45
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/dist/server/node_modules/get-east-asian-width/index.js +0 -30
- package/dist/server/node_modules/get-east-asian-width/license +0 -9
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +0 -18
- package/dist/server/node_modules/get-east-asian-width/lookup.js +0 -135
- package/dist/server/node_modules/get-east-asian-width/package.json +0 -71
- package/dist/server/node_modules/get-east-asian-width/readme.md +0 -65
- package/dist/server/node_modules/get-east-asian-width/utilities.js +0 -24
- package/dist/server/node_modules/onetime/index.d.ts +0 -64
- package/dist/server/node_modules/onetime/index.js +0 -44
- package/dist/server/node_modules/onetime/license +0 -9
- package/dist/server/node_modules/onetime/package.json +0 -43
- package/dist/server/node_modules/onetime/readme.md +0 -94
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/license +0 -21
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- /package/dist/server/node_modules/{ansi-regex → ansi-styles}/license +0 -0
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
declare namespace onetime {
|
|
2
|
-
interface Options {
|
|
3
|
-
/**
|
|
4
|
-
Throw an error when called more than once.
|
|
5
|
-
|
|
6
|
-
@default false
|
|
7
|
-
*/
|
|
8
|
-
throw?: boolean;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare const onetime: {
|
|
13
|
-
/**
|
|
14
|
-
Ensure a function is only called once. When called multiple times it will return the return value from the first call.
|
|
15
|
-
|
|
16
|
-
@param fn - Function that should only be called once.
|
|
17
|
-
@returns A function that only calls `fn` once.
|
|
18
|
-
|
|
19
|
-
@example
|
|
20
|
-
```
|
|
21
|
-
import onetime = require('onetime');
|
|
22
|
-
|
|
23
|
-
let i = 0;
|
|
24
|
-
|
|
25
|
-
const foo = onetime(() => ++i);
|
|
26
|
-
|
|
27
|
-
foo(); //=> 1
|
|
28
|
-
foo(); //=> 1
|
|
29
|
-
foo(); //=> 1
|
|
30
|
-
|
|
31
|
-
onetime.callCount(foo); //=> 3
|
|
32
|
-
```
|
|
33
|
-
*/
|
|
34
|
-
<ArgumentsType extends unknown[], ReturnType>(
|
|
35
|
-
fn: (...arguments: ArgumentsType) => ReturnType,
|
|
36
|
-
options?: onetime.Options
|
|
37
|
-
): (...arguments: ArgumentsType) => ReturnType;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
Get the number of times `fn` has been called.
|
|
41
|
-
|
|
42
|
-
@param fn - Function to get call count from.
|
|
43
|
-
@returns A number representing how many times `fn` has been called.
|
|
44
|
-
|
|
45
|
-
@example
|
|
46
|
-
```
|
|
47
|
-
import onetime = require('onetime');
|
|
48
|
-
|
|
49
|
-
const foo = onetime(() => {});
|
|
50
|
-
foo();
|
|
51
|
-
foo();
|
|
52
|
-
foo();
|
|
53
|
-
|
|
54
|
-
console.log(onetime.callCount(foo));
|
|
55
|
-
//=> 3
|
|
56
|
-
```
|
|
57
|
-
*/
|
|
58
|
-
callCount(fn: (...arguments: any[]) => unknown): number;
|
|
59
|
-
|
|
60
|
-
// TODO: Remove this for the next major release
|
|
61
|
-
default: typeof onetime;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export = onetime;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const mimicFn = require('mimic-fn');
|
|
3
|
-
|
|
4
|
-
const calledFunctions = new WeakMap();
|
|
5
|
-
|
|
6
|
-
const onetime = (function_, options = {}) => {
|
|
7
|
-
if (typeof function_ !== 'function') {
|
|
8
|
-
throw new TypeError('Expected a function');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let returnValue;
|
|
12
|
-
let callCount = 0;
|
|
13
|
-
const functionName = function_.displayName || function_.name || '<anonymous>';
|
|
14
|
-
|
|
15
|
-
const onetime = function (...arguments_) {
|
|
16
|
-
calledFunctions.set(onetime, ++callCount);
|
|
17
|
-
|
|
18
|
-
if (callCount === 1) {
|
|
19
|
-
returnValue = function_.apply(this, arguments_);
|
|
20
|
-
function_ = null;
|
|
21
|
-
} else if (options.throw === true) {
|
|
22
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return returnValue;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
mimicFn(onetime, function_);
|
|
29
|
-
calledFunctions.set(onetime, callCount);
|
|
30
|
-
|
|
31
|
-
return onetime;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
module.exports = onetime;
|
|
35
|
-
// TODO: Remove this for the next major release
|
|
36
|
-
module.exports.default = onetime;
|
|
37
|
-
|
|
38
|
-
module.exports.callCount = function_ => {
|
|
39
|
-
if (!calledFunctions.has(function_)) {
|
|
40
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return calledFunctions.get(function_);
|
|
44
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "onetime",
|
|
3
|
-
"version": "5.1.2",
|
|
4
|
-
"description": "Ensure a function is only called once",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/onetime",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=6"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"test": "xo && ava && tsd"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"index.js",
|
|
21
|
-
"index.d.ts"
|
|
22
|
-
],
|
|
23
|
-
"keywords": [
|
|
24
|
-
"once",
|
|
25
|
-
"function",
|
|
26
|
-
"one",
|
|
27
|
-
"onetime",
|
|
28
|
-
"func",
|
|
29
|
-
"fn",
|
|
30
|
-
"single",
|
|
31
|
-
"call",
|
|
32
|
-
"called",
|
|
33
|
-
"prevent"
|
|
34
|
-
],
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"mimic-fn": "^2.1.0"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"ava": "^1.4.1",
|
|
40
|
-
"tsd": "^0.7.1",
|
|
41
|
-
"xo": "^0.24.0"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# onetime [](https://travis-ci.com/github/sindresorhus/onetime)
|
|
2
|
-
|
|
3
|
-
> Ensure a function is only called once
|
|
4
|
-
|
|
5
|
-
When called multiple times it will return the return value from the first call.
|
|
6
|
-
|
|
7
|
-
*Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty and extending `Function.prototype`.*
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
$ npm install onetime
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
const onetime = require('onetime');
|
|
19
|
-
|
|
20
|
-
let i = 0;
|
|
21
|
-
|
|
22
|
-
const foo = onetime(() => ++i);
|
|
23
|
-
|
|
24
|
-
foo(); //=> 1
|
|
25
|
-
foo(); //=> 1
|
|
26
|
-
foo(); //=> 1
|
|
27
|
-
|
|
28
|
-
onetime.callCount(foo); //=> 3
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
const onetime = require('onetime');
|
|
33
|
-
|
|
34
|
-
const foo = onetime(() => {}, {throw: true});
|
|
35
|
-
|
|
36
|
-
foo();
|
|
37
|
-
|
|
38
|
-
foo();
|
|
39
|
-
//=> Error: Function `foo` can only be called once
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## API
|
|
43
|
-
|
|
44
|
-
### onetime(fn, options?)
|
|
45
|
-
|
|
46
|
-
Returns a function that only calls `fn` once.
|
|
47
|
-
|
|
48
|
-
#### fn
|
|
49
|
-
|
|
50
|
-
Type: `Function`
|
|
51
|
-
|
|
52
|
-
Function that should only be called once.
|
|
53
|
-
|
|
54
|
-
#### options
|
|
55
|
-
|
|
56
|
-
Type: `object`
|
|
57
|
-
|
|
58
|
-
##### throw
|
|
59
|
-
|
|
60
|
-
Type: `boolean`\
|
|
61
|
-
Default: `false`
|
|
62
|
-
|
|
63
|
-
Throw an error when called more than once.
|
|
64
|
-
|
|
65
|
-
### onetime.callCount(fn)
|
|
66
|
-
|
|
67
|
-
Returns a number representing how many times `fn` has been called.
|
|
68
|
-
|
|
69
|
-
Note: It throws an error if you pass in a function that is not wrapped by `onetime`.
|
|
70
|
-
|
|
71
|
-
```js
|
|
72
|
-
const onetime = require('onetime');
|
|
73
|
-
|
|
74
|
-
const foo = onetime(() => {});
|
|
75
|
-
|
|
76
|
-
foo();
|
|
77
|
-
foo();
|
|
78
|
-
foo();
|
|
79
|
-
|
|
80
|
-
console.log(onetime.callCount(foo));
|
|
81
|
-
//=> 3
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
#### fn
|
|
85
|
-
|
|
86
|
-
Type: `Function`
|
|
87
|
-
|
|
88
|
-
Function to get call count from.
|
|
89
|
-
|
|
90
|
-
## onetime for enterprise
|
|
91
|
-
|
|
92
|
-
Available as part of the Tidelift Subscription.
|
|
93
|
-
|
|
94
|
-
The maintainers of onetime and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-onetime?utm_source=npm-onetime&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var DATE_TIME = /(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/
|
|
4
|
-
var DATE = /^(\d{1,})-(\d{2})-(\d{2})( BC)?$/
|
|
5
|
-
var TIME_ZONE = /([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/
|
|
6
|
-
var INFINITY = /^-?infinity$/
|
|
7
|
-
|
|
8
|
-
module.exports = function parseDate (isoDate) {
|
|
9
|
-
if (INFINITY.test(isoDate)) {
|
|
10
|
-
// Capitalize to Infinity before passing to Number
|
|
11
|
-
return Number(isoDate.replace('i', 'I'))
|
|
12
|
-
}
|
|
13
|
-
var matches = DATE_TIME.exec(isoDate)
|
|
14
|
-
|
|
15
|
-
if (!matches) {
|
|
16
|
-
// Force YYYY-MM-DD dates to be parsed as local time
|
|
17
|
-
return getDate(isoDate) || null
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var isBC = !!matches[8]
|
|
21
|
-
var year = parseInt(matches[1], 10)
|
|
22
|
-
if (isBC) {
|
|
23
|
-
year = bcYearToNegativeYear(year)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var month = parseInt(matches[2], 10) - 1
|
|
27
|
-
var day = matches[3]
|
|
28
|
-
var hour = parseInt(matches[4], 10)
|
|
29
|
-
var minute = parseInt(matches[5], 10)
|
|
30
|
-
var second = parseInt(matches[6], 10)
|
|
31
|
-
|
|
32
|
-
var ms = matches[7]
|
|
33
|
-
ms = ms ? 1000 * parseFloat(ms) : 0
|
|
34
|
-
|
|
35
|
-
var date
|
|
36
|
-
var offset = timeZoneOffset(isoDate)
|
|
37
|
-
if (offset != null) {
|
|
38
|
-
date = new Date(Date.UTC(year, month, day, hour, minute, second, ms))
|
|
39
|
-
|
|
40
|
-
// Account for years from 0 to 99 being interpreted as 1900-1999
|
|
41
|
-
// by Date.UTC / the multi-argument form of the Date constructor
|
|
42
|
-
if (is0To99(year)) {
|
|
43
|
-
date.setUTCFullYear(year)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (offset !== 0) {
|
|
47
|
-
date.setTime(date.getTime() - offset)
|
|
48
|
-
}
|
|
49
|
-
} else {
|
|
50
|
-
date = new Date(year, month, day, hour, minute, second, ms)
|
|
51
|
-
|
|
52
|
-
if (is0To99(year)) {
|
|
53
|
-
date.setFullYear(year)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return date
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function getDate (isoDate) {
|
|
61
|
-
var matches = DATE.exec(isoDate)
|
|
62
|
-
if (!matches) {
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var year = parseInt(matches[1], 10)
|
|
67
|
-
var isBC = !!matches[4]
|
|
68
|
-
if (isBC) {
|
|
69
|
-
year = bcYearToNegativeYear(year)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
var month = parseInt(matches[2], 10) - 1
|
|
73
|
-
var day = matches[3]
|
|
74
|
-
// YYYY-MM-DD will be parsed as local time
|
|
75
|
-
var date = new Date(year, month, day)
|
|
76
|
-
|
|
77
|
-
if (is0To99(year)) {
|
|
78
|
-
date.setFullYear(year)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return date
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// match timezones:
|
|
85
|
-
// Z (UTC)
|
|
86
|
-
// -05
|
|
87
|
-
// +06:30
|
|
88
|
-
function timeZoneOffset (isoDate) {
|
|
89
|
-
if (isoDate.endsWith('+00')) {
|
|
90
|
-
return 0
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
var zone = TIME_ZONE.exec(isoDate.split(' ')[1])
|
|
94
|
-
if (!zone) return
|
|
95
|
-
var type = zone[1]
|
|
96
|
-
|
|
97
|
-
if (type === 'Z') {
|
|
98
|
-
return 0
|
|
99
|
-
}
|
|
100
|
-
var sign = type === '-' ? -1 : 1
|
|
101
|
-
var offset = parseInt(zone[2], 10) * 3600 +
|
|
102
|
-
parseInt(zone[3] || 0, 10) * 60 +
|
|
103
|
-
parseInt(zone[4] || 0, 10)
|
|
104
|
-
|
|
105
|
-
return offset * sign * 1000
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function bcYearToNegativeYear (year) {
|
|
109
|
-
// Account for numerical difference between representations of BC years
|
|
110
|
-
// See: https://github.com/bendrucker/postgres-date/issues/5
|
|
111
|
-
return -(year - 1)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function is0To99 (num) {
|
|
115
|
-
return num >= 0 && num < 100
|
|
116
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) Ben Drucker <bvdrucker@gmail.com> (bendrucker.me)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "postgres-date",
|
|
3
|
-
"main": "index.js",
|
|
4
|
-
"version": "1.0.7",
|
|
5
|
-
"description": "Postgres date column parser",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": "bendrucker/postgres-date",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Ben Drucker",
|
|
10
|
-
"email": "bvdrucker@gmail.com",
|
|
11
|
-
"url": "bendrucker.me"
|
|
12
|
-
},
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=0.10.0"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"test": "standard && tape test.js"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"postgres",
|
|
21
|
-
"date",
|
|
22
|
-
"parser"
|
|
23
|
-
],
|
|
24
|
-
"dependencies": {},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"standard": "^14.0.0",
|
|
27
|
-
"tape": "^5.0.0"
|
|
28
|
-
},
|
|
29
|
-
"files": [
|
|
30
|
-
"index.js",
|
|
31
|
-
"readme.md"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# postgres-date [](https://travis-ci.org/bendrucker/postgres-date) [](https://greenkeeper.io/)
|
|
2
|
-
|
|
3
|
-
> Postgres date output parser
|
|
4
|
-
|
|
5
|
-
This package parses [date/time outputs](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT) from Postgres into Javascript `Date` objects. Its goal is to match Postgres behavior and preserve data accuracy.
|
|
6
|
-
|
|
7
|
-
If you find a case where a valid Postgres output results in incorrect parsing (including loss of precision), please [create a pull request](https://github.com/bendrucker/postgres-date/compare) and provide a failing test.
|
|
8
|
-
|
|
9
|
-
**Supported Postgres Versions:** `>= 9.6`
|
|
10
|
-
|
|
11
|
-
All prior versions of Postgres are likely compatible but not officially supported.
|
|
12
|
-
|
|
13
|
-
## Install
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
$ npm install --save postgres-date
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```js
|
|
23
|
-
var parse = require('postgres-date')
|
|
24
|
-
parse('2011-01-23 22:15:51Z')
|
|
25
|
-
// => 2011-01-23T22:15:51.000Z
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## API
|
|
29
|
-
|
|
30
|
-
#### `parse(isoDate)` -> `date`
|
|
31
|
-
|
|
32
|
-
##### isoDate
|
|
33
|
-
|
|
34
|
-
*Required*
|
|
35
|
-
Type: `string`
|
|
36
|
-
|
|
37
|
-
A date string from Postgres.
|
|
38
|
-
|
|
39
|
-
## Releases
|
|
40
|
-
|
|
41
|
-
The following semantic versioning increments will be used for changes:
|
|
42
|
-
|
|
43
|
-
* **Major**: Removal of support for Node.js versions or Postgres versions (not expected)
|
|
44
|
-
* **Minor**: Unused, since Postgres returns dates in standard ISO 8601 format
|
|
45
|
-
* **Patch**: Any fix for parsing behavior
|
|
46
|
-
|
|
47
|
-
## License
|
|
48
|
-
|
|
49
|
-
MIT © [Ben Drucker](http://bendrucker.me)
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare namespace PostgresInterval {
|
|
2
|
-
export interface IPostgresInterval {
|
|
3
|
-
years?: number;
|
|
4
|
-
months?: number;
|
|
5
|
-
days?: number;
|
|
6
|
-
hours?: number;
|
|
7
|
-
minutes?: number;
|
|
8
|
-
seconds?: number;
|
|
9
|
-
milliseconds?: number;
|
|
10
|
-
|
|
11
|
-
toPostgres(): string;
|
|
12
|
-
|
|
13
|
-
toISO(): string;
|
|
14
|
-
toISOString(): string;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
declare function PostgresInterval(raw: string): PostgresInterval.IPostgresInterval;
|
|
19
|
-
|
|
20
|
-
export = PostgresInterval;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var extend = require('xtend/mutable')
|
|
4
|
-
|
|
5
|
-
module.exports = PostgresInterval
|
|
6
|
-
|
|
7
|
-
function PostgresInterval (raw) {
|
|
8
|
-
if (!(this instanceof PostgresInterval)) {
|
|
9
|
-
return new PostgresInterval(raw)
|
|
10
|
-
}
|
|
11
|
-
extend(this, parse(raw))
|
|
12
|
-
}
|
|
13
|
-
var properties = ['seconds', 'minutes', 'hours', 'days', 'months', 'years']
|
|
14
|
-
PostgresInterval.prototype.toPostgres = function () {
|
|
15
|
-
var filtered = properties.filter(this.hasOwnProperty, this)
|
|
16
|
-
|
|
17
|
-
// In addition to `properties`, we need to account for fractions of seconds.
|
|
18
|
-
if (this.milliseconds && filtered.indexOf('seconds') < 0) {
|
|
19
|
-
filtered.push('seconds')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (filtered.length === 0) return '0'
|
|
23
|
-
return filtered
|
|
24
|
-
.map(function (property) {
|
|
25
|
-
var value = this[property] || 0
|
|
26
|
-
|
|
27
|
-
// Account for fractional part of seconds,
|
|
28
|
-
// remove trailing zeroes.
|
|
29
|
-
if (property === 'seconds' && this.milliseconds) {
|
|
30
|
-
value = (value + this.milliseconds / 1000).toFixed(6).replace(/\.?0+$/, '')
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return value + ' ' + property
|
|
34
|
-
}, this)
|
|
35
|
-
.join(' ')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var propertiesISOEquivalent = {
|
|
39
|
-
years: 'Y',
|
|
40
|
-
months: 'M',
|
|
41
|
-
days: 'D',
|
|
42
|
-
hours: 'H',
|
|
43
|
-
minutes: 'M',
|
|
44
|
-
seconds: 'S'
|
|
45
|
-
}
|
|
46
|
-
var dateProperties = ['years', 'months', 'days']
|
|
47
|
-
var timeProperties = ['hours', 'minutes', 'seconds']
|
|
48
|
-
// according to ISO 8601
|
|
49
|
-
PostgresInterval.prototype.toISOString = PostgresInterval.prototype.toISO = function () {
|
|
50
|
-
var datePart = dateProperties
|
|
51
|
-
.map(buildProperty, this)
|
|
52
|
-
.join('')
|
|
53
|
-
|
|
54
|
-
var timePart = timeProperties
|
|
55
|
-
.map(buildProperty, this)
|
|
56
|
-
.join('')
|
|
57
|
-
|
|
58
|
-
return 'P' + datePart + 'T' + timePart
|
|
59
|
-
|
|
60
|
-
function buildProperty (property) {
|
|
61
|
-
var value = this[property] || 0
|
|
62
|
-
|
|
63
|
-
// Account for fractional part of seconds,
|
|
64
|
-
// remove trailing zeroes.
|
|
65
|
-
if (property === 'seconds' && this.milliseconds) {
|
|
66
|
-
value = (value + this.milliseconds / 1000).toFixed(6).replace(/0+$/, '')
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return value + propertiesISOEquivalent[property]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
var NUMBER = '([+-]?\\d+)'
|
|
74
|
-
var YEAR = NUMBER + '\\s+years?'
|
|
75
|
-
var MONTH = NUMBER + '\\s+mons?'
|
|
76
|
-
var DAY = NUMBER + '\\s+days?'
|
|
77
|
-
var TIME = '([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?'
|
|
78
|
-
var INTERVAL = new RegExp([YEAR, MONTH, DAY, TIME].map(function (regexString) {
|
|
79
|
-
return '(' + regexString + ')?'
|
|
80
|
-
})
|
|
81
|
-
.join('\\s*'))
|
|
82
|
-
|
|
83
|
-
// Positions of values in regex match
|
|
84
|
-
var positions = {
|
|
85
|
-
years: 2,
|
|
86
|
-
months: 4,
|
|
87
|
-
days: 6,
|
|
88
|
-
hours: 9,
|
|
89
|
-
minutes: 10,
|
|
90
|
-
seconds: 11,
|
|
91
|
-
milliseconds: 12
|
|
92
|
-
}
|
|
93
|
-
// We can use negative time
|
|
94
|
-
var negatives = ['hours', 'minutes', 'seconds', 'milliseconds']
|
|
95
|
-
|
|
96
|
-
function parseMilliseconds (fraction) {
|
|
97
|
-
// add omitted zeroes
|
|
98
|
-
var microseconds = fraction + '000000'.slice(fraction.length)
|
|
99
|
-
return parseInt(microseconds, 10) / 1000
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function parse (interval) {
|
|
103
|
-
if (!interval) return {}
|
|
104
|
-
var matches = INTERVAL.exec(interval)
|
|
105
|
-
var isNegative = matches[8] === '-'
|
|
106
|
-
return Object.keys(positions)
|
|
107
|
-
.reduce(function (parsed, property) {
|
|
108
|
-
var position = positions[property]
|
|
109
|
-
var value = matches[position]
|
|
110
|
-
// no empty string
|
|
111
|
-
if (!value) return parsed
|
|
112
|
-
// milliseconds are actually microseconds (up to 6 digits)
|
|
113
|
-
// with omitted trailing zeroes.
|
|
114
|
-
value = property === 'milliseconds'
|
|
115
|
-
? parseMilliseconds(value)
|
|
116
|
-
: parseInt(value, 10)
|
|
117
|
-
// no zeros
|
|
118
|
-
if (!value) return parsed
|
|
119
|
-
if (isNegative && ~negatives.indexOf(property)) {
|
|
120
|
-
value *= -1
|
|
121
|
-
}
|
|
122
|
-
parsed[property] = value
|
|
123
|
-
return parsed
|
|
124
|
-
}, {})
|
|
125
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "postgres-interval",
|
|
3
|
-
"main": "index.js",
|
|
4
|
-
"version": "1.2.0",
|
|
5
|
-
"description": "Parse Postgres interval columns",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": "bendrucker/postgres-interval",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Ben Drucker",
|
|
10
|
-
"email": "bvdrucker@gmail.com",
|
|
11
|
-
"url": "bendrucker.me"
|
|
12
|
-
},
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=0.10.0"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"test": "standard && tape test.js"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"postgres",
|
|
21
|
-
"interval",
|
|
22
|
-
"parser"
|
|
23
|
-
],
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"xtend": "^4.0.0"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"tape": "^4.0.0",
|
|
29
|
-
"standard": "^12.0.1"
|
|
30
|
-
},
|
|
31
|
-
"files": [
|
|
32
|
-
"index.js",
|
|
33
|
-
"index.d.ts",
|
|
34
|
-
"readme.md"
|
|
35
|
-
]
|
|
36
|
-
}
|