@pnp/graph 2.8.0 → 2.12.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 (153) 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 -36
  11. package/calendars/funcs.js +43 -43
  12. package/calendars/groups.d.ts +13 -13
  13. package/calendars/groups.js +5 -5
  14. package/calendars/index.d.ts +4 -4
  15. package/calendars/index.js +3 -3
  16. package/calendars/types.d.ts +52 -52
  17. package/calendars/types.js +98 -98
  18. package/calendars/users.d.ts +22 -22
  19. package/calendars/users.js +9 -9
  20. package/cloud-communications/index.d.ts +8 -8
  21. package/cloud-communications/index.js +14 -14
  22. package/cloud-communications/types.d.ts +21 -21
  23. package/cloud-communications/types.js +46 -46
  24. package/cloud-communications/users.d.ts +9 -9
  25. package/cloud-communications/users.js +4 -4
  26. package/contacts/index.d.ts +2 -2
  27. package/contacts/index.js +2 -2
  28. package/contacts/types.d.ts +75 -75
  29. package/contacts/types.js +145 -145
  30. package/contacts/users.d.ts +11 -11
  31. package/contacts/users.js +5 -5
  32. package/conversations/groups.d.ts +13 -13
  33. package/conversations/groups.js +6 -6
  34. package/conversations/index.d.ts +2 -2
  35. package/conversations/index.js +2 -2
  36. package/conversations/types.d.ts +103 -103
  37. package/conversations/types.js +173 -173
  38. package/decorators.d.ts +103 -103
  39. package/decorators.js +138 -138
  40. package/directory-objects/index.d.ts +7 -7
  41. package/directory-objects/index.js +13 -13
  42. package/directory-objects/types.d.ts +67 -67
  43. package/directory-objects/types.js +96 -96
  44. package/graphhttpclient.d.ts +13 -13
  45. package/graphhttpclient.js +95 -95
  46. package/graphlibconfig.d.ts +21 -21
  47. package/graphlibconfig.js +19 -19
  48. package/graphqueryable.d.ts +156 -156
  49. package/graphqueryable.d.ts.map +1 -1
  50. package/graphqueryable.js +247 -242
  51. package/graphqueryable.js.map +1 -1
  52. package/groups/index.d.ts +7 -7
  53. package/groups/index.js +13 -13
  54. package/groups/types.d.ts +81 -81
  55. package/groups/types.js +137 -137
  56. package/index.d.ts +8 -8
  57. package/index.js +7 -7
  58. package/insights/index.d.ts +2 -2
  59. package/insights/index.js +2 -2
  60. package/insights/types.d.ts +76 -76
  61. package/insights/types.js +162 -162
  62. package/insights/users.d.ts +9 -9
  63. package/insights/users.js +4 -4
  64. package/invitations/index.d.ts +7 -7
  65. package/invitations/index.js +13 -13
  66. package/invitations/types.d.ts +25 -25
  67. package/invitations/types.js +44 -44
  68. package/members/groups.d.ts +11 -11
  69. package/members/groups.js +5 -5
  70. package/members/index.d.ts +2 -2
  71. package/members/index.js +2 -2
  72. package/members/types.d.ts +31 -31
  73. package/members/types.js +49 -49
  74. package/messages/index.d.ts +2 -2
  75. package/messages/index.js +2 -2
  76. package/messages/types.d.ts +43 -43
  77. package/messages/types.js +77 -77
  78. package/messages/users.d.ts +15 -15
  79. package/messages/users.js +10 -10
  80. package/onedrive/index.d.ts +2 -2
  81. package/onedrive/index.js +2 -2
  82. package/onedrive/types.d.ts +95 -95
  83. package/onedrive/types.js +241 -241
  84. package/onedrive/users.d.ts +11 -11
  85. package/onedrive/users.js +5 -5
  86. package/onenote/index.d.ts +2 -2
  87. package/onenote/index.js +2 -2
  88. package/onenote/types.d.ts +76 -76
  89. package/onenote/types.js +149 -149
  90. package/onenote/users.d.ts +9 -9
  91. package/onenote/users.js +4 -4
  92. package/operations.d.ts +8 -8
  93. package/operations.js +41 -41
  94. package/outlook/index.d.ts +2 -2
  95. package/outlook/index.js +2 -2
  96. package/outlook/types.d.ts +40 -40
  97. package/outlook/types.js +76 -76
  98. package/outlook/users.d.ts +9 -9
  99. package/outlook/users.js +4 -4
  100. package/package.json +5 -5
  101. package/photos/groups.d.ts +9 -9
  102. package/photos/groups.js +4 -4
  103. package/photos/index.d.ts +3 -3
  104. package/photos/index.js +3 -3
  105. package/photos/types.d.ts +21 -21
  106. package/photos/types.js +37 -37
  107. package/photos/users.d.ts +9 -9
  108. package/photos/users.js +4 -4
  109. package/planner/groups.d.ts +9 -9
  110. package/planner/groups.js +4 -4
  111. package/planner/index.d.ts +9 -9
  112. package/planner/index.js +15 -15
  113. package/planner/types.d.ts +117 -117
  114. package/planner/types.js +291 -291
  115. package/planner/users.d.ts +9 -9
  116. package/planner/users.js +4 -4
  117. package/presets/all.d.ts +38 -38
  118. package/presets/all.js +38 -38
  119. package/readme.md +21 -21
  120. package/rest.d.ts +30 -30
  121. package/rest.js +57 -57
  122. package/search/index.d.ts +7 -7
  123. package/search/index.js +18 -18
  124. package/search/types.d.ts +16 -16
  125. package/search/types.js +23 -23
  126. package/sites/group.d.ts +9 -9
  127. package/sites/group.js +4 -4
  128. package/sites/index.d.ts +2 -2
  129. package/sites/index.js +2 -2
  130. package/sites/types.d.ts +23 -23
  131. package/sites/types.js +47 -47
  132. package/subscriptions/index.d.ts +7 -7
  133. package/subscriptions/index.js +13 -13
  134. package/subscriptions/types.d.ts +37 -37
  135. package/subscriptions/types.js +72 -72
  136. package/teams/index.d.ts +19 -19
  137. package/teams/index.js +35 -35
  138. package/teams/types.d.ts +112 -111
  139. package/teams/types.d.ts.map +1 -1
  140. package/teams/types.js +261 -254
  141. package/teams/types.js.map +1 -1
  142. package/teams/users.d.ts +9 -9
  143. package/teams/users.js +4 -4
  144. package/types.d.ts +9 -9
  145. package/types.js +19 -19
  146. package/users/index.d.ts +8 -8
  147. package/users/index.js +23 -23
  148. package/users/types.d.ts +35 -35
  149. package/users/types.js +82 -82
  150. package/utils/toabsoluteurl.d.ts +7 -7
  151. package/utils/toabsoluteurl.js +48 -48
  152. package/utils/type.d.ts +3 -3
  153. package/utils/type.js +3 -3
