@osdk/maker-experimental 0.3.0-beta.3 → 0.3.0-beta.5

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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHKURHHWY_cjs = require('./chunk-HKURHHWY.cjs');
3
+ var chunkFZ56D34B_cjs = require('./chunk-FZ56D34B.cjs');
4
4
  var util = require('util');
5
5
  var path = require('path');
6
6
  var g$1 = require('process');
@@ -10,7 +10,6 @@ require('tiny-invariant');
10
10
  require('assert');
11
11
  var fs = require('fs');
12
12
  var url = require('url');
13
- require('crypto');
14
13
 
15
14
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
16
15
 
@@ -1082,7 +1081,7 @@ function createConsola2(options = {}) {
1082
1081
  },
1083
1082
  stdout: process.stdout,
1084
1083
  stderr: process.stderr,
1085
- prompt: (...args) => import('./prompt-CVWBIE7L.cjs').then((m) => m.prompt(...args)),
1084
+ prompt: (...args) => import('./prompt-6FZ62QK3.cjs').then((m) => m.prompt(...args)),
1086
1085
  reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
1087
1086
  ...options
1088
1087
  });
@@ -2021,8 +2020,8 @@ new YargsParser({
2021
2020
  // TODO: figure out a way to combine ESM and CJS coverage, such that
2022
2021
  // we can exercise all the lines below:
2023
2022
  require: (path2) => {
2024
- if (typeof chunkHKURHHWY_cjs.__require !== "undefined") {
2025
- return chunkHKURHHWY_cjs.__require(path2);
2023
+ if (typeof chunkFZ56D34B_cjs.__require !== "undefined") {
2024
+ return chunkFZ56D34B_cjs.__require(path2);
2026
2025
  } else if (path2.match(/\.json$/)) {
2027
2026
  return JSON.parse(fs.readFileSync(path2, "utf8"));
2028
2027
  } else {
@@ -2203,7 +2202,7 @@ var y18n2 = (opts) => {
2203
2202
  var y18n_default = y18n2;
2204
2203
  var __dirname$1;
2205
2204
  try {
2206
- __dirname$1 = url.fileURLToPath(chunkHKURHHWY_cjs.importMetaUrl);
2205
+ __dirname$1 = url.fileURLToPath(chunkFZ56D34B_cjs.importMetaUrl);
2207
2206
  } catch (e) {
2208
2207
  __dirname$1 = process.cwd();
2209
2208
  }
@@ -2222,8 +2221,8 @@ var mainFilename = __dirname$1.substring(0, __dirname$1.lastIndexOf("node_module
2222
2221
  })
2223
2222
  });
2224
2223
 
2225
- // ../maker/build/esm/api/types.js
2226
- var OntologyEntityTypeEnum = /* @__PURE__ */ function(OntologyEntityTypeEnum2) {
2224
+ // ../maker/build/esm/api/common/OntologyEntityTypeEnum.js
2225
+ var OntologyEntityTypeEnum = /* @__PURE__ */ (function(OntologyEntityTypeEnum2) {
2227
2226
  OntologyEntityTypeEnum2["OBJECT_TYPE"] = "OBJECT_TYPE";
2228
2227
  OntologyEntityTypeEnum2["LINK_TYPE"] = "LINK_TYPE";
2229
2228
  OntologyEntityTypeEnum2["INTERFACE_TYPE"] = "INTERFACE_TYPE";
@@ -2231,124 +2230,14 @@ var OntologyEntityTypeEnum = /* @__PURE__ */ function(OntologyEntityTypeEnum2) {
2231
2230
  OntologyEntityTypeEnum2["ACTION_TYPE"] = "ACTION_TYPE";
2232
2231
  OntologyEntityTypeEnum2["VALUE_TYPE"] = "VALUE_TYPE";
2233
2232
  return OntologyEntityTypeEnum2;
2234
- }({});
2233
+ })({});
2235
2234
 
2236
2235
  // ../maker/build/esm/api/defineObject.js
2237
- function convertToDisplayName(s2) {
2236
+ function uppercaseFirstLetter(s2) {
2238
2237
  return s2 === void 0 || s2 == null ? "" : s2.charAt(0).toUpperCase() + s2.slice(1);
2239
2238
  }
2240
2239
  function convertToPluralDisplayName(s2) {
2241
- return s2 === void 0 || s2 == null ? "" : s2.endsWith("s") ? convertToDisplayName(s2) : convertToDisplayName(s2) + "s";
2242
- }
2243
- function convertType(type) {
2244
- switch (true) {
2245
- case (typeof type === "object" && "markingType" in type):
2246
- return {
2247
- "type": "marking",
2248
- marking: {
2249
- markingType: type.markingType
2250
- }
2251
- };
2252
- case (typeof type === "object" && "structDefinition" in type):
2253
- const structFields = new Array();
2254
- for (const key in type.structDefinition) {
2255
- const fieldTypeDefinition = type.structDefinition[key];
2256
- let field;
2257
- if (typeof fieldTypeDefinition === "string") {
2258
- field = {
2259
- apiName: key,
2260
- displayMetadata: {
2261
- displayName: key,
2262
- description: void 0
2263
- },
2264
- typeClasses: [],
2265
- aliases: [],
2266
- fieldType: convertType(fieldTypeDefinition)
2267
- };
2268
- } else {
2269
- if ("fieldType" in fieldTypeDefinition) {
2270
- field = {
2271
- ...fieldTypeDefinition,
2272
- apiName: key,
2273
- fieldType: convertType(fieldTypeDefinition.fieldType),
2274
- typeClasses: fieldTypeDefinition.typeClasses ?? [],
2275
- aliases: fieldTypeDefinition.aliases ?? []
2276
- };
2277
- } else {
2278
- field = {
2279
- apiName: key,
2280
- displayMetadata: {
2281
- displayName: key,
2282
- description: void 0
2283
- },
2284
- typeClasses: [],
2285
- aliases: [],
2286
- fieldType: convertType(fieldTypeDefinition)
2287
- };
2288
- }
2289
- }
2290
- structFields.push(field);
2291
- }
2292
- return {
2293
- type: "struct",
2294
- struct: {
2295
- structFields
2296
- }
2297
- };
2298
- case (typeof type === "object" && "isLongText" in type):
2299
- return {
2300
- "type": "string",
2301
- "string": {
2302
- analyzerOverride: void 0,
2303
- enableAsciiFolding: void 0,
2304
- isLongText: type.isLongText,
2305
- supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard,
2306
- supportsExactMatching: type.supportsExactMatching
2307
- }
2308
- };
2309
- case type === "geopoint":
2310
- return {
2311
- type: "geohash",
2312
- geohash: {}
2313
- };
2314
- case type === "decimal":
2315
- return {
2316
- type,
2317
- [type]: {
2318
- precision: void 0,
2319
- scale: void 0
2320
- }
2321
- };
2322
- case type === "string":
2323
- return {
2324
- type,
2325
- [type]: {
2326
- analyzerOverride: void 0,
2327
- enableAsciiFolding: void 0,
2328
- isLongText: false,
2329
- supportsEfficientLeadingWildcard: false,
2330
- supportsExactMatching: true
2331
- }
2332
- };
2333
- case type === "mediaReference":
2334
- return {
2335
- type,
2336
- mediaReference: {}
2337
- };
2338
- case type === "geotimeSeries":
2339
- return {
2340
- type: "geotimeSeriesReference",
2341
- geotimeSeriesReference: {}
2342
- };
2343
- default:
2344
- return distributeTypeHelper(type);
2345
- }
2346
- }
2347
- function distributeTypeHelper(type) {
2348
- return {
2349
- type,
2350
- [type]: {}
2351
- };
2240
+ return s2 === void 0 || s2 == null ? "" : s2.endsWith("s") ? uppercaseFirstLetter(s2) : uppercaseFirstLetter(s2) + "s";
2352
2241
  }
2353
2242
 
2354
2243
  // ../maker/build/esm/api/defineOntology.js
@@ -2370,7 +2259,7 @@ function importOntologyEntity(e) {
2370
2259
  function defineImportObject(objectDef) {
2371
2260
  const properties = Object.entries(objectDef.properties ?? {}).map(([apiName, type]) => ({
2372
2261
  apiName,
2373
- displayName: convertToDisplayName(apiName),
2262
+ displayName: uppercaseFirstLetter(apiName),
2374
2263
  type: type.type
2375
2264
  }));
2376
2265
  const finalObject = {
@@ -2378,24 +2267,13 @@ function defineImportObject(objectDef) {
2378
2267
  properties,
2379
2268
  __type: OntologyEntityTypeEnum.OBJECT_TYPE,
2380
2269
  // the rest don't matter for now
2381
- displayName: objectDef.displayName ?? convertToDisplayName(objectDef.apiName),
2270
+ displayName: objectDef.displayName ?? uppercaseFirstLetter(objectDef.apiName),
2382
2271
  pluralDisplayName: convertToPluralDisplayName(objectDef.apiName),
2383
2272
  primaryKeyPropertyApiName: properties[0]?.apiName,
2384
2273
  titlePropertyApiName: properties[0]?.apiName
2385
2274
  };
2386
2275
  importOntologyEntity(finalObject);
2387
- const importPropertyTypes = Object.entries(objectDef.properties).map(([apiName, importedPt]) => ({
2388
- ...importedPt,
2389
- apiName,
2390
- displayName: importedPt.displayName ?? convertToDisplayName(apiName),
2391
- type: convertType(importedPt.type)
2392
- }));
2393
- const ontologyImportObject = {
2394
- ...objectDef,
2395
- displayName: objectDef.displayName ?? convertToDisplayName(objectDef.apiName),
2396
- propertyTypes: importPropertyTypes
2397
- };
2398
- return ontologyImportObject;
2276
+ return finalObject;
2399
2277
  }
2400
2278
  /*! Bundled license information:
2401
2279