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.
Files changed (130) hide show
  1. package/AI/skills/autoreview/SKILL.md +69 -0
  2. package/AI/skills/connections/SKILL.md +4 -4
  3. package/AI/skills/dataverse/SKILL.md +4 -2
  4. package/AI/skills/frontend-design/SKILL.md +32 -20
  5. package/AI/skills/keyvault/SKILL.md +139 -0
  6. package/AI/skills/office365-groups/SKILL.md +46 -25
  7. package/AI/skills/office365-outlook/SKILL.md +56 -25
  8. package/AI/skills/office365-users/SKILL.md +41 -36
  9. package/AI/skills/sharepoint/SKILL.md +174 -31
  10. package/AI/skills/start/SKILL.md +38 -30
  11. package/codeApp/dist/connectors/autoreview.js +1654 -0
  12. package/codeApp/dist/connectors/office365groups.js +2995 -432
  13. package/{examples/outlook Demo/.power/schemas/office365/office365.Schema.json → codeApp/dist/connectors/office365outlook.js} +7439 -16
  14. package/codeApp/dist/connectors/office365users.js +2990 -349
  15. package/codeApp/dist/connectors/sharepoint.js +529 -308
  16. package/examples/combined demo/dist/connectors/office365outlook.js +28521 -0
  17. package/examples/combined demo/dist/connectors/office365users.js +3154 -0
  18. package/examples/combined demo/dist/index.js +2 -6
  19. package/examples/combined demo/power.config.json +1 -1
  20. package/examples/groups Demo/{.power/schemas/office365groups/office365groups.Schema.json → dist/connectors/office365groups.js } +3205 -2204
  21. package/examples/groups Demo/dist/index.js +1 -5
  22. package/examples/groups Demo/power.config.json +1 -1
  23. package/examples/myProfile/dist/connectors/office365users.js +3154 -0
  24. package/examples/myProfile/dist/index.js +1 -5
  25. package/examples/myProfile/power.config.json +1 -1
  26. package/examples/outlook Demo/dist/connectors/office365outlook.js +28521 -0
  27. package/examples/outlook Demo/dist/index.js +2 -5
  28. package/examples/outlook Demo/power.config.json +1 -1
  29. package/examples/sharePoint Demo/dist/connectors/sharepoint.js +687 -0
  30. package/examples/sharePoint Demo/dist/index.js +86 -127
  31. package/examples/sharePoint Demo/power.config.json +1 -1
  32. package/package.json +1 -1
  33. package/codeApp/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6275
  34. package/codeApp/.power/schemas/jira/jira.Schema.json +0 -6903
  35. package/codeApp/.power/schemas/keyvault/keyvault.Schema.json +0 -1600
  36. package/codeApp/.power/schemas/office365groups/office365groups.Schema.json +0 -2204
  37. package/codeApp/.power/schemas/teams/teams.Schema.json +0 -11112
  38. package/codeApp/dist/connectors/outlook.js +0 -1393
  39. package/codeApp/src/generated/index.ts +0 -12
  40. package/codeApp/src/generated/models/AzureKeyVaultModel.ts +0 -107
  41. package/codeApp/src/generated/models/JiraModel.ts +0 -501
  42. package/codeApp/src/generated/models/Office365GroupsModel.ts +0 -363
  43. package/codeApp/src/generated/models/Office365OutlookModel.ts +0 -2046
  44. package/codeApp/src/generated/models/Office365UsersModel.ts +0 -254
  45. package/codeApp/src/generated/services/AzureKeyVaultService.ts +0 -257
  46. package/codeApp/src/generated/services/JiraService.ts +0 -1124
  47. package/codeApp/src/generated/services/Office365GroupsService.ts +0 -326
  48. package/codeApp/src/generated/services/Office365OutlookService.ts +0 -2476
  49. package/codeApp/src/generated/services/Office365UsersService.ts +0 -358
  50. package/examples/apps/kanban/dist/dataverse.js +0 -94
  51. package/examples/apps/kanban/dist/environmentVar.js +0 -55
  52. package/examples/apps/kanban/dist/index.css +0 -605
  53. package/examples/apps/kanban/dist/index.html +0 -21
  54. package/examples/apps/kanban/dist/index.js +0 -860
  55. package/examples/apps/kanban/dist/office365groups.js +0 -97
  56. package/examples/apps/kanban/dist/office365users.js +0 -451
  57. package/examples/apps/kanban/dist/outlook.js +0 -162
  58. package/examples/apps/kanban/dist/power-apps-data.js +0 -2953
  59. package/examples/apps/kanban/dist/sharepoint.js +0 -435
  60. package/examples/apps/kanban/power.config.json +0 -35
  61. package/examples/apps/kanban/src/generated/index.ts +0 -14
  62. package/examples/apps/kanban/src/generated/models/Office365GroupsModel.ts +0 -363
  63. package/examples/apps/kanban/src/generated/models/Office365OutlookModel.ts +0 -2046
  64. package/examples/apps/kanban/src/generated/models/Office365UsersModel.ts +0 -254
  65. package/examples/apps/kanban/src/generated/services/Office365GroupsService.ts +0 -326
  66. package/examples/apps/kanban/src/generated/services/Office365OutlookService.ts +0 -2476
  67. package/examples/apps/kanban/src/generated/services/Office365UsersService.ts +0 -358
  68. package/examples/apps/planning Poker/additional files/AgilePoker_1_0_0_1.zip +0 -0
  69. package/examples/apps/planning Poker/additional files/PokerTables_1_0_0_1.zip +0 -0
  70. package/examples/apps/planning Poker/additional files/customizations (tables).xml +0 -6429
  71. package/examples/apps/planning Poker/additional files/dataverse-tables.json +0 -165
  72. package/examples/apps/planning Poker/additional files/readme.md +0 -122
  73. package/examples/apps/planning Poker/dist/dataverse.js +0 -78
  74. package/examples/apps/planning Poker/dist/index.html +0 -198
  75. package/examples/apps/planning Poker/dist/index.js +0 -955
  76. package/examples/apps/planning Poker/dist/power-apps-data.js +0 -2953
  77. package/examples/apps/planning Poker/dist/styles.css +0 -815
  78. package/examples/apps/planning Poker/power.config.json +0 -50
  79. package/examples/apps/solution explorer/dist/codeapp.js +0 -1098
  80. package/examples/apps/solution explorer/dist/icon-512.png +0 -0
  81. package/examples/apps/solution explorer/dist/index.html +0 -80
  82. package/examples/apps/solution explorer/dist/index.js +0 -735
  83. package/examples/apps/solution explorer/dist/power-apps-data.js +0 -3007
  84. package/examples/apps/solution explorer/dist/styles.css +0 -571
  85. package/examples/apps/solution explorer/power.config.json +0 -151
  86. package/examples/apps/todo/dist/dataverse.js +0 -64
  87. package/examples/apps/todo/dist/icon192.png +0 -0
  88. package/examples/apps/todo/dist/index.html +0 -75
  89. package/examples/apps/todo/dist/index.js +0 -9
  90. package/examples/apps/todo/dist/power-apps-data.js +0 -2953
  91. package/examples/apps/todo/dist/renderer.js +0 -375
  92. package/examples/apps/todo/dist/styles.css +0 -691
  93. package/examples/apps/todo/power.config.json +0 -35
  94. package/examples/combined demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6275
  95. package/examples/combined demo/.power/schemas/jira/jira.Schema.json +0 -6903
  96. package/examples/combined demo/.power/schemas/keyvault/keyvault.Schema.json +0 -1600
  97. package/examples/combined demo/.power/schemas/teams/teams.Schema.json +0 -11112
  98. package/examples/combined demo/dist/office365users.js +0 -513
  99. package/examples/combined demo/dist/outlook.js +0 -1393
  100. package/examples/combined demo/src/generated/index.ts +0 -12
  101. package/examples/combined demo/src/generated/models/AzureKeyVaultModel.ts +0 -107
  102. package/examples/combined demo/src/generated/models/JiraModel.ts +0 -501
  103. package/examples/combined demo/src/generated/models/Office365GroupsModel.ts +0 -363
  104. package/examples/combined demo/src/generated/models/Office365OutlookModel.ts +0 -2046
  105. package/examples/combined demo/src/generated/models/Office365UsersModel.ts +0 -254
  106. package/examples/combined demo/src/generated/services/AzureKeyVaultService.ts +0 -257
  107. package/examples/combined demo/src/generated/services/JiraService.ts +0 -1124
  108. package/examples/combined demo/src/generated/services/Office365GroupsService.ts +0 -326
  109. package/examples/combined demo/src/generated/services/Office365OutlookService.ts +0 -2476
  110. package/examples/combined demo/src/generated/services/Office365UsersService.ts +0 -358
  111. package/examples/groups Demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -613
  112. package/examples/groups Demo/dist/office365groups.js +0 -642
  113. package/examples/groups Demo/src/generated/index.ts +0 -10
  114. package/examples/groups Demo/src/generated/models/Office365GroupsModel.ts +0 -363
  115. package/examples/groups Demo/src/generated/services/Office365GroupsService.ts +0 -326
  116. package/examples/myProfile/dist/office365users.js +0 -517
  117. package/examples/outlook Demo/.power/schemas/appschemas/dataSourcesInfo.ts +0 -6512
  118. package/examples/outlook Demo/dist/outlook.js +0 -1393
  119. package/examples/outlook Demo/src/generated/index.ts +0 -10
  120. package/examples/outlook Demo/src/generated/models/Office365OutlookModel.ts +0 -2046
  121. package/examples/outlook Demo/src/generated/services/Office365OutlookService.ts +0 -2476
  122. package/examples/sharePoint Demo/dist/sharepoint.js +0 -466
  123. package/examples/sharePoint Demo/src/generated/index.ts +0 -14
  124. package/examples/sharePoint Demo/src/generated/models/Office365GroupsModel.ts +0 -363
  125. package/examples/sharePoint Demo/src/generated/models/Office365OutlookModel.ts +0 -2046
  126. package/examples/sharePoint Demo/src/generated/models/Office365UsersModel.ts +0 -254
  127. package/examples/sharePoint Demo/src/generated/services/Office365GroupsService.ts +0 -326
  128. package/examples/sharePoint Demo/src/generated/services/Office365OutlookService.ts +0 -2476
  129. package/examples/sharePoint Demo/src/generated/services/Office365UsersService.ts +0 -358
  130. package/readme.md +0 -590
