@gomomento/sdk-core 1.12.8

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 (184) hide show
  1. package/dist/src/auth/credential-provider.d.ts +83 -0
  2. package/dist/src/auth/credential-provider.js +82 -0
  3. package/dist/src/auth/index.d.ts +1 -0
  4. package/dist/src/auth/index.js +18 -0
  5. package/dist/src/config/logging/default-momento-logger.d.ts +24 -0
  6. package/dist/src/config/logging/default-momento-logger.js +69 -0
  7. package/dist/src/config/logging/index.d.ts +3 -0
  8. package/dist/src/config/logging/index.js +20 -0
  9. package/dist/src/config/logging/momento-logger.d.ts +10 -0
  10. package/dist/src/config/logging/momento-logger.js +3 -0
  11. package/dist/src/config/logging/noop-momento-logger.d.ts +11 -0
  12. package/dist/src/config/logging/noop-momento-logger.js +34 -0
  13. package/dist/src/config/transport/grpc-configuration.d.ts +41 -0
  14. package/dist/src/config/transport/grpc-configuration.js +3 -0
  15. package/dist/src/config/transport/index.d.ts +2 -0
  16. package/dist/src/config/transport/index.js +19 -0
  17. package/dist/src/config/transport/transport-strategy.d.ts +77 -0
  18. package/dist/src/config/transport/transport-strategy.js +60 -0
  19. package/dist/src/errors/error-utils.d.ts +2 -0
  20. package/dist/src/errors/error-utils.js +12 -0
  21. package/dist/src/errors/errors.d.ts +140 -0
  22. package/dist/src/errors/errors.js +229 -0
  23. package/dist/src/errors/index.d.ts +2 -0
  24. package/dist/src/errors/index.js +19 -0
  25. package/dist/src/index.d.ts +57 -0
  26. package/dist/src/index.js +137 -0
  27. package/dist/src/internal/clients/auth/AbstractAuthClient.d.ts +10 -0
  28. package/dist/src/internal/clients/auth/AbstractAuthClient.js +13 -0
  29. package/dist/src/internal/clients/auth/IAuthClient.d.ts +4 -0
  30. package/dist/src/internal/clients/auth/IAuthClient.js +3 -0
  31. package/dist/src/internal/clients/auth/index.d.ts +2 -0
  32. package/dist/src/internal/clients/auth/index.js +19 -0
  33. package/dist/src/internal/clients/cache/AbstractCacheClient.d.ts +638 -0
  34. package/dist/src/internal/clients/cache/AbstractCacheClient.js +870 -0
  35. package/dist/src/internal/clients/cache/ICacheClient.d.ts +45 -0
  36. package/dist/src/internal/clients/cache/ICacheClient.js +3 -0
  37. package/dist/src/internal/clients/cache/IControlClient.d.ts +7 -0
  38. package/dist/src/internal/clients/cache/IControlClient.js +3 -0
  39. package/dist/src/internal/clients/cache/IDataClient.d.ts +29 -0
  40. package/dist/src/internal/clients/cache/IDataClient.js +3 -0
  41. package/dist/src/internal/clients/cache/index.d.ts +4 -0
  42. package/dist/src/internal/clients/cache/index.js +21 -0
  43. package/dist/src/internal/clients/index.d.ts +3 -0
  44. package/dist/src/internal/clients/index.js +20 -0
  45. package/dist/src/internal/clients/ping/AbstractPingClient.d.ts +25 -0
  46. package/dist/src/internal/clients/ping/AbstractPingClient.js +29 -0
  47. package/dist/src/internal/clients/ping/IPingClient.d.ts +3 -0
  48. package/dist/src/internal/clients/ping/IPingClient.js +3 -0
  49. package/dist/src/internal/clients/ping/index.d.ts +2 -0
  50. package/dist/src/internal/clients/ping/index.js +19 -0
  51. package/dist/src/internal/subscription-state.d.ts +15 -0
  52. package/dist/src/internal/subscription-state.js +38 -0
  53. package/dist/src/internal/utils/auth.d.ts +25 -0
  54. package/dist/src/internal/utils/auth.js +50 -0
  55. package/dist/src/internal/utils/collections.d.ts +1 -0
  56. package/dist/src/internal/utils/collections.js +8 -0
  57. package/dist/src/internal/utils/display.d.ts +2 -0
  58. package/dist/src/internal/utils/display.js +30 -0
  59. package/dist/src/internal/utils/index.d.ts +7 -0
  60. package/dist/src/internal/utils/index.js +24 -0
  61. package/dist/src/internal/utils/object.d.ts +1 -0
  62. package/dist/src/internal/utils/object.js +8 -0
  63. package/dist/src/internal/utils/sleep.d.ts +1 -0
  64. package/dist/src/internal/utils/sleep.js +6 -0
  65. package/dist/src/internal/utils/string.d.ts +2 -0
  66. package/dist/src/internal/utils/string.js +17 -0
  67. package/dist/src/internal/utils/validators.d.ts +13 -0
  68. package/dist/src/internal/utils/validators.js +105 -0
  69. package/dist/src/internal/vendor/printf/README.md +31 -0
  70. package/dist/src/internal/vendor/printf/printf.d.ts +9 -0
  71. package/dist/src/internal/vendor/printf/printf.js +478 -0
  72. package/dist/src/messages/cache-info.d.ts +5 -0
  73. package/dist/src/messages/cache-info.js +13 -0
  74. package/dist/src/messages/responses/cache-delete.d.ts +61 -0
  75. package/dist/src/messages/responses/cache-delete.js +54 -0
  76. package/dist/src/messages/responses/cache-dictionary-fetch.d.ts +120 -0
  77. package/dist/src/messages/responses/cache-dictionary-fetch.js +162 -0
  78. package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +123 -0
  79. package/dist/src/messages/responses/cache-dictionary-get-field.js +143 -0
  80. package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +122 -0
  81. package/dist/src/messages/responses/cache-dictionary-get-fields.js +173 -0
  82. package/dist/src/messages/responses/cache-dictionary-increment.d.ts +69 -0
  83. package/dist/src/messages/responses/cache-dictionary-increment.js +68 -0
  84. package/dist/src/messages/responses/cache-dictionary-remove-field.d.ts +61 -0
  85. package/dist/src/messages/responses/cache-dictionary-remove-field.js +54 -0
  86. package/dist/src/messages/responses/cache-dictionary-remove-fields.d.ts +61 -0
  87. package/dist/src/messages/responses/cache-dictionary-remove-fields.js +54 -0
  88. package/dist/src/messages/responses/cache-dictionary-set-field.d.ts +61 -0
  89. package/dist/src/messages/responses/cache-dictionary-set-field.js +54 -0
  90. package/dist/src/messages/responses/cache-dictionary-set-fields.d.ts +61 -0
  91. package/dist/src/messages/responses/cache-dictionary-set-fields.js +54 -0
  92. package/dist/src/messages/responses/cache-flush.d.ts +61 -0
  93. package/dist/src/messages/responses/cache-flush.js +54 -0
  94. package/dist/src/messages/responses/cache-get.d.ts +86 -0
  95. package/dist/src/messages/responses/cache-get.js +88 -0
  96. package/dist/src/messages/responses/cache-increment.d.ts +69 -0
  97. package/dist/src/messages/responses/cache-increment.js +68 -0
  98. package/dist/src/messages/responses/cache-list-concatenate-back.d.ts +69 -0
  99. package/dist/src/messages/responses/cache-list-concatenate-back.js +68 -0
  100. package/dist/src/messages/responses/cache-list-concatenate-front.d.ts +69 -0
  101. package/dist/src/messages/responses/cache-list-concatenate-front.js +68 -0
  102. package/dist/src/messages/responses/cache-list-fetch.d.ts +92 -0
  103. package/dist/src/messages/responses/cache-list-fetch.js +96 -0
  104. package/dist/src/messages/responses/cache-list-length.d.ts +84 -0
  105. package/dist/src/messages/responses/cache-list-length.js +78 -0
  106. package/dist/src/messages/responses/cache-list-pop-back.d.ts +86 -0
  107. package/dist/src/messages/responses/cache-list-pop-back.js +88 -0
  108. package/dist/src/messages/responses/cache-list-pop-front.d.ts +86 -0
  109. package/dist/src/messages/responses/cache-list-pop-front.js +88 -0
  110. package/dist/src/messages/responses/cache-list-push-back.d.ts +69 -0
  111. package/dist/src/messages/responses/cache-list-push-back.js +68 -0
  112. package/dist/src/messages/responses/cache-list-push-front.d.ts +69 -0
  113. package/dist/src/messages/responses/cache-list-push-front.js +68 -0
  114. package/dist/src/messages/responses/cache-list-remove-value.d.ts +61 -0
  115. package/dist/src/messages/responses/cache-list-remove-value.js +54 -0
  116. package/dist/src/messages/responses/cache-list-retain.d.ts +61 -0
  117. package/dist/src/messages/responses/cache-list-retain.js +54 -0
  118. package/dist/src/messages/responses/cache-set-add-element.d.ts +71 -0
  119. package/dist/src/messages/responses/cache-set-add-element.js +54 -0
  120. package/dist/src/messages/responses/cache-set-add-elements.d.ts +65 -0
  121. package/dist/src/messages/responses/cache-set-add-elements.js +61 -0
  122. package/dist/src/messages/responses/cache-set-fetch.d.ts +111 -0
  123. package/dist/src/messages/responses/cache-set-fetch.js +121 -0
  124. package/dist/src/messages/responses/cache-set-if-not-exists.d.ts +74 -0
  125. package/dist/src/messages/responses/cache-set-if-not-exists.js +63 -0
  126. package/dist/src/messages/responses/cache-set-remove-element.d.ts +61 -0
  127. package/dist/src/messages/responses/cache-set-remove-element.js +54 -0
  128. package/dist/src/messages/responses/cache-set-remove-elements.d.ts +65 -0
  129. package/dist/src/messages/responses/cache-set-remove-elements.js +61 -0
  130. package/dist/src/messages/responses/cache-set.d.ts +61 -0
  131. package/dist/src/messages/responses/cache-set.js +54 -0
  132. package/dist/src/messages/responses/cache-sorted-set-fetch.d.ts +107 -0
  133. package/dist/src/messages/responses/cache-sorted-set-fetch.js +124 -0
  134. package/dist/src/messages/responses/cache-sorted-set-get-rank.d.ts +81 -0
  135. package/dist/src/messages/responses/cache-sorted-set-get-rank.js +78 -0
  136. package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +118 -0
  137. package/dist/src/messages/responses/cache-sorted-set-get-score.js +131 -0
  138. package/dist/src/messages/responses/cache-sorted-set-get-scores.d.ts +109 -0
  139. package/dist/src/messages/responses/cache-sorted-set-get-scores.js +148 -0
  140. package/dist/src/messages/responses/cache-sorted-set-increment-score.d.ts +69 -0
  141. package/dist/src/messages/responses/cache-sorted-set-increment-score.js +68 -0
  142. package/dist/src/messages/responses/cache-sorted-set-put-element.d.ts +61 -0
  143. package/dist/src/messages/responses/cache-sorted-set-put-element.js +54 -0
  144. package/dist/src/messages/responses/cache-sorted-set-put-elements.d.ts +61 -0
  145. package/dist/src/messages/responses/cache-sorted-set-put-elements.js +54 -0
  146. package/dist/src/messages/responses/cache-sorted-set-remove-element.d.ts +61 -0
  147. package/dist/src/messages/responses/cache-sorted-set-remove-element.js +54 -0
  148. package/dist/src/messages/responses/cache-sorted-set-remove-elements.d.ts +61 -0
  149. package/dist/src/messages/responses/cache-sorted-set-remove-elements.js +54 -0
  150. package/dist/src/messages/responses/create-cache.d.ts +77 -0
  151. package/dist/src/messages/responses/create-cache.js +61 -0
  152. package/dist/src/messages/responses/create-signing-key.d.ts +71 -0
  153. package/dist/src/messages/responses/create-signing-key.js +76 -0
  154. package/dist/src/messages/responses/delete-cache.d.ts +61 -0
  155. package/dist/src/messages/responses/delete-cache.js +54 -0
  156. package/dist/src/messages/responses/generate-api-token.d.ts +50 -0
  157. package/dist/src/messages/responses/generate-api-token.js +52 -0
  158. package/dist/src/messages/responses/grpc-response-types.d.ts +41 -0
  159. package/dist/src/messages/responses/grpc-response-types.js +53 -0
  160. package/dist/src/messages/responses/list-caches.d.ts +70 -0
  161. package/dist/src/messages/responses/list-caches.js +69 -0
  162. package/dist/src/messages/responses/list-signing-keys.d.ts +68 -0
  163. package/dist/src/messages/responses/list-signing-keys.js +68 -0
  164. package/dist/src/messages/responses/response-base.d.ts +43 -0
  165. package/dist/src/messages/responses/response-base.js +50 -0
  166. package/dist/src/messages/responses/revoke-signing-key.d.ts +61 -0
  167. package/dist/src/messages/responses/revoke-signing-key.js +54 -0
  168. package/dist/src/messages/responses/topic-item.d.ts +27 -0
  169. package/dist/src/messages/responses/topic-item.js +43 -0
  170. package/dist/src/messages/responses/topic-publish.d.ts +61 -0
  171. package/dist/src/messages/responses/topic-publish.js +54 -0
  172. package/dist/src/messages/responses/topic-subscribe.d.ts +69 -0
  173. package/dist/src/messages/responses/topic-subscribe.js +72 -0
  174. package/dist/src/messages/signing-key.d.ts +9 -0
  175. package/dist/src/messages/signing-key.js +21 -0
  176. package/dist/src/utils/cache-call-options.d.ts +99 -0
  177. package/dist/src/utils/cache-call-options.js +9 -0
  178. package/dist/src/utils/collection-ttl.d.ts +78 -0
  179. package/dist/src/utils/collection-ttl.js +102 -0
  180. package/dist/src/utils/index.d.ts +3 -0
  181. package/dist/src/utils/index.js +20 -0
  182. package/dist/src/utils/topic-call-options.d.ts +19 -0
  183. package/dist/src/utils/topic-call-options.js +3 -0
  184. package/package.json +53 -0
