@graph8/sdk 0.251.0 → 0.260.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.
Files changed (350) hide show
  1. package/README.md +9 -2
  2. package/dist/cli.js +216 -0
  3. package/dist/index.d.mts +104 -7
  4. package/dist/index.d.ts +104 -7
  5. package/dist/index.js +44 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +44 -3
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/react.d.mts +102 -7
  10. package/dist/react.d.ts +102 -7
  11. package/dist/react.js +62 -11
  12. package/dist/react.js.map +1 -1
  13. package/dist/react.mjs +53 -12
  14. package/dist/react.mjs.map +1 -1
  15. package/dist/types/README.md +7 -0
  16. package/dist/types/agency.d.ts +20 -0
  17. package/dist/types/agentSetup.d.ts +57 -0
  18. package/dist/types/api.d.ts +127 -0
  19. package/dist/types/appClient.d.ts +99 -0
  20. package/dist/types/appPlatform.d.ts +269 -0
  21. package/dist/types/appTokens.d.ts +125 -0
  22. package/dist/types/apps.d.ts +130 -0
  23. package/dist/types/audiences.d.ts +88 -0
  24. package/dist/types/calendar.d.ts +55 -0
  25. package/dist/types/campaigns.d.ts +61 -0
  26. package/dist/types/chat.d.ts +35 -0
  27. package/dist/types/cli.d.ts +14 -0
  28. package/dist/types/companies.d.ts +123 -0
  29. package/dist/types/contacts.d.ts +200 -0
  30. package/dist/types/copilot.d.ts +31 -0
  31. package/dist/types/core.d.ts +1052 -0
  32. package/dist/types/deals.d.ts +215 -0
  33. package/dist/types/enrich.d.ts +51 -0
  34. package/dist/types/fields.d.ts +84 -0
  35. package/dist/types/forms.d.ts +16 -0
  36. package/dist/types/http.d.ts +141 -0
  37. package/dist/types/inbox.d.ts +123 -0
  38. package/dist/types/index.d.ts +63 -0
  39. package/dist/types/intent.d.ts +196 -0
  40. package/dist/types/lists.d.ts +44 -0
  41. package/dist/types/mailboxes.d.ts +240 -0
  42. package/dist/types/marketplace.d.ts +62 -0
  43. package/dist/types/meetings.d.ts +70 -0
  44. package/dist/types/newsletter.d.ts +212 -0
  45. package/dist/types/notes.d.ts +57 -0
  46. package/dist/types/objects.d.ts +281 -0
  47. package/dist/types/pipelines.d.ts +135 -0
  48. package/dist/types/quotes.d.ts +143 -0
  49. package/dist/types/react.d.ts +978 -0
  50. package/dist/types/search.d.ts +99 -0
  51. package/dist/types/sequences.d.ts +255 -0
  52. package/dist/types/signals.d.ts +28 -0
  53. package/dist/types/skills.d.ts +176 -0
  54. package/dist/types/snippet.d.ts +24 -0
  55. package/dist/types/studio.d.ts +161 -0
  56. package/dist/types/tasks.d.ts +101 -0
  57. package/dist/types/types.d.ts +45 -0
  58. package/dist/types/utils.d.ts +21 -0
  59. package/dist/types/version.d.ts +10 -0
  60. package/dist/types/visitors.d.ts +29 -0
  61. package/dist/types/voice.d.ts +304 -0
  62. package/dist/types/webhooks.d.ts +71 -0
  63. package/dist/types/workflows.d.ts +229 -0
  64. package/docs/agents.md +748 -0
  65. package/docs/api/README.md +165 -0
  66. package/docs/api/accounts.d.ts +396 -0
  67. package/docs/api/accounts.md +644 -0
  68. package/docs/api/adCampaigns.d.ts +707 -0
  69. package/docs/api/adCampaigns.md +1091 -0
  70. package/docs/api/adCreatives.d.ts +996 -0
  71. package/docs/api/adCreatives.md +1708 -0
  72. package/docs/api/agency.d.ts +556 -0
  73. package/docs/api/agency.md +845 -0
  74. package/docs/api/agent.d.ts +330 -0
  75. package/docs/api/agent.md +514 -0
  76. package/docs/api/agents.d.ts +1622 -0
  77. package/docs/api/agents.md +2860 -0
  78. package/docs/api/aiInbox.d.ts +1984 -0
  79. package/docs/api/aiInbox.md +3490 -0
  80. package/docs/api/analytics.d.ts +1273 -0
  81. package/docs/api/analytics.md +2095 -0
  82. package/docs/api/apiKeys.d.ts +252 -0
  83. package/docs/api/apiKeys.md +318 -0
  84. package/docs/api/appDeployments.d.ts +236 -0
  85. package/docs/api/appDeployments.md +471 -0
  86. package/docs/api/appDomains.d.ts +171 -0
  87. package/docs/api/appDomains.md +281 -0
  88. package/docs/api/appLogs.d.ts +120 -0
  89. package/docs/api/appLogs.md +159 -0
  90. package/docs/api/appObjects.d.ts +415 -0
  91. package/docs/api/appObjects.md +568 -0
  92. package/docs/api/appPages.d.ts +557 -0
  93. package/docs/api/appPages.md +796 -0
  94. package/docs/api/appPlatformTokens.d.ts +123 -0
  95. package/docs/api/appPlatformTokens.md +172 -0
  96. package/docs/api/appointments.d.ts +2361 -0
  97. package/docs/api/appointments.md +3917 -0
  98. package/docs/api/apps.d.ts +822 -0
  99. package/docs/api/apps.md +1342 -0
  100. package/docs/api/assertUpsert.d.ts +286 -0
  101. package/docs/api/assertUpsert.md +370 -0
  102. package/docs/api/audienceSyncs.d.ts +259 -0
  103. package/docs/api/audienceSyncs.md +395 -0
  104. package/docs/api/brandKit.d.ts +686 -0
  105. package/docs/api/brandKit.md +1133 -0
  106. package/docs/api/bugReports.d.ts +181 -0
  107. package/docs/api/bugReports.md +268 -0
  108. package/docs/api/by-path.md +3260 -0
  109. package/docs/api/calendarInvites.d.ts +117 -0
  110. package/docs/api/calendarInvites.md +148 -0
  111. package/docs/api/campaignWorkflows.d.ts +152 -0
  112. package/docs/api/campaignWorkflows.md +200 -0
  113. package/docs/api/campaigns.d.ts +721 -0
  114. package/docs/api/campaigns.md +1236 -0
  115. package/docs/api/channels.d.ts +171 -0
  116. package/docs/api/channels.md +235 -0
  117. package/docs/api/cliCampaigns.d.ts +205 -0
  118. package/docs/api/cliCampaigns.md +256 -0
  119. package/docs/api/cliPipelines.d.ts +324 -0
  120. package/docs/api/cliPipelines.md +562 -0
  121. package/docs/api/clickHouse.d.ts +115 -0
  122. package/docs/api/clickHouse.md +138 -0
  123. package/docs/api/companies.d.ts +1636 -0
  124. package/docs/api/companies.md +2211 -0
  125. package/docs/api/companyIntelligence.d.ts +299 -0
  126. package/docs/api/companyIntelligence.md +488 -0
  127. package/docs/api/contacts.d.ts +2173 -0
  128. package/docs/api/contacts.md +3143 -0
  129. package/docs/api/content.d.ts +968 -0
  130. package/docs/api/content.md +1667 -0
  131. package/docs/api/contentGridSkills.d.ts +177 -0
  132. package/docs/api/contentGridSkills.md +271 -0
  133. package/docs/api/copilot.d.ts +1017 -0
  134. package/docs/api/copilot.md +1765 -0
  135. package/docs/api/crmSyncs.d.ts +215 -0
  136. package/docs/api/crmSyncs.md +301 -0
  137. package/docs/api/customerSuccess.d.ts +491 -0
  138. package/docs/api/customerSuccess.md +776 -0
  139. package/docs/api/deals.d.ts +1696 -0
  140. package/docs/api/deals.md +2432 -0
  141. package/docs/api/deliverability.d.ts +418 -0
  142. package/docs/api/deliverability.md +677 -0
  143. package/docs/api/desk.d.ts +1765 -0
  144. package/docs/api/desk.md +3007 -0
  145. package/docs/api/dialer.d.ts +1185 -0
  146. package/docs/api/dialer.md +2166 -0
  147. package/docs/api/dialerAnalytics.d.ts +187 -0
  148. package/docs/api/dialerAnalytics.md +257 -0
  149. package/docs/api/documents.d.ts +895 -0
  150. package/docs/api/documents.md +1440 -0
  151. package/docs/api/duplicates.d.ts +195 -0
  152. package/docs/api/duplicates.md +315 -0
  153. package/docs/api/eSign.d.ts +38 -0
  154. package/docs/api/eSign.md +54 -0
  155. package/docs/api/eSignature.d.ts +242 -0
  156. package/docs/api/eSignature.md +341 -0
  157. package/docs/api/enrichment.d.ts +3207 -0
  158. package/docs/api/enrichment.md +5225 -0
  159. package/docs/api/events.d.ts +115 -0
  160. package/docs/api/events.md +105 -0
  161. package/docs/api/fields.d.ts +482 -0
  162. package/docs/api/fields.md +566 -0
  163. package/docs/api/forms.d.ts +1012 -0
  164. package/docs/api/forms.md +1542 -0
  165. package/docs/api/gtmCampaigns.d.ts +662 -0
  166. package/docs/api/gtmCampaigns.md +1044 -0
  167. package/docs/api/gtmContext.d.ts +1187 -0
  168. package/docs/api/gtmContext.md +2112 -0
  169. package/docs/api/gtmDeliverability.d.ts +60 -0
  170. package/docs/api/gtmDeliverability.md +63 -0
  171. package/docs/api/gtmKnowledgeBase.d.ts +76 -0
  172. package/docs/api/gtmKnowledgeBase.md +91 -0
  173. package/docs/api/gtmLaunchHelpers.d.ts +123 -0
  174. package/docs/api/gtmLaunchHelpers.md +148 -0
  175. package/docs/api/gtmLibrary.d.ts +448 -0
  176. package/docs/api/gtmLibrary.md +780 -0
  177. package/docs/api/health.d.ts +39 -0
  178. package/docs/api/health.md +58 -0
  179. package/docs/api/imageLibrary.d.ts +341 -0
  180. package/docs/api/imageLibrary.md +569 -0
  181. package/docs/api/imports.d.ts +157 -0
  182. package/docs/api/imports.md +174 -0
  183. package/docs/api/inbox.d.ts +709 -0
  184. package/docs/api/inbox.md +1067 -0
  185. package/docs/api/install.d.ts +213 -0
  186. package/docs/api/install.md +317 -0
  187. package/docs/api/installedApps.d.ts +131 -0
  188. package/docs/api/installedApps.md +241 -0
  189. package/docs/api/integrationStatus.d.ts +142 -0
  190. package/docs/api/integrationStatus.md +205 -0
  191. package/docs/api/integrations.d.ts +2327 -0
  192. package/docs/api/integrations.md +3791 -0
  193. package/docs/api/intent.d.ts +482 -0
  194. package/docs/api/intent.md +858 -0
  195. package/docs/api/knowledge.d.ts +501 -0
  196. package/docs/api/knowledge.md +843 -0
  197. package/docs/api/knowledgeBase.d.ts +84 -0
  198. package/docs/api/knowledgeBase.md +96 -0
  199. package/docs/api/landingPages.d.ts +1411 -0
  200. package/docs/api/landingPages.md +2488 -0
  201. package/docs/api/leads.d.ts +133 -0
  202. package/docs/api/leads.md +180 -0
  203. package/docs/api/library.d.ts +217 -0
  204. package/docs/api/library.md +338 -0
  205. package/docs/api/linkedIn.d.ts +227 -0
  206. package/docs/api/linkedIn.md +289 -0
  207. package/docs/api/linkedInOutreach.d.ts +727 -0
  208. package/docs/api/linkedInOutreach.md +990 -0
  209. package/docs/api/lists.d.ts +1106 -0
  210. package/docs/api/lists.md +1609 -0
  211. package/docs/api/logs.d.ts +71 -0
  212. package/docs/api/logs.md +70 -0
  213. package/docs/api/mailboxes.d.ts +1050 -0
  214. package/docs/api/mailboxes.md +1690 -0
  215. package/docs/api/marketingIntelligence.d.ts +256 -0
  216. package/docs/api/marketingIntelligence.md +454 -0
  217. package/docs/api/marketplace.d.ts +3173 -0
  218. package/docs/api/marketplace.md +5953 -0
  219. package/docs/api/mcp.d.ts +69 -0
  220. package/docs/api/mcp.md +69 -0
  221. package/docs/api/me.d.ts +54 -0
  222. package/docs/api/me.md +56 -0
  223. package/docs/api/meetings.d.ts +539 -0
  224. package/docs/api/meetings.md +747 -0
  225. package/docs/api/newsletter.d.ts +1613 -0
  226. package/docs/api/newsletter.md +2746 -0
  227. package/docs/api/notes.d.ts +517 -0
  228. package/docs/api/notes.md +888 -0
  229. package/docs/api/notifications.d.ts +94 -0
  230. package/docs/api/notifications.md +105 -0
  231. package/docs/api/objects.d.ts +621 -0
  232. package/docs/api/objects.md +1098 -0
  233. package/docs/api/openSearch.d.ts +234 -0
  234. package/docs/api/openSearch.md +297 -0
  235. package/docs/api/ops.d.ts +299 -0
  236. package/docs/api/ops.md +339 -0
  237. package/docs/api/orgGovernance.d.ts +393 -0
  238. package/docs/api/orgGovernance.md +623 -0
  239. package/docs/api/orgVideos.d.ts +184 -0
  240. package/docs/api/orgVideos.md +252 -0
  241. package/docs/api/organizationSettings.d.ts +626 -0
  242. package/docs/api/organizationSettings.md +911 -0
  243. package/docs/api/phoneNumbers.d.ts +484 -0
  244. package/docs/api/phoneNumbers.md +777 -0
  245. package/docs/api/profile.d.ts +329 -0
  246. package/docs/api/profile.md +540 -0
  247. package/docs/api/programmaticPages.d.ts +400 -0
  248. package/docs/api/programmaticPages.md +626 -0
  249. package/docs/api/providerDomains.d.ts +866 -0
  250. package/docs/api/providerDomains.md +1446 -0
  251. package/docs/api/providerUsage.d.ts +129 -0
  252. package/docs/api/providerUsage.md +186 -0
  253. package/docs/api/public.d.ts +69 -0
  254. package/docs/api/public.md +78 -0
  255. package/docs/api/publicCopilot.d.ts +67 -0
  256. package/docs/api/publicCopilot.md +80 -0
  257. package/docs/api/publicSignals.d.ts +66 -0
  258. package/docs/api/publicSignals.md +71 -0
  259. package/docs/api/publicVisitors.d.ts +97 -0
  260. package/docs/api/publicVisitors.md +118 -0
  261. package/docs/api/quotes.d.ts +1564 -0
  262. package/docs/api/quotes.md +2553 -0
  263. package/docs/api/radar.d.ts +808 -0
  264. package/docs/api/radar.md +1431 -0
  265. package/docs/api/radarReports.d.ts +208 -0
  266. package/docs/api/radarReports.md +306 -0
  267. package/docs/api/recordRoles.d.ts +143 -0
  268. package/docs/api/recordRoles.md +175 -0
  269. package/docs/api/repos.d.ts +146 -0
  270. package/docs/api/repos.md +211 -0
  271. package/docs/api/research.d.ts +295 -0
  272. package/docs/api/research.md +534 -0
  273. package/docs/api/revenue.d.ts +402 -0
  274. package/docs/api/revenue.md +608 -0
  275. package/docs/api/revenueAnalytics.d.ts +147 -0
  276. package/docs/api/revenueAnalytics.md +212 -0
  277. package/docs/api/revenueLifecycle.d.ts +207 -0
  278. package/docs/api/revenueLifecycle.md +274 -0
  279. package/docs/api/revenueRecords.d.ts +372 -0
  280. package/docs/api/revenueRecords.md +563 -0
  281. package/docs/api/roles.d.ts +431 -0
  282. package/docs/api/roles.md +812 -0
  283. package/docs/api/salesCoach.d.ts +877 -0
  284. package/docs/api/salesCoach.md +1540 -0
  285. package/docs/api/sandbox.d.ts +210 -0
  286. package/docs/api/sandbox.md +380 -0
  287. package/docs/api/scans.d.ts +104 -0
  288. package/docs/api/scans.md +136 -0
  289. package/docs/api/scheduleBuy.d.ts +293 -0
  290. package/docs/api/scheduleBuy.md +431 -0
  291. package/docs/api/scraping.d.ts +266 -0
  292. package/docs/api/scraping.md +383 -0
  293. package/docs/api/sdrAnalytics.d.ts +138 -0
  294. package/docs/api/sdrAnalytics.md +246 -0
  295. package/docs/api/search.d.ts +598 -0
  296. package/docs/api/search.md +866 -0
  297. package/docs/api/seo.d.ts +447 -0
  298. package/docs/api/seo.md +660 -0
  299. package/docs/api/sequenceLifecycle.d.ts +439 -0
  300. package/docs/api/sequenceLifecycle.md +513 -0
  301. package/docs/api/sequences.d.ts +1936 -0
  302. package/docs/api/sequences.md +3232 -0
  303. package/docs/api/settings.d.ts +448 -0
  304. package/docs/api/settings.md +731 -0
  305. package/docs/api/signals.d.ts +1441 -0
  306. package/docs/api/signals.md +2526 -0
  307. package/docs/api/signatures.d.ts +719 -0
  308. package/docs/api/signatures.md +1247 -0
  309. package/docs/api/skills.d.ts +230 -0
  310. package/docs/api/skills.md +466 -0
  311. package/docs/api/snippet.d.ts +85 -0
  312. package/docs/api/snippet.md +106 -0
  313. package/docs/api/socialPublishing.d.ts +824 -0
  314. package/docs/api/socialPublishing.md +1245 -0
  315. package/docs/api/studioDocuments.d.ts +244 -0
  316. package/docs/api/studioDocuments.md +348 -0
  317. package/docs/api/support.d.ts +90 -0
  318. package/docs/api/support.md +76 -0
  319. package/docs/api/suppressions.d.ts +241 -0
  320. package/docs/api/suppressions.md +343 -0
  321. package/docs/api/surveys.d.ts +847 -0
  322. package/docs/api/surveys.md +1223 -0
  323. package/docs/api/tasks.d.ts +813 -0
  324. package/docs/api/tasks.md +1344 -0
  325. package/docs/api/teamMembers.d.ts +668 -0
  326. package/docs/api/teamMembers.md +1040 -0
  327. package/docs/api/teams.d.ts +784 -0
  328. package/docs/api/teams.md +1395 -0
  329. package/docs/api/usage.d.ts +277 -0
  330. package/docs/api/usage.md +389 -0
  331. package/docs/api/visitors.d.ts +690 -0
  332. package/docs/api/visitors.md +1075 -0
  333. package/docs/api/voice.d.ts +4661 -0
  334. package/docs/api/voice.md +7905 -0
  335. package/docs/api/webAnalytics.d.ts +964 -0
  336. package/docs/api/webAnalytics.md +1452 -0
  337. package/docs/api/webChat.d.ts +1704 -0
  338. package/docs/api/webChat.md +2048 -0
  339. package/docs/api/webhooks.d.ts +251 -0
  340. package/docs/api/webhooks.md +386 -0
  341. package/docs/api/websiteEditor.d.ts +324 -0
  342. package/docs/api/websiteEditor.md +517 -0
  343. package/docs/api/work.d.ts +2298 -0
  344. package/docs/api/work.md +3096 -0
  345. package/docs/api/workbench.d.ts +2962 -0
  346. package/docs/api/workbench.md +4884 -0
  347. package/docs/api/workflows.d.ts +1218 -0
  348. package/docs/api/workflows.md +2302 -0
  349. package/docs/sdk-clients.md +4339 -0
  350. package/package.json +10 -3
