@pubnio/sdk 0.2.13 → 0.3.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 +274 -15
- package/dist/index.d.cts +582 -25
- package/dist/index.d.ts +582 -25
- package/dist/index.js +275 -16
- package/dist/internal.cjs +274 -15
- package/dist/internal.d.cts +814 -103
- package/dist/internal.d.ts +814 -103
- package/dist/internal.js +275 -16
- package/dist/solid.cjs +274 -15
- package/dist/solid.d.cts +1024 -273
- package/dist/solid.d.ts +1024 -273
- package/dist/solid.js +275 -16
- package/package.json +1 -1
package/dist/internal.js
CHANGED
|
@@ -139,6 +139,7 @@ __export(exports_sdk_gen, {
|
|
|
139
139
|
postsRetry: () => postsRetry,
|
|
140
140
|
postsUpdate: () => postsUpdate,
|
|
141
141
|
postsValidate: () => postsValidate,
|
|
142
|
+
postsValidateBody: () => postsValidateBody,
|
|
142
143
|
profileDeactivate: () => profileDeactivate,
|
|
143
144
|
profileGet: () => profileGet,
|
|
144
145
|
profileUpdate: () => profileUpdate,
|
|
@@ -348,6 +349,8 @@ var IssueCode = Schema6.Literals([
|
|
|
348
349
|
"tiktok_upload_required",
|
|
349
350
|
"tiktok_too_many_mentions",
|
|
350
351
|
"queue_and_time_conflict",
|
|
352
|
+
"queue_not_found",
|
|
353
|
+
"queue_unavailable",
|
|
351
354
|
"invalid_field",
|
|
352
355
|
"account_ambiguous",
|
|
353
356
|
"unsupported_placement",
|
|
@@ -358,8 +361,9 @@ var IssueCode = Schema6.Literals([
|
|
|
358
361
|
var PostIssue = Schema6.Struct({
|
|
359
362
|
code: IssueCode,
|
|
360
363
|
path: Schema6.Array(Schema6.Union([Schema6.String, Schema6.Int])),
|
|
361
|
-
message: Schema6.String
|
|
362
|
-
})
|
|
364
|
+
message: Schema6.String,
|
|
365
|
+
candidates: Schema6.optionalKey(Schema6.Array(Schema6.Struct({ accountId: AccountId, name: Schema6.String })))
|
|
366
|
+
}).annotate({ identifier: "PostIssue" });
|
|
363
367
|
var schemaIssueFormatter = SchemaIssue.makeFormatterStandardSchemaV1();
|
|
364
368
|
|
|
365
369
|
// ../protocol/src/provider.ts
|
|
@@ -576,7 +580,10 @@ var DeliveryIssue = Schema8.Literals([
|
|
|
576
580
|
"tiktok_settings_not_allowed",
|
|
577
581
|
"tiktok_processing_failed",
|
|
578
582
|
"submission_uncertain",
|
|
579
|
-
"confirmation_unavailable"
|
|
583
|
+
"confirmation_unavailable",
|
|
584
|
+
"billing_inactive",
|
|
585
|
+
"spend_cap_reached",
|
|
586
|
+
"insufficient_credit"
|
|
580
587
|
]);
|
|
581
588
|
var FirstCommentStatus = Schema8.Literals([
|
|
582
589
|
"pending",
|
|
@@ -675,6 +682,7 @@ var BillingSubscriptionStatus = Schema9.Literals([
|
|
|
675
682
|
var UsageMeter = Schema9.Literals([
|
|
676
683
|
"confirmed_publish",
|
|
677
684
|
"x_passthrough",
|
|
685
|
+
"x_read",
|
|
678
686
|
"managed_ad",
|
|
679
687
|
"inbox_reply",
|
|
680
688
|
"automation_run"
|
|
@@ -691,10 +699,15 @@ var BillingPlan = Schema9.Struct({
|
|
|
691
699
|
monthlyPrice: Schema9.NullOr(Money),
|
|
692
700
|
annualPrice: Schema9.NullOr(Money),
|
|
693
701
|
meters: Schema9.Array(BillingPlanMeter),
|
|
702
|
+
xReads: Schema9.Boolean,
|
|
703
|
+
includedXReadMicros: Schema9.NullOr(Schema9.Int),
|
|
694
704
|
seatsLimit: Schema9.NullOr(Schema9.Int),
|
|
695
705
|
analyticsRetentionDays: Schema9.Int,
|
|
696
706
|
whiteLabelOAuth: Schema9.Boolean,
|
|
697
|
-
ssoSaml: Schema9.Boolean
|
|
707
|
+
ssoSaml: Schema9.Boolean,
|
|
708
|
+
priorityQueue: Schema9.Boolean,
|
|
709
|
+
adsInsights: Schema9.Boolean,
|
|
710
|
+
adsWrite: Schema9.Boolean
|
|
698
711
|
}).annotate({ identifier: "BillingPlan" });
|
|
699
712
|
var BillingPlanList = Schema9.Struct({
|
|
700
713
|
data: Schema9.Array(BillingPlan)
|
|
@@ -730,6 +743,8 @@ var WorkspaceBilling = Schema9.Struct({
|
|
|
730
743
|
creditBalance: Money,
|
|
731
744
|
spendControls: BillingSpendControls,
|
|
732
745
|
currentPeriod: Schema9.Struct({
|
|
746
|
+
start: Schema9.String,
|
|
747
|
+
end: Schema9.String,
|
|
733
748
|
meters: Schema9.Array(BillingMeterUsage),
|
|
734
749
|
totalVariableSpendMicros: Schema9.Int,
|
|
735
750
|
seatsUsed: Schema9.Int,
|
|
@@ -1871,7 +1886,51 @@ var ApiLimits = Schema15.Struct({
|
|
|
1871
1886
|
media: MediaLimits,
|
|
1872
1887
|
rateLimits: RateLimits
|
|
1873
1888
|
}).annotate({ identifier: "ApiLimits" });
|
|
1889
|
+
var pollOptionCount = { minOptions: 2, maxOptions: 4 };
|
|
1890
|
+
var xPollLimits = {
|
|
1891
|
+
...pollOptionCount,
|
|
1892
|
+
optionCharacters: 25,
|
|
1893
|
+
minDurationMinutes: 5,
|
|
1894
|
+
maxDurationMinutes: 10080
|
|
1895
|
+
};
|
|
1896
|
+
var linkedinPollLimits = {
|
|
1897
|
+
...pollOptionCount,
|
|
1898
|
+
questionCharacters: 140,
|
|
1899
|
+
optionCharacters: 30,
|
|
1900
|
+
durations: ["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]
|
|
1901
|
+
};
|
|
1902
|
+
var xReplySettings = [
|
|
1903
|
+
"following",
|
|
1904
|
+
"mentionedUsers",
|
|
1905
|
+
"subscribers",
|
|
1906
|
+
"verified"
|
|
1907
|
+
];
|
|
1908
|
+
var xMediaTagLimit = 10;
|
|
1909
|
+
var pollOptionLimits = {
|
|
1910
|
+
minOptions: Schema15.Int,
|
|
1911
|
+
maxOptions: Schema15.Int,
|
|
1912
|
+
optionCharacters: Schema15.Int
|
|
1913
|
+
};
|
|
1914
|
+
var FeedSettingsCapability = Schema15.Struct({
|
|
1915
|
+
poll: Schema15.Union([
|
|
1916
|
+
Schema15.Struct({
|
|
1917
|
+
...pollOptionLimits,
|
|
1918
|
+
minDurationMinutes: Schema15.Int,
|
|
1919
|
+
maxDurationMinutes: Schema15.Int
|
|
1920
|
+
}),
|
|
1921
|
+
Schema15.Struct({
|
|
1922
|
+
...pollOptionLimits,
|
|
1923
|
+
questionCharacters: Schema15.Int,
|
|
1924
|
+
durations: Schema15.Array(Schema15.Literals(linkedinPollLimits.durations))
|
|
1925
|
+
})
|
|
1926
|
+
]),
|
|
1927
|
+
replySettings: Schema15.optionalKey(Schema15.Array(Schema15.Literals(xReplySettings))),
|
|
1928
|
+
maxMediaTags: Schema15.optionalKey(Schema15.Int),
|
|
1929
|
+
placeId: Schema15.optionalKey(Schema15.Boolean),
|
|
1930
|
+
quotePostId: Schema15.optionalKey(Schema15.Boolean)
|
|
1931
|
+
});
|
|
1874
1932
|
var PlacementCapability = Schema15.Struct({
|
|
1933
|
+
settings: Schema15.optionalKey(FeedSettingsCapability),
|
|
1875
1934
|
placement: PublishPlacement,
|
|
1876
1935
|
default: Schema15.Boolean,
|
|
1877
1936
|
mediaTypes: Schema15.Array(MediaType),
|
|
@@ -2242,9 +2301,14 @@ var InstagramAudioSearch = Schema17.Struct({
|
|
|
2242
2301
|
import { Schema as Schema28 } from "effect";
|
|
2243
2302
|
|
|
2244
2303
|
// ../protocol/src/publishing.ts
|
|
2245
|
-
import { Schema as Schema18 } from "effect";
|
|
2304
|
+
import { Effect, Schema as Schema18 } from "effect";
|
|
2246
2305
|
var postTextLimit = 128000;
|
|
2247
2306
|
var threadPostTextLimit = 1250;
|
|
2307
|
+
var blueskyPostMaxBytes = 3000;
|
|
2308
|
+
var graphemeSegmenter = new Intl.Segmenter(undefined, {
|
|
2309
|
+
granularity: "grapheme"
|
|
2310
|
+
});
|
|
2311
|
+
var utf8 = new TextEncoder;
|
|
2248
2312
|
var redditTitleMaxLength = 300;
|
|
2249
2313
|
var threadsTextLimit = 500;
|
|
2250
2314
|
var xArticleTitleMaxLength = 100;
|
|
@@ -2352,12 +2416,34 @@ var InstagramStorySettings = Schema18.Struct({
|
|
|
2352
2416
|
muteAudio: Schema18.optionalKey(Schema18.Boolean),
|
|
2353
2417
|
userTags: instagramTags
|
|
2354
2418
|
}).annotate({ identifier: "InstagramStorySettings" });
|
|
2419
|
+
var blueskyPostText = Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(blueskyPostMaxBytes));
|
|
2355
2420
|
var BlueskyFeedSettings = Schema18.Struct({
|
|
2356
|
-
firstComment: Schema18.optionalKey(
|
|
2357
|
-
thread: Schema18.optionalKey(Schema18.Array(
|
|
2421
|
+
firstComment: Schema18.optionalKey(blueskyPostText),
|
|
2422
|
+
thread: Schema18.optionalKey(Schema18.Array(blueskyPostText).check(Schema18.isMaxLength(24))),
|
|
2358
2423
|
altText: Schema18.optionalKey(Schema18.String.check(Schema18.isMaxLength(1000)))
|
|
2359
2424
|
}).annotate({ identifier: "BlueskyFeedSettings" });
|
|
2425
|
+
var nonblank = Schema18.makeFilter((value) => value.trim().length > 0 || "Supply a nonblank string.", { toJsonSchema: () => ({ pattern: "\\S" }) });
|
|
2426
|
+
function pollText(maximum) {
|
|
2427
|
+
return Schema18.String.check(Schema18.isBetweenCodePoints(1, maximum, {
|
|
2428
|
+
expected: `between 1 and ${maximum} characters`
|
|
2429
|
+
}), nonblank);
|
|
2430
|
+
}
|
|
2431
|
+
function pollOptions({
|
|
2432
|
+
minOptions,
|
|
2433
|
+
maxOptions,
|
|
2434
|
+
optionCharacters
|
|
2435
|
+
}) {
|
|
2436
|
+
return Schema18.Array(pollText(optionCharacters)).check(Schema18.isMinLength(minOptions), Schema18.isMaxLength(maxOptions));
|
|
2437
|
+
}
|
|
2438
|
+
var LinkedInPoll = Schema18.Struct({
|
|
2439
|
+
question: pollText(linkedinPollLimits.questionCharacters),
|
|
2440
|
+
options: pollOptions(linkedinPollLimits),
|
|
2441
|
+
duration: Schema18.Literals(linkedinPollLimits.durations)
|
|
2442
|
+
}).annotate({
|
|
2443
|
+
description: "Organic LinkedIn poll. Include post text and omit media, altText, and documentTitle."
|
|
2444
|
+
});
|
|
2360
2445
|
var LinkedInFeedSettings = Schema18.Struct({
|
|
2446
|
+
poll: Schema18.optionalKey(LinkedInPoll),
|
|
2361
2447
|
firstComment: Schema18.optionalKey(text),
|
|
2362
2448
|
thread: Schema18.optionalKey(Schema18.Array(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(threadPostTextLimit))).check(Schema18.isMaxLength(24))),
|
|
2363
2449
|
visibility: Schema18.optionalKey(Schema18.Literals(["PUBLIC", "CONNECTIONS"])),
|
|
@@ -2394,6 +2480,7 @@ var YouTubeVideoSettings = Schema18.Struct({
|
|
|
2394
2480
|
title: Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(100)),
|
|
2395
2481
|
description: Schema18.optionalKey(Schema18.String.check(Schema18.isMaxLength(5000))),
|
|
2396
2482
|
privacyStatus: Schema18.Literals(["public", "unlisted", "private"]),
|
|
2483
|
+
firstComment: Schema18.optionalKey(text),
|
|
2397
2484
|
tags: Schema18.optionalKey(Schema18.Array(Schema18.String.check(Schema18.isMaxLength(100))).check(Schema18.isMaxLength(30))),
|
|
2398
2485
|
categoryId: Schema18.optionalKey(Schema18.String.check(Schema18.isPattern(/^\d{1,3}$/))),
|
|
2399
2486
|
madeForKids: Schema18.optionalKey(Schema18.Boolean),
|
|
@@ -2408,14 +2495,66 @@ var XArticleDraftSettings = Schema18.Struct({
|
|
|
2408
2495
|
title: Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(xArticleTitleMaxLength)),
|
|
2409
2496
|
content: Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(xArticleContentMaxLength))
|
|
2410
2497
|
}).annotate({ identifier: "XArticleDraftSettings" });
|
|
2498
|
+
var XPoll = Schema18.Struct({
|
|
2499
|
+
options: pollOptions(xPollLimits),
|
|
2500
|
+
durationMinutes: Schema18.Number.check(Schema18.isInt({ expected: "an integer number of minutes" }), Schema18.isBetween({
|
|
2501
|
+
minimum: xPollLimits.minDurationMinutes,
|
|
2502
|
+
maximum: xPollLimits.maxDurationMinutes
|
|
2503
|
+
}, {
|
|
2504
|
+
expected: `between ${xPollLimits.minDurationMinutes} and ${xPollLimits.maxDurationMinutes} minutes`
|
|
2505
|
+
}))
|
|
2506
|
+
}).annotate({
|
|
2507
|
+
description: "X poll on the root post. Include post text and omit attachments."
|
|
2508
|
+
});
|
|
2509
|
+
var xPostOptionId = Schema18.String.check(Schema18.isPattern(/^[0-9]{1,19}$/, {
|
|
2510
|
+
expected: "an X ID string of 1 to 19 digits"
|
|
2511
|
+
}));
|
|
2411
2512
|
var XFeedSettings = Schema18.Struct({
|
|
2513
|
+
poll: Schema18.optionalKey(XPoll),
|
|
2514
|
+
replySettings: Schema18.optionalKey(Schema18.Literals(xReplySettings).annotate({
|
|
2515
|
+
description: "Who may reply to the root X post. Omit for the provider default."
|
|
2516
|
+
})),
|
|
2517
|
+
quotePostId: Schema18.optionalKey(xPostOptionId.annotate({
|
|
2518
|
+
description: "Native quotes require an X Enterprise app. With PubNio's current app, omit this field and put the X post URL in the text."
|
|
2519
|
+
})),
|
|
2520
|
+
mediaTaggedUserIds: Schema18.optionalKey(Schema18.Array(xPostOptionId).check(Schema18.isMaxLength(xMediaTagLimit)).annotate({
|
|
2521
|
+
description: "X user ID strings to tag on root post photos (JPEG, PNG, or WebP)."
|
|
2522
|
+
})),
|
|
2523
|
+
placeId: Schema18.optionalKey(Schema18.String.check(Schema18.isTrimmed({
|
|
2524
|
+
expected: "an X Place ID without surrounding whitespace"
|
|
2525
|
+
}), nonblank).annotate({
|
|
2526
|
+
description: "Opaque X Place ID such as geo.place_id from a post lookup."
|
|
2527
|
+
})),
|
|
2412
2528
|
firstComment: Schema18.optionalKey(text),
|
|
2413
|
-
thread: Schema18.optionalKey(Schema18.Array(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(
|
|
2529
|
+
thread: Schema18.optionalKey(Schema18.Array(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(threadPostTextLimit))).check(Schema18.isMaxLength(24))),
|
|
2414
2530
|
article: Schema18.optionalKey(XArticleDraftSettings)
|
|
2415
2531
|
}).annotate({ identifier: "XFeedSettings" });
|
|
2416
|
-
var
|
|
2417
|
-
|
|
2418
|
-
|
|
2532
|
+
var googleBusinessLocalTimeFormat = "Use a valid location-local date and time in YYYY-MM-DDTHH:MM format.";
|
|
2533
|
+
var googleBusinessLocalTime = Schema18.String.check(Schema18.isPattern(/^[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):[0-5][0-9]$/, {
|
|
2534
|
+
message: googleBusinessLocalTimeFormat
|
|
2535
|
+
}), Schema18.makeFilter((value) => {
|
|
2536
|
+
const year = Number(value.slice(0, 4));
|
|
2537
|
+
const date = new Date(`${value}:00Z`);
|
|
2538
|
+
return year > 0 && date.getUTCMonth() + 1 === Number(value.slice(5, 7)) && date.getUTCDate() === Number(value.slice(8, 10)) || googleBusinessLocalTimeFormat;
|
|
2539
|
+
})).annotate({ description: googleBusinessLocalTimeFormat });
|
|
2540
|
+
var googleBusinessNonblank = Schema18.String.check(Schema18.isPattern(/\S/, {
|
|
2541
|
+
message: "Enter a string with non-whitespace content."
|
|
2542
|
+
}));
|
|
2543
|
+
var googleBusinessLink = MediaUrl.annotate({
|
|
2544
|
+
description: "Use an HTTPS URL of at most 2,048 characters without embedded credentials.",
|
|
2545
|
+
message: "Use an HTTPS URL of at most 2,048 characters without embedded credentials."
|
|
2546
|
+
});
|
|
2547
|
+
var GoogleBusinessFeedSettings = Schema18.Struct({
|
|
2548
|
+
topicType: Schema18.optionalKey(Schema18.Literals(["standard", "event", "offer"])),
|
|
2549
|
+
title: Schema18.optionalKey(googleBusinessNonblank),
|
|
2550
|
+
startsAt: Schema18.optionalKey(googleBusinessLocalTime),
|
|
2551
|
+
endsAt: Schema18.optionalKey(googleBusinessLocalTime),
|
|
2552
|
+
couponCode: Schema18.optionalKey(googleBusinessNonblank),
|
|
2553
|
+
redeemUrl: Schema18.optionalKey(googleBusinessLink),
|
|
2554
|
+
terms: Schema18.optionalKey(googleBusinessNonblank),
|
|
2555
|
+
callToAction: Schema18.optionalKey(Schema18.Literals(["book", "order", "shop", "learn_more", "sign_up", "call"])),
|
|
2556
|
+
callToActionUrl: Schema18.optionalKey(googleBusinessLink)
|
|
2557
|
+
}).annotate({ identifier: "GoogleBusinessFeedSettings" });
|
|
2419
2558
|
var ThreadsFeedSettings = Schema18.Struct({
|
|
2420
2559
|
firstComment: Schema18.optionalKey(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(threadsTextLimit))),
|
|
2421
2560
|
thread: Schema18.optionalKey(Schema18.Array(Schema18.String.check(Schema18.isMinLength(1), Schema18.isMaxLength(threadsTextLimit))).check(Schema18.isMaxLength(24)))
|
|
@@ -2594,6 +2733,41 @@ var providerSettings = Schema18.Union([
|
|
|
2594
2733
|
TikTokFeedSettings,
|
|
2595
2734
|
GoogleBusinessFeedSettings
|
|
2596
2735
|
]);
|
|
2736
|
+
function settingsShapeErrors(issue, depth = 0) {
|
|
2737
|
+
switch (issue._tag) {
|
|
2738
|
+
case "Composite":
|
|
2739
|
+
return issue.issues.reduce((count, child) => count + settingsShapeErrors(child, depth), 0);
|
|
2740
|
+
case "AnyOf":
|
|
2741
|
+
return issue.issues.length === 0 ? 0 : Math.min(...issue.issues.map((child) => settingsShapeErrors(child, depth)));
|
|
2742
|
+
case "Pointer":
|
|
2743
|
+
return settingsShapeErrors(issue.issue, depth + issue.path.length);
|
|
2744
|
+
case "UnexpectedKey":
|
|
2745
|
+
return depth === 1 ? 3 : 2;
|
|
2746
|
+
case "MissingKey":
|
|
2747
|
+
return depth === 1 ? 4 : 1;
|
|
2748
|
+
default:
|
|
2749
|
+
return 0;
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
var createTargetSettings = providerSettings.pipe(Schema18.catchDecoding((issue) => {
|
|
2753
|
+
if (issue._tag !== "AnyOf")
|
|
2754
|
+
return Effect.fail(issue);
|
|
2755
|
+
const [first, ...others] = issue.issues;
|
|
2756
|
+
if (!first)
|
|
2757
|
+
return Effect.fail(issue);
|
|
2758
|
+
let closest = first;
|
|
2759
|
+
let fewest = settingsShapeErrors(first);
|
|
2760
|
+
for (const candidate of others) {
|
|
2761
|
+
if (fewest === 0)
|
|
2762
|
+
break;
|
|
2763
|
+
const errors = settingsShapeErrors(candidate);
|
|
2764
|
+
if (errors < fewest) {
|
|
2765
|
+
closest = candidate;
|
|
2766
|
+
fewest = errors;
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
return Effect.fail(closest);
|
|
2770
|
+
}));
|
|
2597
2771
|
var CreatePostTarget = Schema18.Struct({
|
|
2598
2772
|
accountId: AccountId,
|
|
2599
2773
|
provider: Schema18.optionalKey(Provider),
|
|
@@ -2605,7 +2779,7 @@ var CreatePostTarget = Schema18.Struct({
|
|
|
2605
2779
|
queueId: Schema18.optionalKey(Schema18.String.check(Schema18.isUUID()).annotate({
|
|
2606
2780
|
description: "Assign this destination to its connected account's schedule queue."
|
|
2607
2781
|
})),
|
|
2608
|
-
settings: Schema18.optionalKey(
|
|
2782
|
+
settings: Schema18.optionalKey(createTargetSettings)
|
|
2609
2783
|
}).annotate({ identifier: "CreatePostTarget" });
|
|
2610
2784
|
var postText = Schema18.Trim.check(Schema18.isMaxLength(postTextLimit)).pipe(Schema18.annotateEncoded({
|
|
2611
2785
|
description: `At most ${postTextLimit} characters after trimming.`
|
|
@@ -3297,6 +3471,31 @@ var InboxReviewList = Schema21.Struct({
|
|
|
3297
3471
|
var InboxUnreadCount = Schema21.Struct({
|
|
3298
3472
|
unreadCount: Schema21.Int
|
|
3299
3473
|
}).annotate({ identifier: "InboxUnreadCount" });
|
|
3474
|
+
var InboxUnavailableReason = Schema21.Literals([
|
|
3475
|
+
"provider_subscription_limit",
|
|
3476
|
+
"missing_scopes",
|
|
3477
|
+
"webhook_invalid",
|
|
3478
|
+
"subscription_pending",
|
|
3479
|
+
"plan_required",
|
|
3480
|
+
"insufficient_credit",
|
|
3481
|
+
"spend_cap_reached"
|
|
3482
|
+
]);
|
|
3483
|
+
var InboxUnavailableState = Schema21.Struct({
|
|
3484
|
+
reason: InboxUnavailableReason,
|
|
3485
|
+
action: Schema21.Literals([
|
|
3486
|
+
"contact_pubnio",
|
|
3487
|
+
"reconnect_account",
|
|
3488
|
+
"wait_for_repair",
|
|
3489
|
+
"upgrade_plan",
|
|
3490
|
+
"add_credit",
|
|
3491
|
+
"raise_spend_cap"
|
|
3492
|
+
])
|
|
3493
|
+
});
|
|
3494
|
+
var InboxDeliveryGap = Schema21.Struct({
|
|
3495
|
+
from: Schema21.String,
|
|
3496
|
+
to: Schema21.String,
|
|
3497
|
+
action: Schema21.Literal("review_on_x")
|
|
3498
|
+
});
|
|
3300
3499
|
var InboxChannelCapability = Schema21.Struct({
|
|
3301
3500
|
resource: InboxResource,
|
|
3302
3501
|
supported: Schema21.Boolean,
|
|
@@ -3309,7 +3508,8 @@ var InboxChannelCapability = Schema21.Struct({
|
|
|
3309
3508
|
syncMode: InboxSyncMode,
|
|
3310
3509
|
backfillDays: Schema21.Int,
|
|
3311
3510
|
missingScopes: Schema21.Array(Schema21.String),
|
|
3312
|
-
missingTasks: Schema21.Array(Schema21.String)
|
|
3511
|
+
missingTasks: Schema21.Array(Schema21.String),
|
|
3512
|
+
unavailable: Schema21.NullOr(InboxUnavailableState)
|
|
3313
3513
|
}).annotate({ identifier: "InboxChannelCapability" });
|
|
3314
3514
|
var InboxAccountCapabilities = Schema21.Struct({
|
|
3315
3515
|
accountId: AccountId,
|
|
@@ -3324,6 +3524,7 @@ var InboxAccountCapabilities = Schema21.Struct({
|
|
|
3324
3524
|
mentions: InboxChannelCapability,
|
|
3325
3525
|
replyWindow: InboxReplyWindow,
|
|
3326
3526
|
lastSyncError: Schema21.NullOr(Schema21.String),
|
|
3527
|
+
deliveryGap: Schema21.NullOr(InboxDeliveryGap),
|
|
3327
3528
|
checkedAt: Schema21.String
|
|
3328
3529
|
}).annotate({ identifier: "InboxAccountCapabilities" });
|
|
3329
3530
|
var InboxCapabilities = Schema21.Struct({
|
|
@@ -4236,7 +4437,8 @@ var WorkspaceEventType = Schema26.Literals([
|
|
|
4236
4437
|
"billing.credit.topped_up",
|
|
4237
4438
|
"billing.credit.low",
|
|
4238
4439
|
"billing.spend_cap.reached",
|
|
4239
|
-
"billing.invoice.payment_failed"
|
|
4440
|
+
"billing.invoice.payment_failed",
|
|
4441
|
+
"billing.subscription.duplicate_refunded"
|
|
4240
4442
|
]);
|
|
4241
4443
|
var WorkspaceEventEnvelope = Schema26.Struct({
|
|
4242
4444
|
id: Schema26.String.check(Schema26.isUUID()),
|
|
@@ -4817,6 +5019,15 @@ var WebhookEvent = Schema27.Union([
|
|
|
4817
5019
|
hostedInvoiceUrl: Schema27.NullOr(Schema27.String)
|
|
4818
5020
|
})
|
|
4819
5021
|
}),
|
|
5022
|
+
Schema27.Struct({
|
|
5023
|
+
...envelope,
|
|
5024
|
+
type: Schema27.Literal("billing.subscription.duplicate_refunded"),
|
|
5025
|
+
data: Schema27.Struct({
|
|
5026
|
+
subscriptionId: Schema27.String,
|
|
5027
|
+
amountRefundedMinor: Schema27.Int,
|
|
5028
|
+
currency: Schema27.String
|
|
5029
|
+
})
|
|
5030
|
+
}),
|
|
4820
5031
|
Schema27.Struct({
|
|
4821
5032
|
...envelope,
|
|
4822
5033
|
type: Schema27.Literal("webhook.test"),
|
|
@@ -5000,6 +5211,27 @@ class SeatLimitReached extends HttpApiError.Problem()("SeatLimitReached", {
|
|
|
5000
5211
|
}) {
|
|
5001
5212
|
}
|
|
5002
5213
|
|
|
5214
|
+
class PlanRequired extends HttpApiError.Problem()("PlanRequired", {
|
|
5215
|
+
type: "urn:pubnio:problem:plan-required",
|
|
5216
|
+
status: 402,
|
|
5217
|
+
title: "Plan upgrade required"
|
|
5218
|
+
}, {
|
|
5219
|
+
code: Schema28.Literal("plan_required"),
|
|
5220
|
+
entitlement: Schema28.Literals([
|
|
5221
|
+
"adsInsights",
|
|
5222
|
+
"adsWrite",
|
|
5223
|
+
"analyticsHistory"
|
|
5224
|
+
]),
|
|
5225
|
+
currentPlan: BillingPlanId,
|
|
5226
|
+
minimumPlan: BillingPlanId,
|
|
5227
|
+
fundingUrl: Schema28.String,
|
|
5228
|
+
canManageBilling: Schema28.Boolean,
|
|
5229
|
+
nextAction: Schema28.String,
|
|
5230
|
+
param: Schema28.optionalKey(Schema28.String),
|
|
5231
|
+
earliestDate: Schema28.optionalKey(Schema28.String)
|
|
5232
|
+
}) {
|
|
5233
|
+
}
|
|
5234
|
+
|
|
5003
5235
|
class AlreadyMember extends HttpApiError.Problem()("AlreadyMember", {
|
|
5004
5236
|
type: "urn:pubnio:problem:already-member",
|
|
5005
5237
|
status: 409,
|
|
@@ -5471,7 +5703,15 @@ class InboxUnsupportedContent extends HttpApiError.Problem()("InboxUnsupportedCo
|
|
|
5471
5703
|
capability: ProductCapability
|
|
5472
5704
|
}) {
|
|
5473
5705
|
}
|
|
5706
|
+
|
|
5707
|
+
class InboxUnavailable extends HttpApiError.Problem()("InboxUnavailable", {
|
|
5708
|
+
type: "urn:pubnio:problem:inbox-unavailable",
|
|
5709
|
+
status: 409,
|
|
5710
|
+
title: "Inbox unavailable"
|
|
5711
|
+
}, InboxUnavailableState.fields) {
|
|
5712
|
+
}
|
|
5474
5713
|
var InboxProblems = [
|
|
5714
|
+
InboxUnavailable,
|
|
5475
5715
|
InboxReplyWindowClosed,
|
|
5476
5716
|
InboxTargetChanged,
|
|
5477
5717
|
InboxSyncInProgress,
|
|
@@ -5712,7 +5952,8 @@ var AdsProblems = [
|
|
|
5712
5952
|
AdKillSwitchActive,
|
|
5713
5953
|
AdOperationNotRetryable,
|
|
5714
5954
|
AdProviderRejected,
|
|
5715
|
-
InvalidAdRequest
|
|
5955
|
+
InvalidAdRequest,
|
|
5956
|
+
PlanRequired
|
|
5716
5957
|
];
|
|
5717
5958
|
var SchedulingProblems = [
|
|
5718
5959
|
QueueNotFound,
|
|
@@ -6143,7 +6384,7 @@ import { ProblemDetails } from "effect/http";
|
|
|
6143
6384
|
// package.json
|
|
6144
6385
|
var package_default = {
|
|
6145
6386
|
name: "@pubnio/sdk",
|
|
6146
|
-
version: "0.
|
|
6387
|
+
version: "0.3.0",
|
|
6147
6388
|
description: "JavaScript and TypeScript client for the PubNio API",
|
|
6148
6389
|
type: "module",
|
|
6149
6390
|
exports: {
|
|
@@ -7810,6 +8051,15 @@ var postsCreate = (options) => (options.client ?? client).post({
|
|
|
7810
8051
|
...options.headers
|
|
7811
8052
|
}
|
|
7812
8053
|
});
|
|
8054
|
+
var postsValidateBody = (options) => (options.client ?? client).post({
|
|
8055
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
8056
|
+
url: "/api/v1/posts/validate",
|
|
8057
|
+
...options,
|
|
8058
|
+
headers: {
|
|
8059
|
+
"Content-Type": "application/json",
|
|
8060
|
+
...options.headers
|
|
8061
|
+
}
|
|
8062
|
+
});
|
|
7813
8063
|
var postsDelete = (options) => (options.client ?? client).delete({
|
|
7814
8064
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7815
8065
|
url: "/api/v1/posts/{postId}",
|
|
@@ -9347,6 +9597,15 @@ function createPubNioClient({
|
|
|
9347
9597
|
query: { workspaceId },
|
|
9348
9598
|
...transport()
|
|
9349
9599
|
})),
|
|
9600
|
+
validateBody: (input) => {
|
|
9601
|
+
const body = input;
|
|
9602
|
+
return decode(PostValidation, postsValidateBody({
|
|
9603
|
+
client,
|
|
9604
|
+
query: { workspaceId },
|
|
9605
|
+
body,
|
|
9606
|
+
...transport()
|
|
9607
|
+
}));
|
|
9608
|
+
},
|
|
9350
9609
|
publish: (postId, input) => {
|
|
9351
9610
|
const { idempotencyKey = crypto.randomUUID(), ...publish } = input;
|
|
9352
9611
|
return withIdempotencyKey(idempotencyKey, async () => {
|