@pnp/graph 2.7.0 → 2.11.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 (165) hide show
  1. package/LICENSE +25 -25
  2. package/attachments/conversations.d.ts +9 -9
  3. package/attachments/conversations.js +4 -4
  4. package/attachments/index.d.ts +2 -2
  5. package/attachments/index.js +2 -2
  6. package/attachments/types.d.ts +26 -26
  7. package/attachments/types.js +46 -46
  8. package/batch.d.ts +17 -17
  9. package/batch.js +176 -176
  10. package/calendars/funcs.d.ts +36 -24
  11. package/calendars/funcs.d.ts.map +1 -1
  12. package/calendars/funcs.js +43 -29
  13. package/calendars/funcs.js.map +1 -1
  14. package/calendars/groups.d.ts +13 -13
  15. package/calendars/groups.js +5 -5
  16. package/calendars/index.d.ts +4 -4
  17. package/calendars/index.js +3 -3
  18. package/calendars/types.d.ts +52 -51
  19. package/calendars/types.d.ts.map +1 -1
  20. package/calendars/types.js +98 -96
  21. package/calendars/types.js.map +1 -1
  22. package/calendars/users.d.ts +22 -22
  23. package/calendars/users.js +9 -9
  24. package/cloud-communications/index.d.ts +8 -8
  25. package/cloud-communications/index.js +14 -14
  26. package/cloud-communications/types.d.ts +21 -21
  27. package/cloud-communications/types.js +46 -46
  28. package/cloud-communications/users.d.ts +9 -9
  29. package/cloud-communications/users.js +4 -4
  30. package/contacts/index.d.ts +2 -2
  31. package/contacts/index.js +2 -2
  32. package/contacts/types.d.ts +75 -75
  33. package/contacts/types.js +145 -145
  34. package/contacts/users.d.ts +11 -11
  35. package/contacts/users.js +5 -5
  36. package/conversations/groups.d.ts +13 -13
  37. package/conversations/groups.js +6 -6
  38. package/conversations/index.d.ts +2 -2
  39. package/conversations/index.js +2 -2
  40. package/conversations/types.d.ts +103 -103
  41. package/conversations/types.js +173 -173
  42. package/decorators.d.ts +103 -103
  43. package/decorators.js +138 -138
  44. package/directory-objects/index.d.ts +7 -7
  45. package/directory-objects/index.js +13 -13
  46. package/directory-objects/types.d.ts +67 -67
  47. package/directory-objects/types.js +96 -96
  48. package/graphhttpclient.d.ts +13 -13
  49. package/graphhttpclient.js +95 -95
  50. package/graphlibconfig.d.ts +21 -21
  51. package/graphlibconfig.js +19 -19
  52. package/graphqueryable.d.ts +156 -156
  53. package/graphqueryable.d.ts.map +1 -1
  54. package/graphqueryable.js +247 -237
  55. package/graphqueryable.js.map +1 -1
  56. package/groups/index.d.ts +7 -7
  57. package/groups/index.js +13 -13
  58. package/groups/types.d.ts +81 -81
  59. package/groups/types.d.ts.map +1 -1
  60. package/groups/types.js +137 -137
  61. package/groups/types.js.map +1 -1
  62. package/index.d.ts +8 -8
  63. package/index.js +7 -7
  64. package/insights/index.d.ts +2 -2
  65. package/insights/index.js +2 -2
  66. package/insights/types.d.ts +76 -76
  67. package/insights/types.js +162 -162
  68. package/insights/users.d.ts +9 -9
  69. package/insights/users.js +4 -4
  70. package/invitations/index.d.ts +7 -7
  71. package/invitations/index.js +13 -13
  72. package/invitations/types.d.ts +25 -25
  73. package/invitations/types.js +44 -44
  74. package/members/groups.d.ts +11 -11
  75. package/members/groups.js +5 -5
  76. package/members/index.d.ts +2 -2
  77. package/members/index.js +2 -2
  78. package/members/types.d.ts +31 -31
  79. package/members/types.js +49 -49
  80. package/messages/index.d.ts +2 -2
  81. package/messages/index.js +2 -2
  82. package/messages/types.d.ts +43 -43
  83. package/messages/types.d.ts.map +1 -1
  84. package/messages/types.js +77 -77
  85. package/messages/types.js.map +1 -1
  86. package/messages/users.d.ts +15 -15
  87. package/messages/users.js +10 -10
  88. package/onedrive/index.d.ts +2 -2
  89. package/onedrive/index.js +2 -2
  90. package/onedrive/types.d.ts +95 -87
  91. package/onedrive/types.d.ts.map +1 -1
  92. package/onedrive/types.js +241 -192
  93. package/onedrive/types.js.map +1 -1
  94. package/onedrive/users.d.ts +11 -11
  95. package/onedrive/users.js +5 -5
  96. package/onenote/index.d.ts +2 -2
  97. package/onenote/index.js +2 -2
  98. package/onenote/types.d.ts +76 -76
  99. package/onenote/types.js +149 -149
  100. package/onenote/users.d.ts +9 -9
  101. package/onenote/users.js +4 -4
  102. package/operations.d.ts +8 -8
  103. package/operations.js +41 -41
  104. package/outlook/index.d.ts +2 -2
  105. package/outlook/index.js +2 -2
  106. package/outlook/types.d.ts +40 -40
  107. package/outlook/types.js +76 -76
  108. package/outlook/users.d.ts +9 -9
  109. package/outlook/users.js +4 -4
  110. package/package.json +5 -5
  111. package/photos/groups.d.ts +9 -9
  112. package/photos/groups.js +4 -4
  113. package/photos/index.d.ts +3 -3
  114. package/photos/index.js +3 -3
  115. package/photos/types.d.ts +21 -21
  116. package/photos/types.js +37 -37
  117. package/photos/users.d.ts +9 -9
  118. package/photos/users.js +4 -4
  119. package/planner/groups.d.ts +9 -9
  120. package/planner/groups.js +4 -4
  121. package/planner/index.d.ts +9 -9
  122. package/planner/index.js +15 -15
  123. package/planner/types.d.ts +117 -117
  124. package/planner/types.js +291 -291
  125. package/planner/users.d.ts +9 -9
  126. package/planner/users.js +4 -4
  127. package/presets/all.d.ts +38 -38
  128. package/presets/all.js +38 -38
  129. package/readme.md +21 -21
  130. package/rest.d.ts +30 -30
  131. package/rest.js +57 -57
  132. package/search/index.d.ts +7 -7
  133. package/search/index.js +18 -18
  134. package/search/types.d.ts +16 -16
  135. package/search/types.js +23 -23
  136. package/sites/group.d.ts +9 -9
  137. package/sites/group.js +4 -4
  138. package/sites/index.d.ts +2 -2
  139. package/sites/index.js +2 -2
  140. package/sites/types.d.ts +23 -23
  141. package/sites/types.js +47 -47
  142. package/subscriptions/index.d.ts +7 -7
  143. package/subscriptions/index.js +13 -13
  144. package/subscriptions/types.d.ts +37 -37
  145. package/subscriptions/types.js +72 -72
  146. package/teams/index.d.ts +19 -19
  147. package/teams/index.js +35 -35
  148. package/teams/types.d.ts +112 -111
  149. package/teams/types.d.ts.map +1 -1
  150. package/teams/types.js +261 -254
  151. package/teams/types.js.map +1 -1
  152. package/teams/users.d.ts +9 -9
  153. package/teams/users.js +4 -4
  154. package/types.d.ts +9 -9
  155. package/types.js +19 -19
  156. package/users/index.d.ts +8 -8
  157. package/users/index.js +23 -23
  158. package/users/types.d.ts +35 -35
  159. package/users/types.d.ts.map +1 -1
  160. package/users/types.js +82 -82
  161. package/users/types.js.map +1 -1
  162. package/utils/toabsoluteurl.d.ts +7 -7
  163. package/utils/toabsoluteurl.js +48 -48
  164. package/utils/type.d.ts +3 -3
  165. package/utils/type.js +3 -3
