@meshtrade/api-web 1.40.0 → 1.42.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.
Files changed (28) hide show
  1. package/dist/meshtrade/compliance/client/v1/service_pb.d.ts +34 -2
  2. package/dist/meshtrade/compliance/client/v1/service_pb.js +9 -4
  3. package/dist/meshtrade/compliance/client/v1/service_web_meshts.d.ts +7 -1
  4. package/dist/meshtrade/compliance/client/v1/service_web_meshts.js +17 -0
  5. package/dist/meshtrade/iam/role/v1/role.js +2 -0
  6. package/dist/meshtrade/iam/role/v1/role_pb.d.ts +8 -0
  7. package/dist/meshtrade/iam/role/v1/role_pb.js +9 -1
  8. package/dist/meshtrade/iam/user/v1/service_pb.d.ts +0 -77
  9. package/dist/meshtrade/iam/user/v1/service_pb.js +4 -19
  10. package/dist/meshtrade/iam/user/v1/service_web_meshts.d.ts +1 -7
  11. package/dist/meshtrade/iam/user/v1/service_web_meshts.js +0 -17
  12. package/dist/meshtrade/iam/user/v1/user_pb.d.ts +45 -1
  13. package/dist/meshtrade/iam/user/v1/user_pb.js +7 -2
  14. package/dist/meshtrade/iam/user_profile/index.d.ts +1 -0
  15. package/dist/meshtrade/iam/user_profile/index.js +17 -0
  16. package/dist/meshtrade/iam/user_profile/v1/index.d.ts +3 -0
  17. package/dist/meshtrade/iam/user_profile/v1/index.js +44 -0
  18. package/dist/meshtrade/iam/user_profile/v1/service_pb.d.ts +197 -0
  19. package/dist/meshtrade/iam/user_profile/v1/service_pb.js +50 -0
  20. package/dist/meshtrade/iam/user_profile/v1/service_web_meshts.d.ts +109 -0
  21. package/dist/meshtrade/iam/user_profile/v1/service_web_meshts.js +202 -0
  22. package/dist/meshtrade/iam/user_profile/v1/user_profile_pb.d.ts +106 -0
  23. package/dist/meshtrade/iam/user_profile/v1/user_profile_pb.js +18 -0
  24. package/dist/meshtrade/option/method_options/v1/method_options_pb.d.ts +36 -0
  25. package/dist/meshtrade/option/method_options/v1/method_options_pb.js +30 -2
  26. package/dist/meshtrade/trading/limit_order/v1/service_pb.js +1 -1
  27. package/dist/meshtrade/wallet/account/v1/service_pb.js +1 -1
  28. package/package.json +17 -1