@@ -0,0 +1,81 @@
1
+ import { ResponseBase } from './response-base';
2
+ import { SdkError } from '../../errors/errors';
3
+ /**
4
+ * Parent response type for a sorted set GetRank request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Hit}
9
+ * - {Miss}
10
+ * - {Error}
11
+ *
12
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
13
+ * @example
14
+ * For example:
15
+ * ```
16
+ * if (response instanceof CacheSortedSetGetRank.Error) {
17
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
+ * // `CacheSortedSetGetRank.Error` in this block, so you will have access to the properties
19
+ * // of the Error class; e.g. `response.errorCode()`.
20
+ * }
21
+ * ```
22
+ */
23
+ export declare abstract class Response extends ResponseBase {
24
+ }
25
+ declare class _Hit extends Response {
26
+ private readonly _rank;
27
+ constructor(rank: number);
28
+ /**
29
+ * Returns the rank of the element in the sorted set. Ranks start at 0.
30
+ * @returns {number}
31
+ */
32
+ rank(): number;
33
+ toString(): string;
34
+ }
35
+ declare const Hit_base: {
36
+ new (...args: any[]): {};
37
+ } & typeof _Hit;
38
+ /**
39
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
40
+ * `rank()` accessor to retrieve rank.
41
+ */
42
+ export declare class Hit extends Hit_base {
43
+ }
44
+ declare class _Miss extends Response {
45
+ }
46
+ declare const Miss_base: {
47
+ new (...args: any[]): {
48
+ readonly is_miss: boolean;
49
+ };
50
+ } & typeof _Miss;
51
+ /**
52
+ * Indicates that the requested data was not available in the cache.
53
+ */
54
+ export declare class Miss extends Miss_base {
55
+ }
56
+ declare class _Error extends Response {
57
+ protected _innerException: SdkError;
58
+ constructor(_innerException: SdkError);
59
+ }
60
+ declare const Error_base: {
61
+ new (...args: any[]): {
62
+ _innerException: SdkError;
63
+ message(): string;
64
+ innerException(): SdkError;
65
+ errorCode(): import("../../errors/errors").MomentoErrorCode;
66
+ toString(): string;
67
+ };
68
+ } & typeof _Error;
69
+ /**
70
+ * Indicates that an error occurred during the sorted set get rank request.
71
+ *
72
+ * This response object includes the following fields that you can use to determine
73
+ * how you would like to handle the error:
74
+ *
75
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
76
+ * - `message()` - a human-readable description of the error
77
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
78
+ */
79
+ export declare class Error extends Error_base {
80
+ }
81
+ export {};
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Miss = exports.Hit = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a sorted set GetRank request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Hit}
11
+ * - {Miss}
12
+ * - {Error}
13
+ *
14
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
15
+ * @example
16
+ * For example:
17
+ * ```
18
+ * if (response instanceof CacheSortedSetGetRank.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheSortedSetGetRank.Error` in this block, so you will have access to the properties
21
+ * // of the Error class; e.g. `response.errorCode()`.
22
+ * }
23
+ * ```
24
+ */
25
+ class Response extends response_base_1.ResponseBase {
26
+ }
27
+ exports.Response = Response;
28
+ class _Hit extends Response {
29
+ constructor(rank) {
30
+ super();
31
+ this._rank = rank;
32
+ }
33
+ /**
34
+ * Returns the rank of the element in the sorted set. Ranks start at 0.
35
+ * @returns {number}
36
+ */
37
+ rank() {
38
+ return this._rank;
39
+ }
40
+ toString() {
41
+ return `${super.toString()}: rank: ${this.rank()}`;
42
+ }
43
+ }
44
+ /**
45
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
46
+ * `rank()` accessor to retrieve rank.
47
+ */
48
+ class Hit extends (0, response_base_1.ResponseHit)(_Hit) {
49
+ }
50
+ exports.Hit = Hit;
51
+ class _Miss extends Response {
52
+ }
53
+ /**
54
+ * Indicates that the requested data was not available in the cache.
55
+ */
56
+ class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
57
+ }
58
+ exports.Miss = Miss;
59
+ class _Error extends Response {
60
+ constructor(_innerException) {
61
+ super();
62
+ this._innerException = _innerException;
63
+ }
64
+ }
65
+ /**
66
+ * Indicates that an error occurred during the sorted set get rank request.
67
+ *
68
+ * This response object includes the following fields that you can use to determine
69
+ * how you would like to handle the error:
70
+ *
71
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
72
+ * - `message()` - a human-readable description of the error
73
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
74
+ */
75
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
76
+ }
77
+ exports.Error = Error;
78
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc29ydGVkLXNldC1nZXQtcmFuay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUtc29ydGVkLXNldC1nZXQtcmFuay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtREFLeUI7QUFHekI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FtQkc7QUFDSCxNQUFzQixRQUFTLFNBQVEsNEJBQVk7Q0FBRztBQUF0RCw0QkFBc0Q7QUFFdEQsTUFBTSxJQUFLLFNBQVEsUUFBUTtJQUd6QixZQUFZLElBQVk7UUFDdEIsS0FBSyxFQUFFLENBQUM7UUFDUixJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksQ0FBQztJQUNwQixDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksSUFBSTtRQUNULE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQztJQUNwQixDQUFDO0lBRWUsUUFBUTtRQUN0QixPQUFPLEdBQUcsS0FBSyxDQUFDLFFBQVEsRUFBRSxXQUFXLElBQUksQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDO0lBQ3JELENBQUM7Q0FDRjtBQUVEOzs7R0FHRztBQUNILE1BQWEsR0FBSSxTQUFRLElBQUEsMkJBQVcsRUFBQyxJQUFJLENBQUM7Q0FBRztBQUE3QyxrQkFBNkM7QUFFN0MsTUFBTSxLQUFNLFNBQVEsUUFBUTtDQUFHO0FBRS9COztHQUVHO0FBQ0gsTUFBY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oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIFJlc3BvbnNlRXJyb3IoX0Vycm9yKSB7fVxuIl19
@@ -0,0 +1,118 @@
1
+ import { ResponseBase } from './response-base';
2
+ import { SdkError } from '../../errors/errors';
3
+ /**
4
+ * Parent response type for a sorted set get score request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Hit}
9
+ * - {Miss}
10
+ * - {Error}
11
+ *
12
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
13
+ * @example
14
+ * For example:
15
+ * ```
16
+ * if (response instanceof CacheSortedSetGetScore.Error) {
17
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
+ * // `CacheSortedSetGetScore.Error` in this block, so you will have access to the properties
19
+ * // of the Error class; e.g. `response.errorCode()`.
20
+ * }
21
+ * ```
22
+ */
23
+ export declare abstract class Response extends ResponseBase {
24
+ }
25
+ declare class _Hit extends Response {
26
+ private readonly _value;
27
+ private readonly _score;
28
+ constructor(score: number, value: Uint8Array);
29
+ /**
30
+ * Returns the value of the element in the sorted set as a Uint8Array.
31
+ * @returns {number}
32
+ */
33
+ valueUint8Array(): Uint8Array;
34
+ /**
35
+ * Returns the score of the element in the sorted set as a string.
36
+ * @returns {string}
37
+ */
38
+ valueString(): string;
39
+ /**
40
+ *
41
+ *
42
+ * @return {*} {number}
43
+ * @memberof _Hit
44
+ */
45
+ score(): number;
46
+ toString(): string;
47
+ }
48
+ declare const Hit_base: {
49
+ new (...args: any[]): {};
50
+ } & typeof _Hit;
51
+ /**
52
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
53
+ * `score()` accessor to retrieve score.
54
+ */
55
+ export declare class Hit extends Hit_base {
56
+ }
57
+ declare class _Miss extends Response {
58
+ private readonly _value;
59
+ constructor(value: Uint8Array);
60
+ /**
61
+ * Returns the value of the element in the sorted set as a Uint8Array.
62
+ * @returns {number}
63
+ */
64
+ valueUint8Array(): Uint8Array;
65
+ /**
66
+ * Returns the score of the element in the sorted set as a string.
67
+ * @returns {string}
68
+ */
69
+ valueString(): string;
70
+ toString(): string;
71
+ }
72
+ declare const Miss_base: {
73
+ new (...args: any[]): {
74
+ readonly is_miss: boolean;
75
+ };
76
+ } & typeof _Miss;
77
+ /**
78
+ * Indicates that the requested data was not available in the cache.
79
+ */
80
+ export declare class Miss extends Miss_base {
81
+ }
82
+ declare class _Error extends Response {
83
+ protected _innerException: SdkError;
84
+ private readonly _value;
85
+ constructor(_innerException: SdkError, value: Uint8Array);
86
+ /**
87
+ * Returns the value of the element in the sorted set as a Uint8Array.
88
+ * @returns {number}
89
+ */
90
+ valueUint8Array(): Uint8Array;
91
+ /**
92
+ * Returns the score of the element in the sorted set as a string.
93
+ * @returns {string}
94
+ */
95
+ valueString(): string;
96
+ }
97
+ declare const Error_base: {
98
+ new (...args: any[]): {
99
+ _innerException: SdkError;
100
+ message(): string;
101
+ innerException(): SdkError;
102
+ errorCode(): import("../../errors/errors").MomentoErrorCode;
103
+ toString(): string;
104
+ };
105
+ } & typeof _Error;
106
+ /**
107
+ * Indicates that an error occurred during the sorted set get score request.
108
+ *
109
+ * This response object includes the following fields that you can use to determine
110
+ * how you would like to handle the error:
111
+ *
112
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
113
+ * - `message()` - a human-readable description of the error
114
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
115
+ */
116
+ export declare class Error extends Error_base {
117
+ }
118
+ export {};
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Miss = exports.Hit = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a sorted set get score request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Hit}
11
+ * - {Miss}
12
+ * - {Error}
13
+ *
14
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
15
+ * @example
16
+ * For example:
17
+ * ```
18
+ * if (response instanceof CacheSortedSetGetScore.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheSortedSetGetScore.Error` in this block, so you will have access to the properties
21
+ * // of the Error class; e.g. `response.errorCode()`.
22
+ * }
23
+ * ```
24
+ */
25
+ class Response extends response_base_1.ResponseBase {
26
+ }
27
+ exports.Response = Response;
28
+ class _Hit extends Response {
29
+ constructor(score, value) {
30
+ super();
31
+ this._value = value;
32
+ this._score = score;
33
+ }
34
+ /**
35
+ * Returns the value of the element in the sorted set as a Uint8Array.
36
+ * @returns {number}
37
+ */
38
+ valueUint8Array() {
39
+ return this._value;
40
+ }
41
+ /**
42
+ * Returns the score of the element in the sorted set as a string.
43
+ * @returns {string}
44
+ */
45
+ valueString() {
46
+ return new TextDecoder().decode(this._value);
47
+ }
48
+ /**
49
+ *
50
+ *
51
+ * @return {*} {number}
52
+ * @memberof _Hit
53
+ */
54
+ score() {
55
+ return this._score;
56
+ }
57
+ toString() {
58
+ return `${super.toString()}: value: ${this.valueString()}, score: ${this.score()}`;
59
+ }
60
+ }
61
+ /**
62
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
63
+ * `score()` accessor to retrieve score.
64
+ */
65
+ class Hit extends (0, response_base_1.ResponseHit)(_Hit) {
66
+ }
67
+ exports.Hit = Hit;
68
+ class _Miss extends Response {
69
+ constructor(value) {
70
+ super();
71
+ this._value = value;
72
+ }
73
+ /**
74
+ * Returns the value of the element in the sorted set as a Uint8Array.
75
+ * @returns {number}
76
+ */
77
+ valueUint8Array() {
78
+ return this._value;
79
+ }
80
+ /**
81
+ * Returns the score of the element in the sorted set as a string.
82
+ * @returns {string}
83
+ */
84
+ valueString() {
85
+ return new TextDecoder().decode(this._value);
86
+ }
87
+ toString() {
88
+ return `${super.toString()}: value: ${this.valueString()}`;
89
+ }
90
+ }
91
+ /**
92
+ * Indicates that the requested data was not available in the cache.
93
+ */
94
+ class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
95
+ }
96
+ exports.Miss = Miss;
97
+ class _Error extends Response {
98
+ constructor(_innerException, value) {
99
+ super();
100
+ this._innerException = _innerException;
101
+ this._value = value;
102
+ }
103
+ /**
104
+ * Returns the value of the element in the sorted set as a Uint8Array.
105
+ * @returns {number}
106
+ */
107
+ valueUint8Array() {
108
+ return this._value;
109
+ }
110
+ /**
111
+ * Returns the score of the element in the sorted set as a string.
112
+ * @returns {string}
113
+ */
114
+ valueString() {
115
+ return new TextDecoder().decode(this._value);
116
+ }
117
+ }
118
+ /**
119
+ * Indicates that an error occurred during the sorted set get score request.
120
+ *
121
+ * This response object includes the following fields that you can use to determine
122
+ * how you would like to handle the error:
123
+ *
124
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
125
+ * - `message()` - a human-readable description of the error
126
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
127
+ */
128
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
129
+ }
130
+ exports.Error = Error;
131
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc29ydGVkLXNldC1nZXQtc2NvcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWVzc2FnZXMvcmVzcG9uc2VzL2NhY2hlLXNvcnRlZC1zZXQtZ2V0LXNjb3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1EQUt5QjtBQUd6Qjs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW1CRztBQUNILE1BQXNCLFFBQVMsU0FBUSw0QkFBWTtDQUFHO0FBQXRELDRCQUFzRDtBQUV0RCxNQUFNLElBQUssU0FBUSxRQUFRO0lBSXpCLFlBQVksS0FBYSxFQUFFLEtBQWlCO1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c2Ugb2JqZWN0IGluY2x1ZGVzIHRoZSBmb2xsb3dpbmcgZmllbGRzIHRoYXQgeW91IGNhbiB1c2UgdG8gZGV0ZXJtaW5lXG4gKiBob3cgeW91IHdvdWxkIGxpa2UgdG8gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
@@ -0,0 +1,109 @@
1
+ import { SdkError } from '../../errors/errors';
2
+ import { ResponseBase } from './response-base';
3
+ import * as CacheSortedSetGetScoreResponse from './cache-sorted-set-get-score';
4
+ import { _SortedSetGetScoreResponsePart } from './grpc-response-types';
5
+ type CacheSortedSetGetScoreResponseType = CacheSortedSetGetScoreResponse.Hit | CacheSortedSetGetScoreResponse.Miss | CacheSortedSetGetScoreResponse.Error;
6
+ /**
7
+ * Parent response type for a sorted set get scores request. The
8
+ * response object is resolved to a type-safe object of one of
9
+ * the following subtypes:
10
+ *
11
+ * - {Hit}
12
+ * - {Miss}
13
+ * - {Error}
14
+ *
15
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
16
+ * @example
17
+ * For example:
18
+ * ```
19
+ * if (response instanceof CacheSortedSetGetScores.Error) {
20
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
21
+ * // `CacheSortedSetGetScores.Error` in this block, so you will have access to the properties
22
+ * // of the Error class; e.g. `response.errorCode()`.
23
+ * }
24
+ * ```
25
+ */
26
+ export declare abstract class Response extends ResponseBase {
27
+ }
28
+ declare class _Hit extends Response {
29
+ _responses: CacheSortedSetGetScoreResponseType[];
30
+ constructor(scores: _SortedSetGetScoreResponsePart[], values: Uint8Array[]);
31
+ responses(): CacheSortedSetGetScoreResponseType[];
32
+ /**
33
+ * Returns the data as a Map whose keys are byte arrays and values numbers.
34
+ * @returns {Map<Uint8Array, number>}
35
+ */
36
+ valueMapUint8Array(): Map<Uint8Array, number>;
37
+ /**
38
+ * Returns the data as a Map whose keys are utf-8 strings, decoded from the underlying byte arrays and values are numbers.
39
+ * @returns {Map<string, number>}
40
+ */
41
+ valueMapString(): Map<string, number>;
42
+ /**
43
+ * Returns the data as a Map whose keys and values are utf-8 strings, decoded from the underlying byte arrays.
44
+ * This is a convenience alias for {valueMapStringString}.
45
+ * @returns {Map<string, number>}
46
+ */
47
+ valueMap(): Map<string, number>;
48
+ /**
49
+ * Returns the data as a Record whose keys and values are utf-8 strings, decoded from the underlying byte arrays.
50
+ * This can be used in most places where an Object is desired.
51
+ * @returns {Record<string, number>}
52
+ */
53
+ valueRecordString(): Record<string, number>;
54
+ /**
55
+ * Returns the data as a Record whose keys and values are utf-8 strings, decoded from the underlying byte arrays.
56
+ * This can be used in most places where an Object is desired. This is a convenience alias for
57
+ * {valueRecordStringString}.
58
+ * @returns {Record<string, number>}
59
+ */
60
+ valueRecord(): Record<string, number>;
61
+ toString(): string;
62
+ }
63
+ declare const Hit_base: {
64
+ new (...args: any[]): {};
65
+ } & typeof _Hit;
66
+ /**
67
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
68
+ * `value*` accessors to retrieve the data in the appropriate format.
69
+ */
70
+ export declare class Hit extends Hit_base {
71
+ }
72
+ declare class _Miss extends Response {
73
+ }
74
+ declare const Miss_base: {
75
+ new (...args: any[]): {
76
+ readonly is_miss: boolean;
77
+ };
78
+ } & typeof _Miss;
79
+ /**
80
+ * Indicates that the requested data was not available in the cache.
81
+ */
82
+ export declare class Miss extends Miss_base {
83
+ }
84
+ declare class _Error extends Response {
85
+ _innerException: SdkError;
86
+ constructor(_innerException: SdkError);
87
+ }
88
+ declare const Error_base: {
89
+ new (...args: any[]): {
90
+ _innerException: SdkError;
91
+ message(): string;
92
+ innerException(): SdkError;
93
+ errorCode(): import("../../errors/errors").MomentoErrorCode;
94
+ toString(): string;
95
+ };
96
+ } & typeof _Error;
97
+ /**
98
+ * Indicates that an error occurred during the dictionary get fields request.
99
+ *
100
+ * This response object includes the following fields that you can use to determine
101
+ * how you would like to handle the error:
102
+ *
103
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
104
+ * - `message()` - a human-readable description of the error
105
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
106
+ */
107
+ export declare class Error extends Error_base {
108
+ }
109
+ export {};