@@ -1,22 +1,22 @@
1
- import { Presence as IUserPresence } from "@microsoft/microsoft-graph-types";
2
- import { _GraphQueryableCollection, _GraphQueryableInstance } from "../graphqueryable.js";
3
- /**
4
- * Presence
5
- */
6
- export declare class _Presence extends _GraphQueryableInstance<IUserPresence> {
7
- }
8
- export interface IPresence extends _Presence {
9
- }
10
- export declare const Presence: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IPresence & import("@pnp/odata").IInvokable<any>;
11
- export declare class _Communications extends _GraphQueryableCollection<IUserPresence[]> {
12
- /**
13
- * Retrieve presence information for a group of users.
14
- *
15
- * @param ids An array of user id's to retrieve presence for.
16
- */
17
- getPresencesByUserId(ids: string[]): Promise<IUserPresence[]>;
18
- }
19
- export interface ICommunications extends _Communications {
20
- }
21
- export declare const Communications: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => ICommunications & import("@pnp/odata").IInvokable<any>;
1
+ import { Presence as IUserPresence } from "@microsoft/microsoft-graph-types";
2
+ import { _GraphQueryableCollection, _GraphQueryableInstance } from "../graphqueryable.js";
3
+ /**
4
+ * Presence
5
+ */
6
+ export declare class _Presence extends _GraphQueryableInstance<IUserPresence> {
7
+ }
8
+ export interface IPresence extends _Presence {
9
+ }
10
+ export declare const Presence: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IPresence & import("@pnp/odata").IInvokable<any>;
11
+ export declare class _Communications extends _GraphQueryableCollection<IUserPresence[]> {
12
+ /**
13
+ * Retrieve presence information for a group of users.
14
+ *
15
+ * @param ids An array of user id's to retrieve presence for.
16
+ */
17
+ getPresencesByUserId(ids: string[]): Promise<IUserPresence[]>;
18
+ }
19
+ export interface ICommunications extends _Communications {
20
+ }
21
+ export declare const Communications: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => ICommunications & import("@pnp/odata").IInvokable<any>;
22
22
  //# sourceMappingURL=types.d.ts.map
