-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.power
More file actions
161 lines (147 loc) · 4.55 KB
/
code.power
File metadata and controls
161 lines (147 loc) · 4.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/**
* Get an item
*
* @param string $guid The global unique id of the item
* @param array|null $order The search order
* @param object|null $repo The repository object to search. If null, all repos will be searched.
*
* @return object|null
* @since 3.2.2
*/
public function get(string $guid, ?array $order = null, ?object $repo = null): ?object;
/**
* Validate any repository
*
* @param object $repository The target repository object.
* @param object|null $networkTarget The network target name
*
* @return bool True if valid path
* @since 5.1.4
*/
public function validRepo(object &$repository, ?string $networkTarget): bool;
/**
* Resolve and validate entity GUID values.
*
* - Empty values are ignored.
* - If the entity uses a GUID field, each value is validated:
* - Valid GUIDs are accepted as-is.
* - Invalid GUIDs are resolved via a helper field when available.
* - If the entity does not use GUIDs, values are returned unchanged.
*
* @param array $values The values to resolve.
* @param object|null $repo The repository object to search. If null, all repositories are searched.
*
* @return array An array of valid GUID values.
* @since 5.1.4
*/
public function getValidGuids(array $values, ?object $repo): array;
/**
* Get the path/repo object
*
* @param string $guid The target repository guid.
*
* @return object|null
* @since 5.1.1
*/
public function getPath(string $guid): ?object;
/**
* Get all the available repos
*
* @return array|null
* @since 5.1.1
*/
public function getPaths(): ?array;
/**
* Get all paths + indexes (the active set)
*
* @return array|null
* @since 5.1.1
*/
public function getPathsIndexes(): ?array;
/**
* Get the a path + indexes
*
* @param string $guid The unique identifier for the repo.
* @param bool $reload The switch to reload the index, and not return from cache.
*
* @return object|null
* @since 5.1.1
*/
public function getPathIndexes(string $guid, bool $reload = false): ?object;
/**
* Get the index of a repo
*
* @param string $guid The unique identifier for the repo.
* @param bool $reload The switch to reload the index, and not return from cache.
*
* @return object|null
* @since 3.2.2
*/
public function getRemoteIndex(string $guid, bool $reload = false): ?object;
/**
* Reset the index of a entity
*
* @return void
* @since 5.1.2
*/
public function resetEntityIndex(): void;
/**
* Get the network target name
*
* @return string|null
* @since 5.1.1
*/
public function getNetworkTarget(): ?string;
/**
* Check if an item exists in any repo or in a specific repo.
*
* @param string $guid The unique identifier for the item.
* @param object|null $repo The repository object to check against. If null, all repos will be checked.
* @param array|null $order The order of the targets to check. If null, the default order will be used.
*
* @return bool True if the item exists, false otherwise.
* @since 3.2.2
*/
public function exists(string $guid, ?object $repo = null, ?array $order = null): bool;
/**
* Set the branch field
*
* @param string $field The field to use to get the branch name from the data set
*
* @return void
* @since 3.2.2
*/
public function setBranchField(string $field): void;
/**
* Set the DEFAULT branch name (only used if branch field is not found)
*
* @param string|null $name The default branch to use if no name could be found
*
* @return void
* @since 3.2.2
*/
public function setBranchDefaultName(?string $name): void;
/**
* Set the index path
*
* @param string $indexPath The repository index path
*
* @return void
* @since 3.2.2
*/
public function setIndexPath(string $indexPath): void;
/**
* Loads API config using the provided base URL and token.
*
* This method checks if the base URL contains 'https://git.vdm.dev/'.
* If it does, it uses the token as is (which may be null).
* If not, it ensures the token is not null by defaulting to an empty string.
*
* @param Api $api The api object with a load_ method.
* @param string|null $base The base URL path.
* @param string|null $token The token for authentication (can be null).
*
* @return void
* @since 5.0.4
*/
public function loadApi(Api $api, ?string $base, ?string $token): void;