@forwardimpact/librpc 0.1.107 → 0.1.109

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.
@@ -28,15 +28,12 @@ export class GhuserClient extends Client {
28
28
  * @returns { Promise<ghuser.BeginResponse> } Typed response message.
29
29
  */
30
30
  async Begin(req) {
31
- // Type validation
32
- if (!(req instanceof ghuser.BeginRequest)) {
33
- throw new TypeError(
34
- `Begin: Expected parameter to be instanceof ghuser.BeginRequest`,
35
- );
36
- }
37
-
38
- // Convert to plain object
39
- const request = ghuser.BeginRequest.toObject(req);
31
+ // Accept a typed message or a plain init object (coerced to the typed type).
32
+ const message =
33
+ req instanceof ghuser.BeginRequest
34
+ ? req
35
+ : new ghuser.BeginRequest(req);
36
+ const request = ghuser.BeginRequest.toObject(message);
40
37
 
41
38
  // Make gRPC call (tracing handled by base Client class)
42
39
  return this.callUnary("Begin", request, (res) => ghuser.BeginResponse.fromObject(res));
@@ -48,15 +45,12 @@ export class GhuserClient extends Client {
48
45
  * @returns { Promise<ghuser.CompleteResponse> } Typed response message.
49
46
  */
50
47
  async Complete(req) {
51
- // Type validation
52
- if (!(req instanceof ghuser.CompleteRequest)) {
53
- throw new TypeError(
54
- `Complete: Expected parameter to be instanceof ghuser.CompleteRequest`,
55
- );
56
- }
57
-
58
- // Convert to plain object
59
- const request = ghuser.CompleteRequest.toObject(req);
48
+ // Accept a typed message or a plain init object (coerced to the typed type).
49
+ const message =
50
+ req instanceof ghuser.CompleteRequest
51
+ ? req
52
+ : new ghuser.CompleteRequest(req);
53
+ const request = ghuser.CompleteRequest.toObject(message);
60
54
 
61
55
  // Make gRPC call (tracing handled by base Client class)
62
56
  return this.callUnary("Complete", request, (res) => ghuser.CompleteResponse.fromObject(res));
@@ -68,15 +62,12 @@ export class GhuserClient extends Client {
68
62
  * @returns { Promise<ghuser.RedeemResponse> } Typed response message.
69
63
  */
70
64
  async Redeem(req) {
71
- // Type validation
72
- if (!(req instanceof ghuser.RedeemRequest)) {
73
- throw new TypeError(
74
- `Redeem: Expected parameter to be instanceof ghuser.RedeemRequest`,
75
- );
76
- }
77
-
78
- // Convert to plain object
79
- const request = ghuser.RedeemRequest.toObject(req);
65
+ // Accept a typed message or a plain init object (coerced to the typed type).
66
+ const message =
67
+ req instanceof ghuser.RedeemRequest
68
+ ? req
69
+ : new ghuser.RedeemRequest(req);
70
+ const request = ghuser.RedeemRequest.toObject(message);
80
71
 
81
72
  // Make gRPC call (tracing handled by base Client class)
82
73
  return this.callUnary("Redeem", request, (res) => ghuser.RedeemResponse.fromObject(res));
@@ -88,15 +79,12 @@ export class GhuserClient extends Client {
88
79
  * @returns { Promise<ghuser.GetTokenResponse> } Typed response message.
89
80
  */
90
81
  async GetToken(req) {
91
- // Type validation
92
- if (!(req instanceof ghuser.GetTokenRequest)) {
93
- throw new TypeError(
94
- `GetToken: Expected parameter to be instanceof ghuser.GetTokenRequest`,
95
- );
96
- }
97
-
98
- // Convert to plain object
99
- const request = ghuser.GetTokenRequest.toObject(req);
82
+ // Accept a typed message or a plain init object (coerced to the typed type).
83
+ const message =
84
+ req instanceof ghuser.GetTokenRequest
85
+ ? req
86
+ : new ghuser.GetTokenRequest(req);
87
+ const request = ghuser.GetTokenRequest.toObject(message);
100
88
 
101
89
  // Make gRPC call (tracing handled by base Client class)
102
90
  return this.callUnary("GetToken", request, (res) => ghuser.GetTokenResponse.fromObject(res));
@@ -108,15 +96,12 @@ export class GhuserClient extends Client {
108
96
  * @returns { Promise<common.Empty> } Typed response message.
109
97
  */
110
98
  async Revoke(req) {
111
- // Type validation
112
- if (!(req instanceof ghuser.RevokeRequest)) {
113
- throw new TypeError(
114
- `Revoke: Expected parameter to be instanceof ghuser.RevokeRequest`,
115
- );
116
- }
117
-
118
- // Convert to plain object
119
- const request = ghuser.RevokeRequest.toObject(req);
99
+ // Accept a typed message or a plain init object (coerced to the typed type).
100
+ const message =
101
+ req instanceof ghuser.RevokeRequest
102
+ ? req
103
+ : new ghuser.RevokeRequest(req);
104
+ const request = ghuser.RevokeRequest.toObject(message);
120
105
 
121
106
  // Make gRPC call (tracing handled by base Client class)
122
107
  return this.callUnary("Revoke", request, (res) => common.Empty.fromObject(res));
@@ -28,15 +28,12 @@ export class GraphClient extends Client {
28
28
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
29
29
  */
30
30
  async QueryByPattern(req) {
31
- // Type validation
32
- if (!(req instanceof graph.PatternQuery)) {
33
- throw new TypeError(
34
- `QueryByPattern: Expected parameter to be instanceof graph.PatternQuery`,
35
- );
36
- }
37
-
38
- // Convert to plain object
39
- const request = graph.PatternQuery.toObject(req);
31
+ // Accept a typed message or a plain init object (coerced to the typed type).
32
+ const message =
33
+ req instanceof graph.PatternQuery
34
+ ? req
35
+ : new graph.PatternQuery(req);
36
+ const request = graph.PatternQuery.toObject(message);
40
37
 
41
38
  // Make gRPC call (tracing handled by base Client class)
42
39
  return this.callUnary("QueryByPattern", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -48,15 +45,12 @@ export class GraphClient extends Client {
48
45
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
49
46
  */
50
47
  async GetOntology(req) {
51
- // Type validation
52
- if (!(req instanceof common.Empty)) {
53
- throw new TypeError(
54
- `GetOntology: Expected parameter to be instanceof common.Empty`,
55
- );
56
- }
57
-
58
- // Convert to plain object
59
- const request = common.Empty.toObject(req);
48
+ // Accept a typed message or a plain init object (coerced to the typed type).
49
+ const message =
50
+ req instanceof common.Empty
51
+ ? req
52
+ : new common.Empty(req);
53
+ const request = common.Empty.toObject(message);
60
54
 
61
55
  // Make gRPC call (tracing handled by base Client class)
62
56
  return this.callUnary("GetOntology", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -68,15 +62,12 @@ export class GraphClient extends Client {
68
62
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
69
63
  */
70
64
  async GetSubjects(req) {
71
- // Type validation
72
- if (!(req instanceof graph.SubjectsQuery)) {
73
- throw new TypeError(
74
- `GetSubjects: Expected parameter to be instanceof graph.SubjectsQuery`,
75
- );
76
- }
77
-
78
- // Convert to plain object
79
- const request = graph.SubjectsQuery.toObject(req);
65
+ // Accept a typed message or a plain init object (coerced to the typed type).
66
+ const message =
67
+ req instanceof graph.SubjectsQuery
68
+ ? req
69
+ : new graph.SubjectsQuery(req);
70
+ const request = graph.SubjectsQuery.toObject(message);
80
71
 
81
72
  // Make gRPC call (tracing handled by base Client class)
82
73
  return this.callUnary("GetSubjects", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -28,15 +28,12 @@ export class MapClient extends Client {
28
28
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
29
29
  */
30
30
  async GetUnscoredArtifacts(req) {
31
- // Type validation
32
- if (!(req instanceof map.GetUnscoredArtifactsRequest)) {
33
- throw new TypeError(
34
- `GetUnscoredArtifacts: Expected parameter to be instanceof map.GetUnscoredArtifactsRequest`,
35
- );
36
- }
37
-
38
- // Convert to plain object
39
- const request = map.GetUnscoredArtifactsRequest.toObject(req);
31
+ // Accept a typed message or a plain init object (coerced to the typed type).
32
+ const message =
33
+ req instanceof map.GetUnscoredArtifactsRequest
34
+ ? req
35
+ : new map.GetUnscoredArtifactsRequest(req);
36
+ const request = map.GetUnscoredArtifactsRequest.toObject(message);
40
37
 
41
38
  // Make gRPC call (tracing handled by base Client class)
42
39
  return this.callUnary("GetUnscoredArtifacts", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -48,15 +45,12 @@ export class MapClient extends Client {
48
45
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
49
46
  */
50
47
  async GetArtifact(req) {
51
- // Type validation
52
- if (!(req instanceof map.GetArtifactRequest)) {
53
- throw new TypeError(
54
- `GetArtifact: Expected parameter to be instanceof map.GetArtifactRequest`,
55
- );
56
- }
57
-
58
- // Convert to plain object
59
- const request = map.GetArtifactRequest.toObject(req);
48
+ // Accept a typed message or a plain init object (coerced to the typed type).
49
+ const message =
50
+ req instanceof map.GetArtifactRequest
51
+ ? req
52
+ : new map.GetArtifactRequest(req);
53
+ const request = map.GetArtifactRequest.toObject(message);
60
54
 
61
55
  // Make gRPC call (tracing handled by base Client class)
62
56
  return this.callUnary("GetArtifact", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -68,15 +62,12 @@ export class MapClient extends Client {
68
62
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
69
63
  */
70
64
  async WriteEvidence(req) {
71
- // Type validation
72
- if (!(req instanceof map.WriteEvidenceRequest)) {
73
- throw new TypeError(
74
- `WriteEvidence: Expected parameter to be instanceof map.WriteEvidenceRequest`,
75
- );
76
- }
77
-
78
- // Convert to plain object
79
- const request = map.WriteEvidenceRequest.toObject(req);
65
+ // Accept a typed message or a plain init object (coerced to the typed type).
66
+ const message =
67
+ req instanceof map.WriteEvidenceRequest
68
+ ? req
69
+ : new map.WriteEvidenceRequest(req);
70
+ const request = map.WriteEvidenceRequest.toObject(message);
80
71
 
81
72
  // Make gRPC call (tracing handled by base Client class)
82
73
  return this.callUnary("WriteEvidence", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -88,15 +79,12 @@ export class MapClient extends Client {
88
79
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
89
80
  */
90
81
  async GetPerson(req) {
91
- // Type validation
92
- if (!(req instanceof map.GetPersonRequest)) {
93
- throw new TypeError(
94
- `GetPerson: Expected parameter to be instanceof map.GetPersonRequest`,
95
- );
96
- }
97
-
98
- // Convert to plain object
99
- const request = map.GetPersonRequest.toObject(req);
82
+ // Accept a typed message or a plain init object (coerced to the typed type).
83
+ const message =
84
+ req instanceof map.GetPersonRequest
85
+ ? req
86
+ : new map.GetPersonRequest(req);
87
+ const request = map.GetPersonRequest.toObject(message);
100
88
 
101
89
  // Make gRPC call (tracing handled by base Client class)
102
90
  return this.callUnary("GetPerson", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -28,15 +28,12 @@ export class PathwayClient extends Client {
28
28
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
29
29
  */
30
30
  async ListJobs(req) {
31
- // Type validation
32
- if (!(req instanceof pathway.ListJobsRequest)) {
33
- throw new TypeError(
34
- `ListJobs: Expected parameter to be instanceof pathway.ListJobsRequest`,
35
- );
36
- }
37
-
38
- // Convert to plain object
39
- const request = pathway.ListJobsRequest.toObject(req);
31
+ // Accept a typed message or a plain init object (coerced to the typed type).
32
+ const message =
33
+ req instanceof pathway.ListJobsRequest
34
+ ? req
35
+ : new pathway.ListJobsRequest(req);
36
+ const request = pathway.ListJobsRequest.toObject(message);
40
37
 
41
38
  // Make gRPC call (tracing handled by base Client class)
42
39
  return this.callUnary("ListJobs", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -48,15 +45,12 @@ export class PathwayClient extends Client {
48
45
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
49
46
  */
50
47
  async DescribeJob(req) {
51
- // Type validation
52
- if (!(req instanceof pathway.DescribeJobRequest)) {
53
- throw new TypeError(
54
- `DescribeJob: Expected parameter to be instanceof pathway.DescribeJobRequest`,
55
- );
56
- }
57
-
58
- // Convert to plain object
59
- const request = pathway.DescribeJobRequest.toObject(req);
48
+ // Accept a typed message or a plain init object (coerced to the typed type).
49
+ const message =
50
+ req instanceof pathway.DescribeJobRequest
51
+ ? req
52
+ : new pathway.DescribeJobRequest(req);
53
+ const request = pathway.DescribeJobRequest.toObject(message);
60
54
 
61
55
  // Make gRPC call (tracing handled by base Client class)
62
56
  return this.callUnary("DescribeJob", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -68,15 +62,12 @@ export class PathwayClient extends Client {
68
62
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
69
63
  */
70
64
  async ListAgentProfiles(req) {
71
- // Type validation
72
- if (!(req instanceof pathway.ListAgentProfilesRequest)) {
73
- throw new TypeError(
74
- `ListAgentProfiles: Expected parameter to be instanceof pathway.ListAgentProfilesRequest`,
75
- );
76
- }
77
-
78
- // Convert to plain object
79
- const request = pathway.ListAgentProfilesRequest.toObject(req);
65
+ // Accept a typed message or a plain init object (coerced to the typed type).
66
+ const message =
67
+ req instanceof pathway.ListAgentProfilesRequest
68
+ ? req
69
+ : new pathway.ListAgentProfilesRequest(req);
70
+ const request = pathway.ListAgentProfilesRequest.toObject(message);
80
71
 
81
72
  // Make gRPC call (tracing handled by base Client class)
82
73
  return this.callUnary("ListAgentProfiles", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -88,15 +79,12 @@ export class PathwayClient extends Client {
88
79
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
89
80
  */
90
81
  async DescribeAgentProfile(req) {
91
- // Type validation
92
- if (!(req instanceof pathway.DescribeAgentProfileRequest)) {
93
- throw new TypeError(
94
- `DescribeAgentProfile: Expected parameter to be instanceof pathway.DescribeAgentProfileRequest`,
95
- );
96
- }
97
-
98
- // Convert to plain object
99
- const request = pathway.DescribeAgentProfileRequest.toObject(req);
82
+ // Accept a typed message or a plain init object (coerced to the typed type).
83
+ const message =
84
+ req instanceof pathway.DescribeAgentProfileRequest
85
+ ? req
86
+ : new pathway.DescribeAgentProfileRequest(req);
87
+ const request = pathway.DescribeAgentProfileRequest.toObject(message);
100
88
 
101
89
  // Make gRPC call (tracing handled by base Client class)
102
90
  return this.callUnary("DescribeAgentProfile", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -108,15 +96,12 @@ export class PathwayClient extends Client {
108
96
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
109
97
  */
110
98
  async DescribeProgression(req) {
111
- // Type validation
112
- if (!(req instanceof pathway.DescribeProgressionRequest)) {
113
- throw new TypeError(
114
- `DescribeProgression: Expected parameter to be instanceof pathway.DescribeProgressionRequest`,
115
- );
116
- }
117
-
118
- // Convert to plain object
119
- const request = pathway.DescribeProgressionRequest.toObject(req);
99
+ // Accept a typed message or a plain init object (coerced to the typed type).
100
+ const message =
101
+ req instanceof pathway.DescribeProgressionRequest
102
+ ? req
103
+ : new pathway.DescribeProgressionRequest(req);
104
+ const request = pathway.DescribeProgressionRequest.toObject(message);
120
105
 
121
106
  // Make gRPC call (tracing handled by base Client class)
122
107
  return this.callUnary("DescribeProgression", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -128,15 +113,12 @@ export class PathwayClient extends Client {
128
113
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
129
114
  */
130
115
  async ListJobSoftware(req) {
131
- // Type validation
132
- if (!(req instanceof pathway.ListJobSoftwareRequest)) {
133
- throw new TypeError(
134
- `ListJobSoftware: Expected parameter to be instanceof pathway.ListJobSoftwareRequest`,
135
- );
136
- }
137
-
138
- // Convert to plain object
139
- const request = pathway.ListJobSoftwareRequest.toObject(req);
116
+ // Accept a typed message or a plain init object (coerced to the typed type).
117
+ const message =
118
+ req instanceof pathway.ListJobSoftwareRequest
119
+ ? req
120
+ : new pathway.ListJobSoftwareRequest(req);
121
+ const request = pathway.ListJobSoftwareRequest.toObject(message);
140
122
 
141
123
  // Make gRPC call (tracing handled by base Client class)
142
124
  return this.callUnary("ListJobSoftware", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -148,15 +130,12 @@ export class PathwayClient extends Client {
148
130
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
149
131
  */
150
132
  async GetMarkersForProfile(req) {
151
- // Type validation
152
- if (!(req instanceof pathway.GetMarkersForProfileRequest)) {
153
- throw new TypeError(
154
- `GetMarkersForProfile: Expected parameter to be instanceof pathway.GetMarkersForProfileRequest`,
155
- );
156
- }
157
-
158
- // Convert to plain object
159
- const request = pathway.GetMarkersForProfileRequest.toObject(req);
133
+ // Accept a typed message or a plain init object (coerced to the typed type).
134
+ const message =
135
+ req instanceof pathway.GetMarkersForProfileRequest
136
+ ? req
137
+ : new pathway.GetMarkersForProfileRequest(req);
138
+ const request = pathway.GetMarkersForProfileRequest.toObject(message);
160
139
 
161
140
  // Make gRPC call (tracing handled by base Client class)
162
141
  return this.callUnary("GetMarkersForProfile", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -28,15 +28,12 @@ export class TenancyClient extends Client {
28
28
  * @returns { Promise<tenancy.Tenant> } Typed response message.
29
29
  */
30
30
  async ResolveByChannelKey(req) {
31
- // Type validation
32
- if (!(req instanceof tenancy.ChannelTenantKey)) {
33
- throw new TypeError(
34
- `ResolveByChannelKey: Expected parameter to be instanceof tenancy.ChannelTenantKey`,
35
- );
36
- }
37
-
38
- // Convert to plain object
39
- const request = tenancy.ChannelTenantKey.toObject(req);
31
+ // Accept a typed message or a plain init object (coerced to the typed type).
32
+ const message =
33
+ req instanceof tenancy.ChannelTenantKey
34
+ ? req
35
+ : new tenancy.ChannelTenantKey(req);
36
+ const request = tenancy.ChannelTenantKey.toObject(message);
40
37
 
41
38
  // Make gRPC call (tracing handled by base Client class)
42
39
  return this.callUnary("ResolveByChannelKey", request, (res) => tenancy.Tenant.fromObject(res));
@@ -48,15 +45,12 @@ export class TenancyClient extends Client {
48
45
  * @returns { Promise<tenancy.Tenant> } Typed response message.
49
46
  */
50
47
  async ResolveByRepo(req) {
51
- // Type validation
52
- if (!(req instanceof tenancy.RepoKey)) {
53
- throw new TypeError(
54
- `ResolveByRepo: Expected parameter to be instanceof tenancy.RepoKey`,
55
- );
56
- }
57
-
58
- // Convert to plain object
59
- const request = tenancy.RepoKey.toObject(req);
48
+ // Accept a typed message or a plain init object (coerced to the typed type).
49
+ const message =
50
+ req instanceof tenancy.RepoKey
51
+ ? req
52
+ : new tenancy.RepoKey(req);
53
+ const request = tenancy.RepoKey.toObject(message);
60
54
 
61
55
  // Make gRPC call (tracing handled by base Client class)
62
56
  return this.callUnary("ResolveByRepo", request, (res) => tenancy.Tenant.fromObject(res));
@@ -68,15 +62,12 @@ export class TenancyClient extends Client {
68
62
  * @returns { Promise<tenancy.Tenant> } Typed response message.
69
63
  */
70
64
  async ResolveByTenantId(req) {
71
- // Type validation
72
- if (!(req instanceof tenancy.TenantIdKey)) {
73
- throw new TypeError(
74
- `ResolveByTenantId: Expected parameter to be instanceof tenancy.TenantIdKey`,
75
- );
76
- }
77
-
78
- // Convert to plain object
79
- const request = tenancy.TenantIdKey.toObject(req);
65
+ // Accept a typed message or a plain init object (coerced to the typed type).
66
+ const message =
67
+ req instanceof tenancy.TenantIdKey
68
+ ? req
69
+ : new tenancy.TenantIdKey(req);
70
+ const request = tenancy.TenantIdKey.toObject(message);
80
71
 
81
72
  // Make gRPC call (tracing handled by base Client class)
82
73
  return this.callUnary("ResolveByTenantId", request, (res) => tenancy.Tenant.fromObject(res));
@@ -88,15 +79,12 @@ export class TenancyClient extends Client {
88
79
  * @returns { Promise<tenancy.Tenant> } Typed response message.
89
80
  */
90
81
  async UpsertByChannelKey(req) {
91
- // Type validation
92
- if (!(req instanceof tenancy.UpsertChannelKeyRequest)) {
93
- throw new TypeError(
94
- `UpsertByChannelKey: Expected parameter to be instanceof tenancy.UpsertChannelKeyRequest`,
95
- );
96
- }
97
-
98
- // Convert to plain object
99
- const request = tenancy.UpsertChannelKeyRequest.toObject(req);
82
+ // Accept a typed message or a plain init object (coerced to the typed type).
83
+ const message =
84
+ req instanceof tenancy.UpsertChannelKeyRequest
85
+ ? req
86
+ : new tenancy.UpsertChannelKeyRequest(req);
87
+ const request = tenancy.UpsertChannelKeyRequest.toObject(message);
100
88
 
101
89
  // Make gRPC call (tracing handled by base Client class)
102
90
  return this.callUnary("UpsertByChannelKey", request, (res) => tenancy.Tenant.fromObject(res));
@@ -108,15 +96,12 @@ export class TenancyClient extends Client {
108
96
  * @returns { Promise<tenancy.Tenant> } Typed response message.
109
97
  */
110
98
  async UpsertByPair(req) {
111
- // Type validation
112
- if (!(req instanceof tenancy.UpsertPairRequest)) {
113
- throw new TypeError(
114
- `UpsertByPair: Expected parameter to be instanceof tenancy.UpsertPairRequest`,
115
- );
116
- }
117
-
118
- // Convert to plain object
119
- const request = tenancy.UpsertPairRequest.toObject(req);
99
+ // Accept a typed message or a plain init object (coerced to the typed type).
100
+ const message =
101
+ req instanceof tenancy.UpsertPairRequest
102
+ ? req
103
+ : new tenancy.UpsertPairRequest(req);
104
+ const request = tenancy.UpsertPairRequest.toObject(message);
120
105
 
121
106
  // Make gRPC call (tracing handled by base Client class)
122
107
  return this.callUnary("UpsertByPair", request, (res) => tenancy.Tenant.fromObject(res));
@@ -128,15 +113,12 @@ export class TenancyClient extends Client {
128
113
  * @returns { Promise<tenancy.Tenant> } Typed response message.
129
114
  */
130
115
  async SetState(req) {
131
- // Type validation
132
- if (!(req instanceof tenancy.SetStateRequest)) {
133
- throw new TypeError(
134
- `SetState: Expected parameter to be instanceof tenancy.SetStateRequest`,
135
- );
136
- }
137
-
138
- // Convert to plain object
139
- const request = tenancy.SetStateRequest.toObject(req);
116
+ // Accept a typed message or a plain init object (coerced to the typed type).
117
+ const message =
118
+ req instanceof tenancy.SetStateRequest
119
+ ? req
120
+ : new tenancy.SetStateRequest(req);
121
+ const request = tenancy.SetStateRequest.toObject(message);
140
122
 
141
123
  // Make gRPC call (tracing handled by base Client class)
142
124
  return this.callUnary("SetState", request, (res) => tenancy.Tenant.fromObject(res));
@@ -148,15 +130,12 @@ export class TenancyClient extends Client {
148
130
  * @returns { Promise<tenancy.Tenant> } Typed response message.
149
131
  */
150
132
  async SetRepo(req) {
151
- // Type validation
152
- if (!(req instanceof tenancy.SetRepoRequest)) {
153
- throw new TypeError(
154
- `SetRepo: Expected parameter to be instanceof tenancy.SetRepoRequest`,
155
- );
156
- }
157
-
158
- // Convert to plain object
159
- const request = tenancy.SetRepoRequest.toObject(req);
133
+ // Accept a typed message or a plain init object (coerced to the typed type).
134
+ const message =
135
+ req instanceof tenancy.SetRepoRequest
136
+ ? req
137
+ : new tenancy.SetRepoRequest(req);
138
+ const request = tenancy.SetRepoRequest.toObject(message);
160
139
 
161
140
  // Make gRPC call (tracing handled by base Client class)
162
141
  return this.callUnary("SetRepo", request, (res) => tenancy.Tenant.fromObject(res));
@@ -28,15 +28,12 @@ export class TraceClient extends Client {
28
28
  * @returns { Promise<trace.RecordResponse> } Typed response message.
29
29
  */
30
30
  async RecordSpan(req) {
31
- // Type validation
32
- if (!(req instanceof trace.Span)) {
33
- throw new TypeError(
34
- `RecordSpan: Expected parameter to be instanceof trace.Span`,
35
- );
36
- }
37
-
38
- // Convert to plain object
39
- const request = trace.Span.toObject(req);
31
+ // Accept a typed message or a plain init object (coerced to the typed type).
32
+ const message =
33
+ req instanceof trace.Span
34
+ ? req
35
+ : new trace.Span(req);
36
+ const request = trace.Span.toObject(message);
40
37
 
41
38
  // Make gRPC call (tracing handled by base Client class)
42
39
  return this.callUnary("RecordSpan", request, (res) => trace.RecordResponse.fromObject(res));
@@ -48,15 +45,12 @@ export class TraceClient extends Client {
48
45
  * @returns { Promise<trace.QueryResponse> } Typed response message.
49
46
  */
50
47
  async QuerySpans(req) {
51
- // Type validation
52
- if (!(req instanceof trace.QueryRequest)) {
53
- throw new TypeError(
54
- `QuerySpans: Expected parameter to be instanceof trace.QueryRequest`,
55
- );
56
- }
57
-
58
- // Convert to plain object
59
- const request = trace.QueryRequest.toObject(req);
48
+ // Accept a typed message or a plain init object (coerced to the typed type).
49
+ const message =
50
+ req instanceof trace.QueryRequest
51
+ ? req
52
+ : new trace.QueryRequest(req);
53
+ const request = trace.QueryRequest.toObject(message);
60
54
 
61
55
  // Make gRPC call (tracing handled by base Client class)
62
56
  return this.callUnary("QuerySpans", request, (res) => trace.QueryResponse.fromObject(res));
@@ -28,15 +28,12 @@ export class VectorClient extends Client {
28
28
  * @returns { Promise<tool.ToolCallResult> } Typed response message.
29
29
  */
30
30
  async SearchContent(req) {
31
- // Type validation
32
- if (!(req instanceof vector.TextQuery)) {
33
- throw new TypeError(
34
- `SearchContent: Expected parameter to be instanceof vector.TextQuery`,
35
- );
36
- }
37
-
38
- // Convert to plain object
39
- const request = vector.TextQuery.toObject(req);
31
+ // Accept a typed message or a plain init object (coerced to the typed type).
32
+ const message =
33
+ req instanceof vector.TextQuery
34
+ ? req
35
+ : new vector.TextQuery(req);
36
+ const request = vector.TextQuery.toObject(message);
40
37
 
41
38
  // Make gRPC call (tracing handled by base Client class)
42
39
  return this.callUnary("SearchContent", request, (res) => tool.ToolCallResult.fromObject(res));
@@ -391,6 +391,12 @@ export const metadata = {
391
391
  "optional": true,
392
392
  "repeated": false,
393
393
  "description": null
394
+ },
395
+ "tenant_id": {
396
+ "type": "string",
397
+ "optional": true,
398
+ "repeated": false,
399
+ "description": null
394
400
  }
395
401
  }
396
402
  },