@graph8/sdk 0.12.0 → 0.12.2

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/react.d.mts CHANGED
@@ -580,6 +580,29 @@ interface IntentCompany {
580
580
  visit_count: number;
581
581
  last_seen: string | null;
582
582
  }
583
+ /** One company row from `intent.urlCompanies()`. Richer than {@link IntentCompany},
584
+ * which describes the keyword-companies surface. */
585
+ interface IntentUrlCompany {
586
+ company_id: number | null;
587
+ name: string | null;
588
+ domain: string | null;
589
+ industry: string | null;
590
+ employee_count: number | null;
591
+ logo_url: string | null;
592
+ audience: string;
593
+ visit_count: number;
594
+ contacts_seen: number;
595
+ last_seen: string | null;
596
+ }
597
+ /** Response of `intent.urlCompanies()`. This endpoint returns a bare aggregate,
598
+ * not the `{ data }` envelope the rest of the Developer API uses. */
599
+ interface IntentUrlCompaniesResponse {
600
+ url: string;
601
+ total_companies: number;
602
+ b2b_count: number;
603
+ b2c_count: number;
604
+ companies: IntentUrlCompany[];
605
+ }
583
606
  interface IntentContact {
584
607
  contact_id: number | null;
585
608
  email: string | null;
@@ -614,7 +637,7 @@ interface IntentStats {
614
637
  * POST /api/v1/intent/pages/visitors
615
638
  * POST /api/v1/intent/pages/contacts
616
639
  * POST /api/v1/intent/pages/visitor-counts
617
- * POST /intent-search/url-companies (note: bare host, no /api/v1 prefix)
640
+ * POST /api/v1/intent/url-companies
618
641
  */
619
642
  declare const createIntentClient: (apiKey: string, apiUrl?: string) => {
620
643
  /** Org-level intent stats (totals over the last 30 days). */
@@ -697,16 +720,24 @@ declare const createIntentClient: (apiKey: string, apiUrl?: string) => {
697
720
  /**
698
721
  * Find companies whose users visited a specific URL (intent search).
699
722
  *
700
- * Note: this endpoint lives at the bare host (no `/api/v1` prefix), unlike the rest
701
- * of the intent surface we call it directly here instead of through the shared `post()` helper.
723
+ * Previously posted to the bare-host `/intent-search/url-companies`, bypassing
724
+ * the shared `post()` helper. That route is JWT-only, so this method could
725
+ * never actually work with an API key. It now goes through
726
+ * `/api/v1/intent/url-companies` like the rest of the intent surface (g8 issue
727
+ * #16536).
728
+ *
729
+ * Returns a bare aggregate, NOT the `{ data }` envelope — the previous
730
+ * `{ data: IntentCompany[] }` signature never matched what the API sends.
731
+ *
732
+ * `date_from` / `date_to` are accepted for backwards compatibility but have
733
+ * never been read by this endpoint; use `days` to set the lookback window.
702
734
  */
703
735
  urlCompanies(url: string, params?: {
704
736
  limit?: number;
737
+ days?: number;
705
738
  date_from?: string;
706
739
  date_to?: string;
707
- }): Promise<{
708
- data: IntentCompany[];
709
- }>;
740
+ }): Promise<IntentUrlCompaniesResponse>;
710
741
  };
711
742
 
712
743
  type SkillType = "llm" | "api";
@@ -1555,14 +1586,28 @@ interface DealCreateParams {
1555
1586
  */
1556
1587
  company_id?: number;
1557
1588
  description?: string;
1589
+ /**
1590
+ * Monetary value. Required (HTTP 400, marker `amount_required_for_won_stage`)
1591
+ * when creating directly in a Closed Won stage; 0 is a valid amount.
1592
+ */
1558
1593
  amount?: number;
1559
1594
  /** Default: "USD". */
1560
1595
  currency?: string;
1561
- /** Stage ID from the org's pipelines. Defaults to first stage of default pipeline if omitted. */
1596
+ /**
1597
+ * Stage ID from the org's pipelines. Must exist and belong to `pipeline_id`
1598
+ * when both are sent (HTTP 422 otherwise). Defaults to the default
1599
+ * pipeline's first non-closed stage if omitted. Creating directly in a
1600
+ * closed stage triggers the closed-stage rules (HTTP 400 with marker
1601
+ * `close_date_required_for_won_stage` / `close_date_required_for_lost_stage`
1602
+ * / `amount_required_for_won_stage` / `owner_required_for_closed_stage`).
1603
+ */
1562
1604
  stage_id?: string;
1563
- /** Pipeline ID. Defaults to org's default pipeline if omitted. */
1605
+ /** Pipeline ID. Must exist (HTTP 422 otherwise). Defaults to org's default pipeline if omitted. */
1564
1606
  pipeline_id?: string;
1565
- /** ISO 8601 close date. */
1607
+ /**
1608
+ * ISO 8601 close date. Required when creating directly in a Closed Won or
1609
+ * Closed Lost stage; past dates are allowed (backdating is supported).
1610
+ */
1566
1611
  close_date?: string;
1567
1612
  /**
1568
1613
  * Set true to create a deal even if one already exists for the company.
@@ -1575,10 +1620,28 @@ interface DealUpdateParams {
1575
1620
  description?: string;
1576
1621
  amount?: number;
1577
1622
  currency?: string;
1623
+ /**
1624
+ * New stage ID. Must be an existing stage in the deal's pipeline (HTTP 422
1625
+ * otherwise). Moving a deal INTO a Closed Won stage requires an effective
1626
+ * close_date AND amount; Closed Lost requires an effective close_date;
1627
+ * either requires an owner ("effective" = the value in this call, else the
1628
+ * deal's existing value). Violations return HTTP 400 with a marker-prefixed
1629
+ * detail: `close_date_required_for_won_stage`,
1630
+ * `close_date_required_for_lost_stage`, `amount_required_for_won_stage`,
1631
+ * `owner_required_for_closed_stage`. Re-submitting the deal's current stage
1632
+ * is never gated.
1633
+ */
1578
1634
  stage_id?: string;
1579
- /** ISO 8601 close date. */
1580
- close_date?: string;
1581
- /** Reassign the deal owner (user id or email). Pass null to clear. */
1635
+ /**
1636
+ * ISO 8601 close date. Explicit null clears it, except on a deal sitting in
1637
+ * a closed stage (HTTP 400, closed-stage markers above).
1638
+ */
1639
+ close_date?: string | null;
1640
+ /**
1641
+ * Reassign the deal owner (user id or email). Pass null to clear, except on
1642
+ * a deal sitting in a closed stage (HTTP 400, marker
1643
+ * `owner_required_for_closed_stage`).
1644
+ */
1582
1645
  owner_id?: string | null;
1583
1646
  /**
1584
1647
  * mashup_contact_ids to link. Must belong to the deal's company (if the deal
@@ -3719,11 +3782,10 @@ declare const useG8: () => {
3719
3782
  }>;
3720
3783
  urlCompanies(url: string, params?: {
3721
3784
  limit?: number;
3785
+ days?: number;
3722
3786
  date_from?: string;
3723
3787
  date_to?: string;
3724
- }): Promise<{
3725
- data: IntentCompany[];
3726
- }>;
3788
+ }): Promise<IntentUrlCompaniesResponse>;
3727
3789
  };
3728
3790
  get studio(): {
3729
3791
  globalContext(params?: {
package/dist/react.d.ts CHANGED
@@ -580,6 +580,29 @@ interface IntentCompany {
580
580
  visit_count: number;
581
581
  last_seen: string | null;
582
582
  }
583
+ /** One company row from `intent.urlCompanies()`. Richer than {@link IntentCompany},
584
+ * which describes the keyword-companies surface. */
585
+ interface IntentUrlCompany {
586
+ company_id: number | null;
587
+ name: string | null;
588
+ domain: string | null;
589
+ industry: string | null;
590
+ employee_count: number | null;
591
+ logo_url: string | null;
592
+ audience: string;
593
+ visit_count: number;
594
+ contacts_seen: number;
595
+ last_seen: string | null;
596
+ }
597
+ /** Response of `intent.urlCompanies()`. This endpoint returns a bare aggregate,
598
+ * not the `{ data }` envelope the rest of the Developer API uses. */
599
+ interface IntentUrlCompaniesResponse {
600
+ url: string;
601
+ total_companies: number;
602
+ b2b_count: number;
603
+ b2c_count: number;
604
+ companies: IntentUrlCompany[];
605
+ }
583
606
  interface IntentContact {
584
607
  contact_id: number | null;
585
608
  email: string | null;
@@ -614,7 +637,7 @@ interface IntentStats {
614
637
  * POST /api/v1/intent/pages/visitors
615
638
  * POST /api/v1/intent/pages/contacts
616
639
  * POST /api/v1/intent/pages/visitor-counts
617
- * POST /intent-search/url-companies (note: bare host, no /api/v1 prefix)
640
+ * POST /api/v1/intent/url-companies
618
641
  */
619
642
  declare const createIntentClient: (apiKey: string, apiUrl?: string) => {
620
643
  /** Org-level intent stats (totals over the last 30 days). */
@@ -697,16 +720,24 @@ declare const createIntentClient: (apiKey: string, apiUrl?: string) => {
697
720
  /**
698
721
  * Find companies whose users visited a specific URL (intent search).
699
722
  *
700
- * Note: this endpoint lives at the bare host (no `/api/v1` prefix), unlike the rest
701
- * of the intent surface we call it directly here instead of through the shared `post()` helper.
723
+ * Previously posted to the bare-host `/intent-search/url-companies`, bypassing
724
+ * the shared `post()` helper. That route is JWT-only, so this method could
725
+ * never actually work with an API key. It now goes through
726
+ * `/api/v1/intent/url-companies` like the rest of the intent surface (g8 issue
727
+ * #16536).
728
+ *
729
+ * Returns a bare aggregate, NOT the `{ data }` envelope — the previous
730
+ * `{ data: IntentCompany[] }` signature never matched what the API sends.
731
+ *
732
+ * `date_from` / `date_to` are accepted for backwards compatibility but have
733
+ * never been read by this endpoint; use `days` to set the lookback window.
702
734
  */
703
735
  urlCompanies(url: string, params?: {
704
736
  limit?: number;
737
+ days?: number;
705
738
  date_from?: string;
706
739
  date_to?: string;
707
- }): Promise<{
708
- data: IntentCompany[];
709
- }>;
740
+ }): Promise<IntentUrlCompaniesResponse>;
710
741
  };
711
742
 
712
743
  type SkillType = "llm" | "api";
@@ -1555,14 +1586,28 @@ interface DealCreateParams {
1555
1586
  */
1556
1587
  company_id?: number;
1557
1588
  description?: string;
1589
+ /**
1590
+ * Monetary value. Required (HTTP 400, marker `amount_required_for_won_stage`)
1591
+ * when creating directly in a Closed Won stage; 0 is a valid amount.
1592
+ */
1558
1593
  amount?: number;
1559
1594
  /** Default: "USD". */
1560
1595
  currency?: string;
1561
- /** Stage ID from the org's pipelines. Defaults to first stage of default pipeline if omitted. */
1596
+ /**
1597
+ * Stage ID from the org's pipelines. Must exist and belong to `pipeline_id`
1598
+ * when both are sent (HTTP 422 otherwise). Defaults to the default
1599
+ * pipeline's first non-closed stage if omitted. Creating directly in a
1600
+ * closed stage triggers the closed-stage rules (HTTP 400 with marker
1601
+ * `close_date_required_for_won_stage` / `close_date_required_for_lost_stage`
1602
+ * / `amount_required_for_won_stage` / `owner_required_for_closed_stage`).
1603
+ */
1562
1604
  stage_id?: string;
1563
- /** Pipeline ID. Defaults to org's default pipeline if omitted. */
1605
+ /** Pipeline ID. Must exist (HTTP 422 otherwise). Defaults to org's default pipeline if omitted. */
1564
1606
  pipeline_id?: string;
1565
- /** ISO 8601 close date. */
1607
+ /**
1608
+ * ISO 8601 close date. Required when creating directly in a Closed Won or
1609
+ * Closed Lost stage; past dates are allowed (backdating is supported).
1610
+ */
1566
1611
  close_date?: string;
1567
1612
  /**
1568
1613
  * Set true to create a deal even if one already exists for the company.
@@ -1575,10 +1620,28 @@ interface DealUpdateParams {
1575
1620
  description?: string;
1576
1621
  amount?: number;
1577
1622
  currency?: string;
1623
+ /**
1624
+ * New stage ID. Must be an existing stage in the deal's pipeline (HTTP 422
1625
+ * otherwise). Moving a deal INTO a Closed Won stage requires an effective
1626
+ * close_date AND amount; Closed Lost requires an effective close_date;
1627
+ * either requires an owner ("effective" = the value in this call, else the
1628
+ * deal's existing value). Violations return HTTP 400 with a marker-prefixed
1629
+ * detail: `close_date_required_for_won_stage`,
1630
+ * `close_date_required_for_lost_stage`, `amount_required_for_won_stage`,
1631
+ * `owner_required_for_closed_stage`. Re-submitting the deal's current stage
1632
+ * is never gated.
1633
+ */
1578
1634
  stage_id?: string;
1579
- /** ISO 8601 close date. */
1580
- close_date?: string;
1581
- /** Reassign the deal owner (user id or email). Pass null to clear. */
1635
+ /**
1636
+ * ISO 8601 close date. Explicit null clears it, except on a deal sitting in
1637
+ * a closed stage (HTTP 400, closed-stage markers above).
1638
+ */
1639
+ close_date?: string | null;
1640
+ /**
1641
+ * Reassign the deal owner (user id or email). Pass null to clear, except on
1642
+ * a deal sitting in a closed stage (HTTP 400, marker
1643
+ * `owner_required_for_closed_stage`).
1644
+ */
1582
1645
  owner_id?: string | null;
1583
1646
  /**
1584
1647
  * mashup_contact_ids to link. Must belong to the deal's company (if the deal
@@ -3719,11 +3782,10 @@ declare const useG8: () => {
3719
3782
  }>;
3720
3783
  urlCompanies(url: string, params?: {
3721
3784
  limit?: number;
3785
+ days?: number;
3722
3786
  date_from?: string;
3723
3787
  date_to?: string;
3724
- }): Promise<{
3725
- data: IntentCompany[];
3726
- }>;
3788
+ }): Promise<IntentUrlCompaniesResponse>;
3727
3789
  };
3728
3790
  get studio(): {
3729
3791
  globalContext(params?: {
package/dist/react.js CHANGED
@@ -1722,14 +1722,20 @@ var createIntentClient = (apiKey, apiUrl) => {
1722
1722
  /**
1723
1723
  * Find companies whose users visited a specific URL (intent search).
1724
1724
  *
1725
- * Note: this endpoint lives at the bare host (no `/api/v1` prefix), unlike the rest
1726
- * of the intent surface we call it directly here instead of through the shared `post()` helper.
1725
+ * Previously posted to the bare-host `/intent-search/url-companies`, bypassing
1726
+ * the shared `post()` helper. That route is JWT-only, so this method could
1727
+ * never actually work with an API key. It now goes through
1728
+ * `/api/v1/intent/url-companies` like the rest of the intent surface (g8 issue
1729
+ * #16536).
1730
+ *
1731
+ * Returns a bare aggregate, NOT the `{ data }` envelope — the previous
1732
+ * `{ data: IntentCompany[] }` signature never matched what the API sends.
1733
+ *
1734
+ * `date_from` / `date_to` are accepted for backwards compatibility but have
1735
+ * never been read by this endpoint; use `days` to set the lookback window.
1727
1736
  */
1728
1737
  async urlCompanies(url, params = {}) {
1729
- return request(baseUrl, "/intent-search/url-companies", apiKey, {
1730
- method: "POST",
1731
- body: { url, ...params }
1732
- });
1738
+ return post("/intent/url-companies", { url, ...params });
1733
1739
  }
1734
1740
  };
1735
1741
  };