codeapp-js 0.2.2 → 1.0.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 (176) hide show
  1. package/AI/codeapp.agent.md +105 -0
  2. package/AI/skills/connections/SKILL.md +47 -0
  3. package/AI/skills/dataverse/SKILL.md +99 -0
  4. package/AI/skills/environment-variables/SKILL.md +89 -0
  5. package/AI/skills/frontend-design/SKILL.md +34 -0
  6. package/AI/skills/jira/SKILL.md +81 -0
  7. package/AI/skills/office365-groups/SKILL.md +61 -0
  8. package/AI/skills/office365-outlook/SKILL.md +52 -0
  9. package/AI/skills/office365-users/SKILL.md +78 -0
  10. package/AI/skills/sharepoint/SKILL.md +77 -0
  11. package/AI/skills/sql/SKILL.md +85 -0
  12. package/AI/skills/start/SKILL.md +46 -0
  13. package/AI/skills/teams/SKILL.md +55 -0
  14. package/codeApp/.power/schemas/appschemas/dataSourcesInfo.ts +6275 -0
  15. package/codeApp/.power/schemas/jira/jira.Schema.json +6903 -0
  16. package/codeApp/.power/schemas/keyvault/keyvault.Schema.json +1600 -0
  17. package/{examples/combined demo/.power/schemas/office365groups/office365groups.Schema.json → codeApp/.power/schemas/office365groups/office365groups.Schema.json} +2203 -2203
  18. package/codeApp/.power/schemas/teams/teams.Schema.json +11112 -0
  19. package/codeApp/dist/codeapp.js +103 -1043
  20. package/codeApp/dist/connectors/azureKeyvault.js +459 -0
  21. package/codeApp/dist/connectors/jira.js +1247 -0
  22. package/codeApp/dist/connectors/office365groups.js +642 -0
  23. package/codeApp/dist/connectors/office365users.js +513 -0
  24. package/codeApp/dist/connectors/outlook.js +1393 -0
  25. package/{examples/kanban/dist → codeApp/dist/connectors}/sharepoint.js +466 -339
  26. package/codeApp/dist/connectors/sql.js +149 -0
  27. package/codeApp/dist/connectors/teams.js +280 -0
  28. package/codeApp/dist/index.js +1 -1
  29. package/codeApp/dist/power-apps-data.js +725 -176
  30. package/codeApp/src/generated/index.ts +12 -0
  31. package/codeApp/src/generated/models/AzureKeyVaultModel.ts +107 -0
  32. package/codeApp/src/generated/models/JiraModel.ts +501 -0
  33. package/codeApp/src/generated/services/AzureKeyVaultService.ts +257 -0
  34. package/codeApp/src/generated/services/JiraService.ts +1124 -0
  35. package/examples/{kanban → apps/kanban}/dist/dataverse.js +94 -94
  36. package/examples/{kanban → apps/kanban}/dist/index.css +605 -605
  37. package/examples/{kanban → apps/kanban}/dist/index.html +21 -21
  38. package/examples/{kanban → apps/kanban}/dist/index.js +860 -860
  39. package/examples/{kanban → apps/kanban}/dist/office365groups.js +97 -97
  40. package/examples/apps/kanban/dist/office365users.js +451 -0
  41. package/examples/{kanban → apps/kanban}/dist/outlook.js +162 -162
  42. package/examples/{planning Poker/dist/power-apps-data.js → apps/kanban/dist/power-apps-data.js} +2953 -2953
  43. package/{dev files/sharepoint.js → examples/apps/kanban/dist/sharepoint.js} +195 -99
  44. package/examples/{kanban → apps/kanban}/power.config.json +35 -35
  45. package/examples/{planning Poker → apps/planning Poker}/additional files/customizations (tables).xml +6428 -6428
  46. package/examples/{planning Poker → apps/planning Poker}/additional files/dataverse-tables.json +165 -165
  47. package/examples/{planning Poker → apps/planning Poker}/additional files/readme.md +122 -122
  48. package/examples/{planning Poker → apps/planning Poker}/dist/dataverse.js +78 -78
  49. package/examples/{planning Poker → apps/planning Poker}/dist/index.html +198 -198
  50. package/examples/{planning Poker → apps/planning Poker}/dist/index.js +954 -954
  51. package/examples/{kanban/dist/power-apps-data.js → apps/planning Poker/dist/power-apps-data.js } +2953 -2953
  52. package/examples/{planning Poker → apps/planning Poker}/dist/styles.css +815 -815
  53. package/examples/{planning Poker → apps/planning Poker}/power.config.json +50 -50
  54. package/examples/{solution explorer → apps/solution explorer}/dist/codeapp.js +1098 -1098
  55. package/examples/{solution explorer → apps/solution explorer}/dist/index.html +80 -80
  56. package/examples/{solution explorer → apps/solution explorer}/dist/index.js +735 -735
  57. package/examples/{solution explorer → apps/solution explorer}/dist/styles.css +571 -571
  58. package/examples/{solution explorer → apps/solution explorer}/power.config.json +150 -150
  59. package/examples/{todo → apps/todo}/dist/dataverse.js +64 -64
  60. package/examples/{todo → apps/todo}/dist/index.html +75 -75
  61. package/examples/{todo → apps/todo}/dist/index.js +8 -8
  62. package/examples/{todo → apps/todo}/dist/power-apps-data.js +2953 -2953
  63. package/examples/{todo → apps/todo}/dist/renderer.js +375 -375
  64. package/examples/{todo → apps/todo}/dist/styles.css +691 -691
  65. package/examples/{todo → apps/todo}/power.config.json +34 -34
  66. package/examples/combined demo/.power/schemas/appschemas/dataSourcesInfo.ts +6275 -7830
  67. package/examples/combined demo/.power/schemas/jira/jira.Schema.json +6903 -0
  68. package/examples/combined demo/.power/schemas/keyvault/keyvault.Schema.json +1600 -0
  69. package/examples/combined demo/.power/schemas/teams/teams.Schema.json +11112 -0
  70. package/examples/combined demo/dist/codeapp.js +394 -1098
  71. package/examples/combined demo/dist/index.html +29 -511
  72. package/examples/combined demo/dist/index.js +490 -470
  73. package/examples/combined demo/dist/office365users.js +513 -0
  74. package/examples/combined demo/dist/outlook.js +1393 -0
  75. package/examples/combined demo/dist/power-apps-data.js +3079 -3006
  76. package/examples/combined demo/dist/styles.css +483 -0
  77. package/examples/combined demo/power.config.json +33 -42
  78. package/examples/combined demo/src/generated/index.ts +12 -14
  79. package/examples/combined demo/src/generated/models/AzureKeyVaultModel.ts +107 -0
  80. package/examples/combined demo/src/generated/models/JiraModel.ts +501 -0
  81. package/examples/combined demo/src/generated/services/AzureKeyVaultService.ts +257 -0
  82. package/examples/combined demo/src/generated/services/JiraService.ts +1124 -0
  83. package/examples/dataverse Demo/dist/codeapp.js +394 -1085
  84. package/examples/{outlook Demo2/OutlookDemo_1_0_0_1.zip → dataverse Demo/dist/icon-512.png} +0 -0
  85. package/examples/dataverse Demo/dist/index.html +146 -54
  86. package/examples/dataverse Demo/dist/index.js +693 -83
  87. package/examples/dataverse Demo/dist/power-apps-data.js +3079 -2911
  88. package/examples/dataverse Demo/dist/styles.css +528 -0
  89. package/examples/dataverse Demo/power.config.json +41 -35
  90. package/examples/dataverse Demo/readme.md +79 -79
  91. package/examples/groups Demo/dist/codeapp.js +394 -1085
  92. package/examples/groups Demo/dist/icon-512.png +0 -0
  93. package/examples/groups Demo/dist/index.html +21 -25
  94. package/examples/groups Demo/dist/index.js +304 -113
  95. package/examples/groups Demo/dist/office365groups.js +642 -0
  96. package/examples/groups Demo/dist/power-apps-data.js +3079 -2911
  97. package/examples/groups Demo/dist/styles.css +509 -0
  98. package/examples/groups Demo/power.config.json +25 -25
  99. package/examples/myProfile/dist/codeapp.js +398 -0
  100. package/examples/myProfile/dist/index.html +21 -184
  101. package/examples/myProfile/dist/index.js +324 -141
  102. package/examples/myProfile/dist/office365users.js +517 -169
  103. package/examples/myProfile/dist/power-apps-data.js +3080 -2953
  104. package/examples/myProfile/dist/styles.css +458 -0
  105. package/examples/myProfile/power.config.json +24 -23
  106. package/examples/outlook Demo/dist/codeapp.js +394 -1085
  107. package/examples/outlook Demo/dist/index.html +150 -35
  108. package/examples/outlook Demo/dist/index.js +516 -170
  109. package/examples/outlook Demo/dist/outlook.js +1393 -121
  110. package/examples/outlook Demo/dist/power-apps-data.js +3079 -2911
  111. package/examples/outlook Demo/dist/styles.css +408 -84
  112. package/examples/outlook Demo/power.config.json +24 -23
  113. package/examples/outlook Demo/readme.md +92 -82
  114. package/examples/sharePoint Demo/dist/codeapp.js +394 -1085
  115. package/examples/sharePoint Demo/dist/icon-512.png +0 -0
  116. package/examples/sharePoint Demo/dist/index.html +22 -255
  117. package/examples/sharePoint Demo/dist/index.js +899 -262
  118. package/examples/sharePoint Demo/dist/power-apps-data.js +3079 -2911
  119. package/examples/sharePoint Demo/dist/sharepoint.js +466 -0
  120. package/examples/sharePoint Demo/dist/styles.css +587 -0
  121. package/examples/sharePoint Demo/power.config.json +23 -22
  122. package/package.json +1 -1
  123. package/readme.md +479 -61
  124. package/.github/instructions/wyattdave.instructions.md +0 -39
  125. package/.vscode/settings.json +0 -6
  126. package/dev files/dataverse.js +0 -105
  127. package/dev files/office365groups.js +0 -65
  128. package/dev files/office365users.js +0 -169
  129. package/dev files/outlook.js +0 -330
  130. package/examples/combined demo/.power/schemas/office365/office365.Schema.json +0 -21098
  131. package/examples/combined demo/.power/schemas/office365users/office365users.Schema.json +0 -2094
  132. package/examples/kanban/agent/decision-log.md +0 -9
  133. package/examples/kanban/agent/mockup-01-editorial-glass.html +0 -159
  134. package/examples/kanban/agent/mockup-02-dark-rail.html +0 -147
  135. package/examples/kanban/agent/mockup-03-paper-grid.html +0 -114
  136. package/examples/kanban/agent/mockup-04-neon-minimal.html +0 -141
  137. package/examples/kanban/agent/mockup-05-mono-architect.html +0 -119
  138. package/examples/kanban/dist/environmentVar.js +0 -55
  139. package/examples/kanban/dist/office365users.js +0 -169
  140. package/examples/kanban/src/generated/index.ts +0 -14
  141. package/examples/outlook Demo2/agent/decision-log.md +0 -7
  142. package/examples/outlook Demo2/dist/codeapp.js +0 -1334
  143. package/examples/outlook Demo2/dist/index.html +0 -98
  144. package/examples/outlook Demo2/dist/index.js +0 -346
  145. package/examples/outlook Demo2/dist/styles.css +0 -639
  146. package/examples/outlook Demo2/power.config.json +0 -23
  147. package/examples/planning Poker/.vscode/settings.json +0 -5
  148. package/examples/sharePoint Demo/agent/decision-log.md +0 -17
  149. package/examples/solution explorer/agent/decision-log.md +0 -27
  150. package/examples/solution explorer/agent/mockup-01-swiss-grid.html +0 -452
  151. package/examples/solution explorer/agent/mockup-02-dark-glass.html +0 -496
  152. package/examples/solution explorer/agent/mockup-03-paper-console.html +0 -510
  153. package/examples/solution explorer/agent/mockup-04-neon-noir.html +0 -546
  154. package/examples/solution explorer/agent/mockup-05-zen-garden.html +0 -534
  155. package/examples/solution explorer/dist/power-apps-data.js +0 -3007
  156. package/scripts/build-power-sdk.mjs +0 -69
  157. /package/{examples/kanban → codeApp}/src/generated/models/Office365GroupsModel.ts +0 -0
  158. /package/{examples/kanban → codeApp}/src/generated/models/Office365OutlookModel.ts +0 -0
  159. /package/{examples/kanban → codeApp}/src/generated/models/Office365UsersModel.ts +0 -0
  160. /package/{examples/kanban → codeApp}/src/generated/services/Office365GroupsService.ts +0 -0
  161. /package/{examples/kanban → codeApp}/src/generated/services/Office365OutlookService.ts +0 -0
  162. /package/{examples/kanban → codeApp}/src/generated/services/Office365UsersService.ts +0 -0
  163. /package/{dev files → examples/apps/kanban/dist}/environmentVar.js +0 -0
  164. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/index.ts +0 -0
  165. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365GroupsModel.ts +0 -0
  166. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365OutlookModel.ts +0 -0
  167. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365UsersModel.ts +0 -0
  168. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365GroupsService.ts +0 -0
  169. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365OutlookService.ts +0 -0
  170. /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365UsersService.ts +0 -0
  171. /package/examples/{planning Poker → apps/planning Poker}/additional files/AgilePoker_1_0_0_1.zip +0 -0
  172. /package/examples/{planning Poker → apps/planning Poker}/additional files/PokerTables_1_0_0_1.zip +0 -0
  173. /package/examples/{outlook Demo2 → apps/solution explorer}/dist/icon-512.png +0 -0
  174. /package/examples/{outlook Demo2 → apps/solution explorer}/dist/power-apps-data.js +0 -0
  175. /package/examples/{todo → apps/todo}/dist/icon192.png +0 -0
  176. /package/examples/{solution explorer → combined demo}/dist/icon-512.png +0 -0