@@ -0,0 +1,125 @@
1
+ /**
2
+ * App-platform token exchange + refresh core (M6-9).
3
+ *
4
+ * The hosted-app clients never carry a permanent org API key. Instead they mint
5
+ * SHORT-LIVED app tokens by EXCHANGING a longer-lived credential, and refresh
6
+ * them on/near expiry:
7
+ *
8
+ * - browser apps exchange the caller's PropelAuth login at
9
+ * `POST /api/v1/app-sessions/exchange` (identity is derived server-side from
10
+ * the validated principal — the body only names the target app + scopes);
11
+ * - hosted backends exchange service client-credentials at
12
+ * `POST /api/v1/service-token`.
13
+ *
14
+ * Both endpoints answer with the reused `ApiResponse` envelope wrapping a
15
+ * `TokenResponse` (see developer_api/app_platform/app_tokens/dtos.py). This
16
+ * module owns:
17
+ *
18
+ * - `AppTokenResponse` — the minted-token payload shape (frozen wire contract);
19
+ * - `createTokenManager` — caches a token, refreshes it on/near expiry, and
20
+ * de-dupes concurrent refreshes into one in-flight exchange;
21
+ * - `createAppRequester` — binds the managed token onto the hardened
22
+ * `request()` core (typed `G8Error`, retries, idempotency, pagination),
23
+ * attaching `Authorization: Bearer <app-token>` (plus any static header such
24
+ * as a service client's `X-Target-Org-Id`) and refreshing once on a 401.
25
+ *
26
+ * The backend app-token API is INERT/unmounted today (behind a deny-by-default
27
+ * flag), so these paths are exercised against mocked HTTP, never a live server.
28
+ */
29
+ export declare const DEFAULT_APP_API = "https://be.graph8.com";
30
+ /** The minted app token + the non-secret metadata a client reads back.
31
+ * Mirrors `TokenResponse` in developer_api/app_platform/app_tokens/dtos.py. */
32
+ export interface AppTokenResponse {
33
+ /** The signed app JWT (attach as `Authorization: Bearer <access_token>`). */
34
+ access_token: string;
35
+ /** Always "Bearer". */
36
+ token_type: string;
37
+ /** Lifetime in seconds from issuance. */
38
+ expires_in: number;
39
+ /** The distinct-per-app, per-environment audience. */
40
+ audience: string;
41
+ /** App the token is bound to (dapp_-prefixed). */
42
+ app_id: string;
43
+ /** Signing key id (matches a JWKS entry). */
44
+ kid: string;
45
+ }
46
+ /** Per-request options accepted by an {@link AppRequest}. A subset of the
47
+ * hardened core's `RequestOptions` — auth (the app token) and the injected
48
+ * fetch/sleep seams are bound by the requester, not passed per call. */
49
+ export interface AppRequestOptions {
50
+ method?: string;
51
+ body?: unknown;
52
+ headers?: Record<string, string>;
53
+ query?: Record<string, unknown>;
54
+ /** Sent as `Idempotency-Key` for safe POST/PATCH retries. */
55
+ idempotencyKey?: string;
56
+ /** Max retry attempts on 429/5xx/network (default 2). */
57
+ maxRetries?: number;
58
+ /** Base backoff in ms (default 200). */
59
+ retryBaseMs?: number;
60
+ signal?: AbortSignal;
61
+ }
62
+ /** A token-bound request function: same ergonomics as the raw `request()` core
63
+ * minus the credential, which the token manager supplies. */
64
+ export type AppRequest = <T = unknown>(path: string, opts?: AppRequestOptions) => Promise<T>;
65
+ /** Caches + refreshes one app token. */
66
+ export interface TokenManager {
67
+ /** Return a valid token, refreshing on/near expiry. `force` refreshes now. */
68
+ getToken(force?: boolean): Promise<string>;
69
+ /** Current token expiry as an epoch-ms timestamp (0 before the first mint). */
70
+ expiresAt(): number;
71
+ }
72
+ /**
73
+ * Build a token manager over a `refresh` exchange.
74
+ *
75
+ * Freshness rule: a cached token is reused until it is within `refreshSkewMs`
76
+ * of expiry, then a refresh is triggered. Concurrent callers during a refresh
77
+ * share ONE in-flight exchange (no stampede). `now` is injectable for tests.
78
+ */
79
+ export declare function createTokenManager(args: {
80
+ refresh: () => Promise<AppTokenResponse>;
81
+ now?: () => number;
82
+ refreshSkewMs?: number;
83
+ }): TokenManager;
84
+ /**
85
+ * Bind a {@link TokenManager} onto the hardened `request()` core.
86
+ *
87
+ * Every call fetches the current token, attaches `Authorization: Bearer …`
88
+ * (plus any `extraHeaders`, e.g. a service client's `X-Target-Org-Id`), and
89
+ * reuses all of the core's typed errors / retries / idempotency. On a 401 —
90
+ * a token revoked or gone stale mid-window — it force-refreshes ONCE and retries.
91
+ */
92
+ export declare function createAppRequester(args: {
93
+ baseUrl: string;
94
+ tokens: TokenManager;
95
+ extraHeaders?: Record<string, string>;
96
+ fetchImpl?: typeof fetch;
97
+ sleepImpl?: (ms: number) => Promise<void>;
98
+ }): AppRequest;
99
+ /**
100
+ * Exchange the caller's PropelAuth token for a short-lived BROWSER app token.
101
+ * `POST /api/v1/app-sessions/exchange` (body = target app + scopes only;
102
+ * identity/role/tenant are derived server-side from the validated principal).
103
+ */
104
+ export declare function exchangeBrowserToken(args: {
105
+ baseUrl: string;
106
+ appId: string;
107
+ scopes?: string[];
108
+ getPropelAuthToken: () => string | Promise<string>;
109
+ fetchImpl?: typeof fetch;
110
+ sleepImpl?: (ms: number) => Promise<void>;
111
+ }): Promise<AppTokenResponse>;
112
+ /**
113
+ * Exchange service client-credentials for a SERVICE app token.
114
+ * `POST /api/v1/service-token` — credentials travel in the body; this endpoint
115
+ * has no bearer auth, so no `Authorization` is sent on the exchange itself.
116
+ */
117
+ export declare function exchangeServiceToken(args: {
118
+ baseUrl: string;
119
+ clientId: string;
120
+ clientSecret: string;
121
+ scopes?: string[];
122
+ ttlSeconds?: number;
123
+ fetchImpl?: typeof fetch;
124
+ sleepImpl?: (ms: number) => Promise<void>;
125
+ }): Promise<AppTokenResponse>;
@@ -0,0 +1,130 @@
1
+ /**
2
+ * App lifecycle. `draft` serves no traffic; `published` is live; `suspended` is a
3
+ * platform action and cannot be set through this client; `archived` is retired.
4
+ *
5
+ * `active` is the pre-D12c spelling of `published` and is still accepted on write
6
+ * by the backend, so an older caller keeps working. Prefer `published`.
7
+ */
8
+ export type AppStatus = "draft" | "published" | "suspended" | "archived";
9
+ /** Install / consent lifecycle for one client org. */
10
+ export type InstallStatus = "pending" | "consented" | "revoked" | "suspended" | "expired";
11
+ /** An app you build on graph8, which your customers install into their workspace. */
12
+ export interface App {
13
+ app_id: string;
14
+ builder_org_id: string;
15
+ /** Stable identifier, unique within your organization — not globally. */
16
+ slug: string;
17
+ name: string;
18
+ status: string;
19
+ /** https-only origins a BROWSER app token may be presented from. */
20
+ registered_origins: string[];
21
+ default_hostname: string | null;
22
+ created_at: string | null;
23
+ archived_at: string | null;
24
+ }
25
+ /** One client organization's installation of your app. */
26
+ export interface AppInstallation {
27
+ install_id: string;
28
+ app_id: string;
29
+ client_org_id: string;
30
+ status: string;
31
+ consented_scopes: string[];
32
+ created_at: string | null;
33
+ revoked_at: string | null;
34
+ }
35
+ /** Credits your app consumed in one calendar month. */
36
+ export interface AppUsageSummary {
37
+ app_id: string;
38
+ /** Calendar month, `YYYY-MM`. */
39
+ period: string;
40
+ total_credits: number;
41
+ event_count: number;
42
+ /**
43
+ * Credits per CLIENT org — whose data was touched, not who paid. You pay for
44
+ * all of them, so a breakdown keyed on the payer would collapse into one row.
45
+ */
46
+ per_client_credits: Record<string, number>;
47
+ }
48
+ /** A hard credit cap. `null` from `getLimit` means uncapped. */
49
+ export interface AppLimit {
50
+ app_id: string;
51
+ window: string;
52
+ credit_cap: number;
53
+ created_at: string | null;
54
+ }
55
+ export interface AppCreateParams {
56
+ name: string;
57
+ /** Unique within your organization. Lowercased on write. */
58
+ slug: string;
59
+ /**
60
+ * https-only origins a browser app token may be presented from. An `http://`
61
+ * origin is rejected at registration — a bearer token sent over plain http is
62
+ * a token disclosed to the network.
63
+ */
64
+ registered_origins?: string[];
65
+ }
66
+ /**
67
+ * Apps API — manage the apps you build on graph8 (M6). Requires an API key
68
+ * (server-side). On the hardened HTTP core: throws a typed `G8Error` on failure
69
+ * and retries transient errors.
70
+ *
71
+ * PREVIEW AND GATED. Every endpoint returns 403 `builder_not_allowlisted` unless
72
+ * the platform is enabled AND your organization is on the builder allowlist.
73
+ * Both are off by default, so a call fails fast and loudly rather than returning
74
+ * an empty list that looks like "you have no apps".
75
+ *
76
+ * A note on 404s: an app id belonging to ANOTHER organization returns 404, not
77
+ * 403 — the two are deliberately indistinguishable so app ids cannot be
78
+ * enumerated by guessing.
79
+ *
80
+ * Backed by:
81
+ * GET /api/v1/apps — list your apps
82
+ * POST /api/v1/apps — create one (starts in `draft`)
83
+ * GET /api/v1/apps/{app_id} — fetch one
84
+ * POST /api/v1/apps/{app_id}/status — move it through its lifecycle
85
+ * GET /api/v1/apps/{app_id}/installs — who installed it, and their consent
86
+ * GET /api/v1/apps/{app_id}/usage — credits consumed in a month
87
+ * GET /api/v1/apps/{app_id}/limit — the hard cap, or null
88
+ */
89
+ export declare const createAppsClient: (apiKey: string, apiUrl?: string) => {
90
+ /** List your organization's apps, newest first. */
91
+ list(): Promise<{
92
+ data: App[];
93
+ }>;
94
+ /** Fetch one of your apps. Throws `G8Error` (404) if it is not yours. */
95
+ get(appId: string): Promise<App>;
96
+ /**
97
+ * Create an app. It starts in `draft` and serves no traffic until published.
98
+ * Throws `G8Error` (409) when the slug is already taken in your org.
99
+ */
100
+ create(params: AppCreateParams): Promise<App>;
101
+ /**
102
+ * Move an app through its lifecycle: `draft` → `published` → `archived`.
103
+ *
104
+ * `suspended` is excluded from the parameter type on purpose: it is the
105
+ * platform's kill switch for an abusive app, the backend refuses it with a
106
+ * 403, and a builder who could set it could also unset it.
107
+ */
108
+ setStatus(appId: string, status: Exclude<AppStatus, "suspended">): Promise<App>;
109
+ /**
110
+ * The client organizations that installed this app, and their consent state.
111
+ * Includes `pending` and `revoked` installs — if your app cannot reach a
112
+ * tenant, this is where you see why.
113
+ */
114
+ listInstalls(appId: string): Promise<{
115
+ data: AppInstallation[];
116
+ }>;
117
+ /**
118
+ * Credits this app consumed in a calendar month, broken down per client org.
119
+ * Defaults to the current month. A month with no usage returns zeroes, not a
120
+ * 404 — "nothing happened" is an answer.
121
+ */
122
+ usage(appId: string, period?: string): Promise<AppUsageSummary>;
123
+ /**
124
+ * This app's hard credit cap, or `null` when it is uncapped.
125
+ *
126
+ * `null` is the real answer, not an empty object: there is no "unlimited"
127
+ * sentinel, so an accidental zero can never read as "no limit".
128
+ */
129
+ getLimit(appId: string): Promise<AppLimit | null>;
130
+ };
@@ -0,0 +1,88 @@
1
+ /** Ad platform an audience can sync to. */
2
+ export type AudienceSyncPlatform = "meta" | "linkedin" | "google" | "x";
3
+ /** Sync mode: full mirror, or only ever add members. */
4
+ export type AudienceSyncMode = "mirror" | "append_only";
5
+ export interface AudienceSync {
6
+ id: number;
7
+ audience_id: number;
8
+ platform: string;
9
+ platform_audience_name: string | null;
10
+ mode: string;
11
+ refresh_cadence_hours: number;
12
+ is_active: boolean;
13
+ status: string | null;
14
+ last_sync_at: string | null;
15
+ created_at: string | null;
16
+ }
17
+ export interface AudienceSyncCreateParams {
18
+ /** Audience list ID to sync. */
19
+ audience_id: number;
20
+ platform: AudienceSyncPlatform;
21
+ platform_audience_name?: string;
22
+ /** Default "mirror". */
23
+ mode?: AudienceSyncMode;
24
+ /** Refresh cadence in hours (0-720; default 24). */
25
+ refresh_cadence_hours?: number;
26
+ /** Platform-specific config (OAuth creds, ad-account ids, etc.). */
27
+ platform_config?: Record<string, unknown>;
28
+ /** Audience list IDs whose members should be suppressed from the sync. */
29
+ suppression_list_ids?: number[];
30
+ }
31
+ export interface AudienceSyncUpdateParams {
32
+ mode?: AudienceSyncMode;
33
+ refresh_cadence_hours?: number;
34
+ is_active?: boolean;
35
+ suppression_list_ids?: number[];
36
+ }
37
+ export interface AudienceSyncRun {
38
+ id: number;
39
+ started_at: string | null;
40
+ finished_at: string | null;
41
+ status: string | null;
42
+ members_added: number | null;
43
+ members_removed: number | null;
44
+ total_members: number | null;
45
+ error_message: string | null;
46
+ }
47
+ export interface AudienceSyncError {
48
+ id: number;
49
+ started_at: string | null;
50
+ error_message: string | null;
51
+ details: Record<string, unknown> | null;
52
+ }
53
+ /**
54
+ * Audiences API — sync an audience list to ad platforms (Meta, LinkedIn,
55
+ * Google, X). Requires API key (server-side). Built on the hardened HTTP core,
56
+ * so every method throws a typed `G8Error` on failure and retries transient
57
+ * 429/5xx/network errors.
58
+ *
59
+ * Backed by `/api/v1/audience-syncs`.
60
+ */
61
+ export declare const createAudiencesClient: (apiKey: string, apiUrl?: string) => {
62
+ /** List all audience syncs for the organization. */
63
+ list(): Promise<{
64
+ data: AudienceSync[];
65
+ }>;
66
+ /** Create a new audience sync to an ad platform. */
67
+ create(params: AudienceSyncCreateParams): Promise<AudienceSync>;
68
+ /** Get a single audience sync by ID. */
69
+ get(configId: number): Promise<AudienceSync>;
70
+ /** Update an audience sync (partial). */
71
+ update(configId: number, fields: AudienceSyncUpdateParams): Promise<AudienceSync>;
72
+ /** Delete an audience sync. */
73
+ delete(configId: number): Promise<{
74
+ data: Record<string, unknown>;
75
+ }>;
76
+ /** Trigger an immediate sync run for a config. */
77
+ trigger(configId: number): Promise<{
78
+ data: Record<string, unknown>;
79
+ }>;
80
+ /** List recent sync runs for a config (most recent first). */
81
+ runs(configId: number): Promise<{
82
+ data: AudienceSyncRun[];
83
+ }>;
84
+ /** List recent sync errors for a config. */
85
+ errors(configId: number): Promise<{
86
+ data: AudienceSyncError[];
87
+ }>;
88
+ };
@@ -0,0 +1,55 @@
1
+ export interface CalendarConfig {
2
+ /** Event type slug (e.g. "demo-30min") */
3
+ eventType: string;
4
+ /** Username of the host */
5
+ username: string;
6
+ /** Pre-fill attendee info */
7
+ prefill?: {
8
+ name?: string;
9
+ email?: string;
10
+ notes?: string;
11
+ };
12
+ }
13
+ export interface TimeSlot {
14
+ start: string;
15
+ end: string;
16
+ available: boolean;
17
+ }
18
+ export interface Booking {
19
+ uid: string;
20
+ confirmation_url: string;
21
+ start_time: string;
22
+ end_time: string;
23
+ }
24
+ export interface BookingRequest {
25
+ event_type_id: number;
26
+ slot: string;
27
+ attendee: {
28
+ name: string;
29
+ email: string;
30
+ notes?: string;
31
+ };
32
+ }
33
+ type CalendarEvent = "booked" | "cancelled" | "slot_selected";
34
+ type CalendarCallback = (data: Record<string, unknown>) => void;
35
+ /**
36
+ * Calendar and booking - show scheduling widgets, get slots, book meetings.
37
+ *
38
+ * Public endpoints - no API key needed.
39
+ */
40
+ export declare const createCalendarClient: (apiUrl?: string) => {
41
+ /** Show a booking modal overlay. */
42
+ show(config: CalendarConfig): void;
43
+ /** Embed booking widget inline in a container element. */
44
+ embed(selector: string, config: CalendarConfig): void;
45
+ /** Get available time slots for an event type. */
46
+ slots(username: string, eventSlug: string, range: {
47
+ start: string;
48
+ end: string;
49
+ }): Promise<TimeSlot[]>;
50
+ /** Book a meeting programmatically. */
51
+ book(request: BookingRequest): Promise<Booking | null>;
52
+ /** Listen for calendar events. */
53
+ on(event: CalendarEvent, callback: CalendarCallback): void;
54
+ };
55
+ export {};
@@ -0,0 +1,61 @@
1
+ export interface Campaign {
2
+ id: string;
3
+ name: string;
4
+ slug: string;
5
+ status: string;
6
+ category: string | null;
7
+ goal: string | null;
8
+ target_persona: string | null;
9
+ }
10
+ export interface CampaignCreateConfig {
11
+ name: string;
12
+ category?: string;
13
+ brief?: string;
14
+ core_concept?: string;
15
+ primary_hook?: string;
16
+ target_persona?: string;
17
+ goal?: string;
18
+ }
19
+ export interface CampaignLaunchExecution {
20
+ status: string;
21
+ contacts_total?: number;
22
+ contacts_scheduled?: number;
23
+ contacts_queued?: number;
24
+ job_id?: string;
25
+ polling_url?: string;
26
+ orchestrator_version?: string;
27
+ }
28
+ export interface CampaignLaunchResult {
29
+ status: string;
30
+ campaign_id: string;
31
+ sequence_id: string;
32
+ sequence_name: string;
33
+ steps_created: number;
34
+ link_id: string;
35
+ warnings: string[];
36
+ channels_attached: Array<{
37
+ mailbox_id: number;
38
+ email: string;
39
+ channel_type: string;
40
+ auto_picked: boolean;
41
+ }>;
42
+ agent_assigned: {
43
+ textual_agent_name: string | null;
44
+ voice_agent_name: string | null;
45
+ };
46
+ schedule_id: string | null;
47
+ appointment_id: number | null;
48
+ execution: CampaignLaunchExecution;
49
+ message: string;
50
+ }
51
+ /**
52
+ * Campaigns - create, manage, launch campaigns. Requires API key (server-side).
53
+ * On the hardened HTTP core: throws a typed `G8Error` on failure and retries
54
+ * transient errors.
55
+ */
56
+ export declare const createCampaignsClient: (apiKey: string, apiUrl?: string) => {
57
+ list(page?: number, limit?: number): Promise<Campaign[]>;
58
+ get(campaignId: string): Promise<Campaign>;
59
+ create(config: CampaignCreateConfig): Promise<Campaign>;
60
+ launch(campaignId: string): Promise<CampaignLaunchResult>;
61
+ };
@@ -0,0 +1,35 @@
1
+ export interface ChatConfig {
2
+ /** Agent ID to connect to */
3
+ agentId?: string;
4
+ /** Pre-filled first message */
5
+ message?: string;
6
+ /** Widget position */
7
+ position?: "bottom-right" | "bottom-left";
8
+ /** Widget theme */
9
+ theme?: "light" | "dark" | "auto";
10
+ /** Custom greeting */
11
+ greeting?: string;
12
+ /** Custom avatar URL */
13
+ avatar?: string;
14
+ }
15
+ type ChatEvent = "message" | "human_transfer" | "open" | "close" | "error";
16
+ type ChatCallback = (data: Record<string, unknown>) => void;
17
+ /**
18
+ * Webchat - live chat + AI chat embedded in any app.
19
+ *
20
+ * Uses WebSocket connection to the voice/chat agent backend.
21
+ * Public - no API key needed (org/agent IDs are in the config).
22
+ */
23
+ export declare const createChatClient: (writeKey: string, apiUrl?: string) => {
24
+ /** Open the chat widget. */
25
+ open(config?: ChatConfig): void;
26
+ /** Send a message. */
27
+ send(message: string): void;
28
+ /** Listen for chat events. */
29
+ on(event: ChatEvent, callback: ChatCallback): void;
30
+ /** Configure the chat appearance. */
31
+ configure(config: Partial<ChatConfig>): void;
32
+ /** Close the chat widget. */
33
+ close(): void;
34
+ };
35
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The `@graph8/sdk` command line (the package's `bin`), run with npx:
3
+ *
4
+ * npx @graph8/sdk init-agent [--claude] [--codex] [--cursor] [--dry-run]
5
+ *
6
+ * Node only. Built as a separate entry (dist/cli.js), so nothing here reaches
7
+ * the browser bundle or the package's main exports.
8
+ */
9
+ export interface CliIO {
10
+ cwd: string;
11
+ out: (line: string) => void;
12
+ err: (line: string) => void;
13
+ }
14
+ export declare function runCli(argv: string[], io: CliIO): number;
@@ -0,0 +1,123 @@
1
+ export interface Company {
2
+ id: number;
3
+ name: string | null;
4
+ domain: string | null;
5
+ industry: string | null;
6
+ employee_count: number | null;
7
+ revenue: number | null;
8
+ founded_year: number | null;
9
+ description: string | null;
10
+ linkedin_url: string | null;
11
+ country: string | null;
12
+ state: string | null;
13
+ city: string | null;
14
+ }
15
+ export interface CompanyListParams {
16
+ page?: number;
17
+ limit?: number;
18
+ domain?: string;
19
+ industry?: string;
20
+ name?: string;
21
+ country?: string;
22
+ }
23
+ export interface CompanyUpdateParams {
24
+ name?: string;
25
+ domain?: string;
26
+ industry?: string;
27
+ description?: string;
28
+ linkedin_url?: string;
29
+ country?: string;
30
+ state?: string;
31
+ city?: string;
32
+ }
33
+ export interface CompanyContact {
34
+ id: number;
35
+ first_name: string | null;
36
+ last_name: string | null;
37
+ work_email: string | null;
38
+ job_title: string | null;
39
+ }
40
+ /** A column definition on companies (base or custom). */
41
+ export interface CompanyColumn {
42
+ id: number | null;
43
+ title: string;
44
+ data_type: string;
45
+ name: string | null;
46
+ /** Stringified list_id when list-scoped, otherwise null/empty for global. */
47
+ object_id: string | null;
48
+ is_global: boolean;
49
+ }
50
+ export interface CompanyCreateParams {
51
+ /**
52
+ * Company domain, e.g. "acme.com". REQUIRED — it drives dedup: an existing
53
+ * company with the same domain is reused rather than duplicated.
54
+ */
55
+ domain: string;
56
+ name?: string;
57
+ website?: string;
58
+ phone?: string;
59
+ address?: string;
60
+ city?: string;
61
+ state?: string;
62
+ country?: string;
63
+ zip?: string;
64
+ industry?: string;
65
+ /** Sent as a string by the API (e.g. "51-200"), not a number. */
66
+ employee_count?: string;
67
+ linkedin_url?: string;
68
+ /** Optional list to add the company to after creation. */
69
+ list_id?: number;
70
+ }
71
+ export interface CompanyCreateResult {
72
+ status: string;
73
+ /** mashup_companies.id — pass to contacts.update({company_id}) or use on a deal. */
74
+ company_id: number | null;
75
+ /** True when an existing company with the same domain was reused. */
76
+ merged: boolean;
77
+ }
78
+ export interface CompanyColumnCreateParams {
79
+ title: string;
80
+ /** Email of the user creating the column. Required by the backend (audit). */
81
+ created_by: string;
82
+ /** "text" (default) — additional types may be added later. */
83
+ data_type?: string;
84
+ /** If set, the column is list-specific. Omit for org-wide global column. */
85
+ list_id?: number;
86
+ }
87
+ /**
88
+ * Companies API - search and manage CRM companies. Requires API key (server-side).
89
+ */
90
+ export declare const createCompaniesClient: (apiKey: string, apiUrl?: string) => {
91
+ /**
92
+ * Create a company. `domain` is required and drives dedup — an existing
93
+ * company with the same domain is reused (`merged: true`) rather than
94
+ * duplicated. Routes to the same handler the in-app "add company" flow uses.
95
+ */
96
+ create(params: CompanyCreateParams): Promise<CompanyCreateResult>;
97
+ /** List companies with optional filters. */
98
+ list(params?: CompanyListParams): Promise<{
99
+ data: Company[];
100
+ total: number;
101
+ }>;
102
+ /** Get a single company by ID. */
103
+ get(companyId: number): Promise<Company>;
104
+ /** Get contacts belonging to a company. */
105
+ contacts(companyId: number, limit?: number, offset?: number): Promise<{
106
+ data: CompanyContact[];
107
+ total: number;
108
+ }>;
109
+ /** Update a company (partial). */
110
+ update(companyId: number, fields: CompanyUpdateParams): Promise<{
111
+ updated: number;
112
+ }>;
113
+ /** Delete a company (soft-delete). */
114
+ delete(companyId: number): Promise<{
115
+ deleted: boolean;
116
+ }>;
117
+ /** List custom company columns. Pass listId to include list-specific columns. */
118
+ listColumns(listId?: number): Promise<{
119
+ data: CompanyColumn[];
120
+ }>;
121
+ /** Create a custom company column. Global if list_id is omitted, list-scoped otherwise. */
122
+ createColumn(params: CompanyColumnCreateParams): Promise<CompanyColumn>;
123
+ };