@eide/foir-cli 0.1.35 → 0.1.36
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/cli.js +7467 -42
- package/dist/config/types.d.ts +7 -6
- package/dist/config/types.js +6 -14
- package/dist/generated-CPsQ9jfu.d.ts +195 -0
- package/dist/lib/extension-helpers.d.ts +10 -7
- package/dist/lib/extension-helpers.js +15 -85
- package/dist/lib/hook-helpers.d.ts +9 -6
- package/dist/lib/hook-helpers.js +12 -105
- package/dist/lib/seed-helpers.d.ts +10 -8
- package/dist/lib/seed-helpers.js +18 -124
- package/package.json +9 -8
- package/dist/auth/credentials.d.ts +0 -31
- package/dist/auth/credentials.d.ts.map +0 -1
- package/dist/auth/credentials.js +0 -139
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/codegen/fetch-customer-profile-schema.d.ts +0 -12
- package/dist/codegen/fetch-customer-profile-schema.d.ts.map +0 -1
- package/dist/codegen/fetch-customer-profile-schema.js +0 -21
- package/dist/codegen/fetch-models.d.ts +0 -58
- package/dist/codegen/fetch-models.d.ts.map +0 -1
- package/dist/codegen/fetch-models.js +0 -96
- package/dist/codegen/field-mapping.d.ts +0 -34
- package/dist/codegen/field-mapping.d.ts.map +0 -1
- package/dist/codegen/field-mapping.js +0 -250
- package/dist/codegen/generators/config.d.ts +0 -5
- package/dist/codegen/generators/config.d.ts.map +0 -1
- package/dist/codegen/generators/config.js +0 -82
- package/dist/codegen/generators/customer-profile-documents.d.ts +0 -5
- package/dist/codegen/generators/customer-profile-documents.d.ts.map +0 -1
- package/dist/codegen/generators/customer-profile-documents.js +0 -42
- package/dist/codegen/generators/customer-profile-hooks.d.ts +0 -5
- package/dist/codegen/generators/customer-profile-hooks.d.ts.map +0 -1
- package/dist/codegen/generators/customer-profile-hooks.js +0 -78
- package/dist/codegen/generators/customer-profile-loaders.d.ts +0 -5
- package/dist/codegen/generators/customer-profile-loaders.d.ts.map +0 -1
- package/dist/codegen/generators/customer-profile-loaders.js +0 -67
- package/dist/codegen/generators/customer-profile-operations.d.ts +0 -5
- package/dist/codegen/generators/customer-profile-operations.d.ts.map +0 -1
- package/dist/codegen/generators/customer-profile-operations.js +0 -126
- package/dist/codegen/generators/customer-profile-types.d.ts +0 -6
- package/dist/codegen/generators/customer-profile-types.d.ts.map +0 -1
- package/dist/codegen/generators/customer-profile-types.js +0 -45
- package/dist/codegen/generators/documents.d.ts +0 -12
- package/dist/codegen/generators/documents.d.ts.map +0 -1
- package/dist/codegen/generators/documents.js +0 -178
- package/dist/codegen/generators/field-types.d.ts +0 -5
- package/dist/codegen/generators/field-types.d.ts.map +0 -1
- package/dist/codegen/generators/field-types.js +0 -346
- package/dist/codegen/generators/model-index.d.ts +0 -6
- package/dist/codegen/generators/model-index.d.ts.map +0 -1
- package/dist/codegen/generators/model-index.js +0 -26
- package/dist/codegen/generators/model-types.d.ts +0 -12
- package/dist/codegen/generators/model-types.d.ts.map +0 -1
- package/dist/codegen/generators/model-types.js +0 -177
- package/dist/codegen/generators/public-schema-content.d.ts +0 -14
- package/dist/codegen/generators/public-schema-content.d.ts.map +0 -1
- package/dist/codegen/generators/public-schema-content.js +0 -22
- package/dist/codegen/generators/react-hooks-index.d.ts +0 -6
- package/dist/codegen/generators/react-hooks-index.d.ts.map +0 -1
- package/dist/codegen/generators/react-hooks-index.js +0 -20
- package/dist/codegen/generators/react-hooks.d.ts +0 -7
- package/dist/codegen/generators/react-hooks.d.ts.map +0 -1
- package/dist/codegen/generators/react-hooks.js +0 -139
- package/dist/codegen/generators/remix-loaders-index.d.ts +0 -6
- package/dist/codegen/generators/remix-loaders-index.d.ts.map +0 -1
- package/dist/codegen/generators/remix-loaders-index.js +0 -20
- package/dist/codegen/generators/remix-loaders.d.ts +0 -7
- package/dist/codegen/generators/remix-loaders.d.ts.map +0 -1
- package/dist/codegen/generators/remix-loaders.js +0 -107
- package/dist/codegen/generators/static-documents.d.ts +0 -14
- package/dist/codegen/generators/static-documents.d.ts.map +0 -1
- package/dist/codegen/generators/static-documents.js +0 -771
- package/dist/codegen/generators/swift-customer-profile.d.ts +0 -9
- package/dist/codegen/generators/swift-customer-profile.d.ts.map +0 -1
- package/dist/codegen/generators/swift-customer-profile.js +0 -152
- package/dist/codegen/generators/swift-field-types.d.ts +0 -5
- package/dist/codegen/generators/swift-field-types.d.ts.map +0 -1
- package/dist/codegen/generators/swift-field-types.js +0 -151
- package/dist/codegen/generators/swift-model-keys.d.ts +0 -6
- package/dist/codegen/generators/swift-model-keys.d.ts.map +0 -1
- package/dist/codegen/generators/swift-model-keys.js +0 -25
- package/dist/codegen/generators/swift-types.d.ts +0 -13
- package/dist/codegen/generators/swift-types.d.ts.map +0 -1
- package/dist/codegen/generators/swift-types.js +0 -188
- package/dist/codegen/generators/typed-operations-common.d.ts +0 -6
- package/dist/codegen/generators/typed-operations-common.d.ts.map +0 -1
- package/dist/codegen/generators/typed-operations-common.js +0 -84
- package/dist/codegen/generators/typed-operations-index.d.ts +0 -6
- package/dist/codegen/generators/typed-operations-index.d.ts.map +0 -1
- package/dist/codegen/generators/typed-operations-index.js +0 -22
- package/dist/codegen/generators/typed-operations.d.ts +0 -11
- package/dist/codegen/generators/typed-operations.d.ts.map +0 -1
- package/dist/codegen/generators/typed-operations.js +0 -263
- package/dist/codegen/swift-field-mapping.d.ts +0 -30
- package/dist/codegen/swift-field-mapping.d.ts.map +0 -1
- package/dist/codegen/swift-field-mapping.js +0 -150
- package/dist/codegen/write-files.d.ts +0 -15
- package/dist/codegen/write-files.d.ts.map +0 -1
- package/dist/codegen/write-files.js +0 -36
- package/dist/commands/api-keys.d.ts +0 -4
- package/dist/commands/api-keys.d.ts.map +0 -1
- package/dist/commands/api-keys.js +0 -129
- package/dist/commands/auth-config.d.ts +0 -4
- package/dist/commands/auth-config.d.ts.map +0 -1
- package/dist/commands/auth-config.js +0 -38
- package/dist/commands/auth-providers.d.ts +0 -4
- package/dist/commands/auth-providers.d.ts.map +0 -1
- package/dist/commands/auth-providers.js +0 -207
- package/dist/commands/context.d.ts +0 -4
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js +0 -91
- package/dist/commands/create-extension.d.ts +0 -4
- package/dist/commands/create-extension.d.ts.map +0 -1
- package/dist/commands/create-extension.js +0 -60
- package/dist/commands/customer-profiles.d.ts +0 -4
- package/dist/commands/customer-profiles.d.ts.map +0 -1
- package/dist/commands/customer-profiles.js +0 -99
- package/dist/commands/customers.d.ts +0 -4
- package/dist/commands/customers.d.ts.map +0 -1
- package/dist/commands/customers.js +0 -126
- package/dist/commands/embeddings.d.ts +0 -4
- package/dist/commands/embeddings.d.ts.map +0 -1
- package/dist/commands/embeddings.js +0 -145
- package/dist/commands/experiments.d.ts +0 -4
- package/dist/commands/experiments.d.ts.map +0 -1
- package/dist/commands/experiments.js +0 -196
- package/dist/commands/extensions.d.ts +0 -4
- package/dist/commands/extensions.d.ts.map +0 -1
- package/dist/commands/extensions.js +0 -210
- package/dist/commands/files.d.ts +0 -4
- package/dist/commands/files.d.ts.map +0 -1
- package/dist/commands/files.js +0 -143
- package/dist/commands/hooks.d.ts +0 -4
- package/dist/commands/hooks.d.ts.map +0 -1
- package/dist/commands/hooks.js +0 -228
- package/dist/commands/locales.d.ts +0 -4
- package/dist/commands/locales.d.ts.map +0 -1
- package/dist/commands/locales.js +0 -140
- package/dist/commands/login.d.ts +0 -4
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -124
- package/dist/commands/logout.d.ts +0 -4
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -16
- package/dist/commands/media.d.ts +0 -4
- package/dist/commands/media.d.ts.map +0 -1
- package/dist/commands/media.js +0 -44
- package/dist/commands/models.d.ts +0 -4
- package/dist/commands/models.d.ts.map +0 -1
- package/dist/commands/models.js +0 -153
- package/dist/commands/notes.d.ts +0 -4
- package/dist/commands/notes.d.ts.map +0 -1
- package/dist/commands/notes.js +0 -132
- package/dist/commands/notifications.d.ts +0 -4
- package/dist/commands/notifications.d.ts.map +0 -1
- package/dist/commands/notifications.js +0 -73
- package/dist/commands/operations.d.ts +0 -4
- package/dist/commands/operations.d.ts.map +0 -1
- package/dist/commands/operations.js +0 -341
- package/dist/commands/playground.d.ts +0 -4
- package/dist/commands/playground.d.ts.map +0 -1
- package/dist/commands/playground.js +0 -270
- package/dist/commands/pull.d.ts +0 -4
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js +0 -300
- package/dist/commands/records.d.ts +0 -4
- package/dist/commands/records.d.ts.map +0 -1
- package/dist/commands/records.js +0 -314
- package/dist/commands/register-commands.d.ts +0 -7
- package/dist/commands/register-commands.d.ts.map +0 -1
- package/dist/commands/register-commands.js +0 -259
- package/dist/commands/schedules.d.ts +0 -4
- package/dist/commands/schedules.d.ts.map +0 -1
- package/dist/commands/schedules.js +0 -155
- package/dist/commands/search.d.ts +0 -4
- package/dist/commands/search.d.ts.map +0 -1
- package/dist/commands/search.js +0 -60
- package/dist/commands/segments.d.ts +0 -4
- package/dist/commands/segments.d.ts.map +0 -1
- package/dist/commands/segments.js +0 -155
- package/dist/commands/select-project.d.ts +0 -4
- package/dist/commands/select-project.d.ts.map +0 -1
- package/dist/commands/select-project.js +0 -144
- package/dist/commands/settings.d.ts +0 -4
- package/dist/commands/settings.d.ts.map +0 -1
- package/dist/commands/settings.js +0 -115
- package/dist/commands/variant-catalog.d.ts +0 -4
- package/dist/commands/variant-catalog.d.ts.map +0 -1
- package/dist/commands/variant-catalog.js +0 -118
- package/dist/commands/whoami.d.ts +0 -4
- package/dist/commands/whoami.d.ts.map +0 -1
- package/dist/commands/whoami.js +0 -51
- package/dist/config/pull-config.d.ts +0 -33
- package/dist/config/pull-config.d.ts.map +0 -1
- package/dist/config/pull-config.js +0 -119
- package/dist/config/types.d.ts.map +0 -1
- package/dist/graphql/generated.d.ts +0 -6074
- package/dist/graphql/generated.d.ts.map +0 -1
- package/dist/graphql/generated.js +0 -355
- package/dist/lib/client.d.ts +0 -18
- package/dist/lib/client.d.ts.map +0 -1
- package/dist/lib/client.js +0 -64
- package/dist/lib/config-loader.d.ts +0 -28
- package/dist/lib/config-loader.d.ts.map +0 -1
- package/dist/lib/config-loader.js +0 -49
- package/dist/lib/config.d.ts +0 -12
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -8
- package/dist/lib/errors.d.ts +0 -6
- package/dist/lib/errors.d.ts.map +0 -1
- package/dist/lib/errors.js +0 -76
- package/dist/lib/extension-helpers.d.ts.map +0 -1
- package/dist/lib/hook-helpers.d.ts.map +0 -1
- package/dist/lib/input.d.ts +0 -38
- package/dist/lib/input.d.ts.map +0 -1
- package/dist/lib/input.js +0 -108
- package/dist/lib/output.d.ts +0 -31
- package/dist/lib/output.d.ts.map +0 -1
- package/dist/lib/output.js +0 -107
- package/dist/lib/seed-helpers.d.ts.map +0 -1
- package/dist/scaffold/package-manager.d.ts +0 -12
- package/dist/scaffold/package-manager.d.ts.map +0 -1
- package/dist/scaffold/package-manager.js +0 -51
- package/dist/scaffold/scaffold.d.ts +0 -4
- package/dist/scaffold/scaffold.d.ts.map +0 -1
- package/dist/scaffold/scaffold.js +0 -462
package/dist/lib/input.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse input data from --data, --file, or stdin.
|
|
3
|
-
*
|
|
4
|
-
* Supports TypeScript (.ts), JavaScript (.js, .mjs), and JSON (.json) files.
|
|
5
|
-
*/
|
|
6
|
-
export declare function parseInputData(opts: {
|
|
7
|
-
data?: string;
|
|
8
|
-
file?: string;
|
|
9
|
-
}): Promise<Record<string, unknown>>;
|
|
10
|
-
/**
|
|
11
|
-
* Detect whether a string is a UUID or CUID (→ ID lookup) vs a natural key.
|
|
12
|
-
*/
|
|
13
|
-
export declare function isUUID(value: string): boolean;
|
|
14
|
-
interface ParsedFilter {
|
|
15
|
-
field: string;
|
|
16
|
-
operator: string;
|
|
17
|
-
value: unknown;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Parse filter string: "status=active,name~%hello%"
|
|
21
|
-
*/
|
|
22
|
-
export declare function parseFilters(filterStr: string): ParsedFilter[];
|
|
23
|
-
interface ParsedSort {
|
|
24
|
-
field: string;
|
|
25
|
-
direction: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Parse sort string: "createdAt:desc"
|
|
29
|
-
*/
|
|
30
|
-
export declare function parseSort(sortStr: string): ParsedSort | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Prompt for confirmation unless --confirm flag is set.
|
|
33
|
-
*/
|
|
34
|
-
export declare function confirmAction(message: string, opts?: {
|
|
35
|
-
confirm?: boolean;
|
|
36
|
-
}): Promise<boolean>;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=input.d.ts.map
|
package/dist/lib/input.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/lib/input.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAyBnC;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAM7C;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,EAAE,CA8B9D;AAWD,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAQjE;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3B,OAAO,CAAC,OAAO,CAAC,CAalB"}
|
package/dist/lib/input.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import inquirer from 'inquirer';
|
|
2
|
-
import { loadConfig } from './config-loader.js';
|
|
3
|
-
/**
|
|
4
|
-
* Parse input data from --data, --file, or stdin.
|
|
5
|
-
*
|
|
6
|
-
* Supports TypeScript (.ts), JavaScript (.js, .mjs), and JSON (.json) files.
|
|
7
|
-
*/
|
|
8
|
-
export async function parseInputData(opts) {
|
|
9
|
-
if (opts.data) {
|
|
10
|
-
return JSON.parse(opts.data);
|
|
11
|
-
}
|
|
12
|
-
if (opts.file) {
|
|
13
|
-
// Use config loader for TypeScript/JavaScript/JSON files
|
|
14
|
-
return await loadConfig(opts.file);
|
|
15
|
-
}
|
|
16
|
-
// Check for stdin pipe
|
|
17
|
-
if (!process.stdin.isTTY) {
|
|
18
|
-
const chunks = [];
|
|
19
|
-
for await (const chunk of process.stdin) {
|
|
20
|
-
chunks.push(chunk);
|
|
21
|
-
}
|
|
22
|
-
const stdinContent = Buffer.concat(chunks).toString('utf-8').trim();
|
|
23
|
-
if (stdinContent) {
|
|
24
|
-
return JSON.parse(stdinContent);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
throw new Error('No input data provided. Use --data, --file, or pipe via stdin.');
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Detect whether a string is a UUID or CUID (→ ID lookup) vs a natural key.
|
|
31
|
-
*/
|
|
32
|
-
export function isUUID(value) {
|
|
33
|
-
return (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value) || /^c[a-z0-9]{24,}$/.test(value));
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Parse filter string: "status=active,name~%hello%"
|
|
37
|
-
*/
|
|
38
|
-
export function parseFilters(filterStr) {
|
|
39
|
-
if (!filterStr)
|
|
40
|
-
return [];
|
|
41
|
-
return filterStr.split(',').map((part) => {
|
|
42
|
-
const trimmed = part.trim();
|
|
43
|
-
// Order matters: check multi-char operators first
|
|
44
|
-
for (const [op, gqlOp] of [
|
|
45
|
-
['!=', 'NE'],
|
|
46
|
-
['>=', 'GTE'],
|
|
47
|
-
['<=', 'LTE'],
|
|
48
|
-
['>', 'GT'],
|
|
49
|
-
['<', 'LT'],
|
|
50
|
-
['~', 'LIKE'],
|
|
51
|
-
['=', 'EQ'],
|
|
52
|
-
]) {
|
|
53
|
-
const idx = trimmed.indexOf(op);
|
|
54
|
-
if (idx > 0) {
|
|
55
|
-
const field = trimmed.slice(0, idx);
|
|
56
|
-
const rawValue = trimmed.slice(idx + op.length);
|
|
57
|
-
return {
|
|
58
|
-
field,
|
|
59
|
-
operator: gqlOp,
|
|
60
|
-
value: parseFilterValue(rawValue),
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
throw new Error(`Invalid filter expression: "${trimmed}"`);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function parseFilterValue(raw) {
|
|
68
|
-
if (raw === 'true')
|
|
69
|
-
return true;
|
|
70
|
-
if (raw === 'false')
|
|
71
|
-
return false;
|
|
72
|
-
if (raw === 'null')
|
|
73
|
-
return null;
|
|
74
|
-
const num = Number(raw);
|
|
75
|
-
if (!isNaN(num) && raw !== '')
|
|
76
|
-
return num;
|
|
77
|
-
return raw;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Parse sort string: "createdAt:desc"
|
|
81
|
-
*/
|
|
82
|
-
export function parseSort(sortStr) {
|
|
83
|
-
if (!sortStr)
|
|
84
|
-
return undefined;
|
|
85
|
-
const [field, dir] = sortStr.split(':');
|
|
86
|
-
if (!field)
|
|
87
|
-
return undefined;
|
|
88
|
-
return {
|
|
89
|
-
field,
|
|
90
|
-
direction: (dir ?? 'asc').toUpperCase(),
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Prompt for confirmation unless --confirm flag is set.
|
|
95
|
-
*/
|
|
96
|
-
export async function confirmAction(message, opts) {
|
|
97
|
-
if (opts?.confirm)
|
|
98
|
-
return true;
|
|
99
|
-
const { confirmed } = await inquirer.prompt([
|
|
100
|
-
{
|
|
101
|
-
type: 'confirm',
|
|
102
|
-
name: 'confirmed',
|
|
103
|
-
message,
|
|
104
|
-
default: false,
|
|
105
|
-
},
|
|
106
|
-
]);
|
|
107
|
-
return confirmed;
|
|
108
|
-
}
|
package/dist/lib/output.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { GlobalOptions } from './config.js';
|
|
2
|
-
export interface ColumnDef {
|
|
3
|
-
key: string;
|
|
4
|
-
header: string;
|
|
5
|
-
width?: number;
|
|
6
|
-
format?: (value: unknown) => string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Format a single object for output.
|
|
10
|
-
*/
|
|
11
|
-
export declare function formatOutput(data: unknown, options?: GlobalOptions): void;
|
|
12
|
-
/**
|
|
13
|
-
* Format a list of items as a table or structured output.
|
|
14
|
-
*/
|
|
15
|
-
export declare function formatList(items: Record<string, unknown>[], options: GlobalOptions | undefined, config: {
|
|
16
|
-
columns: ColumnDef[];
|
|
17
|
-
total?: number;
|
|
18
|
-
}): void;
|
|
19
|
-
/**
|
|
20
|
-
* Format a relative time string ("2h ago", "3d ago", etc.)
|
|
21
|
-
*/
|
|
22
|
-
export declare function timeAgo(dateStr: string | null | undefined): string;
|
|
23
|
-
/**
|
|
24
|
-
* Print a success message.
|
|
25
|
-
*/
|
|
26
|
-
export declare function success(message: string): void;
|
|
27
|
-
/**
|
|
28
|
-
* Print a warning message.
|
|
29
|
-
*/
|
|
30
|
-
export declare function warn(message: string): void;
|
|
31
|
-
//# sourceMappingURL=output.d.ts.map
|
package/dist/lib/output.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAYzE;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAChC,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,MAAM,EAAE;IAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,IAAI,CAkDN;AASD;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAmBlE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C"}
|
package/dist/lib/output.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Format a single object for output.
|
|
4
|
-
*/
|
|
5
|
-
export function formatOutput(data, options) {
|
|
6
|
-
if (options?.quiet)
|
|
7
|
-
return;
|
|
8
|
-
if (options?.json) {
|
|
9
|
-
console.log(JSON.stringify(data, null, 2));
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (options?.jsonl) {
|
|
13
|
-
console.log(JSON.stringify(data));
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
// Human-readable: pretty-print the object
|
|
17
|
-
console.log(JSON.stringify(data, null, 2));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Format a list of items as a table or structured output.
|
|
21
|
-
*/
|
|
22
|
-
export function formatList(items, options, config) {
|
|
23
|
-
if (options?.quiet) {
|
|
24
|
-
for (const item of items) {
|
|
25
|
-
console.log(item['id'] ?? '');
|
|
26
|
-
}
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (options?.json) {
|
|
30
|
-
console.log(JSON.stringify(items, null, 2));
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (options?.jsonl) {
|
|
34
|
-
for (const item of items) {
|
|
35
|
-
console.log(JSON.stringify(item));
|
|
36
|
-
}
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
// Human-readable table
|
|
40
|
-
if (items.length === 0) {
|
|
41
|
-
console.log(chalk.gray('No results.'));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const { columns } = config;
|
|
45
|
-
// Print header
|
|
46
|
-
const headerLine = columns
|
|
47
|
-
.map((col) => chalk.bold(pad(col.header, col.width ?? 20)))
|
|
48
|
-
.join(' ');
|
|
49
|
-
console.log(headerLine);
|
|
50
|
-
console.log(columns.map((col) => '─'.repeat(col.width ?? 20)).join('──'));
|
|
51
|
-
// Print rows
|
|
52
|
-
for (const item of items) {
|
|
53
|
-
const row = columns
|
|
54
|
-
.map((col) => {
|
|
55
|
-
const raw = item[col.key];
|
|
56
|
-
const formatted = col.format ? col.format(raw) : String(raw ?? '');
|
|
57
|
-
return pad(formatted, col.width ?? 20);
|
|
58
|
-
})
|
|
59
|
-
.join(' ');
|
|
60
|
-
console.log(row);
|
|
61
|
-
}
|
|
62
|
-
if (config.total !== undefined) {
|
|
63
|
-
console.log(chalk.gray(`\n${items.length} of ${config.total} shown`));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function pad(str, width) {
|
|
67
|
-
if (str.length > width) {
|
|
68
|
-
return str.slice(0, width - 1) + '…';
|
|
69
|
-
}
|
|
70
|
-
return str.padEnd(width);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Format a relative time string ("2h ago", "3d ago", etc.)
|
|
74
|
-
*/
|
|
75
|
-
export function timeAgo(dateStr) {
|
|
76
|
-
if (!dateStr)
|
|
77
|
-
return '—';
|
|
78
|
-
const date = new Date(dateStr);
|
|
79
|
-
const now = Date.now();
|
|
80
|
-
const diffMs = now - date.getTime();
|
|
81
|
-
if (diffMs < 0)
|
|
82
|
-
return 'future';
|
|
83
|
-
const minutes = Math.floor(diffMs / 60000);
|
|
84
|
-
if (minutes < 1)
|
|
85
|
-
return 'just now';
|
|
86
|
-
if (minutes < 60)
|
|
87
|
-
return `${minutes}m ago`;
|
|
88
|
-
const hours = Math.floor(minutes / 60);
|
|
89
|
-
if (hours < 24)
|
|
90
|
-
return `${hours}h ago`;
|
|
91
|
-
const days = Math.floor(hours / 24);
|
|
92
|
-
if (days < 30)
|
|
93
|
-
return `${days}d ago`;
|
|
94
|
-
return date.toLocaleDateString();
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Print a success message.
|
|
98
|
-
*/
|
|
99
|
-
export function success(message) {
|
|
100
|
-
console.log(chalk.green(`✓ ${message}`));
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Print a warning message.
|
|
104
|
-
*/
|
|
105
|
-
export function warn(message) {
|
|
106
|
-
console.log(chalk.yellow(`⚠ ${message}`));
|
|
107
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seed-helpers.d.ts","sourceRoot":"","sources":["../../src/lib/seed-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAErE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAE3E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAEzE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,iBAAiB,EAAE,GAC3B,iBAAiB,EAAE,CAErB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,CAE7E;AAGD,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type PackageManager = 'pnpm' | 'yarn' | 'npm';
|
|
2
|
-
export interface PackageManagerInfo {
|
|
3
|
-
name: PackageManager;
|
|
4
|
-
installCommand: string;
|
|
5
|
-
execCommand: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Detects the package manager by checking for lock files in the
|
|
9
|
-
* current working directory and parent directories.
|
|
10
|
-
*/
|
|
11
|
-
export declare function detectPackageManager(): PackageManagerInfo;
|
|
12
|
-
//# sourceMappingURL=package-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/scaffold/package-manager.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,kBAAkB,CA0BzD"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
|
-
import * as path from 'node:path';
|
|
3
|
-
/**
|
|
4
|
-
* Detects the package manager by checking for lock files in the
|
|
5
|
-
* current working directory and parent directories.
|
|
6
|
-
*/
|
|
7
|
-
export function detectPackageManager() {
|
|
8
|
-
const lockFiles = [
|
|
9
|
-
{ file: 'pnpm-lock.yaml', manager: 'pnpm' },
|
|
10
|
-
{ file: 'yarn.lock', manager: 'yarn' },
|
|
11
|
-
{ file: 'package-lock.json', manager: 'npm' },
|
|
12
|
-
];
|
|
13
|
-
let dir = process.cwd();
|
|
14
|
-
// Walk up the directory tree looking for lock files
|
|
15
|
-
while (true) {
|
|
16
|
-
for (const { file, manager } of lockFiles) {
|
|
17
|
-
if (fs.existsSync(path.join(dir, file))) {
|
|
18
|
-
return getManagerInfo(manager);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const parentDir = path.dirname(dir);
|
|
22
|
-
if (parentDir === dir) {
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
dir = parentDir;
|
|
26
|
-
}
|
|
27
|
-
// Default to npm if no lock file found
|
|
28
|
-
return getManagerInfo('npm');
|
|
29
|
-
}
|
|
30
|
-
function getManagerInfo(manager) {
|
|
31
|
-
switch (manager) {
|
|
32
|
-
case 'pnpm':
|
|
33
|
-
return {
|
|
34
|
-
name: 'pnpm',
|
|
35
|
-
installCommand: 'pnpm install',
|
|
36
|
-
execCommand: 'pnpm dlx',
|
|
37
|
-
};
|
|
38
|
-
case 'yarn':
|
|
39
|
-
return {
|
|
40
|
-
name: 'yarn',
|
|
41
|
-
installCommand: 'yarn install',
|
|
42
|
-
execCommand: 'yarn dlx',
|
|
43
|
-
};
|
|
44
|
-
case 'npm':
|
|
45
|
-
return {
|
|
46
|
-
name: 'npm',
|
|
47
|
-
installCommand: 'npm install',
|
|
48
|
-
execCommand: 'npx',
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/scaffold/scaffold.ts"],"names":[],"mappings":"AAIA,KAAK,aAAa,GAAG,eAAe,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE7D,wBAAsB,QAAQ,CAC5B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
|