codeapp-js 1.0.1 → 1.1.0
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/AI/skills/autoreview/SKILL.md +69 -0
- package/AI/skills/connections/SKILL.md +4 -4
- package/AI/skills/dataverse/SKILL.md +4 -2
- package/AI/skills/frontend-design/SKILL.md +32 -20
- package/AI/skills/keyvault/SKILL.md +139 -0
- package/AI/skills/office365-groups/SKILL.md +46 -25
- package/AI/skills/office365-outlook/SKILL.md +56 -25
- package/AI/skills/office365-users/SKILL.md +41 -36
- package/AI/skills/sharepoint/SKILL.md +174 -31
- package/AI/skills/start/SKILL.md +38 -30
- package/codeApp/dist/connectors/autoreview.js +1654 -0
- package/codeApp/dist/connectors/office365groups.js +2995 -432
- package/{examples/outlook Demo/.power/schemas/office365/office365.Schema.json → codeApp/dist/connectors/office365outlook.js} +7439 -16
- package/codeApp/dist/connectors/office365users.js +2990 -349
- package/codeApp/dist/connectors/sharepoint.js +529 -308
- package/examples/combined demo/dist/connectors/office365outlook.js +28521 -0
- package/examples/combined demo/dist/connectors/office365users.js +3154 -0
- package/examples/combined demo/dist/index.js +2 -6
- package/examples/combined demo/power.config.json +1 -1
- package/examples/groups Demo/{.power/schemas/office365groups/office365groups.Schema.json → dist/connectors/office365groups.js } +3205 -2204
- package/examples/groups Demo/dist/index.js +1 -5
- package/examples/groups Demo/power.config.json +1 -1
- package/examples/myProfile/dist/connectors/office365users.js +3154 -0
- package/examples/myProfile/dist/index.js +1 -5
- package/examples/myProfile/power.config.json +1 -1
- package/examples/outlook Demo/dist/connectors/office365outlook.js +28521 -0
- package/examples/outlook Demo/dist/index.js +2 -5
- package/examples/outlook Demo/power.config.json +1 -1
- package/examples/sharePoint Demo/dist/connectors/sharepoint.js +687 -0
- package/examples/sharePoint Demo/dist/index.js +86 -127
- package/examples/sharePoint Demo/power.config.json +1 -1
- package/package.json +1 -1
- package/codeApp/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6275
- package/codeApp/.power/schemas/jira/jira.Schema.json +0 -6903
- package/codeApp/.power/schemas/keyvault/keyvault.Schema.json +0 -1600
- package/codeApp/.power/schemas/office365groups/office365groups.Schema.json +0 -2204
- package/codeApp/.power/schemas/teams/teams.Schema.json +0 -11112
- package/codeApp/dist/connectors/outlook.js +0 -1393
- package/codeApp/src/generated/index.ts +0 -12
- package/codeApp/src/generated/models/AzureKeyVaultModel.ts +0 -107
- package/codeApp/src/generated/models/JiraModel.ts +0 -501
- package/codeApp/src/generated/models/Office365GroupsModel.ts +0 -363
- package/codeApp/src/generated/models/Office365OutlookModel.ts +0 -2046
- package/codeApp/src/generated/models/Office365UsersModel.ts +0 -254
- package/codeApp/src/generated/services/AzureKeyVaultService.ts +0 -257
- package/codeApp/src/generated/services/JiraService.ts +0 -1124
- package/codeApp/src/generated/services/Office365GroupsService.ts +0 -326
- package/codeApp/src/generated/services/Office365OutlookService.ts +0 -2476
- package/codeApp/src/generated/services/Office365UsersService.ts +0 -358
- package/examples/apps/kanban/dist/dataverse.js +0 -94
- package/examples/apps/kanban/dist/environmentVar.js +0 -55
- package/examples/apps/kanban/dist/index.css +0 -605
- package/examples/apps/kanban/dist/index.html +0 -21
- package/examples/apps/kanban/dist/index.js +0 -860
- package/examples/apps/kanban/dist/office365groups.js +0 -97
- package/examples/apps/kanban/dist/office365users.js +0 -451
- package/examples/apps/kanban/dist/outlook.js +0 -162
- package/examples/apps/kanban/dist/power-apps-data.js +0 -2953
- package/examples/apps/kanban/dist/sharepoint.js +0 -435
- package/examples/apps/kanban/power.config.json +0 -35
- package/examples/apps/kanban/src/generated/index.ts +0 -14
- package/examples/apps/kanban/src/generated/models/Office365GroupsModel.ts +0 -363
- package/examples/apps/kanban/src/generated/models/Office365OutlookModel.ts +0 -2046
- package/examples/apps/kanban/src/generated/models/Office365UsersModel.ts +0 -254
- package/examples/apps/kanban/src/generated/services/Office365GroupsService.ts +0 -326
- package/examples/apps/kanban/src/generated/services/Office365OutlookService.ts +0 -2476
- package/examples/apps/kanban/src/generated/services/Office365UsersService.ts +0 -358
- package/examples/apps/planning Poker/additional files/AgilePoker_1_0_0_1.zip +0 -0
- package/examples/apps/planning Poker/additional files/PokerTables_1_0_0_1.zip +0 -0
- package/examples/apps/planning Poker/additional files/customizations (tables).xml +0 -6429
- package/examples/apps/planning Poker/additional files/dataverse-tables.json +0 -165
- package/examples/apps/planning Poker/additional files/readme.md +0 -122
- package/examples/apps/planning Poker/dist/dataverse.js +0 -78
- package/examples/apps/planning Poker/dist/index.html +0 -198
- package/examples/apps/planning Poker/dist/index.js +0 -955
- package/examples/apps/planning Poker/dist/power-apps-data.js +0 -2953
- package/examples/apps/planning Poker/dist/styles.css +0 -815
- package/examples/apps/planning Poker/power.config.json +0 -50
- package/examples/apps/solution explorer/dist/codeapp.js +0 -1098
- package/examples/apps/solution explorer/dist/icon-512.png +0 -0
- package/examples/apps/solution explorer/dist/index.html +0 -80
- package/examples/apps/solution explorer/dist/index.js +0 -735
- package/examples/apps/solution explorer/dist/power-apps-data.js +0 -3007
- package/examples/apps/solution explorer/dist/styles.css +0 -571
- package/examples/apps/solution explorer/power.config.json +0 -151
- package/examples/apps/todo/dist/dataverse.js +0 -64
- package/examples/apps/todo/dist/icon192.png +0 -0
- package/examples/apps/todo/dist/index.html +0 -75
- package/examples/apps/todo/dist/index.js +0 -9
- package/examples/apps/todo/dist/power-apps-data.js +0 -2953
- package/examples/apps/todo/dist/renderer.js +0 -375
- package/examples/apps/todo/dist/styles.css +0 -691
- package/examples/apps/todo/power.config.json +0 -35
- package/examples/combined demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6275
- package/examples/combined demo/.power/schemas/jira/jira.Schema.json +0 -6903
- package/examples/combined demo/.power/schemas/keyvault/keyvault.Schema.json +0 -1600
- package/examples/combined demo/.power/schemas/teams/teams.Schema.json +0 -11112
- package/examples/combined demo/dist/office365users.js +0 -513
- package/examples/combined demo/dist/outlook.js +0 -1393
- package/examples/combined demo/src/generated/index.ts +0 -12
- package/examples/combined demo/src/generated/models/AzureKeyVaultModel.ts +0 -107
- package/examples/combined demo/src/generated/models/JiraModel.ts +0 -501
- package/examples/combined demo/src/generated/models/Office365GroupsModel.ts +0 -363
- package/examples/combined demo/src/generated/models/Office365OutlookModel.ts +0 -2046
- package/examples/combined demo/src/generated/models/Office365UsersModel.ts +0 -254
- package/examples/combined demo/src/generated/services/AzureKeyVaultService.ts +0 -257
- package/examples/combined demo/src/generated/services/JiraService.ts +0 -1124
- package/examples/combined demo/src/generated/services/Office365GroupsService.ts +0 -326
- package/examples/combined demo/src/generated/services/Office365OutlookService.ts +0 -2476
- package/examples/combined demo/src/generated/services/Office365UsersService.ts +0 -358
- package/examples/groups Demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -613
- package/examples/groups Demo/dist/office365groups.js +0 -642
- package/examples/groups Demo/src/generated/index.ts +0 -10
- package/examples/groups Demo/src/generated/models/Office365GroupsModel.ts +0 -363
- package/examples/groups Demo/src/generated/services/Office365GroupsService.ts +0 -326
- package/examples/myProfile/dist/office365users.js +0 -517
- package/examples/outlook Demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6512
- package/examples/outlook Demo/dist/outlook.js +0 -1393
- package/examples/outlook Demo/src/generated/index.ts +0 -10
- package/examples/outlook Demo/src/generated/models/Office365OutlookModel.ts +0 -2046
- package/examples/outlook Demo/src/generated/services/Office365OutlookService.ts +0 -2476
- package/examples/sharePoint Demo/dist/sharepoint.js +0 -466
- package/examples/sharePoint Demo/src/generated/index.ts +0 -14
- package/examples/sharePoint Demo/src/generated/models/Office365GroupsModel.ts +0 -363
- package/examples/sharePoint Demo/src/generated/models/Office365OutlookModel.ts +0 -2046
- package/examples/sharePoint Demo/src/generated/models/Office365UsersModel.ts +0 -254
- package/examples/sharePoint Demo/src/generated/services/Office365GroupsService.ts +0 -326
- package/examples/sharePoint Demo/src/generated/services/Office365OutlookService.ts +0 -2476
- package/examples/sharePoint Demo/src/generated/services/Office365UsersService.ts +0 -358
- package/readme.md +0 -590
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* This file is autogenerated. Do not edit this file directly.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { ClientPhotoMetadata } from '../models/Office365UsersModel';
|
|
7
|
-
import type { EntityListResponse_IReadOnlyList_User } from '../models/Office365UsersModel';
|
|
8
|
-
import type { GraphTrending } from '../models/Office365UsersModel';
|
|
9
|
-
import type { GraphUserUpdateable_V1 } from '../models/Office365UsersModel';
|
|
10
|
-
import type { GraphUser_V1 } from '../models/Office365UsersModel';
|
|
11
|
-
import type { IOperationResult } from '@microsoft/power-apps/data';
|
|
12
|
-
import type { LinklessEntityListResponse_List_Person } from '../models/Office365UsersModel';
|
|
13
|
-
import type { ObjectWithoutType } from '../models/Office365UsersModel';
|
|
14
|
-
import type { User } from '../models/Office365UsersModel';
|
|
15
|
-
import { dataSourcesInfo } from '../../../.power/schemas/appschemas/dataSourcesInfo';
|
|
16
|
-
import { getClient } from '@microsoft/power-apps/data';
|
|
17
|
-
|
|
18
|
-
export class Office365UsersService {
|
|
19
|
-
private static readonly dataSourceName = 'office365users';
|
|
20
|
-
|
|
21
|
-
private static readonly client = getClient(dataSourcesInfo);
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Update my profile
|
|
25
|
-
* Updates the profile of the current user
|
|
26
|
-
*/
|
|
27
|
-
public static async UpdateMyProfile(body?: GraphUserUpdateable_V1): Promise<IOperationResult<void>> {
|
|
28
|
-
const params: { body?: GraphUserUpdateable_V1 } = { body };
|
|
29
|
-
const result = await Office365UsersService.client.executeAsync<{ body?: GraphUserUpdateable_V1 }, void>(
|
|
30
|
-
{
|
|
31
|
-
connectorOperation: {
|
|
32
|
-
tableName: Office365UsersService.dataSourceName,
|
|
33
|
-
operationName: 'UpdateMyProfile',
|
|
34
|
-
parameters: params
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Get my profile (V2)
|
|
42
|
-
* Retrieves the profile of the current user. Learn more about available fields to select: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/user#properties
|
|
43
|
-
*/
|
|
44
|
-
public static async MyProfile_V2($select?: string): Promise<IOperationResult<GraphUser_V1>> {
|
|
45
|
-
const params: { $select?: string } = { $select };
|
|
46
|
-
const result = await Office365UsersService.client.executeAsync<{ $select?: string }, GraphUser_V1>(
|
|
47
|
-
{
|
|
48
|
-
connectorOperation: {
|
|
49
|
-
tableName: Office365UsersService.dataSourceName,
|
|
50
|
-
operationName: 'MyProfile_V2',
|
|
51
|
-
parameters: params
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Update my profile photo
|
|
59
|
-
* Updates the profile photo of the current user. The size of the photo must be less than 4 MB.
|
|
60
|
-
*/
|
|
61
|
-
public static async UpdateMyPhoto(body: string, Content_Type: string): Promise<IOperationResult<void>> {
|
|
62
|
-
const params: { body: string, Content_Type: string } = { body, Content_Type };
|
|
63
|
-
const result = await Office365UsersService.client.executeAsync<{ body: string, Content_Type: string }, void>(
|
|
64
|
-
{
|
|
65
|
-
connectorOperation: {
|
|
66
|
-
tableName: Office365UsersService.dataSourceName,
|
|
67
|
-
operationName: 'UpdateMyPhoto',
|
|
68
|
-
parameters: params
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
return result;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Get my trending documents
|
|
76
|
-
* Retrieves the trending documents for the signed in user
|
|
77
|
-
*/
|
|
78
|
-
public static async MyTrendingDocuments($filter?: string, extractSensitivityLabel?: boolean, fetchSensitivityLabelMetadata?: boolean): Promise<IOperationResult<{ value: GraphTrending[] }>> {
|
|
79
|
-
const params: { $filter?: string, extractSensitivityLabel?: boolean, fetchSensitivityLabelMetadata?: boolean } = { $filter, extractSensitivityLabel, fetchSensitivityLabelMetadata };
|
|
80
|
-
const result = await Office365UsersService.client.executeAsync<{ $filter?: string, extractSensitivityLabel?: boolean, fetchSensitivityLabelMetadata?: boolean }, { value: GraphTrending[] }>(
|
|
81
|
-
{
|
|
82
|
-
connectorOperation: {
|
|
83
|
-
tableName: Office365UsersService.dataSourceName,
|
|
84
|
-
operationName: 'MyTrendingDocuments',
|
|
85
|
-
parameters: params
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Get relevant people
|
|
93
|
-
* Get relevant people.
|
|
94
|
-
*/
|
|
95
|
-
public static async RelevantPeople(userId: string): Promise<IOperationResult<LinklessEntityListResponse_List_Person>> {
|
|
96
|
-
const params: { userId: string } = { userId };
|
|
97
|
-
const result = await Office365UsersService.client.executeAsync<{ userId: string }, LinklessEntityListResponse_List_Person>(
|
|
98
|
-
{
|
|
99
|
-
connectorOperation: {
|
|
100
|
-
tableName: Office365UsersService.dataSourceName,
|
|
101
|
-
operationName: 'RelevantPeople',
|
|
102
|
-
parameters: params
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
return result;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Get my profile (V1)
|
|
110
|
-
* Retrieves the profile of the current user.
|
|
111
|
-
*/
|
|
112
|
-
public static async MyProfile(): Promise<IOperationResult<User>> {
|
|
113
|
-
const result = await Office365UsersService.client.executeAsync<void, User>(
|
|
114
|
-
{
|
|
115
|
-
connectorOperation: {
|
|
116
|
-
tableName: Office365UsersService.dataSourceName,
|
|
117
|
-
operationName: 'MyProfile',
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
return result;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Get user profile (V1)
|
|
125
|
-
* Retrieves the profile of a specific user.
|
|
126
|
-
*/
|
|
127
|
-
public static async UserProfile(userId: string): Promise<IOperationResult<User>> {
|
|
128
|
-
const params: { userId: string } = { userId };
|
|
129
|
-
const result = await Office365UsersService.client.executeAsync<{ userId: string }, User>(
|
|
130
|
-
{
|
|
131
|
-
connectorOperation: {
|
|
132
|
-
tableName: Office365UsersService.dataSourceName,
|
|
133
|
-
operationName: 'UserProfile',
|
|
134
|
-
parameters: params
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Get user photo metadata
|
|
142
|
-
* Get user photo metadata.
|
|
143
|
-
*/
|
|
144
|
-
public static async UserPhotoMetadata(userId: string): Promise<IOperationResult<ClientPhotoMetadata>> {
|
|
145
|
-
const params: { userId: string } = { userId };
|
|
146
|
-
const result = await Office365UsersService.client.executeAsync<{ userId: string }, ClientPhotoMetadata>(
|
|
147
|
-
{
|
|
148
|
-
connectorOperation: {
|
|
149
|
-
tableName: Office365UsersService.dataSourceName,
|
|
150
|
-
operationName: 'UserPhotoMetadata',
|
|
151
|
-
parameters: params
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
return result;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Get user photo (V1)
|
|
159
|
-
* Retrieves the photo of the specified user if they have one.
|
|
160
|
-
*/
|
|
161
|
-
public static async UserPhoto(userId: string): Promise<IOperationResult<string>> {
|
|
162
|
-
const params: { userId: string } = { userId };
|
|
163
|
-
const result = await Office365UsersService.client.executeAsync<{ userId: string }, string>(
|
|
164
|
-
{
|
|
165
|
-
connectorOperation: {
|
|
166
|
-
tableName: Office365UsersService.dataSourceName,
|
|
167
|
-
operationName: 'UserPhoto',
|
|
168
|
-
parameters: params
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
return result;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Get manager (V1)
|
|
176
|
-
* Retrieves the profile of the specified user's manager.
|
|
177
|
-
*/
|
|
178
|
-
public static async Manager(userId: string): Promise<IOperationResult<User>> {
|
|
179
|
-
const params: { userId: string } = { userId };
|
|
180
|
-
const result = await Office365UsersService.client.executeAsync<{ userId: string }, User>(
|
|
181
|
-
{
|
|
182
|
-
connectorOperation: {
|
|
183
|
-
tableName: Office365UsersService.dataSourceName,
|
|
184
|
-
operationName: 'Manager',
|
|
185
|
-
parameters: params
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
return result;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Get direct reports (V1)
|
|
193
|
-
* Retrieves the user profiles of the specified user's direct reports.
|
|
194
|
-
*/
|
|
195
|
-
public static async DirectReports(userId: string): Promise<IOperationResult<User[]>> {
|
|
196
|
-
const params: { userId: string } = { userId };
|
|
197
|
-
const result = await Office365UsersService.client.executeAsync<{ userId: string }, User[]>(
|
|
198
|
-
{
|
|
199
|
-
connectorOperation: {
|
|
200
|
-
tableName: Office365UsersService.dataSourceName,
|
|
201
|
-
operationName: 'DirectReports',
|
|
202
|
-
parameters: params
|
|
203
|
-
},
|
|
204
|
-
});
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Search for users
|
|
210
|
-
* Retrieves the user profiles that match the search term.
|
|
211
|
-
*/
|
|
212
|
-
public static async SearchUser(searchTerm?: string, top?: number): Promise<IOperationResult<User[]>> {
|
|
213
|
-
const params: { searchTerm?: string, top?: number } = { searchTerm, top };
|
|
214
|
-
const result = await Office365UsersService.client.executeAsync<{ searchTerm?: string, top?: number }, User[]>(
|
|
215
|
-
{
|
|
216
|
-
connectorOperation: {
|
|
217
|
-
tableName: Office365UsersService.dataSourceName,
|
|
218
|
-
operationName: 'SearchUser',
|
|
219
|
-
parameters: params
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
return result;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Search for users (V2)
|
|
227
|
-
* Retrieves the user profiles that match the search term (V2).
|
|
228
|
-
*/
|
|
229
|
-
public static async SearchUserV2(searchTerm?: string, top?: number, isSearchTermRequired?: boolean, skipToken?: string): Promise<IOperationResult<EntityListResponse_IReadOnlyList_User>> {
|
|
230
|
-
const params: { searchTerm?: string, top?: number, isSearchTermRequired?: boolean, skipToken?: string } = { searchTerm, top, isSearchTermRequired, skipToken };
|
|
231
|
-
const result = await Office365UsersService.client.executeAsync<{ searchTerm?: string, top?: number, isSearchTermRequired?: boolean, skipToken?: string }, EntityListResponse_IReadOnlyList_User>(
|
|
232
|
-
{
|
|
233
|
-
connectorOperation: {
|
|
234
|
-
tableName: Office365UsersService.dataSourceName,
|
|
235
|
-
operationName: 'SearchUserV2',
|
|
236
|
-
parameters: params
|
|
237
|
-
},
|
|
238
|
-
});
|
|
239
|
-
return result;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Tests the connection
|
|
244
|
-
* Tests the connection.
|
|
245
|
-
*/
|
|
246
|
-
public static async TestConnection(): Promise<IOperationResult<void>> {
|
|
247
|
-
const result = await Office365UsersService.client.executeAsync<void, void>(
|
|
248
|
-
{
|
|
249
|
-
connectorOperation: {
|
|
250
|
-
tableName: Office365UsersService.dataSourceName,
|
|
251
|
-
operationName: 'TestConnection',
|
|
252
|
-
},
|
|
253
|
-
});
|
|
254
|
-
return result;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Get user profile (V2)
|
|
259
|
-
* Retrieves the profile of a specific user. Learn more about available fields to select: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/user#properties
|
|
260
|
-
*/
|
|
261
|
-
public static async UserProfile_V2(id: string, $select?: string): Promise<IOperationResult<GraphUser_V1>> {
|
|
262
|
-
const params: { id: string, $select?: string } = { id, $select };
|
|
263
|
-
const result = await Office365UsersService.client.executeAsync<{ id: string, $select?: string }, GraphUser_V1>(
|
|
264
|
-
{
|
|
265
|
-
connectorOperation: {
|
|
266
|
-
tableName: Office365UsersService.dataSourceName,
|
|
267
|
-
operationName: 'UserProfile_V2',
|
|
268
|
-
parameters: params
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
return result;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Get manager (V2)
|
|
276
|
-
* Retrieves the profile of the specified user's manager. Learn more about available fields to select: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/user#properties
|
|
277
|
-
*/
|
|
278
|
-
public static async Manager_V2(id: string, $select?: string): Promise<IOperationResult<GraphUser_V1>> {
|
|
279
|
-
const params: { id: string, $select?: string } = { id, $select };
|
|
280
|
-
const result = await Office365UsersService.client.executeAsync<{ id: string, $select?: string }, GraphUser_V1>(
|
|
281
|
-
{
|
|
282
|
-
connectorOperation: {
|
|
283
|
-
tableName: Office365UsersService.dataSourceName,
|
|
284
|
-
operationName: 'Manager_V2',
|
|
285
|
-
parameters: params
|
|
286
|
-
},
|
|
287
|
-
});
|
|
288
|
-
return result;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Get direct reports (V2)
|
|
293
|
-
* Retrieves the user profiles of the specified user's direct reports. Learn more about available fields to select: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/user#properties
|
|
294
|
-
*/
|
|
295
|
-
public static async DirectReports_V2(id: string, $select?: string, $top?: number): Promise<IOperationResult<{ value: GraphUser_V1[] }>> {
|
|
296
|
-
const params: { id: string, $select?: string, $top?: number } = { id, $select, $top };
|
|
297
|
-
const result = await Office365UsersService.client.executeAsync<{ id: string, $select?: string, $top?: number }, { value: GraphUser_V1[] }>(
|
|
298
|
-
{
|
|
299
|
-
connectorOperation: {
|
|
300
|
-
tableName: Office365UsersService.dataSourceName,
|
|
301
|
-
operationName: 'DirectReports_V2',
|
|
302
|
-
parameters: params
|
|
303
|
-
},
|
|
304
|
-
});
|
|
305
|
-
return result;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Get user photo (V2)
|
|
310
|
-
* Retrieves the photo of the specified user if they have one
|
|
311
|
-
*/
|
|
312
|
-
public static async UserPhoto_V2(id: string): Promise<IOperationResult<string>> {
|
|
313
|
-
const params: { id: string } = { id };
|
|
314
|
-
const result = await Office365UsersService.client.executeAsync<{ id: string }, string>(
|
|
315
|
-
{
|
|
316
|
-
connectorOperation: {
|
|
317
|
-
tableName: Office365UsersService.dataSourceName,
|
|
318
|
-
operationName: 'UserPhoto_V2',
|
|
319
|
-
parameters: params
|
|
320
|
-
},
|
|
321
|
-
});
|
|
322
|
-
return result;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Get trending documents
|
|
327
|
-
* Retrieves the trending documents for a user
|
|
328
|
-
*/
|
|
329
|
-
public static async TrendingDocuments(id: string, $filter?: string, extractSensitivityLabel?: boolean, fetchSensitivityLabelMetadata?: boolean): Promise<IOperationResult<{ value: GraphTrending[] }>> {
|
|
330
|
-
const params: { id: string, $filter?: string, extractSensitivityLabel?: boolean, fetchSensitivityLabelMetadata?: boolean } = { id, $filter, extractSensitivityLabel, fetchSensitivityLabelMetadata };
|
|
331
|
-
const result = await Office365UsersService.client.executeAsync<{ id: string, $filter?: string, extractSensitivityLabel?: boolean, fetchSensitivityLabelMetadata?: boolean }, { value: GraphTrending[] }>(
|
|
332
|
-
{
|
|
333
|
-
connectorOperation: {
|
|
334
|
-
tableName: Office365UsersService.dataSourceName,
|
|
335
|
-
operationName: 'TrendingDocuments',
|
|
336
|
-
parameters: params
|
|
337
|
-
},
|
|
338
|
-
});
|
|
339
|
-
return result;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Send an HTTP request
|
|
344
|
-
* Construct a Microsoft Graph REST API request to invoke. These segments are supported: 1st segement: /me, /users/<userId> 2nd segment: messages, mailFolders, events, calendar, calendars, outlook, inferenceClassification. Learn more: https://docs.microsoft.com/en-us/graph/use-the-api.
|
|
345
|
-
*/
|
|
346
|
-
public static async HttpRequest(Uri: string, Method: string, Body?: string, ContentType?: string, CustomHeader1?: string, CustomHeader2?: string, CustomHeader3?: string, CustomHeader4?: string, CustomHeader5?: string): Promise<IOperationResult<ObjectWithoutType>> {
|
|
347
|
-
const params: { Uri: string, Method: string, Body?: string, ContentType?: string, CustomHeader1?: string, CustomHeader2?: string, CustomHeader3?: string, CustomHeader4?: string, CustomHeader5?: string } = { Uri, Method, Body, ContentType, CustomHeader1, CustomHeader2, CustomHeader3, CustomHeader4, CustomHeader5 };
|
|
348
|
-
const result = await Office365UsersService.client.executeAsync<{ Uri: string, Method: string, Body?: string, ContentType?: string, CustomHeader1?: string, CustomHeader2?: string, CustomHeader3?: string, CustomHeader4?: string, CustomHeader5?: string }, ObjectWithoutType>(
|
|
349
|
-
{
|
|
350
|
-
connectorOperation: {
|
|
351
|
-
tableName: Office365UsersService.dataSourceName,
|
|
352
|
-
operationName: 'HttpRequest',
|
|
353
|
-
parameters: params
|
|
354
|
-
},
|
|
355
|
-
});
|
|
356
|
-
return result;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { getClient } from "@microsoft/power-apps/data";
|
|
2
|
-
|
|
3
|
-
// ── Table Registry (populated at runtime via registerTable) ────
|
|
4
|
-
let oDataSources = {};
|
|
5
|
-
|
|
6
|
-
// ── Register a Dataverse table for use by the library ──────────
|
|
7
|
-
export function registerTable(sTableName, sPrimaryKey) {
|
|
8
|
-
oDataSources[sTableName] = {
|
|
9
|
-
tableId: '',
|
|
10
|
-
version: '',
|
|
11
|
-
primaryKey: sPrimaryKey,
|
|
12
|
-
dataSourceType: 'Dataverse',
|
|
13
|
-
apis: {}
|
|
14
|
-
};
|
|
15
|
-
// reset client so it picks up the new table on next call
|
|
16
|
-
oSharedClient = null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// ── Initialize SDK & Client ────────────────────────────────────
|
|
20
|
-
let oSharedClient = null;
|
|
21
|
-
|
|
22
|
-
function getSharedClient() {
|
|
23
|
-
if (!oSharedClient) {
|
|
24
|
-
oSharedClient = getClient(oDataSources);
|
|
25
|
-
}
|
|
26
|
-
return oSharedClient;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// ── Unwrap SDK response ────────────────────────────────────────
|
|
30
|
-
function unwrapResult(result) {
|
|
31
|
-
if (result && result.success === false) {
|
|
32
|
-
var sMsg = result.error ? (result.error.message || JSON.stringify(result.error)) : 'Operation failed';
|
|
33
|
-
throw new Error(sMsg);
|
|
34
|
-
}
|
|
35
|
-
return result && 'data' in result ? result.data : result;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ── Create ─────────────────────────────────────────────────────
|
|
39
|
-
export async function createItem(tableName, primaryKey, record) {
|
|
40
|
-
const client = getSharedClient();
|
|
41
|
-
const result = await client.createRecordAsync(tableName, record);
|
|
42
|
-
return unwrapResult(result);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// ── Read (single) ──────────────────────────────────────────────
|
|
46
|
-
export async function getItem(tableName, primaryKey, id, select) {
|
|
47
|
-
const client = getSharedClient();
|
|
48
|
-
const options = select ? { select } : undefined;
|
|
49
|
-
const result = await client.retrieveRecordAsync(tableName, id, options);
|
|
50
|
-
return unwrapResult(result);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// ── List (multiple) ────────────────────────────────────────────
|
|
54
|
-
export async function listItems(tableName, primaryKey, { filter, select, orderBy, top, skip } = {}) {
|
|
55
|
-
const client = getSharedClient();
|
|
56
|
-
const result = await client.retrieveMultipleRecordsAsync(tableName, {
|
|
57
|
-
filter,
|
|
58
|
-
select,
|
|
59
|
-
orderBy,
|
|
60
|
-
top,
|
|
61
|
-
skip,
|
|
62
|
-
});
|
|
63
|
-
var unwrapped = unwrapResult(result);
|
|
64
|
-
return { entities: Array.isArray(unwrapped) ? unwrapped : [] };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// ── Update ─────────────────────────────────────────────────────
|
|
68
|
-
export async function updateItem(tableName, primaryKey, id, changedFields) {
|
|
69
|
-
const client = getSharedClient();
|
|
70
|
-
const result = await client.updateRecordAsync(tableName, id, changedFields);
|
|
71
|
-
return unwrapResult(result);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// ── Delete ─────────────────────────────────────────────────────
|
|
75
|
-
export async function deleteItem(tableName, primaryKey, id) {
|
|
76
|
-
const client = getSharedClient();
|
|
77
|
-
const result = await client.deleteRecordAsync(tableName, id);
|
|
78
|
-
return unwrapResult(result);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// ── Unbound Action ─────────────────────────────────────────────
|
|
82
|
-
export async function callUnboundAction(tableName, primaryKey, actionName, params) {
|
|
83
|
-
const client = getSharedClient();
|
|
84
|
-
const result = await client.invokeActionAsync(tableName, actionName, params);
|
|
85
|
-
return unwrapResult(result);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// ── WhoAmI ─────────────────────────────────────────────────────
|
|
89
|
-
export async function whoAmI() {
|
|
90
|
-
const client = getSharedClient();
|
|
91
|
-
const result = await client.invokeActionAsync('', 'WhoAmI', {});
|
|
92
|
-
var data = unwrapResult(result);
|
|
93
|
-
return data.UserId || data.userid || data.systemuserid || data;
|
|
94
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { getClient } from "@microsoft/power-apps/data";
|
|
2
|
-
|
|
3
|
-
// ── All Table Definitions ──────────────────────────────────────
|
|
4
|
-
const ALL_DATA_SOURCES = {
|
|
5
|
-
environmentvariabledefinitions: { tableId: "", version: "", primaryKey: "environmentvariabledefinitionid", dataSourceType: "Dataverse", apis: {} },
|
|
6
|
-
environmentvariablevalues: { tableId: "", version: "", primaryKey: "environmentvariablevalueid", dataSourceType: "Dataverse", apis: {} },
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// ── Initialize SDK & Client ────────────────────────────────────
|
|
10
|
-
let oSharedClient = null;
|
|
11
|
-
|
|
12
|
-
function getSharedClient() {
|
|
13
|
-
if (!oSharedClient) {
|
|
14
|
-
oSharedClient = getClient(ALL_DATA_SOURCES);
|
|
15
|
-
}
|
|
16
|
-
return oSharedClient;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// ── Unwrap SDK response ────────────────────────────────────────
|
|
20
|
-
function unwrapResult(result) {
|
|
21
|
-
if (result && result.success === false) {
|
|
22
|
-
let sMsg = result.error ? (result.error.message || JSON.stringify(result.error)) : "Operation failed";
|
|
23
|
-
throw new Error(sMsg);
|
|
24
|
-
}
|
|
25
|
-
return result && "data" in result ? result.data : result;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// ── Get Environment Variable (single query with expand) ────────
|
|
29
|
-
export async function getEnvironmentVariable(sSchemaName) {
|
|
30
|
-
let client = getSharedClient();
|
|
31
|
-
|
|
32
|
-
// Try single query: filter values by expanded definition schema name
|
|
33
|
-
let valResult = await client.retrieveMultipleRecordsAsync("environmentvariablevalues", {
|
|
34
|
-
filter: "EnvironmentVariableDefinitionId/schemaname eq '" + sSchemaName + "'",
|
|
35
|
-
select: ["value"],
|
|
36
|
-
expand: [{ name: "EnvironmentVariableDefinitionId", select: ["defaultvalue", "schemaname"] }],
|
|
37
|
-
});
|
|
38
|
-
let aVals = unwrapResult(valResult);
|
|
39
|
-
|
|
40
|
-
// If value record exists, return it
|
|
41
|
-
if (Array.isArray(aVals) && aVals.length > 0 && aVals[0].value) {
|
|
42
|
-
return aVals[0].value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// No value record — fall back to definition default value
|
|
46
|
-
let defResult = await client.retrieveMultipleRecordsAsync("environmentvariabledefinitions", {
|
|
47
|
-
filter: "schemaname eq '" + sSchemaName + "'",
|
|
48
|
-
select: ["defaultvalue"],
|
|
49
|
-
});
|
|
50
|
-
let aDefs = unwrapResult(defResult);
|
|
51
|
-
if (!Array.isArray(aDefs) || aDefs.length === 0) {
|
|
52
|
-
throw new Error("Environment variable not found: " + sSchemaName);
|
|
53
|
-
}
|
|
54
|
-
return aDefs[0].defaultvalue || "";
|
|
55
|
-
}
|