codeapp-js 0.1.1 → 0.2.2

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.
Files changed (121) hide show
  1. package/codeApp/dist/codeapp.js +552 -78
  2. package/codeApp/dist/power-apps-data.js +2531 -2531
  3. package/dev files/outlook.js +218 -9
  4. package/examples/combined demo/dist/codeapp.js +1098 -0
  5. package/examples/combined demo/dist/index.js +69 -114
  6. package/examples/combined demo/dist/power-apps-data.js +646 -170
  7. package/examples/combined demo/power.config.json +42 -42
  8. package/examples/dataverse Demo/dist/codeapp.js +1085 -0
  9. package/examples/dataverse Demo/dist/index.html +54 -54
  10. package/examples/dataverse Demo/dist/index.js +82 -70
  11. package/examples/dataverse Demo/dist/power-apps-data.js +551 -170
  12. package/examples/dataverse Demo/power.config.json +34 -34
  13. package/examples/dataverse Demo/readme.md +79 -79
  14. package/examples/groups Demo/dist/codeapp.js +1085 -0
  15. package/examples/groups Demo/dist/index.js +27 -27
  16. package/examples/groups Demo/dist/power-apps-data.js +551 -170
  17. package/examples/kanban/dist/dataverse.js +94 -94
  18. package/examples/kanban/dist/environmentVar.js +55 -55
  19. package/examples/kanban/dist/office365groups.js +97 -97
  20. package/examples/kanban/dist/office365users.js +169 -169
  21. package/examples/kanban/dist/outlook.js +162 -162
  22. package/examples/kanban/dist/power-apps-data.js +560 -138
  23. package/examples/kanban/dist/sharepoint.js +339 -339
  24. package/examples/myProfile/dist/index.html +184 -184
  25. package/examples/myProfile/dist/index.js +141 -141
  26. package/examples/myProfile/dist/office365users.js +169 -169
  27. package/examples/myProfile/dist/power-apps-data.js +560 -138
  28. package/examples/myProfile/power.config.json +22 -22
  29. package/examples/myProfile/readme.md +79 -79
  30. package/examples/outlook Demo/dist/codeapp.js +1085 -0
  31. package/examples/outlook Demo/dist/index.html +35 -35
  32. package/examples/outlook Demo/dist/index.js +170 -166
  33. package/examples/outlook Demo/dist/outlook.js +121 -121
  34. package/examples/outlook Demo/dist/power-apps-data.js +551 -170
  35. package/examples/outlook Demo/dist/styles.css +84 -84
  36. package/examples/outlook Demo/readme.md +82 -82
  37. package/examples/outlook Demo2/OutlookDemo_1_0_0_1.zip +0 -0
  38. package/examples/outlook Demo2/agent/decision-log.md +7 -0
  39. package/examples/outlook Demo2/dist/codeapp.js +1334 -0
  40. package/examples/outlook Demo2/dist/icon-512.png +0 -0
  41. package/examples/outlook Demo2/dist/index.html +98 -0
  42. package/examples/outlook Demo2/dist/index.js +346 -0
  43. package/examples/outlook Demo2/dist/power-apps-data.js +3007 -0
  44. package/examples/outlook Demo2/dist/styles.css +639 -0
  45. package/examples/outlook Demo2/power.config.json +23 -0
  46. package/examples/outlook Demo2/src/generated/index.ts +14 -0
  47. package/examples/outlook Demo2/src/generated/models/Office365GroupsModel.ts +363 -0
  48. package/examples/outlook Demo2/src/generated/models/Office365OutlookModel.ts +2046 -0
  49. package/examples/outlook Demo2/src/generated/models/Office365UsersModel.ts +254 -0
  50. package/examples/outlook Demo2/src/generated/services/Office365GroupsService.ts +326 -0
  51. package/examples/outlook Demo2/src/generated/services/Office365OutlookService.ts +2476 -0
  52. package/examples/outlook Demo2/src/generated/services/Office365UsersService.ts +358 -0
  53. package/examples/planning Poker/.vscode/settings.json +4 -4
  54. package/examples/planning Poker/additional files/customizations (tables).xml +6428 -6428
  55. package/examples/planning Poker/additional files/dataverse-tables.json +165 -165
  56. package/examples/planning Poker/additional files/readme.md +122 -122
  57. package/examples/planning Poker/dist/dataverse.js +78 -78
  58. package/examples/planning Poker/dist/index.html +198 -198
  59. package/examples/planning Poker/dist/index.js +954 -954
  60. package/examples/planning Poker/dist/power-apps-data.js +560 -138
  61. package/examples/planning Poker/dist/styles.css +815 -815
  62. package/examples/sharePoint Demo/agent/decision-log.md +5 -5
  63. package/examples/sharePoint Demo/dist/codeapp.js +1085 -0
  64. package/examples/sharePoint Demo/dist/index.js +44 -51
  65. package/examples/sharePoint Demo/dist/power-apps-data.js +551 -170
  66. package/examples/sharePoint Demo/power.config.json +22 -22
  67. package/examples/solution explorer/agent/decision-log.md +27 -0
  68. package/examples/solution explorer/agent/mockup-01-swiss-grid.html +452 -0
  69. package/examples/solution explorer/agent/mockup-02-dark-glass.html +496 -0
  70. package/examples/solution explorer/agent/mockup-03-paper-console.html +510 -0
  71. package/examples/solution explorer/agent/mockup-04-neon-noir.html +546 -0
  72. package/examples/solution explorer/agent/mockup-05-zen-garden.html +534 -0
  73. package/examples/solution explorer/dist/codeapp.js +1098 -0
  74. package/examples/solution explorer/dist/icon-512.png +0 -0
  75. package/examples/solution explorer/dist/index.html +80 -0
  76. package/examples/solution explorer/dist/index.js +735 -0
  77. package/examples/solution explorer/dist/power-apps-data.js +3007 -0
  78. package/examples/solution explorer/dist/styles.css +571 -0
  79. package/examples/solution explorer/power.config.json +151 -0
  80. package/examples/todo/dist/dataverse.js +64 -64
  81. package/examples/todo/dist/index.html +75 -75
  82. package/examples/todo/dist/index.js +8 -8
  83. package/examples/todo/dist/power-apps-data.js +560 -138
  84. package/examples/todo/dist/renderer.js +375 -375
  85. package/examples/todo/dist/styles.css +691 -691
  86. package/examples/todo/power.config.json +34 -34
  87. package/package.json +1 -8
  88. package/docs-mockups/atelier/index.html +0 -120
  89. package/docs-mockups/atelier/script.js +0 -23
  90. package/docs-mockups/atelier/styles.css +0 -361
  91. package/docs-mockups/field-guide/index.html +0 -112
  92. package/docs-mockups/field-guide/script.js +0 -20
  93. package/docs-mockups/field-guide/styles.css +0 -272
  94. package/docs-mockups/index.html +0 -80
  95. package/docs-mockups/maker-hub/index.html +0 -178
  96. package/docs-mockups/maker-hub/script.js +0 -20
  97. package/docs-mockups/maker-hub/styles.css +0 -404
  98. package/docs-mockups/script.js +0 -26
  99. package/docs-mockups/signal/index.html +0 -146
  100. package/docs-mockups/signal/script.js +0 -20
  101. package/docs-mockups/signal/styles.css +0 -314
  102. package/docs-mockups/styles.css +0 -287
  103. package/examples/combined demo/dist/dataverse.js +0 -86
  104. package/examples/combined demo/dist/environmentVar.js +0 -55
  105. package/examples/combined demo/dist/office365groups.js +0 -97
  106. package/examples/combined demo/dist/office365users.js +0 -169
  107. package/examples/combined demo/dist/outlook.js +0 -162
  108. package/examples/combined demo/dist/sharepoint.js +0 -339
  109. package/examples/dataverse Demo/dist/dataverse.js +0 -86
  110. package/examples/groups Demo/dist/dataverse.js +0 -86
  111. package/examples/groups Demo/dist/environmentVar.js +0 -55
  112. package/examples/groups Demo/dist/office365groups.js +0 -97
  113. package/examples/groups Demo/dist/office365users.js +0 -169
  114. package/examples/groups Demo/dist/outlook.js +0 -162
  115. package/examples/groups Demo/dist/sharepoint.js +0 -339
  116. package/examples/sharePoint Demo/dist/dataverse.js +0 -94
  117. package/examples/sharePoint Demo/dist/environmentVar.js +0 -55
  118. package/examples/sharePoint Demo/dist/office365groups.js +0 -97
  119. package/examples/sharePoint Demo/dist/office365users.js +0 -169
  120. package/examples/sharePoint Demo/dist/outlook.js +0 -162
  121. package/examples/sharePoint Demo/dist/sharepoint.js +0 -339
