@usesocial/cli 0.19.9 → 0.19.11
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/CHANGELOG.md +12 -0
- package/README.md +9 -8
- package/dist/index.mjs +43 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @usesocial/cli
|
|
2
2
|
|
|
3
|
+
## 0.19.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#173](https://github.com/usesocial/monorepo/pull/173) [`988f3de`](https://github.com/usesocial/monorepo/commit/988f3ded68966de58701c09116bb66b5fb48190b) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Run X OAuth before billing so a distinct authorized account stays resumable across payment retries.
|
|
8
|
+
|
|
9
|
+
## 0.19.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#154](https://github.com/usesocial/monorepo/pull/154) [`6cf8bd8`](https://github.com/usesocial/monorepo/commit/6cf8bd8cb2cad1b577eef28bc11176a398b99251) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Classify wrapped sync access denials as expected CLI failures while preserving safe telemetry.
|
|
14
|
+
|
|
3
15
|
## 0.19.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -283,14 +283,15 @@ returned approval or checkout URL, then rerun `social account setup` until it is
|
|
|
283
283
|
`ready`.
|
|
284
284
|
|
|
285
285
|
`social account connect <platform>` starts or resumes a server-owned partial
|
|
286
|
-
account
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
`
|
|
292
|
-
|
|
293
|
-
`--account-id` after completion only
|
|
286
|
+
account. LinkedIn normally charges the stored card before hosted provider
|
|
287
|
+
approval. X starts OAuth without charging, then purchases any missing provider
|
|
288
|
+
or legacy seat after a distinct, owned identity is authorized. Payment retries
|
|
289
|
+
retain that identity and keep the account unavailable until payment succeeds.
|
|
290
|
+
In a non-TTY shell, omit `--account-id` on the first call, capture the returned
|
|
291
|
+
`accountId`, and pass it back as `--account-id <accountId>` on every poll.
|
|
292
|
+
Surface `connectURL` for `pending_approval` and `paymentURL` for `pending_billing`.
|
|
293
|
+
Replaying a connected ID is stable; omit `--account-id` after completion only
|
|
294
|
+
to connect another account.
|
|
294
295
|
|
|
295
296
|
`social account billing` prints Social LinkedIn and Social X independently.
|
|
296
297
|
Social LinkedIn costs $20 per connected account with flat proxy usage. Social X
|
package/dist/index.mjs
CHANGED
|
@@ -24845,7 +24845,7 @@ function createEnv(opts) {
|
|
|
24845
24845
|
}
|
|
24846
24846
|
//#endregion
|
|
24847
24847
|
//#region package.json
|
|
24848
|
-
var version$1 = "0.19.
|
|
24848
|
+
var version$1 = "0.19.11";
|
|
24849
24849
|
//#endregion
|
|
24850
24850
|
//#region src/lib/env.ts
|
|
24851
24851
|
const URLWithTrailingSlash = url().transform(ensureTrailingSlash);
|
|
@@ -31533,20 +31533,42 @@ var SilentExit = class extends Error {
|
|
|
31533
31533
|
this.code = code;
|
|
31534
31534
|
}
|
|
31535
31535
|
};
|
|
31536
|
+
const isKnownCLIError = (error) => error instanceof SilentExit || error instanceof ZodError || isCittyUsageError(error) || error instanceof UsageError || error instanceof CancelledError || error instanceof AuthError || error instanceof NotFoundError || error instanceof CLIAPIError;
|
|
31537
|
+
const isClassifiedCittyUsageError = (error) => error instanceof Error && error.name === "CLIError" && "code" in error && typeof error.code === "string";
|
|
31538
|
+
/** Returns the first known CLI/API error in a bounded cause chain. */
|
|
31539
|
+
const classificationErrorFor = (error) => {
|
|
31540
|
+
let candidate = error;
|
|
31541
|
+
const seen = /* @__PURE__ */ new Set();
|
|
31542
|
+
for (let depth = 0; depth < 5; depth += 1) {
|
|
31543
|
+
if (isKnownCLIError(candidate)) return candidate;
|
|
31544
|
+
if (!(candidate && typeof candidate === "object")) break;
|
|
31545
|
+
if (seen.has(candidate)) break;
|
|
31546
|
+
seen.add(candidate);
|
|
31547
|
+
if (!("cause" in candidate)) break;
|
|
31548
|
+
candidate = candidate.cause;
|
|
31549
|
+
}
|
|
31550
|
+
};
|
|
31536
31551
|
const exitCodeFor = (error) => {
|
|
31537
|
-
|
|
31538
|
-
if (
|
|
31539
|
-
if (
|
|
31540
|
-
if (
|
|
31541
|
-
if (
|
|
31542
|
-
if (
|
|
31543
|
-
|
|
31544
|
-
|
|
31545
|
-
if (
|
|
31546
|
-
if (
|
|
31552
|
+
const classified = classificationErrorFor(error);
|
|
31553
|
+
if (!classified) return EXIT.api;
|
|
31554
|
+
if (classified instanceof SilentExit) return classified.code;
|
|
31555
|
+
if (classified instanceof ZodError || isClassifiedCittyUsageError(classified)) return EXIT.usage;
|
|
31556
|
+
if (classified instanceof UsageError || classified instanceof CancelledError) return EXIT.usage;
|
|
31557
|
+
if (classified instanceof AuthError) return EXIT.auth;
|
|
31558
|
+
if (classified instanceof NotFoundError) return EXIT.notFound;
|
|
31559
|
+
if (classified instanceof CLIAPIError) {
|
|
31560
|
+
if (classified.status === 404) return EXIT.notFound;
|
|
31561
|
+
if (classified.status === 401 || classified.status === 403) return EXIT.auth;
|
|
31562
|
+
if (classified.status === 429) return EXIT.rateLimited;
|
|
31563
|
+
if (classified.status >= 400) return EXIT.api;
|
|
31547
31564
|
}
|
|
31548
31565
|
return EXIT.api;
|
|
31549
31566
|
};
|
|
31567
|
+
const isExpectedFailure = (error, exitCode) => {
|
|
31568
|
+
if (exitCode === EXIT.usage || exitCode === EXIT.auth || exitCode === EXIT.notFound || exitCode === EXIT.rateLimited) return true;
|
|
31569
|
+
const classified = classificationErrorFor(error);
|
|
31570
|
+
return classified instanceof CLIAPIError && classified.status < 500;
|
|
31571
|
+
};
|
|
31550
31572
|
//#endregion
|
|
31551
31573
|
//#region src/lib/analytics.ts
|
|
31552
31574
|
/**
|
|
@@ -31654,17 +31676,19 @@ const topFrameLabel = (error) => {
|
|
|
31654
31676
|
return frame ? `${frame.functionName}@${frame.basename}:${frame.line}` : void 0;
|
|
31655
31677
|
};
|
|
31656
31678
|
const failureFingerprint = (error, command) => {
|
|
31657
|
-
|
|
31658
|
-
|
|
31659
|
-
|
|
31679
|
+
const metadata = errorMetadata(error);
|
|
31680
|
+
const classified = metadata?.name === "SyncPageError" && metadata._tag === "SyncPageError" ? classificationErrorFor(error) : error;
|
|
31681
|
+
if (classified instanceof CLIAPIError) return `CLIAPIError:${classified.status}:${classified.code ?? "unknown"}`;
|
|
31682
|
+
if (classified instanceof ZodError) {
|
|
31683
|
+
const [issue] = classified.issues;
|
|
31660
31684
|
const issuePath = issue?.path.map(String).join(".") || "unknown";
|
|
31661
31685
|
return `ZodError:${command ?? "unknown"}:${issuePath}:${issue?.code ?? "unknown"}`;
|
|
31662
31686
|
}
|
|
31663
|
-
if (
|
|
31664
|
-
const code = cittyErrorCode(
|
|
31687
|
+
if (classified instanceof Error) {
|
|
31688
|
+
const code = cittyErrorCode(classified);
|
|
31665
31689
|
if (code !== void 0) return `CLIError:${code}:${command ?? "unknown"}`;
|
|
31666
31690
|
}
|
|
31667
|
-
if (isTypedCLIError(
|
|
31691
|
+
if (isTypedCLIError(classified)) return `${classified.name}:${command ?? "unknown"}`;
|
|
31668
31692
|
return `${errorName(error)}:unknown:${topFrameLabel(error) ?? "unknown"}`;
|
|
31669
31693
|
};
|
|
31670
31694
|
const sanitizeExceptionForPostHog = (error, command) => {
|
|
@@ -34331,7 +34355,7 @@ const platformLabel = (platform) => platform === "x" ? "X" : "LinkedIn";
|
|
|
34331
34355
|
const lifecycleConnectContract = writeCLIContract({
|
|
34332
34356
|
hazards: [{
|
|
34333
34357
|
code: "account_connect_billing",
|
|
34334
|
-
message: "
|
|
34358
|
+
message: "LinkedIn can charge on the first call; X charges after OAuth. Pass the returned accountId on every retry."
|
|
34335
34359
|
}],
|
|
34336
34360
|
idField: "accountId",
|
|
34337
34361
|
idempotency: {
|
|
@@ -41158,7 +41182,7 @@ const captureCommandException = (error, exitCode, telemetry, now) => {
|
|
|
41158
41182
|
command: commandContext?.command,
|
|
41159
41183
|
durationMs: commandContext ? now() - commandContext.startedAt : void 0,
|
|
41160
41184
|
exitCode,
|
|
41161
|
-
expected:
|
|
41185
|
+
expected: isExpectedFailure(error, exitCode),
|
|
41162
41186
|
group: commandContext?.group,
|
|
41163
41187
|
handled: true
|
|
41164
41188
|
}));
|