@purpleschool/gptbot 0.8.89 → 0.8.90
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/build/helpers/image-editor/calculate-image-editor-price.helper.js +3 -3
- package/build/helpers/image-generation/calculate-image-generation-price.helper.js +4 -4
- package/build/helpers/music/calculate-music-price.helper.js +1 -1
- package/helpers/image-editor/calculate-image-editor-price.helper.ts +3 -3
- package/helpers/image-generation/calculate-image-generation-price.helper.ts +4 -4
- package/helpers/music/calculate-music-price.helper.ts +1 -1
- package/package.json +1 -1
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateImageEditorPrice = calculateImageEditorPrice;
|
|
4
4
|
function calculateImageEditorPrice({ basePrice, userHasActiveSubscriptionOrProduct, rules, }) {
|
|
5
|
-
let
|
|
5
|
+
let price = basePrice;
|
|
6
6
|
for (const rule of rules !== null && rules !== void 0 ? rules : []) {
|
|
7
7
|
const condition = rule.condition;
|
|
8
8
|
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
9
|
-
|
|
9
|
+
price += rule.value;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return price;
|
|
13
13
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateImageGenerationPrice = calculateImageGenerationPrice;
|
|
4
4
|
function calculateImageGenerationPrice({ basePrice, params, userHasActiveSubscriptionOrProduct, rules, }) {
|
|
5
|
-
let
|
|
5
|
+
let price = basePrice;
|
|
6
6
|
for (const rule of rules !== null && rules !== void 0 ? rules : []) {
|
|
7
7
|
const condition = rule.condition;
|
|
8
8
|
if (condition.resolution && condition.resolution === params.resolution) {
|
|
9
|
-
|
|
9
|
+
price += rule.value;
|
|
10
10
|
}
|
|
11
11
|
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
12
|
-
|
|
12
|
+
price += rule.value;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return price;
|
|
16
16
|
}
|
|
@@ -6,7 +6,7 @@ function calculateMusicPrice({ basePrice, userHasActiveSubscriptionOrProduct, ru
|
|
|
6
6
|
for (const rule of rules !== null && rules !== void 0 ? rules : []) {
|
|
7
7
|
const condition = rule.condition;
|
|
8
8
|
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
9
|
-
price
|
|
9
|
+
price += rule.value;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
return price;
|
|
@@ -9,15 +9,15 @@ export function calculateImageEditorPrice({
|
|
|
9
9
|
userHasActiveSubscriptionOrProduct: boolean;
|
|
10
10
|
rules: ImageEditorModelPricingRules;
|
|
11
11
|
}): number {
|
|
12
|
-
let
|
|
12
|
+
let price = basePrice;
|
|
13
13
|
|
|
14
14
|
for (const rule of rules ?? []) {
|
|
15
15
|
const condition = rule.condition;
|
|
16
16
|
|
|
17
17
|
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
18
|
-
|
|
18
|
+
price += rule.value;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
return
|
|
22
|
+
return price;
|
|
23
23
|
}
|
|
@@ -11,19 +11,19 @@ export function calculateImageGenerationPrice({
|
|
|
11
11
|
userHasActiveSubscriptionOrProduct: boolean;
|
|
12
12
|
rules: ImageModelPricingRules;
|
|
13
13
|
}): number {
|
|
14
|
-
let
|
|
14
|
+
let price = basePrice;
|
|
15
15
|
|
|
16
16
|
for (const rule of rules ?? []) {
|
|
17
17
|
const condition = rule.condition;
|
|
18
18
|
|
|
19
19
|
if (condition.resolution && condition.resolution === params.resolution) {
|
|
20
|
-
|
|
20
|
+
price += rule.value;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (condition.withoutSub && userHasActiveSubscriptionOrProduct === false) {
|
|
24
|
-
|
|
24
|
+
price += rule.value;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
return
|
|
28
|
+
return price;
|
|
29
29
|
}
|