@milaboratories/pl-client 3.7.0 → 3.8.1

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 (79) hide show
  1. package/dist/core/capabilities.cjs +9 -0
  2. package/dist/core/capabilities.cjs.map +1 -0
  3. package/dist/core/capabilities.d.ts +24 -0
  4. package/dist/core/capabilities.d.ts.map +1 -0
  5. package/dist/core/capabilities.js +9 -0
  6. package/dist/core/capabilities.js.map +1 -0
  7. package/dist/core/client.cjs +7 -25
  8. package/dist/core/client.cjs.map +1 -1
  9. package/dist/core/client.d.ts +2 -3
  10. package/dist/core/client.d.ts.map +1 -1
  11. package/dist/core/client.js +7 -25
  12. package/dist/core/client.js.map +1 -1
  13. package/dist/core/ll_client.cjs +153 -7
  14. package/dist/core/ll_client.cjs.map +1 -1
  15. package/dist/core/ll_client.d.ts +26 -0
  16. package/dist/core/ll_client.d.ts.map +1 -1
  17. package/dist/core/ll_client.js +153 -7
  18. package/dist/core/ll_client.js.map +1 -1
  19. package/dist/core/transaction.cjs +4 -2
  20. package/dist/core/transaction.cjs.map +1 -1
  21. package/dist/core/transaction.d.ts.map +1 -1
  22. package/dist/core/transaction.js +4 -2
  23. package/dist/core/transaction.js.map +1 -1
  24. package/dist/core/unauth_client.cjs +33 -1
  25. package/dist/core/unauth_client.cjs.map +1 -1
  26. package/dist/core/unauth_client.d.ts +19 -0
  27. package/dist/core/unauth_client.d.ts.map +1 -1
  28. package/dist/core/unauth_client.js +33 -1
  29. package/dist/core/unauth_client.js.map +1 -1
  30. package/dist/index.cjs +2 -0
  31. package/dist/index.d.ts +2 -1
  32. package/dist/index.js +2 -1
  33. package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.cjs.map +1 -1
  34. package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.js.map +1 -1
  35. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +1101 -135
  36. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs.map +1 -1
  37. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs +49 -10
  38. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs.map +1 -1
  39. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +61 -1
  40. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -1
  41. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js +49 -10
  42. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js.map +1 -1
  43. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +414 -12
  44. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
  45. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js +1101 -135
  46. package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js.map +1 -1
  47. package/dist/proto-grpc/google/protobuf/timestamp.cjs.map +1 -1
  48. package/dist/proto-grpc/google/protobuf/timestamp.d.ts +8 -9
  49. package/dist/proto-grpc/google/protobuf/timestamp.d.ts.map +1 -1
  50. package/dist/proto-grpc/google/protobuf/timestamp.js.map +1 -1
  51. package/dist/proto-grpc/google/rpc/code.cjs.map +1 -1
  52. package/dist/proto-grpc/google/rpc/code.js.map +1 -1
  53. package/dist/proto-rest/plapi.d.ts +247 -12
  54. package/dist/proto-rest/plapi.d.ts.map +1 -1
  55. package/dist/util/pl.cjs.map +1 -1
  56. package/dist/util/pl.js.map +1 -1
  57. package/package.json +4 -4
  58. package/src/core/capabilities.ts +26 -0
  59. package/src/core/client.ts +11 -29
  60. package/src/core/ll_client.test.ts +16 -3
  61. package/src/core/ll_client.ts +187 -8
  62. package/src/core/ll_transaction.test.ts +15 -9
  63. package/src/core/transaction.ts +2 -0
  64. package/src/core/unauth_client.ts +42 -3
  65. package/src/core/unauth_client_branch.test.ts +69 -0
  66. package/src/index.ts +1 -0
  67. package/src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts +1 -1
  68. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +85 -10
  69. package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.ts +1313 -101
  70. package/src/proto-grpc/google/api/http.ts +1 -1
  71. package/src/proto-grpc/google/protobuf/descriptor.ts +7 -240
  72. package/src/proto-grpc/google/protobuf/timestamp.ts +8 -9
  73. package/src/proto-grpc/google/protobuf/wrappers.ts +4 -38
  74. package/src/proto-grpc/google/rpc/code.ts +1 -1
  75. package/src/proto-grpc/google/rpc/error_details.ts +5 -5
  76. package/src/proto-grpc/google/rpc/http.ts +1 -1
  77. package/src/proto-grpc/google/rpc/status.ts +1 -1
  78. package/src/proto-rest/plapi.ts +263 -12
  79. package/src/util/pl.ts +5 -0
@@ -21,9 +21,41 @@ var UnauthenticatedPlClient = class UnauthenticatedPlClient {
21
21
  async requireAuth() {
22
22
  return (await this.authMethods()).methods.length > 0;
23
23
  }
24
+ hasCapability(capability) {
25
+ return this.ll.hasCapability(capability);
26
+ }
27
+ /** Classifies the advertised authentication methods by credential scheme.
28
+ * On legacy backends (no auth:v2) the typed oneof is empty; callers fall through to {@link login}
29
+ * which uses the legacy GetJWTToken path. */
30
+ get supportedAuthSchemes() {
31
+ const result = {
32
+ basic: false,
33
+ token: false
34
+ };
35
+ for (const m of this.ll.authMethodsSync.methods) if (m.method.oneofKind === "basic") result.basic = true;
36
+ else if (m.method.oneofKind === "token") result.token = true;
37
+ return result;
38
+ }
39
+ /** Login with username+password.
40
+ *
41
+ * On auth:v2 backends the client inspects the advertised AuthMethods:
42
+ * - if basic auth is offered, sends {@link LLPlClient.loginBasic};
43
+ * - if only token auth is offered, treats `password` as an opaque bearer token and
44
+ * sends {@link LLPlClient.loginWithToken} (so deployments configured for static-token
45
+ * auth still log in without the caller switching methods).
46
+ *
47
+ * On legacy backends (no auth:v2) it falls through to GetJWTToken with the Basic header,
48
+ * preserving original behavior. */
24
49
  async login(user, password) {
25
50
  try {
26
- const jwtToken = (0, _milaboratories_ts_helpers.notEmpty)(await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), { authorization: "Basic " + Buffer.from(user + ":" + password).toString("base64") }));
51
+ let token;
52
+ if (this.ll.hasCapability("auth:v2")) {
53
+ const schemes = this.supportedAuthSchemes;
54
+ if (schemes.basic) token = await this.ll.loginBasic(user, password);
55
+ else if (schemes.token) token = await this.ll.loginWithToken(password);
56
+ else throw new Error("backend advertises no supported authentication methods");
57
+ } else token = await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), { authorization: "Basic " + Buffer.from(user + ":" + password).toString("base64") });
58
+ const jwtToken = (0, _milaboratories_ts_helpers.notEmpty)(token);
27
59
  if (jwtToken === "") throw new Error("empty token");
28
60
  return { jwtToken };
