owosk 0.3.1 → 0.3.3
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.js +10 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -261,6 +261,7 @@ function normalizeFeature(pf, creditSystemSlugs) {
|
|
|
261
261
|
slug: pf.slug,
|
|
262
262
|
enabled: pf.enabled,
|
|
263
263
|
limit: pf.limit ?? null,
|
|
264
|
+
trialLimit: pf.trialLimit ?? null,
|
|
264
265
|
// Handle both SDK 'reset' and API 'resetInterval'
|
|
265
266
|
reset: normalizeReset(pf.reset || pf.resetInterval),
|
|
266
267
|
usageModel: isCreditSystemFeature ? "included" : usageModel,
|
|
@@ -283,6 +284,7 @@ function normalizePlan(plan, creditSystemSlugs) {
|
|
|
283
284
|
price: plan.price ?? 0,
|
|
284
285
|
currency: plan.currency ?? null,
|
|
285
286
|
interval: plan.interval ?? null,
|
|
287
|
+
billingType: plan.billingType ?? "recurring",
|
|
286
288
|
planGroup: plan.planGroup ?? null,
|
|
287
289
|
trialDays: plan.trialDays ?? 0,
|
|
288
290
|
isAddon: plan.isAddon ?? false,
|
|
@@ -346,6 +348,7 @@ function diffPlans(localPlans, remotePlans, localCreditSystems = [], remoteCredi
|
|
|
346
348
|
"price",
|
|
347
349
|
"currency",
|
|
348
350
|
"interval",
|
|
351
|
+
"billingType",
|
|
349
352
|
"planGroup",
|
|
350
353
|
"trialDays",
|
|
351
354
|
"isAddon",
|
|
@@ -378,6 +381,7 @@ function diffPlans(localPlans, remotePlans, localCreditSystems = [], remoteCredi
|
|
|
378
381
|
const featureFields = [
|
|
379
382
|
"enabled",
|
|
380
383
|
"limit",
|
|
384
|
+
"trialLimit",
|
|
381
385
|
"reset",
|
|
382
386
|
"usageModel",
|
|
383
387
|
"pricePerUnit",
|
|
@@ -998,6 +1002,9 @@ function generateConfig(plans, creditSystems = [], creditPacks = [], defaultProv
|
|
|
998
1002
|
configLines.push(`price: ${plan.price}`);
|
|
999
1003
|
configLines.push(`currency: ${JSON.stringify(plan.currency)}`);
|
|
1000
1004
|
configLines.push(`interval: ${JSON.stringify(plan.interval)}`);
|
|
1005
|
+
if (plan.billingType === "one_time") {
|
|
1006
|
+
configLines.push(`billingType: "one_time"`);
|
|
1007
|
+
}
|
|
1001
1008
|
if (plan.planGroup)
|
|
1002
1009
|
configLines.push(`planGroup: ${JSON.stringify(plan.planGroup)}`);
|
|
1003
1010
|
if (plan.trialDays && plan.trialDays > 0)
|
|
@@ -1179,7 +1186,9 @@ async function buildRemoteCatalogSnapshot(params) {
|
|
|
1179
1186
|
});
|
|
1180
1187
|
const creditSystems = await fetchCreditSystems(params.apiKey, params.apiUrl);
|
|
1181
1188
|
const creditPacks = await fetchCreditPacks(params.apiKey, params.apiUrl);
|
|
1182
|
-
const providers = new Set(
|
|
1189
|
+
const providers = new Set(
|
|
1190
|
+
plans.map((plan) => plan.provider).filter(Boolean)
|
|
1191
|
+
);
|
|
1183
1192
|
const defaultProvider = providers.size === 1 ? Array.from(providers)[0] : void 0;
|
|
1184
1193
|
return {
|
|
1185
1194
|
plans,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "owosk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "CLI for Owostack - sync catalog, manage billing infrastructure",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"commander": "^14.0.3",
|
|
25
25
|
"jiti": "^2.6.1",
|
|
26
26
|
"picocolors": "^1.1.1",
|
|
27
|
-
"@owostack/types": "0.3.
|
|
28
|
-
"owostack": "0.3.
|
|
27
|
+
"@owostack/types": "0.3.3",
|
|
28
|
+
"owostack": "0.3.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.19.10",
|