deepline 0.3.564 → 0.3.566

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.
Files changed (161) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +51 -0
  2. package/dist/bundling-sources/sdk/src/connector-sync.ts +241 -0
  3. package/dist/bundling-sources/sdk/src/index.ts +10 -0
  4. package/dist/bundling-sources/sdk/src/integrations.ts +7 -0
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +5 -0
  7. package/dist/cli/{auth-PXZ7JZUT.mjs → auth-HSFDBHVB.mjs} +5 -5
  8. package/dist/cli/auth-RGFZEMFX.js +44 -0
  9. package/dist/cli/{billing-AMYFMDZL.mjs → billing-6T7HH6DE.mjs} +9 -9
  10. package/dist/cli/{billing-OY2ZN5XJ.js → billing-NG5W2PDU.js} +102 -102
  11. package/dist/cli/{chunk-HEWVHSNN.mjs → chunk-3PNU3FEI.mjs} +4 -4
  12. package/dist/cli/{chunk-4JQ6MHE7.js → chunk-5J6VEC75.js} +4 -4
  13. package/dist/cli/{chunk-I4XWKMGR.js → chunk-6F6DMBEJ.js} +15 -15
  14. package/dist/cli/{chunk-HGGIWRA5.js → chunk-7GLVIFDO.js} +48 -48
  15. package/dist/cli/{chunk-ZOITMXVO.mjs → chunk-AD47OWTE.mjs} +1 -1
  16. package/dist/cli/{chunk-TVF7XVPN.mjs → chunk-AGDRIXF2.mjs} +1 -1
  17. package/dist/cli/{chunk-Y2FZJRRM.js → chunk-AHELFBG5.js} +2 -2
  18. package/dist/cli/{chunk-YIDXJD5L.mjs → chunk-AIF7ZHCF.mjs} +1 -1
  19. package/dist/cli/{chunk-DHZOC2QX.mjs → chunk-ARUXRZR4.mjs} +2 -2
  20. package/dist/cli/{chunk-CXN574UU.mjs → chunk-BILFWD6F.mjs} +1 -1
  21. package/dist/cli/{search-output-AXVUC3TF.js → chunk-C5IA2OYE.js} +2 -199
  22. package/dist/cli/{chunk-2SKEXMFV.js → chunk-CQX5MWHH.js} +5 -5
  23. package/dist/cli/{chunk-DTTMFSNG.mjs → chunk-CSXMBYEW.mjs} +1 -1
  24. package/dist/cli/{chunk-IW3N7ARM.js → chunk-CXK6ZEOQ.js} +159 -9
  25. package/dist/cli/{chunk-655PNNU7.mjs → chunk-E44TMICV.mjs} +1 -1
  26. package/dist/cli/{chunk-GWTFA5GD.js → chunk-EIYQIY3C.js} +3 -3
  27. package/dist/cli/{chunk-MY45K7SA.mjs → chunk-FPKKYS7V.mjs} +5 -5
  28. package/dist/cli/{chunk-DYTTZHYX.mjs → chunk-FUTXULX5.mjs} +5 -5
  29. package/dist/cli/{chunk-WDXXHTIF.js → chunk-FXSDDRVX.js} +23 -23
  30. package/dist/cli/{chunk-KR76WIOX.js → chunk-GY7MY2IJ.js} +1 -1
  31. package/dist/cli/{chunk-RKG2E2JF.js → chunk-H6BQIQEJ.js} +9 -9
  32. package/dist/cli/{chunk-V2SNCH5X.js → chunk-ILTX6ZAH.js} +6 -6
  33. package/dist/cli/{chunk-I2GVGCMM.js → chunk-JSVNTY47.js} +12 -12
  34. package/dist/cli/{chunk-2ISK6CUL.mjs → chunk-K3DEHKV7.mjs} +11 -11
  35. package/dist/cli/{chunk-RBTOZO5M.js → chunk-K5QLALHC.js} +41 -41
  36. package/dist/cli/{chunk-JVSHMUGE.mjs → chunk-KCD4LM2D.mjs} +3 -3
  37. package/dist/cli/{chunk-OCLHNDVN.mjs → chunk-KDPGBC5U.mjs} +5 -5
  38. package/dist/cli/{chunk-XP6ALUAZ.mjs → chunk-KKC7U4UJ.mjs} +2 -2
  39. package/dist/cli/{chunk-VACBPVIR.mjs → chunk-KOMEYB7H.mjs} +104 -0
  40. package/dist/cli/{chunk-HPXN5QZZ.js → chunk-KXGUMGCU.js} +20 -20
  41. package/dist/cli/{chunk-BRQVKZWJ.js → chunk-L2P3672R.js} +7 -7
  42. package/dist/cli/{chunk-2PMHEUED.mjs → chunk-L5N4DSH4.mjs} +3 -3
  43. package/dist/cli/{chunk-4NNNJLAZ.mjs → chunk-LAQNXNVR.mjs} +2 -2
  44. package/dist/cli/{chunk-WXB7PU3O.mjs → chunk-MEBKPVHE.mjs} +1 -1
  45. package/dist/cli/{search-output-N44NPUN6.mjs → chunk-MI5Q5FOD.mjs} +1 -198
  46. package/dist/cli/{chunk-KBGP4CS5.js → chunk-MIS3V2C3.js} +10 -10
  47. package/dist/cli/{chunk-5CNHEUGJ.js → chunk-OEVCKW2M.js} +104 -0
  48. package/dist/cli/{chunk-7DU4VODD.mjs → chunk-OFEARTQO.mjs} +2 -2
  49. package/dist/cli/{chunk-XWDCKDUP.js → chunk-OL3WYX7L.js} +26 -26
  50. package/dist/cli/{chunk-TK6YKQ45.mjs → chunk-P7Q27COZ.mjs} +1 -1
  51. package/dist/cli/{chunk-UWX4TTJU.mjs → chunk-PLXQIHRM.mjs} +2 -2
  52. package/dist/cli/{chunk-V2GHSOQB.js → chunk-PRM3WYG7.js} +100 -100
  53. package/dist/cli/{chunk-QHBYLHOG.mjs → chunk-QBX4UJMY.mjs} +2 -2
  54. package/dist/cli/{chunk-RW6PFYT5.mjs → chunk-RIV2AZLY.mjs} +5 -5
  55. package/dist/cli/{chunk-YMQOTCLU.js → chunk-RUVYG5TT.js} +2 -2
  56. package/dist/cli/{chunk-RK5EKJAT.mjs → chunk-SR7IUISM.mjs} +152 -2
  57. package/dist/cli/{chunk-XVYU3J2J.js → chunk-T3RKLPPS.js} +13 -13
  58. package/dist/cli/{chunk-WSEMXB7X.js → chunk-TVGGBQFG.js} +20 -20
  59. package/dist/cli/{chunk-56P2BEVI.mjs → chunk-TYKMBPNE.mjs} +2 -2
  60. package/dist/cli/{chunk-R5555CB5.js → chunk-UF5MVM6L.js} +2 -2
  61. package/dist/cli/{chunk-ZJ23RI3B.mjs → chunk-VHRYJACF.mjs} +2 -2
  62. package/dist/cli/{chunk-7NSHH3NB.js → chunk-VRWMQUFO.js} +5 -5
  63. package/dist/cli/{chunk-QQTZ6KG4.mjs → chunk-YFP7YZUU.mjs} +4 -4
  64. package/dist/cli/{chunk-ZZW5A4HZ.js → chunk-YJEBAR3C.js} +5 -5
  65. package/dist/cli/{chunk-HXZSXPT2.js → chunk-Z5BLACQ3.js} +53 -53
  66. package/dist/cli/{chunk-4SV43Z64.js → chunk-ZYXQIOWE.js} +3 -3
  67. package/dist/cli/command-docs.js +2 -2
  68. package/dist/cli/command-docs.mjs +1 -1
  69. package/dist/cli/concurrent-runs-help-3QVRXAZG.js +22 -0
  70. package/dist/cli/{concurrent-runs-help-5GPKNDAY.mjs → concurrent-runs-help-TNMN4C74.mjs} +6 -6
  71. package/dist/cli/{csv-X3FHV56H.js → csv-77H4JMDW.js} +13 -13
  72. package/dist/cli/{csv-ARPN6J6K.mjs → csv-KAZRKSLV.mjs} +4 -4
  73. package/dist/cli/{db-WINZJRWC.js → db-MM6R2466.js} +27 -27
  74. package/dist/cli/{db-2HWSS3MA.mjs → db-XQQAVLWO.mjs} +6 -6
  75. package/dist/cli/describe-H43UIBVP.js +50 -0
  76. package/dist/cli/{describe-333JCD22.mjs → describe-P5N56GPA.mjs} +18 -18
  77. package/dist/cli/describe-core.d.mts +2 -2
  78. package/dist/cli/describe-core.d.ts +2 -2
  79. package/dist/cli/{executions-JYYXIRE6.mjs → executions-EGEQZV5V.mjs} +6 -6
  80. package/dist/cli/{executions-UHZHVQLO.js → executions-EGPCT2OK.js} +8 -8
  81. package/dist/cli/{feedback-6G4SDI7M.js → feedback-ALMW7OR5.js} +14 -14
  82. package/dist/cli/{feedback-KNGQ4VMG.mjs → feedback-IWUJAF6O.mjs} +6 -6
  83. package/dist/cli/{git-DREIWOYN.mjs → git-4CQQWLZP.mjs} +5 -5
  84. package/dist/cli/git-UYYH53Q6.js +26 -0
  85. package/dist/cli/index.js +147 -147
  86. package/dist/cli/index.mjs +46 -46
  87. package/dist/cli/integrations-LS73NWU7.mjs +284 -0
  88. package/dist/cli/integrations-Y7W5L7DW.js +284 -0
  89. package/dist/cli/{legacy-noops-FSL5Y4TO.mjs → legacy-noops-V45TJGK3.mjs} +6 -6
  90. package/dist/cli/{legacy-noops-7LZ2HNLB.js → legacy-noops-WXGSAZ6O.js} +9 -9
  91. package/dist/cli/{mcp-TAVIRUQC.js → mcp-3QRLMKFF.js} +24 -24
  92. package/dist/cli/{mcp-WDJV3OCV.mjs → mcp-4IHB3LCG.mjs} +4 -4
  93. package/dist/cli/{monitors-HGT2RVR5.js → monitors-4I2QDCOV.js} +100 -100
  94. package/dist/cli/{monitors-L5FSJSVD.mjs → monitors-K46XW6QH.mjs} +7 -7
  95. package/dist/cli/{org-4LNYSIEM.js → org-CBJY5DO5.js} +121 -121
  96. package/dist/cli/{org-J5DJCLTU.mjs → org-H3GYWKFC.mjs} +6 -6
  97. package/dist/cli/{outcomes-5DZ5EZ5Q.mjs → outcomes-AE6ZPY6O.mjs} +6 -6
  98. package/dist/cli/{outcomes-4QO264GU.js → outcomes-KHZ3S3SG.js} +14 -14
  99. package/dist/cli/{play-FZY7NZAM.js → play-SY2PCUMD.js} +324 -324
  100. package/dist/cli/{play-SETNQCBB.mjs → play-YQS3OI2Q.mjs} +19 -19
  101. package/dist/cli/{providers-754HLYAW.js → providers-IT2YALZM.js} +9 -9
  102. package/dist/cli/{providers-PIS6IQVA.mjs → providers-WJBBSM76.mjs} +6 -6
  103. package/dist/cli/{quickstart-5P4NYWZK.mjs → quickstart-TYMROAQG.mjs} +4 -4
  104. package/dist/cli/{quickstart-2TIUCHQF.js → quickstart-VMLHHXFD.js} +6 -6
  105. package/dist/cli/{run-OQNK7G3I.js → run-GQOWNUD2.js} +44 -44
  106. package/dist/cli/{run-WAN4VZMS.mjs → run-TSOLGWTK.mjs} +23 -23
  107. package/dist/cli/search-B23QXBNF.js +32 -0
  108. package/dist/cli/{search-PTX7IMBB.mjs → search-MJAL37NP.mjs} +7 -7
  109. package/dist/cli/search-output-AUVP4ZLR.js +205 -0
  110. package/dist/cli/search-output-IKVGU3MZ.mjs +205 -0
  111. package/dist/cli/{secrets-ZODIPUMI.mjs → secrets-4KYGVJJJ.mjs} +6 -6
  112. package/dist/cli/{secrets-32WRPZB2.js → secrets-NO6ZD2OZ.js} +15 -15
  113. package/dist/cli/sessions-DJLG57FC.js +23 -0
  114. package/dist/cli/{sessions-JRIS3JMT.mjs → sessions-S2O24LRW.mjs} +6 -6
  115. package/dist/cli/{settings-OI3OHCD5.mjs → settings-NSZNSX67.mjs} +12 -12
  116. package/dist/cli/{settings-YIZUG6T3.js → settings-O5BELZRA.js} +85 -85
  117. package/dist/cli/{setup-4QQ33WUA.mjs → setup-3VTTPHKI.mjs} +9 -9
  118. package/dist/cli/{setup-AF3I4UPE.js → setup-IGJKIVJ7.js} +49 -49
  119. package/dist/cli/skills-76W4VCHP.js +37 -0
  120. package/dist/cli/{skills-EITRSX56.mjs → skills-JMSX77S3.mjs} +7 -7
  121. package/dist/cli/{tools-CMOLGIDR.mjs → tools-MITGT2JM.mjs} +17 -17
  122. package/dist/cli/tools-OS32SFJD.js +57 -0
  123. package/dist/cli/update-UGLA7TLH.js +37 -0
  124. package/dist/cli/{update-PGEARBAI.mjs → update-YXASQQWE.mjs} +9 -9
  125. package/dist/cli/{views-2H77STII.mjs → views-7ZMS2B55.mjs} +6 -6
  126. package/dist/cli/{views-KFLXOZ5N.js → views-Y5CA3JWP.js} +21 -21
  127. package/dist/cli/{workflow-XWMAYWVX.mjs → workflow-GBXWHYDL.mjs} +7 -7
  128. package/dist/cli/{workflow-HCEMVZAZ.js → workflow-U7KXZLKI.js} +17 -17
  129. package/dist/{client-CnphYDTe.d.mts → client-B5cSKEi4.d.mts} +1 -1
  130. package/dist/{client-core-DQOTt3yV.d.mts → client-core-BP19BoBb.d.mts} +107 -2
  131. package/dist/{client-core-Yad6-K7-.d.ts → client-core-Deqov12F.d.ts} +107 -2
  132. package/dist/{client-BSxuaObS.d.ts → client-vUZGmXT9.d.ts} +1 -1
  133. package/dist/index.d.mts +3 -3
  134. package/dist/index.d.ts +3 -3
  135. package/dist/index.js +9 -9
  136. package/dist/index.mjs +6 -6
  137. package/dist/install-integrity.json +121 -118
  138. package/dist/plays/play-description.d.mts +1 -1
  139. package/dist/plays/play-description.d.ts +1 -1
  140. package/dist/plays/run-request.d.mts +1 -1
  141. package/dist/plays/run-request.d.ts +1 -1
  142. package/dist/release.d.mts +1 -1
  143. package/dist/release.d.ts +1 -1
  144. package/dist/release.js +2 -2
  145. package/dist/release.mjs +1 -1
  146. package/dist/server.d.mts +2 -2
  147. package/dist/server.d.ts +2 -2
  148. package/dist/server.js +5 -5
  149. package/dist/server.mjs +3 -3
  150. package/package.json +1 -1
  151. package/dist/cli/auth-645UXOAZ.js +0 -44
  152. package/dist/cli/concurrent-runs-help-QKZXIMSW.js +0 -22
  153. package/dist/cli/describe-6TJYCPFQ.js +0 -50
  154. package/dist/cli/git-TQNP4MAD.js +0 -26
  155. package/dist/cli/integrations-UY3T3ZHA.mjs +0 -129
  156. package/dist/cli/integrations-V6EO6JAM.js +0 -129
  157. package/dist/cli/search-VXKJDQA5.js +0 -32
  158. package/dist/cli/sessions-MW3SUF7R.js +0 -23
  159. package/dist/cli/skills-ECMGSQM4.js +0 -37
  160. package/dist/cli/tools-QTTCIEQM.js +0 -57
  161. package/dist/cli/update-N3YQGALD.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.564',
