@gomomento/sdk-core 1.86.0 → 1.88.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 (160) hide show
  1. package/dist/src/auth/credential-provider.d.ts +26 -0
  2. package/dist/src/auth/credential-provider.js +45 -7
  3. package/dist/src/errors/errors.js +1 -1
  4. package/dist/src/index.d.ts +1 -0
  5. package/dist/src/index.js +2 -1
  6. package/dist/src/internal/utils/auth.d.ts +7 -3
  7. package/dist/src/internal/utils/auth.js +19 -7
  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 -51
  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 +18 -54
  15. package/dist/src/messages/responses/cache-dictionary-fetch.js +23 -46
  16. package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +19 -58
  17. package/dist/src/messages/responses/cache-dictionary-get-field.js +19 -52
  18. package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +19 -56
  19. package/dist/src/messages/responses/cache-dictionary-get-fields.js +27 -50
  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 +19 -54
  35. package/dist/src/messages/responses/cache-get.js +22 -45
  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 -46
  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 -59
  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 -53
  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 -63
  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 +10 -43
  93. package/dist/src/messages/responses/cache-set.js +13 -34
  94. package/dist/src/messages/responses/cache-sorted-set-fetch.js +1 -1
  95. package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +6 -1
  96. package/dist/src/messages/responses/cache-sorted-set-get-score.js +1 -1
  97. package/dist/src/messages/responses/cache-sorted-set-get-scores.js +1 -1
  98. package/dist/src/messages/responses/cache-sorted-set-increment-score.js +1 -1
  99. package/dist/src/messages/responses/cache-ttl-decrease.d.ts +19 -53
  100. package/dist/src/messages/responses/cache-ttl-decrease.js +29 -39
  101. package/dist/src/messages/responses/cache-ttl-increase.d.ts +19 -53
  102. package/dist/src/messages/responses/cache-ttl-increase.js +29 -39
  103. package/dist/src/messages/responses/cache-ttl-update.d.ts +15 -55
  104. package/dist/src/messages/responses/cache-ttl-update.js +21 -41
  105. package/dist/src/messages/responses/create-cache.d.ts +15 -58
  106. package/dist/src/messages/responses/create-cache.js +21 -39
  107. package/dist/src/messages/responses/delete-cache.d.ts +11 -44
  108. package/dist/src/messages/responses/delete-cache.js +14 -35
  109. package/dist/src/messages/responses/enums/auth/generate-api-key.d.ts +4 -0
  110. package/dist/src/messages/responses/enums/auth/generate-api-key.js +9 -0
  111. package/dist/src/messages/responses/enums/auth/generate-disposable-token.d.ts +4 -0
  112. package/dist/src/messages/responses/enums/auth/generate-disposable-token.js +9 -0
  113. package/dist/src/messages/responses/enums/auth/index.d.ts +3 -0
  114. package/dist/src/messages/responses/enums/auth/index.js +10 -0
  115. package/dist/src/messages/responses/enums/auth/refresh-api-key.d.ts +4 -0
  116. package/dist/src/messages/responses/enums/auth/refresh-api-key.js +9 -0
  117. package/dist/src/messages/responses/enums/cache/control/index.d.ts +17 -0
  118. package/dist/src/messages/responses/enums/cache/control/index.js +25 -0
  119. package/dist/src/messages/responses/enums/cache/dictionary/index.d.ts +40 -0
  120. package/dist/src/messages/responses/enums/cache/dictionary/index.js +53 -0
  121. package/dist/src/messages/responses/enums/cache/index.d.ts +5 -0
  122. package/dist/src/messages/responses/enums/cache/index.js +22 -0
  123. package/dist/src/messages/responses/enums/cache/list/index.d.ts +44 -0
  124. package/dist/src/messages/responses/enums/cache/list/index.js +58 -0
  125. package/dist/src/messages/responses/enums/cache/scalar/index.d.ts +95 -0
  126. package/dist/src/messages/responses/enums/cache/scalar/index.js +122 -0
  127. package/dist/src/messages/responses/enums/cache/set/index.d.ts +26 -0
  128. package/dist/src/messages/responses/enums/cache/set/index.js +36 -0
  129. package/dist/src/messages/responses/enums/index.d.ts +4 -0
  130. package/dist/src/messages/responses/enums/index.js +21 -0
  131. package/dist/src/messages/responses/enums/leaderboard/index.d.ts +20 -0
  132. package/dist/src/messages/responses/enums/leaderboard/index.js +29 -0
  133. package/dist/src/messages/responses/enums/topics/index.d.ts +8 -0
  134. package/dist/src/messages/responses/enums/topics/index.js +14 -0
  135. package/dist/src/messages/responses/generate-api-key.d.ts +10 -27
  136. package/dist/src/messages/responses/generate-api-key.js +10 -18
  137. package/dist/src/messages/responses/generate-disposable-token.d.ts +10 -27
  138. package/dist/src/messages/responses/generate-disposable-token.js +10 -18
  139. package/dist/src/messages/responses/leaderboard/leaderboard-delete.d.ts +10 -43
  140. package/dist/src/messages/responses/leaderboard/leaderboard-delete.js +13 -34
  141. package/dist/src/messages/responses/leaderboard/leaderboard-fetch.d.ts +12 -45
  142. package/dist/src/messages/responses/leaderboard/leaderboard-fetch.js +11 -35
  143. package/dist/src/messages/responses/leaderboard/leaderboard-length.d.ts +12 -45
  144. package/dist/src/messages/responses/leaderboard/leaderboard-length.js +11 -35
  145. package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.d.ts +10 -43
  146. package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.js +13 -34
  147. package/dist/src/messages/responses/leaderboard/leaderboard-upsert.d.ts +11 -44
  148. package/dist/src/messages/responses/leaderboard/leaderboard-upsert.js +14 -35
  149. package/dist/src/messages/responses/list-caches.d.ts +13 -46
  150. package/dist/src/messages/responses/list-caches.js +11 -35
  151. package/dist/src/messages/responses/refresh-api-key.d.ts +10 -27
  152. package/dist/src/messages/responses/refresh-api-key.js +10 -18
  153. package/dist/src/messages/responses/response-base.d.ts +20 -0
  154. package/dist/src/messages/responses/response-base.js +42 -2
  155. package/dist/src/messages/responses/topic-publish.d.ts +10 -43
  156. package/dist/src/messages/responses/topic-publish.js +13 -34
  157. package/dist/src/messages/responses/topic-subscribe.d.ts +10 -37
  158. package/dist/src/messages/responses/topic-subscribe.js +10 -33
  159. package/dist/src/messages/responses/webhook/put-webhook.d.ts +1 -10
  160. package/package.json +1 -1
