@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
@@ -1,3 +1,3 @@
1
- import "./users.js";
2
- export { Drive, DriveItem, DriveItems, Drives, IDrive, IDriveItem, IDriveItemAddResult, IDriveItemVersionInfo, IDriveItems, IDrives, IRoot, Root, } from "./types.js";
1
+ import "./users.js";
2
+ export { Drive, DriveItem, DriveItems, Drives, IDrive, IDriveItem, IDriveItemAddResult, IDriveItemVersionInfo, IDriveItems, IDrives, IRoot, Root, } from "./types.js";
3
3
  //# sourceMappingURL=index.d.ts.map
package/onedrive/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./users.js";
2
- export { Drive, DriveItem, DriveItems, Drives, Root, } from "./types.js";
1
+ import "./users.js";
2
+ export { Drive, DriveItem, DriveItems, Drives, Root, } from "./types.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,88 +1,96 @@
1
- import { _GraphQueryableInstance, IGraphQueryableInstance, IGraphQueryableCollection, _GraphQueryableCollection } from "../graphqueryable.js";
2
- import { Drive as IDriveType } from "@microsoft/microsoft-graph-types";
3
- import { IGetById, IDeleteable, IUpdateable } from "../decorators.js";
4
- /**
5
- * Describes a Drive instance
6
- *
7
- */
8
- export declare class _Drive extends _GraphQueryableInstance<IDriveType> {
9
- get root(): IRoot;
10
- get list(): IGraphQueryableInstance;
11
- get recent(): IDriveItems;
12
- get sharedWithMe(): IDriveItems;
13
- getItemById(id: string): IDriveItem;
14
- }
15
- export interface IDrive extends _Drive {
16
- }
17
- export declare const Drive: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDrive & import("@pnp/odata").IInvokable<any>;
18
- /**
19
- * Describes a collection of Drive objects
20
- *
21
- */
22
- export declare class _Drives extends _GraphQueryableCollection<IDriveType[]> {
23
- getById(id: string): IDrive;
24
- }
25
- export interface IDrives extends _Drives, IGetById<IDrive> {
26
- }
27
- export declare const Drives: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDrives & import("@pnp/odata").IInvokable<any>;
28
- /**
29
- * Describes a Root instance
30
- *
31
- */
32
- export declare class _Root extends _GraphQueryableInstance<IDrive> {
33
- get children(): IDriveItems;
34
- search(query: string): Promise<any>;
35
- get thumbnails(): IGraphQueryableCollection;
36
- }
37
- export interface IRoot extends _Root {
38
- }
39
- export declare const Root: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IRoot & import("@pnp/odata").IInvokable<any>;
40
- /**
41
- * Describes a Drive Item instance
42
- *
43
- */
44
- export declare class _DriveItem extends _GraphQueryableInstance<any> {
45
- get children(): IDriveItems;
46
- get thumbnails(): IGraphQueryableCollection;
47
- get versions(): IGraphQueryableCollection<IDriveItemVersionInfo>;
48
- move(parentReference: {
49
- id: "string";
50
- }, name: string): Promise<void>;
51
- getContent(): Promise<Blob>;
52
- setContent(content: any): Promise<{
53
- id: string;
54
- name: string;
55
- size: number;
56
- }>;
57
- }
58
- export interface IDriveItem extends _DriveItem, IDeleteable, IUpdateable {
59
- }
60
- export declare const DriveItem: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDriveItem & import("@pnp/odata").IInvokable<any>;
61
- /**
62
- * Describes a collection of Drive Item objects
63
- *
64
- */
65
- export declare class _DriveItems extends _GraphQueryableCollection {
66
- }
67
- export interface IDriveItems extends _DriveItems, IGetById<IDriveItem> {
68
- }
69
- export declare const DriveItems: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDriveItems & import("@pnp/odata").IInvokable<any>;
70
- /**
71
- * IDriveItemAddResult
72
- */
73
- export interface IDriveItemAddResult {
74
- data: any;
75
- driveItem: IDriveItem;
76
- }
77
- export interface IDriveItemVersionInfo {
78
- id: string;
79
- lastModifiedBy: {
80
- user: {
81
- id: string;
82
- displayName: string;
83
- };
84
- };
85
- lastModifiedDateTime: string;
86
- size: number;
87
- }
1
+ import { _GraphQueryableInstance, IGraphQueryableInstance, IGraphQueryableCollection, _GraphQueryableCollection } from "../graphqueryable.js";
2
+ import { Drive as IDriveType } from "@microsoft/microsoft-graph-types";
3
+ import { IGetById, IDeleteable, IUpdateable } from "../decorators.js";
4
+ /**
5
+ * Describes a Drive instance
6
+ *
7
+ */
8
+ export declare class _Drive extends _GraphQueryableInstance<IDriveType> {
9
+ get root(): IRoot;
10
+ get list(): IGraphQueryableInstance;
11
+ get recent(): IDriveItems;
12
+ get sharedWithMe(): IDriveItems;
13
+ getItemById(id: string): IDriveItem;
14
+ }
15
+ export interface IDrive extends _Drive {
16
+ }
17
+ export declare const Drive: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDrive & import("@pnp/odata").IInvokable<any>;
18
+ /**
19
+ * Describes a collection of Drive objects
20
+ *
21
+ */
22
+ export declare class _Drives extends _GraphQueryableCollection<IDriveType[]> {
23
+ getById(id: string): IDrive;
24
+ }
25
+ export interface IDrives extends _Drives, IGetById<IDrive> {
26
+ }
27
+ export declare const Drives: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDrives & import("@pnp/odata").IInvokable<any>;
28
+ /**
29
+ * Describes a Root instance
30
+ *
31
+ */
32
+ export declare class _Root extends _GraphQueryableInstance<IDrive> {
33
+ get children(): IDriveItems;
34
+ search(query: string): Promise<any>;
35
+ get thumbnails(): IGraphQueryableCollection;
36
+ }
37
+ export interface IRoot extends _Root {
38
+ }
39
+ export declare const Root: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IRoot & import("@pnp/odata").IInvokable<any>;
40
+ /**
41
+ * Describes a Drive Item instance
42
+ *
43
+ */
44
+ export declare class _DriveItem extends _GraphQueryableInstance<any> {
45
+ get children(): IDriveItems;
46
+ get thumbnails(): IGraphQueryableCollection;
47
+ get versions(): IGraphQueryableCollection<IDriveItemVersionInfo>;
48
+ move(parentReference: {
49
+ id: "string";
50
+ }, name: string): Promise<void>;
51
+ getContent(): Promise<Blob>;
52
+ setContent(content: any): Promise<{
53
+ id: string;
54
+ name: string;
55
+ size: number;
56
+ }>;
57
+ }
58
+ export interface IDriveItem extends _DriveItem, IDeleteable, IUpdateable {
59
+ }
60
+ export declare const DriveItem: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDriveItem & import("@pnp/odata").IInvokable<any>;
61
+ /**
62
+ * Describes a collection of Drive Item objects
63
+ *
64
+ */
65
+ export declare class _DriveItems extends _GraphQueryableCollection {
66
+ add(filename: string, content: string): Promise<IDriveItemAddResult>;
67
+ /**
68
+ * Adds a folder to this collection of drive items
69
+ *
70
+ * @param name Name of the new folder
71
+ * @returns result with folder data and chainable drive item object
72
+ */
73
+ addFolder(name: string): Promise<IDriveItemAddResult>;
74
+ }
75
+ export interface IDriveItems extends _DriveItems, IGetById<IDriveItem> {
76
+ }
77
+ export declare const DriveItems: (baseUrl: string | import("../graphqueryable.js").IGraphQueryable<any>, path?: string) => IDriveItems & import("@pnp/odata").IInvokable<any>;
78
+ /**
79
+ * IDriveItemAddResult
80
+ */
81
+ export interface IDriveItemAddResult {
82
+ data: any;
83
+ driveItem: IDriveItem;
84
+ }
85
+ export interface IDriveItemVersionInfo {
86
+ id: string;
87
+ lastModifiedBy: {
88
+ user: {
89
+ id: string;
90
+ displayName: string;
91
+ };
92
+ };
93
+ lastModifiedDateTime: string;
94
+ size: number;
95
+ }
88
96
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../packages/graph/onedrive/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EAC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QAAQ,CAAA;KAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAcjC,UAAU,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAKvF;AACD,MAAM,WAAW,UAAW,SAAQ,UAAU,EAAE,WAAW,EAAE,WAAW;CAAI;AAC5E,eAAO,MAAM,SAAS,6IAAgD,CAAC;AAEvE;;;GAGG;AACH,qBACa,WAAY,SAAQ,yBAAyB;IAEzC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAejF;;;;;OAKG;IACU,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAerE;AACD,MAAM,WAAW,WAAY,SAAQ,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;CAAI;AAC1E,eAAO,MAAM,UAAU,8IAAkD,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE;QACZ,IAAI,EAAE;YACF,EAAE,EAAE,MAAM,CAAC;YACX,WAAW,EAAE,MAAM,CAAC;SACvB,CAAC;KACL,CAAC;IACF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CAChB"}
package/onedrive/types.js CHANGED
@@ -1,193 +1,242 @@
1
- import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
- import { GraphQueryableInstance, GraphQueryableCollection, _GraphQueryableInstance, _GraphQueryableCollection, graphInvokableFactory, } from "../graphqueryable.js";
3
- import { assign, combine, safeGlobal } from "@pnp/common";
4
- import { defaultPath, getById, deleteable, updateable } from "../decorators.js";
5
- import { body, BlobParser } from "@pnp/odata";
6
- import { graphPatch, graphPut } from "../operations.js";
7
- /**
8
- * Describes a Drive instance
9
- *
10
- */
11
- var _Drive = /** @class */ (function (_super) {
12
- __extends(_Drive, _super);
13
- function _Drive() {
14
- return _super !== null && _super.apply(this, arguments) || this;
15
- }
16
- Object.defineProperty(_Drive.prototype, "root", {
17
- get: function () {
18
- return Root(this);
19
- },
20
- enumerable: false,
21
- configurable: true
22
- });
23
- Object.defineProperty(_Drive.prototype, "list", {
24
- get: function () {
25
- return this.clone(GraphQueryableInstance, "list");
26
- },
27
- enumerable: false,
28
- configurable: true
29
- });
30
- Object.defineProperty(_Drive.prototype, "recent", {
31
- get: function () {
32
- return DriveItems(this, "recent");
33
- },
34
- enumerable: false,
35
- configurable: true
36
- });
37
- Object.defineProperty(_Drive.prototype, "sharedWithMe", {
38
- get: function () {
39
- return DriveItems(this, "sharedWithMe");
40
- },
41
- enumerable: false,
42
- configurable: true
43
- });
44
- _Drive.prototype.getItemById = function (id) {
45
- return DriveItem(this, combine("items", id));
46
- };
47
- _Drive = __decorate([
48
- defaultPath("drive")
49
- ], _Drive);
50
- return _Drive;
51
- }(_GraphQueryableInstance));
52
- export { _Drive };
53
- export var Drive = graphInvokableFactory(_Drive);
54
- /**
55
- * Describes a collection of Drive objects
56
- *
57
- */
58
- var _Drives = /** @class */ (function (_super) {
59
- __extends(_Drives, _super);
60
- function _Drives() {
61
- return _super !== null && _super.apply(this, arguments) || this;
62
- }
63
- _Drives.prototype.getById = function (id) {
64
- return Drive(this.getUrlBase(), "drives/" + id);
65
- };
66
- _Drives = __decorate([
67
- defaultPath("drives")
68
- ], _Drives);
69
- return _Drives;
70
- }(_GraphQueryableCollection));
71
- export { _Drives };
72
- export var Drives = graphInvokableFactory(_Drives);
73
- /**
74
- * Describes a Root instance
75
- *
76
- */
77
- var _Root = /** @class */ (function (_super) {
78
- __extends(_Root, _super);
79
- function _Root() {
80
- return _super !== null && _super.apply(this, arguments) || this;
81
- }
82
- Object.defineProperty(_Root.prototype, "children", {
83
- get: function () {
84
- return DriveItems(this, "children");
85
- },
86
- enumerable: false,
87
- configurable: true
88
- });
89
- _Root.prototype.search = function (query) {
90
- var searcher = this.clone(Root);
91
- searcher.query.set("search", "'" + query + "'");
92
- return searcher();
93
- };
94
- Object.defineProperty(_Root.prototype, "thumbnails", {
95
- get: function () {
96
- return this.clone(GraphQueryableCollection, "thumbnails");
97
- },
98
- enumerable: false,
99
- configurable: true
100
- });
101
- _Root = __decorate([
102
- defaultPath("root")
103
- ], _Root);
104
- return _Root;
105
- }(_GraphQueryableInstance));
106
- export { _Root };
107
- export var Root = graphInvokableFactory(_Root);
108
- /**
109
- * Describes a Drive Item instance
110
- *
111
- */
112
- var _DriveItem = /** @class */ (function (_super) {
113
- __extends(_DriveItem, _super);
114
- function _DriveItem() {
115
- return _super !== null && _super.apply(this, arguments) || this;
116
- }
117
- Object.defineProperty(_DriveItem.prototype, "children", {
118
- get: function () {
119
- return DriveItems(this, "children");
120
- },
121
- enumerable: false,
122
- configurable: true
123
- });
124
- Object.defineProperty(_DriveItem.prototype, "thumbnails", {
125
- get: function () {
126
- return this.clone(GraphQueryableCollection, "thumbnails");
127
- },
128
- enumerable: false,
129
- configurable: true
130
- });
131
- Object.defineProperty(_DriveItem.prototype, "versions", {
132
- get: function () {
133
- return this.clone(GraphQueryableCollection, "versions");
134
- },
135
- enumerable: false,
136
- configurable: true
137
- });
138
- _DriveItem.prototype.move = function (parentReference, name) {
139
- return graphPatch(this, body(assign(parentReference, { name: name })));
140
- };
141
- _DriveItem.prototype.getContent = function () {
142
- return __awaiter(this, void 0, void 0, function () {
143
- var info, r, p;
144
- return __generator(this, function (_a) {
145
- switch (_a.label) {
146
- case 0: return [4 /*yield*/, this.get()];
147
- case 1:
148
- info = _a.sent();
149
- return [4 /*yield*/, safeGlobal.fetch(info["@microsoft.graph.downloadUrl"], {
150
- headers: {
151
- "accept": "application/json",
152
- },
153
- method: "GET",
154
- responseType: "arraybuffer",
155
- })];
156
- case 2:
157
- r = _a.sent();
158
- p = new BlobParser();
159
- return [2 /*return*/, p.parse(r)];
160
- }
161
- });
162
- });
163
- };
164
- _DriveItem.prototype.setContent = function (content) {
165
- return graphPut(this.clone(DriveItem, "content"), {
166
- body: content,
167
- });
168
- };
169
- _DriveItem = __decorate([
170
- deleteable(),
171
- updateable()
172
- ], _DriveItem);
173
- return _DriveItem;
174
- }(_GraphQueryableInstance));
175
- export { _DriveItem };
176
- export var DriveItem = graphInvokableFactory(_DriveItem);
177
- /**
178
- * Describes a collection of Drive Item objects
179
- *
180
- */
181
- var _DriveItems = /** @class */ (function (_super) {
182
- __extends(_DriveItems, _super);
183
- function _DriveItems() {
184
- return _super !== null && _super.apply(this, arguments) || this;
185
- }
186
- _DriveItems = __decorate([
187
- getById(DriveItem)
188
- ], _DriveItems);
189
- return _DriveItems;
190
- }(_GraphQueryableCollection));
191
- export { _DriveItems };
192
- export var DriveItems = graphInvokableFactory(_DriveItems);
1
+ import { __awaiter, __decorate, __extends, __generator } from "tslib";
2
+ import { GraphQueryableInstance, GraphQueryableCollection, _GraphQueryableInstance, _GraphQueryableCollection, graphInvokableFactory, } from "../graphqueryable.js";
3
+ import { assign, combine, safeGlobal } from "@pnp/common";
4
+ import { defaultPath, getById, deleteable, updateable } from "../decorators.js";
5
+ import { body, BlobParser } from "@pnp/odata";
6
+ import { graphPatch, graphPost, graphPut } from "../operations.js";
7
+ /**
8
+ * Describes a Drive instance
9
+ *
10
+ */
11
+ var _Drive = /** @class */ (function (_super) {
12
+ __extends(_Drive, _super);
13
+ function _Drive() {
14
+ return _super !== null && _super.apply(this, arguments) || this;
15
+ }
16
+ Object.defineProperty(_Drive.prototype, "root", {
17
+ get: function () {
18
+ return Root(this);
19
+ },
20
+ enumerable: false,
21
+ configurable: true
22
+ });
23
+ Object.defineProperty(_Drive.prototype, "list", {
24
+ get: function () {
25
+ return this.clone(GraphQueryableInstance, "list");
26
+ },
27
+ enumerable: false,
28
+ configurable: true
29
+ });
30
+ Object.defineProperty(_Drive.prototype, "recent", {
31
+ get: function () {
32
+ return DriveItems(this, "recent");
33
+ },
34
+ enumerable: false,
35
+ configurable: true
36
+ });
37
+ Object.defineProperty(_Drive.prototype, "sharedWithMe", {
38
+ get: function () {
39
+ return DriveItems(this, "sharedWithMe");
40
+ },
41
+ enumerable: false,
42
+ configurable: true
43
+ });
44
+ _Drive.prototype.getItemById = function (id) {
45
+ return DriveItem(this, combine("items", id));
46
+ };
47
+ _Drive = __decorate([
48
+ defaultPath("drive")
49
+ ], _Drive);
50
+ return _Drive;
51
+ }(_GraphQueryableInstance));
52
+ export { _Drive };
53
+ export var Drive = graphInvokableFactory(_Drive);
54
+ /**
55
+ * Describes a collection of Drive objects
56
+ *
57
+ */
58
+ var _Drives = /** @class */ (function (_super) {
59
+ __extends(_Drives, _super);
60
+ function _Drives() {
61
+ return _super !== null && _super.apply(this, arguments) || this;
62
+ }
63
+ _Drives.prototype.getById = function (id) {
64
+ return Drive(this.getUrlBase(), "drives/" + id);
65
+ };
66
+ _Drives = __decorate([
67
+ defaultPath("drives")
68
+ ], _Drives);
69
+ return _Drives;
70
+ }(_GraphQueryableCollection));
71
+ export { _Drives };
72
+ export var Drives = graphInvokableFactory(_Drives);
73
+ /**
74
+ * Describes a Root instance
75
+ *
76
+ */
77
+ var _Root = /** @class */ (function (_super) {
78
+ __extends(_Root, _super);
79
+ function _Root() {
80
+ return _super !== null && _super.apply(this, arguments) || this;
81
+ }
82
+ Object.defineProperty(_Root.prototype, "children", {
83
+ get: function () {
84
+ return DriveItems(this, "children");
85
+ },
86
+ enumerable: false,
87
+ configurable: true
88
+ });
89
+ _Root.prototype.search = function (query) {
90
+ var searcher = this.clone(Root);
91
+ searcher.query.set("search", "'" + query + "'");
92
+ return searcher();
93
+ };
94
+ Object.defineProperty(_Root.prototype, "thumbnails", {
95
+ get: function () {
96
+ return this.clone(GraphQueryableCollection, "thumbnails");
97
+ },
98
+ enumerable: false,
99
+ configurable: true
100
+ });
101
+ _Root = __decorate([
102
+ defaultPath("root")
103
+ ], _Root);
104
+ return _Root;
105
+ }(_GraphQueryableInstance));
106
+ export { _Root };
107
+ export var Root = graphInvokableFactory(_Root);
108
+ /**
109
+ * Describes a Drive Item instance
110
+ *
111
+ */
112
+ var _DriveItem = /** @class */ (function (_super) {
113
+ __extends(_DriveItem, _super);
114
+ function _DriveItem() {
115
+ return _super !== null && _super.apply(this, arguments) || this;
116
+ }
117
+ Object.defineProperty(_DriveItem.prototype, "children", {
118
+ get: function () {
119
+ return DriveItems(this, "children");
120
+ },
121
+ enumerable: false,
122
+ configurable: true
123
+ });
124
+ Object.defineProperty(_DriveItem.prototype, "thumbnails", {
125
+ get: function () {
126
+ return this.clone(GraphQueryableCollection, "thumbnails");
127
+ },
128
+ enumerable: false,
129
+ configurable: true
130
+ });
131
+ Object.defineProperty(_DriveItem.prototype, "versions", {
132
+ get: function () {
133
+ return this.clone(GraphQueryableCollection, "versions");
134
+ },
135
+ enumerable: false,
136
+ configurable: true
137
+ });
138
+ _DriveItem.prototype.move = function (parentReference, name) {
139
+ return graphPatch(this, body(assign(parentReference, { name: name })));
140
+ };
141
+ _DriveItem.prototype.getContent = function () {
142
+ return __awaiter(this, void 0, void 0, function () {
143
+ var info, r, p;
144
+ return __generator(this, function (_a) {
145
+ switch (_a.label) {
146
+ case 0: return [4 /*yield*/, this.get()];
147
+ case 1:
148
+ info = _a.sent();
149
+ return [4 /*yield*/, safeGlobal.fetch(info["@microsoft.graph.downloadUrl"], {
150
+ headers: {
151
+ "accept": "application/json",
152
+ },
153
+ method: "GET",
154
+ responseType: "arraybuffer",
155
+ })];
156
+ case 2:
157
+ r = _a.sent();
158
+ p = new BlobParser();
159
+ return [2 /*return*/, p.parse(r)];
160
+ }
161
+ });
162
+ });
163
+ };
164
+ _DriveItem.prototype.setContent = function (content) {
165
+ return graphPut(this.clone(DriveItem, "content"), {
166
+ body: content,
167
+ });
168
+ };
169
+ _DriveItem = __decorate([
170
+ deleteable(),
171
+ updateable()
172
+ ], _DriveItem);
173
+ return _DriveItem;
174
+ }(_GraphQueryableInstance));
175
+ export { _DriveItem };
176
+ export var DriveItem = graphInvokableFactory(_DriveItem);
177
+ /**
178
+ * Describes a collection of Drive Item objects
179
+ *
180
+ */
181
+ var _DriveItems = /** @class */ (function (_super) {
182
+ __extends(_DriveItems, _super);
183
+ function _DriveItems() {
184
+ return _super !== null && _super.apply(this, arguments) || this;
185
+ }
186
+ _DriveItems_1 = _DriveItems;
187
+ _DriveItems.prototype.add = function (filename, content) {
188
+ return __awaiter(this, void 0, void 0, function () {
189
+ var parent, data;
190
+ return __generator(this, function (_a) {
191
+ switch (_a.label) {
192
+ case 0:
193
+ parent = this.getParent(_DriveItems_1);
194
+ parent.concat(":/" + filename + ":/content");
195
+ return [4 /*yield*/, graphPut(parent, { body: content })];
196
+ case 1:
197
+ data = _a.sent();
198
+ return [2 /*return*/, {
199
+ data: data,
200
+ driveItem: this.getById(data.id),
201
+ }];
202
+ }
203
+ });
204
+ });
205
+ };
206
+ /**
207
+ * Adds a folder to this collection of drive items
208
+ *
209
+ * @param name Name of the new folder
210
+ * @returns result with folder data and chainable drive item object
211
+ */
212
+ _DriveItems.prototype.addFolder = function (name) {
213
+ return __awaiter(this, void 0, void 0, function () {
214
+ var postBody, data;
215
+ return __generator(this, function (_a) {
216
+ switch (_a.label) {
217
+ case 0:
218
+ postBody = {
219
+ name: name,
220
+ folder: {},
221
+ "@microsoft.graph.conflictBehavior": "rename",
222
+ };
223
+ return [4 /*yield*/, graphPost(this, body(postBody))];
224
+ case 1:
225
+ data = _a.sent();
226
+ return [2 /*return*/, {
227
+ data: data,
228
+ driveItem: this.getById(data.id),
229
+ }];
230
+ }
231
+ });
232
+ });
233
+ };
234
+ var _DriveItems_1;
235
+ _DriveItems = _DriveItems_1 = __decorate([
236
+ getById(DriveItem)
237
+ ], _DriveItems);
238
+ return _DriveItems;
239
+ }(_GraphQueryableCollection));
240
+ export { _DriveItems };
241
+ export var DriveItems = graphInvokableFactory(_DriveItems);
193
242
  //# sourceMappingURL=types.js.map