codeapp-js 0.2.1 → 0.3.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/codeApp/.power/schemas/appschemas/dataSourcesInfo.ts +6275 -0
- package/codeApp/.power/schemas/jira/jira.Schema.json +6903 -0
- package/codeApp/.power/schemas/keyvault/keyvault.Schema.json +1600 -0
- package/codeApp/.power/schemas/teams/teams.Schema.json +11112 -0
- package/codeApp/dist/codeapp.js +992 -4
- package/codeApp/dist/power-apps-data.js +145 -31
- package/codeApp/src/generated/index.ts +12 -0
- package/codeApp/src/generated/models/AzureKeyVaultModel.ts +107 -0
- package/codeApp/src/generated/models/JiraModel.ts +501 -0
- package/codeApp/src/generated/models/Office365GroupsModel.ts +363 -0
- package/codeApp/src/generated/models/Office365OutlookModel.ts +2046 -0
- package/codeApp/src/generated/models/Office365UsersModel.ts +254 -0
- package/codeApp/src/generated/services/AzureKeyVaultService.ts +257 -0
- package/codeApp/src/generated/services/JiraService.ts +1124 -0
- package/codeApp/src/generated/services/Office365GroupsService.ts +326 -0
- package/codeApp/src/generated/services/Office365OutlookService.ts +2476 -0
- package/codeApp/src/generated/services/Office365UsersService.ts +358 -0
- package/dev files/outlook.js +218 -9
- package/examples/combined demo/dist/codeapp.js +1098 -1098
- package/examples/combined demo/dist/index.js +470 -470
- package/examples/combined demo/dist/power-apps-data.js +3006 -3006
- package/examples/combined demo/power.config.json +42 -42
- package/examples/dataverse Demo/dist/codeapp.js +1085 -1085
- package/examples/dataverse Demo/dist/index.html +54 -54
- package/examples/dataverse Demo/dist/index.js +82 -82
- package/examples/dataverse Demo/dist/power-apps-data.js +2911 -2911
- package/examples/dataverse Demo/power.config.json +34 -34
- package/examples/dataverse Demo/readme.md +79 -79
- package/examples/groups Demo/dist/codeapp.js +1085 -1085
- package/examples/groups Demo/dist/index.js +113 -113
- package/examples/groups Demo/dist/power-apps-data.js +2911 -2911
- package/examples/kanban/dist/dataverse.js +94 -94
- package/examples/kanban/dist/environmentVar.js +55 -55
- package/examples/kanban/dist/office365groups.js +97 -97
- package/examples/kanban/dist/office365users.js +169 -169
- package/examples/kanban/dist/outlook.js +162 -162
- package/examples/kanban/dist/power-apps-data.js +2953 -2953
- package/examples/kanban/dist/sharepoint.js +339 -339
- package/examples/myProfile/dist/index.html +184 -184
- package/examples/myProfile/dist/index.js +141 -141
- package/examples/myProfile/dist/office365users.js +169 -169
- package/examples/myProfile/dist/power-apps-data.js +2953 -2953
- package/examples/myProfile/power.config.json +22 -22
- package/examples/myProfile/readme.md +79 -79
- package/examples/outlook Demo/dist/codeapp.js +1085 -1085
- package/examples/outlook Demo/dist/index.html +35 -35
- package/examples/outlook Demo/dist/index.js +170 -170
- package/examples/outlook Demo/dist/outlook.js +121 -121
- package/examples/outlook Demo/dist/power-apps-data.js +2911 -2911
- package/examples/outlook Demo/dist/styles.css +84 -84
- package/examples/outlook Demo/readme.md +82 -82
- package/examples/outlook Demo2/OutlookDemo_1_0_0_1.zip +0 -0
- package/examples/outlook Demo2/agent/decision-log.md +7 -0
- package/examples/{solution explorer → outlook Demo2}/dist/codeapp.js +245 -9
- package/examples/outlook Demo2/dist/index.html +98 -0
- package/examples/outlook Demo2/dist/index.js +272 -0
- package/examples/outlook Demo2/dist/styles.css +639 -0
- package/examples/outlook Demo2/power.config.json +23 -0
- package/examples/outlook Demo2/src/generated/index.ts +14 -0
- package/examples/outlook Demo2/src/generated/models/Office365GroupsModel.ts +363 -0
- package/examples/outlook Demo2/src/generated/models/Office365OutlookModel.ts +2046 -0
- package/examples/outlook Demo2/src/generated/models/Office365UsersModel.ts +254 -0
- package/examples/outlook Demo2/src/generated/services/Office365GroupsService.ts +326 -0
- package/examples/outlook Demo2/src/generated/services/Office365OutlookService.ts +2476 -0
- package/examples/outlook Demo2/src/generated/services/Office365UsersService.ts +358 -0
- package/examples/planning Poker/.vscode/settings.json +4 -4
- package/examples/planning Poker/additional files/customizations (tables).xml +6428 -6428
- package/examples/planning Poker/additional files/dataverse-tables.json +165 -165
- package/examples/planning Poker/additional files/readme.md +122 -122
- package/examples/planning Poker/dist/dataverse.js +78 -78
- package/examples/planning Poker/dist/index.html +198 -198
- package/examples/planning Poker/dist/index.js +954 -954
- package/examples/planning Poker/dist/power-apps-data.js +2953 -2953
- package/examples/planning Poker/dist/styles.css +815 -815
- package/examples/sharePoint Demo/agent/decision-log.md +5 -5
- package/examples/sharePoint Demo/dist/codeapp.js +1085 -1085
- package/examples/sharePoint Demo/dist/index.js +262 -262
- package/examples/sharePoint Demo/dist/power-apps-data.js +2911 -2911
- package/examples/sharePoint Demo/power.config.json +22 -22
- package/examples/todo/dist/dataverse.js +64 -64
- package/examples/todo/dist/index.html +75 -75
- package/examples/todo/dist/index.js +8 -8
- package/examples/todo/dist/power-apps-data.js +2953 -2953
- package/examples/todo/dist/renderer.js +375 -375
- package/examples/todo/dist/styles.css +691 -691
- package/examples/todo/power.config.json +34 -34
- package/package.json +1 -1
- package/readme.md +33 -4
- package/examples/solution explorer/agent/decision-log.md +0 -27
- package/examples/solution explorer/agent/mockup-01-swiss-grid.html +0 -452
- package/examples/solution explorer/agent/mockup-02-dark-glass.html +0 -496
- package/examples/solution explorer/agent/mockup-03-paper-console.html +0 -510
- package/examples/solution explorer/agent/mockup-04-neon-noir.html +0 -546
- package/examples/solution explorer/agent/mockup-05-zen-garden.html +0 -534
- package/examples/solution explorer/dist/index.html +0 -80
- package/examples/solution explorer/dist/index.js +0 -735
- package/examples/solution explorer/dist/styles.css +0 -571
- package/examples/solution explorer/power.config.json +0 -151
- /package/examples/{solution explorer → outlook Demo2}/dist/icon-512.png +0 -0
- /package/examples/{solution explorer → outlook Demo2}/dist/power-apps-data.js +0 -0
|
@@ -1,169 +1,169 @@
|
|
|
1
|
-
import { getClient } from "@microsoft/power-apps/data";
|
|
2
|
-
|
|
3
|
-
// ── Data source name (must match connectionReferences in power.config.json) ──
|
|
4
|
-
const DATA_SOURCE = "office365users";
|
|
5
|
-
|
|
6
|
-
// ── Initialize SDK client for the Office 365 Users connector ───
|
|
7
|
-
function initClient() {
|
|
8
|
-
const dataSourcesInfo = {
|
|
9
|
-
[DATA_SOURCE]: {
|
|
10
|
-
tableId: "",
|
|
11
|
-
version: "",
|
|
12
|
-
primaryKey: "",
|
|
13
|
-
dataSourceType: "Connector",
|
|
14
|
-
apis: {
|
|
15
|
-
MyProfile_V2: {
|
|
16
|
-
path: "/{connectionId}/codeless/v1.0/me",
|
|
17
|
-
method: "GET",
|
|
18
|
-
parameters: [
|
|
19
|
-
{ name: "connectionId", in: "path", required: true },
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
UserProfile_V2: {
|
|
23
|
-
path: "/{connectionId}/codeless/v1.0/users/{id}",
|
|
24
|
-
method: "GET",
|
|
25
|
-
parameters: [
|
|
26
|
-
{ name: "connectionId", in: "path", required: true },
|
|
27
|
-
{ name: "id", in: "path", required: true },
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
Manager_V2: {
|
|
31
|
-
path: "/{connectionId}/codeless/v1.0/users/{id}/manager",
|
|
32
|
-
method: "GET",
|
|
33
|
-
parameters: [
|
|
34
|
-
{ name: "connectionId", in: "path", required: true },
|
|
35
|
-
{ name: "id", in: "path", required: true },
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
DirectReports_V2: {
|
|
39
|
-
path: "/{connectionId}/codeless/v1.0/users/{id}/directReports",
|
|
40
|
-
method: "GET",
|
|
41
|
-
parameters: [
|
|
42
|
-
{ name: "connectionId", in: "path", required: true },
|
|
43
|
-
{ name: "id", in: "path", required: true },
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
UserPhoto_V2: {
|
|
47
|
-
path: "/{connectionId}/codeless/v1.0/users/{id}/photo/$value",
|
|
48
|
-
method: "GET",
|
|
49
|
-
parameters: [
|
|
50
|
-
{ name: "connectionId", in: "path", required: true },
|
|
51
|
-
{ name: "id", in: "path", required: true },
|
|
52
|
-
],
|
|
53
|
-
responseInfo: { "200": "image/jpeg" },
|
|
54
|
-
},
|
|
55
|
-
SearchUser_V2: {
|
|
56
|
-
path: "/{connectionId}/codeless/v1.0/users",
|
|
57
|
-
method: "GET",
|
|
58
|
-
parameters: [
|
|
59
|
-
{ name: "connectionId", in: "path", required: true },
|
|
60
|
-
{ name: "searchTerm", in: "query", required: false },
|
|
61
|
-
{ name: "$top", in: "query", required: false },
|
|
62
|
-
{ name: "$skip", in: "query", required: false },
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
HttpRequest: {
|
|
66
|
-
path: "/{connectionId}/codeless/v1.0/httprequest",
|
|
67
|
-
method: "POST",
|
|
68
|
-
parameters: [
|
|
69
|
-
{ name: "connectionId", in: "path", required: true },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
return getClient(dataSourcesInfo);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// ── Internal: execute a connector operation ────────────────────
|
|
79
|
-
async function execOp(operationName, parameters) {
|
|
80
|
-
const client = await initClient();
|
|
81
|
-
const result = await client.executeAsync({
|
|
82
|
-
connectorOperation: {
|
|
83
|
-
tableName: DATA_SOURCE,
|
|
84
|
-
operationName,
|
|
85
|
-
parameters,
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
if (!result.success) {
|
|
89
|
-
throw new Error(result.error?.message || "Operation failed");
|
|
90
|
-
}
|
|
91
|
-
return result.data;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// ═══════════════════════════════════════════════════════════════
|
|
95
|
-
// GENERIC
|
|
96
|
-
// ═══════════════════════════════════════════════════════════════
|
|
97
|
-
|
|
98
|
-
// ── Call any Office 365 Users operation by name ────────────────
|
|
99
|
-
export async function callUsersOperation(operationName, parameters = {}) {
|
|
100
|
-
return execOp(operationName, parameters);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// ── Open HTTP Request ──────────────────────────────────────────
|
|
104
|
-
export async function openHttpRequest({ method = "GET", uri, headers, body }) {
|
|
105
|
-
return execOp("HttpRequest", {
|
|
106
|
-
method,
|
|
107
|
-
uri,
|
|
108
|
-
headers: headers || {},
|
|
109
|
-
body: body || "",
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// ═══════════════════════════════════════════════════════════════
|
|
114
|
-
// PROFILE
|
|
115
|
-
// ═══════════════════════════════════════════════════════════════
|
|
116
|
-
|
|
117
|
-
// ── Get My Profile ─────────────────────────────────────────────
|
|
118
|
-
export async function getMyProfile() {
|
|
119
|
-
return execOp("MyProfile_V2", {});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// ── Get User Profile ───────────────────────────────────────────
|
|
123
|
-
export async function getUserProfile(userId) {
|
|
124
|
-
return execOp("UserProfile_V2", {
|
|
125
|
-
id: userId,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// ═══════════════════════════════════════════════════════════════
|
|
130
|
-
// MANAGER & REPORTS
|
|
131
|
-
// ═══════════════════════════════════════════════════════════════
|
|
132
|
-
|
|
133
|
-
// ── Get Manager ────────────────────────────────────────────────
|
|
134
|
-
export async function getManager(userId) {
|
|
135
|
-
return execOp("Manager_V2", {
|
|
136
|
-
id: userId,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// ── Get Direct Reports ─────────────────────────────────────────
|
|
141
|
-
export async function getDirectReports(userId) {
|
|
142
|
-
return execOp("DirectReports_V2", {
|
|
143
|
-
id: userId,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// ═══════════════════════════════════════════════════════════════
|
|
148
|
-
// PHOTO
|
|
149
|
-
// ═══════════════════════════════════════════════════════════════
|
|
150
|
-
|
|
151
|
-
// ── Get User Photo ─────────────────────────────────────────────
|
|
152
|
-
export async function getUserPhoto(userId) {
|
|
153
|
-
return execOp("UserPhoto_V2", {
|
|
154
|
-
id: userId,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// ═══════════════════════════════════════════════════════════════
|
|
159
|
-
// SEARCH
|
|
160
|
-
// ═══════════════════════════════════════════════════════════════
|
|
161
|
-
|
|
162
|
-
// ── Search for Users ───────────────────────────────────────────
|
|
163
|
-
export async function searchForUsers({ searchTerm, top, skip } = {}) {
|
|
164
|
-
const params = {};
|
|
165
|
-
if (searchTerm) params.searchTerm = searchTerm;
|
|
166
|
-
if (top != null) params.$top = top;
|
|
167
|
-
if (skip != null) params.$skip = skip;
|
|
168
|
-
return execOp("SearchUser_V2", params);
|
|
169
|
-
}
|
|
1
|
+
import { getClient } from "@microsoft/power-apps/data";
|
|
2
|
+
|
|
3
|
+
// ── Data source name (must match connectionReferences in power.config.json) ──
|
|
4
|
+
const DATA_SOURCE = "office365users";
|
|
5
|
+
|
|
6
|
+
// ── Initialize SDK client for the Office 365 Users connector ───
|
|
7
|
+
function initClient() {
|
|
8
|
+
const dataSourcesInfo = {
|
|
9
|
+
[DATA_SOURCE]: {
|
|
10
|
+
tableId: "",
|
|
11
|
+
version: "",
|
|
12
|
+
primaryKey: "",
|
|
13
|
+
dataSourceType: "Connector",
|
|
14
|
+
apis: {
|
|
15
|
+
MyProfile_V2: {
|
|
16
|
+
path: "/{connectionId}/codeless/v1.0/me",
|
|
17
|
+
method: "GET",
|
|
18
|
+
parameters: [
|
|
19
|
+
{ name: "connectionId", in: "path", required: true },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
UserProfile_V2: {
|
|
23
|
+
path: "/{connectionId}/codeless/v1.0/users/{id}",
|
|
24
|
+
method: "GET",
|
|
25
|
+
parameters: [
|
|
26
|
+
{ name: "connectionId", in: "path", required: true },
|
|
27
|
+
{ name: "id", in: "path", required: true },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
Manager_V2: {
|
|
31
|
+
path: "/{connectionId}/codeless/v1.0/users/{id}/manager",
|
|
32
|
+
method: "GET",
|
|
33
|
+
parameters: [
|
|
34
|
+
{ name: "connectionId", in: "path", required: true },
|
|
35
|
+
{ name: "id", in: "path", required: true },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
DirectReports_V2: {
|
|
39
|
+
path: "/{connectionId}/codeless/v1.0/users/{id}/directReports",
|
|
40
|
+
method: "GET",
|
|
41
|
+
parameters: [
|
|
42
|
+
{ name: "connectionId", in: "path", required: true },
|
|
43
|
+
{ name: "id", in: "path", required: true },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
UserPhoto_V2: {
|
|
47
|
+
path: "/{connectionId}/codeless/v1.0/users/{id}/photo/$value",
|
|
48
|
+
method: "GET",
|
|
49
|
+
parameters: [
|
|
50
|
+
{ name: "connectionId", in: "path", required: true },
|
|
51
|
+
{ name: "id", in: "path", required: true },
|
|
52
|
+
],
|
|
53
|
+
responseInfo: { "200": "image/jpeg" },
|
|
54
|
+
},
|
|
55
|
+
SearchUser_V2: {
|
|
56
|
+
path: "/{connectionId}/codeless/v1.0/users",
|
|
57
|
+
method: "GET",
|
|
58
|
+
parameters: [
|
|
59
|
+
{ name: "connectionId", in: "path", required: true },
|
|
60
|
+
{ name: "searchTerm", in: "query", required: false },
|
|
61
|
+
{ name: "$top", in: "query", required: false },
|
|
62
|
+
{ name: "$skip", in: "query", required: false },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
HttpRequest: {
|
|
66
|
+
path: "/{connectionId}/codeless/v1.0/httprequest",
|
|
67
|
+
method: "POST",
|
|
68
|
+
parameters: [
|
|
69
|
+
{ name: "connectionId", in: "path", required: true },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
return getClient(dataSourcesInfo);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ── Internal: execute a connector operation ────────────────────
|
|
79
|
+
async function execOp(operationName, parameters) {
|
|
80
|
+
const client = await initClient();
|
|
81
|
+
const result = await client.executeAsync({
|
|
82
|
+
connectorOperation: {
|
|
83
|
+
tableName: DATA_SOURCE,
|
|
84
|
+
operationName,
|
|
85
|
+
parameters,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
if (!result.success) {
|
|
89
|
+
throw new Error(result.error?.message || "Operation failed");
|
|
90
|
+
}
|
|
91
|
+
return result.data;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ═══════════════════════════════════════════════════════════════
|
|
95
|
+
// GENERIC
|
|
96
|
+
// ═══════════════════════════════════════════════════════════════
|
|
97
|
+
|
|
98
|
+
// ── Call any Office 365 Users operation by name ────────────────
|
|
99
|
+
export async function callUsersOperation(operationName, parameters = {}) {
|
|
100
|
+
return execOp(operationName, parameters);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ── Open HTTP Request ──────────────────────────────────────────
|
|
104
|
+
export async function openHttpRequest({ method = "GET", uri, headers, body }) {
|
|
105
|
+
return execOp("HttpRequest", {
|
|
106
|
+
method,
|
|
107
|
+
uri,
|
|
108
|
+
headers: headers || {},
|
|
109
|
+
body: body || "",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ═══════════════════════════════════════════════════════════════
|
|
114
|
+
// PROFILE
|
|
115
|
+
// ═══════════════════════════════════════════════════════════════
|
|
116
|
+
|
|
117
|
+
// ── Get My Profile ─────────────────────────────────────────────
|
|
118
|
+
export async function getMyProfile() {
|
|
119
|
+
return execOp("MyProfile_V2", {});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// ── Get User Profile ───────────────────────────────────────────
|
|
123
|
+
export async function getUserProfile(userId) {
|
|
124
|
+
return execOp("UserProfile_V2", {
|
|
125
|
+
id: userId,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ═══════════════════════════════════════════════════════════════
|
|
130
|
+
// MANAGER & REPORTS
|
|
131
|
+
// ═══════════════════════════════════════════════════════════════
|
|
132
|
+
|
|
133
|
+
// ── Get Manager ────────────────────────────────────────────────
|
|
134
|
+
export async function getManager(userId) {
|
|
135
|
+
return execOp("Manager_V2", {
|
|
136
|
+
id: userId,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// ── Get Direct Reports ─────────────────────────────────────────
|
|
141
|
+
export async function getDirectReports(userId) {
|
|
142
|
+
return execOp("DirectReports_V2", {
|
|
143
|
+
id: userId,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ═══════════════════════════════════════════════════════════════
|
|
148
|
+
// PHOTO
|
|
149
|
+
// ═══════════════════════════════════════════════════════════════
|
|
150
|
+
|
|
151
|
+
// ── Get User Photo ─────────────────────────────────────────────
|
|
152
|
+
export async function getUserPhoto(userId) {
|
|
153
|
+
return execOp("UserPhoto_V2", {
|
|
154
|
+
id: userId,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// ═══════════════════════════════════════════════════════════════
|
|
159
|
+
// SEARCH
|
|
160
|
+
// ═══════════════════════════════════════════════════════════════
|
|
161
|
+
|
|
162
|
+
// ── Search for Users ───────────────────────────────────────────
|
|
163
|
+
export async function searchForUsers({ searchTerm, top, skip } = {}) {
|
|
164
|
+
const params = {};
|
|
165
|
+
if (searchTerm) params.searchTerm = searchTerm;
|
|
166
|
+
if (top != null) params.$top = top;
|
|
167
|
+
if (skip != null) params.$skip = skip;
|
|
168
|
+
return execOp("SearchUser_V2", params);
|
|
169
|
+
}
|