@@ -1,51 +1,15 @@
1
1
  import { SdkError } from '../../errors';
2
- import { ResponseBase } from './response-base';
3
- /**
4
- * Parent response type for a list retain 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 CacheListRetain.Error) {
16
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
17
- * // `CacheListRetain.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 { CacheListRetainResponse } from './enums';
4
+ interface IResponse {
5
+ readonly type: CacheListRetainResponse;
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
- * Indicates a Successful list retain request.
8
+ * Indicates a successful list retain 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: CacheListRetainResponse.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 list retain 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 implements IResponse {
24
+ constructor(_innerException: SdkError);
25
+ readonly type: CacheListRetainResponse.Error;
60
26
  }
27
+ export type Response = Success | Error;
61
28
  export {};
@@ -1,43 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Error = exports.Success = exports.Response = void 0;
3
+ exports.Error = exports.Success = 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 list retain 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 CacheListRetain.Error) {
18
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
19
- * // `CacheListRetain.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 list retain request.
7
+ * Indicates a successful list retain request.
31
8
  */
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;
9
+ class Success extends response_base_1.BaseResponseSuccess {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.type = enums_1.CacheListRetainResponse.Success;
39
13
  }
40
14
  }
15
+ exports.Success = Success;
41
16
  /**
42
17
  * Indicates that an error occurred during the list retain request.
43
18
  *
@@ -48,7 +23,11 @@ class _Error extends Response {
48
23
  * - `message()` - a human-readable description of the error
49
24
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
50
25
  */