@@ -1,47 +1,47 @@
1
- import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
- import { body } from "@pnp/odata";
3
- import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js";
4
- import { defaultPath } from "../decorators.js";
5
- import { graphPost } from "../operations.js";
6
- /**
7
- * Presence
8
- */
9
- var _Presence = /** @class */ (function (_super) {
10
- __extends(_Presence, _super);
11
- function _Presence() {
12
- return _super !== null && _super.apply(this, arguments) || this;
13
- }
14
- _Presence = __decorate([
15
- defaultPath("presence")
16
- ], _Presence);
17
- return _Presence;
18
- }(_GraphQueryableInstance));
19
- export { _Presence };
20
- export var Presence = graphInvokableFactory(_Presence);
21
- var _Communications = /** @class */ (function (_super) {
22
- __extends(_Communications, _super);
23
- function _Communications() {
24
- return _super !== null && _super.apply(this, arguments) || this;
25
- }
26
- /**
27
- * Retrieve presence information for a group of users.
28
- *
29
- * @param ids An array of user id's to retrieve presence for.
30
- */
31
- _Communications.prototype.getPresencesByUserId = function (ids) {
32
- return __awaiter(this, void 0, void 0, function () {
33
- var postBody;
34
- return __generator(this, function (_a) {
35
- postBody = { ids: ids };
36
- return [2 /*return*/, graphPost(this.clone(Communications, "getPresencesByUserId"), body(postBody))];
37
- });
38
- });
39
- };
40
- _Communications = __decorate([
41
- defaultPath("communications")
42
- ], _Communications);
43
- return _Communications;
44
- }(_GraphQueryableCollection));
45
- export { _Communications };
46
- export var Communications = graphInvokableFactory(_Communications);
1
+ import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
+ import { body } from "@pnp/odata";
3
+ import { _GraphQueryableCollection, graphInvokableFactory, _GraphQueryableInstance } from "../graphqueryable.js";
4
+ import { defaultPath } from "../decorators.js";
5
+ import { graphPost } from "../operations.js";
6
+ /**
7
+ * Presence
8
+ */
9
+ var _Presence = /** @class */ (function (_super) {
10
+ __extends(_Presence, _super);
11
+ function _Presence() {
12
+ return _super !== null && _super.apply(this, arguments) || this;
13
+ }
14
+ _Presence = __decorate([
15
+ defaultPath("presence")
16
+ ], _Presence);
17
+ return _Presence;
18
+ }(_GraphQueryableInstance));
19
+ export { _Presence };
20
+ export var Presence = graphInvokableFactory(_Presence);
21
+ var _Communications = /** @class */ (function (_super) {
22
+ __extends(_Communications, _super);
23
+ function _Communications() {
24
+ return _super !== null && _super.apply(this, arguments) || this;
25
+ }
26
+ /**
27
+ * Retrieve presence information for a group of users.
28
+ *
29
+ * @param ids An array of user id's to retrieve presence for.
30
+ */
31
+ _Communications.prototype.getPresencesByUserId = function (ids) {
32
+ return __awaiter(this, void 0, void 0, function () {
33
+ var postBody;
34
+ return __generator(this, function (_a) {
35
+ postBody = { ids: ids };
36
+ return [2 /*return*/, graphPost(this.clone(Communications, "getPresencesByUserId"), body(postBody))];
37
+ });
38
+ });
39
+ };
40
+ _Communications = __decorate([
41
+ defaultPath("communications")
42
+ ], _Communications);
43
+ return _Communications;
44
+ }(_GraphQueryableCollection));
45
+ export { _Communications };
46
+ export var Communications = graphInvokableFactory(_Communications);
47
47
  //# sourceMappingURL=types.js.map
