@creem_io/cli 0.2.1
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/README.md +155 -0
- package/dist/commands/checkouts.d.ts +3 -0
- package/dist/commands/checkouts.d.ts.map +1 -0
- package/dist/commands/checkouts.js +175 -0
- package/dist/commands/checkouts.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +184 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/customers.d.ts +3 -0
- package/dist/commands/customers.d.ts.map +1 -0
- package/dist/commands/customers.js +246 -0
- package/dist/commands/customers.js.map +1 -0
- package/dist/commands/discounts.d.ts +3 -0
- package/dist/commands/discounts.d.ts.map +1 -0
- package/dist/commands/discounts.js +419 -0
- package/dist/commands/discounts.js.map +1 -0
- package/dist/commands/index.d.ts +12 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +26 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +115 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +61 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/migrate.d.ts +3 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +1073 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/products.d.ts +3 -0
- package/dist/commands/products.d.ts.map +1 -0
- package/dist/commands/products.js +400 -0
- package/dist/commands/products.js.map +1 -0
- package/dist/commands/subscriptions.d.ts +3 -0
- package/dist/commands/subscriptions.d.ts.map +1 -0
- package/dist/commands/subscriptions.js +476 -0
- package/dist/commands/subscriptions.js.map +1 -0
- package/dist/commands/transactions.d.ts +3 -0
- package/dist/commands/transactions.d.ts.map +1 -0
- package/dist/commands/transactions.js +326 -0
- package/dist/commands/transactions.js.map +1 -0
- package/dist/commands/whoami.d.ts +3 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +76 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +25 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +77 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/auth.d.ts +28 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +113 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/config.d.ts +34 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +144 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/env-cache.d.ts +10 -0
- package/dist/lib/env-cache.d.ts.map +1 -0
- package/dist/lib/env-cache.js +27 -0
- package/dist/lib/env-cache.js.map +1 -0
- package/dist/tui/command-bar.d.ts +10 -0
- package/dist/tui/command-bar.d.ts.map +1 -0
- package/dist/tui/command-bar.js +35 -0
- package/dist/tui/command-bar.js.map +1 -0
- package/dist/tui/engine.d.ts +3 -0
- package/dist/tui/engine.d.ts.map +1 -0
- package/dist/tui/engine.js +454 -0
- package/dist/tui/engine.js.map +1 -0
- package/dist/tui/index.d.ts +3 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +6 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/keymap.d.ts +29 -0
- package/dist/tui/keymap.d.ts.map +1 -0
- package/dist/tui/keymap.js +143 -0
- package/dist/tui/keymap.js.map +1 -0
- package/dist/tui/renderer.d.ts +12 -0
- package/dist/tui/renderer.d.ts.map +1 -0
- package/dist/tui/renderer.js +379 -0
- package/dist/tui/renderer.js.map +1 -0
- package/dist/tui/types.d.ts +53 -0
- package/dist/tui/types.d.ts.map +1 -0
- package/dist/tui/types.js +24 -0
- package/dist/tui/types.js.map +1 -0
- package/dist/utils/output.d.ts +67 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +245 -0
- package/dist/utils/output.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.createTransactionsCommand = createTransactionsCommand;
|
|
40
|
+
const commander_1 = require("commander");
|
|
41
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
+
const ora_1 = __importDefault(require("ora"));
|
|
43
|
+
const api_1 = require("../lib/api");
|
|
44
|
+
const config_1 = require("../lib/config");
|
|
45
|
+
const output = __importStar(require("../utils/output"));
|
|
46
|
+
/**
|
|
47
|
+
* Formats a Unix timestamp (milliseconds) to a human-readable date.
|
|
48
|
+
* TransactionEntity uses numeric timestamps, not ISO strings.
|
|
49
|
+
*/
|
|
50
|
+
function formatTimestamp(ts) {
|
|
51
|
+
const d = new Date(ts);
|
|
52
|
+
return d.toLocaleDateString("en-US", {
|
|
53
|
+
year: "numeric",
|
|
54
|
+
month: "short",
|
|
55
|
+
day: "numeric",
|
|
56
|
+
hour: "2-digit",
|
|
57
|
+
minute: "2-digit",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Formats transaction status with color
|
|
62
|
+
*/
|
|
63
|
+
function formatStatus(status) {
|
|
64
|
+
switch (status?.toLowerCase()) {
|
|
65
|
+
case "paid":
|
|
66
|
+
return chalk_1.default.green(status);
|
|
67
|
+
case "pending":
|
|
68
|
+
return chalk_1.default.yellow(status);
|
|
69
|
+
case "refunded":
|
|
70
|
+
case "partialrefund":
|
|
71
|
+
case "chargedback":
|
|
72
|
+
case "declined":
|
|
73
|
+
case "void":
|
|
74
|
+
return chalk_1.default.red(status);
|
|
75
|
+
case "uncollectible":
|
|
76
|
+
return chalk_1.default.dim(status);
|
|
77
|
+
default:
|
|
78
|
+
return status || "-";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Formats transaction type with color
|
|
83
|
+
*/
|
|
84
|
+
function formatType(type) {
|
|
85
|
+
switch (type) {
|
|
86
|
+
case "payment":
|
|
87
|
+
return chalk_1.default.cyan("payment");
|
|
88
|
+
case "invoice":
|
|
89
|
+
return chalk_1.default.magenta("invoice");
|
|
90
|
+
default:
|
|
91
|
+
return type || "-";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function formatTransaction(txn, jsonFlag) {
|
|
95
|
+
if ((0, config_1.shouldOutputJson)(jsonFlag)) {
|
|
96
|
+
output.outputJson(txn);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
output.header("Transaction Details");
|
|
100
|
+
output.newline();
|
|
101
|
+
const data = {
|
|
102
|
+
ID: txn.id,
|
|
103
|
+
Status: formatStatus(txn.status),
|
|
104
|
+
Type: formatType(txn.type),
|
|
105
|
+
Amount: output.formatCurrency(txn.amount, txn.currency),
|
|
106
|
+
Currency: txn.currency.toUpperCase(),
|
|
107
|
+
Mode: txn.mode,
|
|
108
|
+
};
|
|
109
|
+
if (txn.amountPaid != null) {
|
|
110
|
+
data["Amount Paid"] = output.formatCurrency(txn.amountPaid, txn.currency);
|
|
111
|
+
}
|
|
112
|
+
if (txn.discountAmount != null) {
|
|
113
|
+
data["Discount"] = output.formatCurrency(txn.discountAmount, txn.currency);
|
|
114
|
+
}
|
|
115
|
+
if (txn.taxAmount != null) {
|
|
116
|
+
data["Tax Amount"] = output.formatCurrency(txn.taxAmount, txn.currency);
|
|
117
|
+
}
|
|
118
|
+
if (txn.taxCountry) {
|
|
119
|
+
data["Tax Country"] = txn.taxCountry;
|
|
120
|
+
}
|
|
121
|
+
if (txn.refundedAmount != null) {
|
|
122
|
+
data["Refunded"] = output.formatCurrency(txn.refundedAmount, txn.currency);
|
|
123
|
+
}
|
|
124
|
+
if (txn.order) {
|
|
125
|
+
data["Order"] = txn.order;
|
|
126
|
+
}
|
|
127
|
+
if (txn.subscription) {
|
|
128
|
+
data["Subscription"] = txn.subscription;
|
|
129
|
+
}
|
|
130
|
+
if (txn.customer) {
|
|
131
|
+
data["Customer"] = txn.customer;
|
|
132
|
+
}
|
|
133
|
+
if (txn.description) {
|
|
134
|
+
data["Description"] = txn.description;
|
|
135
|
+
}
|
|
136
|
+
if (txn.periodStart) {
|
|
137
|
+
data["Period Start"] = formatTimestamp(txn.periodStart);
|
|
138
|
+
}
|
|
139
|
+
if (txn.periodEnd) {
|
|
140
|
+
data["Period End"] = formatTimestamp(txn.periodEnd);
|
|
141
|
+
}
|
|
142
|
+
data["Created"] = formatTimestamp(txn.createdAt);
|
|
143
|
+
output.outputKeyValue(data);
|
|
144
|
+
}
|
|
145
|
+
function getTransactionDetailLines(txn) {
|
|
146
|
+
const lines = [];
|
|
147
|
+
const dl = output.detailLine;
|
|
148
|
+
lines.push("");
|
|
149
|
+
lines.push(dl("ID", txn.id));
|
|
150
|
+
lines.push(dl("Status", formatStatus(txn.status)));
|
|
151
|
+
lines.push(dl("Type", formatType(txn.type)));
|
|
152
|
+
lines.push(dl("Amount", output.formatCurrency(txn.amount, txn.currency)));
|
|
153
|
+
lines.push(dl("Currency", txn.currency.toUpperCase()));
|
|
154
|
+
lines.push(dl("Mode", txn.mode));
|
|
155
|
+
if (txn.amountPaid != null) {
|
|
156
|
+
lines.push(dl("Amount Paid", output.formatCurrency(txn.amountPaid, txn.currency)));
|
|
157
|
+
}
|
|
158
|
+
if (txn.discountAmount != null) {
|
|
159
|
+
lines.push(dl("Discount", output.formatCurrency(txn.discountAmount, txn.currency)));
|
|
160
|
+
}
|
|
161
|
+
if (txn.taxAmount != null) {
|
|
162
|
+
lines.push(dl("Tax Amount", output.formatCurrency(txn.taxAmount, txn.currency)));
|
|
163
|
+
}
|
|
164
|
+
if (txn.taxCountry) {
|
|
165
|
+
lines.push(dl("Tax Country", txn.taxCountry));
|
|
166
|
+
}
|
|
167
|
+
if (txn.refundedAmount != null) {
|
|
168
|
+
lines.push(dl("Refunded", output.formatCurrency(txn.refundedAmount, txn.currency)));
|
|
169
|
+
}
|
|
170
|
+
if (txn.order) {
|
|
171
|
+
lines.push(dl("Order", txn.order));
|
|
172
|
+
}
|
|
173
|
+
if (txn.subscription) {
|
|
174
|
+
lines.push(dl("Subscription", txn.subscription));
|
|
175
|
+
}
|
|
176
|
+
if (txn.customer) {
|
|
177
|
+
lines.push(dl("Customer", txn.customer));
|
|
178
|
+
}
|
|
179
|
+
if (txn.description) {
|
|
180
|
+
lines.push(dl("Description", txn.description));
|
|
181
|
+
}
|
|
182
|
+
if (txn.periodStart) {
|
|
183
|
+
lines.push(dl("Period Start", formatTimestamp(txn.periodStart)));
|
|
184
|
+
}
|
|
185
|
+
if (txn.periodEnd) {
|
|
186
|
+
lines.push(dl("Period End", formatTimestamp(txn.periodEnd)));
|
|
187
|
+
}
|
|
188
|
+
lines.push(dl("Created", formatTimestamp(txn.createdAt)));
|
|
189
|
+
return lines;
|
|
190
|
+
}
|
|
191
|
+
function getTransactionsTuiDescriptor() {
|
|
192
|
+
return {
|
|
193
|
+
name: "Transactions",
|
|
194
|
+
columns: [
|
|
195
|
+
{ header: "ID", width: 24, value: (t) => output.truncate(t.id, 24) },
|
|
196
|
+
{
|
|
197
|
+
header: "Amount",
|
|
198
|
+
width: 14,
|
|
199
|
+
value: (t) => output.formatCurrency(t.amount, t.currency),
|
|
200
|
+
align: "right",
|
|
201
|
+
},
|
|
202
|
+
{ header: "Type", width: 10, value: (t) => formatType(t.type) },
|
|
203
|
+
{ header: "Status", width: 14, value: (t) => formatStatus(t.status) },
|
|
204
|
+
{
|
|
205
|
+
header: "Created",
|
|
206
|
+
width: "auto",
|
|
207
|
+
value: (t) => formatTimestamp(t.createdAt),
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
fetchPage: async (page, pageSize) => {
|
|
211
|
+
const client = (0, api_1.getClient)();
|
|
212
|
+
const result = (await client.transactions.search(undefined, undefined, undefined, page, pageSize));
|
|
213
|
+
const { items, pagination } = result;
|
|
214
|
+
return {
|
|
215
|
+
items,
|
|
216
|
+
hasMore: pagination.nextPage !== undefined,
|
|
217
|
+
total: pagination.totalRecords,
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
getId: (t) => t.id,
|
|
221
|
+
renderDetail: (t) => getTransactionDetailLines(t),
|
|
222
|
+
commands: [],
|
|
223
|
+
searchFilter: (t, query) => {
|
|
224
|
+
const q = query.toLowerCase();
|
|
225
|
+
return (t.id.toLowerCase().includes(q) ||
|
|
226
|
+
t.status.toLowerCase().includes(q) ||
|
|
227
|
+
t.type.toLowerCase().includes(q) ||
|
|
228
|
+
t.customer?.toLowerCase().includes(q) ||
|
|
229
|
+
false ||
|
|
230
|
+
t.order?.toLowerCase().includes(q) ||
|
|
231
|
+
false ||
|
|
232
|
+
t.subscription?.toLowerCase().includes(q) ||
|
|
233
|
+
false ||
|
|
234
|
+
t.description?.toLowerCase().includes(q) ||
|
|
235
|
+
false);
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function createTransactionsCommand() {
|
|
240
|
+
const command = new commander_1.Command("transactions")
|
|
241
|
+
.description("Manage transactions")
|
|
242
|
+
.alias("txn")
|
|
243
|
+
.action(async () => {
|
|
244
|
+
const { launchInteractiveMode } = await Promise.resolve().then(() => __importStar(require("../tui")));
|
|
245
|
+
const descriptor = getTransactionsTuiDescriptor();
|
|
246
|
+
await launchInteractiveMode(descriptor);
|
|
247
|
+
});
|
|
248
|
+
// List / search transactions
|
|
249
|
+
command
|
|
250
|
+
.command("list")
|
|
251
|
+
.description("List transactions")
|
|
252
|
+
.option("--page <number>", "Page number", "1")
|
|
253
|
+
.option("--limit <number>", "Number of results per page", "20")
|
|
254
|
+
.option("--customer <id>", "Filter by customer ID")
|
|
255
|
+
.option("--order <id>", "Filter by order ID")
|
|
256
|
+
.option("--product <id>", "Filter by product ID")
|
|
257
|
+
.option("--json", "Output as JSON")
|
|
258
|
+
.action(async (options) => {
|
|
259
|
+
const spinner = (0, ora_1.default)("Fetching transactions...").start();
|
|
260
|
+
try {
|
|
261
|
+
const client = (0, api_1.getClient)();
|
|
262
|
+
const result = (await client.transactions.search(options.customer, options.order, options.product, parseInt(options.page, 10), parseInt(options.limit, 10)));
|
|
263
|
+
spinner.stop();
|
|
264
|
+
const { items, pagination } = result;
|
|
265
|
+
if ((0, config_1.shouldOutputJson)(options.json)) {
|
|
266
|
+
output.outputJson(result);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
output.newline();
|
|
270
|
+
if (items.length === 0) {
|
|
271
|
+
output.info("No transactions found.");
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
output.outputTable(["ID", "Amount", "Type", "Status", "Customer", "Created"], items.map((t) => [
|
|
275
|
+
output.truncate(t.id, 24),
|
|
276
|
+
output.formatCurrency(t.amount, t.currency),
|
|
277
|
+
formatType(t.type),
|
|
278
|
+
formatStatus(t.status),
|
|
279
|
+
t.customer || "-",
|
|
280
|
+
formatTimestamp(t.createdAt),
|
|
281
|
+
]));
|
|
282
|
+
output.newline();
|
|
283
|
+
output.dim(`Page ${pagination.currentPage} of ${pagination.totalPages} (${pagination.totalRecords} total)`);
|
|
284
|
+
if (pagination.nextPage) {
|
|
285
|
+
output.dim(`Use --page ${pagination.nextPage} for next page`);
|
|
286
|
+
}
|
|
287
|
+
const filters = [];
|
|
288
|
+
if (options.customer)
|
|
289
|
+
filters.push(`customer: ${options.customer}`);
|
|
290
|
+
if (options.order)
|
|
291
|
+
filters.push(`order: ${options.order}`);
|
|
292
|
+
if (options.product)
|
|
293
|
+
filters.push(`product: ${options.product}`);
|
|
294
|
+
if (filters.length > 0) {
|
|
295
|
+
output.dim(`Filtered by ${filters.join(", ")}`);
|
|
296
|
+
}
|
|
297
|
+
output.newline();
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
spinner.stop();
|
|
301
|
+
output.error(error instanceof Error ? error.message : "Failed to fetch transactions");
|
|
302
|
+
process.exit(1);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
// Get transaction by ID
|
|
306
|
+
command
|
|
307
|
+
.command("get <transaction-id>")
|
|
308
|
+
.description("Get transaction details")
|
|
309
|
+
.option("--json", "Output as JSON")
|
|
310
|
+
.action(async (transactionId, options) => {
|
|
311
|
+
const spinner = (0, ora_1.default)("Fetching transaction...").start();
|
|
312
|
+
try {
|
|
313
|
+
const client = (0, api_1.getClient)();
|
|
314
|
+
const transaction = (await client.transactions.getById(transactionId));
|
|
315
|
+
spinner.stop();
|
|
316
|
+
formatTransaction(transaction, options.json);
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
spinner.fail("Failed to fetch transaction");
|
|
320
|
+
output.error(error instanceof Error ? error.message : "Unknown error");
|
|
321
|
+
process.exit(1);
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
return command;
|
|
325
|
+
}
|
|
326
|
+
//# sourceMappingURL=transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/commands/transactions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkQA,8DAuHC;AAzXD,yCAAoC;AACpC,kDAA0B;AAC1B,8CAAsB;AACtB,oCAAuC;AACvC,0CAAiD;AACjD,wDAA0C;AAqC1C;;;GAGG;AACH,SAAS,eAAe,CAAC,EAAU;IACjC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;IACvB,OAAO,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE;QACnC,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,MAAc;IAClC,QAAQ,MAAM,EAAE,WAAW,EAAE,EAAE,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|
1
|
+
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../src/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,mBAAmB,IAAI,OAAO,CAwC7C"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createWhoamiCommand = createWhoamiCommand;
|
|
37
|
+
const commander_1 = require("commander");
|
|
38
|
+
const auth_1 = require("../lib/auth");
|
|
39
|
+
const api_1 = require("../lib/api");
|
|
40
|
+
const config_1 = require("../lib/config");
|
|
41
|
+
const output = __importStar(require("../utils/output"));
|
|
42
|
+
function createWhoamiCommand() {
|
|
43
|
+
const command = new commander_1.Command("whoami")
|
|
44
|
+
.description("Display current authentication status")
|
|
45
|
+
.option("--json", "Output as JSON")
|
|
46
|
+
.action((options) => {
|
|
47
|
+
const authInfo = (0, auth_1.getAuthInfo)();
|
|
48
|
+
// JSON output for any state
|
|
49
|
+
if ((0, config_1.shouldOutputJson)(options.json)) {
|
|
50
|
+
output.outputJson({
|
|
51
|
+
authenticated: authInfo.authenticated,
|
|
52
|
+
environment: authInfo.environment,
|
|
53
|
+
api_key_preview: authInfo.apiKeyPreview || null,
|
|
54
|
+
api_url: (0, api_1.getBaseUrl)(),
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
output.newline();
|
|
59
|
+
if (!authInfo.authenticated) {
|
|
60
|
+
output.warning("Not logged in");
|
|
61
|
+
output.newline();
|
|
62
|
+
output.info("Run `creem login` to authenticate.");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
output.success("Logged in to Creem");
|
|
66
|
+
output.newline();
|
|
67
|
+
output.outputKeyValue({
|
|
68
|
+
Environment: authInfo.environment,
|
|
69
|
+
"API Key": authInfo.apiKeyPreview || "-",
|
|
70
|
+
"API URL": (0, api_1.getBaseUrl)(),
|
|
71
|
+
});
|
|
72
|
+
output.newline();
|
|
73
|
+
});
|
|
74
|
+
return command;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=whoami.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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IAAA,gBAAU,GAAE;SACxB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const commands_1 = require("./commands");
|
|
10
|
+
const VERSION = "0.1.3";
|
|
11
|
+
const creem = chalk_1.default.hex("#ffbe98");
|
|
12
|
+
const BANNER = creem(`
|
|
13
|
+
██████╗██████╗ ███████╗███████╗███╗ ███╗
|
|
14
|
+
██╔════╝██╔══██╗██╔════╝██╔════╝████╗ ████║
|
|
15
|
+
██║ ██████╔╝█████╗ █████╗ ██╔████╔██║
|
|
16
|
+
██║ ██╔══██╗██╔══╝ ██╔══╝ ██║╚██╔╝██║
|
|
17
|
+
╚██████╗██║ ██║███████╗███████╗██║ ╚═╝ ██║
|
|
18
|
+
╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
|
19
|
+
`) + chalk_1.default.dim(` v${VERSION} · The Smooth Merchant of Record\n`);
|
|
20
|
+
const FULL_HELP = `
|
|
21
|
+
${chalk_1.default.dim("Examples:")}
|
|
22
|
+
${chalk_1.default.cyan("creem login")} Authenticate with your API key
|
|
23
|
+
${chalk_1.default.cyan("creem config set environment live")} Switch to live mode
|
|
24
|
+
${chalk_1.default.cyan("creem products list")} List all products
|
|
25
|
+
${chalk_1.default.cyan("creem products create --name ... ")} Create a product
|
|
26
|
+
${chalk_1.default.cyan("creem customers list")} List all customers
|
|
27
|
+
${chalk_1.default.cyan("creem subscriptions get <id>")} Get subscription details
|
|
28
|
+
${chalk_1.default.cyan("creem transactions list")} List transactions
|
|
29
|
+
${chalk_1.default.cyan("creem checkouts create --product <id>")} Create checkout
|
|
30
|
+
${chalk_1.default.cyan("creem migrate lemon-squeezy")} Migrate from Lemon Squeezy
|
|
31
|
+
|
|
32
|
+
${chalk_1.default.dim("Interactive mode:")}
|
|
33
|
+
Run a resource command without a subcommand to browse interactively:
|
|
34
|
+
${chalk_1.default.cyan("creem products")} ${chalk_1.default.cyan("creem customers")} ${chalk_1.default.cyan("creem subscriptions")} ${chalk_1.default.cyan("creem transactions")}
|
|
35
|
+
|
|
36
|
+
${chalk_1.default.dim("Configuration:")}
|
|
37
|
+
Config is stored at ${chalk_1.default.cyan("~/.creem/config.json")}
|
|
38
|
+
API keys: test keys start with ${chalk_1.default.cyan("creem_test_")}, live keys with ${chalk_1.default.cyan("creem_")}
|
|
39
|
+
Environments: ${chalk_1.default.cyan("test")} (default) uses test-api.creem.io, ${chalk_1.default.cyan("live")} uses api.creem.io
|
|
40
|
+
Output format: ${chalk_1.default.cyan("table")} (default) or ${chalk_1.default.cyan("json")} (set globally or per-command with --json)
|
|
41
|
+
|
|
42
|
+
${chalk_1.default.dim("Agents:")}
|
|
43
|
+
Quickstart: https://creem.io/agents.md
|
|
44
|
+
Creem Skills: https://github.com/armitage-labs/creem-skills
|
|
45
|
+
|
|
46
|
+
${chalk_1.default.dim("Documentation:")} https://docs.creem.io
|
|
47
|
+
${chalk_1.default.dim("API keys:")} https://creem.io/dashboard/developers
|
|
48
|
+
`;
|
|
49
|
+
const program = new commander_1.Command();
|
|
50
|
+
program
|
|
51
|
+
.name("creem")
|
|
52
|
+
.description("The official CLI for Creem")
|
|
53
|
+
.version(VERSION, "-v, --version", "Display version number")
|
|
54
|
+
.helpOption("-h, --help", "Display help")
|
|
55
|
+
.enablePositionalOptions()
|
|
56
|
+
.passThroughOptions();
|
|
57
|
+
// Register commands
|
|
58
|
+
program.addCommand((0, commands_1.createLoginCommand)());
|
|
59
|
+
program.addCommand((0, commands_1.createLogoutCommand)());
|
|
60
|
+
program.addCommand((0, commands_1.createWhoamiCommand)());
|
|
61
|
+
program.addCommand((0, commands_1.createConfigCommand)());
|
|
62
|
+
program.addCommand((0, commands_1.createProductsCommand)());
|
|
63
|
+
program.addCommand((0, commands_1.createCheckoutsCommand)());
|
|
64
|
+
program.addCommand((0, commands_1.createSubscriptionsCommand)());
|
|
65
|
+
program.addCommand((0, commands_1.createCustomersCommand)());
|
|
66
|
+
program.addCommand((0, commands_1.createTransactionsCommand)());
|
|
67
|
+
program.addCommand((0, commands_1.createDiscountsCommand)());
|
|
68
|
+
program.addCommand((0, commands_1.createMigrateCommand)());
|
|
69
|
+
// creem help: full reference; creem help <command>: specific command help
|
|
70
|
+
const helpCmd = new commander_1.Command("help")
|
|
71
|
+
.description("Display full help with examples and configuration reference")
|
|
72
|
+
.argument("[command]", "Command to get help for")
|
|
73
|
+
.action((commandName) => {
|
|
74
|
+
if (commandName) {
|
|
75
|
+
const sub = program.commands.find((c) => c.name() === commandName || c.aliases().includes(commandName));
|
|
76
|
+
if (sub) {
|
|
77
|
+
sub.outputHelp();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.error(chalk_1.default.red(`Unknown command: ${commandName}`));
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
program.outputHelp();
|
|
86
|
+
console.log(FULL_HELP);
|
|
87
|
+
});
|
|
88
|
+
// Replace the default help command with ours
|
|
89
|
+
program.addCommand(helpCmd, { hidden: false });
|
|
90
|
+
// Show ASCII banner before help output (only for the root command)
|
|
91
|
+
program.addHelpText("beforeAll", BANNER);
|
|
92
|
+
// Compact footer on default help
|
|
93
|
+
program.addHelpText("after", `
|
|
94
|
+
Run ${chalk_1.default.cyan("creem help")} for examples and configuration reference.
|
|
95
|
+
`);
|
|
96
|
+
// Handle unknown commands
|
|
97
|
+
program.on("command:*", () => {
|
|
98
|
+
console.error(chalk_1.default.red(`Unknown command: ${program.args.join(" ")}`));
|
|
99
|
+
console.error();
|
|
100
|
+
program.outputHelp();
|
|
101
|
+
process.exit(1);
|
|
102
|
+
});
|
|
103
|
+
// Parse and execute
|
|
104
|
+
program.parse(process.argv);
|
|
105
|
+
// If no command provided, show help (banner is printed by the beforeAll hook)
|
|
106
|
+
if (!process.argv.slice(2).length) {
|
|
107
|
+
program.outputHelp();
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,yCAYoB;AAEpB,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,MAAM,KAAK,GAAG,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAEnC,MAAM,MAAM,GACV,KAAK,CAAC;;;;;;;CAOP,CAAC,GAAG,eAAK,CAAC,GAAG,CAAC,MAAM,OAAO,oCAAoC,CAAC,CAAC;AAElE,MAAM,SAAS,GAAG;EAChB,eAAK,CAAC,GAAG,CAAC,WAAW,CAAC;IACpB,eAAK,CAAC,IAAI,CAAC,aAAa,CAAC;IACzB,eAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC;IAC/C,eAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC;IACjC,eAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC;IAC/C,eAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAClC,eAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC;IAC1C,eAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC;IACrC,eAAK,CAAC,IAA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T,CAAC;IAED,OAAO,CAAC,UAAU,EAAE,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AACL,6CAA6C;AAC7C,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAE/C,mEAAmE;AACnE,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAEzC,iCAAiC;AACjC,OAAO,CAAC,WAAW,CACjB,OAAO,EACP;QACM,eAAK,CAAC,IAAI,CAAC,YAAY,CAAC;CAC/B,CACA,CAAC;AAEF,0BAA0B;AAC1B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC3B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,oBAAoB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,EAAE,CAAC;IAChB,OAAO,CAAC,UAAU,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,oBAAoB;AACpB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,8EAA8E;AAC9E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Creem } from "creem";
|
|
2
|
+
/**
|
|
3
|
+
* Gets the base URL for the current environment
|
|
4
|
+
*/
|
|
5
|
+
export declare function getBaseUrl(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Gets or creates a Creem SDK client instance
|
|
8
|
+
* Recreates client if API key or environment changed
|
|
9
|
+
*/
|
|
10
|
+
export declare function getClient(): Creem;
|
|
11
|
+
/**
|
|
12
|
+
* Resets the client (call after login/logout)
|
|
13
|
+
* Also resets the TUI environment cache to ensure UI shows current environment
|
|
14
|
+
*/
|
|
15
|
+
export declare function resetClient(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Validates an API key by making a test request
|
|
18
|
+
* @param apiKey - The API key to validate
|
|
19
|
+
* @param environment - Optional environment override (defaults to config value)
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateApiKey(apiKey: string, environment?: "test" | "live"): Promise<{
|
|
22
|
+
valid: boolean;
|
|
23
|
+
error?: string;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAa9B;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAGnC;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,KAAK,CAqBjC;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAKlC;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAC5B,OAAO,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgB7C"}
|