@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,27 @@
1
+ /**
2
+ * Represents the data received from a topic subscription.
3
+ *
4
+ * @remarks A subscription is created by calling {@link TopicClient.subscribe}.
5
+ * The value is guaranteed to be either a {@link string} or a {@link Uint8Array}.
6
+ * Call the appropriate accessor if you know the type of the value.
7
+ */
8
+ export declare class TopicItem {
9
+ private readonly _value;
10
+ constructor(_value: string | Uint8Array);
11
+ /**
12
+ * Returns the data read from the stream.
13
+ * @returns string | Uint8Array
14
+ */
15
+ value(): string | Uint8Array;
16
+ /**
17
+ * Returns the data read from the stream as a {@link string}.
18
+ * @returns string
19
+ */
20
+ valueString(): string;
21
+ /**
22
+ * Returns the data read from the stream as a {@link Uint8Array}.
23
+ * @returns Uint8Array
24
+ */
25
+ valueUint8Array(): Uint8Array;
26
+ toString(): string;
27
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TopicItem = void 0;
4
+ const display_1 = require("../../internal/utils/display");
5
+ /**
6
+ * Represents the data received from a topic subscription.
7
+ *
8
+ * @remarks A subscription is created by calling {@link TopicClient.subscribe}.
9
+ * The value is guaranteed to be either a {@link string} or a {@link Uint8Array}.
10
+ * Call the appropriate accessor if you know the type of the value.
11
+ */
12
+ class TopicItem {
13
+ constructor(_value) {
14
+ this._value = _value;
15
+ }
16
+ /**
17
+ * Returns the data read from the stream.
18
+ * @returns string | Uint8Array
19
+ */
20
+ value() {
21
+ return this._value;
22
+ }
23
+ /**
24
+ * Returns the data read from the stream as a {@link string}.
25
+ * @returns string
26
+ */
27
+ valueString() {
28
+ return this.value().toString();
29
+ }
30
+ /**
31
+ * Returns the data read from the stream as a {@link Uint8Array}.
32
+ * @returns Uint8Array
33
+ */
34
+ valueUint8Array() {
35
+ return this.value();
36
+ }
37
+ toString() {
38
+ const display = (0, display_1.truncateString)(this.value().toString());
39
+ return `${this.constructor.name}: ${display}`;
40
+ }
41
+ }
42
+ exports.TopicItem = TopicItem;
43
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWMtaXRlbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvdG9waWMtaXRlbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwREF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aW5nIHtcbiAgICBjb25zdCBkaXNwbGF5ID0gdHJ1bmNhdGVTdHJpbmcodGhpcy52YWx1ZSgpLnRvU3RyaW5nKCkpO1xuICAgIHJldHVybiBgJHt0aGlzLmNvbnN0cnVjdG9yLm5hbWV9OiAke2Rpc3BsYXl9YDtcbiAgfVxufVxuIl19
@@ -0,0 +1,61 @@
1
+ import { SdkError } from '../../errors/errors';
2
+ import { ResponseBase } from './response-base';
3
+ /**
4
+ * Parent response type for a topic publish request. The
5
+ * response object is resolved to a type-safe object of one of
6
+ * the following subtypes:
7
+ *
8
+ * - {Success}
9
+ * - {Error}
10
+ *
11
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
12
+ * @example
13
+ * For example:
14
+ * ```
15
+ * if (response instanceof TopicPublish.Error) {
16
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
17
+ * // `TopicPublish.Error` in this block, so you will have access to the properties
18
+ * // of the Error class; e.g. `response.errorCode()`.
19
+ * }
20
+ * ```
21
+ */
22
+ export declare abstract class Response extends ResponseBase {
23
+ }
24
+ declare class _Success extends Response {
25
+ }
26
+ declare const Success_base: {
27
+ new (...args: any[]): {
28
+ readonly is_success: boolean;
29
+ };
30
+ } & typeof _Success;
31
+ /**
32
+ * Indicates a Successful cache set request.
33
+ */
34
+ export declare class Success extends Success_base {
35
+ }
36
+ declare class _Error extends Response {
37
+ protected _innerException: SdkError;
38
+ constructor(_innerException: SdkError);
39
+ }
40
+ declare const Error_base: {
41
+ new (...args: any[]): {
42
+ _innerException: SdkError;
43
+ message(): string;
44
+ innerException(): SdkError;
45
+ errorCode(): import("../../errors/errors").MomentoErrorCode;
46
+ toString(): string;
47
+ };
48
+ } & typeof _Error;
49
+ /**
50
+ * Indicates that an error occurred during the cache set request.
51
+ *
52
+ * This response object includes the following fields that you can use to determine
53
+ * how you would like to handle the error:
54
+ *
55
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
56
+ * - `message()` - a human-readable description of the error
57
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
58
+ */
59
+ export declare class Error extends Error_base {
60
+ }
61
+ export {};
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Success = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a topic publish request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Success}
11
+ * - {Error}
12
+ *
13
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
14
+ * @example
15
+ * For example:
16
+ * ```
17
+ * if (response instanceof TopicPublish.Error) {
18
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
19
+ * // `TopicPublish.Error` in this block, so you will have access to the properties
20
+ * // of the Error class; e.g. `response.errorCode()`.
21
+ * }
22
+ * ```
23
+ */
24
+ class Response extends response_base_1.ResponseBase {
25
+ }
26
+ exports.Response = Response;
27
+ class _Success extends Response {
28
+ }
29
+ /**
30
+ * Indicates a Successful cache set request.
31
+ */
32
+ class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
33
+ }
34
+ exports.Success = Success;
35
+ class _Error extends Response {
36
+ constructor(_innerException) {
37
+ super();
38
+ this._innerException = _innerException;
39
+ }
40
+ }
41
+ /**
42
+ * Indicates that an error occurred during the cache set request.
43
+ *
44
+ * This response object includes the following fields that you can use to determine
45
+ * how you would like to handle the error:
46
+ *
47
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
48
+ * - `message()` - a human-readable description of the error
49
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
50
+ */
51
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
52
+ }
53
+ exports.Error = Error;
54
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWMtcHVibGlzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWd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GNhY2hlIHNldCByZXF1ZXN0LlxuICpcbiAqIFRoaXMgcmVzcG9uc2Ugb2JqZWN0IGluY2x1ZGVzIHRoZSBmb2xsb3dpbmcgZmllbGRzIHRoYXQgeW91IGNhbiB1c2UgdG8gZGV0ZXJtaW5lXG4gKiBob3cgeW91IHdvdWxkIGxpa2UgdG8gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
@@ -0,0 +1,69 @@
1
+ import { SdkError } from '../../errors/errors';
2
+ import { ResponseBase } from './response-base';
3
+ import { SubscriptionState } from '../../internal/subscription-state';
4
+ /**
5
+ * Parent response type for a cache get request. The
6
+ * response object is resolved to a type-safe object of one of
7
+ * the following subtypes:
8
+ *
9
+ * - {Subscription}
10
+ * - {Item}
11
+ * - {Error}
12
+ *
13
+ * `instanceof` type guards can be used to operate on the appropriate subtype.
14
+ * @example
15
+ * For example:
16
+ * ```
17
+ * if (response instanceof TopicSubscribe.Error) {
18
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
19
+ * // `CacheGet.Error` in this block, so you will have access to the properties
20
+ * // of the Error class; e.g. `response.errorCode()`.
21
+ * }
22
+ * ```
23
+ */
24
+ export declare abstract class Response extends ResponseBase {
25
+ }
26
+ /**
27
+ * Encapsulates a topic subscription.
28
+ *
29
+ * @remarks Currently allows unsubscribing from the topic.
30
+ * In the future, this may be extended to include additional
31
+ * statistics about the subscription.
32
+ */
33
+ export declare class Subscription extends Response {
34
+ private subscriptionState;
35
+ constructor(subscriptionState: SubscriptionState);
36
+ /**
37
+ * Unsubscribes from the topic.
38
+ *
39
+ * @returns void
40
+ */
41
+ unsubscribe(): void;
42
+ get isSubscribed(): boolean;
43
+ }
44
+ declare class _Error extends Response {
45
+ protected _innerException: SdkError;
46
+ constructor(_innerException: SdkError);
47
+ }
48
+ declare const Error_base: {
49
+ new (...args: any[]): {
50
+ _innerException: SdkError;
51
+ message(): string;
52
+ innerException(): SdkError;
53
+ errorCode(): import("../../errors/errors").MomentoErrorCode;
54
+ toString(): string;
55
+ };
56
+ } & typeof _Error;
57
+ /**
58
+ * Indicates that an error occurred during the topic subscribe request.
59
+ *
60
+ * This response object includes the following fields that you can use to determine
61
+ * how you would like to handle the error:
62
+ *
63
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
64
+ * - `message()` - a human-readable description of the error
65
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
66
+ */
67
+ export declare class Error extends Error_base {
68
+ }
69
+ export {};
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Error = exports.Subscription = exports.Response = void 0;
4
+ const response_base_1 = require("./response-base");
5
+ /**
6
+ * Parent response type for a cache get request. The
7
+ * response object is resolved to a type-safe object of one of
8
+ * the following subtypes:
9
+ *
10
+ * - {Subscription}
11
+ * - {Item}
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 TopicSubscribe.Error) {
19
+ * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
+ * // `CacheGet.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
+ /**
29
+ * Encapsulates a topic subscription.
30
+ *
31
+ * @remarks Currently allows unsubscribing from the topic.
32
+ * In the future, this may be extended to include additional
33
+ * statistics about the subscription.
34
+ */
35
+ class Subscription extends Response {
36
+ constructor(subscriptionState) {
37
+ super();
38
+ this.subscriptionState = subscriptionState;
39
+ }
40
+ /**
41
+ * Unsubscribes from the topic.
42
+ *
43
+ * @returns void
44
+ */
45
+ unsubscribe() {
46
+ this.subscriptionState.unsubscribe();
47
+ }
48
+ get isSubscribed() {
49
+ return this.subscriptionState.isSubscribed;
50
+ }
51
+ }
52
+ exports.Subscription = Subscription;
53
+ class _Error extends Response {
54
+ constructor(_innerException) {
55
+ super();
56
+ this._innerException = _innerException;
57
+ }
58
+ }
59
+ /**
60
+ * Indicates that an error occurred during the topic subscribe request.
61
+ *
62
+ * This response object includes the following fields that you can use to determine
63
+ * how you would like to handle the error:
64
+ *
65
+ * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
66
+ * - `message()` - a human-readable description of the error
67
+ * - `innerException()` - the original error that caused the failure; can be re-thrown.
68
+ */
69
+ class Error extends (0, response_base_1.ResponseError)(_Error) {
70
+ }
71
+ exports.Error = Error;
72
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWMtc3Vic2NyaWJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy90b3BpYy1zdWJzY3JpYmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsbURBQTREO0FBRzVEOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHO0FBQ0gsTUFBc0IsUUFBUyxTQUFRLDRCQUFZO0NBQUc7QUFBdEQsNEJBQXNEO0FBRXREOzs7Ozs7R0FNRztBQUNILE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kcyB0aGF0IHlvdSBjYW4gdXNlIHRvIGRldGVybWluZVxuICogaG93IHlvdSB3b3VsZCBsaWtlIHRvIGhhbmRsZSB0aGUgZXJyb3I6XG4gKlxuICogLSBgZXJyb3JDb2RlKClgIC0gYSB1bmlxdWUgTW9tZW50byBlcnJvciBjb2RlIGluZGljYXRpbmcgdGhlIHR5cGUgb2YgZXJyb3IgdGhhdCBvY2N1cnJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIFJlc3BvbnNlRXJyb3IoX0Vycm9yKSB7fVxuIl19
@@ -0,0 +1,9 @@
1
+ export declare class SigningKey {
2
+ private readonly keyId;
3
+ private readonly expiresAt;
4
+ private readonly endpoint;
5
+ constructor(keyId: string, expiresAt: Date, endpoint: string);
6
+ getKeyId(): string;
7
+ getExpiresAt(): Date;
8
+ getEndpoint(): string;
9
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SigningKey = void 0;
4
+ class SigningKey {
5
+ constructor(keyId, expiresAt, endpoint) {
6
+ this.keyId = keyId;
7
+ this.expiresAt = expiresAt;
8
+ this.endpoint = endpoint;
9
+ }
10
+ getKeyId() {
11
+ return this.keyId;
12
+ }
13
+ getExpiresAt() {
14
+ return this.expiresAt;
15
+ }
16
+ getEndpoint() {
17
+ return this.endpoint;
18
+ }
19
+ }
20
+ exports.SigningKey = SigningKey;
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmluZy1rZXkuanMiLCJzb3VyY2VSb290I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ljIGdldEV4cGlyZXNBdCgpIHtcbiAgICByZXR1cm4gdGhpcy5leHBpcmVzQXQ7XG4gIH1cblxuICBwdWJsaWMgZ2V0RW5kcG9pbnQoKSB7XG4gICAgcmV0dXJuIHRoaXMuZW5kcG9pbnQ7XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,99 @@
1
+ import { CollectionTtl } from './collection-ttl';
2
+ export interface ScalarCallOptions {
3
+ /**
4
+ * The time to live in seconds of the object being modified.
5
+ */
6
+ ttl?: number;
7
+ }
8
+ export interface CollectionCallOptions {
9
+ /**
10
+ * The length of the TTL and whether it should be refreshed when the collection is modified.
11
+ */
12
+ ttl?: CollectionTtl;
13
+ }
14
+ export interface FrontTruncatableCallOptions extends CollectionCallOptions {
15
+ /**
16
+ * If the collection exceeds this length, remove excess from the start of the list. Must be positive.
17
+ */
18
+ truncateFrontToSize?: number;
19
+ }
20
+ export interface BackTruncatableCallOptions extends CollectionCallOptions {
21
+ /**
22
+ * If the collection exceeds this length, remove excess from the end of the list. Must be positive.
23
+ */
24
+ truncateBackToSize?: number;
25
+ }
26
+ export declare enum SortedSetOrder {
27
+ Ascending = "ASC",
28
+ Descending = "DESC"
29
+ }
30
+ export interface SortedSetFetchByRankCallOptions {
31
+ /**
32
+ * The rank of the first element to return, inclusive.
33
+ * If negative, the rank is relative to the end of the list.
34
+ * If the rank is not specified, the first element is used.
35
+ */
36
+ startRank?: number;
37
+ /**
38
+ * The rank of the last element to return, exclusive.
39
+ * If negative, the rank is relative to the end of the list.
40
+ * If the rank is not specified, the range extends to the end of the list.
41
+ */
42
+ endRank?: number;
43
+ /**
44
+ * The order in which to return the elements.
45
+ * If the order is not specified, the elements are returned in ascending order.
46
+ * If descending order is used, the start and end ranks are interpreted as if
47
+ * the list were reversed.
48
+ */
49
+ order?: SortedSetOrder;
50
+ }
51
+ export interface SortedSetFetchByScoreCallOptions {
52
+ /**
53
+ * The minimum score of the elements to return, inclusive.
54
+ * If the minimum score is not specified, the range extends to the lowest score.
55
+ */
56
+ minScore?: number;
57
+ /**
58
+ * The maximum score of the elements to return, inclusive.
59
+ * If the maximum score is not specified, the range extends to the highest score.
60
+ */
61
+ maxScore?: number;
62
+ /**
63
+ * The order in which to return the elements.
64
+ * If the order is not specified, the elements are returned in ascending order.
65
+ */
66
+ order?: SortedSetOrder;
67
+ /**
68
+ * The index offset of the first element to return, relative to the first element in the result set.
69
+ * If specified must be non-negative (>= 0).
70
+ * Defaults to zero, ie. the start at first element in the result set.
71
+ */
72
+ offset?: number;
73
+ /**
74
+ * The maximum number of elements to return.
75
+ * If specified must be strictly positive (> 0).
76
+ * Defaults to all elements in the result set.
77
+ */
78
+ count?: number;
79
+ }
80
+ export interface ListRetainCallOptions extends CollectionCallOptions {
81
+ /**
82
+ * Starting inclusive index of operation.
83
+ */
84
+ startIndex?: number;
85
+ /**
86
+ * Ending exclusive index of operation.
87
+ */
88
+ endIndex?: number;
89
+ }
90
+ export interface ListFetchCallOptions {
91
+ /**
92
+ * Starting inclusive index of operation.
93
+ */
94
+ startIndex?: number;
95
+ /**
96
+ * Ending exclusive index of operation.
97
+ */
98
+ endIndex?: number;
99
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SortedSetOrder = void 0;
4
+ var SortedSetOrder;
5
+ (function (SortedSetOrder) {
6
+ SortedSetOrder["Ascending"] = "ASC";
7
+ SortedSetOrder["Descending"] = "DESC";
8
+ })(SortedSetOrder = exports.SortedSetOrder || (exports.SortedSetOrder = {}));
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtY2FsbC1vcHRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL2NhY2hlLWNhbGwtb3B0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUE4QkEsSUFBWSxjQUdYO0FB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XG4gIC8qKlxuICAgKiBFbmRpbmcgZXhjbHVzaXZlIGluZGV4IG9mIG9wZXJhdGlvbi5cbiAgICovXG4gIGVuZEluZGV4PzogbnVtYmVyO1xufVxuIl19
@@ -0,0 +1,78 @@
1
+ /** Represents the desired behavior for managing the TTL on collection
2
+ * objects (dictionaries, lists, sets) in your cache.
3
+ *
4
+ * For cache operations that modify a collection, there are a few things
5
+ * to consider. The first time the collection is created, we need to
6
+ * set a TTL on it. For subsequent operations that modify the collection
7
+ * you may choose to update the TTL in order to prolong the life of the
8
+ * cached collection object, or you may choose to leave the TTL unmodified
9
+ * in order to ensure that the collection expires at the original TTL.
10
+ *
11
+ * The default behavior is to refresh the TTL (to prolong the life of the
12
+ * collection) each time it is written. This behavior can be modified
13
+ * by calling CollectionTtl.withNoRefreshTtlOnUpdates().
14
+ *
15
+ * A null TTL means to use the client's TTL.
16
+ */
17
+ export declare class CollectionTtl {
18
+ private readonly _ttlSeconds;
19
+ private readonly _refreshTtl;
20
+ /**
21
+ * If refreshTtl is true, the client must update the collection's TTL
22
+ * when it modifies a collection.
23
+ * A null ttl means to use the client's TTL.
24
+ * @param {number | null} [ttlSeconds=null]
25
+ * @param {boolean} [refreshTtl=true]
26
+ */
27
+ constructor(ttlSeconds?: number | null, refreshTtl?: boolean);
28
+ /** Time-to-live, in seconds.
29
+ * @returns {number | null}
30
+ */
31
+ ttlSeconds(): number | null;
32
+ /** Time-to-live, in milliseconds.
33
+ * @returns {number | null}
34
+ */
35
+ ttlMilliseconds(): number | null;
36
+ /** Whether or not to refresh a collection's TTL when it's modified.
37
+ * @returns {boolean}
38
+ */
39
+ refreshTtl(): boolean;
40
+ /** The default way to handle TTLs for collections. The client's default TTL
41
+ * will be used, and the TTL for the collection will be refreshed any
42
+ * time the collection is modified.
43
+ * @constructor
44
+ * @returns {CollectionTtl}
45
+ */
46
+ static fromCacheTtl(): CollectionTtl;
47
+ /** Constructs a CollectionTtl with the specified TTL. The TTL
48
+ * for the collection will be refreshed any time the collection is
49
+ * modified.
50
+ * @constructor
51
+ * @param {number} [ttlSeconds]
52
+ * @returns {CollectionTtl}
53
+ */
54
+ static of(ttlSeconds: number): CollectionTtl;
55
+ /** Constructs a CollectionTtl with the specified TTL.
56
+ * Will only refresh if the TTL is provided.
57
+ * @constructor
58
+ * @param {number | null} [ttlSeconds=null]
59
+ * @returns {CollectionTtl}
60
+ */
61
+ static refreshTtlIfProvided(ttlSeconds?: number | null): CollectionTtl;
62
+ /** Copies the CollectionTtl, but it will refresh the TTL when
63
+ * the collection is modified.
64
+ * @returns {CollectionTtl}
65
+ */
66
+ withRefreshTtlOnUpdates(): CollectionTtl;
67
+ /** Copies the CollectionTTL, but the TTL will not be refreshed
68
+ * when the collection is modified. Use this if you want to ensure
69
+ * that your collection expires at the originally specified time, even
70
+ * if you make modifications to the value of the collection.
71
+ * @returns {CollectionTtl}
72
+ */
73
+ withNoRefreshTtlOnUpdates(): CollectionTtl;
74
+ /** A string represenation of the CollectionTtl for debugging purposes.
75
+ * @return {CollectionTtl}
76
+ */
77
+ toString(): string;
78
+ }