@nodaro/shared 2.3.0 → 2.5.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 +38 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -3
- package/dist/index.d.ts +52 -3
- package/dist/index.js +35 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/effective-tier.test.ts +116 -0
- package/src/effective-tier.ts +72 -0
- package/src/index.ts +7 -0
- package/src/model-constants.ts +6 -1
- package/src/pipeline-defaults.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -2733,8 +2733,13 @@ var IMAGE_I2I_PROVIDERS = [
|
|
|
2733
2733
|
"kontext-multi",
|
|
2734
2734
|
// BFL Flux 2 Pro — runs through Replicate with safety_tolerance=5 (max for Pro)
|
|
2735
2735
|
"flux-2-pro",
|
|
2736
|
+
// BFL FLUX Fill Pro — dedicated masked inpainting via Replicate (white = edit area)
|
|
2737
|
+
"flux-fill",
|
|
2736
2738
|
// BFL Flux 2 Max — runs through Replicate with safety_tolerance=5, up to 8 refs
|
|
2737
|
-
"flux-2-max"
|
|
2739
|
+
"flux-2-max",
|
|
2740
|
+
// BFL FLUX Fill Pro — dedicated inpainting via Replicate (image + mask + prompt,
|
|
2741
|
+
// white = edit area). Second mask-capable i2i provider alongside ideogram-edit.
|
|
2742
|
+
"flux-fill"
|
|
2738
2743
|
];
|
|
2739
2744
|
var IMAGE_EDIT_PROVIDERS = [
|
|
2740
2745
|
"recraft-upscale",
|
|
@@ -3026,7 +3031,7 @@ var VOICE_DESIGN_MODELS = [
|
|
|
3026
3031
|
"eleven_multilingual_ttv_v2"
|
|
3027
3032
|
];
|
|
3028
3033
|
var DEFAULT_VOICE_DESIGN_MODEL = "eleven_ttv_v3";
|
|
3029
|
-
var I2I_MASK_SUPPORT = /* @__PURE__ */ new Set(["ideogram-edit"]);
|
|
3034
|
+
var I2I_MASK_SUPPORT = /* @__PURE__ */ new Set(["ideogram-edit", "flux-fill"]);
|
|
3030
3035
|
var IMAGE_MASK_MODE = {
|
|
3031
3036
|
"nano-banana": "prompt",
|
|
3032
3037
|
"nano-banana-pro": "prompt",
|
|
@@ -7634,6 +7639,29 @@ var SOCIAL_POST_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
|
7634
7639
|
var INSTAGRAM_CAROUSEL_MIN_ITEMS = 2;
|
|
7635
7640
|
var INSTAGRAM_CAROUSEL_MAX_ITEMS = 10;
|
|
7636
7641
|
|
|
7642
|
+
// src/effective-tier.ts
|
|
7643
|
+
function resolveStoredTier(p) {
|
|
7644
|
+
return p.tier ?? p.subscription_tier ?? "free";
|
|
7645
|
+
}
|
|
7646
|
+
function resolveEffectiveTier(p) {
|
|
7647
|
+
const stored = resolveStoredTier(p);
|
|
7648
|
+
if (stored === "free" && p.lifetime_topup_credits > 0) return "payg";
|
|
7649
|
+
return stored;
|
|
7650
|
+
}
|
|
7651
|
+
var PAYG_RETENTION_DAYS = 90;
|
|
7652
|
+
function isPaygRetentionActive(p, now) {
|
|
7653
|
+
if (p.lifetimeTopupCredits <= 0) return false;
|
|
7654
|
+
const cutoff = now.getTime() - PAYG_RETENTION_DAYS * 24 * 60 * 60 * 1e3;
|
|
7655
|
+
const at = (v) => {
|
|
7656
|
+
if (v === null) return null;
|
|
7657
|
+
const t2 = v instanceof Date ? v.getTime() : new Date(v).getTime();
|
|
7658
|
+
return Number.isFinite(t2) ? t2 : null;
|
|
7659
|
+
};
|
|
7660
|
+
const topup = at(p.lastTopupAt);
|
|
7661
|
+
const spend = at(p.lastSpendAt);
|
|
7662
|
+
return topup !== null && topup >= cutoff || spend !== null && spend >= cutoff;
|
|
7663
|
+
}
|
|
7664
|
+
|
|
7637
7665
|
// src/node-default-mappings.ts
|
|
7638
7666
|
var NODE_DEFAULT_TYPES = [
|
|
7639
7667
|
// Image
|
|
@@ -9867,6 +9895,8 @@ function validateModeActivation(mode, activation) {
|
|
|
9867
9895
|
}
|
|
9868
9896
|
var TIER_PIPELINE_PARALLELISM = {
|
|
9869
9897
|
free: 0,
|
|
9898
|
+
payg: 1,
|
|
9899
|
+
// derived tier — pipeline entitlements copy basic's
|
|
9870
9900
|
basic: 1,
|
|
9871
9901
|
standard: 2,
|
|
9872
9902
|
pro: 3,
|
|
@@ -9874,6 +9904,8 @@ var TIER_PIPELINE_PARALLELISM = {
|
|
|
9874
9904
|
};
|
|
9875
9905
|
var TIER_MAX_PIPELINE_COST_CREDITS = {
|
|
9876
9906
|
free: 0,
|
|
9907
|
+
payg: 3e3,
|
|
9908
|
+
// derived tier — copies basic
|
|
9877
9909
|
basic: 3e3,
|
|
9878
9910
|
standard: 8e3,
|
|
9879
9911
|
pro: 2e4,
|
|
@@ -13396,6 +13428,7 @@ exports.OptimizeForModelInputSchema = OptimizeForModelInputSchema;
|
|
|
13396
13428
|
exports.OptimizeForModelResultSchema = OptimizeForModelResultSchema;
|
|
13397
13429
|
exports.PARAMETER_NODE_TYPES = PARAMETER_NODE_TYPES;
|
|
13398
13430
|
exports.PASSTHROUGH_TYPES = PASSTHROUGH_TYPES;
|
|
13431
|
+
exports.PAYG_RETENTION_DAYS = PAYG_RETENTION_DAYS;
|
|
13399
13432
|
exports.PER_FORMAT_DURATION_BOUNDS = PER_FORMAT_DURATION_BOUNDS;
|
|
13400
13433
|
exports.PIPELINE_ACTIVATION_MODES = PIPELINE_ACTIVATION_MODES;
|
|
13401
13434
|
exports.PIPELINE_FORMATS = PIPELINE_FORMATS;
|
|
@@ -13745,6 +13778,7 @@ exports.isLocationUsageMode = isLocationUsageMode;
|
|
|
13745
13778
|
exports.isMinimaxH3Provider = isMinimaxH3Provider;
|
|
13746
13779
|
exports.isObjectAspectRatio = isObjectAspectRatio;
|
|
13747
13780
|
exports.isOversizedScene = isOversizedScene;
|
|
13781
|
+
exports.isPaygRetentionActive = isPaygRetentionActive;
|
|
13748
13782
|
exports.isPerSecondLipSyncProvider = isPerSecondLipSyncProvider;
|
|
13749
13783
|
exports.isScraperActor = isScraperActor;
|
|
13750
13784
|
exports.isSeedance2Provider = isSeedance2Provider;
|
|
@@ -13818,6 +13852,7 @@ exports.resolveDefaultRole = resolveDefaultRole;
|
|
|
13818
13852
|
exports.resolveDescription = resolveDescription;
|
|
13819
13853
|
exports.resolveDialogueVoices = resolveDialogueVoices;
|
|
13820
13854
|
exports.resolveEffectiveSourceType = resolveEffectiveSourceType;
|
|
13855
|
+
exports.resolveEffectiveTier = resolveEffectiveTier;
|
|
13821
13856
|
exports.resolveEntityAspect = resolveEntityAspect;
|
|
13822
13857
|
exports.resolveFieldMappings = resolveFieldMappings;
|
|
13823
13858
|
exports.resolveGvpAnchorWire = resolveGvpAnchorWire;
|
|
@@ -13838,6 +13873,7 @@ exports.resolveSelectorRefs = resolveSelectorRefs;
|
|
|
13838
13873
|
exports.resolveSeparator = resolveSeparator;
|
|
13839
13874
|
exports.resolveSheetSections = resolveSheetSections;
|
|
13840
13875
|
exports.resolveSourceThroughConnectedList = resolveSourceThroughConnectedList;
|
|
13876
|
+
exports.resolveStoredTier = resolveStoredTier;
|
|
13841
13877
|
exports.resolveSwitchXCreditId = resolveSwitchXCreditId;
|
|
13842
13878
|
exports.resolveVideoAnalysisModel = resolveVideoAnalysisModel;
|
|
13843
13879
|
exports.resolveVideoProviderForMode = resolveVideoProviderForMode;
|