51
- class Error extends (0, response_base_1.ResponseError)(_Error) {
26
+ class Error extends response_base_1.BaseResponseError {
27
+ constructor(_innerException) {
28
+ super(_innerException);
29
+ this.type = enums_1.CacheListRetainResponse.Error;
30
+ }
52
31
  }
53
32
  exports.Error = Error;
54
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtbGlzdC1yZXRhaW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWVzc2FnZXMvcmVzcG9uc2VzL2NhY2hlLWxpc3QtcmV0YWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLG1EQUE2RTtBQUU3RTs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBa0JHO0FBQ0gsTUFBc0IsUUFBUyxTQUFRLDRCQUFZO0NBQUc7QUFBdEQsNEJBQXNEO0FBRXRELE1BQU0sUUFBUyxTQUFRLFFBQVE7Q0FBRztBQUVsQzs7R0FFRztBQUNILE1BQWEsT0FBUSxTQUFRLElBQUEsK0JBQWUsRUFBQyxRQUFRLENBQUM7Q0FBRztBQUF6RCwwQkFBeUQ7QUFFekQsTUFBTSxNQUFPLFNBQVEsUUFBUTtJQUMzQixZQUFzQixlQUF5QjtRQUM3QyxLQUFLLEVBQUUsQ0FBQztRQURZLG9CQUFlLE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IgaW1wbGVtZW50cyBJUmVzcG9uc2Uge1xuICBjb25zdHJ1Y3RvcihfaW5uZXJFeGNlcHRpb246IFNka0Vycm9yKSB7XG4gICAgc3VwZXIoX2lubmVyRXhjZXB0aW9uKTtcbiAgfVxuXG4gIHJlYWRvbmx5IHR5cGU6IENhY2hlTGlzdFJldGFpblJlc3BvbnNlLkVycm9yID0gQ2FjaGVMaXN0UmV0YWluUmVzcG9uc2UuRXJyb3I7XG59XG5cbmV4cG9ydCB0eXBlIFJlc3BvbnNlID0gU3VjY2VzcyB8IEVycm9yO1xuIl19
@@ -1,61 +1,15 @@
1
1
  import { SdkError } from '../../errors';
2
- import { ResponseBase } from './response-base';
3
- /**
4
- * Parent response type for a set add 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 CacheSetAddElement.Error) {
16
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
17
- * // `CacheSetAddElement.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 { CacheSetAddElementResponse } from './enums';
4
+ interface IResponse {
5
+ readonly type: CacheSetAddElementResponse;
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 add 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: CacheSetAddElementResponse.Success;
39
12
  }
40
- declare const Error_base: {
41
- new (...args: any[]): {
42
- _innerException: SdkError;
43
- message(): string;
44
- /**
45
- * Indicates that an error occurred during the set add element request.
46
- *
47
- * This response object includes the following fields that you can use to determine
48
- * how you would like to handle the error:
49
- *
50
- * - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
51
- * - `message()` - a human-readable description of the error
52
- * - `innerException()` - the original error that caused the failure; can be re-thrown.
53
- */
54
- innerException(): SdkError;
55
- errorCode(): import("../../errors").MomentoErrorCode;
56
- toString(): string;
57
- };
58
- } & typeof _Error;
59
13
  /**
60
14
  * Indicates that an error occurred during the set add element request.
61
15
  *
@@ -66,6 +20,9 @@ declare const Error_base: {
66
20
  * - `message()` - a human-readable description of the error
67
21
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
68
22
  */
69
- export declare class Error extends Error_base {
23
+ export declare class Error extends BaseResponseError implements IResponse {
24
+ readonly type: CacheSetAddElementResponse.Error;
25
+ constructor(_innerException: SdkError);
70
26
  }
27
+ export type Response = Success | Error;
71
28
  export {};
@@ -1,43 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Error = exports.Success = exports.Response = void 0;
3
+ exports.Error = exports.Success = void 0;
4
4
  const response_base_1 = require("./response-base");
5
- /**
6
- * Parent response type for a set add element 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 CacheSetAddElement.Error) {
18
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
19
- * // `CacheSetAddElement.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
- }
5
+ const enums_1 = require("./enums");
29
6
  /**
30
7
  * Indicates a Successful set add element request.
31
8
  */
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;
9
+ class Success extends response_base_1.BaseResponseSuccess {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.type = enums_1.CacheSetAddElementResponse.Success;
39
13
  }
40
14
  }
15
+ exports.Success = Success;
41
16
  /**
42
17
  * Indicates that an error occurred during the set add element request.
43
18
  *
@@ -48,7 +23,11 @@ class _Error extends Response {
48
23
  * - `message()` - a human-readable description of the error
49
24
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
50
25
  */