package/readme.md CHANGED
@@ -1,36 +1,43 @@
1
- # CodeApp js
2
- A simplified JavaScript version of Microsofts Power Apps Code Apps.
3
- The project using the `@microsoft/power-apps/data` SDK. It includes generated Dataverse services and connector libraries for Outlook, SharePoint, Office 365 Groups, and Office 365 Users (more to follow soon).
4
-
5
- ---
6
-
7
- ## Project Structure
8
-
9
- ```
10
- dist/
11
- codeapp.js # bridging functions to the sdk
12
- power-apps-data.js # JavaScript version of SDK
13
- index.js # Custom JavaScript for your app
14
- index.html # Web page for App
15
- src/
16
- generated/ # Auto-generated connection services & models
17
- services/
18
- AccountsService.ts
19
- models/
20
- AccountsModel.ts
21
- CommonModels.ts
22
- power.config.json # App configuration, connections, and data sources
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
23
29
  ```
24
30
 
25
- ---
26
-
27
31
  ## Requirements
28
32
 
29
- - Microsoft Power Platform CLI (`pac`) must be installed before using this project.
30
- - Node.js and npm must be installed to use the local npm workflow.
31
- - Verify the CLI is available by running `pac` or `Get-Command pac | Format-List` in PowerShell.
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:
32
37
 