@@ -1,10 +1,10 @@
1
- import { IPresence } from "./types.js";
2
- declare module "../users/types" {
3
- interface _User {
4
- readonly presence: IPresence;
5
- }
6
- interface IUser {
7
- readonly presence: IPresence;
8
- }
9
- }
1
+ import { IPresence } from "./types.js";
2
+ declare module "../users/types" {
3
+ interface _User {
4
+ readonly presence: IPresence;
5
+ }
6
+ interface IUser {
7
+ readonly presence: IPresence;
8
+ }
9
+ }
10
10
  //# sourceMappingURL=users.d.ts.map
@@ -1,5 +1,5 @@
1
- import { addProp } from "@pnp/odata";
2
- import { _User } from "../users/types.js";
3
- import { Presence } from "./types.js";
4
- addProp(_User, "presence", Presence, "presence");
1
+ import { addProp } from "@pnp/odata";
2
+ import { _User } from "../users/types.js";
3
+ import { Presence } from "./types.js";
4
+ addProp(_User, "presence", Presence, "presence");
5
5
  //# sourceMappingURL=users.js.map
@@ -1,3 +1,3 @@
1
- import "./users.js";
2
- export { Contact, IContactAddResult, ContactFolder, IContactFolderAddResult, ContactFolders, Contacts, IContact, IContactFolder, IContactFolders, IContacts, } from "./types.js";
1
+ import "./users.js";
2
+ export { Contact, IContactAddResult, ContactFolder, IContactFolderAddResult, ContactFolders, Contacts, IContact, IContactFolder, IContactFolders, IContacts, } from "./types.js";
3
3
  //# sourceMappingURL=index.d.ts.map
