@space-df/sdk 0.0.1-dev.13 → 0.0.1-dev.15

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 (110) hide show
  1. package/api.doc.md +1066 -219
  2. package/dist/index.d.mts +5 -0
  3. package/dist/index.d.ts +5 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +5 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +5 -0
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/package.json +1 -1
  10. package/dist/resources/auth/auth.d.ts +0 -1
  11. package/dist/resources/auth/auth.d.ts.map +1 -1
  12. package/dist/resources/auth/space-policies.d.ts +6 -3
  13. package/dist/resources/auth/space-policies.d.ts.map +1 -1
  14. package/dist/resources/auth/space-policies.js +16 -5
  15. package/dist/resources/auth/space-policies.js.map +1 -1
  16. package/dist/resources/auth/space-policies.mjs +16 -5
  17. package/dist/resources/auth/space-policies.mjs.map +1 -1
  18. package/dist/resources/auth/space-role-users.d.ts +11 -7
  19. package/dist/resources/auth/space-role-users.d.ts.map +1 -1
  20. package/dist/resources/auth/space-role-users.js +15 -12
  21. package/dist/resources/auth/space-role-users.js.map +1 -1
  22. package/dist/resources/auth/space-role-users.mjs +15 -12
  23. package/dist/resources/auth/space-role-users.mjs.map +1 -1
  24. package/dist/resources/auth/space-roles.d.ts +14 -3
  25. package/dist/resources/auth/space-roles.d.ts.map +1 -1
  26. package/dist/resources/auth/space-roles.js +14 -12
  27. package/dist/resources/auth/space-roles.js.map +1 -1
  28. package/dist/resources/auth/space-roles.mjs +14 -12
  29. package/dist/resources/auth/space-roles.mjs.map +1 -1
  30. package/dist/resources/auth/spaces.d.ts +11 -3
  31. package/dist/resources/auth/spaces.d.ts.map +1 -1
  32. package/dist/resources/auth/spaces.js +14 -8
  33. package/dist/resources/auth/spaces.js.map +1 -1
  34. package/dist/resources/auth/spaces.mjs +14 -8
  35. package/dist/resources/auth/spaces.mjs.map +1 -1
  36. package/dist/resources/device/device-connector.d.ts +25 -0
  37. package/dist/resources/device/device-connector.d.ts.map +1 -0
  38. package/dist/resources/device/device-connector.js +30 -0
  39. package/dist/resources/device/device-connector.js.map +1 -0
  40. package/dist/resources/device/device-connector.mjs +26 -0
  41. package/dist/resources/device/device-connector.mjs.map +1 -0
  42. package/dist/resources/device/device-model.d.ts +20 -0
  43. package/dist/resources/device/device-model.d.ts.map +1 -0
  44. package/dist/resources/device/device-model.js +52 -0
  45. package/dist/resources/device/device-model.js.map +1 -0
  46. package/dist/resources/device/device-model.mjs +48 -0
  47. package/dist/resources/device/device-model.mjs.map +1 -0
  48. package/dist/resources/device/devices.d.ts +18 -0
  49. package/dist/resources/device/devices.d.ts.map +1 -0
  50. package/dist/resources/device/devices.js +52 -0
  51. package/dist/resources/device/devices.js.map +1 -0
  52. package/dist/resources/device/devices.mjs +48 -0
  53. package/dist/resources/device/devices.mjs.map +1 -0
  54. package/dist/resources/device/index.d.ts +6 -0
  55. package/dist/resources/device/index.d.ts.map +1 -0
  56. package/dist/resources/device/index.js +22 -0
  57. package/dist/resources/device/index.js.map +1 -0
  58. package/dist/resources/device/index.mjs +6 -0
  59. package/dist/resources/device/index.mjs.map +1 -0
  60. package/dist/resources/device/manufacturers.d.ts +20 -0
  61. package/dist/resources/device/manufacturers.d.ts.map +1 -0
  62. package/dist/resources/device/manufacturers.js +52 -0
  63. package/dist/resources/device/manufacturers.js.map +1 -0
  64. package/dist/resources/device/manufacturers.mjs +48 -0
  65. package/dist/resources/device/manufacturers.mjs.map +1 -0
  66. package/dist/resources/device/network-server.d.ts +19 -0
  67. package/dist/resources/device/network-server.d.ts.map +1 -0
  68. package/dist/resources/device/network-server.js +52 -0
  69. package/dist/resources/device/network-server.js.map +1 -0
  70. package/dist/resources/device/network-server.mjs +48 -0
  71. package/dist/resources/device/network-server.mjs.map +1 -0
  72. package/dist/resources/index.d.ts +1 -0
  73. package/dist/resources/index.d.ts.map +1 -1
  74. package/dist/resources/index.js +1 -0
  75. package/dist/resources/index.js.map +1 -1
  76. package/dist/resources/index.mjs +1 -0
  77. package/dist/src/index.ts +5 -0
  78. package/dist/src/resources/auth/auth.ts +0 -2
  79. package/dist/src/resources/auth/presigned-url.ts +1 -1
  80. package/dist/src/resources/auth/space-policies.ts +22 -7
  81. package/dist/src/resources/auth/space-role-users.ts +24 -16
  82. package/dist/src/resources/auth/space-roles.ts +27 -12
  83. package/dist/src/resources/auth/spaces.ts +26 -11
  84. package/dist/src/resources/device/device-connector.ts +49 -0
  85. package/dist/src/resources/device/device-model.ts +65 -0
  86. package/dist/src/resources/device/devices.ts +63 -0
  87. package/dist/src/resources/device/index.ts +5 -0
  88. package/dist/src/resources/device/manufacturers.ts +65 -0
  89. package/dist/src/resources/device/network-server.ts +64 -0
  90. package/dist/src/resources/index.ts +1 -0
  91. package/dist/src/version.ts +1 -1
  92. package/dist/version.d.ts +1 -1
  93. package/dist/version.js +1 -1
  94. package/dist/version.mjs +1 -1
  95. package/package.json +1 -1
  96. package/src/index.ts +5 -0
  97. package/src/resources/auth/auth.ts +0 -2
  98. package/src/resources/auth/presigned-url.ts +1 -1
  99. package/src/resources/auth/space-policies.ts +22 -7
  100. package/src/resources/auth/space-role-users.ts +24 -16
  101. package/src/resources/auth/space-roles.ts +27 -12
  102. package/src/resources/auth/spaces.ts +26 -11
  103. package/src/resources/device/device-connector.ts +49 -0
  104. package/src/resources/device/device-model.ts +65 -0
  105. package/src/resources/device/devices.ts +63 -0
  106. package/src/resources/device/index.ts +5 -0
  107. package/src/resources/device/manufacturers.ts +65 -0
  108. package/src/resources/device/network-server.ts +64 -0
  109. package/src/resources/index.ts +1 -0
  110. package/src/version.ts +1 -1
