salesprompter-cli 0.1.31 → 0.1.32
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/auth.js +8 -2
- package/dist/cli.js +8 -4
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -15,7 +15,9 @@ const UserSchema = z.object({
|
|
|
15
15
|
name: nullableOptionalString,
|
|
16
16
|
orgId: nullableOptionalString,
|
|
17
17
|
orgName: nullableOptionalString,
|
|
18
|
-
orgSlug: nullableOptionalString
|
|
18
|
+
orgSlug: nullableOptionalString,
|
|
19
|
+
workspaceClientId: nullableOptionalString,
|
|
20
|
+
workspaceClientName: nullableOptionalString
|
|
19
21
|
});
|
|
20
22
|
const AuthSessionSchema = z.object({
|
|
21
23
|
accessToken: z.string().min(1),
|
|
@@ -84,6 +86,8 @@ const WhoAmIResponseSchema = z
|
|
|
84
86
|
orgId: nullableOptionalString,
|
|
85
87
|
orgName: nullableOptionalString,
|
|
86
88
|
orgSlug: nullableOptionalString,
|
|
89
|
+
workspaceClientId: nullableOptionalString,
|
|
90
|
+
workspaceClientName: nullableOptionalString,
|
|
87
91
|
expiresAt: z.string().datetime().optional()
|
|
88
92
|
}),
|
|
89
93
|
z.object({
|
|
@@ -107,7 +111,9 @@ const WhoAmIResponseSchema = z
|
|
|
107
111
|
name: value.name,
|
|
108
112
|
orgId: value.orgId,
|
|
109
113
|
orgName: value.orgName,
|
|
110
|
-
orgSlug: value.orgSlug
|
|
114
|
+
orgSlug: value.orgSlug,
|
|
115
|
+
workspaceClientId: value.workspaceClientId,
|
|
116
|
+
workspaceClientName: value.workspaceClientName
|
|
111
117
|
},
|
|
112
118
|
expiresAt: value.expiresAt
|
|
113
119
|
};
|
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import { setTimeout as delay } from "node:timers/promises";
|
|
|
10
10
|
import { createClient } from "@supabase/supabase-js";
|
|
11
11
|
import { Command } from "commander";
|
|
12
12
|
import { z } from "zod";
|
|
13
|
-
import { clearAuthSession, loginWithBrowserConnect, loginWithDeviceFlow, loginWithToken, requireAuthSession, shouldBypassAuth, verifySession } from "./auth.js";
|
|
13
|
+
import { clearAuthSession, loginWithBrowserConnect, loginWithDeviceFlow, loginWithToken, requireAuthSession, shouldBypassAuth, verifySession, writeAuthSession } from "./auth.js";
|
|
14
14
|
import { buildBigQueryLeadLookupSql, executeBigQuerySql, normalizeBigQueryLeadRows, runBigQueryQuery, runBigQueryRows } from "./bigquery.js";
|
|
15
15
|
import { AccountProfileSchema, EnrichedLeadSchema, IcpSchema, LeadSchema, ScoredLeadSchema, SyncTargetSchema } from "./domain.js";
|
|
16
16
|
import { auditDomainDecisions, buildDomainfinderBacklogQueries, buildDomainfinderCandidatesSql, buildDomainfinderInputSql, buildDomainfinderWritebackSql, buildExistingDomainRepairSql, buildExistingDomainAuditQueries, compareDomainSelectionStrategies, selectBestDomains } from "./domainfinder.js";
|
|
@@ -2545,11 +2545,13 @@ function compactOptionalText(value) {
|
|
|
2545
2545
|
return compacted && compacted.length > 0 ? compacted : null;
|
|
2546
2546
|
}
|
|
2547
2547
|
function getOrgLabel(session) {
|
|
2548
|
-
const orgName = compactOptionalText(session.user.orgName);
|
|
2548
|
+
const orgName = compactOptionalText(session.user.orgName) ?? compactOptionalText(session.user.workspaceClientName);
|
|
2549
2549
|
const orgSlug = compactOptionalText(session.user.orgSlug);
|
|
2550
2550
|
const orgId = compactOptionalText(session.user.orgId);
|
|
2551
|
+
const workspaceClientId = compactOptionalText(session.user.workspaceClientId);
|
|
2551
2552
|
if (orgName) {
|
|
2552
|
-
const
|
|
2553
|
+
const clientLabel = workspaceClientId ? `client ${workspaceClientId}` : null;
|
|
2554
|
+
const details = [orgSlug, clientLabel, orgId].filter((value) => Boolean(value));
|
|
2553
2555
|
return details.length > 0 ? `${orgName} (${details.join(", ")})` : orgName;
|
|
2554
2556
|
}
|
|
2555
2557
|
if (orgSlug) {
|
|
@@ -2784,7 +2786,9 @@ async function ensureWizardSession(options) {
|
|
|
2784
2786
|
};
|
|
2785
2787
|
}
|
|
2786
2788
|
try {
|
|
2787
|
-
const
|
|
2789
|
+
const cachedSession = await requireAuthSession();
|
|
2790
|
+
const session = await verifySession(cachedSession);
|
|
2791
|
+
await writeAuthSession(session);
|
|
2788
2792
|
writeSessionSummary(session);
|
|
2789
2793
|
writeWizardLine();
|
|
2790
2794
|
return {
|
package/package.json
CHANGED