@pptb/types 1.0.1 → 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 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptb/types",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "TypeScript type definitions for Power Platform Tool Box API",
5
5
  "main": "index.d.ts",
6
6
  "types": "index.d.ts",
package/toolboxAPI.d.ts CHANGED
@@ -85,6 +85,7 @@ declare namespace ToolBoxAPI {
85
85
  shell?: string;
86
86
  cwd?: string;
87
87
  env?: Record<string, string>;
88
+ visible?: boolean; // Whether terminal should be visible initially (default: true)
88
89
  }
89
90
 
90
91
  /**
@@ -201,6 +202,40 @@ declare namespace ToolBoxAPI {
201
202
  off: (callback: (event: any, payload: ToolBoxEventPayload) => void) => void;
202
203
  }
203
204
 
205
+ /**
206
+ * Settings namespace - context-aware tool settings
207
+ * All settings operations automatically use the current tool's ID
208
+ */
209
+ export interface SettingsAPI {
210
+ /**
211
+ * Get all settings for this tool
212
+ * @returns Promise resolving to an object with all settings (empty object if no settings exist)
213
+ */
214
+ getSettings: () => Promise<Record<string, any>>;
215
+
216
+ /**
217
+ * Get a specific setting by key
218
+ * @param key The setting key to retrieve
219
+ * @returns Promise resolving to the setting value, or undefined if not found
220
+ */
221
+ getSetting: (key: string) => Promise<any>;
222
+
223
+ /**
224
+ * Set a specific setting by key
225
+ * @param key The setting key to set
226
+ * @param value The value to store (can be any JSON-serializable value)
227
+ * @returns Promise that resolves when the setting is saved
228
+ */
229
+ setSetting: (key: string, value: any) => Promise<void>;
230
+
231
+ /**
232
+ * Set all settings (replaces entire settings object)
233
+ * @param settings The settings object to store
234
+ * @returns Promise that resolves when the settings are saved
235
+ */
236
+ setSettings: (settings: Record<string, any>) => Promise<void>;
237
+ }
238
+
204
239
  /**
205
240
  * Main ToolBox API exposed to tools via window.toolboxAPI
206
241
  */
@@ -215,6 +250,11 @@ declare namespace ToolBoxAPI {
215
250
  */
216
251
  utils: UtilsAPI;
217
252
 
253
+ /**
254
+ * Tool-specific settings (context-aware)
255
+ */
256
+ settings: SettingsAPI;
257
+
218
258
  /**
219
259
  * Terminal operations (context-aware)
220
260
  */