29
61
  } catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"unauth_client.cjs","names":["LLPlClient","UnauthenticatedError"],"sources":["../../src/core/unauth_client.ts"],"sourcesContent":["import type { AuthInformation, PlClientConfig } from \"./config\";\nimport type {\n AuthAPI_ListMethods_Response,\n MaintenanceAPI_Ping_Response,\n} from \"../proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api\";\nimport { LLPlClient } from \"./ll_client\";\nimport { type MiLogger, notEmpty } from \"@milaboratories/ts-helpers\";\nimport { UnauthenticatedError } from \"./errors\";\n\n/** Primarily used for initial authentication (login) */\nexport class UnauthenticatedPlClient {\n public readonly ll: LLPlClient;\n\n private constructor(ll: LLPlClient) {\n this.ll = ll;\n }\n\n public static async build(\n configOrAddress: PlClientConfig | string,\n ops?: { logger?: MiLogger },\n ): Promise<UnauthenticatedPlClient> {\n const ll = await LLPlClient.build(configOrAddress, ops);\n return new UnauthenticatedPlClient(ll);\n }\n\n public async ping(): Promise<MaintenanceAPI_Ping_Response> {\n return await this.ll.ping();\n }\n\n public async authMethods(): Promise<AuthAPI_ListMethods_Response> {\n return await this.ll.authMethods();\n }\n\n public async requireAuth(): Promise<boolean> {\n return (await this.authMethods()).methods.length > 0;\n }\n\n public async login(user: string, password: string): Promise<AuthInformation> {\n try {\n const token = await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), {\n authorization: \"Basic \" + Buffer.from(user + \":\" + password).toString(\"base64\"),\n });\n const jwtToken = notEmpty(token);\n if (jwtToken === \"\") throw new Error(\"empty token\");\n return { jwtToken };\n } catch (e: any) {\n if (e.code === \"UNAUTHENTICATED\") throw new UnauthenticatedError(e.message);\n throw new Error(e);\n }\n }\n}\n"],"mappings":";;;;;;AAUA,IAAa,0BAAb,MAAa,wBAAwB;CACnC;CAEA,YAAoB,IAAgB;AAClC,OAAK,KAAK;;CAGZ,aAAoB,MAClB,iBACA,KACkC;AAElC,SAAO,IAAI,wBADA,MAAMA,kBAAAA,WAAW,MAAM,iBAAiB,IAAI,CACjB;;CAGxC,MAAa,OAA8C;AACzD,SAAO,MAAM,KAAK,GAAG,MAAM;;CAG7B,MAAa,cAAqD;AAChE,SAAO,MAAM,KAAK,GAAG,aAAa;;CAGpC,MAAa,cAAgC;AAC3C,UAAQ,MAAM,KAAK,aAAa,EAAE,QAAQ,SAAS;;CAGrD,MAAa,MAAM,MAAc,UAA4C;AAC3E,MAAI;GAIF,MAAM,YAAA,GAAA,2BAAA,UAHQ,MAAM,KAAK,GAAG,YAAY,OAAO,KAAK,GAAG,KAAK,eAAe,EAAE,EAC3E,eAAe,WAAW,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC,SAAS,SAAS,EAChF,CAAC,CAC8B;AAChC,OAAI,aAAa,GAAI,OAAM,IAAI,MAAM,cAAc;AACnD,UAAO,EAAE,UAAU;WACZ,GAAQ;AACf,OAAI,EAAE,SAAS,kBAAmB,OAAM,IAAIC,eAAAA,qBAAqB,EAAE,QAAQ;AAC3E,SAAM,IAAI,MAAM,EAAE"}
1
+ {"version":3,"file":"unauth_client.cjs","names":["LLPlClient","UnauthenticatedError"],"sources":["../../src/core/unauth_client.ts"],"sourcesContent":["import type { AuthInformation, PlClientConfig } from \"./config\";\nimport type {\n AuthAPI_ListMethods_Response,\n MaintenanceAPI_Ping_Response,\n} from \"../proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api\";\nimport { LLPlClient } from \"./ll_client\";\nimport { type MiLogger, notEmpty } from \"@milaboratories/ts-helpers\";\nimport { UnauthenticatedError } from \"./errors\";\nimport type { BackendCapability } from \"./capabilities\";\n\n/** Primarily used for initial authentication (login) */\nexport class UnauthenticatedPlClient {\n public readonly ll: LLPlClient;\n\n private constructor(ll: LLPlClient) {\n this.ll = ll;\n }\n\n public static async build(\n configOrAddress: PlClientConfig | string,\n ops?: { logger?: MiLogger },\n ): Promise<UnauthenticatedPlClient> {\n const ll = await LLPlClient.build(configOrAddress, ops);\n return new UnauthenticatedPlClient(ll);\n }\n\n public async ping(): Promise<MaintenanceAPI_Ping_Response> {\n return await this.ll.ping();\n }\n\n public async authMethods(): Promise<AuthAPI_ListMethods_Response> {\n return await this.ll.authMethods();\n }\n\n public async requireAuth(): Promise<boolean> {\n return (await this.authMethods()).methods.length > 0;\n }\n\n public hasCapability(capability: BackendCapability): boolean {\n return this.ll.hasCapability(capability);\n }\n\n /** Classifies the advertised authentication methods by credential scheme.\n * On legacy backends (no auth:v2) the typed oneof is empty; callers fall through to {@link login}\n * which uses the legacy GetJWTToken path. */\n public get supportedAuthSchemes(): { basic: boolean; token: boolean } {\n const result = { basic: false, token: false };\n for (const m of this.ll.authMethodsSync.methods) {\n if (m.method.oneofKind === \"basic\") result.basic = true;\n else if (m.method.oneofKind === \"token\") result.token = true;\n }\n return result;\n }\n\n /** Login with username+password.\n *\n * On auth:v2 backends the client inspects the advertised AuthMethods:\n * - if basic auth is offered, sends {@link LLPlClient.loginBasic};\n * - if only token auth is offered, treats `password` as an opaque bearer token and\n * sends {@link LLPlClient.loginWithToken} (so deployments configured for static-token\n * auth still log in without the caller switching methods).\n *\n * On legacy backends (no auth:v2) it falls through to GetJWTToken with the Basic header,\n * preserving original behavior. */\n public async login(user: string, password: string): Promise<AuthInformation> {\n try {\n let token: string;\n if (this.ll.hasCapability(\"auth:v2\")) {\n const schemes = this.supportedAuthSchemes;\n if (schemes.basic) {\n token = await this.ll.loginBasic(user, password);\n } else if (schemes.token) {\n token = await this.ll.loginWithToken(password);\n } else {\n throw new Error(\"backend advertises no supported authentication methods\");\n }\n } else {\n token = await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), {\n authorization: \"Basic \" + Buffer.from(user + \":\" + password).toString(\"base64\"),\n });\n }\n const jwtToken = notEmpty(token);\n if (jwtToken === \"\") throw new Error(\"empty token\");\n return { jwtToken };\n } catch (e: any) {\n if (e.code === \"UNAUTHENTICATED\") throw new UnauthenticatedError(e.message);\n throw new Error(e);\n }\n }\n}\n"],"mappings":";;;;;;AAWA,IAAa,0BAAb,MAAa,wBAAwB;CACnC;CAEA,YAAoB,IAAgB;AAClC,OAAK,KAAK;;CAGZ,aAAoB,MAClB,iBACA,KACkC;AAElC,SAAO,IAAI,wBADA,MAAMA,kBAAAA,WAAW,MAAM,iBAAiB,IAAI,CACjB;;CAGxC,MAAa,OAA8C;AACzD,SAAO,MAAM,KAAK,GAAG,MAAM;;CAG7B,MAAa,cAAqD;AAChE,SAAO,MAAM,KAAK,GAAG,aAAa;;CAGpC,MAAa,cAAgC;AAC3C,UAAQ,MAAM,KAAK,aAAa,EAAE,QAAQ,SAAS;;CAGrD,cAAqB,YAAwC;AAC3D,SAAO,KAAK,GAAG,cAAc,WAAW;;;;;CAM1C,IAAW,uBAA2D;EACpE,MAAM,SAAS;GAAE,OAAO;GAAO,OAAO;GAAO;AAC7C,OAAK,MAAM,KAAK,KAAK,GAAG,gBAAgB,QACtC,KAAI,EAAE,OAAO,cAAc,QAAS,QAAO,QAAQ;WAC1C,EAAE,OAAO,cAAc,QAAS,QAAO,QAAQ;AAE1D,SAAO;;;;;;;;;;;;CAaT,MAAa,MAAM,MAAc,UAA4C;AAC3E,MAAI;GACF,IAAI;AACJ,OAAI,KAAK,GAAG,cAAc,UAAU,EAAE;IACpC,MAAM,UAAU,KAAK;AACrB,QAAI,QAAQ,MACV,SAAQ,MAAM,KAAK,GAAG,WAAW,MAAM,SAAS;aACvC,QAAQ,MACjB,SAAQ,MAAM,KAAK,GAAG,eAAe,SAAS;QAE9C,OAAM,IAAI,MAAM,yDAAyD;SAG3E,SAAQ,MAAM,KAAK,GAAG,YAAY,OAAO,KAAK,GAAG,KAAK,eAAe,EAAE,EACrE,eAAe,WAAW,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC,SAAS,SAAS,EAChF,CAAC;GAEJ,MAAM,YAAA,GAAA,2BAAA,UAAoB,MAAM;AAChC,OAAI,aAAa,GAAI,OAAM,IAAI,MAAM,cAAc;AACnD,UAAO,EAAE,UAAU;WACZ,GAAQ;AACf,OAAI,EAAE,SAAS,kBAAmB,OAAM,IAAIC,eAAAA,qBAAqB,EAAE,QAAQ;AAC3E,SAAM,IAAI,MAAM,EAAE"}
@@ -1,5 +1,6 @@
1
1
  import { AuthAPI_ListMethods_Response, MaintenanceAPI_Ping_Response } from "../proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js";
