@usesocial/cli 0.19.10 → 0.19.12

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @usesocial/cli
2
2
 
3
+ ## 0.19.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#174](https://github.com/usesocial/monorepo/pull/174) [`c4e3f88`](https://github.com/usesocial/monorepo/commit/c4e3f88ee253404bd142f7540763a58368fa625d) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Show a recovery hint for LinkedIn profile section fuse limits, suggesting fewer sections or an experience preview.
8
+
9
+ ## 0.19.11
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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.
14
+
3
15
  ## 0.19.10
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 that purchases only that provider's plan or next seat, or the applicable
287
- legacy Social Pro seat during transition. It normally charges the stored card
288
- directly before returning hosted provider approval. In a non-TTY shell, omit
289
- `--account-id` on the first call, capture the returned `accountId`, and pass it
290
- back as `--account-id <accountId>` on every poll. Surface `paymentURL` only when
291
- `pending_billing` says customer action is required, then surface `connectURL`
292
- for provider approval. Replaying a connected account ID is stable; omit
293
- `--account-id` after completion only to connect another account.
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
@@ -12871,6 +12871,10 @@ const parseTypedSocialSelectorResult = (value, options = {}) => {
12871
12871
  }));
12872
12872
  };
12873
12873
  new RegExp(String.raw`^/search/(?<category>companies|jobs|people|posts)$`);
12874
+ object({
12875
+ detail: string().includes("Fuse limit was reached"),
12876
+ type: literal("provider/invalid_parameters")
12877
+ });
12874
12878
  //#endregion
12875
12879
  //#region ../../packages/linkedin/src/profiles.ts
12876
12880
  const displayNameFrom = (firstName, lastName, username) => [firstName, lastName].filter(Boolean).join(" ").trim() || username || "";
@@ -24845,7 +24849,7 @@ function createEnv(opts) {
24845
24849
  }
24846
24850
  //#endregion
24847
24851
  //#region package.json
24848
- var version$1 = "0.19.10";
24852
+ var version$1 = "0.19.12";
24849
24853
  //#endregion
24850
24854
  //#region src/lib/env.ts
24851
24855
  const URLWithTrailingSlash = url().transform(ensureTrailingSlash);
@@ -25090,34 +25094,44 @@ var CLIAPIError = class extends Error {
25090
25094
  this.syncResume = details.syncResume;
25091
25095
  }
25092
25096
  };
25093
- const TransportRequestId = string().optional().catch(void 0);
25097
+ const TransportOptionalString = string().optional().catch(void 0);
25094
25098
  const TransportRetryAfterSeconds = number().finite().optional().catch(void 0);
25095
25099
  const TransportAPIError = object({
25096
25100
  code: string(),
25101
+ hint: TransportOptionalString,
25097
25102
  message: string(),
25098
- requestId: TransportRequestId,
25103
+ requestId: TransportOptionalString,
25099
25104
  retryAfterSeconds: TransportRetryAfterSeconds
25100
25105
  });
25101
25106
  const LegacyTransportAPIError = object({
25102
25107
  error: string(),
25103
- request_id: TransportRequestId,
25108
+ hint: TransportOptionalString,
25109
+ request_id: TransportOptionalString,
25104
25110
  retryAfterSeconds: TransportRetryAfterSeconds
25105
25111
  });
25106
25112
  const parseAPIErrorBody = (body) => {
25107
25113
  const modern = TransportAPIError.safeParse(body);
25108
- if (modern.success) return {
25109
- code: modern.data.code,
25110
- message: modern.data.message,
25111
- requestId: modern.data.requestId,
25112
- retryAfterSeconds: modern.data.retryAfterSeconds
25113
- };
25114
+ if (modern.success) {
25115
+ const parsed = {
25116
+ code: modern.data.code,
25117
+ message: modern.data.message,
25118
+ requestId: modern.data.requestId,
25119
+ retryAfterSeconds: modern.data.retryAfterSeconds
25120
+ };
25121
+ if (modern.data.hint !== void 0) parsed.hint = modern.data.hint;
25122
+ return parsed;
25123
+ }
25114
25124
  const legacy = LegacyTransportAPIError.safeParse(body);
25115
- if (legacy.success) return {
25116
- code: legacy.data.error,
25117
- message: legacy.data.error,
25118
- requestId: legacy.data.request_id,
25119
- retryAfterSeconds: legacy.data.retryAfterSeconds
25120
- };
25125
+ if (legacy.success) {
25126
+ const parsed = {
25127
+ code: legacy.data.error,
25128
+ message: legacy.data.error,
25129
+ requestId: legacy.data.request_id,
25130
+ retryAfterSeconds: legacy.data.retryAfterSeconds
25131
+ };
25132
+ if (legacy.data.hint !== void 0) parsed.hint = legacy.data.hint;
25133
+ return parsed;
25134
+ }
25121
25135
  return {};
25122
25136
  };
25123
25137
  const retryContextKey = (request) => `${request.method} ${request.url}`;
@@ -25157,6 +25171,7 @@ const createAPI = (opts = {}) => {
25157
25171
  const retryContext = retryContextFor(error.request);
25158
25172
  return new CLIAPIError(parsed.message ?? error.response.statusText, error.response.status, body, retryAfterSeconds, {
25159
25173
  code: parsed.code,
25174
+ hint: parsed.hint,
25160
25175
  requestId: parsed.requestId ?? error.response.headers.get("x-social-request-id") ?? void 0,
25161
25176
  retryBudgetExhausted: retryContext && retryContext.retryCount >= LINKEDIN_RATE_LIMIT_RETRY_LIMIT ? true : retryContext?.retryBudgetExhausted,
25162
25177
  retryCount: retryContext?.retryCount
@@ -25229,6 +25244,7 @@ const toCLIAPIError = (error) => {
25229
25244
  const parsed = parseAPIErrorBody(body);
25230
25245
  return new CLIAPIError(parsed.message ?? transport.data.message, transport.data.status, body, parsed.retryAfterSeconds, {
25231
25246
  code: parsed.code,
25247
+ hint: parsed.hint,
25232
25248
  orpcCode: transport.data.code,
25233
25249
  requestId: parsed.requestId
25234
25250
  });
@@ -34355,7 +34371,7 @@ const platformLabel = (platform) => platform === "x" ? "X" : "LinkedIn";
34355
34371
  const lifecycleConnectContract = writeCLIContract({
34356
34372
  hazards: [{
34357
34373
  code: "account_connect_billing",
34358
- message: "The first call can start provider billing; pass the returned accountId when polling so retries cannot start another charge."
34374
+ message: "LinkedIn can charge on the first call; X charges after OAuth. Pass the returned accountId on every retry."
34359
34375
  }],
34360
34376
  idField: "accountId",
34361
34377
  idempotency: {