@osdk/generator 2.2.0-beta.5 → 2.2.0-beta.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.
- package/CHANGELOG.md +14 -0
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +16 -3
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/build/cjs/chunk-XOCES5YA.cjs +6 -6
- package/build/cjs/chunk-XOCES5YA.cjs.map +1 -1
- package/build/cjs/index.cjs +27 -27
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/prompt-YMFYYBNJ.cjs +5 -5
- package/build/cjs/prompt-YMFYYBNJ.cjs.map +1 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +16 -3
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/package.json +3 -3
package/build/cjs/index.cjs
CHANGED
|
@@ -72,7 +72,7 @@ var EnhancedBase = class extends AbstractImportable {
|
|
|
72
72
|
};
|
|
73
73
|
function extractNamespace(fqApiName) {
|
|
74
74
|
const last = fqApiName.lastIndexOf(".");
|
|
75
|
-
if (last === -1) return [
|
|
75
|
+
if (last === -1) return [void 0, fqApiName];
|
|
76
76
|
return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -104,7 +104,7 @@ var EnhancedAction = class extends EnhancedBase {
|
|
|
104
104
|
|
|
105
105
|
// src/util/deleteUndefineds.ts
|
|
106
106
|
function deleteUndefineds(obj) {
|
|
107
|
-
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !==
|
|
107
|
+
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// src/GenerateContext/EnhancedInterfaceType.ts
|
|
@@ -393,7 +393,7 @@ async function generatePerActionDataFiles({
|
|
|
393
393
|
${entries.map(([key, value]) => {
|
|
394
394
|
return `"${key}": {
|
|
395
395
|
${stringify(value, {
|
|
396
|
-
description: (value2, d) => value2 ? d(value2) :
|
|
396
|
+
description: (value2, d) => value2 ? d(value2) : void 0,
|
|
397
397
|
// trick to remove undefineds
|
|
398
398
|
type: (type) => {
|
|
399
399
|
if (typeof type === "string") {
|
|
@@ -410,7 +410,7 @@ async function generatePerActionDataFiles({
|
|
|
410
410
|
} else if (type.type === "struct") {
|
|
411
411
|
return `ActionMetadata.DataType.Struct<${JSON.stringify(type.struct)}>`;
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return void 0;
|
|
414
414
|
}
|
|
415
415
|
})}
|
|
416
416
|
}`;
|
|
@@ -476,12 +476,12 @@ async function generatePerActionDataFiles({
|
|
|
476
476
|
signatures: ${action.shortApiName}.Signatures;
|
|
477
477
|
},
|
|
478
478
|
${stringify(fullActionDef, {
|
|
479
|
-
"description": () =>
|
|
480
|
-
"displayName": () =>
|
|
481
|
-
"modifiedEntities": () =>
|
|
482
|
-
"parameters": () =>
|
|
483
|
-
"rid": () =>
|
|
484
|
-
"status": () =>
|
|
479
|
+
"description": () => void 0,
|
|
480
|
+
"displayName": () => void 0,
|
|
481
|
+
"modifiedEntities": () => void 0,
|
|
482
|
+
"parameters": () => void 0,
|
|
483
|
+
"rid": () => void 0,
|
|
484
|
+
"status": () => void 0
|
|
485
485
|
})}
|
|
486
486
|
osdkMetadata: typeof $osdkMetadata;
|
|
487
487
|
}
|
|
@@ -491,12 +491,12 @@ async function generatePerActionDataFiles({
|
|
|
491
491
|
return ` export const ${action.shortApiName}: ${action.shortApiName} =
|
|
492
492
|
{
|
|
493
493
|
${stringify(fullActionDef, {
|
|
494
|
-
"description": () =>
|
|
495
|
-
"displayName": () =>
|
|
496
|
-
"modifiedEntities": () =>
|
|
497
|
-
"parameters": () =>
|
|
498
|
-
"rid": () =>
|
|
499
|
-
"status": () =>
|
|
494
|
+
"description": () => void 0,
|
|
495
|
+
"displayName": () => void 0,
|
|
496
|
+
"modifiedEntities": () => void 0,
|
|
497
|
+
"parameters": () => void 0,
|
|
498
|
+
"rid": () => void 0,
|
|
499
|
+
"status": () => void 0
|
|
500
500
|
})},
|
|
501
501
|
osdkMetadata: $osdkMetadata
|
|
502
502
|
}
|
|
@@ -533,7 +533,7 @@ async function generatePerActionDataFiles({
|
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
const imports = getObjectImports(referencedObjectDefs,
|
|
536
|
+
const imports = getObjectImports(referencedObjectDefs, void 0, currentFilePath, true);
|
|
537
537
|
await fs2.writeFile(path8__namespace.default.join(rootOutDir, currentFilePath), await formatTs(`
|
|
538
538
|
import type {
|
|
539
539
|
ActionDefinition,
|
|
@@ -598,7 +598,7 @@ function extractReferencedObjectsFromActionParameter(actionParameter) {
|
|
|
598
598
|
case "integer":
|
|
599
599
|
case "long":
|
|
600
600
|
case "timestamp":
|
|
601
|
-
return
|
|
601
|
+
return void 0;
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
|
|
@@ -852,9 +852,9 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology,
|
|
|
852
852
|
}
|
|
853
853
|
for (const apiName of Object.keys(parent.properties)) {
|
|
854
854
|
if (definition.properties[apiName] != null) {
|
|
855
|
-
!fastDeepEqual__default.default(definition.properties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`) : invariant__default.default(false) :
|
|
855
|
+
!fastDeepEqual__default.default(definition.properties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`) : invariant__default.default(false) : void 0;
|
|
856
856
|
} else if (mergedProperties[apiName] != null) {
|
|
857
|
-
!fastDeepEqual__default.default(mergedProperties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`) : invariant__default.default(false) :
|
|
857
|
+
!fastDeepEqual__default.default(mergedProperties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`) : invariant__default.default(false) : void 0;
|
|
858
858
|
}
|
|
859
859
|
mergedProperties[apiName] = parent.properties[apiName];
|
|
860
860
|
}
|
|
@@ -1120,9 +1120,9 @@ async function generateV2QueryFile(fs2, outDir, relOutDir, query, importExt, ont
|
|
|
1120
1120
|
signature: ${query.shortApiName}.Signature;
|
|
1121
1121
|
},
|
|
1122
1122
|
${stringify(baseProps, {
|
|
1123
|
-
"description": () =>
|
|
1124
|
-
"displayName": () =>
|
|
1125
|
-
"rid": () =>
|
|
1123
|
+
"description": () => void 0,
|
|
1124
|
+
"displayName": () => void 0,
|
|
1125
|
+
"rid": () => void 0
|
|
1126
1126
|
})},
|
|
1127
1127
|
osdkMetadata: typeof $osdkMetadata;
|
|
1128
1128
|
}
|
|
@@ -1130,9 +1130,9 @@ async function generateV2QueryFile(fs2, outDir, relOutDir, query, importExt, ont
|
|
|
1130
1130
|
|
|
1131
1131
|
export const ${query.shortApiName}: ${query.definitionIdentifier} = {
|
|
1132
1132
|
${stringify(baseProps, {
|
|
1133
|
-
"description": () =>
|
|
1134
|
-
"displayName": () =>
|
|
1135
|
-
"rid": () =>
|
|
1133
|
+
"description": () => void 0,
|
|
1134
|
+
"displayName": () => void 0,
|
|
1135
|
+
"rid": () => void 0
|
|
1136
1136
|
})},
|
|
1137
1137
|
osdkMetadata: $osdkMetadata
|
|
1138
1138
|
};
|
|
@@ -1382,7 +1382,7 @@ function getPackageJsonContents(name, version, dependencyVersions) {
|
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
1384
|
async function writeJson(minimalFs, filePath, body) {
|
|
1385
|
-
return void await minimalFs.writeFile(filePath, JSON.stringify(body,
|
|
1385
|
+
return void await minimalFs.writeFile(filePath, JSON.stringify(body, void 0, 2) + "\n");
|
|
1386
1386
|
}
|
|
1387
1387
|
|
|
1388
1388
|
exports.__UNSTABLE_generateClientSdkPackage = generateClientSdkPackage;
|