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,54 +1,54 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Dataverse Demo</title>
|
|
7
|
-
<script type="importmap">
|
|
8
|
-
{
|
|
9
|
-
"imports": {
|
|
10
|
-
"@microsoft/power-apps/data": "./power-apps-data.js"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
</script>
|
|
14
|
-
<style>
|
|
15
|
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
16
|
-
body { font-family: "Segoe UI", sans-serif; background: #f5f5f5; color: #333; padding: 2rem; }
|
|
17
|
-
h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }
|
|
18
|
-
#add-bar { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
|
|
19
|
-
#task-input { flex: 1; padding: .5rem .75rem; border: 1px solid #ccc; border-radius: 6px; font-size: .95rem; }
|
|
20
|
-
button { padding: .5rem 1.25rem; border: none; border-radius: 6px; background: #0078d4; color: #fff; font-size: .95rem; cursor: pointer; }
|
|
21
|
-
button:hover { background: #106ebe; }
|
|
22
|
-
button:disabled { opacity: .5; cursor: not-allowed; }
|
|
23
|
-
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
|
|
24
|
-
th, td { text-align: left; padding: .75rem 1rem; }
|
|
25
|
-
th { background: #0078d4; color: #fff; font-weight: 600; }
|
|
26
|
-
tr:nth-child(even) { background: #fafafa; }
|
|
27
|
-
#status { margin-top: 1rem; font-size: .85rem; color: #666; }
|
|
28
|
-
</style>
|
|
29
|
-
</head>
|
|
30
|
-
<body>
|
|
31
|
-
<h1>Dataverse Tasks</h1>
|
|
32
|
-
|
|
33
|
-
<div id="add-bar">
|
|
34
|
-
<input id="task-input" type="text" placeholder="New task subject..." />
|
|
35
|
-
<button id="btn-add">Add Task</button>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<table>
|
|
39
|
-
<thead>
|
|
40
|
-
<tr>
|
|
41
|
-
<th>Subject</th>
|
|
42
|
-
<th>Status</th>
|
|
43
|
-
<th>Created On</th>
|
|
44
|
-
</tr>
|
|
45
|
-
</thead>
|
|
46
|
-
<tbody id="task-body">
|
|
47
|
-
<tr><td colspan="3">Loading…</td></tr>
|
|
48
|
-
</tbody>
|
|
49
|
-
</table>
|
|
50
|
-
<div id="status"></div>
|
|
51
|
-
|
|
52
|
-
<script type="module" src="index.js"></script>
|
|
53
|
-
</body>
|
|
54
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Dataverse Demo</title>
|
|
7
|
+
<script type="importmap">
|
|
8
|
+
{
|
|
9
|
+
"imports": {
|
|
10
|
+
"@microsoft/power-apps/data": "./power-apps-data.js"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
<style>
|
|
15
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
16
|
+
body { font-family: "Segoe UI", sans-serif; background: #f5f5f5; color: #333; padding: 2rem; }
|
|
17
|
+
h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }
|
|
18
|
+
#add-bar { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
|
|
19
|
+
#task-input { flex: 1; padding: .5rem .75rem; border: 1px solid #ccc; border-radius: 6px; font-size: .95rem; }
|
|
20
|
+
button { padding: .5rem 1.25rem; border: none; border-radius: 6px; background: #0078d4; color: #fff; font-size: .95rem; cursor: pointer; }
|
|
21
|
+
button:hover { background: #106ebe; }
|
|
22
|
+
button:disabled { opacity: .5; cursor: not-allowed; }
|
|
23
|
+
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
|
|
24
|
+
th, td { text-align: left; padding: .75rem 1rem; }
|
|
25
|
+
th { background: #0078d4; color: #fff; font-weight: 600; }
|
|
26
|
+
tr:nth-child(even) { background: #fafafa; }
|
|
27
|
+
#status { margin-top: 1rem; font-size: .85rem; color: #666; }
|
|
28
|
+
</style>
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<h1>Dataverse Tasks</h1>
|
|
32
|
+
|
|
33
|
+
<div id="add-bar">
|
|
34
|
+
<input id="task-input" type="text" placeholder="New task subject..." />
|
|
35
|
+
<button id="btn-add">Add Task</button>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<table>
|
|
39
|
+
<thead>
|
|
40
|
+
<tr>
|
|
41
|
+
<th>Subject</th>
|
|
42
|
+
<th>Status</th>
|
|
43
|
+
<th>Created On</th>
|
|
44
|
+
</tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody id="task-body">
|
|
47
|
+
<tr><td colspan="3">Loading…</td></tr>
|
|
48
|
+
</tbody>
|
|
49
|
+
</table>
|
|
50
|
+
<div id="status"></div>
|
|
51
|
+
|
|
52
|
+
<script type="module" src="index.js"></script>
|
|
53
|
+
</body>
|
|
54
|
+
</html>
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { initDataSources, createItem, listItems } from './codeapp.js';
|
|
2
|
-
|
|
3
|
-
const TABLE = 'tasks';
|
|
4
|
-
const PK = 'activityid';
|
|
5
|
-
|
|
6
|
-
function dsEntry(sPrimaryKey) {
|
|
7
|
-
return { tableId: '', version: '', primaryKey: sPrimaryKey, dataSourceType: 'Dataverse', apis: {} };
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
initDataSources({
|
|
11
|
-
tasks: dsEntry('activityid')
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const taskBody = document.getElementById('task-body');
|
|
15
|
-
const taskInput = document.getElementById('task-input');
|
|
16
|
-
const btnAdd = document.getElementById('btn-add');
|
|
17
|
-
const status = document.getElementById('status');
|
|
18
|
-
|
|
19
|
-
function renderRows(records) {
|
|
20
|
-
if (!records || records.length === 0) {
|
|
21
|
-
taskBody.innerHTML = '<tr><td colspan="3">No tasks found.</td></tr>';
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
taskBody.innerHTML = records
|
|
25
|
-
.map((r) => {
|
|
26
|
-
const subject = r.subject || '—';
|
|
27
|
-
const state = r.statecode === 0 ? 'Open' : 'Completed';
|
|
28
|
-
const created = r.createdon
|
|
29
|
-
? new Date(r.createdon).toLocaleDateString()
|
|
30
|
-
: '—';
|
|
31
|
-
return '<tr><td>' + escapeHtml(subject) + '</td><td>' + state + '</td><td>' + created + '</td></tr>';
|
|
32
|
-
})
|
|
33
|
-
.join('');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function escapeHtml(sText) {
|
|
37
|
-
let sStr = String(sText == null ? '' : sText);
|
|
38
|
-
return sStr
|
|
39
|
-
.replace(new RegExp('&', 'g'), '&')
|
|
40
|
-
.replace(new RegExp('<', 'g'), '<')
|
|
41
|
-
.replace(new RegExp('>', 'g'), '>')
|
|
42
|
-
.replace(new RegExp('"', 'g'), '"')
|
|
43
|
-
.replace(new RegExp("'", 'g'), ''');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function loadTasks() {
|
|
47
|
-
status.textContent = 'Loading tasks…';
|
|
48
|
-
try {
|
|
49
|
-
const result = await listItems(TABLE, PK, {
|
|
50
|
-
select: ["subject", "statecode", "createdon"],
|
|
51
|
-
orderBy: ["createdon desc"],
|
|
52
|
-
top: 5,
|
|
53
|
-
});
|
|
54
|
-
renderRows(result.entities ?? []);
|
|
55
|
-
status.textContent = '';
|
|
56
|
-
} catch (err) {
|
|
57
|
-
status.textContent = 'Error loading tasks: ' + err.message;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async function addTask() {
|
|
62
|
-
const subject = taskInput.value.trim();
|
|
63
|
-
if (!subject) return;
|
|
64
|
-
|
|
65
|
-
btnAdd.disabled = true;
|
|
66
|
-
status.textContent = 'Creating task…';
|
|
67
|
-
try {
|
|
68
|
-
await createItem(TABLE, PK, { subject });
|
|
69
|
-
taskInput.value = '';
|
|
70
|
-
await loadTasks();
|
|
71
|
-
} catch (err) {
|
|
72
|
-
status.textContent = 'Error creating task: ' + err.message;
|
|
73
|
-
} finally {
|
|
74
|
-
btnAdd.disabled = false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
btnAdd.addEventListener('click', addTask);
|
|
79
|
-
taskInput.addEventListener('keydown', (e) => {
|
|
80
|
-
if (e.key === 'Enter') addTask();
|
|
81
|
-
});
|
|
82
|
-
|
|
1
|
+
import { initDataSources, createItem, listItems } from './codeapp.js';
|
|
2
|
+
|
|
3
|
+
const TABLE = 'tasks';
|
|
4
|
+
const PK = 'activityid';
|
|
5
|
+
|
|
6
|
+
function dsEntry(sPrimaryKey) {
|
|
7
|
+
return { tableId: '', version: '', primaryKey: sPrimaryKey, dataSourceType: 'Dataverse', apis: {} };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
initDataSources({
|
|
11
|
+
tasks: dsEntry('activityid')
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const taskBody = document.getElementById('task-body');
|
|
15
|
+
const taskInput = document.getElementById('task-input');
|
|
16
|
+
const btnAdd = document.getElementById('btn-add');
|
|
17
|
+
const status = document.getElementById('status');
|
|
18
|
+
|
|
19
|
+
function renderRows(records) {
|
|
20
|
+
if (!records || records.length === 0) {
|
|
21
|
+
taskBody.innerHTML = '<tr><td colspan="3">No tasks found.</td></tr>';
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
taskBody.innerHTML = records
|
|
25
|
+
.map((r) => {
|
|
26
|
+
const subject = r.subject || '—';
|
|
27
|
+
const state = r.statecode === 0 ? 'Open' : 'Completed';
|
|
28
|
+
const created = r.createdon
|
|
29
|
+
? new Date(r.createdon).toLocaleDateString()
|
|
30
|
+
: '—';
|
|
31
|
+
return '<tr><td>' + escapeHtml(subject) + '</td><td>' + state + '</td><td>' + created + '</td></tr>';
|
|
32
|
+
})
|
|
33
|
+
.join('');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function escapeHtml(sText) {
|
|
37
|
+
let sStr = String(sText == null ? '' : sText);
|
|
38
|
+
return sStr
|
|
39
|
+
.replace(new RegExp('&', 'g'), '&')
|
|
40
|
+
.replace(new RegExp('<', 'g'), '<')
|
|
41
|
+
.replace(new RegExp('>', 'g'), '>')
|
|
42
|
+
.replace(new RegExp('"', 'g'), '"')
|
|
43
|
+
.replace(new RegExp("'", 'g'), ''');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function loadTasks() {
|
|
47
|
+
status.textContent = 'Loading tasks…';
|
|
48
|
+
try {
|
|
49
|
+
const result = await listItems(TABLE, PK, {
|
|
50
|
+
select: ["subject", "statecode", "createdon"],
|
|
51
|
+
orderBy: ["createdon desc"],
|
|
52
|
+
top: 5,
|
|
53
|
+
});
|
|
54
|
+
renderRows(result.entities ?? []);
|
|
55
|
+
status.textContent = '';
|
|
56
|
+
} catch (err) {
|
|
57
|
+
status.textContent = 'Error loading tasks: ' + err.message;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function addTask() {
|
|
62
|
+
const subject = taskInput.value.trim();
|
|
63
|
+
if (!subject) return;
|
|
64
|
+
|
|
65
|
+
btnAdd.disabled = true;
|
|
66
|
+
status.textContent = 'Creating task…';
|
|
67
|
+
try {
|
|
68
|
+
await createItem(TABLE, PK, { subject });
|
|
69
|
+
taskInput.value = '';
|
|
70
|
+
await loadTasks();
|
|
71
|
+
} catch (err) {
|
|
72
|
+
status.textContent = 'Error creating task: ' + err.message;
|
|
73
|
+
} finally {
|
|
74
|
+
btnAdd.disabled = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
btnAdd.addEventListener('click', addTask);
|
|
79
|
+
taskInput.addEventListener('keydown', (e) => {
|
|
80
|
+
if (e.key === 'Enter') addTask();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
83
|
loadTasks();
|