@omnigraph/sql 0.0.0-stage → 0.1.0
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/CHANGELOG.md +7 -0
- package/dist/cjs/directives.js +59 -0
- package/dist/cjs/directives.js.map +7 -0
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/introspect/mysql.js +93 -0
- package/dist/cjs/introspect/postgres.js +106 -0
- package/dist/cjs/introspect/sqlite.js +60 -0
- package/dist/cjs/introspect/sqlite.js.map +7 -0
- package/dist/cjs/introspect/types.js +0 -0
- package/dist/cjs/introspect/types.js.map +7 -0
- package/dist/cjs/naming.js +54 -0
- package/dist/cjs/naming.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/schema.js +712 -0
- package/dist/cjs/schema.js.map +7 -0
- package/dist/cjs/type-map.js +40 -0
- package/dist/cjs/type-map.js.map +7 -0
- package/dist/esm/directives.js +55 -0
- package/dist/esm/directives.js.map +7 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/introspect/mysql.js +90 -0
- package/dist/esm/introspect/postgres.js +102 -0
- package/dist/esm/introspect/sqlite.js +57 -0
- package/dist/esm/introspect/sqlite.js.map +7 -0
- package/dist/esm/introspect/types.js +0 -0
- package/dist/esm/introspect/types.js.map +7 -0
- package/dist/esm/naming.js +50 -0
- package/dist/esm/naming.js.map +7 -0
- package/dist/esm/schema.js +707 -0
- package/dist/esm/schema.js.map +7 -0
- package/dist/esm/type-map.js +37 -0
- package/dist/esm/type-map.js.map +7 -0
- package/dist/package.json +54 -0
- package/dist/typings/directives.d.cts +17 -0
- package/dist/typings/directives.d.ts +17 -0
- package/dist/typings/index.d.cts +10 -0
- package/dist/typings/index.d.ts +10 -0
- package/dist/typings/introspect/mysql.d.cts +7 -0
- package/dist/typings/introspect/mysql.d.ts +7 -0
- package/dist/typings/introspect/postgres.d.cts +9 -0
- package/dist/typings/introspect/postgres.d.ts +9 -0
- package/dist/typings/introspect/sqlite.d.cts +8 -0
- package/dist/typings/introspect/sqlite.d.ts +8 -0
- package/dist/typings/introspect/types.d.cts +26 -0
- package/dist/typings/introspect/types.d.ts +26 -0
- package/dist/typings/naming.d.cts +17 -0
- package/dist/typings/naming.d.ts +17 -0
- package/dist/typings/schema.d.cts +39 -0
- package/dist/typings/schema.d.ts +39 -0
- package/dist/typings/type-map.d.cts +4 -0
- package/dist/typings/type-map.d.ts +4 -0
- package/package.json +61 -4
- package/src/directives.ts +67 -0
- package/src/index.ts +20 -0
- package/src/introspect/mysql.ts +110 -0
- package/src/introspect/postgres.ts +142 -0
- package/src/introspect/sqlite.ts +90 -0
- package/src/introspect/types.ts +31 -0
- package/src/naming.ts +67 -0
- package/src/schema.ts +834 -0
- package/src/type-map.ts +50 -0
- package/test/__snapshots__/sqlite-chinook.spec.ts.snap +328 -0
- package/test/sqlite-chinook.spec.ts +33 -0
- package/README.md +0 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransportDirective = exports.SqlRelationDirective = exports.SqlMutationDirective = exports.SqlQueryDirective = exports.SqlDirective = exports.SqlMutationKindEnum = exports.SqlQueryKindEnum = exports.SqlKindEnum = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
/**
|
|
6
|
+
* Single kind enum for `@sql` (reads, writes, and relation fields via `$this`).
|
|
7
|
+
*/
|
|
8
|
+
exports.SqlKindEnum = new graphql_1.GraphQLEnumType({
|
|
9
|
+
name: 'SqlKind',
|
|
10
|
+
values: {
|
|
11
|
+
ROW: { value: 'ROW' },
|
|
12
|
+
ROWS: { value: 'ROWS' },
|
|
13
|
+
CONNECTION: { value: 'CONNECTION' },
|
|
14
|
+
COUNT: { value: 'COUNT' },
|
|
15
|
+
INSERT: { value: 'INSERT' },
|
|
16
|
+
UPDATE: { value: 'UPDATE' },
|
|
17
|
+
DELETE: { value: 'DELETE' },
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
/** @deprecated use SqlKindEnum */
|
|
21
|
+
exports.SqlQueryKindEnum = exports.SqlKindEnum;
|
|
22
|
+
/** @deprecated use SqlKindEnum */
|
|
23
|
+
exports.SqlMutationKindEnum = exports.SqlKindEnum;
|
|
24
|
+
exports.SqlDirective = new graphql_1.GraphQLDirective({
|
|
25
|
+
name: 'sql',
|
|
26
|
+
// FIELD: Query/Mutation/relations. OBJECT: type-level entity resolver (`$this` keys),
|
|
27
|
+
// same pattern as Connectors type-level `@connect`.
|
|
28
|
+
locations: [graphql_1.DirectiveLocation.FIELD_DEFINITION, graphql_1.DirectiveLocation.OBJECT],
|
|
29
|
+
args: {
|
|
30
|
+
subgraph: { type: graphql_1.GraphQLString },
|
|
31
|
+
table: { type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString) },
|
|
32
|
+
kind: { type: new graphql_1.GraphQLNonNull(exports.SqlKindEnum) },
|
|
33
|
+
/** Equality / join predicates only (`AlbumId: $args.id`, `$this` binders). */
|
|
34
|
+
where: { type: graphql_1.GraphQLString },
|
|
35
|
+
/** Structured Filter input binder (`$args.filter`). */
|
|
36
|
+
filter: { type: graphql_1.GraphQLString },
|
|
37
|
+
/** Order-by binder (`$args.orderBy`). */
|
|
38
|
+
orderBy: { type: graphql_1.GraphQLString },
|
|
39
|
+
/** Limit binder (`$args.limit`). */
|
|
40
|
+
limit: { type: graphql_1.GraphQLString },
|
|
41
|
+
/** Offset binder (`$args.offset`). */
|
|
42
|
+
offset: { type: graphql_1.GraphQLString },
|
|
43
|
+
/** CONNECTION page size (`$args.first`). */
|
|
44
|
+
first: { type: graphql_1.GraphQLString },
|
|
45
|
+
/** CONNECTION cursor (`$args.after`). */
|
|
46
|
+
after: { type: graphql_1.GraphQLString },
|
|
47
|
+
/** Column values for INSERT / UPDATE (`Title: $args.input.title`). */
|
|
48
|
+
set: { type: graphql_1.GraphQLString },
|
|
49
|
+
selection: { type: graphql_1.GraphQLString },
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
/** @deprecated use SqlDirective */
|
|
53
|
+
exports.SqlQueryDirective = exports.SqlDirective;
|
|
54
|
+
/** @deprecated use SqlDirective */
|
|
55
|
+
exports.SqlMutationDirective = exports.SqlDirective;
|
|
56
|
+
/** @deprecated relations also use `@sql` */
|
|
57
|
+
exports.SqlRelationDirective = exports.SqlDirective;
|
|
58
|
+
var utils_1 = require("@graphql-mesh/utils");
|
|
59
|
+
Object.defineProperty(exports, "TransportDirective", { enumerable: true, get: function () { return utils_1.TransportDirective; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/directives.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n DirectiveLocation,\n GraphQLBoolean,\n GraphQLDirective,\n GraphQLEnumType,\n GraphQLNonNull,\n GraphQLString,\n} from 'graphql';\n\nexport const SqlQueryKindEnum = new GraphQLEnumType({\n name: 'SqlQueryKind',\n values: {\n ROW: { value: 'ROW' },\n ROWS: { value: 'ROWS' },\n CONNECTION: { value: 'CONNECTION' },\n COUNT: { value: 'COUNT' },\n },\n});\n\nexport const SqlMutationKindEnum = new GraphQLEnumType({\n name: 'SqlMutationKind',\n values: {\n INSERT: { value: 'INSERT' },\n UPDATE: { value: 'UPDATE' },\n DELETE: { value: 'DELETE' },\n },\n});\n\nexport const SqlQueryDirective = new GraphQLDirective({\n name: 'sql__query',\n locations: [DirectiveLocation.FIELD_DEFINITION],\n args: {\n subgraph: { type: GraphQLString },\n table: { type: new GraphQLNonNull(GraphQLString) },\n kind: { type: SqlQueryKindEnum, defaultValue: 'ROWS' },\n args: { type: GraphQLString },\n selection: { type: new GraphQLNonNull(GraphQLString) },\n entity: { type: GraphQLBoolean },\n },\n});\n\nexport const SqlMutationDirective = new GraphQLDirective({\n name: 'sql__mutation',\n locations: [DirectiveLocation.FIELD_DEFINITION],\n args: {\n subgraph: { type: GraphQLString },\n table: { type: new GraphQLNonNull(GraphQLString) },\n kind: { type: new GraphQLNonNull(SqlMutationKindEnum) },\n args: { type: new GraphQLNonNull(GraphQLString) },\n selection: { type: GraphQLString },\n },\n});\n\nexport const SqlRelationDirective = new GraphQLDirective({\n name: 'sql__relation',\n locations: [DirectiveLocation.FIELD_DEFINITION],\n args: {\n subgraph: { type: GraphQLString },\n table: { type: new GraphQLNonNull(GraphQLString) },\n kind: { type: SqlQueryKindEnum, defaultValue: 'ROW' },\n args: { type: new GraphQLNonNull(GraphQLString) },\n selection: { type: new GraphQLNonNull(GraphQLString) },\n },\n});\n\nexport { TransportDirective } from '@graphql-mesh/utils';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOO;AA0DP,mBAAmC;AAxD5B,MAAM,mBAAmB,IAAI,+BAAgB;AAAA,EAClD,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,KAAK,EAAE,OAAO,MAAM;AAAA,IACpB,MAAM,EAAE,OAAO,OAAO;AAAA,IACtB,YAAY,EAAE,OAAO,aAAa;AAAA,IAClC,OAAO,EAAE,OAAO,QAAQ;AAAA,EAC1B;AACF,CAAC;AAEM,MAAM,sBAAsB,IAAI,+BAAgB;AAAA,EACrD,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,QAAQ,EAAE,OAAO,SAAS;AAAA,IAC1B,QAAQ,EAAE,OAAO,SAAS;AAAA,IAC1B,QAAQ,EAAE,OAAO,SAAS;AAAA,EAC5B;AACF,CAAC;AAEM,MAAM,oBAAoB,IAAI,gCAAiB;AAAA,EACpD,MAAM;AAAA,EACN,WAAW,CAAC,iCAAkB,gBAAgB;AAAA,EAC9C,MAAM;AAAA,IACJ,UAAU,EAAE,MAAM,6BAAc;AAAA,IAChC,OAAO,EAAE,MAAM,IAAI,8BAAe,4BAAa,EAAE;AAAA,IACjD,MAAM,EAAE,MAAM,kBAAkB,cAAc,OAAO;AAAA,IACrD,MAAM,EAAE,MAAM,6BAAc;AAAA,IAC5B,WAAW,EAAE,MAAM,IAAI,8BAAe,4BAAa,EAAE;AAAA,IACrD,QAAQ,EAAE,MAAM,8BAAe;AAAA,EACjC;AACF,CAAC;AAEM,MAAM,uBAAuB,IAAI,gCAAiB;AAAA,EACvD,MAAM;AAAA,EACN,WAAW,CAAC,iCAAkB,gBAAgB;AAAA,EAC9C,MAAM;AAAA,IACJ,UAAU,EAAE,MAAM,6BAAc;AAAA,IAChC,OAAO,EAAE,MAAM,IAAI,8BAAe,4BAAa,EAAE;AAAA,IACjD,MAAM,EAAE,MAAM,IAAI,8BAAe,mBAAmB,EAAE;AAAA,IACtD,MAAM,EAAE,MAAM,IAAI,8BAAe,4BAAa,EAAE;AAAA,IAChD,WAAW,EAAE,MAAM,6BAAc;AAAA,EACnC;AACF,CAAC;AAEM,MAAM,uBAAuB,IAAI,gCAAiB;AAAA,EACvD,MAAM;AAAA,EACN,WAAW,CAAC,iCAAkB,gBAAgB;AAAA,EAC9C,MAAM;AAAA,IACJ,UAAU,EAAE,MAAM,6BAAc;AAAA,IAChC,OAAO,EAAE,MAAM,IAAI,8BAAe,4BAAa,EAAE;AAAA,IACjD,MAAM,EAAE,MAAM,kBAAkB,cAAc,MAAM;AAAA,IACpD,MAAM,EAAE,MAAM,IAAI,8BAAe,4BAAa,EAAE;AAAA,IAChD,WAAW,EAAE,MAAM,IAAI,8BAAe,4BAAa,EAAE;AAAA,EACvD;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapMysqlPoolAsSqlClient = exports.getSqlExecutor = void 0;
|
|
4
|
+
exports.loadSqlSubgraph = loadSqlSubgraph;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const cross_helpers_1 = require("@graphql-mesh/cross-helpers");
|
|
7
|
+
const schema_js_1 = require("./schema.js");
|
|
8
|
+
tslib_1.__exportStar(require("./directives.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./naming.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./schema.js"), exports);
|
|
11
|
+
function loadSqlSubgraph(name, opts) {
|
|
12
|
+
return () => ({
|
|
13
|
+
name,
|
|
14
|
+
schema$: (0, schema_js_1.loadGraphQLSchemaFromSql)(name, {
|
|
15
|
+
...opts,
|
|
16
|
+
cwd: opts.cwd || cross_helpers_1.process.cwd(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
var transport_sql_1 = require("@graphql-mesh/transport-sql");
|
|
21
|
+
Object.defineProperty(exports, "getSqlExecutor", { enumerable: true, get: function () { return transport_sql_1.getSqlExecutor; } });
|
|
22
|
+
Object.defineProperty(exports, "wrapMysqlPoolAsSqlClient", { enumerable: true, get: function () { return transport_sql_1.wrapMysqlPoolAsSqlClient; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { process as meshProcess } from '@graphql-mesh/cross-helpers';\nimport type { LoadSqlSubgraphOpts } from './schema.js';\nimport { loadGraphQLSchemaFromSql } from './schema.js';\n\nexport * from './directives.js';\nexport * from './naming.js';\nexport * from './schema.js';\nexport type * from './introspect/types.js';\n\nexport function loadSqlSubgraph(name: string, opts: LoadSqlSubgraphOpts) {\n return () => ({\n name,\n schema$: loadGraphQLSchemaFromSql(name, {\n ...opts,\n cwd: opts.cwd || meshProcess.cwd(),\n }),\n });\n}\n\nexport { getSqlExecutor } from '@graphql-mesh/transport-sql';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAuC;AAEvC,oBAAyC;AAEzC,0BAAc,4BAJd;AAKA,0BAAc,wBALd;AAMA,0BAAc,wBANd;AAmBA,2BAA+B;AAVxB,SAAS,gBAAgB,MAAc,MAA2B;AACvE,SAAO,OAAO;AAAA,IACZ;AAAA,IACA,aAAS,wCAAyB,MAAM;AAAA,MACtC,GAAG;AAAA,MACH,KAAK,KAAK,OAAO,qBAAAA,QAAY,IAAI;AAAA,IACnC,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": ["meshProcess"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.introspectMysql = introspectMysql;
|
|
4
|
+
const promise_1 = require("mysql2/promise");
|
|
5
|
+
const transport_sql_1 = require("@graphql-mesh/transport-sql");
|
|
6
|
+
async function introspectMysql(opts) {
|
|
7
|
+
const parsed = (0, transport_sql_1.parseSqlUri)(opts.connectionString);
|
|
8
|
+
if (parsed.adapter !== 'mysql' || !parsed.database) {
|
|
9
|
+
throw new Error('MySQL introspection requires a mysql://…/database URI');
|
|
10
|
+
}
|
|
11
|
+
const pool = (0, promise_1.createPool)({
|
|
12
|
+
host: parsed.host,
|
|
13
|
+
port: parsed.port,
|
|
14
|
+
user: parsed.user,
|
|
15
|
+
password: parsed.password,
|
|
16
|
+
database: parsed.database,
|
|
17
|
+
ssl: parsed.ssl ? { rejectUnauthorized: false } : undefined,
|
|
18
|
+
});
|
|
19
|
+
try {
|
|
20
|
+
const database = parsed.database;
|
|
21
|
+
const [tableRows] = await pool.query(`SELECT TABLE_NAME AS name
|
|
22
|
+
FROM information_schema.TABLES
|
|
23
|
+
WHERE TABLE_SCHEMA = ? AND TABLE_TYPE = 'BASE TABLE'
|
|
24
|
+
ORDER BY TABLE_NAME`, [database]);
|
|
25
|
+
let tableNames = tableRows.map(r => String(r.name));
|
|
26
|
+
if (opts.includeTables?.length) {
|
|
27
|
+
const allow = new Set(opts.includeTables);
|
|
28
|
+
tableNames = tableNames.filter(n => allow.has(n));
|
|
29
|
+
}
|
|
30
|
+
if (opts.excludeTables?.length) {
|
|
31
|
+
const deny = new Set(opts.excludeTables);
|
|
32
|
+
tableNames = tableNames.filter(n => !deny.has(n));
|
|
33
|
+
}
|
|
34
|
+
const tables = [];
|
|
35
|
+
for (const name of tableNames) {
|
|
36
|
+
const [colRows] = await pool.query(`SELECT
|
|
37
|
+
COLUMN_NAME AS name,
|
|
38
|
+
DATA_TYPE AS dataType,
|
|
39
|
+
COLUMN_TYPE AS columnType,
|
|
40
|
+
IS_NULLABLE AS isNullable,
|
|
41
|
+
COLUMN_KEY AS columnKey,
|
|
42
|
+
EXTRA AS extra
|
|
43
|
+
FROM information_schema.COLUMNS
|
|
44
|
+
WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?
|
|
45
|
+
ORDER BY ORDINAL_POSITION`, [database, name]);
|
|
46
|
+
const columns = colRows.map(c => ({
|
|
47
|
+
name: String(c.name),
|
|
48
|
+
dataType: String(c.columnType || c.dataType || 'TEXT'),
|
|
49
|
+
notNull: String(c.isNullable).toUpperCase() === 'NO',
|
|
50
|
+
primaryKey: String(c.columnKey).toUpperCase() === 'PRI',
|
|
51
|
+
autoIncrement: String(c.extra || '')
|
|
52
|
+
.toLowerCase()
|
|
53
|
+
.includes('auto_increment'),
|
|
54
|
+
}));
|
|
55
|
+
const [fkRows] = await pool.query(`SELECT
|
|
56
|
+
CONSTRAINT_NAME AS constraintName,
|
|
57
|
+
COLUMN_NAME AS columnName,
|
|
58
|
+
REFERENCED_TABLE_NAME AS refTable,
|
|
59
|
+
REFERENCED_COLUMN_NAME AS refColumn,
|
|
60
|
+
ORDINAL_POSITION AS seq
|
|
61
|
+
FROM information_schema.KEY_COLUMN_USAGE
|
|
62
|
+
WHERE TABLE_SCHEMA = ?
|
|
63
|
+
AND TABLE_NAME = ?
|
|
64
|
+
AND REFERENCED_TABLE_NAME IS NOT NULL
|
|
65
|
+
ORDER BY CONSTRAINT_NAME, ORDINAL_POSITION`, [database, name]);
|
|
66
|
+
const fkByName = new Map();
|
|
67
|
+
for (const fk of fkRows) {
|
|
68
|
+
const constraintName = String(fk.constraintName);
|
|
69
|
+
let meta = fkByName.get(constraintName);
|
|
70
|
+
if (!meta) {
|
|
71
|
+
meta = {
|
|
72
|
+
columns: [],
|
|
73
|
+
refTable: String(fk.refTable),
|
|
74
|
+
refColumns: [],
|
|
75
|
+
};
|
|
76
|
+
fkByName.set(constraintName, meta);
|
|
77
|
+
}
|
|
78
|
+
const idx = Number(fk.seq) - 1;
|
|
79
|
+
meta.columns[idx] = String(fk.columnName);
|
|
80
|
+
meta.refColumns[idx] = String(fk.refColumn);
|
|
81
|
+
}
|
|
82
|
+
tables.push({
|
|
83
|
+
name,
|
|
84
|
+
columns,
|
|
85
|
+
foreignKeys: [...fkByName.values()],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return { adapter: 'mysql', tables };
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
await pool.end();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.introspectPostgres = introspectPostgres;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pg_1 = tslib_1.__importDefault(require("pg"));
|
|
6
|
+
const transport_sql_1 = require("@graphql-mesh/transport-sql");
|
|
7
|
+
async function introspectPostgres(opts) {
|
|
8
|
+
const parsed = (0, transport_sql_1.parseSqlUri)(opts.connectionString);
|
|
9
|
+
if (parsed.adapter !== 'postgres') {
|
|
10
|
+
throw new Error('Postgres introspection requires a postgres(ql)://… URI');
|
|
11
|
+
}
|
|
12
|
+
const schemaName = opts.schema || 'public';
|
|
13
|
+
const pool = new pg_1.default.Pool({
|
|
14
|
+
connectionString: opts.connectionString,
|
|
15
|
+
});
|
|
16
|
+
try {
|
|
17
|
+
const tableRes = await pool.query(`SELECT table_name AS name
|
|
18
|
+
FROM information_schema.tables
|
|
19
|
+
WHERE table_schema = $1 AND table_type = 'BASE TABLE'
|
|
20
|
+
ORDER BY table_name`, [schemaName]);
|
|
21
|
+
let tableNames = tableRes.rows.map(r => String(r.name));
|
|
22
|
+
if (opts.includeTables?.length) {
|
|
23
|
+
const allow = new Set(opts.includeTables);
|
|
24
|
+
tableNames = tableNames.filter(n => allow.has(n));
|
|
25
|
+
}
|
|
26
|
+
if (opts.excludeTables?.length) {
|
|
27
|
+
const deny = new Set(opts.excludeTables);
|
|
28
|
+
tableNames = tableNames.filter(n => !deny.has(n));
|
|
29
|
+
}
|
|
30
|
+
const tables = [];
|
|
31
|
+
for (const name of tableNames) {
|
|
32
|
+
const colRes = await pool.query(`SELECT
|
|
33
|
+
column_name AS name,
|
|
34
|
+
data_type,
|
|
35
|
+
udt_name,
|
|
36
|
+
is_nullable,
|
|
37
|
+
column_default
|
|
38
|
+
FROM information_schema.columns
|
|
39
|
+
WHERE table_schema = $1 AND table_name = $2
|
|
40
|
+
ORDER BY ordinal_position`, [schemaName, name]);
|
|
41
|
+
const pkRes = await pool.query(`SELECT kcu.column_name
|
|
42
|
+
FROM information_schema.table_constraints tc
|
|
43
|
+
JOIN information_schema.key_column_usage kcu
|
|
44
|
+
ON tc.constraint_name = kcu.constraint_name
|
|
45
|
+
AND tc.table_schema = kcu.table_schema
|
|
46
|
+
WHERE tc.table_schema = $1
|
|
47
|
+
AND tc.table_name = $2
|
|
48
|
+
AND tc.constraint_type = 'PRIMARY KEY'
|
|
49
|
+
ORDER BY kcu.ordinal_position`, [schemaName, name]);
|
|
50
|
+
const pkCols = new Set(pkRes.rows.map(r => String(r.column_name)));
|
|
51
|
+
const columns = colRes.rows.map(c => {
|
|
52
|
+
const dataType = String(c.udt_name || c.data_type || 'text');
|
|
53
|
+
const def = c.column_default != null ? String(c.column_default) : '';
|
|
54
|
+
return {
|
|
55
|
+
name: String(c.name),
|
|
56
|
+
dataType,
|
|
57
|
+
notNull: String(c.is_nullable).toUpperCase() === 'NO',
|
|
58
|
+
primaryKey: pkCols.has(String(c.name)),
|
|
59
|
+
autoIncrement: /nextval\(/i.test(def) || /identity/i.test(def),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
const fkRes = await pool.query(`SELECT
|
|
63
|
+
tc.constraint_name,
|
|
64
|
+
kcu.column_name,
|
|
65
|
+
ccu.table_name AS foreign_table_name,
|
|
66
|
+
ccu.column_name AS foreign_column_name,
|
|
67
|
+
kcu.ordinal_position
|
|
68
|
+
FROM information_schema.table_constraints AS tc
|
|
69
|
+
JOIN information_schema.key_column_usage AS kcu
|
|
70
|
+
ON tc.constraint_name = kcu.constraint_name
|
|
71
|
+
AND tc.table_schema = kcu.table_schema
|
|
72
|
+
JOIN information_schema.constraint_column_usage AS ccu
|
|
73
|
+
ON ccu.constraint_name = tc.constraint_name
|
|
74
|
+
AND ccu.table_schema = tc.table_schema
|
|
75
|
+
WHERE tc.constraint_type = 'FOREIGN KEY'
|
|
76
|
+
AND tc.table_schema = $1
|
|
77
|
+
AND tc.table_name = $2
|
|
78
|
+
ORDER BY tc.constraint_name, kcu.ordinal_position`, [schemaName, name]);
|
|
79
|
+
const fkByName = new Map();
|
|
80
|
+
for (const fk of fkRes.rows) {
|
|
81
|
+
const constraintName = String(fk.constraint_name);
|
|
82
|
+
let meta = fkByName.get(constraintName);
|
|
83
|
+
if (!meta) {
|
|
84
|
+
meta = {
|
|
85
|
+
columns: [],
|
|
86
|
+
refTable: String(fk.foreign_table_name),
|
|
87
|
+
refColumns: [],
|
|
88
|
+
};
|
|
89
|
+
fkByName.set(constraintName, meta);
|
|
90
|
+
}
|
|
91
|
+
const idx = Number(fk.ordinal_position) - 1;
|
|
92
|
+
meta.columns[idx] = String(fk.column_name);
|
|
93
|
+
meta.refColumns[idx] = String(fk.foreign_column_name);
|
|
94
|
+
}
|
|
95
|
+
tables.push({
|
|
96
|
+
name,
|
|
97
|
+
columns,
|
|
98
|
+
foreignKeys: [...fkByName.values()],
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return { adapter: 'postgres', tables };
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
await pool.end();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.introspectSqlite = introspectSqlite;
|
|
4
|
+
const node_sqlite_1 = require("node:sqlite");
|
|
5
|
+
const transport_sql_1 = require("@graphql-mesh/transport-sql");
|
|
6
|
+
function introspectSqlite(opts) {
|
|
7
|
+
const dbPath = (0, transport_sql_1.resolveSqlitePath)(opts.db.startsWith('file:') ? opts.db : `file:${opts.db}`, opts.cwd);
|
|
8
|
+
const db = new node_sqlite_1.DatabaseSync(dbPath);
|
|
9
|
+
try {
|
|
10
|
+
const tableRows = db
|
|
11
|
+
.prepare(`SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' ORDER BY name`)
|
|
12
|
+
.all();
|
|
13
|
+
let tableNames = tableRows.map(r => r.name);
|
|
14
|
+
if (opts.includeTables?.length) {
|
|
15
|
+
const allow = new Set(opts.includeTables);
|
|
16
|
+
tableNames = tableNames.filter(n => allow.has(n));
|
|
17
|
+
}
|
|
18
|
+
if (opts.excludeTables?.length) {
|
|
19
|
+
const deny = new Set(opts.excludeTables);
|
|
20
|
+
tableNames = tableNames.filter(n => !deny.has(n));
|
|
21
|
+
}
|
|
22
|
+
const tables = tableNames.map(name => {
|
|
23
|
+
const cols = db.prepare(`PRAGMA table_info(${quote(name)})`).all();
|
|
24
|
+
const columns = cols.map(c => ({
|
|
25
|
+
name: c.name,
|
|
26
|
+
dataType: c.type || 'TEXT',
|
|
27
|
+
notNull: Boolean(c.notnull) || Boolean(c.pk),
|
|
28
|
+
primaryKey: Boolean(c.pk),
|
|
29
|
+
autoIncrement: false,
|
|
30
|
+
}));
|
|
31
|
+
const solePk = columns.filter(c => c.primaryKey);
|
|
32
|
+
if (solePk.length === 1 && /int/i.test(solePk[0].dataType)) {
|
|
33
|
+
solePk[0].autoIncrement = true;
|
|
34
|
+
}
|
|
35
|
+
const fkRows = db.prepare(`PRAGMA foreign_key_list(${quote(name)})`).all();
|
|
36
|
+
const fkById = new Map();
|
|
37
|
+
for (const fk of fkRows) {
|
|
38
|
+
let meta = fkById.get(fk.id);
|
|
39
|
+
if (!meta) {
|
|
40
|
+
meta = { columns: [], refTable: fk.table, refColumns: [] };
|
|
41
|
+
fkById.set(fk.id, meta);
|
|
42
|
+
}
|
|
43
|
+
meta.columns[fk.seq] = fk.from;
|
|
44
|
+
meta.refColumns[fk.seq] = fk.to;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
name,
|
|
48
|
+
columns,
|
|
49
|
+
foreignKeys: [...fkById.values()],
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
return { adapter: 'sqlite', tables };
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
db.close();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function quote(name) {
|
|
59
|
+
return `"${name.replace(/"/g, '""')}"`;
|
|
60
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/introspect/sqlite.ts"],
|
|
4
|
+
"sourcesContent": ["import { DatabaseSync } from 'node:sqlite';\nimport { resolveSqlitePath } from '@graphql-mesh/transport-sql';\nimport type { SqlColumnMeta, SqlForeignKeyMeta, SqlSchemaMeta, SqlTableMeta } from './types.js';\n\nexport interface IntrospectSqliteOpts {\n db: string;\n cwd?: string;\n includeTables?: string[];\n excludeTables?: string[];\n}\n\nexport function introspectSqlite(opts: IntrospectSqliteOpts): SqlSchemaMeta {\n const dbPath = resolveSqlitePath(opts.db.startsWith('file:') ? opts.db : `file:${opts.db}`, opts.cwd);\n const db = new DatabaseSync(dbPath);\n try {\n const tableRows = db\n .prepare(\n `SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' ORDER BY name`,\n )\n .all() as { name: string }[];\n\n let tableNames = tableRows.map(r => r.name);\n if (opts.includeTables?.length) {\n const allow = new Set(opts.includeTables);\n tableNames = tableNames.filter(n => allow.has(n));\n }\n if (opts.excludeTables?.length) {\n const deny = new Set(opts.excludeTables);\n tableNames = tableNames.filter(n => !deny.has(n));\n }\n\n const tables: SqlTableMeta[] = tableNames.map(name => {\n const cols = db.prepare(`PRAGMA table_info(${quote(name)})`).all() as {\n cid: number;\n name: string;\n type: string;\n notnull: number;\n dflt_value: unknown;\n pk: number;\n }[];\n const columns: SqlColumnMeta[] = cols.map(c => ({\n name: c.name,\n dataType: c.type || 'TEXT',\n notNull: Boolean(c.notnull) || Boolean(c.pk),\n primaryKey: Boolean(c.pk),\n autoIncrement: false,\n }));\n\n // Detect INTEGER PRIMARY KEY autoincrement heuristic\n const solePk = columns.filter(c => c.primaryKey);\n if (solePk.length === 1 && /int/i.test(solePk[0].dataType)) {\n solePk[0].autoIncrement = true;\n }\n\n const fkRows = db.prepare(`PRAGMA foreign_key_list(${quote(name)})`).all() as {\n id: number;\n seq: number;\n table: string;\n from: string;\n to: string;\n }[];\n const fkById = new Map<number, SqlForeignKeyMeta>();\n for (const fk of fkRows) {\n let meta = fkById.get(fk.id);\n if (!meta) {\n meta = { columns: [], refTable: fk.table, refColumns: [] };\n fkById.set(fk.id, meta);\n }\n meta.columns[fk.seq] = fk.from;\n meta.refColumns[fk.seq] = fk.to;\n }\n\n return {\n name,\n columns,\n foreignKeys: [...fkById.values()],\n };\n });\n\n return { dialect: 'sqlite', tables };\n } finally {\n db.close();\n }\n}\n\nfunction quote(name: string): string {\n return `\"${name.replace(/\"/g, '\"\"')}\"`;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA6B;AAC7B,2BAAkC;AAU3B,SAAS,iBAAiB,MAA2C;AAC1E,QAAM,aAAS,wCAAkB,KAAK,GAAG,WAAW,OAAO,IAAI,KAAK,KAAK,QAAQ,KAAK,EAAE,IAAI,KAAK,GAAG;AACpG,QAAM,KAAK,IAAI,gCAAa,MAAM;AAClC,MAAI;AACF,UAAM,YAAY,GACf;AAAA,MACC;AAAA,IACF,EACC,IAAI;AAEP,QAAI,aAAa,UAAU,IAAI,OAAK,EAAE,IAAI;AAC1C,QAAI,KAAK,eAAe,QAAQ;AAC9B,YAAM,QAAQ,IAAI,IAAI,KAAK,aAAa;AACxC,mBAAa,WAAW,OAAO,OAAK,MAAM,IAAI,CAAC,CAAC;AAAA,IAClD;AACA,QAAI,KAAK,eAAe,QAAQ;AAC9B,YAAM,OAAO,IAAI,IAAI,KAAK,aAAa;AACvC,mBAAa,WAAW,OAAO,OAAK,CAAC,KAAK,IAAI,CAAC,CAAC;AAAA,IAClD;AAEA,UAAM,SAAyB,WAAW,IAAI,UAAQ;AACpD,YAAM,OAAO,GAAG,QAAQ,qBAAqB,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI;AAQjE,YAAM,UAA2B,KAAK,IAAI,QAAM;AAAA,QAC9C,MAAM,EAAE;AAAA,QACR,UAAU,EAAE,QAAQ;AAAA,QACpB,SAAS,QAAQ,EAAE,OAAO,KAAK,QAAQ,EAAE,EAAE;AAAA,QAC3C,YAAY,QAAQ,EAAE,EAAE;AAAA,QACxB,eAAe;AAAA,MACjB,EAAE;AAGF,YAAM,SAAS,QAAQ,OAAO,OAAK,EAAE,UAAU;AAC/C,UAAI,OAAO,WAAW,KAAK,OAAO,KAAK,OAAO,CAAC,EAAE,QAAQ,GAAG;AAC1D,eAAO,CAAC,EAAE,gBAAgB;AAAA,MAC5B;AAEA,YAAM,SAAS,GAAG,QAAQ,2BAA2B,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI;AAOzE,YAAM,SAAS,oBAAI,IAA+B;AAClD,iBAAW,MAAM,QAAQ;AACvB,YAAI,OAAO,OAAO,IAAI,GAAG,EAAE;AAC3B,YAAI,CAAC,MAAM;AACT,iBAAO,EAAE,SAAS,CAAC,GAAG,UAAU,GAAG,OAAO,YAAY,CAAC,EAAE;AACzD,iBAAO,IAAI,GAAG,IAAI,IAAI;AAAA,QACxB;AACA,aAAK,QAAQ,GAAG,GAAG,IAAI,GAAG;AAC1B,aAAK,WAAW,GAAG,GAAG,IAAI,GAAG;AAAA,MAC/B;AAEA,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA,aAAa,CAAC,GAAG,OAAO,OAAO,CAAC;AAAA,MAClC;AAAA,IACF,CAAC;AAED,WAAO,EAAE,SAAS,UAAU,OAAO;AAAA,EACrC,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;AAEA,SAAS,MAAM,MAAsB;AACnC,SAAO,IAAI,KAAK,QAAQ,MAAM,IAAI,CAAC;AACrC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/introspect/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { SqlDialect } from '@graphql-mesh/transport-sql';\n\nexport type { SqlDialect };\n\nexport interface SqlColumnMeta {\n name: string;\n dataType: string;\n notNull: boolean;\n primaryKey: boolean;\n autoIncrement?: boolean;\n}\n\nexport interface SqlForeignKeyMeta {\n /** Local table column(s) */\n columns: string[];\n /** Referenced table */\n refTable: string;\n /** Referenced column(s) */\n refColumns: string[];\n}\n\nexport interface SqlTableMeta {\n name: string;\n columns: SqlColumnMeta[];\n foreignKeys: SqlForeignKeyMeta[];\n}\n\nexport interface SqlSchemaMeta {\n dialect: SqlDialect;\n tables: SqlTableMeta[];\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDefaultNaming = createDefaultNaming;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const change_case_1 = require("change-case");
|
|
6
|
+
const pluralize_1 = tslib_1.__importDefault(require("pluralize"));
|
|
7
|
+
function createDefaultNaming() {
|
|
8
|
+
return {
|
|
9
|
+
typeName(table) {
|
|
10
|
+
return (0, change_case_1.pascalCase)(pluralize_1.default.singular(table));
|
|
11
|
+
},
|
|
12
|
+
fieldName(column) {
|
|
13
|
+
return (0, change_case_1.camelCase)(column);
|
|
14
|
+
},
|
|
15
|
+
pluralField(typeName) {
|
|
16
|
+
return (0, change_case_1.camelCase)(pluralize_1.default.plural(typeName));
|
|
17
|
+
},
|
|
18
|
+
singularField(typeName) {
|
|
19
|
+
return (0, change_case_1.camelCase)(typeName);
|
|
20
|
+
},
|
|
21
|
+
connectionField(typeName) {
|
|
22
|
+
return `all${(0, change_case_1.pascalCase)(pluralize_1.default.plural(typeName))}`;
|
|
23
|
+
},
|
|
24
|
+
countField(typeName) {
|
|
25
|
+
return `${(0, change_case_1.camelCase)(pluralize_1.default.plural(typeName))}Count`;
|
|
26
|
+
},
|
|
27
|
+
orderByEnum(typeName) {
|
|
28
|
+
return `${typeName}OrderBy`;
|
|
29
|
+
},
|
|
30
|
+
filterInput(typeName) {
|
|
31
|
+
return `${typeName}Filter`;
|
|
32
|
+
},
|
|
33
|
+
createInput(typeName) {
|
|
34
|
+
return `Create${typeName}Input`;
|
|
35
|
+
},
|
|
36
|
+
updateInput(typeName) {
|
|
37
|
+
return `Update${typeName}Input`;
|
|
38
|
+
},
|
|
39
|
+
payloadType(typeName) {
|
|
40
|
+
return `${typeName}Payload`;
|
|
41
|
+
},
|
|
42
|
+
deletePayloadType(typeName) {
|
|
43
|
+
return `Delete${typeName}Payload`;
|
|
44
|
+
},
|
|
45
|
+
orderValue(fieldName, dir) {
|
|
46
|
+
return `${(0, change_case_1.constantCase)(fieldName)}_${dir}`;
|
|
47
|
+
},
|
|
48
|
+
pkFieldName(column, isSolePk) {
|
|
49
|
+
if (isSolePk)
|
|
50
|
+
return 'id';
|
|
51
|
+
return (0, change_case_1.camelCase)(column);
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/naming.ts"],
|
|
4
|
+
"sourcesContent": ["import { camelCase, constantCase, pascalCase } from 'change-case';\nimport pluralize from 'pluralize';\n\nexport interface SqlNaming {\n typeName(table: string): string;\n fieldName(column: string): string;\n pluralField(typeName: string): string;\n singularField(typeName: string): string;\n connectionField(typeName: string): string;\n countField(typeName: string): string;\n orderByEnum(typeName: string): string;\n filterInput(typeName: string): string;\n createInput(typeName: string): string;\n updateInput(typeName: string): string;\n payloadType(typeName: string): string;\n deletePayloadType(typeName: string): string;\n orderValue(fieldName: string, dir: 'ASC' | 'DESC'): string;\n pkFieldName(column: string, isSolePk: boolean): string;\n}\n\nexport function createDefaultNaming(): SqlNaming {\n return {\n typeName(table) {\n return pascalCase(pluralize.singular(table));\n },\n fieldName(column) {\n return camelCase(column);\n },\n pluralField(typeName) {\n return camelCase(pluralize.plural(typeName));\n },\n singularField(typeName) {\n return camelCase(typeName);\n },\n connectionField(typeName) {\n return `all${pascalCase(pluralize.plural(typeName))}`;\n },\n countField(typeName) {\n return `${camelCase(pluralize.plural(typeName))}Count`;\n },\n orderByEnum(typeName) {\n return `${typeName}OrderBy`;\n },\n filterInput(typeName) {\n return `${typeName}Filter`;\n },\n createInput(typeName) {\n return `Create${typeName}Input`;\n },\n updateInput(typeName) {\n return `Update${typeName}Input`;\n },\n payloadType(typeName) {\n return `${typeName}Payload`;\n },\n deletePayloadType(typeName) {\n return `Delete${typeName}Payload`;\n },\n orderValue(fieldName, dir) {\n return `${constantCase(fieldName)}_${dir}`;\n },\n pkFieldName(column, isSolePk) {\n if (isSolePk) return 'id';\n return camelCase(column);\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAoD;AACpD,uBAAsB;AAmBf,SAAS,sBAAiC;AAC/C,SAAO;AAAA,IACL,SAAS,OAAO;AACd,iBAAO,+BAAW,iBAAAA,QAAU,SAAS,KAAK,CAAC;AAAA,IAC7C;AAAA,IACA,UAAU,QAAQ;AAChB,iBAAO,8BAAU,MAAM;AAAA,IACzB;AAAA,IACA,YAAY,UAAU;AACpB,iBAAO,8BAAU,iBAAAA,QAAU,OAAO,QAAQ,CAAC;AAAA,IAC7C;AAAA,IACA,cAAc,UAAU;AACtB,iBAAO,8BAAU,QAAQ;AAAA,IAC3B;AAAA,IACA,gBAAgB,UAAU;AACxB,aAAO,UAAM,+BAAW,iBAAAA,QAAU,OAAO,QAAQ,CAAC,CAAC;AAAA,IACrD;AAAA,IACA,WAAW,UAAU;AACnB,aAAO,OAAG,8BAAU,iBAAAA,QAAU,OAAO,QAAQ,CAAC,CAAC;AAAA,IACjD;AAAA,IACA,YAAY,UAAU;AACpB,aAAO,GAAG,QAAQ;AAAA,IACpB;AAAA,IACA,YAAY,UAAU;AACpB,aAAO,GAAG,QAAQ;AAAA,IACpB;AAAA,IACA,YAAY,UAAU;AACpB,aAAO,SAAS,QAAQ;AAAA,IAC1B;AAAA,IACA,YAAY,UAAU;AACpB,aAAO,SAAS,QAAQ;AAAA,IAC1B;AAAA,IACA,YAAY,UAAU;AACpB,aAAO,GAAG,QAAQ;AAAA,IACpB;AAAA,IACA,kBAAkB,UAAU;AAC1B,aAAO,SAAS,QAAQ;AAAA,IAC1B;AAAA,IACA,WAAW,WAAW,KAAK;AACzB,aAAO,OAAG,iCAAa,SAAS,CAAC,IAAI,GAAG;AAAA,IAC1C;AAAA,IACA,YAAY,QAAQ,UAAU;AAC5B,UAAI,SAAU,QAAO;AACrB,iBAAO,8BAAU,MAAM;AAAA,IACzB;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["pluralize"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|