gd-sprest-def 1.2.8 → 1.2.9

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.
@@ -1,22 +1,24 @@
1
1
  import { IBaseExecution } from "../../base";
2
+ import * as EntityTypes from "./entityTypes.d"
3
+
2
4
  /*********************************************
3
5
  * invitations
4
6
  **********************************************/
5
7
  export interface invitations extends IBaseExecution<EntityTypes.invitation> {
6
- invitedUser: () => IBaseExecution<users>;
8
+ invitedUser: () => IBaseExecution<EntityTypes.user[]>;
7
9
  }
8
10
  /*********************************************
9
11
  * users
10
12
  **********************************************/
11
13
  export interface users extends IBaseExecution<EntityTypes.user> {
12
- createdObjects: () => IBaseExecution<directoryObjects>;
13
- directReports: () => IBaseExecution<directoryObjects>;
14
- manager: () => IBaseExecution<directoryObjects>;
15
- memberOf: () => IBaseExecution<directoryObjects>;
16
- ownedDevices: () => IBaseExecution<directoryObjects>;
17
- ownedObjects: () => IBaseExecution<directoryObjects>;
18
- registeredDevices: () => IBaseExecution<directoryObjects>;
19
- transitiveMemberOf: () => IBaseExecution<directoryObjects>;
14
+ createdObjects: () => IBaseExecution<EntityTypes.directoryObject[]>;
15
+ directReports: () => IBaseExecution<EntityTypes.directoryObject[]>;
16
+ manager: () => IBaseExecution<EntityTypes.directoryObject[]>;
17
+ memberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
18
+ ownedDevices: () => IBaseExecution<EntityTypes.directoryObject[]>;
19
+ ownedObjects: () => IBaseExecution<EntityTypes.directoryObject[]>;
20
+ registeredDevices: () => IBaseExecution<EntityTypes.directoryObject[]>;
21
+ transitiveMemberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
20
22
  }
21
23
  /*********************************************
22
24
  * applicationTemplates
@@ -40,8 +42,8 @@ export interface identityProviders extends IBaseExecution<EntityTypes.identityPr
40
42
  * applications
41
43
  **********************************************/
42
44
  export interface applications extends IBaseExecution<EntityTypes.application> {
43
- createdOnBehalfOf: () => IBaseExecution<directoryObjects>;
44
- owners: () => IBaseExecution<directoryObjects>;
45
+ createdOnBehalfOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
46
+ owners: () => IBaseExecution<EntityTypes.directoryObject[]>;
45
47
  }
46
48
  /*********************************************
47
49
  * certificateBasedAuthConfiguration
@@ -53,10 +55,10 @@ export interface certificateBasedAuthConfiguration extends IBaseExecution<Entity
53
55
  * contacts
54
56
  **********************************************/
55
57
  export interface contacts extends IBaseExecution<EntityTypes.orgContact> {
56
- directReports: () => IBaseExecution<directoryObjects>;
57
- manager: () => IBaseExecution<directoryObjects>;
58
- memberOf: () => IBaseExecution<directoryObjects>;
59
- transitiveMemberOf: () => IBaseExecution<directoryObjects>;
58
+ directReports: () => IBaseExecution<EntityTypes.directoryObject[]>;
59
+ manager: () => IBaseExecution<EntityTypes.directoryObject[]>;
60
+ memberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
61
+ transitiveMemberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
60
62
  }
61
63
  /*********************************************
62
64
  * contracts
@@ -68,9 +70,9 @@ export interface contracts extends IBaseExecution<EntityTypes.contract> {
68
70
  * devices
69
71
  **********************************************/
70
72
  export interface devices extends IBaseExecution<EntityTypes.device> {
71
- registeredOwners: () => IBaseExecution<directoryObjects>;
72
- registeredUsers: () => IBaseExecution<directoryObjects>;
73
- transitiveMemberOf: () => IBaseExecution<directoryObjects>;
73
+ registeredOwners: () => IBaseExecution<EntityTypes.directoryObject[]>;
74
+ registeredUsers: () => IBaseExecution<EntityTypes.directoryObject[]>;
75
+ transitiveMemberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
74
76
  }
