salesprompter-cli 0.1.48 → 0.1.49

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 (2) hide show
  1. package/dist/cli.js +31 -23
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -8,6 +8,7 @@ import path from "node:path";
8
8
  import { emitKeypressEvents } from "node:readline";
9
9
  import { createInterface } from "node:readline/promises";
10
10
  import { setTimeout as delay } from "node:timers/promises";
11
+ import { gzipSync } from "node:zlib";
11
12
  import { createClient } from "@supabase/supabase-js";
12
13
  import pg from "pg";
13
14
  import { Command } from "commander";
@@ -8739,34 +8740,41 @@ function describeLocalSalesNavigatorAccountPartialError(fetchResult) {
8739
8740
  async function importLocalSalesNavigatorPeopleViaApp(session, payload) {
8740
8741
  const { value } = await fetchCliJson(session, (currentSession) => {
8741
8742
  const workspaceClientId = currentSession.user.workspaceClientId?.trim() || null;
8743
+ const serializedPayload = JSON.stringify({
8744
+ sourceQueryUrl: payload.sourceQueryUrl,
8745
+ slicedQueryUrl: payload.sourceQueryUrl,
8746
+ appliedFilters: [],
8747
+ maxResultsPerSearch: payload.maxResultsPerSearch,
8748
+ numberOfProfiles: payload.numberOfProfiles,
8749
+ slicePreset: payload.slicePreset,
8750
+ totalResults: payload.totalResults,
8751
+ fetchedPages: payload.fetchedPages,
8752
+ people: payload.people,
8753
+ rawPayload: {
8754
+ clientId: workspaceClientId ?? undefined,
8755
+ client_id: workspaceClientId ?? undefined,
8756
+ leadList: workspaceClientId
8757
+ ? { clientId: workspaceClientId }
8758
+ : undefined,
8759
+ workflow: "salesnav:local-import",
8760
+ localPeopleCount: payload.people.length,
8761
+ fetchedPages: payload.fetchedPages,
8762
+ pacing: payload.pacing,
8763
+ },
8764
+ });
8765
+ const shouldCompress = Buffer.byteLength(serializedPayload) >= 512 * 1024;
8742
8766
  return fetch(`${currentSession.apiBaseUrl}/api/cli/salesnav/local-import`, {
8743
8767
  method: "POST",
8744
8768
  headers: {
8745
- "Content-Type": "application/json",
8769
+ "Content-Type": shouldCompress
8770
+ ? "application/octet-stream"
8771
+ : "application/json",
8746
8772
  Authorization: `Bearer ${currentSession.accessToken}`,
8773
+ ...(shouldCompress
8774
+ ? { "X-Salesprompter-Content-Encoding": "gzip" }
8775
+ : {}),
8747
8776
  },
8748
- body: JSON.stringify({
8749
- sourceQueryUrl: payload.sourceQueryUrl,
8750
- slicedQueryUrl: payload.sourceQueryUrl,
8751
- appliedFilters: [],
8752
- maxResultsPerSearch: payload.maxResultsPerSearch,
8753
- numberOfProfiles: payload.numberOfProfiles,
8754
- slicePreset: payload.slicePreset,
8755
- totalResults: payload.totalResults,
8756
- fetchedPages: payload.fetchedPages,
8757
- people: payload.people,
8758
- rawPayload: {
8759
- clientId: workspaceClientId ?? undefined,
8760
- client_id: workspaceClientId ?? undefined,
8761
- leadList: workspaceClientId
8762
- ? { clientId: workspaceClientId }
8763
- : undefined,
8764
- workflow: "salesnav:local-import",
8765
- localPeopleCount: payload.people.length,
8766
- fetchedPages: payload.fetchedPages,
8767
- pacing: payload.pacing,
8768
- },
8769
- }),
8777
+ body: shouldCompress ? gzipSync(serializedPayload) : serializedPayload,
8770
8778
  });
8771
8779
  }, SalesNavigatorLocalImportResponseSchema);
8772
8780
  return value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "salesprompter-cli",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "description": "Sales workflow CLI for guided lead generation, enrichment, scoring, and sync.",
5
5
  "author": "Daniel Sinewe <hello@danielsinewe.com>",
6
6
  "type": "module",