decocms 2.289.1 → 2.290.1
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-DvPnQfC5.js → AlertCircle-BKpPv_ue.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-BKxpVLR_.js → ArrowNarrowLeft-DzI4-MMz.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CuQjuTVk.js → ArrowUpRight-CgoB9CSG.js} +1 -1
- package/dist/client/assets/{CheckCircle-4_rcsB70.js → CheckCircle-_hRmcUCr.js} +1 -1
- package/dist/client/assets/{ChevronDown-DfsMdmf4.js → ChevronDown-DgrWziJW.js} +1 -1
- package/dist/client/assets/{ChevronRight-CVhRkUc0.js → ChevronRight-DJnGkhn4.js} +1 -1
- package/dist/client/assets/{ChevronUp-CD4XJT02.js → ChevronUp-CYzPfn3Y.js} +1 -1
- package/dist/client/assets/{Container-BcAiX456.js → Container-CCq3u0Gk.js} +1 -1
- package/dist/client/assets/{DotsVertical-e4sJs2sy.js → DotsVertical-om3rzQE9.js} +1 -1
- package/dist/client/assets/{LinkExternal01-M3Y1_vaI.js → LinkExternal01-DbNOYo2d.js} +1 -1
- package/dist/client/assets/{Lock01-_ctwMSEo.js → Lock01-BsLK0x7P.js} +1 -1
- package/dist/client/assets/{Palette-BkMTuMlr.js → Palette-CN1aN7Xh.js} +1 -1
- package/dist/client/assets/{Play-CrMiqzaH.js → Play-CwsBegSF.js} +1 -1
- package/dist/client/assets/{Plus-BR3le3XA.js → Plus-CnK1SC2T.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BvVeeLFE.js → RefreshCcw01-DESLbhAD.js} +1 -1
- package/dist/client/assets/{SearchMd-CnSMs6Gr.js → SearchMd-DlfhE_5j.js} +1 -1
- package/dist/client/assets/{Settings02-bYDpmczV.js → Settings02-LVlkEIxI.js} +1 -1
- package/dist/client/assets/{Shield01-CMpoeZYl.js → Shield01-DGTwcXqp.js} +1 -1
- package/dist/client/assets/{Star01-B5vecVQL.js → Star01-CWHB1ChF.js} +1 -1
- package/dist/client/assets/{Sun-wZV-LjB0.js → Sun-1aZYqU86.js} +1 -1
- package/dist/client/assets/{Tool01-CuCSRQWJ.js → Tool01-X8GEQ_TP.js} +1 -1
- package/dist/client/assets/{Trash01-J7CgYdQ6.js → Trash01-CIUqVsqV.js} +1 -1
- package/dist/client/assets/{User01-BgWj-XfO.js → User01-Dds7lT_Z.js} +1 -1
- package/dist/client/assets/{Users03-DuJUh6K5.js → Users03-BD0tlSQu.js} +1 -1
- package/dist/client/assets/{X-B94SYTq6.js → X-BDxrsCdA.js} +1 -1
- package/dist/client/assets/{XCircle-CV0L9GR_.js → XCircle-BJ-0U-0t.js} +1 -1
- package/dist/client/assets/{XClose-BDJKoeIM.js → XClose-Bl-2e8QV.js} +1 -1
- package/dist/client/assets/{Zap-DbOUQQao.js → Zap-B3a3OZUG.js} +1 -1
- package/dist/client/assets/{ZapSquare-BVc4n4iU.js → ZapSquare-Ddm4Ccl_.js} +1 -1
- package/dist/client/assets/{accordion-_jHDGcgU.js → accordion-eGw-yxkH.js} +1 -1
- package/dist/client/assets/{agent-icon-C6qW6eXG.js → agent-icon-Dhv8pT4N.js} +1 -1
- package/dist/client/assets/{agents-list-DQZlBppY.js → agents-list-BoLhMS8b.js} +1 -1
- package/dist/client/assets/ai-providers-5Y8Lye7a.js +1 -0
- package/dist/client/assets/ai-providers-logos-D6a8kmGH.js +1 -0
- package/dist/client/assets/{alert-dialog-DUehP6wO.js → alert-dialog-C5H0at4x.js} +1 -1
- package/dist/client/assets/{auth-catchall-Cbr_hZzc.js → auth-catchall-CDaNQLse.js} +1 -1
- package/dist/client/assets/{automation-list-row-CE-l0VNu.js → automation-list-row-i8Q9Zh9Z.js} +1 -1
- package/dist/client/assets/{automations-C3LxjCxf.js → automations-ulYqPLWi.js} +1 -1
- package/dist/client/assets/{avatar-BIm7SPe1.js → avatar-BCAMjlDk.js} +1 -1
- package/dist/client/assets/{badge-CtBsPi0r.js → badge-arNIH4S4.js} +1 -1
- package/dist/client/assets/{brand-context-CB2HhrLr.js → brand-context-doHsqzeN.js} +1 -1
- package/dist/client/assets/{card-BLtPWaiK.js → card-BcKfGMCs.js} +1 -1
- package/dist/client/assets/{chat-context-DcUrkBB6.js → chat-context-BgLXGROj.js} +14 -14
- package/dist/client/assets/{checkbox-BEdGbH_8.js → checkbox-eCIm2Y45.js} +1 -1
- package/dist/client/assets/{collection-detail-CtkPh5nj.js → collection-detail-BIdQmVBg.js} +1 -1
- package/dist/client/assets/{collection-display-button-DbKOigBA.js → collection-display-button-31iCSNaH.js} +1 -1
- package/dist/client/assets/{collection-search-CEPfUiWA.js → collection-search-CWRKNmnq.js} +1 -1
- package/dist/client/assets/{collection-search-BEbLDyCP.js → collection-search-CZEXNAkX.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B2huksH6.js → collection-table-wrapper-iKnV9U-a.js} +1 -1
- package/dist/client/assets/{collection-tabs-QSa5ykeq.js → collection-tabs-BB_C6DLQ.js} +1 -1
- package/dist/client/assets/{collections-CF9hrNRd.js → collections-BmZbVrT4.js} +1 -1
- package/dist/client/assets/{command-DmhSl-c8.js → command-BXuf0gSd.js} +1 -1
- package/dist/client/assets/{connection-card-bmzpIukU.js → connection-card-CaHQAi2l.js} +1 -1
- package/dist/client/assets/{connection-detail-DwoYH_6W.js → connection-detail-DtFDjt8X.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BrmC7SFw.js → connection-form-helpers-D-VsE2HN.js} +1 -1
- package/dist/client/assets/{connections-B52vPeyp.js → connections-B0CDxzS1.js} +1 -1
- package/dist/client/assets/{constants-DjiHYs3d.js → constants-CBodG1Pl.js} +1 -1
- package/dist/client/assets/{constants-Bv-ydthU.js → constants-fZUl7A6B.js} +1 -1
- package/dist/client/assets/{dialog-CbDVIhlb.js → dialog-CfIcbBij.js} +1 -1
- package/dist/client/assets/{domain-settings-5pXF-wm_.js → domain-settings-Bz-lXZFn.js} +1 -1
- package/dist/client/assets/{drawer-BmeDjX1X.js → drawer-D0hdbn63.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BfGuGlIh.js → dropdown-menu-Cye9zjaV.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BodX3cKc.js → dynamic-plugin-layout-DyEJh8Ah.js} +1 -1
- package/dist/client/assets/{empty-state-Bmk-UZeD.js → empty-state-Ce0UFiAd.js} +1 -1
- package/dist/client/assets/{empty-state-dX7dSbXx.js → empty-state-KsHmVPO4.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DpnZLfW6.js → extract-connection-data-C_Q81cim.js} +1 -1
- package/dist/client/assets/{features-B6zSQU4N.js → features-UEpssbRc.js} +1 -1
- package/dist/client/assets/{form-Bp7QYVLp.js → form-Bt1yLlZE.js} +1 -1
- package/dist/client/assets/{general-CwdchWiq.js → general-CX6SxsSV.js} +1 -1
- package/dist/client/assets/{github-repo-picker-iNFjYstD.js → github-repo-picker-4y_CmSBW.js} +1 -1
- package/dist/client/assets/{index-Bren1GGu.js → index-B5IXTINZ.js} +1 -1
- package/dist/client/assets/{index-CC820IDY.js → index-BdMwcoDn.js} +1 -1
- package/dist/client/assets/{index-EeoXzNpy.js → index-BqvsnDAu.js} +1 -1
- package/dist/client/assets/{index-BHs8YvDv.js → index-C1JqC4-z.js} +1 -1
- package/dist/client/assets/{index-B0QzmEJF.js → index-Cf59DRJ6.js} +1 -1
- package/dist/client/assets/{index-n7SSrZJX.js → index-D7IIXROb.js} +2 -2
- package/dist/client/assets/{index-CtxpjU_s.js → index-DP75UHA3.js} +1 -1
- package/dist/client/assets/{index-B2N3AyqY.js → index-DTSAQq_o.js} +26 -26
- package/dist/client/assets/{index-B5cVztKY.js → index-DU8sxbAO.js} +1 -1
- package/dist/client/assets/{index-BsNTGYXY.js → index-DtTftwEv.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BvBE16xD.js → infiniteQueryObserver-CYDDJzdR.js} +1 -1
- package/dist/client/assets/{input-93auOJA-.js → input-C-zd9-6X.js} +1 -1
- package/dist/client/assets/{integration-icon-D1WPsIeS.js → integration-icon-DoWhqWe3.js} +1 -1
- package/dist/client/assets/{label-CDWfKnpv.js → label-B9VSuQAr.js} +1 -1
- package/dist/client/assets/{layout-ALExO3RM.js → layout-BJjatDlM.js} +1 -1
- package/dist/client/assets/{login-Dh8YEJcV.js → login-DMa1Q2q-.js} +1 -1
- package/dist/client/assets/{members-B0H2ICnj.js → members-BOugcvjA.js} +1 -1
- package/dist/client/assets/{monaco-editor-D2WY7je5.js → monaco-editor-Bo3tZIb0.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CuznDVqp.js → monitoring-stats-row-B1bACC1V.js} +1 -1
- package/dist/client/assets/{oauth-callback-BxmH83JY.js → oauth-callback-CIypIDM5.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Dji18vK6.js → oauth-callback-ai-provider-Cx6R_dTa.js} +1 -1
- package/dist/client/assets/{onboarding-DO-aZIsc.js → onboarding-BqheUOWx.js} +1 -1
- package/dist/client/assets/{org-layout-DwQfVG_G.js → org-layout-CZ-JkZR2.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-C0Hb_7ZN.js → org-plugin-layout-BrcX-6Wg.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DsKgDNt_.js → plugin-empty-state-DrfwC6PK.js} +1 -1
- package/dist/client/assets/{plugin-header-I-VJ7nR-.js → plugin-header-Dv9_QG9M.js} +1 -1
- package/dist/client/assets/{plugin-layout-rZ66K3Mj.js → plugin-layout-BYLLm93H.js} +1 -1
- package/dist/client/assets/{popover-BlhVdyjC.js → popover-BcJ5dkfy.js} +1 -1
- package/dist/client/assets/{profile-ChlGBaRJ.js → profile-BDIFKyuQ.js} +1 -1
- package/dist/client/assets/{project-app-view-CxGV0sjn.js → project-app-view-Dmfqsj8y.js} +1 -1
- package/dist/client/assets/registry-DWmg34NR.js +2 -0
- package/dist/client/assets/{registry-layout-fy1D5wVh.js → registry-layout-CcQfrJPf.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D3LKevpJ.js → required-auth-layout-C8vP14ZM.js} +1 -1
- package/dist/client/assets/{reset-password-Cl6OUHwF.js → reset-password-Cx8pIjDB.js} +1 -1
- package/dist/client/assets/{roles-BZIugQbX.js → roles-V2PuVErH.js} +1 -1
- package/dist/client/assets/{scroll-area-DjI8JrA4.js → scroll-area-BJTd57Y3.js} +1 -1
- package/dist/client/assets/{search-input-c4tKbop1.js → search-input-o1N12hd4.js} +1 -1
- package/dist/client/assets/select-model-i86p2wLu.js +4 -0
- package/dist/client/assets/{select-DXPKpbnT.js → select-wye91jBR.js} +1 -1
- package/dist/client/assets/{settings-layout-D5262yUh.js → settings-layout-Bre58uB_.js} +1 -1
- package/dist/client/assets/{settings-section-BlkGvCu3.js → settings-section-C9gADeUy.js} +1 -1
- package/dist/client/assets/{shell-layout-DhpXypjS.js → shell-layout-BkODIfEq.js} +1 -1
- package/dist/client/assets/{skeleton-BK_N4aC7.js → skeleton-DRv0yCtF.js} +1 -1
- package/dist/client/assets/{sso-BtozqQ30.js → sso-DZp-3maq.js} +1 -1
- package/dist/client/assets/{store-DyctnerN.js → store-CN0vQifq.js} +1 -1
- package/dist/client/assets/store-registry-BObCKoqP.js +2 -0
- package/dist/client/assets/{switch-CrF-gMSq.js → switch-PbUvXBwc.js} +1 -1
- package/dist/client/assets/{table-C8OGdLdI.js → table-Vdrlqd3N.js} +1 -1
- package/dist/client/assets/{tabs-C_BS-m5A.js → tabs-CMVGP6Nm.js} +1 -1
- package/dist/client/assets/{task-status-Cm6Qp7d4.js → task-status-Cc80uZAM.js} +1 -1
- package/dist/client/assets/{textarea-Bx9ByRsd.js → textarea-CFCCYt2a.js} +1 -1
- package/dist/client/assets/{toggle-group-3sydXp-E.js → toggle-group-C7CndFhA.js} +1 -1
- package/dist/client/assets/{tools-list-CBTIdi20.js → tools-list-Kw0AITzg.js} +1 -1
- package/dist/client/assets/{types-CZtgPZDT.js → types-CfADcGn6.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D498L3pM.js → use-ai-providers-BH0Y2Lij.js} +1 -1
- package/dist/client/assets/{use-collections-CtCWr_i-.js → use-collections-BosUNiJP.js} +1 -1
- package/dist/client/assets/{use-connection-BNJDlOt9.js → use-connection-BHgGmTOA.js} +1 -1
- package/dist/client/assets/{use-copy-CogZRw7t.js → use-copy-D6qOpdpT.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BZbpQ7wy.js → use-create-virtual-mcp-Cx6IqxLi.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CGP9dkEP.js → use-decopilot-events-Bw4kdPRS.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DnC4oqeg.js → use-delete-connection-BNbEYahP.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BDcVHuzE.js → use-infinite-scroll-omTMTmB1.js} +1 -1
- package/dist/client/assets/{use-list-state-DhCZMYGi.js → use-list-state-BiBwgFiI.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BtNM-5qj.js → use-mcp-tools-jeaH_mio.js} +1 -1
- package/dist/client/assets/{use-members-BhnMtyBX.js → use-members-BR83cmtt.js} +1 -1
- package/dist/client/assets/{use-mobile-BP1wV0Dh.js → use-mobile-CrP2KZis.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Bl8tivkk.js → use-navigate-to-agent-C3zfnZck.js} +1 -1
- package/dist/client/assets/{use-org-sso-BURT85r2.js → use-org-sso-Bp80Qjb5.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DFb5kpIb.js → use-organization-roles-BV6xrqqH.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DOx6Mt6y.js → use-organization-settings-qZ1AM5bR.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BnhgPbEO.js → use-registry-connections-4TVYi7-o.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DfEYCKF7.js → use-status-sounds-DOhvVAtI.js} +1 -1
- package/dist/client/assets/{use-tasks-CpxN0ye6.js → use-tasks-Cd7MvMgt.js} +1 -1
- package/dist/client/assets/{use-view-mode-CXzkxsjO.js → use-view-mode-BtY__6eQ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CXDuGiqH.js → use-virtual-mcp-BUyveTe6.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-c3E-w9DY.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-D705BqvF.js +1 -0
- package/dist/client/assets/{user-DzVhNpqN.js → user-DgdWVRpj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DPCyIr82.js → view-mode-toggle-D2WG_Euq.js} +1 -1
- package/dist/client/assets/{workflow-CdQVYV4Q.js → workflow-DRs0QH0L.js} +1 -1
- package/dist/client/assets/workflow-detail-B8_Px7_-.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +393 -393
- package/dist/server/migrate.js +132 -132
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/{postgres-bytea/license → xtend/LICENSE} +1 -2
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-CbLrb_N0.js +0 -1
- package/dist/client/assets/ai-providers-logos-CS4PCiqI.js +0 -1
- package/dist/client/assets/registry-Fsu61we3.js +0 -2
- package/dist/client/assets/select-model-_tj2LEO8.js +0 -4
- package/dist/client/assets/store-registry-Iir3u5ll.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CJd90n7M.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CJSBGdra.js +0 -1
- package/dist/client/assets/workflow-detail-BXw4DQr0.js +0 -1
- package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
- package/dist/server/node_modules/mimic-fn/index.js +0 -13
- package/dist/server/node_modules/mimic-fn/license +0 -9
- package/dist/server/node_modules/mimic-fn/package.json +0 -42
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/license +0 -21
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- 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/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
|
@@ -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,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,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
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# postgres-interval [](https://travis-ci.org/bendrucker/postgres-interval) [](https://greenkeeper.io/)
|
|
2
|
-
|
|
3
|
-
> Parse Postgres interval columns
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
$ npm install --save postgres-interval
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
var parse = require('postgres-interval')
|
|
17
|
-
var interval = parse('01:02:03')
|
|
18
|
-
//=> {hours: 1, minutes: 2, seconds: 3}
|
|
19
|
-
interval.toPostgres()
|
|
20
|
-
// 3 seconds 2 minutes 1 hours
|
|
21
|
-
interval.toISO()
|
|
22
|
-
// P0Y0M0DT1H2M3S
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## API
|
|
26
|
-
|
|
27
|
-
#### `parse(pgInterval)` -> `interval`
|
|
28
|
-
|
|
29
|
-
##### pgInterval
|
|
30
|
-
|
|
31
|
-
*Required*
|
|
32
|
-
Type: `string`
|
|
33
|
-
|
|
34
|
-
A Postgres interval string.
|
|
35
|
-
|
|
36
|
-
#### `interval.toPostgres()` -> `string`
|
|
37
|
-
|
|
38
|
-
Returns an interval string. This allows the interval object to be passed into prepared statements.
|
|
39
|
-
|
|
40
|
-
#### `interval.toISOString()` -> `string`
|
|
41
|
-
|
|
42
|
-
Returns an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) compliant string.
|
|
43
|
-
|
|
44
|
-
Also available as `interval.toISO()` for backwards compatibility.
|
|
45
|
-
|
|
46
|
-
## License
|
|
47
|
-
|
|
48
|
-
MIT © [Ben Drucker](http://bendrucker.me)
|