2
2
  import { AuthInformation, PlClientConfig } from "./config.js";
3
+ import { BackendCapability } from "./capabilities.js";
3
4
  import { LLPlClient } from "./ll_client.js";
4
5
  import { MiLogger } from "@milaboratories/ts-helpers";
5
6
 
@@ -14,6 +15,24 @@ declare class UnauthenticatedPlClient {
14
15
  ping(): Promise<MaintenanceAPI_Ping_Response>;
15
16
  authMethods(): Promise<AuthAPI_ListMethods_Response>;
16
17
  requireAuth(): Promise<boolean>;
18
+ hasCapability(capability: BackendCapability): boolean;
19
+ /** Classifies the advertised authentication methods by credential scheme.
20
+ * On legacy backends (no auth:v2) the typed oneof is empty; callers fall through to {@link login}
21
+ * which uses the legacy GetJWTToken path. */
22
+ get supportedAuthSchemes(): {
23
+ basic: boolean;
24
+ token: boolean;
25
+ };
26
+ /** Login with username+password.
27
+ *
28
+ * On auth:v2 backends the client inspects the advertised AuthMethods:
29
+ * - if basic auth is offered, sends {@link LLPlClient.loginBasic};
30
+ * - if only token auth is offered, treats `password` as an opaque bearer token and
31
+ * sends {@link LLPlClient.loginWithToken} (so deployments configured for static-token
32
+ * auth still log in without the caller switching methods).
33
+ *
34
+ * On legacy backends (no auth:v2) it falls through to GetJWTToken with the Basic header,
35
+ * preserving original behavior. */
17
36
  login(user: string, password: string): Promise<AuthInformation>;
18
37
  }
19
38
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"unauth_client.d.ts","names":[],"sources":["../../src/core/unauth_client.ts"],"mappings":";;;;;;;cAUa,uBAAA;EAAA,SACK,EAAA,EAAI,UAAA;EAAA,QAEb,WAAA,CAAA;EAAA,OAIa,KAAA,CAClB,eAAA,EAAiB,cAAA,WACjB,GAAA;IAAQ,MAAA,GAAS,QAAA;EAAA,IAChB,OAAA,CAAQ,uBAAA;EAKE,IAAA,CAAA,GAAQ,OAAA,CAAQ,4BAAA;EAIhB,WAAA,CAAA,GAAe,OAAA,CAAQ,4BAAA;EAIvB,WAAA,CAAA,GAAe,OAAA;EAIf,KAAA,CAAM,IAAA,UAAc,QAAA,WAAmB,OAAA,CAAQ,eAAA;AAAA"}
1
+ {"version":3,"file":"unauth_client.d.ts","names":[],"sources":["../../src/core/unauth_client.ts"],"mappings":";;;;;;;;cAWa,uBAAA;EAAA,SACK,EAAA,EAAI,UAAA;EAAA,QAEb,WAAA,CAAA;EAAA,OAIa,KAAA,CAClB,eAAA,EAAiB,cAAA,WACjB,GAAA;IAAQ,MAAA,GAAS,QAAA;EAAA,IAChB,OAAA,CAAQ,uBAAA;EAKE,IAAA,CAAA,GAAQ,OAAA,CAAQ,4BAAA;EAIhB,WAAA,CAAA,GAAe,OAAA,CAAQ,4BAAA;EAIvB,WAAA,CAAA,GAAe,OAAA;EAIrB,aAAA,CAAc,UAAA,EAAY,iBAAA;EAZZ;;;EAAA,IAmBV,oBAAA,CAAA;IAA0B,KAAA;IAAgB,KAAA;EAAA;EAmBM;;;;;;;;;;EAA9C,KAAA,CAAM,IAAA,UAAc,QAAA,WAAmB,OAAA,CAAQ,eAAA;AAAA"}
@@ -20,9 +20,41 @@ var UnauthenticatedPlClient = class UnauthenticatedPlClient {
20
20
  async requireAuth() {
21
21
  return (await this.authMethods()).methods.length > 0;
22
22
  }
23
+ hasCapability(capability) {
24
+ return this.ll.hasCapability(capability);
25
+ }
26
+ /** Classifies the advertised authentication methods by credential scheme.
27
+ * On legacy backends (no auth:v2) the typed oneof is empty; callers fall through to {@link login}
28
+ * which uses the legacy GetJWTToken path. */
29
+ get supportedAuthSchemes() {
30
+ const result = {
31
+ basic: false,
32
+ token: false
33
+ };
34
+ for (const m of this.ll.authMethodsSync.methods) if (m.method.oneofKind === "basic") result.basic = true;
35
+ else if (m.method.oneofKind === "token") result.token = true;
36
+ return result;
37
+ }
38
+ /** Login with username+password.
39
+ *
40
+ * On auth:v2 backends the client inspects the advertised AuthMethods:
41
+ * - if basic auth is offered, sends {@link LLPlClient.loginBasic};
42
+ * - if only token auth is offered, treats `password` as an opaque bearer token and
43
+ * sends {@link LLPlClient.loginWithToken} (so deployments configured for static-token
44
+ * auth still log in without the caller switching methods).
45
+ *
46
+ * On legacy backends (no auth:v2) it falls through to GetJWTToken with the Basic header,
47
+ * preserving original behavior. */
23
48
  async login(user, password) {
24
49
  try {
25
- const jwtToken = notEmpty(await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), { authorization: "Basic " + Buffer.from(user + ":" + password).toString("base64") }));
50
+ let token;
51
+ if (this.ll.hasCapability("auth:v2")) {
52
+ const schemes = this.supportedAuthSchemes;
53
+ if (schemes.basic) token = await this.ll.loginBasic(user, password);
54
+ else if (schemes.token) token = await this.ll.loginWithToken(password);
55
+ else throw new Error("backend advertises no supported authentication methods");
56
+ } else token = await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), { authorization: "Basic " + Buffer.from(user + ":" + password).toString("base64") });
57
+ const jwtToken = notEmpty(token);
26
58
  if (jwtToken === "") throw new Error("empty token");
