@miradorlabs/web-grpc 4.19.0 → 4.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miradorlabs/web-grpc",
3
- "version": "4.19.0",
3
+ "version": "4.21.0",
4
4
  "description": "Generated gRPC (grpc-js) client stubs for the Mirador web gateway.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -13,7 +13,15 @@ export const protobufFileName = "proto/gateway/common/v1/status.proto";
13
13
 
14
14
  export interface ResponseStatus {
15
15
  code: ResponseStatus_StatusCode;
16
- errorMessage?: string | undefined;
16
+ errorMessage?:
17
+ | string
18
+ | undefined;
19
+ /**
20
+ * The AIP-193 ErrorInfo.reason of a backend refusal (for example PERSONAL_ORG_INACTIVE): a stable UPPER_SNAKE_CASE
21
+ * constant that clients branch on, listed on each RPC that gives one. Empty when the failure has none. error_message
22
+ * is for people and may change.
23
+ */
24
+ reason: string;
17
25
  }
18
26
 
19
27
  export enum ResponseStatus_StatusCode {
@@ -90,7 +98,7 @@ export function responseStatus_StatusCodeToJSON(object: ResponseStatus_StatusCod
90
98
  }
91
99
 
92
100
  function createBaseResponseStatus(): ResponseStatus {
93
- return { code: 0, errorMessage: undefined };
101
+ return { code: 0, errorMessage: undefined, reason: "" };
94
102
  }
95
103
 
96
104
  export const ResponseStatus: MessageFns<ResponseStatus> = {
@@ -101,6 +109,9 @@ export const ResponseStatus: MessageFns<ResponseStatus> = {
101
109
  if (message.errorMessage !== undefined) {
102
110
  writer.uint32(18).string(message.errorMessage);
103
111
  }
112
+ if (message.reason !== "") {
113
+ writer.uint32(26).string(message.reason);
114
+ }
104
115
  return writer;
105
116
  },
106
117
 
@@ -133,6 +144,14 @@ export const ResponseStatus: MessageFns<ResponseStatus> = {
133
144
  message.errorMessage = reader.string();
134
145
  continue;
135
146
  }
147
+ case 3: {
148
+ if (tag !== 26) {
149
+ break;
150
+ }
151
+
152
+ message.reason = reader.string();
153
+ continue;
154
+ }
136
155
  }
137
156
  if ((tag & 7) === 4 || tag === 0) {
138
157
  break;
@@ -153,6 +172,7 @@ export const ResponseStatus: MessageFns<ResponseStatus> = {
153
172
  : isSet(object.error_message)
154
173
  ? globalThis.String(object.error_message)
155
174
  : undefined,
175
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
156
176
  };
157
177
  },
158
178
 
@@ -164,6 +184,9 @@ export const ResponseStatus: MessageFns<ResponseStatus> = {
164
184
  if (message.errorMessage !== undefined) {
165
185
  obj.errorMessage = message.errorMessage;
166
186
  }
187
+ if (message.reason !== "") {
188
+ obj.reason = message.reason;
189
+ }
167
190
  return obj;
168
191
  },
169
192
 
@@ -174,6 +197,7 @@ export const ResponseStatus: MessageFns<ResponseStatus> = {
174
197
  const message = createBaseResponseStatus();
175
198
  message.code = object.code ?? 0;
176
199
  message.errorMessage = object.errorMessage ?? undefined;
200
+ message.reason = object.reason ?? "";
177
201
  return message;
178
202
  },
179
203
  };
