@siglume/api-sdk 1.1.0 → 1.2.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 CHANGED
@@ -1826,6 +1826,7 @@ function parseListing(data) {
1826
1826
  price_model: stringOrNull2(data.price_model),
1827
1827
  price_value_minor: Number(data.price_value_minor ?? 0),
1828
1828
  pricing_plan,
1829
+ billing_timing: String(data.billing_timing ?? metadata.billing_timing ?? "post"),
1829
1830
  currency: String(data.currency ?? "USD"),
1830
1831
  allow_free_trial: Boolean(data.allow_free_trial ?? false),
1831
1832
  free_trial_duration_days: Number(data.free_trial_duration_days ?? 30),
@@ -3044,6 +3045,7 @@ var init_client = __esm({
3044
3045
  "price_model",
3045
3046
  "price_value_minor",
3046
3047
  "pricing_plan",
3048
+ "billing_timing",
3047
3049
  "currency",
3048
3050
  "allow_free_trial",
3049
3051
  "free_trial_duration_days",
@@ -3063,6 +3065,13 @@ var init_client = __esm({
3063
3065
  if (payload.pricing_plan !== void 0 && (typeof payload.pricing_plan !== "object" || Array.isArray(payload.pricing_plan))) {
3064
3066
  throw new SiglumeClientError("AppManifest.pricing_plan must be an object when provided.");
3065
3067
  }
3068
+ if (payload.billing_timing !== void 0 && payload.billing_timing !== null) {
3069
+ const billingTiming = String(payload.billing_timing || "post").trim().toLowerCase();
3070
+ if (billingTiming !== "post" && billingTiming !== "prepay") {
3071
+ throw new SiglumeClientError("AppManifest.billing_timing must be 'post' or 'prepay'.");
3072
+ }
3073
+ payload.billing_timing = billingTiming;
3074
+ }
3066
3075
  if (payload.store_vertical === void 0 || payload.store_vertical === null) {
3067
3076
  throw new SiglumeClientError(
3068
3077
  "AppManifest.store_vertical is required. Choose 'api' for normal API Store listings or 'game' for API games."
@@ -7546,6 +7555,9 @@ var AppTestHarness = class {
7546
7555
  issues.push("at least one example_prompt is recommended");
7547
7556
  }
7548
7557
  issues.push(...pricingPlanFloorIssues(manifest.pricing_plan, String(manifest.currency ?? "USD")));
7558
+ if (manifest.billing_timing !== void 0 && manifest.billing_timing !== "post" && manifest.billing_timing !== "prepay") {
7559
+ issues.push("billing_timing must be 'post' or 'prepay'");
7560
+ }
7549
7561
  if ((manifest.price_model === PriceModel.USAGE_BASED || manifest.price_model === PriceModel.PER_ACTION) && (!manifest.pricing_plan || !Array.isArray(manifest.pricing_plan.items) || manifest.pricing_plan.items.length === 0)) {
7550
7562
  issues.push("pricing_plan.items is required for usage_based/per_action pricing");
7551
7563
  }