33
- ---
38
+ ```powershell
39
+ Get-Command pac | Format-List
40
+ ```
34
41
 
35
42
  ## npm Setup
36
43
 
@@ -40,18 +47,16 @@ From the repository root:
40
47
  npm install
41
48
  ```
42
49
 
43
- This installs the npm dependencies and rebuilds every local `power-apps-data.js` file from the published `@microsoft/power-apps` package so the samples stay in sync with npm.
44
-
45
- To serve the repository locally:
50
+ To serve the repo locally:
46
51
 
47
52
  ```bash
48
53
  npm start
49
54
  ```
50
55
 
51
- The server runs from the repo root on port `4173`, so you can open any sample directly, for example:
56
+ The local server runs from the repo root on port `4173`. Useful sample URLs include:
52
57
 
53
58
  - `http://localhost:4173/codeApp/dist/`
54
- - `http://localhost:4173/examples/todo/dist/`
59
+ - `http://localhost:4173/examples/apps/todo/dist/`
55
60
  - `http://localhost:4173/examples/outlook%20Demo/dist/`
56
61
 
57
62
  To jump straight to the starter app:
@@ -60,9 +65,7 @@ To jump straight to the starter app:
60
65
  npm run start:codeapp
61
66
  ```
62
67
 
63
- ---
64
-
65
- ## CLI Commands
68
+ ## PAC CLI Reference
66
69
 
67
70
  ```bash