75
77
  /*********************************************
76
78
  * directoryObjects
@@ -82,7 +84,7 @@ export interface directoryObjects extends IBaseExecution<EntityTypes.directoryOb
82
84
  * directoryRoles
83
85
  **********************************************/
84
86
  export interface directoryRoles extends IBaseExecution<EntityTypes.directoryRole> {
85
- members: () => IBaseExecution<directoryObjects>;
87
+ members: () => IBaseExecution<EntityTypes.directoryObject[]>;
86
88
  }
87
89
  /*********************************************
88
90
  * directoryRoleTemplates
@@ -100,18 +102,18 @@ export interface domainDnsRecords extends IBaseExecution<EntityTypes.domainDnsRe
100
102
  * domains
101
103
  **********************************************/
102
104
  export interface domains extends IBaseExecution<EntityTypes.domain> {
103
- domainNameReferences: () => IBaseExecution<directoryObjects>;
105
+ domainNameReferences: () => IBaseExecution<EntityTypes.directoryObject[]>;
104
106
  }
105
107
  /*********************************************
106
108
  * groups
107
109
  **********************************************/
108
110
  export interface groups extends IBaseExecution<EntityTypes.group> {
109
- createdOnBehalfOf: () => IBaseExecution<directoryObjects>;
110
- memberOf: () => IBaseExecution<directoryObjects>;
111
- members: () => IBaseExecution<directoryObjects>;
112
- owners: () => IBaseExecution<directoryObjects>;
113
- transitiveMemberOf: () => IBaseExecution<directoryObjects>;
114
- transitiveMembers: () => IBaseExecution<directoryObjects>;
111
+ createdOnBehalfOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
112
+ memberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
113
+ members: () => IBaseExecution<EntityTypes.directoryObject[]>;
114
+ owners: () => IBaseExecution<EntityTypes.directoryObject[]>;
115
+ transitiveMemberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
116
+ transitiveMembers: () => IBaseExecution<EntityTypes.directoryObject[]>;
115
117
  }
116
118
  /*********************************************
117
119
  * groupSettings
@@ -159,12 +161,12 @@ export interface scopedRoleMemberships extends IBaseExecution<EntityTypes.scoped
159
161
  * servicePrincipals
160
162
  **********************************************/
161
163
  export interface servicePrincipals extends IBaseExecution<EntityTypes.servicePrincipal> {
162
- createdObjects: () => IBaseExecution<directoryObjects>;
163
- memberOf: () => IBaseExecution<directoryObjects>;
164
+ createdObjects: () => IBaseExecution<EntityTypes.directoryObject[]>;
165
+ memberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
164
166
  oauth2PermissionGrants: () => IBaseExecution<oauth2PermissionGrants>;
165
- ownedObjects: () => IBaseExecution<directoryObjects>;
166
- owners: () => IBaseExecution<directoryObjects>;
167
- transitiveMemberOf: () => IBaseExecution<directoryObjects>;
167
+ ownedObjects: () => IBaseExecution<EntityTypes.directoryObject[]>;
168
+ owners: () => IBaseExecution<EntityTypes.directoryObject[]>;
169
+ transitiveMemberOf: () => IBaseExecution<EntityTypes.directoryObject[]>;
168
170
  }
169
171
  /*********************************************
170
172
  * subscribedSkus
@@ -194,8 +196,8 @@ export interface shares extends IBaseExecution<EntityTypes.sharedDriveItem> {
194
196
  * sites
195
197
  **********************************************/
196
198
  export interface sites extends IBaseExecution<EntityTypes.site> {
197
- parentTerm: () => IBaseExecution<terms>;
198
- termSet: () => IBaseExecution<sets>;
199
+ parentTerm: () => IBaseExecution<EntityTypes.term[]>;
200
+ termSet: () => IBaseExecution<EntityTypes.set[]>;
199
201
  sharedColumns: () => IBaseExecution<columns>;
200
202
  welcomePageColumns: () => IBaseExecution<columns>;
201
203
  }
