@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.
@@ -4,6 +4,7 @@ var fs = require('fs');
4
4
  var path16 = require('path');
5
5
  var prettier = require('prettier');
6
6
  var organizeImports = require('prettier-plugin-organize-imports');
7
+ var consola2 = require('consola');
7
8
  var generatorConverters = require('@osdk/generator-converters');
8
9
  var fastDeepEqual = require('fast-deep-equal');
9
10
  var invariant = require('tiny-invariant');
@@ -31,6 +32,7 @@ function _interopNamespace(e) {
31
32
  var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
32
33
  var path16__namespace = /*#__PURE__*/_interopNamespace(path16);
33
34
  var organizeImports__default = /*#__PURE__*/_interopDefault(organizeImports);
35
+ var consola2__default = /*#__PURE__*/_interopDefault(consola2);
34
36
  var fastDeepEqual__default = /*#__PURE__*/_interopDefault(fastDeepEqual);
35
37
  var invariant__default = /*#__PURE__*/_interopDefault(invariant);
36
38
 
@@ -97,6 +99,9 @@ ${Array.from(uniqueLinkTargets).map((linkTarget) => `import type { ${linkTarget}
97
99
  readonly $primaryKey: ${wirePropertyTypeV2ToTypeScriptType(objectTypeWithLinks.objectType.properties[objectTypeWithLinks.objectType.primaryKey].dataType)};
98
100
  ${Object.entries(objectTypeWithLinks.objectType.properties).sort((a, b) => a[0].localeCompare(b[0])).flatMap(([propertyName, propertyDefinition]) => {
99
101
  const propertyType = wirePropertyTypeV2ToTypeScriptType(propertyDefinition.dataType);
102
+ if (propertyType == null) {
103
+ return [];
104
+ }
100
105
  const entries = [`${getDescriptionIfPresent(propertyDefinition.description, true)}readonly ${propertyName}: ${propertyType} | undefined`];
101
106
  if (isReservedKeyword(propertyName)) {
102
107
  entries.push(`/** @deprecated please migrate to '${propertyName}' instead */
@@ -118,7 +123,11 @@ function wirePropertyTypeV2ToTypeScriptType(property) {
118
123
  case "boolean":
119
124
  return "boolean";
120
125
  case "array":
121
- return wirePropertyTypeV2ToTypeScriptType(property.subType) + "[]";
126
+ const subType = wirePropertyTypeV2ToTypeScriptType(property.subType);
127
+ if (subType == null) {
128
+ return void 0;
129
+ }
130
+ return subType + "[]";
122
131
  case "integer":
123
132
  return "number";
124
133
  case "attachment":
@@ -148,7 +157,8 @@ function wirePropertyTypeV2ToTypeScriptType(property) {
148
157
  case "marking":
149
158
  return "string";
150
159
  default:
151
- throw new Error(`Unknown property type ${property}`);
160
+ consola2.consola.info(`Unknown property type ${JSON.stringify(property)}`);
161
+ return void 0;
152
162
  }
153
163
  }
154
164
  function getDescriptionIfPresent(description, includeNewline) {
@@ -284,7 +294,7 @@ function getObjectDefIdentifier(name, v2) {
284
294
  }
285
295
  function wireObjectTypeV2ToSdkObjectConst(object, importExt, v2 = false) {
286
296
  const uniqueLinkTargetTypes = new Set(object.linkTypes.map((a) => a.objectTypeApiName));
287
- const definition = deleteUndefineds(generatorConverters.wireObjectTypeFullMetadataToSdkObjectTypeDefinition(object, v2));
297
+ const definition = deleteUndefineds(generatorConverters.wireObjectTypeFullMetadataToSdkObjectTypeDefinition(object, v2, consola2__default.default));
288
298
  const objectDefIdentifier = getObjectDefIdentifier(object.objectType.apiName, v2);
289
299
  function getV1Types() {
290
300
  return `
@@ -1783,7 +1793,7 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology,
1783
1793
 
1784
1794
  };`;
1785
1795
  }
1786
- var ExpectedOsdkVersion = "0.21.2";
1796
+ var ExpectedOsdkVersion = "0.21.3";
1787
1797
  async function generateOntologyMetadataFile(ontology, userAgent, fs2, outDir) {
1788
1798
  fs2.writeFile(path16__namespace.default.join(outDir, "OntologyMetadata.ts"), await formatTs(`
1789
1799
  import { OntologyMetadata as OM } from "@osdk/api";