68
71
  # Authenticate and create a local auth profile
@@ -84,33 +87,82 @@ pac connection list
84
87
  pac connection create --name "<connection-name>" --application-id "<app-id>" --client-secret "<client-secret>" --tenant-id "<tenant-id>"
85
88
 
86
89
  # Add datasource files
87
- pac code add-data-source -a "<connection-name>" -c "<connection-id"
90
+ pac code add-data-source -a "<connection-name>" -c "<connection-id>"
88
91
 
89
92
  # Push the app to your Power Platform environment
90
93
  pac code push --solutionName <YourSolutionName>
91
94
  ```
92
95
 
93
- ---
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
94
112
 
95
- ## Configuring `power.config.json`
113
+ Each skill folder contains a `SKILL.md` file that gives the agent focused guidance for a connector, runtime pattern, or build workflow.
96
114
 
97
- ### Adding a Dataverse Table
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 |
98
130
 
99
- To add a new Dataverse table (e.g. **contacts**), add an entry under `databaseReferences.default.cds.dataSources`:
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`:
100
151
 
101
152
  ```jsonc
102
153
  {
103
- // ... other config ...
104
154
  "databaseReferences": {
105
155
  "default.cds": {
106
156
  "dataSources": {
107
157
  "accounts": {
108
158
  "entitySetName": "accounts",
109
- "logicalName": "account"
159
+ "logicalName": "account",
160
+ "isHidden": false
110
161
  },
111
162
  "contacts": {
112
163
  "entitySetName": "contacts",
113
- "logicalName": "contact"
164
+ "logicalName": "contact",
165
+ "isHidden": false
114
166
  }
115
167
  },
116
168
  "environmentVariableName": ""
@@ -119,54 +171,420 @@ To add a new Dataverse table (e.g. **contacts**), add an entry under `databaseRe
119
171
  }
