@pptb/types 1.0.11 → 1.0.12

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
@@ -380,6 +380,56 @@ declare namespace DataverseAPI {
380
380
  * const result = await dataverseAPI.queryData('$filter=statecode eq 0', 'secondary');
381
381
  */
382
382
  queryData: (odataQuery: string, connectionTarget?: "primary" | "secondary") => Promise<{ value: Record<string, unknown>[] }>;
383
+
384
+ /**
385
+ * Create multiple records in Dataverse
386
+ *
387
+ * @param entityLogicalName - Logical name of the entity (e.g., 'account', 'contact')
388
+ * @param records - Array of record data to create, including the "@odata.type" property for each record
389
+ * @param connectionTarget - Optional connection target for multi-connection tools ('primary' or 'secondary'). Defaults to 'primary'.
390
+ * @returns Array of strings representing the created record IDs
391
+ *
392
+ * @example
393
+ * const results = await dataverseAPI.createMultiple('account', [
394
+ * { name: 'Contoso Ltd', "@odata.type": "Microsoft.Dynamics.CRM.account" },
395
+ * { name: 'Fabrikam Inc', "@odata.type": "Microsoft.Dynamics.CRM.account" }
396
+ * ]);
397
+ */
398
+ createMultiple: (entityLogicalName: string, records: Record<string, unknown>[], connectionTarget?: "primary" | "secondary") => Promise<string[]>;
399
+
400
+ /**
401
+ * Update multiple records in Dataverse
402
+ * @param entityLogicalName - Logical name of the entity
403
+ * @param records - Array of record data to update, each including the "id" property and the "odata.type" property
404
+ * @param connectionTarget - Optional connection target for multi-connection tools ('primary' or 'secondary'). Defaults to 'primary'.
405
+ *
406
+ * @example
407
+ * await dataverseAPI.updateMultiple('account', [
408
+ * { accountid: 'guid-1', name: 'Updated Name 1', "@odata.type": "Microsoft.Dynamics.CRM.account" },
409
+ * { accountid: 'guid-2', name: 'Updated Name 2', "@odata.type": "Microsoft.Dynamics.CRM.account" }
410
+ * ]);
411
+ */
412
+ updateMultiple: (entityLogicalName: string, records: Record<string, unknown>[], connectionTarget?: "primary" | "secondary") => Promise<void>;
413
+ * Gets the Dataverse entity set (collection) name for the specified table.
414
+ *
415
+ * This is typically used when building OData queries where the collection name
416
+ * (entity set name) is required instead of the logical table name.
417
+ *
418
+ * Note: This is a utility method that applies pluralization rules and does not
419
+ * require an active connection to Dataverse.
420
+ *
421
+ * @param entityLogicalName - The logical name of the Dataverse table (for example, "account").
422
+ * @returns The corresponding entity set name (for example, "accounts").
423
+ *
424
+ * @example
425
+ * const entitySetName = await dataverseAPI.getEntitySetName('account');
426
+ * console.log(entitySetName); // Output: "accounts"
427
+ *
428
+ * @example
429
+ * const entitySetName = await dataverseAPI.getEntitySetName('opportunity');
430
+ * console.log(entitySetName); // Output: "opportunities"
431
+ */
432
+ getEntitySetName: (entityLogicalName: string) => Promise<string>;
383
433
  }
384
434
  }
385
435
 
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
- "name": "@pptb/types",
3
- "version": "1.0.11",
4
- "description": "TypeScript type definitions for Power Platform Tool Box API",
5
- "main": "index.d.ts",
6
- "types": "index.d.ts",
7
- "keywords": [
8
- "powerplatform",
9
- "pptb",
10
- "toolbox",
11
- "types",
12
- "typescript",
13
- "dataverse"
14
- ],
15
- "author": "Power Platform Tool Box",
16
- "license": "GPL-3.0",
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/PowerPlatformToolBox/desktop-app.git",
20
- "directory": "packages"
21
- }
22
- }
2
+ "name": "@pptb/types",
3
+ "version": "1.0.12",
4
+ "description": "TypeScript type definitions for Power Platform Tool Box API",
5
+ "main": "index.d.ts",
6
+ "types": "index.d.ts",
7
+ "keywords": [
8
+ "powerplatform",
9
+ "pptb",
10
+ "toolbox",
11
+ "types",
12
+ "typescript",
13
+ "dataverse"
14
+ ],
15
+ "author": "Power Platform Tool Box",
16
+ "license": "GPL-3.0",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/PowerPlatformToolBox/desktop-app.git",
20
+ "directory": "packages"
21
+ }
22
+ }
package/toolboxAPI.d.ts CHANGED
@@ -65,6 +65,11 @@ declare namespace ToolBoxAPI {
65
65
  tenantId?: string;
66
66
  createdAt: string;
67
67
  lastUsedAt?: string;
68
+ /**
69
+ * @deprecated isActive is a legacy field that is no longer persisted.
70
+ * It may be present in older tool code but should not be relied upon.
71
+ * Use the connection context provided by the ToolBox API instead.
72
+ */
68
73
  isActive?: boolean;
69
74
  }
70
75