@osdk/generator 2.0.0-beta.8 → 2.0.0-beta.9
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 +13 -0
- package/build/browser/index.js +27 -21
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +27 -21
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/v2.0/generatePerActionDataFiles.d.ts.map +1 -1
- package/build/esm/index.js +27 -21
- package/build/esm/index.js.map +1 -1
- package/build/esm/v2.0/generatePerActionDataFiles.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePerActionDataFiles.d.ts","sourceRoot":"","sources":["../../../src/v2.0/generatePerActionDataFiles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAU7E,wBAAsB,0BAA0B,CAC9C,EACE,iBAAiB,EAAE,QAAQ,EAC3B,EAAE,EACF,MAAM,EAAE,UAAU,EAClB,SAAc,EACd,QAAQ,EAAE,gBAAgB,GAC3B,EAAE,IAAI,CACL,eAAe,EACb,mBAAmB,GACnB,IAAI,GACJ,QAAQ,GACR,WAAW,GACX,UAAU,CACb,
|
|
1
|
+
{"version":3,"file":"generatePerActionDataFiles.d.ts","sourceRoot":"","sources":["../../../src/v2.0/generatePerActionDataFiles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAU7E,wBAAsB,0BAA0B,CAC9C,EACE,iBAAiB,EAAE,QAAQ,EAC3B,EAAE,EACF,MAAM,EAAE,UAAU,EAClB,SAAc,EACd,QAAQ,EAAE,gBAAgB,GAC3B,EAAE,IAAI,CACL,eAAe,EACb,mBAAmB,GACnB,IAAI,GACJ,QAAQ,GACR,WAAW,GACX,UAAU,CACb,iBAsPF"}
|
package/build/esm/index.js
CHANGED
|
@@ -666,12 +666,8 @@ async function generatePerActionDataFiles({
|
|
|
666
666
|
const uniqueApiNames = new Set(uniqueApiNamesArray);
|
|
667
667
|
const uniqueApiNamesString = stringUnionFrom([...uniqueApiNames]);
|
|
668
668
|
const fullActionDef = deleteUndefineds(wireActionTypeV2ToSdkActionDefinition(action.raw));
|
|
669
|
-
const {
|
|
670
|
-
parameters,
|
|
671
|
-
...actionDefSansParameters
|
|
672
|
-
} = fullActionDef;
|
|
673
669
|
function createParamsDef() {
|
|
674
|
-
const entries = Object.entries(parameters);
|
|
670
|
+
const entries = Object.entries(fullActionDef.parameters ?? {});
|
|
675
671
|
entries.sort((a, b) => a[0].localeCompare(b[0]));
|
|
676
672
|
if (entries.length === 0) {
|
|
677
673
|
return `// Represents the definition of the parameters for the action
|
|
@@ -722,7 +718,7 @@ async function generatePerActionDataFiles({
|
|
|
722
718
|
|
|
723
719
|
${getDescriptionIfPresent(action.description)}
|
|
724
720
|
export interface Params {
|
|
725
|
-
${stringify(parameters, {
|
|
721
|
+
${stringify(fullActionDef.parameters, {
|
|
726
722
|
"*": (ogValue, _, ogKey) => {
|
|
727
723
|
const key = `${getDescriptionIfPresent(ogValue.description)}
|
|
728
724
|
readonly "${ogKey}"${ogValue.nullable ? "?" : ""}`;
|
|
@@ -733,16 +729,6 @@ async function generatePerActionDataFiles({
|
|
|
733
729
|
})}
|
|
734
730
|
}
|
|
735
731
|
|
|
736
|
-
|
|
737
|
-
// Represents the definition of the action
|
|
738
|
-
export interface Definition extends ActionDefinition<"${action.shortApiName}", ${uniqueApiNamesString}, ${action.shortApiName}.Signatures>, VersionBound<$ExpectedClientVersion> {
|
|
739
|
-
${Object.entries(actionDefSansParameters).sort((a, b) => a[0].localeCompare(b[0])).map(([key, value]) => {
|
|
740
|
-
return `${key}: ${JSON.stringify(value)};`;
|
|
741
|
-
}).join("\n")}
|
|
742
|
-
parameters: ${action.definitionParamsIdentifier};
|
|
743
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
732
|
// Represents a fqn of the action
|
|
747
733
|
export interface Signatures {
|
|
748
734
|
${getDescriptionIfPresent(action.description)}
|
|
@@ -753,15 +739,36 @@ async function generatePerActionDataFiles({
|
|
|
753
739
|
|
|
754
740
|
}
|
|
755
741
|
|
|
742
|
+
|
|
756
743
|
${jsDocBlock.join("\n")}
|
|
757
744
|
*/
|
|
758
|
-
export
|
|
745
|
+
export interface ${action.shortApiName} extends MinimalActionDefinition<"${action.shortApiName}", ${uniqueApiNamesString}, ${action.shortApiName}.Signatures> {
|
|
746
|
+
__DefinitionMetadata?: {
|
|
747
|
+
${stringify(fullActionDef, {
|
|
748
|
+
"parameters": () => action.definitionParamsIdentifier
|
|
749
|
+
})}
|
|
750
|
+
|
|
751
|
+
signatures: ${action.shortApiName}.Signatures;
|
|
752
|
+
},
|
|
753
|
+
${stringify(fullActionDef, {
|
|
754
|
+
"description": () => void 0,
|
|
755
|
+
"displayName": () => void 0,
|
|
756
|
+
"modifiedEntities": () => void 0,
|
|
757
|
+
"parameters": () => void 0
|
|
758
|
+
})}
|
|
759
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
760
|
+
}
|
|
759
761
|
`;
|
|
760
762
|
}
|
|
761
763
|
function createV2Object() {
|
|
762
|
-
return ` export const ${action.shortApiName}: ${action.
|
|
764
|
+
return ` export const ${action.shortApiName}: ${action.shortApiName} =
|
|
763
765
|
{
|
|
764
|
-
${stringify(fullActionDef
|
|
766
|
+
${stringify(fullActionDef, {
|
|
767
|
+
"description": () => void 0,
|
|
768
|
+
"displayName": () => void 0,
|
|
769
|
+
"modifiedEntities": () => void 0,
|
|
770
|
+
"parameters": () => void 0
|
|
771
|
+
})},
|
|
765
772
|
osdkMetadata: $osdkMetadata
|
|
766
773
|
}
|
|
767
774
|
`;
|
|
@@ -787,9 +794,8 @@ async function generatePerActionDataFiles({
|
|
|
787
794
|
}
|
|
788
795
|
const imports = getObjectImports(referencedObjectDefs, void 0, currentFilePath, true);
|
|
789
796
|
await fs2.writeFile(path5__default.join(rootOutDir, currentFilePath), await formatTs(`
|
|
790
|
-
import type {
|
|
797
|
+
import type { MinimalActionDefinition, ObjectActionDataType, ObjectSetActionDataType } from "@osdk/api";
|
|
791
798
|
import type { ActionParam, ActionReturnTypeForOptions, ApplyActionOptions, ApplyBatchActionOptions, } from '@osdk/client.api';
|
|
792
|
-
import type { $ExpectedClientVersion } from "../../OntologyMetadata${importExt}";
|
|
793
799
|
import { $osdkMetadata} from "../../OntologyMetadata${importExt}";
|
|
794
800
|
${imports}
|
|
795
801
|
|