@osdk/cli 0.28.0-beta.8 → 0.29.0-beta.1
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 +24 -0
- package/build/esm/{chunk-DGKZAGPL.js → chunk-MRRQIWFU.js} +2 -5
- package/build/esm/chunk-MRRQIWFU.js.map +1 -0
- package/build/esm/{chunk-WW4LKEPP.js → chunk-OTLNXP2X.js} +3 -3
- package/build/esm/{chunk-WW4LKEPP.js.map → chunk-OTLNXP2X.js.map} +1 -1
- package/build/esm/{handleGenerate-ZNUGIWQR.js → handleGenerate-FCOJJA72.js} +144 -46
- package/build/esm/handleGenerate-FCOJJA72.js.map +1 -0
- package/build/esm/index.js +14 -14
- package/build/esm/index.js.map +1 -1
- package/build/esm/{siteDeployCommand-6PRTJTIM.js → siteDeployCommand-R4TBKSRE.js} +3 -3
- package/build/esm/{siteDeployCommand-6PRTJTIM.js.map → siteDeployCommand-R4TBKSRE.js.map} +1 -1
- package/build/esm/{versionDeleteCommand-BZNCR2F3.js → versionDeleteCommand-7WJ33WHQ.js} +3 -3
- package/build/esm/{versionDeleteCommand-BZNCR2F3.js.map → versionDeleteCommand-7WJ33WHQ.js.map} +1 -1
- package/build/esm/{versionDeleteCommand-UK6HQQ6P.js → versionDeleteCommand-VA7EWMPW.js} +3 -3
- package/build/esm/{versionDeleteCommand-UK6HQQ6P.js.map → versionDeleteCommand-VA7EWMPW.js.map} +1 -1
- package/build/esm/{versionGetCommand-65AEFFHG.js → versionGetCommand-T2MHSG72.js} +3 -3
- package/build/esm/{versionGetCommand-65AEFFHG.js.map → versionGetCommand-T2MHSG72.js.map} +1 -1
- package/build/esm/{versionInfoCommand-4LVQQPL7.js → versionInfoCommand-HJUXK64K.js} +3 -3
- package/build/esm/{versionInfoCommand-4LVQQPL7.js.map → versionInfoCommand-HJUXK64K.js.map} +1 -1
- package/build/esm/{versionListCommand-55SDL7SP.js → versionListCommand-5MYPWYTK.js} +3 -3
- package/build/esm/{versionListCommand-55SDL7SP.js.map → versionListCommand-5MYPWYTK.js.map} +1 -1
- package/build/esm/{versionListCommand-DIQTJDYO.js → versionListCommand-AM65WXFS.js} +3 -3
- package/build/esm/{versionListCommand-DIQTJDYO.js.map → versionListCommand-AM65WXFS.js.map} +1 -1
- package/build/esm/{versionSetCommand-ASQCYG24.js → versionSetCommand-GTPVR3R6.js} +3 -3
- package/build/esm/{versionSetCommand-ASQCYG24.js.map → versionSetCommand-GTPVR3R6.js.map} +1 -1
- package/build/esm/{versionUnsetCommand-2RESWNMX.js → versionUnsetCommand-6ZK54OMR.js} +3 -3
- package/build/esm/{versionUnsetCommand-2RESWNMX.js.map → versionUnsetCommand-6ZK54OMR.js.map} +1 -1
- package/build/esm/{widgetSetDeployCommand-THQPS6NP.js → widgetSetDeployCommand-W6TBBHV2.js} +4 -4
- package/build/esm/{widgetSetDeployCommand-THQPS6NP.js.map → widgetSetDeployCommand-W6TBBHV2.js.map} +1 -1
- package/package.json +9 -9
- package/build/esm/chunk-DGKZAGPL.js.map +0 -1
- package/build/esm/handleGenerate-ZNUGIWQR.js.map +0 -1
|
@@ -57,16 +57,16 @@ var require_fast_deep_equal = __commonJS({
|
|
|
57
57
|
// ../cli.cmd.typescript/build/esm/generate/handleGenerate.mjs
|
|
58
58
|
init_esm_shims();
|
|
59
59
|
|
|
60
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
60
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/index.js
|
|
61
61
|
init_esm_shims();
|
|
62
62
|
|
|
63
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
63
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
64
64
|
init_esm_shims();
|
|
65
65
|
|
|
66
|
-
// ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.
|
|
66
|
+
// ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.4.0/node_modules/@osdk/shared.net.platformapi/build/esm/index.js
|
|
67
67
|
init_esm_shims();
|
|
68
68
|
|
|
69
|
-
// ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.
|
|
69
|
+
// ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.4.0/node_modules/@osdk/shared.net.platformapi/build/esm/foundryPlatformFetch.js
|
|
70
70
|
init_esm_shims();
|
|
71
71
|
|
|
72
72
|
// ../../node_modules/.pnpm/@osdk+shared.client@1.0.1/node_modules/@osdk/shared.client/index.js
|
|
@@ -110,7 +110,7 @@ var UnknownError = class extends PalantirApiError2 {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
// ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.
|
|
113
|
+
// ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.4.0/node_modules/@osdk/shared.net.platformapi/build/esm/foundryPlatformFetch.js
|
|
114
114
|
async function foundryPlatformFetch(client, [httpMethodNum, origPath, flags, contentType, responseContentType], ...args) {
|
|
115
115
|
const path21 = origPath.replace(/\{([^}]+)\}/g, () => encodeURIComponent(args.shift()));
|
|
116
116
|
const body = flags & 1 ? args.shift() : void 0;
|
|
@@ -137,7 +137,11 @@ async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, h
|
|
|
137
137
|
headersInit.set("Content-Type", requestMediaType ?? "application/json");
|
|
138
138
|
headersInit.set("Accept", responseMediaType ?? "application/json");
|
|
139
139
|
Object.entries(headers || {}).forEach(([key2, value]) => {
|
|
140
|
-
if (value
|
|
140
|
+
if (key2 === "Content-Type" && typeof value === "string") {
|
|
141
|
+
headersInit.set("Content-Type", value);
|
|
142
|
+
} else if (key2 === "Accept" && typeof value === "string") {
|
|
143
|
+
headersInit.set("Accept", value);
|
|
144
|
+
} else if (value != null) {
|
|
141
145
|
headersInit.append(key2, value.toString());
|
|
142
146
|
}
|
|
143
147
|
});
|
|
@@ -171,37 +175,37 @@ function parseUrl(baseUrl, endpointPath) {
|
|
|
171
175
|
return new URL(`api${endpointPath}`, baseUrl);
|
|
172
176
|
}
|
|
173
177
|
|
|
174
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
178
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
175
179
|
init_esm_shims();
|
|
176
180
|
|
|
177
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
181
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
|
|
178
182
|
init_esm_shims();
|
|
179
183
|
|
|
180
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
184
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/AttachmentPropertyV2.js
|
|
181
185
|
init_esm_shims();
|
|
182
186
|
|
|
183
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
187
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/CipherTextProperty.js
|
|
184
188
|
init_esm_shims();
|
|
185
189
|
|
|
186
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
190
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/LinkedObjectV2.js
|
|
187
191
|
init_esm_shims();
|
|
188
192
|
|
|
189
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
193
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
|
|
190
194
|
init_esm_shims();
|
|
191
195
|
|
|
192
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
196
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
193
197
|
init_esm_shims();
|
|
194
198
|
|
|
195
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
199
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
196
200
|
init_esm_shims();
|
|
197
201
|
|
|
198
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
202
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
|
|
199
203
|
init_esm_shims();
|
|
200
204
|
|
|
201
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
205
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectV2.js
|
|
202
206
|
init_esm_shims();
|
|
203
207
|
|
|
204
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
208
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyV2.js
|
|
205
209
|
var OntologyV2_exports = {};
|
|
206
210
|
__export(OntologyV2_exports, {
|
|
207
211
|
get: () => get,
|
|
@@ -227,16 +231,16 @@ function loadMetadata($ctx, ...args) {
|
|
|
227
231
|
return foundryPlatformFetch($ctx, _loadMetadata, ...args);
|
|
228
232
|
}
|
|
229
233
|
|
|
230
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
234
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
|
|
231
235
|
init_esm_shims();
|
|
232
236
|
|
|
233
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
237
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
234
238
|
init_esm_shims();
|
|
235
239
|
|
|
236
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
240
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
237
241
|
init_esm_shims();
|
|
238
242
|
|
|
239
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
243
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
240
244
|
init_esm_shims();
|
|
241
245
|
|
|
242
246
|
// ../generator/build/esm/index.js
|
|
@@ -443,12 +447,16 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2,
|
|
|
443
447
|
apiName: interfaceType.apiName,
|
|
444
448
|
displayName: interfaceType.displayName,
|
|
445
449
|
description: interfaceType.description,
|
|
446
|
-
implements: interfaceType.allExtendsInterfaces
|
|
450
|
+
implements: interfaceType.allExtendsInterfaces ? [...interfaceType.allExtendsInterfaces].sort((a, b) => a.localeCompare(b)) : interfaceType.extendsInterfaces ? [...interfaceType.extendsInterfaces].sort((a, b) => a.localeCompare(b)) : void 0,
|
|
447
451
|
properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key2, value]) => {
|
|
448
452
|
return [key2, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];
|
|
449
|
-
}).filter(([
|
|
450
|
-
links: {},
|
|
451
|
-
|
|
453
|
+
}).filter(([_, value]) => value != null)),
|
|
454
|
+
links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).map(([linkApiName, linkType]) => [linkApiName, {
|
|
455
|
+
multiplicity: linkType.cardinality === "MANY",
|
|
456
|
+
targetTypeApiName: linkType.linkedEntityApiName.apiName,
|
|
457
|
+
targetType: linkType.linkedEntityApiName.type === "objectTypeApiName" ? "object" : "interface"
|
|
458
|
+
}])),
|
|
459
|
+
implementedBy: interfaceType.implementedByObjectTypes ? [...interfaceType.implementedByObjectTypes].sort((a, b) => a.localeCompare(b)) : interfaceType.implementedByObjectTypes
|
|
452
460
|
};
|
|
453
461
|
}
|
|
454
462
|
|
|
@@ -531,14 +539,14 @@ function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, l
|
|
|
531
539
|
description: objectTypeWithLink.objectType.description,
|
|
532
540
|
primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,
|
|
533
541
|
primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),
|
|
534
|
-
links: Object.fromEntries(objectTypeWithLink.linkTypes.map((linkType) => {
|
|
542
|
+
links: Object.fromEntries([...objectTypeWithLink.linkTypes].sort((a, b) => a.apiName.localeCompare(b.apiName)).map((linkType) => {
|
|
535
543
|
return [linkType.apiName, {
|
|
536
544
|
multiplicity: linkType.cardinality === "MANY",
|
|
537
545
|
targetType: linkType.objectTypeApiName
|
|
538
546
|
}];
|
|
539
547
|
})),
|
|
540
|
-
properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key2, value]) => [key2, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key2), log)]).filter(([
|
|
541
|
-
implements: objectTypeWithLink.implementsInterfaces,
|
|
548
|
+
properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key2, value]) => [key2, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key2), log)]).filter(([_, value]) => value != null)),
|
|
549
|
+
implements: objectTypeWithLink.implementsInterfaces ? [...objectTypeWithLink.implementsInterfaces].sort((a, b) => a.localeCompare(b)) : objectTypeWithLink.implementsInterfaces,
|
|
542
550
|
interfaceMap,
|
|
543
551
|
inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),
|
|
544
552
|
icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : void 0,
|
|
@@ -692,6 +700,18 @@ function wireQueryDataTypeToQueryDataTypeDefinition(input) {
|
|
|
692
700
|
objectSet: input.objectTypeApiName,
|
|
693
701
|
nullable: false
|
|
694
702
|
};
|
|
703
|
+
case "interfaceObject":
|
|
704
|
+
return {
|
|
705
|
+
type: "interface",
|
|
706
|
+
interface: input.interfaceTypeApiName,
|
|
707
|
+
nullable: false
|
|
708
|
+
};
|
|
709
|
+
case "interfaceObjectSet":
|
|
710
|
+
return {
|
|
711
|
+
type: "interfaceObjectSet",
|
|
712
|
+
objectSet: input.interfaceTypeApiName,
|
|
713
|
+
nullable: false
|
|
714
|
+
};
|
|
695
715
|
case "array":
|
|
696
716
|
return {
|
|
697
717
|
...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),
|
|
@@ -21892,8 +21912,10 @@ function createDefinition(object, ontology, identifier, {
|
|
|
21892
21912
|
strictProps: ${osdkObjectStrictPropsIdentifier};
|
|
21893
21913
|
${stringify(definition, {
|
|
21894
21914
|
links: () => `{
|
|
21895
|
-
${stringify(definition.links, {
|
|
21896
|
-
"*": (
|
|
21915
|
+
${definition.type === "interface" ? stringify(definition.links, {
|
|
21916
|
+
"*": (linkDefinition) => `$InterfaceMetadata.Link<${linkDefinition.targetType === "interface" ? ontology.requireInterfaceType(linkDefinition.targetTypeApiName).getImportedDefinitionIdentifier(true) : ontology.requireObjectType(linkDefinition.targetTypeApiName).getImportedDefinitionIdentifier(true)}, ${linkDefinition.multiplicity}>`
|
|
21917
|
+
}) : stringify(definition.links, {
|
|
21918
|
+
"*": (linkDefinition) => `$ObjectMetadata.Link<${ontology.requireObjectType(linkDefinition.targetType).getImportedDefinitionIdentifier(true)}, ${linkDefinition.multiplicity}>`
|
|
21897
21919
|
})}
|
|
21898
21920
|
}`,
|
|
21899
21921
|
properties: () => `{
|
|
@@ -21935,8 +21957,9 @@ function remapStructType(structType) {
|
|
|
21935
21957
|
}
|
|
21936
21958
|
|
|
21937
21959
|
// ../generator/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js
|
|
21938
|
-
function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false) {
|
|
21960
|
+
function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false, currentFilePath = "") {
|
|
21939
21961
|
const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw));
|
|
21962
|
+
const uniqueLinkTargetTypes = new Set(definition.links ? Object.values(definition.links).map((a) => a.targetType === "object" ? ontology.requireObjectType(a.targetTypeApiName) : ontology.requireInterfaceType(a.targetTypeApiName)) : []);
|
|
21940
21963
|
const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);
|
|
21941
21964
|
const parents = definition.implements?.map((p) => {
|
|
21942
21965
|
const parent = ontology.requireInterfaceType(p, true);
|
|
@@ -21983,26 +22006,28 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology,
|
|
|
21983
22006
|
throw new Error(`Interfaces with fully qualified api names MUST NOT have any properties with an unqualified api name. Interface: ${interfaceDef.fullApiName}, properties: ${badProperties.join(", ")}`);
|
|
21984
22007
|
}
|
|
21985
22008
|
}
|
|
21986
|
-
|
|
22009
|
+
const imports = getObjectImports(uniqueLinkTargetTypes, definition.apiName, currentFilePath, true);
|
|
22010
|
+
return `${imports}
|
|
21987
22011
|
${v2 ? function(forInternalUse2 = false) {
|
|
21988
22012
|
return `import type {
|
|
21989
22013
|
InterfaceDefinition as $InterfaceDefinition,
|
|
22014
|
+
InterfaceMetadata as $InterfaceMetadata,
|
|
21990
22015
|
ObjectSet as $ObjectSet,
|
|
21991
22016
|
Osdk as $Osdk,
|
|
21992
22017
|
PropertyValueWireToClient as $PropType,
|
|
21993
22018
|
} from "${forInternalUse2 ? "@osdk/api" : "@osdk/client"}";
|
|
21994
22019
|
|
|
21995
|
-
${Object.keys(definition.links).length
|
|
22020
|
+
${definition.links ? Object.keys(definition.links).length > 0 ? `
|
|
21996
22021
|
export interface ${osdkObjectLinksIdentifier} {
|
|
21997
22022
|
${stringify(definition.links, {
|
|
21998
22023
|
"*": (definition2) => {
|
|
21999
|
-
const linkTarget = ontology.requireObjectType(definition2.
|
|
22000
|
-
return `${definition2.multiplicity ? `${linkTarget}
|
|
22024
|
+
const linkTarget = definition2.targetType === "object" ? ontology.requireObjectType(definition2.targetTypeApiName).getImportedDefinitionIdentifier(v2) : ontology.requireInterfaceType(definition2.targetTypeApiName).getImportedDefinitionIdentifier(v2);
|
|
22025
|
+
return `${definition2.multiplicity ? `${linkTarget}.ObjectSet` : `${linkTarget}.ObjectSet`}
|
|
22001
22026
|
`;
|
|
22002
22027
|
}
|
|
22003
22028
|
})}
|
|
22004
22029
|
}
|
|
22005
|
-
`}
|
|
22030
|
+
` : `export type ${osdkObjectLinksIdentifier} = {};` : `export type ${osdkObjectLinksIdentifier} = {};`}
|
|
22006
22031
|
|
|
22007
22032
|
export namespace ${interfaceDef.shortApiName} {
|
|
22008
22033
|
|
|
@@ -22045,10 +22070,11 @@ async function generatePerInterfaceDataFiles({
|
|
|
22045
22070
|
});
|
|
22046
22071
|
for (const obj of Object.values(ontology.interfaceTypes)) {
|
|
22047
22072
|
if (obj instanceof ForeignType) continue;
|
|
22073
|
+
const relPath = path19__default.join(".", "ontology", "interfaces", `${obj.shortApiName}.ts`);
|
|
22048
22074
|
await fs9.writeFile(path19__default.join(interfacesDir, `${obj.shortApiName}.ts`), await formatTs(`
|
|
22049
22075
|
import type { PropertyDef as $PropertyDef } from "${forInternalUse ? "@osdk/api" : "@osdk/client"}";
|
|
22050
22076
|
import { $osdkMetadata } from "../../OntologyMetadata${importExt}";
|
|
22051
|
-
${__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(obj, ontology, true, forInternalUse)}
|
|
22077
|
+
${__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(obj, ontology, true, forInternalUse, relPath)}
|
|
22052
22078
|
`));
|
|
22053
22079
|
}
|
|
22054
22080
|
await fs9.writeFile(interfacesDir + ".ts", await formatTs(`
|
|
@@ -22089,6 +22115,69 @@ async function generatePerObjectDataFiles(ctx) {
|
|
|
22089
22115
|
// ../generator/build/esm/v2.0/generatePerQueryDataFiles.js
|
|
22090
22116
|
init_esm_shims();
|
|
22091
22117
|
|
|
22118
|
+
// ../generator/build/esm/shared/getInterfaceTypeApiNamesFromQuery.js
|
|
22119
|
+
init_esm_shims();
|
|
22120
|
+
|
|
22121
|
+
// ../generator/build/esm/shared/getInterfaceTypesFromQueryDataType.js
|
|
22122
|
+
init_esm_shims();
|
|
22123
|
+
function getInterfaceTypesFromQueryDataType(dataType, types) {
|
|
22124
|
+
switch (dataType.type) {
|
|
22125
|
+
case "array":
|
|
22126
|
+
case "set":
|
|
22127
|
+
getInterfaceTypesFromQueryDataType(dataType.subType, types);
|
|
22128
|
+
return;
|
|
22129
|
+
case "interfaceObject":
|
|
22130
|
+
case "interfaceObjectSet":
|
|
22131
|
+
types.add(dataType.interfaceTypeApiName);
|
|
22132
|
+
return;
|
|
22133
|
+
case "struct":
|
|
22134
|
+
for (const prop of Object.values(dataType.fields)) {
|
|
22135
|
+
getInterfaceTypesFromQueryDataType(prop.fieldType, types);
|
|
22136
|
+
}
|
|
22137
|
+
return;
|
|
22138
|
+
case "union":
|
|
22139
|
+
for (const type2 of dataType.unionTypes) {
|
|
22140
|
+
getInterfaceTypesFromQueryDataType(type2, types);
|
|
22141
|
+
}
|
|
22142
|
+
return;
|
|
22143
|
+
case "entrySet":
|
|
22144
|
+
getInterfaceTypesFromQueryDataType(dataType.keyType, types);
|
|
22145
|
+
getInterfaceTypesFromQueryDataType(dataType.valueType, types);
|
|
22146
|
+
return;
|
|
22147
|
+
case "attachment":
|
|
22148
|
+
case "boolean":
|
|
22149
|
+
case "date":
|
|
22150
|
+
case "double":
|
|
22151
|
+
case "float":
|
|
22152
|
+
case "integer":
|
|
22153
|
+
case "long":
|
|
22154
|
+
case "null":
|
|
22155
|
+
case "string":
|
|
22156
|
+
case "threeDimensionalAggregation":
|
|
22157
|
+
case "timestamp":
|
|
22158
|
+
case "twoDimensionalAggregation":
|
|
22159
|
+
case "entrySet":
|
|
22160
|
+
case "unsupported":
|
|
22161
|
+
case "object":
|
|
22162
|
+
case "objectSet":
|
|
22163
|
+
return;
|
|
22164
|
+
default:
|
|
22165
|
+
throw new Error(`Unknown query data type ${dataType.type}`);
|
|
22166
|
+
}
|
|
22167
|
+
}
|
|
22168
|
+
|
|
22169
|
+
// ../generator/build/esm/shared/getInterfaceTypeApiNamesFromQuery.js
|
|
22170
|
+
function getInterfaceTypeApiNamesFromQuery(query) {
|
|
22171
|
+
const types = /* @__PURE__ */ new Set();
|
|
22172
|
+
for (const {
|
|
22173
|
+
dataType
|
|
22174
|
+
} of Object.values(query.parameters)) {
|
|
22175
|
+
getInterfaceTypesFromQueryDataType(dataType, types);
|
|
22176
|
+
}
|
|
22177
|
+
getInterfaceTypesFromQueryDataType(query.output, types);
|
|
22178
|
+
return Array.from(types);
|
|
22179
|
+
}
|
|
22180
|
+
|
|
22092
22181
|
// ../generator/build/esm/shared/getObjectTypeApiNamesFromQuery.js
|
|
22093
22182
|
init_esm_shims();
|
|
22094
22183
|
|
|
@@ -22134,9 +22223,11 @@ function getObjectTypesFromQueryDataType(dataType, types) {
|
|
|
22134
22223
|
case "twoDimensionalAggregation":
|
|
22135
22224
|
case "entrySet":
|
|
22136
22225
|
case "unsupported":
|
|
22226
|
+
case "interfaceObject":
|
|
22227
|
+
case "interfaceObjectSet":
|
|
22137
22228
|
return;
|
|
22138
22229
|
default:
|
|
22139
|
-
throw new Error(`
|
|
22230
|
+
throw new Error(`Unknown query data type ${dataType.type}`);
|
|
22140
22231
|
}
|
|
22141
22232
|
}
|
|
22142
22233
|
|
|
@@ -22177,8 +22268,9 @@ async function generatePerQueryDataFilesV2({
|
|
|
22177
22268
|
async function generateV2QueryFile(fs9, outDir, relOutDir, query, importExt, ontology, forInternalUse, fixedVersionQueryTypes) {
|
|
22178
22269
|
const relFilePath = path19__default.join(relOutDir, `${query.shortApiName}.ts`);
|
|
22179
22270
|
const objectTypes = getObjectTypeApiNamesFromQuery(query);
|
|
22180
|
-
const
|
|
22181
|
-
const
|
|
22271
|
+
const interfaceTypes = getInterfaceTypeApiNamesFromQuery(query);
|
|
22272
|
+
const interfaceAndObjectTypes = /* @__PURE__ */ new Set([...objectTypes.map((o) => ontology.requireObjectType(o)), ...interfaceTypes.map((o) => ontology.requireInterfaceType(o))]);
|
|
22273
|
+
const importObjects = getObjectImports(interfaceAndObjectTypes, "", relFilePath, true);
|
|
22182
22274
|
const baseProps = deleteUndefineds(wireQueryTypeV2ToSdkQueryDefinitionNoParams(query.raw));
|
|
22183
22275
|
const outputBase = deleteUndefineds(wireQueryDataTypeToQueryDataTypeDefinition(query.output));
|
|
22184
22276
|
const isUsingFixedVersion = fixedVersionQueryTypes.includes(query.fullApiName);
|
|
@@ -22329,9 +22421,15 @@ function getQueryParamType(enhancedOntology, input, type2, isMapKey = false) {
|
|
|
22329
22421
|
}
|
|
22330
22422
|
inner = `Query${type2}.ObjectType<${enhancedOntology.requireObjectType(input.object).getImportedDefinitionIdentifier(true)}>`;
|
|
22331
22423
|
break;
|
|
22424
|
+
case "interface":
|
|
22425
|
+
inner = `Query${type2}.InterfaceType<${enhancedOntology.requireInterfaceType(input.interface).getImportedDefinitionIdentifier(true)}>`;
|
|
22426
|
+
break;
|
|
22332
22427
|
case "objectSet":
|
|
22333
22428
|
inner = `Query${type2}.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet).getImportedDefinitionIdentifier(true)}>`;
|
|
22334
22429
|
break;
|
|
22430
|
+
case "interfaceObjectSet":
|
|
22431
|
+
inner = `Query${type2}.ObjectSetType<${enhancedOntology.requireInterfaceType(input.objectSet).getImportedDefinitionIdentifier(true)}>`;
|
|
22432
|
+
break;
|
|
22335
22433
|
case "set":
|
|
22336
22434
|
inner = `${type2 === "Param" ? "Readonly" : ""}Set<${getQueryParamType(enhancedOntology, input.set, type2)}>`;
|
|
22337
22435
|
break;
|
|
@@ -22544,7 +22642,7 @@ function createSharedClientContext(baseUrl, tokenProvider, userAgent, fetchFn =
|
|
|
22544
22642
|
|
|
22545
22643
|
// ../cli.cmd.typescript/build/esm/generate/handleGenerate.mjs
|
|
22546
22644
|
var import_fast_deep_equal2 = __toESM(require_fast_deep_equal(), 1);
|
|
22547
|
-
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.
|
|
22645
|
+
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.29.0-beta.1"}`;
|
|
22548
22646
|
async function handleGenerate(args) {
|
|
22549
22647
|
let success = false;
|
|
22550
22648
|
if (args.ontologyPath) {
|
|
@@ -22680,7 +22778,7 @@ async function generateClientSdk(ontology, args) {
|
|
|
22680
22778
|
}
|
|
22681
22779
|
return true;
|
|
22682
22780
|
}
|
|
22683
|
-
await generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.
|
|
22781
|
+
await generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.29.0-beta.1", args.externalObjects, args.externalInterfaces);
|
|
22684
22782
|
return true;
|
|
22685
22783
|
} catch (e) {
|
|
22686
22784
|
consola.error("OSDK generation failed", e.message, e.stack);
|
|
@@ -22707,8 +22805,8 @@ async function getDependencyVersions() {
|
|
|
22707
22805
|
typescriptVersion,
|
|
22708
22806
|
tslibVersion,
|
|
22709
22807
|
areTheTypesWrongVersion,
|
|
22710
|
-
osdkApiVersion: `^${"2.
|
|
22711
|
-
osdkClientVersion: `^${"2.
|
|
22808
|
+
osdkApiVersion: `^${"2.5.0-beta.1"}`,
|
|
22809
|
+
osdkClientVersion: `^${"2.5.0-beta.1"}`,
|
|
22712
22810
|
osdkLegacyClientVersion
|
|
22713
22811
|
};
|
|
22714
22812
|
}
|
|
@@ -22747,5 +22845,5 @@ function createNormalFs() {
|
|
|
22747
22845
|
}
|
|
22748
22846
|
|
|
22749
22847
|
export { getDependencyVersions, handleGenerate, updateVersionsIfTheyExist };
|
|
22750
|
-
//# sourceMappingURL=handleGenerate-
|
|
22751
|
-
//# sourceMappingURL=handleGenerate-
|
|
22848
|
+
//# sourceMappingURL=handleGenerate-FCOJJA72.js.map
|
|
22849
|
+
//# sourceMappingURL=handleGenerate-FCOJJA72.js.map
|