vidspotai-shared 1.0.40 → 1.0.41
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/lib/utils/helpers.d.ts +7 -4
- package/lib/utils/helpers.d.ts.map +1 -1
- package/lib/utils/helpers.js +10 -7
- package/package.json +1 -1
package/lib/utils/helpers.d.ts
CHANGED
|
@@ -9,10 +9,13 @@ export declare const getCreditsFromCost: (cost: number, applyFloor?: boolean) =>
|
|
|
9
9
|
* Discount factors applied to the total clip cost for multi-clip video types.
|
|
10
10
|
* Implements economies-of-scale pricing: higher volume → lower per-clip margin.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Factors are calibrated so annual-plan users ($0.15/credit) retain ≥20% gross margin
|
|
13
|
+
* on every video type. The break-even condition is: factor × $0.15 / $0.10 ≥ 1.25.
|
|
14
|
+
*
|
|
15
|
+
* SHORT: 1.00 (no discount) → monthly 50% margin | annual 33% margin
|
|
16
|
+
* MEDIUM: 0.90 (10% discount) → monthly 46% margin | annual 26% margin
|
|
17
|
+
* LONG: 0.85 (15% discount) → monthly 41% margin | annual 21% margin
|
|
18
|
+
* VERY_LONG: 0.80 (20% discount) → monthly 36% margin | annual 20% margin
|
|
16
19
|
*/
|
|
17
20
|
export declare const MULTI_CLIP_DISCOUNT_FACTORS: Partial<Record<EVideoDurationType, number>>;
|
|
18
21
|
export declare function getMultiClipDiscountFactor(durationType: EVideoDurationType): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAElB,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,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,CAmBhB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,WAAW,CAqBlE,CAAC;AAEF,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,SAAQ,EACf,QAAQ,SAAM,oBAQf;AAGD,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,EAAE,CAAC,CAAC;IACb,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAGxB,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AA+CrB,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAatE"}
|
package/lib/utils/helpers.js
CHANGED
|
@@ -62,15 +62,18 @@ exports.getCreditsFromCost = getCreditsFromCost;
|
|
|
62
62
|
* Discount factors applied to the total clip cost for multi-clip video types.
|
|
63
63
|
* Implements economies-of-scale pricing: higher volume → lower per-clip margin.
|
|
64
64
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
65
|
+
* Factors are calibrated so annual-plan users ($0.15/credit) retain ≥20% gross margin
|
|
66
|
+
* on every video type. The break-even condition is: factor × $0.15 / $0.10 ≥ 1.25.
|
|
67
|
+
*
|
|
68
|
+
* SHORT: 1.00 (no discount) → monthly 50% margin | annual 33% margin
|
|
69
|
+
* MEDIUM: 0.90 (10% discount) → monthly 46% margin | annual 26% margin
|
|
70
|
+
* LONG: 0.85 (15% discount) → monthly 41% margin | annual 21% margin
|
|
71
|
+
* VERY_LONG: 0.80 (20% discount) → monthly 36% margin | annual 20% margin
|
|
69
72
|
*/
|
|
70
73
|
exports.MULTI_CLIP_DISCOUNT_FACTORS = {
|
|
71
|
-
[types_1.EVideoDurationType.MEDIUM]: 0.
|
|
72
|
-
[types_1.EVideoDurationType.LONG]: 0.
|
|
73
|
-
[types_1.EVideoDurationType.VERY_LONG]: 0.
|
|
74
|
+
[types_1.EVideoDurationType.MEDIUM]: 0.90,
|
|
75
|
+
[types_1.EVideoDurationType.LONG]: 0.85,
|
|
76
|
+
[types_1.EVideoDurationType.VERY_LONG]: 0.80,
|
|
74
77
|
};
|
|
75
78
|
function getMultiClipDiscountFactor(durationType) {
|
|
76
79
|
return exports.MULTI_CLIP_DISCOUNT_FACTORS[durationType] ?? 1.0;
|