@@ -251,8 +253,8 @@ export interface chats extends IBaseExecution<EntityTypes.chat> {
251
253
  * teams
252
254
  **********************************************/
253
255
  export interface teams extends IBaseExecution<EntityTypes.team> {
254
- group: () => IBaseExecution<groups>;
255
- template: () => IBaseExecution<teamsTemplates>;
256
+ group: () => IBaseExecution<EntityTypes.group[]>;
257
+ template: () => IBaseExecution<EntityTypes.teamsTemplate[]>;
256
258
  }
257
259
  /*********************************************
258
260
  * teamsTemplates
package/main.js CHANGED
@@ -74,8 +74,8 @@ function applyMethodsToDirectories(methods, directories) {
74
74
  let idx = name.lastIndexOf('.');
75
75
 
76
76
  // Set the lib and obj name
77
- let lib = name.substr(0, idx);
78
- let obj = name.substr(idx + 1);
77
+ let lib = name.substring(0, idx);
78
+ let obj = name.substring(idx + 1);
79
79
 
80
80
  // See if a file name exists for this object
81
81
  if (directories[lib] && directories[lib].EntityTypes && directories[lib].EntityTypes[obj]) {
@@ -267,7 +267,7 @@ function updateReferences(fileImports, dirName, type) {
267
267
  if (type && type.indexOf('.') > 0) {
268
268
  // Get the last index of it
269
269
  let refType = type.replace(/^Array\<|\>$/g, '');
270
- refType = refType.substr(0, refType.lastIndexOf('.'));
270
+ refType = refType.substring(0, refType.lastIndexOf('.'));
271
271
 
272
272
  // Set the root namespace
273
273
  let root = refType.split('.')[0];
@@ -400,7 +400,6 @@ function processGraph(schemas) {
400
400
  returnType = returnTypeInfo[returnTypeInfo.length - 1];
401
401
  }
402
402
 
403
-
404
403
  // Add the method
405
404
  methods.push({ name, returnType });
406
405
  }
@@ -507,7 +506,7 @@ function processGraph(schemas) {
507
506
  let name2 = null;
508
507
  if (!isCollection && name[name.length - 1] == "s") {
509
508
  // Set the name
510
- name2 = name.substring(name.length - 1);
509
+ name2 = name.substring(0, name.length - 1);
511
510
  }
512
511
 
513
512
  // See if it's a complex type
@@ -555,7 +554,10 @@ function processGraph(schemas) {
555
554
  if (fs.existsSync("lib/microsoft/Graph") == false) { fs.mkdirSync("lib/microsoft/Graph"); }
556
555
 
557
556
  // Create the endpoints
558
- let content = ["import { IBaseExecution } from \"../../base\";"];
557
+ let content = [
558
+ "import { IBaseExecution } from \"../../base\";",
559
+ "import * as EntityTypes from \"./entityTypes.d\"\n"
560
+ ];
559
561
  for (let name in endPoints) {
560
562
  let endPoint = endPoints[name];
561
563
 
@@ -889,7 +891,7 @@ function processREST(schemas) {
889
891
  else if (hasMethods[endpoint.ReturnType]) {
890
892
  // Update the return type
891
893
  let idx = endpoint.ReturnType.lastIndexOf('.');
892
- endpoint.ReturnType = endpoint.ReturnType.substr(0, idx) + '.I' + endpoint.ReturnType.substr(idx + 1);
894
+ endpoint.ReturnType = endpoint.ReturnType.substring(0, idx) + '.I' + endpoint.ReturnType.substring(idx + 1);
893
895
  }
894
896
 
895
897
  // Update the imports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-sprest-def",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "TypeScript definition files generated from the $metadata REST endpoint in SharePoint.",
5
5
  "author": "Gunjan Datta <me@dattabase.com> (https://gunjandatta.github.io)",
6
6
  "license": "MIT",