@wirecat/amo-cli 0.6.0 → 0.7.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 +17 -0
- package/README.md +2 -2
- package/contracts/wirecat.json +14 -0
- package/dist/amo/button.js +1 -1
- package/dist/amo/json.js +1 -1
- package/dist/amo/oauth.js +1 -2
- package/dist/amo/transport.js +1 -2
- package/dist/api-keys.js +1 -1
- package/dist/bin/amo.js +11 -11
- package/dist/bundle/amo.js +5 -183
- package/dist/bundle/{chunk-FYOPPKAN.js → chunk-3HWD4BKU.js} +4 -6
- package/dist/bundle/{chunk-GOCMJBEE.js → chunk-4EXURQQQ.js} +21 -19
- package/dist/bundle/chunk-AEWYRB6F.js +8 -0
- package/dist/bundle/{chunk-SWCJM3YD.js → chunk-GL7CRTHR.js} +3 -3
- package/dist/bundle/chunk-N2UB32VN.js +76 -0
- package/dist/bundle/{chunk-RNWUCAJJ.js → chunk-PVVSHDMQ.js} +7 -15
- package/dist/bundle/program-SQH3SPOW.js +2352 -0
- package/dist/bundle/{instructions-4H7UREH2.js → source-C65ZJUTW.js} +5 -6
- package/dist/bundle/store-SJ2TOUGU.js +12 -0
- package/dist/bundle/writer-I7GBI3VE.js +12 -0
- package/dist/commands/account.js +1 -1
- package/dist/commands/api.js +1 -3
- package/dist/commands/crm-shared.js +2 -3
- package/dist/commands/schedule.js +1 -1
- package/dist/commands/session.js +1 -3
- package/dist/commands/write.js +1 -2
- package/dist/config.js +1 -2
- package/dist/context.js +1 -2
- package/dist/crm/activities.js +1 -1
- package/dist/crm/records.js +1 -1
- package/dist/crm/source.js +1 -1
- package/dist/crm/writer.js +1 -1
- package/dist/identity.js +4 -0
- package/dist/program.js +1 -2
- package/dist/setup/flow.js +1 -1
- package/dist/store.js +1 -1
- package/dist/version.js +1 -1
- package/dist/whoami.js +1 -1
- package/package.json +3 -3
- package/scenarios/first-sync.md +13 -11
- package/scenarios/keep-in-sync.md +7 -6
- package/scenarios/safe-agent-writes.md +10 -9
- package/dist/amo/account.d.ts +0 -18
- package/dist/amo/account.d.ts.map +0 -1
- package/dist/amo/account.js.map +0 -1
- package/dist/amo/allow-list.d.ts +0 -31
- package/dist/amo/allow-list.d.ts.map +0 -1
- package/dist/amo/allow-list.js.map +0 -1
- package/dist/amo/button.d.ts +0 -53
- package/dist/amo/button.d.ts.map +0 -1
- package/dist/amo/button.js.map +0 -1
- package/dist/amo/errors.d.ts +0 -12
- package/dist/amo/errors.d.ts.map +0 -1
- package/dist/amo/errors.js.map +0 -1
- package/dist/amo/json.d.ts +0 -3
- package/dist/amo/json.d.ts.map +0 -1
- package/dist/amo/json.js.map +0 -1
- package/dist/amo/oauth.d.ts +0 -64
- package/dist/amo/oauth.d.ts.map +0 -1
- package/dist/amo/oauth.js.map +0 -1
- package/dist/amo/operation.d.ts +0 -45
- package/dist/amo/operation.d.ts.map +0 -1
- package/dist/amo/operation.js.map +0 -1
- package/dist/amo/operations.d.ts +0 -3
- package/dist/amo/operations.d.ts.map +0 -1
- package/dist/amo/operations.js.map +0 -1
- package/dist/amo/routes.d.ts +0 -67
- package/dist/amo/routes.d.ts.map +0 -1
- package/dist/amo/routes.js.map +0 -1
- package/dist/amo/transport.d.ts +0 -62
- package/dist/amo/transport.d.ts.map +0 -1
- package/dist/amo/transport.js.map +0 -1
- package/dist/api-keys.d.ts +0 -47
- package/dist/api-keys.d.ts.map +0 -1
- package/dist/api-keys.js.map +0 -1
- package/dist/bin/amo.d.ts +0 -3
- package/dist/bin/amo.d.ts.map +0 -1
- package/dist/bin/amo.js.map +0 -1
- package/dist/bundle/agent-VVACEKSX.js +0 -42
- package/dist/bundle/all-profiles-QNUKL4NA.js +0 -320
- package/dist/bundle/anthropic-PQN6MNP7.js +0 -90
- package/dist/bundle/app-server-Q2QEA7GP.js +0 -258
- package/dist/bundle/areas-27FRPBF3.js +0 -71
- package/dist/bundle/bun-F4M4KCNA.js +0 -169
- package/dist/bundle/bun-sqlite-P5IDBDVR.js +0 -75
- package/dist/bundle/chunk-22KAQPX7.js +0 -58
- package/dist/bundle/chunk-2JGNMZ55.js +0 -338
- package/dist/bundle/chunk-2VDHC7QO.js +0 -288
- package/dist/bundle/chunk-34ZOMVUK.js +0 -185
- package/dist/bundle/chunk-3J3EDSXF.js +0 -1939
- package/dist/bundle/chunk-3TYER5IK.js +0 -80
- package/dist/bundle/chunk-5NGLCDYQ.js +0 -106
- package/dist/bundle/chunk-5SQTHOBI.js +0 -12313
- package/dist/bundle/chunk-6GE36KUE.js +0 -360
- package/dist/bundle/chunk-6GZKY3HV.js +0 -3752
- package/dist/bundle/chunk-6OV2TRGF.js +0 -362
- package/dist/bundle/chunk-7CPIZFOE.js +0 -460
- package/dist/bundle/chunk-A5K2NU3K.js +0 -37780
- package/dist/bundle/chunk-ADLS6FVG.js +0 -24600
- package/dist/bundle/chunk-AEC4H5WZ.js +0 -259
- package/dist/bundle/chunk-APBEDWOE.js +0 -1718
- package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
- package/dist/bundle/chunk-B7L5MSRP.js +0 -136
- package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DIZEHPS6.js +0 -1347
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-DUPCDJ3W.js +0 -357
- package/dist/bundle/chunk-DWT24UVR.js +0 -388
- package/dist/bundle/chunk-DXWJORSY.js +0 -1703
- package/dist/bundle/chunk-DY3PLWIH.js +0 -332
- package/dist/bundle/chunk-DYWHAJRK.js +0 -1259
- package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
- package/dist/bundle/chunk-EXRM3ML4.js +0 -76
- package/dist/bundle/chunk-FFER7KJI.js +0 -407
- package/dist/bundle/chunk-FIP2DG7W.js +0 -64
- package/dist/bundle/chunk-FTH6WGYO.js +0 -24
- package/dist/bundle/chunk-FWRLGIF6.js +0 -5304
- package/dist/bundle/chunk-G3N2RHGF.js +0 -738
- package/dist/bundle/chunk-G46PNDWL.js +0 -58
- package/dist/bundle/chunk-G6NY7LFB.js +0 -230
- package/dist/bundle/chunk-GRGCZSES.js +0 -1007
- package/dist/bundle/chunk-GVSKLZRD.js +0 -30
- package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
- package/dist/bundle/chunk-HN2LCLGT.js +0 -1068
- package/dist/bundle/chunk-HO4JGD4Q.js +0 -16
- package/dist/bundle/chunk-HOF7GQWW.js +0 -142
- package/dist/bundle/chunk-HUAHLO6N.js +0 -29
- package/dist/bundle/chunk-IDCZ4LWS.js +0 -150
- package/dist/bundle/chunk-IN3VL7UU.js +0 -560
- package/dist/bundle/chunk-ISQ23VKV.js +0 -123
- package/dist/bundle/chunk-JVBCQHCS.js +0 -80
- package/dist/bundle/chunk-K5W7YEHB.js +0 -9541
- package/dist/bundle/chunk-KAFSS35C.js +0 -193
- package/dist/bundle/chunk-KLRCTMES.js +0 -100
- package/dist/bundle/chunk-KYRYD4CR.js +0 -38
- package/dist/bundle/chunk-LBZSURLL.js +0 -798
- package/dist/bundle/chunk-LC7ZD2RW.js +0 -92
- package/dist/bundle/chunk-LH6FJYMO.js +0 -334
- package/dist/bundle/chunk-LJKINNWC.js +0 -209
- package/dist/bundle/chunk-M36XP74N.js +0 -86
- package/dist/bundle/chunk-MNPGZCKE.js +0 -361
- package/dist/bundle/chunk-MRPMORLH.js +0 -353
- package/dist/bundle/chunk-NNREILWP.js +0 -189
- package/dist/bundle/chunk-NSOY4FMN.js +0 -159
- package/dist/bundle/chunk-OEEWVKJX.js +0 -53
- package/dist/bundle/chunk-OGJFDKDL.js +0 -161
- package/dist/bundle/chunk-PATZAYFZ.js +0 -453
- package/dist/bundle/chunk-PCR6GFNP.js +0 -1171
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-Q4MH2O5E.js +0 -108
- package/dist/bundle/chunk-QFOP3KUP.js +0 -2603
- package/dist/bundle/chunk-QQRJEWKB.js +0 -1197
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-SDVUGWD7.js +0 -614
- package/dist/bundle/chunk-SEFE6PGL.js +0 -218
- package/dist/bundle/chunk-SYRDEMQE.js +0 -68141
- package/dist/bundle/chunk-SYYQZDHJ.js +0 -95
- 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-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-U6XPWCWM.js +0 -133
- package/dist/bundle/chunk-UFKC7TIX.js +0 -28404
- package/dist/bundle/chunk-UNWF3TH5.js +0 -274
- package/dist/bundle/chunk-W3BOR6AT.js +0 -2333
- package/dist/bundle/chunk-WIHN3ELW.js +0 -2793
- package/dist/bundle/chunk-X76RS6JO.js +0 -1043
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YF3S26TS.js +0 -4172
- package/dist/bundle/chunk-ZCQ4H7CA.js +0 -54
- package/dist/bundle/chunk-ZOZV32IR.js +0 -170
- package/dist/bundle/chunk-ZTKHXDEU.js +0 -52
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/cli-EAD3WZLR.js +0 -1254
- package/dist/bundle/command-contract-SMEJ2ICG.js +0 -40
- package/dist/bundle/command-server-entry-YTZP6I4T.js +0 -169
- package/dist/bundle/decode-57BE5OBT.js +0 -296
- package/dist/bundle/dispatch-56FECRCU.js +0 -411
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/dist-T54K3FJV.js +0 -7577
- package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
- package/dist/bundle/embed-NFGFYUO4.js +0 -37
- package/dist/bundle/embedder-SRBOJMXX.js +0 -110
- package/dist/bundle/failure-WDSX6H3B.js +0 -24
- package/dist/bundle/first-run-HWRUL2GR.js +0 -28
- package/dist/bundle/first-screen-ATN4D3FQ.js +0 -41
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-BGDEHCWY.js +0 -26
- package/dist/bundle/meeting-model-WWGVRXPL.js +0 -24
- package/dist/bundle/meeting-semantic-ZQ47BL2Z.js +0 -21
- package/dist/bundle/node-P3PUHKYH.js +0 -176
- package/dist/bundle/node-P4E63KXA.js +0 -2340
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-JOTSNH3P.js +0 -73
- package/dist/bundle/oauth-XPSAL6VO.js +0 -19
- package/dist/bundle/open-PO52FVA5.js +0 -22
- package/dist/bundle/openai-WITYLMY5.js +0 -237
- package/dist/bundle/process-AFIXYXWL.js +0 -91
- package/dist/bundle/program-JODTZNBZ.js +0 -4920
- package/dist/bundle/prompt-XORLAXHY.js +0 -16
- package/dist/bundle/recognize-JKMZHDYS.js +0 -25
- package/dist/bundle/remote-3IMEJTEH.js +0 -30
- package/dist/bundle/rerank-3F2E6NNN.js +0 -51
- package/dist/bundle/serve-6BWU3NMB.js +0 -198
- package/dist/bundle/server-GPSB5WFG.js +0 -220
- package/dist/bundle/server-HMCC64ZU.js +0 -88
- package/dist/bundle/source-E72OS27D.js +0 -47
- package/dist/bundle/sqlite-runtime-YHYQDUXE.js +0 -19
- package/dist/bundle/state-R7W4U6T4.js +0 -35
- package/dist/bundle/store-HTVRL7FB.js +0 -312
- package/dist/bundle/store-IWW6U6QN.js +0 -34
- package/dist/bundle/store-TBZ3ZS6H.js +0 -186
- package/dist/bundle/store-maintenance-command-CJM2VLMW.js +0 -75
- package/dist/bundle/surface-5GBWNYBE.js +0 -74
- package/dist/bundle/writer-TW2Q55VJ.js +0 -49
- package/dist/commands/account.d.ts +0 -4
- package/dist/commands/account.d.ts.map +0 -1
- package/dist/commands/account.js.map +0 -1
- package/dist/commands/api.d.ts +0 -3
- package/dist/commands/api.d.ts.map +0 -1
- package/dist/commands/api.js.map +0 -1
- package/dist/commands/crm-shared.d.ts +0 -8
- package/dist/commands/crm-shared.d.ts.map +0 -1
- package/dist/commands/crm-shared.js.map +0 -1
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.d.ts.map +0 -1
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/session.d.ts +0 -35
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/write.d.ts +0 -14
- package/dist/commands/write.d.ts.map +0 -1
- package/dist/commands/write.js.map +0 -1
- package/dist/config.d.ts +0 -4
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context.d.ts +0 -62
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/crm/activities.d.ts +0 -32
- package/dist/crm/activities.d.ts.map +0 -1
- package/dist/crm/activities.js.map +0 -1
- package/dist/crm/records.d.ts +0 -20
- package/dist/crm/records.d.ts.map +0 -1
- package/dist/crm/records.js.map +0 -1
- package/dist/crm/source.d.ts +0 -41
- package/dist/crm/source.d.ts.map +0 -1
- package/dist/crm/source.js.map +0 -1
- package/dist/crm/writer.d.ts +0 -14
- package/dist/crm/writer.d.ts.map +0 -1
- package/dist/crm/writer.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/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.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/reasons.d.ts +0 -10
- package/dist/reasons.d.ts.map +0 -1
- package/dist/reasons.js.map +0 -1
- package/dist/setup/flow.d.ts +0 -2
- package/dist/setup/flow.d.ts.map +0 -1
- package/dist/setup/flow.js.map +0 -1
- package/dist/store.d.ts +0 -15
- 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
- package/dist/whoami.d.ts +0 -24
- package/dist/whoami.d.ts.map +0 -1
- package/dist/whoami.js.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
amoCrmSource
|
|
5
|
+
} from "./chunk-4EXURQQQ.js";
|
|
6
|
+
import "./chunk-3HWD4BKU.js";
|
|
7
|
+
import "./chunk-AEWYRB6F.js";
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
instructions
|
|
9
|
+
amoCrmSource
|
|
11
10
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
PROVIDER,
|
|
5
|
+
openAmoStore
|
|
6
|
+
} from "./chunk-GL7CRTHR.js";
|
|
7
|
+
import "./chunk-N2UB32VN.js";
|
|
8
|
+
import "./chunk-AEWYRB6F.js";
|
|
9
|
+
export {
|
|
10
|
+
PROVIDER,
|
|
11
|
+
openAmoStore
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
AMO_WRITES,
|
|
5
|
+
amoCrmWriter
|
|
6
|
+
} from "./chunk-PVVSHDMQ.js";
|
|
7
|
+
import "./chunk-3HWD4BKU.js";
|
|
8
|
+
import "./chunk-AEWYRB6F.js";
|
|
9
|
+
export {
|
|
10
|
+
AMO_WRITES,
|
|
11
|
+
amoCrmWriter
|
|
12
|
+
};
|
package/dist/commands/account.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProfileTokenStore, recalledAccount } from "@wirecat/cli-core
|
|
1
|
+
import { ProfileTokenStore, recalledAccount } from "@wirecat/cli-core";
|
|
2
2
|
import { decodeSignIn } from "../amo/account.js";
|
|
3
3
|
import { appStorage } from "../amo/oauth.js";
|
|
4
4
|
import { configuration } from "../config.js";
|
package/dist/commands/api.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { answerEntity, itemOf, LOCAL_READ, listOf, NO_EFFECTS, outputFor, parseApiJson, queryTerms, REMOTE_WRITE, renderAnswer, snakeKeys, termField, terminalAsker, withQuery, } from "@wirecat/cli-core
|
|
4
|
-
import { CRM_ASSIGN_OTHERS_KEY, refuseForeignClientReads, withoutFileLinks } from "@wirecat/cli-core/crm";
|
|
5
|
-
import { levelFor } from "@wirecat/cli-core/sends";
|
|
3
|
+
import { answerEntity, CRM_ASSIGN_OTHERS_KEY, itemOf, LOCAL_READ, levelFor, listOf, NO_EFFECTS, outputFor, parseApiJson, queryTerms, REMOTE_WRITE, refuseForeignClientReads, renderAnswer, snakeKeys, termField, terminalAsker, withoutFileLinks, withQuery, } from "@wirecat/cli-core";
|
|
6
4
|
import { Command } from "commander";
|
|
7
5
|
import * as v from "valibot";
|
|
8
6
|
import { matchOperation, OPERATIONS, pathOf, withEveryId } from "../amo/operation.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { outputFor } from "@wirecat/cli-core
|
|
2
|
-
import { addCrmCommands, openCrmStore } from "@wirecat/cli-core/crm/cli";
|
|
1
|
+
import { addCrmCommands, openCrmStore, outputFor } from "@wirecat/cli-core";
|
|
3
2
|
import { Command } from "commander";
|
|
4
3
|
import { crmApiKeys } from "../api-keys.js";
|
|
5
4
|
import { permissions } from "../config.js";
|
|
@@ -57,7 +56,7 @@ const openProfile = async (command, { readOnly }) => {
|
|
|
57
56
|
const amo = () => (transport ??= transportFor(command, signInOf(command)));
|
|
58
57
|
let source;
|
|
59
58
|
const asked = async () => {
|
|
60
|
-
const { crmSettingKey } = await import("@wirecat/cli-core
|
|
59
|
+
const { crmSettingKey } = await import("@wirecat/cli-core");
|
|
61
60
|
const scope = await store.crm.scope(account);
|
|
62
61
|
return {
|
|
63
62
|
mode: scope.mode,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { baseContext, scheduleCommandFor } from "@wirecat/cli-core
|
|
1
|
+
import { baseContext, scheduleCommandFor } from "@wirecat/cli-core";
|
|
2
2
|
import { configuration } from "../config.js";
|
|
3
3
|
import { IDENTITY } from "../identity.js";
|
|
4
4
|
const contextOf = (command, resolving) => {
|
package/dist/commands/session.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { CliError, monotonic, realSleep } from "@wirecat/cli-base";
|
|
2
2
|
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { readSecret } from "@wirecat/cli-core";
|
|
4
|
-
import { commandWords, environmentOf, FETCH, itemOf, LOCAL_READ, LOCAL_WRITE, listOf, logsInOrOut, openBrowser, outputFor, ProfileTokenStore, profileFree, profilesHere, REMOTE_READ, refuseCommandName, refuseOffline, refuseUnderReadOnly, rememberAccount, renderAnswer, rootOf, secretInputOf, signInSteps, storageOf, } from "@wirecat/cli-core/cli";
|
|
5
|
-
import { refuseTakenCrmAccount } from "@wirecat/cli-core/crm/cli";
|
|
3
|
+
import { commandWords, environmentOf, FETCH, itemOf, LOCAL_READ, LOCAL_WRITE, listOf, logsInOrOut, openBrowser, outputFor, ProfileTokenStore, profileFree, profilesHere, REMOTE_READ, readSecret, refuseCommandName, refuseOffline, refuseTakenCrmAccount, refuseUnderReadOnly, rememberAccount, renderAnswer, rootOf, secretInputOf, signInSteps, storageOf, } from "@wirecat/cli-core";
|
|
6
4
|
import { Command } from "commander";
|
|
7
5
|
import { accountOrigin, decodeSignIn, encodeSignIn } from "../amo/account.js";
|
|
8
6
|
import { browserSignIn, refuseKommo } from "../amo/button.js";
|
package/dist/commands/write.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
|
-
import { environmentOf, itemOf, outputFor, readOnlyLockOf, readOnlyRefusal, renderAnswer, terminalAsker, } from "@wirecat/cli-core
|
|
3
|
-
import { guardedWrite, guardFor, keyedGuard, levelFor, newOperationId } from "@wirecat/cli-core/sends";
|
|
2
|
+
import { environmentOf, guardedWrite, guardFor, itemOf, keyedGuard, levelFor, newOperationId, outputFor, readOnlyLockOf, readOnlyRefusal, renderAnswer, terminalAsker, } from "@wirecat/cli-core";
|
|
4
3
|
import { permissions } from "../config.js";
|
|
5
4
|
import { contextOf, signInOf, transportFor } from "../context.js";
|
|
6
5
|
import { IDENTITY } from "../identity.js";
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { commandPathKey, commandPermissions, plain, settingsFor } from "@wirecat/cli-core
|
|
2
|
-
import { CRM_WRITE_DEFAULTS, CRM_WRITE_KEYS, crmAlsoChecks } from "@wirecat/cli-core/crm";
|
|
1
|
+
import { CRM_WRITE_DEFAULTS, CRM_WRITE_KEYS, commandPathKey, commandPermissions, crmAlsoChecks, plain, settingsFor, } from "@wirecat/cli-core";
|
|
3
2
|
import * as v from "valibot";
|
|
4
3
|
import { accountOrigin } from "./amo/account.js";
|
|
5
4
|
import { API_DEFAULTS, API_KEYS, crmApiKeys } from "./api-keys.js";
|
package/dist/context.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
|
-
import { baseContext, environmentOf, ProfileTokenStore, refuseOffline, } from "@wirecat/cli-core
|
|
3
|
-
import { Pacer, pacePathFor } from "@wirecat/cli-core/sends";
|
|
2
|
+
import { baseContext, environmentOf, Pacer, ProfileTokenStore, pacePathFor, refuseOffline, } from "@wirecat/cli-core";
|
|
4
3
|
import { accountOrigin, decodeSignIn } from "./amo/account.js";
|
|
5
4
|
import { appAuthOf } from "./amo/oauth.js";
|
|
6
5
|
import { AmoTransport } from "./amo/transport.js";
|
package/dist/crm/activities.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isCliError } from "@wirecat/cli-base";
|
|
2
|
-
import { crmValues } from "@wirecat/cli-core
|
|
2
|
+
import { crmValues, } from "@wirecat/cli-core";
|
|
3
3
|
import { ROUTES } from "../amo/routes.js";
|
|
4
4
|
const { fieldOf, id, isRaw, text } = crmValues;
|
|
5
5
|
/** A row saved while the last round ran, or this computer's clock ahead of the account's, is read again. */
|
package/dist/crm/records.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { crmValues } from "@wirecat/cli-core
|
|
1
|
+
import { crmValues, } from "@wirecat/cli-core";
|
|
2
2
|
const { amountOf, epoch, fieldOf, id, isRaw, rawsOf, text } = crmValues;
|
|
3
3
|
/** Every pipeline has these two, whatever their names (leads_pipelines). */
|
|
4
4
|
export const WON = "142";
|
package/dist/crm/source.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
|
-
import { crmValues, } from "@wirecat/cli-core
|
|
2
|
+
import { crmValues, } from "@wirecat/cli-core";
|
|
3
3
|
import { matchOperation } from "../amo/operation.js";
|
|
4
4
|
import { ENTITIES, ROUTES } from "../amo/routes.js";
|
|
5
5
|
import { readActivities } from "./activities.js";
|
package/dist/crm/writer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
|
-
import { crmValues, fieldNamed, foldFieldName, optionOf, } from "@wirecat/cli-core
|
|
2
|
+
import { crmValues, fieldNamed, foldFieldName, optionOf, } from "@wirecat/cli-core";
|
|
3
3
|
import { ENTITIES } from "../amo/routes.js";
|
|
4
4
|
import { LOST, WON } from "./records.js";
|
|
5
5
|
/**
|
package/dist/identity.js
CHANGED
|
@@ -24,9 +24,13 @@ export const DESKTOP = {
|
|
|
24
24
|
userHosts: "the amoCRM or Kommo account you sign in to, such as example.amocrm.ru",
|
|
25
25
|
tagline: "amoCRM and Kommo CRM: deals, contacts and companies",
|
|
26
26
|
syncs: "your deals, contacts and companies",
|
|
27
|
+
mcpPort: 8761,
|
|
27
28
|
signIn: {
|
|
28
29
|
gives: "Lets your agent read and change the account's CRM with the rights of the administrator who made the token, or of the user who signed in through your own integration.",
|
|
29
30
|
asks: "The account's address and a long-lived token from a private integration's Keys and scopes tab, or that integration's ID and secret key.",
|
|
31
|
+
methods: [
|
|
32
|
+
{ id: "token", label: "Long-lived token", words: ["{profile}", "session", "start", "--json"], stdin: true },
|
|
33
|
+
],
|
|
30
34
|
},
|
|
31
35
|
};
|
|
32
36
|
export const SKILL = new URL("../skills/amo-cli/SKILL.md", import.meta.url);
|
package/dist/program.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { resolvePaths } from "@wirecat/cli-base";
|
|
4
|
-
import { appDoctorCommand, appMcpCommand, commandsCommand, configCommand, createProgram as createSharedProgram, guideCommand, outputFor, ProfileTokenStore, run as runShared, runsCommand, setupCommand, skillCommand, upgradeCommand, } from "@wirecat/cli-core
|
|
5
|
-
import { appUpdate } from "@wirecat/cli-core/update";
|
|
4
|
+
import { appDoctorCommand, appMcpCommand, appUpdate, commandsCommand, configCommand, createProgram as createSharedProgram, guideCommand, outputFor, ProfileTokenStore, run as runShared, runsCommand, setupCommand, skillCommand, upgradeCommand, } from "@wirecat/cli-core";
|
|
6
5
|
import { appSourceOf } from "./amo/oauth.js";
|
|
7
6
|
import { apiCommand } from "./commands/api.js";
|
|
8
7
|
import { crmSharedCommands } from "./commands/crm-shared.js";
|
package/dist/setup/flow.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
|
-
import { commandWords, defineSetup, refuseCommandName, refuseOffline, rootOf
|
|
2
|
+
import { commandWords, defineSetup, refuseCommandName, refuseOffline, rootOf } from "@wirecat/cli-core";
|
|
3
3
|
import { accountOrigin } from "../amo/account.js";
|
|
4
4
|
import { appStorage } from "../amo/oauth.js";
|
|
5
5
|
import { checkedToken, signInWithButton } from "../commands/session.js";
|
package/dist/store.js
CHANGED
|
@@ -10,7 +10,7 @@ export const PROVIDER = {
|
|
|
10
10
|
* open writes nothing, the entry included, and fails when the file is missing or needs a migration.
|
|
11
11
|
*/
|
|
12
12
|
export const openAmoStore = async (env, { readOnly = false } = {}) => {
|
|
13
|
-
const { openAppStore } = await import("@wirecat/cli-core
|
|
13
|
+
const { openAppStore } = await import("@wirecat/cli-core");
|
|
14
14
|
return openAppStore(env, { app: IDENTITY, provider: PROVIDER, readOnly });
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=store.js.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.7.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/whoami.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/amo-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Read and change an amoCRM or Kommo account's CRM — deals, contacts, companies — from the terminal, scripts and AI agents",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"docs:spell": "cspell lint --config cspell.json --no-progress --no-summary README.md SECURITY.md CHANGELOG.md AGENTS.md CLAUDE.md 'docs/*.md' 'skills/**/*.md'"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@wirecat/cli-base": "1.
|
|
65
|
-
"@wirecat/cli-core": "
|
|
64
|
+
"@wirecat/cli-base": "2.1.1",
|
|
65
|
+
"@wirecat/cli-core": "3.0.0",
|
|
66
66
|
"commander": "15.0.0",
|
|
67
67
|
"valibot": "1.5.0"
|
|
68
68
|
},
|
package/scenarios/first-sync.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
title: First sync and the pipeline board
|
|
3
3
|
goal: Copy your deals and their clients into the local store and see where each deal stands.
|
|
4
4
|
steps:
|
|
5
|
-
- run: amo setup
|
|
6
|
-
why: the account's address
|
|
7
|
-
- run: amo session status --check
|
|
8
|
-
why: the account and the user the
|
|
9
|
-
- run: amo sync
|
|
10
|
-
why: copies the pipelines, the deals assigned to you and only the contacts and companies on them
|
|
11
|
-
- run: amo pipelines show Sales
|
|
5
|
+
- run: amo work setup
|
|
6
|
+
why: the account's address, then one click in the browser for an amoCRM administrator, or the long-lived token from a private integration, saved only after the account answers
|
|
7
|
+
- run: amo work session status --check
|
|
8
|
+
why: the account and the user the sign-in acts as, and whether that user is an administrator
|
|
9
|
+
- run: amo work sync
|
|
10
|
+
why: copies the pipelines, the deals assigned to you and only the contacts and companies on them, and the next sync takes only the changes
|
|
11
|
+
- run: amo work pipelines show Sales
|
|
12
12
|
why: the pipeline as a board and a funnel, how many deals stand in each stage and how many reached it
|
|
13
|
-
- run: amo deals list status:open
|
|
13
|
+
- run: amo work deals list status:open
|
|
14
14
|
why: the open deals with stage, amount and owner, from the store, offline too
|
|
15
15
|
look:
|
|
16
16
|
- the user in session status, since a colleague's token copies their deals, not yours
|
|
@@ -18,6 +18,8 @@ look:
|
|
|
18
18
|
- the stage where most deals wait
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
`
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
The commands use `work` as the profile, the name you gave the account's sign-in. Put your own name in its place.
|
|
22
|
+
`Sales` stands for one of your pipelines, and `amo work pipelines list` names them. An administrator can copy
|
|
23
|
+
colleagues' deals too, by their user ids: `amo work users list`, then the `unassigned` setting on the settings page.
|
|
24
|
+
That list replaces your own, so include your own id. No setting copies the whole CRM, and any other client is read
|
|
25
|
+
live with `people` or `organizations`.
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
title: Keep the copy up to date
|
|
3
3
|
goal: Have the local store follow the account on its own, and search it beside your other WireCat tools.
|
|
4
4
|
steps:
|
|
5
|
-
- run: amo schedule command crm --every 1h -- sync
|
|
6
|
-
why: a timer on this computer that runs sync every hour
|
|
7
|
-
- run: amo schedule list
|
|
5
|
+
- run: amo work schedule command crm --every 1h -- sync
|
|
6
|
+
why: a timer on this computer that runs sync every hour and reads only what changed
|
|
7
|
+
- run: amo work schedule list
|
|
8
8
|
why: the schedule, when it runs next and how its last run went
|
|
9
|
-
- run: amo store status
|
|
9
|
+
- run: amo work store status
|
|
10
10
|
why: how far each kind's sync is, how many records are stored and when it last ran
|
|
11
|
-
- run: amo search all invoice
|
|
11
|
+
- run: amo work search all invoice
|
|
12
12
|
why: stored deals beside your messages, notes and meetings from other WireCat tools
|
|
13
13
|
look:
|
|
14
14
|
- a schedule whose last run failed
|
|
15
15
|
- a kind in store status that is partial, which the next sync goes on with
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
The commands use `work` as the profile, the name you gave the account's sign-in. Put your own name in its place.
|
|
19
|
+
`amo work sync --rescan` reads everything again, every id too, when the copy looks wrong.
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
title: Let an agent change the CRM without surprises
|
|
3
3
|
goal: Give an agent your CRM over MCP while the writes that reach clients or cannot be undone stay yours.
|
|
4
4
|
steps:
|
|
5
|
-
- run: amo config set permissions.deals.move readonly
|
|
6
|
-
why: a stage change can start the account's own automation, such as a Salesbot that writes to a client
|
|
7
|
-
- run: amo config set permissions.deals.close deny
|
|
5
|
+
- run: amo work config set permissions.deals.move readonly
|
|
6
|
+
why: a stage change can start the account's own automation, such as a Salesbot that writes to a client. Over MCP ask does not ask, so ask stops nothing there
|
|
7
|
+
- run: amo work config set permissions.deals.close deny
|
|
8
8
|
why: no agent marks a deal won or lost, whatever it is asked
|
|
9
|
-
- run: amo mcp add claude-code --permission people.update=deny --allow-writes
|
|
10
|
-
why: add this profile to Claude Code
|
|
11
|
-
- run: amo config show
|
|
9
|
+
- run: amo work mcp add claude-code --permission people.update=deny --allow-writes
|
|
10
|
+
why: add this profile to Claude Code. This server also refuses contact changes, and --allow-writes acknowledges the writes it still offers
|
|
11
|
+
- run: amo work config show
|
|
12
12
|
why: each permission with its level and where it came from
|
|
13
|
-
- run: amo runs list
|
|
13
|
+
- run: amo work runs list
|
|
14
14
|
why: what the agent ran, refused writes too
|
|
15
15
|
look:
|
|
16
16
|
- the levels of deals.move, deals.close and people.update in config show
|
|
17
17
|
- refused runs in runs list, and which command asked
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
The commands use `work` as the profile, the name you gave the account's sign-in. Put your own name in its place.
|
|
21
|
+
At a terminal `ask` still asks before the write. Over MCP nobody is there to answer, so a write at `ask` goes ahead.
|
|
22
|
+
Set `readonly` or `deny`, or turn on approval of `amo_write` in the agent client.
|
package/dist/amo/account.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Account hosts: `<subdomain>.amocrm.ru` (amoCRM), `<subdomain>.kommo.com` and the older `<subdomain>.amocrm.com`
|
|
3
|
-
* (Kommo), never the shared `www` (amocrm.ru developers "Рекомендации", developers.kommo.com "Limitations").
|
|
4
|
-
*/
|
|
5
|
-
export declare const ACCOUNT_DOMAINS: readonly ["amocrm.ru", "amocrm.com", "kommo.com"];
|
|
6
|
-
/** One account: the address the owner gave, kept exactly (amocrm.com is never turned into kommo.com), and its token. */
|
|
7
|
-
export interface AmoSignIn {
|
|
8
|
-
origin: string;
|
|
9
|
-
token: string;
|
|
10
|
-
/** The token's user, learnt at sign-in; absent for `AMO_TOKEN`. */
|
|
11
|
-
userId?: string;
|
|
12
|
-
}
|
|
13
|
-
/** `https://example.amocrm.ru`, `example.kommo.com/`: the account's origin, or a refusal that quotes nothing back. */
|
|
14
|
-
export declare const accountOrigin: (raw: string) => string;
|
|
15
|
-
/** The keyring holds the address beside the token, so one entry is the whole sign-in, as b24's webhook address is. */
|
|
16
|
-
export declare const encodeSignIn: (signIn: AmoSignIn) => string;
|
|
17
|
-
export declare const decodeSignIn: (secret: string) => AmoSignIn;
|
|
18
|
-
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/amo/account.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,eAAe,YAAI,WAAW,EAAE,YAAY,EAAE,WAAW,CAAU,CAAA;AAMhF,wHAAwH;AACxH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,sHAAsH;AACtH,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,MAmB3C,CAAA;AAED,sHAAsH;AACtH,eAAO,MAAM,YAAY,WAAY,SAAS,KAAG,MAAgC,CAAA;AAEjF,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,SAoB7C,CAAA"}
|
package/dist/amo/account.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/amo/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC;;;GAGG;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M,OAAO,CAAC,+BAA+B,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACzG,OAAO,GAAG,CAAC,MAAM,CAAA;AACnB,CAAC,CAAA;AAED,sHAAsH;AACtH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAiB,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;AAEjF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAa,EAAE;IACxD,IAAI,KAAc,CAAA;IAClB,IAAI,CAAC;QACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,KAAK,GAAG,SAAS,CAAA;IACnB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QACzF,MAAM,IAAI,QAAQ,CAChB,qBAAqB,EACrB,0EAA0E,EAC1E;YACE,MAAM,EAAE,mBAAmB;SAC5B,CACF,CAAA;IACH,OAAO;QACL,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;QACnC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,CAAC,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtE,CAAA;AACH,CAAC,CAAA"}
|
package/dist/amo/allow-list.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { SchemaNode } from "@wirecat/cli-base/codegen/runtime";
|
|
2
|
-
import type { SpecOperation } from "./operation.js";
|
|
3
|
-
/** The record types `{entity_type}` and `{entity}` take where the spec gives no enum. */
|
|
4
|
-
export declare const ENTITY_TYPES: {
|
|
5
|
-
readonly values: readonly ["leads", "contacts", "companies", "customers"];
|
|
6
|
-
readonly sources: readonly ["https://www.amocrm.ru/developers/content/crm_platform/entity-links-api", "https://www.amocrm.ru/developers/content/crm_platform/custom-fields", "https://www.amocrm.ru/developers/content/crm_platform/tags-api", "https://www.amocrm.ru/developers/content/crm_platform/events-and-notes"];
|
|
7
|
-
};
|
|
8
|
-
/** Routes with no page in the Kommo reference. */
|
|
9
|
-
export declare const EXTRA_OPERATIONS: readonly SpecOperation[];
|
|
10
|
-
/** The `with` values each list or record takes; the spec types `with` as free text and names them only in prose. */
|
|
11
|
-
export declare const WITH_VALUES: Readonly<Record<string, {
|
|
12
|
-
values: readonly string[];
|
|
13
|
-
source: string;
|
|
14
|
-
}>>;
|
|
15
|
-
/** The largest `limit` a list takes: 250 on every list page, events 100 in the ru docs (Kommo says 250). */
|
|
16
|
-
export declare const LIMITS: {
|
|
17
|
-
readonly default: 250;
|
|
18
|
-
readonly byPath: Readonly<Record<string, number>>;
|
|
19
|
-
readonly sources: readonly ["https://www.amocrm.ru/developers/content/crm_platform/leads-api", "https://www.amocrm.ru/developers/content/crm_platform/events-and-notes"];
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Body fields the merged spec types wrongly, by name at any depth of any body: right for `custom_fields_values`, which
|
|
23
|
-
* means the same everywhere. Every write page types
|
|
24
|
-
* `custom_fields_values` as a string; the custom-fields page sends an array of `field_id` or `field_code` with
|
|
25
|
-
* `values`, each a `value`, `enum_id` or `enum_code`.
|
|
26
|
-
*/
|
|
27
|
-
export declare const BODY_FIELDS: Readonly<Record<string, {
|
|
28
|
-
schema: SchemaNode;
|
|
29
|
-
source: string;
|
|
30
|
-
}>>;
|
|
31
|
-
//# sourceMappingURL=allow-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"allow-list.d.ts","sourceRoot":"","sources":["../../src/amo/allow-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,E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AG;IACZ,MAAM,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAsC;IACrE,OAAO,EAAE;QACP,iEAAiE;QACjE,wEAAwE;KACzE;CACO,CAAA;AAEV,MAAM,aAAa,GAAG,qEAAqE,CAAA;AAE3F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAqE;IAC3F,oBAAoB,EAAE;QACpB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,UAAU,EAAE;oBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAC7B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC9B,MAAM,EAAE;wBACN,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,EAAE;4BACZ,UAAU,EAAE;gCACV,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gCAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gCAC5B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;6BAC9B;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAA"}
|
package/dist/amo/button.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { type KeyringStore, type SleepLike } from "@wirecat/cli-base";
|
|
2
|
-
import { type OAuthClient } from "@wirecat/cli-core/oauth";
|
|
3
|
-
import { type AppAuth } from "./oauth.js";
|
|
4
|
-
export declare const CONNECT_VARIABLE: string;
|
|
5
|
-
/** The button page and the claim endpoint; a test moves both to one fake origin, keeping their paths. */
|
|
6
|
-
export declare const connectUrls: (env: NodeJS.ProcessEnv) => {
|
|
7
|
-
page: string;
|
|
8
|
-
claim: string;
|
|
9
|
-
};
|
|
10
|
-
/** Kommo's button is not checked yet, so a guess could create an integration amo then cannot finish. */
|
|
11
|
-
export declare const refuseKommo: (origin: string) => void;
|
|
12
|
-
export interface BrowserSteps {
|
|
13
|
-
openBrowser: (url: string) => Promise<void>;
|
|
14
|
-
showUrl: (url: string) => void;
|
|
15
|
-
readPaste?: (signal: AbortSignal) => Promise<string>;
|
|
16
|
-
}
|
|
17
|
-
interface ClaimOptions {
|
|
18
|
-
claim: string;
|
|
19
|
-
state: string;
|
|
20
|
-
fetch?: typeof fetch | undefined;
|
|
21
|
-
sleep: SleepLike;
|
|
22
|
-
now: () => number;
|
|
23
|
-
signal?: AbortSignal | undefined;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The keys amoCRM posted to the claim server for this `state`, read once. A 404 `not_ready` means the webhook has not come
|
|
27
|
-
* yet. No failure quotes the answer: a body may hold the secret.
|
|
28
|
-
*/
|
|
29
|
-
export declare const claimKeys: (options: ClaimOptions) => Promise<OAuthClient>;
|
|
30
|
-
export interface BrowserSignInOptions<T> {
|
|
31
|
-
env: NodeJS.ProcessEnv;
|
|
32
|
-
profile: string;
|
|
33
|
-
origin: string;
|
|
34
|
-
storage: "keyring" | "file";
|
|
35
|
-
keyring?: KeyringStore | undefined;
|
|
36
|
-
fetch?: typeof fetch | undefined;
|
|
37
|
-
sleep: SleepLike;
|
|
38
|
-
now: () => number;
|
|
39
|
-
signal?: AbortSignal | undefined;
|
|
40
|
-
steps: BrowserSteps;
|
|
41
|
-
/** Whose rights the new tokens carry, asked of the account before anything is kept. */
|
|
42
|
-
check: (auth: AppAuth) => Promise<T>;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* amoCRM's button on the connect page creates an integration in the account the person picks and posts its keys to
|
|
46
|
-
* the claim server; amo claims them once, exchanges the code on the account `--host` names and keeps it all as a
|
|
47
|
-
* `--client-id` sign-in, marked so a failed renewal names this command.
|
|
48
|
-
*/
|
|
49
|
-
export declare const browserSignIn: <T extends {
|
|
50
|
-
id: string;
|
|
51
|
-
}>(options: BrowserSignInOptions<T>) => Promise<T>;
|
|
52
|
-
export {};
|
|
53
|
-
//# sourceMappingURL=button.d.ts.map
|
package/dist/amo/button.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/amo/button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE3F,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,yBAAyB,CAAA;AAGvE,OAAO,EACL,KAAK,OAAO,EAQb,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,gBAAgB,QAAsC,CAAA;AASnE,yGAAyG;AACzG,eAAO,MAAM,WAAW,QAAS,MAAM,CAAC,UAAU,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAoBjF,CAAA;AAED,wGAAwG;AACxG,eAAO,MAAM,WAAW,WAAY,MAAM,SAQzC,CAAA;AAQD,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACrD;AAoGD,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAA;IAChC,KAAK,EAAE,SAAS,CAAA;IAChB,GAAG,EAAE,MAAM,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;CACjC;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,YAAmB,YAAY,KAAG,OAAO,CAAC,WAAW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KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EACnE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CACvG,CAAA;IACD,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,QAAQ,CAAC,sBAAsB,EAAE,mCAAmC,CAAC,CAAA;IAC5F,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,CAAA;IACvC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,CAAA;IACzF,yGAAyG;IACzG,OAAO,CAAC,MAAM,EAAE,CAAA;IAChB,MAAM,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;QAC3G,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,IAAI,CAAC,EAAE;QACf,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,IAAI;KACd,CAAC,CAAA;IACF,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
package/dist/amo/errors.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CliError } from "@wirecat/cli-base";
|
|
2
|
-
export declare const isBlock: (operation: string, body: unknown, json: boolean) => boolean;
|
|
3
|
-
export interface Refusal {
|
|
4
|
-
/** Whether the answer was JSON at all: a block's 403 is a bare page. */
|
|
5
|
-
json: boolean;
|
|
6
|
-
waitMs?: number | undefined;
|
|
7
|
-
/** An OAuth access token, which a refresh renews; a long-lived token has nothing to refresh it with. */
|
|
8
|
-
oauth?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/** amoCRM's refusal as a stable code and reason a script branches on; the message never repeats amoCRM's text. */
|
|
11
|
-
export declare const amoError: (operation: string, status: number, body: unknown, { json, waitMs, oauth }: Refusal) => CliError;
|
|
12
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/amo/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/amo/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,mBAAmB,CAAA;AA2ClF,eAAO,MAAM,OAAO,cAAe,MAAM,QAAQ,OAAO,QAAQ,OAAO,KAAG,OACH,CAAA;AAEvE,MAAM,WAAW,OAAO;IACtB,wEAAwE;IACxE,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,wGAAwG;IACxG,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,kHAAkH;AAClH,eAAO,MAAM,QAAQ,cACR,MAAM,UACT,MAAM,QACR,OAAO,2BACoB,OAAO,KACvC,QAoDF,CAAA"}
|
package/dist/amo/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/amo/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,mBAAmB,CAAA;AAClF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC;;;;;;;;;;GAUG;AAEH,0GAA0G;AAC1G,MAAM,YAAY,GAAG,KAAK,CAAA;AAE1B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AAEzC,iGAAiG;AAC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AAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EACnF,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9F,CAAA;IACH,CAAC;IACD,IAAI,MAAM,IAAI,GAAG;QACf,OAAO,EAAE,CAAC,sBAAsB,EAAE,oBAAoB,SAAS,UAAU,MAAM,GAAG,EAAE;YAClF,SAAS,EAAE,eAAe,CAAC,MAAM,CAAC;SACnC,CAAC,CAAA;IACJ,OAAO,EAAE,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,kBAAkB,SAAS,UAAU,MAAM,GAAG,CAAC,CAAA;AACpH,CAAC,CAAA"}
|
package/dist/amo/json.d.ts
DELETED
package/dist/amo/json.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/amo/json.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE1C,eAAO,MAAM,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,IAAsB,CAAA"}
|
package/dist/amo/json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/amo/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAIjD,MAAM,CAAC,MAAM,QAAQ,GAAsC,SAAS,CAAC,KAAK,CAAA"}
|
package/dist/amo/oauth.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { type CredentialStorage, type KeyringStore } from "@wirecat/cli-base";
|
|
2
|
-
import { type OAuthClient, type OAuthProvider, type SignInOptions as SignInSteps, type TokenCodec, type TokenStorage } from "@wirecat/cli-core/oauth";
|
|
3
|
-
export declare const PROVIDER = "amocrm";
|
|
4
|
-
/**
|
|
5
|
-
* The Redirect URI of an integration the owner creates for `--client-id`, which amoCRM sends the browser to with
|
|
6
|
-
* `code` and `state` (amocrm.ru developers oauth/step-by-step). The static page forwards any `code` and `state` to the
|
|
7
|
-
* waiting local port (cli-docs public/webhooks/apps/amo-callback.html).
|
|
8
|
-
*/
|
|
9
|
-
export declare const RELAY_URL = "https://wirecat.dev/webhooks/apps/amo-callback";
|
|
10
|
-
/** The Redirect URI amoCRM's button gives the integration it creates; the same page as RELAY_URL, on that server. */
|
|
11
|
-
export declare const BUTTON_RELAY_URL = "https://connect.wirecat.dev/webhooks/apps/amo-callback";
|
|
12
|
-
/** The page with amoCRM's button, which reads `state` from the fragment (cli-docs services/amo-connect). */
|
|
13
|
-
export declare const CONNECT_PAGE_URL = "https://connect.wirecat.dev/connect/amo.html";
|
|
14
|
-
/** Hands over once the keys amoCRM posted for a `state`. */
|
|
15
|
-
export declare const CLAIM_URL = "https://connect.wirecat.dev/api/amo/claim";
|
|
16
|
-
/** A sign-in through the owner's own integration: the account, the user whose rights it carries, and the token. */
|
|
17
|
-
export interface AppAuth {
|
|
18
|
-
origin: string;
|
|
19
|
-
userId: string;
|
|
20
|
-
accessToken: (refresh: boolean) => Promise<string>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* cli-core's account-bound entry, plus the Redirect URI it was signed in with: every refresh sends the same one, and
|
|
24
|
-
* amoCRM refuses one that differs from the integration's setting (oauth/step-by-step).
|
|
25
|
-
*/
|
|
26
|
-
export declare const appCodec: TokenCodec;
|
|
27
|
-
/** The folder cli-core's sign-in lock lives in, beside the config. */
|
|
28
|
-
export declare const lockDirOf: (env: NodeJS.ProcessEnv) => string;
|
|
29
|
-
/** The same service, folder and moved-run rule as the long-lived token's `ProfileTokenStore`, under `oauth:amocrm:<profile>`. */
|
|
30
|
-
export declare const appStorage: (env: NodeJS.ProcessEnv, profile: string, keyring?: KeyringStore, storage?: CredentialStorage) => TokenStorage;
|
|
31
|
-
/** Where the integration's sign-in is kept, `keyring` or `file`, and never what. */
|
|
32
|
-
export declare const appSourceOf: (env: NodeJS.ProcessEnv, profile: string, keyring?: KeyringStore) => import("@wirecat/cli-base").CredentialSource | undefined;
|
|
33
|
-
export declare const appProvider: (origin: string, client: OAuthClient, redirectUri?: string) => OAuthProvider;
|
|
34
|
-
export declare const fetchFor: (origin: string, given?: typeof fetch) => import("@wirecat/cli-base/http").FetchLike;
|
|
35
|
-
export interface AppSignInOptions<T> {
|
|
36
|
-
env: NodeJS.ProcessEnv;
|
|
37
|
-
profile: string;
|
|
38
|
-
origin: string;
|
|
39
|
-
client: OAuthClient;
|
|
40
|
-
storage: "keyring" | "file";
|
|
41
|
-
keyring?: KeyringStore | undefined;
|
|
42
|
-
fetch?: typeof fetch | undefined;
|
|
43
|
-
signal?: AbortSignal | undefined;
|
|
44
|
-
signInCommand: string;
|
|
45
|
-
steps: Omit<SignInSteps, "scopes" | "accept">;
|
|
46
|
-
/** Whose rights the new tokens carry, asked of the account before anything is kept. */
|
|
47
|
-
check: (auth: AppAuth) => Promise<T>;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* The integration's sign-in: authorize in the browser, exchange the code on the account the owner named, ask that
|
|
51
|
-
* account who it is, then keep it. A code from another account fails there, before anything is saved.
|
|
52
|
-
*/
|
|
53
|
-
export declare const appSignIn: <T extends {
|
|
54
|
-
id: string;
|
|
55
|
-
}>(options: AppSignInOptions<T>) => Promise<T>;
|
|
56
|
-
/** The profile's integration sign-in, refreshed under cli-core's shared lock; none when the profile has none. */
|
|
57
|
-
export declare const appAuthOf: (options: {
|
|
58
|
-
env: NodeJS.ProcessEnv;
|
|
59
|
-
profile: string;
|
|
60
|
-
keyring?: KeyringStore | undefined;
|
|
61
|
-
fetch?: typeof fetch | undefined;
|
|
62
|
-
signal?: AbortSignal | undefined;
|
|
63
|
-
}) => AppAuth | undefined;
|
|
64
|
-
//# sourceMappingURL=oauth.d.ts.map
|