@wirecat/mail-cli 0.38.0 → 0.40.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/CHANGELOG.md +38 -0
- package/README.md +12 -10
- package/contracts/wirecat.json +63 -2
- package/dist/bin/mail.js +11 -11
- package/dist/bundle/{chunk-HIKPVWCL.js → chunk-VI5G3S4Y.js} +32 -5
- package/dist/bundle/mail.js +4 -166
- package/dist/bundle/program-DWRLBUW5.js +17329 -0
- package/dist/commands/account-remove.js +1 -2
- package/dist/commands/account.js +1 -1
- package/dist/commands/attachments.js +1 -2
- package/dist/commands/context.js +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/drafts-send.js +1 -2
- package/dist/commands/drafts.js +1 -2
- package/dist/commands/export.js +1 -2
- package/dist/commands/folders.js +1 -2
- package/dist/commands/import.js +1 -1
- package/dist/commands/messages.js +1 -1
- package/dist/commands/organising.js +1 -2
- package/dist/commands/read.js +3 -5
- package/dist/commands/restore.js +2 -2
- package/dist/commands/rules.js +3 -4
- package/dist/commands/send.js +1 -2
- package/dist/commands/session-start.js +1 -1
- package/dist/commands/session.js +1 -1
- package/dist/commands/stats.js +1 -1
- package/dist/commands/status.js +3 -5
- package/dist/commands/sync.js +1 -1
- package/dist/commands/tags.js +3 -4
- package/dist/config.js +1 -1
- package/dist/identity.js +26 -0
- package/dist/mail/changes.js +3 -2
- package/dist/mail/cleanup.js +3 -2
- package/dist/mail/domain-age.js +1 -1
- package/dist/mail/memo-trash.js +47 -0
- package/dist/mail/organise.js +1 -1
- package/dist/mail/save.js +1 -1
- package/dist/mail/send.js +1 -1
- package/dist/oauth.js +1 -3
- package/dist/profile.js +1 -1
- package/dist/program.js +1 -2
- package/dist/providers.js +4 -4
- package/dist/store.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/skills/mail-cli/SKILL.md +3 -3
- package/dist/bin/mail.d.ts +0 -3
- package/dist/bin/mail.d.ts.map +0 -1
- package/dist/bin/mail.js.map +0 -1
- package/dist/bundle/agent-U43CYLAP.js +0 -41
- package/dist/bundle/all-profiles-OCUZMXMI.js +0 -320
- package/dist/bundle/anthropic-CABWJABQ.js +0 -90
- package/dist/bundle/app-server-TTWPIGWG.js +0 -257
- package/dist/bundle/bun-F4M4KCNA.js +0 -169
- package/dist/bundle/bun-sqlite-YKYG25CR.js +0 -75
- package/dist/bundle/chunk-24UGTK32.js +0 -185
- package/dist/bundle/chunk-2HDXD6LM.js +0 -615
- package/dist/bundle/chunk-2SQLHBDP.js +0 -54
- package/dist/bundle/chunk-2YO3PLOE.js +0 -2843
- package/dist/bundle/chunk-3TYER5IK.js +0 -80
- package/dist/bundle/chunk-4FXDUXZP.js +0 -192
- package/dist/bundle/chunk-5ICUC66S.js +0 -76
- package/dist/bundle/chunk-725OPCHI.js +0 -4070
- package/dist/bundle/chunk-77YTUOKN.js +0 -1255
- package/dist/bundle/chunk-7ECP5ZQR.js +0 -2
- package/dist/bundle/chunk-7EJWHADX.js +0 -323
- package/dist/bundle/chunk-7KO5FSAW.js +0 -64
- package/dist/bundle/chunk-A3KNH3Q4.js +0 -353
- package/dist/bundle/chunk-AGO3OVKW.js +0 -40856
- package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
- package/dist/bundle/chunk-BA5B5ZF4.js +0 -12177
- package/dist/bundle/chunk-C4PUDTGD.js +0 -106
- package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
- package/dist/bundle/chunk-CJJFOT7W.js +0 -52
- package/dist/bundle/chunk-CLTFTGBP.js +0 -560
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DKGKPJA3.js +0 -3752
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-DYCE72XB.js +0 -794
- package/dist/bundle/chunk-EDWY73H7.js +0 -133
- package/dist/bundle/chunk-EJQAP6A6.js +0 -1007
- package/dist/bundle/chunk-ESNZL7SB.js +0 -330
- package/dist/bundle/chunk-FFER7KJI.js +0 -407
- package/dist/bundle/chunk-FTH6WGYO.js +0 -24
- package/dist/bundle/chunk-FWGNDKJK.js +0 -195
- package/dist/bundle/chunk-G46PNDWL.js +0 -58
- package/dist/bundle/chunk-G5HG7ZWQ.js +0 -1169
- package/dist/bundle/chunk-G6NY7LFB.js +0 -230
- package/dist/bundle/chunk-GMWKNWWY.js +0 -388
- package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
- package/dist/bundle/chunk-HFDDVGDH.js +0 -9512
- package/dist/bundle/chunk-HFRH5YJ6.js +0 -86
- package/dist/bundle/chunk-HI6MTNID.js +0 -338
- package/dist/bundle/chunk-HO4JGD4Q.js +0 -16
- package/dist/bundle/chunk-HTQTIKWP.js +0 -928
- package/dist/bundle/chunk-HUAHLO6N.js +0 -29
- package/dist/bundle/chunk-HYUUAH2N.js +0 -188
- package/dist/bundle/chunk-I4AWLFYH.js +0 -377
- package/dist/bundle/chunk-I4PZOWYG.js +0 -334
- package/dist/bundle/chunk-IDCZ4LWS.js +0 -150
- package/dist/bundle/chunk-ISQ23VKV.js +0 -123
- package/dist/bundle/chunk-KLRCTMES.js +0 -100
- package/dist/bundle/chunk-KP5JDYY6.js +0 -2669
- package/dist/bundle/chunk-KYRYD4CR.js +0 -38
- package/dist/bundle/chunk-LB2CF3GG.js +0 -730
- package/dist/bundle/chunk-LC7ZD2RW.js +0 -92
- package/dist/bundle/chunk-M65NILSA.js +0 -259
- package/dist/bundle/chunk-NQFG7AES.js +0 -364
- package/dist/bundle/chunk-OAO3JKQD.js +0 -463
- package/dist/bundle/chunk-OEEWVKJX.js +0 -53
- package/dist/bundle/chunk-OVHC7OV4.js +0 -218
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-PT4VLN3K.js +0 -161
- package/dist/bundle/chunk-QETNCUWB.js +0 -1703
- package/dist/bundle/chunk-QK3Z7BCC.js +0 -95
- package/dist/bundle/chunk-QWF3TFW4.js +0 -1342
- package/dist/bundle/chunk-RHEDE7D4.js +0 -80
- package/dist/bundle/chunk-RI5YZ23Y.js +0 -1068
- package/dist/bundle/chunk-ROUZN6UQ.js +0 -1997
- package/dist/bundle/chunk-RQD7CAGF.js +0 -288
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-SBLHQAH3.js +0 -360
- package/dist/bundle/chunk-SXLIADMY.js +0 -52
- package/dist/bundle/chunk-SYCM6SQ5.js +0 -2470
- package/dist/bundle/chunk-T3W4V4A6.js +0 -63
- package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
- package/dist/bundle/chunk-TES7MB6I.js +0 -82
- package/dist/bundle/chunk-TQDSBLQB.js +0 -2
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-UGFMQWAZ.js +0 -1044
- package/dist/bundle/chunk-VA6PHTMV.js +0 -690
- package/dist/bundle/chunk-VK24UQSD.js +0 -142
- package/dist/bundle/chunk-VUHH4MQW.js +0 -73464
- package/dist/bundle/chunk-W3BOR6AT.js +0 -2333
- package/dist/bundle/chunk-WA53OJ7V.js +0 -160
- package/dist/bundle/chunk-XGVMQMTS.js +0 -1197
- package/dist/bundle/chunk-XQUUANA2.js +0 -24600
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YP4FYLFI.js +0 -170
- package/dist/bundle/chunk-ZDBWBCEO.js +0 -108
- package/dist/bundle/chunk-ZKVUAH5N.js +0 -274
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/command-contract-V2WIL6RL.js +0 -40
- package/dist/bundle/command-server-entry-ZC5YF4EC.js +0 -169
- package/dist/bundle/decode-NXAGEUAD.js +0 -296
- package/dist/bundle/dispatch-USKS7J74.js +0 -411
- package/dist/bundle/dist-HFUVURJG.js +0 -7577
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/dist-XN2CRP3U.js +0 -318
- package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
- package/dist/bundle/embed-3P3LSM2O.js +0 -37
- package/dist/bundle/embedder-2SANUF2X.js +0 -110
- package/dist/bundle/failure-D4FGOIWF.js +0 -24
- package/dist/bundle/first-run-HEZKQLJL.js +0 -28
- package/dist/bundle/first-screen-7TQZ4I6X.js +0 -41
- package/dist/bundle/instructions-4H7UREH2.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-HF2NL4PU.js +0 -26
- package/dist/bundle/meeting-model-B7RVFB7L.js +0 -24
- package/dist/bundle/meeting-semantic-YQTL7YVQ.js +0 -21
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-P3PUHKYH.js +0 -176
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-OFHTCHJH.js +0 -73
- package/dist/bundle/oauth-IVB5RP7T.js +0 -19
- package/dist/bundle/open-KDGDLCWV.js +0 -22
- package/dist/bundle/openai-NVUBKA7Z.js +0 -237
- package/dist/bundle/process-AFIXYXWL.js +0 -91
- package/dist/bundle/program-JQ7EFODJ.js +0 -47008
- package/dist/bundle/prompt-QG7FC2SA.js +0 -16
- package/dist/bundle/public-FBD7MQUM.js +0 -204
- package/dist/bundle/recognize-ZBR5KNID.js +0 -25
- package/dist/bundle/remote-QOTHNO2M.js +0 -30
- package/dist/bundle/rerank-JD2NIUW6.js +0 -51
- package/dist/bundle/serve-QZT3FKK7.js +0 -198
- package/dist/bundle/server-M6JJ7IKS.js +0 -219
- package/dist/bundle/server-TAMXMWK6.js +0 -87
- package/dist/bundle/sqlite-runtime-N2PY7C7J.js +0 -19
- package/dist/bundle/state-OGRUMU7P.js +0 -35
- package/dist/bundle/store-7UE63OQR.js +0 -313
- package/dist/bundle/store-DGJKE4ZJ.js +0 -186
- package/dist/bundle/store-maintenance-command-WIDKMZLK.js +0 -74
- package/dist/bundle/surface-LTEEEZU4.js +0 -73
- package/dist/commands/account-remove.d.ts +0 -3
- package/dist/commands/account-remove.d.ts.map +0 -1
- package/dist/commands/account-remove.js.map +0 -1
- package/dist/commands/account.d.ts +0 -3
- package/dist/commands/account.d.ts.map +0 -1
- package/dist/commands/account.js.map +0 -1
- package/dist/commands/attachments.d.ts +0 -3
- package/dist/commands/attachments.d.ts.map +0 -1
- package/dist/commands/attachments.js.map +0 -1
- package/dist/commands/context.d.ts +0 -79
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -68
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/drafts-send.d.ts +0 -7
- package/dist/commands/drafts-send.d.ts.map +0 -1
- package/dist/commands/drafts-send.js.map +0 -1
- package/dist/commands/drafts.d.ts +0 -3
- package/dist/commands/drafts.d.ts.map +0 -1
- package/dist/commands/drafts.js.map +0 -1
- package/dist/commands/export.d.ts +0 -3
- package/dist/commands/export.d.ts.map +0 -1
- package/dist/commands/export.js.map +0 -1
- package/dist/commands/folders.d.ts +0 -3
- package/dist/commands/folders.d.ts.map +0 -1
- package/dist/commands/folders.js.map +0 -1
- package/dist/commands/import.d.ts +0 -3
- package/dist/commands/import.d.ts.map +0 -1
- package/dist/commands/import.js.map +0 -1
- package/dist/commands/login.d.ts +0 -5
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/mailbox.d.ts +0 -17
- package/dist/commands/mailbox.d.ts.map +0 -1
- package/dist/commands/mailbox.js.map +0 -1
- package/dist/commands/messages.d.ts +0 -4
- package/dist/commands/messages.d.ts.map +0 -1
- package/dist/commands/messages.js.map +0 -1
- package/dist/commands/organising.d.ts +0 -98
- package/dist/commands/organising.d.ts.map +0 -1
- package/dist/commands/organising.js.map +0 -1
- package/dist/commands/read.d.ts +0 -6
- package/dist/commands/read.d.ts.map +0 -1
- package/dist/commands/read.js.map +0 -1
- package/dist/commands/restore.d.ts +0 -3
- package/dist/commands/restore.d.ts.map +0 -1
- package/dist/commands/restore.js.map +0 -1
- package/dist/commands/rules.d.ts +0 -3
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js.map +0 -1
- package/dist/commands/send.d.ts +0 -51
- package/dist/commands/send.d.ts.map +0 -1
- package/dist/commands/send.js.map +0 -1
- package/dist/commands/server-search.d.ts +0 -8
- package/dist/commands/server-search.d.ts.map +0 -1
- package/dist/commands/server-search.js.map +0 -1
- package/dist/commands/session-start.d.ts +0 -3
- package/dist/commands/session-start.d.ts.map +0 -1
- package/dist/commands/session-start.js.map +0 -1
- package/dist/commands/session.d.ts +0 -3
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -3
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -11
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/tags.d.ts +0 -3
- package/dist/commands/tags.d.ts.map +0 -1
- package/dist/commands/tags.js.map +0 -1
- package/dist/commands/words.d.ts +0 -8
- package/dist/commands/words.d.ts.map +0 -1
- package/dist/commands/words.js.map +0 -1
- package/dist/config.d.ts +0 -239
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/discovery.d.ts +0 -31
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js.map +0 -1
- package/dist/export/format.d.ts +0 -19
- package/dist/export/format.d.ts.map +0 -1
- package/dist/export/format.js.map +0 -1
- package/dist/export/journal.d.ts +0 -34
- package/dist/export/journal.d.ts.map +0 -1
- package/dist/export/journal.js.map +0 -1
- package/dist/export/write.d.ts +0 -14
- package/dist/export/write.d.ts.map +0 -1
- package/dist/export/write.js.map +0 -1
- package/dist/identity.d.ts +0 -7
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/mail/backend.d.ts +0 -138
- package/dist/mail/backend.d.ts.map +0 -1
- package/dist/mail/backend.js.map +0 -1
- package/dist/mail/changes.d.ts +0 -99
- package/dist/mail/changes.d.ts.map +0 -1
- package/dist/mail/changes.js.map +0 -1
- package/dist/mail/cleanup.d.ts +0 -41
- package/dist/mail/cleanup.d.ts.map +0 -1
- package/dist/mail/cleanup.js.map +0 -1
- package/dist/mail/compose.d.ts +0 -75
- package/dist/mail/compose.d.ts.map +0 -1
- package/dist/mail/compose.js.map +0 -1
- package/dist/mail/domain-age.d.ts +0 -29
- package/dist/mail/domain-age.d.ts.map +0 -1
- package/dist/mail/domain-age.js.map +0 -1
- package/dist/mail/drafts.d.ts +0 -54
- package/dist/mail/drafts.d.ts.map +0 -1
- package/dist/mail/drafts.js.map +0 -1
- package/dist/mail/imap/account.d.ts +0 -5
- package/dist/mail/imap/account.d.ts.map +0 -1
- package/dist/mail/imap/account.js.map +0 -1
- package/dist/mail/imap/connection.d.ts +0 -72
- package/dist/mail/imap/connection.d.ts.map +0 -1
- package/dist/mail/imap/connection.js.map +0 -1
- package/dist/mail/imap/errors.d.ts +0 -11
- package/dist/mail/imap/errors.d.ts.map +0 -1
- package/dist/mail/imap/errors.js.map +0 -1
- package/dist/mail/imap/index.d.ts +0 -7
- package/dist/mail/imap/index.d.ts.map +0 -1
- package/dist/mail/imap/index.js.map +0 -1
- package/dist/mail/imap/messages.d.ts +0 -17
- package/dist/mail/imap/messages.d.ts.map +0 -1
- package/dist/mail/imap/messages.js.map +0 -1
- package/dist/mail/imap/read.d.ts +0 -7
- package/dist/mail/imap/read.d.ts.map +0 -1
- package/dist/mail/imap/read.js.map +0 -1
- package/dist/mail/imap/search.d.ts +0 -19
- package/dist/mail/imap/search.d.ts.map +0 -1
- package/dist/mail/imap/search.js.map +0 -1
- package/dist/mail/imap/write.d.ts +0 -5
- package/dist/mail/imap/write.d.ts.map +0 -1
- package/dist/mail/imap/write.js.map +0 -1
- package/dist/mail/locate.d.ts +0 -32
- package/dist/mail/locate.d.ts.map +0 -1
- package/dist/mail/locate.js.map +0 -1
- package/dist/mail/mbox.d.ts +0 -9
- package/dist/mail/mbox.d.ts.map +0 -1
- package/dist/mail/mbox.js.map +0 -1
- package/dist/mail/organise.d.ts +0 -101
- package/dist/mail/organise.d.ts.map +0 -1
- package/dist/mail/organise.js.map +0 -1
- package/dist/mail/restore.d.ts +0 -22
- package/dist/mail/restore.d.ts.map +0 -1
- package/dist/mail/restore.js.map +0 -1
- package/dist/mail/rethread.d.ts +0 -14
- package/dist/mail/rethread.d.ts.map +0 -1
- package/dist/mail/rethread.js.map +0 -1
- package/dist/mail/rules/apply.d.ts +0 -48
- package/dist/mail/rules/apply.d.ts.map +0 -1
- package/dist/mail/rules/apply.js.map +0 -1
- package/dist/mail/rules/file.d.ts +0 -9
- package/dist/mail/rules/file.d.ts.map +0 -1
- package/dist/mail/rules/file.js.map +0 -1
- package/dist/mail/rules/filters.d.ts +0 -11
- package/dist/mail/rules/filters.d.ts.map +0 -1
- package/dist/mail/rules/filters.js.map +0 -1
- package/dist/mail/rules/folders.d.ts +0 -11
- package/dist/mail/rules/folders.d.ts.map +0 -1
- package/dist/mail/rules/folders.js.map +0 -1
- package/dist/mail/rules/query.d.ts +0 -16
- package/dist/mail/rules/query.d.ts.map +0 -1
- package/dist/mail/rules/query.js.map +0 -1
- package/dist/mail/rules/store.d.ts +0 -9
- package/dist/mail/rules/store.d.ts.map +0 -1
- package/dist/mail/rules/store.js.map +0 -1
- package/dist/mail/save.d.ts +0 -9
- package/dist/mail/save.d.ts.map +0 -1
- package/dist/mail/save.js.map +0 -1
- package/dist/mail/send-as.d.ts +0 -21
- package/dist/mail/send-as.d.ts.map +0 -1
- package/dist/mail/send-as.js.map +0 -1
- package/dist/mail/send.d.ts +0 -76
- package/dist/mail/send.d.ts.map +0 -1
- package/dist/mail/send.js.map +0 -1
- package/dist/mail/smtp.d.ts +0 -4
- package/dist/mail/smtp.d.ts.map +0 -1
- package/dist/mail/smtp.js.map +0 -1
- package/dist/oauth.d.ts +0 -75
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js.map +0 -1
- package/dist/profile.d.ts +0 -20
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js.map +0 -1
- package/dist/program.d.ts +0 -6
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
- package/dist/providers.d.ts +0 -255
- package/dist/providers.d.ts.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/reasons.d.ts +0 -9
- package/dist/reasons.d.ts.map +0 -1
- package/dist/reasons.js.map +0 -1
- package/dist/secret.d.ts +0 -31
- package/dist/secret.d.ts.map +0 -1
- package/dist/secret.js.map +0 -1
- package/dist/store.d.ts +0 -12
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/wcat.d.ts +0 -3
- package/dist/wcat.d.ts.map +0 -1
- package/dist/wcat.js.map +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
__name
|
|
5
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
-
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/commander-internals.js
|
|
8
|
-
var internals = /* @__PURE__ */ __name((command) => command, "internals");
|
|
9
|
-
var hasOwnAction = /* @__PURE__ */ __name((command) => internals(command)._actionHandler != null, "hasOwnAction");
|
|
10
|
-
var isHidden = /* @__PURE__ */ __name((command) => internals(command)._hidden === true, "isHidden");
|
|
11
|
-
var hide = /* @__PURE__ */ __name((command) => {
|
|
12
|
-
internals(command)._hidden = true;
|
|
13
|
-
}, "hide");
|
|
14
|
-
var helpOptionOf = /* @__PURE__ */ __name((command) => internals(command)._getHelpOption(), "helpOptionOf");
|
|
15
|
-
var rejectUnknownOption = /* @__PURE__ */ __name((command, flag) => internals(command).unknownOption(flag), "rejectUnknownOption");
|
|
16
|
-
var onUnknownOption = /* @__PURE__ */ __name((command, handle) => {
|
|
17
|
-
const own = internals(command);
|
|
18
|
-
const fallback = own.unknownOption.bind(command);
|
|
19
|
-
own.unknownOption = (flag) => handle(flag, fallback);
|
|
20
|
-
}, "onUnknownOption");
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
hasOwnAction,
|
|
24
|
-
isHidden,
|
|
25
|
-
hide,
|
|
26
|
-
helpOptionOf,
|
|
27
|
-
rejectUnknownOption,
|
|
28
|
-
onUnknownOption
|
|
29
|
-
};
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
stdinFieldOf
|
|
5
|
-
} from "./chunk-GZ7WBU5Y.js";
|
|
6
|
-
import {
|
|
7
|
-
commandPathOf
|
|
8
|
-
} from "./chunk-EDWY73H7.js";
|
|
9
|
-
import {
|
|
10
|
-
commandServerRequest,
|
|
11
|
-
metaOf
|
|
12
|
-
} from "./chunk-BA5B5ZF4.js";
|
|
13
|
-
import {
|
|
14
|
-
errorObjectOf,
|
|
15
|
-
renderError
|
|
16
|
-
} from "./chunk-KP5JDYY6.js";
|
|
17
|
-
import {
|
|
18
|
-
CliError
|
|
19
|
-
} from "./chunk-S6JG4YUH.js";
|
|
20
|
-
import {
|
|
21
|
-
__name
|
|
22
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
23
|
-
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/command-server.js
|
|
25
|
-
import { createInterface } from "node:readline";
|
|
26
|
-
|
|
27
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
|
|
28
|
-
var COMMAND_SERVER_ARGV = ["commands", "--serve"];
|
|
29
|
-
var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
|
|
30
|
-
|
|
31
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/command-server.js
|
|
32
|
-
var COMMAND_SERVER_PROTOCOL = 1;
|
|
33
|
-
var COMMAND_SERVER_IDLE_MS = 10 * 6e4;
|
|
34
|
-
var COMMAND_SERVER_CONCURRENT = 8;
|
|
35
|
-
var runsAlone = /* @__PURE__ */ __name((command) => commandPathOf(command)[0] === "store", "runsAlone");
|
|
36
|
-
var enterCommandServer = /* @__PURE__ */ __name(async (command, cli) => {
|
|
37
|
-
const request = commandServerRequest();
|
|
38
|
-
if (!request)
|
|
39
|
-
return;
|
|
40
|
-
refuseInCommandServer(command, cli);
|
|
41
|
-
if (runsAlone(command))
|
|
42
|
-
await request.alone();
|
|
43
|
-
}, "enterCommandServer");
|
|
44
|
-
var refuseInCommandServer = /* @__PURE__ */ __name((command, cli) => {
|
|
45
|
-
if (!commandServerRequest())
|
|
46
|
-
return;
|
|
47
|
-
const typed = [cli, ...commandPathOf(command)].join(" ");
|
|
48
|
-
const { lifetime } = metaOf(command);
|
|
49
|
-
if (lifetime)
|
|
50
|
-
throw new CliError("validation_error", `\`${typed}\` ${lifetime === "persistent" ? "runs until it is stopped" : "waits on a person"}; the command server runs only commands that return \u2014 start it as a process of its own`);
|
|
51
|
-
if (stdinFieldOf(command))
|
|
52
|
-
throw new CliError("validation_error", `\`${typed}\` reads its input on stdin, which the command server does not pass on \u2014 start it as a process of its own`);
|
|
53
|
-
}, "refuseInCommandServer");
|
|
54
|
-
var refusal = /* @__PURE__ */ __name((cli, message) => `${renderError(errorObjectOf(new CliError("validation_error", message)), { cli, interactive: false })}
|
|
55
|
-
`, "refusal");
|
|
56
|
-
var requestOf = /* @__PURE__ */ __name((line, cli) => {
|
|
57
|
-
let parsed;
|
|
58
|
-
try {
|
|
59
|
-
parsed = JSON.parse(line);
|
|
60
|
-
} catch {
|
|
61
|
-
return { id: null, error: "a request is one JSON object per line" };
|
|
62
|
-
}
|
|
63
|
-
const { id, argv } = parsed ?? {};
|
|
64
|
-
const known = typeof id === "number" && Number.isFinite(id) ? id : null;
|
|
65
|
-
if (known === null)
|
|
66
|
-
return { id: null, error: 'a request needs a numeric "id"' };
|
|
67
|
-
if (!Array.isArray(argv) || !argv.every((word) => typeof word === "string"))
|
|
68
|
-
return { id: known, error: '"argv" is a list of strings' };
|
|
69
|
-
if (isCommandServer(argv))
|
|
70
|
-
return { id: known, error: `\`${cli} commands --serve\` cannot run inside itself` };
|
|
71
|
-
return { id: known, argv };
|
|
72
|
-
}, "requestOf");
|
|
73
|
-
var serveCommands = /* @__PURE__ */ __name(async ({ input, write, run, cli, version, idleMs = COMMAND_SERVER_IDLE_MS, concurrent = COMMAND_SERVER_CONCURRENT, signal }) => {
|
|
74
|
-
const send = /* @__PURE__ */ __name((value) => write(`${JSON.stringify(value)}
|
|
75
|
-
`), "send");
|
|
76
|
-
await send({ ready: true, protocol: COMMAND_SERVER_PROTOCOL, version, concurrent });
|
|
77
|
-
const lines = createInterface({ input, crlfDelay: Number.POSITIVE_INFINITY });
|
|
78
|
-
return new Promise((resolve) => {
|
|
79
|
-
const waiting = [];
|
|
80
|
-
let active = 0;
|
|
81
|
-
let running = 0;
|
|
82
|
-
let gated = false;
|
|
83
|
-
let drained;
|
|
84
|
-
let turns = Promise.resolve();
|
|
85
|
-
let timer;
|
|
86
|
-
let ending = false;
|
|
87
|
-
let done = false;
|
|
88
|
-
const finish = /* @__PURE__ */ __name(() => {
|
|
89
|
-
if (done)
|
|
90
|
-
return;
|
|
91
|
-
done = true;
|
|
92
|
-
clearTimeout(timer);
|
|
93
|
-
lines.close();
|
|
94
|
-
resolve(0);
|
|
95
|
-
}, "finish");
|
|
96
|
-
const settle = /* @__PURE__ */ __name(() => {
|
|
97
|
-
if (running === 0 && drained) {
|
|
98
|
-
const go = drained;
|
|
99
|
-
drained = void 0;
|
|
100
|
-
go();
|
|
101
|
-
}
|
|
102
|
-
pump();
|
|
103
|
-
if (active > 0 || waiting.length > 0 || done)
|
|
104
|
-
return;
|
|
105
|
-
if (ending)
|
|
106
|
-
finish();
|
|
107
|
-
else {
|
|
108
|
-
clearTimeout(timer);
|
|
109
|
-
timer = setTimeout(finish, idleMs);
|
|
110
|
-
}
|
|
111
|
-
}, "settle");
|
|
112
|
-
const start = /* @__PURE__ */ __name((line) => {
|
|
113
|
-
active += 1;
|
|
114
|
-
running += 1;
|
|
115
|
-
let holdsPlace = true;
|
|
116
|
-
let ended = false;
|
|
117
|
-
let turn;
|
|
118
|
-
let release;
|
|
119
|
-
const alone = /* @__PURE__ */ __name(() => {
|
|
120
|
-
if (turn)
|
|
121
|
-
return turn;
|
|
122
|
-
holdsPlace = false;
|
|
123
|
-
running -= 1;
|
|
124
|
-
turn = turns.then(() => new Promise((go) => {
|
|
125
|
-
if (ended)
|
|
126
|
-
return go();
|
|
127
|
-
gated = true;
|
|
128
|
-
drained = /* @__PURE__ */ __name(() => {
|
|
129
|
-
if (ended)
|
|
130
|
-
gated = false;
|
|
131
|
-
else {
|
|
132
|
-
holdsPlace = true;
|
|
133
|
-
running += 1;
|
|
134
|
-
}
|
|
135
|
-
go();
|
|
136
|
-
}, "drained");
|
|
137
|
-
settle();
|
|
138
|
-
}));
|
|
139
|
-
turns = turn.then(() => ended && !holdsPlace ? void 0 : new Promise((free) => release = free));
|
|
140
|
-
return turn;
|
|
141
|
-
}, "alone");
|
|
142
|
-
const answer = /* @__PURE__ */ __name(async () => {
|
|
143
|
-
const request = requestOf(line, cli);
|
|
144
|
-
if ("error" in request)
|
|
145
|
-
return send({ id: request.id, code: 2, stdout: "", stderr: refusal(cli, request.error) });
|
|
146
|
-
const answered = await run(request.argv, alone);
|
|
147
|
-
return send({ id: request.id, ...answered });
|
|
148
|
-
}, "answer");
|
|
149
|
-
answer().catch(finish).finally(() => {
|
|
150
|
-
ended = true;
|
|
151
|
-
active -= 1;
|
|
152
|
-
if (holdsPlace)
|
|
153
|
-
running -= 1;
|
|
154
|
-
if (release) {
|
|
155
|
-
gated = false;
|
|
156
|
-
release();
|
|
157
|
-
}
|
|
158
|
-
settle();
|
|
159
|
-
});
|
|
160
|
-
}, "start");
|
|
161
|
-
const pump = /* @__PURE__ */ __name(() => {
|
|
162
|
-
while (!done && !gated && running < concurrent && waiting.length > 0)
|
|
163
|
-
start(waiting.shift());
|
|
164
|
-
}, "pump");
|
|
165
|
-
lines.on("line", (line) => {
|
|
166
|
-
if (done || ending || line.trim() === "")
|
|
167
|
-
return;
|
|
168
|
-
clearTimeout(timer);
|
|
169
|
-
waiting.push(line);
|
|
170
|
-
pump();
|
|
171
|
-
});
|
|
172
|
-
const end = /* @__PURE__ */ __name(() => {
|
|
173
|
-
ending = true;
|
|
174
|
-
settle();
|
|
175
|
-
}, "end");
|
|
176
|
-
lines.on("close", end);
|
|
177
|
-
if (signal?.aborted)
|
|
178
|
-
end();
|
|
179
|
-
signal?.addEventListener("abort", end, { once: true });
|
|
180
|
-
settle();
|
|
181
|
-
});
|
|
182
|
-
}, "serveCommands");
|
|
183
|
-
|
|
184
|
-
export {
|
|
185
|
-
COMMAND_SERVER_CONCURRENT,
|
|
186
|
-
enterCommandServer,
|
|
187
|
-
serveCommands
|
|
188
|
-
};
|
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
CliError
|
|
5
|
-
} from "./chunk-S6JG4YUH.js";
|
|
6
|
-
import {
|
|
7
|
-
__name
|
|
8
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
9
|
-
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
11
|
-
var CURRENCY_SCALES = {
|
|
12
|
-
AED: 2,
|
|
13
|
-
AMD: 2,
|
|
14
|
-
AUD: 2,
|
|
15
|
-
BHD: 3,
|
|
16
|
-
BYN: 2,
|
|
17
|
-
CAD: 2,
|
|
18
|
-
CHF: 2,
|
|
19
|
-
CLP: 0,
|
|
20
|
-
CNY: 2,
|
|
21
|
-
CZK: 2,
|
|
22
|
-
DKK: 2,
|
|
23
|
-
EUR: 2,
|
|
24
|
-
GBP: 2,
|
|
25
|
-
GEL: 2,
|
|
26
|
-
HUF: 2,
|
|
27
|
-
ILS: 2,
|
|
28
|
-
INR: 2,
|
|
29
|
-
ISK: 0,
|
|
30
|
-
JPY: 0,
|
|
31
|
-
KGS: 2,
|
|
32
|
-
KRW: 0,
|
|
33
|
-
KWD: 3,
|
|
34
|
-
KZT: 2,
|
|
35
|
-
NOK: 2,
|
|
36
|
-
PLN: 2,
|
|
37
|
-
RSD: 2,
|
|
38
|
-
RUB: 2,
|
|
39
|
-
SEK: 2,
|
|
40
|
-
THB: 2,
|
|
41
|
-
TRY: 2,
|
|
42
|
-
UAH: 2,
|
|
43
|
-
USD: 2,
|
|
44
|
-
UZS: 2,
|
|
45
|
-
VND: 0
|
|
46
|
-
};
|
|
47
|
-
var refuse = /* @__PURE__ */ __name((message, reason) => {
|
|
48
|
-
throw new CliError("validation_error", message, { reason });
|
|
49
|
-
}, "refuse");
|
|
50
|
-
var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
|
|
51
|
-
var parseDecimal = /* @__PURE__ */ __name((text, scale) => {
|
|
52
|
-
const match = DECIMAL.exec(text.trim());
|
|
53
|
-
if (!match || (match[2] ?? "").length > scale)
|
|
54
|
-
return void 0;
|
|
55
|
-
return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
|
|
56
|
-
}, "parseDecimal");
|
|
57
|
-
var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
|
|
58
|
-
const value = BigInt(units);
|
|
59
|
-
if (value < 0n)
|
|
60
|
-
return `-${formatDecimal(-value, scale)}`;
|
|
61
|
-
const digits = value.toString().padStart(scale + 1, "0");
|
|
62
|
-
return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
|
|
63
|
-
}, "formatDecimal");
|
|
64
|
-
var groupDigits = /* @__PURE__ */ __name((decimal) => {
|
|
65
|
-
const [whole = "0", fraction] = decimal.split(".");
|
|
66
|
-
const grouped = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
67
|
-
return fraction === void 0 ? grouped : `${grouped}.${fraction}`;
|
|
68
|
-
}, "groupDigits");
|
|
69
|
-
var currencyOf = /* @__PURE__ */ __name((text) => {
|
|
70
|
-
const code = typeof text === "string" ? text.trim().toUpperCase() : "";
|
|
71
|
-
if (CURRENCY_SCALES[code] === void 0)
|
|
72
|
-
return refuse(`${typeof text === "string" && text.trim() ? text.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
|
|
73
|
-
return code;
|
|
74
|
-
}, "currencyOf");
|
|
75
|
-
var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
|
|
76
|
-
var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
77
|
-
const scale = scaleOf(currency);
|
|
78
|
-
const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
|
|
79
|
-
if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
|
|
80
|
-
return refuse(`${what} is a decimal string with at most ${scale} decimal${scale === 1 ? "" : "s"} for ${currency}, such as "${formatDecimal(5e3 * 10 ** scale, scale)}"`, "money.amount");
|
|
81
|
-
return Number(units);
|
|
82
|
-
}, "minorUnits");
|
|
83
|
-
var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
84
|
-
if (typeof amount !== "string" || !amount.trim().startsWith("-"))
|
|
85
|
-
return minorUnits(amount, currency, what);
|
|
86
|
-
const units = minorUnits(amount.trim().slice(1), currency, what);
|
|
87
|
-
return units === 0 ? 0 : -units;
|
|
88
|
-
}, "signedMinorUnits");
|
|
89
|
-
var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
|
|
90
|
-
amount: formatDecimal(units, scaleOf(currency)),
|
|
91
|
-
currency
|
|
92
|
-
}), "moneyOf");
|
|
93
|
-
var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
|
|
94
|
-
var QUANTITY_SCALE = 3;
|
|
95
|
-
var quantityOf = /* @__PURE__ */ __name((text) => {
|
|
96
|
-
const thousandths = typeof text === "string" ? parseDecimal(text, QUANTITY_SCALE) : void 0;
|
|
97
|
-
if (thousandths === void 0 || thousandths === 0n)
|
|
98
|
-
return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
|
|
99
|
-
const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
|
|
100
|
-
return { text: plain, thousandths };
|
|
101
|
-
}, "quantityOf");
|
|
102
|
-
var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
|
|
103
|
-
|
|
104
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/deals.js
|
|
105
|
-
var DEAL_KINDS = ["deal", "lead"];
|
|
106
|
-
var DEAL_STATUSES = ["open", "won", "lost"];
|
|
107
|
-
var STAGE_OUTCOMES = DEAL_STATUSES;
|
|
108
|
-
var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
|
|
109
|
-
var dealLine = /* @__PURE__ */ __name((deal) => {
|
|
110
|
-
const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
|
|
111
|
-
return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
|
|
112
|
-
}, "dealLine");
|
|
113
|
-
|
|
114
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/finance.js
|
|
115
|
-
var INVOICE_DIRECTIONS = ["receivable", "payable"];
|
|
116
|
-
var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
|
|
117
|
-
var MONEY_DIRECTIONS = ["in", "out"];
|
|
118
|
-
var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
|
|
119
|
-
var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
|
|
120
|
-
if (current === "draft" || current === "void")
|
|
121
|
-
return current;
|
|
122
|
-
if (paid <= 0)
|
|
123
|
-
return "issued";
|
|
124
|
-
return paid < total ? "partly_paid" : "paid";
|
|
125
|
-
}, "settledStatus");
|
|
126
|
-
var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
|
|
127
|
-
var notes = /* @__PURE__ */ __name((...words) => {
|
|
128
|
-
const kept = words.filter((word) => word !== null);
|
|
129
|
-
return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
|
|
130
|
-
}, "notes");
|
|
131
|
-
var invoiceLine = /* @__PURE__ */ __name((invoice) => {
|
|
132
|
-
const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
|
|
133
|
-
const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
|
|
134
|
-
return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
|
|
135
|
-
}, "invoiceLine");
|
|
136
|
-
var paymentLine = /* @__PURE__ */ __name((payment) => {
|
|
137
|
-
const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
|
|
138
|
-
return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
|
|
139
|
-
}, "paymentLine");
|
|
140
|
-
var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
|
|
141
|
-
var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
|
|
142
|
-
|
|
143
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/orders.js
|
|
144
|
-
var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
|
|
145
|
-
var ORDER_PURPOSES = ["personal", "business", "client", "other"];
|
|
146
|
-
var orderLine = /* @__PURE__ */ __name((order) => {
|
|
147
|
-
const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
|
|
148
|
-
const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
|
|
149
|
-
const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
|
|
150
|
-
return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
|
|
151
|
-
}, "orderLine");
|
|
152
|
-
var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
|
|
153
|
-
|
|
154
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/relations.js
|
|
155
|
-
var ORGANIZATION_ROLES = [
|
|
156
|
-
"employee",
|
|
157
|
-
"contractor",
|
|
158
|
-
"founder",
|
|
159
|
-
"owner",
|
|
160
|
-
"manager",
|
|
161
|
-
"adviser",
|
|
162
|
-
"contact"
|
|
163
|
-
];
|
|
164
|
-
var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
|
|
165
|
-
var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
|
|
166
|
-
var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
|
|
167
|
-
var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
|
|
168
|
-
var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
|
|
169
|
-
var checkEngagement = /* @__PURE__ */ __name((kind, from, to, level) => {
|
|
170
|
-
if (kind !== "member-of" || from !== "person" || to !== "project")
|
|
171
|
-
throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
|
|
172
|
-
reason: "relationship.engagement-ends"
|
|
173
|
-
});
|
|
174
|
-
if (!isEngagement(level))
|
|
175
|
-
throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
|
|
176
|
-
reason: "relationship.engagement-unknown"
|
|
177
|
-
});
|
|
178
|
-
return level;
|
|
179
|
-
}, "checkEngagement");
|
|
180
|
-
var ENGAGEMENT_ORDER = { high: 0, medium: 1, unknown: 2, low: 3, none: 4 };
|
|
181
|
-
var engagementRank = /* @__PURE__ */ __name((level) => ENGAGEMENT_ORDER[level ?? "unknown"], "engagementRank");
|
|
182
|
-
var byEngagement = /* @__PURE__ */ __name((items) => items.map((item, index) => ({ item, index })).sort((a, b) => engagementRank(a.item.engagement) - engagementRank(b.item.engagement) || a.index - b.index).map(({ item }) => item), "byEngagement");
|
|
183
|
-
var RELATIONS = {
|
|
184
|
-
"member-of": {
|
|
185
|
-
from: ["person", "organization", "project", "chat", "email_thread"],
|
|
186
|
-
to: ["organization", "project"],
|
|
187
|
-
roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
|
|
188
|
-
},
|
|
189
|
-
"reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
|
|
190
|
-
"customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
|
|
191
|
-
"partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
|
|
192
|
-
"related-to": {
|
|
193
|
-
from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
|
|
194
|
-
to: ["person", "organization", "project", "task"],
|
|
195
|
-
roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
var RELATION_KINDS = Object.keys(RELATIONS);
|
|
199
|
-
var specOf = /* @__PURE__ */ __name((kind) => Object.hasOwn(RELATIONS, kind) ? RELATIONS[kind] : void 0, "specOf");
|
|
200
|
-
var isRelationKind = /* @__PURE__ */ __name((kind) => specOf(kind) !== void 0, "isRelationKind");
|
|
201
|
-
var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
|
|
202
|
-
var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
|
|
203
|
-
var checkEnds = /* @__PURE__ */ __name((kind, from, to) => {
|
|
204
|
-
const spec = specOf(kind);
|
|
205
|
-
if (!spec)
|
|
206
|
-
throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
|
|
207
|
-
if (memberOnly(from) && (kind !== "member-of" || to !== "project"))
|
|
208
|
-
throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
|
|
209
|
-
if (partyOnly(from, to))
|
|
210
|
-
throw new CliError("validation_error", "a contract is related only to a person or an organization");
|
|
211
|
-
if (!spec.from.includes(from) || !spec.to.includes(to))
|
|
212
|
-
throw new CliError("validation_error", `${kind} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
|
|
213
|
-
return spec;
|
|
214
|
-
}, "checkEnds");
|
|
215
|
-
var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
|
|
216
|
-
var rolesOf = /* @__PURE__ */ __name((kind, from, to) => {
|
|
217
|
-
const spec = specOf(kind);
|
|
218
|
-
if (kind === "member-of" && from !== "person")
|
|
219
|
-
return void 0;
|
|
220
|
-
return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
|
|
221
|
-
}, "rolesOf");
|
|
222
|
-
var ROLE_LISTS = {
|
|
223
|
-
organization: ORGANIZATION_ROLES,
|
|
224
|
-
project: PROJECT_ROLES,
|
|
225
|
-
deal: DEAL_ROLES,
|
|
226
|
-
contract: CONTRACT_ROLES,
|
|
227
|
-
related: RELATED_ROLES
|
|
228
|
-
};
|
|
229
|
-
var roleListOf = /* @__PURE__ */ __name((kind, from, to) => {
|
|
230
|
-
if (kind === "related-to" && isParty(from) && isParty(to))
|
|
231
|
-
return "related";
|
|
232
|
-
const roles = rolesOf(kind, from, to);
|
|
233
|
-
return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
|
|
234
|
-
}, "roleListOf");
|
|
235
|
-
var checkRole = /* @__PURE__ */ __name((kind, from, to, role, extra = []) => {
|
|
236
|
-
const roles = rolesOf(kind, from, to)?.concat(extra);
|
|
237
|
-
if (roles && !roles.includes(role))
|
|
238
|
-
throw new CliError("validation_error", `a ${from}'s role on ${kind} ${to} is one of ${roles.join(", ")}`, {
|
|
239
|
-
reason: "relationship.role-unknown"
|
|
240
|
-
});
|
|
241
|
-
return role;
|
|
242
|
-
}, "checkRole");
|
|
243
|
-
var isSymmetric = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric === true, "isSymmetric");
|
|
244
|
-
var inverseOf = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric ? kind : specOf(kind)?.inverse ?? null, "inverseOf");
|
|
245
|
-
var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
|
|
246
|
-
var standingOf = /* @__PURE__ */ __name((link, now) => {
|
|
247
|
-
if (link.endsAt != null && link.endsAt <= now)
|
|
248
|
-
return "ended";
|
|
249
|
-
if (link.confirmed)
|
|
250
|
-
return "confirmed";
|
|
251
|
-
if (link.deletedAt != null)
|
|
252
|
-
return "ended";
|
|
253
|
-
return link.accountId != null ? "reported" : "proposed";
|
|
254
|
-
}, "standingOf");
|
|
255
|
-
var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
|
|
256
|
-
var usableLink = /* @__PURE__ */ __name((link, now) => isUsable(standingOf(link, now)), "usableLink");
|
|
257
|
-
var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
|
|
258
|
-
var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE ${KEYED} AND override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
|
|
259
|
-
var usableLinkSql = /* @__PURE__ */ __name((alias, now) => `(${alias}.confirmed = 1 OR (${alias}.account_id IS NOT NULL AND ${alias}.deleted_at IS NULL))` + (now === void 0 ? "" : ` AND (${alias}.ends_at IS NULL OR ${alias}.ends_at > ${Math.trunc(now)})`), "usableLinkSql");
|
|
260
|
-
|
|
261
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/crm.js
|
|
262
|
-
var CRM_KINDS = ["organization", "person", "deal", "lead"];
|
|
263
|
-
var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
|
|
264
|
-
var isCrmUserId = /* @__PURE__ */ __name((id) => /^\d{1,20}$/.test(id), "isCrmUserId");
|
|
265
|
-
var normalCrmUserId = /* @__PURE__ */ __name((id) => {
|
|
266
|
-
const text = id.trim();
|
|
267
|
-
return /^\d+$/.test(text) ? text.replace(/^0+(?=\d)/, "") : text;
|
|
268
|
-
}, "normalCrmUserId");
|
|
269
|
-
var isItemKind = /* @__PURE__ */ __name((kind) => kind === "deal" || kind === "lead", "isItemKind");
|
|
270
|
-
|
|
271
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/business.js
|
|
272
|
-
var CATALOG_KINDS = ["product", "service"];
|
|
273
|
-
var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
|
|
274
|
-
var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
|
|
275
|
-
var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
|
|
276
|
-
var PERIOD_UNITS = ["day", "week", "month", "year"];
|
|
277
|
-
var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
|
|
278
|
-
var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
|
|
279
|
-
var TRANSACTION_STATUSES = ["pending", "booked"];
|
|
280
|
-
var ORDER_DIRECTIONS = ["purchase", "sale"];
|
|
281
|
-
var intervalOf = /* @__PURE__ */ __name((text, reason = "subscription.interval") => {
|
|
282
|
-
const match = typeof text === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text.trim()) : null;
|
|
283
|
-
if (!match)
|
|
284
|
-
throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
|
|
285
|
-
return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
|
|
286
|
-
}, "intervalOf");
|
|
287
|
-
var intervalText = /* @__PURE__ */ __name(({ count, unit }) => `${count}-${unit}`, "intervalText");
|
|
288
|
-
var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
|
|
289
|
-
var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
|
|
290
|
-
var productLine = /* @__PURE__ */ __name((product) => {
|
|
291
|
-
const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
|
|
292
|
-
const per = price && product.unit !== null ? ` per ${product.unit}` : "";
|
|
293
|
-
return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
|
|
294
|
-
}, "productLine");
|
|
295
|
-
var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
|
|
296
|
-
var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
|
|
297
|
-
var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
|
|
298
|
-
var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
|
|
299
|
-
|
|
300
|
-
export {
|
|
301
|
-
CURRENCY_SCALES,
|
|
302
|
-
parseDecimal,
|
|
303
|
-
formatDecimal,
|
|
304
|
-
currencyOf,
|
|
305
|
-
scaleOf,
|
|
306
|
-
minorUnits,
|
|
307
|
-
signedMinorUnits,
|
|
308
|
-
moneyOf,
|
|
309
|
-
moneyLabel,
|
|
310
|
-
quantityOf,
|
|
311
|
-
lineUnits,
|
|
312
|
-
DEAL_KINDS,
|
|
313
|
-
DEAL_STATUSES,
|
|
314
|
-
STAGE_OUTCOMES,
|
|
315
|
-
DEAL_ROLES,
|
|
316
|
-
dealLine,
|
|
317
|
-
INVOICE_DIRECTIONS,
|
|
318
|
-
INVOICE_STATUSES,
|
|
319
|
-
MONEY_DIRECTIONS,
|
|
320
|
-
FINANCE_REVIEWS,
|
|
321
|
-
settledStatus,
|
|
322
|
-
invoiceLine,
|
|
323
|
-
paymentLine,
|
|
324
|
-
invoiceTitle,
|
|
325
|
-
paymentEntryTitle,
|
|
326
|
-
ORDER_STATUSES,
|
|
327
|
-
ORDER_PURPOSES,
|
|
328
|
-
orderLine,
|
|
329
|
-
orderTitle,
|
|
330
|
-
ORGANIZATION_ROLES,
|
|
331
|
-
PROJECT_ROLES,
|
|
332
|
-
CONTRACT_ROLES,
|
|
333
|
-
RELATED_ROLES,
|
|
334
|
-
ENGAGEMENT_LEVELS,
|
|
335
|
-
isEngagement,
|
|
336
|
-
checkEngagement,
|
|
337
|
-
engagementRank,
|
|
338
|
-
byEngagement,
|
|
339
|
-
RELATIONS,
|
|
340
|
-
RELATION_KINDS,
|
|
341
|
-
isRelationKind,
|
|
342
|
-
checkEnds,
|
|
343
|
-
rolesOf,
|
|
344
|
-
ROLE_LISTS,
|
|
345
|
-
roleListOf,
|
|
346
|
-
checkRole,
|
|
347
|
-
isSymmetric,
|
|
348
|
-
inverseOf,
|
|
349
|
-
STANDINGS,
|
|
350
|
-
standingOf,
|
|
351
|
-
isUsable,
|
|
352
|
-
usableLink,
|
|
353
|
-
KEYED,
|
|
354
|
-
notOverriddenSql,
|
|
355
|
-
usableLinkSql,
|
|
356
|
-
CRM_KINDS,
|
|
357
|
-
CRM_ACTIVITY_KINDS,
|
|
358
|
-
isCrmUserId,
|
|
359
|
-
normalCrmUserId,
|
|
360
|
-
isItemKind,
|
|
361
|
-
CATALOG_KINDS,
|
|
362
|
-
BUSINESS_KINDS,
|
|
363
|
-
CONTRACT_KINDS,
|
|
364
|
-
CONTRACT_STATUSES,
|
|
365
|
-
PERIOD_UNITS,
|
|
366
|
-
SUBSCRIPTION_STATUSES,
|
|
367
|
-
WALLET_KINDS,
|
|
368
|
-
TRANSACTION_STATUSES,
|
|
369
|
-
ORDER_DIRECTIONS,
|
|
370
|
-
intervalOf,
|
|
371
|
-
intervalText,
|
|
372
|
-
productLine,
|
|
373
|
-
contractLine,
|
|
374
|
-
subscriptionLine,
|
|
375
|
-
walletLine,
|
|
376
|
-
transactionLine
|
|
377
|
-
};
|