@pptb/types 1.0.2 → 1.0.3
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/dataverseAPI.d.ts +60 -1
- package/package.json +1 -1
package/dataverseAPI.d.ts
CHANGED
|
@@ -205,14 +205,20 @@ declare namespace DataverseAPI {
|
|
|
205
205
|
* Get metadata for a specific entity
|
|
206
206
|
*
|
|
207
207
|
* @param entityLogicalName - Logical name of the entity
|
|
208
|
+
* @param selectColumns - Optional array of column names to retrieve (retrieves all if not specified)
|
|
208
209
|
* @returns Object containing entity metadata
|
|
209
210
|
*
|
|
210
211
|
* @example
|
|
211
212
|
* const metadata = await dataverseAPI.getEntityMetadata('account');
|
|
212
213
|
* console.log('Display Name:', metadata.DisplayName?.LocalizedLabels[0]?.Label);
|
|
213
214
|
* console.log('Attributes:', metadata.Attributes?.length);
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* // Get only specific metadata columns
|
|
218
|
+
* const metadata = await dataverseAPI.getEntityMetadata('account', ['LogicalName', 'DisplayName']);
|
|
219
|
+
* console.log('Display Name:', metadata.DisplayName?.LocalizedLabels[0]?.Label);
|
|
214
220
|
*/
|
|
215
|
-
getEntityMetadata: (entityLogicalName: string) => Promise<EntityMetadata>;
|
|
221
|
+
getEntityMetadata: (entityLogicalName: string, selectColumns?: string[]) => Promise<EntityMetadata>;
|
|
216
222
|
|
|
217
223
|
/**
|
|
218
224
|
* Get metadata for all entities
|
|
@@ -227,6 +233,59 @@ declare namespace DataverseAPI {
|
|
|
227
233
|
* });
|
|
228
234
|
*/
|
|
229
235
|
getAllEntitiesMetadata: () => Promise<EntityMetadataCollection>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Get related metadata for a specific entity (attributes, relationships, etc.)
|
|
239
|
+
*
|
|
240
|
+
* @param entityLogicalName - Logical name of the entity
|
|
241
|
+
* @param relatedPath - Path after EntityDefinitions(LogicalName='name') (e.g., 'Attributes', 'OneToManyRelationships', 'ManyToOneRelationships', 'ManyToManyRelationships', 'Keys')
|
|
242
|
+
* @param selectColumns - Optional array of column names to retrieve (retrieves all if not specified)
|
|
243
|
+
* @returns Object containing the related metadata
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* // Get all attributes for an entity
|
|
247
|
+
* const attributes = await dataverseAPI.getEntityRelatedMetadata('account', 'Attributes');
|
|
248
|
+
* console.log('Attributes:', attributes.value);
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* // Get specific attributes with select
|
|
252
|
+
* const attributes = await dataverseAPI.getEntityRelatedMetadata(
|
|
253
|
+
* 'account',
|
|
254
|
+
* 'Attributes',
|
|
255
|
+
* ['LogicalName', 'DisplayName', 'AttributeType']
|
|
256
|
+
* );
|
|
257
|
+
* console.log('Filtered attributes:', attributes.value);
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* // Get one-to-many relationships
|
|
261
|
+
* const relationships = await dataverseAPI.getEntityRelatedMetadata(
|
|
262
|
+
* 'account',
|
|
263
|
+
* 'OneToManyRelationships'
|
|
264
|
+
* );
|
|
265
|
+
* console.log('One-to-many relationships:', relationships.value);
|
|
266
|
+
*/
|
|
267
|
+
getEntityRelatedMetadata: (entityLogicalName: string, relatedPath: string, selectColumns?: string[]) => Promise<Record<string, unknown>>;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Get solutions from the environment
|
|
271
|
+
*
|
|
272
|
+
* @param selectColumns - Required array of column names to retrieve (must contain at least one column)
|
|
273
|
+
* @returns Object with value array containing solutions
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* const solutions = await dataverseAPI.getSolutions([
|
|
277
|
+
* 'solutionid',
|
|
278
|
+
* 'uniquename',
|
|
279
|
+
* 'friendlyname',
|
|
280
|
+
* 'version',
|
|
281
|
+
* 'ismanaged'
|
|
282
|
+
* ]);
|
|
283
|
+
* console.log(`Total solutions: ${solutions.value.length}`);
|
|
284
|
+
* solutions.value.forEach(solution => {
|
|
285
|
+
* console.log(`${solution.friendlyname} (${solution.uniquename}) - v${solution.version}`);
|
|
286
|
+
* });
|
|
287
|
+
*/
|
|
288
|
+
getSolutions: (selectColumns: string[]) => Promise<{ value: Record<string, unknown>[] }>;
|
|
230
289
|
}
|
|
231
290
|
}
|
|
232
291
|
|