Skip to content

Commit 6cbada8

Browse files
committed
add invites tab, hover for permissions and limits, and fix pause stuff
1 parent e4c92e2 commit 6cbada8

22 files changed

Lines changed: 719 additions & 95 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"volta": {
7878
"node": "24.7.0"
7979
},
80-
"packageManager": "pnpm@10.17.0",
80+
"packageManager": "pnpm@10.18.1",
8181
"pnpm": {
8282
"onlyBuiltDependencies": [
8383
"@tailwindcss/oxide",

src/lib/api/internal/v1/.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.openapi-generator-ignore
21
apis/APITokensApi.ts
32
apis/AccountApi.ts
43
apis/AdminApi.ts

src/lib/api/internal/v2/.openapi-generator/FILES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.openapi-generator-ignore
21
apis/AccountApi.ts
32
apis/HubEndpointsApi.ts
43
apis/HubManagementApi.ts
@@ -7,6 +6,7 @@ apis/UserShockerSharesApi.ts
76
apis/index.ts
87
index.ts
98
models/BasicUserInfo.ts
9+
models/BulkUserShareShockersUpdateRequest.ts
1010
models/ChangeUsernameRequest.ts
1111
models/Control.ts
1212
models/ControlRequest.ts
@@ -26,6 +26,7 @@ models/RoleType.ts
2626
models/ShareInviteBaseDetails.ts
2727
models/ShockerLimits.ts
2828
models/ShockerPermLimitPairWithId.ts
29+
models/ShockerPermLimitPairWithIdAndName.ts
2930
models/ShockerPermissions.ts
3031
models/SignUpV2.ts
3132
models/UserShareInfo.ts

src/lib/api/internal/v2/apis/UserShockerSharesApi.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import * as runtime from '../runtime';
1717
import type {
18+
BulkUserShareShockersUpdateRequest,
1819
CreateShareRequest,
1920
OpenShockProblem,
2021
PauseUserShareShockersRequest,
@@ -25,6 +26,8 @@ import type {
2526
V2UserSharesListItem,
2627
} from '../models/index';
2728
import {
29+
BulkUserShareShockersUpdateRequestFromJSON,
30+
BulkUserShareShockersUpdateRequestToJSON,
2831
CreateShareRequestFromJSON,
2932
CreateShareRequestToJSON,
3033
OpenShockProblemFromJSON,
@@ -53,6 +56,11 @@ export interface UserSharesBulkRemoveUserShareShockersRequest {
5356
requestBody?: Array<string>;
5457
}
5558

59+
export interface UserSharesBulkUserShareShockersUpdateRequest {
60+
userId: string;
61+
bulkUserShareShockersUpdateRequest?: BulkUserShareShockersUpdateRequest;
62+
}
63+
5664
export interface UserSharesCreateShareInviteRequest {
5765
createShareRequest?: CreateShareRequest;
5866
}
@@ -104,6 +112,22 @@ export interface UserShockerSharesApiInterface {
104112
*/
105113
userSharesBulkRemoveUserShareShockers(userId: string, requestBody?: Array<string>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RemoveUserSharesResponse>;
106114

115+
/**
116+
*
117+
* @summary Update user shares for a shocker
118+
* @param {string} userId
119+
* @param {BulkUserShareShockersUpdateRequest} [bulkUserShareShockersUpdateRequest]
120+
* @param {*} [options] Override http request option.
121+
* @throws {RequiredError}
122+
* @memberof UserShockerSharesApiInterface
123+
*/
124+
userSharesBulkUserShareShockersUpdateRaw(requestParameters: UserSharesBulkUserShareShockersUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
125+
126+
/**
127+
* Update user shares for a shocker
128+
*/
129+
userSharesBulkUserShareShockersUpdate(userId: string, bulkUserShareShockersUpdateRequest?: BulkUserShareShockersUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
130+
107131
/**
108132
*
109133
* @param {CreateShareRequest} [createShareRequest]
@@ -277,6 +301,45 @@ export class UserShockerSharesApi extends runtime.BaseAPI implements UserShocker
277301
return await response.value();
278302
}
279303

304+
/**
305+
* Update user shares for a shocker
306+
*/
307+
async userSharesBulkUserShareShockersUpdateRaw(requestParameters: UserSharesBulkUserShareShockersUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
308+
if (requestParameters['userId'] == null) {
309+
throw new runtime.RequiredError(
310+
'userId',
311+
'Required parameter "userId" was null or undefined when calling userSharesBulkUserShareShockersUpdate().'
312+
);
313+
}
314+
315+
const queryParameters: any = {};
316+
317+
const headerParameters: runtime.HTTPHeaders = {};
318+
319+
headerParameters['Content-Type'] = 'application/json';
320+
321+
322+
let urlPath = `/2/shares/user/{userId}/shockers`;
323+
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
324+
325+
const response = await this.request({
326+
path: urlPath,
327+
method: 'PATCH',
328+
headers: headerParameters,
329+
query: queryParameters,
330+
body: BulkUserShareShockersUpdateRequestToJSON(requestParameters['bulkUserShareShockersUpdateRequest']),
331+
}, initOverrides);
332+
333+
return new runtime.VoidApiResponse(response);
334+
}
335+
336+
/**
337+
* Update user shares for a shocker
338+
*/
339+
async userSharesBulkUserShareShockersUpdate(userId: string, bulkUserShareShockersUpdateRequest?: BulkUserShareShockersUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
340+
await this.userSharesBulkUserShareShockersUpdateRaw({ userId: userId, bulkUserShareShockersUpdateRequest: bulkUserShareShockersUpdateRequest }, initOverrides);
341+
}
342+
280343
/**
281344
*/
282345
async userSharesCreateShareInviteRaw(requestParameters: UserSharesCreateShareInviteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* OpenShock.API
5+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6+
*
7+
* The version of the OpenAPI document: 2
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
import { mapValues } from '../runtime';
16+
import type { ShockerPermissions } from './ShockerPermissions';
17+
import {
18+
ShockerPermissionsFromJSON,
19+
ShockerPermissionsFromJSONTyped,
20+
ShockerPermissionsToJSON,
21+
ShockerPermissionsToJSONTyped,
22+
} from './ShockerPermissions';
23+
import type { ShockerLimits } from './ShockerLimits';
24+
import {
25+
ShockerLimitsFromJSON,
26+
ShockerLimitsFromJSONTyped,
27+
ShockerLimitsToJSON,
28+
ShockerLimitsToJSONTyped,
29+
} from './ShockerLimits';
30+
31+
/**
32+
*
33+
* @export
34+
* @interface BulkUserShareShockersUpdateRequest
35+
*/
36+
export interface BulkUserShareShockersUpdateRequest {
37+
/**
38+
*
39+
* @type {ShockerPermissions}
40+
* @memberof BulkUserShareShockersUpdateRequest
41+
*/
42+
permissions: ShockerPermissions;
43+
/**
44+
*
45+
* @type {ShockerLimits}
46+
* @memberof BulkUserShareShockersUpdateRequest
47+
*/
48+
limits: ShockerLimits;
49+
/**
50+
*
51+
* @type {Array<string>}
52+
* @memberof BulkUserShareShockersUpdateRequest
53+
*/
54+
shockers: Array<string>;
55+
}
56+
57+
/**
58+
* Check if a given object implements the BulkUserShareShockersUpdateRequest interface.
59+
*/
60+
export function instanceOfBulkUserShareShockersUpdateRequest(value: object): value is BulkUserShareShockersUpdateRequest {
61+
if (!('permissions' in value) || value['permissions'] === undefined) return false;
62+
if (!('limits' in value) || value['limits'] === undefined) return false;
63+
if (!('shockers' in value) || value['shockers'] === undefined) return false;
64+
return true;
65+
}
66+
67+
export function BulkUserShareShockersUpdateRequestFromJSON(json: any): BulkUserShareShockersUpdateRequest {
68+
return BulkUserShareShockersUpdateRequestFromJSONTyped(json, false);
69+
}
70+
71+
export function BulkUserShareShockersUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkUserShareShockersUpdateRequest {
72+
if (json == null) {
73+
return json;
74+
}
75+
return {
76+
77+
'permissions': ShockerPermissionsFromJSON(json['permissions']),
78+
'limits': ShockerLimitsFromJSON(json['limits']),
79+
'shockers': json['shockers'],
80+
};
81+
}
82+
83+
export function BulkUserShareShockersUpdateRequestToJSON(json: any): BulkUserShareShockersUpdateRequest {
84+
return BulkUserShareShockersUpdateRequestToJSONTyped(json, false);
85+
}
86+
87+
export function BulkUserShareShockersUpdateRequestToJSONTyped(value?: BulkUserShareShockersUpdateRequest | null, ignoreDiscriminator: boolean = false): any {
88+
if (value == null) {
89+
return value;
90+
}
91+
92+
return {
93+
94+
'permissions': ShockerPermissionsToJSON(value['permissions']),
95+
'limits': ShockerLimitsToJSON(value['limits']),
96+
'shockers': value['shockers'],
97+
};
98+
}
99+

src/lib/api/internal/v2/models/ShareInviteBaseDetails.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
*/
1414

1515
import { mapValues } from '../runtime';
16-
import type { ShockerPermLimitPairWithId } from './ShockerPermLimitPairWithId';
17-
import {
18-
ShockerPermLimitPairWithIdFromJSON,
19-
ShockerPermLimitPairWithIdFromJSONTyped,
20-
ShockerPermLimitPairWithIdToJSON,
21-
ShockerPermLimitPairWithIdToJSONTyped,
22-
} from './ShockerPermLimitPairWithId';
2316
import type { BasicUserInfo } from './BasicUserInfo';
2417
import {
2518
BasicUserInfoFromJSON,
2619
BasicUserInfoFromJSONTyped,
2720
BasicUserInfoToJSON,
2821
BasicUserInfoToJSONTyped,
2922
} from './BasicUserInfo';
23+
import type { ShockerPermLimitPairWithIdAndName } from './ShockerPermLimitPairWithIdAndName';
24+
import {
25+
ShockerPermLimitPairWithIdAndNameFromJSON,
26+
ShockerPermLimitPairWithIdAndNameFromJSONTyped,
27+
ShockerPermLimitPairWithIdAndNameToJSON,
28+
ShockerPermLimitPairWithIdAndNameToJSONTyped,
29+
} from './ShockerPermLimitPairWithIdAndName';
3030

3131
/**
3232
*
@@ -60,10 +60,10 @@ export interface ShareInviteBaseDetails {
6060
sharedWith: BasicUserInfo;
6161
/**
6262
*
63-
* @type {Array<ShockerPermLimitPairWithId>}
63+
* @type {Array<ShockerPermLimitPairWithIdAndName>}
6464
* @memberof ShareInviteBaseDetails
6565
*/
66-
shockers: Array<ShockerPermLimitPairWithId>;
66+
shockers: Array<ShockerPermLimitPairWithIdAndName>;
6767
}
6868

6969
/**
@@ -92,7 +92,7 @@ export function ShareInviteBaseDetailsFromJSONTyped(json: any, ignoreDiscriminat
9292
'createdAt': (new Date(json['createdAt'])),
9393
'owner': BasicUserInfoFromJSON(json['owner']),
9494
'sharedWith': BasicUserInfoFromJSON(json['sharedWith']),
95-
'shockers': ((json['shockers'] as Array<any>).map(ShockerPermLimitPairWithIdFromJSON)),
95+
'shockers': ((json['shockers'] as Array<any>).map(ShockerPermLimitPairWithIdAndNameFromJSON)),
9696
};
9797
}
9898

@@ -111,7 +111,7 @@ export function ShareInviteBaseDetailsToJSONTyped(value?: ShareInviteBaseDetails
111111
'createdAt': value['createdAt'].toISOString(),
112112
'owner': BasicUserInfoToJSON(value['owner']),
113113
'sharedWith': BasicUserInfoToJSON(value['sharedWith']),
114-
'shockers': ((value['shockers'] as Array<any>).map(ShockerPermLimitPairWithIdToJSON)),
114+
'shockers': ((value['shockers'] as Array<any>).map(ShockerPermLimitPairWithIdAndNameToJSON)),
115115
};
116116
}
117117

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* OpenShock.API
5+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6+
*
7+
* The version of the OpenAPI document: 2
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
import { mapValues } from '../runtime';
16+
import type { ShockerPermissions } from './ShockerPermissions';
17+
import {
18+
ShockerPermissionsFromJSON,
19+
ShockerPermissionsFromJSONTyped,
20+
ShockerPermissionsToJSON,
21+
ShockerPermissionsToJSONTyped,
22+
} from './ShockerPermissions';
23+
import type { ShockerLimits } from './ShockerLimits';
24+
import {
25+
ShockerLimitsFromJSON,
26+
ShockerLimitsFromJSONTyped,
27+
ShockerLimitsToJSON,
28+
ShockerLimitsToJSONTyped,
29+
} from './ShockerLimits';
30+
31+
/**
32+
*
33+
* @export
34+
* @interface ShockerPermLimitPairWithIdAndName
35+
*/
36+
export interface ShockerPermLimitPairWithIdAndName {
37+
/**
38+
*
39+
* @type {ShockerPermissions}
40+
* @memberof ShockerPermLimitPairWithIdAndName
41+
*/
42+
permissions: ShockerPermissions;
43+
/**
44+
*
45+
* @type {ShockerLimits}
46+
* @memberof ShockerPermLimitPairWithIdAndName
47+
*/
48+
limits: ShockerLimits;
49+
/**
50+
*
51+
* @type {string}
52+
* @memberof ShockerPermLimitPairWithIdAndName
53+
*/
54+
id?: string;
55+
/**
56+
*
57+
* @type {string}
58+
* @memberof ShockerPermLimitPairWithIdAndName
59+
*/
60+
name: string;
61+
}
62+
63+
/**
64+
* Check if a given object implements the ShockerPermLimitPairWithIdAndName interface.
65+
*/
66+
export function instanceOfShockerPermLimitPairWithIdAndName(value: object): value is ShockerPermLimitPairWithIdAndName {
67+
if (!('permissions' in value) || value['permissions'] === undefined) return false;
68+
if (!('limits' in value) || value['limits'] === undefined) return false;
69+
if (!('name' in value) || value['name'] === undefined) return false;
70+
return true;
71+
}
72+
73+
export function ShockerPermLimitPairWithIdAndNameFromJSON(json: any): ShockerPermLimitPairWithIdAndName {
74+
return ShockerPermLimitPairWithIdAndNameFromJSONTyped(json, false);
75+
}
76+
77+
export function ShockerPermLimitPairWithIdAndNameFromJSONTyped(json: any, ignoreDiscriminator: boolean): ShockerPermLimitPairWithIdAndName {
78+
if (json == null) {
79+
return json;
80+
}
81+
return {
82+
83+
'permissions': ShockerPermissionsFromJSON(json['permissions']),
84+
'limits': ShockerLimitsFromJSON(json['limits']),
85+
'id': json['id'] == null ? undefined : json['id'],
86+
'name': json['name'],
87+
};
88+
}
89+
90+
export function ShockerPermLimitPairWithIdAndNameToJSON(json: any): ShockerPermLimitPairWithIdAndName {
91+
return ShockerPermLimitPairWithIdAndNameToJSONTyped(json, false);
92+
}
93+
94+
export function ShockerPermLimitPairWithIdAndNameToJSONTyped(value?: ShockerPermLimitPairWithIdAndName | null, ignoreDiscriminator: boolean = false): any {
95+
if (value == null) {
96+
return value;
97+
}
98+
99+
return {
100+
101+
'permissions': ShockerPermissionsToJSON(value['permissions']),
102+
'limits': ShockerLimitsToJSON(value['limits']),
103+
'id': value['id'],
104+
'name': value['name'],
105+
};
106+
}
107+

0 commit comments

Comments
 (0)