@milaboratories/pl-client 2.11.13 → 2.12.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 (63) hide show
  1. package/dist/core/config.cjs +2 -2
  2. package/dist/core/config.cjs.map +1 -1
  3. package/dist/core/config.d.ts +2 -2
  4. package/dist/core/config.js +2 -2
  5. package/dist/core/config.js.map +1 -1
  6. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.cjs.map +1 -1
  7. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.js.map +1 -1
  8. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.cjs +26 -2
  9. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.cjs.map +1 -1
  10. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.cjs.map +1 -1
  11. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.js.map +1 -1
  12. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +12 -0
  13. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
  14. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.js +26 -2
  15. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.js.map +1 -1
  16. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.cjs.map +1 -1
  17. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.js.map +1 -1
  18. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.cjs.map +1 -1
  19. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.js.map +1 -1
  20. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.cjs.map +1 -1
  21. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.js.map +1 -1
  22. package/dist/proto/google/protobuf/any.cjs.map +1 -1
  23. package/dist/proto/google/protobuf/any.d.ts +9 -5
  24. package/dist/proto/google/protobuf/any.d.ts.map +1 -1
  25. package/dist/proto/google/protobuf/any.js.map +1 -1
  26. package/dist/proto/google/protobuf/descriptor.d.ts +881 -46
  27. package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -1
  28. package/dist/proto/google/protobuf/duration.cjs.map +1 -1
  29. package/dist/proto/google/protobuf/duration.d.ts +0 -1
  30. package/dist/proto/google/protobuf/duration.d.ts.map +1 -1
  31. package/dist/proto/google/protobuf/duration.js.map +1 -1
  32. package/dist/proto/google/protobuf/struct.d.ts +1 -1
  33. package/dist/proto/google/protobuf/timestamp.cjs.map +1 -1
  34. package/dist/proto/google/protobuf/timestamp.d.ts +1 -4
  35. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -1
  36. package/dist/proto/google/protobuf/timestamp.js.map +1 -1
  37. package/dist/proto/google/protobuf/wrappers.d.ts +27 -0
  38. package/dist/proto/google/protobuf/wrappers.d.ts.map +1 -1
  39. package/package.json +3 -3
  40. package/src/core/config.ts +2 -2
  41. package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +1 -1
  42. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +1 -1
  43. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +1 -1
  44. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +1 -1
  45. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +1 -1
  46. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +1 -1
  47. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +1 -1
  48. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +1 -1
  49. package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +1 -1
  50. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +1 -1
  51. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +38 -2
  52. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +1 -1
  53. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +1 -1
  54. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +1 -1
  55. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +1 -1
  56. package/src/proto/google/api/http.ts +1 -1
  57. package/src/proto/google/protobuf/any.ts +10 -6
  58. package/src/proto/google/protobuf/descriptor.ts +1469 -77
  59. package/src/proto/google/protobuf/duration.ts +1 -2
  60. package/src/proto/google/protobuf/empty.ts +1 -1
  61. package/src/proto/google/protobuf/struct.ts +2 -2
  62. package/src/proto/google/protobuf/timestamp.ts +2 -5
  63. package/src/proto/google/protobuf/wrappers.ts +38 -5
@@ -7,8 +7,8 @@ const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;
7
7
  const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;
8
8
  const DEFAULT_MAX_CACHE_BYTES = 128_000_000; // 128 Mb
9
9
  const DEFAULT_RETRY_BACKOFF_ALGORITHM = 'exponential';
10
- const DEFAULT_RETRY_MAX_ATTEMPTS = 16; // 1st attempt + 15 retries
11
- const DEFAULT_RETRY_INITIAL_DELAY = 14; // 14 ms * <jitter> of sleep after first failure
10
+ const DEFAULT_RETRY_MAX_ATTEMPTS = 21; // 1st attempt + 20 retries
11
+ const DEFAULT_RETRY_INITIAL_DELAY = 20; // 20 ms * <jitter> of sleep after first failure
12
12
  const DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER = 1.5; // + 50% on each round
13
13
  const DEFAULT_RETRY_LINEAR_BACKOFF_STEP = 50; // + 50 ms
