Skip to content

Commit 5de8156

Browse files
committed
Model updated to 16.0.25409.12005 version, a a few generator fixes
1 parent e730592 commit 5de8156

24 files changed

+1594
-347
lines changed

generator/Builders/TemplateContext.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
namespace Office365\Generator\Builders;
44

55
use PhpParser\Node;
6+
use PhpParser\Node\Identifier;
67
use PhpParser\NodeFinder;
78
use PhpParser\NodeTraverser;
89
use PhpParser\NodeVisitorAbstract;
910
use PhpParser\ParserFactory;
11+
use PhpParser\PhpVersion;
1012

1113
class TemplateContext extends NodeVisitorAbstract
1214
{
@@ -86,7 +88,7 @@ private function findNodeByName($nodes, $name){
8688

8789
private function parseTemplate($fileName){
8890
$template = file_get_contents($fileName);
89-
$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP5);
91+
$parser = (new ParserFactory)->createForVersion(PhpVersion::fromString("7.1"));
9092
return $parser->parse($template);
9193
}
9294

@@ -96,22 +98,24 @@ public function enterNode(Node $origNode)
9698
$node = $origNode;
9799
if($node instanceof Node\Stmt\Namespace_){
98100
if($node->name instanceof Node\Name){
99-
$node->name->parts = explode("\\",$this->values['namespace']);
101+
//$node->name->parts = explode("\\",$this->values['namespace']);
102+
$node->name = new Node\Name($this->values['namespace']);
100103
}
101104
}
102105
elseif ($node instanceof Node\Stmt\Class_) {
103106
if(isset($this->values['class']))
104-
$node->name = $this->values['class'];
107+
$node->name = new Identifier($this->values['class']);
105108
}
106109
elseif ($node instanceof Node\Stmt\ClassMethod) {
107-
$node->name = $this->values['function'];
110+
$node->name = new Identifier($this->values['function']);
108111
}
109112
elseif ($node instanceof Node\Name) {
110113
/*if($node->parts[0] === "ClientObject" && count($node->parts) > 1) {
111114
$node->parts[0] = $this->values['property'];
112115
}*/
113-
if($node->parts[0] === "ClientObject" && isset($this->values['type'])) {
114-
$node->parts[0] = $this->values['type'];
116+
if($node->getParts()[0] === "ClientObject" && isset($this->values['type'])) {
117+
//$node->parts[0] = $this->values['type'];
118+
$node->name = $this->values['type'];
115119
}
116120
}
117121
elseif ($node instanceof Node\Scalar\String_){

generator/Builders/TypeBuilder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PhpParser\NodeTraverser;
77
use PhpParser\NodeVisitorAbstract;
88
use PhpParser\ParserFactory;
9+
use PhpParser\PhpVersion;
910
use PhpParser\PrettyPrinter;
1011

1112

@@ -65,7 +66,8 @@ public function build(TemplateContext $template)
6566

6667
if ($this->typeSchema['state'] === "attached") {
6768
$code = file_get_contents($this->typeSchema['file']);
68-
$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP5);
69+
//$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP5);
70+
$parser = (new ParserFactory)->createForVersion(PhpVersion::fromString("7.1"));
6971
$this->typeNode = $parser->parse($code);
7072
}
7173
else {
@@ -98,14 +100,14 @@ public function enterNode(Node $node) {
98100
}
99101

100102
//build function nodes
101-
$funcBuilder = new FunctionBuilder();
103+
/*$funcBuilder = new FunctionBuilder();
102104
if(isset($this->typeSchema['functions'])){
103105
foreach($this->typeSchema['functions'] as $funcSchema){
104106
if ($funcSchema['state'] === "detached"){
105107
//$node->stmts[] = $funcBuilder->build($template);
106108
}
107109
}
108-
}
110+
}*/
109111
}
110112
}
111113

generator/Settings.SharePoint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"docsRoot": "https:\/\/docs.microsoft.com\/en-us\/openspecs\/sharepoint_protocols\/ms-csomspt\/",
77
"rootNamespace": "Office365\\SharePoint",
88
"entityRootNamespace": "SP",
9-
"version": "16.0.24922.12004",
10-
"timestamp": "2024-06-08T09:12:30+00:00",
9+
"version": "16.0.25409.12005",
10+
"timestamp": "2024-10-28T19:21:18+00:00",
1111
"placeholder": "Generated ",
1212
"typeMappings": {
1313
"SP.List": "SP.SPList",

generator/metadata/SharePoint.xml

Lines changed: 1103 additions & 77 deletions
Large diffs are not rendered by default.

src/SharePoint/AgreementAttributeDTO.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Generated 2024-06-08T09:12:30+00:00 16.0.24922.12004
4+
* Generated 2024-10-28T18:15:51+00:00 16.0.25409.12005
55
*/
66
namespace Office365\SharePoint;
77

@@ -16,4 +16,20 @@ class AgreementAttributeDTO extends ClientValue
1616
* @var string
1717
*/
1818
public $ReviewSubmissionDate;
19+
/**
20+
* @var string
21+
*/
22+
public $ReviewCompleteDate;
23+
/**
24+
* @var UserDTO
25+
*/
26+
public $Reviewer;
27+
/**
28+
* @var string
29+
*/
30+
public $ReviewStartDate;
31+
/**
32+
* @var integer
33+
*/
34+
public $State;
1935
}

src/SharePoint/AgreementReportBaseData.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Generated 2024-04-20T08:07:39+00:00 16.0.24803.12007
4+
* Generated 2024-10-28T19:09:39+00:00 16.0.25409.12005
55
*/
66
namespace Office365\SharePoint;
77

@@ -20,4 +20,8 @@ class AgreementReportBaseData extends ClientValue
2020
* @var integer
2121
*/
2222
public $NearExpiration;
23+
/**
24+
* @var string
25+
*/
26+
public $ErrorMessage;
2327
}

