@graph8/sdk 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +408 -19
- package/dist/index.d.ts +408 -19
- package/dist/index.js +244 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +244 -38
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +400 -15
- package/dist/react.d.ts +400 -15
- package/dist/react.js +244 -38
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +244 -38
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -578,6 +578,29 @@ interface IntentCompany {
|
|
|
578
578
|
visit_count: number;
|
|
579
579
|
last_seen: string | null;
|
|
580
580
|
}
|
|
581
|
+
/** One company row from `intent.urlCompanies()`. Richer than {@link IntentCompany},
|
|
582
|
+
* which describes the keyword-companies surface. */
|
|
583
|
+
interface IntentUrlCompany {
|
|
584
|
+
company_id: number | null;
|
|
585
|
+
name: string | null;
|
|
586
|
+
domain: string | null;
|
|
587
|
+
industry: string | null;
|
|
588
|
+
employee_count: number | null;
|
|
589
|
+
logo_url: string | null;
|
|
590
|
+
audience: string;
|
|
591
|
+
visit_count: number;
|
|
592
|
+
contacts_seen: number;
|
|
593
|
+
last_seen: string | null;
|
|
594
|
+
}
|
|
595
|
+
/** Response of `intent.urlCompanies()`. This endpoint returns a bare aggregate,
|
|
596
|
+
* not the `{ data }` envelope the rest of the Developer API uses. */
|
|
597
|
+
interface IntentUrlCompaniesResponse {
|
|
598
|
+
url: string;
|
|
599
|
+
total_companies: number;
|
|
600
|
+
b2b_count: number;
|
|
601
|
+
b2c_count: number;
|
|
602
|
+
companies: IntentUrlCompany[];
|
|
603
|
+
}
|
|
581
604
|
interface IntentContact {
|
|
582
605
|
contact_id: number | null;
|
|
583
606
|
email: string | null;
|
|
@@ -612,7 +635,7 @@ interface IntentStats {
|
|
|
612
635
|
* POST /api/v1/intent/pages/visitors
|
|
613
636
|
* POST /api/v1/intent/pages/contacts
|
|
614
637
|
* POST /api/v1/intent/pages/visitor-counts
|
|
615
|
-
* POST /intent
|
|
638
|
+
* POST /api/v1/intent/url-companies
|
|
616
639
|
*/
|
|
617
640
|
declare const createIntentClient: (apiKey: string, apiUrl?: string) => {
|
|
618
641
|
/** Org-level intent stats (totals over the last 30 days). */
|
|
@@ -695,16 +718,24 @@ declare const createIntentClient: (apiKey: string, apiUrl?: string) => {
|
|
|
695
718
|
/**
|
|
696
719
|
* Find companies whose users visited a specific URL (intent search).
|
|
697
720
|
*
|
|
698
|
-
*
|
|
699
|
-
*
|
|
721
|
+
* Previously posted to the bare-host `/intent-search/url-companies`, bypassing
|
|
722
|
+
* the shared `post()` helper. That route is JWT-only, so this method could
|
|
723
|
+
* never actually work with an API key. It now goes through
|
|
724
|
+
* `/api/v1/intent/url-companies` like the rest of the intent surface (g8 issue
|
|
725
|
+
* #16536).
|
|
726
|
+
*
|
|
727
|
+
* Returns a bare aggregate, NOT the `{ data }` envelope — the previous
|
|
728
|
+
* `{ data: IntentCompany[] }` signature never matched what the API sends.
|
|
729
|
+
*
|
|
730
|
+
* `date_from` / `date_to` are accepted for backwards compatibility but have
|
|
731
|
+
* never been read by this endpoint; use `days` to set the lookback window.
|
|
700
732
|
*/
|
|
701
733
|
urlCompanies(url: string, params?: {
|
|
702
734
|
limit?: number;
|
|
735
|
+
days?: number;
|
|
703
736
|
date_from?: string;
|
|
704
737
|
date_to?: string;
|
|
705
|
-
}): Promise<
|
|
706
|
-
data: IntentCompany[];
|
|
707
|
-
}>;
|
|
738
|
+
}): Promise<IntentUrlCompaniesResponse>;
|
|
708
739
|
};
|
|
709
740
|
|
|
710
741
|
type SkillType = "llm" | "api";
|
|
@@ -1553,14 +1584,28 @@ interface DealCreateParams {
|
|
|
1553
1584
|
*/
|
|
1554
1585
|
company_id?: number;
|
|
1555
1586
|
description?: string;
|
|
1587
|
+
/**
|
|
1588
|
+
* Monetary value. Required (HTTP 400, marker `amount_required_for_won_stage`)
|
|
1589
|
+
* when creating directly in a Closed Won stage; 0 is a valid amount.
|
|
1590
|
+
*/
|
|
1556
1591
|
amount?: number;
|
|
1557
1592
|
/** Default: "USD". */
|
|
1558
1593
|
currency?: string;
|
|
1559
|
-
/**
|
|
1594
|
+
/**
|
|
1595
|
+
* Stage ID from the org's pipelines. Must exist and belong to `pipeline_id`
|
|
1596
|
+
* when both are sent (HTTP 422 otherwise). Defaults to the default
|
|
1597
|
+
* pipeline's first non-closed stage if omitted. Creating directly in a
|
|
1598
|
+
* closed stage triggers the closed-stage rules (HTTP 400 with marker
|
|
1599
|
+
* `close_date_required_for_won_stage` / `close_date_required_for_lost_stage`
|
|
1600
|
+
* / `amount_required_for_won_stage` / `owner_required_for_closed_stage`).
|
|
1601
|
+
*/
|
|
1560
1602
|
stage_id?: string;
|
|
1561
|
-
/** Pipeline ID. Defaults to org's default pipeline if omitted. */
|
|
1603
|
+
/** Pipeline ID. Must exist (HTTP 422 otherwise). Defaults to org's default pipeline if omitted. */
|
|
1562
1604
|
pipeline_id?: string;
|
|
1563
|
-
/**
|
|
1605
|
+
/**
|
|
1606
|
+
* ISO 8601 close date. Required when creating directly in a Closed Won or
|
|
1607
|
+
* Closed Lost stage; past dates are allowed (backdating is supported).
|
|
1608
|
+
*/
|
|
1564
1609
|
close_date?: string;
|
|
1565
1610
|
/**
|
|
1566
1611
|
* Set true to create a deal even if one already exists for the company.
|
|
@@ -1573,10 +1618,28 @@ interface DealUpdateParams {
|
|
|
1573
1618
|
description?: string;
|
|
1574
1619
|
amount?: number;
|
|
1575
1620
|
currency?: string;
|
|
1621
|
+
/**
|
|
1622
|
+
* New stage ID. Must be an existing stage in the deal's pipeline (HTTP 422
|
|
1623
|
+
* otherwise). Moving a deal INTO a Closed Won stage requires an effective
|
|
1624
|
+
* close_date AND amount; Closed Lost requires an effective close_date;
|
|
1625
|
+
* either requires an owner ("effective" = the value in this call, else the
|
|
1626
|
+
* deal's existing value). Violations return HTTP 400 with a marker-prefixed
|
|
1627
|
+
* detail: `close_date_required_for_won_stage`,
|
|
1628
|
+
* `close_date_required_for_lost_stage`, `amount_required_for_won_stage`,
|
|
1629
|
+
* `owner_required_for_closed_stage`. Re-submitting the deal's current stage
|
|
1630
|
+
* is never gated.
|
|
1631
|
+
*/
|
|
1576
1632
|
stage_id?: string;
|
|
1577
|
-
/**
|
|
1578
|
-
|
|
1579
|
-
|
|
1633
|
+
/**
|
|
1634
|
+
* ISO 8601 close date. Explicit null clears it, except on a deal sitting in
|
|
1635
|
+
* a closed stage (HTTP 400, closed-stage markers above).
|
|
1636
|
+
*/
|
|
1637
|
+
close_date?: string | null;
|
|
1638
|
+
/**
|
|
1639
|
+
* Reassign the deal owner (user id or email). Pass null to clear, except on
|
|
1640
|
+
* a deal sitting in a closed stage (HTTP 400, marker
|
|
1641
|
+
* `owner_required_for_closed_stage`).
|
|
1642
|
+
*/
|
|
1580
1643
|
owner_id?: string | null;
|
|
1581
1644
|
/**
|
|
1582
1645
|
* mashup_contact_ids to link. Must belong to the deal's company (if the deal
|
|
@@ -1676,6 +1739,298 @@ declare const createDealsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
1676
1739
|
}>;
|
|
1677
1740
|
};
|
|
1678
1741
|
|
|
1742
|
+
/** A custom object type in your workspace — a record type you define. */
|
|
1743
|
+
interface CustomObject {
|
|
1744
|
+
/** Stable API slug, e.g. `invoices`. */
|
|
1745
|
+
slug: string;
|
|
1746
|
+
singular_noun: string;
|
|
1747
|
+
plural_noun: string;
|
|
1748
|
+
/** True for object types graph8 ships; system objects cannot be deleted. */
|
|
1749
|
+
is_system: boolean;
|
|
1750
|
+
is_archived: boolean;
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* One attribute on a custom object, and the rules its values must satisfy.
|
|
1754
|
+
*
|
|
1755
|
+
* `attribute_type` is one of 16 supported types and decides how a value is
|
|
1756
|
+
* validated and canonicalized: `text`, `number`, `currency`, `date`,
|
|
1757
|
+
* `timestamp`, `checkbox`, `select`, `status`, `email_address`, `phone_number`,
|
|
1758
|
+
* `domain`, `location`, `personal_name`, `record_reference`, `rating`,
|
|
1759
|
+
* `actor_reference`.
|
|
1760
|
+
*/
|
|
1761
|
+
interface CustomObjectAttribute {
|
|
1762
|
+
slug: string;
|
|
1763
|
+
attribute_type: string;
|
|
1764
|
+
is_required: boolean;
|
|
1765
|
+
/** No two ACTIVE records may hold the same value. A collision returns 409. */
|
|
1766
|
+
is_unique: boolean;
|
|
1767
|
+
is_multiselect: boolean;
|
|
1768
|
+
/** Type-specific configuration, e.g. the allowed options for a `select`. */
|
|
1769
|
+
config: Record<string, unknown>;
|
|
1770
|
+
}
|
|
1771
|
+
/** One record, with its currently active attribute values. */
|
|
1772
|
+
interface CustomObjectRecord {
|
|
1773
|
+
id: string;
|
|
1774
|
+
object_slug: string;
|
|
1775
|
+
/**
|
|
1776
|
+
* Values keyed by attribute slug. Untyped by necessity — the valid keys come
|
|
1777
|
+
* from YOUR attribute definitions at runtime, so call `listAttributes` for the
|
|
1778
|
+
* schema. Saying `any` here would imply the shape was considered and found to
|
|
1779
|
+
* be free.
|
|
1780
|
+
*/
|
|
1781
|
+
values: Record<string, unknown>;
|
|
1782
|
+
is_archived: boolean;
|
|
1783
|
+
created_at: string | null;
|
|
1784
|
+
updated_at: string | null;
|
|
1785
|
+
}
|
|
1786
|
+
/** One generation of one attribute's value. */
|
|
1787
|
+
interface CustomObjectHistoryEntry {
|
|
1788
|
+
attribute: string;
|
|
1789
|
+
value: unknown;
|
|
1790
|
+
active_from: string | null;
|
|
1791
|
+
/** Null means this value is still in force. */
|
|
1792
|
+
active_until: string | null;
|
|
1793
|
+
actor_id: string | null;
|
|
1794
|
+
}
|
|
1795
|
+
interface CustomObjectHistory {
|
|
1796
|
+
record_id: string;
|
|
1797
|
+
entries: CustomObjectHistoryEntry[];
|
|
1798
|
+
}
|
|
1799
|
+
interface ListRecordsParams {
|
|
1800
|
+
page?: number;
|
|
1801
|
+
/** 1-200, default 50. */
|
|
1802
|
+
limit?: number;
|
|
1803
|
+
/** Opaque cursor from a prior response. Takes precedence over `page`. */
|
|
1804
|
+
cursor?: string;
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* Pagination envelope for record listings.
|
|
1808
|
+
*
|
|
1809
|
+
* Named distinctly rather than `PaginationMeta`: `deals.ts` and `quotes.ts` each
|
|
1810
|
+
* already declare their own structurally identical `PaginationMeta`, and one of
|
|
1811
|
+
* them is re-exported from `index.ts` — so a third with that name is a
|
|
1812
|
+
* `TS2300: Duplicate identifier` at the package's export site. Consolidating the
|
|
1813
|
+
* three into one shared type is worth doing and is not this change.
|
|
1814
|
+
*/
|
|
1815
|
+
interface ObjectPagination {
|
|
1816
|
+
page: number;
|
|
1817
|
+
limit: number;
|
|
1818
|
+
total: number;
|
|
1819
|
+
has_next: boolean;
|
|
1820
|
+
next_cursor: string | null;
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Custom Objects API — your own record types, their schema, and their records (M6-3).
|
|
1824
|
+
* Requires an API key (server-side). On the hardened HTTP core: throws a typed
|
|
1825
|
+
* `G8Error` on failure and retries transient errors.
|
|
1826
|
+
*
|
|
1827
|
+
* PREVIEW AND GATED. Every endpoint returns 403 `app_not_enabled` until the
|
|
1828
|
+
* custom-objects surface is switched on for the platform. It is off by default,
|
|
1829
|
+
* so a call fails fast rather than returning an empty list that reads as "you
|
|
1830
|
+
* have no objects".
|
|
1831
|
+
*
|
|
1832
|
+
* HOW THIS DIFFERS FROM `g8.fields`. A FIELD adds a column to an existing
|
|
1833
|
+
* contact or company. A CUSTOM OBJECT is a whole new record type with its own
|
|
1834
|
+
* attributes and its own records. Use fields to extend a contact; use custom
|
|
1835
|
+
* objects to model an invoice, a shipment, or a subscription.
|
|
1836
|
+
*
|
|
1837
|
+
* THREE BEHAVIOURS WORTH KNOWING BEFORE YOU WRITE
|
|
1838
|
+
*
|
|
1839
|
+
* 1. An unknown field is REJECTED (422), not ignored. A typo does not silently
|
|
1840
|
+
* lose your data, and the response lists every problem at once so a payload
|
|
1841
|
+
* with three mistakes takes one round trip to fix.
|
|
1842
|
+
* 2. `update` is a PARTIAL write. Attributes you omit are left alone; sending
|
|
1843
|
+
* an explicit `null` CLEARS one. The two are deliberately different.
|
|
1844
|
+
* 3. `archive` does not destroy anything. The record leaves listings, stays
|
|
1845
|
+
* readable by id, and keeps its history.
|
|
1846
|
+
*
|
|
1847
|
+
* Backed by:
|
|
1848
|
+
* GET /api/v1/objects
|
|
1849
|
+
* GET /api/v1/objects/{slug}
|
|
1850
|
+
* GET /api/v1/objects/{slug}/attributes
|
|
1851
|
+
* GET /api/v1/objects/{slug}/records
|
|
1852
|
+
* POST /api/v1/objects/{slug}/records
|
|
1853
|
+
* GET /api/v1/objects/{slug}/records/{id}
|
|
1854
|
+
* PATCH /api/v1/objects/{slug}/records/{id}
|
|
1855
|
+
* DELETE /api/v1/objects/{slug}/records/{id}
|
|
1856
|
+
* GET /api/v1/objects/{slug}/records/{id}/history
|
|
1857
|
+
*/
|
|
1858
|
+
declare const createObjectsClient: (apiKey: string, apiUrl?: string) => {
|
|
1859
|
+
/** List the custom object types in your workspace. */
|
|
1860
|
+
list(): Promise<{
|
|
1861
|
+
data: CustomObject[];
|
|
1862
|
+
}>;
|
|
1863
|
+
/** Fetch one object type by slug. */
|
|
1864
|
+
get(objectSlug: string): Promise<CustomObject>;
|
|
1865
|
+
/** The object's attributes — the schema its records must satisfy. */
|
|
1866
|
+
listAttributes(objectSlug: string): Promise<{
|
|
1867
|
+
data: CustomObjectAttribute[];
|
|
1868
|
+
}>;
|
|
1869
|
+
/** Paginated records with their current values. Archived records are excluded. */
|
|
1870
|
+
listRecords(objectSlug: string, params?: ListRecordsParams): Promise<{
|
|
1871
|
+
data: CustomObjectRecord[];
|
|
1872
|
+
pagination?: ObjectPagination;
|
|
1873
|
+
}>;
|
|
1874
|
+
/**
|
|
1875
|
+
* Create a record. Every field is validated against the object's attributes;
|
|
1876
|
+
* an unknown one is a 422 listing every problem at once, and a collision on a
|
|
1877
|
+
* unique attribute is a 409.
|
|
1878
|
+
*/
|
|
1879
|
+
createRecord(objectSlug: string, values: Record<string, unknown>): Promise<CustomObjectRecord>;
|
|
1880
|
+
/** Fetch one record with its currently active values. */
|
|
1881
|
+
getRecord(objectSlug: string, recordId: string): Promise<CustomObjectRecord>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Update a record. PARTIAL: only the attributes you send are touched, so
|
|
1884
|
+
* required attributes you omit are left alone rather than reported missing.
|
|
1885
|
+
* Sending an explicit `null` CLEARS that attribute.
|
|
1886
|
+
*
|
|
1887
|
+
* Values are versioned rather than overwritten, so the previous value stays
|
|
1888
|
+
* readable through `history`.
|
|
1889
|
+
*/
|
|
1890
|
+
updateRecord(objectSlug: string, recordId: string, values: Record<string, unknown>): Promise<CustomObjectRecord>;
|
|
1891
|
+
/**
|
|
1892
|
+
* Archive a record. It leaves listings, stays readable by id, and keeps its
|
|
1893
|
+
* history and associations. Nothing is destroyed.
|
|
1894
|
+
*/
|
|
1895
|
+
archiveRecord(objectSlug: string, recordId: string): Promise<CustomObjectRecord>;
|
|
1896
|
+
/**
|
|
1897
|
+
* A record's value timeline, newest first. An entry whose `active_until` is
|
|
1898
|
+
* null is the value currently in force.
|
|
1899
|
+
*/
|
|
1900
|
+
history(objectSlug: string, recordId: string, limit?: number): Promise<CustomObjectHistory>;
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* App lifecycle. `draft` serves no traffic; `published` is live; `suspended` is a
|
|
1905
|
+
* platform action and cannot be set through this client; `archived` is retired.
|
|
1906
|
+
*
|
|
1907
|
+
* `active` is the pre-D12c spelling of `published` and is still accepted on write
|
|
1908
|
+
* by the backend, so an older caller keeps working. Prefer `published`.
|
|
1909
|
+
*/
|
|
1910
|
+
type AppStatus = "draft" | "published" | "suspended" | "archived";
|
|
1911
|
+
/** Install / consent lifecycle for one client org. */
|
|
1912
|
+
type InstallStatus = "pending" | "consented" | "revoked" | "suspended" | "expired";
|
|
1913
|
+
/** An app you build on graph8, which your customers install into their workspace. */
|
|
1914
|
+
interface App {
|
|
1915
|
+
app_id: string;
|
|
1916
|
+
builder_org_id: string;
|
|
1917
|
+
/** Stable identifier, unique within your organization — not globally. */
|
|
1918
|
+
slug: string;
|
|
1919
|
+
name: string;
|
|
1920
|
+
status: string;
|
|
1921
|
+
/** https-only origins a BROWSER app token may be presented from. */
|
|
1922
|
+
registered_origins: string[];
|
|
1923
|
+
default_hostname: string | null;
|
|
1924
|
+
created_at: string | null;
|
|
1925
|
+
archived_at: string | null;
|
|
1926
|
+
}
|
|
1927
|
+
/** One client organization's installation of your app. */
|
|
1928
|
+
interface AppInstallation {
|
|
1929
|
+
install_id: string;
|
|
1930
|
+
app_id: string;
|
|
1931
|
+
client_org_id: string;
|
|
1932
|
+
status: string;
|
|
1933
|
+
consented_scopes: string[];
|
|
1934
|
+
created_at: string | null;
|
|
1935
|
+
revoked_at: string | null;
|
|
1936
|
+
}
|
|
1937
|
+
/** Credits your app consumed in one calendar month. */
|
|
1938
|
+
interface AppUsageSummary {
|
|
1939
|
+
app_id: string;
|
|
1940
|
+
/** Calendar month, `YYYY-MM`. */
|
|
1941
|
+
period: string;
|
|
1942
|
+
total_credits: number;
|
|
1943
|
+
event_count: number;
|
|
1944
|
+
/**
|
|
1945
|
+
* Credits per CLIENT org — whose data was touched, not who paid. You pay for
|
|
1946
|
+
* all of them, so a breakdown keyed on the payer would collapse into one row.
|
|
1947
|
+
*/
|
|
1948
|
+
per_client_credits: Record<string, number>;
|
|
1949
|
+
}
|
|
1950
|
+
/** A hard credit cap. `null` from `getLimit` means uncapped. */
|
|
1951
|
+
interface AppLimit {
|
|
1952
|
+
app_id: string;
|
|
1953
|
+
window: string;
|
|
1954
|
+
credit_cap: number;
|
|
1955
|
+
created_at: string | null;
|
|
1956
|
+
}
|
|
1957
|
+
interface AppCreateParams {
|
|
1958
|
+
name: string;
|
|
1959
|
+
/** Unique within your organization. Lowercased on write. */
|
|
1960
|
+
slug: string;
|
|
1961
|
+
/**
|
|
1962
|
+
* https-only origins a browser app token may be presented from. An `http://`
|
|
1963
|
+
* origin is rejected at registration — a bearer token sent over plain http is
|
|
1964
|
+
* a token disclosed to the network.
|
|
1965
|
+
*/
|
|
1966
|
+
registered_origins?: string[];
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Apps API — manage the apps you build on graph8 (M6). Requires an API key
|
|
1970
|
+
* (server-side). On the hardened HTTP core: throws a typed `G8Error` on failure
|
|
1971
|
+
* and retries transient errors.
|
|
1972
|
+
*
|
|
1973
|
+
* PREVIEW AND GATED. Every endpoint returns 403 `builder_not_allowlisted` unless
|
|
1974
|
+
* the platform is enabled AND your organization is on the builder allowlist.
|
|
1975
|
+
* Both are off by default, so a call fails fast and loudly rather than returning
|
|
1976
|
+
* an empty list that looks like "you have no apps".
|
|
1977
|
+
*
|
|
1978
|
+
* A note on 404s: an app id belonging to ANOTHER organization returns 404, not
|
|
1979
|
+
* 403 — the two are deliberately indistinguishable so app ids cannot be
|
|
1980
|
+
* enumerated by guessing.
|
|
1981
|
+
*
|
|
1982
|
+
* Backed by:
|
|
1983
|
+
* GET /api/v1/apps — list your apps
|
|
1984
|
+
* POST /api/v1/apps — create one (starts in `draft`)
|
|
1985
|
+
* GET /api/v1/apps/{app_id} — fetch one
|
|
1986
|
+
* POST /api/v1/apps/{app_id}/status — move it through its lifecycle
|
|
1987
|
+
* GET /api/v1/apps/{app_id}/installs — who installed it, and their consent
|
|
1988
|
+
* GET /api/v1/apps/{app_id}/usage — credits consumed in a month
|
|
1989
|
+
* GET /api/v1/apps/{app_id}/limit — the hard cap, or null
|
|
1990
|
+
*/
|
|
1991
|
+
declare const createAppsClient: (apiKey: string, apiUrl?: string) => {
|
|
1992
|
+
/** List your organization's apps, newest first. */
|
|
1993
|
+
list(): Promise<{
|
|
1994
|
+
data: App[];
|
|
1995
|
+
}>;
|
|
1996
|
+
/** Fetch one of your apps. Throws `G8Error` (404) if it is not yours. */
|
|
1997
|
+
get(appId: string): Promise<App>;
|
|
1998
|
+
/**
|
|
1999
|
+
* Create an app. It starts in `draft` and serves no traffic until published.
|
|
2000
|
+
* Throws `G8Error` (409) when the slug is already taken in your org.
|
|
2001
|
+
*/
|
|
2002
|
+
create(params: AppCreateParams): Promise<App>;
|
|
2003
|
+
/**
|
|
2004
|
+
* Move an app through its lifecycle: `draft` → `published` → `archived`.
|
|
2005
|
+
*
|
|
2006
|
+
* `suspended` is excluded from the parameter type on purpose: it is the
|
|
2007
|
+
* platform's kill switch for an abusive app, the backend refuses it with a
|
|
2008
|
+
* 403, and a builder who could set it could also unset it.
|
|
2009
|
+
*/
|
|
2010
|
+
setStatus(appId: string, status: Exclude<AppStatus, "suspended">): Promise<App>;
|
|
2011
|
+
/**
|
|
2012
|
+
* The client organizations that installed this app, and their consent state.
|
|
2013
|
+
* Includes `pending` and `revoked` installs — if your app cannot reach a
|
|
2014
|
+
* tenant, this is where you see why.
|
|
2015
|
+
*/
|
|
2016
|
+
listInstalls(appId: string): Promise<{
|
|
2017
|
+
data: AppInstallation[];
|
|
2018
|
+
}>;
|
|
2019
|
+
/**
|
|
2020
|
+
* Credits this app consumed in a calendar month, broken down per client org.
|
|
2021
|
+
* Defaults to the current month. A month with no usage returns zeroes, not a
|
|
2022
|
+
* 404 — "nothing happened" is an answer.
|
|
2023
|
+
*/
|
|
2024
|
+
usage(appId: string, period?: string): Promise<AppUsageSummary>;
|
|
2025
|
+
/**
|
|
2026
|
+
* This app's hard credit cap, or `null` when it is uncapped.
|
|
2027
|
+
*
|
|
2028
|
+
* `null` is the real answer, not an empty object: there is no "unlimited"
|
|
2029
|
+
* sentinel, so an accidental zero can never read as "no limit".
|
|
2030
|
+
*/
|
|
2031
|
+
getLimit(appId: string): Promise<AppLimit | null>;
|
|
2032
|
+
};
|
|
2033
|
+
|
|
1679
2034
|
/** A field (column) definition on contacts or companies — base or custom. */
|
|
1680
2035
|
interface Field {
|
|
1681
2036
|
id: number | null;
|
|
@@ -3139,6 +3494,8 @@ declare class G8 {
|
|
|
3139
3494
|
/** @internal */ _notes: ReturnType<typeof createNotesClient> | null;
|
|
3140
3495
|
/** @internal */ _tasks: ReturnType<typeof createTasksClient> | null;
|
|
3141
3496
|
/** @internal */ _fields: ReturnType<typeof createFieldsClient> | null;
|
|
3497
|
+
/** @internal */ _apps: ReturnType<typeof createAppsClient> | null;
|
|
3498
|
+
/** @internal */ _objects: ReturnType<typeof createObjectsClient> | null;
|
|
3142
3499
|
/** @internal */ _deals: ReturnType<typeof createDealsClient> | null;
|
|
3143
3500
|
/** @internal */ _inbox: ReturnType<typeof createInboxClient> | null;
|
|
3144
3501
|
/** @internal */ _quotes: ReturnType<typeof createQuotesClient> | null;
|
|
@@ -3281,7 +3638,7 @@ declare class G8 {
|
|
|
3281
3638
|
contact_id?: number;
|
|
3282
3639
|
user_email?: string;
|
|
3283
3640
|
campaign_id?: string;
|
|
3284
|
-
date_from
|
|
3641
|
+
date_from?: string;
|
|
3285
3642
|
date_to?: string;
|
|
3286
3643
|
limit?: number;
|
|
3287
3644
|
page?: number;
|
|
@@ -3423,6 +3780,39 @@ declare class G8 {
|
|
|
3423
3780
|
};
|
|
3424
3781
|
}>;
|
|
3425
3782
|
};
|
|
3783
|
+
/** Apps you build on graph8 — lifecycle, installs, usage, limits (requires API key). PREVIEW. */
|
|
3784
|
+
get apps(): {
|
|
3785
|
+
list(): Promise<{
|
|
3786
|
+
data: App[];
|
|
3787
|
+
}>;
|
|
3788
|
+
get(appId: string): Promise<App>;
|
|
3789
|
+
create(params: AppCreateParams): Promise<App>;
|
|
3790
|
+
setStatus(appId: string, status: Exclude<AppStatus, "suspended">): Promise<App>;
|
|
3791
|
+
listInstalls(appId: string): Promise<{
|
|
3792
|
+
data: AppInstallation[];
|
|
3793
|
+
}>;
|
|
3794
|
+
usage(appId: string, period?: string): Promise<AppUsageSummary>;
|
|
3795
|
+
getLimit(appId: string): Promise<AppLimit | null>;
|
|
3796
|
+
};
|
|
3797
|
+
/** Custom object types, their schema, and their records (requires API key). PREVIEW. */
|
|
3798
|
+
get objects(): {
|
|
3799
|
+
list(): Promise<{
|
|
3800
|
+
data: CustomObject[];
|
|
3801
|
+
}>;
|
|
3802
|
+
get(objectSlug: string): Promise<CustomObject>;
|
|
3803
|
+
listAttributes(objectSlug: string): Promise<{
|
|
3804
|
+
data: CustomObjectAttribute[];
|
|
3805
|
+
}>;
|
|
3806
|
+
listRecords(objectSlug: string, params?: ListRecordsParams): Promise<{
|
|
3807
|
+
data: CustomObjectRecord[];
|
|
3808
|
+
pagination?: ObjectPagination;
|
|
3809
|
+
}>;
|
|
3810
|
+
createRecord(objectSlug: string, values: Record<string, unknown>): Promise<CustomObjectRecord>;
|
|
3811
|
+
getRecord(objectSlug: string, recordId: string): Promise<CustomObjectRecord>;
|
|
3812
|
+
updateRecord(objectSlug: string, recordId: string, values: Record<string, unknown>): Promise<CustomObjectRecord>;
|
|
3813
|
+
archiveRecord(objectSlug: string, recordId: string): Promise<CustomObjectRecord>;
|
|
3814
|
+
history(objectSlug: string, recordId: string, limit?: number): Promise<CustomObjectHistory>;
|
|
3815
|
+
};
|
|
3426
3816
|
/** Deals and pipelines (requires API key). */
|
|
3427
3817
|
get deals(): {
|
|
3428
3818
|
pipelines(): Promise<{
|
|
@@ -3580,7 +3970,7 @@ declare class G8 {
|
|
|
3580
3970
|
};
|
|
3581
3971
|
}>;
|
|
3582
3972
|
nodeTypes(params?: {
|
|
3583
|
-
type
|
|
3973
|
+
type?: string;
|
|
3584
3974
|
}): Promise<{
|
|
3585
3975
|
data: NodeTypeSchema[];
|
|
3586
3976
|
}>;
|
|
@@ -3717,7 +4107,7 @@ declare class G8 {
|
|
|
3717
4107
|
data: IntentCompany[];
|
|
3718
4108
|
}>;
|
|
3719
4109
|
keywordContacts(keywordId: string, params?: {
|
|
3720
|
-
limit
|
|
4110
|
+
limit?: number;
|
|
3721
4111
|
date_from?: string;
|
|
3722
4112
|
date_to?: string;
|
|
3723
4113
|
}): Promise<{
|
|
@@ -3758,11 +4148,10 @@ declare class G8 {
|
|
|
3758
4148
|
}>;
|
|
3759
4149
|
urlCompanies(url: string, params?: {
|
|
3760
4150
|
limit?: number;
|
|
4151
|
+
days?: number;
|
|
3761
4152
|
date_from?: string;
|
|
3762
4153
|
date_to?: string;
|
|
3763
|
-
}): Promise<
|
|
3764
|
-
data: IntentCompany[];
|
|
3765
|
-
}>;
|
|
4154
|
+
}): Promise<IntentUrlCompaniesResponse>;
|
|
3766
4155
|
};
|
|
3767
4156
|
/** Studio context — ICPs, personas, brand briefs, intelligence, AI research reports (requires API key). */
|
|
3768
4157
|
get studio(): {
|
|
@@ -4241,4 +4630,4 @@ interface Graph8ServiceClient {
|
|
|
4241
4630
|
*/
|
|
4242
4631
|
declare function createGraph8ServiceClient(config: Graph8ServiceClientConfig): Graph8ServiceClient;
|
|
4243
4632
|
|
|
4244
|
-
export { type AddToSequenceConfig, type AgencyClient, type AgencyInfo, type AppRequest, type AppRequestOptions, type AppTokenResponse, type AudienceSync, type AudienceSyncCreateParams, type AudienceSyncError, type AudienceSyncMode, type AudienceSyncPlatform, type AudienceSyncRun, type AudienceSyncUpdateParams, type Booking, type BookingRequest, type CalendarConfig, type CallGradingResult, type Campaign, type CampaignCreateConfig, type CampaignLaunchExecution, type CampaignLaunchResult, type ChatConfig, type Company, type CompanyColumn, type CompanyColumnCreateParams, type CompanyContact, type CompanyEnrichment, type CompanyListParams, type CompanyUpdateParams, type ConstructEventOptions, type Contact, type ContactColumn, type ContactColumnCreateParams, type ContactCreateParams, type ContactDeal, type ContactList, type ContactListParams, type ContactUpdateParams, type CopilotConfig, type CreatedField, DEFAULT_APP_API, type Deal, type DealCreateParams, type DealListParams, type DealUpdateParams, type DialerAgentSummary, type DialerAgentsListParams, type DialerAgentsListResult, type DialerNumberInfo, type DialerNumbersListResult, type DialerReportFilters, type DialerReportMetric, type DialerSessionCreateParams, type DialerSessionCreateResult, type DialerSessionResumeResult, type DialerSessionStatus, type DialerSessionStatusUpdateResult, type DialerSessionSummary, type DialerSessionsListParams, type DialerSessionsListResult, type DialerStatsParams, type DialerStatsResult, type EmailVerification, type EnrichLookupResult, type EvidenceKey, type Field, type FieldCreateParams, type FieldDeleteParams, type G8Config, G8Error, type G8PrivacyConfig, type GlobalContextDocument, type Graph8AppClient, type Graph8AppClientConfig, type Graph8ServiceClient, type Graph8ServiceClientConfig, type ICP, type IdentifyProperties, type InboxAssignResult, type InboxAssignee, type InboxChannel, type InboxContact, type InboxDraft, type InboxListParams, type InboxMessage, type InboxSendParams, type InboxSendResult, type InboxTag, type InboxTagResult, type InboxThread, type IntelligenceData, type IntentCompany, type IntentContact, type IntentKeyword, type IntentPage, type IntentSignals, type IntentStats, type IntentVisitor, KNOWN_WEBHOOK_EVENTS, type ListContact, type MarketplaceHiring, type MarketplaceOffer, type MarketplaceProfile, type MeetingAnalysis, type MeetingAttendee, type MeetingDetail, type MeetingListParams, type MeetingSummary, type MeetingTranscriptLine, type MissedCallback, type MissedCallbacksResult, type NodeTypeSchema, type Note, type PaginatedResponse, type PaginationMeta$1 as PaginationMeta, type PersonEnrichment, type Persona, type Pipeline, type PipelineStage, type PipelineSuggestion, type QuotableProduct, type QuoteCreateParams, type QuoteDetail, type QuoteLineItem, type QuoteListParams, type QuoteSendParams, type QuoteSettings, type QuoteStatus, type QuoteSummary, type QuoteUpdateParams, type RequestOptions, type ResearchReport, type SearchCompanyItem, type SearchCondition, type SearchContactItem, type SearchFilter, type SearchOperator, type SearchParams, type SearchResults, type SearchSaveParams, type SearchSaveResult, type Sequence, type SequenceActionResult, type SequenceAnalytics, type SequenceChannelConfig, type SequenceContactItem, type SequenceContactsParams, type SequenceCreateParams, type SequenceCreateResult, type SequenceDetail, type SequenceKind, type SequenceListItem, type SequenceListParams, type SequencePreview, type SequencePreviewChannel, type SequencePreviewStep, type SequenceStepConfig, type SequenceStepInputType, type SequenceStepType, type SequenceStepUpdateParams, type SequenceUpdateParams, type SetFieldValueParams, type Skill, type SkillCreateAPIParams, type SkillCreateLLMParams, type SkillInputField, type SkillListParams, type SkillTemplate, type SkillType, type SkillUpdateAPIParams, type SkillUpdateLLMParams, type Snippet, type StageCreateParams, type StagePipeline, type StagePipelineCreateParams, type StagePipelineStage, type StagePipelineUpdateParams, type StageUpdateParams, type Task, type TaskCreateParams, type TaskListParams, type TaskUpdateParams, type TimeSlot, type TokenManager, type TrackProperties, type VisitorCompany, type VisitorScore, type VoicePagination, type WebhookEvent, type WebhookEventPayload, WebhookSignatureError, type Workflow, type WorkflowConfig, type WorkflowConnection, type WorkflowCreateParams, type WorkflowExecution, type WorkflowListParams, type WorkflowNode, type WorkflowUpdateParams, backoffDelayMs, constructEvent, createAppRequester, createGraph8AppClient, createGraph8ServiceClient, createTokenManager, exchangeBrowserToken, exchangeServiceToken, g8, isRetryableStatus, paginate, parseRetryAfter, request };
|
|
4633
|
+
export { type AddToSequenceConfig, type AgencyClient, type AgencyInfo, type App, type AppCreateParams, type AppInstallation, type AppLimit, type AppRequest, type AppRequestOptions, type AppStatus, type AppTokenResponse, type AppUsageSummary, type AudienceSync, type AudienceSyncCreateParams, type AudienceSyncError, type AudienceSyncMode, type AudienceSyncPlatform, type AudienceSyncRun, type AudienceSyncUpdateParams, type Booking, type BookingRequest, type CalendarConfig, type CallGradingResult, type Campaign, type CampaignCreateConfig, type CampaignLaunchExecution, type CampaignLaunchResult, type ChatConfig, type Company, type CompanyColumn, type CompanyColumnCreateParams, type CompanyContact, type CompanyEnrichment, type CompanyListParams, type CompanyUpdateParams, type ConstructEventOptions, type Contact, type ContactColumn, type ContactColumnCreateParams, type ContactCreateParams, type ContactDeal, type ContactList, type ContactListParams, type ContactUpdateParams, type CopilotConfig, type CreatedField, type CustomObject, type CustomObjectAttribute, type CustomObjectHistory, type CustomObjectHistoryEntry, type CustomObjectRecord, DEFAULT_APP_API, type Deal, type DealCreateParams, type DealListParams, type DealUpdateParams, type DialerAgentSummary, type DialerAgentsListParams, type DialerAgentsListResult, type DialerNumberInfo, type DialerNumbersListResult, type DialerReportFilters, type DialerReportMetric, type DialerSessionCreateParams, type DialerSessionCreateResult, type DialerSessionResumeResult, type DialerSessionStatus, type DialerSessionStatusUpdateResult, type DialerSessionSummary, type DialerSessionsListParams, type DialerSessionsListResult, type DialerStatsParams, type DialerStatsResult, type EmailVerification, type EnrichLookupResult, type EvidenceKey, type Field, type FieldCreateParams, type FieldDeleteParams, type G8Config, G8Error, type G8PrivacyConfig, type GlobalContextDocument, type Graph8AppClient, type Graph8AppClientConfig, type Graph8ServiceClient, type Graph8ServiceClientConfig, type ICP, type IdentifyProperties, type InboxAssignResult, type InboxAssignee, type InboxChannel, type InboxContact, type InboxDraft, type InboxListParams, type InboxMessage, type InboxSendParams, type InboxSendResult, type InboxTag, type InboxTagResult, type InboxThread, type InstallStatus, type IntelligenceData, type IntentCompany, type IntentContact, type IntentKeyword, type IntentPage, type IntentSignals, type IntentStats, type IntentVisitor, KNOWN_WEBHOOK_EVENTS, type ListContact, type ListRecordsParams, type MarketplaceHiring, type MarketplaceOffer, type MarketplaceProfile, type MeetingAnalysis, type MeetingAttendee, type MeetingDetail, type MeetingListParams, type MeetingSummary, type MeetingTranscriptLine, type MissedCallback, type MissedCallbacksResult, type NodeTypeSchema, type Note, type ObjectPagination, type PaginatedResponse, type PaginationMeta$1 as PaginationMeta, type PersonEnrichment, type Persona, type Pipeline, type PipelineStage, type PipelineSuggestion, type QuotableProduct, type QuoteCreateParams, type QuoteDetail, type QuoteLineItem, type QuoteListParams, type QuoteSendParams, type QuoteSettings, type QuoteStatus, type QuoteSummary, type QuoteUpdateParams, type RequestOptions, type ResearchReport, type SearchCompanyItem, type SearchCondition, type SearchContactItem, type SearchFilter, type SearchOperator, type SearchParams, type SearchResults, type SearchSaveParams, type SearchSaveResult, type Sequence, type SequenceActionResult, type SequenceAnalytics, type SequenceChannelConfig, type SequenceContactItem, type SequenceContactsParams, type SequenceCreateParams, type SequenceCreateResult, type SequenceDetail, type SequenceKind, type SequenceListItem, type SequenceListParams, type SequencePreview, type SequencePreviewChannel, type SequencePreviewStep, type SequenceStepConfig, type SequenceStepInputType, type SequenceStepType, type SequenceStepUpdateParams, type SequenceUpdateParams, type SetFieldValueParams, type Skill, type SkillCreateAPIParams, type SkillCreateLLMParams, type SkillInputField, type SkillListParams, type SkillTemplate, type SkillType, type SkillUpdateAPIParams, type SkillUpdateLLMParams, type Snippet, type StageCreateParams, type StagePipeline, type StagePipelineCreateParams, type StagePipelineStage, type StagePipelineUpdateParams, type StageUpdateParams, type Task, type TaskCreateParams, type TaskListParams, type TaskUpdateParams, type TimeSlot, type TokenManager, type TrackProperties, type VisitorCompany, type VisitorScore, type VoicePagination, type WebhookEvent, type WebhookEventPayload, WebhookSignatureError, type Workflow, type WorkflowConfig, type WorkflowConnection, type WorkflowCreateParams, type WorkflowExecution, type WorkflowListParams, type WorkflowNode, type WorkflowUpdateParams, backoffDelayMs, constructEvent, createAppRequester, createGraph8AppClient, createGraph8ServiceClient, createTokenManager, exchangeBrowserToken, exchangeServiceToken, g8, isRetryableStatus, paginate, parseRetryAfter, request };
|