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
|
@@ -3,16 +3,17 @@ import { enableDebugger } from "./codeapp.js";
|
|
|
3
3
|
enableDebugger();
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from './sharepoint.js';
|
|
6
|
+
createSpItemByList,
|
|
7
|
+
deleteSpItemByList,
|
|
8
|
+
getItemsByList,
|
|
9
|
+
resolveSharePointList,
|
|
10
|
+
updateSpItemByList,
|
|
11
|
+
} from './connectors/sharepoint.js';
|
|
12
12
|
|
|
13
13
|
const oAppConfig = {
|
|
14
14
|
sAppName: 'SharePoint Demo App',
|
|
15
15
|
sSiteUrl: 'https://37wcqv.sharepoint.com/sites/testsite',
|
|
16
|
+
sListId: '742435b6-7897-4636-ab8e-ec347405b9a6',
|
|
16
17
|
sListName: 'Test List',
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -89,43 +90,10 @@ async function initializeApp() {
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
async function resolveListAccess() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return oTableAccess;
|
|
96
|
-
}
|
|
97
|
-
} catch (oError) {
|
|
98
|
-
throw new Error('SharePoint table lookup failed: ' + getErrorMessage(oError));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
throw new Error('The SharePoint list "' + oAppConfig.sListName + '" could not be resolved through connector table lookup. Configure a real SharePoint list ID or expose a matching list through listTables.');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
async function resolveListAccessFromTables() {
|
|
105
|
-
const oTablesResponse = await listTables(oAppConfig.sSiteUrl);
|
|
106
|
-
const aTables = normalizeCollection(oTablesResponse);
|
|
107
|
-
const sTargetName = normalizeString(oAppConfig.sListName);
|
|
108
|
-
const oMatchedTable = aTables.find(function(oTable) {
|
|
109
|
-
return getListTableNames(oTable).some(function(sCandidate) {
|
|
110
|
-
return normalizeString(sCandidate) === sTargetName;
|
|
111
|
-
});
|
|
93
|
+
return resolveSharePointList(oAppConfig.sSiteUrl, {
|
|
94
|
+
listId: oAppConfig.sListId,
|
|
95
|
+
listName: oAppConfig.sListName,
|
|
112
96
|
});
|
|
113
|
-
|
|
114
|
-
if (!oMatchedTable) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const sListId = getTableId(oMatchedTable);
|
|
119
|
-
if (!sListId) {
|
|
120
|
-
throw new Error('The SharePoint connector returned the list but did not expose a usable list identifier.');
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
sSiteUrl: oAppConfig.sSiteUrl,
|
|
125
|
-
sListName: getPreferredListName(oMatchedTable),
|
|
126
|
-
sListId: sListId,
|
|
127
|
-
sAccessLabel: 'Connector table API',
|
|
128
|
-
};
|
|
129
97
|
}
|
|
130
98
|
|
|
131
99
|
async function refreshAppData({ bPreserveSelection } = { bPreserveSelection: true }) {
|
|
@@ -139,11 +107,11 @@ async function refreshAppData({ bPreserveSelection } = { bPreserveSelection: tru
|
|
|
139
107
|
return getItemId(oItem) === iExistingSelection;
|
|
140
108
|
});
|
|
141
109
|
|
|
142
|
-
oState.iSelectedItemId = bSelectionStillExists ? iExistingSelection :
|
|
110
|
+
oState.iSelectedItemId = bSelectionStillExists ? iExistingSelection : null;
|
|
143
111
|
}
|
|
144
112
|
|
|
145
113
|
async function fetchItems() {
|
|
146
|
-
const oResponse = await
|
|
114
|
+
const oResponse = await getItemsByList(oState.oListAccess.sSiteUrl, oState.oListAccess, { top: 200 });
|
|
147
115
|
return normalizeCollection(oResponse);
|
|
148
116
|
}
|
|
149
117
|
|
|
@@ -233,7 +201,7 @@ function renderApp() {
|
|
|
233
201
|
</div>
|
|
234
202
|
<div class="meta-card">
|
|
235
203
|
<span class="meta-label">Demo Focus</span>
|
|
236
|
-
<span class="meta-value">List items,
|
|
204
|
+
<span class="meta-value">List items, reusable list resolution, and connector-backed CRUD forms.</span>
|
|
237
205
|
</div>
|
|
238
206
|
</div>
|
|
239
207
|
</section>
|
|
@@ -257,11 +225,11 @@ function renderApp() {
|
|
|
257
225
|
<article class="panel">
|
|
258
226
|
<div class="panel-header">
|
|
259
227
|
<div>
|
|
260
|
-
<h2
|
|
261
|
-
<p
|
|
228
|
+
<h2>${oSelectedItem ? 'Update Record' : 'Add Record'}</h2>
|
|
229
|
+
<p>${oSelectedItem ? 'The selected SharePoint item is loaded below. Update the values here and save the changes back to the list.' : 'Create a new SharePoint item using discovered fields. Required columns are marked automatically when metadata is available.'}</p>
|
|
262
230
|
</div>
|
|
263
231
|
</div>
|
|
264
|
-
${renderCreateForm()}
|
|
232
|
+
${renderCreateForm(oSelectedItem)}
|
|
265
233
|
</article>
|
|
266
234
|
|
|
267
235
|
<section>
|
|
@@ -315,23 +283,33 @@ function renderStatusMarkup() {
|
|
|
315
283
|
`;
|
|
316
284
|
}
|
|
317
285
|
|
|
318
|
-
function renderCreateForm() {
|
|
286
|
+
function renderCreateForm(oSelectedItem) {
|
|
287
|
+
const bEditing = Boolean(oSelectedItem);
|
|
288
|
+
const sFormMode = bEditing ? 'edit' : 'create';
|
|
289
|
+
const sSubmitLabel = bEditing
|
|
290
|
+
? (oState.bSubmittingEdit ? 'Updating...' : 'Update item')
|
|
291
|
+
: (oState.bSubmittingCreate ? 'Adding...' : 'Add item');
|
|
292
|
+
const sResetLabel = bEditing ? 'Create new item' : 'Clear form';
|
|
293
|
+
const sOverrideLabel = bEditing
|
|
294
|
+
? 'JSON object merged into the update request'
|
|
295
|
+
: 'JSON object merged into the create request';
|
|
296
|
+
|
|
319
297
|
return `
|
|
320
|
-
<form id="
|
|
321
|
-
${renderFieldInputs(
|
|
322
|
-
<p class="helper-text"
|
|
298
|
+
<form id="item-form" class="field-grid" data-mode="${sFormMode}" data-item-id="${bEditing ? String(getItemId(oSelectedItem)) : ''}">
|
|
299
|
+
${renderFieldInputs(oSelectedItem, sFormMode)}
|
|
300
|
+
<p class="helper-text">${bEditing ? 'The selected row is loaded into this form. Use advanced payload overrides only when you need to send extra fields manually.' : 'Use advanced payload overrides if your list has additional complex columns you want to send manually.'}</p>
|
|
323
301
|
<details class="details-box">
|
|
324
302
|
<summary>Advanced payload overrides</summary>
|
|
325
303
|
<div class="details-inner">
|
|
326
304
|
<div class="field">
|
|
327
|
-
<label for="
|
|
328
|
-
<textarea id="
|
|
305
|
+
<label for="${sFormMode}-overrides">${sOverrideLabel}</label>
|
|
306
|
+
<textarea id="${sFormMode}-overrides" name="payloadOverrides">{}</textarea>
|
|
329
307
|
</div>
|
|
330
308
|
</div>
|
|
331
309
|
</details>
|
|
332
310
|
<div class="button-row">
|
|
333
|
-
<button class="button" type="submit" ${isActionDisabled() ? 'disabled' : ''}>${
|
|
334
|
-
<button class="button-ghost" type="
|
|
311
|
+
<button class="button" type="submit" ${isActionDisabled() ? 'disabled' : ''}>${sSubmitLabel}</button>
|
|
312
|
+
<button class="button-ghost" type="button" data-action="reset-form" ${isActionDisabled() ? 'disabled' : ''}>${sResetLabel}</button>
|
|
335
313
|
</div>
|
|
336
314
|
</form>
|
|
337
315
|
`;
|
|
@@ -395,7 +373,7 @@ function renderEditorMarkup(oSelectedItem) {
|
|
|
395
373
|
if (!oSelectedItem) {
|
|
396
374
|
return `
|
|
397
375
|
<div class="editor-empty">
|
|
398
|
-
Select a record from the table to
|
|
376
|
+
Select a record from the table to load it into the form above. The primary button will switch from Add item to Update item.
|
|
399
377
|
</div>
|
|
400
378
|
`;
|
|
401
379
|
}
|
|
@@ -405,30 +383,20 @@ function renderEditorMarkup(oSelectedItem) {
|
|
|
405
383
|
<div>
|
|
406
384
|
<span class="tag">Selected record</span>
|
|
407
385
|
<h2>${escapeHtml(getPrimaryTitle(oSelectedItem))}</h2>
|
|
408
|
-
<p>
|
|
386
|
+
<p>This record is currently loaded into the form above. Update it there, or delete it from here.</p>
|
|
409
387
|
</div>
|
|
410
388
|
<div class="muted">Item ID ${String(getItemId(oSelectedItem))}</div>
|
|
411
389
|
</div>
|
|
412
|
-
<
|
|
413
|
-
|
|
414
|
-
<
|
|
415
|
-
<
|
|
416
|
-
|
|
417
|
-
<div class="field">
|
|
418
|
-
<label for="edit-overrides">JSON object merged into the update request</label>
|
|
419
|
-
<textarea id="edit-overrides" name="payloadOverrides">{}</textarea>
|
|
420
|
-
</div>
|
|
421
|
-
<p class="helper-text">Current item snapshot:</p>
|
|
422
|
-
<div class="field">
|
|
423
|
-
<textarea readonly>${escapeHtml(JSON.stringify(oSelectedItem, null, 2))}</textarea>
|
|
424
|
-
</div>
|
|
425
|
-
</div>
|
|
426
|
-
</details>
|
|
390
|
+
<div class="field-grid">
|
|
391
|
+
<p class="helper-text">Current item snapshot:</p>
|
|
392
|
+
<div class="field">
|
|
393
|
+
<textarea readonly>${escapeHtml(JSON.stringify(oSelectedItem, null, 2))}</textarea>
|
|
394
|
+
</div>
|
|
427
395
|
<div class="button-row">
|
|
428
|
-
<button class="button" type="
|
|
396
|
+
<button class="button-ghost" type="button" data-action="reset-form" ${isActionDisabled() ? 'disabled' : ''}>Create new item</button>
|
|
429
397
|
<button class="button-danger" type="button" data-delete-item="${String(getItemId(oSelectedItem))}" ${isActionDisabled() ? 'disabled' : ''}>Delete item</button>
|
|
430
398
|
</div>
|
|
431
|
-
</
|
|
399
|
+
</div>
|
|
432
400
|
`;
|
|
433
401
|
}
|
|
434
402
|
|
|
@@ -502,7 +470,7 @@ async function handleRootClick(oEvent) {
|
|
|
502
470
|
if (!Number.isNaN(iItemId)) {
|
|
503
471
|
oState.iSelectedItemId = iItemId;
|
|
504
472
|
oState.sError = '';
|
|
505
|
-
oState.sNotice = '
|
|
473
|
+
oState.sNotice = 'Item ' + String(iItemId) + ' loaded into the form.';
|
|
506
474
|
renderApp();
|
|
507
475
|
}
|
|
508
476
|
return;
|
|
@@ -519,6 +487,14 @@ async function handleRootClick(oEvent) {
|
|
|
519
487
|
const sAction = eAction.getAttribute('data-action');
|
|
520
488
|
if (sAction === 'refresh') {
|
|
521
489
|
await handleRefresh();
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
if (sAction === 'reset-form') {
|
|
494
|
+
oState.iSelectedItemId = null;
|
|
495
|
+
oState.sError = '';
|
|
496
|
+
oState.sNotice = 'Ready to add a new SharePoint item.';
|
|
497
|
+
renderApp();
|
|
522
498
|
}
|
|
523
499
|
}
|
|
524
500
|
|
|
@@ -529,13 +505,13 @@ async function handleRootSubmit(oEvent) {
|
|
|
529
505
|
return;
|
|
530
506
|
}
|
|
531
507
|
|
|
532
|
-
if (eForm.id === '
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
508
|
+
if (eForm.id === 'item-form') {
|
|
509
|
+
if (eForm.getAttribute('data-mode') === 'edit') {
|
|
510
|
+
await handleEditSubmit(eForm);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
536
513
|
|
|
537
|
-
|
|
538
|
-
await handleEditSubmit(eForm);
|
|
514
|
+
await handleCreateSubmit(eForm);
|
|
539
515
|
}
|
|
540
516
|
}
|
|
541
517
|
|
|
@@ -575,10 +551,9 @@ async function handleCreateSubmit(eForm) {
|
|
|
575
551
|
const oResult = await createListItem(oPayload);
|
|
576
552
|
await refreshAppData({ bPreserveSelection: false });
|
|
577
553
|
const iCreatedItemId = getItemId(oResult);
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
oState.sNotice = 'New item created successfully.';
|
|
554
|
+
oState.sNotice = iCreatedItemId != null
|
|
555
|
+
? 'New item ' + String(iCreatedItemId) + ' created successfully.'
|
|
556
|
+
: 'New item created successfully.';
|
|
582
557
|
} catch (oError) {
|
|
583
558
|
oState.sError = getErrorMessage(oError);
|
|
584
559
|
} finally {
|
|
@@ -638,21 +613,25 @@ async function handleDelete(iItemId) {
|
|
|
638
613
|
}
|
|
639
614
|
|
|
640
615
|
async function createListItem(oPayload) {
|
|
641
|
-
return
|
|
616
|
+
return createSpItemByList(oState.oListAccess.sSiteUrl, oState.oListAccess, oPayload);
|
|
642
617
|
}
|
|
643
618
|
|
|
644
619
|
async function updateListItem(iItemId, oPayload) {
|
|
645
|
-
return
|
|
620
|
+
return updateSpItemByList(oState.oListAccess.sSiteUrl, oState.oListAccess, iItemId, oPayload);
|
|
646
621
|
}
|
|
647
622
|
|
|
648
623
|
async function deleteListItem(iItemId) {
|
|
649
|
-
return
|
|
624
|
+
return deleteSpItemByList(oState.oListAccess.sSiteUrl, oState.oListAccess, iItemId);
|
|
650
625
|
}
|
|
651
626
|
|
|
652
627
|
function buildPayloadFromForm(eForm) {
|
|
653
628
|
const oPayload = {};
|
|
654
629
|
|
|
655
630
|
oState.aFields.forEach(function(oField) {
|
|
631
|
+
if (isSystemField(oField.sName)) {
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
|
|
656
635
|
const eField = eForm.elements.namedItem('field:' + oField.sName);
|
|
657
636
|
if (!eField) {
|
|
658
637
|
return;
|
|
@@ -812,44 +791,24 @@ function isEditablePrimitive(value) {
|
|
|
812
791
|
}
|
|
813
792
|
|
|
814
793
|
function isSystemField(sFieldName) {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
||
|
|
829
|
-
||
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
return oTable.DisplayName || oTable.displayName || oTable.Title || oTable.title || oAppConfig.sListName;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
function getListTableNames(oTable) {
|
|
837
|
-
return [
|
|
838
|
-
oTable.DisplayName,
|
|
839
|
-
oTable.displayName,
|
|
840
|
-
oTable.Title,
|
|
841
|
-
oTable.title,
|
|
842
|
-
oTable.TableName,
|
|
843
|
-
oTable.tableName,
|
|
844
|
-
oTable.Name,
|
|
845
|
-
oTable.name,
|
|
846
|
-
oTable.EntitySetName,
|
|
847
|
-
oTable.entitySetName,
|
|
848
|
-
].filter(Boolean);
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
function normalizeString(sValue) {
|
|
852
|
-
return String(sValue || '').trim().toLowerCase();
|
|
794
|
+
const sName = String(sFieldName || '').trim();
|
|
795
|
+
if (!sName) {
|
|
796
|
+
return true;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
const sLowerName = sName.toLowerCase();
|
|
800
|
+
if (aSystemFieldNames.some(function(sSystemFieldName) {
|
|
801
|
+
return sSystemFieldName.toLowerCase() === sLowerName;
|
|
802
|
+
})) {
|
|
803
|
+
return true;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
return sName.startsWith('@')
|
|
807
|
+
|| sName.startsWith('{')
|
|
808
|
+
|| sName.includes('}')
|
|
809
|
+
|| sName.includes('#')
|
|
810
|
+
|| sName.startsWith('_')
|
|
811
|
+
|| sLowerName === 'iteminternalid';
|
|
853
812
|
}
|
|
854
813
|
|
|
855
814
|
function getErrorMessage(oError) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"appId": "1979e40c-021e-457e-b0b5-a5bc009596c8",
|
|
3
3
|
"appDisplayName": "SharePoint DemoApp",
|
|
4
4
|
"description": "",
|
|
5
|
-
"environmentId": "
|
|
5
|
+
"environmentId": "Default-6b6c3ede-aa0d-4268-a46f-96b7621b13a8",
|
|
6
6
|
"buildPath": "./dist",
|
|
7
7
|
"buildEntryPoint": "index.html",
|
|
8
8
|
"logoPath": "default",
|