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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptb/types",
3
- "version": "1.2.4-beta.5",
3
+ "version": "1.2.4-beta.6",
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",
@@ -0,0 +1,200 @@
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;