@@ -9,20 +9,20 @@ export class Spaces extends APIResource {
9
9
  }
10
10
 
11
11
  update(params: SpaceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Space> {
12
- const { ...body } = params;
12
+ const { 'X-Space': xspace, ...body } = params;
13
13
  return this._client.put(`/spaces`, {
14
14
  body,
15
15
  ...options,
16
- headers: { ...options?.headers },
16
+ headers: { ...options?.headers, 'X-Space': xspace },
17
17
  });
18
18
  }
19
19
 
20
20
  partialUpdate(params: SpaceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Space> {
21
- const { ...body } = params;
21
+ const { 'X-Space': xspace, ...body } = params;
22
22
  return this._client.patch(`/spaces`, {
23
23
  body,
24
24
  ...options,
25
- headers: { ...options?.headers },
25
+ headers: { ...options?.headers, 'X-Space': xspace },
26
26
  });
27
27
  }
28
28
 
@@ -39,16 +39,21 @@ export class Spaces extends APIResource {
39
39
  headers: { ...options?.headers },
40
40
  });
41
41
  }
42
-
43
- delete(options?: Core.RequestOptions): Core.APIPromise<void> {
42
+ delete(params: SpaceParams, options?: Core.RequestOptions): Core.APIPromise<void> {
43
+ const { 'X-Space': xspace } = params;
44
44
  return this._client.delete(`/spaces`, {
45
45
  ...options,
46
- headers: { Accept: '*/*', ...options?.headers },
46
+ headers: { Accept: '*/*', ...options?.headers, 'X-Space': xspace },
47
47
  });
48
48
  }
49
49
 
50
- invitation(body: OAuthInvitation, options?: Core.RequestOptions): Core.APIPromise<OAuthInvitation> {
51
- return this._client.post(`/spaces/invitation`, { body, ...options });
50
+ invitation(params: OAuthInvitationParams, options?: Core.RequestOptions): Core.APIPromise<OAuthInvitationParams> {
51
+ const { 'X-Space': xspace, ...body } = params;
52
+ return this._client.post(`/spaces/invitation`, {
53
+ body,
54
+ ...options,
55
+ headers: { ...options?.headers, 'X-Space': xspace },
56
+ });
52
57
  }
53
58
 
54
59
  joinSpace(token: string, options?: Core.RequestOptions): Core.APIPromise<JoinSpaceResponse> {
@@ -101,6 +106,15 @@ export interface SpaceUpdateParams {
101
106
  * Body param:
102
107
  */
103
108
  slug_name: string;
109
+
110
+ /**
111
+ * Header param:
112
+ */
113
+ 'X-Space': string;
114
+ }
115
+
116
+ export interface SpaceParams {
117
+ 'X-Space': string;
104
118
  }
105
119
 
106
120
  export interface SpaceUpdateParams {
@@ -125,8 +139,9 @@ export interface SpaceUpdateParams {
125
139
  is_active?: boolean;
126
140
  }
127
141
 
128
- export interface OAuthInvitation {
142
+ export interface OAuthInvitationParams {
129
143
  receiver_list: Receiver[];
144
+ 'X-Space': string;
130
145
  }
131
146
 
132
147
  export interface Receiver {
@@ -137,4 +152,4 @@ export interface Receiver {
137
152
  export interface JoinSpaceResponse {
138
153
  error?: string;
139
154
  result?: string;
140
- }
155
+ }
@@ -0,0 +1,49 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+
4
+ export class DeviceConnector extends APIResource {
5
+ create(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<DeviceConnectorParams> {
6
+ const { ...body } = params;
7
+ return this._client.post(`/device-connector/`, {
8
+ body,
9
+ ...options,
10
+ headers: { ...options?.headers },
11
+ });
12
+ }
13
+
14
+ testConnectionPreview(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<void> {
15
+ const { ...body } = params;
16
+ return this._client.post(`/device-connector/test-connection-preview/`, {
17
+ body,
18
+ ...options,
19
+ headers: { ...options?.headers },
20
+ });
21
+ }
22
+
23
+ testConnection(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
24
+ return this._client.get(`/device-connector/${id}/`, {
25
+ ...options,
26
+ headers: { ...options?.headers },
27
+ });
28
+ }
29
+ }
30
+
31
+ export interface DeviceConnectorParams {
32
+ network_server: string;
33
+ name: string;
34
+ connector_type: string;
35
+ status?: string;
36
+ deviceHttpConfig?: DeviceHttpConfig;
37
+ deviceMqttConfig?: DeviceMqttConfig;
38
+ }
39
+
40
+ export interface DeviceHttpConfig {
41
+ api_token: string;
42
+ address_url: string;
43
+ }
44
+
45
+ export interface DeviceMqttConfig {
46
+ mqtt_broker: string;
47
+ username: string;
48
+ password: string;
49
+ }
@@ -0,0 +1,65 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+ import { ListParamsResponse, ListResponse } from '../../types/api';
4
+
5
+ export class DeviceModel extends APIResource {
6
+ create(params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams> {
7
+ const { ...body } = params;
8
+ return this._client.post(`/device-models/`, {
9
+ body,
10
+ ...options,
11
+ headers: { ...options?.headers },
12
+ });
13
+ }
14
+
15
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams> {
16
+ return this._client.get(`/device-models/${id}/`, {
17
+ ...options,
18
+ headers: { ...options?.headers },
19
+ });
20
+ }
21
+
22
+ update(id: string, params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams> {
23
+ const { ...body } = params;
24
+ return this._client.put(`/device-models/${id}/`, {
25
+ body,
26
+ ...options,
27
+ headers: { ...options?.headers },
28
+ });
29
+ }
30
+
31
+ partialUpdate(id: number, params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams> {
32
+ const { ...body } = params;
33
+ return this._client.patch(`/device-models/${id}/`, {
34
+ body,
35
+ ...options,
36
+ headers: { ...options?.headers },
37
+ });
38
+ }
39
+
40
+ list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceModelListResponse> {
41
+ const { ...query } = params;
42
+ return this._client.get(`/device-models/`, {
43
+ query,
44
+ ...options,
45
+ headers: { ...options?.headers },
46
+ });
47
+ }
48
+
49
+ delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
50
+ return this._client.delete(`/device-models/${id}/`, {
51
+ ...options,
52
+ headers: { Accept: '*/*', ...options?.headers },
53
+ });
54
+ }
55
+ }
56
+
57
+ export interface DeviceModelParams {
58
+ name: string;
59
+ alias: string;
60
+ image_url: string;
61
+ default_config: object;
62
+ manufacture: string;
63
+ }
64
+
65
+ export type DeviceModelListResponse = ListResponse<DeviceModelParams>;
@@ -0,0 +1,63 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+ import { ListParamsResponse, ListResponse } from '../../types/api';
4
+
5
+ export class Device extends APIResource {
6
+ create(params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams> {
7
+ const { ...body } = params;
8
+ return this._client.post(`/devices/`, {
9
+ body,
10
+ ...options,
11
+ headers: { ...options?.headers },
12
+ });
13
+ }
14
+
15
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceParams> {
16
+ return this._client.get(`/devices/${id}/`, {
17
+ ...options,
18
+ headers: { ...options?.headers },
19
+ });
20
+ }
21
+
22
+ update(id: string, params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams> {
23
+ const { ...body } = params;
24
+ return this._client.put(`/devices/${id}/`, {
25
+ body,
26
+ ...options,
27
+ headers: { ...options?.headers },
28
+ });
29
+ }
30
+
31
+ partialUpdate(id: number, params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams> {
32
+ const { ...body } = params;
33
+ return this._client.patch(`/devices/${id}/`, {
34
+ body,
35
+ ...options,
36
+ headers: { ...options?.headers },
37
+ });
38
+ }
39
+
40
+ list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceListResponse> {
41
+ const { ...query } = params;
42
+ return this._client.get(`/devices/`, {
43
+ query,
44
+ ...options,
45
+ headers: { ...options?.headers },
46
+ });
47
+ }
48
+
49
+ delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
50
+ return this._client.delete(`/devices/${id}/`, {
51
+ ...options,
52
+ headers: { Accept: '*/*', ...options?.headers },
53
+ });
54
+ }
55
+ }
56
+
57
+ export interface DeviceParams {
58
+ status?: string;
59
+ device_connector: string;
60
+ device_model: string;
61
+ }
62
+
63
+ export type DeviceListResponse = ListResponse<DeviceParams>;
@@ -0,0 +1,5 @@
1
+ export * from './device-model';
2
+ export * from './device-connector';
3
+ export * from './network-server';
4
+ export * from './devices';
5
+ export * from './manufacturers';
@@ -0,0 +1,65 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+ import { ListParamsResponse, ListResponse } from '../../types/api';
4
+
5
+ export class Manufacturers extends APIResource {
6
+ create(params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams> {
7
+ const { ...body } = params;
8
+ return this._client.post(`/manufacturers/`, {
9
+ body,
10
+ ...options,
11
+ headers: { ...options?.headers },
12
+ });
13
+ }
14
+
15
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams> {
16
+ return this._client.get(`/manufacturers/${id}/`, {
17
+ ...options,
18
+ headers: { ...options?.headers },
19
+ });
20
+ }
21
+
22
+ update(id: string, params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams> {
23
+ const { ...body } = params;
24
+ return this._client.put(`/manufacturers/${id}/`, {
25
+ body,
26
+ ...options,
27
+ headers: { ...options?.headers },
28
+ });
29
+ }
30
+
31
+ partialUpdate(id: number, params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams> {
32
+ const { ...body } = params;
33
+ return this._client.patch(`/manufacturers/${id}/`, {
34
+ body,
35
+ ...options,
36
+ headers: { ...options?.headers },
37
+ });
38
+ }
39
+
40
+ list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<ManufacturersListResponse> {
41
+ const { ...query } = params;
42
+ return this._client.get(`/manufacturers/`, {
43
+ query,
44
+ ...options,
45
+ headers: { ...options?.headers },
46
+ });
47
+ }
48
+
49
+ delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
50
+ return this._client.delete(`/manufacturers/${id}/`, {
51
+ ...options,
52
+ headers: { Accept: '*/*', ...options?.headers },
53
+ });
54
+ }
55
+ }
56
+
57
+ export interface ManufacturersParams {
58
+ name: string;
59
+ location: string;
60
+ description: string;
61
+ portal_url: string;
62
+ national: string;
63
+ }
64
+
65
+ export type ManufacturersListResponse = ListResponse<ManufacturersParams>;
@@ -0,0 +1,64 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+ import { ListParamsResponse, ListResponse } from '../../types/api';
4
+
5
+ export class NetworkServer extends APIResource {
6
+ create(params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams> {
7
+ const { ...body } = params;
8
+ return this._client.post(`/network-server/`, {
9
+ body,
10
+ ...options,
11
+ headers: { ...options?.headers },
12
+ });
13
+ }
14
+
15
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams> {
16
+ return this._client.get(`/network-server/${id}/`, {
17
+ ...options,
18
+ headers: { ...options?.headers },
19
+ });
20
+ }
21
+
22
+ update(id: string, params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams> {
23
+ const { ...body } = params;
24
+ return this._client.put(`/network-server/${id}/`, {
25
+ body,
26
+ ...options,
27
+ headers: { ...options?.headers },
28
+ });
29
+ }
30
+
31
+ partialUpdate(id: number, params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams> {
32
+ const { ...body } = params;
33
+ return this._client.patch(`/network-server/${id}/`, {
34
+ body,
35
+ ...options,
36
+ headers: { ...options?.headers },
37
+ });
38
+ }
39
+
40
+ list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<NetworkServerListResponse> {
41
+ const { ...query } = params;
42
+ return this._client.get(`/network-server/`, {
43
+ query,
44
+ ...options,
45
+ headers: { ...options?.headers },
46
+ });
47
+ }
48
+
49
+ delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
50
+ return this._client.delete(`/network-server/${id}/`, {
51
+ ...options,
52
+ headers: { Accept: '*/*', ...options?.headers },
53
+ });
54
+ }
55
+ }
56
+
57
+ export interface NetworkServerParams {
58
+ name: string;
59
+ logo: string;
60
+ description: string;
61
+ type_connect: string[];
62
+ }
63
+
64
+ export type NetworkServerListResponse = ListResponse<NetworkServerParams>;
@@ -4,3 +4,4 @@
4
4
  export * from './auth/index';
5
5
  export * from './dashboard/index';
6
6
  export * from './console/index';
7
+ export * from './device/index';
@@ -1 +1 @@
1
- export const VERSION = '0.0.1-dev.13';
1
+ export const VERSION = '0.0.1-dev.15';
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.1-dev.13";
1
+ export declare const VERSION = "0.0.1-dev.15";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.0.1-dev.13';
4
+ exports.VERSION = '0.0.1-dev.15';
5
5
  //# sourceMappingURL=version.js.map
package/dist/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.1-dev.13';
1
+ export const VERSION = '0.0.1-dev.15';
2
2
  //# sourceMappingURL=version.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@space-df/sdk",
3
- "version": "0.0.1-dev.13",
3
+ "version": "0.0.1-dev.15",
4
4
  "description": "The official TypeScript library for the Spacedf SDK API",
5
5
  "author": "Spacedf SDK <support@digitalfortress.dev>",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -148,6 +148,11 @@ export class SpaceDFSDK extends Core.APIClient {
148
148
  credentials: API.Credentials = new API.Credentials(this);
149
149
  users: API.Users = new API.Users(this);
150
150
  presignedUrl: API.PresignedUrl = new API.PresignedUrl(this);
151
+ deviceConnector: API.DeviceConnector = new API.DeviceConnector(this);
152
+ deviceModel: API.DeviceModel = new API.DeviceModel(this);
153
+ device: API.Device = new API.Device(this);
154
+ manufacturers: API.Manufacturers = new API.Manufacturers(this);
155
+ networkServer: API.NetworkServer = new API.NetworkServer(this);
151
156
 
152
157
  protected override defaultQuery(): Core.DefaultQuery | undefined {
153
158
  return this._options.defaultQuery;
@@ -107,8 +107,6 @@ export interface ForgetPasswordParams {
107
107
 
108
108
  export interface AuthRefreshTokenParams {
109
109
  refresh: string;
110
-
111
- space_slug_name: string;
112
110
  }
113
111
 
114
112
  export interface AuthRegisterParams {
@@ -10,4 +10,4 @@ export class PresignedUrl extends APIResource {
10
10
  export interface PresignedUrlResponse {
11
11
  presigned_url: string;
12
12
  file_name: string;
13
- }
13
+ }
@@ -4,17 +4,28 @@ import { ListParamsResponse, ListResponse } from '../../types/api';
4
4
  import * as Core from '../../core';
5
5
 
6
6
  export class SpacePolicies extends APIResource {
7
- retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy> {
8
- return this._client.get(`/space-policies/${id}`, options);
7
+ retrieve(id: number, params: SpacePolicyParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy> {
8
+ const { 'X-Space': xspace } = params;
9
+ return this._client.get(`/space-policies/${id}`, {
10
+ ...options,
11
+ headers: { ...options?.headers, 'X-Space': xspace },
12
+ });
9
13
  }
10
14
 
11
- list(query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
12
- list(options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
13
- list(query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse> {
15
+ list(spaceName: string, query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
16
+ list(spaceName: string, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
17
+ list(spaceName: string, query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse> {
14
18
  if (isRequestOptions(query)) {
15
- return this.list({}, query);
19
+ return this.list(spaceName, {}, query);
16
20
  }
17
- return this._client.get(`/space-policies`, { query, ...options });
21
+ const mergedOptions: Core.RequestOptions = {
22
+ ...options,
23
+ headers: {
24
+ ...(options?.headers || {}),
25
+ 'X-Space': spaceName,
26
+ },
27
+ };
28
+ return this._client.get(`/space-policies`, { query, ...mergedOptions });
18
29
  }
19
30
  }
20
31
 
@@ -53,3 +64,7 @@ export interface SpacePolicy {
53
64
  export type SpacePolicyListResponse = ListResponse<SpacePolicy>;
54
65
 
55
66
  export type SpacePolicyListParams = ListParamsResponse;
67
+
68
+ export interface SpacePolicyParams {
69
+ 'X-Space': string;
70
+ }
@@ -3,51 +3,54 @@ import { ListParamsResponse, ListResponse } from '../../types/api';
3
3
  import * as Core from '../../core';
4
4
 
5
5
  export class SpaceRoleUsers extends APIResource {
6
- retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser> {
6
+ retrieve(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser> {
7
+ const { 'X-Space': xspace } = params;
7
8
  return this._client.get(`/space-role-users/${id}`, {
8
9
  ...options,
9
- headers: { ...options?.headers },
10
+ headers: { ...options?.headers, 'X-Space': xspace },
10
11
  });
11
12
  }
12
13
 
13
- list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse> {
14
+ list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse> {
14
15
  const { ...query } = params;
15
16
  return this._client.get(`/space-role-users`, {
16
17
  query,
17
18
  ...options,
18
- headers: { ...options?.headers },
19
+ headers: { ...options?.headers, 'X-Space': spaceName },
19
20
  });
20
21
  }
21
22
 
22
- update(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams> {
23
- const { ...body } = params;
23
+ update(id: number, params: SpaceRoleUserUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserUpdateParams> {
24
+ const { 'X-Space': xspace, ...body } = params;
24
25
  return this._client.put(`/space-role-users/${id}`, {
25
26
  body,
26
27
  ...options,
27
- headers: { ...options?.headers },
28
+ headers: { ...options?.headers, 'X-Space': xspace },
28
29
  });
29
30
  }
30
31
 
31
- partialUpdate(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams> {
32
- const { ...body } = params;
32
+ partialUpdate(id: number, params: SpaceRoleUserUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserUpdateParams> {
33
+ const { 'X-Space': xspace, ...body } = params;
33
34
  return this._client.patch(`/space-role-users/${id}`, {
34
35
  body,
35
36
  ...options,
36
- headers: { ...options?.headers },
37
+ headers: { ...options?.headers, 'X-Space': xspace },
37
38
  });
38
39
  }
39
40
 
40
- setSpaceDefault(id: String, options?: Core.RequestOptions): Core.APIPromise<void> {
41
+ setSpaceDefault(id: String, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void> {
42
+ const { 'X-Space': xspace } = params;
41
43
  return this._client.post(`/space-role-users/${id}/default`, {
42
44
  ...options,
43
- headers: {...options?.headers },
45
+ headers: { ...options?.headers, 'X-Space': xspace },
44
46
  });
45
47
  }
46
48
 
47
- delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
49
+ delete(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void> {
50
+ const { 'X-Space': xspace } = params;
48
51
  return this._client.delete(`/space-role-users/${id}`, {
49
52
  ...options,
50
- headers: { Accept: '*/*', ...options?.headers },
53
+ headers: { Accept: '*/*', ...options?.headers, 'X-Space': xspace },
51
54
  });
52
55
  }
53
56
  }
@@ -64,8 +67,13 @@ export interface SpaceRoleUser {
64
67
  readonly updated_at?: string;
65
68
  }
66
69
 
67
- export interface SpaceRoleParams {
68
- space_role: string;
70
+ export interface SpaceRoleUserUpdateParams {
71
+ space_role: string;
72
+ 'X-Space': string;
73
+ }
74
+
75
+ export interface SpaceRoleUsersParams {
76
+ 'X-Space': string;
69
77
  }
70
78
 
71
79
  export type SpaceRoleUserListResponse = ListResponse<SpaceRoleUser>;