package/readme.md DELETED
@@ -1,590 +0,0 @@
1
- # CodeApp JS
2
-
3
- A JavaScript-first Power Apps Code Apps workspace built around the `@microsoft/power-apps/data` runtime, generated Dataverse services, and handwritten connector wrappers for common Microsoft and third-party services. This repo is not affiliated with Microsoft Corporation in anyway.
4
-
5
- The repo currently ships connector wrappers for Outlook, SharePoint, Office 365 Groups, Office 365 Users, Teams, Jira, Azure Key Vault, and SQL Server.
6
-
7
- Move information can be found at [codappjs.com](https://codeappjs.com)
8
-
9
- ## Repository Layout
10
-
11
- ```text
12
- AI/
13
- codeapp.agent.md # Custom agent definition for repo-specific Code App workflows
14
- skills/ # Reusable skill documents for connectors and app-building guidance
15
- codeApp/
16
- dist/
17
- codeapp.js # Shared helper bridge for app code
18
- power-apps-data.js # Bundled Power Apps data runtime
19
- connectors/ # Handwritten connector wrappers used by apps in this repo
20
- index.html # Starter app shell
21
- index.js # Starter app logic
22
- src/
23
- generated/ # Generated Dataverse and connector models/services
24
- power.config.json # App configuration, Dataverse tables, and connection references
25
- examples/
26
- ... # Sample apps showing different connector and Dataverse patterns
27
- agent/
28
- decision-log.md # Durable repo-level decisions for AI-assisted work
29
- ```
30
-
31
- ## Requirements
32
-
33
- - Microsoft Power Platform CLI (`pac`)
34
- - A Power Platform environment with the connectors you want to use
35
-
36
- Verify the CLI from PowerShell:
37
-
38
- ```powershell
39
- Get-Command pac | Format-List
40
- ```
41
-
42
- ## npm Setup
43
-
44
- From the repository root:
45
-
46
- ```bash
47
- npm install
48
- ```
49
-
50
- To serve the repo locally:
51
-
52
- ```bash
53
- npm start
54
- ```
55
-
56
- The local server runs from the repo root on port `4173`. Useful sample URLs include:
57
-
58
- - `http://localhost:4173/codeApp/dist/`
59
- - `http://localhost:4173/examples/apps/todo/dist/`
60
- - `http://localhost:4173/examples/outlook%20Demo/dist/`
61
-
62
- To jump straight to the starter app:
63
-
64
- ```bash
65
- npm run start:codeapp
66
- ```
67
-
68
- ## PAC CLI Reference
69
-
70
- ```bash
71
- # Authenticate and create a local auth profile
72
- pac auth create
73
-
74
- # Authenticate directly to a specific environment
75
- pac auth create --environment "<environment-id-or-url>"
76
-
77
- # List saved auth profiles
78
- pac auth list
79
-
80
- # Select the active environment for the current auth profile
81
- pac env select --environment "<environment-id-or-url>"
82
-
83
- # List Dataverse connections in the selected environment
84
- pac connection list
85
-
86
- # Create a Dataverse connection
87
- pac connection create --name "<connection-name>" --application-id "<app-id>" --client-secret "<client-secret>" --tenant-id "<tenant-id>"
88
-
89
- # Add datasource files
90
- pac code add-data-source -a "<connection-name>" -c "<connection-id>"
91
-
92
- # Push the app to your Power Platform environment
93
- pac code push --solutionName <YourSolutionName>
94
- ```
95
-
96
- ## AI Folder
97
-
98
- The `AI/` folder holds the repo's agent customization assets.
99
-
100
- ### AI/codeapp.agent.md
101
-
102
- This file defines the custom `codeapp` agent mode used for Power Apps code-first work in this repo.. It captures repo-specific behavior such as:
103
-
104
- - preferring direct file creation and edits over advisory-only answers
105
- - reading connector skill files before wiring managed connectors
106
- - keeping durable notes in `agent/decision-log.md`
107
- - steering work toward `dist/`, `power.config.json`, and the repo wrappers instead of ad hoc runtime code
108
-
109
- To use it in VS Code GitHub Copilot use the set agent option and add a new agent.
110
-
111
- ### AI/skills
112
-
113
- Each skill folder contains a `SKILL.md` file that gives the agent focused guidance for a connector, runtime pattern, or build workflow.
114
-
115
- | Skill folder | Purpose |
116
- | --- | --- |
117
- | `AI/skills/connections` | Shared rules for connector-backed apps, connection references, and wrapper conventions |
118
- | `AI/skills/dataverse` | Dataverse CRUD, table registration, unbound actions, and helper usage |
119
- | `AI/skills/environment-variables` | Reading Dataverse-backed environment variables through the repo helper layer |
120
- | `AI/skills/frontend-design` | UI and visual-direction guidance for distinctive Code App frontends |
121
- | `AI/skills/jira` | Jira helper behavior, instance-aware flows, and raw operation guidance |
122
- | `AI/skills/keyvault` | Azure Key Vault helper usage and secret-handling rules |
123
- | `AI/skills/office365-groups` | Group listing, membership, events, and raw HTTP group calls |
124
- | `AI/skills/office365-outlook` | Mail, calendar, contacts, rooms, mailbox settings, and Outlook MCP helpers |
125
- | `AI/skills/office365-users` | Profiles, managers, reports, photos, search, and raw HTTP user calls |
126
- | `AI/skills/sharepoint` | List CRUD, libraries, files, and SharePoint HTTP request flows |
127
- | `AI/skills/sql` | SQL Server table, row, query, and stored procedure helper guidance |
128
- | `AI/skills/start` | Startup skill entry used during guided app bootstrapping workflows |
129
- | `AI/skills/teams` | Teams, channels, chats, mentions, notifications, and Teams HTTP calls |
130
-
131
- In practice, the connector skill files should be treated as the documentation companion to the wrapper files in `codeApp/dist/connectors/`.
132
-
133
- ## codeApp Files
134
-
135
- The starter app in `codeApp/` is the reference implementation for repo conventions.
136
-
137
- - `codeApp/dist/index.html`: the single-page shell loaded by the Power Apps host.
138
- - `codeApp/dist/index.js`: user-authored app logic and startup orchestration.
139
- - `codeApp/dist/codeapp.js`: shared helper layer for Dataverse and app runtime integration.
140
- - `codeApp/dist/power-apps-data.js`: bundled SDK runtime used by the wrappers.
141
- - `codeApp/dist/connectors/*.js`: stable handwritten wrappers for connector-backed operations.
142
- - `codeApp/src/generated/services/*.ts`: generated service classes for Dataverse and generated connector metadata.
143
- - `codeApp/src/generated/models/*.ts`: generated models used by the service layer.
144
- - `codeApp/power.config.json`: Dataverse table registration plus connection references for managed connectors.
145
-
146
- ## Configuring power.config.json
147
-
148
- ### Dataverse Tables
149
-
150
- Add Dataverse tables under `databaseReferences.default.cds.dataSources`:
151
-
152
- ```jsonc
153
- {
154
- "databaseReferences": {
155
- "default.cds": {
156
- "dataSources": {
157
- "accounts": {
158
- "entitySetName": "accounts",
159
- "logicalName": "account",
160
- "isHidden": false
161
- },
162
- "contacts": {
163
- "entitySetName": "contacts",
164
- "logicalName": "contact",
165
- "isHidden": false
166
- }
167
- },
168
- "environmentVariableName": ""
169
- }
170
- }
171
- }
172
- ```
173
-
174
- After adding the table, run `pac code push` to regenerate the corresponding service classes.
175
-
176
- ### Connection References
177
-
178
- Each connector wrapper expects a matching `connectionReferences` entry. The object key can vary by environment, but the `dataSources` value should stay aligned with the wrapper.
179
-
180
- ```jsonc
181
- {
182
- "connectionReferences": {
183
- "office365outlook": {
184
- "id": "/providers/Microsoft.PowerApps/apis/shared_office365",
185
- "displayName": "Office 365 Outlook",
186
- "dataSources": ["office365"],
187
- "dataSets": {}
188
- },
189
- "sharepointonline": {
190
- "id": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
191
- "displayName": "SharePoint",
192
- "dataSources": ["sharepointonline"],
193
- "dataSets": {}
194
- },
195
- "office365groups": {
196
- "id": "/providers/Microsoft.PowerApps/apis/shared_office365groups",
197
- "displayName": "Office 365 Groups",
198
- "dataSources": ["office365groups"],
199
- "dataSets": {}
200
- },
201
- "office365users": {
202
- "id": "/providers/Microsoft.PowerApps/apis/shared_office365users",
203
- "displayName": "Office 365 Users",
204
- "dataSources": ["office365users"],
205
- "dataSets": {}
206
- },
207
- "teamsConnection": {
208
- "id": "/providers/Microsoft.PowerApps/apis/shared_teams",
209
- "displayName": "Microsoft Teams",
210
- "dataSources": ["teams"],
211
- "dataSets": {}
212
- },
213
- "jiraConnection": {
214
- "id": "/providers/Microsoft.PowerApps/apis/shared_jira",
215
- "displayName": "Jira",
216
- "dataSources": ["jira"],
217
- "authenticationType": "APIToken",
218
- "dataSets": {}
219
- },
220
- "keyVaultConnection": {
221
- "id": "/providers/Microsoft.PowerApps/apis/shared_keyvault",
222
- "displayName": "Azure Key Vault",
223
- "dataSources": ["keyvault"],
224
- "authenticationType": "oauthDefault",
225
- "dataSets": {}
226
- },
227
- "sqlConnection": {
228
- "id": "/providers/Microsoft.PowerApps/apis/shared_sql",
229
- "displayName": "SQL Server",
230
- "dataSources": ["sql"],
231
- "dataSets": {}
232
- }
233
- }
234
- }
235
- ```
236
-
237
-
238
- ## Built-in Debugger
239
-
240
- `codeApp/dist/codeapp.js` includes a browser-side debugger UI for development. It is enabled by calling `enableDebugger()`.
241
-
242
- ### How to Use It
243
-
244
- 1. Import `enableDebugger` from `./codeapp.js` in `index.js`.
245
- 2. Call it early in your boot path, before the Dataverse or connector calls you want to inspect.
246
- 3. Run the app in the browser or deployed host.
247
- 4. Click the floating bug icon in the top-right corner to open or close the debug panel.
248
-
249
- ```js
250
- import { enableDebugger} from './codeapp.js';
251
-
252
- async function boot() {
253
- enableDebugger();
254
- }
255
-
256
- boot();
257
- ```
258
-
259
- ### What the Debugger Shows
260
-
261
- - a floating bug icon with a badge showing the number of logged calls
262
- - a side panel titled `codeapp.js Debugger`
263
- - per-call entries with function name, timestamp, and duration
264
- - captured arguments for each wrapped call
265
- - either the returned result or the thrown error
266
- - a copy button that writes the entry payload to the clipboard
267
- - a clear button that empties the current session log
268
-
269
- ### Important Behavior
270
-
271
- - The debugger is opt-in and inactive until `enableDebugger()` is called.
272
- - Most public helpers in `codeapp.js` and the connector wrappers are instrumented through `_dbgWrap(...)`, so enabling the debugger early gives the best coverage.
273
- - It supports both synchronous and asynchronous calls and records completion time in milliseconds.
274
- - If the document body is not ready yet, the debugger waits for `DOMContentLoaded` before injecting the UI.
275
- - Use it only in development. The helper logs a console warning when debug mode is enabled.
276
-
277
- ## Connector Coverage
278
- The handwritten connector wrappers live in `codeApp/dist/connectors/` (with the exception of Dataverse which is in the codeapp.js file) and are the public API surface for app code in this repo.
279
-
280
- | Connector | Wrapper file | Preferred data source | AI skill |
281
- | --- | --- | --- | --- |
282
- | Datavese | `codeApp/dist/codeapp.js` | `dataverse` | `AI/skills/dataverse/SKILL.md` |
283
- | Azure Key Vault | `codeApp/dist/connectors/azureKeyvault.js` | `keyvault` | `AI/skills/keyvault/SKILL.md` |
284
- | Jira | `codeApp/dist/connectors/jira.js` | `jira` | `AI/skills/jira/SKILL.md` |
285
- | Office 365 Groups | `codeApp/dist/connectors/office365groups.js` | `office365groups` | `AI/skills/office365-groups/SKILL.md` |
286
- | Office 365 Users | `codeApp/dist/connectors/office365users.js` | `office365users` | `AI/skills/office365-users/SKILL.md` |
287
- | Office 365 Outlook | `codeApp/dist/connectors/outlook.js` | `office365` | `AI/skills/office365-outlook/SKILL.md` |
288
- | SharePoint | `codeApp/dist/connectors/sharepoint.js` | `sharepointonline` | `AI/skills/sharepoint/SKILL.md` |
289
- | SQL Server | `codeApp/dist/connectors/sql.js` | `sql` | `AI/skills/sql/SKILL.md` |
290
- | Teams | `codeApp/dist/connectors/teams.js` | `teams` | `AI/skills/teams/SKILL.md` |
291
-
292
-
293
- ### Dataverse
294
-
295
- The shared helper file `codeApp/dist/codeapp.js` exposes the repo's Dataverse-focused runtime API. Import these helpers from `./codeapp.js` in your app code.
296
-
297
- #### Bootstrapping Helpers
298
-
299
- - `initDataSources(oSources)`: initializes the Dataverse tables known to the runtime. Call this before the first Dataverse request when you already know the full table set.
300
- - `registerTable(tableName, primaryKey)`: adds a Dataverse table at runtime and resets the shared client so the next request picks up the new table.
301
- - `getEnvironmentVariable(schemaName)`: reads a Dataverse environment variable value and falls back to the definition default value when no current value row exists.
302
- - `whoAmI()`: returns the current user ID from the Power Apps host context.
303
-
304
- Actions:
305
-
306
- - `createItem(tableName, primaryKey, record)`
307
- - `getItem(tableName, primaryKey, id, select)`
308
- - `listItems(tableName, primaryKey, { filter, select, orderBy, top, skip })`
309
- - `updateItem(tableName, primaryKey, id, changedFields)`
310
- - `deleteItem(tableName, primaryKey, id)`
311
- - `callUnboundAction(tableName, primaryKey, actionName, params)`
312
-
313
- #### Notes
314
-
315
- - `listItems(...)` returns an object shaped like `{ entities: [...] }`.
316
- - `getItem(...)` and `listItems(...)` accept arrays or comma-separated strings for `select`, and `listItems(...)` also accepts arrays or comma-separated strings for `orderBy`.
317
- - `callUnboundAction(...)` uses the registered data-source map to execute a Dataverse action. Do not add action names to `power.config.json` `dataSources`; actions are not entities.
318
- - `getEnvironmentVariable(...)` depends on `environmentvariabledefinitions` and `environmentvariablevalues` being available through Dataverse configuration.
319
-
320
- ### Example
321
-
322
- ```js
323
- import {
324
- initDataSources,
325
- createItem,
326
- getItem,
327
- listItems,
328
- updateItem,
329
- deleteItem,
330
- getEnvironmentVariable,
331
- callUnboundAction,
332
- whoAmI,
333
- } from './codeapp.js';
334
-
335
- function dsEntry(primaryKey) {
336
- return {
337
- tableId: '',
338
- version: '',
339
- primaryKey,
340
- dataSourceType: 'Dataverse',
341
- apis: {},
342
- };
343
- }
344
-
345
- async function boot() {
346
- initDataSources({
347
- accounts: dsEntry('accountid'),
348
- contacts: dsEntry('contactid'),
349
- environmentvariabledefinitions: dsEntry('environmentvariabledefinitionid'),
350
- environmentvariablevalues: dsEntry('environmentvariablevalueid'),
351
- });
352
-
353
- const me = await whoAmI();
354
- const apiBaseUrl = await getEnvironmentVariable('wd_apiBaseUrl');
355
-
356
- const created = await createItem('contacts', 'contactid', {
357
- firstname: 'Ada',
358
- lastname: 'Lovelace',
359
- });
360
-
361
- const contact = await getItem('contacts', 'contactid', created.contactid, ['firstname', 'lastname']);
362
-
363
- const results = await listItems('contacts', 'contactid', {
364
- select: ['firstname', 'lastname'],
365
- orderBy: 'lastname asc',
366
- top: 10,
367
- });
368
-
369
- await updateItem('contacts', 'contactid', created.contactid, { firstname: 'Augusta Ada' });
370
- await callUnboundAction('contacts', 'contactid', 'WhoAmI', {});
371
-
372
- console.log(me, apiBaseUrl, contact, results.entities);
373
- }
374
- ```
375
-
376
-
377
-
378
-
379
- ### Azure Key Vault
380
-
381
- Actions:
382
-
383
- - `callKeyVaultOperation(operationName, parameters)`
384
- - `listKeys(options)`
385
- - `listKeyVersions(keyName)`
386
- - `getKeyMetadata(keyName)`
387
- - `getKeyVersionMetadata(keyName, keyVersion)`
388
- - `encryptData(keyName, input)`
389
- - `encryptDataWithVersion(keyName, keyVersion, input)`
390
- - `decryptData(keyName, input)`
391
- - `decryptDataWithVersion(keyName, keyVersion, input)`
392
- - `getSecret(secretName, apiVersion)`
393
- - `listSecrets(options)`
394
- - `listSecretVersions(secretName, apiVersion)`
395
- - `getSecretMetadata(secretName, apiVersion)`
396
- - `getSecretVersionMetadata(secretName, secretVersion, apiVersion)`
397
- - `getSecretVersion(secretName, secretVersion, apiVersion)`
398
-
399
- ### Jira
400
-
401
- Actions:
402
-
403
- - `callJiraOperation(operationName, parameters)`
404
- - `addJiraComment(issueKey, body, jiraInstance)`
405
- - `cancelJiraTask(taskId, jiraInstance, token)`
406
- - `createJiraIssueV3(options)`
407
- - `editJiraIssueV2(issueIdOrKey, options)`
408
- - `getCurrentJiraUser({ jiraInstance, expand })`
409
- - `getJiraIssueByKey(issueKey, jiraInstance)`
410
- - `listJiraFilters(jiraInstance)`
411
- - `listJiraIssues({ jiraInstance, jql, fields, expand })`
412
- - `listJiraProjects(options)`
413
- - `getJiraTask(taskId, jiraInstance)`
414
- - `getJiraUser(accountId, options)`
415
- - `editJiraIssue(issueIdOrKey, options)`
416
- - `createJiraIssue(options)`
417
- - `updateJiraIssue(issueKey, options)`
418
- - `listJiraIssueTypes(options)`
419
- - `listJiraIssueTypeFields(options)`
420
- - `createJiraProject(options)`
421
- - `updateJiraProject(projectIdOrKey, options)`
422
- - `deleteJiraProject(projectIdOrKey, options)`
423
- - `listJiraProjectCategories(options)`
424
- - `createJiraProjectCategory(options)`
425
- - `removeJiraProjectCategory(id, options)`
426
- - `listJiraStatuses(options)`
427
- - `listJiraProjectUsers(options)`
428
- - `listJiraAssignableUsers(options)`
429
- - `listJiraPriorityTypes(options)`
430
- - `listJiraResources()`
431
- - `listJiraIssuesDatacenter(options)`
432
- - `listJiraTransitions(issueIdOrKey, options)`
433
- - `transitionJiraIssue(issueIdOrKey, options)`
434
- - `onNewJiraIssue(options)`
435
- - `onClosedJiraIssue(options)`
436
- - `onUpdatedJiraIssue(options)`
437
- - `onNewJiraIssueFromJql(options)`
438
- - `manageJiraIssues(queryRequest, sessionId)`
439
-
440
- ### Office 365 Groups
441
-
442
- Actions:
443
-
444
- - `callGroupsOperation(operationName, parameters)`
445
- - `openGroupsHttpRequest(options)`
446
- - `listMyGroups(options)`
447
- - `listGroupMembers(groupId, options)`
448
- - `listOwnedGroups(options)`
449
- - `listGroups(options)`
450
- - `onGroupMembershipChange(groupId, options)`
451
- - `addMemberToGroup(userUpn, groupId)`
452
- - `removeMemberFromGroup(userUpn, groupId)`
453
- - `createGroupEvent(groupId, options)`
454
- - `updateGroupEvent(eventId, options, groupId)`
455
- - `deleteGroupEvent(eventId, groupId)`
456
- - `onNewGroupEvent(groupId)`
457
- - `listDeletedGroups()`
458
- - `restoreDeletedGroup(groupId)`
459
- - `listDeletedGroupsByOwner(userId)`
460
-
461
- ### Office 365 Users
462
-
463
- Actions:
464
-
465
- - `callUsersOperation(operationName, parameters)`
466
- - `openUsersHttpRequest(options)`
467
- - `updateMyProfile(profile)`
468
- - `getMyProfile(options)`
469
- - `getUserProfile(userId, options)`
470
- - `getManager(userId, options)`
471
- - `getDirectReports(userId, options)`
472
- - `getMyTrendingDocuments(options)`
473
- - `getRelevantPeople(userId)`
474
- - `updateMyPhoto(bodyOrOptions, contentType)`
475
- - `getUserPhotoMetadata(userId)`
476
- - `getUserPhoto(userId)`
477
- - `getTrendingDocuments(userId, options)`
478
- - `searchForUsers(options)`
479
-
480
- ### Office 365 Outlook
481
-
482
- Actions:
483
-
484
- - `callOutlookOperation(operationName, parameters)`
485
- - `sendEmail(options)`
486
- - `forwardEmail(messageId, options)`
487
- - `replyToEmail(messageId, options)`
488
- - `listEmails(options)`
489
- - `sendFromSharedMailbox(sharedMailbox, options)`
490
- - `moveEmail(messageId, destinationFolderId, options)`
491
- - `deleteEmail(messageId, options)`
492
- - `createEvent(options)`
493
- - `listEvents(options)`
494
- - `editEvent(eventId, changedFields, calendarId)`
495
- - `deleteEvent(eventId, calendarId, options)`
496
- - `getEmail(messageId, options)`
497
- - `draftEmail(options)`
498
- - `updateDraftEmail(messageId, options)`
499
- - `sendDraftEmail(messageId)`
500
- - `markEmailAsRead(messageId, options)`
501
- - `updateEmailFlag(messageId, options)`
502
- - `getEmailAttachment(messageId, attachmentId, options)`
503
- - `listOutlookCategories()`
504
- - `assignOutlookCategory(messageId, category)`
505
- - `assignOutlookCategoryBulk(messageIds, categoryName)`
506
- - `listCalendars(options)`
507
- - `getEvent(eventId, calendarId, options)`
508
- - `getCalendarView(options)`
509
- - `respondToEventInvite(eventId, response, options)`
510
- - `listRoomLists()`
511
- - `listRooms()`
512
- - `listRoomsInRoomList(roomList)`
513
- - `findMeetingTimes(request)`
514
- - `setAutomaticReplies(settings)`
515
- - `getMailTips(request)`
516
- - `listContactFolders()`
517
- - `listContacts(folderId, options)`
518
- - `getContact(folderId, contactId, options)`
519
- - `createContact(folderId, contact)`
520
- - `updateContact(folderId, contactId, contact)`
521
- - `deleteContact(folderId, contactId, options)`
522
- - `callOutlookHttpRequest(options)`
523
- - `manageOutlookEmails(queryRequest, sessionId)`
524
- - `manageOutlookMeetings(queryRequest, sessionId)`
525
- - `manageOutlookContacts(queryRequest, sessionId)`
526
-
527
- ### SharePoint
528
-
529
- Actions:
530
-
531
- - `callSharePointOperation(operationName, parameters)`
532
- - `sendHttpRequest(options)`
533
- - `getItems(siteUrl, listId, options)`
534
- - `getSpItem(siteUrl, listId, itemId)`
535
- - `createSpItem(siteUrl, listId, fields)`
536
- - `updateSpItem(siteUrl, listId, itemId, changedFields)`
537
- - `deleteSpItem(siteUrl, listId, itemId)`
538
- - `listTables(siteUrl)`
539
- - `listLibrary(siteUrl)`
540
- - `createFile(siteUrl, libraryName, fileName, fileContent)`
541
- - `updateFile(siteUrl, fileId, fileContent)`
542
- - `deleteFile(siteUrl, fileId)`
543
- - `moveFile(siteUrl, sourceFileId, destinationFolderPath, newFileName)`
544
- - `getFileMetadata(siteUrl, fileId)`
545
-
546
- ### SQL Server
547
-
548
- Actions:
549
-
550
- - `callSqlOperation(operationName, parameters)`
551
- - `getSqlTables({ server, database })`
552
- - `getSqlRows({ server, database, table, apply, filter, orderBy, skip, top, select })`
553
- - `getSqlRow({ server, database, table, id })`
554
- - `insertSqlRow({ server, database, table, item })`
555
- - `updateSqlRow({ server, database, table, id, item })`
556
- - `deleteSqlRow({ server, database, table, id })`
557
- - `executeSqlQuery({ server, database, query })`
558
- - `executeSqlStoredProcedure({ server, database, procedure, parameters })`
559
-
560
- Raw SQL connector actions used by the wrapper:
561
-
562
- - `GetTables_V2`
563
- - `GetItems_V2`
564
- - `GetItem_V2`
565
- - `PostItem_V2`
566
- - `PatchItem_V2`
567
- - `DeleteItem_V2`
568
- - `ExecutePassThroughNativeQuery_V2`
569
- - `ExecuteProcedure_V2`
570
-
571
- ### Teams
572
-
573
- Actions:
574
-
575
- - `callTeamsOperation(operationName, parameters)`
576
- - `sendTeamsGraphHttpRequest(options)`
577
- - `listTeams()`
578
- - `listChannels(teamId)`
579
- - `getTeam(teamId)`
580
- - `getChannelDetails(teamId, channelId)`
581
- - `addMemberToTeam(teamId, body)`
582
- - `addMemberToChannel(teamId, channelId, body)`
583
- - `getUserMentionToken(userId)`
584
- - `getTeamTagMentionToken(teamId, tagId)`
585
- - `listChats({ top, skip })`
586
- - `listMembers(teamId, channelId)`
587
- - `postFeedNotification({ groupId, body })`
588
- - `postCardInChatOrChannel({ poster, location, body })`
589
- - `postMessageInChatOrChannel({ poster, location, body })`
590
-