@apify/mcp-widgets 0.3.11 → 0.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c1af0f5fc11bc880714b4ff54f14957331e38d35
|
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
export type StructuredPricingInfo = {
|
|
2
2
|
model: string;
|
|
3
3
|
userTier?: string;
|
|
4
|
-
pricePerUnit?: number;
|
|
5
|
-
unitName?: string;
|
|
6
|
-
trialMinutes?: number;
|
|
7
|
-
tieredPricing?: {
|
|
8
|
-
tier: string;
|
|
9
|
-
pricePerUnit: number;
|
|
10
|
-
}[];
|
|
11
4
|
events?: {
|
|
12
5
|
title: string;
|
|
13
6
|
description?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;SACpB,EAAE,CAAC;KACP,EAAE,CAAC;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,OAAO,CA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,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE;YACP,OAAO,CAAC,EAAE;gBAAE,EAAE,EAAE,MAAM,CAAC;gBAAC,SAAS,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SAChD,CAAC;KACL,CAAC;CACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/utils/formatting.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/utils/formatting.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA6CtD,wBAAgB,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CASpE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAU7E;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,WAAmD,CAAC;AAE5F,2CAA2C;AAC3C,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
package/dist/utils/formatting.js
CHANGED
|
@@ -13,20 +13,14 @@ function formatPriceUsd(price) {
|
|
|
13
13
|
}
|
|
14
14
|
/** Cheapest paid tier scaled to 1,000 units, `null` when every tier is free. */
|
|
15
15
|
function cheapestPaidPricePerThousand(tiers) {
|
|
16
|
-
const paidPrices = tiers.filter(({ tier,
|
|
16
|
+
const paidPrices = tiers.filter(({ tier, priceUsd }) => tier !== "FREE" && priceUsd > 0).map(({ priceUsd }) => priceUsd);
|
|
17
17
|
if (paidPrices.length === 0) return null;
|
|
18
18
|
return Math.min(...paidPrices) * PRICE_DISPLAY_UNIT_SIZE;
|
|
19
19
|
}
|
|
20
|
-
function formatFlatPricePerMonth(pricePerUnit) {
|
|
21
|
-
return `${formatPriceUsd(pricePerUnit ?? 0)}/month + usage`;
|
|
22
|
-
}
|
|
23
20
|
function formatPayPerEventPricing(event) {
|
|
24
21
|
const title = event.title.toLowerCase() || "result";
|
|
25
22
|
const perThousand = `1,000 ${pluralize(title, PRICE_DISPLAY_UNIT_SIZE)}`;
|
|
26
|
-
const tieredPerThousand = cheapestPaidPricePerThousand(
|
|
27
|
-
tier,
|
|
28
|
-
price: priceUsd
|
|
29
|
-
})));
|
|
23
|
+
const tieredPerThousand = cheapestPaidPricePerThousand(event.tieredPricing ?? []);
|
|
30
24
|
if (tieredPerThousand !== null) return `from ${formatPriceUsd(tieredPerThousand)} / ${perThousand}`;
|
|
31
25
|
if (typeof event.priceUsd === "number") {
|
|
32
26
|
if (event.priceUsd < PER_THOUSAND_PRICING_THRESHOLD) return `${formatPriceUsd(event.priceUsd * PRICE_DISPLAY_UNIT_SIZE)} / ${perThousand}`;
|
|
@@ -34,20 +28,11 @@ function formatPayPerEventPricing(event) {
|
|
|
34
28
|
}
|
|
35
29
|
return "Pay per event";
|
|
36
30
|
}
|
|
37
|
-
function formatPricePerDatasetItem(pricing) {
|
|
38
|
-
const perThousand = `1,000 ${pluralize(pricing.unitName || "result")}`;
|
|
39
|
-
return `from ${formatPriceUsd(cheapestPaidPricePerThousand((pricing.tieredPricing ?? []).map(({ tier, pricePerUnit }) => ({
|
|
40
|
-
tier,
|
|
41
|
-
price: pricePerUnit
|
|
42
|
-
}))) ?? (pricing.pricePerUnit ?? 0) * PRICE_DISPLAY_UNIT_SIZE)} / ${perThousand}`;
|
|
43
|
-
}
|
|
44
31
|
function formatPricing(pricing) {
|
|
45
|
-
if (pricing.model === "FLAT_PRICE_PER_MONTH") return formatFlatPricePerMonth(pricing.pricePerUnit);
|
|
46
32
|
if (pricing.model === "PAY_PER_EVENT") {
|
|
47
33
|
if (pricing.events?.length === 1) return formatPayPerEventPricing(pricing.events[0]);
|
|
48
34
|
return "Pay per event";
|
|
49
35
|
}
|
|
50
|
-
if (pricing.model === "PRICE_PER_DATASET_ITEM") return formatPricePerDatasetItem(pricing);
|
|
51
36
|
return "Pay per usage";
|
|
52
37
|
}
|
|
53
38
|
function formatNumber(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/mcp-widgets",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "React components that render the output of Apify MCP tools (Actor search, Actor details)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apify",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"vite": "^8.0.14",
|
|
70
70
|
"vite-plugin-dts": "^5.0.1"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "282d58a07666961bdcc8d712c926cbda8244cac3"
|
|
73
73
|
}
|