120
172
  ```
121
173
 
122
- After adding the table, run `pac code push` the SDK will auto-generate a service class (like `AccountsService`) that you can import and use.
123
-
124
- ### Adding a Connection Reference
174
+ After adding the table, run `pac code push` to regenerate the corresponding service classes.
125
175
 
126
- Each connector library needs a matching entry in `connectionReferences`.
176
+ ### Connection References
127
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.
128
179
 
129
180
  ```jsonc
130
181
  {
131
182
  "connectionReferences": {
132
- // Dataverse
133
- "Dataverse": {
134
- "id": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
135
- "displayName": "Microsoft Dataverse",
136
- "dataSources": ["commondataserviceforapps"],
137
- "dataSets": {}
138
- },
139
-
140
- // Office 365 Outlook (used by dist/outlook.js)
141
183
  "office365outlook": {
142
184
  "id": "/providers/Microsoft.PowerApps/apis/shared_office365",
143
185
  "displayName": "Office 365 Outlook",
144
186
  "dataSources": ["office365"],
145
187
  "dataSets": {}
146
188
  },
147
- // SharePoint Online (used by dist/sharepoint.js)
148
189
  "sharepointonline": {
149
190
  "id": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
150
191
  "displayName": "SharePoint",
151
192
  "dataSources": ["sharepointonline"],
152
193
  "dataSets": {}
153
194
  },
154
- // Office 365 Groups (used by dist/office365groups.js)
155
195
  "office365groups": {
156
196
  "id": "/providers/Microsoft.PowerApps/apis/shared_office365groups",
157
197
  "displayName": "Office 365 Groups",
158
198
  "dataSources": ["office365groups"],
159
199
  "dataSets": {}
160
200
  },
161
- // Office 365 Users (used by dist/office365users.js)
162
201
  "office365users": {
163
202
  "id": "/providers/Microsoft.PowerApps/apis/shared_office365users",
164
203
  "displayName": "Office 365 Users",
165
204
  "dataSources": ["office365users"],
166
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": {}
167
232
  }
168
233
  }
169
234
  }
