@pptb/types 1.2.4-beta.4 → 1.2.4-beta.5

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/README.md CHANGED
@@ -622,8 +622,9 @@ Core platform features organized into namespaces:
622
622
 
623
623
  #### Connections
624
624
 
625
- - **getActiveConnection()**: Promise<DataverseConnection | null>
626
- - Returns the currently active Dataverse connection or null if none is active
625
+ - **getActiveConnection()**: Promise<Connection | null>
626
+ - Returns the currently active connection or null if none is active
627
+ - Includes `enabledForPowerPlatformAPI` so tools can decide whether to use Power Platform API
627
628
 
628
629
  #### Utils
629
630
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptb/types",
3
- "version": "1.2.4-beta.4",
3
+ "version": "1.2.4-beta.5",
4
4
  "description": "Type definitions for Power Platform ToolBox APIs and validity checks for tool packages",
5
5
  "main": "index.d.ts",
6
6
  "types": "index.d.ts",
package/toolboxAPI.d.ts CHANGED
@@ -75,9 +75,9 @@ declare namespace ToolBoxAPI {
75
75
  }
76
76
 
77
77
  /**
78
- * Dataverse connection configuration
78
+ * Power Platform ToolBox connection configuration
79
79
  */
80
- export interface DataverseConnection {
80
+ export interface Connection {
81
81
  id: string;
82
82
  name: string;
83
83
  url: string;
@@ -85,6 +85,7 @@ declare namespace ToolBoxAPI {
85
85
  category?: string;
86
86
  environmentColor?: string;
87
87
  categoryColor?: string;
88
+ enabledForPowerPlatformAPI?: boolean;
88
89
  createdAt?: string;
89
90
  lastUsedAt?: string;
90
91
  /**
@@ -95,6 +96,11 @@ declare namespace ToolBoxAPI {
95
96
  isActive?: boolean;
96
97
  }
97
98
 
99
+ /**
100
+ * @deprecated Use Connection instead.
101
+ */
102
+ export type DataverseConnection = Connection;
103
+
98
104
  /**
99
105
  * Tool information
100
106
  */
@@ -150,12 +156,12 @@ declare namespace ToolBoxAPI {
150
156
  /**
151
157
  * Get the currently active Dataverse connection
152
158
  */
153
- getActiveConnection: () => Promise<DataverseConnection | null>;
159
+ getActiveConnection: () => Promise<Connection | null>;
154
160
 
155
161
  /**
156
162
  * Get the secondary connection for multi-connection tools
157
163
  */
158
- getSecondaryConnection: () => Promise<DataverseConnection | null>;
164
+ getSecondaryConnection: () => Promise<Connection | null>;
159
165
  }
160
166
 
161
167
  /**
@@ -498,7 +504,11 @@ declare namespace ToolBoxAPI {
498
504
  * @param prefillData Data to pre-populate the target tool's state
499
505
  * @param options Optional connection overrides and launch flags
500
506
  */
501
- launchTool: (targetToolId: string, prefillData?: Record<string, unknown>, options?: { primaryConnectionId?: string | null; secondaryConnectionId?: string | null; noReturn?: boolean }) => Promise<unknown>;
507
+ launchTool: (
508
+ targetToolId: string,
509
+ prefillData?: Record<string, unknown>,
510
+ options?: { primaryConnectionId?: string | null; secondaryConnectionId?: string | null; noReturn?: boolean },
511
+ ) => Promise<unknown>;
502
512
 
503
513
  /**
504
514
  * Find installed tools that declare a given capability tag in their
@@ -1,200 +0,0 @@
1
- /**
2
- * Power Platform ToolBox - Power Platform API Type Definitions
3
- *
4
- * Power Platform Admin APIs exposed to tools via window.powerplatformAPI
5
- * https://learn.microsoft.com/en-us/rest/api/power-platform/
6
- */
7
-
8
- declare namespace PowerPlatformAPI {
9
- /**
10
- * Power Platform API category response type
11
- */
12
- export interface PowerPlatformResponse {
13
- [key: string]: unknown;
14
- }
15
-
16
- /**
17
- * Generic HTTP method type
18
- */
19
- export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
20
-
21
- /**
22
- * Power Platform API category client interface
23
- * Provides generic HTTP methods for each API category
24
- */
25
- export interface CategoryClient {
26
- /**
27
- * Make a GET request to the category endpoint
28
- * @param path Relative path after the category base URL (e.g., "environments/{environmentId}/apps/{app}?api-version=2024-10-01")
29
- * @param connectionTarget Optional connection target for multi-connection tools ('primary' or 'secondary'). Defaults to 'primary'.
30
- * @param headers Optional custom headers
31
- */
32
- Get: (path?: string, connectionTarget?: "primary" | "secondary", headers?: Record<string, string>) => Promise<PowerPlatformResponse>;
33
-
34
- /**
35
- * Make a POST request to the category endpoint
36
- * @param path Relative path after the category base URL
37
- * @param body Optional request body
38
- * @param connectionTarget Optional connection target for multi-connection tools ('primary' or 'secondary'). Defaults to 'primary'.
39
- * @param headers Optional custom headers
40
- */
41
- Post: (path?: string, body?: unknown, connectionTarget?: "primary" | "secondary", headers?: Record<string, string>) => Promise<PowerPlatformResponse>;
42
-
43
- /**
44
- * Make a PUT request to the category endpoint
45
- * @param path Relative path after the category base URL
46
- * @param body Optional request body
47
- * @param connectionTarget Optional connection target for multi-connection tools ('primary' or 'secondary'). Defaults to 'primary'.
48
- * @param headers Optional custom headers
49
- */
50
- Put: (path?: string, body?: unknown, connectionTarget?: "primary" | "secondary", headers?: Record<string, string>) => Promise<PowerPlatformResponse>;
51
-
52
- /**
53
- * Make a PATCH request to the category endpoint
54
- * @param path Relative path after the category base URL
55
- * @param body Optional request body
56
- * @param connectionTarget Optional connection target for multi-connection tools ('primary' or 'secondary'). Defaults to 'primary'.
57
- * @param headers Optional custom headers
58
- */
59
- Patch: (path?: string, body?: unknown, connectionTarget?: "primary" | "secondary", headers?: Record<string, string>) => Promise<PowerPlatformResponse>;
60
-
61
- /**
62
- * Make a DELETE request to the category endpoint
63
- * @param path Relative path after the category base URL
64
- * @param connectionTarget Optional connection target for multi-connection tools ('primary' or 'secondary'). Defaults to 'primary'.
65
- * @param headers Optional custom headers
66
- * @param body Optional request body (for DELETE with payload)
67
- */
68
- Delete: (path?: string, connectionTarget?: "primary" | "secondary", headers?: Record<string, string>, body?: unknown) => Promise<PowerPlatformResponse>;
69
- }
70
-
71
- /**
72
- * Power Platform Analytics API
73
- * https://api.powerplatform.com/analytics
74
- */
75
- export interface Analytics extends CategoryClient {}
76
-
77
- /**
78
- * Power Platform App Management API
79
- * https://api.powerplatform.com/appmanagement
80
- */
81
- export interface AppManagement extends CategoryClient {}
82
-
83
- /**
84
- * Power Platform Authorization API
85
- * https://api.powerplatform.com/authorization
86
- */
87
- export interface Authorization extends CategoryClient {}
88
-
89
- /**
90
- * Power Platform Connectivity API
91
- * https://api.powerplatform.com/connectivity
92
- */
93
- export interface Connectivity extends CategoryClient {}
94
-
95
- /**
96
- * Power Platform Copilot Studio API
97
- * https://api.powerplatform.com/copilotstudio
98
- */
99
- export interface CopilotStudio extends CategoryClient {}
100
-
101
- /**
102
- * Power Platform Dynamics API
103
- * https://api.powerplatform.com/dynamics
104
- */
105
- export interface Dynamics extends CategoryClient {}
106
-
107
- /**
108
- * Power Platform Environment Management API
109
- * https://api.powerplatform.com/environmentmanagement
110
- */
111
- export interface EnvironmentManagement extends CategoryClient {}
112
-
113
- /**
114
- * Power Platform Governance API
115
- * https://api.powerplatform.com/governance
116
- */
117
- export interface Governance extends CategoryClient {}
118
-
119
- /**
120
- * Power Platform Licensing API
121
- * https://api.powerplatform.com/licensing
122
- */
123
- export interface Licensing extends CategoryClient {}
124
-
125
- /**
126
- * Power Platform Power Apps API
127
- * https://api.powerplatform.com/powerapps
128
- */
129
- export interface PowerApps extends CategoryClient {}
130
-
131
- /**
132
- * Power Platform Power Automate API
133
- * https://api.powerplatform.com/powerautomate
134
- */
135
- export interface PowerAutomate extends CategoryClient {}
136
-
137
- /**
138
- * Power Platform Power Pages API
139
- * https://api.powerplatform.com/powerpages
140
- */
141
- export interface PowerPages extends CategoryClient {}
142
-
143
- /**
144
- * Power Platform Resource Query API
145
- * https://api.powerplatform.com/resourcequery
146
- */
147
- export interface ResourceQuery extends CategoryClient {}
148
-
149
- /**
150
- * Power Platform User Management API
151
- * https://api.powerplatform.com/usermanagement
152
- */
153
- export interface UserManagement extends CategoryClient {}
154
-
155
- /**
156
- * Power Platform Workflow Agents API
157
- * https://api.powerplatform.com/workflowagents
158
- */
159
- export interface WorkflowAgents extends CategoryClient {}
160
-
161
- /**
162
- * Main Power Platform API interface
163
- * Each category exposes generic HTTP methods (Get, Post, Put, Patch, Delete)
164
- */
165
- export interface API {
166
- Analytics: Analytics;
167
- AppManagement: AppManagement;
168
- Authorization: Authorization;
169
- Connectivity: Connectivity;
170
- CopilotStudio: CopilotStudio;
171
- Dynamics: Dynamics;
172
- EnvironmentManagement: EnvironmentManagement;
173
- Governance: Governance;
174
- Licensing: Licensing;
175
- PowerApps: PowerApps;
176
- PowerAutomate: PowerAutomate;
177
- PowerPages: PowerPages;
178
- ResourceQuery: ResourceQuery;
179
- UserManagement: UserManagement;
180
- WorkflowAgents: WorkflowAgents;
181
- }
182
- }
183
-
184
- /**
185
- * Global window interface extension for Power Platform API
186
- */
187
- declare global {
188
- interface Window {
189
- /**
190
- * Power Platform Admin API accessible to tools
191
- * @example
192
- * // Get admin app from Power Apps
193
- * const app = await powerplatformAPI.PowerApps.Get('environments/{environmentId}/apps/{app}?api-version=2024-10-01');
194
- */
195
- powerplatformAPI: PowerPlatformAPI.API;
196
- }
197
- }
198
-
199
- export = PowerPlatformAPI;
200
- export as namespace PowerPlatformAPI;