| 366 | * @returns A google.protobuf.Struct object. |
| 367 | */ |
| 368 | export function createStructFromObject(data: JsonObject): ImportedPbStruct { |
| 369 | try { |
| 370 | return ImportedPbStruct.fromJson(data); |
| 371 | } catch (error) { |
| 372 | if ( |
| 373 | error instanceof Error && |
| 374 | error.message.includes("Unable to parse message google.protobuf.Struct from JSON") |
| 375 | ) { |
| 376 | throw new Error("Input data for createStructFromObject must be a non-null object."); |
| 377 | } |
| 378 | throw error; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | export * from "./authzedapi/authzed/api/v1/core.js"; |
| 383 | export * from "./authzedapi/authzed/api/v1/experimental_service.js"; |