@milaboratories/pl-client 3.0.0 → 3.1.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.
- package/dist/_virtual/_rolldown/runtime.cjs +12 -22
- package/dist/_virtual/_rolldown/runtime.js +6 -11
- package/dist/core/PromiseTracker.cjs +2 -3
- package/dist/core/PromiseTracker.cjs.map +1 -1
- package/dist/core/PromiseTracker.d.ts.map +1 -0
- package/dist/core/PromiseTracker.js +1 -2
- package/dist/core/PromiseTracker.js.map +1 -1
- package/dist/core/StatefulPromise.cjs +1 -2
- package/dist/core/StatefulPromise.cjs.map +1 -1
- package/dist/core/StatefulPromise.js +1 -1
- package/dist/core/StatefulPromise.js.map +1 -1
- package/dist/core/abstract_stream.d.ts.map +1 -0
- package/dist/core/advisory_locks.cjs +1 -2
- package/dist/core/advisory_locks.cjs.map +1 -1
- package/dist/core/advisory_locks.js +1 -1
- package/dist/core/advisory_locks.js.map +1 -1
- package/dist/core/auth.cjs +2 -3
- package/dist/core/auth.cjs.map +1 -1
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +1 -2
- package/dist/core/auth.js.map +1 -1
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/client.cjs +63 -36
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.d.ts +3 -1
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +54 -27
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.cjs +16 -17
- package/dist/core/config.cjs.map +1 -1
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +16 -16
- package/dist/core/config.js.map +1 -1
- package/dist/core/default_client.cjs +6 -7
- package/dist/core/default_client.cjs.map +1 -1
- package/dist/core/default_client.d.ts.map +1 -0
- package/dist/core/default_client.js +1 -2
- package/dist/core/default_client.js.map +1 -1
- package/dist/core/driver.cjs +1 -2
- package/dist/core/driver.cjs.map +1 -1
- package/dist/core/driver.d.ts.map +1 -0
- package/dist/core/driver.js +1 -1
- package/dist/core/error_resource.cjs +1 -2
- package/dist/core/error_resource.cjs.map +1 -1
- package/dist/core/error_resource.js +1 -1
- package/dist/core/errors.cjs +11 -4
- package/dist/core/errors.cjs.map +1 -1
- package/dist/core/errors.d.ts +2 -1
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +9 -3
- package/dist/core/errors.js.map +1 -1
- package/dist/core/final.cjs +3 -4
- package/dist/core/final.cjs.map +1 -1
- package/dist/core/final.d.ts.map +1 -0
- package/dist/core/final.js +1 -2
- package/dist/core/final.js.map +1 -1
- package/dist/core/ll_client.cjs +24 -13
- package/dist/core/ll_client.cjs.map +1 -1
- package/dist/core/ll_client.d.ts +6 -1
- package/dist/core/ll_client.d.ts.map +1 -0
- package/dist/core/ll_client.js +13 -2
- package/dist/core/ll_client.js.map +1 -1
- package/dist/core/ll_transaction.cjs +4 -5
- package/dist/core/ll_transaction.cjs.map +1 -1
- package/dist/core/ll_transaction.d.ts.map +1 -0
- package/dist/core/ll_transaction.js +1 -2
- package/dist/core/ll_transaction.js.map +1 -1
- package/dist/core/stat.cjs +1 -2
- package/dist/core/stat.cjs.map +1 -1
- package/dist/core/stat.d.ts.map +1 -0
- package/dist/core/stat.js +1 -1
- package/dist/core/transaction.cjs +30 -19
- package/dist/core/transaction.cjs.map +1 -1
- package/dist/core/transaction.d.ts.map +1 -0
- package/dist/core/transaction.js +21 -10
- package/dist/core/transaction.js.map +1 -1
- package/dist/core/type_conversion.cjs +7 -8
- package/dist/core/type_conversion.cjs.map +1 -1
- package/dist/core/type_conversion.js +3 -4
- package/dist/core/type_conversion.js.map +1 -1
- package/dist/core/types.cjs +3 -4
- package/dist/core/types.cjs.map +1 -1
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/unauth_client.cjs +4 -5
- package/dist/core/unauth_client.cjs.map +1 -1
- package/dist/core/unauth_client.d.ts.map +1 -0
- package/dist/core/unauth_client.js +1 -2
- package/dist/core/unauth_client.js.map +1 -1
- package/dist/core/websocket_stream.cjs +4 -5
- package/dist/core/websocket_stream.cjs.map +1 -1
- package/dist/core/websocket_stream.js +1 -2
- package/dist/core/websocket_stream.js.map +1 -1
- package/dist/core/wire.d.ts.map +1 -0
- package/dist/helpers/pl.cjs +12 -14
- package/dist/helpers/pl.cjs.map +1 -1
- package/dist/helpers/pl.d.ts.map +1 -0
- package/dist/helpers/pl.js +5 -7
- package/dist/helpers/pl.js.map +1 -1
- package/dist/helpers/poll.cjs +3 -4
- package/dist/helpers/poll.cjs.map +1 -1
- package/dist/helpers/poll.d.ts.map +1 -0
- package/dist/helpers/poll.js +1 -2
- package/dist/helpers/poll.js.map +1 -1
- package/dist/helpers/retry_strategy.cjs +1 -2
- package/dist/helpers/retry_strategy.cjs.map +1 -1
- package/dist/helpers/retry_strategy.js +1 -1
- package/dist/helpers/retry_strategy.js.map +1 -1
- package/dist/helpers/tx_helpers.cjs +3 -4
- package/dist/helpers/tx_helpers.cjs.map +1 -1
- package/dist/helpers/tx_helpers.d.ts.map +1 -0
- package/dist/helpers/tx_helpers.js +1 -2
- package/dist/helpers/tx_helpers.js.map +1 -1
- package/dist/index.cjs +34 -34
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -3
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.cjs +3 -4
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.cjs.map +1 -1
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.js +1 -2
- package/dist/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +115 -421
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs +3 -4
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +4 -4
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js +1 -2
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.client.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js +108 -414
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs +5 -6
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js +1 -2
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api_types.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs +2 -3
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js +1 -2
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/base_types.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs +6 -16
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +1 -0
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js +4 -14
- package/dist/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/any.cjs +2 -3
- package/dist/proto-grpc/google/protobuf/any.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/any.d.ts.map +1 -0
- package/dist/proto-grpc/google/protobuf/any.js +1 -2
- package/dist/proto-grpc/google/protobuf/any.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/duration.cjs +2 -3
- package/dist/proto-grpc/google/protobuf/duration.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/duration.d.ts.map +1 -0
- package/dist/proto-grpc/google/protobuf/duration.js +1 -2
- package/dist/proto-grpc/google/protobuf/duration.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/timestamp.cjs +2 -3
- package/dist/proto-grpc/google/protobuf/timestamp.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/timestamp.d.ts.map +1 -0
- package/dist/proto-grpc/google/protobuf/timestamp.js +1 -2
- package/dist/proto-grpc/google/protobuf/timestamp.js.map +1 -1
- package/dist/proto-grpc/google/rpc/code.cjs +1 -2
- package/dist/proto-grpc/google/rpc/code.cjs.map +1 -1
- package/dist/proto-grpc/google/rpc/code.d.ts.map +1 -0
- package/dist/proto-grpc/google/rpc/code.js +1 -1
- package/dist/proto-grpc/google/rpc/code.js.map +1 -1
- package/dist/proto-rest/index.cjs +8 -9
- package/dist/proto-rest/index.cjs.map +1 -1
- package/dist/proto-rest/index.d.ts.map +1 -0
- package/dist/proto-rest/index.js +1 -2
- package/dist/proto-rest/index.js.map +1 -1
- package/dist/proto-rest/plapi.d.ts.map +1 -0
- package/dist/test/tcp-proxy.cjs +2 -3
- package/dist/test/tcp-proxy.cjs.map +1 -1
- package/dist/test/tcp-proxy.d.ts.map +1 -0
- package/dist/test/tcp-proxy.js +1 -2
- package/dist/test/tcp-proxy.js.map +1 -1
- package/dist/test/test_config.cjs +16 -19
- package/dist/test/test_config.cjs.map +1 -1
- package/dist/test/test_config.d.ts.map +1 -0
- package/dist/test/test_config.js +3 -6
- package/dist/test/test_config.js.map +1 -1
- package/dist/util/pl.cjs +1 -2
- package/dist/util/pl.cjs.map +1 -1
- package/dist/util/pl.js +1 -1
- package/dist/util/util.cjs +1 -2
- package/dist/util/util.cjs.map +1 -1
- package/dist/util/util.js +1 -1
- package/package.json +7 -7
- package/src/core/client.ts +80 -30
- package/src/core/errors.ts +11 -0
- package/src/core/ll_client.test.ts +15 -0
- package/src/core/ll_client.ts +22 -1
- package/src/core/ll_transaction.test.ts +12 -2
- package/src/core/transaction.ts +8 -2
- package/src/proto-grpc/github.com/milaboratory/pl/plapi/plapiproto/api.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry_strategy.cjs","names":[],"sources":["../../src/helpers/retry_strategy.ts"],"sourcesContent":["export interface RetryConfig {\n maxAttempts: number;\n initialDelay: number;\n maxDelay: number;\n}\n\nexport const DEFAULT_RETRY_CONFIG: RetryConfig = {\n maxAttempts: 10,\n initialDelay: 100,\n maxDelay: 30000,\n};\n\nexport interface RetryCallbacks {\n onRetry: () => void;\n onMaxAttemptsReached: (error: Error) => void;\n}\n\nexport class RetryStrategy {\n private attempts = 0;\n private timer: ReturnType<typeof setTimeout> | null = null;\n private readonly config: RetryConfig;\n private readonly callbacks: RetryCallbacks;\n private readonly backoff: ExponentialBackoff;\n\n constructor(config: Partial<RetryConfig>, callbacks: RetryCallbacks) {\n this.config = { ...DEFAULT_RETRY_CONFIG, ...config };\n this.callbacks = callbacks;\n this.backoff = new ExponentialBackoff({\n initialDelay: this.config.initialDelay,\n maxDelay: this.config.maxDelay,\n factor: 2,\n jitter: 0.1,\n });\n }\n\n schedule(): void {\n if (this.timer) return;\n if (this.hasExceededLimit()) {\n this.notifyMaxAttemptsReached();\n return;\n }\n\n this.timer = setTimeout(() => {\n this.timer = null;\n this.attempts++;\n this.callbacks.onRetry();\n }, this.backoff.delay());\n }\n\n cancel(): void {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n }\n\n reset(): void {\n this.attempts = 0;\n this.backoff.reset();\n }\n\n private hasExceededLimit(): boolean {\n return this.attempts >= this.config.maxAttempts;\n }\n\n private notifyMaxAttemptsReached(): void {\n const error = new Error(`Max retry attempts (${this.config.maxAttempts}) reached`);\n this.callbacks.onMaxAttemptsReached(error);\n }\n}\n\ninterface ExponentialBackoffConfig {\n initialDelay: number;\n maxDelay: number;\n factor: number;\n jitter: number;\n}\n\nclass ExponentialBackoff {\n private readonly initialDelay: number;\n private readonly maxDelay: number;\n\n private currentDelay: number;\n\n private readonly factor: number;\n private readonly jitter: number;\n\n constructor(config: ExponentialBackoffConfig) {\n this.initialDelay = config.initialDelay;\n this.maxDelay = config.maxDelay;\n this.factor = config.factor;\n this.jitter = config.jitter;\n this.currentDelay = config.initialDelay;\n }\n\n delay(): number {\n if (this.currentDelay >= this.maxDelay) {\n return this.applyJitter(this.maxDelay);\n }\n\n this.currentDelay = this.currentDelay * this.factor;\n\n if (this.currentDelay > this.maxDelay) {\n this.currentDelay = this.maxDelay;\n }\n\n return this.applyJitter(this.currentDelay);\n }\n\n reset(): void {\n this.currentDelay = this.initialDelay;\n }\n\n private applyJitter(delay: number): number {\n if (delay === 0 || this.jitter === 0) {\n return delay;\n }\n const delayFactor = 1 - this.jitter / 2 + Math.random() * this.jitter;\n return delay * delayFactor;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"retry_strategy.cjs","names":[],"sources":["../../src/helpers/retry_strategy.ts"],"sourcesContent":["export interface RetryConfig {\n maxAttempts: number;\n initialDelay: number;\n maxDelay: number;\n}\n\nexport const DEFAULT_RETRY_CONFIG: RetryConfig = {\n maxAttempts: 10,\n initialDelay: 100,\n maxDelay: 30000,\n};\n\nexport interface RetryCallbacks {\n onRetry: () => void;\n onMaxAttemptsReached: (error: Error) => void;\n}\n\nexport class RetryStrategy {\n private attempts = 0;\n private timer: ReturnType<typeof setTimeout> | null = null;\n private readonly config: RetryConfig;\n private readonly callbacks: RetryCallbacks;\n private readonly backoff: ExponentialBackoff;\n\n constructor(config: Partial<RetryConfig>, callbacks: RetryCallbacks) {\n this.config = { ...DEFAULT_RETRY_CONFIG, ...config };\n this.callbacks = callbacks;\n this.backoff = new ExponentialBackoff({\n initialDelay: this.config.initialDelay,\n maxDelay: this.config.maxDelay,\n factor: 2,\n jitter: 0.1,\n });\n }\n\n schedule(): void {\n if (this.timer) return;\n if (this.hasExceededLimit()) {\n this.notifyMaxAttemptsReached();\n return;\n }\n\n this.timer = setTimeout(() => {\n this.timer = null;\n this.attempts++;\n this.callbacks.onRetry();\n }, this.backoff.delay());\n }\n\n cancel(): void {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n }\n\n reset(): void {\n this.attempts = 0;\n this.backoff.reset();\n }\n\n private hasExceededLimit(): boolean {\n return this.attempts >= this.config.maxAttempts;\n }\n\n private notifyMaxAttemptsReached(): void {\n const error = new Error(`Max retry attempts (${this.config.maxAttempts}) reached`);\n this.callbacks.onMaxAttemptsReached(error);\n }\n}\n\ninterface ExponentialBackoffConfig {\n initialDelay: number;\n maxDelay: number;\n factor: number;\n jitter: number;\n}\n\nclass ExponentialBackoff {\n private readonly initialDelay: number;\n private readonly maxDelay: number;\n\n private currentDelay: number;\n\n private readonly factor: number;\n private readonly jitter: number;\n\n constructor(config: ExponentialBackoffConfig) {\n this.initialDelay = config.initialDelay;\n this.maxDelay = config.maxDelay;\n this.factor = config.factor;\n this.jitter = config.jitter;\n this.currentDelay = config.initialDelay;\n }\n\n delay(): number {\n if (this.currentDelay >= this.maxDelay) {\n return this.applyJitter(this.maxDelay);\n }\n\n this.currentDelay = this.currentDelay * this.factor;\n\n if (this.currentDelay > this.maxDelay) {\n this.currentDelay = this.maxDelay;\n }\n\n return this.applyJitter(this.currentDelay);\n }\n\n reset(): void {\n this.currentDelay = this.initialDelay;\n }\n\n private applyJitter(delay: number): number {\n if (delay === 0 || this.jitter === 0) {\n return delay;\n }\n const delayFactor = 1 - this.jitter / 2 + Math.random() * this.jitter;\n return delay * delayFactor;\n }\n}\n"],"mappings":";AAMA,MAAa,uBAAoC;CAC/C,aAAa;CACb,cAAc;CACd,UAAU;CACX;AAOD,IAAa,gBAAb,MAA2B;CACzB,WAAmB;CACnB,QAAsD;CACtD;CACA;CACA;CAEA,YAAY,QAA8B,WAA2B;AACnE,OAAK,SAAS;GAAE,GAAG;GAAsB,GAAG;GAAQ;AACpD,OAAK,YAAY;AACjB,OAAK,UAAU,IAAI,mBAAmB;GACpC,cAAc,KAAK,OAAO;GAC1B,UAAU,KAAK,OAAO;GACtB,QAAQ;GACR,QAAQ;GACT,CAAC;;CAGJ,WAAiB;AACf,MAAI,KAAK,MAAO;AAChB,MAAI,KAAK,kBAAkB,EAAE;AAC3B,QAAK,0BAA0B;AAC/B;;AAGF,OAAK,QAAQ,iBAAiB;AAC5B,QAAK,QAAQ;AACb,QAAK;AACL,QAAK,UAAU,SAAS;KACvB,KAAK,QAAQ,OAAO,CAAC;;CAG1B,SAAe;AACb,MAAI,KAAK,OAAO;AACd,gBAAa,KAAK,MAAM;AACxB,QAAK,QAAQ;;;CAIjB,QAAc;AACZ,OAAK,WAAW;AAChB,OAAK,QAAQ,OAAO;;CAGtB,mBAAoC;AAClC,SAAO,KAAK,YAAY,KAAK,OAAO;;CAGtC,2BAAyC;EACvC,MAAM,wBAAQ,IAAI,MAAM,uBAAuB,KAAK,OAAO,YAAY,WAAW;AAClF,OAAK,UAAU,qBAAqB,MAAM;;;AAW9C,IAAM,qBAAN,MAAyB;CACvB;CACA;CAEA;CAEA;CACA;CAEA,YAAY,QAAkC;AAC5C,OAAK,eAAe,OAAO;AAC3B,OAAK,WAAW,OAAO;AACvB,OAAK,SAAS,OAAO;AACrB,OAAK,SAAS,OAAO;AACrB,OAAK,eAAe,OAAO;;CAG7B,QAAgB;AACd,MAAI,KAAK,gBAAgB,KAAK,SAC5B,QAAO,KAAK,YAAY,KAAK,SAAS;AAGxC,OAAK,eAAe,KAAK,eAAe,KAAK;AAE7C,MAAI,KAAK,eAAe,KAAK,SAC3B,MAAK,eAAe,KAAK;AAG3B,SAAO,KAAK,YAAY,KAAK,aAAa;;CAG5C,QAAc;AACZ,OAAK,eAAe,KAAK;;CAG3B,YAAoB,OAAuB;AACzC,MAAI,UAAU,KAAK,KAAK,WAAW,EACjC,QAAO;AAGT,SAAO,SADa,IAAI,KAAK,SAAS,IAAI,KAAK,QAAQ,GAAG,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry_strategy.js","names":[],"sources":["../../src/helpers/retry_strategy.ts"],"sourcesContent":["export interface RetryConfig {\n maxAttempts: number;\n initialDelay: number;\n maxDelay: number;\n}\n\nexport const DEFAULT_RETRY_CONFIG: RetryConfig = {\n maxAttempts: 10,\n initialDelay: 100,\n maxDelay: 30000,\n};\n\nexport interface RetryCallbacks {\n onRetry: () => void;\n onMaxAttemptsReached: (error: Error) => void;\n}\n\nexport class RetryStrategy {\n private attempts = 0;\n private timer: ReturnType<typeof setTimeout> | null = null;\n private readonly config: RetryConfig;\n private readonly callbacks: RetryCallbacks;\n private readonly backoff: ExponentialBackoff;\n\n constructor(config: Partial<RetryConfig>, callbacks: RetryCallbacks) {\n this.config = { ...DEFAULT_RETRY_CONFIG, ...config };\n this.callbacks = callbacks;\n this.backoff = new ExponentialBackoff({\n initialDelay: this.config.initialDelay,\n maxDelay: this.config.maxDelay,\n factor: 2,\n jitter: 0.1,\n });\n }\n\n schedule(): void {\n if (this.timer) return;\n if (this.hasExceededLimit()) {\n this.notifyMaxAttemptsReached();\n return;\n }\n\n this.timer = setTimeout(() => {\n this.timer = null;\n this.attempts++;\n this.callbacks.onRetry();\n }, this.backoff.delay());\n }\n\n cancel(): void {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n }\n\n reset(): void {\n this.attempts = 0;\n this.backoff.reset();\n }\n\n private hasExceededLimit(): boolean {\n return this.attempts >= this.config.maxAttempts;\n }\n\n private notifyMaxAttemptsReached(): void {\n const error = new Error(`Max retry attempts (${this.config.maxAttempts}) reached`);\n this.callbacks.onMaxAttemptsReached(error);\n }\n}\n\ninterface ExponentialBackoffConfig {\n initialDelay: number;\n maxDelay: number;\n factor: number;\n jitter: number;\n}\n\nclass ExponentialBackoff {\n private readonly initialDelay: number;\n private readonly maxDelay: number;\n\n private currentDelay: number;\n\n private readonly factor: number;\n private readonly jitter: number;\n\n constructor(config: ExponentialBackoffConfig) {\n this.initialDelay = config.initialDelay;\n this.maxDelay = config.maxDelay;\n this.factor = config.factor;\n this.jitter = config.jitter;\n this.currentDelay = config.initialDelay;\n }\n\n delay(): number {\n if (this.currentDelay >= this.maxDelay) {\n return this.applyJitter(this.maxDelay);\n }\n\n this.currentDelay = this.currentDelay * this.factor;\n\n if (this.currentDelay > this.maxDelay) {\n this.currentDelay = this.maxDelay;\n }\n\n return this.applyJitter(this.currentDelay);\n }\n\n reset(): void {\n this.currentDelay = this.initialDelay;\n }\n\n private applyJitter(delay: number): number {\n if (delay === 0 || this.jitter === 0) {\n return delay;\n }\n const delayFactor = 1 - this.jitter / 2 + Math.random() * this.jitter;\n return delay * delayFactor;\n }\n}\n"],"mappings":";AAMA,MAAa,uBAAoC;CAC/C,aAAa;CACb,cAAc;CACd,UAAU;CACX;AAOD,IAAa,gBAAb,MAA2B;CACzB,
|
|
1
|
+
{"version":3,"file":"retry_strategy.js","names":[],"sources":["../../src/helpers/retry_strategy.ts"],"sourcesContent":["export interface RetryConfig {\n maxAttempts: number;\n initialDelay: number;\n maxDelay: number;\n}\n\nexport const DEFAULT_RETRY_CONFIG: RetryConfig = {\n maxAttempts: 10,\n initialDelay: 100,\n maxDelay: 30000,\n};\n\nexport interface RetryCallbacks {\n onRetry: () => void;\n onMaxAttemptsReached: (error: Error) => void;\n}\n\nexport class RetryStrategy {\n private attempts = 0;\n private timer: ReturnType<typeof setTimeout> | null = null;\n private readonly config: RetryConfig;\n private readonly callbacks: RetryCallbacks;\n private readonly backoff: ExponentialBackoff;\n\n constructor(config: Partial<RetryConfig>, callbacks: RetryCallbacks) {\n this.config = { ...DEFAULT_RETRY_CONFIG, ...config };\n this.callbacks = callbacks;\n this.backoff = new ExponentialBackoff({\n initialDelay: this.config.initialDelay,\n maxDelay: this.config.maxDelay,\n factor: 2,\n jitter: 0.1,\n });\n }\n\n schedule(): void {\n if (this.timer) return;\n if (this.hasExceededLimit()) {\n this.notifyMaxAttemptsReached();\n return;\n }\n\n this.timer = setTimeout(() => {\n this.timer = null;\n this.attempts++;\n this.callbacks.onRetry();\n }, this.backoff.delay());\n }\n\n cancel(): void {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n }\n\n reset(): void {\n this.attempts = 0;\n this.backoff.reset();\n }\n\n private hasExceededLimit(): boolean {\n return this.attempts >= this.config.maxAttempts;\n }\n\n private notifyMaxAttemptsReached(): void {\n const error = new Error(`Max retry attempts (${this.config.maxAttempts}) reached`);\n this.callbacks.onMaxAttemptsReached(error);\n }\n}\n\ninterface ExponentialBackoffConfig {\n initialDelay: number;\n maxDelay: number;\n factor: number;\n jitter: number;\n}\n\nclass ExponentialBackoff {\n private readonly initialDelay: number;\n private readonly maxDelay: number;\n\n private currentDelay: number;\n\n private readonly factor: number;\n private readonly jitter: number;\n\n constructor(config: ExponentialBackoffConfig) {\n this.initialDelay = config.initialDelay;\n this.maxDelay = config.maxDelay;\n this.factor = config.factor;\n this.jitter = config.jitter;\n this.currentDelay = config.initialDelay;\n }\n\n delay(): number {\n if (this.currentDelay >= this.maxDelay) {\n return this.applyJitter(this.maxDelay);\n }\n\n this.currentDelay = this.currentDelay * this.factor;\n\n if (this.currentDelay > this.maxDelay) {\n this.currentDelay = this.maxDelay;\n }\n\n return this.applyJitter(this.currentDelay);\n }\n\n reset(): void {\n this.currentDelay = this.initialDelay;\n }\n\n private applyJitter(delay: number): number {\n if (delay === 0 || this.jitter === 0) {\n return delay;\n }\n const delayFactor = 1 - this.jitter / 2 + Math.random() * this.jitter;\n return delay * delayFactor;\n }\n}\n"],"mappings":";AAMA,MAAa,uBAAoC;CAC/C,aAAa;CACb,cAAc;CACd,UAAU;CACX;AAOD,IAAa,gBAAb,MAA2B;CACzB,WAAmB;CACnB,QAAsD;CACtD;CACA;CACA;CAEA,YAAY,QAA8B,WAA2B;AACnE,OAAK,SAAS;GAAE,GAAG;GAAsB,GAAG;GAAQ;AACpD,OAAK,YAAY;AACjB,OAAK,UAAU,IAAI,mBAAmB;GACpC,cAAc,KAAK,OAAO;GAC1B,UAAU,KAAK,OAAO;GACtB,QAAQ;GACR,QAAQ;GACT,CAAC;;CAGJ,WAAiB;AACf,MAAI,KAAK,MAAO;AAChB,MAAI,KAAK,kBAAkB,EAAE;AAC3B,QAAK,0BAA0B;AAC/B;;AAGF,OAAK,QAAQ,iBAAiB;AAC5B,QAAK,QAAQ;AACb,QAAK;AACL,QAAK,UAAU,SAAS;KACvB,KAAK,QAAQ,OAAO,CAAC;;CAG1B,SAAe;AACb,MAAI,KAAK,OAAO;AACd,gBAAa,KAAK,MAAM;AACxB,QAAK,QAAQ;;;CAIjB,QAAc;AACZ,OAAK,WAAW;AAChB,OAAK,QAAQ,OAAO;;CAGtB,mBAAoC;AAClC,SAAO,KAAK,YAAY,KAAK,OAAO;;CAGtC,2BAAyC;EACvC,MAAM,wBAAQ,IAAI,MAAM,uBAAuB,KAAK,OAAO,YAAY,WAAW;AAClF,OAAK,UAAU,qBAAqB,MAAM;;;AAW9C,IAAM,qBAAN,MAAyB;CACvB;CACA;CAEA;CAEA;CACA;CAEA,YAAY,QAAkC;AAC5C,OAAK,eAAe,OAAO;AAC3B,OAAK,WAAW,OAAO;AACvB,OAAK,SAAS,OAAO;AACrB,OAAK,SAAS,OAAO;AACrB,OAAK,eAAe,OAAO;;CAG7B,QAAgB;AACd,MAAI,KAAK,gBAAgB,KAAK,SAC5B,QAAO,KAAK,YAAY,KAAK,SAAS;AAGxC,OAAK,eAAe,KAAK,eAAe,KAAK;AAE7C,MAAI,KAAK,eAAe,KAAK,SAC3B,MAAK,eAAe,KAAK;AAG3B,SAAO,KAAK,YAAY,KAAK,aAAa;;CAG5C,QAAc;AACZ,OAAK,eAAe,KAAK;;CAG3B,YAAoB,OAAuB;AACzC,MAAI,UAAU,KAAK,KAAK,WAAW,EACjC,QAAO;AAGT,SAAO,SADa,IAAI,KAAK,SAAS,IAAI,KAAK,QAAQ,GAAG,KAAK"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_types = require(
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_types = require("../core/types.cjs");
|
|
3
3
|
let _milaboratories_ts_helpers = require("@milaboratories/ts-helpers");
|
|
4
|
-
|
|
5
4
|
//#region src/helpers/tx_helpers.ts
|
|
6
5
|
async function valErr(tx, f) {
|
|
7
6
|
const result = {
|
|
@@ -20,7 +19,7 @@ async function valErr(tx, f) {
|
|
|
20
19
|
}
|
|
21
20
|
return result;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
22
|
//#endregion
|
|
25
23
|
exports.valErr = valErr;
|
|
24
|
+
|
|
26
25
|
//# sourceMappingURL=tx_helpers.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_helpers.cjs","names":["isNotNullResourceId"],"sources":["../../src/helpers/tx_helpers.ts"],"sourcesContent":["import type { PlTransaction } from \"../core/transaction\";\nimport type { FieldData, OptionalResourceId } from \"../core/types\";\nimport { isNotNullResourceId } from \"../core/types\";\nimport { cachedDeserialize, notEmpty } from \"@milaboratories/ts-helpers\";\n\nexport interface ValErr {\n valueId: OptionalResourceId;\n errorId: OptionalResourceId;\n error?: string;\n}\n\nexport async function valErr(tx: PlTransaction, f: FieldData): Promise<ValErr> {\n const result = {\n valueId: f.value,\n errorId: f.error,\n error: \"\",\n };\n\n if (isNotNullResourceId(f.error)) {\n const e = await tx.getResourceData(f.error, true);\n const deserializationResult = cachedDeserialize(notEmpty(e.data));\n if (typeof deserializationResult !== \"string\") {\n const dataStr = notEmpty(e.data).toString();\n throw new Error(\n `Unexpected error structure: ${dataStr.substring(0, Math.min(dataStr.length, 100))}...`,\n );\n }\n result.error = deserializationResult;\n }\n\n return result;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tx_helpers.cjs","names":["isNotNullResourceId"],"sources":["../../src/helpers/tx_helpers.ts"],"sourcesContent":["import type { PlTransaction } from \"../core/transaction\";\nimport type { FieldData, OptionalResourceId } from \"../core/types\";\nimport { isNotNullResourceId } from \"../core/types\";\nimport { cachedDeserialize, notEmpty } from \"@milaboratories/ts-helpers\";\n\nexport interface ValErr {\n valueId: OptionalResourceId;\n errorId: OptionalResourceId;\n error?: string;\n}\n\nexport async function valErr(tx: PlTransaction, f: FieldData): Promise<ValErr> {\n const result = {\n valueId: f.value,\n errorId: f.error,\n error: \"\",\n };\n\n if (isNotNullResourceId(f.error)) {\n const e = await tx.getResourceData(f.error, true);\n const deserializationResult = cachedDeserialize(notEmpty(e.data));\n if (typeof deserializationResult !== \"string\") {\n const dataStr = notEmpty(e.data).toString();\n throw new Error(\n `Unexpected error structure: ${dataStr.substring(0, Math.min(dataStr.length, 100))}...`,\n );\n }\n result.error = deserializationResult;\n }\n\n return result;\n}\n"],"mappings":";;;;AAWA,eAAsB,OAAO,IAAmB,GAA+B;CAC7E,MAAM,SAAS;EACb,SAAS,EAAE;EACX,SAAS,EAAE;EACX,OAAO;EACR;AAED,KAAIA,cAAAA,oBAAoB,EAAE,MAAM,EAAE;EAChC,MAAM,IAAI,MAAM,GAAG,gBAAgB,EAAE,OAAO,KAAK;EACjD,MAAM,yBAAA,GAAA,2BAAA,oBAAA,GAAA,2BAAA,UAAmD,EAAE,KAAK,CAAC;AACjE,MAAI,OAAO,0BAA0B,UAAU;GAC7C,MAAM,WAAA,GAAA,2BAAA,UAAmB,EAAE,KAAK,CAAC,UAAU;AAC3C,SAAM,IAAI,MACR,+BAA+B,QAAQ,UAAU,GAAG,KAAK,IAAI,QAAQ,QAAQ,IAAI,CAAC,CAAC,KACpF;;AAEH,SAAO,QAAQ;;AAGjB,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx_helpers.d.ts","names":[],"sources":["../../src/helpers/tx_helpers.ts"],"mappings":";;;;UAKiB,MAAA;EACf,OAAA,EAAS,kBAAA;EACT,OAAA,EAAS,kBAAA;EACT,KAAA;AAAA;AAAA,iBAGoB,MAAA,CAAO,EAAA,EAAI,aAAA,EAAe,CAAA,EAAG,SAAA,GAAY,OAAA,CAAQ,MAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isNotNullResourceId } from "../core/types.js";
|
|
2
2
|
import { cachedDeserialize, notEmpty } from "@milaboratories/ts-helpers";
|
|
3
|
-
|
|
4
3
|
//#region src/helpers/tx_helpers.ts
|
|
5
4
|
async function valErr(tx, f) {
|
|
6
5
|
const result = {
|
|
@@ -19,7 +18,7 @@ async function valErr(tx, f) {
|
|
|
19
18
|
}
|
|
20
19
|
return result;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
//#endregion
|
|
24
22
|
export { valErr };
|
|
23
|
+
|
|
25
24
|
//# sourceMappingURL=tx_helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_helpers.js","names":[],"sources":["../../src/helpers/tx_helpers.ts"],"sourcesContent":["import type { PlTransaction } from \"../core/transaction\";\nimport type { FieldData, OptionalResourceId } from \"../core/types\";\nimport { isNotNullResourceId } from \"../core/types\";\nimport { cachedDeserialize, notEmpty } from \"@milaboratories/ts-helpers\";\n\nexport interface ValErr {\n valueId: OptionalResourceId;\n errorId: OptionalResourceId;\n error?: string;\n}\n\nexport async function valErr(tx: PlTransaction, f: FieldData): Promise<ValErr> {\n const result = {\n valueId: f.value,\n errorId: f.error,\n error: \"\",\n };\n\n if (isNotNullResourceId(f.error)) {\n const e = await tx.getResourceData(f.error, true);\n const deserializationResult = cachedDeserialize(notEmpty(e.data));\n if (typeof deserializationResult !== \"string\") {\n const dataStr = notEmpty(e.data).toString();\n throw new Error(\n `Unexpected error structure: ${dataStr.substring(0, Math.min(dataStr.length, 100))}...`,\n );\n }\n result.error = deserializationResult;\n }\n\n return result;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tx_helpers.js","names":[],"sources":["../../src/helpers/tx_helpers.ts"],"sourcesContent":["import type { PlTransaction } from \"../core/transaction\";\nimport type { FieldData, OptionalResourceId } from \"../core/types\";\nimport { isNotNullResourceId } from \"../core/types\";\nimport { cachedDeserialize, notEmpty } from \"@milaboratories/ts-helpers\";\n\nexport interface ValErr {\n valueId: OptionalResourceId;\n errorId: OptionalResourceId;\n error?: string;\n}\n\nexport async function valErr(tx: PlTransaction, f: FieldData): Promise<ValErr> {\n const result = {\n valueId: f.value,\n errorId: f.error,\n error: \"\",\n };\n\n if (isNotNullResourceId(f.error)) {\n const e = await tx.getResourceData(f.error, true);\n const deserializationResult = cachedDeserialize(notEmpty(e.data));\n if (typeof deserializationResult !== \"string\") {\n const dataStr = notEmpty(e.data).toString();\n throw new Error(\n `Unexpected error structure: ${dataStr.substring(0, Math.min(dataStr.length, 100))}...`,\n );\n }\n result.error = deserializationResult;\n }\n\n return result;\n}\n"],"mappings":";;;AAWA,eAAsB,OAAO,IAAmB,GAA+B;CAC7E,MAAM,SAAS;EACb,SAAS,EAAE;EACX,SAAS,EAAE;EACX,OAAO;EACR;AAED,KAAI,oBAAoB,EAAE,MAAM,EAAE;EAChC,MAAM,IAAI,MAAM,GAAG,gBAAgB,EAAE,OAAO,KAAK;EACjD,MAAM,wBAAwB,kBAAkB,SAAS,EAAE,KAAK,CAAC;AACjE,MAAI,OAAO,0BAA0B,UAAU;GAC7C,MAAM,UAAU,SAAS,EAAE,KAAK,CAAC,UAAU;AAC3C,SAAM,IAAI,MACR,+BAA+B,QAAQ,UAAU,GAAG,KAAK,IAAI,QAAQ,QAAQ,IAAI,CAAC,CAAC,KACpF;;AAEH,SAAO,QAAQ;;AAGjB,QAAO"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
|
|
3
|
-
const require_types = require(
|
|
4
|
-
const require_errors = require(
|
|
5
|
-
const require_transaction = require(
|
|
6
|
-
const require_pl = require(
|
|
7
|
-
const require_config = require(
|
|
8
|
-
const require_auth = require(
|
|
9
|
-
const require_index = require(
|
|
10
|
-
const require_final = require(
|
|
11
|
-
const require_client = require(
|
|
12
|
-
const require_driver = require(
|
|
13
|
-
const require_unauth_client = require(
|
|
14
|
-
const require_default_client = require(
|
|
15
|
-
const require_tx_helpers = require(
|
|
16
|
-
const require_poll = require(
|
|
17
|
-
const require_test_config = require(
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_types = require("./core/types.cjs");
|
|
4
|
+
const require_errors = require("./core/errors.cjs");
|
|
5
|
+
const require_transaction = require("./core/transaction.cjs");
|
|
6
|
+
const require_pl = require("./helpers/pl.cjs");
|
|
7
|
+
const require_config = require("./core/config.cjs");
|
|
8
|
+
const require_auth = require("./core/auth.cjs");
|
|
9
|
+
const require_index = require("./proto-rest/index.cjs");
|
|
10
|
+
const require_final = require("./core/final.cjs");
|
|
11
|
+
const require_client = require("./core/client.cjs");
|
|
12
|
+
const require_driver = require("./core/driver.cjs");
|
|
13
|
+
const require_unauth_client = require("./core/unauth_client.cjs");
|
|
14
|
+
const require_default_client = require("./core/default_client.cjs");
|
|
15
|
+
const require_tx_helpers = require("./helpers/tx_helpers.cjs");
|
|
16
|
+
const require_poll = require("./helpers/poll.cjs");
|
|
17
|
+
const require_test_config = require("./test/test_config.cjs");
|
|
18
18
|
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
19
|
-
|
|
20
19
|
exports.AnonymousAuthInformation = require_config.AnonymousAuthInformation;
|
|
21
20
|
exports.ContinuePolling = require_poll.ContinuePolling;
|
|
22
21
|
exports.DEFAULT_AUTH_MAX_REFRESH = require_config.DEFAULT_AUTH_MAX_REFRESH;
|
|
@@ -38,11 +37,11 @@ exports.DisconnectedError = require_errors.DisconnectedError;
|
|
|
38
37
|
exports.MaxLocalId = require_types.MaxLocalId;
|
|
39
38
|
exports.MaxTxId = require_types.MaxTxId;
|
|
40
39
|
exports.NullResourceId = require_types.NullResourceId;
|
|
41
|
-
Object.defineProperty(exports,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
Object.defineProperty(exports, "Pl", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function() {
|
|
43
|
+
return require_pl.pl_exports;
|
|
44
|
+
}
|
|
46
45
|
});
|
|
47
46
|
exports.PlClient = require_client.PlClient;
|
|
48
47
|
exports.PlError = require_errors.PlError;
|
|
@@ -54,18 +53,18 @@ exports.RESTError = require_errors.RESTError;
|
|
|
54
53
|
exports.RecoverablePlError = require_errors.RecoverablePlError;
|
|
55
54
|
exports.ResourceTypeName = _milaboratories_pl_model_common.ResourceTypeName;
|
|
56
55
|
exports.ResourceTypePrefix = _milaboratories_pl_model_common.ResourceTypePrefix;
|
|
57
|
-
Object.defineProperty(exports,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
Object.defineProperty(exports, "RestAPI", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function() {
|
|
59
|
+
return require_index.proto_rest_exports;
|
|
60
|
+
}
|
|
62
61
|
});
|
|
63
62
|
exports.SUPPORTED_WIRE_PROTOCOLS = require_config.SUPPORTED_WIRE_PROTOCOLS;
|
|
64
|
-
Object.defineProperty(exports,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
Object.defineProperty(exports, "TestHelpers", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function() {
|
|
66
|
+
return require_test_config.test_config_exports;
|
|
67
|
+
}
|
|
69
68
|
});
|
|
70
69
|
exports.TxCommitConflict = require_transaction.TxCommitConflict;
|
|
71
70
|
exports.UnauthenticatedError = require_errors.UnauthenticatedError;
|
|
@@ -102,6 +101,7 @@ exports.isRootResourceId = require_types.isRootResourceId;
|
|
|
102
101
|
exports.isTimeoutError = require_errors.isTimeoutError;
|
|
103
102
|
exports.isTimeoutOrCancelError = require_errors.isTimeoutOrCancelError;
|
|
104
103
|
exports.isUnauthenticated = require_errors.isUnauthenticated;
|
|
104
|
+
exports.isUnimplementedError = require_errors.isUnimplementedError;
|
|
105
105
|
exports.jsonToData = require_types.jsonToData;
|
|
106
106
|
exports.plAddressToConfig = require_config.plAddressToConfig;
|
|
107
107
|
exports.poll = require_poll.poll;
|
|
@@ -119,4 +119,4 @@ exports.toGlobalFieldId = require_transaction.toGlobalFieldId;
|
|
|
119
119
|
exports.toGlobalResourceId = require_transaction.toGlobalResourceId;
|
|
120
120
|
exports.toResourceId = require_transaction.toResourceId;
|
|
121
121
|
exports.tryGetFileConfig = require_default_client.tryGetFileConfig;
|
|
122
|
-
exports.valErr = require_tx_helpers.valErr;
|
|
122
|
+
exports.valErr = require_tx_helpers.valErr;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,11 +7,11 @@ import { GrpcConnection, RestConnection, WireClientProvider, WireClientProviderF
|
|
|
7
7
|
import { index_d_exports } from "./proto-rest/index.js";
|
|
8
8
|
import { PlDriver, PlDriverDefinition, addRTypeToMetadata, createRTypeRoutingHeader } from "./core/driver.js";
|
|
9
9
|
import { PlClient, TxOps } from "./core/client.js";
|
|
10
|
-
import { DisconnectedError, PlError, PlErrorCodeNotFound, RESTError, RecoverablePlError, UnauthenticatedError, UnrecoverablePlError, isAbortedError, isCancelError, isConnectionProblem, isNotFoundError, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, rethrowMeaningfulError, throwPlNotFoundError } from "./core/errors.js";
|
|
10
|
+
import { DisconnectedError, PlError, PlErrorCodeNotFound, RESTError, RecoverablePlError, UnauthenticatedError, UnrecoverablePlError, isAbortedError, isCancelError, isConnectionProblem, isNotFoundError, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, rethrowMeaningfulError, throwPlNotFoundError } from "./core/errors.js";
|
|
11
11
|
import { defaultPlClient, tryGetFileConfig } from "./core/default_client.js";
|
|
12
12
|
import { UnauthenticatedPlClient } from "./core/unauth_client.js";
|
|
13
13
|
import { expirationFromAuthInformation, inferAuthRefreshTime } from "./core/auth.js";
|
|
14
14
|
import { ValErr, valErr } from "./helpers/tx_helpers.js";
|
|
15
15
|
import { ContinuePolling, DefaultPollingRetryOptions, PollFieldTraverseOps, PollResourceAccessor, PollTxAccessor, poll } from "./helpers/poll.js";
|
|
16
16
|
import { test_config_d_exports } from "./test/test_config.js";
|
|
17
|
-
export { AnonymousAuthInformation, AnyFieldId, AnyFieldRef, AnyRef, AnyResourceId, AnyResourceRef, AuthInformation, AuthOps, BasicResourceData, 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, FinalResourceDataPredicate, FutureFieldType, GrpcConnection, KeyValue, KeyValueString, LocalFieldId, LocalResourceId, MaxLocalId, MaxTxId, NullResourceId, OptionalAnyResourceId, OptionalResourceId, pl_d_exports as Pl, PlClient, PlClientConfig, PlConnectionStatus, PlConnectionStatusListener, PlDriver, PlDriverDefinition, PlError, PlErrorCodeNotFound, PlTransaction, PollFieldTraverseOps, PollResourceAccessor, PollTxAccessor, RESTError, RecoverablePlError, ResourceData, ResourceId, ResourceKind, ResourceRef, ResourceType, ResourceTypeName, ResourceTypePrefix, index_d_exports as RestAPI, RestConnection, SUPPORTED_WIRE_PROTOCOLS, test_config_d_exports as TestHelpers, TxCommitConflict, TxOps, UnauthenticatedError, UnauthenticatedPlClient, UnrecoverablePlError, ValErr, WireClientProvider, WireClientProviderFactory, WireConnection, addRTypeToMetadata, bigintToResourceId, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, defaultPlClient, ensureResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullResourceId, isNullResourceId, isResource, isResourceId, isResourceRef, isRootResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, jsonToData, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceId, tryGetFileConfig, valErr, wireProtocol };
|
|
17
|
+
export { AnonymousAuthInformation, AnyFieldId, AnyFieldRef, AnyRef, AnyResourceId, AnyResourceRef, AuthInformation, AuthOps, BasicResourceData, 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, FinalResourceDataPredicate, FutureFieldType, GrpcConnection, KeyValue, KeyValueString, LocalFieldId, LocalResourceId, MaxLocalId, MaxTxId, NullResourceId, OptionalAnyResourceId, OptionalResourceId, pl_d_exports as Pl, PlClient, PlClientConfig, PlConnectionStatus, PlConnectionStatusListener, PlDriver, PlDriverDefinition, PlError, PlErrorCodeNotFound, PlTransaction, PollFieldTraverseOps, PollResourceAccessor, PollTxAccessor, RESTError, RecoverablePlError, ResourceData, ResourceId, ResourceKind, ResourceRef, ResourceType, ResourceTypeName, ResourceTypePrefix, index_d_exports as RestAPI, RestConnection, SUPPORTED_WIRE_PROTOCOLS, test_config_d_exports as TestHelpers, TxCommitConflict, TxOps, UnauthenticatedError, UnauthenticatedPlClient, UnrecoverablePlError, ValErr, WireClientProvider, WireClientProviderFactory, WireConnection, addRTypeToMetadata, bigintToResourceId, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, defaultPlClient, ensureResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullResourceId, isNullResourceId, isResource, isResourceId, isResourceRef, isRootResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, jsonToData, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceId, tryGetFileConfig, valErr, wireProtocol };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MaxLocalId, MaxTxId, NullResourceId, bigintToResourceId, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, ensureResourceIdNotNull, extractBasicResourceData, extractTxId, getField, isAnyResourceId, isLocalResourceId, isNotNullResourceId, isNullResourceId, isRootResourceId, jsonToData, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, stringifyWithResourceId } from "./core/types.js";
|
|
2
|
-
import { DisconnectedError, PlError, PlErrorCodeNotFound, RESTError, RecoverablePlError, UnauthenticatedError, UnrecoverablePlError, isAbortedError, isCancelError, isConnectionProblem, isNotFoundError, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, rethrowMeaningfulError, throwPlNotFoundError } from "./core/errors.js";
|
|
2
|
+
import { DisconnectedError, PlError, PlErrorCodeNotFound, RESTError, RecoverablePlError, UnauthenticatedError, UnrecoverablePlError, isAbortedError, isCancelError, isConnectionProblem, isNotFoundError, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, rethrowMeaningfulError, throwPlNotFoundError } from "./core/errors.js";
|
|
3
3
|
import { PlTransaction, TxCommitConflict, field, isField, isFieldRef, isResource, isResourceId, isResourceRef, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceId } from "./core/transaction.js";
|
|
4
4
|
import { pl_exports } from "./helpers/pl.js";
|
|
5
5
|
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";
|
|
@@ -13,5 +13,4 @@ import { defaultPlClient, tryGetFileConfig } from "./core/default_client.js";
|
|
|
13
13
|
import { valErr } from "./helpers/tx_helpers.js";
|
|
14
14
|
import { ContinuePolling, DefaultPollingRetryOptions, PollResourceAccessor, PollTxAccessor, poll } from "./helpers/poll.js";
|
|
15
15
|
import { test_config_exports } from "./test/test_config.js";
|
|
16
|
-
|
|
17
|
-
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, MaxLocalId, MaxTxId, NullResourceId, 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, addRTypeToMetadata, bigintToResourceId, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, defaultPlClient, ensureResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullResourceId, isNullResourceId, isResource, isResourceId, isResourceRef, isRootResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, jsonToData, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceId, tryGetFileConfig, valErr };
|
|
16
|
+
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, MaxLocalId, MaxTxId, NullResourceId, 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, addRTypeToMetadata, bigintToResourceId, checkLocalityOfResourceId, createGlobalResourceId, createLocalResourceId, createRTypeRoutingHeader, defaultPlClient, ensureResourceIdNotNull, expirationFromAuthInformation, extractBasicResourceData, extractTxId, field, getField, inferAuthRefreshTime, isAbortedError, isAnyResourceId, isCancelError, isConnectionProblem, isField, isFieldRef, isLocalResourceId, isNotFoundError, isNotNullResourceId, isNullResourceId, isResource, isResourceId, isResourceRef, isRootResourceId, isTimeoutError, isTimeoutOrCancelError, isUnauthenticated, isUnimplementedError, jsonToData, plAddressToConfig, poll, resDataToJson, resourceIdFromString, resourceIdToString, resourceType, resourceTypeToString, resourceTypesEqual, rethrowMeaningfulError, stringifyWithResourceId, throwPlNotFoundError, toFieldId, toGlobalFieldId, toGlobalResourceId, toResourceId, tryGetFileConfig, valErr };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_any = require(
|
|
1
|
+
require("../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_any = require("../../../../../google/protobuf/any.cjs");
|
|
3
3
|
let _protobuf_ts_runtime = require("@protobuf-ts/runtime");
|
|
4
|
-
|
|
5
4
|
//#region src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts
|
|
6
5
|
var Status$Type = class extends _protobuf_ts_runtime.MessageType {
|
|
7
6
|
constructor() {
|
|
@@ -71,7 +70,7 @@ var Status$Type = class extends _protobuf_ts_runtime.MessageType {
|
|
|
71
70
|
* @generated MessageType for protobuf message google.rpc.Status
|
|
72
71
|
*/
|
|
73
72
|
const Status = new Status$Type();
|
|
74
|
-
|
|
75
73
|
//#endregion
|
|
76
74
|
exports.Status = Status;
|
|
75
|
+
|
|
77
76
|
//# sourceMappingURL=status.cjs.map
|
|
@@ -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 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":"
|
|
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,OAAQ,KAAK,iBAAmB;AAClE,UAAQ,OAAO;AACf,UAAQ,UAAU;AAClB,UAAQ,UAAU,EAAE;AACpB,MAAI,UAAU,KAAA,EACV,EAAA,GAAA,qBAAA,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,KAAKA,YAAAA,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,OAAOC,qBAAAA,oBAAoB,SAAS,GAAG,KAAK,UAAU,SAAS,SAAS,UAAU,EAAE;;;AAG3G,SAAO;;CAEX,oBAAoB,SAAiB,QAAuB,SAA4C;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","names":[],"sources":["../../../../../../../src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts"],"mappings":";;;;;;;;;;;AA+DC;;;;UAxBgB,MAAA;EAkCE;;;;;;EA3Bf,IAAA;EA6D6C;;;;;;;;EApD7C,OAAA;EAkBA;;;;;;EAXA,OAAA,EAAS,GAAA;AAAA;AAAA,cAGP,WAAA,SAAoB,WAAA,CAAY,MAAA;;EAQlC,MAAA,CAAO,KAAA,GAAQ,cAAA,CAAe,MAAA,IAAU,MAAA;EASxC,kBAAA,CAAmB,MAAA,EAAQ,aAAA,EAAe,MAAA,UAAgB,OAAA,EAAS,iBAAA,EAAmB,MAAA,GAAS,MAAA,GAAS,MAAA;EAyBxG,mBAAA,CAAoB,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,aAAA,EAAe,OAAA,EAAS,kBAAA,GAAqB,aAAA;AAAA;;;;cAmBjF,MAAA,EAAM,WAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Any } from "../../../../../google/protobuf/any.js";
|
|
2
2
|
import { MessageType, UnknownFieldHandler, WireType, reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
3
|
-
|
|
4
3
|
//#region src/proto-grpc/github.com/googleapis/googleapis/google/rpc/status.ts
|
|
5
4
|
var Status$Type = class extends MessageType {
|
|
6
5
|
constructor() {
|
|
@@ -70,7 +69,7 @@ var Status$Type = class extends MessageType {
|
|
|
70
69
|
* @generated MessageType for protobuf message google.rpc.Status
|
|
71
70
|
*/
|
|
72
71
|
const Status = new Status$Type();
|
|
73
|
-
|
|
74
72
|
//#endregion
|
|
75
73
|
export { Status };
|
|
74
|
+
|
|
76
75
|
//# sourceMappingURL=status.js.map
|
|
@@ -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 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":"
|
|
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 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"}
|