@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.d.cts
CHANGED
|
@@ -158,6 +158,8 @@ interface AppManifest {
|
|
|
158
158
|
price_model?: PriceModel;
|
|
159
159
|
price_value_minor?: number;
|
|
160
160
|
currency: ListingCurrency;
|
|
161
|
+
allow_free_trial: boolean;
|
|
162
|
+
free_trial_duration_days?: number;
|
|
161
163
|
jurisdiction: string;
|
|
162
164
|
applicable_regulations?: string[];
|
|
163
165
|
data_residency?: string;
|
|
@@ -256,6 +258,8 @@ interface AppListingRecord {
|
|
|
256
258
|
price_model?: string | null;
|
|
257
259
|
price_value_minor: number;
|
|
258
260
|
currency: string;
|
|
261
|
+
allow_free_trial: boolean;
|
|
262
|
+
free_trial_duration_days: number;
|
|
259
263
|
short_description?: string | null;
|
|
260
264
|
description?: string | null;
|
|
261
265
|
docs_url?: string | null;
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -158,6 +158,8 @@ interface AppManifest {
|
|
|
158
158
|
price_model?: PriceModel;
|
|
159
159
|
price_value_minor?: number;
|
|
160
160
|
currency: ListingCurrency;
|
|
161
|
+
allow_free_trial: boolean;
|
|
162
|
+
free_trial_duration_days?: number;
|
|
161
163
|
jurisdiction: string;
|
|
162
164
|
applicable_regulations?: string[];
|
|
163
165
|
data_residency?: string;
|
|
@@ -256,6 +258,8 @@ interface AppListingRecord {
|
|
|
256
258
|
price_model?: string | null;
|
|
257
259
|
price_value_minor: number;
|
|
258
260
|
currency: string;
|
|
261
|
+
allow_free_trial: boolean;
|
|
262
|
+
free_trial_duration_days: number;
|
|
259
263
|
short_description?: string | null;
|
|
260
264
|
description?: string | null;
|
|
261
265
|
docs_url?: string | null;
|
package/dist/cli/index.js
CHANGED
|
@@ -1313,6 +1313,8 @@ function parseListing(data) {
|
|
|
1313
1313
|
price_model: stringOrNull(data.price_model),
|
|
1314
1314
|
price_value_minor: Number(data.price_value_minor ?? 0),
|
|
1315
1315
|
currency: String(data.currency ?? "USD"),
|
|
1316
|
+
allow_free_trial: Boolean(data.allow_free_trial ?? false),
|
|
1317
|
+
free_trial_duration_days: Number(data.free_trial_duration_days ?? 30),
|
|
1316
1318
|
short_description: stringOrNull(data.short_description),
|
|
1317
1319
|
description: stringOrNull(data.description),
|
|
1318
1320
|
docs_url: stringOrNull(data.docs_url),
|
|
@@ -2512,6 +2514,8 @@ var init_client = __esm({
|
|
|
2512
2514
|
"price_model",
|
|
2513
2515
|
"price_value_minor",
|
|
2514
2516
|
"currency",
|
|
2517
|
+
"allow_free_trial",
|
|
2518
|
+
"free_trial_duration_days",
|
|
2515
2519
|
"permission_class",
|
|
2516
2520
|
"approval_mode",
|
|
2517
2521
|
"dry_run_supported",
|
|
@@ -2539,6 +2543,24 @@ var init_client = __esm({
|
|
|
2539
2543
|
throw new SiglumeClientError(`AppManifest.currency must be 'USD' or 'JPY'. Got ${String(payload.currency)}.`);
|
|
2540
2544
|
}
|
|
2541
2545
|
payload.currency = currency;
|
|
2546
|
+
if (payload.allow_free_trial === void 0 || payload.allow_free_trial === null) {
|
|
2547
|
+
throw new SiglumeClientError(
|
|
2548
|
+
"AppManifest.allow_free_trial is required. Pass true to offer a Plus/Pro buyer free trial or false to disable trials."
|
|
2549
|
+
);
|
|
2550
|
+
}
|
|
2551
|
+
if (Boolean(payload.allow_free_trial)) {
|
|
2552
|
+
const duration = payload.free_trial_duration_days ?? 30;
|
|
2553
|
+
if (typeof duration !== "number" || !Number.isInteger(duration)) {
|
|
2554
|
+
throw new SiglumeClientError(
|
|
2555
|
+
"AppManifest.free_trial_duration_days must be an integer when allow_free_trial=true."
|
|
2556
|
+
);
|
|
2557
|
+
}
|
|
2558
|
+
if (duration < 1 || duration > 90) {
|
|
2559
|
+
throw new SiglumeClientError(
|
|
2560
|
+
`AppManifest.free_trial_duration_days must be between 1 and 90 when allow_free_trial=true, got: ${duration}.`
|
|
2561
|
+
);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2542
2564
|
if (payload.manifest && typeof payload.manifest === "object") {
|
|
2543
2565
|
delete payload.manifest.version;
|
|
2544
2566
|
}
|
|
@@ -5114,10 +5136,14 @@ function appendValueChange(changes, emittedKeys, level, key, oldValue, newValue,
|
|
|
5114
5136
|
}
|
|
5115
5137
|
function normalizeManifest(value) {
|
|
5116
5138
|
const payload = coerceMapping(value, "manifest");
|
|
5139
|
+
const rawDuration = payload.free_trial_duration_days;
|
|
5140
|
+
const duration = rawDuration === void 0 || rawDuration === null ? 30 : Number(rawDuration);
|
|
5117
5141
|
return {
|
|
5118
5142
|
...payload,
|
|
5119
5143
|
price_model: payload.price_model ?? "free",
|
|
5120
5144
|
currency: payload.currency ?? "USD",
|
|
5145
|
+
allow_free_trial: Boolean(payload.allow_free_trial ?? false),
|
|
5146
|
+
free_trial_duration_days: Number.isFinite(duration) ? Math.trunc(duration) : 30,
|
|
5121
5147
|
// AppManifest defaults permission_class to "read-only" (hyphen form,
|
|
5122
5148
|
// PermissionClass.READ_ONLY). Without this default, a legacy / minimal
|
|
5123
5149
|
// manifest without permission_class compared against an upgraded one
|
|
@@ -7669,6 +7695,7 @@ function buildOperationManifest(operation, capability_key_override) {
|
|
|
7669
7695
|
required_connected_accounts: [],
|
|
7670
7696
|
price_model: PriceModel.FREE,
|
|
7671
7697
|
currency: "USD",
|
|
7698
|
+
allow_free_trial: false,
|
|
7672
7699
|
jurisdiction: "US",
|
|
7673
7700
|
short_description: operation.summary,
|
|
7674
7701
|
docs_url: "https://example.com/docs",
|
|
@@ -7747,6 +7774,7 @@ function operationAdapterSource(operation, manifest) {
|
|
|
7747
7774
|
" required_connected_accounts: [],",
|
|
7748
7775
|
" price_model: PriceModel.FREE,",
|
|
7749
7776
|
" currency: 'USD' as const,",
|
|
7777
|
+
" allow_free_trial: false,",
|
|
7750
7778
|
` jurisdiction: ${JSON.stringify(manifest.jurisdiction)},`,
|
|
7751
7779
|
` short_description: ${JSON.stringify(manifest.short_description ?? "")},`,
|
|
7752
7780
|
` support_contact: ${JSON.stringify(manifest.support_contact ?? "")},`,
|
|
@@ -8427,6 +8455,7 @@ function fallbackTemplateSource(template) {
|
|
|
8427
8455
|
" required_connected_accounts: [],",
|
|
8428
8456
|
" price_model: PriceModel.FREE,",
|
|
8429
8457
|
" currency: 'USD' as const,",
|
|
8458
|
+
" allow_free_trial: false,",
|
|
8430
8459
|
' jurisdiction: "US",',
|
|
8431
8460
|
' short_description: "Starter template generated by siglume init.",',
|
|
8432
8461
|
' support_contact: "support@example.com",',
|
|
@@ -8481,6 +8510,7 @@ function starterManifest(template) {
|
|
|
8481
8510
|
required_connected_accounts: [],
|
|
8482
8511
|
price_model: "free",
|
|
8483
8512
|
currency: "USD",
|
|
8513
|
+
allow_free_trial: false,
|
|
8484
8514
|
jurisdiction: "US",
|
|
8485
8515
|
short_description: "Starter template generated by siglume init.",
|
|
8486
8516
|
support_contact: "support@example.com",
|