27
59
  return { jwtToken };
28
60
  } catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"unauth_client.js","names":[],"sources":["../../src/core/unauth_client.ts"],"sourcesContent":["import type { AuthInformation, PlClientConfig } from \"./config\";\nimport type {\n AuthAPI_ListMethods_Response,\n MaintenanceAPI_Ping_Response,\n} from \"../proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api\";\nimport { LLPlClient } from \"./ll_client\";\nimport { type MiLogger, notEmpty } from \"@milaboratories/ts-helpers\";\nimport { UnauthenticatedError } from \"./errors\";\n\n/** Primarily used for initial authentication (login) */\nexport class UnauthenticatedPlClient {\n public readonly ll: LLPlClient;\n\n private constructor(ll: LLPlClient) {\n this.ll = ll;\n }\n\n public static async build(\n configOrAddress: PlClientConfig | string,\n ops?: { logger?: MiLogger },\n ): Promise<UnauthenticatedPlClient> {\n const ll = await LLPlClient.build(configOrAddress, ops);\n return new UnauthenticatedPlClient(ll);\n }\n\n public async ping(): Promise<MaintenanceAPI_Ping_Response> {\n return await this.ll.ping();\n }\n\n public async authMethods(): Promise<AuthAPI_ListMethods_Response> {\n return await this.ll.authMethods();\n }\n\n public async requireAuth(): Promise<boolean> {\n return (await this.authMethods()).methods.length > 0;\n }\n\n public async login(user: string, password: string): Promise<AuthInformation> {\n try {\n const token = await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), {\n authorization: \"Basic \" + Buffer.from(user + \":\" + password).toString(\"base64\"),\n });\n const jwtToken = notEmpty(token);\n if (jwtToken === \"\") throw new Error(\"empty token\");\n return { jwtToken };\n } catch (e: any) {\n if (e.code === \"UNAUTHENTICATED\") throw new UnauthenticatedError(e.message);\n throw new Error(e);\n }\n }\n}\n"],"mappings":";;;;;AAUA,IAAa,0BAAb,MAAa,wBAAwB;CACnC;CAEA,YAAoB,IAAgB;AAClC,OAAK,KAAK;;CAGZ,aAAoB,MAClB,iBACA,KACkC;AAElC,SAAO,IAAI,wBADA,MAAM,WAAW,MAAM,iBAAiB,IAAI,CACjB;;CAGxC,MAAa,OAA8C;AACzD,SAAO,MAAM,KAAK,GAAG,MAAM;;CAG7B,MAAa,cAAqD;AAChE,SAAO,MAAM,KAAK,GAAG,aAAa;;CAGpC,MAAa,cAAgC;AAC3C,UAAQ,MAAM,KAAK,aAAa,EAAE,QAAQ,SAAS;;CAGrD,MAAa,MAAM,MAAc,UAA4C;AAC3E,MAAI;GAIF,MAAM,WAAW,SAHH,MAAM,KAAK,GAAG,YAAY,OAAO,KAAK,GAAG,KAAK,eAAe,EAAE,EAC3E,eAAe,WAAW,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC,SAAS,SAAS,EAChF,CAAC,CAC8B;AAChC,OAAI,aAAa,GAAI,OAAM,IAAI,MAAM,cAAc;AACnD,UAAO,EAAE,UAAU;WACZ,GAAQ;AACf,OAAI,EAAE,SAAS,kBAAmB,OAAM,IAAI,qBAAqB,EAAE,QAAQ;AAC3E,SAAM,IAAI,MAAM,EAAE"}