@@ -71,7 +71,8 @@ proto.gateway.common.v1.ResponseStatus.prototype.toObject = function(opt_include
71
71
  proto.gateway.common.v1.ResponseStatus.toObject = function(includeInstance, msg) {
72
72
  var f, obj = {
73
73
  code: jspb.Message.getFieldWithDefault(msg, 1, 0),
74
- errorMessage: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f
74
+ errorMessage: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
75
+ reason: jspb.Message.getFieldWithDefault(msg, 3, "")
75
76
  };
76
77
 
77
78
  if (includeInstance) {
@@ -116,6 +117,10 @@ proto.gateway.common.v1.ResponseStatus.deserializeBinaryFromReader = function(ms
116
117
  var value = /** @type {string} */ (reader.readStringRequireUtf8());
117
118
  msg.setErrorMessage(value);
118
119
  break;
120
+ case 3:
121
+ var value = /** @type {string} */ (reader.readStringRequireUtf8());
122
+ msg.setReason(value);
123
+ break;
119
124
  default:
120
125
  reader.skipField();
121
126
  break;
@@ -159,6 +164,13 @@ proto.gateway.common.v1.ResponseStatus.serializeBinaryToWriter = function(messag
159
164
  f
160
165
  );
161
166
  }
167
+ f = message.getReason();
168
+ if (f.length > 0) {
169
+ writer.writeString(
170
+ 3,
171
+ f
172
+ );
173
+ }
162
174
  };
163
175
 
164
176
 
@@ -230,4 +242,22 @@ proto.gateway.common.v1.ResponseStatus.prototype.hasErrorMessage = function() {
230
242
  };
231
243
 
232
244
 
245
+ /**
246
+ * optional string reason = 3;
247
+ * @return {string}
248
+ */
249
+ proto.gateway.common.v1.ResponseStatus.prototype.getReason = function() {
250
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
251
+ };
252
+
253
+
254
+ /**
255
+ * @param {string} value
256
+ * @return {!proto.gateway.common.v1.ResponseStatus} returns this
257
+ */
258
+ proto.gateway.common.v1.ResponseStatus.prototype.setReason = function(value) {
259
+ return jspb.Message.setProto3StringField(this, 3, value);
260
+ };
261
+
262
+
233
263
  goog.object.extend(exports, proto.gateway.common.v1);
@@ -139,6 +139,45 @@ export function organizationStatusToJSON(object: OrganizationStatus): string {
139
139
  }
140
140
  }
141
141
 
142
+ export enum OrganizationType {
143
+ ORGANIZATION_TYPE_UNSPECIFIED = 0,
144
+ ORGANIZATION_TYPE_PERSONAL = 1,
145
+ ORGANIZATION_TYPE_SHARED = 2,
146
+ UNRECOGNIZED = -1,
147
+ }
148
+
149
+ export function organizationTypeFromJSON(object: any): OrganizationType {
150
+ switch (object) {
151
+ case 0:
152
+ case "ORGANIZATION_TYPE_UNSPECIFIED":
153
+ return OrganizationType.ORGANIZATION_TYPE_UNSPECIFIED;
154
+ case 1:
155
+ case "ORGANIZATION_TYPE_PERSONAL":
156
+ return OrganizationType.ORGANIZATION_TYPE_PERSONAL;
157
+ case 2:
158
+ case "ORGANIZATION_TYPE_SHARED":
159
+ return OrganizationType.ORGANIZATION_TYPE_SHARED;
160
+ case -1:
161
+ case "UNRECOGNIZED":
162
+ default:
163
+ return OrganizationType.UNRECOGNIZED;
164
+ }
165
+ }
166
+
167
+ export function organizationTypeToJSON(object: OrganizationType): string {
168
+ switch (object) {
169
+ case OrganizationType.ORGANIZATION_TYPE_UNSPECIFIED:
170
+ return "ORGANIZATION_TYPE_UNSPECIFIED";
171
+ case OrganizationType.ORGANIZATION_TYPE_PERSONAL:
172
+ return "ORGANIZATION_TYPE_PERSONAL";
173
+ case OrganizationType.ORGANIZATION_TYPE_SHARED:
174
+ return "ORGANIZATION_TYPE_SHARED";
175
+ case OrganizationType.UNRECOGNIZED:
176
+ default:
177
+ return "UNRECOGNIZED";
178
+ }
179
+ }
180
+
142
181
  export enum OnboardingStatus {
143
182
  ONBOARDING_STATUS_UNSPECIFIED = 0,
144
183
  ONBOARDING_STATUS_NOT_STARTED = 1,
@@ -397,6 +436,21 @@ export function mcpClientKindToJSON(object: McpClientKind): string {
397
436
  export interface LogonRequest {
398
437
  /** Invitation ID for accepting invites during logon */
399
438
  invitationId?: string | undefined;
439
+ filter: OrganizationFilter | undefined;
440
+ }
441
+
442
+ /**
443
+ * OrganizationFilter narrows the organizations a Logon answers. Fields AND; a repeated field matches any of its values;
444
+ * an unset or empty field does not filter.
445
+ */
446
+ export interface OrganizationFilter {
447
+ /**
448
+ * The types of the organizations to answer. ORGANIZATION_TYPE_PERSONAL also makes the caller's PERSONAL organization
449
+ * and its one team when they have none; its time_zone starts empty, for the client to set with UpdateOrganization.
450
+ * Refusals are a VALIDATION_ERROR whose status.reason is PERSONAL_ORGS_DISABLED (personal organizations are off) or
451
+ * PERSONAL_ORG_INACTIVE (the PERSONAL organization is suspended and nothing else matches).
452
+ */
453
+ organizationTypes: OrganizationType[];
400
454
  }
401
455
 
402
456
  export interface LogonResponse {
@@ -452,6 +506,11 @@ export interface Organization {
452
506
  * one, which is distinct from an explicit UTC.
453
507
  */
454
508
  timeZone: string;
509
+ /**
510
+ * PERSONAL is one person's own workspace (one member, its owner, and one team); SHARED is every other organization.
511
+ * Lists put SHARED organizations first and the PERSONAL one last.
512
+ */
513
+ organizationType: OrganizationType;
455
514
  }
456
515
 
457
516
  export interface CreateProjectRequest {
@@ -1023,7 +1082,7 @@ export interface GetProductFeaturesResponse {
1023
1082
  }
1024
1083
 
1025
1084
  function createBaseLogonRequest(): LogonRequest {
1026
- return { invitationId: undefined };
1085
+ return { invitationId: undefined, filter: undefined };
1027
1086
  }
1028
1087
 
1029
1088
  export const LogonRequest: MessageFns<LogonRequest> = {
@@ -1031,6 +1090,9 @@ export const LogonRequest: MessageFns<LogonRequest> = {
1031
1090
  if (message.invitationId !== undefined) {
1032
1091
  writer.uint32(10).string(message.invitationId);
1033
1092
  }
1093
+ if (message.filter !== undefined) {
1094
+ OrganizationFilter.encode(message.filter, writer.uint32(18).fork()).join();
1095
+ }
1034
1096
  return writer;
1035
1097
  },
1036
1098
 
@@ -1055,6 +1117,14 @@ export const LogonRequest: MessageFns<LogonRequest> = {
1055
1117
  message.invitationId = reader.string();
1056
1118
  continue;
1057
1119
  }
1120
+ case 2: {
1121
+ if (tag !== 18) {
1122
+ break;
1123
+ }
1124
+
1125
+ message.filter = OrganizationFilter.decode(reader, reader.uint32());
1126
+ continue;
1127
+ }
1058
1128
  }
1059
1129
  if ((tag & 7) === 4 || tag === 0) {
1060
1130
  break;
@@ -1074,6 +1144,7 @@ export const LogonRequest: MessageFns<LogonRequest> = {
1074
1144
  : isSet(object.invitation_id)
1075
1145
  ? globalThis.String(object.invitation_id)
1076
1146
  : undefined,
1147
+ filter: isSet(object.filter) ? OrganizationFilter.fromJSON(object.filter) : undefined,
1077
1148
  };
1078
1149
  },
1079
1150
 
@@ -1082,6 +1153,9 @@ export const LogonRequest: MessageFns<LogonRequest> = {
1082
1153
  if (message.invitationId !== undefined) {
1083
1154
  obj.invitationId = message.invitationId;
1084
1155
  }
1156
+ if (message.filter !== undefined) {
1157
+ obj.filter = OrganizationFilter.toJSON(message.filter);
1158
+ }
1085
1159
  return obj;
1086
1160
  },
1087
1161
 
@@ -1091,6 +1165,92 @@ export const LogonRequest: MessageFns<LogonRequest> = {
1091
1165
  fromPartial<I extends Exact<DeepPartial<LogonRequest>, I>>(object: I): LogonRequest {
1092
1166
  const message = createBaseLogonRequest();
1093
1167
  message.invitationId = object.invitationId ?? undefined;
1168
+ message.filter = (object.filter !== undefined && object.filter !== null)
1169
+ ? OrganizationFilter.fromPartial(object.filter)
1170
+ : undefined;
1171
+ return message;
1172
+ },
1173
+ };
1174
+
1175
+ function createBaseOrganizationFilter(): OrganizationFilter {
1176
+ return { organizationTypes: [] };
1177
+ }
1178
+
1179
+ export const OrganizationFilter: MessageFns<OrganizationFilter> = {
1180
+ encode(message: OrganizationFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1181
+ for (const v of message.organizationTypes) {
1182
+ writer.uint32(8).int32(v!);
1183
+ }
1184
+ return writer;
1185
+ },
1186
+
1187
+ decode(input: BinaryReader | Uint8Array, length?: number): OrganizationFilter {
1188
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1189
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1190
+ if (previousRecursionDepth >= 100) {
1191
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
1192
+ }
1193
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1194
+ try {
1195
+ const end = length === undefined ? reader.len : reader.pos + length;
1196
+ const message = createBaseOrganizationFilter();
1197
+ while (reader.pos < end) {
1198
+ const tag = reader.uint32();
1199
+ switch (tag >>> 3) {
1200
+ case 1: {
1201
+ if (tag === 8) {
1202
+ message.organizationTypes.push(reader.int32() as any);
1203
+
1204
+ continue;
1205
+ }
1206
+
1207
+ if (tag === 10) {
1208
+ const end2 = reader.uint32() + reader.pos;
1209
+ while (reader.pos < end2) {
1210
+ message.organizationTypes.push(reader.int32() as any);
1211
+ }
1212
+
1213
+ continue;
1214
+ }
1215
+
1216
+ break;
1217
+ }
1218
+ }
1219
+ if ((tag & 7) === 4 || tag === 0) {
1220
+ break;
1221
+ }
1222
+ reader.skip(tag & 7);
1223
+ }
1224
+ return message;
1225
+ } finally {
1226
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1227
+ }
1228
+ },
1229
+
1230
+ fromJSON(object: any): OrganizationFilter {
1231
+ return {
1232
+ organizationTypes: globalThis.Array.isArray(object?.organizationTypes)
1233
+ ? object.organizationTypes.map((e: any) => organizationTypeFromJSON(e))
1234
+ : globalThis.Array.isArray(object?.organization_types)
1235
+ ? object.organization_types.map((e: any) => organizationTypeFromJSON(e))
1236
+ : [],
1237
+ };
1238
+ },
1239
+
1240
+ toJSON(message: OrganizationFilter): unknown {
1241
+ const obj: any = {};
1242
+ if (message.organizationTypes?.length) {
1243
+ obj.organizationTypes = message.organizationTypes.map((e) => organizationTypeToJSON(e));
1244
+ }
1245
+ return obj;
1246
+ },
1247
+
1248
+ create<I extends Exact<DeepPartial<OrganizationFilter>, I>>(base?: I): OrganizationFilter {
1249
+ return OrganizationFilter.fromPartial(base ?? ({} as any));
1250
+ },
1251
+ fromPartial<I extends Exact<DeepPartial<OrganizationFilter>, I>>(object: I): OrganizationFilter {
1252
+ const message = createBaseOrganizationFilter();
1253
+ message.organizationTypes = object.organizationTypes?.map((e) => e) || [];
1094
1254
  return message;
1095
1255
  },
1096
1256
  };
@@ -1497,6 +1657,7 @@ function createBaseOrganization(): Organization {
1497
1657
  createdAt: undefined,
1498
1658
  updatedAt: undefined,
1499
1659
  timeZone: "",
1660
+ organizationType: 0,
1500
1661
  };
1501
1662
  }
1502
1663
 
@@ -1523,6 +1684,9 @@ export const Organization: MessageFns<Organization> = {
1523
1684
  if (message.timeZone !== "") {
1524
1685
  writer.uint32(58).string(message.timeZone);
1525
1686
  }
1687
+ if (message.organizationType !== 0) {
1688
+ writer.uint32(64).int32(message.organizationType);
1689
+ }
1526
1690
  return writer;
1527
1691
  },
1528
1692
 
@@ -1595,6 +1759,14 @@ export const Organization: MessageFns<Organization> = {
1595
1759
  message.timeZone = reader.string();
1596
1760
  continue;
1597
1761
  }
1762
+ case 8: {
1763
+ if (tag !== 64) {
1764
+ break;
1765
+ }
1766
+
1767
+ message.organizationType = reader.int32() as any;
1768
+ continue;
1769
+ }
1598
1770
  }
1599
1771
  if ((tag & 7) === 4 || tag === 0) {
1600
1772
  break;
@@ -1640,6 +1812,11 @@ export const Organization: MessageFns<Organization> = {
1640
1812
  : isSet(object.time_zone)
1641
1813
  ? globalThis.String(object.time_zone)
1642
1814
  : "",
1815
+ organizationType: isSet(object.organizationType)
1816
+ ? organizationTypeFromJSON(object.organizationType)
1817
+ : isSet(object.organization_type)
1818
+ ? organizationTypeFromJSON(object.organization_type)
1819
+ : 0,
1643
1820
  };
1644
1821
  },
1645
1822
 
@@ -1666,6 +1843,9 @@ export const Organization: MessageFns<Organization> = {
1666
1843
  if (message.timeZone !== "") {
1667
1844
  obj.timeZone = message.timeZone;
1668
1845
  }
1846
+ if (message.organizationType !== 0) {
1847
+ obj.organizationType = organizationTypeToJSON(message.organizationType);
1848
+ }
1669
1849
  return obj;
1670
1850
  },
1671
1851
 
@@ -1681,6 +1861,7 @@ export const Organization: MessageFns<Organization> = {
1681
1861
  message.createdAt = object.createdAt ?? undefined;
1682
1862
  message.updatedAt = object.updatedAt ?? undefined;
1683
1863
  message.timeZone = object.timeZone ?? "";
1864
+ message.organizationType = object.organizationType ?? 0;
1684
1865
  return message;
1685
1866
  },
1686
1867
  };