@postrun/js 1.3.0 → 2.1.0

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/index.cjs CHANGED
@@ -811,7 +811,6 @@ var zErrorCode = z__namespace.enum([
811
811
  "account_not_available",
812
812
  "connection_reauth_required",
813
813
  "connection_not_pending",
814
- "connection_in_use",
815
814
  "not_implemented",
816
815
  "connection_discovery_failed",
817
816
  "media_processing",
@@ -858,9 +857,11 @@ var zErrorCode = z__namespace.enum([
858
857
  "media_failed",
859
858
  "media_unsupported",
860
859
  "media_kind_mismatch",
860
+ "variant_unparseable",
861
861
  "publishing_unavailable",
862
862
  "x_duplicate_content",
863
863
  "x_not_authorized",
864
+ "x_access_not_permitted",
864
865
  "x_rate_limited",
865
866
  "x_publish_failed",
866
867
  "x_media_upload_failed",
@@ -887,7 +888,8 @@ var zErrorCode = z__namespace.enum([
887
888
  "tiktok_not_authorized",
888
889
  "tiktok_rate_limited",
889
890
  "tiktok_publish_failed",
890
- "connection_platform_mismatch"
891
+ "connection_platform_mismatch",
892
+ "connection_removed"
891
893
  ]);
892
894
  z__namespace.object({
893
895
  limit: z__namespace.int().gte(1).lte(100).optional().default(20),
@@ -1929,7 +1931,7 @@ z__namespace.object({
1929
1931
  variants: z__namespace.array(z__namespace.object({
1930
1932
  id: z__namespace.string(),
1931
1933
  object: z__namespace.literal("post_variant"),
1932
- connection_id: z__namespace.string(),
1934
+ connection_id: z__namespace.string().nullable(),
1933
1935
  platform: z__namespace.enum([
1934
1936
  "x",
1935
1937
  "linkedin",
@@ -2208,7 +2210,7 @@ z__namespace.object({
2208
2210
  variants: z__namespace.array(z__namespace.object({
2209
2211
  id: z__namespace.string(),
2210
2212
  object: z__namespace.literal("post_variant"),
2211
- connection_id: z__namespace.string(),
2213
+ connection_id: z__namespace.string().nullable(),
2212
2214
  platform: z__namespace.enum([
2213
2215
  "x",
2214
2216
  "linkedin",
@@ -2290,7 +2292,7 @@ z__namespace.object({
2290
2292
  variants: z__namespace.array(z__namespace.object({
2291
2293
  id: z__namespace.string(),
2292
2294
  object: z__namespace.literal("post_variant"),
2293
- connection_id: z__namespace.string(),
2295
+ connection_id: z__namespace.string().nullable(),
2294
2296
  platform: z__namespace.enum([
2295
2297
  "x",
2296
2298
  "linkedin",
@@ -2566,7 +2568,7 @@ z__namespace.object({
2566
2568
  variants: z__namespace.array(z__namespace.object({
2567
2569
  id: z__namespace.string(),
2568
2570
  object: z__namespace.literal("post_variant"),
2569
- connection_id: z__namespace.string(),
2571
+ connection_id: z__namespace.string().nullable(),
2570
2572
  platform: z__namespace.enum([
2571
2573
  "x",
2572
2574
  "linkedin",
@@ -2821,7 +2823,6 @@ z__namespace.object({
2821
2823
  "account_not_available",
2822
2824
  "connection_reauth_required",
2823
2825
  "connection_not_pending",
2824
- "connection_in_use",
2825
2826
  "not_implemented",
2826
2827
  "connection_discovery_failed",
2827
2828
  "media_processing",
@@ -2868,9 +2869,11 @@ z__namespace.object({
2868
2869
  "media_failed",
2869
2870
  "media_unsupported",
2870
2871
  "media_kind_mismatch",
2872
+ "variant_unparseable",
2871
2873
  "publishing_unavailable",
2872
2874
  "x_duplicate_content",
2873
2875
  "x_not_authorized",
2876
+ "x_access_not_permitted",
2874
2877
  "x_rate_limited",
2875
2878
  "x_publish_failed",
2876
2879
  "x_media_upload_failed",
@@ -2897,7 +2900,8 @@ z__namespace.object({
2897
2900
  "tiktok_not_authorized",
2898
2901
  "tiktok_rate_limited",
2899
2902
  "tiktok_publish_failed",
2900
- "connection_platform_mismatch"
2903
+ "connection_platform_mismatch",
2904
+ "connection_removed"
2901
2905
  ]),
2902
2906
  message: z__namespace.string(),
2903
2907
  hint: z__namespace.string().optional(),
@@ -5887,6 +5891,10 @@ var tokensMint = (options) => (options.client ?? client).post({
5887
5891
  }
5888
5892
  });
5889
5893
 
5894
+ // src/resources.ts
5895
+ var isPublished = (post) => post.status === "published";
5896
+ var failedVariants = (post) => post.variants.filter((variant) => variant.status === "failed");
5897
+
5890
5898
  // src/compose.ts
5891
5899
  var ComposeError = class extends Error {
5892
5900
  constructor(message) {
@@ -6088,6 +6096,7 @@ exports.connectionsListAccounts = connectionsListAccounts;
6088
6096
  exports.connectionsListByProfile = connectionsListByProfile;
6089
6097
  exports.connectionsSelect = connectionsSelect;
6090
6098
  exports.createPostrunClient = createPostrunClient;
6099
+ exports.failedVariants = failedVariants;
6091
6100
  exports.googleCreateAd = googleCreateAd;
6092
6101
  exports.googleCreateAdGroup = googleCreateAdGroup;
6093
6102
  exports.googleCreateBudget = googleCreateBudget;
@@ -6131,6 +6140,7 @@ exports.googleSetKeywordBid = googleSetKeywordBid;
6131
6140
  exports.googleUploadConversions = googleUploadConversions;
6132
6141
  exports.googleUploadImageAsset = googleUploadImageAsset;
6133
6142
  exports.isPostPlatform = isPostPlatform;
6143
+ exports.isPublished = isPublished;
6134
6144
  exports.logsGet = logsGet;
6135
6145
  exports.logsList = logsList;
6136
6146
  exports.mediaCreate = mediaCreate;