package/contacts/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./users.js";
2
- export { Contact, ContactFolder, ContactFolders, Contacts, } from "./types.js";
1
+ import "./users.js";
2
+ export { Contact, ContactFolder, ContactFolders, Contacts, } from "./types.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,76 +1,76 @@
1
- import { _GraphQueryableCollection, _GraphQueryableInstance } from "../graphqueryable.js";
2
- import { ITypedHash } from "@pnp/common";
3
- import { Contact as IContactType, ContactFolder as IContactFolderType, EmailAddress as IEmailAddressType } from "@microsoft/microsoft-graph-types";
4
- import { IUpdateable, IDeleteable, IGetById } from "../decorators.js";
5
- /**
6
- * Contact
7
- */
8
- export declare class _Contact extends _GraphQueryableInstance<IContactType> {
9
- }
10
- export interface IContact extends _Contact, IUpdateable<IContactType>, IDeleteable {
11
- }
12
- export declare const Contact: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContact & import("@pnp/odata").IInvokable<any>;
13
- /**
14
- * Contacts
15
- */
16
- export declare class _Contacts extends _GraphQueryableCollection<IContactType[]> {
17
- /**
18
- * Create a new Contact for the user.
19
- *
20
- * @param givenName The contact's given name.
21
- * @param surName The contact's surname.
22
- * @param emailAddresses The contact's email addresses.
23
- * @param businessPhones The contact's business phone numbers.
24
- * @param additionalProperties A plain object collection of additional properties you want to set on the new contact
25
- */
26
- add(givenName: string, surName: string, emailAddresses: IEmailAddressType[], businessPhones: string[], additionalProperties?: ITypedHash<any>): Promise<IContactAddResult>;
27
- }
28
- export interface IContacts extends _Contacts, IGetById<IContact> {
29
- }
30
- export declare const Contacts: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContacts & import("@pnp/odata").IInvokable<any>;
31
- /**
32
- * Contact Folder
33
- */
34
- export declare class _ContactFolder extends _GraphQueryableInstance<IContactFolderType> {
35
- /**
36
- * Gets the contacts in this contact folder
37
- */
38
- get contacts(): IContacts;
39
- /**
40
- * Gets the contacts in this contact folder
41
- */
42
- get childFolders(): IContactFolders;
43
- }
44
- export interface IContactFolder extends _ContactFolder, IUpdateable, IDeleteable {
45
- }
46
- export declare const ContactFolder: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContactFolder & import("@pnp/odata").IInvokable<any>;
47
- /**
48
- * Contact Folders
49
- */
50
- export declare class _ContactFolders extends _GraphQueryableCollection<IContactFolderType[]> {
51
- /**
52
- * Create a new Contact Folder for the user.
53
- *
54
- * @param displayName The folder's display name.
55
- * @param parentFolderId The ID of the folder's parent folder.
56
- */
57
- add(displayName: string, parentFolderId?: string): Promise<IContactFolderAddResult>;
58
- }
59
- export interface IContactFolders extends _ContactFolders, IGetById<IContactFolder> {
60
- }
61
- export declare const ContactFolders: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContactFolders & import("@pnp/odata").IInvokable<any>;
62
- /**
63
- * IContactFolderAddResult
64
- */
65
- export interface IContactFolderAddResult {
66
- data: IContactFolderType;
67
- contactFolder: IContactFolder;
68
- }
69
- /**
70
- * IContactAddResult
71
- */
72
- export interface IContactAddResult {
73
- data: IContactType;
74
- contact: IContact;
75
- }
1
+ import { _GraphQueryableCollection, _GraphQueryableInstance } from "../graphqueryable.js";
2
+ import { ITypedHash } from "@pnp/common";
3
+ import { Contact as IContactType, ContactFolder as IContactFolderType, EmailAddress as IEmailAddressType } from "@microsoft/microsoft-graph-types";
4
+ import { IUpdateable, IDeleteable, IGetById } from "../decorators.js";
5
+ /**
6
+ * Contact
7
+ */
8
+ export declare class _Contact extends _GraphQueryableInstance<IContactType> {
9
+ }
10
+ export interface IContact extends _Contact, IUpdateable<IContactType>, IDeleteable {
11
+ }
12
+ export declare const Contact: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContact & import("@pnp/odata").IInvokable<any>;
13
+ /**
14
+ * Contacts
15
+ */
16
+ export declare class _Contacts extends _GraphQueryableCollection<IContactType[]> {
17
+ /**
18
+ * Create a new Contact for the user.
19
+ *
20
+ * @param givenName The contact's given name.
21
+ * @param surName The contact's surname.
22
+ * @param emailAddresses The contact's email addresses.
23
+ * @param businessPhones The contact's business phone numbers.
24
+ * @param additionalProperties A plain object collection of additional properties you want to set on the new contact
25
+ */
26
+ add(givenName: string, surName: string, emailAddresses: IEmailAddressType[], businessPhones: string[], additionalProperties?: ITypedHash<any>): Promise<IContactAddResult>;
27
+ }
28
+ export interface IContacts extends _Contacts, IGetById<IContact> {
29
+ }
30
+ export declare const Contacts: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContacts & import("@pnp/odata").IInvokable<any>;
31
+ /**
32
+ * Contact Folder
33
+ */
34
+ export declare class _ContactFolder extends _GraphQueryableInstance<IContactFolderType> {
35
+ /**
36
+ * Gets the contacts in this contact folder
37
+ */
38
+ get contacts(): IContacts;
39
+ /**
40
+ * Gets the contacts in this contact folder
41
+ */
42
+ get childFolders(): IContactFolders;
43
+ }
44
+ export interface IContactFolder extends _ContactFolder, IUpdateable, IDeleteable {
45
+ }
46
+ export declare const ContactFolder: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContactFolder & import("@pnp/odata").IInvokable<any>;
47
+ /**
48
+ * Contact Folders
49
+ */
50
+ export declare class _ContactFolders extends _GraphQueryableCollection<IContactFolderType[]> {
51
+ /**
52
+ * Create a new Contact Folder for the user.
53
+ *
54
+ * @param displayName The folder's display name.
55
+ * @param parentFolderId The ID of the folder's parent folder.
56
+ */
57
+ add(displayName: string, parentFolderId?: string): Promise<IContactFolderAddResult>;
58
+ }
59
+ export interface IContactFolders extends _ContactFolders, IGetById<IContactFolder> {
60
+ }
61
+ export declare const ContactFolders: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IContactFolders & import("@pnp/odata").IInvokable<any>;
62
+ /**
63
+ * IContactFolderAddResult
64
+ */
65
+ export interface IContactFolderAddResult {
66
+ data: IContactFolderType;
67
+ contactFolder: IContactFolder;
68
+ }
69
+ /**
70
+ * IContactAddResult
71
+ */
72
+ export interface IContactAddResult {
73
+ data: IContactType;
74
+ contact: IContact;
75
+ }
76
76
  //# sourceMappingURL=types.d.ts.map