@@ -1,16 +1,16 @@
1
1
 
2
- import { getItemsByName, getItems, listTables } from './sharepoint.js';
2
+ import { getItemsByName, getItems, listTables } from './codeapp.js';
3
3
 
4
- const sSiteUrl = '<SITE_URL>';
5
- const sListName = '<LIST_NAME>';
6
- const iTopRows = 20;
4
+ let sSiteUrl = '<SITE_URL>';
5
+ let sListName = '<LIST_NAME>';
6
+ let iTopRows = 20;
7
7
 
8
8
  function getElementById(sId) {
9
9
  return document.getElementById(sId);
10
10
  }
11
11
 
12
12
  function setStatus(sMessage, bIsError = false) {
13
- const eStatusBar = getElementById('statusBar');
13
+ let eStatusBar = getElementById('statusBar');
14
14
 
15
15
  if (!eStatusBar) {
16
16
  return;
@@ -22,7 +22,7 @@ function setStatus(sMessage, bIsError = false) {
22
22
  }
23
23
 
24
24
  function hideStatus() {
25
- const eStatusBar = getElementById('statusBar');
25
+ let eStatusBar = getElementById('statusBar');
26
26
 
27
27
  if (!eStatusBar) {
28
28
  return;
@@ -32,20 +32,20 @@ function hideStatus() {
32
32
  }
33
33
 
34
34
  function setMetaLabels(iRowCount) {
35
- const eSiteLabel = getElementById('siteLabel');
36
- const eListLabel = getElementById('listLabel');
37
- const eCountLabel = getElementById('countLabel');
35
+ let eSiteLabel = getElementById('siteLabel');
36
+ let eListLabel = getElementById('listLabel');
37
+ let eCountLabel = getElementById('countLabel');
38
38
 
39
39
  if (eSiteLabel) {
40
- eSiteLabel.textContent = `Site: ${sSiteUrl}`;
40
+ eSiteLabel.textContent = 'Site: ' + sSiteUrl;
41
41
  }
42
42
 
43
43
  if (eListLabel) {
44
- eListLabel.textContent = `List: ${sListName}`;
44
+ eListLabel.textContent = 'List: ' + sListName;
45
45
  }
46
46
 
47
47
  if (eCountLabel) {
48
- eCountLabel.textContent = `Rows: ${iRowCount}`;
48
+ eCountLabel.textContent = 'Rows: ' + iRowCount;
49
49
  }
50
50
  }
51
51
 
@@ -74,7 +74,7 @@ function isRenderableValue(value) {
74
74
  }
75
75
 
76
76
  function getVisibleColumns(aRows) {
77
- const aIgnoredColumns = [
77
+ let aIgnoredColumns = [
78
78
  '@odata.etag',
79
79
  'Attachments',
80
80
  'ContentTypeId',
@@ -83,11 +83,11 @@ function getVisibleColumns(aRows) {
83
83
  'odata.editLink'
84
84
  ];
85
85
 
86
- const aColumns = [];
86
+ let aColumns = [];
87
87
 
88
88
  aRows.forEach((oRow) => {
89
89
  Object.keys(oRow || {}).forEach((sKey) => {
90
- const bIgnored =
90
+ let bIgnored =
91
91
  aIgnoredColumns.includes(sKey) ||
92
92
  sKey.indexOf('@odata') === 0 ||
93
93
  sKey.indexOf('_') === 0;
@@ -107,7 +107,7 @@ function getVisibleColumns(aRows) {
107
107
 
108
108
  function formatCellValue(value) {
109
109
  if (value === null || value === undefined || value === '') {
110
- return '';
110
+ return '\u2014';
111
111
  }
112
112
 
113
113
  if (typeof value === 'boolean') {
@@ -118,10 +118,10 @@ function formatCellValue(value) {
118
118
  }
119
119
 
120
120
  function renderTable(aRows) {
121
- const eTable = getElementById('listTable');
122
- const eTableHead = getElementById('tableHead');
123
- const eTableBody = getElementById('tableBody');
124
- const eEmptyState = getElementById('emptyState');
121
+ let eTable = getElementById('listTable');
122
+ let eTableHead = getElementById('tableHead');
123
+ let eTableBody = getElementById('tableBody');
124
+ let eEmptyState = getElementById('emptyState');
125
125
 
126
126
  if (!eTable || !eTableHead || !eTableBody || !eEmptyState) {
127
127
  return;
@@ -136,7 +136,7 @@ function renderTable(aRows) {
136
136
  return;
137
137
  }
138
138
 
139
- const aColumns = getVisibleColumns(aRows);
139
+ let aColumns = getVisibleColumns(aRows);
140
140
 
141
141
  if (!aColumns.length) {
142
142
  eTable.hidden = true;
@@ -145,10 +145,10 @@ function renderTable(aRows) {
145
145
  return;
146
146
  }
147
147
 
148
- const eHeaderRow = document.createElement('tr');
148
+ let eHeaderRow = document.createElement('tr');
149
149
 
150
150
  aColumns.forEach((sColumn) => {
151
- const eHeaderCell = document.createElement('th');
151
+ let eHeaderCell = document.createElement('th');
152
152
  eHeaderCell.textContent = sColumn;
153
153
  eHeaderRow.appendChild(eHeaderCell);
154
154
  });
@@ -156,10 +156,10 @@ function renderTable(aRows) {
156
156
  eTableHead.appendChild(eHeaderRow);
157
157
 
158
158
  aRows.forEach((oRow) => {
159
- const eBodyRow = document.createElement('tr');
159
+ let eBodyRow = document.createElement('tr');
160
160
 
161
161
  aColumns.forEach((sColumn) => {
162
- const eBodyCell = document.createElement('td');
162
+ let eBodyCell = document.createElement('td');
163
163
  eBodyCell.textContent = formatCellValue(oRow[sColumn]);
164
164
  eBodyRow.appendChild(eBodyCell);
165
165
  });
@@ -176,26 +176,19 @@ function normalizeText(value) {
176
176
  }
177
177
 
178
178
  function getListIdentifier(oList) {
179
- return (
180
- oList?.Name ||
181
- oList?.name ||
182
- oList?.Id ||
183
- oList?.id ||
184
- oList?.TableName ||
185
- oList?.tableName ||
186
- ''
187
- );
179
+ if (!oList) return '';
180
+ return oList.Name || oList.name || oList.Id || oList.id || oList.TableName || oList.tableName || '';
188
181
  }
189
182
 
190
183
  function matchesListName(oList) {
191
- const sTarget = normalizeText(sListName);
192
- const aCandidates = [
193
- oList?.DisplayName,
194
- oList?.displayName,
195
- oList?.Title,
196
- oList?.title,
197
- oList?.Name,
198
- oList?.name
184
+ let sTarget = normalizeText(sListName);
185
+ let aCandidates = [
186
+ oList ? oList.DisplayName : null,
187
+ oList ? oList.displayName : null,
188
+ oList ? oList.Title : null,
189
+ oList ? oList.title : null,
190
+ oList ? oList.Name : null,
191
+ oList ? oList.name : null
199
192
  ]
200
193
  .filter(Boolean)
201
194
  .map((value) => normalizeText(value));
@@ -204,28 +197,28 @@ function matchesListName(oList) {
204
197
  }
205
198
 
206
199
  async function loadRowsByListName() {
207
- const oResult = await getItemsByName(sSiteUrl, sListName, { top: iTopRows });
200
+ let oResult = await getItemsByName(sSiteUrl, sListName, { top: iTopRows });
208
201
  return normalizeResultArray(oResult).slice(0, iTopRows);
209
202
  }
210
203
 
211
204
  async function loadRowsByResolvedListId() {
212
205
  setStatus('List name lookup failed. Trying connector table lookup...');
213
206
 
214
- const oTablesResult = await listTables(sSiteUrl);
215
- const aLists = normalizeResultArray(oTablesResult);
216
- const oMatchedList = aLists.find((oList) => matchesListName(oList));
217
- const sResolvedListId = getListIdentifier(oMatchedList);
207
+ let oTablesResult = await listTables(sSiteUrl);
208
+ let aLists = normalizeResultArray(oTablesResult);
209
+ let oMatchedList = aLists.find((oList) => matchesListName(oList));
210
+ let sResolvedListId = getListIdentifier(oMatchedList);
218
211
 
219
212
  if (!sResolvedListId) {
220
- throw new Error(`List '${sListName}' was not found in connector metadata.`);
213
+ throw new Error('List \'' + sListName + '\' was not found in connector metadata.');
221
214
  }
222
215
 
223
- const oItemsResult = await getItems(sSiteUrl, sResolvedListId, { top: iTopRows });
216
+ let oItemsResult = await getItems(sSiteUrl, sResolvedListId, { top: iTopRows });
224
217
  return normalizeResultArray(oItemsResult).slice(0, iTopRows);
225
218
  }
226
219
 
227
220
  function shouldTryFallback(oError) {
228
- const sMessage = oError && oError.message ? oError.message : String(oError);
221
+ let sMessage = oError && oError.message ? oError.message : String(oError);
229
222
  return sMessage.indexOf('404') >= 0 || sMessage.indexOf('Resource not found') >= 0;
230
223
  }
231
224
 
@@ -261,7 +254,7 @@ async function boot() {
261
254
  try {
262
255
  await loadSharePointRows();
263
256
  } catch (oErr) {
264
- const sMessage = oErr && oErr.message ? oErr.message : String(oErr);
257
+ let sMessage = oErr && oErr.message ? oErr.message : String(oErr);
265
258
  setStatus('SharePoint: ' + sMessage, true);
266
259
  }
267
260
  }