@solvapay/server 2.8.0 → 2.9.0-preview-465291233085dd2cc8f8ce13a3336583bc9901a0
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/edge.d.ts +22 -92
- package/dist/edge.js +1 -12
- package/dist/fetch/index.cjs +1 -12
- package/dist/fetch/index.d.cts +11 -77
- package/dist/fetch/index.d.ts +11 -77
- package/dist/fetch/index.js +1 -12
- package/dist/index.cjs +1 -12
- package/dist/index.d.cts +22 -92
- package/dist/index.d.ts +22 -92
- package/dist/index.js +1 -12
- package/package.json +1 -1
package/dist/edge.d.ts
CHANGED
|
@@ -320,12 +320,9 @@ interface components {
|
|
|
320
320
|
label?: string;
|
|
321
321
|
meter: string;
|
|
322
322
|
/** @enum {string} */
|
|
323
|
-
onExceed: 'block' | '
|
|
324
|
-
onExceedPricingId?: string;
|
|
323
|
+
onExceed: 'block' | 'draw_credits';
|
|
325
324
|
/** @enum {string} */
|
|
326
325
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
327
|
-
/** @enum {string} */
|
|
328
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
329
326
|
windowDays?: number;
|
|
330
327
|
} | {
|
|
331
328
|
feature: string;
|
|
@@ -336,12 +333,11 @@ interface components {
|
|
|
336
333
|
value: boolean | number | string;
|
|
337
334
|
} | {
|
|
338
335
|
days: number;
|
|
339
|
-
downgradeToPricingId?: string;
|
|
340
336
|
/** @enum {string} */
|
|
341
337
|
kind: 'trial';
|
|
342
338
|
label?: string;
|
|
343
339
|
/** @enum {string} */
|
|
344
|
-
onEnd: 'convert' | 'cancel'
|
|
340
|
+
onEnd: 'convert' | 'cancel';
|
|
345
341
|
} | {
|
|
346
342
|
/** @enum {string} */
|
|
347
343
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -355,17 +351,6 @@ interface components {
|
|
|
355
351
|
/** @enum {string} */
|
|
356
352
|
mode: 'percentage' | 'fixed';
|
|
357
353
|
value: number;
|
|
358
|
-
} | {
|
|
359
|
-
capUnits?: number;
|
|
360
|
-
currency?: string;
|
|
361
|
-
/** @enum {string} */
|
|
362
|
-
kind: 'rollover';
|
|
363
|
-
label?: string;
|
|
364
|
-
maxCycles?: number;
|
|
365
|
-
meter: string;
|
|
366
|
-
rateMinor?: number;
|
|
367
|
-
/** @enum {string} */
|
|
368
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
369
354
|
} | {
|
|
370
355
|
/** @enum {string} */
|
|
371
356
|
kind: 'autoAssigned';
|
|
@@ -516,12 +501,9 @@ interface components {
|
|
|
516
501
|
label?: string;
|
|
517
502
|
meter: string;
|
|
518
503
|
/** @enum {string} */
|
|
519
|
-
onExceed: 'block' | '
|
|
520
|
-
onExceedPricingId?: string;
|
|
504
|
+
onExceed: 'block' | 'draw_credits';
|
|
521
505
|
/** @enum {string} */
|
|
522
506
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
523
|
-
/** @enum {string} */
|
|
524
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
525
507
|
windowDays?: number;
|
|
526
508
|
} | {
|
|
527
509
|
feature: string;
|
|
@@ -532,12 +514,11 @@ interface components {
|
|
|
532
514
|
value: boolean | number | string;
|
|
533
515
|
} | {
|
|
534
516
|
days: number;
|
|
535
|
-
downgradeToPricingId?: string;
|
|
536
517
|
/** @enum {string} */
|
|
537
518
|
kind: 'trial';
|
|
538
519
|
label?: string;
|
|
539
520
|
/** @enum {string} */
|
|
540
|
-
onEnd: 'convert' | 'cancel'
|
|
521
|
+
onEnd: 'convert' | 'cancel';
|
|
541
522
|
} | {
|
|
542
523
|
/** @enum {string} */
|
|
543
524
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -551,17 +532,6 @@ interface components {
|
|
|
551
532
|
/** @enum {string} */
|
|
552
533
|
mode: 'percentage' | 'fixed';
|
|
553
534
|
value: number;
|
|
554
|
-
} | {
|
|
555
|
-
capUnits?: number;
|
|
556
|
-
currency?: string;
|
|
557
|
-
/** @enum {string} */
|
|
558
|
-
kind: 'rollover';
|
|
559
|
-
label?: string;
|
|
560
|
-
maxCycles?: number;
|
|
561
|
-
meter: string;
|
|
562
|
-
rateMinor?: number;
|
|
563
|
-
/** @enum {string} */
|
|
564
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
565
535
|
} | {
|
|
566
536
|
/** @enum {string} */
|
|
567
537
|
kind: 'autoAssigned';
|
|
@@ -664,7 +634,7 @@ interface components {
|
|
|
664
634
|
* @example duplicate
|
|
665
635
|
* @enum {string}
|
|
666
636
|
*/
|
|
667
|
-
reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based' | '
|
|
637
|
+
reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based' | 'not_credit_drawn' | 'within_included';
|
|
668
638
|
};
|
|
669
639
|
CreditDebitSuccessResponse: {
|
|
670
640
|
/**
|
|
@@ -908,11 +878,9 @@ interface components {
|
|
|
908
878
|
* @example requests
|
|
909
879
|
*/
|
|
910
880
|
meterName?: string;
|
|
911
|
-
/** @description Access is blocked
|
|
881
|
+
/** @description Access is blocked until prepaid credits cover the next unit — past an included cap with `onExceed: draw_credits`, or from the first unit on a recurring meter with no limit. */
|
|
912
882
|
needsTopUp?: boolean;
|
|
913
|
-
/** @description Access is
|
|
914
|
-
needsUpgrade?: boolean;
|
|
915
|
-
/** @description Access is granted and usage beyond the included cap accrues an overage charge — `onExceed: charge`. */
|
|
883
|
+
/** @description Access is granted past the included cap and the usage is paid from prepaid credits — `onExceed: draw_credits`. */
|
|
916
884
|
overage?: boolean;
|
|
917
885
|
/**
|
|
918
886
|
* Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
|
|
@@ -934,10 +902,6 @@ interface components {
|
|
|
934
902
|
* @example 997
|
|
935
903
|
*/
|
|
936
904
|
remaining: number;
|
|
937
|
-
/** @description Access is granted but the caller should degrade/throttle service — the limit was exceeded with `onExceed: throttle`. */
|
|
938
|
-
throttled?: boolean;
|
|
939
|
-
/** @description The customer was auto-upgraded to the target pricing to restore access — `onExceed: auto_upgrade` succeeded. */
|
|
940
|
-
upgraded?: boolean;
|
|
941
905
|
/** @description Consumed usage units this period. Present only when the backend measured a finite cap. */
|
|
942
906
|
used?: number;
|
|
943
907
|
/**
|
|
@@ -1005,12 +969,9 @@ interface components {
|
|
|
1005
969
|
label?: string;
|
|
1006
970
|
meter: string;
|
|
1007
971
|
/** @enum {string} */
|
|
1008
|
-
onExceed: 'block' | '
|
|
1009
|
-
onExceedPricingId?: string;
|
|
972
|
+
onExceed: 'block' | 'draw_credits';
|
|
1010
973
|
/** @enum {string} */
|
|
1011
974
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
1012
|
-
/** @enum {string} */
|
|
1013
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
1014
975
|
windowDays?: number;
|
|
1015
976
|
} | {
|
|
1016
977
|
feature: string;
|
|
@@ -1021,12 +982,11 @@ interface components {
|
|
|
1021
982
|
value: boolean | number | string;
|
|
1022
983
|
} | {
|
|
1023
984
|
days: number;
|
|
1024
|
-
downgradeToPricingId?: string;
|
|
1025
985
|
/** @enum {string} */
|
|
1026
986
|
kind: 'trial';
|
|
1027
987
|
label?: string;
|
|
1028
988
|
/** @enum {string} */
|
|
1029
|
-
onEnd: 'convert' | 'cancel'
|
|
989
|
+
onEnd: 'convert' | 'cancel';
|
|
1030
990
|
} | {
|
|
1031
991
|
/** @enum {string} */
|
|
1032
992
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -1040,17 +1000,6 @@ interface components {
|
|
|
1040
1000
|
/** @enum {string} */
|
|
1041
1001
|
mode: 'percentage' | 'fixed';
|
|
1042
1002
|
value: number;
|
|
1043
|
-
} | {
|
|
1044
|
-
capUnits?: number;
|
|
1045
|
-
currency?: string;
|
|
1046
|
-
/** @enum {string} */
|
|
1047
|
-
kind: 'rollover';
|
|
1048
|
-
label?: string;
|
|
1049
|
-
maxCycles?: number;
|
|
1050
|
-
meter: string;
|
|
1051
|
-
rateMinor?: number;
|
|
1052
|
-
/** @enum {string} */
|
|
1053
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
1054
1003
|
} | {
|
|
1055
1004
|
/** @enum {string} */
|
|
1056
1005
|
kind: 'autoAssigned';
|
|
@@ -1921,12 +1870,9 @@ interface components {
|
|
|
1921
1870
|
label?: string;
|
|
1922
1871
|
meter: string;
|
|
1923
1872
|
/** @enum {string} */
|
|
1924
|
-
onExceed: 'block' | '
|
|
1925
|
-
onExceedPricingId?: string;
|
|
1873
|
+
onExceed: 'block' | 'draw_credits';
|
|
1926
1874
|
/** @enum {string} */
|
|
1927
1875
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
1928
|
-
/** @enum {string} */
|
|
1929
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
1930
1876
|
windowDays?: number;
|
|
1931
1877
|
} | {
|
|
1932
1878
|
feature: string;
|
|
@@ -1937,12 +1883,11 @@ interface components {
|
|
|
1937
1883
|
value: boolean | number | string;
|
|
1938
1884
|
} | {
|
|
1939
1885
|
days: number;
|
|
1940
|
-
downgradeToPricingId?: string;
|
|
1941
1886
|
/** @enum {string} */
|
|
1942
1887
|
kind: 'trial';
|
|
1943
1888
|
label?: string;
|
|
1944
1889
|
/** @enum {string} */
|
|
1945
|
-
onEnd: 'convert' | 'cancel'
|
|
1890
|
+
onEnd: 'convert' | 'cancel';
|
|
1946
1891
|
} | {
|
|
1947
1892
|
/** @enum {string} */
|
|
1948
1893
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -1956,17 +1901,6 @@ interface components {
|
|
|
1956
1901
|
/** @enum {string} */
|
|
1957
1902
|
mode: 'percentage' | 'fixed';
|
|
1958
1903
|
value: number;
|
|
1959
|
-
} | {
|
|
1960
|
-
capUnits?: number;
|
|
1961
|
-
currency?: string;
|
|
1962
|
-
/** @enum {string} */
|
|
1963
|
-
kind: 'rollover';
|
|
1964
|
-
label?: string;
|
|
1965
|
-
maxCycles?: number;
|
|
1966
|
-
meter: string;
|
|
1967
|
-
rateMinor?: number;
|
|
1968
|
-
/** @enum {string} */
|
|
1969
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
1970
1904
|
} | {
|
|
1971
1905
|
/** @enum {string} */
|
|
1972
1906
|
kind: 'autoAssigned';
|
|
@@ -3941,12 +3875,11 @@ type FreeLimit = Required<Omit<GeneratedFreeAllowance, 'windowDays'>> & Pick<Gen
|
|
|
3941
3875
|
/**
|
|
3942
3876
|
* `LimitResponse` plus a deprecated SDK-only `plan` alias.
|
|
3943
3877
|
*
|
|
3944
|
-
* The backend `LimitResponse`
|
|
3945
|
-
* (`
|
|
3946
|
-
*
|
|
3947
|
-
*
|
|
3948
|
-
*
|
|
3949
|
-
* others accompany a gate outcome.
|
|
3878
|
+
* The backend `LimitResponse` carries the `onExceed` outcome flags
|
|
3879
|
+
* (`overage` / `needsTopUp`, resolved by `decideLimit`), so they flow
|
|
3880
|
+
* through from `generated.ts`. `overage` rides the allow path
|
|
3881
|
+
* (`withinLimits: true`) so a protected handler can read it from
|
|
3882
|
+
* `decision.limits`; `needsTopUp` accompanies a gate outcome.
|
|
3950
3883
|
*
|
|
3951
3884
|
* Read `planRef` for the active plan. `plan` is never populated by the
|
|
3952
3885
|
* backend — it remains optional so older fixtures and callers still type-check.
|
|
@@ -4379,13 +4312,11 @@ type PaywallDecision<T> = {
|
|
|
4379
4312
|
limits: LimitResponseWithPlan;
|
|
4380
4313
|
customerRef: string;
|
|
4381
4314
|
/**
|
|
4382
|
-
* Set when access is granted
|
|
4383
|
-
* `onExceed:
|
|
4384
|
-
*
|
|
4385
|
-
* cap. Absent on a plain allow. Derived from `limits`; not new
|
|
4386
|
-
* wire data.
|
|
4315
|
+
* Set when access is granted past the included cap and the usage
|
|
4316
|
+
* is paid from prepaid credits (`onExceed: draw_credits`). Absent on a
|
|
4317
|
+
* plain allow. Derived from `limits`; not new wire data.
|
|
4387
4318
|
*/
|
|
4388
|
-
consequence?: '
|
|
4319
|
+
consequence?: 'overage';
|
|
4389
4320
|
/**
|
|
4390
4321
|
* Id minted by `decide()` and reused by `runAllow()` so success /
|
|
4391
4322
|
* fail tracking shares one idempotency key with the decision.
|
|
@@ -5110,8 +5041,7 @@ interface SolvaPay {
|
|
|
5110
5041
|
* @param params.customerRef - Customer reference
|
|
5111
5042
|
* @param params.productRef - Product reference
|
|
5112
5043
|
* @returns Full `LimitResponseWithPlan`, including the `onExceed` outcome
|
|
5113
|
-
* flags (`
|
|
5114
|
-
* `upgraded`) the backend already sends on `/v1/sdk/limits`
|
|
5044
|
+
* flags (`overage` / `needsTopUp`) the backend sends on `/v1/sdk/limits`
|
|
5115
5045
|
*
|
|
5116
5046
|
* @example
|
|
5117
5047
|
* ```typescript
|
|
@@ -5667,7 +5597,7 @@ declare function nextActionFor(state: PaywallState): PaywallNextAction;
|
|
|
5667
5597
|
* (no purchaseRef / planRef) must not fall through to upgrade_required.
|
|
5668
5598
|
* 3. `paywallReason === 'topup_required'` — backend stays authoritative
|
|
5669
5599
|
* for credit-based denials (same rule as Managed MCP).
|
|
5670
|
-
* 3. Authoritative `needsTopUp`
|
|
5600
|
+
* 3. Authoritative `needsTopUp` flag from `decideLimit`.
|
|
5671
5601
|
* 4. Credit-field presence + a real shortfall (`balance < cost`).
|
|
5672
5602
|
* 5. Active purchase / plan at included cap → `limit_reached`.
|
|
5673
5603
|
* 6. Floor: never `upgrade_required` when credit fields or a purchase
|
package/dist/edge.js
CHANGED
|
@@ -732,9 +732,6 @@ function classifyPaywallState(limits) {
|
|
|
732
732
|
if (limits.needsTopUp === true) {
|
|
733
733
|
return { kind: "topup_required" };
|
|
734
734
|
}
|
|
735
|
-
if (limits.needsUpgrade === true) {
|
|
736
|
-
return { kind: "upgrade_required" };
|
|
737
|
-
}
|
|
738
735
|
const signals = creditSignals(limits);
|
|
739
736
|
if (signals.isCreditBased) {
|
|
740
737
|
if (signals.creditBalance !== void 0 && signals.creditsPerCall !== void 0 && signals.creditBalance < signals.creditsPerCall) {
|
|
@@ -862,14 +859,6 @@ function buildGateMessage(state, gate) {
|
|
|
862
859
|
return `${lead}${topup}${auto}${switchLine}`;
|
|
863
860
|
}
|
|
864
861
|
case "upgrade_required": {
|
|
865
|
-
if (hasActivePlan(gate)) {
|
|
866
|
-
const planName = gate.planName ?? "This plan";
|
|
867
|
-
const lead = `${planName} is active but its included usage is exhausted, and the automatic switch to the next plan did not complete.`;
|
|
868
|
-
if (ladder) {
|
|
869
|
-
return `${lead} Switch here: ${ladder}. ${callViewer("account").replace(/^c/, "C")} for usage and recovery.`;
|
|
870
|
-
}
|
|
871
|
-
return `${lead}${recoverClause(url, "switch plan", "checkout")}`;
|
|
872
|
-
}
|
|
873
862
|
if (ladder) {
|
|
874
863
|
return `You don't have an active plan for this tool. Pick a plan to use this tool: ${ladder} (links expire in ${CHECKOUT_SESSION_TTL_MINUTES} minutes), or ${callViewer("checkout")}. ${callViewer("account").replace(/^c/, "C")} for usage and recovery.`;
|
|
875
864
|
}
|
|
@@ -1409,7 +1398,7 @@ var SolvaPayPaywall = class {
|
|
|
1409
1398
|
requestId
|
|
1410
1399
|
};
|
|
1411
1400
|
}
|
|
1412
|
-
const consequence = lastLimitsCheck.
|
|
1401
|
+
const consequence = lastLimitsCheck.overage ? "overage" : void 0;
|
|
1413
1402
|
return {
|
|
1414
1403
|
outcome: "allow",
|
|
1415
1404
|
args,
|
package/dist/fetch/index.cjs
CHANGED
|
@@ -888,9 +888,6 @@ function classifyPaywallState(limits) {
|
|
|
888
888
|
if (limits.needsTopUp === true) {
|
|
889
889
|
return { kind: "topup_required" };
|
|
890
890
|
}
|
|
891
|
-
if (limits.needsUpgrade === true) {
|
|
892
|
-
return { kind: "upgrade_required" };
|
|
893
|
-
}
|
|
894
891
|
const signals = creditSignals(limits);
|
|
895
892
|
if (signals.isCreditBased) {
|
|
896
893
|
if (signals.creditBalance !== void 0 && signals.creditsPerCall !== void 0 && signals.creditBalance < signals.creditsPerCall) {
|
|
@@ -1018,14 +1015,6 @@ function buildGateMessage(state, gate) {
|
|
|
1018
1015
|
return `${lead}${topup}${auto}${switchLine}`;
|
|
1019
1016
|
}
|
|
1020
1017
|
case "upgrade_required": {
|
|
1021
|
-
if (hasActivePlan(gate)) {
|
|
1022
|
-
const planName = gate.planName ?? "This plan";
|
|
1023
|
-
const lead = `${planName} is active but its included usage is exhausted, and the automatic switch to the next plan did not complete.`;
|
|
1024
|
-
if (ladder) {
|
|
1025
|
-
return `${lead} Switch here: ${ladder}. ${callViewer("account").replace(/^c/, "C")} for usage and recovery.`;
|
|
1026
|
-
}
|
|
1027
|
-
return `${lead}${recoverClause(url, "switch plan", "checkout")}`;
|
|
1028
|
-
}
|
|
1029
1018
|
if (ladder) {
|
|
1030
1019
|
return `You don't have an active plan for this tool. Pick a plan to use this tool: ${ladder} (links expire in ${CHECKOUT_SESSION_TTL_MINUTES} minutes), or ${callViewer("checkout")}. ${callViewer("account").replace(/^c/, "C")} for usage and recovery.`;
|
|
1031
1020
|
}
|
|
@@ -1541,7 +1530,7 @@ var SolvaPayPaywall = class {
|
|
|
1541
1530
|
requestId
|
|
1542
1531
|
};
|
|
1543
1532
|
}
|
|
1544
|
-
const consequence = lastLimitsCheck.
|
|
1533
|
+
const consequence = lastLimitsCheck.overage ? "overage" : void 0;
|
|
1545
1534
|
return {
|
|
1546
1535
|
outcome: "allow",
|
|
1547
1536
|
args,
|
package/dist/fetch/index.d.cts
CHANGED
|
@@ -317,12 +317,9 @@ interface components {
|
|
|
317
317
|
label?: string;
|
|
318
318
|
meter: string;
|
|
319
319
|
/** @enum {string} */
|
|
320
|
-
onExceed: 'block' | '
|
|
321
|
-
onExceedPricingId?: string;
|
|
320
|
+
onExceed: 'block' | 'draw_credits';
|
|
322
321
|
/** @enum {string} */
|
|
323
322
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
324
|
-
/** @enum {string} */
|
|
325
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
326
323
|
windowDays?: number;
|
|
327
324
|
} | {
|
|
328
325
|
feature: string;
|
|
@@ -333,12 +330,11 @@ interface components {
|
|
|
333
330
|
value: boolean | number | string;
|
|
334
331
|
} | {
|
|
335
332
|
days: number;
|
|
336
|
-
downgradeToPricingId?: string;
|
|
337
333
|
/** @enum {string} */
|
|
338
334
|
kind: 'trial';
|
|
339
335
|
label?: string;
|
|
340
336
|
/** @enum {string} */
|
|
341
|
-
onEnd: 'convert' | 'cancel'
|
|
337
|
+
onEnd: 'convert' | 'cancel';
|
|
342
338
|
} | {
|
|
343
339
|
/** @enum {string} */
|
|
344
340
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -352,17 +348,6 @@ interface components {
|
|
|
352
348
|
/** @enum {string} */
|
|
353
349
|
mode: 'percentage' | 'fixed';
|
|
354
350
|
value: number;
|
|
355
|
-
} | {
|
|
356
|
-
capUnits?: number;
|
|
357
|
-
currency?: string;
|
|
358
|
-
/** @enum {string} */
|
|
359
|
-
kind: 'rollover';
|
|
360
|
-
label?: string;
|
|
361
|
-
maxCycles?: number;
|
|
362
|
-
meter: string;
|
|
363
|
-
rateMinor?: number;
|
|
364
|
-
/** @enum {string} */
|
|
365
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
366
351
|
} | {
|
|
367
352
|
/** @enum {string} */
|
|
368
353
|
kind: 'autoAssigned';
|
|
@@ -513,12 +498,9 @@ interface components {
|
|
|
513
498
|
label?: string;
|
|
514
499
|
meter: string;
|
|
515
500
|
/** @enum {string} */
|
|
516
|
-
onExceed: 'block' | '
|
|
517
|
-
onExceedPricingId?: string;
|
|
501
|
+
onExceed: 'block' | 'draw_credits';
|
|
518
502
|
/** @enum {string} */
|
|
519
503
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
520
|
-
/** @enum {string} */
|
|
521
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
522
504
|
windowDays?: number;
|
|
523
505
|
} | {
|
|
524
506
|
feature: string;
|
|
@@ -529,12 +511,11 @@ interface components {
|
|
|
529
511
|
value: boolean | number | string;
|
|
530
512
|
} | {
|
|
531
513
|
days: number;
|
|
532
|
-
downgradeToPricingId?: string;
|
|
533
514
|
/** @enum {string} */
|
|
534
515
|
kind: 'trial';
|
|
535
516
|
label?: string;
|
|
536
517
|
/** @enum {string} */
|
|
537
|
-
onEnd: 'convert' | 'cancel'
|
|
518
|
+
onEnd: 'convert' | 'cancel';
|
|
538
519
|
} | {
|
|
539
520
|
/** @enum {string} */
|
|
540
521
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -548,17 +529,6 @@ interface components {
|
|
|
548
529
|
/** @enum {string} */
|
|
549
530
|
mode: 'percentage' | 'fixed';
|
|
550
531
|
value: number;
|
|
551
|
-
} | {
|
|
552
|
-
capUnits?: number;
|
|
553
|
-
currency?: string;
|
|
554
|
-
/** @enum {string} */
|
|
555
|
-
kind: 'rollover';
|
|
556
|
-
label?: string;
|
|
557
|
-
maxCycles?: number;
|
|
558
|
-
meter: string;
|
|
559
|
-
rateMinor?: number;
|
|
560
|
-
/** @enum {string} */
|
|
561
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
562
532
|
} | {
|
|
563
533
|
/** @enum {string} */
|
|
564
534
|
kind: 'autoAssigned';
|
|
@@ -661,7 +631,7 @@ interface components {
|
|
|
661
631
|
* @example duplicate
|
|
662
632
|
* @enum {string}
|
|
663
633
|
*/
|
|
664
|
-
reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based' | '
|
|
634
|
+
reason: 'duplicate' | 'no_product_ref' | 'customer_not_found' | 'no_active_purchase' | 'plan_not_credit_based' | 'not_credit_drawn' | 'within_included';
|
|
665
635
|
};
|
|
666
636
|
CreditDebitSuccessResponse: {
|
|
667
637
|
/**
|
|
@@ -905,11 +875,9 @@ interface components {
|
|
|
905
875
|
* @example requests
|
|
906
876
|
*/
|
|
907
877
|
meterName?: string;
|
|
908
|
-
/** @description Access is blocked
|
|
878
|
+
/** @description Access is blocked until prepaid credits cover the next unit — past an included cap with `onExceed: draw_credits`, or from the first unit on a recurring meter with no limit. */
|
|
909
879
|
needsTopUp?: boolean;
|
|
910
|
-
/** @description Access is
|
|
911
|
-
needsUpgrade?: boolean;
|
|
912
|
-
/** @description Access is granted and usage beyond the included cap accrues an overage charge — `onExceed: charge`. */
|
|
880
|
+
/** @description Access is granted past the included cap and the usage is paid from prepaid credits — `onExceed: draw_credits`. */
|
|
913
881
|
overage?: boolean;
|
|
914
882
|
/**
|
|
915
883
|
* Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
|
|
@@ -931,10 +899,6 @@ interface components {
|
|
|
931
899
|
* @example 997
|
|
932
900
|
*/
|
|
933
901
|
remaining: number;
|
|
934
|
-
/** @description Access is granted but the caller should degrade/throttle service — the limit was exceeded with `onExceed: throttle`. */
|
|
935
|
-
throttled?: boolean;
|
|
936
|
-
/** @description The customer was auto-upgraded to the target pricing to restore access — `onExceed: auto_upgrade` succeeded. */
|
|
937
|
-
upgraded?: boolean;
|
|
938
902
|
/** @description Consumed usage units this period. Present only when the backend measured a finite cap. */
|
|
939
903
|
used?: number;
|
|
940
904
|
/**
|
|
@@ -1002,12 +966,9 @@ interface components {
|
|
|
1002
966
|
label?: string;
|
|
1003
967
|
meter: string;
|
|
1004
968
|
/** @enum {string} */
|
|
1005
|
-
onExceed: 'block' | '
|
|
1006
|
-
onExceedPricingId?: string;
|
|
969
|
+
onExceed: 'block' | 'draw_credits';
|
|
1007
970
|
/** @enum {string} */
|
|
1008
971
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
1009
|
-
/** @enum {string} */
|
|
1010
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
1011
972
|
windowDays?: number;
|
|
1012
973
|
} | {
|
|
1013
974
|
feature: string;
|
|
@@ -1018,12 +979,11 @@ interface components {
|
|
|
1018
979
|
value: boolean | number | string;
|
|
1019
980
|
} | {
|
|
1020
981
|
days: number;
|
|
1021
|
-
downgradeToPricingId?: string;
|
|
1022
982
|
/** @enum {string} */
|
|
1023
983
|
kind: 'trial';
|
|
1024
984
|
label?: string;
|
|
1025
985
|
/** @enum {string} */
|
|
1026
|
-
onEnd: 'convert' | 'cancel'
|
|
986
|
+
onEnd: 'convert' | 'cancel';
|
|
1027
987
|
} | {
|
|
1028
988
|
/** @enum {string} */
|
|
1029
989
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -1037,17 +997,6 @@ interface components {
|
|
|
1037
997
|
/** @enum {string} */
|
|
1038
998
|
mode: 'percentage' | 'fixed';
|
|
1039
999
|
value: number;
|
|
1040
|
-
} | {
|
|
1041
|
-
capUnits?: number;
|
|
1042
|
-
currency?: string;
|
|
1043
|
-
/** @enum {string} */
|
|
1044
|
-
kind: 'rollover';
|
|
1045
|
-
label?: string;
|
|
1046
|
-
maxCycles?: number;
|
|
1047
|
-
meter: string;
|
|
1048
|
-
rateMinor?: number;
|
|
1049
|
-
/** @enum {string} */
|
|
1050
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
1051
1000
|
} | {
|
|
1052
1001
|
/** @enum {string} */
|
|
1053
1002
|
kind: 'autoAssigned';
|
|
@@ -1918,12 +1867,9 @@ interface components {
|
|
|
1918
1867
|
label?: string;
|
|
1919
1868
|
meter: string;
|
|
1920
1869
|
/** @enum {string} */
|
|
1921
|
-
onExceed: 'block' | '
|
|
1922
|
-
onExceedPricingId?: string;
|
|
1870
|
+
onExceed: 'block' | 'draw_credits';
|
|
1923
1871
|
/** @enum {string} */
|
|
1924
1872
|
scope: 'billing_period' | 'lifetime' | 'rolling_window';
|
|
1925
|
-
/** @enum {string} */
|
|
1926
|
-
uiHint?: 'upgrade_prompt' | 'soft_warning';
|
|
1927
1873
|
windowDays?: number;
|
|
1928
1874
|
} | {
|
|
1929
1875
|
feature: string;
|
|
@@ -1934,12 +1880,11 @@ interface components {
|
|
|
1934
1880
|
value: boolean | number | string;
|
|
1935
1881
|
} | {
|
|
1936
1882
|
days: number;
|
|
1937
|
-
downgradeToPricingId?: string;
|
|
1938
1883
|
/** @enum {string} */
|
|
1939
1884
|
kind: 'trial';
|
|
1940
1885
|
label?: string;
|
|
1941
1886
|
/** @enum {string} */
|
|
1942
|
-
onEnd: 'convert' | 'cancel'
|
|
1887
|
+
onEnd: 'convert' | 'cancel';
|
|
1943
1888
|
} | {
|
|
1944
1889
|
/** @enum {string} */
|
|
1945
1890
|
appliesTo?: 'recurring' | 'setup' | 'usage' | 'all';
|
|
@@ -1953,17 +1898,6 @@ interface components {
|
|
|
1953
1898
|
/** @enum {string} */
|
|
1954
1899
|
mode: 'percentage' | 'fixed';
|
|
1955
1900
|
value: number;
|
|
1956
|
-
} | {
|
|
1957
|
-
capUnits?: number;
|
|
1958
|
-
currency?: string;
|
|
1959
|
-
/** @enum {string} */
|
|
1960
|
-
kind: 'rollover';
|
|
1961
|
-
label?: string;
|
|
1962
|
-
maxCycles?: number;
|
|
1963
|
-
meter: string;
|
|
1964
|
-
rateMinor?: number;
|
|
1965
|
-
/** @enum {string} */
|
|
1966
|
-
treatment: 'forfeit' | 'carry_forward' | 'credit_units' | 'credit_money';
|
|
1967
1901
|
} | {
|
|
1968
1902
|
/** @enum {string} */
|
|
1969
1903
|
kind: 'autoAssigned';
|