@placeos/ts-client 4.5.0 → 4.7.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.
- package/dist/alerts/functions.d.ts +7 -10
- package/dist/alerts/interfaces.d.ts +22 -0
- package/dist/api.d.ts +32 -19
- package/dist/applications/functions.d.ts +2 -5
- package/dist/applications/interfaces.d.ts +5 -11
- package/dist/assets/assets.class.d.ts +62 -0
- package/dist/assets/functions.d.ts +146 -0
- package/dist/assets/interfaces.d.ts +38 -0
- package/dist/clusters/functions.d.ts +16 -7
- package/dist/clusters/interfaces.d.ts +18 -3
- package/dist/domains/functions.d.ts +10 -6
- package/dist/drivers/functions.d.ts +3 -5
- package/dist/drivers/interfaces.d.ts +9 -7
- package/dist/edge/functions.d.ts +8 -7
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2695 -2081
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/ldap-sources/functions.d.ts +2 -5
- package/dist/metadata/functions.d.ts +8 -9
- package/dist/metadata/interfaces.d.ts +18 -4
- package/dist/modules/functions.d.ts +10 -4
- package/dist/modules/interfaces.d.ts +14 -12
- package/dist/oauth-sources/functions.d.ts +2 -5
- package/dist/repositories/functions.d.ts +17 -29
- package/dist/repositories/interfaces.d.ts +31 -3
- package/dist/resources/interface.d.ts +9 -4
- package/dist/saml-sources/functions.d.ts +4 -7
- package/dist/settings/functions.d.ts +6 -8
- package/dist/settings/interfaces.d.ts +7 -0
- package/dist/short-url/functions.d.ts +60 -0
- package/dist/short-url/interfaces.d.ts +22 -0
- package/dist/short-url/short-url.class.d.ts +17 -0
- package/dist/signage/interfaces.d.ts +9 -1
- package/dist/storages/functions.d.ts +31 -0
- package/dist/storages/interfaces.d.ts +6 -0
- package/dist/storages/storage.class.d.ts +18 -0
- package/dist/systems/functions.d.ts +38 -10
- package/dist/systems/interfaces.d.ts +58 -5
- package/dist/triggers/functions.d.ts +5 -7
- package/dist/triggers/interfaces.d.ts +9 -0
- package/dist/users/functions.d.ts +50 -10
- package/dist/users/interfaces.d.ts +35 -2
- package/dist/webrtc/functions.d.ts +52 -0
- package/dist/webrtc/interfaces.d.ts +73 -0
- package/dist/zones/functions.d.ts +12 -6
- package/dist/zones/interfaces.d.ts +9 -4
- package/package.json +1 -1
- package/src/alerts/functions.ts +14 -22
- package/src/alerts/interfaces.ts +25 -0
- package/src/api.ts +148 -3
- package/src/applications/functions.ts +4 -7
- package/src/applications/interfaces.ts +6 -12
- package/src/assets/assets.class.ts +123 -0
- package/src/assets/functions.ts +440 -0
- package/src/assets/interfaces.ts +41 -0
- package/src/clusters/functions.ts +39 -8
- package/src/clusters/interfaces.ts +21 -3
- package/src/domains/functions.ts +17 -6
- package/src/drivers/functions.ts +4 -6
- package/src/drivers/interfaces.ts +11 -7
- package/src/edge/functions.ts +18 -10
- package/src/ldap-sources/functions.ts +4 -7
- package/src/metadata/functions.ts +16 -10
- package/src/metadata/interfaces.ts +20 -4
- package/src/modules/functions.ts +29 -7
- package/src/modules/interfaces.ts +15 -12
- package/src/oauth-sources/functions.ts +4 -7
- package/src/repositories/functions.ts +35 -35
- package/src/repositories/interfaces.ts +35 -3
- package/src/resources/interface.ts +9 -4
- package/src/saml-sources/functions.ts +6 -9
- package/src/settings/functions.ts +14 -10
- package/src/settings/interfaces.ts +8 -0
- package/src/short-url/functions.ts +155 -0
- package/src/short-url/interfaces.ts +25 -0
- package/src/short-url/short-url.class.ts +33 -0
- package/src/signage/interfaces.ts +10 -1
- package/src/storages/functions.ts +88 -0
- package/src/storages/interfaces.ts +7 -0
- package/src/storages/storage.class.ts +34 -0
- package/src/systems/functions.ts +113 -13
- package/src/systems/interfaces.ts +65 -5
- package/src/triggers/functions.ts +9 -8
- package/src/triggers/interfaces.ts +10 -0
- package/src/users/functions.ts +104 -9
- package/src/users/interfaces.ts +40 -2
- package/src/webrtc/functions.ts +120 -0
- package/src/webrtc/interfaces.ts +77 -0
- package/src/zones/functions.ts +28 -7
- package/src/zones/interfaces.ts +10 -4
package/src/edge/functions.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { apiEndpoint } from '../auth/functions';
|
|
1
2
|
import { PlaceAuthSourceQueryOptions } from '../auth-sources/interfaces';
|
|
2
3
|
import {
|
|
3
4
|
create,
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
task,
|
|
8
9
|
update,
|
|
9
10
|
} from '../resources/functions';
|
|
10
|
-
import { HashMap } from '../utilities/types';
|
|
11
11
|
import { PlaceEdge } from './edge';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -31,10 +31,9 @@ export function queryEdges(query_params: PlaceAuthSourceQueryOptions = {}) {
|
|
|
31
31
|
/**
|
|
32
32
|
* Get the data for an Edge
|
|
33
33
|
* @param id ID of the Edge to retrieve
|
|
34
|
-
* @param query_params Query parameters to add the to request URL
|
|
35
34
|
*/
|
|
36
|
-
export function showEdge(id: string
|
|
37
|
-
return show({ id, query_params, fn: process, path: PATH });
|
|
35
|
+
export function showEdge(id: string) {
|
|
36
|
+
return show({ id, query_params: {}, fn: process, path: PATH });
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
/**
|
|
@@ -71,23 +70,32 @@ export function addEdge(form_data: Partial<PlaceEdge>) {
|
|
|
71
70
|
/**
|
|
72
71
|
* Remove an Edge node from the database
|
|
73
72
|
* @param id ID of the Edge
|
|
74
|
-
* @param query_params Query parameters to add the to request URL
|
|
75
73
|
*/
|
|
76
|
-
export function removeEdge(id: string
|
|
77
|
-
return remove({ id, query_params, path: PATH });
|
|
74
|
+
export function removeEdge(id: string) {
|
|
75
|
+
return remove({ id, query_params: {}, path: PATH });
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
/**
|
|
81
79
|
* Generate token for Edge connection
|
|
82
80
|
* @param id ID of the Edge
|
|
83
|
-
* @param query_params Query parameters to add the to request URL
|
|
84
81
|
*/
|
|
85
|
-
export function retrieveEdgeToken(id: string
|
|
82
|
+
export function retrieveEdgeToken(id: string) {
|
|
86
83
|
return task<{ token: string }>({
|
|
87
84
|
id,
|
|
88
85
|
task_name: 'token',
|
|
89
|
-
form_data:
|
|
86
|
+
form_data: {},
|
|
90
87
|
method: 'get',
|
|
91
88
|
path: PATH,
|
|
92
89
|
});
|
|
93
90
|
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get the edge control websocket URL.
|
|
94
|
+
* This is the endpoint that edge devices use to connect to the cluster.
|
|
95
|
+
*/
|
|
96
|
+
export function edgeControlUrl(): string {
|
|
97
|
+
const endpoint = apiEndpoint();
|
|
98
|
+
const wsProtocol = endpoint.startsWith('https') ? 'wss:' : 'ws:';
|
|
99
|
+
const httpProtocol = endpoint.startsWith('https') ? 'https:' : 'http:';
|
|
100
|
+
return endpoint.replace(httpProtocol, wsProtocol) + `${PATH}/control`;
|
|
101
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlaceAuthSourceQueryOptions } from '../auth-sources/interfaces';
|
|
2
2
|
import { create, query, remove, show, update } from '../resources/functions';
|
|
3
|
-
import { HashMap } from '../utilities/types';
|
|
4
3
|
import { PlaceLDAPSource } from './ldap-source';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -26,10 +25,9 @@ export function queryLDAPSources(
|
|
|
26
25
|
/**
|
|
27
26
|
* Get the data for an LDAP source
|
|
28
27
|
* @param id ID of the LDAP source to retrieve
|
|
29
|
-
* @param query_params Query parameters to add the to request URL
|
|
30
28
|
*/
|
|
31
|
-
export function showLDAPSource(id: string
|
|
32
|
-
return show({ id, query_params, fn: process, path: PATH });
|
|
29
|
+
export function showLDAPSource(id: string) {
|
|
30
|
+
return show({ id, query_params: {}, fn: process, path: PATH });
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
/**
|
|
@@ -66,8 +64,7 @@ export function addLDAPSource(form_data: Partial<PlaceLDAPSource>) {
|
|
|
66
64
|
/**
|
|
67
65
|
* Remove an LDAP source from the database
|
|
68
66
|
* @param id ID of the LDAP source
|
|
69
|
-
* @param query_params Query parameters to add the to request URL
|
|
70
67
|
*/
|
|
71
|
-
export function removeLDAPSource(id: string
|
|
72
|
-
return remove({ id, query_params, path: PATH });
|
|
68
|
+
export function removeLDAPSource(id: string) {
|
|
69
|
+
return remove({ id, query_params: {}, path: PATH });
|
|
73
70
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { create, remove, show, task, update } from '../resources/functions';
|
|
3
3
|
import { HashMap } from '../utilities/types';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
PlaceMetadataDeleteOptions,
|
|
6
|
+
PlaceMetadataHistoryOptions,
|
|
7
|
+
PlaceMetadataOptions,
|
|
8
|
+
PlaceZoneMetadataOptions,
|
|
9
|
+
} from './interfaces';
|
|
5
10
|
import { PlaceMetadata } from './metadata';
|
|
6
11
|
import { PlaceZoneMetadata } from './zone-metadata';
|
|
7
12
|
|
|
@@ -22,7 +27,7 @@ function process(item: Partial<PlaceMetadata>) {
|
|
|
22
27
|
*/
|
|
23
28
|
export function listMetadata(
|
|
24
29
|
id: string,
|
|
25
|
-
query_params:
|
|
30
|
+
query_params: PlaceMetadataOptions = {},
|
|
26
31
|
): Observable<PlaceMetadata[]> {
|
|
27
32
|
return show({
|
|
28
33
|
id,
|
|
@@ -53,11 +58,11 @@ function flatten<T = any>(an_array: T[]): T {
|
|
|
53
58
|
/**
|
|
54
59
|
* List the metadata history for a database item
|
|
55
60
|
* @param id ID of the item to retrieve metadata
|
|
56
|
-
* @param
|
|
61
|
+
* @param query_params Query parameters to add to the request URL.
|
|
57
62
|
*/
|
|
58
63
|
export function listMetadataHistory(
|
|
59
64
|
id: string,
|
|
60
|
-
query_params:
|
|
65
|
+
query_params: PlaceMetadataHistoryOptions = {},
|
|
61
66
|
): Observable<PlaceMetadata[]> {
|
|
62
67
|
return task({
|
|
63
68
|
id,
|
|
@@ -78,16 +83,14 @@ export function listMetadataHistory(
|
|
|
78
83
|
* Get a metadata field for a database item
|
|
79
84
|
* @param id ID of the item to retrieve metadata
|
|
80
85
|
* @param name Name of the metadata field to retrieve
|
|
81
|
-
* @param query_params Query parameters to add the to request URL.
|
|
82
86
|
*/
|
|
83
87
|
export function showMetadata(
|
|
84
88
|
id: string,
|
|
85
89
|
name: string,
|
|
86
|
-
query_params: HashMap = {},
|
|
87
90
|
): Observable<PlaceMetadata> {
|
|
88
91
|
return show({
|
|
89
92
|
id,
|
|
90
|
-
query_params: {
|
|
93
|
+
query_params: { name },
|
|
91
94
|
fn: (data: HashMap) => process(data[name]),
|
|
92
95
|
path: PATH,
|
|
93
96
|
});
|
|
@@ -120,11 +123,14 @@ export function addMetadata(form_data: Partial<PlaceMetadata>) {
|
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
/**
|
|
123
|
-
* Remove
|
|
126
|
+
* Remove metadata from the database
|
|
124
127
|
* @param id ID of the item associated with the metadata
|
|
125
|
-
* @param query_params Query parameters
|
|
128
|
+
* @param query_params Query parameters including the metadata key name (required)
|
|
126
129
|
*/
|
|
127
|
-
export function removeMetadata(
|
|
130
|
+
export function removeMetadata(
|
|
131
|
+
id: string,
|
|
132
|
+
query_params: PlaceMetadataDeleteOptions,
|
|
133
|
+
) {
|
|
128
134
|
return remove({ id, query_params, path: PATH });
|
|
129
135
|
}
|
|
130
136
|
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
/** Query param options for getting
|
|
1
|
+
/** Query param options for getting metadata */
|
|
2
2
|
export interface PlaceMetadataOptions {
|
|
3
|
-
/**
|
|
3
|
+
/** The name of the metadata key to return */
|
|
4
4
|
name?: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
/** Query param options for deleting metadata */
|
|
8
|
+
export interface PlaceMetadataDeleteOptions {
|
|
9
|
+
/** The name of the metadata key to delete (required) */
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
/** Query param options for getting child metadata */
|
|
8
14
|
export interface PlaceZoneMetadataOptions extends PlaceMetadataOptions {
|
|
9
|
-
/**
|
|
10
|
-
|
|
15
|
+
/** Include parent metadata in the results (included by default) */
|
|
16
|
+
include_parent?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Query param options for getting metadata history */
|
|
20
|
+
export interface PlaceMetadataHistoryOptions {
|
|
21
|
+
/** The name of the metadata key */
|
|
22
|
+
name?: string;
|
|
23
|
+
/** Maximum number of results to return */
|
|
24
|
+
limit?: number;
|
|
25
|
+
/** Starting offset of the result set for pagination */
|
|
26
|
+
offset?: number;
|
|
11
27
|
}
|
package/src/modules/functions.ts
CHANGED
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
} from '../resources/functions';
|
|
10
10
|
import { PlaceSettings } from '../settings/settings';
|
|
11
11
|
import { HashMap } from '../utilities/types';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
PlaceModulePingOptions,
|
|
14
|
+
PlaceModuleQueryOptions,
|
|
15
|
+
PlaceModuleShowOptions,
|
|
16
|
+
} from './interfaces';
|
|
13
17
|
import { PlaceModule } from './module';
|
|
14
18
|
|
|
15
19
|
/**
|
|
@@ -35,7 +39,7 @@ export function queryModules(query_params: PlaceModuleQueryOptions = {}) {
|
|
|
35
39
|
* @param id ID of the module to retrieve
|
|
36
40
|
* @param query_params Query parameters to add the to request URL
|
|
37
41
|
*/
|
|
38
|
-
export function showModule(id: string, query_params:
|
|
42
|
+
export function showModule(id: string, query_params: PlaceModuleShowOptions = {}) {
|
|
39
43
|
return show({ id, query_params, fn: process, path: PATH });
|
|
40
44
|
}
|
|
41
45
|
|
|
@@ -73,10 +77,9 @@ export function addModule(form_data: Partial<PlaceModule>) {
|
|
|
73
77
|
/**
|
|
74
78
|
* Remove a module from the database
|
|
75
79
|
* @param id ID of the module
|
|
76
|
-
* @param query_params Query parameters to add the to request URL
|
|
77
80
|
*/
|
|
78
|
-
export function removeModule(id: string
|
|
79
|
-
return remove({ id, query_params, path: PATH });
|
|
81
|
+
export function removeModule(id: string) {
|
|
82
|
+
return remove({ id, query_params: {}, path: PATH });
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
/**
|
|
@@ -100,7 +103,7 @@ export function stopModule(id: string) {
|
|
|
100
103
|
* @param id Module ID
|
|
101
104
|
*/
|
|
102
105
|
export function pingModule(id: string): Observable<PlaceModulePingOptions> {
|
|
103
|
-
return task({ id, task_name: '
|
|
106
|
+
return task({ id, task_name: 'ping', method: 'post', path: PATH });
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
/**
|
|
@@ -121,7 +124,7 @@ export function lookupModuleState(
|
|
|
121
124
|
id: string,
|
|
122
125
|
key: string,
|
|
123
126
|
): Observable<HashMap> {
|
|
124
|
-
return task({ id, task_name: `state
|
|
127
|
+
return task({ id, task_name: `state/${key}`, method: 'get', path: PATH });
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
/**
|
|
@@ -159,3 +162,22 @@ export function moduleRuntimeError(id: string) {
|
|
|
159
162
|
path: PATH,
|
|
160
163
|
});
|
|
161
164
|
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Execute a command on a module
|
|
168
|
+
* @param id Module ID
|
|
169
|
+
* @param method Name of the method to execute
|
|
170
|
+
* @param args Array of arguments to pass to the executed method
|
|
171
|
+
*/
|
|
172
|
+
export function executeOnModule(
|
|
173
|
+
id: string,
|
|
174
|
+
method: string,
|
|
175
|
+
args: any[] = [],
|
|
176
|
+
): Observable<HashMap> {
|
|
177
|
+
return task({
|
|
178
|
+
id,
|
|
179
|
+
task_name: `exec/${encodeURIComponent(method)}`,
|
|
180
|
+
form_data: args,
|
|
181
|
+
path: PATH,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { PlaceResourceQueryOptions } from '../resources/interface';
|
|
2
2
|
|
|
3
|
-
/** Mapping of available query
|
|
3
|
+
/** Mapping of available query parameters for the modules index endpoint */
|
|
4
4
|
export interface PlaceModuleQueryOptions extends PlaceResourceQueryOptions {
|
|
5
|
-
/**
|
|
5
|
+
/** Only return modules updated before this time (unix epoch) */
|
|
6
|
+
as_of?: number;
|
|
7
|
+
/** Only return modules running in this system (query params are ignored if this is provided) */
|
|
6
8
|
control_system_id?: string;
|
|
7
|
-
/** Returns modules with the given dependency */
|
|
8
|
-
driver_id?: string;
|
|
9
9
|
/** Return results that connected state matches this value */
|
|
10
10
|
connected?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
11
|
+
/** Only return instances of this driver */
|
|
12
|
+
driver_id?: string;
|
|
13
|
+
/** Do not return logic modules (return only modules that can exist in multiple systems) */
|
|
14
14
|
no_logic?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
/** Return only running modules */
|
|
16
|
+
running?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Mapping of available query parameters for the modules show endpoint */
|
|
20
|
+
export interface PlaceModuleShowOptions {
|
|
21
|
+
/** Return the driver details along with the module */
|
|
22
|
+
complete?: boolean;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
/** Place response from `ping` module task endpoint `/api/engine/v2/<mod_id>/ping` */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlaceAuthSourceQueryOptions } from '../auth-sources/interfaces';
|
|
2
2
|
import { create, query, remove, show, update } from '../resources/functions';
|
|
3
|
-
import { HashMap } from '../utilities/types';
|
|
4
3
|
import { PlaceOAuthSource } from './oauth-source';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -26,10 +25,9 @@ export function queryOAuthSources(
|
|
|
26
25
|
/**
|
|
27
26
|
* Get the data for an OAuth source
|
|
28
27
|
* @param id ID of the OAuth source to retrieve
|
|
29
|
-
* @param query_params Query parameters to add the to request URL
|
|
30
28
|
*/
|
|
31
|
-
export function showOAuthSource(id: string
|
|
32
|
-
return show({ id, query_params, fn: process, path: PATH });
|
|
29
|
+
export function showOAuthSource(id: string) {
|
|
30
|
+
return show({ id, query_params: {}, fn: process, path: PATH });
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
/**
|
|
@@ -66,8 +64,7 @@ export function addOAuthSource(form_data: Partial<PlaceOAuthSource>) {
|
|
|
66
64
|
/**
|
|
67
65
|
* Remove an OAuth source from the database
|
|
68
66
|
* @param id ID of the OAuth source
|
|
69
|
-
* @param query_params Query parameters to add the to request URL
|
|
70
67
|
*/
|
|
71
|
-
export function removeOAuthSource(id: string
|
|
72
|
-
return remove({ id, query_params, path: PATH });
|
|
68
|
+
export function removeOAuthSource(id: string) {
|
|
69
|
+
return remove({ id, query_params: {}, path: PATH });
|
|
73
70
|
}
|
|
@@ -8,13 +8,16 @@ import {
|
|
|
8
8
|
task,
|
|
9
9
|
update,
|
|
10
10
|
} from '../resources/functions';
|
|
11
|
-
import { PlaceResourceQueryOptions } from '../resources/interface';
|
|
12
11
|
import { HashMap } from '../utilities/types';
|
|
13
12
|
import {
|
|
14
13
|
GitCommitDetails,
|
|
14
|
+
PlaceRemoteRepositoryCommitsQuery,
|
|
15
|
+
PlaceRemoteRepositoryQuery,
|
|
15
16
|
PlaceRepositoryCommitQuery,
|
|
16
17
|
PlaceRepositoryDetailsQuery,
|
|
18
|
+
PlaceRepositoryFoldersQuery,
|
|
17
19
|
PlaceRepositoryPullQuery,
|
|
20
|
+
PlaceRepositoryQueryOptions,
|
|
18
21
|
} from './interfaces';
|
|
19
22
|
import { PlaceRepository } from './repository';
|
|
20
23
|
|
|
@@ -33,7 +36,7 @@ function process(item: Partial<PlaceRepository>) {
|
|
|
33
36
|
* @param query_params Query parameters to add the to request URL
|
|
34
37
|
*/
|
|
35
38
|
export function queryRepositories(
|
|
36
|
-
query_params:
|
|
39
|
+
query_params: PlaceRepositoryQueryOptions = {},
|
|
37
40
|
) {
|
|
38
41
|
return query({ query_params, fn: process, path: PATH });
|
|
39
42
|
}
|
|
@@ -41,10 +44,9 @@ export function queryRepositories(
|
|
|
41
44
|
/**
|
|
42
45
|
* Get the data for a repository
|
|
43
46
|
* @param id ID of the repository to retrieve
|
|
44
|
-
* @param query_params Query parameters to add the to request URL
|
|
45
47
|
*/
|
|
46
|
-
export function showRepository(id: string
|
|
47
|
-
return show({ id, query_params, fn: process, path: PATH });
|
|
48
|
+
export function showRepository(id: string) {
|
|
49
|
+
return show({ id, query_params: {}, fn: process, path: PATH });
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
/**
|
|
@@ -79,34 +81,30 @@ export function addRepository(form_data: Partial<PlaceRepository>) {
|
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
|
-
* Remove
|
|
84
|
+
* Remove a repository from the database
|
|
83
85
|
* @param id ID of the repository
|
|
84
|
-
* @param query_params Query parameters to add the to request URL
|
|
85
86
|
*/
|
|
86
|
-
export function removeRepository(id: string
|
|
87
|
-
return remove({ id, query_params, path: PATH });
|
|
87
|
+
export function removeRepository(id: string) {
|
|
88
|
+
return remove({ id, query_params: {}, path: PATH });
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
92
|
* Get a list of all the interfaces
|
|
92
|
-
* @param query_params Addition query parameters to pass to the request
|
|
93
93
|
*/
|
|
94
|
-
export function listInterfaceRepositories(
|
|
95
|
-
query_params: HashMap = {},
|
|
96
|
-
): Observable<string[]> {
|
|
94
|
+
export function listInterfaceRepositories(): Observable<string[]> {
|
|
97
95
|
return show({
|
|
98
96
|
id: 'interfaces',
|
|
99
|
-
query_params,
|
|
97
|
+
query_params: {},
|
|
100
98
|
path: PATH,
|
|
101
99
|
});
|
|
102
100
|
}
|
|
103
101
|
|
|
104
102
|
/**
|
|
105
|
-
* Get name of the default
|
|
103
|
+
* Get name of the default branch for a new repository
|
|
106
104
|
* @param query_params Details about the repository
|
|
107
105
|
*/
|
|
108
106
|
export function listRemoteRepositoryDefaultBranch(
|
|
109
|
-
query_params:
|
|
107
|
+
query_params: PlaceRemoteRepositoryQuery,
|
|
110
108
|
): Observable<string> {
|
|
111
109
|
return show({
|
|
112
110
|
id: 'remote_default_branch',
|
|
@@ -115,21 +113,12 @@ export function listRemoteRepositoryDefaultBranch(
|
|
|
115
113
|
});
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
export interface RepositoryDetails {
|
|
119
|
-
/** Git URL of the remote repository */
|
|
120
|
-
repository_url: string;
|
|
121
|
-
/** Username required to access the repository */
|
|
122
|
-
username?: string;
|
|
123
|
-
/** Password for the required user */
|
|
124
|
-
password?: string;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
116
|
/**
|
|
128
117
|
* Get a list of branches for a new repository
|
|
129
118
|
* @param query_params Details about the repository
|
|
130
119
|
*/
|
|
131
120
|
export function listRemoteRepositoryBranches(
|
|
132
|
-
query_params:
|
|
121
|
+
query_params: PlaceRemoteRepositoryQuery,
|
|
133
122
|
): Observable<string[]> {
|
|
134
123
|
return show({
|
|
135
124
|
id: 'remote_branches',
|
|
@@ -138,19 +127,12 @@ export function listRemoteRepositoryBranches(
|
|
|
138
127
|
});
|
|
139
128
|
}
|
|
140
129
|
|
|
141
|
-
export interface RepositoryBranchDetails extends RepositoryDetails {
|
|
142
|
-
/** Branch to grab details for. Defaults to the default branch */
|
|
143
|
-
branch?: string;
|
|
144
|
-
/** Number of commits to retrieve from the remote. Defaults to `50` */
|
|
145
|
-
depth?: number;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
130
|
/**
|
|
149
131
|
* Get a list of branch commits for a new repository
|
|
150
132
|
* @param query_params Details about the repository
|
|
151
133
|
*/
|
|
152
134
|
export function listRemoteRepositoryCommits(
|
|
153
|
-
query_params:
|
|
135
|
+
query_params: PlaceRemoteRepositoryCommitsQuery,
|
|
154
136
|
): Observable<GitCommitDetails[]> {
|
|
155
137
|
return show({
|
|
156
138
|
id: 'remote_commits',
|
|
@@ -164,7 +146,7 @@ export function listRemoteRepositoryCommits(
|
|
|
164
146
|
* @param query_params Details about the repository
|
|
165
147
|
*/
|
|
166
148
|
export function listRemoteRepositoryTags(
|
|
167
|
-
query_params:
|
|
149
|
+
query_params: PlaceRemoteRepositoryQuery,
|
|
168
150
|
): Observable<string[]> {
|
|
169
151
|
return show({
|
|
170
152
|
id: 'remote_tags',
|
|
@@ -301,3 +283,21 @@ export function pullRepositoryChanges(
|
|
|
301
283
|
path: PATH,
|
|
302
284
|
});
|
|
303
285
|
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Get the folder tree structure of a repository
|
|
289
|
+
* @param id ID of the repository
|
|
290
|
+
* @param query_params Query parameters to add to the request
|
|
291
|
+
*/
|
|
292
|
+
export function listRepositoryFolders(
|
|
293
|
+
id: string,
|
|
294
|
+
query_params?: PlaceRepositoryFoldersQuery,
|
|
295
|
+
): Observable<string[]> {
|
|
296
|
+
return task({
|
|
297
|
+
id,
|
|
298
|
+
task_name: 'folders',
|
|
299
|
+
form_data: query_params,
|
|
300
|
+
method: 'get',
|
|
301
|
+
path: PATH,
|
|
302
|
+
});
|
|
303
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PlaceResourceQueryOptions } from '../resources/interface';
|
|
2
|
+
|
|
1
3
|
/** Type of repository */
|
|
2
4
|
export enum PlaceRepositoryType {
|
|
3
5
|
/** Repository is a collection of Driver logic */
|
|
@@ -6,6 +8,10 @@ export enum PlaceRepositoryType {
|
|
|
6
8
|
Interface = 'interface',
|
|
7
9
|
}
|
|
8
10
|
|
|
11
|
+
/** Mapping of available query parameters for the repositories index endpoint */
|
|
12
|
+
export interface PlaceRepositoryQueryOptions extends PlaceResourceQueryOptions {}
|
|
13
|
+
|
|
14
|
+
/** Query parameters for repository commit listing */
|
|
9
15
|
export interface PlaceRepositoryCommitQuery {
|
|
10
16
|
/** URL encoded name of the branch being requested */
|
|
11
17
|
branch?: string;
|
|
@@ -20,24 +26,50 @@ export interface GitCommitDetails {
|
|
|
20
26
|
author: string;
|
|
21
27
|
/** Short hash of the commit */
|
|
22
28
|
commit: string;
|
|
23
|
-
/** ISO datetime string for commit
|
|
29
|
+
/** ISO datetime string for commit */
|
|
24
30
|
date: string;
|
|
25
31
|
/** Commit summary */
|
|
26
32
|
subject: string;
|
|
27
33
|
}
|
|
28
34
|
|
|
35
|
+
/** Query parameters for repository driver details */
|
|
29
36
|
export interface PlaceRepositoryDetailsQuery {
|
|
30
|
-
/** URL encoded name of the driver being requested */
|
|
37
|
+
/** URL encoded name of the driver being requested (required) */
|
|
31
38
|
driver: string;
|
|
32
|
-
/** Hash of the commit being requested for the driver */
|
|
39
|
+
/** Hash of the commit being requested for the driver (required) */
|
|
33
40
|
commit: string;
|
|
34
41
|
}
|
|
35
42
|
|
|
43
|
+
/** Query parameters for repository pull */
|
|
36
44
|
export interface PlaceRepositoryPullQuery {
|
|
37
45
|
/** Hash of the commit being requested */
|
|
38
46
|
commit: string;
|
|
39
47
|
}
|
|
40
48
|
|
|
49
|
+
/** Query parameters for remote repository operations */
|
|
50
|
+
export interface PlaceRemoteRepositoryQuery {
|
|
51
|
+
/** The git URL that represents the repository (required) */
|
|
52
|
+
repository_url: string;
|
|
53
|
+
/** A username for access if required */
|
|
54
|
+
username?: string;
|
|
55
|
+
/** The password or access token as required */
|
|
56
|
+
password?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Query parameters for remote repository commits */
|
|
60
|
+
export interface PlaceRemoteRepositoryCommitsQuery extends PlaceRemoteRepositoryQuery {
|
|
61
|
+
/** The branch to grab commits from */
|
|
62
|
+
branch?: string;
|
|
63
|
+
/** The number of commits to return */
|
|
64
|
+
depth?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Query parameters for repository folders listing */
|
|
68
|
+
export interface PlaceRepositoryFoldersQuery {
|
|
69
|
+
/** Include dot files and folders */
|
|
70
|
+
include_dots?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
41
73
|
/** Metadata for a repository commit */
|
|
42
74
|
export interface PlaceRepositoryCommit {
|
|
43
75
|
/** Hash associated with the commit */
|
|
@@ -7,15 +7,20 @@ import { HashMap } from '../utilities/types';
|
|
|
7
7
|
export interface PlaceResourceQueryOptions {
|
|
8
8
|
/**
|
|
9
9
|
* Search filter supporting the following syntax
|
|
10
|
-
* https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
10
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html
|
|
11
11
|
*/
|
|
12
12
|
q?: string;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Comma separated list of fields to search.
|
|
15
|
+
* Accepts wildcard expressions and boost relevance scores using caret ^ operator.
|
|
16
|
+
*/
|
|
14
17
|
fields?: string;
|
|
15
18
|
/** Number of results to return. Defaults to `20`. Max `500` */
|
|
16
19
|
limit?: number;
|
|
17
|
-
/**
|
|
20
|
+
/** @deprecated Use `ref` for pagination. Offset of the results to return. Max `10000` */
|
|
18
21
|
offset?: number;
|
|
22
|
+
/** Token for accessing the next page of results, provided in the `Link` header */
|
|
23
|
+
ref?: string;
|
|
19
24
|
/** Number of milliseconds to cache the query response */
|
|
20
25
|
cache?: number;
|
|
21
26
|
/** Whether the request is a API poll request */
|
|
@@ -80,7 +85,7 @@ export interface TaskParameters<T> {
|
|
|
80
85
|
id: string;
|
|
81
86
|
task_name: string;
|
|
82
87
|
form_data?: any;
|
|
83
|
-
method?: 'post' | 'get' | 'del' | 'put';
|
|
88
|
+
method?: 'post' | 'get' | 'del' | 'put' | 'patch';
|
|
84
89
|
callback?: (_: any) => T;
|
|
85
90
|
path: string;
|
|
86
91
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlaceAuthSourceQueryOptions } from '../auth-sources/interfaces';
|
|
2
2
|
import { create, query, remove, show, update } from '../resources/functions';
|
|
3
|
-
import { HashMap } from '../utilities/types';
|
|
4
3
|
import { PlaceSAMLSource } from './saml-source';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -24,12 +23,11 @@ export function querySAMLSources(
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
* Get the data for
|
|
26
|
+
* Get the data for a SAML source
|
|
28
27
|
* @param id ID of the SAML source to retrieve
|
|
29
|
-
* @param query_params Query parameters to add the to request URL
|
|
30
28
|
*/
|
|
31
|
-
export function showSAMLSource(id: string
|
|
32
|
-
return show({ id, query_params, fn: process, path: PATH });
|
|
29
|
+
export function showSAMLSource(id: string) {
|
|
30
|
+
return show({ id, query_params: {}, fn: process, path: PATH });
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
/**
|
|
@@ -64,10 +62,9 @@ export function addSAMLSource(form_data: Partial<PlaceSAMLSource>) {
|
|
|
64
62
|
}
|
|
65
63
|
|
|
66
64
|
/**
|
|
67
|
-
* Remove
|
|
65
|
+
* Remove a SAML source from the database
|
|
68
66
|
* @param id ID of the SAML source
|
|
69
|
-
* @param query_params Query parameters to add the to request URL
|
|
70
67
|
*/
|
|
71
|
-
export function removeSAMLSource(id: string
|
|
72
|
-
return remove({ id, query_params, path: PATH });
|
|
68
|
+
export function removeSAMLSource(id: string) {
|
|
69
|
+
return remove({ id, query_params: {}, path: PATH });
|
|
73
70
|
}
|