@siglume/api-sdk 0.10.6 → 0.10.7
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/bin/siglume.cjs +30 -0
- package/dist/bin/siglume.cjs.map +1 -1
- package/dist/bin/siglume.js +30 -0
- package/dist/bin/siglume.js.map +1 -1
- package/dist/cli/index.cjs +30 -0
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +4 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.js +30 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +75 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -1335,6 +1335,8 @@ function parseListing(data) {
|
|
|
1335
1335
|
price_model: stringOrNull(data.price_model),
|
|
1336
1336
|
price_value_minor: Number(data.price_value_minor ?? 0),
|
|
1337
1337
|
currency: String(data.currency ?? "USD"),
|
|
1338
|
+
allow_free_trial: Boolean(data.allow_free_trial ?? false),
|
|
1339
|
+
free_trial_duration_days: Number(data.free_trial_duration_days ?? 30),
|
|
1338
1340
|
short_description: stringOrNull(data.short_description),
|
|
1339
1341
|
description: stringOrNull(data.description),
|
|
1340
1342
|
docs_url: stringOrNull(data.docs_url),
|
|
@@ -2534,6 +2536,8 @@ var init_client = __esm({
|
|
|
2534
2536
|
"price_model",
|
|
2535
2537
|
"price_value_minor",
|
|
2536
2538
|
"currency",
|
|
2539
|
+
"allow_free_trial",
|
|
2540
|
+
"free_trial_duration_days",
|
|
2537
2541
|
"permission_class",
|
|
2538
2542
|
"approval_mode",
|
|
2539
2543
|
"dry_run_supported",
|
|
@@ -2561,6 +2565,24 @@ var init_client = __esm({
|
|
|
2561
2565
|
throw new SiglumeClientError(`AppManifest.currency must be 'USD' or 'JPY'. Got ${String(payload.currency)}.`);
|
|
2562
2566
|
}
|
|
2563
2567
|
payload.currency = currency;
|
|
2568
|
+
if (payload.allow_free_trial === void 0 || payload.allow_free_trial === null) {
|
|
2569
|
+
throw new SiglumeClientError(
|
|
2570
|
+
"AppManifest.allow_free_trial is required. Pass true to offer a Plus/Pro buyer free trial or false to disable trials."
|
|
2571
|
+
);
|
|
2572
|
+
}
|
|
2573
|
+
if (Boolean(payload.allow_free_trial)) {
|
|
2574
|
+
const duration = payload.free_trial_duration_days ?? 30;
|
|
2575
|
+
if (typeof duration !== "number" || !Number.isInteger(duration)) {
|
|
2576
|
+
throw new SiglumeClientError(
|
|
2577
|
+
"AppManifest.free_trial_duration_days must be an integer when allow_free_trial=true."
|
|
2578
|
+
);
|
|
2579
|
+
}
|
|
2580
|
+
if (duration < 1 || duration > 90) {
|
|
2581
|
+
throw new SiglumeClientError(
|
|
2582
|
+
`AppManifest.free_trial_duration_days must be between 1 and 90 when allow_free_trial=true, got: ${duration}.`
|
|
2583
|
+
);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2564
2586
|
if (payload.manifest && typeof payload.manifest === "object") {
|
|
2565
2587
|
delete payload.manifest.version;
|
|
2566
2588
|
}
|
|
@@ -5141,10 +5163,14 @@ function appendValueChange(changes, emittedKeys, level, key, oldValue, newValue,
|
|
|
5141
5163
|
}
|
|
5142
5164
|
function normalizeManifest(value) {
|
|
5143
5165
|
const payload = coerceMapping(value, "manifest");
|
|
5166
|
+
const rawDuration = payload.free_trial_duration_days;
|
|
5167
|
+
const duration = rawDuration === void 0 || rawDuration === null ? 30 : Number(rawDuration);
|
|
5144
5168
|
return {
|
|
5145
5169
|
...payload,
|
|
5146
5170
|
price_model: payload.price_model ?? "free",
|
|
5147
5171
|
currency: payload.currency ?? "USD",
|
|
5172
|
+
allow_free_trial: Boolean(payload.allow_free_trial ?? false),
|
|
5173
|
+
free_trial_duration_days: Number.isFinite(duration) ? Math.trunc(duration) : 30,
|
|
5148
5174
|
// AppManifest defaults permission_class to "read-only" (hyphen form,
|
|
5149
5175
|
// PermissionClass.READ_ONLY). Without this default, a legacy / minimal
|
|
5150
5176
|
// manifest without permission_class compared against an upgraded one
|
|
@@ -7696,6 +7722,7 @@ function buildOperationManifest(operation, capability_key_override) {
|
|
|
7696
7722
|
required_connected_accounts: [],
|
|
7697
7723
|
price_model: PriceModel.FREE,
|
|
7698
7724
|
currency: "USD",
|
|
7725
|
+
allow_free_trial: false,
|
|
7699
7726
|
jurisdiction: "US",
|
|
7700
7727
|
short_description: operation.summary,
|
|
7701
7728
|
docs_url: "https://example.com/docs",
|
|
@@ -7774,6 +7801,7 @@ function operationAdapterSource(operation, manifest) {
|
|
|
7774
7801
|
" required_connected_accounts: [],",
|
|
7775
7802
|
" price_model: PriceModel.FREE,",
|
|
7776
7803
|
" currency: 'USD' as const,",
|
|
7804
|
+
" allow_free_trial: false,",
|
|
7777
7805
|
` jurisdiction: ${JSON.stringify(manifest.jurisdiction)},`,
|
|
7778
7806
|
` short_description: ${JSON.stringify(manifest.short_description ?? "")},`,
|
|
7779
7807
|
` support_contact: ${JSON.stringify(manifest.support_contact ?? "")},`,
|
|
@@ -8454,6 +8482,7 @@ function fallbackTemplateSource(template) {
|
|
|
8454
8482
|
" required_connected_accounts: [],",
|
|
8455
8483
|
" price_model: PriceModel.FREE,",
|
|
8456
8484
|
" currency: 'USD' as const,",
|
|
8485
|
+
" allow_free_trial: false,",
|
|
8457
8486
|
' jurisdiction: "US",',
|
|
8458
8487
|
' short_description: "Starter template generated by siglume init.",',
|
|
8459
8488
|
' support_contact: "support@example.com",',
|
|
@@ -8508,6 +8537,7 @@ function starterManifest(template) {
|
|
|
8508
8537
|
required_connected_accounts: [],
|
|
8509
8538
|
price_model: "free",
|
|
8510
8539
|
currency: "USD",
|
|
8540
|
+
allow_free_trial: false,
|
|
8511
8541
|
jurisdiction: "US",
|
|
8512
8542
|
short_description: "Starter template generated by siglume init.",
|
|
8513
8543
|
support_contact: "support@example.com",
|