1
+ {"version":3,"file":"unauth_client.js","names":[],"sources":["../../src/core/unauth_client.ts"],"sourcesContent":["import type { AuthInformation, PlClientConfig } from \"./config\";\nimport type {\n AuthAPI_ListMethods_Response,\n MaintenanceAPI_Ping_Response,\n} from \"../proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api\";\nimport { LLPlClient } from \"./ll_client\";\nimport { type MiLogger, notEmpty } from \"@milaboratories/ts-helpers\";\nimport { UnauthenticatedError } from \"./errors\";\nimport type { BackendCapability } from \"./capabilities\";\n\n/** Primarily used for initial authentication (login) */\nexport class UnauthenticatedPlClient {\n public readonly ll: LLPlClient;\n\n private constructor(ll: LLPlClient) {\n this.ll = ll;\n }\n\n public static async build(\n configOrAddress: PlClientConfig | string,\n ops?: { logger?: MiLogger },\n ): Promise<UnauthenticatedPlClient> {\n const ll = await LLPlClient.build(configOrAddress, ops);\n return new UnauthenticatedPlClient(ll);\n }\n\n public async ping(): Promise<MaintenanceAPI_Ping_Response> {\n return await this.ll.ping();\n }\n\n public async authMethods(): Promise<AuthAPI_ListMethods_Response> {\n return await this.ll.authMethods();\n }\n\n public async requireAuth(): Promise<boolean> {\n return (await this.authMethods()).methods.length > 0;\n }\n\n public hasCapability(capability: BackendCapability): boolean {\n return this.ll.hasCapability(capability);\n }\n\n /** Classifies the advertised authentication methods by credential scheme.\n * On legacy backends (no auth:v2) the typed oneof is empty; callers fall through to {@link login}\n * which uses the legacy GetJWTToken path. */\n public get supportedAuthSchemes(): { basic: boolean; token: boolean } {\n const result = { basic: false, token: false };\n for (const m of this.ll.authMethodsSync.methods) {\n if (m.method.oneofKind === \"basic\") result.basic = true;\n else if (m.method.oneofKind === \"token\") result.token = true;\n }\n return result;\n }\n\n /** Login with username+password.\n *\n * On auth:v2 backends the client inspects the advertised AuthMethods:\n * - if basic auth is offered, sends {@link LLPlClient.loginBasic};\n * - if only token auth is offered, treats `password` as an opaque bearer token and\n * sends {@link LLPlClient.loginWithToken} (so deployments configured for static-token\n * auth still log in without the caller switching methods).\n *\n * On legacy backends (no auth:v2) it falls through to GetJWTToken with the Basic header,\n * preserving original behavior. */\n public async login(user: string, password: string): Promise<AuthInformation> {\n try {\n let token: string;\n if (this.ll.hasCapability(\"auth:v2\")) {\n const schemes = this.supportedAuthSchemes;\n if (schemes.basic) {\n token = await this.ll.loginBasic(user, password);\n } else if (schemes.token) {\n token = await this.ll.loginWithToken(password);\n } else {\n throw new Error(\"backend advertises no supported authentication methods\");\n }\n } else {\n token = await this.ll.getJwtToken(BigInt(this.ll.conf.authTTLSeconds), {\n authorization: \"Basic \" + Buffer.from(user + \":\" + password).toString(\"base64\"),\n });\n }\n const jwtToken = notEmpty(token);\n if (jwtToken === \"\") throw new Error(\"empty token\");\n return { jwtToken };\n } catch (e: any) {\n if (e.code === \"UNAUTHENTICATED\") throw new U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ACnD,UAAO,EAAE,UAAU;WACZ,GAAQ;AACf,OAAI,EAAE,SAAS,kBAAmB,OAAM,IAAI,qBAAqB,EAAE,QAAQ;AAC3E,SAAM,IAAI,MAAM,EAAE"}
package/dist/index.cjs CHANGED
@@ -7,6 +7,7 @@ const require_transaction = require("./core/transaction.cjs");
7
7
  const require_pl = require("./helpers/pl.cjs");
8
8
  const require_config = require("./core/config.cjs");
9
9
  const require_auth = require("./core/auth.cjs");
10
+ const require_capabilities = require("./core/capabilities.cjs");
10
11
  const require_index = require("./proto-rest/index.cjs");
11
12
  const require_final = require("./core/final.cjs");
12
13
  const require_user_resources = require("./core/user_resources.cjs");
@@ -94,6 +95,7 @@ exports.extractBasicResourceData = require_types.extractBasicResourceData;
94
95
  exports.extractTxId = require_types.extractTxId;
95
96
  exports.field = require_transaction.field;
96
97
  exports.getField = require_types.getField;
98
+ exports.hasCapability = require_capabilities.hasCapability;
97
99
  exports.inferAuthRefreshTime = require_auth.inferAuthRefreshTime;
98
100
  exports.isAbortedError = require_errors.isAbortedError;
99
101
  exports.isAnyResourceId = require_types.isAnyResourceId;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { DefaultFinalResourceDataPredicate, FinalResourceDataPredicate, Resource
4
4
  import { AnyFieldId, AnyFieldRef, AnyRef, AnyResourceRef, FieldId, FieldRef, KeyValue, KeyValueString, LocalFieldId, PlTransaction, ResourceIdWithSignature, ResourceRef, ResourceTreeFrame, ResourceTreeItem, TxCommitConflict, field, isField, isFieldRef, isResource, isResourceId, isResourceRef, toFieldId, toGlobalFieldId, toGlobalResourceId } from "./core/transaction.js";
5
5
  import { pl_d_exports } from "./helpers/pl.js";
6
6
  import { AnonymousAuthInformation, AuthInformation, AuthOps, DEFAULT_AUTH_MAX_REFRESH, DEFAULT_MAX_CACHE_BYTES, DEFAULT_REQUEST_TIMEOUT, DEFAULT_RETRY_BACKOFF_ALGORITHM, DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY, DEFAULT_RETRY_JITTER, DEFAULT_RETRY_LINEAR_BACKOFF_STEP, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RO_TX_TIMEOUT, DEFAULT_RW_TX_TIMEOUT, DEFAULT_TOKEN_TTL_SECONDS, DefaultRetryOptions, PlClientConfig, PlConnectionStatus, PlConnectionStatusListener, SUPPORTED_WIRE_PROTOCOLS, plAddressToConfig, wireProtocol } from "./core/config.js";
7
+ import { BackendCapability, hasCapability } from "./core/capabilities.js";
7
8
  import { GrpcConnection, RestConnection, WireClientProvider, WireClientProviderFactory, WireConnection } from "./core/wire.js";
8
9
  import { index_d_exports } from "./proto-rest/index.js";
9
10
  import { PlDriver, PlDriverDefinition, addRTypeToMetadata, createRTypeRoutingHeader } from "./core/driver.js";
@@ -17,4 +18,4 @@ import { Filter, Property, treeFilter } from "./core/tree_filter.js";
17
18
  import { ValErr, valErr } from "./helpers/tx_helpers.js";
18
19
  import { ContinuePolling, DefaultPollingRetryOptions, PollFieldTraverseOps, PollResourceAccessor, PollTxAccessor, poll } from "./helpers/poll.js";
19
20
  import { test_config_d_exports } from "./test/test_config.js";
20
- export { AnonymousAuthInformation, AnyFieldId, AnyFieldRef, AnyRef, AnyResourceId, AnyResourceRef, AuthInformation, AuthOps, BasicResourceData, ColorProof, ContinuePolling, DEFAULT_AUTH_MAX_REFRESH, DEFAULT_MAX_CACHE_BYTES, DEFAULT_REQUEST_TIMEOUT, DEFAULT_RETRY_BACKOFF_ALGORITHM, DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY, DEFAULT_RETRY_JITTER, DEFAULT_RETRY_LINEAR_BACKOFF_STEP, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RO_TX_TIMEOUT, DEFAULT_RW_TX_TIMEOUT, DEFAULT_TOKEN_TTL_SECONDS, DefaultFinalResourceDataPredicate, DefaultPollingRetryOptions, DefaultRetryOptions, DisconnectedError, FieldData, FieldId, FieldRef, FieldStatus, FieldType, Filter, ResourceAPI_Tree_Filter_OperatorType as FilterOperatorType, ResourceAPI_Tree_Filter_Property as FilterProperty, FinalResourceDataPredicate, FutureFieldType, GlobalResourceId, GrpcConnection, KeyValue, KeyValueString, LocalFieldId, LocalResourceId, MaxLocalId, MaxTxId, NullResourceId, NullSignedResourceId, OptionalAnyResourceId, OptionalSignedResourceId, PermissionDeniedError, pl_d_exports as Pl, PlClient, PlClientConfig, PlConnectionStatus, PlConnectionStatusListener, PlDriver, PlDriverDefinition, PlError, PlErrorCodeNotFound, PlTransaction, PollFieldTraverseOps, PollResourceAccessor, PollTxAccessor, Property, RESTError, RecoverablePlError, ResourceAPI_Tree_Filter, ResourceData, ResourceIdWithSignature, ResourceKind, ResourceRef, ResourceSignature, ResourceTreeFrame, ResourceTreeItem, ResourceType, ResourceTypeName, ResourceTypePrefix, index_d_exports as RestAPI, RestConnection, SUPPORTED_WIRE_PROTOCOLS, SignedResourceId, StorageInfo, test_config_d_exports as TestHelpers, TxCommitConflict, TxOps, TxRunner, UnauthenticatedError, UnauthenticatedPlClient, UnrecoverablePlError, UserResources, ValErr, WireClientProvider, WireClientProviderFactory, WireConnection, addRTypeToMetadata, anyResourceIdToBigint, asSignedResourceId, base64UrlToSignature, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, createSignedResourceId, defaultPlClient, ensureSignedResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullSignedResourceId, isNullSignedResourceId, isPermissionDenied, isResource, isResourceId, isResourceRef, isRootResourceId, isSignedResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, jsonToData, parseResourceType, parseSignedResourceId, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, signatureToBase64Url, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceSignature, treeFilter, tryGetFileConfig, valErr, wireProtocol };
21
+ export { AnonymousAuthInformation, AnyFieldId, AnyFieldRef, AnyRef, AnyResourceId, AnyResourceRef, AuthInformation, AuthOps, BackendCapability, BasicResourceData, ColorProof, ContinuePolling, DEFAULT_AUTH_MAX_REFRESH, DEFAULT_MAX_CACHE_BYTES, DEFAULT_REQUEST_TIMEOUT, DEFAULT_RETRY_BACKOFF_ALGORITHM, DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY, DEFAULT_RETRY_JITTER, DEFAULT_RETRY_LINEAR_BACKOFF_STEP, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RO_TX_TIMEOUT, DEFAULT_RW_TX_TIMEOUT, DEFAULT_TOKEN_TTL_SECONDS, DefaultFinalResourceDataPredicate, DefaultPollingRetryOptions, DefaultRetryOptions, DisconnectedError, FieldData, FieldId, FieldRef, FieldStatus, FieldType, Filter, ResourceAPI_Tree_Filter_OperatorType as FilterOperatorType, ResourceAPI_Tree_Filter_Property as FilterProperty, FinalResourceDataPredicate, FutureFieldType, GlobalResourceId, GrpcConnection, KeyValue, KeyValueString, LocalFieldId, LocalResourceId, MaxLocalId, MaxTxId, NullResourceId, NullSignedResourceId, OptionalAnyResourceId, OptionalSignedResourceId, PermissionDeniedError, pl_d_exports as Pl, PlClient, PlClientConfig, PlConnectionStatus, PlConnectionStatusListener, PlDriver, PlDriverDefinition, PlError, PlErrorCodeNotFound, PlTransaction, PollFieldTraverseOps, PollResourceAccessor, PollTxAccessor, Property, RESTError, RecoverablePlError, ResourceAPI_Tree_Filter, ResourceData, ResourceIdWithSignature, ResourceKind, ResourceRef, ResourceSignature, ResourceTreeFrame, ResourceTreeItem, ResourceType, ResourceTypeName, ResourceTypePrefix, index_d_exports as RestAPI, RestConnection, SUPPORTED_WIRE_PROTOCOLS, SignedResourceId, StorageInfo, test_config_d_exports as TestHelpers, TxCommitConflict, TxOps, TxRunner, UnauthenticatedError, UnauthenticatedPlClient, UnrecoverablePlError, UserResources, ValErr, WireClientProvider, WireClientProviderFactory, WireConnection, addRTypeToMetadata, anyResourceIdToBigint, asSignedResourceId, base64UrlToSignature, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, createSignedResourceId, defaultPlClient, ensureSignedResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, hasCapability, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullSignedResourceId, isNullSignedResourceId, isPermissionDenied, isResource, isResourceId, isResourceRef, isRootResourceId, isSignedResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, jsonToData, parseResourceType, parseSignedResourceId, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, signatureToBase64Url, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceSignature, treeFilter, tryGetFileConfig, valErr, wireProtocol };
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import { PlTransaction, TxCommitConflict, field, isField, isFieldRef, isResource
5
5
  import { pl_exports } from "./helpers/pl.js";
6
6
  import { AnonymousAuthInformation, DEFAULT_AUTH_MAX_REFRESH, DEFAULT_MAX_CACHE_BYTES, DEFAULT_REQUEST_TIMEOUT, DEFAULT_RETRY_BACKOFF_ALGORITHM, DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY, DEFAULT_RETRY_JITTER, DEFAULT_RETRY_LINEAR_BACKOFF_STEP, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RO_TX_TIMEOUT, DEFAULT_RW_TX_TIMEOUT, DEFAULT_TOKEN_TTL_SECONDS, DefaultRetryOptions, SUPPORTED_WIRE_PROTOCOLS, plAddressToConfig } from "./core/config.js";
7
7
  import { expirationFromAuthInformation, inferAuthRefreshTime } from "./core/auth.js";
8
+ import { hasCapability } from "./core/capabilities.js";
8
9
  import { proto_rest_exports } from "./proto-rest/index.js";
9
10
  import { DefaultFinalResourceDataPredicate, ResourceTypeName, ResourceTypePrefix } from "./core/final.js";
10
11
  import { UserResources } from "./core/user_resources.js";
@@ -16,4 +17,4 @@ import { treeFilter } from "./core/tree_filter.js";
16
17
  import { valErr } from "./helpers/tx_helpers.js";
17
18
  import { ContinuePolling, DefaultPollingRetryOptions, PollResourceAccessor, PollTxAccessor, poll } from "./helpers/poll.js";
18
19
  import { test_config_exports } from "./test/test_config.js";
19
- export { AnonymousAuthInformation, ContinuePolling, DEFAULT_AUTH_MAX_REFRESH, DEFAULT_MAX_CACHE_BYTES, DEFAULT_REQUEST_TIMEOUT, DEFAULT_RETRY_BACKOFF_ALGORITHM, DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY, DEFAULT_RETRY_JITTER, DEFAULT_RETRY_LINEAR_BACKOFF_STEP, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RO_TX_TIMEOUT, DEFAULT_RW_TX_TIMEOUT, DEFAULT_TOKEN_TTL_SECONDS, DefaultFinalResourceDataPredicate, DefaultPollingRetryOptions, DefaultRetryOptions, DisconnectedError, ResourceAPI_Tree_Filter_OperatorType as FilterOperatorType, ResourceAPI_Tree_Filter_Property as FilterProperty, MaxLocalId, MaxTxId, NullResourceId, NullSignedResourceId, PermissionDeniedError, pl_exports as Pl, PlClient, PlError, PlErrorCodeNotFound, PlTransaction, PollResourceAccessor, PollTxAccessor, RESTError, RecoverablePlError, ResourceTypeName, ResourceTypePrefix, proto_rest_exports as RestAPI, SUPPORTED_WIRE_PROTOCOLS, test_config_exports as TestHelpers, TxCommitConflict, UnauthenticatedError, UnauthenticatedPlClient, UnrecoverablePlError, UserResources, addRTypeToMetadata, anyResourceIdToBigint, asSignedResourceId, base64UrlToSignature, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, createSignedResourceId, defaultPlClient, ensureSignedResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullSignedResourceId, isNullSignedResourceId, isPermissionDenied, isResource, isResourceId, isResourceRef, isRootResourceId, isSignedResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, jsonToData, parseResourceType, parseSignedResourceId, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, signatureToBase64Url, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceSignature, treeFilter, tryGetFileConfig, valErr };
20
+ export { AnonymousAuthInformation, ContinuePolling, DEFAULT_AUTH_MAX_REFRESH, DEFAULT_MAX_CACHE_BYTES, DEFAULT_REQUEST_TIMEOUT, DEFAULT_RETRY_BACKOFF_ALGORITHM, DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER, DEFAULT_RETRY_INITIAL_DELAY, DEFAULT_RETRY_JITTER, DEFAULT_RETRY_LINEAR_BACKOFF_STEP, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RO_TX_TIMEOUT, DEFAULT_RW_TX_TIMEOUT, DEFAULT_TOKEN_TTL_SECONDS, DefaultFinalResourceDataPredicate, DefaultPollingRetryOptions, DefaultRetryOptions, DisconnectedError, ResourceAPI_Tree_Filter_OperatorType as FilterOperatorType, ResourceAPI_Tree_Filter_Property as FilterProperty, MaxLocalId, MaxTxId, NullResourceId, NullSignedResourceId, PermissionDeniedError, pl_exports as Pl, PlClient, PlError, PlErrorCodeNotFound, PlTransaction, PollResourceAccessor, PollTxAccessor, RESTError, RecoverablePlError, ResourceTypeName, ResourceTypePrefix, proto_rest_exports as RestAPI, SUPPORTED_WIRE_PROTOCOLS, test_config_exports as TestHelpers, TxCommitConflict, UnauthenticatedError, UnauthenticatedPlClient, UnrecoverablePlError, UserResources, addRTypeToMetadata, anyResourceIdToBigint, asSignedResourceId, base64UrlToSignature, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, createSignedResourceId, defaultPlClient, ensureSignedResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, hasCapability, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullSignedResourceId, isNullSignedResourceId, isPermissionDenied, isResource, isResourceId, isResourceRef, isRootResourceId, isSignedResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, jsonToData, parseResourceType, parseSignedResourceId, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, signatureToBase64Url, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceSignature, treeFilter, tryGetFileConfig, valErr };
@@ -1 +1 @@
1
- {"version":3,"file":"status.cjs","names":["MessageType","Any","UnknownFieldHandler","WireType"],"sources":["../../../../../../../src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/googleapis/googleapis/google/rpc/status.proto\" (package \"google.rpc\", syntax proto3)\n// tslint:disable\n//\n// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\nimport { Any } from \"../../../../../google/protobuf/any\";\n/**\n * The `Status` type defines a logical error model that is suitable for\n * different programming environments, including REST APIs and RPC APIs. It is\n * used by [gRPC](https://github.com/grpc). Each `Status` message contains\n * three pieces of data: error code, error message, and error details.\n *\n * You can find out more about this error model and how to work with it in the\n * [API Design Guide](https://cloud.google.com/apis/design/errors).\n *\n * @generated from protobuf message google.rpc.Status\n */\nexport interface Status {\n /**\n * The status code, which should be an enum value of\n * [google.rpc.Code][google.rpc.Code].\n *\n * @generated from protobuf field: int32 code = 1\n */\n code: number;\n /**\n * A developer-facing error message, which should be in English. Any\n * user-facing error message should be localized and sent in the\n * [google.rpc.Status.details][google.rpc.Status.details] field, or localized\n * by the client.\n *\n * @generated from protobuf field: string message = 2\n */\n message: string;\n /**\n * A list of messages that carry the error details. There is a common set of\n * message types for APIs to use.\n *\n * @generated from protobuf field: repeated google.protobuf.Any details = 3\n */\n details: Any[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Status$Type extends MessageType<Status> {\n constructor() {\n super(\"google.rpc.Status\", [\n { no: 1, name: \"code\", kind: \"scalar\", T: 5 /*ScalarType.INT32*/ },\n { no: 2, name: \"message\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"details\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Any }\n ]);\n }\n create(value?: PartialMessage<Status>): Status {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.code = 0;\n message.message = \"\";\n message.details = [];\n if (value !== undefined)\n reflectionMergePartial<Status>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Status): Status {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int32 code */ 1:\n message.code = reader.int32();\n break;\n case /* string message */ 2:\n message.message = reader.string();\n break;\n case /* repeated google.protobuf.Any details */ 3:\n message.details.push(Any.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Status, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int32 code = 1; */\n if (message.code !== 0)\n writer.tag(1, WireType.Varint).int32(message.code);\n /* string message = 2; */\n if (message.message !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.message);\n /* repeated google.protobuf.Any details = 3; */\n for (let i = 0; i < message.details.length; i++)\n Any.internalBinaryWrite(message.details[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.rpc.Status\n */\nexport const Status = new Status$Type();\n"],"mappings":";;;;AAiEA,IAAM,cA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4C;AAEpG,MAAI,QAAQ,SAAS,EACjB,QAAO,IAAI,GAAGC,qBAAAA,SAAS,OAAO,CAAC,MAAM,QAAQ,KAAK;AAEtD,MAAI,QAAQ,YAAY,GACpB,QAAO,IAAI,GAAGA,qBAAAA,SAAS,gBAAgB,CAAC,OAAO,QAAQ,QAAQ;AAEnE,OAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,QAAQ,IACxC,aAAA,IAAI,oBAAoB,QAAQ,QAAQ,IAAI,OAAO,IAAI,GAAGA,qBAAAA,SAAS,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM;EAC/G,IAAI,IAAI,QAAQ;AAChB,MAAI,MAAM,MACN,EAAC,KAAK,OAAOD,qBAAAA,oBAAoB,UAAU,GAAG,KAAK,UAAU,SAAS,OAAO;AACjF,SAAO;;;;;;AAMf,MAAa,SAAS,IAAI,aAAa"}
1
+ {"version":3,"file":"status.cjs","names":["MessageType","Any","UnknownFieldHandler","WireType"],"sources":["../../../../../../../src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/googleapis/googleapis/google/rpc/status.proto\" (package \"google.rpc\", syntax proto3)\n// tslint:disable\n//\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\nimport { Any } from \"../../../../../google/protobuf/any\";\n/**\n * The `Status` type defines a logical error model that is suitable for\n * different programming environments, including REST APIs and RPC APIs. It is\n * used by [gRPC](https://github.com/grpc). Each `Status` message contains\n * three pieces of data: error code, error message, and error details.\n *\n * You can find out more about this error model and how to work with it in the\n * [API Design Guide](https://cloud.google.com/apis/design/errors).\n *\n * @generated from protobuf message google.rpc.Status\n */\nexport interface Status {\n /**\n * The status code, which should be an enum value of\n * [google.rpc.Code][google.rpc.Code].\n *\n * @generated from protobuf field: int32 code = 1\n */\n code: number;\n /**\n * A developer-facing error message, which should be in English. Any\n * user-facing error message should be localized and sent in the\n * [google.rpc.Status.details][google.rpc.Status.details] field, or localized\n * by the client.\n *\n * @generated from protobuf field: string message = 2\n */\n message: string;\n /**\n * A list of messages that carry the error details. There is a common set of\n * message types for APIs to use.\n *\n * @generated from protobuf field: repeated google.protobuf.Any details = 3\n */\n details: Any[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Status$Type extends MessageType<Status> {\n constructor() {\n super(\"google.rpc.Status\", [\n { no: 1, name: \"code\", kind: \"scalar\", T: 5 /*ScalarType.INT32*/ },\n { no: 2, name: \"message\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"details\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Any }\n ]);\n }\n create(value?: PartialMessage<Status>): Status {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.code = 0;\n message.message = \"\";\n message.details = [];\n if (value !== undefined)\n reflectionMergePartial<Status>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Status): Status {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int32 code */ 1:\n message.code = reader.int32();\n break;\n case /* string message */ 2:\n message.message = reader.string();\n break;\n case /* repeated google.protobuf.Any details */ 3:\n message.details.push(Any.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Status, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int32 code = 1; */\n if (message.code !== 0)\n writer.tag(1, WireType.Varint).int32(message.code);\n /* string message = 2; */\n if (message.message !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.message);\n /* repeated google.protobuf.Any details = 3; */\n for (let i = 0; i < message.details.length; i++)\n Any.internalBinaryWrite(message.details[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.rpc.Status\n */\nexport const Status = new Status$Type();\n"],"mappings":";;;;AAiEA,IAAM,cAAN,cAA0BA,qBAAAA,YAAoB;CAC1C,cAAc;AACV,QAAM,qBAAqB;GACvB;IAAE,IAAI;IAAG,MAAM;IAAQ,MAAM;IAAU,GAAG;IAAwB;GAClE;IAAE,IAAI;IAAG,MAAM;IAAW,MAAM;IAAU,GAAG;IAAyB;GACtE;IAAE,IAAI;IAAG,MAAM;IAAW,MAAM;IAAW,QAAQ;IAA2B,SAASC,YAAAA;IAAK;GAC/F,CAAC;;CAEN,OAAO,OAAwC;EAC3C,MAAM,UAAU,WAAW,OAAO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AAAA,SAAS,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM;EAC/G,IAAI,IAAI,QAAQ;AAChB,MAAI,MAAM,MACN,EAAC,KAAK,OAAOD,qBAAAA,oBAAoB,UAAU,GAAG,KAAK,UAAU,SAAS,OAAO;AACjF,SAAO;;;;;;AAMf,MAAa,SAAS,IAAI,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","names":[],"sources":["../../../../../../../src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/googleapis/googleapis/google/rpc/status.proto\" (package \"google.rpc\", syntax proto3)\n// tslint:disable\n//\n// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\nimport { Any } from \"../../../../../google/protobuf/any\";\n/**\n * The `Status` type defines a logical error model that is suitable for\n * different programming environments, including REST APIs and RPC APIs. It is\n * used by [gRPC](https://github.com/grpc). Each `Status` message contains\n * three pieces of data: error code, error message, and error details.\n *\n * You can find out more about this error model and how to work with it in the\n * [API Design Guide](https://cloud.google.com/apis/design/errors).\n *\n * @generated from protobuf message google.rpc.Status\n */\nexport interface Status {\n /**\n * The status code, which should be an enum value of\n * [google.rpc.Code][google.rpc.Code].\n *\n * @generated from protobuf field: int32 code = 1\n */\n code: number;\n /**\n * A developer-facing error message, which should be in English. Any\n * user-facing error message should be localized and sent in the\n * [google.rpc.Status.details][google.rpc.Status.details] field, or localized\n * by the client.\n *\n * @generated from protobuf field: string message = 2\n */\n message: string;\n /**\n * A list of messages that carry the error details. There is a common set of\n * message types for APIs to use.\n *\n * @generated from protobuf field: repeated google.protobuf.Any details = 3\n */\n details: Any[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Status$Type extends MessageType<Status> {\n constructor() {\n super(\"google.rpc.Status\", [\n { no: 1, name: \"code\", kind: \"scalar\", T: 5 /*ScalarType.INT32*/ },\n { no: 2, name: \"message\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"details\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Any }\n ]);\n }\n create(value?: PartialMessage<Status>): Status {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.code = 0;\n message.message = \"\";\n message.details = [];\n if (value !== undefined)\n reflectionMergePartial<Status>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Status): Status {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int32 code */ 1:\n message.code = reader.int32();\n break;\n case /* string message */ 2:\n message.message = reader.string();\n break;\n case /* repeated google.protobuf.Any details */ 3:\n message.details.push(Any.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Status, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int32 code = 1; */\n if (message.code !== 0)\n writer.tag(1, WireType.Varint).int32(message.code);\n /* string message = 2; */\n if (message.message !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.message);\n /* repeated google.protobuf.Any details = 3; */\n for (let i = 0; i < message.details.length; i++)\n Any.internalBinaryWrite(message.details[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message google.rpc.Status\n */\nexport const Status = new Status$Type();\n"],"mappings":";;;AAiEA,IAAM,cAAN,cAA0B,YAAoB;CAC1C,cAAc;AACV,QAAM,qBAAqB;GACvB;IAAE,IAAI;IAAG,MAAM;IAAQ,MAAM;IAAU,GAAG;IAAwB;GAClE;IAAE,IAAI;IAAG,MAAM;IAAW,MAAM;IAAU,GAAG;IAAyB;GACtE;IAAE,IAAI;IAAG,MAAM;IAAW,MAAM;IAAW,QAAQ;IAA2B,SAAS;IAAK;GAC/F,CAAC;;CAEN,OAAO,OAAwC;EAC3C,MAAM,UAAU,WAAW,OAAO,OAAQ,KAAK,iBAAmB;AAClE,UAAQ,OAAO;AACf,UAAQ,UAAU;AAClB,UAAQ,UAAU,EAAE;AACpB,MAAI,UAAU,KAAA,EACV,wBAA+B,MAAM,SAAS,MAAM;AACxD,SAAO;;CAEX,mBAAmB,QAAuB,QAAgB,SAA4B,QAAyB;EAC3G,IAAI,UAAU,UAAU,KAAK,QAAQ,EAAE,MAAM,OAAO,MAAM;AAC1D,SAAO,OAAO,MAAM,KAAK;GACrB,IAAI,CAAC,SAAS,YAAY,OAAO,KAAK;AACtC,WAAQ,SAAR;IACI,KAAsB;AAClB,aAAQ,OAAO,OAAO,OAAO;AAC7B;IACJ,KAA0B;AACtB,aAAQ,UAAU,OAAO,QAAQ;AACjC;IACJ,KAAgD;AAC5C,aAAQ,QAAQ,KAAK,IAAI,mBAAmB,QAAQ,OAAO,QAAQ,EAAE,QAAQ,CAAC;AAC9E;IACJ;KACI,IAAI,IAAI,QAAQ;AAChB,SAAI,MAAM,QACN,OAAM,IAAI,WAAW,MAAM,iBAAiB,QAAQ,cAAc,SAAS,QAAQ,KAAK,WAAW;KACvG,IAAI,IAAI,OAAO,KAAK,SAAS;AAC7B,SAAI,MAAM,MACN,EAAC,MAAM,OAAO,oBAAoB,SAAS,GAAG,KAAK,UAAU,SAAS,SAAS,UAAU,EAAE;;;AAG3G,SAAO;;CAEX,oBAAoB,SAAiB,QAAuB,SAA4C;AAEpG,MAAI,QAAQ,SAAS,EACjB,QAAO,IAAI,GAAG,SAAS,OAAO,CAAC,MAAM,QAAQ,KAAK;AAEtD,MAAI,QAAQ,YAAY,GACpB,QAAO,IAAI,GAAG,SAAS,gBAAgB,CAAC,OAAO,QAAQ,QAAQ;AAEnE,OAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,QAAQ,IACxC,KAAI,oBAAoB,QAAQ,QAAQ,IAAI,OAAO,IAAI,GAAG,SAAS,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM;EAC/G,IAAI,IAAI,QAAQ;AAChB,MAAI,MAAM,MACN,EAAC,KAAK,OAAO,oBAAoB,UAAU,GAAG,KAAK,UAAU,SAAS,OAAO;AACjF,SAAO;;;;;;AAMf,MAAa,SAAS,IAAI,aAAa"}
1
+ {"version":3,"file":"status.js","names":[],"sources":["../../../../../../../src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/googleapis/googleapis/google/rpc/status.proto\" (package \"google.rpc\", syntax proto3)\n// tslint:disable\n//\n// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\nimport { Any } from \"../../../../../google/protobuf/any\";\n/**\n * The `Status` type defines a logical error model that is suitable for\n * different programming environments, including REST APIs and RPC APIs. It is\n * used by [gRPC](https://github.com/grpc). Each `Status` message contains\n * three pieces of data: error code, error message, and error details.\n *\n * You can find out more about this error model and how to work with it in the\n * [API Design Guide](https://cloud.google.com/apis/design/errors).\n *\n * @generated from protobuf message google.rpc.Status\n */\nexport interface Status {\n /**\n * The status code, which should be an enum value of\n * [google.rpc.Code][google.rpc.Code].\n *\n * @generated from protobuf field: int32 code = 1\n */\n code: number;\n /**\n * A developer-facing error message, which should be in English. Any\n * user-facing error message should be localized and sent in the\n * [google.rpc.Status.details][google.rpc.Status.details] field, or localized\n * by the client.\n *\n * @generated from protobuf field: string message = 2\n */\n message: string;\n /**\n * A list of messages that carry the error details. There is a common set of\n * message types for APIs to use.\n *\n * @generated from protobuf field: repeated google.protobuf.Any details = 3\n */\n details: Any[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass Status$Type extends MessageType<Status> {\n constructor() {\n super(\"google.rpc.Status\", [\n { no: 1, name: \"code\", kind: \"scalar\", T: 5 /*ScalarType.INT32*/ },\n { no: 2, name: \"message\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"details\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Any }\n ]);\n }\n create(value?: PartialMessage<Status>): Status {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.code = 0;\n message.message = \"\";\n message.details = [];\n if (value !== undefined)\n reflectionMergePartial<Status>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Status): Status {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* int32 code */ 1:\n message.code = reader.int32();\n break;\n case /* string message */ 2:\n message.message = reader.string();\n break;\n case /* repeated google.protobuf.Any details */ 3:\n message.details.push(Any.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: Status, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* int32 code = 1; */\n if (message.code !== 0)\n writer.tag(1, WireType.Varint).int32(message.code);\n /* string message = 2; */\n if (message.message !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.message);\n /* repeated google.protobuf.Any details = 3; */\n for (let i = 0; i < message.details.length; i++)\n Any.internalBinaryWrite(message.details[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writ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