src/SharePoint/ApprovalsCreateRequestParameters.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Generated 2024-02-24T10:21:51+00:00 16.0.24607.12008
4+
* Generated 2024-10-28T19:09:39+00:00 16.0.25409.12005
55
*/
66
namespace Office365\SharePoint;
77

@@ -48,4 +48,8 @@ class ApprovalsCreateRequestParameters extends ClientValue
4848
* @var integer
4949
*/
5050
public $itemUrlType;
51+
/**
52+
* @var bool
53+
*/
54+
public $markDocAsFinal;
5155
}

src/SharePoint/BrandCenterConfiguration.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Generated 2024-06-08T09:12:30+00:00 16.0.24922.12004
4+
* Generated 2024-10-28T18:15:51+00:00 16.0.25409.12005
55
*/
66
namespace Office365\SharePoint;
77

@@ -32,4 +32,12 @@ class BrandCenterConfiguration extends ClientValue
3232
* @var SPResourcePath
3333
*/
3434
public $BrandFontLibraryUrl;
35+
/**
36+
* @var string
37+
*/
38+
public $BrandColorsListId;
39+
/**
40+
* @var SPResourcePath
41+
*/
42+
public $BrandColorsListUrl;
3543
}

src/SharePoint/ConfiguredUserInfo.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Generated 2024-04-20T08:07:39+00:00 16.0.24803.12007
4+
* Generated 2024-10-28T19:09:39+00:00 16.0.25409.12005
55
*/
66
namespace Office365\SharePoint;
77

@@ -24,4 +24,8 @@ class ConfiguredUserInfo extends ClientValue
2424
* @var integer
2525
*/
2626
public $UserId;
27+
/**
28+
* @var string
29+
*/
30+
public $ProfilePicUrl;
2731
}

src/SharePoint/DeviationAnalysisRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Generated 2024-04-20T08:07:39+00:00 16.0.24803.12007
4+
* Generated 2024-10-28T19:09:39+00:00 16.0.25409.12005
55
*/
66
namespace Office365\SharePoint;
77

@@ -36,4 +36,8 @@ class DeviationAnalysisRule extends ClientValue
3636
* @var bool
3737
*/
3838
public $SendForApproval;
39+
/**
40+
* @var string
41+
*/
42+
public $SnippetPath;
3943
}

0 commit comments

Comments
 (0)