208
+ version: '0.3.566',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -43,6 +43,11 @@ export const MONITOR_SYSTEM_PROCESSES = [
43
43
  'operator_bridge',
44
44
  /** Workspace archive suspending every monitor in the workspace. */
45
45
  'workspace_archive',
46
+ /**
47
+ * A released identity claim putting the Fleet members blocked on its
48
+ * target back in their queues (#10305).
49
+ */
50
+ 'identity_release',
46
51
  ] as const;
47
52
 
48
53
  export type MonitorSystemProcess = (typeof MONITOR_SYSTEM_PROCESSES)[number];
@@ -14,15 +14,15 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-2PMHEUED.mjs";
18
- import "./chunk-4NNNJLAZ.mjs";
19
- import "./chunk-ZOITMXVO.mjs";
20
- import "./chunk-TVF7XVPN.mjs";
17
+ } from "./chunk-L5N4DSH4.mjs";
18
+ import "./chunk-LAQNXNVR.mjs";
19
+ import "./chunk-AD47OWTE.mjs";
20
+ import "./chunk-AGDRIXF2.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-TK6YKQ45.mjs";
25
+ import "./chunk-P7Q27COZ.mjs";
26
26
  import "./chunk-WZYKRD7T.mjs";
27
27
  import "./chunk-KRD6H754.mjs";
