@gomomento/sdk-core 1.87.0 → 1.89.0

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 (179) hide show
  1. package/dist/src/clients/ICacheClient.d.ts +2 -2
  2. package/dist/src/clients/ICacheClient.js +1 -1
  3. package/dist/src/clients/IMomentoCache.d.ts +2 -2
  4. package/dist/src/clients/IMomentoCache.js +1 -1
  5. package/dist/src/errors/errors.js +1 -1
  6. package/dist/src/internal/clients/cache/IDataClient.d.ts +2 -2
  7. package/dist/src/internal/clients/cache/IDataClient.js +1 -1
  8. package/dist/src/messages/responses/cache-batch-get.d.ts +18 -51
  9. package/dist/src/messages/responses/cache-batch-get.js +23 -56
  10. package/dist/src/messages/responses/cache-batch-set.d.ts +14 -48
  11. package/dist/src/messages/responses/cache-batch-set.js +12 -42
  12. package/dist/src/messages/responses/cache-delete.d.ts +11 -44
  13. package/dist/src/messages/responses/cache-delete.js +14 -35
  14. package/dist/src/messages/responses/cache-dictionary-fetch.d.ts +5 -5
  15. package/dist/src/messages/responses/cache-dictionary-fetch.js +4 -4
  16. package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +5 -5
  17. package/dist/src/messages/responses/cache-dictionary-get-field.js +4 -4
  18. package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +5 -5
  19. package/dist/src/messages/responses/cache-dictionary-get-fields.js +4 -4
  20. package/dist/src/messages/responses/cache-dictionary-increment.d.ts +14 -46
  21. package/dist/src/messages/responses/cache-dictionary-increment.js +14 -41
  22. package/dist/src/messages/responses/cache-dictionary-length.d.ts +19 -53
  23. package/dist/src/messages/responses/cache-dictionary-length.js +26 -40
  24. package/dist/src/messages/responses/cache-dictionary-remove-field.d.ts +10 -43
  25. package/dist/src/messages/responses/cache-dictionary-remove-field.js +13 -34
  26. package/dist/src/messages/responses/cache-dictionary-remove-fields.d.ts +10 -43
  27. package/dist/src/messages/responses/cache-dictionary-remove-fields.js +13 -34
  28. package/dist/src/messages/responses/cache-dictionary-set-field.d.ts +10 -43
  29. package/dist/src/messages/responses/cache-dictionary-set-field.js +13 -34
  30. package/dist/src/messages/responses/cache-dictionary-set-fields.d.ts +10 -43
  31. package/dist/src/messages/responses/cache-dictionary-set-fields.js +13 -34
  32. package/dist/src/messages/responses/cache-flush.d.ts +12 -45
  33. package/dist/src/messages/responses/cache-flush.js +15 -36
  34. package/dist/src/messages/responses/cache-get.d.ts +1 -1
  35. package/dist/src/messages/responses/cache-get.js +1 -1
  36. package/dist/src/messages/responses/cache-increment.d.ts +24 -51
  37. package/dist/src/messages/responses/cache-increment.js +27 -49
  38. package/dist/src/messages/responses/cache-item-get-ttl.d.ts +22 -55
  39. package/dist/src/messages/responses/cache-item-get-ttl.js +27 -41
  40. package/dist/src/messages/responses/cache-item-get-type.d.ts +22 -55
  41. package/dist/src/messages/responses/cache-item-get-type.js +27 -41
  42. package/dist/src/messages/responses/cache-key-exists.d.ts +16 -47
  43. package/dist/src/messages/responses/cache-key-exists.js +17 -38
  44. package/dist/src/messages/responses/cache-keys-exist.d.ts +16 -47
  45. package/dist/src/messages/responses/cache-keys-exist.js +16 -37
  46. package/dist/src/messages/responses/cache-list-concatenate-back.d.ts +13 -56
  47. package/dist/src/messages/responses/cache-list-concatenate-back.js +13 -37
  48. package/dist/src/messages/responses/cache-list-concatenate-front.d.ts +13 -46
  49. package/dist/src/messages/responses/cache-list-concatenate-front.js +13 -37
  50. package/dist/src/messages/responses/cache-list-fetch.d.ts +23 -58
  51. package/dist/src/messages/responses/cache-list-fetch.js +26 -49
  52. package/dist/src/messages/responses/cache-list-length.d.ts +27 -66
  53. package/dist/src/messages/responses/cache-list-length.js +32 -42
  54. package/dist/src/messages/responses/cache-list-pop-back.d.ts +22 -57
  55. package/dist/src/messages/responses/cache-list-pop-back.js +25 -48
  56. package/dist/src/messages/responses/cache-list-pop-front.d.ts +22 -57
  57. package/dist/src/messages/responses/cache-list-pop-front.js +25 -48
  58. package/dist/src/messages/responses/cache-list-push-back.d.ts +13 -46
  59. package/dist/src/messages/responses/cache-list-push-back.js +13 -37
  60. package/dist/src/messages/responses/cache-list-push-front.d.ts +13 -46
  61. package/dist/src/messages/responses/cache-list-push-front.js +13 -37
  62. package/dist/src/messages/responses/cache-list-remove-value.d.ts +11 -44
  63. package/dist/src/messages/responses/cache-list-remove-value.js +14 -35
  64. package/dist/src/messages/responses/cache-list-retain.d.ts +11 -44
  65. package/dist/src/messages/responses/cache-list-retain.js +14 -35
  66. package/dist/src/messages/responses/cache-set-add-element.d.ts +10 -43
  67. package/dist/src/messages/responses/cache-set-add-element.js +13 -34
  68. package/dist/src/messages/responses/cache-set-add-elements.d.ts +12 -45
  69. package/dist/src/messages/responses/cache-set-add-elements.js +17 -38
  70. package/dist/src/messages/responses/cache-set-fetch.d.ts +18 -54
  71. package/dist/src/messages/responses/cache-set-fetch.js +23 -46
  72. package/dist/src/messages/responses/cache-set-if-absent-or-equal.d.ts +15 -55
  73. package/dist/src/messages/responses/cache-set-if-absent-or-equal.js +21 -41
  74. package/dist/src/messages/responses/cache-set-if-absent.d.ts +14 -54
  75. package/dist/src/messages/responses/cache-set-if-absent.js +20 -40
  76. package/dist/src/messages/responses/cache-set-if-equal.d.ts +15 -55
  77. package/dist/src/messages/responses/cache-set-if-equal.js +21 -41
  78. package/dist/src/messages/responses/cache-set-if-not-equal.d.ts +15 -55
  79. package/dist/src/messages/responses/cache-set-if-not-equal.js +21 -41
  80. package/dist/src/messages/responses/cache-set-if-not-exists.d.ts +14 -54
  81. package/dist/src/messages/responses/cache-set-if-not-exists.js +20 -40
  82. package/dist/src/messages/responses/cache-set-if-present-and-not-equal.d.ts +15 -55
  83. package/dist/src/messages/responses/cache-set-if-present-and-not-equal.js +21 -41
  84. package/dist/src/messages/responses/cache-set-if-present.d.ts +15 -55
  85. package/dist/src/messages/responses/cache-set-if-present.js +21 -41
  86. package/dist/src/messages/responses/cache-set-remove-element.d.ts +10 -43
  87. package/dist/src/messages/responses/cache-set-remove-element.js +13 -34
  88. package/dist/src/messages/responses/cache-set-remove-elements.d.ts +13 -46
  89. package/dist/src/messages/responses/cache-set-remove-elements.js +13 -34
  90. package/dist/src/messages/responses/cache-set-sample.d.ts +18 -54
  91. package/dist/src/messages/responses/cache-set-sample.js +23 -46
  92. package/dist/src/messages/responses/cache-set.d.ts +4 -4
  93. package/dist/src/messages/responses/cache-set.js +3 -3
  94. package/dist/src/messages/responses/cache-sorted-set-fetch.d.ts +19 -55
  95. package/dist/src/messages/responses/cache-sorted-set-fetch.js +23 -46
  96. package/dist/src/messages/responses/cache-sorted-set-get-rank.d.ts +19 -53
  97. package/dist/src/messages/responses/cache-sorted-set-get-rank.js +22 -39
  98. package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +28 -66
  99. package/dist/src/messages/responses/cache-sorted-set-get-score.js +32 -60
  100. package/dist/src/messages/responses/cache-sorted-set-get-scores.d.ts +21 -58
  101. package/dist/src/messages/responses/cache-sorted-set-get-scores.js +29 -52
  102. package/dist/src/messages/responses/cache-sorted-set-increment-score.d.ts +14 -46
  103. package/dist/src/messages/responses/cache-sorted-set-increment-score.js +14 -41
  104. package/dist/src/messages/responses/cache-sorted-set-length-by-score.d.ts +18 -53
  105. package/dist/src/messages/responses/cache-sorted-set-length-by-score.js +23 -40
  106. package/dist/src/messages/responses/cache-sorted-set-length.d.ts +19 -53
  107. package/dist/src/messages/responses/cache-sorted-set-length.js +22 -39
  108. package/dist/src/messages/responses/cache-sorted-set-put-element.d.ts +10 -43
  109. package/dist/src/messages/responses/cache-sorted-set-put-element.js +13 -34
  110. package/dist/src/messages/responses/cache-sorted-set-put-elements.d.ts +10 -43
  111. package/dist/src/messages/responses/cache-sorted-set-put-elements.js +13 -34
  112. package/dist/src/messages/responses/cache-sorted-set-remove-element.d.ts +10 -43
  113. package/dist/src/messages/responses/cache-sorted-set-remove-element.js +13 -34
  114. package/dist/src/messages/responses/cache-sorted-set-remove-elements.d.ts +10 -43
  115. package/dist/src/messages/responses/cache-sorted-set-remove-elements.js +13 -34
  116. package/dist/src/messages/responses/cache-ttl-decrease.d.ts +19 -53
  117. package/dist/src/messages/responses/cache-ttl-decrease.js +29 -39
  118. package/dist/src/messages/responses/cache-ttl-increase.d.ts +19 -53
  119. package/dist/src/messages/responses/cache-ttl-increase.js +29 -39
  120. package/dist/src/messages/responses/cache-ttl-update.d.ts +15 -55
  121. package/dist/src/messages/responses/cache-ttl-update.js +21 -41
  122. package/dist/src/messages/responses/create-cache.d.ts +15 -48
  123. package/dist/src/messages/responses/create-cache.js +21 -39
  124. package/dist/src/messages/responses/delete-cache.d.ts +11 -44
  125. package/dist/src/messages/responses/delete-cache.js +14 -35
  126. package/dist/src/messages/responses/enums/auth/generate-api-key.d.ts +4 -0
  127. package/dist/src/messages/responses/enums/auth/generate-api-key.js +9 -0
  128. package/dist/src/messages/responses/enums/auth/generate-disposable-token.d.ts +4 -0
  129. package/dist/src/messages/responses/enums/auth/generate-disposable-token.js +9 -0
  130. package/dist/src/messages/responses/enums/auth/index.d.ts +3 -0
  131. package/dist/src/messages/responses/enums/auth/index.js +10 -0
  132. package/dist/src/messages/responses/enums/auth/refresh-api-key.d.ts +4 -0
  133. package/dist/src/messages/responses/enums/auth/refresh-api-key.js +9 -0
  134. package/dist/src/messages/responses/enums/cache/control/index.d.ts +17 -0
  135. package/dist/src/messages/responses/enums/cache/control/index.js +25 -0
  136. package/dist/src/messages/responses/enums/cache/dictionary/index.d.ts +40 -0
  137. package/dist/src/messages/responses/enums/cache/dictionary/index.js +53 -0
  138. package/dist/src/messages/responses/enums/cache/index.d.ts +6 -0
  139. package/dist/src/messages/responses/enums/cache/index.js +23 -0
  140. package/dist/src/messages/responses/enums/cache/list/index.d.ts +44 -0
  141. package/dist/src/messages/responses/enums/cache/list/index.js +58 -0
  142. package/dist/src/messages/responses/enums/cache/scalar/index.d.ts +95 -0
  143. package/dist/src/messages/responses/enums/cache/scalar/index.js +122 -0
  144. package/dist/src/messages/responses/enums/cache/set/index.d.ts +26 -0
  145. package/dist/src/messages/responses/enums/cache/set/index.js +36 -0
  146. package/dist/src/messages/responses/enums/cache/sorted-set/index.d.ts +50 -0
  147. package/dist/src/messages/responses/enums/cache/sorted-set/index.js +65 -0
  148. package/dist/src/messages/responses/enums/index.d.ts +4 -24
  149. package/dist/src/messages/responses/enums/index.js +19 -31
  150. package/dist/src/messages/responses/enums/leaderboard/index.d.ts +20 -0
  151. package/dist/src/messages/responses/enums/leaderboard/index.js +29 -0
  152. package/dist/src/messages/responses/enums/topics/index.d.ts +8 -0
  153. package/dist/src/messages/responses/enums/topics/index.js +14 -0
  154. package/dist/src/messages/responses/generate-api-key.d.ts +10 -27
  155. package/dist/src/messages/responses/generate-api-key.js +10 -18
  156. package/dist/src/messages/responses/generate-disposable-token.d.ts +10 -27
  157. package/dist/src/messages/responses/generate-disposable-token.js +10 -18
  158. package/dist/src/messages/responses/leaderboard/leaderboard-delete.d.ts +10 -43
  159. package/dist/src/messages/responses/leaderboard/leaderboard-delete.js +13 -34
  160. package/dist/src/messages/responses/leaderboard/leaderboard-fetch.d.ts +12 -45
  161. package/dist/src/messages/responses/leaderboard/leaderboard-fetch.js +11 -35
  162. package/dist/src/messages/responses/leaderboard/leaderboard-length.d.ts +12 -45
  163. package/dist/src/messages/responses/leaderboard/leaderboard-length.js +11 -35
  164. package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.d.ts +10 -43
  165. package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.js +13 -34
  166. package/dist/src/messages/responses/leaderboard/leaderboard-upsert.d.ts +11 -44
  167. package/dist/src/messages/responses/leaderboard/leaderboard-upsert.js +14 -35
  168. package/dist/src/messages/responses/list-caches.d.ts +13 -46
  169. package/dist/src/messages/responses/list-caches.js +11 -35
  170. package/dist/src/messages/responses/refresh-api-key.d.ts +10 -27
  171. package/dist/src/messages/responses/refresh-api-key.js +10 -18
  172. package/dist/src/messages/responses/response-base.d.ts +6 -0
  173. package/dist/src/messages/responses/response-base.js +9 -2
  174. package/dist/src/messages/responses/topic-publish.d.ts +10 -43
  175. package/dist/src/messages/responses/topic-publish.js +13 -34
  176. package/dist/src/messages/responses/topic-subscribe.d.ts +10 -37
  177. package/dist/src/messages/responses/topic-subscribe.js +10 -33
  178. package/dist/src/messages/responses/webhook/list-webhooks.d.ts +1 -10
  179. package/package.json +1 -1
