@voxgig/create-sdkgen 0.25.0 → 0.26.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/package.json
CHANGED
|
@@ -110,9 +110,9 @@ function makeEntityTestData(_model: Model, entity: ModelEntity) {
|
|
|
110
110
|
// here made the test data a second copy of the model's own copy of them.
|
|
111
111
|
data.requests = {}
|
|
112
112
|
for (const op of Object.values(entity.op || {}) as any[]) for (const point of op.points || []) {
|
|
113
|
-
if (point.
|
|
114
|
-
provenance: 'operation-contract', version: point.
|
|
115
|
-
source: point.
|
|
113
|
+
if (point.co) data.requests[point.co.id] = {
|
|
114
|
+
provenance: 'operation-contract', version: point.co.version,
|
|
115
|
+
source: point.co.source,
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
return data
|
|
@@ -135,17 +135,17 @@ function collectEntityPathParams(entity: any): [string, string][] {
|
|
|
135
135
|
const op = ops[opname]
|
|
136
136
|
const points = op?.points || []
|
|
137
137
|
for (const point of points) {
|
|
138
|
-
const params = point?.
|
|
139
|
-
const renameMap: Record<string, string> = point?.
|
|
138
|
+
const params = point?.g?.params || []
|
|
139
|
+
const renameMap: Record<string, string> = point?.r?.param || {}
|
|
140
140
|
for (const param of params) {
|
|
141
|
-
if (!param?.
|
|
142
|
-
if ('id' === param.
|
|
141
|
+
if (!param?.n) continue
|
|
142
|
+
if ('id' === param.n) continue
|
|
143
143
|
// Skip params that ARE the entity's own id under URL rename.
|
|
144
|
-
const camel = lcf(camelify(param.
|
|
144
|
+
const camel = lcf(camelify(param.n))
|
|
145
145
|
if ('id' === renameMap[camel]) continue
|
|
146
|
-
if (out.has(param.
|
|
147
|
-
const baseName = param.
|
|
148
|
-
out.set(param.
|
|
146
|
+
if (out.has(param.n)) continue
|
|
147
|
+
const baseName = param.n.replace(/_id$/, '')
|
|
148
|
+
out.set(param.n, baseName.toUpperCase() + '01')
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -157,15 +157,15 @@ function makeEntityTestFields(entity: ModelEntity, start: number, entdata: Recor
|
|
|
157
157
|
entdata = entdata ?? {}
|
|
158
158
|
let num = (start * size(entity.fields) * 10)
|
|
159
159
|
each(entity.fields, (field: ModelField) => {
|
|
160
|
-
entdata[field.
|
|
161
|
-
field.
|
|
162
|
-
field.
|
|
163
|
-
['`$NUMBER`', '`$INTEGER`'].includes(field.
|
|
164
|
-
'`$BOOLEAN`' === field.
|
|
165
|
-
'`$OBJECT`' === field.
|
|
166
|
-
'`$MAP`' === field.
|
|
167
|
-
'`$ARRAY`' === field.
|
|
168
|
-
'`$LIST`' === field.
|
|
160
|
+
entdata[field.n] =
|
|
161
|
+
field.n.endsWith('_id') ?
|
|
162
|
+
field.n.substring(0, field.n.length - 3).toUpperCase() + '01' :
|
|
163
|
+
['`$NUMBER`', '`$INTEGER`'].includes(field.t) ? num :
|
|
164
|
+
'`$BOOLEAN`' === field.t ? 0 === num % 2 :
|
|
165
|
+
'`$OBJECT`' === field.t ? {} :
|
|
166
|
+
'`$MAP`' === field.t ? {} :
|
|
167
|
+
'`$ARRAY`' === field.t ? [] :
|
|
168
|
+
'`$LIST`' === field.t ? [] :
|
|
169
169
|
's' + (num.toString(16))
|
|
170
170
|
num++
|
|
171
171
|
})
|