@@ -0,0 +1,197 @@
1
+ import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { UserProfile, UserProfileSchema } from "./user_profile_pb";
3
+ import type { Message } from "@bufbuild/protobuf";
4
+ /**
5
+ * Describes the file meshtrade/iam/user_profile/v1/service.proto.
6
+ */
7
+ export declare const file_meshtrade_iam_user_profile_v1_service: GenFile;
8
+ /**
9
+ *
10
+ * Request message for GetUserProfileByUser.
11
+ *
12
+ * Retrieves a user profile by specifying the associated user resource name.
13
+ *
14
+ * @generated from message meshtrade.iam.user_profile.v1.GetUserProfileByUserRequest
15
+ */
16
+ export type GetUserProfileByUserRequest = Message<"meshtrade.iam.user_profile.v1.GetUserProfileByUserRequest"> & {
17
+ /**
18
+ *
19
+ * The resource name of the user whose profile should be retrieved.
20
+ * Format: users/{ULIDv2}.
21
+ * This field is required.
22
+ *
23
+ * @generated from field: string user = 1;
24
+ */
25
+ user: string;
26
+ };
27
+ /**
28
+ * Describes the message meshtrade.iam.user_profile.v1.GetUserProfileByUserRequest.
29
+ * Use `create(GetUserProfileByUserRequestSchema)` to create a new message.
30
+ */
31
+ export declare const GetUserProfileByUserRequestSchema: GenMessage<GetUserProfileByUserRequest>;
32
+ /**
33
+ *
34
+ * Request message for UpdateUserProfile.
35
+ *
36
+ * Updates an existing user profile. Only the fields provided
37
+ * in the user_profile will be updated; omitted fields remain unchanged.
38
+ *
39
+ * @generated from message meshtrade.iam.user_profile.v1.UpdateUserProfileRequest
40
+ */
41
+ export type UpdateUserProfileRequest = Message<"meshtrade.iam.user_profile.v1.UpdateUserProfileRequest"> & {
42
+ /**
43
+ *
44
+ * The user profile with updated values.
45
+ * The name field must be set to identify which profile to update.
46
+ * Only provided fields will be modified.
47
+ *
48
+ * @generated from field: meshtrade.iam.user_profile.v1.UserProfile user_profile = 1;
49
+ */
50
+ userProfile?: UserProfile;
51
+ };
52
+ /**
53
+ * Describes the message meshtrade.iam.user_profile.v1.UpdateUserProfileRequest.
54
+ * Use `create(UpdateUserProfileRequestSchema)` to create a new message.
55
+ */
56
+ export declare const UpdateUserProfileRequestSchema: GenMessage<UpdateUserProfileRequest>;
57
+ /**
58
+ *
59
+ *
60
+ * Request message for GetUserProfile.
61
+ *
62
+ * Retrieves a specific user profile by its resource name.
63
+ *
64
+ * @generated from message meshtrade.iam.user_profile.v1.GetUserProfileRequest
65
+ */
66
+ export type GetUserProfileRequest = Message<"meshtrade.iam.user_profile.v1.GetUserProfileRequest"> & {
67
+ /**
68
+ *
69
+ * The resource name of the user profile to retrieve.
70
+ * Format: user_profiles/{ULIDv2}.
71
+ * This field is required.
72
+ *
73
+ * @generated from field: string name = 1;
74
+ */
75
+ name: string;
76
+ };
77
+ /**
78
+ * Describes the message meshtrade.iam.user_profile.v1.GetUserProfileRequest.
79
+ * Use `create(GetUserProfileRequestSchema)` to create a new message.
80
+ */
81
+ export declare const GetUserProfileRequestSchema: GenMessage<GetUserProfileRequest>;
82
+ /**
83
+ *
84
+ * Request message for ListUserProfiles.
85
+ *
86
+ * Lists all user profiles accessible to the caller based on
87
+ * their role permissions and group ownership.
88
+ *
89
+ * @generated from message meshtrade.iam.user_profile.v1.ListUserProfilesRequest
90
+ */
91
+ export type ListUserProfilesRequest = Message<"meshtrade.iam.user_profile.v1.ListUserProfilesRequest"> & {};
92
+ /**
93
+ * Describes the message meshtrade.iam.user_profile.v1.ListUserProfilesRequest.
94
+ * Use `create(ListUserProfilesRequestSchema)` to create a new message.
95
+ */
96
+ export declare const ListUserProfilesRequestSchema: GenMessage<ListUserProfilesRequest>;
97
+ /**
98
+ *
99
+ * Response message for ListUserProfiles.
100
+ *
101
+ * Contains the collection of user profiles accessible to the caller.
102
+ *
103
+ * @generated from message meshtrade.iam.user_profile.v1.ListUserProfilesResponse
104
+ */
105
+ export type ListUserProfilesResponse = Message<"meshtrade.iam.user_profile.v1.ListUserProfilesResponse"> & {
106
+ /**
107
+ *
108
+ * The list of user profiles.
109
+ * Ordered by creation time, with most recent first.
110
+ *
111
+ * @generated from field: repeated meshtrade.iam.user_profile.v1.UserProfile user_profiles = 1;
112
+ */
113
+ userProfiles: UserProfile[];
114
+ };
115
+ /**
116
+ * Describes the message meshtrade.iam.user_profile.v1.ListUserProfilesResponse.
117
+ * Use `create(ListUserProfilesResponseSchema)` to create a new message.
118
+ */
119
+ export declare const ListUserProfilesResponseSchema: GenMessage<ListUserProfilesResponse>;
120
+ /**
121
+ *
122
+ * UserProfileService manages user profile information and preferences.
123
+ *
124
+ * User profiles contain display preferences, localization settings, and
125
+ * personalization data for authenticated users in the IAM system.
126
+ * Each profile is linked to a specific user and owned by a group.
127
+ *
128
+ * @generated from service meshtrade.iam.user_profile.v1.UserProfileService
129
+ */
130
+ export declare const UserProfileService: GenService<{
131
+ /**
132
+ *
133
+ * Updates an existing user profile.
134
+ *
135
+ * Allows modification of profile information including display name,
136
+ * profile picture, locale preferences, and currency settings.
137
+ * Only the fields provided in the request will be updated.
138
+ *
139
+ * Returns the updated UserProfile resource.
140
+ *
141
+ * @generated from rpc meshtrade.iam.user_profile.v1.UserProfileService.UpdateUserProfile
142
+ */
143
+ updateUserProfile: {
144
+ methodKind: "unary";
145
+ input: typeof UpdateUserProfileRequestSchema;
146
+ output: typeof UserProfileSchema;
147
+ };
148
+ /**
149
+ *
150
+ * Retrieves a user profile by its resource name.
151
+ *
152
+ * Fetches the complete user profile information including all
153
+ * preferences and settings for the specified user profile ID.
154
+ *
155
+ * Returns the requested UserProfile resource.
156
+ *
157
+ * @generated from rpc meshtrade.iam.user_profile.v1.UserProfileService.GetUserProfile
158
+ */
159
+ getUserProfile: {
160
+ methodKind: "unary";
161
+ input: typeof GetUserProfileRequestSchema;
162
+ output: typeof UserProfileSchema;
163
+ };
164
+ /**
165
+ *
166
+ * Retrieves a user profile by the associated user resource name.
167
+ *
168
+ * Looks up and returns the user profile linked to a specific user ID.
169
+ * This is useful when you have a user resource and need to find
170
+ * their associated profile information.
171
+ *
172
+ * Returns the UserProfile resource associated with the specified user.
173
+ *
174
+ * @generated from rpc meshtrade.iam.user_profile.v1.UserProfileService.GetUserProfileByUser
175
+ */
176
+ getUserProfileByUser: {
177
+ methodKind: "unary";
178
+ input: typeof GetUserProfileByUserRequestSchema;
179
+ output: typeof UserProfileSchema;
180
+ };
181
+ /**
182
+ *
183
+ * Lists all user_profiles accessible to the caller.
184
+ *
185
+ * Returns a collection of all user_profiles within the caller's
186
+ * access scope based on group ownership and role permissions.
187
+ *
188
+ * Returns a ListUserProfilesResponse containing all accessible user_profiles.
189
+ *
190
+ * @generated from rpc meshtrade.iam.user_profile.v1.UserProfileService.ListUserProfiles
191
+ */
192
+ listUserProfiles: {
193
+ methodKind: "unary";
194
+ input: typeof ListUserProfilesRequestSchema;
195
+ output: typeof ListUserProfilesResponseSchema;
196
+ };
197
+ }>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // @generated by protoc-gen-es v2.10.1 with parameter "target=ts"
3
+ // @generated from file meshtrade/iam/user_profile/v1/service.proto (package meshtrade.iam.user_profile.v1, syntax proto3)
4
+ /* eslint-disable */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UserProfileService = exports.ListUserProfilesResponseSchema = exports.ListUserProfilesRequestSchema = exports.GetUserProfileRequestSchema = exports.UpdateUserProfileRequestSchema = exports.GetUserProfileByUserRequestSchema = exports.file_meshtrade_iam_user_profile_v1_service = void 0;
7
+ const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
8
+ const validate_pb_1 = require("../../../../buf/validate/validate_pb");
9
+ const user_profile_pb_1 = require("./user_profile_pb");
10
+ const method_options_pb_1 = require("../../../option/method_options/v1/method_options_pb");
11
+ /**
12
+ * Describes the file meshtrade/iam/user_profile/v1/service.proto.
13
+ */
14
+ exports.file_meshtrade_iam_user_profile_v1_service = (0, codegenv2_1.f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LnYxLkxpc3RVc2VyUHJvZmlsZXNSZXF1ZXN0GjcubWVzaHRyYWRlLmlhbS51c2VyX3Byb2ZpbGUudjEuTGlzdFVzZXJQcm9maWxlc1Jlc3BvbnNlIhqytRgWCAEQAhoQwI23AcGNtwHIjbcByY23AUJnCiRjby5tZXNodHJhZGUuYXBpLmlhbS51c2VyX3Byb2ZpbGUudjFaP2dpdGh1Yi5jb20vbWVzaHRyYWRlL2FwaS9nby9pYW0vdXNlcl9wcm9maWxlL3YxO3VzZXJfcHJvZmlsZV92MWIGcHJvdG8z", [validate_pb_1.file_buf_validate_validate, user_profile_pb_1.file_meshtrade_iam_user_profile_v1_user_profile, method_options_pb_1.file_meshtrade_option_method_options_v1_method_options]);
15
+ /**
16
+ * Describes the message meshtrade.iam.user_profile.v1.GetUserProfileByUserRequest.
17
+ * Use `create(GetUserProfileByUserRequestSchema)` to create a new message.
18
+ */
19
+ exports.GetUserProfileByUserRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_meshtrade_iam_user_profile_v1_service, 0);
20
+ /**
21
+ * Describes the message meshtrade.iam.user_profile.v1.UpdateUserProfileRequest.
22
+ * Use `create(UpdateUserProfileRequestSchema)` to create a new message.
23
+ */
24
+ exports.UpdateUserProfileRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_meshtrade_iam_user_profile_v1_service, 1);
25
+ /**
26
+ * Describes the message meshtrade.iam.user_profile.v1.GetUserProfileRequest.
27
+ * Use `create(GetUserProfileRequestSchema)` to create a new message.
28
+ */
29
+ exports.GetUserProfileRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_meshtrade_iam_user_profile_v1_service, 2);
30
+ /**
31
+ * Describes the message meshtrade.iam.user_profile.v1.ListUserProfilesRequest.
32
+ * Use `create(ListUserProfilesRequestSchema)` to create a new message.
33
+ */
34
+ exports.ListUserProfilesRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_meshtrade_iam_user_profile_v1_service, 3);
35
+ /**
36
+ * Describes the message meshtrade.iam.user_profile.v1.ListUserProfilesResponse.
37
+ * Use `create(ListUserProfilesResponseSchema)` to create a new message.
38
+ */
39
+ exports.ListUserProfilesResponseSchema = (0, codegenv2_1.messageDesc)(exports.file_meshtrade_iam_user_profile_v1_service, 4);
40
+ /**
41
+ *
42
+ * UserProfileService manages user profile information and preferences.
43
+ *
44
+ * User profiles contain display preferences, localization settings, and
45
+ * personalization data for authenticated users in the IAM system.
46
+ * Each profile is linked to a specific user and owned by a group.
47
+ *
48
+ * @generated from service meshtrade.iam.user_profile.v1.UserProfileService
49
+ */
50
+ exports.UserProfileService = (0, codegenv2_1.serviceDesc)(exports.file_meshtrade_iam_user_profile_v1_service, 0);
@@ -0,0 +1,109 @@
1
+ import { GetUserProfileByUserRequest, GetUserProfileRequest, ListUserProfilesRequest, ListUserProfilesResponse, UpdateUserProfileRequest } from "./service_pb";
2
+ import { UserProfile } from "./user_profile_pb";
3
+ import { ClientOption } from "../../../config";
4
+ /**
5
+ * Web client for interacting with the meshtrade.iam.user_profile.v1 user profile v1 API resource service.
6
+ * Uses Connect-ES with gRPC-Web transport for browser-based communication.
7
+ *
8
+ * Supports flexible authentication modes using functional options pattern:
9
+ *
10
+ * 1. **No Authentication** (public APIs):
11
+ * ```typescript
12
+ * const client = new UserProfileServiceWeb(
13
+ * WithServerUrl("http://localhost:10000")
14
+ * );
15
+ * ```
16
+ *
17
+ * 2. **API Key Authentication** (backend services):
18
+ * ```typescript
19
+ * const client = new UserProfileServiceWeb(
20
+ * WithAPIKey("your-api-key"),
21
+ * WithGroup("groups/01ARZ3NDEKTSV4YWVF8F5BH32"),
22
+ * WithServerUrl("https://api.example.com")
23
+ * );
24
+ * ```
25
+ *
26
+ * 3. **JWT Token Authentication** (Next.js frontend with user session):
27
+ * ```typescript
28
+ * const client = new UserProfileServiceWeb(
29
+ * WithJWTAccessToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."),
30
+ * WithServerUrl("https://api.example.com")
31
+ * );
32
+ * ```
33
+ *
34
+ * 4. **JWT with Group Context** (user session with specific group):
35
+ * ```typescript
36
+ * const client = new UserProfileServiceWeb(
37
+ * WithJWTAccessToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."),
38
+ * WithGroup("groups/01ARZ3NDEKTSV4YWVF8F5BH32"),
39
+ * WithServerUrl("https://api.example.com")
40
+ * );
41
+ * ```
42
+ *
43
+ * Available options:
44
+ * - `WithAPIKey(key)` - API key authentication (mutually exclusive with JWT)
45
+ * - `WithJWTAccessToken(token)` - JWT authentication (mutually exclusive with API key)
46
+ * - `WithGroup(group)` - Group context (optional, works with both auth modes)
47
+ * - `WithServerUrl(url)` - Custom server URL (optional, defaults to production)
48
+ */
49
+ export declare class UserProfileServiceWeb {
50
+ private _client;
51
+ private readonly _config;
52
+ private readonly _interceptors;
53
+ private readonly _validator;
54
+ /**
55
+ * Constructs an instance of UserProfileServiceWeb.
56
+ *
57
+ * Uses functional options pattern for flexible configuration:
58
+ * - `WithAPIKey(key)` - API key authentication
59
+ * - `WithJWTAccessToken(token)` - JWT authentication
60
+ * - `WithGroup(group)` - Group context (optional)
61
+ * - `WithServerUrl(url)` - Custom server URL (optional)
62
+ *
63
+ * @param {...ClientOption} opts - Variable number of configuration options
64
+ */
65
+ constructor(...opts: ClientOption[]);
66
+ /**
67
+ * Returns a new client instance configured to send the specified group
68
+ * resource name in the request headers for subsequent API calls.
69
+ *
70
+ * This method creates a new client with the same authentication configuration
71
+ * but with the group context updated to the specified value.
72
+ *
73
+ * **Compatibility**: Works with all authentication modes:
74
+ * - **API key auth**: Creates new client with API key + new group
75
+ * - **JWT auth**: Creates new client with JWT + new group
76
+ * - **No auth**: Creates new client with standalone group interceptor
77
+ *
78
+ * @param {string} group - The operating group context to inject into the request
79
+ * in the format `groups/{ulid}` where {ulid} is a 26-character ULID.
80
+ * Example: 'groups/01ARZ3NDEKTSV4YWVF8F5BH32'
81
+ * @returns {UserProfileServiceWeb} A new, configured instance of the client.
82
+ * @throws {Error} If the group format is invalid
83
+ */
84
+ withGroup(group: string): UserProfileServiceWeb;
85
+ /**
86
+ * Updates an existing user profile.
87
+ * @param {UpdateUserProfileRequest} request - The request object for updateuserprofile.
88
+ * @returns {Promise<UserProfile>} A promise that resolves with the user profile.
89
+ */
90
+ updateUserProfile(request: UpdateUserProfileRequest): Promise<UserProfile>;
91
+ /**
92
+ * Retrieves an user profile.
93
+ * @param {GetUserProfileRequest} request - The request object for getuserprofile.
94
+ * @returns {Promise<UserProfile>} A promise that resolves with the user profile.
95
+ */
96
+ getUserProfile(request: GetUserProfileRequest): Promise<UserProfile>;
97
+ /**
98
+ * Retrieves an user profile.
99
+ * @param {GetUserProfileByUserRequest} request - The request object for getuserprofilebyuser.
100
+ * @returns {Promise<UserProfile>} A promise that resolves with the user profile.
101
+ */
102
+ getUserProfileByUser(request: GetUserProfileByUserRequest): Promise<UserProfile>;
103
+ /**
104
+ * Retrieves a list of user profiles.
105
+ * @param {ListUserProfilesRequest} request - The request object for listuserprofiles.
106
+ * @returns {Promise<ListUserProfilesResponse>} A promise that resolves with the list of user profiles.
107
+ */
108
+ listUserProfiles(request: ListUserProfilesRequest): Promise<ListUserProfilesResponse>;
109
+ }
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-meshts. DO NOT EDIT.
3
+ // @generated by protoc-gen-meshts v1
4
+ // @generated from file meshtrade/iam/user_profile/v1/service.proto (package meshtrade.iam.user_profile.v1, syntax proto3)
5
+ /* eslint-disable */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.UserProfileServiceWeb = void 0;
8
+ const connect_1 = require("@connectrpc/connect");
9
+ const connect_web_1 = require("@connectrpc/connect-web");
10
+ const service_pb_1 = require("./service_pb");
11
+ const service_pb_2 = require("./service_pb");
12
+ const config_1 = require("../../../config");
13
+ const protovalidate_1 = require("@bufbuild/protovalidate");
14
+ const interceptors_1 = require("../../../interceptors");
15
+ /**
16
+ * Web client for interacting with the meshtrade.iam.user_profile.v1 user profile v1 API resource service.
17
+ * Uses Connect-ES with gRPC-Web transport for browser-based communication.
18
+ *
19
+ * Supports flexible authentication modes using functional options pattern:
20
+ *
21
+ * 1. **No Authentication** (public APIs):
22
+ * ```typescript
23
+ * const client = new UserProfileServiceWeb(
24
+ * WithServerUrl("http://localhost:10000")
25
+ * );
26
+ * ```
27
+ *
28
+ * 2. **API Key Authentication** (backend services):
29
+ * ```typescript
30
+ * const client = new UserProfileServiceWeb(
31
+ * WithAPIKey("your-api-key"),
32
+ * WithGroup("groups/01ARZ3NDEKTSV4YWVF8F5BH32"),
33
+ * WithServerUrl("https://api.example.com")
34
+ * );
35
+ * ```
36
+ *
37
+ * 3. **JWT Token Authentication** (Next.js frontend with user session):
38
+ * ```typescript
39
+ * const client = new UserProfileServiceWeb(
40
+ * WithJWTAccessToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."),
41
+ * WithServerUrl("https://api.example.com")
42
+ * );
43
+ * ```
44
+ *
45
+ * 4. **JWT with Group Context** (user session with specific group):
46
+ * ```typescript
47
+ * const client = new UserProfileServiceWeb(
48
+ * WithJWTAccessToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."),
49
+ * WithGroup("groups/01ARZ3NDEKTSV4YWVF8F5BH32"),
50
+ * WithServerUrl("https://api.example.com")
51
+ * );
52
+ * ```
53
+ *
54
+ * Available options:
55
+ * - `WithAPIKey(key)` - API key authentication (mutually exclusive with JWT)
56
+ * - `WithJWTAccessToken(token)` - JWT authentication (mutually exclusive with API key)
57
+ * - `WithGroup(group)` - Group context (optional, works with both auth modes)
58
+ * - `WithServerUrl(url)` - Custom server URL (optional, defaults to production)
59
+ */
60
+ class UserProfileServiceWeb {
61
+ /**
62
+ * Constructs an instance of UserProfileServiceWeb.
63
+ *
64
+ * Uses functional options pattern for flexible configuration:
65
+ * - `WithAPIKey(key)` - API key authentication
66
+ * - `WithJWTAccessToken(token)` - JWT authentication
67
+ * - `WithGroup(group)` - Group context (optional)
68
+ * - `WithServerUrl(url)` - Custom server URL (optional)
69
+ *
70
+ * @param {...ClientOption} opts - Variable number of configuration options
71
+ */
72
+ constructor(...opts) {
73
+ // Build configuration from options
74
+ this._config = (0, config_1.buildConfigFromOptions)(...opts);
75
+ // Initialize validator for request validation
76
+ this._validator = (0, protovalidate_1.createValidator)();
77
+ this._interceptors = [];
78
+ this._interceptors.push((0, interceptors_1.createLoggingInterceptor)());
79
+ if (this._config.apiKey) {
80
+ this._interceptors.push((0, interceptors_1.createApiKeyInterceptor)(this._config.apiKey));
81
+ }
82
+ if (this._config.jwtToken) {
83
+ this._interceptors.push((0, interceptors_1.createJwtInterceptor)(this._config.jwtToken));
84
+ }
85
+ if (this._config.group) {
86
+ this._interceptors.push((0, interceptors_1.createGroupInterceptor)(this._config.group));
87
+ }
88
+ // Create the gRPC-Web transport for browser with interceptors
89
+ // Custom fetch wrapper to include credentials for cookie-based authentication
90
+ const transport = (0, connect_web_1.createGrpcWebTransport)({
91
+ baseUrl: this._config.apiServerURL,
92
+ interceptors: this._interceptors,
93
+ fetch: (input, init) => fetch(input, { ...init, credentials: "include" }),
94
+ });
95
+ // Construct the Connect-ES client
96
+ this._client = (0, connect_1.createClient)(service_pb_1.UserProfileService, transport);
97
+ }
98
+ /**
99
+ * Returns a new client instance configured to send the specified group
100
+ * resource name in the request headers for subsequent API calls.
101
+ *
102
+ * This method creates a new client with the same authentication configuration
103
+ * but with the group context updated to the specified value.
104
+ *
105
+ * **Compatibility**: Works with all authentication modes:
106
+ * - **API key auth**: Creates new client with API key + new group
107
+ * - **JWT auth**: Creates new client with JWT + new group
108
+ * - **No auth**: Creates new client with standalone group interceptor
109
+ *
110
+ * @param {string} group - The operating group context to inject into the request
111
+ * in the format `groups/{ulid}` where {ulid} is a 26-character ULID.
112
+ * Example: 'groups/01ARZ3NDEKTSV4YWVF8F5BH32'
113
+ * @returns {UserProfileServiceWeb} A new, configured instance of the client.
114
+ * @throws {Error} If the group format is invalid
115
+ */
116
+ withGroup(group) {
117
+ // Build new options array with existing auth and updated group
118
+ const newOpts = [];
119
+ // Add server URL
120
+ newOpts.push((0, config_1.WithServerUrl)(this._config.apiServerURL));
121
+ // Add authentication (preserve existing mode)
122
+ if (this._config.apiKey) {
123
+ newOpts.push((0, config_1.WithAPIKey)(this._config.apiKey));
124
+ }
125
+ else if (this._config.jwtToken) {
126
+ newOpts.push((0, config_1.WithJWTAccessToken)(this._config.jwtToken));
127
+ }
128
+ // Add the new group
129
+ newOpts.push((0, config_1.WithGroup)(group));
130
+ // Return a new client instance with updated configuration
131
+ return new UserProfileServiceWeb(...newOpts);
132
+ }
133
+ /**
134
+ * Updates an existing user profile.
135
+ * @param {UpdateUserProfileRequest} request - The request object for updateuserprofile.
136
+ * @returns {Promise<UserProfile>} A promise that resolves with the user profile.
137
+ */
138
+ updateUserProfile(request) {
139
+ // Validate request
140
+ const result = this._validator.validate(service_pb_2.UpdateUserProfileRequestSchema, request);
141
+ if (result.kind === "invalid") {
142
+ const violations = result.violations.map(v => `${v.field.toString()}: ${v.message}`).join("; ");
143
+ throw new Error(`Validation failed: ${violations}`);
144
+ }
145
+ else if (result.kind === "error") {
146
+ throw result.error;
147
+ }
148
+ return this._client.updateUserProfile(request);
149
+ }
150
+ /**
151
+ * Retrieves an user profile.
152
+ * @param {GetUserProfileRequest} request - The request object for getuserprofile.
153
+ * @returns {Promise<UserProfile>} A promise that resolves with the user profile.
154
+ */
155
+ getUserProfile(request) {
156
+ // Validate request
157
+ const result = this._validator.validate(service_pb_2.GetUserProfileRequestSchema, request);
158
+ if (result.kind === "invalid") {
159
+ const violations = result.violations.map(v => `${v.field.toString()}: ${v.message}`).join("; ");
160
+ throw new Error(`Validation failed: ${violations}`);
161
+ }
162
+ else if (result.kind === "error") {
163
+ throw result.error;
164
+ }
165
+ return this._client.getUserProfile(request);
166
+ }
167
+ /**
168
+ * Retrieves an user profile.
169
+ * @param {GetUserProfileByUserRequest} request - The request object for getuserprofilebyuser.
170
+ * @returns {Promise<UserProfile>} A promise that resolves with the user profile.
171
+ */
172
+ getUserProfileByUser(request) {
173
+ // Validate request
174
+ const result = this._validator.validate(service_pb_2.GetUserProfileByUserRequestSchema, request);
175
+ if (result.kind === "invalid") {
176
+ const violations = result.violations.map(v => `${v.field.toString()}: ${v.message}`).join("; ");
177
+ throw new Error(`Validation failed: ${violations}`);
178
+ }
179
+ else if (result.kind === "error") {
180
+ throw result.error;
181
+ }
182
+ return this._client.getUserProfileByUser(request);
183
+ }
184
+ /**
185
+ * Retrieves a list of user profiles.
186
+ * @param {ListUserProfilesRequest} request - The request object for listuserprofiles.
187
+ * @returns {Promise<ListUserProfilesResponse>} A promise that resolves with the list of user profiles.
188
+ */
189
+ listUserProfiles(request) {
190
+ // Validate request
191
+ const result = this._validator.validate(service_pb_2.ListUserProfilesRequestSchema, request);
192
+ if (result.kind === "invalid") {
193
+ const violations = result.violations.map(v => `${v.field.toString()}: ${v.message}`).join("; ");
194
+ throw new Error(`Validation failed: ${violations}`);
195
+ }
196
+ else if (result.kind === "error") {
197
+ throw result.error;
198
+ }
199
+ return this._client.listUserProfiles(request);
200
+ }
201
+ }
202
+ exports.UserProfileServiceWeb = UserProfileServiceWeb;
@@ -0,0 +1,106 @@
1
+ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Token } from "../../../type/v1/token_pb";
3
+ import type { Message } from "@bufbuild/protobuf";
4
+ /**
5
+ * Describes the file meshtrade/iam/user_profile/v1/user_profile.proto.
6
+ */
7
+ export declare const file_meshtrade_iam_user_profile_v1_user_profile: GenFile;
8
+ /**
9
+ *
10
+ * A user_profile in the IAM user_profile service.
11
+ *
12
+ * Each User Profile belongs to a specific user
13
+ *
14
+ * @generated from message meshtrade.iam.user_profile.v1.UserProfile
15
+ */
16
+ export type UserProfile = Message<"meshtrade.iam.user_profile.v1.UserProfile"> & {
17
+ /**
18
+ *
19
+ * The unique resource name for the user_profiles.
20
+ * Format: user_profiles/{ULIDv2}.
21
+ * This field is system-generated and immutable upon creation.
22
+ * Any value provided on creation is ignored.
23
+ *
24
+ * @generated from field: string name = 1;
25
+ */
26
+ name: string;
27
+ /**
28
+ *
29
+ * The resource name of the parent group that owns this user_profile.
30
+ * This field is required on creation and establishes the direct ownership link.
31
+ * Format: groups/{ULIDv2}.
32
+ *
33
+ * @generated from field: string owner = 2;
34
+ */
35
+ owner: string;
36
+ /**
37
+ *
38
+ * Ownership hiearchy of groups that have access to this resource in the format groups/{group_id}.
39
+ * System set on creation.
40
+ *
41
+ * @generated from field: repeated string owners = 3;
42
+ */
43
+ owners: string[];
44
+ /**
45
+ *
46
+ * The resource name of the user associated with this profile.
47
+ * Format: users/{ULIDv2}.
48
+ * This field links the user profile to a specific user resource.
49
+ * This field is required.
50
+ *
51
+ * @generated from field: string user = 4;
52
+ */
53
+ user: string;
54
+ /**
55
+ *
56
+ * The locale/language preference for this user profile.
57
+ * Format: IETF BCP 47 language tag (e.g., "en", "en-US", "fr-FR", "zh-Hans-CN").
58
+ * Used for internationalization and localization of the user interface.
59
+ * This field is optional but must be a valid BCP 47 tag when provided.
60
+ *
61
+ * @generated from field: string locale = 5;
62
+ */
63
+ locale: string;
64
+ /**
65
+ *
66
+ * URL to the user's profile picture or avatar image.
67
+ * Should be a valid HTTPS URL pointing to an accessible image resource.
68
+ * Used for displaying user identity in the application interface.
69
+ * This field is optional but must be a valid URI when provided.
70
+ *
71
+ * @generated from field: string profile_picture_url = 6;
72
+ */
73
+ profilePictureUrl: string;
74
+ /**
75
+ *
76
+ * The display name shown for this user in the application.
77
+ * This field is required and represents how the user is identified to others.
78
+ * May be the user's full name, nickname, or preferred identifier.
79
+ *
80
+ * @generated from field: string display_name = 7;
81
+ */
82
+ displayName: string;
83
+ /**
84
+ *
85
+ * The preferred currency token for displaying monetary values to this user.
86
+ * Used as the default currency for presenting prices, balances, and trading values.
87
+ * References a token from the meshtrade.type.v1.Token definition.
88
+ *
89
+ * @generated from field: meshtrade.type.v1.Token display_currency = 8;
90
+ */
91
+ displayCurrency?: Token;
92
+ /**
93
+ *
94
+ * The currency token used for financial reporting and accounting purposes.
95
+ * This may differ from display_currency and is used for official records and statements.
96
+ * References a token from the meshtrade.type.v1.Token definition.
97
+ *
98
+ * @generated from field: meshtrade.type.v1.Token reporting_currency = 9;
99
+ */
100
+ reportingCurrency?: Token;
101
+ };
102
+ /**
103
+ * Describes the message meshtrade.iam.user_profile.v1.UserProfile.
104
+ * Use `create(UserProfileSchema)` to create a new message.
105
+ */
106
+ export declare const UserProfileSchema: GenMessage<UserProfile>;