@usesocial/cli 0.19.2 → 0.19.4

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.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#143](https://github.com/usesocial/monorepo/pull/143) [`4def923`](https://github.com/usesocial/monorepo/commit/4def923f4d4abb77528a37ebd2bf3093eb6e8ac0) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Align LinkedIn people, company, and post search with Unipile's cursor pagination contract.
8
+
9
+ ## 0.19.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#139](https://github.com/usesocial/monorepo/pull/139) [`1f924b9`](https://github.com/usesocial/monorepo/commit/1f924b9a8c9229109210bab72cae3731912b3125) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Clarify when disconnected accounts must use connect and when credential failures can reconnect without changing billing.
14
+
3
15
  ## 0.19.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.mjs CHANGED
@@ -11069,6 +11069,11 @@ const PROXY_CACHE_STATUSES = [
11069
11069
  "n/a"
11070
11070
  ];
11071
11071
  const PROXY_CAPABILITIES = ["read", "write"];
11072
+ const BILLING_OPERATION_LEASE_KINDS = [
11073
+ "proxy_request",
11074
+ "seat_mutation",
11075
+ "social_plan_migration"
11076
+ ];
11072
11077
  const CLI_SCOPE_ALIASES$1 = ["read", "read,write"];
11073
11078
  const CLI_CAPABILITIES = [
11074
11079
  "social:read",
@@ -11118,6 +11123,7 @@ _enum(ACCOUNT_CONNECT_ATTEMPT_STATUSES);
11118
11123
  _enum(PROXY_SURFACES);
11119
11124
  _enum(PROXY_CACHE_STATUSES);
11120
11125
  _enum(PROXY_CAPABILITIES);
11126
+ _enum(BILLING_OPERATION_LEASE_KINDS);
11121
11127
  _enum(CLI_SCOPE_ALIASES$1);
11122
11128
  _enum(CLI_CAPABILITIES);
11123
11129
  _enum(FEEDBACK_TYPES);
@@ -11317,6 +11323,8 @@ pgTable("account_connect_attempts", {
11317
11323
  operationKey: text$1("operation_key").notNull(),
11318
11324
  billingPaymentURL: text$1("billing_payment_url"),
11319
11325
  billingRequiredAction: jsonb("billing_required_action").$type(),
11326
+ failureCode: text$1("failure_code"),
11327
+ failureStage: text$1("failure_stage"),
11320
11328
  hostedAuthBindingId: text$1("hosted_auth_binding_id"),
11321
11329
  hostedAuthAccountId: text$1("hosted_auth_account_id"),
11322
11330
  hostedAuthBoundAt: timestamptz("hosted_auth_bound_at"),
@@ -11481,6 +11489,17 @@ pgTable("proxy_call_logs", {
11481
11489
  check("proxy_call_logs_surface_check", sqlCheckIn(table.surface, PROXY_SURFACES)),
11482
11490
  check("proxy_call_logs_cache_status_check", sqlCheckIn(table.cacheStatus, PROXY_CACHE_STATUSES))
11483
11491
  ]);
11492
+ pgTable("billing_operation_leases", {
11493
+ id: text$1("id").primaryKey(),
11494
+ userId: text$1("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
11495
+ kind: text$1("kind", { enum: BILLING_OPERATION_LEASE_KINDS }).notNull(),
11496
+ expiresAt: timestamptz("expires_at").notNull(),
11497
+ createdAt: timestamptz("created_at").notNull().defaultNow()
11498
+ }, (table) => [
11499
+ uniqueIndex("billing_operation_leases_migration_user_key").on(table.userId).where(sql`${table.kind} = 'social_plan_migration'`),
11500
+ index("billing_operation_leases_user_kind_expiry_idx").on(table.userId, table.kind, table.expiresAt),
11501
+ check("billing_operation_leases_kind_check", sqlCheckIn(table.kind, BILLING_OPERATION_LEASE_KINDS))
11502
+ ]);
11484
11503
  const profiles = pgTable("profiles", {
11485
11504
  id: text$1("id").primaryKey().$defaultFn(() => crypto.randomUUID()),
11486
11505
  platform: text$1("platform", { enum: PLATFORMS }).notNull(),
@@ -13206,19 +13225,20 @@ const LINKEDIN_OPERATIONS = [
13206
13225
  },
13207
13226
  parameters: [
13208
13227
  {
13209
- name: "limit",
13228
+ name: "cursor",
13210
13229
  in: "query",
13211
13230
  required: false,
13212
- kind: "integer",
13213
- max: 20,
13214
- description: "Rows to return (1-20)"
13231
+ kind: "string",
13232
+ description: "Pagination cursor"
13215
13233
  },
13216
13234
  {
13217
- name: "cursor",
13235
+ name: "limit",
13218
13236
  in: "query",
13219
13237
  required: false,
13220
- kind: "string",
13221
- description: "Pagination cursor"
13238
+ kind: "integer",
13239
+ min: 1,
13240
+ max: 20,
13241
+ description: "Rows to return (1-20)"
13222
13242
  },
13223
13243
  {
13224
13244
  name: "before",
@@ -13297,18 +13317,19 @@ const LINKEDIN_OPERATIONS = [
13297
13317
  description: "An offset used for pagination, if supported by the provider, else use cursor."
13298
13318
  },
13299
13319
  {
13300
- name: "limit",
13320
+ name: "cursor",
13301
13321
  in: "query",
13302
13322
  required: false,
13303
- kind: "integer",
13304
- description: "Rows to return (1-250)"
13323
+ kind: "string",
13324
+ description: "Pagination cursor"
13305
13325
  },
13306
13326
  {
13307
- name: "cursor",
13327
+ name: "limit",
13308
13328
  in: "query",
13309
13329
  required: false,
13310
- kind: "string",
13311
- description: "Pagination cursor"
13330
+ kind: "integer",
13331
+ min: 1,
13332
+ description: "Rows to return (1-250)"
13312
13333
  },
13313
13334
  {
13314
13335
  name: "chat_id",
@@ -13395,6 +13416,8 @@ const LINKEDIN_OPERATIONS = [
13395
13416
  in: "query",
13396
13417
  required: false,
13397
13418
  kind: "integer",
13419
+ min: 1,
13420
+ max: 100,
13398
13421
  description: "Rows to return (1-100)"
13399
13422
  },
13400
13423
  {
@@ -13497,6 +13520,7 @@ const LINKEDIN_OPERATIONS = [
13497
13520
  in: "query",
13498
13521
  required: false,
13499
13522
  kind: "integer",
13523
+ min: 1,
13500
13524
  description: "Rows to return (1-100)"
13501
13525
  },
13502
13526
  {
@@ -13559,6 +13583,7 @@ const LINKEDIN_OPERATIONS = [
13559
13583
  in: "query",
13560
13584
  required: false,
13561
13585
  kind: "integer",
13586
+ min: 1,
13562
13587
  description: "Rows to return (1-100)"
13563
13588
  },
13564
13589
  {
@@ -13590,9 +13615,9 @@ const LINKEDIN_OPERATIONS = [
13590
13615
  capability: "read",
13591
13616
  mutates: false,
13592
13617
  pagination: {
13593
- style: "offset",
13594
- limitParam: "limit",
13595
- offsetParam: "offset",
13618
+ style: "cursor",
13619
+ cursorParam: "cursor",
13620
+ cursorPath: "next_cursor",
13596
13621
  totalCountPath: "total_count",
13597
13622
  itemsPath: "data"
13598
13623
  },
@@ -13600,29 +13625,19 @@ const LINKEDIN_OPERATIONS = [
13600
13625
  billingCategory: "user_read",
13601
13626
  kind: "search"
13602
13627
  },
13603
- parameters: [
13604
- {
13605
- name: "offset",
13606
- in: "query",
13607
- required: false,
13608
- kind: "integer",
13609
- description: "Pagination offset"
13610
- },
13611
- {
13612
- name: "limit",
13613
- in: "query",
13614
- required: false,
13615
- kind: "integer",
13616
- description: "Rows to return (1-100)"
13617
- },
13618
- {
13619
- name: "keywords",
13620
- in: "query",
13621
- required: true,
13622
- kind: "string",
13623
- description: "Search keywords"
13624
- }
13625
- ]
13628
+ parameters: [{
13629
+ name: "cursor",
13630
+ in: "query",
13631
+ required: false,
13632
+ kind: "string",
13633
+ description: "Pagination cursor"
13634
+ }, {
13635
+ name: "keywords",
13636
+ in: "query",
13637
+ required: true,
13638
+ kind: "string",
13639
+ description: "Search keywords"
13640
+ }]
13626
13641
  },
13627
13642
  {
13628
13643
  schemaBaseName: "SearchJobs",
@@ -13666,6 +13681,8 @@ const LINKEDIN_OPERATIONS = [
13666
13681
  in: "query",
13667
13682
  required: false,
13668
13683
  kind: "integer",
13684
+ min: 1,
13685
+ max: 100,
13669
13686
  description: "Rows to return (1-100)"
13670
13687
  },
13671
13688
  {
@@ -13696,9 +13713,9 @@ const LINKEDIN_OPERATIONS = [
13696
13713
  capability: "read",
13697
13714
  mutates: false,
13698
13715
  pagination: {
13699
- style: "offset",
13700
- limitParam: "limit",
13701
- offsetParam: "offset",
13716
+ style: "cursor",
13717
+ cursorParam: "cursor",
13718
+ cursorPath: "next_cursor",
13702
13719
  totalCountPath: "total_count",
13703
13720
  itemsPath: "data"
13704
13721
  },
@@ -13706,29 +13723,19 @@ const LINKEDIN_OPERATIONS = [
13706
13723
  billingCategory: "user_read",
13707
13724
  kind: "search"
13708
13725
  },
13709
- parameters: [
13710
- {
13711
- name: "offset",
13712
- in: "query",
13713
- required: false,
13714
- kind: "integer",
13715
- description: "Pagination offset"
13716
- },
13717
- {
13718
- name: "limit",
13719
- in: "query",
13720
- required: false,
13721
- kind: "integer",
13722
- description: "Rows to return (1-100)"
13723
- },
13724
- {
13725
- name: "keywords",
13726
- in: "query",
13727
- required: true,
13728
- kind: "string",
13729
- description: "Search keywords"
13730
- }
13731
- ]
13726
+ parameters: [{
13727
+ name: "cursor",
13728
+ in: "query",
13729
+ required: false,
13730
+ kind: "string",
13731
+ description: "Pagination cursor"
13732
+ }, {
13733
+ name: "keywords",
13734
+ in: "query",
13735
+ required: true,
13736
+ kind: "string",
13737
+ description: "Search keywords"
13738
+ }]
13732
13739
  },
13733
13740
  {
13734
13741
  schemaBaseName: "SearchPosts",
@@ -13749,9 +13756,9 @@ const LINKEDIN_OPERATIONS = [
13749
13756
  capability: "read",
13750
13757
  mutates: false,
13751
13758
  pagination: {
13752
- style: "offset",
13753
- limitParam: "limit",
13754
- offsetParam: "offset",
13759
+ style: "cursor",
13760
+ cursorParam: "cursor",
13761
+ cursorPath: "next_cursor",
13755
13762
  totalCountPath: "total_count",
13756
13763
  itemsPath: "data"
13757
13764
  },
@@ -13759,29 +13766,19 @@ const LINKEDIN_OPERATIONS = [
13759
13766
  billingCategory: "posts_read",
13760
13767
  kind: "search"
13761
13768
  },
13762
- parameters: [
13763
- {
13764
- name: "offset",
13765
- in: "query",
13766
- required: false,
13767
- kind: "integer",
13768
- description: "Pagination offset"
13769
- },
13770
- {
13771
- name: "limit",
13772
- in: "query",
13773
- required: false,
13774
- kind: "integer",
13775
- description: "Rows to return (1-100)"
13776
- },
13777
- {
13778
- name: "keywords",
13779
- in: "query",
13780
- required: true,
13781
- kind: "string",
13782
- description: "Search keywords"
13783
- }
13784
- ]
13769
+ parameters: [{
13770
+ name: "cursor",
13771
+ in: "query",
13772
+ required: false,
13773
+ kind: "string",
13774
+ description: "Pagination cursor"
13775
+ }, {
13776
+ name: "keywords",
13777
+ in: "query",
13778
+ required: true,
13779
+ kind: "string",
13780
+ description: "Search keywords"
13781
+ }]
13785
13782
  },
13786
13783
  {
13787
13784
  schemaBaseName: "UserProfile",
@@ -13864,18 +13861,19 @@ const LINKEDIN_OPERATIONS = [
13864
13861
  },
13865
13862
  parameters: [
13866
13863
  {
13867
- name: "limit",
13864
+ name: "cursor",
13868
13865
  in: "query",
13869
13866
  required: false,
13870
- kind: "integer",
13871
- description: "Rows to return (1-100)"
13867
+ kind: "string",
13868
+ description: "Pagination cursor"
13872
13869
  },
13873
13870
  {
13874
- name: "cursor",
13871
+ name: "limit",
13875
13872
  in: "query",
13876
13873
  required: false,
13877
- kind: "string",
13878
- description: "Pagination cursor"
13874
+ kind: "integer",
13875
+ min: 1,
13876
+ description: "Rows to return (1-100)"
13879
13877
  },
13880
13878
  {
13881
13879
  name: "identifier",
@@ -13921,18 +13919,19 @@ const LINKEDIN_OPERATIONS = [
13921
13919
  },
13922
13920
  parameters: [
13923
13921
  {
13924
- name: "limit",
13922
+ name: "cursor",
13925
13923
  in: "query",
13926
13924
  required: false,
13927
- kind: "integer",
13928
- description: "Rows to return (1-1000)"
13925
+ kind: "string",
13926
+ description: "Pagination cursor"
13929
13927
  },
13930
13928
  {
13931
- name: "cursor",
13929
+ name: "limit",
13932
13930
  in: "query",
13933
13931
  required: false,
13934
- kind: "string",
13935
- description: "Pagination cursor"
13932
+ kind: "integer",
13933
+ min: 1,
13934
+ description: "Rows to return (1-1000)"
13936
13935
  },
13937
13936
  {
13938
13937
  name: "user_id",
@@ -13989,6 +13988,7 @@ const LINKEDIN_OPERATIONS = [
13989
13988
  in: "query",
13990
13989
  required: false,
13991
13990
  kind: "integer",
13991
+ min: 1,
13992
13992
  description: "Rows to return (1-100)"
13993
13993
  }]
13994
13994
  },
@@ -14030,6 +14030,7 @@ const LINKEDIN_OPERATIONS = [
14030
14030
  in: "query",
14031
14031
  required: false,
14032
14032
  kind: "integer",
14033
+ min: 1,
14033
14034
  description: "Rows to return (1-100)"
14034
14035
  }]
14035
14036
  },
@@ -14515,8 +14516,8 @@ const dataWithAuditableWriteTarget = (op, data, body) => {
14515
14516
  //#endregion
14516
14517
  //#region ../../packages/linkedin/src/cli/types.ts
14517
14518
  const MessagesListInput = object({
14518
- limit: union([string(), number()]).optional(),
14519
14519
  cursor: string().optional(),
14520
+ limit: union([string(), number()]).optional(),
14520
14521
  before: string().optional(),
14521
14522
  after: string().optional()
14522
14523
  });
@@ -14530,8 +14531,8 @@ const MessagesReadInput = object({
14530
14531
  after: string().optional(),
14531
14532
  user_id: string().optional(),
14532
14533
  offset: union([string(), number()]).optional(),
14533
- limit: union([string(), number()]).optional(),
14534
14534
  cursor: string().optional(),
14535
+ limit: union([string(), number()]).optional(),
14535
14536
  chat_id: string()
14536
14537
  });
14537
14538
  const MessagesReadOutput = object({
@@ -14579,8 +14580,7 @@ const PostsReactionsOutput = object({
14579
14580
  next_cursor: string().optional()
14580
14581
  }).passthrough();
14581
14582
  const SearchCompaniesInput = object({
14582
- offset: union([string(), number()]).optional(),
14583
- limit: union([string(), number()]).optional(),
14583
+ cursor: string().optional(),
14584
14584
  keywords: string()
14585
14585
  });
14586
14586
  const SearchCompaniesOutput = object({
@@ -14599,8 +14599,7 @@ const SearchJobsOutput = object({
14599
14599
  next_cursor: string().optional()
14600
14600
  }).passthrough();
14601
14601
  const SearchPeopleInput = object({
14602
- offset: union([string(), number()]).optional(),
14603
- limit: union([string(), number()]).optional(),
14602
+ cursor: string().optional(),
14604
14603
  keywords: string()
14605
14604
  });
14606
14605
  const SearchPeopleOutput = object({
@@ -14609,8 +14608,7 @@ const SearchPeopleOutput = object({
14609
14608
  next_cursor: string().optional()
14610
14609
  }).passthrough();
14611
14610
  const SearchPostsInput = object({
14612
- offset: union([string(), number()]).optional(),
14613
- limit: union([string(), number()]).optional(),
14611
+ cursor: string().optional(),
14614
14612
  keywords: string()
14615
14613
  });
14616
14614
  const SearchPostsOutput = object({
@@ -14625,8 +14623,8 @@ const UserProfileInput = object({
14625
14623
  });
14626
14624
  const UserProfileOutput = record(string(), unknown());
14627
14625
  const UserPostsInput = object({
14628
- limit: union([string(), number()]).optional(),
14629
14626
  cursor: string().optional(),
14627
+ limit: union([string(), number()]).optional(),
14630
14628
  identifier: string()
14631
14629
  });
14632
14630
  const UserPostsOutput = object({
@@ -14635,8 +14633,8 @@ const UserPostsOutput = object({
14635
14633
  next_cursor: string().optional()
14636
14634
  }).passthrough();
14637
14635
  const UserConnectionsInput = object({
14638
- limit: union([string(), number()]).optional(),
14639
14636
  cursor: string().optional(),
14637
+ limit: union([string(), number()]).optional(),
14640
14638
  user_id: string().optional(),
14641
14639
  filter: string().optional()
14642
14640
  });
@@ -14748,6 +14746,8 @@ const PostsCommentOutput = object({
14748
14746
  ]),
14749
14747
  public_identifier: string().optional(),
14750
14748
  display_name: string(),
14749
+ first_name: string().optional(),
14750
+ last_name: string().optional(),
14751
14751
  profile_url: string().optional(),
14752
14752
  public_picture_url: string().optional(),
14753
14753
  private_picture_download_url: string().optional(),
@@ -14861,11 +14861,13 @@ const schemas$1 = {
14861
14861
  ]),
14862
14862
  public_identifier: string().optional(),
14863
14863
  display_name: string(),
14864
+ first_name: string().optional(),
14865
+ last_name: string().optional(),
14864
14866
  profile_url: string().optional(),
14865
14867
  public_picture_url: string().optional(),
14866
14868
  private_picture_download_url: string().optional(),
14867
14869
  description: string().optional(),
14868
- specifics: unknown().optional()
14870
+ specifics: union([record(string(), unknown()), record(string(), unknown())]).optional()
14869
14871
  }).passthrough().optional()
14870
14872
  }).passthrough(),
14871
14873
  RequestsAcceptInput: object({ request_id: string() }),
@@ -22823,7 +22825,7 @@ const reconnectAccountForIdentifier = async (deps, identifier) => {
22823
22825
  if (ae.isError(account)) {
22824
22826
  if (LinkedinLifecycleNoAccountMatch.is(account.error)) {
22825
22827
  const disconnected = resolveLinkedinLifecycleAccount(accounts.filter((candidate) => candidate.status === "disconnected"), identifier);
22826
- if (ae.isOk(disconnected)) throw new Error(`LinkedIn account @${accountUsername(disconnected.value)} is disconnected and its seat was released. Run \`social account connect linkedin\` to connect it again.`);
22828
+ if (ae.isOk(disconnected)) throw new Error(`LinkedIn account @${accountUsername(disconnected.value)} is disconnected and its seat was released. Run \`social account connect linkedin\` to connect it again. Connecting it again may require billing approval.`);
22827
22829
  }
22828
22830
  throw account.error;
22829
22831
  }
@@ -22925,7 +22927,7 @@ var XReconnectRequiresConnect = class extends h("XReconnectRequiresConnect") {
22925
22927
  super({
22926
22928
  operation: "reconnect",
22927
22929
  account,
22928
- message: `X account ${account} is disconnected and its seat was released. Run \`social account connect x\` to connect it again.`
22930
+ message: `X account ${account} is disconnected and its seat was released. Run \`social account connect x\` to connect it again. Connecting it again may require billing approval.`
22929
22931
  });
22930
22932
  this.name = "XReconnectRequiresConnect";
22931
22933
  }
@@ -24487,7 +24489,7 @@ function createEnv(opts) {
24487
24489
  }
24488
24490
  //#endregion
24489
24491
  //#region package.json
24490
- var version$1 = "0.19.2";
24492
+ var version$1 = "0.19.4";
24491
24493
  //#endregion
24492
24494
  //#region src/lib/env.ts
24493
24495
  const URLWithTrailingSlash = url().transform(ensureTrailingSlash);