170
235
  ```
171
236
 
172
- ---
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
+
@@ -1,39 +0,0 @@
1
- # Copilot Instructions
2
-
3
- These instructions guide AI coding agents working in this repository to be immediately productive and consistent with project conventions.
4
-
5
- ## Project Overview
6
- - standard web technologies: HTML, CSS, JavaScript (ES6+).
7
- - Core files:
8
- - `index.html`: Structure, assets, and script/style inclusions.
9
- - `styles.css`: responsive and built to light/dark themes using CSS custom properties.
10
- - `script.js`: key functionality of the site
11
- - `dom.js`: dom manipulation functions
12
- - `imgs/`: image files for UI icons.
13
- - `README.md`: Features, usage, and future enhancements.
14
- - `Sitemap.xml`: for search engine indexing.
15
- - No build step or backend;
16
- - Create as a Progressive Web App (PWA) with service worker for offline support and caching, but with always fetching latest data when online.
17
- - cloudflare hosting
18
-
19
- - Follow `wyattdave.instructions.md` conventions:
20
- - Use camelCase for variables and functions.
21
- - Prefix variable names: `b` boolean, `i` number, `s` string, `a` array, `o` object, `e` element.
22
- - Ensure variables are type consistent and avoid implicit type coercion by using naming conventions.
23
- - CSS should be in a separate file, avoid inline styles unless for dynamic styling.
24
- - JavaScript should be in a separate file, avoid inline event handlers and scripts in html.
25
- - JavaScript files should follow: script.js for main logic, dom.js for dom manipulation functions, specific js files for large logic, and per html page for page-specific logic.
26
- - Function-first approach; avoid classes unless necessary.
27
- - Build functions for reusability and testability; avoid inline code blocks.
28
- - Use descriptive names for variables and functions, avoiding abbreviations.
29
- - Use let and const, avoid var.
30
- - Use const for dom elements where possible.
31
- - Use strict equality `===` and inequality `!==`.
32
- - Use `//` for single-line comments and `/* */` for multi-line comments.
33
- - Use forEach, map, filter, reduce for array operations instead of for loops where appropriate.
34
- - Use arrow functions for anonymous functions and callbacks.
35
- - Use " for html attributes and ' for js strings, ` for template literals.
36
- - Use `new RegExp("pattern","flags")` (avoid literal `/.../flags`).
37
- - Use `fetch` for API calls, with async/await syntax.
38
- - Handle errors gracefully with try/catch and user-friendly messages.
39
- - Prefer string concatenation `"a"+variable+"b"` over template literals.
@@ -1,6 +0,0 @@
1
- {
2
- "chat.tools.terminal.autoApprove": {
3
- "Test-Path": true,
4
- "ForEach-Object": true
5
- }
6
- }