@kwiz/common 1.0.199 → 1.0.201

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 (39) hide show
  1. package/lib/cjs/helpers/promises.js +5 -0
  2. package/lib/cjs/helpers/promises.js.map +1 -1
  3. package/lib/cjs/helpers/sharepoint.js +8 -0
  4. package/lib/cjs/helpers/sharepoint.js.map +1 -1
  5. package/lib/cjs/types/exports-index.js +1 -0
  6. package/lib/cjs/types/exports-index.js.map +1 -1
  7. package/lib/cjs/types/sharepoint.utils.types.js.map +1 -1
  8. package/lib/cjs/types/webpart.types.js +16 -0
  9. package/lib/cjs/types/webpart.types.js.map +1 -0
  10. package/lib/cjs/utils/sharepoint.rest/exports-index.js +1 -0
  11. package/lib/cjs/utils/sharepoint.rest/exports-index.js.map +1 -1
  12. package/lib/cjs/utils/sharepoint.rest/list.js +1 -1
  13. package/lib/cjs/utils/sharepoint.rest/list.js.map +1 -1
  14. package/lib/cjs/utils/sharepoint.rest/webparts.js +89 -0
  15. package/lib/cjs/utils/sharepoint.rest/webparts.js.map +1 -0
  16. package/lib/esm/helpers/promises.js +4 -0
  17. package/lib/esm/helpers/promises.js.map +1 -1
  18. package/lib/esm/helpers/sharepoint.js +8 -0
  19. package/lib/esm/helpers/sharepoint.js.map +1 -1
  20. package/lib/esm/types/exports-index.js +1 -0
  21. package/lib/esm/types/exports-index.js.map +1 -1
  22. package/lib/esm/types/sharepoint.utils.types.js.map +1 -1
  23. package/lib/esm/types/webpart.types.js +13 -0
  24. package/lib/esm/types/webpart.types.js.map +1 -0
  25. package/lib/esm/utils/sharepoint.rest/exports-index.js +1 -0
  26. package/lib/esm/utils/sharepoint.rest/exports-index.js.map +1 -1
  27. package/lib/esm/utils/sharepoint.rest/list.js +1 -1
  28. package/lib/esm/utils/sharepoint.rest/list.js.map +1 -1
  29. package/lib/esm/utils/sharepoint.rest/webparts.js +83 -0
  30. package/lib/esm/utils/sharepoint.rest/webparts.js.map +1 -0
  31. package/lib/types/helpers/promises.d.ts +1 -0
  32. package/lib/types/helpers/sharepoint.d.ts +2 -1
  33. package/lib/types/types/common.types.d.ts +3 -0
  34. package/lib/types/types/exports-index.d.ts +1 -0
  35. package/lib/types/types/sharepoint.utils.types.d.ts +1 -0
  36. package/lib/types/types/webpart.types.d.ts +25 -0
  37. package/lib/types/utils/sharepoint.rest/exports-index.d.ts +1 -0
  38. package/lib/types/utils/sharepoint.rest/webparts.d.ts +5 -0
  39. package/package.json +1 -1
@@ -32,3 +32,6 @@ export type apiResultType<T> = {
32
32
  success: true;
33
33
  value: T;
34
34
  };
35
+ export type DeepPartial<T> = {
36
+ [P in keyof T]?: DeepPartial<T[P]>;
37
+ };
@@ -13,3 +13,4 @@ export * from './regex.types';
13
13
  export * from './rest.types';
14
14
  export * from './sharepoint.types';
15
15
  export * from './sharepoint.utils.types';
16
+ export * from './webpart.types';
@@ -112,6 +112,7 @@ export interface iListView {
112
112
  DefaultView: boolean;
113
113
  ReadOnlyView: boolean;
114
114
  ViewFields?: string[];
115
+ CustomFormatter?: string;
115
116
  }
116
117
  export interface IListWorkflowAssociation {
117
118
  AllowManual: boolean;
@@ -0,0 +1,25 @@
1
+ import { IDictionary } from "./common.types";
2
+ export interface IWebPartDefinition {
3
+ Id: string;
4
+ ZoneId: string;
5
+ WebPart: IWebPart;
6
+ }
7
+ export interface IWebPart {
8
+ ExportMode: WebPartExportMode;
9
+ Hidden: boolean;
10
+ IsClosed: boolean;
11
+ Properties: IDictionary<string | number | boolean>;
12
+ Subtitle: string;
13
+ Title: string;
14
+ TitleUrl: string;
15
+ ZoneIndex: number;
16
+ }
17
+ export declare enum WebPartExportMode {
18
+ None = 0,
19
+ All = 1,
20
+ NonSensitiveData = 2
21
+ }
22
+ export declare enum WebPartMethods {
23
+ DeleteWebPart = "deletewebpart",
24
+ SaveWebPartChanges = "savewebpartchanges"
25
+ }
@@ -10,3 +10,4 @@ export * from './sp-people-search-service';
10
10
  export * from './timzone-map';
11
11
  export * from './user';
12
12
  export * from './web';
13
+ export * from './webparts';
@@ -0,0 +1,5 @@
1
+ import { IWebPartDefinition } from "../../types/webpart.types";
2
+ export declare function DeleteWebPart(siteUrl: string, fileServerRelativeUrl: string, webPartId: string): Promise<boolean>;
3
+ export declare function HideWebPart(siteUrl: string, fileServerRelativeUrl: string, webPartId: string, hidden: boolean): Promise<boolean>;
4
+ export declare function GetWebParts(siteUrl: string, fileServerRelativeUrl: string): Promise<IWebPartDefinition[]>;
5
+ export declare function GetWebPartById(siteUrl: string, fileServerRelativeUrl: string, webPartId: string): Promise<IWebPartDefinition>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwiz/common",
3
- "version": "1.0.199",
3
+ "version": "1.0.201",
4
4
  "description": "KWIZ common utilities and helpers for M365 platform",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",