deepline 0.3.563 → 0.3.565
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client-core.ts +51 -0
- package/dist/bundling-sources/sdk/src/connector-sync.ts +241 -0
- package/dist/bundling-sources/sdk/src/index.ts +10 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +7 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +8 -0
- package/dist/cli/auth-AN2KCWG2.js +44 -0
- package/dist/cli/{auth-3YES4ACM.mjs → auth-YKIUCQ2Q.mjs} +5 -5
- package/dist/cli/{billing-NZ2NCOQS.mjs → billing-HK23QHAA.mjs} +9 -9
- package/dist/cli/{billing-L2GDKBXK.js → billing-NIGAUQJF.js} +102 -102
- package/dist/cli/{chunk-UMJWODG7.mjs → chunk-2US3VJXX.mjs} +1 -1
- package/dist/cli/{chunk-HST5XA3B.mjs → chunk-4ENCU2BI.mjs} +2 -2
- package/dist/cli/{chunk-T2RNEBV7.js → chunk-4VKDPTHF.js} +4 -4
- package/dist/cli/{chunk-TX5PQ7KP.js → chunk-5HV2CNXA.js} +10 -10
- package/dist/cli/{chunk-V4KKZGLT.js → chunk-6HCJQ23O.js} +23 -23
- package/dist/cli/{chunk-JVXHVEWX.mjs → chunk-A3EI3A3Q.mjs} +5 -5
- package/dist/cli/{chunk-YDXFVE4V.mjs → chunk-AAOXS3XM.mjs} +152 -2
- package/dist/cli/{chunk-L5QJRMFJ.mjs → chunk-AH2CBDQJ.mjs} +2 -2
- package/dist/cli/{chunk-NCGDBNNF.mjs → chunk-B2FQZ7P4.mjs} +2 -2
- package/dist/cli/{chunk-QGIHGITM.js → chunk-B4FBMREO.js} +3 -3
- package/dist/cli/{chunk-UUEVGLGO.mjs → chunk-BCEXSQPK.mjs} +1 -1
- package/dist/cli/{chunk-VYY6HNOC.js → chunk-BDNVUPDX.js} +2 -2
- package/dist/cli/{search-output-FRRT574G.js → chunk-C5IA2OYE.js} +2 -199
- package/dist/cli/{chunk-K77ANXGU.js → chunk-E73BRM5N.js} +13 -13
- package/dist/cli/{chunk-MGOCWY7J.js → chunk-EPQIA32E.js} +100 -100
- package/dist/cli/{chunk-XWGWVLQQ.mjs → chunk-EXOC3TLA.mjs} +4 -4
- package/dist/cli/{chunk-BP2XRVBA.mjs → chunk-F4ZLUDKW.mjs} +5 -5
- package/dist/cli/{chunk-QOLFZD6Q.js → chunk-FEWBYUUF.js} +2 -2
- package/dist/cli/{chunk-ERT4ZMZT.js → chunk-FWH6QYTE.js} +5 -5
- package/dist/cli/{chunk-LIO7CPM3.js → chunk-FXRSHBRP.js} +159 -9
- package/dist/cli/{chunk-DA24O3ZV.js → chunk-GE62FFN6.js} +3 -3
- package/dist/cli/{chunk-RP2LCS7G.mjs → chunk-GTX2RMQG.mjs} +11 -11
- package/dist/cli/{chunk-G5CY6KI2.js → chunk-H3NH5RJ6.js} +41 -41
- package/dist/cli/{chunk-AYNDNXBJ.mjs → chunk-H4LHB6ES.mjs} +1 -1
- package/dist/cli/{chunk-XTSQ3ZV5.mjs → chunk-IFZA4IGI.mjs} +2 -2
- package/dist/cli/{chunk-NTRTFEI4.js → chunk-IKA37N6Y.js} +26 -26
- package/dist/cli/{chunk-U77PK5R3.js → chunk-J5QAOURJ.js} +20 -20
- package/dist/cli/{chunk-GVRVZQBY.mjs → chunk-JLXLCD6F.mjs} +2 -2
- package/dist/cli/{chunk-O3NLECXL.mjs → chunk-K6RPKBD7.mjs} +1 -1
- package/dist/cli/{chunk-VACBPVIR.mjs → chunk-KOMEYB7H.mjs} +104 -0
- package/dist/cli/{chunk-2MAP42AM.mjs → chunk-LHL6VWJE.mjs} +1 -1
- package/dist/cli/{chunk-XDZZCRUG.mjs → chunk-LKVWMLWI.mjs} +1 -1
- package/dist/cli/{chunk-K5FNC4VL.mjs → chunk-LOV5JGWO.mjs} +2 -2
- package/dist/cli/{search-output-O7FYSGYQ.mjs → chunk-MI5Q5FOD.mjs} +1 -198
- package/dist/cli/{chunk-IICHFEFE.js → chunk-NH3LVGVR.js} +5 -5
- package/dist/cli/{chunk-ZX3UZCWC.mjs → chunk-NOSGGCJ3.mjs} +1 -1
- package/dist/cli/{chunk-5CNHEUGJ.js → chunk-OEVCKW2M.js} +104 -0
- package/dist/cli/{chunk-SJ2LY4V5.js → chunk-OIDETCX2.js} +20 -20
- package/dist/cli/{chunk-H3UIWEXF.js → chunk-P6BVT2OW.js} +2 -2
- package/dist/cli/{chunk-QGNITJYC.js → chunk-PQEWFVJ3.js} +15 -15
- package/dist/cli/{chunk-L5O7MWRZ.mjs → chunk-RULYYQB4.mjs} +5 -5
- package/dist/cli/{chunk-6LPMQPSQ.mjs → chunk-SEWLXJHM.mjs} +2 -2
- package/dist/cli/{chunk-2UW5A57I.js → chunk-SL3IRGAW.js} +9 -9
- package/dist/cli/{chunk-FCRBXLIJ.js → chunk-TCJZQRX6.js} +12 -12
- package/dist/cli/{chunk-POGS26GF.mjs → chunk-U7F4ODVQ.mjs} +1 -1
- package/dist/cli/{chunk-6UHRBEDV.mjs → chunk-UTQ6LQWG.mjs} +3 -3
- package/dist/cli/{chunk-NS56OQUQ.js → chunk-UWMK5DLS.js} +1 -1
- package/dist/cli/{chunk-6U7CIG3C.mjs → chunk-V2TC2ARE.mjs} +4 -4
- package/dist/cli/{chunk-OZC6SSOB.js → chunk-WPVJV23H.js} +7 -7
- package/dist/cli/{chunk-DVWFK676.js → chunk-XNOUOO6G.js} +6 -6
- package/dist/cli/{chunk-XY5DE4TK.mjs → chunk-YD5BBYS2.mjs} +5 -5
- package/dist/cli/{chunk-H2N324LF.mjs → chunk-YGVLCJNY.mjs} +3 -3
- package/dist/cli/{chunk-DFCBNTVQ.mjs → chunk-YIKEVZUQ.mjs} +2 -2
- package/dist/cli/{chunk-4MPLA5RD.js → chunk-ZEKRYFMN.js} +48 -48
- package/dist/cli/{chunk-CH7OVBBJ.js → chunk-ZIKVPGYC.js} +5 -5
- package/dist/cli/{chunk-4KHRPJOW.js → chunk-ZTHMJ4SK.js} +53 -53
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/concurrent-runs-help-SKAAESKY.js +22 -0
- package/dist/cli/{concurrent-runs-help-VEZX3RK4.mjs → concurrent-runs-help-WD2EUKO7.mjs} +6 -6
- package/dist/cli/{csv-RJBNLD23.mjs → csv-RM3FOTS5.mjs} +4 -4
- package/dist/cli/{csv-W5C4JCYL.js → csv-UI63ZOMD.js} +13 -13
- package/dist/cli/{db-VVGP2KCM.mjs → db-RIJBJCT7.mjs} +6 -6
- package/dist/cli/{db-GYCRUH4V.js → db-V5SWE3WN.js} +27 -27
- package/dist/cli/{describe-HZW272Y6.mjs → describe-HZC4GOLO.mjs} +18 -18
- package/dist/cli/describe-RRWLYUQS.js +50 -0
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-D37NX6CD.js → executions-2Q23JJSI.js} +8 -8
- package/dist/cli/{executions-N4ZA4ZD5.mjs → executions-XRH267DY.mjs} +6 -6
- package/dist/cli/{feedback-W6CY6UBA.js → feedback-BEHH4KGB.js} +14 -14
- package/dist/cli/{feedback-4PB4ACBV.mjs → feedback-Y5MWMTQ2.mjs} +6 -6
- package/dist/cli/{git-WHIEYIVM.mjs → git-644DZQKA.mjs} +5 -5
- package/dist/cli/git-OEHB7UQH.js +26 -0
- package/dist/cli/index.js +147 -147
- package/dist/cli/index.mjs +46 -46
- package/dist/cli/integrations-ILXWYGTO.js +284 -0
- package/dist/cli/integrations-PMXZ7V6Y.mjs +284 -0
- package/dist/cli/{legacy-noops-PJNDUOWG.js → legacy-noops-USLUHQWW.js} +9 -9
- package/dist/cli/{legacy-noops-YYX2W2WX.mjs → legacy-noops-YUG2HVGQ.mjs} +6 -6
- package/dist/cli/{mcp-APKPI24N.js → mcp-DFLBEEWG.js} +24 -24
- package/dist/cli/{mcp-T32DPP4D.mjs → mcp-X63UPZS7.mjs} +4 -4
- package/dist/cli/{monitors-BY4DJFCF.js → monitors-POG6YUZ4.js} +100 -100
- package/dist/cli/{monitors-DTJD3IUI.mjs → monitors-QGI7QH4K.mjs} +7 -7
- package/dist/cli/{org-2GMHKAQK.js → org-E3NIDN32.js} +121 -121
- package/dist/cli/{org-GQYIJBKO.mjs → org-VAJL4BCS.mjs} +6 -6
- package/dist/cli/{outcomes-3ASEQLIF.mjs → outcomes-FOE35FHM.mjs} +6 -6
- package/dist/cli/{outcomes-4XY4F57P.js → outcomes-SCQFFBXS.js} +14 -14
- package/dist/cli/{play-EX7PB6CI.mjs → play-7N4Z2LEH.mjs} +19 -19
- package/dist/cli/{play-2LDJMIG2.js → play-BGK7PDXO.js} +324 -324
- package/dist/cli/{providers-GAERKWYW.mjs → providers-KDI3B22S.mjs} +6 -6
- package/dist/cli/{providers-IDIFP5PU.js → providers-OK2ES375.js} +9 -9
- package/dist/cli/{quickstart-7NL5YAJF.js → quickstart-HOHFIFVW.js} +6 -6
- package/dist/cli/{quickstart-E2GCIGR4.mjs → quickstart-LHJF7YCP.mjs} +4 -4
- package/dist/cli/{run-2EPOAEJ5.mjs → run-BQIDPU5J.mjs} +23 -23
- package/dist/cli/{run-3CEY5JF3.js → run-K45RGJP4.js} +44 -44
- package/dist/cli/{search-TYRKGVKB.mjs → search-PD3OAWO3.mjs} +7 -7
- package/dist/cli/search-QCFLRPCX.js +32 -0
- package/dist/cli/search-output-FVT2FPUN.mjs +205 -0
- package/dist/cli/search-output-P2JVWNCK.js +205 -0
- package/dist/cli/{secrets-5YL7RU2B.mjs → secrets-4MCBJUGL.mjs} +6 -6
- package/dist/cli/{secrets-5W2ZF2JB.js → secrets-LDCXYN33.js} +15 -15
- package/dist/cli/{sessions-VWENSY3G.mjs → sessions-36VI33IL.mjs} +6 -6
- package/dist/cli/sessions-WTQ6QNAU.js +23 -0
- package/dist/cli/{settings-JQOMJTOC.js → settings-3J4FUQPF.js} +85 -85
- package/dist/cli/{settings-W6FCYDJC.mjs → settings-D6L7S4ZC.mjs} +12 -12
- package/dist/cli/{setup-DJIVQUBT.js → setup-L6VH3OR4.js} +49 -49
- package/dist/cli/{setup-3JUQWZTS.mjs → setup-PBQ773AV.mjs} +9 -9
- package/dist/cli/skills-PENWR7KI.js +37 -0
- package/dist/cli/{skills-7JTWCFL3.mjs → skills-ZRTREJY2.mjs} +7 -7
- package/dist/cli/{tools-DRR3KDV2.mjs → tools-OAHCQUQB.mjs} +17 -17
- package/dist/cli/tools-TIN7MRLX.js +57 -0
- package/dist/cli/update-4TIZS6WV.js +37 -0
- package/dist/cli/{update-KL43AZPW.mjs → update-ZM4LSW5L.mjs} +9 -9
- package/dist/cli/{views-HX4GM53H.js → views-F4MEME43.js} +21 -21
- package/dist/cli/{views-FFTXTJ7U.mjs → views-W6PVUSE3.mjs} +6 -6
- package/dist/cli/{workflow-R2K6CH2X.js → workflow-37V7F5I4.js} +17 -17
- package/dist/cli/{workflow-QO7BRZLM.mjs → workflow-7E2QYAIY.mjs} +7 -7
- package/dist/{client-CnphYDTe.d.mts → client-B5cSKEi4.d.mts} +1 -1
- package/dist/{client-core-DQOTt3yV.d.mts → client-core-BP19BoBb.d.mts} +107 -2
- package/dist/{client-core-Yad6-K7-.d.ts → client-core-Deqov12F.d.ts} +107 -2
- package/dist/{client-BSxuaObS.d.ts → client-vUZGmXT9.d.ts} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +121 -118
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-UC22BJN2.js +0 -44
- package/dist/cli/concurrent-runs-help-NMNGH7QN.js +0 -22
- package/dist/cli/describe-HJ564FPP.js +0 -50
- package/dist/cli/git-LMRN2YR5.js +0 -26
- package/dist/cli/integrations-ASNRHKLO.mjs +0 -129
- package/dist/cli/integrations-HXY5DR6D.js +0 -129
- package/dist/cli/search-ILJXFKNF.js +0 -32
- package/dist/cli/sessions-YMXBFVB3.js +0 -23
- package/dist/cli/skills-T36PD3IA.js +0 -37
- package/dist/cli/tools-X53FZHIC.js +0 -57
- package/dist/cli/update-BISEE3LC.js +0 -37
|
@@ -5,6 +5,10 @@ import {
|
|
|
5
5
|
type AdAccountDiscoveryResult,
|
|
6
6
|
type IntegrationsNamespace,
|
|
7
7
|
} from './integrations';
|
|
8
|
+
import type {
|
|
9
|
+
ConnectorSyncObjectsPage,
|
|
10
|
+
ConnectorSyncStatuses,
|
|
11
|
+
} from './connector-sync';
|
|
8
12
|
import type {
|
|
9
13
|
CalendarDelegationChange,
|
|
10
14
|
CalendarAvailabilityInventory,
|
|
@@ -6256,6 +6260,53 @@ export class DeeplineClient {
|
|
|
6256
6260
|
return this.http.get(`/api/v2/integrations/balance?${params}`);
|
|
6257
6261
|
}
|
|
6258
6262
|
|
|
6263
|
+
/** Every managed CRM provider's sync state, as the Integrations list shows it. */
|
|
6264
|
+
async getConnectorSyncStatuses(): Promise<ConnectorSyncStatuses> {
|
|
6265
|
+
return this.http.get('/api/v2/ingestion/sync-status');
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
/** One provider's sync state and a page of its synced objects. */
|
|
6269
|
+
async getConnectorSyncObjectsPage(
|
|
6270
|
+
provider: string,
|
|
6271
|
+
options: { cursor?: string; limit?: number } = {},
|
|
6272
|
+
): Promise<ConnectorSyncObjectsPage> {
|
|
6273
|
+
const params = new URLSearchParams();
|
|
6274
|
+
if (options.cursor) params.set('cursor', options.cursor);
|
|
6275
|
+
if (options.limit !== undefined) params.set('limit', String(options.limit));
|
|
6276
|
+
const path = `/api/v2/ingestion/providers/${encodeURIComponent(provider)}/sync`;
|
|
6277
|
+
const query = params.toString();
|
|
6278
|
+
return this.http.get(query ? `${path}?${query}` : path);
|
|
6279
|
+
}
|
|
6280
|
+
|
|
6281
|
+
/** Turn a provider's managed sync on or off. */
|
|
6282
|
+
async setConnectorSync(
|
|
6283
|
+
provider: string,
|
|
6284
|
+
enabled: boolean,
|
|
6285
|
+
): Promise<Record<string, unknown>> {
|
|
6286
|
+
// A lost response must not resend the change: the server does not
|
|
6287
|
+
// deduplicate it, and a first enable mints a new setup token each time.
|
|
6288
|
+
return this.http.post(
|
|
6289
|
+
`/api/v2/ingestion/providers/${encodeURIComponent(provider)}/sync`,
|
|
6290
|
+
{ enabled },
|
|
6291
|
+
undefined,
|
|
6292
|
+
{ maxRetries: 0, exactUrlOnly: true },
|
|
6293
|
+
);
|
|
6294
|
+
}
|
|
6295
|
+
|
|
6296
|
+
/** Pause, resume or run a provider's synced objects. */
|
|
6297
|
+
async runConnectorSyncAction(
|
|
6298
|
+
provider: string,
|
|
6299
|
+
body: { action: string; object_types?: string[] },
|
|
6300
|
+
): Promise<Record<string, unknown>> {
|
|
6301
|
+
// Not retried: a resent run_all could queue the same work twice.
|
|
6302
|
+
return this.http.post(
|
|
6303
|
+
`/api/v2/ingestion/providers/${encodeURIComponent(provider)}/actions`,
|
|
6304
|
+
body,
|
|
6305
|
+
undefined,
|
|
6306
|
+
{ maxRetries: 0, exactUrlOnly: true },
|
|
6307
|
+
);
|
|
6308
|
+
}
|
|
6309
|
+
|
|
6259
6310
|
/** Discover and save the ad accounts accessible to the workspace connection. */
|
|
6260
6311
|
async discoverAdAccounts(
|
|
6261
6312
|
provider: AdAccountDiscoveryProvider,
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import type { DeeplineClient } from './client-core';
|
|
2
|
+
import { DeeplineError } from './errors';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Wire types for a CRM connector's managed sync into the Customer DB. The
|
|
6
|
+
* state comes from GET /api/v2/ingestion/sync-status (Convex only); a
|
|
7
|
+
* provider's synced objects from GET /api/v2/ingestion/providers/{provider}/sync.
|
|
8
|
+
* The server computes every state; clients only render it.
|
|
9
|
+
*/
|
|
10
|
+
export type ConnectorSyncState =
|
|
11
|
+
| 'off'
|
|
12
|
+
| 'starting'
|
|
13
|
+
| 'on'
|
|
14
|
+
| 'needs_attention'
|
|
15
|
+
| 'unknown';
|
|
16
|
+
|
|
17
|
+
export type ConnectorSyncSummary = {
|
|
18
|
+
provider: string;
|
|
19
|
+
state: ConnectorSyncState;
|
|
20
|
+
reason: string;
|
|
21
|
+
/** What the Integrations list shows, e.g. "Sync on · Every object overdue". */
|
|
22
|
+
label: string;
|
|
23
|
+
sync_enabled: boolean;
|
|
24
|
+
/** Null when no health facts are recorded (sync off, or not yet). */
|
|
25
|
+
objects: {
|
|
26
|
+
total: number;
|
|
27
|
+
active: number;
|
|
28
|
+
paused: number;
|
|
29
|
+
failed: number;
|
|
30
|
+
backfilling: number;
|
|
31
|
+
scheduled: number;
|
|
32
|
+
never_synced: number;
|
|
33
|
+
/** Which scheduled objects are past due at read time. */
|
|
34
|
+
overdue: 'none' | 'some' | 'all';
|
|
35
|
+
} | null;
|
|
36
|
+
last_success_at: string | null;
|
|
37
|
+
/** Connector health as the sync last recorded it; null when unknown. */
|
|
38
|
+
connector_status: string | null;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type ConnectorSyncStatuses = {
|
|
42
|
+
customer_db: 'active' | 'unavailable';
|
|
43
|
+
providers: ConnectorSyncSummary[];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ConnectorSyncObject = {
|
|
47
|
+
subscription_id: string;
|
|
48
|
+
object_type: string;
|
|
49
|
+
display_name: string;
|
|
50
|
+
status: string;
|
|
51
|
+
health: string;
|
|
52
|
+
frequency_minutes: number;
|
|
53
|
+
next_run_at: string | null;
|
|
54
|
+
last_success_at: string | null;
|
|
55
|
+
last_error: string | null;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type ConnectorSyncObjectsPage = {
|
|
59
|
+
customer_db: 'active' | 'unavailable';
|
|
60
|
+
summary: ConnectorSyncSummary;
|
|
61
|
+
objects: ConnectorSyncObject[];
|
|
62
|
+
next_cursor: string | null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type ConnectorSyncObjects = Omit<
|
|
66
|
+
ConnectorSyncObjectsPage,
|
|
67
|
+
'next_cursor'
|
|
68
|
+
>;
|
|
69
|
+
|
|
70
|
+
export type ConnectorSyncChange = {
|
|
71
|
+
change: Record<string, unknown>;
|
|
72
|
+
/**
|
|
73
|
+
* The provider's state after the change; null when the change applied but
|
|
74
|
+
* reading the state afterwards failed (status_error says why).
|
|
75
|
+
*/
|
|
76
|
+
status: ConnectorSyncSummary | null;
|
|
77
|
+
status_error?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type ConnectorSyncClient = Pick<
|
|
81
|
+
DeeplineClient,
|
|
82
|
+
| 'getConnectorSyncStatuses'
|
|
83
|
+
| 'getConnectorSyncObjectsPage'
|
|
84
|
+
| 'setConnectorSync'
|
|
85
|
+
| 'runConnectorSyncAction'
|
|
86
|
+
>;
|
|
87
|
+
|
|
88
|
+
/** One provider's summary and every object, reading each page in turn. */
|
|
89
|
+
async function readObjects(
|
|
90
|
+
client: ConnectorSyncClient,
|
|
91
|
+
provider: string,
|
|
92
|
+
): Promise<ConnectorSyncObjects> {
|
|
93
|
+
let page = await client.getConnectorSyncObjectsPage(provider);
|
|
94
|
+
const objects = [...page.objects];
|
|
95
|
+
while (page.next_cursor) {
|
|
96
|
+
const cursor = page.next_cursor;
|
|
97
|
+
page = await client.getConnectorSyncObjectsPage(provider, { cursor });
|
|
98
|
+
if (page.next_cursor !== null && page.next_cursor <= cursor)
|
|
99
|
+
throw new DeeplineError(
|
|
100
|
+
`The ${provider} object list did not advance past cursor ${cursor}.`,
|
|
101
|
+
502,
|
|
102
|
+
'CURSOR_NOT_ADVANCING',
|
|
103
|
+
);
|
|
104
|
+
objects.push(...page.objects);
|
|
105
|
+
}
|
|
106
|
+
return { customer_db: page.customer_db, summary: page.summary, objects };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async function readSummary(
|
|
110
|
+
client: ConnectorSyncClient,
|
|
111
|
+
provider: string,
|
|
112
|
+
): Promise<ConnectorSyncSummary> {
|
|
113
|
+
const statuses = await client.getConnectorSyncStatuses();
|
|
114
|
+
const summary = statuses.providers.find((row) => row.provider === provider);
|
|
115
|
+
if (!summary)
|
|
116
|
+
throw new DeeplineError(
|
|
117
|
+
`${provider} has no managed sync. Run deepline integrations sync status.`,
|
|
118
|
+
404,
|
|
119
|
+
'NOT_FOUND',
|
|
120
|
+
);
|
|
121
|
+
return summary;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Pausing or resuming names objects the provider already syncs. A name the
|
|
126
|
+
* server does not know would otherwise change nothing and still succeed.
|
|
127
|
+
*/
|
|
128
|
+
async function requireKnownObjects(
|
|
129
|
+
client: ConnectorSyncClient,
|
|
130
|
+
provider: string,
|
|
131
|
+
objectTypes: readonly string[],
|
|
132
|
+
): Promise<void> {
|
|
133
|
+
if (objectTypes.length === 0)
|
|
134
|
+
throw new DeeplineError(
|
|
135
|
+
'Name at least one object, for example contacts.',
|
|
136
|
+
400,
|
|
137
|
+
'INVALID_ARGUMENT',
|
|
138
|
+
);
|
|
139
|
+
const detail = await readObjects(client, provider);
|
|
140
|
+
if (detail.customer_db !== 'active')
|
|
141
|
+
throw new DeeplineError(
|
|
142
|
+
'The Customer DB is unavailable, so its synced objects cannot be changed.',
|
|
143
|
+
409,
|
|
144
|
+
'CUSTOMER_DB_UNAVAILABLE',
|
|
145
|
+
);
|
|
146
|
+
const known = new Set(detail.objects.map((row) => row.object_type));
|
|
147
|
+
const unknown = objectTypes.filter((objectType) => !known.has(objectType));
|
|
148
|
+
if (unknown.length > 0)
|
|
149
|
+
throw new DeeplineError(
|
|
150
|
+
`${provider} does not sync ${unknown.join(', ')}. Synced objects: ${[...known].join(', ') || 'none'}. Run deepline integrations sync objects ${provider}.`,
|
|
151
|
+
404,
|
|
152
|
+
'NOT_FOUND',
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The change has already applied, so a failed read of the resulting state
|
|
158
|
+
* must not fail the command: a retry would repeat the change.
|
|
159
|
+
*/
|
|
160
|
+
async function withResultingState(
|
|
161
|
+
client: ConnectorSyncClient,
|
|
162
|
+
provider: string,
|
|
163
|
+
change: Record<string, unknown>,
|
|
164
|
+
): Promise<ConnectorSyncChange> {
|
|
165
|
+
try {
|
|
166
|
+
return { change, status: await readSummary(client, provider) };
|
|
167
|
+
} catch (error) {
|
|
168
|
+
return {
|
|
169
|
+
change,
|
|
170
|
+
status: null,
|
|
171
|
+
status_error: error instanceof Error ? error.message : String(error),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function createConnectorSyncNamespace(client: ConnectorSyncClient) {
|
|
177
|
+
const action = async (
|
|
178
|
+
provider: string,
|
|
179
|
+
body: { action: string; object_types?: string[] },
|
|
180
|
+
): Promise<ConnectorSyncChange> =>
|
|
181
|
+
withResultingState(
|
|
182
|
+
client,
|
|
183
|
+
provider,
|
|
184
|
+
await client.runConnectorSyncAction(provider, body),
|
|
185
|
+
);
|
|
186
|
+
return {
|
|
187
|
+
/** Every managed provider's sync state (from Convex only). */
|
|
188
|
+
status: () => client.getConnectorSyncStatuses(),
|
|
189
|
+
/** One provider's sync state (from Convex only). */
|
|
190
|
+
get: (provider: string) => readSummary(client, provider),
|
|
191
|
+
/** One provider's sync state and every synced object (Customer DB). */
|
|
192
|
+
objects: (provider: string) => readObjects(client, provider),
|
|
193
|
+
/** Turn a provider's sync on or off. */
|
|
194
|
+
set: async (
|
|
195
|
+
provider: string,
|
|
196
|
+
enabled: boolean,
|
|
197
|
+
): Promise<ConnectorSyncChange> =>
|
|
198
|
+
withResultingState(
|
|
199
|
+
client,
|
|
200
|
+
provider,
|
|
201
|
+
await client.setConnectorSync(provider, enabled),
|
|
202
|
+
),
|
|
203
|
+
pause: async (provider: string, objectTypes: readonly string[]) => {
|
|
204
|
+
await requireKnownObjects(client, provider, objectTypes);
|
|
205
|
+
return action(provider, {
|
|
206
|
+
action: 'pause_all',
|
|
207
|
+
object_types: [...objectTypes],
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
resume: async (provider: string, objectTypes: readonly string[]) => {
|
|
211
|
+
await requireKnownObjects(client, provider, objectTypes);
|
|
212
|
+
return action(provider, {
|
|
213
|
+
action: 'resume_all',
|
|
214
|
+
object_types: [...objectTypes],
|
|
215
|
+
});
|
|
216
|
+
},
|
|
217
|
+
/**
|
|
218
|
+
* Queue a sync now for every synced object, or only the named ones. As on
|
|
219
|
+
* the sync page, a paused object runs once and stays paused.
|
|
220
|
+
*/
|
|
221
|
+
run: async (provider: string, objectTypes: readonly string[] = []) => {
|
|
222
|
+
const summary = await readSummary(client, provider);
|
|
223
|
+
if (!summary.sync_enabled)
|
|
224
|
+
throw new DeeplineError(
|
|
225
|
+
`Sync is off for ${provider}. Turn it on with deepline integrations sync on ${provider}.`,
|
|
226
|
+
409,
|
|
227
|
+
'SYNC_OFF',
|
|
228
|
+
);
|
|
229
|
+
if (objectTypes.length > 0)
|
|
230
|
+
await requireKnownObjects(client, provider, objectTypes);
|
|
231
|
+
return action(provider, {
|
|
232
|
+
action: 'run_all',
|
|
233
|
+
...(objectTypes.length > 0 ? { object_types: [...objectTypes] } : {}),
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export type ConnectorSyncNamespace = ReturnType<
|
|
240
|
+
typeof createConnectorSyncNamespace
|
|
241
|
+
>;
|
|
@@ -453,3 +453,13 @@ export type {
|
|
|
453
453
|
IntegrationChangeOptions,
|
|
454
454
|
IntegrationChangeResult,
|
|
455
455
|
} from './integrations.js';
|
|
456
|
+
export type {
|
|
457
|
+
ConnectorSyncChange,
|
|
458
|
+
ConnectorSyncObjects,
|
|
459
|
+
ConnectorSyncObjectsPage,
|
|
460
|
+
ConnectorSyncNamespace,
|
|
461
|
+
ConnectorSyncObject,
|
|
462
|
+
ConnectorSyncState,
|
|
463
|
+
ConnectorSyncStatuses,
|
|
464
|
+
ConnectorSyncSummary,
|
|
465
|
+
} from './connector-sync.js';
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
GOOGLE_WORKSPACE_CALENDAR_LIST_SCOPE,
|
|
7
7
|
} from '../../shared_libs/integration-contracts/calendar-delegation';
|
|
8
8
|
import type { DeeplineClient } from './client-core';
|
|
9
|
+
import { createConnectorSyncNamespace } from './connector-sync';
|
|
9
10
|
import { DeeplineError } from './errors';
|
|
10
11
|
|
|
11
12
|
type IntegrationClient = Pick<
|
|
@@ -17,6 +18,10 @@ type IntegrationClient = Pick<
|
|
|
17
18
|
| 'getIntegrationConnectLink'
|
|
18
19
|
| 'discoverAdAccounts'
|
|
19
20
|
| 'listManagedConnectionMembers'
|
|
21
|
+
| 'getConnectorSyncStatuses'
|
|
22
|
+
| 'getConnectorSyncObjectsPage'
|
|
23
|
+
| 'setConnectorSync'
|
|
24
|
+
| 'runConnectorSyncAction'
|
|
20
25
|
>;
|
|
21
26
|
|
|
22
27
|
const CALENDAR_PROVIDER = 'google_calendar_availability';
|
|
@@ -261,6 +266,8 @@ export function createIntegrationsNamespace(client: IntegrationClient) {
|
|
|
261
266
|
provider: 'hubspot' | 'google_calendar_availability',
|
|
262
267
|
options: { cursor?: string } = {},
|
|
263
268
|
) => client.listManagedConnectionMembers(provider, options.cursor),
|
|
269
|
+
/** CRM connector sync into the Customer DB: state, on/off, objects. */
|
|
270
|
+
sync: createConnectorSyncNamespace(client),
|
|
264
271
|
};
|
|
265
272
|
}
|
|
266
273
|
|
|
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
|
|
|
205
205
|
// getters keep their established compatibility behavior.
|
|
206
206
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
207
207
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
208
|
-
version: '0.3.
|
|
208
|
+
version: '0.3.565',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -35,6 +35,13 @@ export function readRequestedOrgHeader(
|
|
|
35
35
|
return orgId ? { kind: 'org', orgId } : { kind: 'absent' };
|
|
36
36
|
}
|
|
37
37
|
export const EXTENSION_PANEL_PATH = '/extension/plays';
|
|
38
|
+
/**
|
|
39
|
+
* The error a published extension returns for a path outside its allowlist.
|
|
40
|
+
* Installed extensions keep the allowlist they shipped with, so the panel can
|
|
41
|
+
* see this for an endpoint added after the user's extension was built.
|
|
42
|
+
*/
|
|
43
|
+
export const UNSUPPORTED_EXTENSION_REQUEST =
|
|
44
|
+
'This request is not supported by Deepline Plays.';
|
|
38
45
|
|
|
39
46
|
export type BridgeFormEntry = [
|
|
40
47
|
string,
|
|
@@ -84,6 +91,7 @@ export function isAllowedExtensionRequest(
|
|
|
84
91
|
pathname === '/api/v2/auth/session' ||
|
|
85
92
|
pathname === '/api/v2/plays' ||
|
|
86
93
|
pathname === '/api/v2/runs' ||
|
|
94
|
+
pathname === '/api/v2/views' ||
|
|
87
95
|
/^\/api\/v2\/plays\/[^/]+(?:\/sheet(?:\/export)?)?$/.test(pathname) ||
|
|
88
96
|
/^\/api\/v2\/runs\/[^/]+(?:\/input)?$/.test(pathname))
|
|
89
97
|
);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunkZTHMJ4SKjs = require('./chunk-ZTHMJ4SK.js');
|
|
18
|
+
require('./chunk-J5QAOURJ.js');
|
|
19
|
+
require('./chunk-GE62FFN6.js');
|
|
20
|
+
require('./chunk-4VKDPTHF.js');
|
|
21
|
+
require('./chunk-6VLFQZK6.js');
|
|
22
|
+
require('./chunk-XNYIZMNQ.js');
|
|
23
|
+
require('./chunk-LFQJW4S2.js');
|
|
24
|
+
require('./chunk-CFJFUVX2.js');
|
|
25
|
+
require('./chunk-UWMK5DLS.js');
|
|
26
|
+
require('./chunk-OG64RBAC.js');
|
|
27
|
+
require('./chunk-COGTRVWW.js');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkZTHMJ4SKjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkZTHMJ4SKjs.authStatusLine; exports.clearPendingClaim = _chunkZTHMJ4SKjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkZTHMJ4SKjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkZTHMJ4SKjs.handleRegister; exports.handleStatus = _chunkZTHMJ4SKjs.handleStatus; exports.handleWait = _chunkZTHMJ4SKjs.handleWait; exports.httpJson = _chunkZTHMJ4SKjs.httpJson; exports.readPendingAuthClaim = _chunkZTHMJ4SKjs.readPendingAuthClaim; exports.readStatusBanner = _chunkZTHMJ4SKjs.readStatusBanner; exports.registerAuthCommands = _chunkZTHMJ4SKjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkZTHMJ4SKjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkZTHMJ4SKjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkZTHMJ4SKjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkZTHMJ4SKjs.statusBannerLine;
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
reportSetupCompleted,
|
|
15
15
|
resolvePendingAuthClaimForResume,
|
|
16
16
|
statusBannerLine
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-YGVLCJNY.mjs";
|
|
18
|
+
import "./chunk-JLXLCD6F.mjs";
|
|
19
|
+
import "./chunk-2US3VJXX.mjs";
|
|
20
|
+
import "./chunk-LKVWMLWI.mjs";
|
|
21
21
|
import "./chunk-ASB47RXJ.mjs";
|
|
22
22
|
import "./chunk-DLIRSHV6.mjs";
|
|
23
23
|
import "./chunk-Z3A2S3QM.mjs";
|
|
24
24
|
import "./chunk-2MGZAI54.mjs";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-H4LHB6ES.mjs";
|
|
26
26
|
import "./chunk-WZYKRD7T.mjs";
|
|
27
27
|
import "./chunk-KRD6H754.mjs";
|
|
28
28
|
export {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
concurrentRunsLine
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-YIKEVZUQ.mjs";
|
|
4
|
+
import "./chunk-YGVLCJNY.mjs";
|
|
5
5
|
import {
|
|
6
6
|
DeeplineClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IFZA4IGI.mjs";
|
|
8
8
|
import {
|
|
9
9
|
PUBLIC_PLAN_SKUS,
|
|
10
10
|
iterateCursorPages,
|
|
11
11
|
requireBillingIdempotencyKey
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AAOXS3XM.mjs";
|
|
13
13
|
import "./chunk-FZHMNK6F.mjs";
|
|
14
14
|
import "./chunk-5TYLSS4Q.mjs";
|
|
15
15
|
import "./chunk-PSX3WHIH.mjs";
|
|
16
16
|
import {
|
|
17
17
|
PLAY_RUNTIME_PRICING_NOTE
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KOMEYB7H.mjs";
|
|
19
19
|
import {
|
|
20
20
|
PRICING_PAGE_NOTE
|
|
21
21
|
} from "./chunk-2RIKOPIM.mjs";
|
|
@@ -32,9 +32,9 @@ import {
|
|
|
32
32
|
openInBrowser,
|
|
33
33
|
printCommandEnvelope,
|
|
34
34
|
shouldEmitJson
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-JLXLCD6F.mjs";
|
|
36
|
+
import "./chunk-2US3VJXX.mjs";
|
|
37
|
+
import "./chunk-LKVWMLWI.mjs";
|
|
38
38
|
import {
|
|
39
39
|
AuthError,
|
|
40
40
|
ConfigError
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
DeeplineError
|
|
45
45
|
} from "./chunk-Z3A2S3QM.mjs";
|
|
46
46
|
import "./chunk-2MGZAI54.mjs";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-H4LHB6ES.mjs";
|
|
48
48
|
import "./chunk-WZYKRD7T.mjs";
|
|
49
49
|
import "./chunk-KRD6H754.mjs";
|
|
50
50
|
|