package/groups/types.d.ts CHANGED
@@ -1,82 +1,82 @@
1
- import { ITypedHash } from "@pnp/common";
2
- import { Event as IEventType, Group as IGroupType } from "@microsoft/microsoft-graph-types";
3
- import { _GraphQueryableCollection } from "../graphqueryable.js";
4
- import { IDeleteable, IUpdateable, IGetById } from "../decorators.js";
5
- import { _DirectoryObject } from "../directory-objects/types.js";
6
- export declare enum GroupType {
7
- /**
8
- * Office 365 (aka unified group)
9
- */
10
- Office365 = 0,
11
- /**
12
- * Dynamic membership
13
- */
14
- Dynamic = 1,
15
- /**
16
- * Security
17
- */
18
- Security = 2
19
- }
20
- /**
21
- * Represents a group entity
22
- */
23
- export declare class _Group extends _DirectoryObject<IGroupType> {
24
- /**
25
- * Add the group to the list of the current user's favorite groups. Supported for only Office 365 groups
26
- */
27
- addFavorite(): Promise<void>;
28
- /**
29
- * Remove the group from the list of the current user's favorite groups. Supported for only Office 365 groups
30
- */
31
- removeFavorite(): Promise<void>;
32
- /**
33
- * Reset the unseenCount of all the posts that the current user has not seen since their last visit
34
- */
35
- resetUnseenCount(): Promise<void>;
36
- /**
37
- * Calling this method will enable the current user to receive email notifications for this group,
38
- * about new posts, events, and files in that group. Supported for only Office 365 groups
39
- */
40
- subscribeByMail(): Promise<void>;
41
- /**
42
- * Calling this method will prevent the current user from receiving email notifications for this group
43
- * about new posts, events, and files in that group. Supported for only Office 365 groups
44
- */
45
- unsubscribeByMail(): Promise<void>;
46
- /**
47
- * Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range, from the default calendar of a group
48
- *
49
- * @param start Start date and time of the time range
50
- * @param end End date and time of the time range
51
- */
52
- getCalendarView(start: Date, end: Date): Promise<IEventType[]>;
53
- }
54
- export interface IGroup extends _Group, IDeleteable, IUpdateable {
55
- }
56
- export declare const Group: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IGroup & import("@pnp/odata").IInvokable<any>;
57
- /**
58
- * Describes a collection of Field objects
59
- *
60
- */
61
- export declare class _Groups extends _GraphQueryableCollection<IGroupType[]> {
62
- /**
63
- * Create a new group as specified in the request body.
64
- *
65
- * @param name Name to display in the address book for the group
66
- * @param mailNickname Mail alias for the group
67
- * @param groupType Type of group being created
68
- * @param additionalProperties A plain object collection of additional properties you want to set on the new group
69
- */
70
- add(name: string, mailNickname: string, groupType: GroupType, additionalProperties?: ITypedHash<any>): Promise<IGroupAddResult>;
71
- }
72
- export interface IGroups extends _Groups, IGetById<IGroup> {
73
- }
74
- export declare const Groups: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IGroups & import("@pnp/odata").IInvokable<any>;
75
- /**
76
- * IGroupAddResult
77
- */
78
- export interface IGroupAddResult {
79
- group: IGroup;
80
- data: any;
81
- }
1
+ import { ITypedHash } from "@pnp/common";
2
+ import { Event as IEventType, Group as IGroupType } from "@microsoft/microsoft-graph-types";
3
+ import { _GraphQueryableSearchableCollection } from "../graphqueryable.js";
4
+ import { IDeleteable, IUpdateable, IGetById } from "../decorators.js";
5
+ import { _DirectoryObject } from "../directory-objects/types.js";
6
+ export declare enum GroupType {
7
+ /**
8
+ * Office 365 (aka unified group)
9
+ */
10
+ Office365 = 0,
11
+ /**
12
+ * Dynamic membership
13
+ */
14
+ Dynamic = 1,
15
+ /**
16
+ * Security
17
+ */
18
+ Security = 2
19
+ }
20
+ /**
21
+ * Represents a group entity
22
+ */
23
+ export declare class _Group extends _DirectoryObject<IGroupType> {
24
+ /**
25
+ * Add the group to the list of the current user's favorite groups. Supported for only Office 365 groups
26
+ */
27
+ addFavorite(): Promise<void>;
28
+ /**
29
+ * Remove the group from the list of the current user's favorite groups. Supported for only Office 365 groups
30
+ */
31
+ removeFavorite(): Promise<void>;
32
+ /**
33
+ * Reset the unseenCount of all the posts that the current user has not seen since their last visit
34
+ */
35
+ resetUnseenCount(): Promise<void>;
36
+ /**
37
+ * Calling this method will enable the current user to receive email notifications for this group,
38
+ * about new posts, events, and files in that group. Supported for only Office 365 groups
39
+ */
40
+ subscribeByMail(): Promise<void>;
41
+ /**
42
+ * Calling this method will prevent the current user from receiving email notifications for this group
43
+ * about new posts, events, and files in that group. Supported for only Office 365 groups
44
+ */
45
+ unsubscribeByMail(): Promise<void>;
46
+ /**
47
+ * Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range, from the default calendar of a group
48
+ *
49
+ * @param start Start date and time of the time range
50
+ * @param end End date and time of the time range
51
+ */
52
+ getCalendarView(start: Date, end: Date): Promise<IEventType[]>;
53
+ }
54
+ export interface IGroup extends _Group, IDeleteable, IUpdateable {
55
+ }
56
+ export declare const Group: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IGroup & import("@pnp/odata").IInvokable<any>;
57
+ /**
58
+ * Describes a collection of Field objects
59
+ *
60
+ */
61
+ export declare class _Groups extends _GraphQueryableSearchableCollection<IGroupType[]> {
62
+ /**
63
+ * Create a new group as specified in the request body.
64
+ *
65
+ * @param name Name to display in the address book for the group
66
+ * @param mailNickname Mail alias for the group
67
+ * @param groupType Type of group being created
68
+ * @param additionalProperties A plain object collection of additional properties you want to set on the new group
69
+ */
70
+ add(name: string, mailNickname: string, groupType: GroupType, additionalProperties?: ITypedHash<any>): Promise<IGroupAddResult>;
71
+ }
72
+ export interface IGroups extends _Groups, IGetById<IGroup> {
73
+ }
74
+ export declare const Groups: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IGroups & import("@pnp/odata").IInvokable<any>;
75
+ /**
76
+ * IGroupAddResult
77
+ */
78
+ export interface IGroupAddResult {
79
+ group: IGroup;
80
+ data: any;
81
+ }
82
82
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../packages/graph/groups/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE5F,OAAO,EAAE,yBAAyB,EAAyB,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAA2B,WAAW,EAAc,WAAW,EAAW,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,oBAAY,SAAS;IACjB;;OAEG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,OAAO,IAAA;IACP;;OAEG;IACH,QAAQ,IAAA;CACX;AAED;;GAEG;AACH,qBAEa,MAAO,SAAQ,gBAAgB,CAAC,UAAU,CAAC;IACpD;;OAEG;IACI,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAGnC;;OAEG;IACI,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAGtC;;OAEG;IACI,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAGxC;;;OAGG;IACI,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAGvC;;;OAGG;IACI,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAGzC;;;;;OAKG;IACI,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAOxE;AACD,MAAM,WAAW,MAAO,SAAQ,MAAM,EAAE,WAAW,EAAE,WAAW;CAAI;AACpE,eAAO,MAAM,KAAK,yIAAwC,CAAC;AAE3D;;;GAGG;AACH,qBAEa,OAAQ,SAAQ,yBAAyB,CAAC,UAAU,EAAE,CAAC;IAEh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IAAI,OAAO,CAAC,IAAI,CAAC;IAGzC;;;;;OAKG;IACI,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAOxE;AACD,MAAM,WAAW,MAAO,SAAQ,MAAM,EAAE,WAAW,EAAE,WAAW;CAAI;AACpE,eAAO,MAAM,KAAK,yIAAwC,CAAC;AAE3D;;;GAGG;AACH,qBAEa,OAAQ,SAAQ,mCAAmC,CAAC,UAAU,EAAE,CAAC;IAE1E;;;;;;;OAOG;IACU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,oBAAoB,GAAE,UAAU,CAAC,GAAG,CAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAwBnJ;AACD,MAAM,WAAW,OAAQ,SAAQ,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC;CAAI;AAC9D,eAAO,MAAM,MAAM,0IAA0C,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;CACb"}
package/groups/types.js CHANGED
@@ -1,138 +1,138 @@
1
- import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
- import { assign } from "@pnp/common";
3
- import { body } from "@pnp/odata";
4
- import { _GraphQueryableCollection, graphInvokableFactory } from "../graphqueryable.js";
5
- import { defaultPath, deleteable, updateable, getById } from "../decorators.js";
6
- import { graphPost } from "../operations.js";
7
- import { _DirectoryObject } from "../directory-objects/types.js";
8
- export var GroupType;
9
- (function (GroupType) {
10
- /**
11
- * Office 365 (aka unified group)
12
- */
13
- GroupType[GroupType["Office365"] = 0] = "Office365";
14
- /**
15
- * Dynamic membership
16
- */
17
- GroupType[GroupType["Dynamic"] = 1] = "Dynamic";
18
- /**
19
- * Security
20
- */
21
- GroupType[GroupType["Security"] = 2] = "Security";
22
- })(GroupType || (GroupType = {}));
23
- /**
24
- * Represents a group entity
25
- */
26
- var _Group = /** @class */ (function (_super) {
27
- __extends(_Group, _super);
28
- function _Group() {
29
- return _super !== null && _super.apply(this, arguments) || this;
30
- }
31
- /**
32
- * Add the group to the list of the current user's favorite groups. Supported for only Office 365 groups
33
- */
34
- _Group.prototype.addFavorite = function () {
35
- return graphPost(this.clone(Group, "addFavorite"));
36
- };
37
- /**
38
- * Remove the group from the list of the current user's favorite groups. Supported for only Office 365 groups
39
- */
40
- _Group.prototype.removeFavorite = function () {
41
- return graphPost(this.clone(Group, "removeFavorite"));
42
- };
43
- /**
44
- * Reset the unseenCount of all the posts that the current user has not seen since their last visit
45
- */
46
- _Group.prototype.resetUnseenCount = function () {
47
- return graphPost(this.clone(Group, "resetUnseenCount"));
48
- };
49
- /**
50
- * Calling this method will enable the current user to receive email notifications for this group,
51
- * about new posts, events, and files in that group. Supported for only Office 365 groups
52
- */
53
- _Group.prototype.subscribeByMail = function () {
54
- return graphPost(this.clone(Group, "subscribeByMail"));
55
- };
56
- /**
57
- * Calling this method will prevent the current user from receiving email notifications for this group
58
- * about new posts, events, and files in that group. Supported for only Office 365 groups
59
- */
60
- _Group.prototype.unsubscribeByMail = function () {
61
- return graphPost(this.clone(Group, "unsubscribeByMail"));
62
- };
63
- /**
64
- * Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range, from the default calendar of a group
65
- *
66
- * @param start Start date and time of the time range
67
- * @param end End date and time of the time range
68
- */
69
- _Group.prototype.getCalendarView = function (start, end) {
70
- var view = this.clone(Group, "calendarView");
71
- view.query.set("startDateTime", start.toISOString());
72
- view.query.set("endDateTime", end.toISOString());
73
- return view();
74
- };
75
- _Group = __decorate([
76
- deleteable(),
77
- updateable()
78
- ], _Group);
79
- return _Group;
80
- }(_DirectoryObject));
81
- export { _Group };
82
- export var Group = graphInvokableFactory(_Group);
83
- /**
84
- * Describes a collection of Field objects
85
- *
86
- */
87
- var _Groups = /** @class */ (function (_super) {
88
- __extends(_Groups, _super);
89
- function _Groups() {
90
- return _super !== null && _super.apply(this, arguments) || this;
91
- }
92
- /**
93
- * Create a new group as specified in the request body.
94
- *
95
- * @param name Name to display in the address book for the group
96
- * @param mailNickname Mail alias for the group
97
- * @param groupType Type of group being created
98
- * @param additionalProperties A plain object collection of additional properties you want to set on the new group
99
- */
100
- _Groups.prototype.add = function (name, mailNickname, groupType, additionalProperties) {
101
- if (additionalProperties === void 0) { additionalProperties = {}; }
102
- return __awaiter(this, void 0, void 0, function () {
103
- var postBody, data;
104
- return __generator(this, function (_a) {
105
- switch (_a.label) {
106
- case 0:
107
- postBody = assign({
108
- displayName: name,
109
- mailEnabled: groupType === GroupType.Office365,
110
- mailNickname: mailNickname,
111
- securityEnabled: groupType !== GroupType.Office365,
112
- }, additionalProperties);
113
- // include a group type if required
114
- if (groupType !== GroupType.Security) {
115
- postBody = assign(postBody, {
116
- groupTypes: groupType === GroupType.Office365 ? ["Unified"] : ["DynamicMembership"],
117
- });
118
- }
119
- return [4 /*yield*/, graphPost(this, body(postBody))];
120
- case 1:
121
- data = _a.sent();
122
- return [2 /*return*/, {
123
- data: data,
124
- group: this.getById(data.id),
125
- }];
126
- }
127
- });
128
- });
129
- };
130
- _Groups = __decorate([
131
- defaultPath("groups"),
132
- getById(Group)
133
- ], _Groups);
134
- return _Groups;
135
- }(_GraphQueryableCollection));
136
- export { _Groups };
137
- export var Groups = graphInvokableFactory(_Groups);
1
+ import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
+ import { assign } from "@pnp/common";
3
+ import { body } from "@pnp/odata";
4
+ import { _GraphQueryableSearchableCollection, graphInvokableFactory } from "../graphqueryable.js";
5
+ import { defaultPath, deleteable, updateable, getById } from "../decorators.js";
6
+ import { graphPost } from "../operations.js";
7
+ import { _DirectoryObject } from "../directory-objects/types.js";
8
+ export var GroupType;
9
+ (function (GroupType) {
10
+ /**
11
+ * Office 365 (aka unified group)
12
+ */
13
+ GroupType[GroupType["Office365"] = 0] = "Office365";
14
+ /**
15
+ * Dynamic membership
16
+ */
17
+ GroupType[GroupType["Dynamic"] = 1] = "Dynamic";
18
+ /**
19
+ * Security
20
+ */
21
+ GroupType[GroupType["Security"] = 2] = "Security";
22
+ })(GroupType || (GroupType = {}));
23
+ /**
24
+ * Represents a group entity
25
+ */
26
+ var _Group = /** @class */ (function (_super) {
27
+ __extends(_Group, _super);
28
+ function _Group() {
29
+ return _super !== null && _super.apply(this, arguments) || this;
30
+ }
31
+ /**
32
+ * Add the group to the list of the current user's favorite groups. Supported for only Office 365 groups
33
+ */
34
+ _Group.prototype.addFavorite = function () {
35
+ return graphPost(this.clone(Group, "addFavorite"));
36
+ };
37
+ /**
38
+ * Remove the group from the list of the current user's favorite groups. Supported for only Office 365 groups
39
+ */
40
+ _Group.prototype.removeFavorite = function () {
41
+ return graphPost(this.clone(Group, "removeFavorite"));
42
+ };
43
+ /**
44
+ * Reset the unseenCount of all the posts that the current user has not seen since their last visit
45
+ */
46
+ _Group.prototype.resetUnseenCount = function () {
47
+ return graphPost(this.clone(Group, "resetUnseenCount"));
48
+ };
49
+ /**
50
+ * Calling this method will enable the current user to receive email notifications for this group,
51
+ * about new posts, events, and files in that group. Supported for only Office 365 groups
52
+ */
53
+ _Group.prototype.subscribeByMail = function () {
54
+ return graphPost(this.clone(Group, "subscribeByMail"));
55
+ };
56
+ /**
57
+ * Calling this method will prevent the current user from receiving email notifications for this group
58
+ * about new posts, events, and files in that group. Supported for only Office 365 groups
59
+ */
60
+ _Group.prototype.unsubscribeByMail = function () {
61
+ return graphPost(this.clone(Group, "unsubscribeByMail"));
62
+ };
63
+ /**
64
+ * Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range, from the default calendar of a group
65
+ *
66
+ * @param start Start date and time of the time range
67
+ * @param end End date and time of the time range
68
+ */
69
+ _Group.prototype.getCalendarView = function (start, end) {
70
+ var view = this.clone(Group, "calendarView");
71
+ view.query.set("startDateTime", start.toISOString());
72
+ view.query.set("endDateTime", end.toISOString());
73
+ return view();
74
+ };
75
+ _Group = __decorate([
76
+ deleteable(),
77
+ updateable()
78
+ ], _Group);
79
+ return _Group;
80
+ }(_DirectoryObject));
81
+ export { _Group };
82
+ export var Group = graphInvokableFactory(_Group);
83
+ /**
84
+ * Describes a collection of Field objects
85
+ *
86
+ */
87
+ var _Groups = /** @class */ (function (_super) {
88
+ __extends(_Groups, _super);
89
+ function _Groups() {
90
+ return _super !== null && _super.apply(this, arguments) || this;
91
+ }
92
+ /**
93
+ * Create a new group as specified in the request body.
94
+ *
95
+ * @param name Name to display in the address book for the group
96
+ * @param mailNickname Mail alias for the group
97
+ * @param groupType Type of group being created
98
+ * @param additionalProperties A plain object collection of additional properties you want to set on the new group
99
+ */
100
+ _Groups.prototype.add = function (name, mailNickname, groupType, additionalProperties) {
101
+ if (additionalProperties === void 0) { additionalProperties = {}; }
102
+ return __awaiter(this, void 0, void 0, function () {
103
+ var postBody, data;
104
+ return __generator(this, function (_a) {
105
+ switch (_a.label) {
106
+ case 0:
107
+ postBody = assign({
108
+ displayName: name,
109
+ mailEnabled: groupType === GroupType.Office365,
110
+ mailNickname: mailNickname,
111
+ securityEnabled: groupType !== GroupType.Office365,
112
+ }, additionalProperties);
113
+ // include a group type if required
114
+ if (groupType !== GroupType.Security) {
115
+ postBody = assign(postBody, {
116
+ groupTypes: groupType === GroupType.Office365 ? ["Unified"] : ["DynamicMembership"],
117
+ });
118
+ }
119
+ return [4 /*yield*/, graphPost(this, body(postBody))];
120
+ case 1:
121
+ data = _a.sent();
122
+ return [2 /*return*/, {
123
+ data: data,
124
+ group: this.getById(data.id),
125
+ }];
126
+ }
127
+ });
128
+ });
129
+ };
130
+ _Groups = __decorate([
131
+ defaultPath("groups"),
132
+ getById(Group)
133
+ ], _Groups);
134
+ return _Groups;
135
+ }(_GraphQueryableSearchableCollection));
136
+ export { _Groups };
137
+ export var Groups = graphInvokableFactory(_Groups);
138
138
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sour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;IAkCA,CAAC;IAhCG;;;;;;;OAOG;IACU,qBAAG,GAAhB,UAAiB,IAAY,EAAE,YAAoB,EAAE,SAAoB,EAAE,oBAA0C;QAA1C,qCAAA,EAAA,yBAA0C;;;;;;wBAE7G,QAAQ,GAAG,MAAM,CAAC;4BAClB,WAAW,EAAE,IAAI;4BACjB,WAAW,EAAE,SAAS,KAAK,SAAS,CAAC,SAAS;4BAC9C,YAAY,EAAE,YAAY;4BAC1B,eAAe,EAAE,SAAS,KAAK,SAAS,CAAC,SAAS;yBACrD,EAAE,oBAAoB,CAAC,CAAC;wBAEzB,mCAAmC;wBACnC,IAAI,SAAS,KAAK,SAAS,CAAC,QAAQ,EAAE;4BAElC,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE;gCACxB,UAAU,EAAE,SAAS,KAAK,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC;6BACtF,CAAC,CAAC;yBACN;wBAEY,qBAAM,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAA;;wBAA5C,IAAI,GAAG,SAAqC;wBAElD,sBAAO;gCACH,IAAI,MAAA;gCACJ,KAAK,EAAQ,IAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;6BACtC,EAAC;;;;KACL;IAjCQ,OAAO;QAFnB,WAAW,CAAC,QAAQ,CAAC;QACrB,OAAO,CAAC,KAAK,CAAC;OACF,OAAO,CAkCnB;IAAD,cAAC;CAAA,AAlCD,CAA6B,mCAAmC,GAkC/D;SAlCY,OAAO;AAoCpB,MAAM,CAAC,IAAM,MAAM,GAAG,qBAAqB,CAAU,OAAO,CAAC,CAAC"}
package/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { graph, GraphRest } from "./rest.js";
2
- export { GraphBatch, } from "./batch.js";
3
- export { IGraphQueryableCollection, IGraphQueryableInstance, IGraphQueryableSearchableCollection, GraphQueryable, IGraphQueryable, GraphQueryableCollection, GraphQueryableInstance, IGraphQueryableConstructor, GraphQueryableSearchableCollection, } from "./graphqueryable.js";
4
- export { IGraphConfiguration, IGraphConfigurationPart, } from "./graphlibconfig";
5
- export * from "./graphhttpclient.js";
6
- export * from "./types.js";
7
- export * from "./operations.js";
8
- export { toAbsoluteUrl, } from "./utils/toabsoluteurl.js";
1
+ export { graph, GraphRest } from "./rest.js";
2
+ export { GraphBatch, } from "./batch.js";
3
+ export { IGraphQueryableCollection, IGraphQueryableInstance, IGraphQueryableSearchableCollection, GraphQueryable, IGraphQueryable, GraphQueryableCollection, GraphQueryableInstance, IGraphQueryableConstructor, GraphQueryableSearchableCollection, } from "./graphqueryable.js";
4
+ export { IGraphConfiguration, IGraphConfigurationPart, } from "./graphlibconfig";
5
+ export * from "./graphhttpclient.js";
6
+ export * from "./types.js";
7
+ export * from "./operations.js";
8
+ export { toAbsoluteUrl, } from "./utils/toabsoluteurl.js";
9
9
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { graph, GraphRest } from "./rest.js";
2
- export { GraphBatch, } from "./batch.js";
3
- export { GraphQueryable, GraphQueryableCollection, GraphQueryableInstance, GraphQueryableSearchableCollection, } from "./graphqueryable.js";
4
- export * from "./graphhttpclient.js";
5
- export * from "./types.js";
6
- export * from "./operations.js";
7
- export { toAbsoluteUrl, } from "./utils/toabsoluteurl.js";
1
+ export { graph, GraphRest } from "./rest.js";
2
+ export { GraphBatch, } from "./batch.js";
3
+ export { GraphQueryable, GraphQueryableCollection, GraphQueryableInstance, GraphQueryableSearchableCollection, } from "./graphqueryable.js";
4
+ export * from "./graphhttpclient.js";
5
+ export * from "./types.js";
6
+ export * from "./operations.js";
7
+ export { toAbsoluteUrl, } from "./utils/toabsoluteurl.js";
8
8
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- import "./users.js";
2
- export { IInsights, ISharedInsight, ISharedInsights, ITrendingInsight, ITrendingInsights, IUsedInsight, IUsedInsights, Insights, SharedInsight, SharedInsights, TrendingInsight, TrendingInsights, UsedInsight, UsedInsights, IResource, Resource, } from "./types.js";
1
+ import "./users.js";
2
+ export { IInsights, ISharedInsight, ISharedInsights, ITrendingInsight, ITrendingInsights, IUsedInsight, IUsedInsights, Insights, SharedInsight, SharedInsights, TrendingInsight, TrendingInsights, UsedInsight, UsedInsights, IResource, Resource, } from "./types.js";
3
3
  //# sourceMappingURL=index.d.ts.map
package/insights/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./users.js";
2
- export { Insights, SharedInsight, SharedInsights, TrendingInsight, TrendingInsights, UsedInsight, UsedInsights, Resource, } from "./types.js";
1
+ import "./users.js";
2
+ export { Insights, SharedInsight, SharedInsights, TrendingInsight, TrendingInsights, UsedInsight, UsedInsights, Resource, } from "./types.js";
3
3
  //# sourceMappingURL=index.js.map