package/contacts/types.js CHANGED
@@ -1,146 +1,146 @@
1
- import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
- import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js";
3
- import { assign } from "@pnp/common";
4
- import { defaultPath, updateable, deleteable, getById } from "../decorators.js";
5
- import { graphPost } from "../operations.js";
6
- import { body } from "@pnp/odata";
7
- /**
8
- * Contact
9
- */
10
- var _Contact = /** @class */ (function (_super) {
11
- __extends(_Contact, _super);
12
- function _Contact() {
13
- return _super !== null && _super.apply(this, arguments) || this;
14
- }
15
- _Contact = __decorate([
16
- updateable(),
17
- deleteable()
18
- ], _Contact);
19
- return _Contact;
20
- }(_GraphQueryableInstance));
21
- export { _Contact };
22
- export var Contact = graphInvokableFactory(_Contact);
23
- /**
24
- * Contacts
25
- */
26
- var _Contacts = /** @class */ (function (_super) {
27
- __extends(_Contacts, _super);
28
- function _Contacts() {
29
- return _super !== null && _super.apply(this, arguments) || this;
30
- }
31
- /**
32
- * Create a new Contact for the user.
33
- *
34
- * @param givenName The contact's given name.
35
- * @param surName The contact's surname.
36
- * @param emailAddresses The contact's email addresses.
37
- * @param businessPhones The contact's business phone numbers.
38
- * @param additionalProperties A plain object collection of additional properties you want to set on the new contact
39
- */
40
- _Contacts.prototype.add = function (givenName, surName, emailAddresses, businessPhones, additionalProperties) {
41
- if (additionalProperties === void 0) { additionalProperties = {}; }
42
- return __awaiter(this, void 0, void 0, function () {
43
- var postBody, data;
44
- return __generator(this, function (_a) {
45
- switch (_a.label) {
46
- case 0:
47
- postBody = assign({ businessPhones: businessPhones, emailAddresses: emailAddresses, givenName: givenName, surName: surName }, additionalProperties);
48
- return [4 /*yield*/, graphPost(this, body(postBody))];
49
- case 1:
50
- data = _a.sent();
51
- return [2 /*return*/, {
52
- contact: this.getById(data.id),
53
- data: data,
54
- }];
55
- }
56
- });
57
- });
58
- };
59
- _Contacts = __decorate([
60
- defaultPath("contacts"),
61
- getById(Contact)
62
- ], _Contacts);
63
- return _Contacts;
64
- }(_GraphQueryableCollection));
65
- export { _Contacts };
66
- export var Contacts = graphInvokableFactory(_Contacts);
67
- /**
68
- * Contact Folder
69
- */
70
- var _ContactFolder = /** @class */ (function (_super) {
71
- __extends(_ContactFolder, _super);
72
- function _ContactFolder() {
73
- return _super !== null && _super.apply(this, arguments) || this;
74
- }
75
- Object.defineProperty(_ContactFolder.prototype, "contacts", {
76
- /**
77
- * Gets the contacts in this contact folder
78
- */
79
- get: function () {
80
- return Contacts(this);
81
- },
82
- enumerable: false,
83
- configurable: true
84
- });
85
- Object.defineProperty(_ContactFolder.prototype, "childFolders", {
86
- /**
87
- * Gets the contacts in this contact folder
88
- */
89
- get: function () {
90
- return ContactFolders(this, "childFolders");
91
- },
92
- enumerable: false,
93
- configurable: true
94
- });
95
- _ContactFolder = __decorate([
96
- deleteable(),
97
- updateable()
98
- ], _ContactFolder);
99
- return _ContactFolder;
100
- }(_GraphQueryableInstance));
101
- export { _ContactFolder };
102
- export var ContactFolder = graphInvokableFactory(_ContactFolder);
103
- /**
104
- * Contact Folders
105
- */
106
- var _ContactFolders = /** @class */ (function (_super) {
107
- __extends(_ContactFolders, _super);
108
- function _ContactFolders() {
109
- return _super !== null && _super.apply(this, arguments) || this;
110
- }
111
- /**
112
- * Create a new Contact Folder for the user.
113
- *
114
- * @param displayName The folder's display name.
115
- * @param parentFolderId The ID of the folder's parent folder.
116
- */
117
- _ContactFolders.prototype.add = function (displayName, parentFolderId) {
118
- return __awaiter(this, void 0, void 0, function () {
119
- var postBody, data;
120
- return __generator(this, function (_a) {
121
- switch (_a.label) {
122
- case 0:
123
- postBody = {
124
- displayName: displayName,
125
- parentFolderId: parentFolderId,
126
- };
127
- return [4 /*yield*/, graphPost(this, body(postBody))];
128
- case 1:
129
- data = _a.sent();
130
- return [2 /*return*/, {
131
- contactFolder: this.getById(data.id),
132
- data: data,
133
- }];
134
- }
135
- });
136
- });
137
- };
138
- _ContactFolders = __decorate([
139
- defaultPath("contactFolders"),
140
- getById(ContactFolder)
141
- ], _ContactFolders);
142
- return _ContactFolders;
143
- }(_GraphQueryableCollection));
144
- export { _ContactFolders };
145
- export var ContactFolders = graphInvokableFactory(_ContactFolders);
1
+ import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
+ import { _GraphQueryableCollection, _GraphQueryableInstance, graphInvokableFactory } from "../graphqueryable.js";
3
+ import { assign } from "@pnp/common";
4
+ import { defaultPath, updateable, deleteable, getById } from "../decorators.js";
5
+ import { graphPost } from "../operations.js";
6
+ import { body } from "@pnp/odata";
7
+ /**
8
+ * Contact
9
+ */
10
+ var _Contact = /** @class */ (function (_super) {
11
+ __extends(_Contact, _super);
12
+ function _Contact() {
13
+ return _super !== null && _super.apply(this, arguments) || this;
14
+ }
15
+ _Contact = __decorate([
16
+ updateable(),
17
+ deleteable()
18
+ ], _Contact);
19
+ return _Contact;
20
+ }(_GraphQueryableInstance));
21
+ export { _Contact };
22
+ export var Contact = graphInvokableFactory(_Contact);
23
+ /**
24
+ * Contacts
25
+ */
26
+ var _Contacts = /** @class */ (function (_super) {
27
+ __extends(_Contacts, _super);
28
+ function _Contacts() {
29
+ return _super !== null && _super.apply(this, arguments) || this;
30
+ }
31
+ /**
32
+ * Create a new Contact for the user.
33
+ *
34
+ * @param givenName The contact's given name.
35
+ * @param surName The contact's surname.
36
+ * @param emailAddresses The contact's email addresses.
37
+ * @param businessPhones The contact's business phone numbers.
38
+ * @param additionalProperties A plain object collection of additional properties you want to set on the new contact
39
+ */
40
+ _Contacts.prototype.add = function (givenName, surName, emailAddresses, businessPhones, additionalProperties) {
41
+ if (additionalProperties === void 0) { additionalProperties = {}; }
42
+ return __awaiter(this, void 0, void 0, function () {
43
+ var postBody, data;
44
+ return __generator(this, function (_a) {
45
+ switch (_a.label) {
46
+ case 0:
47
+ postBody = assign({ businessPhones: businessPhones, emailAddresses: emailAddresses, givenName: givenName, surName: surName }, additionalProperties);
48
+ return [4 /*yield*/, graphPost(this, body(postBody))];
49
+ case 1:
50
+ data = _a.sent();
51
+ return [2 /*return*/, {
52
+ contact: this.getById(data.id),
53
+ data: data,
54
+ }];
55
+ }
56
+ });
57
+ });
58
+ };
59
+ _Contacts = __decorate([
60
+ defaultPath("contacts"),
61
+ getById(Contact)
62
+ ], _Contacts);
63
+ return _Contacts;
64
+ }(_GraphQueryableCollection));
65
+ export { _Contacts };
66
+ export var Contacts = graphInvokableFactory(_Contacts);
67
+ /**
68
+ * Contact Folder
69
+ */
70
+ var _ContactFolder = /** @class */ (function (_super) {
71
+ __extends(_ContactFolder, _super);
72
+ function _ContactFolder() {
73
+ return _super !== null && _super.apply(this, arguments) || this;
74
+ }
75
+ Object.defineProperty(_ContactFolder.prototype, "contacts", {
76
+ /**
77
+ * Gets the contacts in this contact folder
78
+ */
79
+ get: function () {
80
+ return Contacts(this);
81
+ },
82
+ enumerable: false,
83
+ configurable: true
84
+ });
85
+ Object.defineProperty(_ContactFolder.prototype, "childFolders", {
86
+ /**
87
+ * Gets the contacts in this contact folder
88
+ */
89
+ get: function () {
90
+ return ContactFolders(this, "childFolders");
91
+ },
92
+ enumerable: false,
93
+ configurable: true
94
+ });
95
+ _ContactFolder = __decorate([
96
+ deleteable(),
97
+ updateable()
98
+ ], _ContactFolder);
99
+ return _ContactFolder;
100
+ }(_GraphQueryableInstance));
101
+ export { _ContactFolder };
102
+ export var ContactFolder = graphInvokableFactory(_ContactFolder);
103
+ /**
104
+ * Contact Folders
105
+ */
106
+ var _ContactFolders = /** @class */ (function (_super) {
107
+ __extends(_ContactFolders, _super);
108
+ function _ContactFolders() {
109
+ return _super !== null && _super.apply(this, arguments) || this;
110
+ }
111
+ /**
112
+ * Create a new Contact Folder for the user.
113
+ *
114
+ * @param displayName The folder's display name.
115
+ * @param parentFolderId The ID of the folder's parent folder.
116
+ */
117
+ _ContactFolders.prototype.add = function (displayName, parentFolderId) {
118
+ return __awaiter(this, void 0, void 0, function () {
119
+ var postBody, data;
120
+ return __generator(this, function (_a) {
121
+ switch (_a.label) {
122
+ case 0:
123
+ postBody = {
124
+ displayName: displayName,
125
+ parentFolderId: parentFolderId,
126
+ };
127
+ return [4 /*yield*/, graphPost(this, body(postBody))];
128
+ case 1:
129
+ data = _a.sent();
130
+ return [2 /*return*/, {
131
+ contactFolder: this.getById(data.id),
132
+ data: data,
133
+ }];
134
+ }
135
+ });
136
+ });
137
+ };
138
+ _ContactFolders = __decorate([
139
+ defaultPath("contactFolders"),
140
+ getById(ContactFolder)
141
+ ], _ContactFolders);
142
+ return _ContactFolders;
143
+ }(_GraphQueryableCollection));
144
+ export { _ContactFolders };
145
+ export var ContactFolders = graphInvokableFactory(_ContactFolders);
146
146
  //# sourceMappingURL=types.js.map
@@ -1,12 +1,12 @@
1
- import { IContacts, IContactFolders } from "./types.js";
2
- declare module "../users/types" {
3
- interface _User {
4
- readonly contacts: IContacts;
5
- readonly contactFolders: IContactFolders;
6
- }
7
- interface IUser {
8
- readonly contacts: IContacts;
9
- readonly contactFolders: IContactFolders;
10
- }
11
- }
1
+ import { IContacts, IContactFolders } from "./types.js";
2
+ declare module "../users/types" {
3
+ interface _User {
4
+ readonly contacts: IContacts;
5
+ readonly contactFolders: IContactFolders;
6
+ }
7
+ interface IUser {
8
+ readonly contacts: IContacts;
9
+ readonly contactFolders: IContactFolders;
10
+ }
11
+ }
12
12
  //# sourceMappingURL=users.d.ts.map