14
14
  const DEFAULT_RETRY_JITTER = 0.3; // 30%
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","sources":["../../src/core/config.ts"],"sourcesContent":["import type { ExponentialBackoffRetryOptions } from '@milaboratories/ts-helpers';\n\n/** Base configuration structure for PL client */\nexport interface PlClientConfig {\n /** Port and host of remote pl server */\n hostAndPort: string;\n\n /** If set, client will expose a nested object under a field with name `alternative_root_${alternativeRoot}` as a\n * client root. */\n alternativeRoot?: string;\n\n /** If true, client will establish tls connection to the server, using default\n * CA of node instance. */\n // Not implementing custom ssl validation logic for now.\n // Implementing it in a correct way is really nontrivial thing,\n // real use-cases should be considered.\n ssl: boolean;\n\n /** Default timeout in milliseconds for unary calls, like ping and login. */\n defaultRequestTimeout: number;\n\n /** Default timeout in milliseconds for read-write transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultRWTransactionTimeout: number;\n /** Default timeout in milliseconds for read-only transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultROTransactionTimeout: number;\n\n /** Controls what TTL will be requested from the server, when new JWT token\n * is requested. */\n authTTLSeconds: number;\n /** If token is older than this time, it will be refreshed regardless of its\n * expiration time. */\n authMaxRefreshSeconds: number;\n\n /** Proxy server URL to use for pl connection. */\n grpcProxy?: string;\n /** Proxy server URL to use for http connections of pl drivers, like file\n * downloading. */\n httpProxy?: string;\n\n /** Username extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n user?: string;\n /** Password extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n password?: string;\n\n /** Artificial delay introduced after write transactions completion, to\n * somewhat throttle the load on pl. Delay introduced after sync, if requested. */\n txDelay: number;\n\n /** Last resort measure to solve complicated race conditions in pl. */\n forceSync: boolean;\n\n /** Maximal number of bytes of resource state to cache */\n maxCacheBytes: number;\n\n //\n // Retry\n //\n\n /**\n * What type of backoff strategy to use in transaction retries\n * (pl uses optimistic transaction model with regular retries in write transactions)\n * */\n retryBackoffAlgorithm: 'exponential' | 'linear';\n\n /** Maximal number of attempts in */\n retryMaxAttempts: number;\n\n /** Delay after first failed attempt, in ms. */\n retryInitialDelay: number;\n\n /** Each time delay will be multiplied by this number (1.5 means plus on 50% each attempt) */\n retryExponentialBackoffMultiplier: number;\n\n /** [used only for ] This value will be added to the delay from the previous step, in ms */\n retryLinearBackoffStep: number;\n\n /** Value from 0 to 1, determine level of randomness to introduce to the backoff delays sequence. (0 meaning no randomness) */\n retryJitter: number;\n}\n\nexport const DEFAULT_REQUEST_TIMEOUT = 5_000;\nexport const DEFAULT_RO_TX_TIMEOUT = 300_000;\nexport const DEFAULT_RW_TX_TIMEOUT = 60_000;\nexport const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;\nexport const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;\n\nexport const DEFAULT_MAX_CACHE_BYTES = 128_000_000; // 128 Mb\n\nexport const DEFAULT_RETRY_BACKOFF_ALGORITHM = 'exponential';\nexport const DEFAULT_RETRY_MAX_ATTEMPTS = 16; // 1st attempt + 15 retries\nexport const DEFAULT_RETRY_INITIAL_DELAY = 14; // 14 ms * <jitter> of sleep after first failure\nexport const DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER = 1.5; // + 50% on each round\nexport const DEFAULT_RETRY_LINEAR_BACKOFF_STEP = 50; // + 50 ms\nexport const DEFAULT_RETRY_JITTER = 0.3; // 30%\n\nexport const DefaultRetryOptions: ExponentialBackoffRetryOptions = {\n type: 'exponentialBackoff',\n maxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n initialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n backoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n jitter: DEFAULT_RETRY_JITTER,\n};\n\ntype PlConfigOverrides = Partial<\n Pick<\n PlClientConfig,\n | 'ssl'\n | 'defaultRequestTimeout'\n | 'defaultROTransactionTimeout'\n | 'defaultRWTransactionTimeout'\n | 'httpProxy'\n | 'grpcProxy'\n >\n>;\n\nfunction parseInt(s: string | null | undefined): number | undefined {\n if (!s) return undefined;\n const num = Number(s);\n if (Number.isNaN(num)) throw new Error(`Can't parse number: ${s}`);\n return num;\n}\n\n/** Parses pl url and creates a config object that can be passed to\n * {@link PlClient} of {@link UnauthenticatedPlClient}. */\nexport function plAddressToConfig(\n address: string,\n overrides: PlConfigOverrides = {},\n): PlClientConfig {\n if (address.indexOf('://') === -1)\n // non-url address\n return {\n hostAndPort: address,\n ssl: false,\n defaultRequestTimeout: DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout: DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout: DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n txDelay: 0,\n forceSync: false,\n\n maxCacheBytes: DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: DEFAULT_RETRY_BACKOFF_ALGORITHM,\n retryMaxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep: DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n\n const url = new URL(address);\n\n if (\n url.protocol !== 'https:'\n && url.protocol !== 'http:'\n && url.protocol !== 'grpc:'\n && url.protocol !== 'tls:'\n )\n throw new Error(`Unexpected URL schema: ${url.protocol}`);\n\n if (url.pathname !== '/' && url.pathname !== '')\n throw new Error(`Unexpected URL path: ${url.pathname}`);\n\n return {\n hostAndPort: url.host, // this also includes port\n alternativeRoot: url.searchParams.get('alternative-root') ?? undefined,\n ssl: url.protocol === 'https:' || url.protocol === 'tls:',\n defaultRequestTimeout:\n parseInt(url.searchParams.get('request-timeout')) ?? DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout:\n parseInt(url.searchParams.get('ro-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout:\n parseInt(url.searchParams.get('rw-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n grpcProxy: url.searchParams.get('grpc-proxy') ?? undefined,\n httpProxy: url.searchParams.get('http-proxy') ?? undefined,\n user: url.username === '' ? undefined : url.username,\n password: url.password === '' ? undefined : url.password,\n txDelay: parseInt(url.searchParams.get('tx-delay')) ?? 0,\n forceSync: Boolean(url.searchParams.get('force-sync')),\n\n maxCacheBytes: parseInt(url.searchParams.get('max-cache-bytes')) ?? DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: (url.searchParams.get('retry-backoff-algorithm')\n ?? DEFAULT_RETRY_BACKOFF_ALGORITHM) as any,\n retryMaxAttempts:\n parseInt(url.searchParams.get('retry-max-attempts')) ?? DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay:\n parseInt(url.searchParams.get('retry-initial-delay')) ?? DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier:\n parseInt(url.searchParams.get('retry-exp-backoff-multiplier'))\n ?? DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep:\n parseInt(url.searchParams.get('retry-linear-backoff-step'))\n ?? DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: parseInt(url.searchParams.get('retry-backoff-jitter')) ?? DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n}\n\n/**\n * Authorization data / JWT Token.\n * Absent JWT Token tells the client to connect as anonymous user.\n * */\nexport interface AuthInformation {\n /** Absent token means anonymous access */\n jwtToken?: string;\n}\n\nexport const AnonymousAuthInformation: AuthInformation = {};\n\n/** Authorization related settings to pass to {@link PlClient}. */\nexport interface AuthOps {\n /** Initial authorization information */\n authInformation: AuthInformation;\n /** Will be executed after successful authorization information refresh */\n readonly onUpdate?: (newInfo: AuthInformation) => void;\n /** Will be executed if auth-related error happens during normal client operation */\n readonly onAuthError?: () => void;\n /** Will be executed if error encountered during token update */\n readonly onUpdateError?: (error: unknown) => void;\n}\n\n/** Connection status. */\nexport type PlConnectionStatus = 'OK' | 'Disconnected' | 'Unauthenticated';\n\n/** Listener that will be called each time connection status changes. */\nexport type PlConnectionStatusListener = (status: PlConnectionStatus) => void;\n"],"names":[],"mappings":";;AAkFO,MAAM,uBAAuB,GAAG;AAChC,MAAM,qBAAqB,GAAG;AAC9B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AACjD,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AAEhD,MAAM,uBAAuB,GAAG,YAAY;AAE5C,MAAM,+BAA+B,GAAG;AACxC,MAAM,0BAA0B,GAAG,GAAG;AACtC,MAAM,2BAA2B,GAAG,GAAG;AACvC,MAAM,4CAA4C,GAAG,IAAI;AACzD,MAAM,iCAAiC,GAAG,GAAG;AAC7C,MAAM,oBAAoB,GAAG,IAAI;AAEjC,MAAM,mBAAmB,GAAmC;AACjE,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,YAAY,EAAE,2BAA2B;AACzC,IAAA,iBAAiB,EAAE,4CAA4C;AAC/D,IAAA,MAAM,EAAE,oBAAoB;;AAe9B,SAAS,QAAQ,CAAC,CAA4B,EAAA;AAC5C,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,SAAS;AACxB,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC;AACrB,IAAA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAAE,QAAA,MAAM,IAAI,KAAK,CAA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YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEtD,QAAA,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,IAAI,uBAAuB;QAE3F,qBAAqB,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,yBAAyB;AACjE,eAAA,+BAA+B,CAAQ;AAC5C,QAAA,gBAAgB,EACd,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,0BAA0B;AACpF,QAAA,iBAAiB,EACf,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,IAAI,2BAA2B;QACtF,iCAAiC,EAC/B,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,8BAA8B,CAAC;eAC1D,4CAA4C;QACjD,sBAAsB,EACpB,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,2BAA2B,CAAC;eACvD,iCAAiC;AACtC,QAAA,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,IAAI,oBAAoB;AAE3F,QAAA,GAAG,SAAS;KACb;AACH;AAWO,MAAM,wBAAwB,GAAoB;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"config.cjs","sources":["../../src/core/config.ts"],"sourcesContent":["import type { ExponentialBackoffRetryOptions } from '@milaboratories/ts-helpers';\n\n/** Base configuration structure for PL client */\nexport interface PlClientConfig {\n /** Port and host of remote pl server */\n hostAndPort: string;\n\n /** If set, client will expose a nested object under a field with name `alternative_root_${alternativeRoot}` as a\n * client root. */\n alternativeRoot?: string;\n\n /** If true, client will establish tls connection to the server, using default\n * CA of node instance. */\n // Not implementing custom ssl validation logic for now.\n // Implementing it in a correct way is really nontrivial thing,\n // real use-cases should be considered.\n ssl: boolean;\n\n /** Default timeout in milliseconds for unary calls, like ping and login. */\n defaultRequestTimeout: number;\n\n /** Default timeout in milliseconds for read-write transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultRWTransactionTimeout: number;\n /** Default timeout in milliseconds for read-only transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultROTransactionTimeout: number;\n\n /** Controls what TTL will be requested from the server, when new JWT token\n * is requested. */\n authTTLSeconds: number;\n /** If token is older than this time, it will be refreshed regardless of its\n * expiration time. */\n authMaxRefreshSeconds: number;\n\n /** Proxy server URL to use for pl connection. */\n grpcProxy?: string;\n /** Proxy server URL to use for http connections of pl drivers, like file\n * downloading. */\n httpProxy?: string;\n\n /** Username extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n user?: string;\n /** Password extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n password?: string;\n\n /** Artificial delay introduced after write transactions completion, to\n * somewhat throttle the load on pl. Delay introduced after sync, if requested. */\n txDelay: number;\n\n /** Last resort measure to solve complicated race conditions in pl. */\n forceSync: boolean;\n\n /** Maximal number of bytes of resource state to cache */\n maxCacheBytes: number;\n\n //\n // Retry\n //\n\n /**\n * What type of backoff strategy to use in transaction retries\n * (pl uses optimistic transaction model with regular retries in write transactions)\n * */\n retryBackoffAlgorithm: 'exponential' | 'linear';\n\n /** Maximal number of attempts in */\n retryMaxAttempts: number;\n\n /** Delay after first failed attempt, in ms. */\n retryInitialDelay: number;\n\n /** Each time delay will be multiplied by this number (1.5 means plus on 50% each attempt) */\n retryExponentialBackoffMultiplier: number;\n\n /** [used only for ] This value will be added to the delay from the previous step, in ms */\n retryLinearBackoffStep: number;\n\n /** Value from 0 to 1, determine level of randomness to introduce to the backoff delays sequence. (0 meaning no randomness) */\n retryJitter: number;\n}\n\nexport const DEFAULT_REQUEST_TIMEOUT = 5_000;\nexport const DEFAULT_RO_TX_TIMEOUT = 300_000;\nexport const DEFAULT_RW_TX_TIMEOUT = 60_000;\nexport const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;\nexport const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;\n\nexport const DEFAULT_MAX_CACHE_BYTES = 128_000_000; // 128 Mb\n\nexport const DEFAULT_RETRY_BACKOFF_ALGORITHM = 'exponential';\nexport const DEFAULT_RETRY_MAX_ATTEMPTS = 21; // 1st attempt + 20 retries\nexport const DEFAULT_RETRY_INITIAL_DELAY = 20; // 20 ms * <jitter> of sleep after first failure\nexport const DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER = 1.5; // + 50% on each round\nexport const DEFAULT_RETRY_LINEAR_BACKOFF_STEP = 50; // + 50 ms\nexport const DEFAULT_RETRY_JITTER = 0.3; // 30%\n\nexport const DefaultRetryOptions: ExponentialBackoffRetryOptions = {\n type: 'exponentialBackoff',\n maxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n initialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n backoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n jitter: DEFAULT_RETRY_JITTER,\n};\n\ntype PlConfigOverrides = Partial<\n Pick<\n PlClientConfig,\n | 'ssl'\n | 'defaultRequestTimeout'\n | 'defaultROTransactionTimeout'\n | 'defaultRWTransactionTimeout'\n | 'httpProxy'\n | 'grpcProxy'\n >\n>;\n\nfunction parseInt(s: string | null | undefined): number | undefined {\n if (!s) return undefined;\n const num = Number(s);\n if (Number.isNaN(num)) throw new Error(`Can't parse number: ${s}`);\n return num;\n}\n\n/** Parses pl url and creates a config object that can be passed to\n * {@link PlClient} of {@link UnauthenticatedPlClient}. */\nexport function plAddressToConfig(\n address: string,\n overrides: PlConfigOverrides = {},\n): PlClientConfig {\n if (address.indexOf('://') === -1)\n // non-url address\n return {\n hostAndPort: address,\n ssl: false,\n defaultRequestTimeout: DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout: DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout: DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n txDelay: 0,\n forceSync: false,\n\n maxCacheBytes: DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: DEFAULT_RETRY_BACKOFF_ALGORITHM,\n retryMaxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep: DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n\n const url = new URL(address);\n\n if (\n url.protocol !== 'https:'\n && url.protocol !== 'http:'\n && url.protocol !== 'grpc:'\n && url.protocol !== 'tls:'\n )\n throw new Error(`Unexpected URL schema: ${url.protocol}`);\n\n if (url.pathname !== '/' && url.pathname !== '')\n throw new Error(`Unexpected URL path: ${url.pathname}`);\n\n return {\n hostAndPort: url.host, // this also includes port\n alternativeRoot: url.searchParams.get('alternative-root') ?? undefined,\n ssl: url.protocol === 'https:' || url.protocol === 'tls:',\n defaultRequestTimeout:\n parseInt(url.searchParams.get('request-timeout')) ?? DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout:\n parseInt(url.searchParams.get('ro-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout:\n parseInt(url.searchParams.get('rw-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n grpcProxy: url.searchParams.get('grpc-proxy') ?? undefined,\n httpProxy: url.searchParams.get('http-proxy') ?? undefined,\n user: url.username === '' ? undefined : url.username,\n password: url.password === '' ? undefined : url.password,\n txDelay: parseInt(url.searchParams.get('tx-delay')) ?? 0,\n forceSync: Boolean(url.searchParams.get('force-sync')),\n\n maxCacheBytes: parseInt(url.searchParams.get('max-cache-bytes')) ?? DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: (url.searchParams.get('retry-backoff-algorithm')\n ?? DEFAULT_RETRY_BACKOFF_ALGORITHM) as any,\n retryMaxAttempts:\n parseInt(url.searchParams.get('retry-max-attempts')) ?? DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay:\n parseInt(url.searchParams.get('retry-initial-delay')) ?? DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier:\n parseInt(url.searchParams.get('retry-exp-backoff-multiplier'))\n ?? DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep:\n parseInt(url.searchParams.get('retry-linear-backoff-step'))\n ?? DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: parseInt(url.searchParams.get('retry-backoff-jitter')) ?? DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n}\n\n/**\n * Authorization data / JWT Token.\n * Absent JWT Token tells the client to connect as anonymous user.\n * */\nexport interface AuthInformation {\n /** Absent token means anonymous access */\n jwtToken?: string;\n}\n\nexport const AnonymousAuthInformation: AuthInformation = {};\n\n/** Authorization related settings to pass to {@link PlClient}. */\nexport interface AuthOps {\n /** Initial authorization information */\n authInformation: AuthInformation;\n /** Will be executed after successful authorization information refresh */\n readonly onUpdate?: (newInfo: AuthInformation) => void;\n /** Will be executed if auth-related error happens during normal client operation */\n readonly onAuthError?: () => void;\n /** Will be executed if error encountered during token update */\n readonly onUpdateError?: (error: unknown) => void;\n}\n\n/** Connection status. */\nexport type PlConnectionStatus = 'OK' | 'Disconnected' | 'Unauthenticated';\n\n/** Listener that will be called each time connection status changes. */\n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,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,0BAA0B;AACpF,QAAA,iBAAiB,EACf,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,IAAI,2BAA2B;QACtF,iCAAiC,EAC/B,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,8BAA8B,CAAC;eAC1D,4CAA4C;QACjD,sBAAsB,EACpB,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,2BAA2B,CAAC;eACvD,iCAAiC;AACtC,QAAA,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,IAAI,oBAAoB;AAE3F,QAAA,GAAG,SAAS;KACb;AACH;AAWO,MAAM,wBAAwB,GAAoB;;;;;;;;;;;;;;;;;;"}
@@ -62,8 +62,8 @@ export declare const DEFAULT_TOKEN_TTL_SECONDS: number;
62
62
  export declare const DEFAULT_AUTH_MAX_REFRESH: number;
63
63
  export declare const DEFAULT_MAX_CACHE_BYTES = 128000000;
64
64
  export declare const DEFAULT_RETRY_BACKOFF_ALGORITHM = "exponential";
65
- export declare const DEFAULT_RETRY_MAX_ATTEMPTS = 16;
66
- export declare const DEFAULT_RETRY_INITIAL_DELAY = 14;
65
+ export declare const DEFAULT_RETRY_MAX_ATTEMPTS = 21;
66
+ export declare const DEFAULT_RETRY_INITIAL_DELAY = 20;
67
67
  export declare const DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER = 1.5;
68
68
  export declare const DEFAULT_RETRY_LINEAR_BACKOFF_STEP = 50;
69
69
  export declare const DEFAULT_RETRY_JITTER = 0.3;
@@ -5,8 +5,8 @@ const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;
5
5
  const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;
6
6
  const DEFAULT_MAX_CACHE_BYTES = 128_000_000; // 128 Mb
7
7
  const DEFAULT_RETRY_BACKOFF_ALGORITHM = 'exponential';
8
- const DEFAULT_RETRY_MAX_ATTEMPTS = 16; // 1st attempt + 15 retries
9
- const DEFAULT_RETRY_INITIAL_DELAY = 14; // 14 ms * <jitter> of sleep after first failure
8
+ const DEFAULT_RETRY_MAX_ATTEMPTS = 21; // 1st attempt + 20 retries
9
+ const DEFAULT_RETRY_INITIAL_DELAY = 20; // 20 ms * <jitter> of sleep after first failure
10
10
  const DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER = 1.5; // + 50% on each round
11
11
  const DEFAULT_RETRY_LINEAR_BACKOFF_STEP = 50; // + 50 ms
12
12
  const DEFAULT_RETRY_JITTER = 0.3; // 30%
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../src/core/config.ts"],"sourcesContent":["import type { ExponentialBackoffRetryOptions } from '@milaboratories/ts-helpers';\n\n/** Base configuration structure for PL client */\nexport interface PlClientConfig {\n /** Port and host of remote pl server */\n hostAndPort: string;\n\n /** If set, client will expose a nested object under a field with name `alternative_root_${alternativeRoot}` as a\n * client root. */\n alternativeRoot?: string;\n\n /** If true, client will establish tls connection to the server, using default\n * CA of node instance. */\n // Not implementing custom ssl validation logic for now.\n // Implementing it in a correct way is really nontrivial thing,\n // real use-cases should be considered.\n ssl: boolean;\n\n /** Default timeout in milliseconds for unary calls, like ping and login. */\n defaultRequestTimeout: number;\n\n /** Default timeout in milliseconds for read-write transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultRWTransactionTimeout: number;\n /** Default timeout in milliseconds for read-only transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultROTransactionTimeout: number;\n\n /** Controls what TTL will be requested from the server, when new JWT token\n * is requested. */\n authTTLSeconds: number;\n /** If token is older than this time, it will be refreshed regardless of its\n * expiration time. */\n authMaxRefreshSeconds: number;\n\n /** Proxy server URL to use for pl connection. */\n grpcProxy?: string;\n /** Proxy server URL to use for http connections of pl drivers, like file\n * downloading. */\n httpProxy?: string;\n\n /** Username extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n user?: string;\n /** Password extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n password?: string;\n\n /** Artificial delay introduced after write transactions completion, to\n * somewhat throttle the load on pl. Delay introduced after sync, if requested. */\n txDelay: number;\n\n /** Last resort measure to solve complicated race conditions in pl. */\n forceSync: boolean;\n\n /** Maximal number of bytes of resource state to cache */\n maxCacheBytes: number;\n\n //\n // Retry\n //\n\n /**\n * What type of backoff strategy to use in transaction retries\n * (pl uses optimistic transaction model with regular retries in write transactions)\n * */\n retryBackoffAlgorithm: 'exponential' | 'linear';\n\n /** Maximal number of attempts in */\n retryMaxAttempts: number;\n\n /** Delay after first failed attempt, in ms. */\n retryInitialDelay: number;\n\n /** Each time delay will be multiplied by this number (1.5 means plus on 50% each attempt) */\n retryExponentialBackoffMultiplier: number;\n\n /** [used only for ] This value will be added to the delay from the previous step, in ms */\n retryLinearBackoffStep: number;\n\n /** Value from 0 to 1, determine level of randomness to introduce to the backoff delays sequence. (0 meaning no randomness) */\n retryJitter: number;\n}\n\nexport const DEFAULT_REQUEST_TIMEOUT = 5_000;\nexport const DEFAULT_RO_TX_TIMEOUT = 300_000;\nexport const DEFAULT_RW_TX_TIMEOUT = 60_000;\nexport const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;\nexport const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;\n\nexport const DEFAULT_MAX_CACHE_BYTES = 128_000_000; // 128 Mb\n\nexport const DEFAULT_RETRY_BACKOFF_ALGORITHM = 'exponential';\nexport const DEFAULT_RETRY_MAX_ATTEMPTS = 16; // 1st attempt + 15 retries\nexport const DEFAULT_RETRY_INITIAL_DELAY = 14; // 14 ms * <jitter> of sleep after first failure\nexport const DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER = 1.5; // + 50% on each round\nexport const DEFAULT_RETRY_LINEAR_BACKOFF_STEP = 50; // + 50 ms\nexport const DEFAULT_RETRY_JITTER = 0.3; // 30%\n\nexport const DefaultRetryOptions: ExponentialBackoffRetryOptions = {\n type: 'exponentialBackoff',\n maxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n initialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n backoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n jitter: DEFAULT_RETRY_JITTER,\n};\n\ntype PlConfigOverrides = Partial<\n Pick<\n PlClientConfig,\n | 'ssl'\n | 'defaultRequestTimeout'\n | 'defaultROTransactionTimeout'\n | 'defaultRWTransactionTimeout'\n | 'httpProxy'\n | 'grpcProxy'\n >\n>;\n\nfunction parseInt(s: string | null | undefined): number | undefined {\n if (!s) return undefined;\n const num = Number(s);\n if (Number.isNaN(num)) throw new Error(`Can't parse number: ${s}`);\n return num;\n}\n\n/** Parses pl url and creates a config object that can be passed to\n * {@link PlClient} of {@link UnauthenticatedPlClient}. */\nexport function plAddressToConfig(\n address: string,\n overrides: PlConfigOverrides = {},\n): PlClientConfig {\n if (address.indexOf('://') === -1)\n // non-url address\n return {\n hostAndPort: address,\n ssl: false,\n defaultRequestTimeout: DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout: DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout: DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n txDelay: 0,\n forceSync: false,\n\n maxCacheBytes: DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: DEFAULT_RETRY_BACKOFF_ALGORITHM,\n retryMaxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep: DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n\n const url = new URL(address);\n\n if (\n url.protocol !== 'https:'\n && url.protocol !== 'http:'\n && url.protocol !== 'grpc:'\n && url.protocol !== 'tls:'\n )\n throw new Error(`Unexpected URL schema: ${url.protocol}`);\n\n if (url.pathname !== '/' && url.pathname !== '')\n throw new Error(`Unexpected URL path: ${url.pathname}`);\n\n return {\n hostAndPort: url.host, // this also includes port\n alternativeRoot: url.searchParams.get('alternative-root') ?? undefined,\n ssl: url.protocol === 'https:' || url.protocol === 'tls:',\n defaultRequestTimeout:\n parseInt(url.searchParams.get('request-timeout')) ?? DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout:\n parseInt(url.searchParams.get('ro-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout:\n parseInt(url.searchParams.get('rw-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n grpcProxy: url.searchParams.get('grpc-proxy') ?? undefined,\n httpProxy: url.searchParams.get('http-proxy') ?? undefined,\n user: url.username === '' ? undefined : url.username,\n password: url.password === '' ? undefined : url.password,\n txDelay: parseInt(url.searchParams.get('tx-delay')) ?? 0,\n forceSync: Boolean(url.searchParams.get('force-sync')),\n\n maxCacheBytes: parseInt(url.searchParams.get('max-cache-bytes')) ?? DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: (url.searchParams.get('retry-backoff-algorithm')\n ?? DEFAULT_RETRY_BACKOFF_ALGORITHM) as any,\n retryMaxAttempts:\n parseInt(url.searchParams.get('retry-max-attempts')) ?? DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay:\n parseInt(url.searchParams.get('retry-initial-delay')) ?? DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier:\n parseInt(url.searchParams.get('retry-exp-backoff-multiplier'))\n ?? DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep:\n parseInt(url.searchParams.get('retry-linear-backoff-step'))\n ?? DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: parseInt(url.searchParams.get('retry-backoff-jitter')) ?? DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n}\n\n/**\n * Authorization data / JWT Token.\n * Absent JWT Token tells the client to connect as anonymous user.\n * */\nexport interface AuthInformation {\n /** Absent token means anonymous access */\n jwtToken?: string;\n}\n\nexport const AnonymousAuthInformation: AuthInformation = {};\n\n/** Authorization related settings to pass to {@link PlClient}. */\nexport interface AuthOps {\n /** Initial authorization information */\n authInformation: AuthInformation;\n /** Will be executed after successful authorization information refresh */\n readonly onUpdate?: (newInfo: AuthInformation) => void;\n /** Will be executed if auth-related error happens during normal client operation */\n readonly onAuthError?: () => void;\n /** Will be executed if error encountered during token update */\n readonly onUpdateError?: (error: unknown) => void;\n}\n\n/** Connection status. */\nexport type PlConnectionStatus = 'OK' | 'Disconnected' | 'Unauthenticated';\n\n/** Listener that will be called each time connection status changes. */\nexport type PlConnectionStatusListener = (status: PlConnectionStatus) => void;\n"],"names":[],"mappings":"AAkFO,MAAM,uBAAuB,GAAG;AAChC,MAAM,qBAAqB,GAAG;AAC9B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AACjD,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AAEhD,MAAM,uBAAuB,GAAG,YAAY;AAE5C,MAAM,+BAA+B,GAAG;AACxC,MAAM,0BAA0B,GAAG,GAAG;AACtC,MAAM,2BAA2B,GAAG,GAAG;AACvC,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AG,CAAC,YAAY,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,IAAI,oBAAoB;AAE3F,QAAA,GAAG,SAAS;KACb;AACH;AAWO,MAAM,wBAAwB,GAAoB;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../src/core/config.ts"],"sourcesContent":["import type { ExponentialBackoffRetryOptions } from '@milaboratories/ts-helpers';\n\n/** Base configuration structure for PL client */\nexport interface PlClientConfig {\n /** Port and host of remote pl server */\n hostAndPort: string;\n\n /** If set, client will expose a nested object under a field with name `alternative_root_${alternativeRoot}` as a\n * client root. */\n alternativeRoot?: string;\n\n /** If true, client will establish tls connection to the server, using default\n * CA of node instance. */\n // Not implementing custom ssl validation logic for now.\n // Implementing it in a correct way is really nontrivial thing,\n // real use-cases should be considered.\n ssl: boolean;\n\n /** Default timeout in milliseconds for unary calls, like ping and login. */\n defaultRequestTimeout: number;\n\n /** Default timeout in milliseconds for read-write transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultRWTransactionTimeout: number;\n /** Default timeout in milliseconds for read-only transaction, should be\n * adjusted for long round-trip or low bandwidth connections. */\n defaultROTransactionTimeout: number;\n\n /** Controls what TTL will be requested from the server, when new JWT token\n * is requested. */\n authTTLSeconds: number;\n /** If token is older than this time, it will be refreshed regardless of its\n * expiration time. */\n authMaxRefreshSeconds: number;\n\n /** Proxy server URL to use for pl connection. */\n grpcProxy?: string;\n /** Proxy server URL to use for http connections of pl drivers, like file\n * downloading. */\n httpProxy?: string;\n\n /** Username extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n user?: string;\n /** Password extracted from pl URL. Ignored by {@link PlClient}, picked up by {@link defaultPlClient}. */\n password?: string;\n\n /** Artificial delay introduced after write transactions completion, to\n * somewhat throttle the load on pl. Delay introduced after sync, if requested. */\n txDelay: number;\n\n /** Last resort measure to solve complicated race conditions in pl. */\n forceSync: boolean;\n\n /** Maximal number of bytes of resource state to cache */\n maxCacheBytes: number;\n\n //\n // Retry\n //\n\n /**\n * What type of backoff strategy to use in transaction retries\n * (pl uses optimistic transaction model with regular retries in write transactions)\n * */\n retryBackoffAlgorithm: 'exponential' | 'linear';\n\n /** Maximal number of attempts in */\n retryMaxAttempts: number;\n\n /** Delay after first failed attempt, in ms. */\n retryInitialDelay: number;\n\n /** Each time delay will be multiplied by this number (1.5 means plus on 50% each attempt) */\n retryExponentialBackoffMultiplier: number;\n\n /** [used only for ] This value will be added to the delay from the previous step, in ms */\n retryLinearBackoffStep: number;\n\n /** Value from 0 to 1, determine level of randomness to introduce to the backoff delays sequence. (0 meaning no randomness) */\n retryJitter: number;\n}\n\nexport const DEFAULT_REQUEST_TIMEOUT = 5_000;\nexport const DEFAULT_RO_TX_TIMEOUT = 300_000;\nexport const DEFAULT_RW_TX_TIMEOUT = 60_000;\nexport const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;\nexport const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;\n\nexport const DEFAULT_MAX_CACHE_BYTES = 128_000_000; // 128 Mb\n\nexport const DEFAULT_RETRY_BACKOFF_ALGORITHM = 'exponential';\nexport const DEFAULT_RETRY_MAX_ATTEMPTS = 21; // 1st attempt + 20 retries\nexport const DEFAULT_RETRY_INITIAL_DELAY = 20; // 20 ms * <jitter> of sleep after first failure\nexport const DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER = 1.5; // + 50% on each round\nexport const DEFAULT_RETRY_LINEAR_BACKOFF_STEP = 50; // + 50 ms\nexport const DEFAULT_RETRY_JITTER = 0.3; // 30%\n\nexport const DefaultRetryOptions: ExponentialBackoffRetryOptions = {\n type: 'exponentialBackoff',\n maxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n initialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n backoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n jitter: DEFAULT_RETRY_JITTER,\n};\n\ntype PlConfigOverrides = Partial<\n Pick<\n PlClientConfig,\n | 'ssl'\n | 'defaultRequestTimeout'\n | 'defaultROTransactionTimeout'\n | 'defaultRWTransactionTimeout'\n | 'httpProxy'\n | 'grpcProxy'\n >\n>;\n\nfunction parseInt(s: string | null | undefined): number | undefined {\n if (!s) return undefined;\n const num = Number(s);\n if (Number.isNaN(num)) throw new Error(`Can't parse number: ${s}`);\n return num;\n}\n\n/** Parses pl url and creates a config object that can be passed to\n * {@link PlClient} of {@link UnauthenticatedPlClient}. */\nexport function plAddressToConfig(\n address: string,\n overrides: PlConfigOverrides = {},\n): PlClientConfig {\n if (address.indexOf('://') === -1)\n // non-url address\n return {\n hostAndPort: address,\n ssl: false,\n defaultRequestTimeout: DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout: DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout: DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n txDelay: 0,\n forceSync: false,\n\n maxCacheBytes: DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: DEFAULT_RETRY_BACKOFF_ALGORITHM,\n retryMaxAttempts: DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay: DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier: DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep: DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n\n const url = new URL(address);\n\n if (\n url.protocol !== 'https:'\n && url.protocol !== 'http:'\n && url.protocol !== 'grpc:'\n && url.protocol !== 'tls:'\n )\n throw new Error(`Unexpected URL schema: ${url.protocol}`);\n\n if (url.pathname !== '/' && url.pathname !== '')\n throw new Error(`Unexpected URL path: ${url.pathname}`);\n\n return {\n hostAndPort: url.host, // this also includes port\n alternativeRoot: url.searchParams.get('alternative-root') ?? undefined,\n ssl: url.protocol === 'https:' || url.protocol === 'tls:',\n defaultRequestTimeout:\n parseInt(url.searchParams.get('request-timeout')) ?? DEFAULT_REQUEST_TIMEOUT,\n defaultROTransactionTimeout:\n parseInt(url.searchParams.get('ro-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RO_TX_TIMEOUT,\n defaultRWTransactionTimeout:\n parseInt(url.searchParams.get('rw-tx-timeout'))\n ?? parseInt(url.searchParams.get('tx-timeout'))\n ?? DEFAULT_RW_TX_TIMEOUT,\n authTTLSeconds: DEFAULT_TOKEN_TTL_SECONDS,\n authMaxRefreshSeconds: DEFAULT_AUTH_MAX_REFRESH,\n grpcProxy: url.searchParams.get('grpc-proxy') ?? undefined,\n httpProxy: url.searchParams.get('http-proxy') ?? undefined,\n user: url.username === '' ? undefined : url.username,\n password: url.password === '' ? undefined : url.password,\n txDelay: parseInt(url.searchParams.get('tx-delay')) ?? 0,\n forceSync: Boolean(url.searchParams.get('force-sync')),\n\n maxCacheBytes: parseInt(url.searchParams.get('max-cache-bytes')) ?? DEFAULT_MAX_CACHE_BYTES,\n\n retryBackoffAlgorithm: (url.searchParams.get('retry-backoff-algorithm')\n ?? DEFAULT_RETRY_BACKOFF_ALGORITHM) as any,\n retryMaxAttempts:\n parseInt(url.searchParams.get('retry-max-attempts')) ?? DEFAULT_RETRY_MAX_ATTEMPTS,\n retryInitialDelay:\n parseInt(url.searchParams.get('retry-initial-delay')) ?? DEFAULT_RETRY_INITIAL_DELAY,\n retryExponentialBackoffMultiplier:\n parseInt(url.searchParams.get('retry-exp-backoff-multiplier'))\n ?? DEFAULT_RETRY_EXPONENTIAL_BACKOFF_MULTIPLIER,\n retryLinearBackoffStep:\n parseInt(url.searchParams.get('retry-linear-backoff-step'))\n ?? DEFAULT_RETRY_LINEAR_BACKOFF_STEP,\n retryJitter: parseInt(url.searchParams.get('retry-backoff-jitter')) ?? DEFAULT_RETRY_JITTER,\n\n ...overrides,\n };\n}\n\n/**\n * Authorization data / JWT Token.\n * Absent JWT Token tells the client to connect as anonymous user.\n * */\nexport interface AuthInformation {\n /** Absent token means anonymous access */\n jwtToken?: string;\n}\n\nexport const AnonymousAuthInformation: AuthInformation = {};\n\n/** Authorization related settings to pass to {@link PlClient}. */\nexport interface AuthOps {\n /** Initial authorization information */\n authInformation: AuthInformation;\n /** Will be executed after successful authorization information refresh */\n readonly onUpdate?: (newInfo: AuthInformation) => void;\n /** Will be executed if auth-related error happens during normal client operation */\n readonly onAuthError?: () => void;\n /** Will be executed if error encountered during token update */\n readonly onUpdateError?: (error: unknown) => void;\n}\n\n/** Connection status. */\nexport type PlConnectionStatus = 'OK' | 'Disconnected' | 'Unauthenticated';\n\n/** Listener that will be called each time connection status changes. */\nexport type PlConnectionStatusListener = (status: PlConnectionStatus) => void;\n"],"names":[],"mappings":"AAkFO,MAAM,uBAAuB,GAAG;AAChC,MAAM,qBAAqB,GAAG;AAC9B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AACjD,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AAEhD,MAAM,uBAAuB,GAAG,YAAY;AAE5C,MAAM,+BAA+B,GAAG;AACxC,MAAM,0BAA0B,GAAG,GAAG;AACtC,MAAM,2BAA2B,GAAG,GAAG;AACvC,MAAM,4CAA4C,GAAG,IAAI;AACzD,MAAM,iCAAiC,GAAG,GAAG;AAC7C,MAAM,oBAAoB,GAAG,IAAI;AAEjC,MAAM,mBAAmB,GAAmC;AACjE,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,YAAY,EAAE,2BAA2B;AACzC,IAAA,iBAAiB,EAAE,4CAA4C;AAC/D,IAAA,MAAM,EAAE,oBAAoB;;AAe9B,SAAS,QAAQ,CAAC,CAA4B,EAAA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Q,KAAK,EAAE,GAAG,SAAS,GAAG,GAAG,CAAC,QAAQ;AACxD,QAAA,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;QACxD,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEtD,QAAA,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,IAAI,uBAAuB;QAE3F,qBAAqB,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,yBAAyB;AACjE,eAAA,+BAA+B,CAAQ;AAC5C,QAAA,gBAAgB,EACd,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,0BAA0B;AACpF,QAAA,iBAAiB,EACf,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,IAAI,2BAA2B;QACtF,iCAAiC,EAC/B,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,8BAA8B,CAAC;eAC1D,4CAA4C;QACjD,sBAAsB,EACpB,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,2BAA2B,CAAC;eACvD,iCAAiC;AACtC,QAAA,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,IAAI,oBAAoB;AAE3F,QAAA,GAAG,SAAS;KACb;AACH;AAWO,MAAM,wBAAwB,GAAoB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"status.cjs","sources":["../../../../../../../src/proto/github.com/googleapis/googleapis/google/rpc/status.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.0 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 2020 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 [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 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"],"names":["MessageType","Any","reflectionMergePartial","UnknownFieldHandler","WireType"],"mappings":";;;;;AA8DA;AACA,MAAM,WAAY,SAAQA,mBAAmB,CAAA;AACzC,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,mBAAmB,EAAE;AACvB,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,uBAAuB;AAClE,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,wBAAwB;YACtE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,0BAA0B,CAAC,EAAE,MAAMC,OAAG;AAC7F,SAAA,CAAC;IACN;AACA,IAAA,MAAM,CAAC,KAA8B,EAAA;AACjC,QAAA,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAiB,EAAE;AAClE,QAAA,OAAO,CAAC,IAAI,GAAG,CAAC;AAChB,QAAA,OAAO,CAAC,OAAO,GAAG,EAAE;AACpB,QAAA,OAAO,CAAC,OAAO,GAAG,EAAE;QACpB,IAAI,KAAK,KAAK,SAAS;AACnB,YAAAC,8BAAsB,CAAS,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC;AACxD,QAAA,OAAO,OAAO;IAClB;AACA,IAAA,kBAAkB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAA0B,EAAE,MAAe,EAAA;AACjG,QAAA,IAAI,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM;AAChE,QAAA,OA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;AAEtD,QAAA,IAAI,OAAO,CAAC,OAAO,KAAK,EAAE;AACtB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEA,gBAAQ,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;;AAEnE,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE;AAC3C,YAAAH,OAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEG,gBAAQ,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;AAC/G,QAAA,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB;QAClC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,GAAGD,2BAAmB,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;AACjF,QAAA,OAAO,MAAM;IACjB;AACH;AACD;;AAEG;AACI,MAAM,MAAM,GAAG,IAAI,WAAW;;;;"}
1
+ {"version":3,"file":"status.cjs","sources":["../../../../../../../src/proto/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 2020 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 [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 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"],"names":["MessageType","Any","reflectionMergePartial","UnknownFieldHandler","WireType"],"mappings":";;;;;AA8DA;AACA,MAAM,WAAY,SAAQA,mBAAmB,CAAA;AACzC,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,mBAAmB,EAAE;AACvB,YAAA,EAAE,EAAE,EAA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AC3C,YAAAH,OAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAEG,gBAAQ,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;AAC/G,QAAA,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB;QAClC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,GAAGD,2BAAmB,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;AACjF,QAAA,OAAO,MAAM;IACjB;AACH;AACD;;AAEG;AACI,MAAM,MAAM,GAAG,IAAI,WAAW;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sources":["../../../../../../../src/proto/github.com/googleapis/googleapis/google/rpc/status.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.0 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 2020 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 [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 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"],"names":[],"mappings":";;;AA8DA;AACA,MAAM,WAAY,SAAQ,WAAmB,CAAA;AACzC,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,mBAAmB,EAAE;AACvB,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,uBAAuB;AAClE,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,wBAAwB;YACtE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,0B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CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;AACjF,QAAA,OAAO,MAAM;IACjB;AACH;AACD;;AAEG;AACI,MAAM,MAAM,GAAG,IAAI,WAAW;;;;"}
1
+ {"version":3,"file":"status.js","sources":["../../../../../../../src/proto/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 2020 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 [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 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"],"names":[],"mappings":";;;AA8DA;AACA,MAAM,WAAY,SAAQ,WAAmB,CAAA;AACzC,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,mBAAmB,EAAE;AACvB,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,uBAAuB;AAClE,YAAA,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,wBAAwB;YACtE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,0BAA0B,CAAC,EAAE,MAAM,GAAG;AAC7F,SAAA,CAAC;IACN;AACA,IAAA,MAAM,CAAC,KAA8B,EAAA;AACjC,QAAA,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAiB,EAAE;AAClE,QAAA,OAAO,CAAC,IAAI,GAAG,CAAC;AAChB,QAAA,OAAO,CAAC,OAAO,GAAG,EAAE;AACpB,QAAA,OAAO,CAAC,OAAO,GAAG,EAAE;QACpB,IAAI,KAAK,KAAK,SAAS;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,QAAQ,EAAE,CAAC,CAAC;;QAE3G;AACA,QAAA,OAAO,OAAO;IAClB;AACA,IAAA,mBAAmB,CAAC,OAAe,EAAE,MAAqB,EAAE,OAA2B,EAAA;;AAEnF,QAAA,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;AAClB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;;AAEtD,QAAA,IAAI,OAAO,CAAC,OAAO,KAAK,EAAE;AACtB,YAAA,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;;AAEnE,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE;AAC3C,YAAA,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;AAC/G,QAAA,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB;QAClC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,GAAG,mBAAmB,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC;AACjF,QAAA,OAAO,MAAM;IACjB;AACH;AACD;;AAEG;AACI,MAAM,MAAM,GAAG,IAAI,WAAW;;;;"}
@@ -8,7 +8,7 @@ var resource_types = require('./resource_types.cjs');
8
8
  var base_types = require('./base_types.cjs');
9
9
  var status = require('../../../../googleapis/googleapis/google/rpc/status.cjs');
10
10
 
11
- // @generated by protobuf-ts 2.11.0 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none
11
+ // @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none
12
12
  // @generated from protobuf file "github.com/milaboratory/pl/plapi/plapiproto/api.proto" (package "MiLaboratories.PL.API", syntax proto3)
13
13
  // tslint:disable
14
14
  /**
@@ -12469,7 +12469,10 @@ class MaintenanceAPI_Ping_Response$Type extends runtime.MessageType {
12469
12469
  { no: 2, name: "core_full_version", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
12470
12470
  { no: 3, name: "server_info", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
12471
12471
  { no: 4, name: "compression", kind: "enum", T: () => ["MiLaboratories.PL.API.MaintenanceAPI.Ping.Response.Compression", exports.MaintenanceAPI_Ping_Response_Compression] },
12472
- { no: 5, name: "instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
12472
+ { no: 5, name: "instance_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
12473
+ { no: 6, name: "platform", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
12474
+ { no: 7, name: "os", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
12475
+ { no: 8, name: "arch", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
12473
12476
  ]);
12474
12477
  }
12475
12478
  create(value) {
@@ -12479,6 +12482,9 @@ class MaintenanceAPI_Ping_Response$Type extends runtime.MessageType {
12479
12482
  message.serverInfo = "";
12480
12483
  message.compression = 0;
12481
12484
  message.instanceId = "";
12485
+ message.platform = "";
12486
+ message.os = "";
12487
+ message.arch = "";
12482
12488
  if (value !== undefined)
12483
12489
  runtime.reflectionMergePartial(this, message, value);
12484
12490
  return message;
@@ -12503,6 +12509,15 @@ class MaintenanceAPI_Ping_Response$Type extends runtime.MessageType {
12503
12509
  case /* string instance_id */ 5:
12504
12510
  message.instanceId = reader.string();
12505
12511
  break;
12512
+ case /* string platform */ 6:
12513
+ message.platform = reader.string();
12514
+ break;
12515
+ case /* string os */ 7:
12516
+ message.os = reader.string();
12517
+ break;
12518
+ case /* string arch */ 8:
12519
+ message.arch = reader.string();
12520
+ break;
12506
12521
  default:
12507
12522
  let u = options.readUnknownField;
12508
12523
  if (u === "throw")
@@ -12530,6 +12545,15 @@ class MaintenanceAPI_Ping_Response$Type extends runtime.MessageType {
12530
12545
  /* string instance_id = 5; */
12531
12546
  if (message.instanceId !== "")
12532
12547
  writer.tag(5, runtime.WireType.LengthDelimited).string(message.instanceId);
12548
+ /* string platform = 6; */
12549
+ if (message.platform !== "")
12550
+ writer.tag(6, runtime.WireType.LengthDelimited).string(message.platform);
12551
+ /* string os = 7; */
12552
+ if (message.os !== "")
12553
+ writer.tag(7, runtime.WireType.LengthDelimited).string(message.os);
12554
+ /* string arch = 8; */
12555
+ if (message.arch !== "")
12556
+ writer.tag(8, runtime.WireType.LengthDelimited).string(message.arch);
12533
12557
  let u = options.writeUnknownFields;
12534
12558
  if (u !== false)
12535
12559
  (u == true ? runtime.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);