@@ -1,66 +1,23 @@
1
1
  import { SdkError } from '../../errors';
2
- import { ResponseBase } from './response-base';
3
- /**
4
- * Parent response type for a cache setIfNotExists request. The
5
- * response object is resolved to a type-safe object of one of
6
- * the following subtypes:
7
- *
8
- * - {Stored}
9
- * - {NotStored}
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 CacheSetIfNotExists.Error) {
17
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
- * // `CacheSetIfNotExists.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 _Stored extends Response {
2
+ import { BaseResponseError, ResponseBase } from './response-base';
3
+ import { CacheSetIfNotExistsResponse } from './enums';
4
+ interface IResponse {
5
+ readonly type: CacheSetIfNotExistsResponse;
26
6
  }
27
- declare const Stored_base: {
28
- new (...args: any[]): {
29
- readonly is_success: boolean;
30
- };
31
- } & typeof _Stored;
32
7
  /**
33
8
  * Indicates the key did not exist and the value was set.
34
9
  */
35
- export declare class Stored extends Stored_base {
10
+ export declare class Stored extends ResponseBase implements IResponse {
11
+ readonly type: CacheSetIfNotExistsResponse.Stored;
36
12
  }
37
- declare class _NotStored extends Response {
38
- }
39
- declare const NotStored_base: {
40
- new (...args: any[]): {
41
- readonly is_success: boolean;
42
- };
43
- } & typeof _NotStored;
44
13
  /**
45
- * Indicates the key existed and no value was set.
14
+ * Indicates the key already exists and no value was set.
46
15
  */
47
- export declare class NotStored extends NotStored_base {
48
- }
49
- declare class _Error extends Response {
50
- protected _innerException: SdkError;
51
- constructor(_innerException: SdkError);
16
+ export declare class NotStored extends ResponseBase implements IResponse {
17
+ readonly type: CacheSetIfNotExistsResponse.NotStored;
52
18
  }
53
- declare const Error_base: {
54
- new (...args: any[]): {
55
- _innerException: SdkError;
56
- message(): string;
57
- innerException(): SdkError;
58
- errorCode(): import("../../errors").MomentoErrorCode;
59
- toString(): string;
60
- };
61
- } & typeof _Error;
62
19
  /**
63
- * Indicates that an error occurred during the cache setIfNotExists request.
20
+ * Indicates that an error occurred during the setIfNotExists request.
64
21
  *
65
22
  * This response object includes the following fields that you can use to determine
66
23
  * how you would like to handle the error:
@@ -69,6 +26,9 @@ declare const Error_base: {
69
26
  * - `message()` - a human-readable description of the error
70
27
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
71
28
  */
72
- export declare class Error extends Error_base {
29
+ export declare class Error extends BaseResponseError implements IResponse {
30
+ constructor(_innerException: SdkError);
31
+ readonly type: CacheSetIfNotExistsResponse.Error;
73
32
  }
33
+ export type Response = Stored | NotStored | Error;
74
34
  export {};
@@ -1,54 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Error = exports.NotStored = exports.Stored = exports.Response = void 0;
3
+ exports.Error = exports.NotStored = exports.Stored = void 0;
4
4
  const response_base_1 = require("./response-base");
5
- /**
6
- * Parent response type for a cache setIfNotExists request. The
7
- * response object is resolved to a type-safe object of one of
8
- * the following subtypes:
9
- *
10
- * - {Stored}
11
- * - {NotStored}
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 CacheSetIfNotExists.Error) {
19
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
- * // `CacheSetIfNotExists.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 _Stored extends Response {
29
- }
5
+ const enums_1 = require("./enums");
30
6
  /**
31
7
  * Indicates the key did not exist and the value was set.
32
8
  */
33
- class Stored extends (0, response_base_1.ResponseSuccess)(_Stored) {
9
+ class Stored extends response_base_1.ResponseBase {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.type = enums_1.CacheSetIfNotExistsResponse.Stored;
13
+ }
34
14
  }
35
15
  exports.Stored = Stored;
36
- class _NotStored extends Response {
37
- }
38
16
  /**
39
- * Indicates the key existed and no value was set.
17
+ * Indicates the key already exists and no value was set.
40
18
  */
41
- class NotStored extends (0, response_base_1.ResponseSuccess)(_NotStored) {
42
- }
43
- exports.NotStored = NotStored;
44
- class _Error extends Response {
45
- constructor(_innerException) {
46
- super();
47
- this._innerException = _innerException;
19
+ class NotStored extends response_base_1.ResponseBase {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.type = enums_1.CacheSetIfNotExistsResponse.NotStored;
48
23
  }
49
24
  }
25
+ exports.NotStored = NotStored;
50
26
  /**
51
- * Indicates that an error occurred during the cache setIfNotExists request.
27
+ * Indicates that an error occurred during the setIfNotExists request.
52
28
  *
53
29
  * This response object includes the following fields that you can use to determine
54
30
  * how you would like to handle the error:
@@ -57,7 +33,11 @@ class _Error extends Response {
57
33
  * - `message()` - a human-readable description of the error
58
34
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
59
35
  */
60
- class Error extends (0, response_base_1.ResponseError)(_Error) {
36
+ class Error extends response_base_1.BaseResponseError {
37
+ constructor(_innerException) {
38
+ super(_innerException);
39
+ this.type = enums_1.CacheSetIfNotExistsResponse.Error;
40
+ }
61
41
  }
62
42
  exports.Error = Error;
63
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LWlmLW5vdC1leGlzdHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWVzc2FnZXMvcm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F1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgQmFzZVJlc3BvbnNlRXJyb3IgaW1wbGVtZW50cyBJUmVzcG9uc2Uge1xuICBjb25zdHJ1Y3RvcihfaW5uZXJFeGNlcHRpb246IFNka0Vycm9yKSB7XG4gICAgc3VwZXIoX2lubmVyRXhjZXB0aW9uKTtcbiAgfVxuXG4gIHJlYWRvbmx5IHR5cGU6IENhY2hlU2V0SWZOb3RFeGlzdHNSZXNwb25zZS5FcnJvciA9XG4gICAgQ2FjaGVTZXRJZk5vdEV4aXN0c1Jlc3BvbnNlLkVycm9yO1xufVxuXG5leHBvcnQgdHlwZSBSZXNwb25zZSA9IFN0b3JlZCB8IE5vdFN0b3JlZCB8IEVycm9yO1xuIl19
@@ -1,66 +1,23 @@
1
1
  import { SdkError } from '../../errors';
2
- import { ResponseBase } from './response-base';
3
- /**
4
- * Parent response type for a cache setIfPresentAndNotEqual request. The
5
- * response object is resolved to a type-safe object of one of
6
- * the following subtypes:
7
- *
8
- * - {Stored}
9
- * - {NotStored}
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 CacheSetIfPresentAndNotEqual.Error) {
17
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
- * // `CacheSetIfPresentAndNotEqual.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 _Stored extends Response {
2
+ import { BaseResponseError, ResponseBase } from './response-base';
3
+ import { CacheSetIfPresentAndNotEqualResponse } from './enums';
4
+ interface IResponse {
5
+ readonly type: CacheSetIfPresentAndNotEqualResponse;
26
6
  }
27
- declare const Stored_base: {
28
- new (...args: any[]): {
29
- readonly is_success: boolean;
30
- };
31
- } & typeof _Stored;
32
7
  /**
33
- * Indicates the key did not exist and the value was set.
8
+ * Indicates the new value was set because the key already exists and the existing item was not equal to the supplied `notEqual` value.
34
9
  */
35
- export declare class Stored extends Stored_base {
10
+ export declare class Stored extends ResponseBase implements IResponse {
11
+ readonly type: CacheSetIfPresentAndNotEqualResponse.Stored;
36
12
  }
37
- declare class _NotStored extends Response {
38
- }
39
- declare const NotStored_base: {
40
- new (...args: any[]): {
41
- readonly is_success: boolean;
42
- };
43
- } & typeof _NotStored;
44
13
  /**
45
- * Indicates the key existed and no value was set.
14
+ * Indicates that no value was set because the key did not exist or the existing item was equal to the supplied `notEqual` value.
46
15
  */
47
- export declare class NotStored extends NotStored_base {
48
- }
49
- declare class _Error extends Response {
50
- protected _innerException: SdkError;
51
- constructor(_innerException: SdkError);
16
+ export declare class NotStored extends ResponseBase implements IResponse {
17
+ readonly type: CacheSetIfPresentAndNotEqualResponse.NotStored;
52
18
  }
53
- declare const Error_base: {
54
- new (...args: any[]): {
55
- _innerException: SdkError;
56
- message(): string;
57
- innerException(): SdkError;
58
- errorCode(): import("../../errors").MomentoErrorCode;
59
- toString(): string;
60
- };
61
- } & typeof _Error;
62
19
  /**
63
- * Indicates that an error occurred during the cache setIfPresentAndNotEqual request.
20
+ * Indicates that an error occurred during the setIfPresentAndNotEqual request.
64
21
  *
65
22
  * This response object includes the following fields that you can use to determine
66
23
  * how you would like to handle the error:
@@ -69,6 +26,9 @@ declare const Error_base: {
69
26
  * - `message()` - a human-readable description of the error
70
27
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
71
28
  */
72
- export declare class Error extends Error_base {
29
+ export declare class Error extends BaseResponseError implements IResponse {
30
+ constructor(_innerException: SdkError);
31
+ readonly type: CacheSetIfPresentAndNotEqualResponse.Error;
73
32
  }
33
+ export type Response = Stored | NotStored | Error;
74
34
  export {};
@@ -1,54 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Error = exports.NotStored = exports.Stored = exports.Response = void 0;
3
+ exports.Error = exports.NotStored = exports.Stored = void 0;
4
4
  const response_base_1 = require("./response-base");
5
+ const enums_1 = require("./enums");
5
6
  /**
6
- * Parent response type for a cache setIfPresentAndNotEqual request. The
7
- * response object is resolved to a type-safe object of one of
8
- * the following subtypes:
9
- *
10
- * - {Stored}
11
- * - {NotStored}
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 CacheSetIfPresentAndNotEqual.Error) {
19
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
- * // `CacheSetIfPresentAndNotEqual.Error` in this block, so you will have access to the properties
21
- * // of the Error class; e.g. `response.errorCode()`.
22
- * }
23
- * ```
7
+ * Indicates the new value was set because the key already exists and the existing item was not equal to the supplied `notEqual` value.
24
8
  */
25
- class Response extends response_base_1.ResponseBase {
26
- }
27
- exports.Response = Response;
28
- class _Stored extends Response {
29
- }
30
- /**
31
- * Indicates the key did not exist and the value was set.
32
- */
33
- class Stored extends (0, response_base_1.ResponseSuccess)(_Stored) {
9
+ class Stored extends response_base_1.ResponseBase {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.type = enums_1.CacheSetIfPresentAndNotEqualResponse.Stored;
13
+ }
34
14
  }
35
15
  exports.Stored = Stored;
36
- class _NotStored extends Response {
37
- }
38
16
  /**
39
- * Indicates the key existed and no value was set.
17
+ * Indicates that no value was set because the key did not exist or the existing item was equal to the supplied `notEqual` value.
40
18
  */
41
- class NotStored extends (0, response_base_1.ResponseSuccess)(_NotStored) {
42
- }
43
- exports.NotStored = NotStored;
44
- class _Error extends Response {
45
- constructor(_innerException) {
46
- super();
47
- this._innerException = _innerException;
19
+ class NotStored extends response_base_1.ResponseBase {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.type = enums_1.CacheSetIfPresentAndNotEqualResponse.NotStored;
48
23
  }
49
24
  }
25
+ exports.NotStored = NotStored;
50
26
  /**
51
- * Indicates that an error occurred during the cache setIfPresentAndNotEqual request.
27
+ * Indicates that an error occurred during the setIfPresentAndNotEqual request.
52
28
  *
53
29
  * This response object includes the following fields that you can use to determine
54
30
  * how you would like to handle the error:
@@ -57,7 +33,11 @@ class _Error extends Response {
57
33
  * - `message()` - a human-readable description of the error
58
34
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
59
35
  */
60
- class Error extends (0, response_base_1.ResponseError)(_Error) {
36
+ class Error extends response_base_1.BaseResponseError {
37
+ constructor(_innerException) {
38
+ super(_innerException);
39
+ this.type = enums_1.CacheSetIfPresentAndNotEqualResponse.Error;
40
+ }
61
41
  }
62
42
  exports.Error = Error;
63
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LWlmLXByZXNlbnQtYW5kLW5vdC1lcXVhbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUtc2V0LWlmLXByZXNlbnQtYW5kLW5vdC1lcXVhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFBNkU7QUFFN0U7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FtQkc7QUFDSCxNQUFzQixRQUFTLFNBQVEsNEJBQVk7Q0FBRztBQUF0RCw0QkFBc0Q7QUFFdEQsTUFBTSxPQUFRLFNBQVEsUUFBUTtDQUFHO0FBRWpDOztHQUVHO0FBQ0gs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0aGUgZXJyb3I6XG4gKlxuICogLSBgZXJyb3JDb2RlKClgIC0gYSB1bmlxdWUgTW9tZW50byBlcnJvciBjb2RlIGluZGljYXRpbmcgdGhlIHR5cGUgb2YgZXJyb3IgdGhhdCBvY2N1cnJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIEJhc2VSZXNwb25zZUVycm9yIGltcGxlbWVudHMgSVJlc3BvbnNlIHtcbiAgY29uc3RydWN0b3IoX2lubmVyRXhjZXB0aW9uOiBTZGtFcnJvcikge1xuICAgIHN1cGVyKF9pbm5lckV4Y2VwdGlvbik7XG4gIH1cblxuICByZWFkb25seSB0eXBlOiBDYWNoZVNldElmUHJlc2VudEFuZE5vdEVxdWFsUmVzcG9uc2UuRXJyb3IgPVxuICAgIENhY2hlU2V0SWZQcmVzZW50QW5kTm90RXF1YWxSZXNwb25zZS5FcnJvcjtcbn1cblxuZXhwb3J0IHR5cGUgUmVzcG9uc2UgPSBTdG9yZWQgfCBOb3RTdG9yZWQgfCBFcnJvcjtcbiJdfQ==
@@ -1,66 +1,23 @@
1
1
  import { SdkError } from '../../errors';
2
- import { ResponseBase } from './response-base';
3
- /**
4
- * Parent response type for a cache setIfPresent request. The
5
- * response object is resolved to a type-safe object of one of
6
- * the following subtypes:
7
- *
8
- * - {Stored}
9
- * - {NotStored}
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 CacheSetIfPresent.Error) {
17
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
- * // `CacheSetIfPresent.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 _Stored extends Response {
2
+ import { BaseResponseError, ResponseBase } from './response-base';
3
+ import { CacheSetIfPresentResponse } from './enums';
4
+ interface IResponse {
5
+ readonly type: CacheSetIfPresentResponse;
26
6
  }
27
- declare const Stored_base: {
28
- new (...args: any[]): {
29
- readonly is_success: boolean;
30
- };
31
- } & typeof _Stored;
32
7
  /**
33
- * Indicates the key did not exist and the value was set.
8
+ * Indicates the key already exists and the value was set.
34
9
  */
35
- export declare class Stored extends Stored_base {
10
+ export declare class Stored extends ResponseBase implements IResponse {
11
+ readonly type: CacheSetIfPresentResponse.Stored;
36
12
  }
37
- declare class _NotStored extends Response {
38
- }
39
- declare const NotStored_base: {
40
- new (...args: any[]): {
41
- readonly is_success: boolean;
42
- };
43
- } & typeof _NotStored;
44
13
  /**
45
- * Indicates the key existed and no value was set.
14
+ * Indicates the key did not exist and no value was set.
46
15
  */
47
- export declare class NotStored extends NotStored_base {
48
- }
49
- declare class _Error extends Response {
50
- protected _innerException: SdkError;
51
- constructor(_innerException: SdkError);
16
+ export declare class NotStored extends ResponseBase implements IResponse {
17
+ readonly type: CacheSetIfPresentResponse.NotStored;
52
18
  }
53
- declare const Error_base: {
54
- new (...args: any[]): {
55
- _innerException: SdkError;
56
- message(): string;
57
- innerException(): SdkError;
58
- errorCode(): import("../../errors").MomentoErrorCode;
59
- toString(): string;
60
- };
61
- } & typeof _Error;
62
19
  /**
63
- * Indicates that an error occurred during the cache setIfPresent request.
20
+ * Indicates that an error occurred during the setIfPresent request.
64
21
  *
65
22
  * This response object includes the following fields that you can use to determine
66
23
  * how you would like to handle the error:
@@ -69,6 +26,9 @@ declare const Error_base: {
69
26
  * - `message()` - a human-readable description of the error
70
27
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
71
28
  */
72
- export declare class Error extends Error_base {
29
+ export declare class Error extends BaseResponseError implements IResponse {
30
+ constructor(_innerException: SdkError);
31
+ readonly type: CacheSetIfPresentResponse.Error;
73
32
  }
33
+ export type Response = Stored | NotStored | Error;
74
34
  export {};
@@ -1,54 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Error = exports.NotStored = exports.Stored = exports.Response = void 0;
3
+ exports.Error = exports.NotStored = exports.Stored = void 0;
4
4
  const response_base_1 = require("./response-base");
5
+ const enums_1 = require("./enums");
5
6
  /**
6
- * Parent response type for a cache setIfPresent request. The
7
- * response object is resolved to a type-safe object of one of
8
- * the following subtypes:
9
- *
10
- * - {Stored}
11
- * - {NotStored}
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 CacheSetIfPresent.Error) {
19
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
- * // `CacheSetIfPresent.Error` in this block, so you will have access to the properties
21
- * // of the Error class; e.g. `response.errorCode()`.
22
- * }
23
- * ```
7
+ * Indicates the key already exists and the value was set.
24
8
  */
25
- class Response extends response_base_1.ResponseBase {
26
- }
27
- exports.Response = Response;
28
- class _Stored extends Response {
29
- }
30
- /**
31
- * Indicates the key did not exist and the value was set.
32
- */
33
- class Stored extends (0, response_base_1.ResponseSuccess)(_Stored) {
9
+ class Stored extends response_base_1.ResponseBase {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.type = enums_1.CacheSetIfPresentResponse.Stored;
13
+ }
34
14
  }
35
15
  exports.Stored = Stored;
36
- class _NotStored extends Response {
37
- }
38
16
  /**
39
- * Indicates the key existed and no value was set.
17
+ * Indicates the key did not exist and no value was set.
40
18
  */
41
- class NotStored extends (0, response_base_1.ResponseSuccess)(_NotStored) {
42
- }
43
- exports.NotStored = NotStored;
44
- class _Error extends Response {
45
- constructor(_innerException) {
46
- super();
47
- this._innerException = _innerException;
19
+ class NotStored extends response_base_1.ResponseBase {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.type = enums_1.CacheSetIfPresentResponse.NotStored;
48
23
  }
49
24
  }
25
+ exports.NotStored = NotStored;
50
26
  /**
51
- * Indicates that an error occurred during the cache setIfPresent request.
27
+ * Indicates that an error occurred during the setIfPresent request.
52
28
  *
53
29
  * This response object includes the following fields that you can use to determine
54
30
  * how you would like to handle the error:
@@ -57,7 +33,11 @@ class _Error extends Response {
57
33
  * - `message()` - a human-readable description of the error
58
34
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
59
35
  */
60
- class Error extends (0, response_base_1.ResponseError)(_Error) {
36
+ class Error extends response_base_1.BaseResponseError {
37
+ constructor(_innerException) {
38
+ super(_innerException);
39
+ this.type = enums_1.CacheSetIfPresentResponse.Error;
40
+ }
61
41
  }
62
42
  exports.Error = Error;
63
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LWlmLXByZXNlbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWVzc2FnZXMvcmVzcG9uc2VzL2NhY2hlLXNldC1pZi1wcmVzZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLG1EQUE2RTtBQUU3RTs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW1CRztBQUNILE1BQXNCLFFBQVMsU0FBUSw0QkFBWTtDQUFHO0FBQXRELDRCQUFzRDtBQUV0RCxNQUFNLE9BQVEsU0FBUSxRQUFRO0NBQUc7QUFFakM7O0dBRUc7QUFDSCxNQUFhLE1BQU8sU0FBUSxJQUFBLCtCQUFlLEVBQUMsT0FBTyxDQUFDO0NBQUc7QUFBdkQsd0JBQXVEO0FBRXZELE1BQU0sVUFBVyxTQUFRLFFBQVE7Q0FBRztBQUVwQzs7R0FFRztBQUNILE1BQWEsU0FBVSxTQUFRLElBQUEsK0JBQWUsRUFBQyxVQUFVLENB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c3BvbnNlLkVycm9yID1cbiAgICBDYWNoZVNldElmUHJlc2VudFJlc3BvbnNlLkVycm9yO1xufVxuXG5leHBvcnQgdHlwZSBSZXNwb25zZSA9IFN0b3JlZCB8IE5vdFN0b3JlZCB8IEVycm9yO1xuIl19
@@ -1,51 +1,15 @@
1
1
  import { SdkError } from '../../errors';
2
- import { ResponseBase } from './response-base';
3
- /**
4
- * Parent response type for a set remove element 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 CacheSetRemoveElement.Error) {
16
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
17
- * // `CacheSetRemoveElement.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 {
2
+ import { BaseResponseError, BaseResponseSuccess } from './response-base';
3
+ import { CacheSetRemoveElementResponse } from './enums';
4
+ interface IResponse {
5
+ readonly type: CacheSetRemoveElementResponse;
23
6
  }
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
7
  /**
32
8
  * Indicates a Successful set remove element request.
33
9
  */
34
- export declare class Success extends Success_base {
35
- }
36
- declare class _Error extends Response {
37
- protected _innerException: SdkError;
38
- constructor(_innerException: SdkError);
10
+ export declare class Success extends BaseResponseSuccess implements IResponse {
11
+ readonly type: CacheSetRemoveElementResponse.Success;
39
12
  }
40
- declare const Error_base: {
41
- new (...args: any[]): {
42
- _innerException: SdkError;
43
- message(): string;
44
- innerException(): SdkError;
45
- errorCode(): import("../../errors").MomentoErrorCode;
46
- toString(): string;
47
- };
48
- } & typeof _Error;
49
13
  /**
50
14
  * Indicates that an error occurred during the set remove element request.
51
15
  *
@@ -56,6 +20,9 @@ declare const Error_base: {
56
20
  * - `message()` - a human-readable description of the error
57
21
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
58
22
  */
59
- export declare class Error extends Error_base {
23
+ export declare class Error extends BaseResponseError {
24
+ readonly type: CacheSetRemoveElementResponse.Error;
25
+ constructor(_innerException: SdkError);
60
26
  }
27
+ export type Response = Success | Error;
61
28
  export {};