@osdk/generator 1.13.5 → 1.13.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"wireObjectTypeV2ToSdkObjectConst.d.ts","sourceRoot":"","sources":["../../../src/shared/wireObjectTypeV2ToSdkObjectConst.ts"],"names":[],"mappings":"AAsBA,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,UAE/D"}
1
+ {"version":3,"file":"wireObjectTypeV2ToSdkObjectConst.d.ts","sourceRoot":"","sources":["../../../src/shared/wireObjectTypeV2ToSdkObjectConst.ts"],"names":[],"mappings":"AAuBA,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,UAE/D"}
@@ -1,3 +1,4 @@
1
+ import type { ObjectPropertyType } from "@osdk/gateway/types";
1
2
  export declare const TodoWireOntology: {
2
3
  ontology: {
3
4
  rid: string;
@@ -144,4 +145,153 @@ export declare const TodoWireOntology: {
144
145
  interfaceTypes: {};
145
146
  sharedPropertyTypes: {};
146
147
  };
148
+ export declare const TodoWireOntologyWithUnknownProperties: {
149
+ ontology: {
150
+ rid: string;
151
+ apiName: string;
152
+ displayName: string;
153
+ description: string;
154
+ };
155
+ actionTypes: {
156
+ markTodoCompleted: {
157
+ apiName: string;
158
+ description: string;
159
+ parameters: {
160
+ object: {
161
+ description: string;
162
+ dataType: {
163
+ type: "object";
164
+ objectApiName: string;
165
+ objectTypeApiName: string;
166
+ };
167
+ required: false;
168
+ };
169
+ };
170
+ rid: string;
171
+ operations: {
172
+ type: "modifyObject";
173
+ objectTypeApiName: string;
174
+ }[];
175
+ status: "ACTIVE";
176
+ };
177
+ deleteTodos: {
178
+ apiName: string;
179
+ description: string;
180
+ parameters: {
181
+ object: {
182
+ description: string;
183
+ dataType: {
184
+ type: "array";
185
+ subType: {
186
+ type: "object";
187
+ objectApiName: string;
188
+ objectTypeApiName: string;
189
+ };
190
+ };
191
+ required: false;
192
+ };
193
+ };
194
+ rid: string;
195
+ operations: {
196
+ type: "deleteObject";
197
+ objectTypeApiName: string;
198
+ }[];
199
+ status: "ACTIVE";
200
+ };
201
+ };
202
+ objectTypes: {
203
+ Todo: {
204
+ objectType: {
205
+ apiName: string;
206
+ primaryKey: string;
207
+ displayName: string;
208
+ description: string;
209
+ titleProperty: string;
210
+ properties: {
211
+ id: {
212
+ dataType: {
213
+ type: "integer";
214
+ };
215
+ };
216
+ body: {
217
+ dataType: {
218
+ type: "string";
219
+ };
220
+ description: string;
221
+ displayName: string;
222
+ };
223
+ complete: {
224
+ dataType: {
225
+ type: "boolean";
226
+ };
227
+ };
228
+ unknownType: {
229
+ dataType: ObjectPropertyType;
230
+ };
231
+ };
232
+ status: "ACTIVE";
233
+ rid: string;
234
+ };
235
+ linkTypes: {
236
+ apiName: string;
237
+ cardinality: "ONE";
238
+ displayName: string;
239
+ objectTypeApiName: string;
240
+ status: "ACTIVE";
241
+ foreignKeyPropertyApiName: string;
242
+ }[];
243
+ implementsInterfaces: never[];
244
+ implementsInterfaces2: {};
245
+ sharedPropertyTypeMapping: {};
246
+ };
247
+ Person: {
248
+ objectType: {
249
+ apiName: string;
250
+ primaryKey: string;
251
+ displayName: string;
252
+ description: string;
253
+ titleProperty: string;
254
+ properties: {
255
+ email: {
256
+ dataType: {
257
+ type: "string";
258
+ };
259
+ };
260
+ };
261
+ rid: string;
262
+ status: "ACTIVE";
263
+ };
264
+ linkTypes: {
265
+ apiName: string;
266
+ cardinality: "MANY";
267
+ displayName: string;
268
+ objectTypeApiName: string;
269
+ status: "ACTIVE";
270
+ foreignKeyPropertyApiName: string;
271
+ }[];
272
+ implementsInterfaces: never[];
273
+ implementsInterfaces2: {};
274
+ sharedPropertyTypeMapping: {};
275
+ };
276
+ };
277
+ queryTypes: {
278
+ getCount: {
279
+ apiName: string;
280
+ output: {
281
+ type: "integer";
282
+ };
283
+ parameters: {
284
+ completed: {
285
+ dataType: {
286
+ type: "boolean";
287
+ };
288
+ };
289
+ };
290
+ rid: string;
291
+ version: string;
292
+ };
293
+ };
294
+ interfaceTypes: {};
295
+ sharedPropertyTypes: {};
296
+ };
147
297
  //# sourceMappingURL=TodoWireOntology.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TodoWireOntology.d.ts","sourceRoot":"","sources":["../../../../src/util/test/TodoWireOntology.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+IK,CAAC"}
1
+ {"version":3,"file":"TodoWireOntology.d.ts","sourceRoot":"","sources":["../../../../src/util/test/TodoWireOntology.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+IK,CAAC;AAEnC,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAoFtB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEZ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wireObjectTypeV2ToV1ObjectInterfaceString.d.ts","sourceRoot":"","sources":["../../../src/v1.1/wireObjectTypeV2ToV1ObjectInterfaceString.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAG7B,wBAAgB,yCAAyC,CACvD,mBAAmB,EAAE,sBAAsB,EAC3C,SAAS,SAAK,UA2Ef;AAgDD,wBAAgB,uBAAuB,CACrC,WAAW,CAAC,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,OAAO,UAQzB"}
1
+ {"version":3,"file":"wireObjectTypeV2ToV1ObjectInterfaceString.d.ts","sourceRoot":"","sources":["../../../src/v1.1/wireObjectTypeV2ToV1ObjectInterfaceString.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAI7B,wBAAgB,yCAAyC,CACvD,mBAAmB,EAAE,sBAAsB,EAC3C,SAAS,SAAK,UA8Ef;AAoDD,wBAAgB,uBAAuB,CACrC,WAAW,CAAC,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,OAAO,UAQzB"}
@@ -3,6 +3,7 @@ import * as path16 from 'path';
3
3
  import path16__default, { join } from 'path';
4
4
  import { format } from 'prettier';
5
5
  import organizeImports from 'prettier-plugin-organize-imports';
6
+ import consola2, { consola } from 'consola';
6
7
  import { wireObjectTypeFullMetadataToSdkObjectTypeDefinition, __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from '@osdk/generator-converters';
7
8
  import fastDeepEqual from 'fast-deep-equal';
8
9
  import invariant from 'tiny-invariant';
@@ -70,6 +71,9 @@ ${Array.from(uniqueLinkTargets).map((linkTarget) => `import type { ${linkTarget}
70
71
  readonly $primaryKey: ${wirePropertyTypeV2ToTypeScriptType(objectTypeWithLinks.objectType.properties[objectTypeWithLinks.objectType.primaryKey].dataType)};
71
72
  ${Object.entries(objectTypeWithLinks.objectType.properties).sort((a, b) => a[0].localeCompare(b[0])).flatMap(([propertyName, propertyDefinition]) => {
72
73
  const propertyType = wirePropertyTypeV2ToTypeScriptType(propertyDefinition.dataType);
74
+ if (propertyType == null) {
75
+ return [];
76
+ }
73
77
  const entries = [`${getDescriptionIfPresent(propertyDefinition.description, true)}readonly ${propertyName}: ${propertyType} | undefined`];
74
78
  if (isReservedKeyword(propertyName)) {
75
79
  entries.push(`/** @deprecated please migrate to '${propertyName}' instead */
@@ -91,7 +95,11 @@ function wirePropertyTypeV2ToTypeScriptType(property) {
91
95
  case "boolean":
92
96
  return "boolean";
93
97
  case "array":
94
- return wirePropertyTypeV2ToTypeScriptType(property.subType) + "[]";
98
+ const subType = wirePropertyTypeV2ToTypeScriptType(property.subType);
99
+ if (subType == null) {
100
+ return void 0;
101
+ }
102
+ return subType + "[]";
95
103
  case "integer":
96
104
  return "number";
97
105
  case "attachment":
@@ -121,7 +129,8 @@ function wirePropertyTypeV2ToTypeScriptType(property) {
121
129
  case "marking":
122
130
  return "string";
123
131
  default:
124
- throw new Error(`Unknown property type ${property}`);
132
+ consola.info(`Unknown property type ${JSON.stringify(property)}`);
133
+ return void 0;
125
134
  }
126
135
  }
127
136
  function getDescriptionIfPresent(description, includeNewline) {
@@ -257,7 +266,7 @@ function getObjectDefIdentifier(name, v2) {
257
266
  }
258
267
  function wireObjectTypeV2ToSdkObjectConst(object, importExt, v2 = false) {
259
268
  const uniqueLinkTargetTypes = new Set(object.linkTypes.map((a) => a.objectTypeApiName));
260
- const definition = deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectTypeDefinition(object, v2));
269
+ const definition = deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectTypeDefinition(object, v2, consola2));
261
270
  const objectDefIdentifier = getObjectDefIdentifier(object.objectType.apiName, v2);
262
271
  function getV1Types() {
263
272
  return `
@@ -1756,7 +1765,7 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology,
1756
1765
 
1757
1766
  };`;
1758
1767
  }
1759
- var ExpectedOsdkVersion = "0.21.2";
1768
+ var ExpectedOsdkVersion = "0.21.3";
1760
1769
  async function generateOntologyMetadataFile(ontology, userAgent, fs2, outDir) {
1761
1770
  fs2.writeFile(path16__default.join(outDir, "OntologyMetadata.ts"), await formatTs(`
1762
1771
  import { OntologyMetadata as OM } from "@osdk/api";