@pptb/types 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/dataverseAPI.d.ts +34 -0
  2. package/package.json +1 -1
package/dataverseAPI.d.ts CHANGED
@@ -286,6 +286,40 @@ declare namespace DataverseAPI {
286
286
  * });
287
287
  */
288
288
  getSolutions: (selectColumns: string[]) => Promise<{ value: Record<string, unknown>[] }>;
289
+
290
+ /**
291
+ * Query data from Dataverse using OData query parameters
292
+ *
293
+ * @param entityLogicalName - Logical name of the entity to query (e.g., 'account', 'contact')
294
+ * @param odataQuery - OData query string with parameters like $select, $filter, $orderby, $top, $skip, $expand
295
+ * @returns Object with value array containing matching records
296
+ *
297
+ * @example
298
+ * // Get top 10 active accounts with specific fields
299
+ * const result = await dataverseAPI.queryData(
300
+ * 'account',
301
+ * '$select=name,emailaddress1,telephone1&$filter=statecode eq 0&$orderby=name&$top=10'
302
+ * );
303
+ * console.log(`Found ${result.value.length} records`);
304
+ * result.value.forEach(record => {
305
+ * console.log(`${record.name} - ${record.emailaddress1}`);
306
+ * });
307
+ *
308
+ * @example
309
+ * // Query with expand to include related records
310
+ * const result = await dataverseAPI.queryData(
311
+ * 'account',
312
+ * '$select=name,accountid&$expand=contact_customer_accounts($select=fullname,emailaddress1)&$top=5'
313
+ * );
314
+ *
315
+ * @example
316
+ * // Simple query with just a filter
317
+ * const result = await dataverseAPI.queryData(
318
+ * 'contact',
319
+ * '$filter=contains(fullname, \'Smith\')&$top=20'
320
+ * );
321
+ */
322
+ queryData: (entityLogicalName: string, odataQuery: string) => Promise<{ value: Record<string, unknown>[] }>;
289
323
  }
290
324
  }
291
325
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptb/types",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "TypeScript type definitions for Power Platform Tool Box API",
5
5
  "main": "index.d.ts",
6
6
  "types": "index.d.ts",