@technicity/data-service-generator 0.10.0-next.1 → 0.12.0-next.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.
|
@@ -249,7 +249,7 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
|
|
|
249
249
|
param1: ${findOnes
|
|
250
250
|
.map((findOne) => `{ ${findOne.name}: ${findOne.type}${findOne.nullable ? " | null" : ""} }`)
|
|
251
251
|
.join(" | ")},
|
|
252
|
-
param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, context?: TContext }
|
|
252
|
+
param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, skipCache?: boolean, context?: TContext }
|
|
253
253
|
): Promise<${x.typeReturnBaseName}> {
|
|
254
254
|
return this.runtime.resolve(
|
|
255
255
|
{
|
|
@@ -258,7 +258,8 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
|
|
|
258
258
|
args: { $where: param1 },
|
|
259
259
|
fields: param2?.fields,
|
|
260
260
|
artifacts,
|
|
261
|
-
context: param2?.context
|
|
261
|
+
context: param2?.context,
|
|
262
|
+
skipCache: param2?.skipCache
|
|
262
263
|
}
|
|
263
264
|
);
|
|
264
265
|
}`;
|
|
@@ -266,7 +267,7 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
|
|
|
266
267
|
if (x.kind === "getList") {
|
|
267
268
|
return `async ${x.methodName}(
|
|
268
269
|
param1: { $where?: ${x.typeWhereName}, $orderBy?: ${x.typeOrderByName}, $limit?: number },
|
|
269
|
-
param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, context?: TContext }
|
|
270
|
+
param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, skipCache?: boolean, context?: TContext }
|
|
270
271
|
): Promise<Array<${x.typeReturnBaseName}>> {
|
|
271
272
|
return this.runtime.resolve(
|
|
272
273
|
{
|
|
@@ -275,7 +276,8 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
|
|
|
275
276
|
args: param1,
|
|
276
277
|
fields: param2?.fields,
|
|
277
278
|
artifacts,
|
|
278
|
-
context: param2?.context
|
|
279
|
+
context: param2?.context,
|
|
280
|
+
skipCache: param2?.skipCache
|
|
279
281
|
}
|
|
280
282
|
);
|
|
281
283
|
}`;
|
|
@@ -283,7 +285,7 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
|
|
|
283
285
|
if (x.kind === "getListPaginated") {
|
|
284
286
|
return `async ${x.methodName}(
|
|
285
287
|
param1: { $where?: ${x.typeWhereName}, $orderBy?: ${x.typeOrderByName}, $paginate: Paginate },
|
|
286
|
-
param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, context?: TContext }
|
|
288
|
+
param2?: { fields?: ${x.typeFieldsName}, correlationId?: string, skipCache?: boolean, context?: TContext }
|
|
287
289
|
): Promise<ListPaginated<${x.typeReturnBaseName}>> {
|
|
288
290
|
return this.runtime.resolve(
|
|
289
291
|
{
|
|
@@ -292,7 +294,8 @@ async function getSDKSource(input, specialCaseUuidColumn, supplementClientOpts)
|
|
|
292
294
|
args: param1,
|
|
293
295
|
fields: param2?.fields,
|
|
294
296
|
artifacts,
|
|
295
|
-
context: param2?.context
|
|
297
|
+
context: param2?.context,
|
|
298
|
+
skipCache: param2?.skipCache
|
|
296
299
|
}
|
|
297
300
|
);
|
|
298
301
|
}`;
|
|
@@ -46,7 +46,7 @@ function _resolve(input, dbCall, formatQuery, beginTransaction, dialect, context
|
|
|
46
46
|
case "findUnique":
|
|
47
47
|
case "findMany":
|
|
48
48
|
case "findManyPaginated":
|
|
49
|
-
return cache ?
|
|
49
|
+
return cache && !input.skipCache ?
|
|
50
50
|
getCached(input, dbCall, formatQuery, dialect, cache) :
|
|
51
51
|
getData(input, dbCall, formatQuery, dialect);
|
|
52
52
|
case "create":
|
|
@@ -281,7 +281,7 @@ function ensureUuidSelect(input) {
|
|
|
281
281
|
const { scalarFields, relationFields } = artifacts[type];
|
|
282
282
|
if (!scalarFields.includes("uuid"))
|
|
283
283
|
return;
|
|
284
|
-
const fields = input.fields;
|
|
284
|
+
const fields = input.fields || [];
|
|
285
285
|
if (!fields.includes("uuid"))
|
|
286
286
|
fields.unshift("uuid");
|
|
287
287
|
for (const field of fields)
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@technicity/data-service-generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0-next.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
8
|
"scripts": {
|
|
9
9
|
"compile": "rm -rf dist && tsc",
|
|
10
|
+
"publish:next": "npm version preminor --preid next",
|
|
11
|
+
"preversion": "npm run compile",
|
|
12
|
+
"postversion": "npm publish",
|
|
10
13
|
"generate": "npm run compile && concurrently \"node ./test/mysql/generate.js\" \"node ./test/mysql8/generate.js\"",
|
|
11
14
|
"test": "npm run generate && mocha ./test/addNullFallbacks.test.js && mocha ./test/stringifyWhere.test.js && npm run test:sdk",
|
|
12
15
|
"test:prepare": "docker-compose down --volumes && docker-compose up -d --build",
|