@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/create-sdkgen",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "main": "dist/create-sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "types": "dist/create-sdkgen.d.ts",
@@ -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.contract) data.requests[point.contract.id] = {
114
- provenance: 'operation-contract', version: point.contract.version,
115
- source: point.contract.source,
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?.args?.params || []
139
- const renameMap: Record<string, string> = point?.rename?.param || {}
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?.name) continue
142
- if ('id' === param.name) continue
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.name))
144
+ const camel = lcf(camelify(param.n))
145
145
  if ('id' === renameMap[camel]) continue
146
- if (out.has(param.name)) continue
147
- const baseName = param.name.replace(/_id$/, '')
148
- out.set(param.name, baseName.toUpperCase() + '01')
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.name] =
161
- field.name.endsWith('_id') ?
162
- field.name.substring(0, field.name.length - 3).toUpperCase() + '01' :
163
- ['`$NUMBER`', '`$INTEGER`'].includes(field.type) ? num :
164
- '`$BOOLEAN`' === field.type ? 0 === num % 2 :
165
- '`$OBJECT`' === field.type ? {} :
166
- '`$MAP`' === field.type ? {} :
167
- '`$ARRAY`' === field.type ? [] :
168
- '`$LIST`' === field.type ? [] :
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
  })