@ichicraft/widgets-widget-base 1.9.11 → 1.9.13

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/README.md CHANGED
@@ -9,6 +9,17 @@ All notable changes to this project will be documented here.
9
9
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10
10
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
+ ## 1.9.13 - 2024-06-18
13
+
14
+ - Added `spHttpClient` property to `WidgetContext` interface, to perform REST calls against SharePoint.
15
+ - Added `spHttpClientConfiguration` property to `WidgetContext` interface.
16
+
17
+ ## 1.9.12 - 2024-06-17
18
+
19
+ - Added `sp` property to `WidgetContext` interface, to allow using a centralized PnPjs version across all widgets.
20
+ - Added `siteId` property to `WidgetContext` interface.
21
+ - Added `boardsInstanceId` property to `WidgetContext` interface.
22
+
12
23
  ## 1.9.11 - 2024-06-14
13
24
 
14
25
  - Fixed handling of null `ICPersonaType` values in `isCurrentUserInScope` function of `UserHelper` class.
@@ -1,5 +1,6 @@
1
- import type { AadHttpClientFactory, AadTokenProviderFactory } from '@microsoft/sp-http';
2
- export type { AadTokenProviderFactory, AadTokenProvider, AadHttpClientFactory, AadHttpClient, AadHttpClientConfiguration, AadHttpClientResponse, } from '@microsoft/sp-http';
1
+ import type { AadHttpClientFactory, AadTokenProviderFactory, SPHttpClient, SPHttpClientConfiguration } from '@microsoft/sp-http';
2
+ import type { SPFI } from '@pnp/sp/fi';
3
+ export type { AadTokenProviderFactory, AadTokenProvider, AadHttpClientFactory, AadHttpClient, AadHttpClientConfiguration, AadHttpClientResponse, SPHttpClient, SPHttpClientConfiguration, } from '@microsoft/sp-http';
3
4
  /**
4
5
  * Widget context providing widget metadata and functionality offered by the widget board
5
6
  */
@@ -54,19 +55,27 @@ export interface WidgetContext {
54
55
  */
55
56
  isMobileWebView: boolean;
56
57
  /**
57
- * Tenant ID of current SharePoint tenant
58
+ * Tenant ID of current SharePoint tenant.
58
59
  */
59
60
  tenantId: string;
60
61
  /**
61
- * Site url of the site where the widget board is running
62
+ * ID of current Ichicraft Boards installation. Could either be a Site Collection ID (SP Shell) or a fixed ID (Teams Shell)
63
+ */
64
+ boardsInstanceId: string;
65
+ /**
66
+ * Site ID of the SharePoint site where the widget board is running
67
+ */
68
+ siteId: string;
69
+ /**
70
+ * Site url of the SharePoint site where the widget board is running
62
71
  */
63
72
  siteUrl: string;
64
73
  /**
65
- * User name of the currently signed in user.
74
+ * User name of the currently signed in user
66
75
  */
67
76
  userName: string;
68
77
  /**
69
- * The email address for the current user.
78
+ * The email address for the current user
70
79
  *
71
80
  * @remarks
72
81
  * Example: `"example@contoso.com"`
@@ -133,6 +142,18 @@ export interface WidgetContext {
133
142
  * Preferred border radius of UI elements as configured in Widget Board configuration
134
143
  */
135
144
  elementBorderRadius: number;
145
+ /**
146
+ * Interacts with the SharePoint REST api, such as fetching/updating sites, lists and users.
147
+ */
148
+ sp: SPFI;
149
+ /**
150
+ * Used to perform REST calls against SharePoint.
151
+ */
152
+ spHttpClient: SPHttpClient;
153
+ /**
154
+ * Provides a set of switches for enabling/disabling various features of the SPHttpClient.
155
+ */
156
+ spHttpClientConfiguration: SPHttpClientConfiguration;
136
157
  /**
137
158
  * MS Graph Client Factory class as provided by the WebPartContext object.
138
159
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.9.11",
3
+ "version": "1.9.13",
4
4
  "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -19,7 +19,8 @@
19
19
  "lib/**/*"
20
20
  ],
21
21
  "dependencies": {
22
- "@microsoft/sp-http": "1.18.2"
22
+ "@microsoft/sp-http": "1.18.2",
23
+ "@pnp/sp": "4.0.1"
23
24
  },
24
25
  "devDependencies": {
25
26
  "typescript": "^5.4.5"