51
- class Error extends (0, response_base_1.ResponseError)(_Error) {
26
+ class Error extends response_base_1.BaseResponseError {
27
+ constructor(_innerException) {
28
+ super(_innerException);
29
+ this.type = enums_1.CacheSetAddElementResponse.Error;
30
+ }
52
31
  }
53
32
  exports.Error = Error;
54
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LWFkZC1lbGVtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS1zZXQtYWRkLWVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBQTZFO0FBRTdFOzs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FrQkc7QUFDSCxNQUFzQixRQUFTLFNBQVEsNEJBQVk7Q0FBRztBQUF0RCw0QkFBc0Q7QUFFdEQsTUFBTSxRQUFTLFNBQVEsUUFBUTtDQUFHO0FBRWxDOztHQUVHO0FBQ0gsTUFBYSxPQUFRLFNBQVEsSUFBQSwrQkFBZSxFQUFDLFFBQVEsQ0FBQztDQUFHO0FBQXpELDBCQUF5RDtBQUV6RCxNQUFNLE1BQU8sU0FBUSxRQUFRO0lBQzNCLFlBQXNCLGVBQXlCO1FBQzdDLE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HVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgQmFzZVJlc3BvbnNlRXJyb3IgaW1wbGVtZW50cyBJUmVzcG9uc2Uge1xuICByZWFkb25seSB0eXBlOiBDYWNoZVNldEFkZEVsZW1lbnRSZXNwb25zZS5FcnJvciA9XG4gICAgQ2FjaGVTZXRBZGRFbGVtZW50UmVzcG9uc2UuRXJyb3I7XG4gIGNvbnN0cnVjdG9yKF9pbm5lckV4Y2VwdGlvbjogU2RrRXJyb3IpIHtcbiAgICBzdXBlcihfaW5uZXJFeGNlcHRpb24pO1xuICB9XG59XG5cbmV4cG9ydCB0eXBlIFJlc3BvbnNlID0gU3VjY2VzcyB8IEVycm9yO1xuIl19
@@ -1,55 +1,18 @@
1
- import { ResponseBase } from './response-base';
1
+ import { BaseResponseError, BaseResponseSuccess } from './response-base';
2
2
  import { SdkError } from '../../errors';
3
3
  import * as CacheSetAddElement from './cache-set-add-element';
4
- /**
5
- * Parent response type for a set add elements request. The
6
- * response object is resolved to a type-safe object of one of
7
- * the following subtypes:
8
- *
9
- * - {Success}
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 CacheSetAddElements.Error) {
17
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
- * // `CacheSetAddElements.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
- abstract toSingularResponse(): CacheSetAddElement.Response;
25
- }
26
- declare class _Success extends Response {
4
+ import { CacheSetAddElementsResponse } from './enums';
5
+ interface IResponse {
6
+ readonly type: CacheSetAddElementsResponse;
27
7
  toSingularResponse(): CacheSetAddElement.Response;
28
8
  }
29
- declare const Success_base: {
30
- new (...args: any[]): {
31
- readonly is_success: boolean;
32
- };
33
- } & typeof _Success;
34
9
  /**
35
10
  * Indicates a Successful set add elements request.
36
11
  */
37
- export declare class Success extends Success_base {
12
+ export declare class Success extends BaseResponseSuccess implements IResponse {
13
+ readonly type: CacheSetAddElementsResponse.Success;
14
+ toSingularResponse(): CacheSetAddElement.Success;
38
15
  }
39
- declare class _Error extends Response {
40
- _innerException: SdkError;
41
- constructor(_innerException: SdkError);
42
- toSingularResponse(): CacheSetAddElement.Response;
43
- }
44
- declare const Error_base: {
45
- new (...args: any[]): {
46
- _innerException: SdkError;
47
- message(): string;
48
- innerException(): SdkError;
49
- errorCode(): import("../../errors").MomentoErrorCode;
50
- toString(): string;
51
- };
52
- } & typeof _Error;
53
16
  /**
54
17
  * Indicates that an error occurred during the set add elements request.
55
18
  *
@@ -60,6 +23,10 @@ declare const Error_base: {
60
23
  * - `message()` - a human-readable description of the error
61
24
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
62
25
  */
63
- export declare class Error extends Error_base {
26
+ export declare class Error extends BaseResponseError implements IResponse {
27
+ readonly type: CacheSetAddElementsResponse.Error;
28
+ constructor(_innerException: SdkError);
29
+ toSingularResponse(): CacheSetAddElement.Error;
64
30
  }
31
+ export type Response = Success | Error;
65
32
  export {};
@@ -1,50 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Error = exports.Success = exports.Response = void 0;
3
+ exports.Error = exports.Success = void 0;
4
4
  const response_base_1 = require("./response-base");
5
5
  const CacheSetAddElement = require("./cache-set-add-element");
6
- /**
7
- * Parent response type for a set add elements request. The
8
- * response object is resolved to a type-safe object of one of
9
- * the following subtypes:
10
- *
11
- * - {Success}
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 CacheSetAddElements.Error) {
19
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
20
- * // `CacheSetAddElements.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 _Success extends Response {
29
- toSingularResponse() {
30
- return new CacheSetAddElement.Success();
31
- }
32
- }
6
+ const enums_1 = require("./enums");
33
7
  /**
34
8
  * Indicates a Successful set add elements request.
35
9
  */
36
- class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
37
- }
38
- exports.Success = Success;
39
- class _Error extends Response {
40
- constructor(_innerException) {
41
- super();
42
- this._innerException = _innerException;
10
+ class Success extends response_base_1.BaseResponseSuccess {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.type = enums_1.CacheSetAddElementsResponse.Success;
43
14
  }
44
15
  toSingularResponse() {
45
- return new CacheSetAddElement.Error(this._innerException);
16
+ return new CacheSetAddElement.Success();
46
17
  }
47
18
  }
19
+ exports.Success = Success;
48
20
  /**
49
21
  * Indicates that an error occurred during the set add elements request.
50
22
  *
@@ -55,7 +27,14 @@ class _Error extends Response {
55
27
  * - `message()` - a human-readable description of the error
56
28
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
57
29
  */
58
- class Error extends (0, response_base_1.ResponseError)(_Error) {
30
+ class Error extends response_base_1.BaseResponseError {
31
+ constructor(_innerException) {
32
+ super(_innerException);
33
+ this.type = enums_1.CacheSetAddElementsResponse.Error;
34
+ }
35
+ toSingularResponse() {
36
+ return new CacheSetAddElement.Error(this._innerException);
37
+ }
59
38
  }
60
39
  exports.Error = Error;
61
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LWFkZC1lbGVtZW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUtc2V0LWFkZC1lbGVtZW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtREFBNkU7QUFFN0UsOERBQThEO0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1,17 @@
1
- import { ResponseBase } from './response-base';
1
+ import { ResponseBase, BaseResponseMiss, BaseResponseError } from './response-base';
2
2
  import { SdkError } from '../../errors';
3
- /**
4
- * Parent response type for a set fetch 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 CacheSetFetch.Error) {
17
- * // Handle error as appropriate. The compiler will smart-cast `response` to type
18
- * // `CacheSetFetch.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 {
3
+ import { CacheSetFetchResponse } from './enums';
4
+ interface IResponse {
24
5
  value(): string[] | undefined;
6
+ readonly type: CacheSetFetchResponse;
25
7
  }
26
- declare class _Hit extends Response {
8
+ /**
9
+ * Indicates that the requested data was successfully retrieved from the cache. Provides
10
+ * `value*` accessors to retrieve the data in the appropriate format.
11
+ */
12
+ export declare class Hit extends ResponseBase implements IResponse {
27
13
  private readonly elements;
14
+ readonly type: CacheSetFetchResponse.Hit;
28
15
  constructor(elements: Uint8Array[]);
29
16
  /**
30
17
  * Returns the data as a Set whose values are utf-8 strings, decoded from the underlying byte arrays. This
@@ -70,40 +57,13 @@ declare class _Hit extends Response {
70
57
  valueArrayUint8Array(): Uint8Array[];
71
58
  toString(): string;
72
59
  }
73
- declare const Hit_base: {
74
- new (...args: any[]): {};
75
- } & typeof _Hit;
76
- /**
77
- * Indicates that the requested data was successfully retrieved from the cache. Provides
78
- * `value*` accessors to retrieve the data in the appropriate format.
79
- */
80
- export declare class Hit extends Hit_base {
81
- }
82
- declare class _Miss extends Response {
83
- }
84
- declare const Miss_base: {
85
- new (...args: any[]): {
86
- readonly is_miss: boolean;
87
- };
88
- } & typeof _Miss;
89
60
  /**
90
61
  * Indicates that the requested data was not available in the cache.
91
62
  */
92
- export declare class Miss extends Miss_base {
93
- }
94
- declare class _Error extends Response {
95
- _innerException: SdkError;
96
- constructor(_innerException: SdkError);
63
+ export declare class Miss extends BaseResponseMiss {
64
+ readonly type: CacheSetFetchResponse.Miss;
65
+ value(): undefined;
97
66
  }
98
- declare const Error_base: {
99
- new (...args: any[]): {
100
- _innerException: SdkError;
101
- message(): string;
102
- innerException(): SdkError;
103
- errorCode(): import("../../errors").MomentoErrorCode;
104
- toString(): string;
105
- };
106
- } & typeof _Error;
107
67
  /**
108
68
  * Indicates that an error occurred during the set fetch request.
109
69
  *
@@ -114,6 +74,10 @@ declare const Error_base: {
114
74
  * - `message()` - a human-readable description of the error
115
75
  * - `innerException()` - the original error that caused the failure; can be re-thrown.
116
76
  */
117
- export declare class Error extends Error_base {
77
+ export declare class Error extends BaseResponseError implements IResponse {
78
+ constructor(_innerException: SdkError);
79
+ readonly type: CacheSetFetchResponse.Error;
80
+ value(): undefined;
118
81
  }
82
+ export type Response = Hit | Miss | Error;
119
83
  export {};