28
28
  export {
@@ -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 _chunkZ5BLACQ3js = require('./chunk-Z5BLACQ3.js');
18
+ require('./chunk-TVGGBQFG.js');
19
+ require('./chunk-ZYXQIOWE.js');
20
+ require('./chunk-5J6VEC75.js');
21
+ require('./chunk-6VLFQZK6.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-LFQJW4S2.js');
24
+ require('./chunk-CFJFUVX2.js');
25
+ require('./chunk-GY7MY2IJ.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 = _chunkZ5BLACQ3js.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkZ5BLACQ3js.authStatusLine; exports.clearPendingClaim = _chunkZ5BLACQ3js.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkZ5BLACQ3js.clearSatisfiedPendingClaim; exports.handleRegister = _chunkZ5BLACQ3js.handleRegister; exports.handleStatus = _chunkZ5BLACQ3js.handleStatus; exports.handleWait = _chunkZ5BLACQ3js.handleWait; exports.httpJson = _chunkZ5BLACQ3js.httpJson; exports.readPendingAuthClaim = _chunkZ5BLACQ3js.readPendingAuthClaim; exports.readStatusBanner = _chunkZ5BLACQ3js.readStatusBanner; exports.registerAuthCommands = _chunkZ5BLACQ3js.registerAuthCommands; exports.reportApprovalLinkShown = _chunkZ5BLACQ3js.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkZ5BLACQ3js.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkZ5BLACQ3js.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkZ5BLACQ3js.statusBannerLine;
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  concurrentRunsLine
3
- } from "./chunk-XP6ALUAZ.mjs";
4
- import "./chunk-2PMHEUED.mjs";
3
+ } from "./chunk-KKC7U4UJ.mjs";
4
+ import "./chunk-L5N4DSH4.mjs";
5
5
  import {
6
6
  DeeplineClient
7
- } from "./chunk-UWX4TTJU.mjs";
7
+ } from "./chunk-PLXQIHRM.mjs";
8
8
  import {
9
9
  PUBLIC_PLAN_SKUS,
10
10
  iterateCursorPages,
11
11
  requireBillingIdempotencyKey
12
- } from "./chunk-RK5EKJAT.mjs";
12
+ } from "./chunk-SR7IUISM.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-VACBPVIR.mjs";
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-4NNNJLAZ.mjs";
36
- import "./chunk-ZOITMXVO.mjs";
37
- import "./chunk-TVF7XVPN.mjs";
35
+ } from "./chunk-LAQNXNVR.mjs";
36
+ import "./chunk-AD47OWTE.mjs";
37
+ import "./chunk-AGDRIXF2.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-TK6YKQ45.mjs";
47
+ import "./chunk-P7Q27COZ.mjs";
48
48
  import "./chunk-WZYKRD7T.mjs";
49
49
  import "./chunk-KRD6H754.mjs";
50
50